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/.nycrc b/.nycrc index 04de9940..945ec528 100644 --- a/.nycrc +++ b/.nycrc @@ -7,7 +7,7 @@ "html", "text" ], - "lines": 99.5, + "lines": 99.4, "branches": "97", - "statements": "99.5" + "statements": "99.4" } 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]) diff --git a/package.json b/package.json index decd0c3f..a28cb1ec 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'", @@ -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", @@ -58,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", @@ -66,13 +66,11 @@ "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", "standardx": "^7.0.0", "start-server-and-test": "^1.11.2", - "ts-transform-default-export": "^1.0.2", "typescript": "^4.0.0" }, "files": [ @@ -82,7 +80,7 @@ "!*.d.cts" ], "engines": { - "node": ">=12" + "node": ">=14" }, "standardx": { "ignore": [ diff --git a/rollup.config.js b/rollup.config.js index 15fd65db..6ea6cf1e 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' +import typescript from '@rollup/plugin-typescript' const output = { format: 'cjs', @@ -14,11 +13,7 @@ export default { input: './lib/index.ts', output, plugins: [ - ts({ - transformers: ({ program }) => ({ - afterDeclarations: transformDefaultExport(program) - }) - }), + typescript(), cleanup({ comments: 'none', extensions: ['*']