From e34bba99be0f25b65a10d931444c4eab7db9f830 Mon Sep 17 00:00:00 2001 From: John Gee Date: Sat, 4 Mar 2023 16:55:22 +1300 Subject: [PATCH 01/12] chore: fix build:cjs run script --- package.json | 2 +- rollup.config.js | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index decd0c3f..4365dc14 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "mocha": "^10.0.0", "puppeteer": "^16.0.0", "rimraf": "^3.0.2", - "rollup": "^2.22.1", + "rollup": "^3.18.0", "rollup-plugin-cleanup": "^3.1.1", "rollup-plugin-ts": "^3.0.2", "serve": "^14.0.0", diff --git a/rollup.config.js b/rollup.config.js index 15fd65db..e5930f3b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,5 @@ import cleanup from 'rollup-plugin-cleanup' import ts from 'rollup-plugin-ts' -import transformDefaultExport from 'ts-transform-default-export' const output = { format: 'cjs', @@ -14,11 +13,7 @@ export default { input: './lib/index.ts', output, plugins: [ - ts({ - transformers: ({ program }) => ({ - afterDeclarations: transformDefaultExport(program) - }) - }), + ts(), cleanup({ comments: 'none', extensions: ['*'] From c9ab308273524ddb2eb9b696153667d4ebba2b1f Mon Sep 17 00:00:00 2001 From: John Gee Date: Sat, 4 Mar 2023 17:17:12 +1300 Subject: [PATCH 02/12] chore: remove ts-transform-default-export dependency --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 4365dc14..b07f5dae 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,6 @@ "serve": "^14.0.0", "standardx": "^7.0.0", "start-server-and-test": "^1.11.2", - "ts-transform-default-export": "^1.0.2", "typescript": "^4.0.0" }, "files": [ From ce1484d000b419614f46b33b98215868dfc5fecd Mon Sep 17 00:00:00 2001 From: John Gee Date: Sat, 4 Mar 2023 21:00:23 +1300 Subject: [PATCH 03/12] chore!: bump minimum node version and pin back rollup-plugin-ts --- .github/workflows/ci.yaml | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 51f1f43d..4b682d25 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [12, 14, 16] + node: [14, 16, 18] steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 14 - run: npm install env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true diff --git a/package.json b/package.json index b07f5dae..06bd1924 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "rimraf": "^3.0.2", "rollup": "^3.18.0", "rollup-plugin-cleanup": "^3.1.1", - "rollup-plugin-ts": "^3.0.2", + "rollup-plugin-ts": "~3.0.2", "serve": "^14.0.0", "standardx": "^7.0.0", "start-server-and-test": "^1.11.2", @@ -81,7 +81,7 @@ "!*.d.cts" ], "engines": { - "node": ">=12" + "node": ">=14" }, "standardx": { "ignore": [ From 5bfd9edf1685eae653f6bd11263896c21fa5d71a Mon Sep 17 00:00:00 2001 From: John Gee Date: Sat, 4 Mar 2023 21:09:01 +1300 Subject: [PATCH 04/12] chore: found another place to update for node minimum version --- lib/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.ts b/lib/index.ts index 3cc34257..e159d9e8 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -18,7 +18,7 @@ import { readFileSync } from 'fs' // version support policy. The YARGS_MIN_NODE_VERSION is used for testing only. const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) ? Number(process.env.YARGS_MIN_NODE_VERSION) - : 12 + : 14 const nodeVersion = process?.versions?.node ?? process?.version?.slice(1) if (nodeVersion) { const major = Number(nodeVersion.match(/^([^.]+)/)![1]) From c21dad1dc58cf541b1c98eb5adc3b0b48e21c990 Mon Sep 17 00:00:00 2001 From: John Gee Date: Sun, 5 Mar 2023 11:17:18 +1300 Subject: [PATCH 05/12] chore: switch from rollup-plugin-ts to @rollup/plugin-typescript --- package.json | 5 +++-- rollup.config.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 06bd1924..171b3bf3 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "author": "Ben Coe ", "license": "ISC", "devDependencies": { + "@rollup/plugin-typescript": "^11.0.0", "@types/chai": "^4.2.11", "@types/mocha": "^9.0.0", "@types/node": "^16.11.4", @@ -68,7 +69,6 @@ "rimraf": "^3.0.2", "rollup": "^3.18.0", "rollup-plugin-cleanup": "^3.1.1", - "rollup-plugin-ts": "~3.0.2", "serve": "^14.0.0", "standardx": "^7.0.0", "start-server-and-test": "^1.11.2", @@ -87,5 +87,6 @@ "ignore": [ "build" ] - } + }, + "dependencies": {} } diff --git a/rollup.config.js b/rollup.config.js index e5930f3b..80ebf356 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,5 @@ import cleanup from 'rollup-plugin-cleanup' -import ts from 'rollup-plugin-ts' +import typescript from '@rollup/plugin-typescript'; const output = { format: 'cjs', @@ -13,7 +13,7 @@ export default { input: './lib/index.ts', output, plugins: [ - ts(), + typescript(), cleanup({ comments: 'none', extensions: ['*'] From cea2c9565e6e93b0b7f677219a83b4f801e96707 Mon Sep 17 00:00:00 2001 From: John Gee Date: Sun, 5 Mar 2023 11:20:10 +1300 Subject: [PATCH 06/12] chore: remove stray semicolon --- rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 80ebf356..6ea6cf1e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,5 @@ import cleanup from 'rollup-plugin-cleanup' -import typescript from '@rollup/plugin-typescript'; +import typescript from '@rollup/plugin-typescript' const output = { format: 'cjs', From cb9bdc2ef6a7f749cfba52ee6a4cdf5b514c2b8a Mon Sep 17 00:00:00 2001 From: John Gee Date: Sun, 5 Mar 2023 11:48:21 +1300 Subject: [PATCH 07/12] chore: pass sourceMap into plugin --- rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 6ea6cf1e..4f980285 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -13,7 +13,7 @@ export default { input: './lib/index.ts', output, plugins: [ - typescript(), + typescript({ compilerOptions: { sourceMap: output.sourcemap } }), cleanup({ comments: 'none', extensions: ['*'] From 3e686592fdf0c65b1e864a48e6f7692c7a8d97aa Mon Sep 17 00:00:00 2001 From: John Gee Date: Sun, 5 Mar 2023 14:17:30 +1300 Subject: [PATCH 08/12] chore: remove typescript plugin configuration override --- rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 4f980285..6ea6cf1e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -13,7 +13,7 @@ export default { input: './lib/index.ts', output, plugins: [ - typescript({ compilerOptions: { sourceMap: output.sourcemap } }), + typescript(), cleanup({ comments: 'none', extensions: ['*'] From 0c44af8c15a7d826e72442c5b66733bb83e7821b Mon Sep 17 00:00:00 2001 From: John Gee Date: Thu, 23 Mar 2023 21:39:32 +1300 Subject: [PATCH 09/12] Use native rollup support for environment variable --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 171b3bf3..0e4c477c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "scripts": { "check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'", "fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'", - "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", + "pretest": "rimraf build && tsc -p tsconfig.test.json && npm run build:cjs -- --environment NODE_ENV:test", "test": "c8 --reporter=text --reporter=html mocha test/*.cjs", "test:esm": "c8 --reporter=text --reporter=html mocha test/*.mjs", "test:browser": "start-server-and-test 'serve ./ -p 8080' http://127.0.0.1:8080/package.json 'node ./test/browser/yargs-test.cjs'", @@ -59,7 +59,6 @@ "@typescript-eslint/parser": "^3.10.1", "c8": "^7.3.0", "chai": "^4.2.0", - "cross-env": "^7.0.2", "eslint": "^7.0.0", "eslint-plugin-import": "^2.20.1", "eslint-plugin-node": "^11.0.0", From f1f3c469328d082a161aafbbd03caac61db6a3a6 Mon Sep 17 00:00:00 2001 From: John Gee Date: Thu, 23 Mar 2023 21:41:03 +1300 Subject: [PATCH 10/12] Remove surplus empty dependencies --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 0e4c477c..a28cb1ec 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,5 @@ "ignore": [ "build" ] - }, - "dependencies": {} + } } From 6204068422555ab99dcba8c25f2c2f62e11f0f85 Mon Sep 17 00:00:00 2001 From: John Gee Date: Thu, 23 Mar 2023 21:51:04 +1300 Subject: [PATCH 11/12] Drop coverage baseline to pass test with 1 extra commented line --- .nycrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nycrc b/.nycrc index 04de9940..175d5735 100644 --- a/.nycrc +++ b/.nycrc @@ -7,7 +7,7 @@ "html", "text" ], - "lines": 99.5, + "lines": 99.4, "branches": "97", "statements": "99.5" } From 78abc6fa901ef53549a726ece1aa538cd66a9e00 Mon Sep 17 00:00:00 2001 From: John Gee Date: Thu, 23 Mar 2023 21:55:59 +1300 Subject: [PATCH 12/12] Drop coverage baseline to pass test with 1 extra commented line --- .nycrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nycrc b/.nycrc index 175d5735..945ec528 100644 --- a/.nycrc +++ b/.nycrc @@ -9,5 +9,5 @@ ], "lines": 99.4, "branches": "97", - "statements": "99.5" + "statements": "99.4" }