From aa9d4c5a19836f5e489f284ba69322ce48ae4e8b Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 27 Mar 2023 20:29:03 +0900 Subject: [PATCH 01/15] `npm uninstall @tsconfig/node16-strictest-esm` --- package-lock.json | 13 ------------- package.json | 1 - 2 files changed, 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1050bf2..fecc48a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ }, "devDependencies": { "@octokit/types": "^9.0.0", - "@tsconfig/node16-strictest-esm": "^1.0.3", "@types/node": "^16.18.19", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", @@ -1863,12 +1862,6 @@ "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", "dev": true }, - "node_modules/@tsconfig/node16-strictest-esm": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16-strictest-esm/-/node16-strictest-esm-1.0.3.tgz", - "integrity": "sha512-0/QTPDkKmE2dy0dMRstPCv4VJ+gUGgvMKzaWd5P3hgdlmPqYqe1pJxDGUlNYbSgUBlncIvvX+mIeZarokysNgg==", - "dev": true - }, "node_modules/@types/babel__core": { "version": "7.20.0", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", @@ -7274,12 +7267,6 @@ "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", "dev": true }, - "@tsconfig/node16-strictest-esm": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16-strictest-esm/-/node16-strictest-esm-1.0.3.tgz", - "integrity": "sha512-0/QTPDkKmE2dy0dMRstPCv4VJ+gUGgvMKzaWd5P3hgdlmPqYqe1pJxDGUlNYbSgUBlncIvvX+mIeZarokysNgg==", - "dev": true - }, "@types/babel__core": { "version": "7.20.0", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", diff --git a/package.json b/package.json index bfa25ee..ffd8936 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ }, "devDependencies": { "@octokit/types": "^9.0.0", - "@tsconfig/node16-strictest-esm": "^1.0.3", "@types/node": "^16.18.19", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", From b77334f4beafd338870e4fb41d73d9d1b12fa247 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 27 Mar 2023 20:30:09 +0900 Subject: [PATCH 02/15] `npm install --save-dev @tsconfig/strictest @tsconfig/node16` --- package-lock.json | 26 ++++++++++++++++++++------ package.json | 2 ++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index fecc48a..584853c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,8 @@ }, "devDependencies": { "@octokit/types": "^9.0.0", + "@tsconfig/node16": "^1.0.3", + "@tsconfig/strictest": "^2.0.0", "@types/node": "^16.18.19", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", @@ -1857,9 +1859,15 @@ "dev": true }, "node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "node_modules/@tsconfig/strictest": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tsconfig/strictest/-/strictest-2.0.0.tgz", + "integrity": "sha512-E0dpiZNdwO20c8d3seh7OmjAvDpwoRkTcU6M8cvggzB45Bd45tyTU2XJeA5Wfq+8NzVGhunvqOJ30AjSkywMXA==", "dev": true }, "node_modules/@types/babel__core": { @@ -7262,9 +7270,15 @@ "dev": true }, "@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "@tsconfig/strictest": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tsconfig/strictest/-/strictest-2.0.0.tgz", + "integrity": "sha512-E0dpiZNdwO20c8d3seh7OmjAvDpwoRkTcU6M8cvggzB45Bd45tyTU2XJeA5Wfq+8NzVGhunvqOJ30AjSkywMXA==", "dev": true }, "@types/babel__core": { diff --git a/package.json b/package.json index ffd8936..62a7712 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,8 @@ }, "devDependencies": { "@octokit/types": "^9.0.0", + "@tsconfig/node16": "^1.0.3", + "@tsconfig/strictest": "^2.0.0", "@types/node": "^16.18.19", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", From 256b20f7f0d54998ef0bbe2e02fd106fc76b93c7 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 27 Mar 2023 20:33:39 +0900 Subject: [PATCH 03/15] `npm uninstall typescript && npm install --save-dev typescript` --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 584853c..6cf3645 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "jest": "^29.5.0", "ts-node": "^10.9.1", "tsx": "^3.12.6", - "typescript": "^4.9.5" + "typescript": "^5.0.2" }, "engines": { "node": "16.x" @@ -5645,16 +5645,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", + "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/universal-user-agent": { @@ -9988,9 +9988,9 @@ "dev": true }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", + "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", "dev": true }, "universal-user-agent": { diff --git a/package.json b/package.json index 62a7712..dc3f00c 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,6 @@ "jest": "^29.5.0", "ts-node": "^10.9.1", "tsx": "^3.12.6", - "typescript": "^4.9.5" + "typescript": "^5.0.2" } } From 742d7816498ff14be37411b65d84c5e61d5e87fa Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 27 Mar 2023 20:35:30 +0900 Subject: [PATCH 04/15] Apply newstyle of combined tsconfig --- tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 315732d..66d305a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { - // https://github.com/tsconfig/bases/blob/d1543a94d47c3ef9af9987790742b09caf71b71d/bases/node16-strictest-esm.combined.json - "extends": "@tsconfig/node16-strictest-esm/tsconfig.json", + // https://github.com/tsconfig/bases/pull/161 + "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node16/tsconfig"], "compilerOptions": { // https://www.typescriptlang.org/docs/handbook/esm-node.html "module": "node16", From aa94f29105f018b756a5255fa438c087a30988d0 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 27 Mar 2023 20:38:55 +0900 Subject: [PATCH 05/15] Apply type prefix to care verbatimModuleSyntax --- __tests__/main.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 222f434..933ad7e 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -1,6 +1,6 @@ import { wait } from '../src/wait'; import { env, execPath } from 'process'; -import { execFileSync, ExecFileSyncOptions } from 'child_process'; +import { execFileSync, type ExecFileSyncOptions } from 'child_process'; import { join } from 'path'; import { expect, test } from '@jest/globals'; From 7ff4dad5109be7b78b2d5a161a9b739c0ae5c7ad Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 27 Mar 2023 21:24:44 +0900 Subject: [PATCH 06/15] `npm uninstall tsx` --- package-lock.json | 127 ---------------------------------------------- package.json | 1 - 2 files changed, 128 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6cf3645..5aead47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,6 @@ "eslint-plugin-jest": "^27.2.1", "jest": "^29.5.0", "ts-node": "^10.9.1", - "tsx": "^3.12.6", "typescript": "^5.0.2" }, "engines": { @@ -712,46 +711,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@esbuild-kit/cjs-loader": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz", - "integrity": "sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==", - "dev": true, - "dependencies": { - "@esbuild-kit/core-utils": "^3.0.0", - "get-tsconfig": "^4.4.0" - } - }, - "node_modules/@esbuild-kit/core-utils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz", - "integrity": "sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==", - "dev": true, - "dependencies": { - "esbuild": "~0.17.6", - "source-map-support": "^0.5.21" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/@esbuild-kit/esm-loader": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz", - "integrity": "sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==", - "dev": true, - "dependencies": { - "@esbuild-kit/core-utils": "^3.0.0", - "get-tsconfig": "^4.4.0" - } - }, "node_modules/@esbuild/android-arm": { "version": "0.17.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", @@ -3657,15 +3616,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-tsconfig": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.4.0.tgz", - "integrity": "sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==", - "dev": true, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5586,23 +5536,6 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "node_modules/tsx": { - "version": "3.12.6", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.6.tgz", - "integrity": "sha512-q93WgS3lBdHlPgS0h1i+87Pt6n9K/qULIMNYZo07nSeu2z5QE2CellcAZfofVXBo2tQg9av2ZcRMQ2S2i5oadQ==", - "dev": true, - "dependencies": { - "@esbuild-kit/cjs-loader": "^2.4.2", - "@esbuild-kit/core-utils": "^3.0.0", - "@esbuild-kit/esm-loader": "^2.5.5" - }, - "bin": { - "tsx": "dist/cli.js" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -6423,48 +6356,6 @@ } } }, - "@esbuild-kit/cjs-loader": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz", - "integrity": "sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==", - "dev": true, - "requires": { - "@esbuild-kit/core-utils": "^3.0.0", - "get-tsconfig": "^4.4.0" - } - }, - "@esbuild-kit/core-utils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz", - "integrity": "sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==", - "dev": true, - "requires": { - "esbuild": "~0.17.6", - "source-map-support": "^0.5.21" - }, - "dependencies": { - "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - } - } - }, - "@esbuild-kit/esm-loader": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz", - "integrity": "sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==", - "dev": true, - "requires": { - "@esbuild-kit/core-utils": "^3.0.0", - "get-tsconfig": "^4.4.0" - } - }, "@esbuild/android-arm": { "version": "0.17.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", @@ -8539,12 +8430,6 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, - "get-tsconfig": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.4.0.tgz", - "integrity": "sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==", - "dev": true - }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9949,18 +9834,6 @@ "tslib": "^1.8.1" } }, - "tsx": { - "version": "3.12.6", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.6.tgz", - "integrity": "sha512-q93WgS3lBdHlPgS0h1i+87Pt6n9K/qULIMNYZo07nSeu2z5QE2CellcAZfofVXBo2tQg9av2ZcRMQ2S2i5oadQ==", - "dev": true, - "requires": { - "@esbuild-kit/cjs-loader": "^2.4.2", - "@esbuild-kit/core-utils": "^3.0.0", - "@esbuild-kit/esm-loader": "^2.5.5", - "fsevents": "~2.3.2" - } - }, "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", diff --git a/package.json b/package.json index dc3f00c..3fd9e38 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "eslint-plugin-jest": "^27.2.1", "jest": "^29.5.0", "ts-node": "^10.9.1", - "tsx": "^3.12.6", "typescript": "^5.0.2" } } From eca4d484286d4bcef68bf763f914a5d11d36a29d Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 17 Apr 2023 17:35:41 +0900 Subject: [PATCH 07/15] Import derprecated combined tsconfig from tsconfig/bases https://github.com/tsconfig/bases/commit/0ae4791797d8ba3dd2bca9aca880eb2d3e30e6fb --- tsconfig.base.json | 31 +++++++++++++++++++++++++++++++ tsconfig.json | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 tsconfig.base.json diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..c36e9b9 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,31 @@ +{ + // Import from https://github.com/tsconfig/bases/commit/0ae4791797d8ba3dd2bca9aca880eb2d3e30e6fb + // To avoid issues around tsconfig.extends array + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Node 16 + Strictest", + "compilerOptions": { + "lib": [ + "es2021" + ], + "module": "commonjs", + "target": "es2021", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "allowUnusedLabels": false, + "allowUnreachableCode": false, + "exactOptionalPropertyTypes": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + // TODO: Update to verbatimModuleSyntax + "importsNotUsedAsValues": "error", + "checkJs": true + } +} diff --git a/tsconfig.json b/tsconfig.json index 66d305a..20f9039 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { - // https://github.com/tsconfig/bases/pull/161 - "extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node16/tsconfig"], + // 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", From 1c6d21b539bd598b3327a9082d1e183006baf922 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 17 Apr 2023 17:38:05 +0900 Subject: [PATCH 08/15] Update importsNotUsedAsValues to verbatimModuleSyntax https://github.com/tsconfig/bases/commit/00fa4eeb82d0cd700df26ba5f7e0ec011781adb1 --- tsconfig.base.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tsconfig.base.json b/tsconfig.base.json index c36e9b9..7ab0cb8 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -24,8 +24,7 @@ "noUncheckedIndexedAccess": true, "noUnusedLocals": true, "noUnusedParameters": true, - // TODO: Update to verbatimModuleSyntax - "importsNotUsedAsValues": "error", + "verbatimModuleSyntax": true, "checkJs": true } } From 9131a0e2419abb4a12c39618bcb4f7bd4dbec78d Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 17 Apr 2023 17:39:43 +0900 Subject: [PATCH 09/15] Remove unused @tsconfig family now --- package-lock.json | 14 -------------- package.json | 2 -- 2 files changed, 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5aead47..9f4c838 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,8 +15,6 @@ }, "devDependencies": { "@octokit/types": "^9.0.0", - "@tsconfig/node16": "^1.0.3", - "@tsconfig/strictest": "^2.0.0", "@types/node": "^16.18.19", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", @@ -1823,12 +1821,6 @@ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, - "node_modules/@tsconfig/strictest": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tsconfig/strictest/-/strictest-2.0.0.tgz", - "integrity": "sha512-E0dpiZNdwO20c8d3seh7OmjAvDpwoRkTcU6M8cvggzB45Bd45tyTU2XJeA5Wfq+8NzVGhunvqOJ30AjSkywMXA==", - "dev": true - }, "node_modules/@types/babel__core": { "version": "7.20.0", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", @@ -7166,12 +7158,6 @@ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, - "@tsconfig/strictest": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tsconfig/strictest/-/strictest-2.0.0.tgz", - "integrity": "sha512-E0dpiZNdwO20c8d3seh7OmjAvDpwoRkTcU6M8cvggzB45Bd45tyTU2XJeA5Wfq+8NzVGhunvqOJ30AjSkywMXA==", - "dev": true - }, "@types/babel__core": { "version": "7.20.0", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", diff --git a/package.json b/package.json index 3fd9e38..ace1d5f 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,6 @@ }, "devDependencies": { "@octokit/types": "^9.0.0", - "@tsconfig/node16": "^1.0.3", - "@tsconfig/strictest": "^2.0.0", "@types/node": "^16.18.19", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", From b67c876cf9f9c5125a2e35046174eaa60dc86404 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 17 Apr 2023 17:40:54 +0900 Subject: [PATCH 10/15] Bump nixpkgs to latest --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 094be4e..094ecf1 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,4 @@ -{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/b77bbeca8ba3069eea82a3711242cdc2240cc7c9.tar.gz") { } }: +{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/4c3edba85629ec304b5269e4b0ac7f26c433df23.tar.gz") { } }: pkgs.mkShell { buildInputs = [ From 327e1c7c34c94dbdacff827e2fd3a72ff81764c7 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 17 Apr 2023 17:41:43 +0900 Subject: [PATCH 11/15] `npm uninstall typescript && npm install --save-dev typescript` --- 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 9f4c838..7488d70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "eslint-plugin-jest": "^27.2.1", "jest": "^29.5.0", "ts-node": "^10.9.1", - "typescript": "^5.0.2" + "typescript": "^5.0.4" }, "engines": { "node": "16.x" @@ -5570,9 +5570,9 @@ } }, "node_modules/typescript": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", - "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -9847,9 +9847,9 @@ "dev": true }, "typescript": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", - "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "universal-user-agent": { diff --git a/package.json b/package.json index ace1d5f..0fe89cf 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,6 @@ "eslint-plugin-jest": "^27.2.1", "jest": "^29.5.0", "ts-node": "^10.9.1", - "typescript": "^5.0.2" + "typescript": "^5.0.4" } } From 02ebb67fcb04d7607c83e92f59bae97fc96966ed Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 17 Apr 2023 17:42:24 +0900 Subject: [PATCH 12/15] tsx again --- package-lock.json | 127 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 128 insertions(+) diff --git a/package-lock.json b/package-lock.json index 7488d70..c1aaa24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "eslint-plugin-jest": "^27.2.1", "jest": "^29.5.0", "ts-node": "^10.9.1", + "tsx": "^3.12.6", "typescript": "^5.0.4" }, "engines": { @@ -709,6 +710,46 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@esbuild-kit/cjs-loader": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz", + "integrity": "sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==", + "dev": true, + "dependencies": { + "@esbuild-kit/core-utils": "^3.0.0", + "get-tsconfig": "^4.4.0" + } + }, + "node_modules/@esbuild-kit/core-utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz", + "integrity": "sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==", + "dev": true, + "dependencies": { + "esbuild": "~0.17.6", + "source-map-support": "^0.5.21" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/@esbuild-kit/esm-loader": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz", + "integrity": "sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==", + "dev": true, + "dependencies": { + "@esbuild-kit/core-utils": "^3.0.0", + "get-tsconfig": "^4.4.0" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.17.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", @@ -3608,6 +3649,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.5.0.tgz", + "integrity": "sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5528,6 +5578,23 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, + "node_modules/tsx": { + "version": "3.12.6", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.6.tgz", + "integrity": "sha512-q93WgS3lBdHlPgS0h1i+87Pt6n9K/qULIMNYZo07nSeu2z5QE2CellcAZfofVXBo2tQg9av2ZcRMQ2S2i5oadQ==", + "dev": true, + "dependencies": { + "@esbuild-kit/cjs-loader": "^2.4.2", + "@esbuild-kit/core-utils": "^3.0.0", + "@esbuild-kit/esm-loader": "^2.5.5" + }, + "bin": { + "tsx": "dist/cli.js" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -6348,6 +6415,48 @@ } } }, + "@esbuild-kit/cjs-loader": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz", + "integrity": "sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==", + "dev": true, + "requires": { + "@esbuild-kit/core-utils": "^3.0.0", + "get-tsconfig": "^4.4.0" + } + }, + "@esbuild-kit/core-utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz", + "integrity": "sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==", + "dev": true, + "requires": { + "esbuild": "~0.17.6", + "source-map-support": "^0.5.21" + }, + "dependencies": { + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + } + } + }, + "@esbuild-kit/esm-loader": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz", + "integrity": "sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==", + "dev": true, + "requires": { + "@esbuild-kit/core-utils": "^3.0.0", + "get-tsconfig": "^4.4.0" + } + }, "@esbuild/android-arm": { "version": "0.17.12", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.12.tgz", @@ -8416,6 +8525,12 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.5.0.tgz", + "integrity": "sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==", + "dev": true + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9820,6 +9935,18 @@ "tslib": "^1.8.1" } }, + "tsx": { + "version": "3.12.6", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.6.tgz", + "integrity": "sha512-q93WgS3lBdHlPgS0h1i+87Pt6n9K/qULIMNYZo07nSeu2z5QE2CellcAZfofVXBo2tQg9av2ZcRMQ2S2i5oadQ==", + "dev": true, + "requires": { + "@esbuild-kit/cjs-loader": "^2.4.2", + "@esbuild-kit/core-utils": "^3.0.0", + "@esbuild-kit/esm-loader": "^2.5.5", + "fsevents": "~2.3.2" + } + }, "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", diff --git a/package.json b/package.json index 0fe89cf..4b12a63 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "eslint-plugin-jest": "^27.2.1", "jest": "^29.5.0", "ts-node": "^10.9.1", + "tsx": "^3.12.6", "typescript": "^5.0.4" } } From 4466480a793846b0a36d0f20e3d1f475ad951df2 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 18 Apr 2023 01:53:20 +0900 Subject: [PATCH 13/15] Remove outdated task `npm run all` --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 41cff27..ac94dd8 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,7 @@ "pretest": "npm run package", "test": "jest", "typecheck": "tsc", - "repl": "tsx", - "all": "npm run format:check && npm run lint:check && npm run build && npm run package && npm test" + "repl": "tsx" }, "repository": { "type": "git", From 28c4a99024e6d2f424dbc5231b49eff8b86582f6 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 18 Apr 2023 01:54:09 +0900 Subject: [PATCH 14/15] Prefer module.exports since enabling verbatimModuleSyntax ref: https://zenn.dev/teppeis/articles/2023-04-typescript-5_0-verbatim-module-syntax --- jest.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.ts b/jest.config.ts index 2ba50ac..dc94ea8 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -16,4 +16,4 @@ const config: Config.InitialOptions = { extensionsToTreatAsEsm: ['.ts'], testMatch: ['**/**/*.test.ts'], }; -export default config; +module.exports = config; From 5f9e812cf1a47e957a8d2ddcbfdea2b93af0bcf4 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Tue, 18 Apr 2023 01:59:28 +0900 Subject: [PATCH 15/15] Add eslint rule for TS5 era --- .eslintrc.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.eslintrc.yml b/.eslintrc.yml index 31c484a..b04839b 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -33,6 +33,9 @@ rules: '@typescript-eslint/prefer-readonly-parameter-types': - error - ignoreInferredTypes: true + # See https://zenn.dev/teppeis/articles/2023-04-typescript-5_0-verbatim-module-syntax for enabling reason + '@typescript-eslint/consistent-type-imports': 'error' + '@typescript-eslint/no-import-type-side-effects': 'error' parser: '@typescript-eslint/parser' parserOptions: ecmaVersion: 12