@cloudwick/astral-ui-cli 0.3.0 → 0.5.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.
- package/README.md +63 -25
- package/dist/index.js +263 -139
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/templates/css/utilities.css +0 -21
package/README.md
CHANGED
|
@@ -9,13 +9,9 @@ For most projects, we recommend using the CLI with `npx` or `yarn dlx` instead o
|
|
|
9
9
|
```bash
|
|
10
10
|
# Using npx
|
|
11
11
|
npx @cloudwick/astral-ui-cli init
|
|
12
|
-
# or more simply:
|
|
13
|
-
npx astral-ui init
|
|
14
12
|
|
|
15
13
|
# Using yarn
|
|
16
14
|
yarn dlx @cloudwick/astral-ui-cli init
|
|
17
|
-
# or:
|
|
18
|
-
yarn dlx astral-ui init
|
|
19
15
|
```
|
|
20
16
|
|
|
21
17
|
If you frequently use the CLI in your workflow, you can install it globally:
|
|
@@ -32,13 +28,13 @@ yarn global add @cloudwick/astral-ui-cli
|
|
|
32
28
|
|
|
33
29
|
```bash
|
|
34
30
|
# Initialize your project
|
|
35
|
-
npx astral-ui init
|
|
31
|
+
npx @cloudwick/astral-ui-cli init
|
|
36
32
|
|
|
37
33
|
# Follow instructions to set up path aliases
|
|
38
|
-
npx astral-ui setup-aliases
|
|
34
|
+
npx @cloudwick/astral-ui-cli setup-aliases
|
|
39
35
|
|
|
40
36
|
# Add components
|
|
41
|
-
npx astral-ui add button card
|
|
37
|
+
npx @cloudwick/astral-ui-cli add button card
|
|
42
38
|
|
|
43
39
|
# Start using in your code
|
|
44
40
|
import { Button } from '@components/ui/button';
|
|
@@ -50,10 +46,10 @@ import { keyboardKeys, mobileBreakPoint } from '@constants';
|
|
|
50
46
|
|
|
51
47
|
For the best experience, follow these steps in order:
|
|
52
48
|
|
|
53
|
-
1. **Initialize** your project with `npx astral-ui init`
|
|
54
|
-
2. **Set up path aliases** using `npx astral-ui setup-aliases` and follow the instructions
|
|
55
|
-
3. **Add components** with `npx astral-ui add [component...]`
|
|
56
|
-
4. **Repair Tailwind** if needed with `npx astral-ui repair-tailwind`
|
|
49
|
+
1. **Initialize** your project with `npx @cloudwick/astral-ui-cli init`
|
|
50
|
+
2. **Set up path aliases** using `npx @cloudwick/astral-ui-cli setup-aliases` and follow the instructions
|
|
51
|
+
3. **Add components** with `npx @cloudwick/astral-ui-cli add [component...]`
|
|
52
|
+
4. **Repair Tailwind** if needed with `npx @cloudwick/astral-ui-cli repair-tailwind`
|
|
57
53
|
5. **Import and use** components in your application
|
|
58
54
|
|
|
59
55
|
## Commands
|
|
@@ -63,7 +59,7 @@ For the best experience, follow these steps in order:
|
|
|
63
59
|
Initialize a project with Astral Core configuration.
|
|
64
60
|
|
|
65
61
|
```bash
|
|
66
|
-
npx astral-ui init
|
|
62
|
+
npx @cloudwick/astral-ui-cli init
|
|
67
63
|
```
|
|
68
64
|
|
|
69
65
|
This command will:
|
|
@@ -90,7 +86,7 @@ This command will:
|
|
|
90
86
|
Display instructions for setting up path aliases in your project.
|
|
91
87
|
|
|
92
88
|
```bash
|
|
93
|
-
npx astral-ui setup-aliases
|
|
89
|
+
npx @cloudwick/astral-ui-cli setup-aliases
|
|
94
90
|
```
|
|
95
91
|
|
|
96
92
|
This command will:
|
|
@@ -110,10 +106,10 @@ This command will:
|
|
|
110
106
|
|
|
111
107
|
```bash
|
|
112
108
|
# Generate instructions for current directory
|
|
113
|
-
npx astral-ui setup-aliases
|
|
109
|
+
npx @cloudwick/astral-ui-cli setup-aliases
|
|
114
110
|
|
|
115
111
|
# Generate instructions for a specific project
|
|
116
|
-
npx astral-ui setup-aliases --cwd ./my-project
|
|
112
|
+
npx @cloudwick/astral-ui-cli setup-aliases --cwd ./my-project
|
|
117
113
|
```
|
|
118
114
|
|
|
119
115
|
### `add`
|
|
@@ -121,7 +117,7 @@ npx astral-ui setup-aliases --cwd ./my-project
|
|
|
121
117
|
Add components to your project.
|
|
122
118
|
|
|
123
119
|
```bash
|
|
124
|
-
npx astral-ui add [component...]
|
|
120
|
+
npx @cloudwick/astral-ui-cli add [component...]
|
|
125
121
|
```
|
|
126
122
|
|
|
127
123
|
#### Options
|
|
@@ -135,21 +131,28 @@ npx astral-ui add [component...]
|
|
|
135
131
|
| `--path <path>` | `-p` | Specify the path to add the component to |
|
|
136
132
|
| `--silent` | `-s` | Mute output |
|
|
137
133
|
| `--skip-dependencies` | | Skip installing internal component dependencies |
|
|
134
|
+
| `--list` | `-l` | List all available components |
|
|
138
135
|
|
|
139
136
|
#### Examples
|
|
140
137
|
|
|
141
138
|
```bash
|
|
139
|
+
# List all available components
|
|
140
|
+
npx @cloudwick/astral-ui-cli add --list
|
|
141
|
+
|
|
142
|
+
# List components in silent mode (component names only)
|
|
143
|
+
npx @cloudwick/astral-ui-cli add --list --silent
|
|
144
|
+
|
|
142
145
|
# Add specific components
|
|
143
|
-
npx astral-ui add button card select
|
|
146
|
+
npx @cloudwick/astral-ui-cli add button card select
|
|
144
147
|
|
|
145
148
|
# Add all components
|
|
146
|
-
npx astral-ui add --all
|
|
149
|
+
npx @cloudwick/astral-ui-cli add --all
|
|
147
150
|
|
|
148
151
|
# Add a component to a specific directory
|
|
149
|
-
npx astral-ui add button --path ./components/custom
|
|
152
|
+
npx @cloudwick/astral-ui-cli add button --path ./components/custom
|
|
150
153
|
|
|
151
154
|
# Skip installing internal component dependencies
|
|
152
|
-
npx astral-ui add button --skip-dependencies
|
|
155
|
+
npx @cloudwick/astral-ui-cli add button --skip-dependencies
|
|
153
156
|
```
|
|
154
157
|
|
|
155
158
|
### `repair-tailwind`
|
|
@@ -157,14 +160,22 @@ npx astral-ui add button --skip-dependencies
|
|
|
157
160
|
Repair Tailwind configuration when setup fails - only use if experiencing issues with Tailwind.
|
|
158
161
|
|
|
159
162
|
```bash
|
|
160
|
-
npx astral-ui repair-tailwind
|
|
163
|
+
npx @cloudwick/astral-ui-cli repair-tailwind
|
|
161
164
|
```
|
|
162
165
|
|
|
163
166
|
This command will:
|
|
164
167
|
- Check for existing Tailwind configuration and create a timestamped backup
|
|
165
168
|
- Create a new Tailwind configuration with the appropriate file extension for your project
|
|
166
|
-
-
|
|
169
|
+
- Set up the complete CSS structure including:
|
|
170
|
+
- Main CSS file with proper imports
|
|
171
|
+
- Fonts stylesheet (fonts.min.css)
|
|
167
172
|
- Ensure proper dependencies are installed
|
|
173
|
+
- Create a backup of any existing Tailwind configuration before modifying it
|
|
174
|
+
|
|
175
|
+
The CSS structure created will match exactly what the `init` command creates, including:
|
|
176
|
+
- CSS variables for colors and theming
|
|
177
|
+
- Font imports and configuration
|
|
178
|
+
- Proper file organization
|
|
168
179
|
|
|
169
180
|
#### Options
|
|
170
181
|
|
|
@@ -174,6 +185,19 @@ This command will:
|
|
|
174
185
|
| `--cwd <dir>` | `-c` | Specify the working directory |
|
|
175
186
|
| `--silent` | `-s` | Mute output |
|
|
176
187
|
|
|
188
|
+
#### Example Usage
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Basic repair
|
|
192
|
+
npx @cloudwick/astral-ui-cli repair-tailwind
|
|
193
|
+
|
|
194
|
+
# Force overwrite existing files
|
|
195
|
+
npx @cloudwick/astral-ui-cli repair-tailwind --force
|
|
196
|
+
|
|
197
|
+
# Repair in a specific directory
|
|
198
|
+
npx @cloudwick/astral-ui-cli repair-tailwind --cwd ./my-project
|
|
199
|
+
```
|
|
200
|
+
|
|
177
201
|
## Configuration
|
|
178
202
|
|
|
179
203
|
### components.json
|
|
@@ -215,6 +239,20 @@ For full details, see `schema/components-config.schema.json` in your project.
|
|
|
215
239
|
|
|
216
240
|
## Available Components
|
|
217
241
|
|
|
242
|
+
To see a complete list of all available components, run:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
npx @cloudwick/astral-ui-cli add --list
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
This will display all components with their descriptions. You can also use the silent mode to get just the component names:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
npx @cloudwick/astral-ui-cli add --list --silent
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Popular Components
|
|
255
|
+
|
|
218
256
|
| Component | Description |
|
|
219
257
|
|-----------|-------------|
|
|
220
258
|
| `button` | A button component with various styles, sizes, and states |
|
|
@@ -263,7 +301,7 @@ The `cn` function allows you to conditionally combine class names and automatica
|
|
|
263
301
|
|
|
264
302
|
## Styling Components
|
|
265
303
|
|
|
266
|
-
The components in the registry require Tailwind CSS to be properly configured in your application. When you run `npx astral-ui init`, the CLI will:
|
|
304
|
+
The components in the registry require Tailwind CSS to be properly configured in your application. When you run `npx @cloudwick/astral-ui-cli init`, the CLI will:
|
|
267
305
|
|
|
268
306
|
1. Check for an existing Tailwind configuration and upgrade it with required settings
|
|
269
307
|
2. Create a CSS file with required CSS variables for component styling
|
|
@@ -306,7 +344,7 @@ If you're having problems with imports:
|
|
|
306
344
|
- **Next.js**: Make sure you're using the correct import format for your Next.js version
|
|
307
345
|
- **Angular**: Configure paths in tsconfig.app.json instead of tsconfig.json
|
|
308
346
|
- **Create React App**: You'll need CRACO or similar to enable path aliases
|
|
309
|
-
3. **Verify setup**: Run `npx astral-ui setup-aliases` again to get fresh instructions
|
|
347
|
+
3. **Verify setup**: Run `npx @cloudwick/astral-ui-cli setup-aliases` again to get fresh instructions
|
|
310
348
|
4. **Check components.json**: Make sure the paths in the "aliases" section match your project structure
|
|
311
349
|
|
|
312
350
|
### Styling Issues
|
|
@@ -316,7 +354,7 @@ If components don't appear correctly styled:
|
|
|
316
354
|
1. Make sure the Tailwind CSS configuration is properly loaded in your application
|
|
317
355
|
2. Verify the CSS variables are included in your main CSS file
|
|
318
356
|
3. Check that your component is properly importing the required utilities
|
|
319
|
-
4. Run `npx astral-ui repair-tailwind` to create a fresh Tailwind configuration
|
|
357
|
+
4. Run `npx @cloudwick/astral-ui-cli repair-tailwind` to create a fresh Tailwind configuration
|
|
320
358
|
5. If you need to combine the new configuration with your existing customizations, use your backup file as a reference
|
|
321
359
|
|
|
322
360
|
## Contributing
|