Skip to content

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

Merged
kazrael2119 merged 8 commits into
mainfrom
copilot/typespec-ts-fail-to-build-multi-client-packages
Jul 28, 2026
Merged

[typespec-ts] Sync tsconfig.src include with warp exports for multi-client packages#4872
kazrael2119 merged 8 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
@kazrael2119
kazrael2119 marked this pull request as ready for review July 17, 2026 02:55
@kazrael2119

Copy link
Copy Markdown
Member

@copilot resolve conflicts

…ail-to-build-multi-client-packages

# Conflicts:
#	packages/typespec-ts/src/metadata/build-ts-config.ts

Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve conflicts

Resolved the conflict in build-ts-config.ts (merged main in f1edda4). Kept both main's compilerOptions.resolveJsonModule and the getSrcIncludePaths(exports) include change. Build and metadata unit tests pass.

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-ts@4872

commit: c14f9cd

Comment thread packages/typespec-ts/src/metadata/build-ts-config.ts
Comment thread packages/typespec-ts/src/metadata/build-ts-config.ts Outdated
Comment thread packages/typespec-ts/src/index.ts Outdated

@JialinHuang803 JialinHuang803 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.

Overall looks good to me. Just left some suggestions to simplify the comments.

kazrael2119 and others added 4 commits July 28, 2026 10:38
Co-authored-by: JialinHuang803 <139532647+JialinHuang803@users.noreply.github.com>
Co-authored-by: JialinHuang803 <139532647+JialinHuang803@users.noreply.github.com>
Co-authored-by: JialinHuang803 <139532647+JialinHuang803@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @azure-tools/typespec-ts
Show changes

@azure-tools/typespec-ts - fix ✏️

Fix multi-client package build failures by syncing the generated config/tsconfig.src.*.json include lists with the warp.config.yml exports, so every client entry point is compiled and emitted to dist (previously warp failed with DIST_MISSING).

@kazrael2119
kazrael2119 added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit 008ad69 Jul 28, 2026
31 checks passed
@kazrael2119
kazrael2119 deleted the copilot/typespec-ts-fail-to-build-multi-client-packages branch July 28, 2026 03:29
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

3 participants