Repository navigation
Require Node.js 22 and update dependencies - #1365
Draft
Christof Marti (chrmarti) wants to merge 6 commits into
Draft
Christof Marti (chrmarti) wants to merge 6 commits into
Christof Marti (chrmarti) wants to merge 6 commits into
Conversation
Node.js 20 is end-of-life, and the security fixes for tar are only available in tar 8, which requires Node.js 22. - Update tar to 8, proxy-agent to 8, yargs to 18, chalk to 6, js-yaml to 5 and node-pty to the 1.2.0 beta that VS Code uses. - Update chai to 6, mocha to 12 and TypeScript to 6, and override mocha's glob and minimatch with patched versions. - Map import.meta in the CommonJS bundle and ship pac-proxy-agent's quickjs.wasm next to it. - Remove Dependabot holds that are no longer needed and hold TypeScript 7, which has no JS API yet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The js-yaml upgrade disables merge keys by default, causing merged Compose project names to be missed and potentially selecting or creating containers under the wrong project.
1 open issue
What changed in this PR
Moves the Dev Containers CLI to Node.js 22.12+ to enable dependency upgrades and security fixes.
Changes:
- Updates runtime and development dependencies, overrides, and Dependabot policies.
- Adapts CommonJS bundling and archive handling to upgraded libraries.
- Aligns CI, installer defaults, development containers, and documentation with Node.js 22.
| File | Description |
|---|---|
yarn.lock |
Locks upgraded dependencies. |
tsconfig.base.json |
Updates module resolution and Node types. |
src/spec-node/typings/zlib-zstd.d.ts |
Removes obsolete Zstd stubs. |
src/spec-configuration/typings/zlib-zstd.d.ts |
Removes obsolete Zstd stubs. |
src/spec-configuration/containerCollectionsOCI.ts |
Adapts extraction filtering to tar 8. |
scripts/install.sh |
Defaults installations to Node.js 22. |
package.json |
Raises Node minimum, upgrades dependencies, and ships WASM. |
esbuild.js |
Supports bundled import metadata and PAC proxy WASM. |
docs/contributing-code.md |
Updates Node.js prerequisites. |
CHANGELOG.md |
Documents runtime and dependency upgrades. |
.github/workflows/test-windows.yml |
Runs Windows tests on Node.js 22. |
.github/workflows/test-docker-v29.yml |
Uses Node.js 22 for Docker 29 tests. |
.github/workflows/test-docker-v20.yml |
Uses Node.js 22 for Docker 20 tests. |
.github/workflows/dev-containers.yml |
Moves CI jobs to Node.js 22. |
.github/dependabot.yml |
Revises dependency upgrade holds. |
.devcontainer/Dockerfile |
Defaults the development image to Node.js 22. |
.devcontainer/devcontainer.json |
Selects the Node.js 22 image variant. |
Review effort: Balanced
js-yaml 5 loads YAML 1.2 without merge keys by default, so a project name supplied through a merge was missed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
yargs converted numeric exec arguments to numbers, so `1.0` became 1. node-pty 1.2 expects strings when spawning and corrupted memory with a number, crashing `exec` in a terminal for `[ -t 1 ]` (exit code 139). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The tar rewrite, beta node-pty upgrade, and external WASM packaging require Linux/macOS integration CI and packaged PAC proxy confirmation beyond the documented Windows-only runtime validation.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ship a single bundle file again, so consumers that copy the bundle don't need to copy quickjs.wasm along with it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Node.js 20 is end-of-life, and the security fixes for
tar(7 high-severity alerts) are only intar8, which requires Node.js 22. This moves the CLI to Node.js 22 and updates all held-back dependencies except TypeScript 7.It fixes all 11 open Dependabot alerts: tar (136-142), follow-redirects (132), basic-ftp (131), minimatch (134) and glob (135). It supersedes #1360, which fails CI because
chalk6 requires Node.js 22.Changes
enginesis>=22.12.0(the minimum of yargs 18 and mocha 12). CI, theinstall.shdefault, the dev container and the contributing docs move from 20 to 22.@types/js-yamlis removed because js-yaml 5 ships its own types.mocha/glob^14.0.7andmocha/minimatch^11.0.10, because mocha 12.0.3 still declaresglob ^13andminimatch ^10(fixes pending in fix(deps): update dependency glob to v14 [security] mochajs/mocha#6500 and fix(deps): update dependency minimatch to v11 [security] mochajs/mocha#6480). Thebasic-ftpoverride is removed; proxy-agent 8 bringsbasic-ftp ^6.2.4.<<) by default. Compose YAML is now loaded with merge keys enabled, so a projectnamesupplied through a merge is found again.execarguments: yargs converted numericexecarguments to numbers (1.0became1,0x10became16). node-pty 1.0.0 converted them back to strings, but node-pty 1.2's N-APIspawncorrupts memory with a number, which crashedexecin a terminal for[ -t 1 ](exit code 139). Positional number parsing is now off forexec, so arguments are passed on verbatim.Notes for reviewers
tsconfig.base.json:"module": "node20"lets TypeScript resolve therequiretypes of ESM-only packages (tar 8, proxy-agent 8)."types": ["node"]is needed because TypeScript 6 defaultstypesto[].esbuild.js:import.meta.urlandimport.meta.resolve, which yargs 18 and pac-proxy-agent 9 use. This replaces the yargs 17 shim.quickjs.wasmthroughimport.meta.resolve. It is patched to use the wasm inlined into the bundle as base64, so the CLI is still a single file. The build fails if the patch no longer matches.filtercallback always receives aReadEntrynow, sogetBlobusesentry.typedirectly. Thezlib-zstd.d.tsstubs, added for tar 7's minizlib types under @types/node 20, are removed because @types/node 22 has these types.package.jsonhas no dependencies, and VS Code supplies its own node-pty (1.2.0-beta.19), so this only affects development and CI. 1.1.0, the latest stable, has broken spawn-helper permissions (fix: ensure spawn-helper is executable for macos prebuilds microsoft/node-pty#866). beta.19 ships prebuilt binaries for all platforms.Validation
Locally on Windows with Node.js 22.23.5: type-check, lint,
yarn packageand 210 Docker-free unit tests, including the Feature download and extraction tests. From the unpacked npm package withoutnode_modules:--help,--version, unknown-option errors,features info,templates applywith omitted paths (tar extract filter),features package(tar create), PAC proxy to a dead proxy and to DIRECT, and a plainHTTPS_PROXY. The Docker test suites, Linux, macOS andinstall.share covered by CI.