Skip to content

Add local-vscode-extension-rig and migrate VS Code extensions to it#5849

Draft
iclanton wants to merge 3 commits into
microsoft:mainfrom
iclanton:add-local-vscode-extension-rig
Draft

Add local-vscode-extension-rig and migrate VS Code extensions to it#5849
iclanton wants to merge 3 commits into
microsoft:mainfrom
iclanton:add-local-vscode-extension-rig

Conversation

@iclanton

Copy link
Copy Markdown
Member

Summary

Adds a new local local-vscode-extension-rig and migrates the repo's VS Code extension projects from the public @rushstack/heft-vscode-extension-rig to it. The new rig delegates to local-node-rig and no longer enables skipLibCheck, which surfaced several pre-existing declaration-file type errors (previously suppressed) plus one genuine source bug. This PR fixes all of them so the affected projects build cleanly.

Why the build broke

The old public rig set "skipLibCheck": true, which silently hid type errors inside .d.ts files. The new rig does not, so tsc now checks declaration files and reports issues that were always present.

Changes

New rig

  • rigs/local-vscode-extension-rig — profiles, eslint includes, heft/typescript/jest/rush-project config, webpack base.

Migrated projects (rig.json, heft.json, rush-project.json, eslint.config.js, webpack.config.js, package.json, tsconfig.json):

  • vscode-extensions/rush-vscode-extension
  • vscode-extensions/debug-certificate-manager-vscode-extension
  • vscode-extensions/playwright-local-browser-server-vscode-extension

Type fixes

  • rush-vscode-extension (TS2403 ×7): the rig forces "types": ["jest", "node"], whose ambient test globals (describe/it/beforeEach) collide with this project's @types/mocha (it uses Mocha + @vscode/test-electron for VS Code integration tests). Overrode types to ["mocha", "node"] in the project's tsconfig.json.
  • rush-vscode-command-webview (TS2315): IFromExtensionMessage lived in fromExtension.ts alongside fromExtensionListener, which uses the DOM-generic MessageEvent<T>. When the Node-based extension imported the type via the package barrel, MessageEvent resolved to the non-generic @types/node declaration. Extracted the contract into a new DOM-free module src/Message/IFromExtensionMessage.ts and re-pointed the barrel at it.
  • playwright-local-browser-server (TS2304): playwright-core's type definitions reference DOM types (Node, HTMLElement, SVGElement). Added "lib": ["DOM"] to the project's tsconfig.json, matching the existing convention in apps/playwright-browser-tunnel.
  • rush-vscode-extension/src/test/suite/index.ts (TS2794): real source bug — new Promise(...) inferred Promise<unknown> so resolve() required an argument.

Also includes eslint --fix import-order and node: protocol cleanups picked up by the pre-commit hook.

Notes

  • No rush change files were added: all affected projects are non-published (private rigs/webview, or vsix-tagged apps / shouldPublish: false). rush change --verify passes.
  • This is the minimal "get green" change. A follow-up could modernize the VS Code test tooling (@vscode/test-electron 1.x → 3.x, adopt @vscode/test-cli) and split unit (Jest) vs. integration (Mocha-in-host) tests, but that is intentionally out of scope here.

Testing

  • rush build across all migrated projects + dependents: green (lint warnings only, all pre-existing/unrelated).
  • rush test --only . on the affected projects: passes.
  • rush change --verify: passes.

Switch the VS Code extension projects from the public heft-vscode-extension-rig to a new local-vscode-extension-rig. The new rig no longer enables skipLibCheck, which surfaced several pre-existing declaration-file type errors plus one source bug.

rush-vscode-extension: override tsconfig 'types' to ['mocha','node'] so the rig's default Jest globals no longer collide with @types/mocha (TS2403). rush-vscode-command-webview: extract IFromExtensionMessage into a DOM-free module so the Node-based extension can consume it without the DOM-generic MessageEvent<T> (TS2315). playwright-local-browser-server: add lib 'DOM' for playwright-core's DOM-referencing type definitions (TS2304).

Also includes eslint --fix import-order and node: protocol cleanups.
iclanton added 2 commits June 25, 2026 20:00
Use async file IO and the rush-sdk packageJson API instead of synchronous reads, mark immutable fields readonly, and return plain arrays from TreeDataProvider.getChildren implementations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

1 participant