Skip to content

eng: Prepare 1.2.0 with shared build, lint, and test tooling - #2412

Open
Brandon Waterloo [MSFT] (bwateratmsft) wants to merge 61 commits into
mainfrom
bwateratmsft-copy-plugin-alternatives
Open

Brandon Waterloo [MSFT] (bwateratmsft) wants to merge 61 commits into
mainfrom
bwateratmsft-copy-plugin-alternatives

Conversation

@bwateratmsft

@bwateratmsft Brandon Waterloo [MSFT] (bwateratmsft) commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🤖

Summary

Prepare a stable @microsoft/vscode-azext-eng@1.2.0 release in focused commits:

  • Dependency/compiler updates: upgrade to age-eligible tooling releases, build with native TypeScript 7.0.2, and retain TypeScript 6.0.3 for typescript-eslint. Keep Mocha 11.8.0, Node >=22.17.0, and Node 22 typings. The root .nvmrc remains 22.18, without a package-local Node pin or CI Node-selection changes.
  • Build tooling: replace esbuild-plugin-copy with a public native copy plugin, include Azure utils icon assets, and add browser/webview presets plus an optional Sass plugin subpath. Per-asset mode accepts exact destination permissions or a synchronous permission-transform callback.
  • ESLint: add composable explicit-project and import-restriction helpers, underscore-prefixed unused-binding ignores, and .mts/.cts test support.
  • Test tooling: add independent VS Code and standalone Node/Mocha config factories and an opt-in safe VS Code test-cache linker/CLI. Eng's tests live beside src and share its compiler project, following vscode-azure's layout. Native ESM TypeScript tests exercise built public exports; test/global.test.ts is discovered alongside the suites, without a preload or eng-specific source-resolution hook. Keep local Chai should separate from the public expect globals.
  • Release/documentation: remove the alpha publishing tag, update migration guidance, explain npm/pnpm compiler resolution, and record the conditional TypeScript 7.1 API consolidation TODO.

Compatibility notes

  • Minimum engineering-tools Node version is 22.17.0; this does not independently prescribe an extension's minimum VS Code engine.
  • Eng uses one tsconfig with rootDir: "." and default file inclusion. Remove the explicit include, separate test tsconfig, and build:check script. Both builds check source and tests. TypeScript resolves package self-imports back to source using rootDir/outDir; no paths aliases or pre-existing build outputs are needed for the initial type-check.
  • Production output now lives under dist/esm/src and dist/cjs/src; exports, declaration targets, the CLI bin, and lockfile bin metadata point to those paths. Public package subpath names are unchanged. Emitted tests are excluded from the archive. Anchor the source-folder packaging exclusion to the package root so it does not exclude the new production output.
  • The test script remains just mocha. CI builds first; local developers run npm run build before npm test because tests exercise built public helpers. Native TypeScript test files run directly, not their emitted JavaScript. Mocha retains its default two-second timeout. The test/*.test.{ts,mts} glob includes the local assertion setup; remove the import node option entirely. Only type-stripping and experimental-warning options remain.
  • Production ESM imports retain JavaScript extensions; rewriteRelativeImportExtensions remains removed. The shared resolver and its registration are unchanged from main: retain asynchronous module.register() and the existing extensionless .ts/.js lookup. Remove the temporary synchronous-hook migration and all explicit JavaScript source fallbacks. Consumer presets still transform enums; eng's harness only strips types. Consumer default test paths are unchanged.
  • Copy mappings use a source directory plus optional include patterns and preserve relative directory structure. Copying runs after each build, without independent asset watching or stale-file removal. Downstream custom copying requires a separate migration.
  • Copy permission overrides are POSIX-only and destination-only. mode: 0o755 sets permissions; mode: current => current | 0o100 adds owner-execute. Invalid modes, callback errors, and chmod errors fail the build; source/destination aliases are rejected before chmod. Windows ignores overrides without logging or invoking callbacks; JSDoc says "Ignored on Windows." Source permission changes in node_modules remain separate.
  • Sass and test-cache linking remain opt-in. Linked VS Code tests must run serially because the whole cache directory is shared. TypeScript 7.1 consolidation depends on typescript-eslint supporting its new compiler API.

Validation

The single-project/test simplification was validated from eng, including a build with both output directories removed beforehand. After removing redundant paths, native TS7, TypeScript 6, and typed ESLint passed with neither output directory present. After restoring the original asynchronous hook, ESM/CJS builds, typed lint, and the full native test suite passed again on Node 22. The latest global.test.ts discovery change passed full suites on actual Node 22.17.0 and Node 24.18 with no preload option, plus both module-target type-checks and typed lint.

Command Result
npm run build Passed for the layout change: native TS7 ESM/CJS builds check source and tests together, without a separate test project
npm run lint Passed: typed lint covers source and sibling tests
npm test -- --reporter dot Passed with setup discovered by the test glob on Node 24.18: 28 passing, 5 POSIX-only pending
npm exec --offline --package=node@22.17.0 -- node node_modules\@typescript\native\bin\tsc --noEmit --incremental false Passed again with global.test.ts; also previously passed without aliases or build outputs
npm exec --offline --package=node@22.17.0 -- node node_modules\@typescript\native\bin\tsc --noEmit --incremental false --outDir .\dist\cjs --module nodenext --moduleResolution nodenext --declaration false Passed: renamed setup type-checks under the CommonJS build's module settings
npm exec --offline --package=node@22.17.0 -- node node_modules\typescript\bin\tsc --noEmit --incremental false Passed on TypeScript 6 without aliases or build outputs
npm exec --offline --package=node@22.17.0 -- node node_modules\@typescript\native\bin\tsc Passed with the original asynchronous hook
npm exec --offline --package=node@22.17.0 -- node node_modules\@typescript\native\bin\tsc --outDir .\dist\cjs --module nodenext --moduleResolution nodenext --declaration false Passed with the original asynchronous hook
npm exec --offline --package=node@22.17.0 -- node node_modules\mocha\bin\mocha.js --reporter dot Passed with setup discovered by the test glob and no preload: 28 passing, 5 pending
npm test -- --grep 'Node Mocha factory' Passed on Node 24.18 with the original asynchronous hook: 1 passing
npm exec --offline --package=node@22.17.0 -- node node_modules\mocha\bin\mocha.js --reporter dot --grep 'cache CLI' Passed: actual published CommonJS CLI exercised after changing its test target; 1 passing
npm exec --offline --package=node@22.18.0 -- node node_modules\eslint\bin\eslint.js --max-warnings 0 Passed again with global.test.ts and no preload
npm pack --dry-run --json Passed: file-selection assertions confirm every export/declaration/CLI target is included, with no tests, source code, tsconfigs, or build info
npm pack --json --pack-destination <session artifact directory> Passed for the layout change: actual tar listing verified 70 entries and all public targets; previous consumer archives preserved, no reinstall requested
git diff --check Passed

All six CommonJS public helper entry points also loaded on actual Node 22.17.0. The integration fixture covers extensionless TypeScript preference, existing JavaScript imports, CommonJS resolution, enum transformation, and shared globals. Package/declaration integration verifies ESM exports and loading without the optional Sass peer. Existing typeless-package warnings remain visible.

Earlier validation of the unchanged copy implementation on Ubuntu/WSL with actual Node 22.17.0 and Linux esbuild 0.28.2 passed 14 tests, with 1 Windows-only pending, using node --experimental-strip-types --disable-warning=ExperimentalWarning node_modules/mocha/bin/mocha.js --no-config --no-package --reporter dot "src/test/copyPlugin.test.mts" before relocation. POSIX checks were not rerun for this configuration-only simplification.

Locked dependency versions remain those in the previously audited Node 22 lock: all 295 releases were published on or before 2026-10-05T15:06:58.056Z. This simplification changes only root CLI bin metadata in the lockfile.

Use native TypeScript 7 for builds and retain the TypeScript 6 API for ESLint. Keep Mocha 11 and Node 22 typings, resolving dependencies with a seven-day publication cutoff.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Replace esbuild-plugin-copy with a public native copy plugin, include Azure utils icon assets, and add webview presets with an optional Sass subpath. Cover native copying with integration tests and exclude compiled tests from package contents.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Compose explicit TypeScript lint projects, type-only module boundaries, and lazy import restrictions without replacing rule options. Ignore underscore-prefixed bindings and apply test relaxations to ts, mts, and cts files.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Add immutable VS Code and standalone Node Mocha configuration factories, a safe cache-link helper and CLI, and regression coverage for test, lint, browser, Sass, compiler, and public export behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Remove the alpha publish tag and document native copying, the minimum Node version, compiler isolation and pnpm bin resolution, and the future TypeScript 7.1 API migration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Copilot AI balanced review requested due to automatic review settings October 12, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes release-critical shared tooling, dependency resolution, and cross-platform filesystem behavior across multiple public APIs.

0 open findings

What changed in this PR

Prepares the shared Azure extension engineering package for stable 1.2.0 with updated compilers, build/lint presets, and test infrastructure.

Changes:

  • Adds native asset copying, webview/Sass build support, and updated dependencies.
  • Adds composable ESLint, VS Code, and standalone Mocha configurations.
  • Adds optional shared VS Code test caching and integration coverage.
File Description
eng/​.npmignore Excludes compiled tests from publication.
eng/​MIGRATION.md Documents Node, compiler, and copy-plugin migration.
eng/​README.md Describes compiler separation and Mocha tooling.
eng/​package-lock.json Locks the 1.2.0 dependency graph.
eng/​package.json Defines release metadata, exports, dependencies, and scripts.
eng/​tsconfig.json Explicitly includes Node ambient types.
eng/​src/​cloneConfig.ts Adds configuration cloning support.
eng/​src/​esbuild/​README.md Documents copying, webviews, and Sass.
eng/​src/​esbuild/​copyPlugin.ts Implements native asset copying.
eng/​src/​esbuild/​esbuildConfigs.ts Adds copy and webview presets.
eng/​src/​esbuild/​sassPlugin.ts Adds opt-in Sass compilation.
eng/​src/​eslint/​README.md Documents new lint helpers and behavior.
eng/​src/​eslint/​eslintConfigs.ts Adds composable restrictions and project configuration.
eng/​src/​mocha/​README.md Documents standalone Node/Mocha tests.
eng/​src/​mocha/​config.ts Adds the shared Mocha configuration factory.
eng/​src/​test/​copyPlugin.test.mts Tests native copying behavior.
eng/​src/​test/​sharedTooling.test.mts Covers shared build, lint, and test tooling.
eng/​src/​vscode-test/​README.md Documents config factories and cache sharing.
eng/​src/​vscode-test/​linkTestCache.ts Implements safe test-cache linking.
eng/​src/​vscode-test/​linkTestCacheCli.ts Adds the cache-linking CLI.
eng/​src/​vscode-test/​vscodeTestConfigs.ts Adds independent VS Code config creation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Use a standalone Mocha harness with should and chai-as-promised assertions. Remove duplicated CJS test runs, keep both production build formats, and preserve filesystem, watch, export, and optional-peer regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
Reverts d4bbd1d at user request.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 02654a8c-4ca1-401a-95f0-f672fbcb0c65
@bwateratmsft
Brandon Waterloo [MSFT] (bwateratmsft) marked this pull request as ready for review October 15, 2026 14:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants