@expcat/tigercat-cli 1.0.7 → 1.2.0

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 +138 -1
  2. package/dist/index.js +819 -106
  3. package/package.json +11 -11
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @expcat/tigercat-cli
2
2
 
3
- CLI tooling for the [Tigercat](https://github.com/expcats/Tigercat) UI component library.
3
+ CLI tooling for the [Tigercat](https://github.com/expcat/Tigercat) UI component library.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,6 +10,84 @@ pnpm add -g @expcat/tigercat-cli
10
10
  npx @expcat/tigercat-cli
11
11
  ```
12
12
 
13
+ ## Usage Examples
14
+
15
+ ### Start a Vue 3 project
16
+
17
+ ```bash
18
+ tigercat create admin-console --template vue3
19
+ cd admin-console
20
+ pnpm install
21
+ pnpm dev
22
+ ```
23
+
24
+ Preview the generated file list without writing files:
25
+
26
+ ```bash
27
+ tigercat create admin-console --template vue3 --dry-run
28
+ ```
29
+
30
+ ### Start a React project
31
+
32
+ ```bash
33
+ tigercat create design-lab --template react
34
+ cd design-lab
35
+ pnpm install
36
+ pnpm dev
37
+ ```
38
+
39
+ ### Add component boilerplate to an existing project
40
+
41
+ Run from a project that already depends on `@expcat/tigercat-vue` or `@expcat/tigercat-react`:
42
+
43
+ ```bash
44
+ tigercat add Button Form Input Select
45
+ tigercat add --framework vue3 --install --snippet src/tigercat-components.ts
46
+ ```
47
+
48
+ When no component names are provided, `add` opens an interactive multi-select prompt.
49
+ The command prints the correct package import, detects missing peer dependencies,
50
+ can install them with `--install`, and creates `src/components/*Demo.vue` or
51
+ `src/components/*Demo.tsx` files when a `src/components` directory exists.
52
+
53
+ ```bash
54
+ tigercat add Button Form Input Select --dry-run
55
+ ```
56
+
57
+ ### Open a temporary playground
58
+
59
+ ```bash
60
+ tigercat playground --template vue3 --port 3456
61
+ tigercat playground --template react --port 3457
62
+ tigercat playground --template react --no-open
63
+ ```
64
+
65
+ Playground files are created under `.tigercat-playground/` in the current working directory.
66
+
67
+ ```bash
68
+ tigercat playground --template react --port 3457 --dry-run
69
+ ```
70
+
71
+ ### Generate API docs from type definitions
72
+
73
+ ```bash
74
+ tigercat generate docs --input packages/core/src/types --output docs/api
75
+ tigercat generate docs --input packages/core/src/types --output docs/api --dry-run
76
+ tigercat generate test Button --framework both
77
+ tigercat generate doc-template Button --output docs/components
78
+ ```
79
+
80
+ ### Check project compatibility
81
+
82
+ ```bash
83
+ tigercat doctor
84
+ tigercat doctor --json
85
+ ```
86
+
87
+ `doctor` verifies `package.json`, Node.js, pnpm, Tailwind CSS, Tigercat peer dependencies,
88
+ template dependency compatibility, and the supported version compatibility matrix. JSON output is
89
+ designed for CI and automated diagnostics.
90
+
13
91
  ## Commands
14
92
 
15
93
  ### `tigercat create <name>`
@@ -19,6 +97,7 @@ Create a new project with Tigercat pre-configured.
19
97
  ```bash
20
98
  tigercat create my-app --template vue3
21
99
  tigercat create my-app --template react
100
+ tigercat create my-app --template vue3 --dry-run
22
101
  ```
23
102
 
24
103
  ### `tigercat add <component>`
@@ -28,6 +107,8 @@ Add a component to your project with import boilerplate.
28
107
  ```bash
29
108
  tigercat add Button
30
109
  tigercat add Form Input Select DatePicker
110
+ tigercat add --framework react --install --snippet src/tigercat-components.ts
111
+ tigercat add Button --dry-run
31
112
  ```
32
113
 
33
114
  ### `tigercat playground`
@@ -37,6 +118,8 @@ Launch an interactive playground for testing components.
37
118
  ```bash
38
119
  tigercat playground
39
120
  tigercat playground --template react
121
+ tigercat playground --template react --no-open
122
+ tigercat playground --template react --dry-run
40
123
  ```
41
124
 
42
125
  ### `tigercat generate docs`
@@ -46,8 +129,62 @@ Generate API documentation from component type definitions.
46
129
  ```bash
47
130
  tigercat generate docs
48
131
  tigercat generate docs --output ./docs/api
132
+ tigercat generate docs --output ./docs/api --dry-run
133
+ ```
134
+
135
+ ### `tigercat generate test`
136
+
137
+ Generate Vue and/or React starter test templates for a component.
138
+
139
+ ```bash
140
+ tigercat generate test Button --framework both
141
+ tigercat generate test Button --framework vue3
142
+ tigercat generate test Button --framework react --dry-run
143
+ ```
144
+
145
+ ### `tigercat generate doc-template`
146
+
147
+ Generate a component documentation page template.
148
+
149
+ ```bash
150
+ tigercat generate doc-template Button
151
+ tigercat generate doc-template Button --output docs/components --dry-run
152
+ ```
153
+
154
+ ### `tigercat doctor`
155
+
156
+ Check whether the current project has compatible Node, pnpm, Tailwind CSS, Tigercat peer dependencies, and template tooling.
157
+
158
+ ```bash
159
+ tigercat doctor
160
+ tigercat doctor --json
49
161
  ```
50
162
 
163
+ ## Windows Support
164
+
165
+ The CLI is fully cross-platform. All template file paths use forward slashes and are
166
+ resolved via Node.js `path.resolve()` at write time, so they work correctly on Windows
167
+ with backslash paths, paths containing spaces, and UNC paths.
168
+
169
+ ### Package Manager `.cmd` Shims
170
+
171
+ When installed globally or locally, each package manager creates platform-specific shims
172
+ so that `tigercat` can be invoked directly from PowerShell, CMD, or Git Bash:
173
+
174
+ | Package manager | Global install | Shim files created |
175
+ | --------------- | ---------------------------------- | ----------------------------------------------- |
176
+ | **pnpm** | `pnpm add -g @expcat/tigercat-cli` | `tigercat.cmd`, `tigercat` (sh) |
177
+ | **npm** | `npm i -g @expcat/tigercat-cli` | `tigercat.cmd`, `tigercat` (sh), `tigercat.ps1` |
178
+ | **bun** | `bun add -g @expcat/tigercat-cli` | `tigercat.cmd`, `tigercat` (sh) |
179
+
180
+ For local (non-global) installs, run via `npx tigercat`, `pnpm exec tigercat`, or
181
+ `bunx tigercat`. The `#!/usr/bin/env node` shebang in the built output is used by all
182
+ three package managers to locate the Node.js runtime.
183
+
184
+ > **Note:** If you use Corepack with pnpm on Windows, ensure `shell: true` is passed
185
+ > when spawning pnpm programmatically (the project scripts already handle this via
186
+ > `scripts/utils/pnpm.mjs`).
187
+
51
188
  ## License
52
189
 
53
190
  MIT