Skip to content

[typespec-ts] Sync tsconfig.src include with warp exports for multi-client packages#4872

Draft
kazrael2119 with Copilot wants to merge 2 commits into
mainfrom
copilot/typespec-ts-fail-to-build-multi-client-packages
Draft

[typespec-ts] Sync tsconfig.src include with warp exports for multi-client packages#4872
kazrael2119 with Copilot wants to merge 2 commits into
mainfrom
copilot/typespec-ts-fail-to-build-multi-client-packages

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Multi-client packages failed to build with DIST_MISSING: the generated config/tsconfig.src.*.json files hardcoded include: ["../src/index.ts"], while warp.config.yml exported every client's entry point as a separate subpath (./devCenter./src/devCenter/index.ts). Since the root src/index.ts imports the deeper client/api files directly instead of re-exporting the per-client barrels, TypeScript never emitted those barrels to dist, and warp's export validation failed.

Changes

  • build-ts-config.ts: New getSrcIncludePaths(exports) derives the include list from the same exports map that drives warp.config.yml — mapping ./src/...../src/..., dropping non-.ts values (e.g. package.json), de-duplicating, and always keeping ../src/index.ts as fallback. The four buildTsSrc{Esm,Browser,ReactNative,Cjs}Config builders now take exports.
  • index.ts: Threads modularPackageInfo.exports into the buildTsSrc*Config builders in both the initial-generation and update/migration paths, keeping the tsconfig inputs and warp exports in sync.
  • Tests: test-next/unit/metadata/ts-config.test.ts covering default fallback, multi-client sync, non-.ts filtering, de-duplication, and per-target propagation.

For the multi-client example in the issue, the emitted configs now include every exported barrel:

// config/tsconfig.src.esm.json
"include": [
  "../src/index.ts",
  "../src/devCenter/index.ts",
  "../src/devCenter/api/index.ts",
  "../src/devBoxes/index.ts",
  "../src/deploymentEnvironments/index.ts",
  "../src/models/index.ts"
]

…ti-client

Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:typescript Issues for @azure-tools/typespec-ts emitter label Jul 13, 2026
Copilot AI changed the title [WIP] Fix build failure for multi-client packages in typespec-ts [typespec-ts] Sync tsconfig.src include with warp exports for multi-client packages Jul 13, 2026
Copilot AI requested a review from kazrael2119 July 13, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:typescript Issues for @azure-tools/typespec-ts emitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[typespec-ts] Fail to build multi-client packages

2 participants