From 33d1334b770d2cf2501740800251058680145ee8 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Fri, 31 Jan 2025 09:40:19 +0000 Subject: [PATCH 1/2] fix: exclude tailwind package when installing integration --- .changeset/green-sloths-switch.md | 5 +++++ packages/astro/src/cli/add/index.ts | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 .changeset/green-sloths-switch.md diff --git a/.changeset/green-sloths-switch.md b/.changeset/green-sloths-switch.md new file mode 100644 index 000000000000..bfa51268c399 --- /dev/null +++ b/.changeset/green-sloths-switch.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a bug that caused peer dependency errors when running "astro add tailwind" diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts index c3a2e1fe793a..d34c60f65e29 100644 --- a/packages/astro/src/cli/add/index.ts +++ b/packages/astro/src/cli/add/index.ts @@ -40,6 +40,7 @@ interface AddOptions { interface IntegrationInfo { id: string; packageName: string; + integrationName: string; dependencies: [name: string, version: string][]; type: 'integration' | 'adapter'; } @@ -283,7 +284,7 @@ export async function add(names: string[], { flags }: AddOptions) { 'SKIP_FORMAT', `\n ${magenta( `Check our deployment docs for ${bold( - integration.packageName, + integration.integrationName, )} to update your "adapter" config.`, )}`, ); @@ -349,7 +350,9 @@ export async function add(names: string[], { flags }: AddOptions) { case UpdateResult.failure: case UpdateResult.updated: case undefined: { - const list = integrations.map((integration) => ` - ${integration.packageName}`).join('\n'); + const list = integrations + .map((integration) => ` - ${integration.integrationName}`) + .join('\n'); logger.info( 'SKIP_FORMAT', msg.success( @@ -618,8 +621,7 @@ async function convertIntegrationsToInstallSpecifiers( integrations: IntegrationInfo[], ): Promise { const ranges: Record = {}; - for (let { packageName, dependencies } of integrations) { - ranges[packageName] = '*'; + for (let { dependencies } of integrations) { for (const [name, range] of dependencies) { ranges[name] = range; } @@ -790,7 +792,7 @@ async function validateIntegrations(integrations: string[]): Promise Date: Fri, 31 Jan 2025 10:46:26 +0100 Subject: [PATCH 2/2] Update .changeset/green-sloths-switch.md --- .changeset/green-sloths-switch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/green-sloths-switch.md b/.changeset/green-sloths-switch.md index bfa51268c399..5671a1f69e44 100644 --- a/.changeset/green-sloths-switch.md +++ b/.changeset/green-sloths-switch.md @@ -2,4 +2,4 @@ 'astro': patch --- -Fixes a bug that caused peer dependency errors when running "astro add tailwind" +Fixes a bug that caused peer dependency errors when running `astro add tailwind`