Skip to content

Commit

Permalink
fixup! feat(semver-major): upgrade package to Node.js v23
Browse files Browse the repository at this point in the history
  • Loading branch information
avivkeller committed Oct 27, 2024
1 parent 5552ddd commit 9b3e6e1
Show file tree
Hide file tree
Showing 53 changed files with 83 additions and 957 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ jobs:
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: test
npm-publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
test
.github
.github
3 changes: 0 additions & 3 deletions .release-please-manifest.json

This file was deleted.

46 changes: 24 additions & 22 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
# Maintenance Guide for the Package
# Package Maintenance Guide

This guide outlines the procedures necessary for maintaining this package, ensuring its functionality and compatibility with newer versions of Node.js. The goal is to streamline the maintenance process until a majority of users can transition to the latest versions, paving the way for eventual deprecation of this library.
This guide provides a step-by-step approach to maintaining the package, ensuring its ongoing functionality and compatibility with newer Node.js versions. The aim is to simplify maintenance until the majority of users have transitioned to newer versions, ultimately leading to the package's deprecation.

## Overview

Maintaining this library involves updating specific internal files and ensuring that all references are correctly modified. The steps below provide a clear pathway for effective package maintenance.
Maintaining this package involves updating specific internal files and adjusting references as needed. The steps below outline a structured process to ensure effective and consistent maintenance.

## Maintenance Steps
## Steps for Maintenance

### 1. Identify Files for Update
Start by identifying the internal files that require updates. These files are typically located in the `lib/internal/` directory. For example, `lib/internal/test_runner/runner.js` is one file that may need attention.
### Identify Files to Update
Begin by locating the internal files that need updating. These files are generally found in the `lib/internal/test_runner` directory. For example, `lib/internal/test_runner/runner.js` is a file that might require changes.

### 2. Update File Contents
- Replace the entire contents of the identified file with the updated version from your reference source. Ensure you use the correct version that corresponds to the changes made in Node.js internals.
### Update the File Contents
- Replace the content of the identified file with the updated version from the appropriate reference source, ensuring you use the version that reflects recent changes in Node.js internals.

### 3. Modify Require Statements
- After replacing the file contents, locate all instances of the following pattern in the file:
- There may be cases where a slight modification of the file may be needed in order for it to work with this polyfill. Ideally, only the minimal amount should be modified, to make future updating as easy as possible. If contents *must* be altered, leave a comment `/* NOTE(Author): ... */` explaining the change.

### Update `require` Statements
- Once the file content is updated, search for any occurrences of:
```javascript
require('internal/...');
require('internal/...');
```
- Update these instances to the new syntax:
- Replace these instances with the updated syntax:
```javascript
require('#internal/...');
require('#internal/...');
```

### 4. Add Necessary Imports
- If the updated file requires specific bindings, include the following line at the top of the file:
### Add Required Imports
- If the updated file needs specific bindings, add the following line at the top:
```javascript
const { primordials, internalBinding } = require('#lib/bootstrap');
```

### 5. Follow Special Comments
- Pay close attention to any comments formatted as `/* NOTE(Author): ... */` within the files. These notes may contain essential guidelines or considerations regarding the code. Adhere to any instructions provided in these comments during the update process.
### Follow Special Comments
- Pay attention to any comments in the format `/* NOTE(Author): ... */` within the code. These may provide important instructions or considerations. Make sure to follow any guidelines specified in these comments.

### 6. Implement Polyfills as Needed
- When updating the library, you may encounter new features that require polyfilling if they are not present in the library. Add the minimal amount of code necessary for functionality. For instance, in `lib/internal/options`, only implement parsing for the options that are actually needed.
### Implement Polyfills if Necessary
- If new features require polyfills that are not already available, implement only the minimal code needed for functionality. For example, in `lib/internal/options`, add parsing for the required options only.

## Final Steps

- After completing the updates, conduct thorough testing of the package to ensure all functionality works as expected with the new changes.
- Document any significant modifications made during the update process to maintain a clear history for future reference.
- After making the updates, thoroughly test the package to ensure it functions correctly with the changes.
- Document any significant updates to maintain a clear record for future maintenance.

If you have any questions about this document, it was written by @RedYetiDev.
For any questions about this guide, please refer to @RedYetiDev.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ This package is a user-land implementation of [`node:test`](https://nodejs.org/a
- Does not support module mocking.
- No inherent file watching capabilities.
- No built-in coverage support.
- Cannot import external scripts into `run()`-called test files.
- Cannot import external scripts into `run()`-called test files.

For the API reference, see [API.md](API.md).
2 changes: 1 addition & 1 deletion lib/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ module.exports = {
default: throw name
}
}
};
};
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ run(options).on('test:summary', (data) => {
if (!data.success) {
process.exitCode = 1;
}
});
});
2 changes: 1 addition & 1 deletion lib/internal/abort_controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
AbortController
}
}
2 changes: 1 addition & 1 deletion lib/internal/assert/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ function innerOk(_caller, _length, ...args) {

module.exports = {
innerOk
}
}
2 changes: 1 addition & 1 deletion lib/internal/console/global.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = console;
module.exports = console;
2 changes: 1 addition & 1 deletion lib/internal/deps/minimatch/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('minimatch');
module.exports = require('minimatch');
2 changes: 1 addition & 1 deletion lib/internal/error_serdes.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ function deserializeError(error) {
require('assert').fail('This should not happen');
}

module.exports = { serializeError, deserializeError };
module.exports = { serializeError, deserializeError };
2 changes: 1 addition & 1 deletion lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,4 @@ registerError('ERR_OUT_OF_RANGE',
return `${msg} It must be ${range}. Received ${received}`;
}, RangeError);

registerError('UNSUPPORTED_FEATURE', '%s is not supported by this polyfill. Please upgrade to the latest version of Node.js to make use of this feature', Error);
registerError('UNSUPPORTED_FEATURE', '%s is not supported by this polyfill. Please upgrade to the latest version of Node.js to make use of this feature', Error);
2 changes: 1 addition & 1 deletion lib/internal/event_target.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ const kResistStopPropagation = Symbol('kResistStopPropagation');

module.exports = {
kResistStopPropagation
}
}
2 changes: 1 addition & 1 deletion lib/internal/events/abort_listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ const { EventEmitter } = require('node:events');

module.exports = {
addAbortListener: EventEmitter.addAbortListener
}
}
2 changes: 1 addition & 1 deletion lib/internal/fs/glob.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,4 +655,4 @@ class Glob {
module.exports = {
__proto__: null,
Glob,
};
};
2 changes: 1 addition & 1 deletion lib/internal/fs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ for (const name of Reflect.ownKeys(Dirent.prototype)) {
};
}

module.exports = { DirentFromStats }
module.exports = { DirentFromStats }
2 changes: 1 addition & 1 deletion lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
Module: module.constructor
}
}
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ module.exports = {
getOrInitializeCascadedLoader() {
return cascadedLoader
}
}
}
2 changes: 1 addition & 1 deletion lib/internal/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ module.exports = {
// Useful for determining file arguments
notParsedAsOptions,
parsedAsOptions
};
};
2 changes: 1 addition & 1 deletion lib/internal/priority_queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ module.exports = class PriorityQueue {

return value;
}
};
};
2 changes: 1 addition & 1 deletion lib/internal/process/task_queues.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
queueMicrotask,
}
}
2 changes: 1 addition & 1 deletion lib/internal/readline/interface.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Interface } = require('node:readline');
module.exports = {
Interface
};
};
2 changes: 1 addition & 1 deletion lib/internal/source_map/source_map_cache.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const { codes: { ERR_UNSUPPORTED_FEATURE } } = require('#internal/errors');
throw new ERR_UNSUPPORTED_FEATURE('Sourcemap caching')
throw new ERR_UNSUPPORTED_FEATURE('Sourcemap caching')
2 changes: 1 addition & 1 deletion lib/internal/streams/end-of-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,4 @@ function finished(stream, opts) {
}

module.exports = eos;
module.exports.finished = finished;
module.exports.finished = finished;
2 changes: 1 addition & 1 deletion lib/internal/streams/transform.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('node:stream').Transform;
module.exports = require('node:stream').Transform;
2 changes: 1 addition & 1 deletion lib/internal/streams/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,4 @@ module.exports = {
kCloseEmitted,
kErrored,
kConstructed,
};
};
Loading

0 comments on commit 9b3e6e1

Please sign in to comment.