From 8e739ce29773352b345623cb8068fa935e46dd86 Mon Sep 17 00:00:00 2001 From: bailey Date: Tue, 23 Sep 2025 10:44:12 -0600 Subject: [PATCH 1/3] remove support for Node16 --- .evergreen/config.yml | 39 +++++++-------------------------------- package-lock.json | 15 +-------------- package.json | 4 ++-- tsconfig.json | 7 +++---- 4 files changed, 13 insertions(+), 52 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index e4c5c625..a4d0cc2a 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -134,37 +134,12 @@ functions: args: - .evergreen/run-spec-benchmarks.sh tasks: - - name: node-tests-v16 - tags: ["node"] - commands: - - func: fetch source - vars: - NODE_LTS_VERSION: 16 - NPM_VERSION: 9 - - func: install dependencies - vars: - NODE_LTS_VERSION: 16 - NPM_VERSION: 9 - - func: run tests - vars: - TEST_TARGET: node - - name: node-tests-v18 - tags: ["node"] - commands: - - func: fetch source - vars: - NODE_LTS_VERSION: 18 - NPM_VERSION: 10 - - func: install dependencies - - func: run tests - vars: - TEST_TARGET: node - name: node-tests-v20 tags: ["node"] commands: - func: fetch source vars: - NODE_LTS_VERSION: 20 + NODE_LTS_VERSION: "20.19.0" - func: install dependencies - func: run tests - name: node-tests-v22 @@ -256,8 +231,8 @@ tasks: commands: - func: fetch source vars: - # This needs to stay pinned at Node v18.16.0 for consistency across perf runs. - NODE_LTS_VERSION: v18.16.0 + # This needs to stay pinned at Node v22.11.0 for consistency across perf runs. + NODE_LTS_VERSION: v22.11.0 NPM_VERSION: 9 - func: install dependencies vars: @@ -273,8 +248,8 @@ tasks: commands: - func: fetch source vars: - # This needs to stay pinned at Node v18.16.0 for consistency across perf runs. - NODE_LTS_VERSION: v18.16.0 + # This needs to stay pinned at Node v22.11.0 for consistency across perf runs. + NODE_LTS_VERSION: v22.11.0 NPM_VERSION: 9 - func: install dependencies vars: @@ -287,8 +262,8 @@ tasks: commands: - func: fetch source vars: - # This needs to stay pinned at Node v18.16.0 for consistency across perf runs. - NODE_LTS_VERSION: v18.16.0 + # This needs to stay pinned at Node v22.11.0 for consistency across perf runs. + NODE_LTS_VERSION: v22.11.0 NPM_VERSION: 9 - func: install dependencies vars: diff --git a/package-lock.json b/package-lock.json index f74b7c19..19ba3437 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "uuid": "^11.1.0" }, "engines": { - "node": ">=16.20.1" + "node": ">=20.19.0" } }, "etc/eslint/no-bigint-usage": { @@ -1686,19 +1686,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", diff --git a/package.json b/package.json index 2d493e16..054a1824 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "require": "./lib/bson.cjs" }, "engines": { - "node": ">=16.20.1" + "node": ">=20.19.0" }, "scripts": { "pretest": "npm run build", @@ -117,4 +117,4 @@ "prepare": "node etc/prepare.js", "release": "standard-version -i HISTORY.md" } -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 2c98753d..f22445fb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,14 +4,13 @@ "checkJs": false, "strict": true, "alwaysStrict": true, - "target": "es2021", + "target": "es2023", "module": "commonjs", "moduleResolution": "node", "skipLibCheck": true, "erasableSyntaxOnly": true, "lib": [ - "es2021", - "ES2022.Error" + "es2023" ], "outDir": "lib", "importHelpers": false, @@ -35,4 +34,4 @@ "include": [ "src/**/*" ] -} +} \ No newline at end of file From 294a11ec607f6982b3c90fc0e2146ce3f86b2d48 Mon Sep 17 00:00:00 2001 From: bailey Date: Tue, 23 Sep 2025 10:51:38 -0600 Subject: [PATCH 2/3] Add import assertion for json import in benchmarks --- test/bench/custom/main.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/bench/custom/main.mjs b/test/bench/custom/main.mjs index 2f768727..363b4cf9 100644 --- a/test/bench/custom/main.mjs +++ b/test/bench/custom/main.mjs @@ -37,7 +37,9 @@ async function completeSuite() { if (++completedSuites >= collectedSuites.length) { let cpuBaselineResults; try { - cpuBaselineResults = await import('../etc/cpuBaseline.json', { assert: { type: 'json' } }); + cpuBaselineResults = await import('../etc/cpuBaseline.json', { + with: { type: 'json' } + }); } catch (cause) { throw new Error("Couldn't find baseline results", { cause }); } From b171c7e5f177151338766869144f9a1f116ae756 Mon Sep 17 00:00:00 2001 From: bailey Date: Tue, 23 Sep 2025 11:40:44 -0600 Subject: [PATCH 3/3] eslint parser version --- .eslintrc.json | 2 +- .evergreen/install-dependencies.sh | 2 +- .github/dependabot.yml | 3 --- etc/eslint/no-bigint-usage/test/no_bigint_literals.test.js | 2 +- rollup.config.mjs | 4 ++-- test/.eslintrc.json | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index f192ad1e..d5c4c394 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,7 +19,7 @@ }, "parser": "@typescript-eslint/parser", "parserOptions": { - "ecmaVersion": 2020, + "ecmaVersion": 2023, "project": [ "./tsconfig.json" ] diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 93a22813..17009340 100755 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -5,7 +5,7 @@ set -o errexit # Exit the script with error if any of the commands fail ## a nodejs major version (i.e., 16) ## 'latest' ## a full nodejs version, in the format v..patch -export NODE_LTS_VERSION=${NODE_LTS_VERSION:-16} +export NODE_LTS_VERSION=${NODE_LTS_VERSION:-20.19.0} # npm version can be defined in the environment for cases where we need to install # a version lower than latest to support EOL Node versions. When not provided will # be handled by this script in drivers tools. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 43c1f55b..7a4e5fe5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,9 +20,6 @@ updates: # sinon-chai 4.x+ supports chai 5.x+. - dependency-name: "sinon-chai" versions: [">=4.0.0"] - # nyc is Node18+ only starting on nyc@16.x. - - dependency-name: "nyc" - versions: [">=16.0.0"] # we ignore TS as a part of quarterly dependency updates. - dependency-name: "typescript" groups: diff --git a/etc/eslint/no-bigint-usage/test/no_bigint_literals.test.js b/etc/eslint/no-bigint-usage/test/no_bigint_literals.test.js index d3572c6b..0670aec0 100644 --- a/etc/eslint/no-bigint-usage/test/no_bigint_literals.test.js +++ b/etc/eslint/no-bigint-usage/test/no_bigint_literals.test.js @@ -1,7 +1,7 @@ const { rules } = require('../index'); const { RuleTester } = require('eslint'); -const ruleTester = new RuleTester({ languageOptions: { ecmaVersion: 2020 } }); +const ruleTester = new RuleTester({ languageOptions: { ecmaVersion: 2023 } }); ruleTester.run('no-bigint-literals', rules['no-bigint-literals'], { valid: [{ diff --git a/rollup.config.mjs b/rollup.config.mjs index a750bc14..e303ede7 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -9,11 +9,11 @@ const tsConfig = { checkJs: false, strict: true, alwaysStrict: true, - target: 'es2021', + target: 'es2023', module: 'esnext', moduleResolution: 'node', removeComments: true, - lib: ['es2021', 'ES2022.Error'], + lib: ['es2023'], importHelpers: false, noEmitHelpers: false, noEmitOnError: true, diff --git a/test/.eslintrc.json b/test/.eslintrc.json index 4ac30b29..03c6b732 100644 --- a/test/.eslintrc.json +++ b/test/.eslintrc.json @@ -14,7 +14,7 @@ "globalThis": true }, "parserOptions": { - "ecmaVersion": 2020 + "ecmaVersion": 2023 }, "extends": [ "eslint:recommended",