Skip to content

Commit 98b9c97

Browse files
TheLarkInnclaude
andcommitted
test(rush-lib): verify version bump eligibility and publish dispatch for VSIX
Add tests verifying VS Code extensions use individual versioning (no lockstep policy) and only target the 'vsix' publish provider, ensuring correct dispatch through the publish pipeline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f3b9c82 commit 98b9c97

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,60 @@ describe(RushConfiguration.name, () => {
458458
expect(vscodeShared).toBeDefined();
459459
expect(vscodeShared!.shouldPublish).toBe(false);
460460
});
461+
462+
it('verifies VS Code extensions are eligible for version bumping (no lockstep policy)', () => {
463+
const rushJsonPath: string = path.resolve(__dirname, '../../../../../rush.json');
464+
const rushJson: IRushJson = JsonFile.load(rushJsonPath) as IRushJson;
465+
466+
const vsixProjectNames: string[] = [
467+
'rushstack',
468+
'@rushstack/rush-vscode-command-webview',
469+
'debug-certificate-manager',
470+
'playwright-local-browser-server'
471+
];
472+
473+
for (const projectName of vsixProjectNames) {
474+
const entry: IRushJsonProjectEntry | undefined = rushJson.projects.find(
475+
(p: IRushJsonProjectEntry) => p.packageName === projectName
476+
);
477+
expect(entry).toBeDefined();
478+
// shouldPublish must be true for rush version --bump to process the project
479+
expect(entry!.shouldPublish).toBe(true);
480+
// Must not have a lockstep version policy with publishTarget 'none'
481+
// (no versionPolicyName means individual versioning, which is compatible with vsix)
482+
expect(entry!.publishTarget).toEqual(['vsix']);
483+
// Extensions should not have a lockstep version policy
484+
// (they use individual versioning for independent VSIX releases)
485+
expect(entry!.versionPolicyName).toBeUndefined();
486+
}
487+
});
488+
489+
it('verifies publish dispatch path: vsix projects do not include npm target', () => {
490+
const rushJsonPath: string = path.resolve(__dirname, '../../../../../rush.json');
491+
const rushJson: IRushJson = JsonFile.load(rushJsonPath) as IRushJson;
492+
493+
const vsixProjectNames: string[] = [
494+
'rushstack',
495+
'@rushstack/rush-vscode-command-webview',
496+
'debug-certificate-manager',
497+
'playwright-local-browser-server'
498+
];
499+
500+
for (const projectName of vsixProjectNames) {
501+
const entry: IRushJsonProjectEntry | undefined = rushJson.projects.find(
502+
(p: IRushJsonProjectEntry) => p.packageName === projectName
503+
);
504+
expect(entry).toBeDefined();
505+
const targets: string[] = Array.isArray(entry!.publishTarget)
506+
? entry!.publishTarget
507+
: [entry!.publishTarget!];
508+
// VSIX projects must only have 'vsix' target (not 'npm')
509+
// This ensures rush publish dispatches to VsixPublishProvider, not NpmPublishProvider
510+
expect(targets).toEqual(['vsix']);
511+
expect(targets).not.toContain('npm');
512+
expect(targets).not.toContain('none');
513+
}
514+
});
461515
});
462516

463517
describe(RushConfigurationProject.name, () => {

0 commit comments

Comments
 (0)