Skip to content

fix(compiler): honor declared identities for subpath emitters - #12464

Draft
Timothee Guerin (timotheeguerin) wants to merge 1 commit into
microsoft:mainfrom
timotheeguerin:fix/subpath-emitter-library-identity
Draft

Timothee Guerin (timotheeguerin) wants to merge 1 commit into
microsoft:mainfrom
timotheeguerin:fix/subpath-emitter-library-identity

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

Subpath emitters currently collapse to their parent package's name: their own options are ignored, default output folders collide, and progress/timing reports cannot distinguish them.

Resolve identity from the entry point's $lib.name during library loading, keeping version/support metadata from package.json. An export @org/emitters/ts declaring $lib.name = "@org/emitters/typescript" can now use:

emit:
  - "@org/emitters/ts"
options:
  "@org/emitters/typescript":
    max-files: 10

Its default output directory and runtime reporting use @org/emitters/typescript, independent of the alias or filesystem path used to load it. Package-keyed options remain a compatibility fallback. To retain an existing shared output directory, set emitter-output-dir explicitly.

Fixes #10200.

Alternative to #12447, following the library-loading feedback on the earlier attempt.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the compiler:core Issues for @typespec/compiler label Nov 2, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/compiler@12464

commit: 344a517

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @typespec/compiler
Show changes

@typespec/compiler - fix ✏️

Resolve emitters exported from package subpaths using their declared $lib.name, giving each emitter its own options, default output directory, and runtime reporting. Package-keyed options remain supported as a fallback.

@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

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

compiler:core Issues for @typespec/compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Emitter options not resolved for subpath export emitters

1 participant