@dinachi/cli 0.1.0 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +31 -3
  2. package/dist/index.js +10 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,16 +6,42 @@ A CLI for adding Dinachi UI components to your project. Just like shadcn/ui, thi
6
6
 
7
7
  ```bash
8
8
  npm install -g @dinachi/cli
9
- # or
9
+ ```
10
+
11
+ **Or use npx without global install:**
12
+
13
+ ```bash
10
14
  npx @dinachi/cli@latest init
11
15
  ```
12
16
 
13
17
  ## Usage
14
18
 
19
+ ### Two ways to use the CLI
20
+
21
+ **Option 1: Install globally (recommended)**
22
+
23
+ ```bash
24
+ npm install -g @dinachi/cli
25
+
26
+ # Then use short commands
27
+ dinachi init
28
+ dinachi add button
29
+ ```
30
+
31
+ **Option 2: Use npx (no global install)**
32
+
33
+ ```bash
34
+ # Always use the full package name
35
+ npx @dinachi/cli init
36
+ npx @dinachi/cli add button
37
+ ```
38
+
15
39
  ### Initialize Dinachi UI in your project
16
40
 
17
41
  ```bash
18
- npx dinachi init
42
+ dinachi init
43
+ # or
44
+ npx @dinachi/cli init
19
45
  ```
20
46
 
21
47
  This will:
@@ -27,7 +53,9 @@ This will:
27
53
  ### Add components
28
54
 
29
55
  ```bash
30
- npx dinachi add button
56
+ dinachi add button
57
+ # or
58
+ npx @dinachi/cli add button
31
59
  ```
32
60
 
33
61
  This will:
package/dist/index.js CHANGED
@@ -567,7 +567,7 @@ var initCommand = new Command2("init").description("Initialize Dinachi UI in you
567
567
  type: "text",
568
568
  name: "utilsPath",
569
569
  message: "Where would you like to install utilities?",
570
- initial: "./src/lib/utils.ts"
570
+ initial: "./src/lib"
571
571
  },
572
572
  {
573
573
  type: "confirm",
@@ -583,7 +583,7 @@ var initCommand = new Command2("init").description("Initialize Dinachi UI in you
583
583
  const spinner = ora2("Setting up Dinachi UI...").start();
584
584
  try {
585
585
  await fs3.ensureDir(path3.dirname(response.componentsPath));
586
- await fs3.ensureDir(path3.dirname(response.utilsPath));
586
+ await fs3.ensureDir(response.utilsPath);
587
587
  const utilsContent = `import { type ClassValue, clsx } from "clsx"
588
588
  import { twMerge } from "tailwind-merge"
589
589
 
@@ -591,7 +591,7 @@ export function cn(...inputs: ClassValue[]) {
591
591
  return twMerge(clsx(inputs))
592
592
  }
593
593
  `;
594
- await fs3.writeFile(response.utilsPath, utilsContent);
594
+ await fs3.writeFile(path3.join(response.utilsPath, "utils.ts"), utilsContent);
595
595
  if (response.installDeps) {
596
596
  spinner.text = "Installing dependencies...";
597
597
  const deps = [
@@ -615,16 +615,20 @@ export function cn(...inputs: ClassValue[]) {
615
615
  },
616
616
  "aliases": {
617
617
  "components": "${response.componentsPath}",
618
- "utils": "${response.utilsPath.replace(".ts", "")}"
618
+ "utils": "${response.utilsPath}"
619
619
  }
620
620
  }`;
621
621
  await fs3.writeFile("components.json", configContent);
622
622
  spinner.succeed("\u2705 Dinachi UI setup complete!");
623
623
  console.log();
624
624
  console.log("Next steps:");
625
- console.log(` 1. Add a component: ${chalk2.cyan("npx dinachi add button")}`);
625
+ console.log(` 1. Add a component: ${chalk2.cyan("npx @dinachi/cli add button")}`);
626
626
  console.log(` 2. Components will be installed to: ${chalk2.cyan(response.componentsPath)}`);
627
- console.log(` 3. Utils available at: ${chalk2.cyan(response.utilsPath)}`);
627
+ console.log(` 3. Utils available at: ${chalk2.cyan(path3.join(response.utilsPath, "utils.ts"))}`);
628
+ console.log();
629
+ console.log("\u{1F4A1} Tip: Install globally for shorter commands:");
630
+ console.log(` ${chalk2.cyan("npm install -g @dinachi/cli")}`);
631
+ console.log(` Then use: ${chalk2.cyan("dinachi add button")}`);
628
632
  } catch (error) {
629
633
  spinner.fail(`\u274C Setup failed: ${error.message}`);
630
634
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dinachi/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "CLI for adding Dinachi UI components to your project",
5
5
  "type": "module",
6
6
  "keywords": [