Skip to content

Commit 0cc2614

Browse files
authored
attempt at migrating to node 20 (#673)
1 parent e63fe9e commit 0cc2614

File tree

16 files changed

+349
-325
lines changed

16 files changed

+349
-325
lines changed

.devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# see https://github.com/microsoft/vscode-dev-containers/tree/main/containers
2-
ARG VARIANT="16"
2+
ARG VARIANT="20"
33
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
44

55
ENV PATH="/opt/emsdk/upstream/emscripten:${PATH}"

.devcontainer/devcontainer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"name": "Node.js + C++",
44
"build": {
55
"dockerfile": "Dockerfile",
6-
// Node v16
7-
"args": { "VARIANT": "16" }
6+
"args": { "VARIANT": "20" }
87
},
98
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
109

.github/workflows/c-cpp.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
key: ${{env.EM_VERSION}}-${{ runner.os }}
3232
- uses: actions/setup-node@v3
3333
with:
34-
node-version: "16"
34+
node-version: "20"
3535
cache: yarn
3636
registry-url: 'https://registry.npmjs.org'
3737
- uses: mymindstorm/setup-emsdk@v12
@@ -41,7 +41,7 @@ jobs:
4141
# setup node again, in case emsdk messed it up
4242
- uses: actions/setup-node@v3
4343
with:
44-
node-version: "16"
44+
node-version: "20"
4545
cache: yarn
4646
registry-url: 'https://registry.npmjs.org'
4747
- run: yarn install --frozen-lockfile

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fetch-depth: 0
1717
- uses: actions/setup-node@v3
1818
with:
19-
node-version: "16"
19+
node-version: "20"
2020
cache: yarn
2121
- run: yarn install --frozen-lockfile
2222
- name: Build tools

cli/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@
2727
"directory": "cli"
2828
},
2929
"engines": {
30-
"node": ">=16"
30+
"node": ">=20"
3131
},
3232
"license": "MIT",
3333
"devDependencies": {
3434
"@devicescript/dap": "*",
3535
"@devicescript/compiler": "*",
3636
"@devicescript/interop": "*",
3737
"@devicescript/vm": "*",
38-
"@types/debounce-promise": "^3.1.6",
39-
"@types/fs-extra": "^11.0.1",
40-
"@types/node": "^16",
41-
"@types/update-notifier": "^6.0.2",
42-
"commander": "^10.0.0",
38+
"@types/debounce-promise": "^3.1.9",
39+
"@types/fs-extra": "^11.0.4",
40+
"@types/node": "^20",
41+
"@types/update-notifier": "^6.0.8",
42+
"commander": "^11.1.0",
4343
"debounce-promise": "^3.1.2",
4444
"jacdac-ts": "*",
45-
"fast-glob": "^3.2.12",
45+
"fast-glob": "^3.3.2",
4646
"faye-websocket": "^0.11.4",
47-
"fs-extra": "^11.1.0"
47+
"fs-extra": "^11.2.0"
4848
},
4949
"dependencies": {
50-
"update-notifier": "^6.0.2"
50+
"update-notifier": "^7.0.0"
5151
},
5252
"optionalDependencies": {
53-
"serialport": "^10.5.0"
53+
"serialport": "^12.0.0"
5454
},
5555
"publishConfig": {
5656
"access": "public"

cli/src/init.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ to the VS Code extension
218218

219219
const optionalFiles: FileSet = {
220220
".devcontainer/devcontainer.json": {
221-
image: "mcr.microsoft.com/devcontainers/javascript-node:18",
221+
image: "mcr.microsoft.com/devcontainers/javascript-node:20",
222222
features: {
223223
"ghcr.io/devcontainers/features/node:1": {},
224224
"ghcr.io/devcontainers/features/github-cli:1": {},

cli/src/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../../tsconfig-base.json",
33
"compilerOptions": {
4-
"module": "node16",
4+
"module": "NodeNext",
55
"declarationDir": "../built/types",
66
"outDir": "../built",
77
"types": ["node"]

compiler/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
"./built/**"
2727
],
2828
"engines": {
29-
"node": ">=16"
29+
"node": ">=20"
3030
},
3131
"license": "MIT",
3232
"devDependencies": {
3333
"@devicescript/interop": "*",
34-
"@types/fs-extra": "^11.0.1",
35-
"@types/node": "^16",
36-
"esbuild": "^0.17.11",
34+
"@types/fs-extra": "^11.0.4",
35+
"@types/node": "^20",
36+
"esbuild": "^0.19.9",
3737
"jacdac-ts": "*",
3838
"typescript": "^4.9.5"
3939
},

dap/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
},
2222
"license": "MIT",
2323
"devDependencies": {
24-
"@types/node": "^16",
24+
"@types/node": "^20",
2525
"async-mutex": "^0.4.0",
2626
"@devicescript/compiler": "*",
2727
"@devicescript/vm": "*",
28-
"@vscode/debugadapter": "^1.58.0",
28+
"@vscode/debugadapter": "^1.64.0",
2929
"jacdac-ts": "*"
3030
},
3131
"dependencies": {},

interop/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
],
2323
"license": "MIT",
2424
"devDependencies": {
25-
"esbuild": "^0.14.11",
26-
"typescript": "^4.5.4"
25+
"esbuild": "^0.19.9",
26+
"typescript": "^4.9.5"
2727
},
2828
"dependencies": {
2929
"json5": "^2.2.3"

interop/src/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export const MIN_NODE_VERSION = 16
1+
export const MIN_NODE_VERSION = 20
22
export const MARKETPLACE_EXTENSION_ID = "devicescript.devicescript-vscode"

interop/src/errors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const errors: Record<string, string> = {
44
"can't connect, no HF2 nor JDUSB": "no-hf2",
55
"esptool cannot connect": "esptool-cannot-connect",
66
"I2C device not found or malfunctioning": "i2c-device-not-found-or-malfunctioning",
7-
"Unable to locate Node.JS v16+.": "terminal-nodemissing",
7+
"Unable to locate Node.JS.": "terminal-nodemissing",
88
"Install @devicescript/cli package": "terminal-notinstalled",
99
"missing \"devicescript\" section": "missing-devicescript-section",
1010
"No DeviceScript device found.": "no-devicescript-device-found",

package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@
5858
],
5959
"devDependencies": {
6060
"auto-changelog": "^2.4.0",
61-
"esbuild": "^0.17.11",
62-
"semver": "^7.3.8",
63-
"zx": "^7.2.1"
64-
},
65-
"dependencies": {
66-
"prettier": "^3.0.3"
61+
"esbuild": "^0.19.9",
62+
"semver": "^7.5.4",
63+
"zx": "^7.2.3",
64+
"prettier": "^3.1.1"
6765
}
6866
}

vscode/src/devtoolsserver.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -883,11 +883,11 @@ export class DeveloperToolsManager extends JDEventSource {
883883
if (!v) {
884884
showErrorWithHelp(
885885
"terminal.nodemissing",
886-
"Unable to locate Node.JS v16+."
886+
"Unable to locate Node.JS."
887887
)
888888
return undefined
889889
}
890-
if (!(v.major >= 16)) {
890+
if (!(v.major >= MIN_NODE_VERSION)) {
891891
showErrorMessage(
892892
"terminal.nodeversion",
893893
`Node.JS version outdated, found ${v.major}.${v.minor} but needed v16+.`

website/docs/developer/errors.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ are due to invalid configurations, aside from hardware issues with the sensor.
2828
- The I2C address is incorrect. Check the datasheet for the correct address.
2929
- The I2C address is correct, but the sensor is not responding. Check the wiring and the sensor datasheet.
3030

31-
## Unable to locate Node.JS v16+. {#terminal-nodemissing}
31+
## Unable to locate Node.JS. {#terminal-nodemissing}
3232

3333
The Visual Studio Code extension was unable to determine the version of Node.JS.
3434
This may mean that Node.JS is not installed or not in the path,

0 commit comments

Comments
 (0)