You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Audit and trim @azure-tools/typespec-ts emitter dependencies (#4754)
Fixes#4537.
This PR audits the `@azure-tools/typespec-ts` emitter's dependencies and
removes/replaces several that were unmaintained, redundant, or only
powering dead code paths.
## Dependency changes
- **Removed `handlebars`** (runtime dep) — replaced the four metadata
builders with a tiny in-house `renderTemplate` (a mustache subset
supporting `{{var}}` and `{{#if}}/{{else}}/{{/if}}` with handlebars
standalone-whitespace semantics). Output was verified byte-identical
against handlebars across a boolean matrix.
- **Removed `mkdirp`** (devDep) — the only usage (`mkdirp -p coverage`)
is now a portable `node -e
"require('fs').mkdirSync('coverage',{recursive:true})"`.
- **Removed redundant `prettier`** from `devDependencies` (it was
already in `dependencies`).
- **Replaced unmaintained `npm-run-all`** with `concurrently` (already
in the repo catalog, actively maintained). `npm-run-all` had no release
since 2018. Mapped `--race` to `concurrently --kill-others --success
first` and verified the exit-code/teardown semantics.
- Dropped `handlebars`, `mkdirp`, and `npm-run-all` from the workspace
catalog.
## Cleanup enabled by the audit
- **Removed dead README template paths**: `karmaConfig`,
`nonBrandedReadmeTemplate`, and `serviceDocURL` were unused; the README
template now treats the `@azure` scope as always-on (every generated
package is branded), dropping the `{{#if azure}}` gates.
- **Removed the internal `is-typespec-test` emitter option** — its only
effect was gating the README "Install the package" section. Cleaned up
the option schema, interface, transform, docs, regenerated reference
docs, and 79 test `tspconfig.yaml` fixtures.
## Merge
- Merged latest `main` (including #4750's coverage/spector unification);
resolved the one `package.json` scripts conflict.
## Verification
Replicated the `Consistency` CI gates locally: `format:check`, package
`lint`, `cspell`, `chronus verify`, and `deps check` (catalog-sync) all
pass. Build, `test-next`, and `unit-test` suites are green.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove unused `handlebars` and `mkdirp` dependencies. README, snippets, sample-test, and recorded-client metadata files now use a small built-in template renderer instead of Handlebars, and the test-server scripts create the coverage directory with Node instead of `mkdirp`. Also drop dead metadata templates (`karmaConfig`, the non-branded README template) that were no longer emitted.
Remove the internal `is-typespec-test` emitter option. Its only effect was hiding the README "Install the package" section for test packages, so the install section is now always emitted and the option (and the `isReleasablePackage` metadata it gated) has been dropped.
constazureReadmeModularTemplate=`# {{ clientDescriptiveName }} library for JavaScript
12
10
@@ -38,23 +36,18 @@ Key links:
38
36
39
37
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
40
38
41
-
{{#if azure}}
42
39
### Prerequisites
43
40
44
41
- An [Azure subscription][azure_sub].
45
-
{{/if}}
46
42
47
-
{{#if isReleasablePackage}}
48
43
### Install the \`{{ clientPackageName }}\` package
49
44
50
45
Install the {{ clientDescriptiveName }} library for JavaScript with \`npm\`:
51
46
52
47
\`\`\`bash
53
48
npm install {{ clientPackageName }}
54
49
\`\`\`
55
-
{{/if}}
56
50
57
-
{{#if azure}}
58
51
{{#if addCredentials}}
59
52
### Create and authenticate a \`{{ clientClassName}}\`
60
53
@@ -129,7 +122,8 @@ const credential = new InteractiveBrowserCredential({
129
122
const client = new {{ clientClassName }}("<endpoint>", credential);
130
123
\`\`\`
131
124
{{/if}}
132
-
{{/if}}{{/if}}
125
+
{{/if}}
126
+
133
127
134
128
### JavaScript Bundle
135
129
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
@@ -140,7 +134,6 @@ To use this client library in the browser, first you need to use a bundler. For
140
134
141
135
\`{{ clientClassName }}\` is the primary interface for developers using the {{ clientDescriptiveName }} library. Explore the methods on this client object to understand the different features of the {{ serviceName }} service that you can access.
142
136
143
-
{{#if azure}}
144
137
## Troubleshooting
145
138
146
139
### Logging
@@ -153,7 +146,7 @@ import { setLogLevel } from "@azure/logger";
153
146
setLogLevel("info");
154
147
\`\`\`
155
148
156
-
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs]({{ repoURL }}/tree/main/sdk/core/logger).
149
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
157
150
158
151
{{#if samplesURL}}
159
152
## Next steps
@@ -163,54 +156,16 @@ Please take a look at the [samples]({{ samplesURL }}) directory for detailed exa
163
156
164
157
## Contributing
165
158
166
-
If you'd like to contribute to this library, please read the [contributing guide]({{ contributingGuideURL }}) to learn more about how to build and test the code.
159
+
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
167
160
168
161
## Related projects
169
162
170
-
- [{{ projectName }}]({{ repoURL }})
163
+
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
0 commit comments