Move Azure TypeScript emitter from autorest.typescript#4526
Conversation
|
All changed packages have been documented.
Show changes
|
⚡ Benchmark Results
Full details – comparing
|
| 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)
commit: |
|
You can try these changes here
|
There was a problem hiding this comment.
should use the top level config
There was a problem hiding this comment.
and this, use top level config
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
same here should be able to use top level config
| "@types/lodash": ^4.17.4 | ||
| "@typescript-eslint/eslint-plugin": ^8.28.0 | ||
| "@vitest/coverage-istanbul": ^4.1.0 | ||
| chai: ^4.3.6 |
There was a problem hiding this comment.
do you actually use all those dependenccies? feels like a lot shouldn't be needed(chai, istanbul, chalk, mkdirp)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
add yourself to the benchmark package as well, example #4525
This pull request is a first cut of the migration of the
@azure-tools/typespec-tspackage into this repository from autorest.typescript.Key changes include:
1. Addition of
@azure-tools/typespec-tspackage and supporting filestypespec-tspackage from theautorest.typescriptrepository, including its own ESLint and Prettier configurations,.prettierignore, and documentation files such asREADME.mdandCONTRIBUTING.md. [1] [2] [3] [4] [5] [6] [7]Due to the large amount of changes (filename renames, lint fixes, etc.) required to bring
typespec-tsin line withtypespec-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
ci-typescript.yml) to build, lint, test, and check formatting for thetypespec-tspackage, based off of the existing Python workflow (ci-python.yml).typespec-tsin the matrix and dev version publishing steps. [1] [2]3. Monorepo configuration updates
typespec-tspackage’s own configs, preventing conflicts and performance issues. [1] [2] [3]To do/future work