Skip to content

Commit

Permalink
cli: install dependencies as dev deps (#1315)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Oct 12, 2024
1 parent 9cf14cc commit bc787f3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-files-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shadcn-svelte": minor
---

Install all dependencies as dev dependencies
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/commands/init.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
);

Expand Down

0 comments on commit bc787f3

Please sign in to comment.