From 06641477dd7838b7f6e1ceed23ceac03b3289c85 Mon Sep 17 00:00:00 2001 From: Steve Rice Date: Thu, 21 Nov 2024 12:40:00 -0800 Subject: [PATCH] Set `@typespec/compiler` as a `peerDependency` in library templates (#4685) As specified in [the documentation](https://typespec.io/docs/extending-typespec/basics#step-3-defining-dependencies): > Use `peerDependencies` for all TypeSpec libraries (and the compiler) that you use in your own library or emitter. --------- Co-authored-by: Mark Cowlishaw --- .chronus/changes/peer-dependencies-2024-9-10-22-53-58.md | 7 +++++++ .../templates/__snapshots__/emitter-ts/package.json | 3 ++- .../templates/__snapshots__/library-ts/package.json | 3 ++- packages/compiler/templates/emitter-ts/package.json | 3 ++- packages/compiler/templates/library-ts/package.json | 3 ++- 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .chronus/changes/peer-dependencies-2024-9-10-22-53-58.md diff --git a/.chronus/changes/peer-dependencies-2024-9-10-22-53-58.md b/.chronus/changes/peer-dependencies-2024-9-10-22-53-58.md new file mode 100644 index 0000000000..f846ae4fa1 --- /dev/null +++ b/.chronus/changes/peer-dependencies-2024-9-10-22-53-58.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/compiler" +--- + +Set `@typespec/compiler` as a `peerDependency` in library templates \ No newline at end of file diff --git a/packages/compiler/templates/__snapshots__/emitter-ts/package.json b/packages/compiler/templates/__snapshots__/emitter-ts/package.json index e08b6c9604..be67451bea 100644 --- a/packages/compiler/templates/__snapshots__/emitter-ts/package.json +++ b/packages/compiler/templates/__snapshots__/emitter-ts/package.json @@ -13,13 +13,14 @@ "default": "./dist/src/testing/index.js" } }, - "dependencies": { + "peerDependencies": { "@typespec/compiler": "latest" }, "devDependencies": { "@types/node": "latest", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", + "@typespec/compiler": "latest", "eslint": "^8.45.0", "typescript": "^5.3.3", "prettier": "^3.0.3" diff --git a/packages/compiler/templates/__snapshots__/library-ts/package.json b/packages/compiler/templates/__snapshots__/library-ts/package.json index 079f06ca5a..d9db6f4cac 100644 --- a/packages/compiler/templates/__snapshots__/library-ts/package.json +++ b/packages/compiler/templates/__snapshots__/library-ts/package.json @@ -14,13 +14,14 @@ "default": "./dist/src/testing/index.js" } }, - "dependencies": { + "peerDependencies": { "@typespec/compiler": "latest" }, "devDependencies": { "@types/node": "latest", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", + "@typespec/compiler": "latest", "@typespec/library-linter": "latest", "eslint": "^8.45.0", "prettier": "^3.0.3", diff --git a/packages/compiler/templates/emitter-ts/package.json b/packages/compiler/templates/emitter-ts/package.json index 4806800b1b..70db6e13ab 100644 --- a/packages/compiler/templates/emitter-ts/package.json +++ b/packages/compiler/templates/emitter-ts/package.json @@ -13,13 +13,14 @@ "default": "./dist/src/testing/index.js" } }, - "dependencies": { + "peerDependencies": { "@typespec/compiler": "latest" }, "devDependencies": { "@types/node": "latest", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", + "@typespec/compiler": "latest", "eslint": "^8.45.0", "typescript": "^5.3.3", "prettier": "^3.0.3" diff --git a/packages/compiler/templates/library-ts/package.json b/packages/compiler/templates/library-ts/package.json index 99014148a6..5ad106e7e1 100644 --- a/packages/compiler/templates/library-ts/package.json +++ b/packages/compiler/templates/library-ts/package.json @@ -14,13 +14,14 @@ "default": "./dist/src/testing/index.js" } }, - "dependencies": { + "peerDependencies": { "@typespec/compiler": "latest" }, "devDependencies": { "@types/node": "latest", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", + "@typespec/compiler": "latest", "@typespec/library-linter": "latest", "eslint": "^8.45.0", "prettier": "^3.0.3",