Skip to content

Commit 027ffb7

Browse files
authored
feat!(NODE-4435): drop support for nodejs versions below 14 (#517)
1 parent a93441d commit 027ffb7

15 files changed

+5390
-4940
lines changed

.eslintrc.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,17 @@
6363
"@typescript-eslint/no-unsafe-return": "off",
6464
"@typescript-eslint/no-unsafe-argument": "off",
6565
"@typescript-eslint/no-unsafe-call": "off"
66-
}
66+
},
67+
"overrides": [
68+
{
69+
"parser": "espree",
70+
"files": [
71+
"*.mjs"
72+
],
73+
"parserOptions": {
74+
"sourceType": "module",
75+
"ecmaVersion": "latest"
76+
}
77+
}
78+
]
6779
}

.evergreen/config.yml

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -92,46 +92,6 @@ functions:
9292
- ${PROJECT_DIRECTORY}/.evergreen/run-typescript.sh
9393

9494
tasks:
95-
- name: node-tests-v6
96-
tags: ["node"]
97-
commands:
98-
- func: fetch source
99-
vars:
100-
NODE_MAJOR_VERSION: 6
101-
- func: install dependencies
102-
- func: run tests
103-
vars:
104-
TEST_TARGET: node
105-
- name: node-tests-v8
106-
tags: ["node"]
107-
commands:
108-
- func: fetch source
109-
vars:
110-
NODE_MAJOR_VERSION: 8
111-
- func: install dependencies
112-
- func: run tests
113-
vars:
114-
TEST_TARGET: node
115-
- name: node-tests-v10
116-
tags: ["node"]
117-
commands:
118-
- func: fetch source
119-
vars:
120-
NODE_MAJOR_VERSION: 10
121-
- func: install dependencies
122-
- func: run tests
123-
vars:
124-
TEST_TARGET: node
125-
- name: node-tests-v12
126-
tags: ["node"]
127-
commands:
128-
- func: fetch source
129-
vars:
130-
NODE_MAJOR_VERSION: 12
131-
- func: install dependencies
132-
- func: run tests
133-
vars:
134-
TEST_TARGET: node
13595
- name: node-tests-v14
13696
tags: ["node"]
13797
commands:
@@ -162,16 +122,17 @@ tasks:
162122
- func: run tests
163123
vars:
164124
TEST_TARGET: node
165-
- name: browser-tests
166-
tags: ["browser"]
167-
commands:
168-
- func: fetch source
169-
vars:
170-
NODE_MAJOR_VERSION: 16
171-
- func: install dependencies
172-
- func: run tests
173-
vars:
174-
TEST_TARGET: browser
125+
# TODO(NODE-3555): Karma tests pass locally still after these changes, rhel80 is just missing chrome
126+
# - name: browser-tests
127+
# tags: ["browser"]
128+
# commands:
129+
# - func: fetch source
130+
# vars:
131+
# NODE_MAJOR_VERSION: 16
132+
# - func: install dependencies
133+
# - func: run tests
134+
# vars:
135+
# TEST_TARGET: browser
175136
- name: run-checks
176137
tags:
177138
- run-checks
@@ -214,16 +175,12 @@ tasks:
214175

215176
buildvariants:
216177
- name: linux
217-
display_name: Ubuntu 22.04
218-
run_on: ubuntu2004-small
219-
tasks: [".node", ".browser"]
220-
- name: mac
221-
display_name: MacOS 10.14
222-
run_on: macos-1014
178+
display_name: RHEL 8.0
179+
run_on: rhel80-small
223180
tasks: [".node"]
224181
- name: lint
225182
display_name: lint
226-
run_on: ubuntu2004-small
183+
run_on: rhel80-small
227184
tasks:
228185
- run-checks
229186
- check-typescript-oldest

.evergreen/install-dependencies.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,12 @@ registry=https://registry.npmjs.org
5555
EOT
5656

5757
# install node dependencies
58-
npm install # npm prepare runs after install and will compile the library
58+
# npm prepare runs after install and will compile the library
59+
# TODO(NODE-3555): rollup dependencies for node polyfills have broken peerDeps. We can remove this flag once we've removed them.
60+
npm install --legacy-peer-deps
61+
62+
set +o xtrace
63+
echo "Running: nvm use ${NODE_VERSION}"
5964
nvm use "${NODE_VERSION}" # Switch to the node version we want to test against
65+
echo "Success: switched to node $(node -v)"
66+
set -o xtrace

.evergreen/run-checks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts"
66
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
77
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
88

9-
npm run lint
9+
npm run check:lint

.evergreen/run-tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
1313

1414
case $1 in
1515
"node")
16-
npm run test-node
16+
npm run check:coverage
1717
;;
1818
"browser")
19+
# TODO(NODE-3555): remove explicit browser tests
1920
npm run test-browser
2021
;;
2122
*)

.mocharc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json",
3+
"require": [
4+
"source-map-support/register",
5+
"ts-node/register",
6+
"./node_modules/chai/register-expect"
7+
],
8+
"extension": [
9+
"js",
10+
"ts"
11+
],
12+
"recursive": true,
13+
"timeout": 10000,
14+
"failZero": true,
15+
"sort": true,
16+
"color": true
17+
}

.nycrc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
22
"extends": "@istanbuljs/nyc-config-typescript",
3-
"reporter": ["lcovonly", "text-summary", "html"]
3+
"reporter": [
4+
"lcovonly",
5+
"text-summary",
6+
"html"
7+
],
8+
"statements": 53,
9+
"branches": 38,
10+
"functions": 52,
11+
"lines": 54
412
}

0 commit comments

Comments
 (0)