diff --git a/.changeset/ten-students-sleep.md b/.changeset/ten-students-sleep.md new file mode 100644 index 00000000..8e592363 --- /dev/null +++ b/.changeset/ten-students-sleep.md @@ -0,0 +1,5 @@ +--- +"shadcn-solid": patch +--- + +- add `solid-icons` when `init` diff --git a/apps/www/public/registry/index.json b/apps/www/public/registry/index.json index 278b9bf6..83750048 100644 --- a/apps/www/public/registry/index.json +++ b/apps/www/public/registry/index.json @@ -249,7 +249,7 @@ "textfield" ], "files": [ - "ui/textfield.tsx" + "ui/textarea.tsx" ], "type": "components:ui" }, diff --git a/apps/www/public/registry/styles/default/textarea.json b/apps/www/public/registry/styles/default/textarea.json index 417e69fe..42480fe7 100644 --- a/apps/www/public/registry/styles/default/textarea.json +++ b/apps/www/public/registry/styles/default/textarea.json @@ -8,8 +8,8 @@ ], "files": [ { - "name": "textfield.tsx", - "content": "import { cn } from \"@/lib/cn\"\nimport { TextField as TextFieldPrimitive } from \"@kobalte/core\"\nimport { cva } from \"class-variance-authority\"\nimport { splitProps, type ParentComponent } from \"solid-js\"\n\nexport const TextFieldErrorMessage = TextFieldPrimitive.ErrorMessage\nexport const TextFieldDescription = TextFieldPrimitive.Description\nexport const TextField = TextFieldPrimitive.Root\n\nexport const labelVariants = cva(\n\t\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport const TextFieldLabel: ParentComponent<\n\tTextFieldPrimitive.TextFieldLabelProps\n> = (props) => {\n\tconst [local, rest] = splitProps(props, [\"class\"])\n\treturn (\n\t\t\n\t)\n}\n\nexport const TextFieldInput: ParentComponent<\n\tTextFieldPrimitive.TextFieldInputProps\n> = (props) => {\n\tconst [local, rest] = splitProps(props, [\"class\"])\n\treturn (\n\t\t\n\t)\n}\n" + "name": "textarea.tsx", + "content": "import { cn } from \"@/lib/cn\"\nimport { TextField as TextFieldPrimitive } from \"@kobalte/core\"\nimport { splitProps, type ParentComponent } from \"solid-js\"\n\nexport const TextFieldTextArea: ParentComponent<\n\tTextFieldPrimitive.TextFieldTextAreaProps\n> = (props) => {\n\tconst [local, rest] = splitProps(props, [\"class\"])\n\treturn (\n\t\t\n\t)\n}\n" } ], "type": "components:ui" diff --git a/apps/www/src/__registry__/index.tsx b/apps/www/src/__registry__/index.tsx index 6cf9fd27..55a70884 100644 --- a/apps/www/src/__registry__/index.tsx +++ b/apps/www/src/__registry__/index.tsx @@ -185,7 +185,7 @@ export const Index: Record = { type: "components:ui", registryDependencies: ["textfield"], component: lazy(() => import("@/registry/default/ui/textarea")), - files: ["registry/default/ui/textfield.tsx"], + files: ["registry/default/ui/textarea.tsx"], }, "toast": { name: "toast", diff --git a/apps/www/src/registry/registry.ts b/apps/www/src/registry/registry.ts index e5a2a23f..c215f5d1 100644 --- a/apps/www/src/registry/registry.ts +++ b/apps/www/src/registry/registry.ts @@ -39,7 +39,7 @@ const ui: Registry = [ { name: "checkbox", type: "components:ui", - dependencies: ["@kobalte/core", "solid-icons"], + dependencies: ["@kobalte/core"], files: ["ui/checkbox.tsx"], }, { @@ -153,7 +153,7 @@ const ui: Registry = [ type: "components:ui", dependencies: ["@kobalte/core"], registryDependencies: ["textfield"], - files: ["ui/textfield.tsx"], + files: ["ui/textarea.tsx"], }, { name: "toast", diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 550e992f..6c36f4ac 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -30,6 +30,7 @@ const PROJECT_DEPENDENCIES = [ "class-variance-authority", "clsx", "tailwind-merge", + "solid-icons", ] const initOptionsSchema = z.object({ diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 6eeb7a2c..b2472115 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -10,7 +10,7 @@ async function main() { const program = new Command() .name("shadcn-solid") .description("add components and dependencies to your project") - .version("0.3.0", "-v, --version", "display the version number") + .version("0.3.1", "-v, --version", "display the version number") program.addCommand(init).addCommand(add) diff --git a/packages/cli/src/utils/get-project-info.ts b/packages/cli/src/utils/get-project-info.ts deleted file mode 100644 index 8a79e70e..00000000 --- a/packages/cli/src/utils/get-project-info.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { existsSync } from "fs" -import fs from "fs-extra" -import path from "path" - -export async function getProjectInfo() { - const info = { - tsconfig: null, - srcDir: false, - appDir: false, - srcComponentsUiDir: false, - componentsUiDir: false, - } - - try { - const tsconfig = await getTsConfig() - - return { - tsconfig, - srcDir: existsSync(path.resolve("./src")), - appDir: - existsSync(path.resolve("./app")) || - existsSync(path.resolve("./src/app")), - srcComponentsUiDir: existsSync(path.resolve("./src/components/ui")), - componentsUiDir: existsSync(path.resolve("./components/ui")), - } - } catch (error) { - return info - } -} - -export async function getTsConfig() { - try { - const tsconfigPath = path.join("tsconfig.json") - const tsconfig = await fs.readJSON(tsconfigPath) - - if (!tsconfig) { - throw new Error("tsconfig.json is missing") - } - - return tsconfig - } catch (error) { - return null - } -}