Skip to content

Commit 85ebe0d

Browse files
jeremymengCopilot
andauthored
Use catalog: specifier for tslib in azure-sdk-for-js monorepo packages (#4570)
Generated `package.json` files for the azure-sdk-for-js monorepo were pinning `tslib` to a hard-coded version (`^2.8.1`). The monorepo manages shared tool/runtime versions through pnpm's catalog feature (see `pnpm-workspace.yaml`), and other deps like `typescript`, `eslint`, `rimraf`, etc. are already emitted as `catalog:`. `tslib` was the odd one out, requiring a manual edit each regeneration to stay in sync with the workspace catalog. This switches the runtime dependency emitted by `buildAzureMonorepoPackage` to `tslib: 'catalog:'` so it picks up whatever the monorepo's catalog has pinned (`^2.8.1` today). Standalone (non-monorepo) generators in `azurePackageCommon.ts` / `packageCommon.ts` are intentionally left untouched, since `catalog:` would not resolve outside the workspace. Verified by running the `packageJson.test.ts` test-next suite (51/51 passing) and a `pnpm -r --filter '@azure-tools/typespec-ts...' build`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bb8a193 commit 85ebe0d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@azure-tools/typespec-ts"
5+
---
6+
7+
Use the `catalog:` pnpm workspace specifier for the `tslib` dependency when generating `package.json` for the azure-sdk-for-js monorepo.

packages/typespec-ts/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function getAzureMonorepoDependencies(config: AzureMonorepoInfoConfig) {
4343
"@azure/core-rest-pipeline": "^1.20.0",
4444
"@azure/core-util": "^1.12.0",
4545
"@azure/logger": "^1.2.0",
46-
tslib: "^2.8.1",
46+
tslib: "catalog:",
4747
};
4848

4949
const testDeps = withTests

0 commit comments

Comments
 (0)