Skip to content

Commit

Permalink
Simply replaced to node20
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Oct 5, 2023
1 parent cd91829 commit 1b86dd6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: npm
- name: install dependencies
run: npm ci --ignore-scripts
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: npm
- name: install dependencies
run: npm ci --ignore-scripts
Expand All @@ -68,7 +68,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: npm
- name: install dependencies
run: npm ci --ignore-scripts
Expand Down
9 changes: 0 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,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 @@ -18,5 +18,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 @@ -13,15 +13,7 @@
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.2"
];
};
};
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = with pkgs;
Expand All @@ -31,7 +23,7 @@
# https://github.com/kachick/dotfiles/pull/228
bashInteractive

nodejs_16
nodejs_20
dprint
cargo-make
nil
Expand Down
2 changes: 1 addition & 1 deletion jest.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.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "lib/main.js",
"engines": {
"node": "16.x"
"node": "20.x"
},
"scripts": {
"prepackage": "tsx scripts/rmrf.ts lib dist",
Expand Down
14 changes: 8 additions & 6 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
// Import from https://github.com/tsconfig/bases/commit/0ae4791797d8ba3dd2bca9aca880eb2d3e30e6fb
// To avoid issues around tsconfig.extends array
// Import from tsconfig/bases
// - https://github.com/tsconfig/bases/blob/5ee68ffc8325546335649525a3553067d2d27830/bases/node20.json
// - https://github.com/tsconfig/bases/blob/5ee68ffc8325546335649525a3553067d2d27830/bases/strictest.json
// Inlined to avoid problems around tsconfig.extends array
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node 16 + Strictest",
"display": "Node 20 + Strictest",
"compilerOptions": {
"lib": [
"es2021"
"es2023"
],
"module": "commonjs",
"target": "es2021",
"module": "node16",
"target": "es2022",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// TODO: Use tsconfig/base after all tools support tsconfig.extends array
"extends": "./tsconfig.base.json",
"compilerOptions": {
// https://www.typescriptlang.org/docs/handbook/esm-node.html
"module": "node16",
"noEmit": true,
"noUnusedLocals": false
},
Expand Down

0 comments on commit 1b86dd6

Please sign in to comment.