Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add flags for init command #1186

Merged
merged 23 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brown-snails-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shadcn-svelte": minor
---

feat: Added CLI flags for each option for `init`
11 changes: 9 additions & 2 deletions apps/www/src/content/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ Usage: shadcn-svelte init [options]
initialize your project and install dependencies

Options:
-c, --cwd <cwd> the working directory. (default: the current directory)
-h, --help display help for command
-c, --cwd <cwd> the working directory. defaults to the current directory. (default: the current directory)
-T, --typescript use TypeScript
--style <name> the style for the components (choices: "default", "new-york")
--base-color <name> the base color for the components (choices: "slate", "gray", "zinc", "neutral", "stone")
--css <path> path to the global CSS file
--tailwind-config <path> path to the tailwind config file
--components-alias <path> import alias for components
--utils-alias <path> import alias for utils
-h, --help display help for command
```

## add
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"tsup": "^8.0.0",
"type-fest": "^3.13.1",
"typescript": "^5.0.0",
"valibot": "^0.30.0",
"valibot": "^0.36.0",
"vitest": "^0.34.6"
}
}
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const addOptionsSchema = v.object({
proxy: v.optional(v.string()),
});

type AddOptions = v.Output<typeof addOptionsSchema>;
type AddOptions = v.InferOutput<typeof addOptionsSchema>;

export const add = new Command()
.command("add")
Expand Down
Loading
Loading