shadcn-svelte 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 shadcn
4
+ Copyright (c) 2023 huntabyte
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # shadcn-svelte
2
+
3
+ A CLI for adding shadcn components to your project.
4
+
5
+ ## Usage
6
+
7
+ Use the `init` command to initialize dependencies for a new project.
8
+
9
+ The `init` command installs dependencies, adds the `cn` util, configures `tailwind.config.cjs`, and sets up CSS variables for the project.
10
+
11
+ ```bash
12
+ npx shadcn-svelte init
13
+ ```
14
+
15
+ ## add
16
+
17
+ Use the `add` command to add components to your project.
18
+
19
+ The `add` command adds a component to your project and installs all required dependencies.
20
+
21
+ ```bash
22
+ npx shadcn-svelte add [component]
23
+ ```
24
+
25
+ ### Example
26
+
27
+ ```bash
28
+ npx shadcn-svelte add alert-dialog
29
+ ```
30
+
31
+ You can also run the command without any arguments to view a list of all available components:
32
+
33
+ ```bash
34
+ npx shadcn-svelte add
35
+ ```
36
+
37
+ ## Documentation
38
+
39
+ Visit https://shadcn-svelte.com to view the documentation.
40
+
41
+ ## License
42
+
43
+ Licensed under the [MIT license](https://github.com/huntabyte/shadcn-svelte/blob/main/LICENSE.md).
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/index.js ADDED
@@ -0,0 +1,422 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/utils/get-components.ts
4
+ import fetch from "node-fetch";
5
+ import * as z from "zod";
6
+ var baseUrl = process.env.COMPONENTS_BASE_URL ?? "http://localhost:5173";
7
+ var componentSchema = z.object({
8
+ component: z.string(),
9
+ name: z.string(),
10
+ dependencies: z.array(z.string()).optional(),
11
+ files: z.array(
12
+ z.object({
13
+ name: z.string(),
14
+ dir: z.string(),
15
+ content: z.string()
16
+ })
17
+ )
18
+ });
19
+ var componentsSchema = z.array(componentSchema);
20
+ async function getAvailableComponents() {
21
+ try {
22
+ const response = await fetch(`${baseUrl}/api/components`);
23
+ const components = await response.json();
24
+ return componentsSchema.parse(components);
25
+ } catch (error) {
26
+ throw new Error(
27
+ `Failed to fetch components from ${baseUrl}/api/components.`
28
+ );
29
+ }
30
+ }
31
+
32
+ // src/utils/get-package-info.ts
33
+ import fs from "fs-extra";
34
+ import path from "path";
35
+ function getPackageInfo() {
36
+ const packageJsonPath = path.join("package.json");
37
+ return fs.readJSONSync(packageJsonPath);
38
+ }
39
+
40
+ // src/utils/get-package-manager.ts
41
+ function getPackageManager() {
42
+ const userAgent = process.env.npm_config_user_agent;
43
+ if (!userAgent) {
44
+ return "npm";
45
+ }
46
+ if (userAgent.startsWith("yarn")) {
47
+ return "yarn";
48
+ }
49
+ if (userAgent.startsWith("pnpm")) {
50
+ return "pnpm";
51
+ }
52
+ return "npm";
53
+ }
54
+
55
+ // src/utils/get-project-info.ts
56
+ import { existsSync } from "fs";
57
+ import fs2 from "fs-extra";
58
+ import path2 from "path";
59
+ async function getProjectInfo() {
60
+ const info = {
61
+ tsconfig: null,
62
+ alias: null,
63
+ srcDir: false,
64
+ appDir: false
65
+ };
66
+ try {
67
+ const tsconfig = await getTsConfig();
68
+ const paths = tsconfig?.compilerOptions?.paths;
69
+ const alias = paths ? Object.keys(paths)[0].replace("*", "") : null;
70
+ return {
71
+ tsconfig,
72
+ alias,
73
+ srcDir: existsSync(path2.resolve("./src")),
74
+ appDir: existsSync(path2.resolve("./app")) || existsSync(path2.resolve("./src/app"))
75
+ };
76
+ } catch (error) {
77
+ return info;
78
+ }
79
+ }
80
+ async function getTsConfig() {
81
+ try {
82
+ const tsconfigPath = path2.join("tsconfig.json");
83
+ const tsconfig = await fs2.readJSON(tsconfigPath);
84
+ if (!tsconfig) {
85
+ throw new Error("tsconfig.json is missing");
86
+ }
87
+ return tsconfig;
88
+ } catch (error) {
89
+ return null;
90
+ }
91
+ }
92
+
93
+ // src/utils/logger.ts
94
+ import chalk from "chalk";
95
+ var logger = {
96
+ error(...args) {
97
+ console.log(chalk.red(...args));
98
+ },
99
+ warn(...args) {
100
+ console.log(chalk.yellow(...args));
101
+ },
102
+ info(...args) {
103
+ console.log(chalk.cyan(...args));
104
+ },
105
+ success(...args) {
106
+ console.log(chalk.green(...args));
107
+ }
108
+ };
109
+
110
+ // src/utils/templates.ts
111
+ var STYLES = `@tailwind base;
112
+ @tailwind components;
113
+ @tailwind utilities;
114
+
115
+ @layer base {
116
+ :root {
117
+ --background: 0 0% 100%;
118
+ --foreground: 222.2 47.4% 11.2%;
119
+
120
+ --muted: 210 40% 96.1%;
121
+ --muted-foreground: 215.4 16.3% 46.9%;
122
+
123
+ --popover: 0 0% 100%;
124
+ --popover-foreground: 222.2 47.4% 11.2%;
125
+
126
+ --card: 0 0% 100%;
127
+ --card-foreground: 222.2 47.4% 11.2%;
128
+
129
+ --border: 214.3 31.8% 91.4%;
130
+ --input: 214.3 31.8% 91.4%;
131
+
132
+ --primary: 222.2 47.4% 11.2%;
133
+ --primary-foreground: 210 40% 98%;
134
+
135
+ --secondary: 210 40% 96.1%;
136
+ --secondary-foreground: 222.2 47.4% 11.2%;
137
+
138
+ --accent: 210 40% 96.1%;
139
+ --accent-foreground: 222.2 47.4% 11.2%;
140
+
141
+ --destructive: 0 100% 50%;
142
+ --destructive-foreground: 210 40% 98%;
143
+
144
+ --ring: 215 20.2% 65.1%;
145
+
146
+ --radius: 0.5rem;
147
+ }
148
+
149
+ .dark {
150
+ --background: 224 71% 4%;
151
+ --foreground: 213 31% 91%;
152
+
153
+ --muted: 223 47% 11%;
154
+ --muted-foreground: 215.4 16.3% 56.9%;
155
+
156
+ --popover: 224 71% 4%;
157
+ --popover-foreground: 215 20.2% 65.1%;
158
+
159
+ --card: 224 71% 4%;
160
+ --card-foreground: 213 31% 91%;
161
+
162
+ --border: 216 34% 17%;
163
+ --input: 216 34% 17%;
164
+
165
+ --primary: 210 40% 98%;
166
+ --primary-foreground: 222.2 47.4% 1.2%;
167
+
168
+ --secondary: 222.2 47.4% 11.2%;
169
+ --secondary-foreground: 210 40% 98%;
170
+
171
+ --accent: 216 34% 17%;
172
+ --accent-foreground: 210 40% 98%;
173
+
174
+ --destructive: 0 63% 31%;
175
+ --destructive-foreground: 210 40% 98%;
176
+
177
+ --ring: 216 34% 17%;
178
+
179
+ --radius: 0.5rem;
180
+ }
181
+ }
182
+
183
+ @layer base {
184
+ * {
185
+ @apply border-border;
186
+ }
187
+ body {
188
+ @apply bg-background text-foreground;
189
+ font-feature-settings: "rlig" 1, "calt" 1;
190
+ }
191
+ }`;
192
+ var UTILS = `import { ClassValue, clsx } from "clsx"
193
+ import { twMerge } from "tailwind-merge"
194
+
195
+ export function cn(...inputs: ClassValue[]) {
196
+ return twMerge(clsx(inputs))
197
+ }
198
+ `;
199
+ var TAILWIND_CONFIG = `const { fontFamily } = require("tailwindcss/defaultTheme")
200
+ /** @type {import('tailwindcss').Config} */
201
+ module.exports = {
202
+ darkMode: ["class"],
203
+ content: [
204
+ "./src/**/*.{html,js,svelte,ts}",
205
+ ],
206
+ theme: {
207
+ container: {
208
+ center: true,
209
+ padding: "2rem",
210
+ screens: {
211
+ "2xl": "1400px",
212
+ },
213
+ },
214
+ extend: {
215
+ colors: {
216
+ border: "hsl(var(--border))",
217
+ input: "hsl(var(--input))",
218
+ ring: "hsl(var(--ring))",
219
+ background: "hsl(var(--background))",
220
+ foreground: "hsl(var(--foreground))",
221
+ primary: {
222
+ DEFAULT: "hsl(var(--primary))",
223
+ foreground: "hsl(var(--primary-foreground))",
224
+ },
225
+ secondary: {
226
+ DEFAULT: "hsl(var(--secondary))",
227
+ foreground: "hsl(var(--secondary-foreground))",
228
+ },
229
+ destructive: {
230
+ DEFAULT: "hsl(var(--destructive))",
231
+ foreground: "hsl(var(--destructive-foreground))",
232
+ },
233
+ muted: {
234
+ DEFAULT: "hsl(var(--muted))",
235
+ foreground: "hsl(var(--muted-foreground))",
236
+ },
237
+ accent: {
238
+ DEFAULT: "hsl(var(--accent))",
239
+ foreground: "hsl(var(--accent-foreground))",
240
+ },
241
+ popover: {
242
+ DEFAULT: "hsl(var(--popover))",
243
+ foreground: "hsl(var(--popover-foreground))",
244
+ },
245
+ card: {
246
+ DEFAULT: "hsl(var(--card))",
247
+ foreground: "hsl(var(--card-foreground))",
248
+ },
249
+ },
250
+ borderRadius: {
251
+ lg: "var(--radius)",
252
+ md: "calc(var(--radius) - 2px)",
253
+ sm: "calc(var(--radius) - 4px)",
254
+ },
255
+ fontFamily: {
256
+ sans: [...fontFamily.sans]
257
+ }
258
+ }
259
+ },
260
+ plugins: [require("tailwindcss-animate")],
261
+ }`;
262
+
263
+ // src/index.ts
264
+ import { Command } from "commander";
265
+ import { execa } from "execa";
266
+ import { existsSync as existsSync2, promises as fs3 } from "fs";
267
+ import ora from "ora";
268
+ import path3 from "path";
269
+ import prompts from "prompts";
270
+ process.on("SIGINT", () => process.exit(0));
271
+ process.on("SIGTERM", () => process.exit(0));
272
+ var PROJECT_DEPENDENCIES = [
273
+ "tailwindcss-animate",
274
+ "class-variance-authority",
275
+ "clsx",
276
+ "tailwind-merge",
277
+ "lucide-svelte"
278
+ ];
279
+ async function main() {
280
+ const packageInfo = getPackageInfo();
281
+ const projectInfo = await getProjectInfo();
282
+ const packageManager = getPackageManager();
283
+ const program = new Command().name("shadcn-svelte").description("Add shadcn-svelte components to your project").version(
284
+ packageInfo.version || "1.0.0",
285
+ "-v, --version",
286
+ "display the version number"
287
+ );
288
+ program.command("init").description("Configure your SvelteKit project.").option("-y, --yes", "Skip confirmation prompt.").action(async (options) => {
289
+ logger.warn(
290
+ "This command assumes a SvelteKit project with TypeScript and Tailwind CSS."
291
+ );
292
+ logger.warn(
293
+ "If you don't have these, follow the manual steps at https://ui.shadcn.com/docs/installation."
294
+ );
295
+ logger.warn("");
296
+ if (!options.yes) {
297
+ const { proceed } = await prompts({
298
+ type: "confirm",
299
+ name: "proceed",
300
+ message: "Running this command will install dependencies and overwrite your existing tailwind.config.cjs. Proceed?",
301
+ initial: true
302
+ });
303
+ if (!proceed) {
304
+ process.exit(0);
305
+ }
306
+ }
307
+ const dependenciesSpinner = ora(`Installing dependencies...`).start();
308
+ await execa(packageManager, [
309
+ packageManager === "npm" ? "install" : "add",
310
+ ...PROJECT_DEPENDENCIES
311
+ ]);
312
+ dependenciesSpinner.succeed();
313
+ if (!projectInfo?.appDir) {
314
+ const stylesDir = "./src/styles";
315
+ if (!existsSync2(path3.resolve(stylesDir))) {
316
+ await fs3.mkdir(path3.resolve(stylesDir), { recursive: true });
317
+ }
318
+ }
319
+ let stylesDestination = "./src/styles/globals.css";
320
+ if (projectInfo?.appDir) {
321
+ stylesDestination = "./src/app/globals.css";
322
+ }
323
+ const stylesSpinner = ora(`Adding styles with CSS variables...`).start();
324
+ await fs3.writeFile(stylesDestination, STYLES, "utf8");
325
+ stylesSpinner.succeed();
326
+ const libDir = "./src/lib";
327
+ if (!existsSync2(path3.resolve(libDir))) {
328
+ await fs3.mkdir(path3.resolve(libDir), { recursive: true });
329
+ }
330
+ const utilsDestination = "./src/lib/utils.ts";
331
+ const utilsSpinner = ora(`Adding utils...`).start();
332
+ await fs3.writeFile(utilsDestination, UTILS, "utf8");
333
+ utilsSpinner.succeed();
334
+ const tailwindDestination = "./tailwind.config.cjs";
335
+ const tailwindSpinner = ora(`Updating tailwind.config.cjs...`).start();
336
+ await fs3.writeFile(tailwindDestination, TAILWIND_CONFIG, "utf8");
337
+ tailwindSpinner.succeed();
338
+ });
339
+ program.command("add").description("add components to your project").argument("[components...]", "name of components").action(async (components) => {
340
+ logger.warn(
341
+ "Running the following command will overwrite existing files."
342
+ );
343
+ logger.warn(
344
+ "Make sure you have committed your changes before proceeding."
345
+ );
346
+ logger.warn("");
347
+ const availableComponents = await getAvailableComponents();
348
+ if (!availableComponents?.length) {
349
+ logger.error(
350
+ "An error occurred while fetching components. Please try again."
351
+ );
352
+ process.exit(0);
353
+ }
354
+ let selectedComponents = availableComponents.filter(
355
+ (component) => components.includes(component.component)
356
+ );
357
+ if (!selectedComponents?.length) {
358
+ selectedComponents = await promptForComponents(availableComponents);
359
+ }
360
+ const dir = await promptForDestinationDir();
361
+ if (!selectedComponents?.length) {
362
+ logger.warn("No components selected. Nothing to install.");
363
+ process.exit(0);
364
+ }
365
+ const destinationDir = path3.resolve(dir);
366
+ if (!existsSync2(destinationDir)) {
367
+ const spinner = ora(`Creating ${dir}...`).start();
368
+ await fs3.mkdir(destinationDir, { recursive: true });
369
+ spinner.succeed();
370
+ }
371
+ logger.success(
372
+ `Installing ${selectedComponents.length} component(s) and dependencies...`
373
+ );
374
+ for (const component of selectedComponents) {
375
+ const componentSpinner = ora(`${component.name}...`).start();
376
+ for (const file of component.files) {
377
+ if (projectInfo?.alias) {
378
+ file.content = file.content.replace(/$\//g, projectInfo.alias);
379
+ }
380
+ const dirPath = path3.join(dir, file.dir);
381
+ await fs3.mkdir(dirPath, { recursive: true });
382
+ const filePath = path3.resolve(dirPath, file.name);
383
+ await fs3.writeFile(filePath, file.content);
384
+ }
385
+ if (component.dependencies?.length) {
386
+ await execa(packageManager, [
387
+ packageManager === "npm" ? "install" : "add",
388
+ ...component.dependencies
389
+ ]);
390
+ }
391
+ componentSpinner.succeed(component.name);
392
+ }
393
+ });
394
+ program.parse();
395
+ }
396
+ async function promptForComponents(components) {
397
+ const { components: selectedComponents } = await prompts({
398
+ type: "autocompleteMultiselect",
399
+ name: "components",
400
+ message: "Which component(s) would you like to add?",
401
+ hint: "Space to select. A to select all. I to invert selection.",
402
+ instructions: false,
403
+ choices: components.map((component) => ({
404
+ title: component.name,
405
+ value: component
406
+ }))
407
+ });
408
+ return selectedComponents;
409
+ }
410
+ async function promptForDestinationDir() {
411
+ const { dir } = await prompts([
412
+ {
413
+ type: "text",
414
+ name: "dir",
415
+ message: "Where would you like to install the component(s)?",
416
+ initial: "./src/lib/components/ui"
417
+ }
418
+ ]);
419
+ return dir;
420
+ }
421
+ main();
422
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/get-components.ts","../src/utils/get-package-info.ts","../src/utils/get-package-manager.ts","../src/utils/get-project-info.ts","../src/utils/logger.ts","../src/utils/templates.ts","../src/index.ts"],"sourcesContent":["import fetch from \"node-fetch\"\nimport * as z from \"zod\"\n\nconst baseUrl =\n process.env.COMPONENTS_BASE_URL ?? \"http://localhost:5173\"\n\nconst componentSchema = z.object({\n component: z.string(),\n name: z.string(),\n dependencies: z.array(z.string()).optional(),\n files: z.array(\n z.object({\n name: z.string(),\n dir: z.string(),\n content: z.string(),\n })\n ),\n})\n\nexport type Component = z.infer<typeof componentSchema>\n\nconst componentsSchema = z.array(componentSchema)\n\nexport async function getAvailableComponents() {\n try {\n const response = await fetch(`${baseUrl}/api/components`)\n const components = await response.json()\n\n return componentsSchema.parse(components)\n } catch (error) {\n throw new Error(\n `Failed to fetch components from ${baseUrl}/api/components.`\n )\n }\n}\n","import fs from \"fs-extra\"\nimport path from \"path\"\nimport { type PackageJson } from \"type-fest\"\n\nexport function getPackageInfo() {\n const packageJsonPath = path.join(\"package.json\")\n\n return fs.readJSONSync(packageJsonPath) as PackageJson\n}\n","export function getPackageManager() {\n const userAgent = process.env.npm_config_user_agent\n\n if (!userAgent) {\n return \"npm\"\n }\n\n if (userAgent.startsWith(\"yarn\")) {\n return \"yarn\"\n }\n\n if (userAgent.startsWith(\"pnpm\")) {\n return \"pnpm\"\n }\n\n return \"npm\"\n}\n","import { existsSync } from \"fs\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\n\nexport async function getProjectInfo() {\n const info = {\n tsconfig: null,\n alias: null,\n srcDir: false,\n appDir: false\n };\n\n try {\n const tsconfig = await getTsConfig();\n const paths = tsconfig?.compilerOptions?.paths;\n const alias = paths ? Object.keys(paths)[0].replace(\"*\", \"\") : null;\n\n return {\n tsconfig,\n alias,\n srcDir: existsSync(path.resolve(\"./src\")),\n appDir:\n existsSync(path.resolve(\"./app\")) ||\n existsSync(path.resolve(\"./src/app\"))\n };\n } catch (error) {\n return info;\n }\n}\n\nexport async function getTsConfig() {\n try {\n const tsconfigPath = path.join(\"tsconfig.json\");\n const tsconfig = await fs.readJSON(tsconfigPath);\n\n if (!tsconfig) {\n throw new Error(\"tsconfig.json is missing\");\n }\n\n return tsconfig;\n } catch (error) {\n return null;\n }\n}\n","import chalk from \"chalk\";\n\nexport const logger = {\n error(...args: unknown[]) {\n console.log(chalk.red(...args));\n },\n warn(...args: unknown[]) {\n console.log(chalk.yellow(...args));\n },\n info(...args: unknown[]) {\n console.log(chalk.cyan(...args));\n },\n success(...args: unknown[]) {\n console.log(chalk.green(...args));\n }\n};\n","export const STYLES = `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n \n@layer base {\n :root {\n --background: 0 0% 100%;\n --foreground: 222.2 47.4% 11.2%;\n \n --muted: 210 40% 96.1%;\n --muted-foreground: 215.4 16.3% 46.9%;\n \n --popover: 0 0% 100%;\n --popover-foreground: 222.2 47.4% 11.2%;\n \n --card: 0 0% 100%;\n --card-foreground: 222.2 47.4% 11.2%;\n \n --border: 214.3 31.8% 91.4%;\n --input: 214.3 31.8% 91.4%;\n \n --primary: 222.2 47.4% 11.2%;\n --primary-foreground: 210 40% 98%;\n \n --secondary: 210 40% 96.1%;\n --secondary-foreground: 222.2 47.4% 11.2%;\n \n --accent: 210 40% 96.1%;\n --accent-foreground: 222.2 47.4% 11.2%;\n \n --destructive: 0 100% 50%;\n --destructive-foreground: 210 40% 98%;\n \n --ring: 215 20.2% 65.1%;\n \n --radius: 0.5rem;\n }\n \n .dark {\n --background: 224 71% 4%;\n --foreground: 213 31% 91%;\n \n --muted: 223 47% 11%;\n --muted-foreground: 215.4 16.3% 56.9%;\n \n --popover: 224 71% 4%;\n --popover-foreground: 215 20.2% 65.1%;\n \n --card: 224 71% 4%;\n --card-foreground: 213 31% 91%;\n \n --border: 216 34% 17%;\n --input: 216 34% 17%;\n \n --primary: 210 40% 98%;\n --primary-foreground: 222.2 47.4% 1.2%;\n \n --secondary: 222.2 47.4% 11.2%;\n --secondary-foreground: 210 40% 98%;\n \n --accent: 216 34% 17%;\n --accent-foreground: 210 40% 98%;\n \n --destructive: 0 63% 31%;\n --destructive-foreground: 210 40% 98%;\n \n --ring: 216 34% 17%;\n \n --radius: 0.5rem;\n }\n}\n \n@layer base {\n * {\n @apply border-border;\n }\n body {\n @apply bg-background text-foreground;\n font-feature-settings: \"rlig\" 1, \"calt\" 1;\n }\n}`;\n\nexport const UTILS = `import { ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n \nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n`;\n\nexport const TAILWIND_CONFIG = `const { fontFamily } = require(\"tailwindcss/defaultTheme\")\n/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n darkMode: [\"class\"],\n content: [\n \"./src/**/*.{html,js,svelte,ts}\",\n ],\n theme: {\n container: {\n center: true,\n padding: \"2rem\",\n screens: {\n \"2xl\": \"1400px\",\n },\n },\n extend: {\n colors: {\n border: \"hsl(var(--border))\",\n input: \"hsl(var(--input))\",\n ring: \"hsl(var(--ring))\",\n background: \"hsl(var(--background))\",\n foreground: \"hsl(var(--foreground))\",\n primary: {\n DEFAULT: \"hsl(var(--primary))\",\n foreground: \"hsl(var(--primary-foreground))\",\n },\n secondary: {\n DEFAULT: \"hsl(var(--secondary))\",\n foreground: \"hsl(var(--secondary-foreground))\",\n },\n destructive: {\n DEFAULT: \"hsl(var(--destructive))\",\n foreground: \"hsl(var(--destructive-foreground))\",\n },\n muted: {\n DEFAULT: \"hsl(var(--muted))\",\n foreground: \"hsl(var(--muted-foreground))\",\n },\n accent: {\n DEFAULT: \"hsl(var(--accent))\",\n foreground: \"hsl(var(--accent-foreground))\",\n },\n popover: {\n DEFAULT: \"hsl(var(--popover))\",\n foreground: \"hsl(var(--popover-foreground))\",\n },\n card: {\n DEFAULT: \"hsl(var(--card))\",\n foreground: \"hsl(var(--card-foreground))\",\n },\n },\n borderRadius: {\n lg: \"var(--radius)\",\n md: \"calc(var(--radius) - 2px)\",\n sm: \"calc(var(--radius) - 4px)\",\n },\n fontFamily: {\n sans: [...fontFamily.sans]\n }\n }\n },\n plugins: [require(\"tailwindcss-animate\")],\n}`;\n","#!/usr/bin/env node\nimport { Component, getAvailableComponents } from \"./utils/get-components\";\nimport { getPackageInfo } from \"./utils/get-package-info\";\nimport { getPackageManager } from \"./utils/get-package-manager\";\nimport { getProjectInfo } from \"./utils/get-project-info\";\nimport { logger } from \"./utils/logger\";\nimport { STYLES, TAILWIND_CONFIG, UTILS } from \"./utils/templates\";\nimport { Command } from \"commander\";\nimport { execa } from \"execa\";\nimport { existsSync, promises as fs } from \"fs\";\nimport ora from \"ora\";\nimport path, { dirname } from \"path\";\nimport prompts from \"prompts\";\n\nprocess.on(\"SIGINT\", () => process.exit(0));\nprocess.on(\"SIGTERM\", () => process.exit(0));\n\nconst PROJECT_DEPENDENCIES = [\n \"tailwindcss-animate\",\n \"class-variance-authority\",\n \"clsx\",\n \"tailwind-merge\",\n \"lucide-svelte\"\n];\n\nasync function main() {\n const packageInfo = getPackageInfo();\n const projectInfo = await getProjectInfo();\n const packageManager = getPackageManager();\n\n const program = new Command()\n .name(\"shadcn-svelte\")\n .description(\"Add shadcn-svelte components to your project\")\n .version(\n packageInfo.version || \"1.0.0\",\n \"-v, --version\",\n \"display the version number\"\n );\n\n program\n .command(\"init\")\n .description(\"Configure your SvelteKit project.\")\n .option(\"-y, --yes\", \"Skip confirmation prompt.\")\n .action(async (options) => {\n logger.warn(\n \"This command assumes a SvelteKit project with TypeScript and Tailwind CSS.\"\n );\n logger.warn(\n \"If you don't have these, follow the manual steps at https://ui.shadcn.com/docs/installation.\"\n );\n logger.warn(\"\");\n\n if (!options.yes) {\n const { proceed } = await prompts({\n type: \"confirm\",\n name: \"proceed\",\n message:\n \"Running this command will install dependencies and overwrite your existing tailwind.config.cjs. Proceed?\",\n initial: true\n });\n\n if (!proceed) {\n process.exit(0);\n }\n }\n\n // Install dependencies.\n const dependenciesSpinner = ora(`Installing dependencies...`).start();\n await execa(packageManager, [\n packageManager === \"npm\" ? \"install\" : \"add\",\n ...PROJECT_DEPENDENCIES\n ]);\n dependenciesSpinner.succeed();\n\n // Ensure styles directory exists.\n if (!projectInfo?.appDir) {\n const stylesDir = \"./src/styles\";\n if (!existsSync(path.resolve(stylesDir))) {\n await fs.mkdir(path.resolve(stylesDir), { recursive: true });\n }\n }\n\n // Update styles.css\n let stylesDestination = \"./src/styles/globals.css\";\n if (projectInfo?.appDir) {\n stylesDestination = \"./src/app/globals.css\";\n }\n const stylesSpinner = ora(`Adding styles with CSS variables...`).start();\n await fs.writeFile(stylesDestination, STYLES, \"utf8\");\n stylesSpinner.succeed();\n\n // Ensure lib directory exists.\n const libDir = \"./src/lib\";\n if (!existsSync(path.resolve(libDir))) {\n await fs.mkdir(path.resolve(libDir), { recursive: true });\n }\n\n // Create lib/utils.ts\n const utilsDestination = \"./src/lib/utils.ts\";\n\n const utilsSpinner = ora(`Adding utils...`).start();\n await fs.writeFile(utilsDestination, UTILS, \"utf8\");\n utilsSpinner.succeed();\n\n const tailwindDestination = \"./tailwind.config.cjs\";\n const tailwindSpinner = ora(`Updating tailwind.config.cjs...`).start();\n await fs.writeFile(tailwindDestination, TAILWIND_CONFIG, \"utf8\");\n tailwindSpinner.succeed();\n });\n\n program\n .command(\"add\")\n .description(\"add components to your project\")\n .argument(\"[components...]\", \"name of components\")\n .action(async (components: string[]) => {\n logger.warn(\n \"Running the following command will overwrite existing files.\"\n );\n logger.warn(\n \"Make sure you have committed your changes before proceeding.\"\n );\n logger.warn(\"\");\n\n const availableComponents = await getAvailableComponents();\n\n if (!availableComponents?.length) {\n logger.error(\n \"An error occurred while fetching components. Please try again.\"\n );\n process.exit(0);\n }\n\n let selectedComponents = availableComponents.filter((component) =>\n components.includes(component.component)\n );\n\n if (!selectedComponents?.length) {\n selectedComponents = await promptForComponents(availableComponents);\n }\n\n const dir = await promptForDestinationDir();\n\n if (!selectedComponents?.length) {\n logger.warn(\"No components selected. Nothing to install.\");\n process.exit(0);\n }\n\n // Create componentPath directory if it doesn't exist.\n const destinationDir = path.resolve(dir);\n if (!existsSync(destinationDir)) {\n const spinner = ora(`Creating ${dir}...`).start();\n await fs.mkdir(destinationDir, { recursive: true });\n spinner.succeed();\n }\n\n logger.success(\n `Installing ${selectedComponents.length} component(s) and dependencies...`\n );\n for (const component of selectedComponents) {\n const componentSpinner = ora(`${component.name}...`).start();\n\n // Write the files.\n for (const file of component.files) {\n // Replace alias with the project's alias.\n if (projectInfo?.alias) {\n file.content = file.content.replace(/$\\//g, projectInfo.alias);\n }\n const dirPath = path.join(dir, file.dir)\n await fs.mkdir(dirPath, { recursive: true })\n const filePath = path.resolve(dirPath, file.name)\n await fs.writeFile(filePath, file.content)\n\n }\n\n // Install dependencies.\n if (component.dependencies?.length) {\n await execa(packageManager, [\n packageManager === \"npm\" ? \"install\" : \"add\",\n ...component.dependencies\n ]);\n }\n componentSpinner.succeed(component.name);\n }\n });\n\n program.parse();\n}\n\nasync function promptForComponents(components: Component[]) {\n const { components: selectedComponents } = await prompts({\n type: \"autocompleteMultiselect\",\n name: \"components\",\n message: \"Which component(s) would you like to add?\",\n hint: \"Space to select. A to select all. I to invert selection.\",\n instructions: false,\n choices: components.map((component) => ({\n title: component.name,\n value: component\n }))\n });\n\n return selectedComponents;\n}\n\nasync function promptForDestinationDir() {\n const { dir } = await prompts([\n {\n type: \"text\",\n name: \"dir\",\n message: \"Where would you like to install the component(s)?\",\n initial: \"./src/lib/components/ui\"\n }\n ]);\n\n return dir;\n}\n\nmain();\n"],"mappings":";;;AAAA,OAAO,WAAW;AAClB,YAAY,OAAO;AAEnB,IAAM,UACF,QAAQ,IAAI,uBAAuB;AAEvC,IAAM,kBAAoB,SAAO;AAAA,EAC7B,WAAa,SAAO;AAAA,EACpB,MAAQ,SAAO;AAAA,EACf,cAAgB,QAAQ,SAAO,CAAC,EAAE,SAAS;AAAA,EAC3C,OAAS;AAAA,IACH,SAAO;AAAA,MACL,MAAQ,SAAO;AAAA,MACf,KAAO,SAAO;AAAA,MACd,SAAW,SAAO;AAAA,IACtB,CAAC;AAAA,EACL;AACJ,CAAC;AAID,IAAM,mBAAqB,QAAM,eAAe;AAEhD,eAAsB,yBAAyB;AAC3C,MAAI;AACA,UAAM,WAAW,MAAM,MAAM,GAAG,wBAAwB;AACxD,UAAM,aAAa,MAAM,SAAS,KAAK;AAEvC,WAAO,iBAAiB,MAAM,UAAU;AAAA,EAC5C,SAAS,OAAP;AACE,UAAM,IAAI;AAAA,MACN,mCAAmC;AAAA,IACvC;AAAA,EACJ;AACJ;;;AClCA,OAAO,QAAQ;AACf,OAAO,UAAU;AAGV,SAAS,iBAAiB;AAC7B,QAAM,kBAAkB,KAAK,KAAK,cAAc;AAEhD,SAAO,GAAG,aAAa,eAAe;AAC1C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AC,eAAe;AAAA,MACtC,OAAO,UAAU;AAAA,MACjB,OAAO;AAAA,IACT,EAAE;AAAA,EACJ,CAAC;AAED,SAAO;AACT;AAEA,eAAe,0BAA0B;AACvC,QAAM,EAAE,IAAI,IAAI,MAAM,QAAQ;AAAA,IAC5B;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEA,KAAK;","names":["fs","path","existsSync","fs","path"]}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "shadcn-svelte",
3
+ "version": "0.0.1",
4
+ "description": "Add components to your apps.",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "license": "MIT",
9
+ "author": {
10
+ "name": "huntabyte",
11
+ "url": "https://twitter.com/huntabyte"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/huntabyte/shadcn-svelte.git",
16
+ "directory": "packages/cli"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "keywords": [
22
+ "components",
23
+ "ui",
24
+ "tailwind",
25
+ "radix-ui",
26
+ "shadcn",
27
+ "svelte",
28
+ "sveltekit",
29
+ "radix-svelte"
30
+ ],
31
+ "type": "module",
32
+ "exports": "./dist/index.js",
33
+ "bin": "./dist/index.js",
34
+ "dependencies": {
35
+ "chalk": "5.2.0",
36
+ "commander": "^10.0.0",
37
+ "execa": "^7.0.0",
38
+ "fs-extra": "^11.1.0",
39
+ "node-fetch": "^3.3.0",
40
+ "ora": "^6.1.2",
41
+ "prompts": "^2.4.2",
42
+ "zod": "^3.20.2"
43
+ },
44
+ "devDependencies": {
45
+ "@ianvs/prettier-plugin-sort-imports": "^3.7.2",
46
+ "@types/fs-extra": "^11.0.1",
47
+ "@types/prompts": "^2.4.2",
48
+ "prettier": "^2.8.8",
49
+ "rimraf": "^4.1.3",
50
+ "tsup": "^6.6.3",
51
+ "type-fest": "^3.8.0",
52
+ "typescript": "^4.9.3"
53
+ },
54
+ "scripts": {
55
+ "dev": "tsup --watch",
56
+ "build": "tsup",
57
+ "typecheck": "tsc --noEmit",
58
+ "clean": "rimraf dist && rimraf components",
59
+ "start:dev": "cross-env COMPONENTS_BASE_URL=http://localhost:5173 node dist/index.js",
60
+ "start": "node dist/index.js",
61
+ "format:write": "prettier --write \"**/*.{ts,md}\" --cache",
62
+ "format:check": "prettier --check \"**/*.{ts,md}\" --cache",
63
+ "release": "changeset version",
64
+ "pub:beta": "pnpm build && pnpm publish --no-git-checks --access public --tag beta",
65
+ "pub:next": "pnpm build && pnpm publish --no-git-checks --access public --tag next",
66
+ "pub:release": "pnpm build && pnpm publish --access public"
67
+ }
68
+ }