From 7e7d55ad72217fd61e3b5262d8f93a9151cf1970 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 23 Jul 2023 14:42:45 +0900 Subject: [PATCH 1/7] `npm uninstall @types/node && npm install --save-dev @types/node@20.4.4` --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index e53866d9..6390cc07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "@tsconfig/node18": "^18.2.0", "@tsconfig/strictest": "^2.0.1", - "@types/node": "^18.17.0", + "@types/node": "^20.4.4", "@typescript-eslint/eslint-plugin": "^6.1.0", "@typescript-eslint/parser": "^6.1.0", "eslint": "^8.45.0", @@ -3559,9 +3559,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.17.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.0.tgz", - "integrity": "sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==", + "version": "20.4.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.4.tgz", + "integrity": "sha512-CukZhumInROvLq3+b5gLev+vgpsIqC2D0deQr/yS1WnxvmYLlJXZpaQrQiseMY+6xusl79E04UjWoqyr+t1/Ew==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -12848,9 +12848,9 @@ "dev": true }, "@types/node": { - "version": "18.17.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.0.tgz", - "integrity": "sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==", + "version": "20.4.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.4.tgz", + "integrity": "sha512-CukZhumInROvLq3+b5gLev+vgpsIqC2D0deQr/yS1WnxvmYLlJXZpaQrQiseMY+6xusl79E04UjWoqyr+t1/Ew==", "dev": true }, "@types/normalize-package-data": { diff --git a/package.json b/package.json index 6d65c714..60051fb8 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "devDependencies": { "@tsconfig/node18": "^18.2.0", "@tsconfig/strictest": "^2.0.1", - "@types/node": "^18.17.0", + "@types/node": "^20.4.4", "@typescript-eslint/eslint-plugin": "^6.1.0", "@typescript-eslint/parser": "^6.1.0", "eslint": "^8.45.0", From 2e4b60ff4573828c04613a89ef776758d3823fa5 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 23 Jul 2023 14:43:44 +0900 Subject: [PATCH 2/7] Bump nodejs to 20.x --- .node-version | 2 +- CONTRIBUTING.md | 2 +- default.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.node-version b/.node-version index 3876fd49..bd45cd74 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18.16.1 +20.4.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d774e293..a9136cab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,7 +84,7 @@ Actual behavior checking requires that includ ```console $ npm install $ npx tsx -Welcome to Node.js v18.16.1. +Welcome to Node.js v20.4.0. Type ".help" for more information. ``` diff --git a/default.nix b/default.nix index 6525f46f..c1b16613 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,7 @@ pkgs.mkShell { buildInputs = [ - pkgs.nodejs-18_x + pkgs.nodejs_20 pkgs.dprint pkgs.nil pkgs.nixpkgs-fmt From ec2668df82716117370cc0abae2ebbe517abf7a8 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 23 Jul 2023 14:44:38 +0900 Subject: [PATCH 3/7] `pm uninstall @tsconfig/node18 && npm install --save-dev @tsconfig/node20` --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6390cc07..60e8f9f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "devDependencies": { - "@tsconfig/node18": "^18.2.0", + "@tsconfig/node20": "^20.1.0", "@tsconfig/strictest": "^2.0.1", "@types/node": "^20.4.4", "@typescript-eslint/eslint-plugin": "^6.1.0", @@ -3471,10 +3471,10 @@ "node": ">= 10" } }, - "node_modules/@tsconfig/node18": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.0.tgz", - "integrity": "sha512-yhxwIlFVSVcMym3O31HoMnRXpoenmpIxcj4Yoes2DUpe+xCJnA7ECQP1Vw889V0jTt/2nzvpLQ/UuMYCd3JPIg==", + "node_modules/@tsconfig/node20": { + "version": "20.1.0", + "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.0.tgz", + "integrity": "sha512-7Yz1xDv3sot8+NwiYA8wkx60qr3Tr+soJwlqVQSkiEqqgYoNmMmqSPiYs1vMmTxneB3igHAD11dGOR2+BShzTA==", "dev": true }, "node_modules/@tsconfig/strictest": { @@ -12760,10 +12760,10 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, - "@tsconfig/node18": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.0.tgz", - "integrity": "sha512-yhxwIlFVSVcMym3O31HoMnRXpoenmpIxcj4Yoes2DUpe+xCJnA7ECQP1Vw889V0jTt/2nzvpLQ/UuMYCd3JPIg==", + "@tsconfig/node20": { + "version": "20.1.0", + "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.0.tgz", + "integrity": "sha512-7Yz1xDv3sot8+NwiYA8wkx60qr3Tr+soJwlqVQSkiEqqgYoNmMmqSPiYs1vMmTxneB3igHAD11dGOR2+BShzTA==", "dev": true }, "@tsconfig/strictest": { diff --git a/package.json b/package.json index 60051fb8..90b25b3d 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "test": "glob -c \"node --loader tsx --no-warnings --test\" \"./test/**/*_test.ts\"" }, "devDependencies": { - "@tsconfig/node18": "^18.2.0", + "@tsconfig/node20": "^20.1.0", "@tsconfig/strictest": "^2.0.1", "@types/node": "^20.4.4", "@typescript-eslint/eslint-plugin": "^6.1.0", From f6d08991f73c9c467cc764f390064682f3f0d7fa Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 23 Jul 2023 14:44:53 +0900 Subject: [PATCH 4/7] Update tsconfig --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 17fd93de..ad5e64b0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"], + "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node20/tsconfig"], "compilerOptions": { "noEmit": true }, From f4081c7b13987f4701525a43f3fff8fcc6ebc2b2 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 23 Jul 2023 14:47:30 +0900 Subject: [PATCH 5/7] Update renovate config too --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 7a027266..a11fe2b8 100644 --- a/renovate.json +++ b/renovate.json @@ -13,7 +13,7 @@ }, { "matchPackageNames": ["nodejs/node"], - "allowedVersions": "/^v?18\\./" + "allowedVersions": "/^v?20\\./" }, { "extends": ["schedule:weekly"], From 705cad8d0b4f0ec5a527353f1f398bf50ac29064 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 23 Jul 2023 14:47:55 +0900 Subject: [PATCH 6/7] Need to specify module type since nodejs 20? --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 90b25b3d..69d5ade6 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "type": "module", "scripts": { "test": "glob -c \"node --loader tsx --no-warnings --test\" \"./test/**/*_test.ts\"" }, From 4be6a9d803eaf548ebf39c889a59056d87ddda4c Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 23 Jul 2023 14:55:41 +0900 Subject: [PATCH 7/7] Enable allowImportingTsExtensions to suppress tsc error --- test/regex_test.ts | 2 +- tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/regex_test.ts b/test/regex_test.ts index 6271c046..65d5c53d 100644 --- a/test/regex_test.ts +++ b/test/regex_test.ts @@ -8,7 +8,7 @@ import path from 'path'; import RE2 from 're2'; import JSON5 from 'json5'; -import { examples } from './examples'; +import { examples } from './examples.ts'; // Copied from https://github.com/renovatebot/renovate/blob/0296e58e19844b6eb3583ee3197bcae42e25d9f7/lib/config/types.ts#L169-L185 // Because they does not expose these types via npm, AFAIK diff --git a/tsconfig.json b/tsconfig.json index ad5e64b0..b33aec6a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node20/tsconfig"], "compilerOptions": { - "noEmit": true + "noEmit": true, + "allowImportingTsExtensions": true }, "include": ["**/*.ts"] }