Skip to content

Add TCGC exact-name support to TypeScript emitter - #5331

Merged
Qiaoqiao Zhang (qiaozha) merged 5 commits into
Azure:mainfrom
qiaozha:typespec-ts-exact-name
Sep 3, 2026
Merged

Add TCGC exact-name support to TypeScript emitter#5331
Qiaoqiao Zhang (qiaozha) merged 5 commits into
Azure:mainfrom
qiaozha:typespec-ts-exact-name

Conversation

@qiaozha

Copy link
Copy Markdown
Member

Summary

  • honor TCGC exact() names across TypeScript clients, operations, parameters, models, properties, and enum members
  • keep exact names consistent in serializers, classic clients, generated samples/tests, and client hierarchy paths
  • report deduplicated warnings at emission sites when an exact name cannot form a valid TypeScript identifier
  • add focused unit coverage and opt the emitter into the shared exact-name Spector scenario with a generated API baseline

Validation

  • mise exec -- pnpm format
  • mise exec -- pnpm lint
  • mise exec -- pnpm --filter @azure-tools/typespec-ts build
  • mise exec -- pnpm --dir packages/typespec-ts unit-test (669 tests)
  • mise exec -- pnpm --dir packages/typespec-ts test-next (254 tests)
  • exact-name Spector integration (5 tests)

@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @azure-tools/typespec-ts
Show changes

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

Honor TCGC exact() names without applying TypeScript casing transformations.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

📦 Package size report

1 package changed size, +3.49 KB (+0.0%) packed overall.

Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-ts 536.71 KB → 540.33 KB +3.61 KB (+0.7%) 🔴 2.58 MB → 2.60 MB +20.22 KB (+0.8%) 🔴
12 package(s) with no notable change
Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-java 13.51 MB → 13.51 MB -130 B (-0.0%) 15.03 MB → 15.03 MB
@azure-tools/azure-http-specs 146.71 KB → 146.71 KB 1.16 MB → 1.16 MB
@azure-tools/typespec-autorest 81.01 KB → 81.01 KB 395.40 KB → 395.40 KB
@azure-tools/typespec-autorest-canonical 7.42 KB → 7.42 KB 26.00 KB → 26.00 KB
@azure-tools/typespec-azure-core 130.84 KB → 130.84 KB 709.84 KB → 709.84 KB
@azure-tools/typespec-azure-portal-core 42.40 KB → 42.40 KB 192.91 KB → 192.91 KB
@azure-tools/typespec-azure-resource-manager 174.78 KB → 174.78 KB 1.06 MB → 1.06 MB
@azure-tools/typespec-azure-rulesets 5.27 KB → 5.27 KB 32.97 KB → 32.97 KB
@azure-tools/typespec-client-generator-core 229.48 KB → 229.48 KB 1.23 MB → 1.23 MB
@azure-tools/typespec-go 261.39 KB → 261.39 KB 1.34 MB → 1.34 MB
@azure-tools/typespec-metadata 15.91 KB → 15.91 KB 62.26 KB → 62.26 KB
@azure-tools/typespec-python 42.22 KB → 42.22 KB 164.91 KB → 164.91 KB

Packed = gzipped .tgz published to npm. Unpacked = total extracted size. 🆕 added, 🗑️ removed. Packages from the core/ submodule are not included.
🔴 grew · 🟢 shrank — only changes of at least 512 B and 0.5% are marked.

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 2a68edc

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Comment thread packages/typespec-ts/src/utils/name-utils.ts Outdated
Comment thread packages/typespec-ts/src/utils/name-utils.ts Outdated
Comment thread packages/typespec-ts/test/modular-unit/exact-name.test.ts Outdated
Comment thread packages/typespec-ts/src/modular/emit-models.ts Outdated
Comment thread packages/typespec-ts/src/modular/emit-models.ts Outdated
Comment thread packages/typespec-ts/src/modular/build-classical-client.ts Outdated
@qiaozha
Qiaoqiao Zhang (qiaozha) added this pull request to the merge queue Sep 3, 2026
Merged via the queue into Azure:main with commit f782fa0 Sep 3, 2026
35 checks passed
@qiaozha
Qiaoqiao Zhang (qiaozha) deleted the typespec-ts-exact-name branch September 3, 2026 08:13
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.

2 participants