From bf7be34b983a20a7dfa59dbaa8cb42f249a8b319 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Fri, 11 Oct 2024 12:10:15 -0400 Subject: [PATCH 1/4] cli: install dependencies as dev deps --- packages/cli/src/commands/add.ts | 2 +- packages/cli/src/commands/init.ts | 2 +- packages/cli/src/commands/update.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/commands/add.ts b/packages/cli/src/commands/add.ts index 1d2151229..d6356b294 100644 --- a/packages/cli/src/commands/add.ts +++ b/packages/cli/src/commands/add.ts @@ -251,7 +251,7 @@ async function runAdd(cwd: string, config: Config, options: AddOptions) { title: `${highlight(pm)}: Installing dependencies`, enabled: dependencies.size > 0, async task() { - await execa(pm, [add, ...dependencies], { + await execa(pm, [add, '-D', ...dependencies], { cwd, }); return `Dependencies installed with ${highlight(pm)}`; diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index e98874313..04690b774 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -370,7 +370,7 @@ export async function runInit(cwd: string, config: Config, options: InitOptions) title: `${highlight(pm)}: Installing dependencies`, enabled: options.deps, async task() { - await execa(pm, [add, ...PROJECT_DEPENDENCIES], { + await execa(pm, [add, "-D", ...PROJECT_DEPENDENCIES], { cwd, }); return `Dependencies installed with ${highlight(pm)}`; diff --git a/packages/cli/src/commands/update.ts b/packages/cli/src/commands/update.ts index 84f2a8eb2..d9c728ba8 100644 --- a/packages/cli/src/commands/update.ts +++ b/packages/cli/src/commands/update.ts @@ -232,7 +232,7 @@ async function runUpdate(cwd: string, config: Config, options: UpdateOptions) { title: `${highlight(pm)}: Installing dependencies`, enabled: dependencies.size > 0, async task() { - await execa(pm, [add, ...dependencies], { + await execa(pm, [add, "-D", ...dependencies], { cwd, }); return `Dependencies installed with ${highlight(pm)}`; From ddc7d622b23f33dff8c82b7c0220dad5399fc9e2 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Fri, 11 Oct 2024 12:11:02 -0400 Subject: [PATCH 2/4] add changeset --- .changeset/twelve-files-allow.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/twelve-files-allow.md diff --git a/.changeset/twelve-files-allow.md b/.changeset/twelve-files-allow.md new file mode 100644 index 000000000..b6176d258 --- /dev/null +++ b/.changeset/twelve-files-allow.md @@ -0,0 +1,5 @@ +--- +"shadcn-svelte": minor +--- + +Install all dependencies as dev dependencies From 47faea6aef3873aec87b94a0d8757d0dc2c4c867 Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Fri, 11 Oct 2024 12:15:31 -0400 Subject: [PATCH 3/4] update tests --- packages/cli/test/commands/init.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/test/commands/init.spec.ts b/packages/cli/test/commands/init.spec.ts index bc5446945..52ce57fb9 100644 --- a/packages/cli/test/commands/init.spec.ts +++ b/packages/cli/test/commands/init.spec.ts @@ -69,7 +69,7 @@ it("init (config-full)", async () => { expect(execa).toHaveBeenCalledWith( "pnpm", - ["add", "tailwind-variants", "clsx", "tailwind-merge"], + ["add", "-D", "tailwind-variants", "clsx", "tailwind-merge"], { cwd: targetDir } ); From d0a635497859b65553358dab8b3559939f8af7cb Mon Sep 17 00:00:00 2001 From: Hunter Johnston Date: Fri, 11 Oct 2024 12:17:17 -0400 Subject: [PATCH 4/4] format --- packages/cli/src/commands/add.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/commands/add.ts b/packages/cli/src/commands/add.ts index d6356b294..0c4a5afb7 100644 --- a/packages/cli/src/commands/add.ts +++ b/packages/cli/src/commands/add.ts @@ -251,7 +251,7 @@ async function runAdd(cwd: string, config: Config, options: AddOptions) { title: `${highlight(pm)}: Installing dependencies`, enabled: dependencies.size > 0, async task() { - await execa(pm, [add, '-D', ...dependencies], { + await execa(pm, [add, "-D", ...dependencies], { cwd, }); return `Dependencies installed with ${highlight(pm)}`;