Skip to content

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

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

Timothee Guerin (timotheeguerin) wants to merge 3 commits 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: 4042ed7

@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

azure-sdk-automation Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@microsoft-github-policy-service microsoft-github-policy-service Bot added the stale Mark a PR that hasn't been recently updated and will be closed. label Nov 17, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Hi @Timothee Guerin (@timotheeguerin). Your PR has had no update for 14 days and it is marked as a stale PR. If it is not updated within 14 additional days, the PR will automatically be closed. The stale label is removed automatically when you update or comment on your PR, or when a maintainer reviews it. You can also remove the label manually.

@microsoft-github-policy-service microsoft-github-policy-service Bot removed the stale Mark a PR that hasn't been recently updated and will be closed. label Nov 17, 2026

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