Add local-vscode-extension-rig and migrate VS Code extensions to it#5849
Draft
iclanton wants to merge 3 commits into
Draft
Add local-vscode-extension-rig and migrate VS Code extensions to it#5849iclanton wants to merge 3 commits into
iclanton wants to merge 3 commits into
Conversation
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.
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.
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.
Summary
Adds a new local
local-vscode-extension-rigand migrates the repo's VS Code extension projects from the public@rushstack/heft-vscode-extension-rigto it. The new rig delegates tolocal-node-rigand no longer enablesskipLibCheck, 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.tsfiles. The new rig does not, sotscnow 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-extensionvscode-extensions/debug-certificate-manager-vscode-extensionvscode-extensions/playwright-local-browser-server-vscode-extensionType 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-electronfor VS Code integration tests). Overrodetypesto["mocha", "node"]in the project'stsconfig.json.rush-vscode-command-webview(TS2315):IFromExtensionMessagelived infromExtension.tsalongsidefromExtensionListener, which uses the DOM-genericMessageEvent<T>. When the Node-based extension imported the type via the package barrel,MessageEventresolved to the non-generic@types/nodedeclaration. Extracted the contract into a new DOM-free modulesrc/Message/IFromExtensionMessage.tsand 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'stsconfig.json, matching the existing convention inapps/playwright-browser-tunnel.rush-vscode-extension/src/test/suite/index.ts(TS2794): real source bug —new Promise(...)inferredPromise<unknown>soresolve()required an argument.Also includes
eslint --fiximport-order andnode:protocol cleanups picked up by the pre-commit hook.Notes
rush changefiles were added: all affected projects are non-published (privaterigs/webview, orvsix-tagged apps /shouldPublish: false).rush change --verifypasses.@vscode/test-electron1.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 buildacross all migrated projects + dependents: green (lint warnings only, all pre-existing/unrelated).rush test --only .on the affected projects: passes.rush change --verify: passes.