Skip to content

build: share API declarations across module formats - #1793

Merged
Eduardo Villalpando Mello (edvilme) merged 2 commits into
mainfrom
api-npm-types
Sep 16, 2026
Merged

Eduardo Villalpando Mello (edvilme) merged 2 commits into
mainfrom
api-npm-types

Conversation

@edvilme

Copy link
Copy Markdown
Contributor

Summary

  • emit the API package declaration files once under out/types
  • point both ESM and CommonJS package exports to the shared declaration entry point
  • keep separate ESM and CommonJS JavaScript builds
  • ensure package validation rejects duplicated declarations under the runtime output directories

Validation

  • npm run compile
  • npm run test:package

Emit the npm package declarations once and point both ESM and CommonJS exports at the shared type tree.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cb57f94f-69e9-4501-a84e-7661b191ceba
@bschnurr

Copy link
Copy Markdown
Member

🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR.

This comment was marked as resolved.

Scan the complete ESM and CommonJS output trees so supporting declaration files cannot be duplicated unnoticed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cb57f94f-69e9-4501-a84e-7661b191ceba
@bschnurr

Copy link
Copy Markdown
Member

Result: 🔴 could-not-verify

Verification details

Verification: Isolated verification observed failures that were not classified as caused by this PR: API compile validation, API package validation, Dependency and test discovery, Offline API dependency bootstrap.

Summary: Verification could not complete because offline dependency setup failed: TypeScript 5.9.3 was absent from the sandbox cache. Consequently, `npm run compile` could not find `tsc`, and `npm run test:package` stopped while attempting network access before reaching its assertions. These failures are environmental rather than attributable to the PR, but no meaningful test completed successfully.

Test runs: 4 failed

  • Failed | unrelated to this PR | API compile validation | npm run compile
  • Failed | unrelated to this PR | API package validation | npm run test:package
  • Failed | unrelated to this PR | Dependency and test discovery | printf 'sandbox_profile=%s\n' "$AUTOMATION_SANDBOX_PROFILE"; printf 'node='; node --version; printf 'npm='; npm --version; if [ -d node_modules ]; then echo 'root_node_modules=present'; else echo 'root_node_modules=missing'; fi; if [ -d api/node_modules ]; then echo 'api_node_modules=present'; else echo 'api_node_modules=missing'; fi; echo 'api scripts:'; node -e "const p=require('./api/package.json'); console.log(JSON.stringify(p.scripts,null,2))"; echo 'changed files:'; git diff --name-status HEAD^ HEAD; echo 'api diff:'; git diff --unified=3 HEAD^ HEAD -- api/package.json api/scripts/test-package.cjs api/tsconfig.base.json api/tsconfig.types.json
  • Failed | unrelated to this PR | Offline API dependency bootstrap | npm ci --offline
API compile validation diagnostic output
> @vscode/python-environments@1.4.0 compile:types
> tsc -b ./tsconfig.types.json

sh: 1: tsc: not found
API package validation diagnostic output
npm error code EAI_AGAIN
npm error request to https://packagefeedproxy.microsoft.io/npm/@types%2fnode failed, reason: getaddrinfo EAI_AGAIN packagefeedproxy.microsoft.io
Error: Command failed: npm install --ignore-scripts --no-package-lock --no-save ...
The package assertions were not reached.
Dependency and test discovery diagnostic output
sandbox_profile=typescript
node=v22.21.1
npm=10.9.4
root_node_modules=missing
api_node_modules=missing
error: Could not access 'HEAD^'
Offline API dependency bootstrap diagnostic output
npm error code ENOTCACHED
npm error request to https://packagefeedproxy.microsoft.io/npm/typescript/-/typescript-5.9.3.tgz failed: cache mode is 'only-if-cached' but no cached response is available.

@bschnurr Bill Schnurr (bschnurr) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) added the review-auto:approved Automated review: no blocking findings (approval posted). label Sep 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved via Review Center.

@edvilme
Eduardo Villalpando Mello (edvilme) merged commit c3bb837 into main Sep 16, 2026
86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code quality issues review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants