Skip to content

Commit

Permalink
Filter out astro from peerDependencies in astro add (#7620)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis authored Jul 11, 2023
1 parent 13b36d9 commit 831dfd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rude-balloons-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Filter out `astro` from integration peer dependencies when running `astro add`
3 changes: 2 additions & 1 deletion packages/astro/src/cli/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,8 @@ export async function validateIntegrations(integrations: string[]): Promise<Inte
const meta = pkgJson['peerDependenciesMeta'] || {};
for (const peer in pkgJson['peerDependencies']) {
const optional = meta[peer]?.optional || false;
if (!optional) {
const isAstro = peer === 'astro';
if (!optional && !isAstro) {
dependencies.push([peer, pkgJson['peerDependencies'][peer]]);
}
}
Expand Down

0 comments on commit 831dfd1

Please sign in to comment.