Skip to content

Commit

Permalink
chore: use node 20 (LTS) & drop 14, 16 (#142)
Browse files Browse the repository at this point in the history
Node 20 enters LTS tomorrow - build and test on it as the main version.
Node 14 and 16 are both EoL already, drop support for them

BREAKING CHANGE: Drops support for EoL Node 14 and 16
  • Loading branch information
nihalgonsalves authored Oct 23, 2023
1 parent db82caa commit 9021334
Show file tree
Hide file tree
Showing 5 changed files with 1,081 additions and 1,009 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-20
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn format:check
Expand All @@ -16,7 +16,7 @@ jobs:
- run: yarn build
- run: yarn test

- name: test built package
- name: test built package on node@20
run: |
mkdir ../foo
cd ../foo
Expand All @@ -32,4 +32,18 @@ jobs:
assert.strictEqual(esbuildPluginBrowserslist().name, 'esbuild-plugin-browserslist');
assert.strictEqual(resolveToEsbuildTarget(['chrome 90'])[0], 'chrome90');
" > test.js
node -v
node test.js
# Not using a matrix here since it's simpler
# to just duplicate it and not spawn new instances
- uses: actions/setup-node@v3
with:
node-version: 18
- name: test build package on node@18
run: |
cd ../foo
node -v
node test.js
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- run: yarn install --frozen-lockfile
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"dist"
Expand All @@ -34,8 +34,8 @@
"zod": "^3.21.4"
},
"devDependencies": {
"@commitlint/cli": "^17.6.6",
"@commitlint/config-conventional": "^17.6.6",
"@commitlint/cli": "^18.0.0",
"@commitlint/config-conventional": "^18.0.0",
"@nihalgonsalves/esconfig": "^0.6.0",
"@types/debug": "^4.1.8",
"@types/node": "18",
Expand Down
Loading

0 comments on commit 9021334

Please sign in to comment.