Skip to content

Commit

Permalink
Start to replace node16 with node20
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Aug 15, 2023
1 parent f10b2ac commit c732cb3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 26 deletions.
9 changes: 0 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,3 @@ esbuild app.jsx --bundle --platform=node --packages=external
If you do this, your dependencies must still be present on the file system at run-time since they are no longer included in the bundle.
```

## Why using nodejs16 instead of deno/bun/nodejs18?

They are not yet supported in JavaScript action engine.

- https://github.com/actions/runner/blob/5421fe3f7107f770c904ed4c7e506ae7a5cde2c2/src/Runner.Worker/ActionManifestManager.cs#L492
- https://github.com/kachick/wait-other-jobs/pull/273#issuecomment-1306058624

After bumped to nodejs18, I'd like to replace jest with [built-in test runner](https://github.com/nodejs/node/pull/42325).
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ inputs:
required: false
default: 'false'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
12 changes: 2 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,13 @@
flake-utils.lib.eachDefaultSystem (system:
let
# https://discourse.nixos.org/t/mark-a-devshell-dependency-as-insecure/24354/3
pkgs = import nixpkgs
{
inherit system;
config = {
permittedInsecurePackages = [
"nodejs-16.20.1"
];
};
};
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = with pkgs;
mkShell {
buildInputs = [
nodejs-16_x
nodejs_20
deno
dprint
cargo-make
Expand Down
2 changes: 1 addition & 1 deletion jest.post.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config: Config.InitialOptions = {
'^.+\\.(t|j)sx?$': [
'esbuild-jest-transform',
{
'target': 'node16',
'target': 'node20',
'packages': 'external',
},
],
Expand Down
2 changes: 1 addition & 1 deletion jest.pre.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const config: Config = {
'^.+\\.(t|j)sx?$': [
'esbuild-jest-transform',
{
'target': 'node16',
'target': 'node20',
'packages': 'external',
},
],
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"description": "",
"main": "lib/main.js",
"engines": {
"node": "16.x"
"node": "20.x"
},
"scripts": {
"prepackage": "tsx scripts/rmrf.ts lib dist",
"package": "esbuild src/main.ts --bundle --platform=node --target=node16 --packages=external --outfile=lib/main.js && ncc build",
"package": "esbuild src/main.ts --bundle --platform=node --target=node20 --packages=external --outfile=lib/main.js && ncc build",
"postpackage": "tsx scripts/rmrf.ts lib",
"test:ts": "jest --config jest.pre.config.ts",
"pretest:js": "npm run package",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": "./tsconfig.base.json",
"compilerOptions": {
// https://www.typescriptlang.org/docs/handbook/esm-node.html
"module": "node16",
"module": "NodeNext",
"noEmit": true,
"noUnusedLocals": false
},
Expand Down

0 comments on commit c732cb3

Please sign in to comment.