@foundrykit/cli 0.1.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/.turbo/turbo-build.log +18 -0
- package/.turbo/turbo-lint.log +5 -0
- package/.turbo/turbo-type-check.log +5 -0
- package/README.md +328 -0
- package/components.json +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +761 -0
- package/dist/index.js.map +1 -0
- package/eslint.config.js +4 -0
- package/package.json +45 -0
- package/postcss.config.mjs +6 -0
- package/src/commands/add.ts +375 -0
- package/src/commands/doctor.ts +11 -0
- package/src/commands/init.ts +318 -0
- package/src/commands/list.ts +255 -0
- package/src/commands/update.ts +12 -0
- package/src/index.ts +24 -0
- package/tsconfig.json +11 -0
- package/tsconfig.lint.json +8 -0
- package/tsup.config.ts +11 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @foundrykit/cli@0.1.0 build /Users/isaacsneddon-jenkins/Desktop/projects/umi/projects/foundrykit/packages/cli
|
|
4
|
+
> tsup
|
|
5
|
+
|
|
6
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
7
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.5.0
|
|
9
|
+
[34mCLI[39m Using tsup config: /Users/isaacsneddon-jenkins/Desktop/projects/umi/projects/foundrykit/packages/cli/tsup.config.ts
|
|
10
|
+
[34mCLI[39m Target: es2022
|
|
11
|
+
[34mCLI[39m Cleaning output folder
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m25.73 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m44.08 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 60ms
|
|
16
|
+
DTS Build start
|
|
17
|
+
DTS ⚡️ Build success in 3627ms
|
|
18
|
+
DTS dist/index.d.ts 20.00 B
|
package/README.md
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
# @foundrykit/cli
|
|
2
|
+
|
|
3
|
+
A command-line interface for managing FoundryKit components, blocks, and projects. Provides tools for adding, updating, and managing UI components across your applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Component management** - Add, update, and list components
|
|
8
|
+
- **Block management** - Manage page blocks and sections
|
|
9
|
+
- **Project initialization** - Set up new FoundryKit projects
|
|
10
|
+
- **Registry integration** - Connect to component registries
|
|
11
|
+
- **Interactive mode** - User-friendly interactive prompts
|
|
12
|
+
- **Colorized output** - Beautiful terminal output with colors
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### Global Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add -g @foundrykit/cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Local Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm add -D @foundrykit/cli
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Available Commands
|
|
29
|
+
|
|
30
|
+
### Core Commands
|
|
31
|
+
|
|
32
|
+
- **`foundrykit init`** - Initialize a new FoundryKit project
|
|
33
|
+
- **`foundrykit add`** - Add components or blocks to your project
|
|
34
|
+
- **`foundrykit list`** - List available components and blocks
|
|
35
|
+
- **`foundrykit update`** - Update existing components
|
|
36
|
+
- **`foundrykit doctor`** - Check project health and configuration
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Initializing a Project
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Initialize a new FoundryKit project
|
|
44
|
+
foundrykit init
|
|
45
|
+
|
|
46
|
+
# Initialize with specific options
|
|
47
|
+
foundrykit init --template nextjs --typescript --tailwind
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Options:**
|
|
51
|
+
- `--template` - Project template (nextjs, react, vue)
|
|
52
|
+
- `--typescript` - Enable TypeScript
|
|
53
|
+
- `--tailwind` - Include Tailwind CSS
|
|
54
|
+
- `--yes` - Skip interactive prompts
|
|
55
|
+
|
|
56
|
+
### Adding Components
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Add a specific component
|
|
60
|
+
foundrykit add button
|
|
61
|
+
|
|
62
|
+
# Add multiple components
|
|
63
|
+
foundrykit add button input card
|
|
64
|
+
|
|
65
|
+
# Add from specific category
|
|
66
|
+
foundrykit add --category primitives button
|
|
67
|
+
|
|
68
|
+
# Add with specific variant
|
|
69
|
+
foundrykit add button --variant outlined
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Options:**
|
|
73
|
+
- `--category` - Component category (primitives, components, blocks)
|
|
74
|
+
- `--variant` - Component variant
|
|
75
|
+
- `--path` - Custom installation path
|
|
76
|
+
- `--registry` - Custom registry URL
|
|
77
|
+
|
|
78
|
+
### Listing Available Items
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# List all available components
|
|
82
|
+
foundrykit list
|
|
83
|
+
|
|
84
|
+
# List components by category
|
|
85
|
+
foundrykit list --category primitives
|
|
86
|
+
|
|
87
|
+
# List with details
|
|
88
|
+
foundrykit list --detailed
|
|
89
|
+
|
|
90
|
+
# Search for specific components
|
|
91
|
+
foundrykit list --search button
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Options:**
|
|
95
|
+
- `--category` - Filter by category
|
|
96
|
+
- `--detailed` - Show detailed information
|
|
97
|
+
- `--search` - Search by name or description
|
|
98
|
+
- `--json` - Output in JSON format
|
|
99
|
+
|
|
100
|
+
### Updating Components
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Update all components
|
|
104
|
+
foundrykit update
|
|
105
|
+
|
|
106
|
+
# Update specific component
|
|
107
|
+
foundrykit update button
|
|
108
|
+
|
|
109
|
+
# Update with specific version
|
|
110
|
+
foundrykit update button --version 2.0.0
|
|
111
|
+
|
|
112
|
+
# Check for updates without applying
|
|
113
|
+
foundrykit update --check
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Options:**
|
|
117
|
+
- `--version` - Specific version to update to
|
|
118
|
+
- `--check` - Check for updates without applying
|
|
119
|
+
- `--force` - Force update even if conflicts exist
|
|
120
|
+
|
|
121
|
+
### Project Health Check
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Check project health
|
|
125
|
+
foundrykit doctor
|
|
126
|
+
|
|
127
|
+
# Fix common issues
|
|
128
|
+
foundrykit doctor --fix
|
|
129
|
+
|
|
130
|
+
# Generate health report
|
|
131
|
+
foundrykit doctor --report
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Options:**
|
|
135
|
+
- `--fix` - Automatically fix common issues
|
|
136
|
+
- `--report` - Generate detailed health report
|
|
137
|
+
- `--verbose` - Show detailed output
|
|
138
|
+
|
|
139
|
+
## Interactive Mode
|
|
140
|
+
|
|
141
|
+
When run without arguments, the CLI enters interactive mode:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
foundrykit
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This provides a guided experience for:
|
|
148
|
+
- Project initialization
|
|
149
|
+
- Component selection
|
|
150
|
+
- Configuration options
|
|
151
|
+
- Installation preferences
|
|
152
|
+
|
|
153
|
+
## Configuration
|
|
154
|
+
|
|
155
|
+
### Project Configuration
|
|
156
|
+
|
|
157
|
+
Create a `foundrykit.config.js` file in your project root:
|
|
158
|
+
|
|
159
|
+
```javascript
|
|
160
|
+
module.exports = {
|
|
161
|
+
// Registry configuration
|
|
162
|
+
registry: {
|
|
163
|
+
url: 'https://registry.foundrykit.com',
|
|
164
|
+
token: process.env.FOUNDRYKIT_TOKEN
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
// Installation preferences
|
|
168
|
+
install: {
|
|
169
|
+
path: './components',
|
|
170
|
+
format: 'tsx',
|
|
171
|
+
style: 'tailwind'
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
// Component preferences
|
|
175
|
+
components: {
|
|
176
|
+
defaultCategory: 'primitives',
|
|
177
|
+
includeTypes: true,
|
|
178
|
+
includeTests: false
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Environment Variables
|
|
184
|
+
|
|
185
|
+
- `FOUNDRYKIT_TOKEN` - Registry authentication token
|
|
186
|
+
- `FOUNDRYKIT_REGISTRY_URL` - Custom registry URL
|
|
187
|
+
- `FOUNDRYKIT_DEBUG` - Enable debug mode
|
|
188
|
+
|
|
189
|
+
## Registry Integration
|
|
190
|
+
|
|
191
|
+
### Connecting to Registries
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Connect to default registry
|
|
195
|
+
foundrykit registry connect
|
|
196
|
+
|
|
197
|
+
# Connect to custom registry
|
|
198
|
+
foundrykit registry connect --url https://custom-registry.com
|
|
199
|
+
|
|
200
|
+
# Authenticate with token
|
|
201
|
+
foundrykit registry auth --token YOUR_TOKEN
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Publishing Components
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Publish component to registry
|
|
208
|
+
foundrykit registry publish button
|
|
209
|
+
|
|
210
|
+
# Publish with metadata
|
|
211
|
+
foundrykit registry publish button --description "Accessible button component"
|
|
212
|
+
|
|
213
|
+
# Publish with tags
|
|
214
|
+
foundrykit registry publish button --tags react,accessible,ui
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Advanced Usage
|
|
218
|
+
|
|
219
|
+
### Custom Templates
|
|
220
|
+
|
|
221
|
+
Create custom component templates:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Create template from existing component
|
|
225
|
+
foundrykit template create button --from ./my-button
|
|
226
|
+
|
|
227
|
+
# Use custom template
|
|
228
|
+
foundrykit add button --template ./custom-templates/button
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Scripts Integration
|
|
232
|
+
|
|
233
|
+
Add to your `package.json` scripts:
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"scripts": {
|
|
238
|
+
"add:component": "foundrykit add",
|
|
239
|
+
"update:components": "foundrykit update",
|
|
240
|
+
"check:health": "foundrykit doctor"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### CI/CD Integration
|
|
246
|
+
|
|
247
|
+
```yaml
|
|
248
|
+
# GitHub Actions example
|
|
249
|
+
- name: Update components
|
|
250
|
+
run: |
|
|
251
|
+
foundrykit update --check
|
|
252
|
+
foundrykit update --yes
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Troubleshooting
|
|
256
|
+
|
|
257
|
+
### Common Issues
|
|
258
|
+
|
|
259
|
+
**Component not found:**
|
|
260
|
+
```bash
|
|
261
|
+
# Check available components
|
|
262
|
+
foundrykit list --search component-name
|
|
263
|
+
|
|
264
|
+
# Update registry cache
|
|
265
|
+
foundrykit registry refresh
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**Installation fails:**
|
|
269
|
+
```bash
|
|
270
|
+
# Check project health
|
|
271
|
+
foundrykit doctor
|
|
272
|
+
|
|
273
|
+
# Clear cache and retry
|
|
274
|
+
foundrykit cache clear
|
|
275
|
+
foundrykit add component-name
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Version conflicts:**
|
|
279
|
+
```bash
|
|
280
|
+
# Check for conflicts
|
|
281
|
+
foundrykit update --check
|
|
282
|
+
|
|
283
|
+
# Force update
|
|
284
|
+
foundrykit update --force
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Debug Mode
|
|
288
|
+
|
|
289
|
+
Enable debug mode for detailed logging:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
FOUNDRYKIT_DEBUG=1 foundrykit add button
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## API Reference
|
|
296
|
+
|
|
297
|
+
### Command Options
|
|
298
|
+
|
|
299
|
+
All commands support these common options:
|
|
300
|
+
|
|
301
|
+
- `--help` - Show command help
|
|
302
|
+
- `--version` - Show CLI version
|
|
303
|
+
- `--verbose` - Enable verbose output
|
|
304
|
+
- `--quiet` - Suppress output
|
|
305
|
+
- `--json` - Output in JSON format
|
|
306
|
+
|
|
307
|
+
### Exit Codes
|
|
308
|
+
|
|
309
|
+
- `0` - Success
|
|
310
|
+
- `1` - General error
|
|
311
|
+
- `2` - Configuration error
|
|
312
|
+
- `3` - Network error
|
|
313
|
+
- `4` - Permission error
|
|
314
|
+
|
|
315
|
+
## Contributing
|
|
316
|
+
|
|
317
|
+
When contributing to the CLI:
|
|
318
|
+
|
|
319
|
+
1. Follow the existing command structure
|
|
320
|
+
2. Add comprehensive help text
|
|
321
|
+
3. Include TypeScript definitions
|
|
322
|
+
4. Add unit tests
|
|
323
|
+
5. Update this README
|
|
324
|
+
6. Ensure cross-platform compatibility
|
|
325
|
+
|
|
326
|
+
## License
|
|
327
|
+
|
|
328
|
+
MIT
|
package/components.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/styles/globals.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true
|
|
11
|
+
},
|
|
12
|
+
"iconLibrary": "lucide",
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@workspace/ui/components",
|
|
15
|
+
"utils": "@workspace/ui/lib/utils",
|
|
16
|
+
"hooks": "@workspace/ui/hooks",
|
|
17
|
+
"lib": "@workspace/ui/lib",
|
|
18
|
+
"ui": "@workspace/ui/components"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|