Skip to content

Commit f3b9c82

Browse files
TheLarkInnclaude
andcommitted
test(rush-lib): verify VS Code extension publishTarget configuration
Add tests that validate the 4 VS Code extension projects in rush.json are correctly configured with shouldPublish: true and publishTarget: ["vsix"], and that vscode-shared remains unpublished. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6c61a5f commit f3b9c82

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

libraries/rush-lib/src/api/test/RushConfiguration.test.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,54 @@ describe(RushConfiguration.name, () => {
412412
});
413413
});
414414

415+
describe('VS Code extension project configuration', () => {
416+
interface IRushJsonProjectEntry {
417+
packageName: string;
418+
projectFolder: string;
419+
shouldPublish?: boolean;
420+
publishTarget?: string | string[];
421+
[key: string]: unknown;
422+
}
423+
424+
interface IRushJson {
425+
projects: IRushJsonProjectEntry[];
426+
[key: string]: unknown;
427+
}
428+
429+
it('verifies 4 VS Code extensions have shouldPublish and publishTarget: ["vsix"]', () => {
430+
// Load the real rush.json from the repo root
431+
const rushJsonPath: string = path.resolve(__dirname, '../../../../../rush.json');
432+
const rushJson: IRushJson = JsonFile.load(rushJsonPath) as IRushJson;
433+
434+
const vsixProjectNames: string[] = [
435+
'rushstack',
436+
'@rushstack/rush-vscode-command-webview',
437+
'debug-certificate-manager',
438+
'playwright-local-browser-server'
439+
];
440+
441+
for (const projectName of vsixProjectNames) {
442+
const entry: IRushJsonProjectEntry | undefined = rushJson.projects.find(
443+
(p: IRushJsonProjectEntry) => p.packageName === projectName
444+
);
445+
expect(entry).toBeDefined();
446+
expect(entry!.shouldPublish).toBe(true);
447+
expect(entry!.publishTarget).toEqual(['vsix']);
448+
}
449+
});
450+
451+
it('verifies @rushstack/vscode-shared is NOT configured to publish', () => {
452+
const rushJsonPath: string = path.resolve(__dirname, '../../../../../rush.json');
453+
const rushJson: IRushJson = JsonFile.load(rushJsonPath) as IRushJson;
454+
455+
const vscodeShared: IRushJsonProjectEntry | undefined = rushJson.projects.find(
456+
(p: IRushJsonProjectEntry) => p.packageName === '@rushstack/vscode-shared'
457+
);
458+
expect(vscodeShared).toBeDefined();
459+
expect(vscodeShared!.shouldPublish).toBe(false);
460+
});
461+
});
462+
415463
describe(RushConfigurationProject.name, () => {
416464
it('correctly updates the packageJson property after the packageJson is edited by packageJsonEditor', async () => {
417465
const rushConfiguration: RushConfiguration = RushConfiguration.loadFromConfigurationFile(

0 commit comments

Comments
 (0)