Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ test/
quickActions.test.ts Quick action command building, path containment, patch merge (95 tests)
verifyMcp.test.ts MCP server verify and JSON-RPC response parsing (15 tests)
downloadIntegration.test.ts HTTP download, redirect, streaming SHA-256 (12 tests)
packageEngines.test.ts engines.node major meets installed vsce and ovsx floors (1 test)
suite/
index.ts VS Code extension integration tests
runExtensionTests.ts Test runner using @vscode/test-electron
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm run compile
npm test
```

**Requirements:** Node.js 20+ and VS Code 1.90+.
**Requirements:** Node.js 22+ and VS Code 1.90+. Packaging uses `@vscode/vsce` 4, which does not run on Node 20. `.nvmrc` pins 22.

## Development workflow

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"engines": {
"vscode": "^1.90.0",
"node": ">=20"
"node": ">=22"
},
"icon": "images/logo-512.png",
"galleryBanner": {
Expand Down
38 changes: 38 additions & 0 deletions test/unit/packageEngines.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import path from "node:path";
import test from "node:test";

const repoRoot = path.resolve(__dirname, "../../..");

function enginesNode(packageJsonPath: string): string {
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8")) as {
engines?: { node?: string };
};
const node = pkg.engines?.node;
if (typeof node !== "string") {
throw new Error(`missing engines.node in ${packageJsonPath}`);
}
return node;
}

function nodeMajor(enginesNodeSpec: string): number {
const match = /(\d+)/.exec(enginesNodeSpec);
assert.ok(match, `cannot parse engines.node major from ${enginesNodeSpec}`);
return Number(match[1]);
}

test("engines.node major meets installed vsce and ovsx floors", () => {
const extensionNode = enginesNode(path.join(repoRoot, "package.json"));
const vsceNode = enginesNode(path.join(repoRoot, "node_modules/@vscode/vsce/package.json"));
const ovsxNode = enginesNode(path.join(repoRoot, "node_modules/ovsx/package.json"));
const extensionMajor = nodeMajor(extensionNode);
assert.ok(
extensionMajor >= nodeMajor(vsceNode),
`engines.node ${extensionNode} is below @vscode/vsce ${vsceNode}`
);
assert.ok(
extensionMajor >= nodeMajor(ovsxNode),
`engines.node ${extensionNode} is below ovsx ${ovsxNode}`
);
});
Loading