Skip to content

Move Azure TypeScript emitter from autorest.typescript#4526

Open
timovv wants to merge 16 commits into
Azure:mainfrom
timovv:move-typespec-ts
Open

Move Azure TypeScript emitter from autorest.typescript#4526
timovv wants to merge 16 commits into
Azure:mainfrom
timovv:move-typespec-ts

Conversation

@timovv
Copy link
Copy Markdown
Member

@timovv timovv commented Jun 1, 2026

This pull request is a first cut of the migration of the @azure-tools/typespec-ts package into this repository from autorest.typescript.

Key changes include:

1. Addition of @azure-tools/typespec-ts package and supporting files

  • Migrated the typespec-ts package from the autorest.typescript repository, including its own ESLint and Prettier configurations, .prettierignore, and documentation files such as README.md and CONTRIBUTING.md. [1] [2] [3] [4] [5] [6] [7]

Due to the large amount of changes (filename renames, lint fixes, etc.) required to bring typespec-ts in line with typespec-azure's lint and format rules, I kept typespec-ts' lint and formatting separate from the rest of the workspace, at least for now. It will probably be easier to complete and then make the necessary changes to integrate with the rest of the repo later.

2. CI/CD and workflow integration

  • Added a new GitHub Actions workflow (ci-typescript.yml) to build, lint, test, and check formatting for the typespec-ts package, based off of the existing Python workflow (ci-python.yml).
  • Updated the nightly end-to-end workflow to include typespec-ts in the matrix and dev version publishing steps. [1] [2]

3. Monorepo configuration updates

  • Updated repository-wide ESLint, Prettier, and spell-check configurations to ignore or delegate to the typespec-ts package’s own configs, preventing conflicts and performance issues. [1] [2] [3]

To do/future work

  • Spector coverage upload (follow up PR?)

Comment thread .github/workflows/ci-typescript.yml Fixed
Comment thread .github/workflows/ci-typescript.yml Fixed
Comment thread .github/workflows/ci-typescript.yml Fixed
Comment thread .github/workflows/ci-typescript.yml Fixed
Comment thread .github/workflows/ci-typescript.yml Fixed
@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Jun 1, 2026

All changed packages have been documented.

  • @azure-tools/typespec-ts
Show changes

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

Initial move of typespec-ts package from autorest.typescript repo

Comment thread packages/typespec-ts/src/rlc-common/buildClientDefinitions.ts Fixed
Comment thread packages/typespec-ts/src/rlc-common/buildClientDefinitions.ts Fixed
Comment thread packages/typespec-ts/src/modular/emitSamples.ts Fixed
Comment thread packages/typespec-ts/src/modular/emitSamples.ts Fixed
Comment thread packages/typespec-ts/src/modular/helpers/exampleValueHelpers.ts Fixed
Comment thread packages/typespec-ts/src/modular/helpers/exampleValueHelpers.ts Fixed
Comment thread packages/typespec-ts/src/modular/helpers/exampleValueHelpers.ts Fixed
Comment thread packages/typespec-ts/src/modular/helpers/exampleValueHelpers.ts Fixed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

⚡ Benchmark Results

⚠️ 3 metric(s) regressed above the +5% threshold:

Metric Baseline Current Change
loader 🟡 212.7ms 🟡 232.4ms +9.3% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 12.3ms 🟡 13.4ms +9.3% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🟡 19.7ms 🔴 21.0ms +6.8% 🔴
Full details – comparing 9db3d0d vs baseline 8cd8304
Metric Baseline Current Change
total 🔴 6.59s 🔴 6.51s -1.3%
loader 🟡 212.7ms 🟡 232.4ms +9.3% 🔴
resolver 🟢 20.3ms 🟢 15.5ms -23.5% 🟢
checker 🟢 187.3ms 🟢 189.4ms +1.1%
validation 🟢 43.4ms 🟢 38.4ms -11.4% 🟢
 ↳ validation/@azure-tools/typespec-azure-core 🟢 6.2ms 🟢 6.3ms +1.2%
 ↳ validation/@typespec/http 🟢 5.4ms 🟢 5.2ms -4.5%
 ↳ validation/@typespec/rest 🟢 0.6ms 🟢 0.4ms -31.3%
 ↳ validation/@typespec/versioning 🔴 28.4ms 🔴 25.1ms -11.8% 🟢
 ↳ validation/compiler 🟢 1.8ms 🟢 1.2ms -33.6%
linter 🟡 212.3ms 🟢 165.8ms -21.9% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/auth-required 🟢 0.0ms 🟢 0.0ms -13.6%
 ↳ linter/@azure-tools/typespec-azure-core/bad-record-type 🟢 0.4ms 🟢 0.2ms -51.1%
 ↳ linter/@azure-tools/typespec-azure-core/byos 🟢 9.0ms 🟢 6.6ms -26.8% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/casing-style 🟢 0.8ms 🟢 0.6ms -19.6%
 ↳ linter/@azure-tools/typespec-azure-core/composition-over-inheritance 🟢 0.1ms 🟢 0.1ms -13.5%
 ↳ linter/@azure-tools/typespec-azure-core/documentation-required 🟢 0.9ms 🟢 1.2ms +40.5%
 ↳ linter/@azure-tools/typespec-azure-core/friendly-name 🟢 0.8ms 🟢 0.6ms -24.5%
 ↳ linter/@azure-tools/typespec-azure-core/key-visibility-required 🟢 0.2ms 🟢 0.2ms -1.8%
 ↳ linter/@azure-tools/typespec-azure-core/known-encoding 🟢 0.3ms 🟢 0.3ms -2.7%
 ↳ linter/@azure-tools/typespec-azure-core/long-running-polling-operation-required 🟢 0.3ms 🟢 0.3ms -2.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-case-mismatch 🟢 0.2ms 🟢 0.2ms -8.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-closed-literal-union 🟢 0.3ms 🟢 0.2ms -13.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-enum 🟢 0.0ms 🟢 0.0ms -6.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-error-status-codes 🟢 0.1ms 🟢 0.1ms -11.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops 🟢 0.1ms 🟢 0.1ms -4.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-format 🟢 0.9ms 🟢 0.7ms -21.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-generic-numeric 🟢 0.4ms 🟢 0.6ms +44.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🔴 31.4ms 🔴 23.9ms -23.7% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/no-legacy-usage 🟢 1.1ms 🟢 1.2ms +7.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-multiple-discriminator 🟢 0.1ms 🟢 0.1ms +5.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-nullable 🟢 0.3ms 🟢 0.2ms -10.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-offsetdatetime 🟢 1.2ms 🟢 1.3ms +12.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-openapi 🟢 3.0ms 🟢 2.1ms -31.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-private-usage 🟢 2.1ms 🟢 1.8ms -14.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🔴 31.3ms 🔴 24.0ms -23.4% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 43.5ms 🔴 29.8ms -31.6% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/no-rest-library-interfaces 🟢 0.0ms 🟢 0.0ms -30.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch 🟢 7.8ms 🟢 6.9ms -11.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-rpc-path-params 🟢 0.3ms 🟢 0.2ms -29.5%
 ↳ linter/@azure-tools/typespec-azure-core/no-string-discriminator 🟢 0.0ms 🟢 0.0ms +2.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-unknown 🟢 0.3ms 🟢 0.2ms -37.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-unnamed-union 🟢 0.4ms 🟢 0.3ms -6.3%
 ↳ linter/@azure-tools/typespec-azure-core/operation-missing-api-version 🟢 0.2ms 🟢 0.1ms -20.2%
 ↳ linter/@azure-tools/typespec-azure-core/request-body-problem 🟢 0.3ms 🟢 0.3ms -19.0%
 ↳ linter/@azure-tools/typespec-azure-core/require-versioned 🟢 0.0ms 🟢 0.0ms -33.5%
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 38.2ms 🔴 26.7ms -30.2% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/rpc-operation-request-body 🟢 0.4ms 🟢 1.0ms +133.1%
 ↳ linter/@azure-tools/typespec-azure-core/spread-discriminated-model 🟢 0.3ms 🟢 0.3ms -8.6%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-names 🟡 10.2ms 🟢 7.3ms -28.8% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-operations 🟢 0.1ms 🟢 0.1ms -7.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version 🟢 3.7ms 🟢 4.0ms +7.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key 🟢 0.1ms 🟢 0.1ms +8.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage 🟢 0.1ms 🟢 0.1ms -9.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes 🟢 4.6ms 🟢 5.1ms +12.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts 🟢 4.0ms 🟢 4.2ms +4.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-record 🟢 0.4ms 🟢 0.3ms -2.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes 🟢 0.4ms 🟢 0.5ms +16.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes 🟢 0.0ms 🟢 0.0ms -17.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment 🟢 0.2ms 🟢 0.2ms -1.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property 🟢 0.1ms 🟢 0.1ms +14.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator 🟢 0.0ms 🟢 0.0ms -23.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb 🟢 0.1ms 🟢 0.1ms +1.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property 🟢 0.1ms 🟢 0.1ms +8.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format 🟢 0.0ms 🟢 0.0ms -4.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars 🟢 0.2ms 🟢 0.2ms +9.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern 🟢 0.0ms 🟢 0.0ms -26.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation 🟢 0.2ms 🟢 0.1ms -10.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response 🟢 4.4ms 🟢 4.6ms +4.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-patch 🟢 0.3ms 🟢 0.3ms +1.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars 🟢 0.2ms 🟢 0.2ms +6.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state 🟢 0.1ms 🟢 0.1ms +0.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels 🟢 0.1ms 🟢 0.1ms +5.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/empty-updateable-properties 🟢 0.1ms 🟢 0.1ms +12.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation 🟢 0.0ms 🟢 0.0ms +4.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 12.3ms 🟡 13.4ms +9.3% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint 🟢 0.0ms 🟢 0.0ms -5.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers 🟢 0.3ms 🟢 0.3ms -3.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-empty-model 🟢 0.1ms 🟢 0.1ms -0.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation 🟢 0.2ms 🟢 0.2ms +12.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🟡 19.7ms 🔴 21.0ms +6.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/patch-envelope 🟢 0.1ms 🟢 0.1ms +4.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/resource-name 🟢 0.1ms 🟢 0.1ms +5.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/secret-prop 🟢 2.4ms 🟢 1.9ms -23.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/unsupported-type 🟢 0.4ms 🟢 0.4ms -1.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/version-progression 🟢 0.0ms 🟢 0.0ms -11.0%
 ↳ linter/@azure-tools/typespec-client-generator-core/property-name-conflict 🟢 1.2ms 🟢 1.1ms -10.8%
 ↳ linter/@azure-tools/typespec-client-generator-core/require-client-suffix 🟢 0.2ms 🟢 0.2ms -25.0%
emit 🔴 5.83s 🔴 5.81s -0.4%
 ↳ emit/@azure-tools/typespec-autorest 🟢 166.1ms 🟢 158.4ms -4.6%
 ↳ emit/@azure-tools/typespec-python 🔴 4.33s 🔴 4.37s +1.1%
 ↳ emit/@typespec/http-client-js 🔴 1.14s 🔴 1.14s -0.3%
 ↳ emit/@typespec/openapi3 🟢 147.1ms 🟢 143.2ms -2.7%
 ↳ emit/@typespec/openapi3/compute 🟢 130.7ms 🟢 127.8ms -2.2%
 ↳ emit/@typespec/openapi3/write 🟢 16.9ms 🟢 15.3ms -9.6% 🟢

Averaged across 3 specs (azure-arm-resource-manager, azure-core-dataplane, azure-full).
Threshold: changes > ±5% are highlighted.
🟢 Fast · 🟡 Moderate (stages >200ms, rules >10ms) · 🔴 Slow (stages >400ms, rules >20ms)

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 1, 2026

Open in StackBlitz

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

commit: 92f0f31

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Jun 1, 2026

You can try these changes here

🛝 Playground 🌐 Website

@timovv timovv force-pushed the move-typespec-ts branch from 57aab1e to b672f9e Compare June 1, 2026 19:24
@timovv timovv marked this pull request as ready for review June 1, 2026 20:08
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.

should use the top level config

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread packages/typespec-ts/.prettierignore Outdated
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.

and this, use top level config

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking using the repo-wide config for lint and format here: #4531. Will take this as a fast-follow item once the initial migration has landed.

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.

same here should be able to use top level config

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread packages/typespec-ts/package.json Outdated
Comment thread packages/typespec-ts/tsconfig.json
Comment thread pnpm-workspace.yaml Outdated
"@types/lodash": ^4.17.4
"@typescript-eslint/eslint-plugin": ^8.28.0
"@vitest/coverage-istanbul": ^4.1.0
chai: ^4.3.6
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.

do you actually use all those dependenccies? feels like a lot shouldn't be needed(chai, istanbul, chalk, mkdirp)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I picked some low hanging fruit here and cleaned it up some, but there's still room for a more thorough dependency audit. I will create a follow up task for this. mkdirp, for example, is used by some of the package.json scripts.

Comment thread packages/typespec-ts/test/unit/azureCoreOperationsGenerator.spec.ts
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.

add yourself to the benchmark package as well, example #4525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants