@roboticela/devkit 2.0.0 → 3.0.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 +620 -0
- package/dist/index.js +1 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/installer.js +1 -1
- package/dist/lib/registry.js +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
# @roboticela/devkit
|
|
2
|
+
|
|
3
|
+
> Scaffold, extend, and theme full-stack projects with one command.
|
|
4
|
+
|
|
5
|
+
**DevKit** is the official CLI for [Roboticela](https://roboticela.com) templates. It lets you spin up a production-ready project, install full-stack feature components (auth, dashboard, billing, and more), and manage your design token system — all from the terminal.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @roboticela/devkit create my-app
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
- [Installation](#installation)
|
|
16
|
+
- [Quick Start](#quick-start)
|
|
17
|
+
- [Templates](#templates)
|
|
18
|
+
- [Commands](#commands)
|
|
19
|
+
- [create](#devkit-create)
|
|
20
|
+
- [init](#devkit-init)
|
|
21
|
+
- [add](#devkit-add)
|
|
22
|
+
- [remove](#devkit-remove)
|
|
23
|
+
- [list](#devkit-list)
|
|
24
|
+
- [info](#devkit-info)
|
|
25
|
+
- [update](#devkit-update)
|
|
26
|
+
- [upgrade](#devkit-upgrade)
|
|
27
|
+
- [doctor](#devkit-doctor)
|
|
28
|
+
- [theme](#devkit-theme)
|
|
29
|
+
- [install](#devkit-install)
|
|
30
|
+
- [eject](#devkit-eject)
|
|
31
|
+
- [Configuration Files](#configuration-files)
|
|
32
|
+
- [Design Token System](#design-token-system)
|
|
33
|
+
- [Environment Variables](#environment-variables)
|
|
34
|
+
- [Local Development](#local-development)
|
|
35
|
+
- [Publishing a Release](#publishing-a-release)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
**Use without installing (recommended for project creation):**
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx @roboticela/devkit create my-app
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Install globally for repeated use:**
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install -g @roboticela/devkit
|
|
51
|
+
devkit --version
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Requirements:** Node.js `>=20`
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Quick Start
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# 1. Create a new project — fully interactive
|
|
62
|
+
npx @roboticela/devkit create
|
|
63
|
+
|
|
64
|
+
# 2. Move into it and fill in your secrets
|
|
65
|
+
cd my-app
|
|
66
|
+
cp .env.example .env
|
|
67
|
+
|
|
68
|
+
# 3. Check everything is wired up correctly
|
|
69
|
+
devkit doctor
|
|
70
|
+
|
|
71
|
+
# 4. Start developing
|
|
72
|
+
npm run dev
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
That's it. DevKit scaffolds the template, applies your theme, installs your chosen components, and prints exactly which environment variables you still need to fill in.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Templates
|
|
80
|
+
|
|
81
|
+
DevKit targets two official templates. Every component declares which template(s) it supports — incompatible combinations are blocked before any files are written.
|
|
82
|
+
|
|
83
|
+
| ID | Stack | Platform |
|
|
84
|
+
|----|-------|----------|
|
|
85
|
+
| `nextjs-compact` | Next.js 16 · React 19 · TailwindCSS 4 · TypeScript | Web |
|
|
86
|
+
| `vite-express-tauri` | Vite 7 · React 19 · Express 5 · Tauri 2 · Prisma · TypeScript | Web + Desktop |
|
|
87
|
+
|
|
88
|
+
**Template compatibility matrix (selected components):**
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Component nextjs-compact vite-express-tauri
|
|
92
|
+
──────────────────────────────────────────────────────
|
|
93
|
+
auth ✓ ✓
|
|
94
|
+
profile ✓ ✓
|
|
95
|
+
landing-page ✓ ✓
|
|
96
|
+
hero-section ✓ ✓
|
|
97
|
+
pricing ✓ ✓
|
|
98
|
+
dashboard ✓ ✓
|
|
99
|
+
blog ✓ ✓
|
|
100
|
+
subscriptions ✓ ✓
|
|
101
|
+
file-upload ✓ ✓
|
|
102
|
+
docs-site ✓ ✗ (Next.js MDX only)
|
|
103
|
+
desktop-updater ✗ ✓ (Tauri only)
|
|
104
|
+
desktop-tray ✗ ✓ (Tauri only)
|
|
105
|
+
offline-storage ✗ ✓ (Tauri only)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Commands
|
|
111
|
+
|
|
112
|
+
### `devkit create`
|
|
113
|
+
|
|
114
|
+
Scaffold a brand-new project. This is the recommended starting point — it fetches the template, applies your theme, installs npm dependencies, adds your chosen components, and makes the first git commit in one go.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Fully interactive
|
|
118
|
+
devkit create
|
|
119
|
+
|
|
120
|
+
# Pre-fill the project name
|
|
121
|
+
devkit create my-app
|
|
122
|
+
|
|
123
|
+
# Non-interactive: provide every flag
|
|
124
|
+
devkit create my-app \
|
|
125
|
+
--template=vite-express-tauri \
|
|
126
|
+
--preset=bold \
|
|
127
|
+
--add=auth,hero-section,dashboard \
|
|
128
|
+
--variant=hero-section:gradient-mesh \
|
|
129
|
+
--git --install
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Flags:**
|
|
133
|
+
|
|
134
|
+
| Flag | Values | Description |
|
|
135
|
+
|------|--------|-------------|
|
|
136
|
+
| `--template` | `nextjs-compact` \| `vite-express-tauri` | Skip the template selection prompt |
|
|
137
|
+
| `--preset` | `default` \| `minimal` \| `bold` \| `playful` \| `corporate` | Theme preset |
|
|
138
|
+
| `--primary` | hex string | Override the primary brand color, e.g. `#e11d48` |
|
|
139
|
+
| `--git` | — | Initialize a git repository |
|
|
140
|
+
| `--no-git` | — | Skip git initialization |
|
|
141
|
+
| `--install` | — | Run `npm install` after scaffolding |
|
|
142
|
+
| `--no-install` | — | Skip `npm install` |
|
|
143
|
+
| `--add` | comma-separated | Components to add immediately, e.g. `--add=auth,pricing` |
|
|
144
|
+
| `--variant` | `component:variant` | Variant for a component, e.g. `--variant=hero-section:particles` |
|
|
145
|
+
| `-y, --yes` | — | Accept all defaults, skip all prompts |
|
|
146
|
+
|
|
147
|
+
**How it fetches the template:**
|
|
148
|
+
|
|
149
|
+
DevKit uses the GitHub Tarball API to download only the latest snapshot — no `git` binary required, and no commit history in your new project:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
GET https://api.github.com/repos/Roboticela/NextJS-Template-DevKit/tarball/main
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
If the API is unreachable (rate limit or network issue), it falls back to `git clone --depth=1` automatically.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### `devkit init`
|
|
160
|
+
|
|
161
|
+
Initialize DevKit inside a project you have already cloned or set up manually. Auto-detects the template type by inspecting `package.json` and the directory structure.
|
|
162
|
+
|
|
163
|
+
> Prefer `devkit create` when starting fresh. Use `devkit init` only when adopting DevKit in an existing project.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
devkit init
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**What it creates:**
|
|
170
|
+
|
|
171
|
+
- `devkit.config.json` — pre-filled with your site info
|
|
172
|
+
- `devkit.lock.json` — empty, ready to track installed components
|
|
173
|
+
- `.devkit/` — directory for component manifests
|
|
174
|
+
- `.gitignore` entry for `.devkit/` cache files
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### `devkit add`
|
|
179
|
+
|
|
180
|
+
Install one or more components into the current project.
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Single component
|
|
184
|
+
devkit add auth
|
|
185
|
+
|
|
186
|
+
# Component with a specific variant
|
|
187
|
+
devkit add hero-section --variant=split-image
|
|
188
|
+
|
|
189
|
+
# Multiple components at once
|
|
190
|
+
devkit add auth profile pricing
|
|
191
|
+
|
|
192
|
+
# Specific version
|
|
193
|
+
devkit add auth@2.0.0
|
|
194
|
+
|
|
195
|
+
# Preview what would be installed without touching any files
|
|
196
|
+
devkit add auth --dry-run
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**What happens under the hood:**
|
|
200
|
+
|
|
201
|
+
1. Resolves the component version (latest unless pinned)
|
|
202
|
+
2. Checks template compatibility — exits with a clear error if incompatible
|
|
203
|
+
3. Reads `devkit.config.json` — prompts for any missing required fields
|
|
204
|
+
4. Downloads component files for the detected template
|
|
205
|
+
5. Copies files into the project (skips user-modified files, warns you)
|
|
206
|
+
6. Installs required npm packages (`npm install <packages>`)
|
|
207
|
+
7. Runs database migrations if the component needs them
|
|
208
|
+
8. Injects route registrations into your router file
|
|
209
|
+
9. Updates `devkit.lock.json`
|
|
210
|
+
10. Prints post-install instructions: which env vars to fill in and what to do next
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### `devkit remove`
|
|
215
|
+
|
|
216
|
+
Uninstall a component and delete all files it owns.
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
devkit remove auth
|
|
220
|
+
|
|
221
|
+
# Remove from DevKit tracking but keep the files
|
|
222
|
+
devkit remove auth --keep-files
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
DevKit only deletes files it created. Files you have modified are flagged with a warning, and you decide whether to delete them.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### `devkit list`
|
|
230
|
+
|
|
231
|
+
Browse available components in the registry.
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
devkit list
|
|
235
|
+
devkit list --template=nextjs-compact
|
|
236
|
+
devkit list --template=vite-express-tauri
|
|
237
|
+
devkit list --installed
|
|
238
|
+
devkit list --category=auth
|
|
239
|
+
devkit list --category=ui
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Example output:**
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
┌────────────────────┬───────────────────────────────┬────────────────────────────┬──────────────┐
|
|
246
|
+
│ Component │ Description │ Templates │ Installed │
|
|
247
|
+
├────────────────────┼───────────────────────────────┼────────────────────────────┼──────────────┤
|
|
248
|
+
│ auth │ Full authentication system │ nextjs-compact, vite-expr… │ v2.1.0 ✓ │
|
|
249
|
+
│ hero-section │ Landing hero (6 variants) │ nextjs-compact, vite-expr… │ - │
|
|
250
|
+
│ pricing │ Pricing table (3 variants) │ nextjs-compact, vite-expr… │ - │
|
|
251
|
+
│ desktop-tray │ System tray icon & menu │ vite-express-tauri only │ - │
|
|
252
|
+
│ docs-site │ MDX documentation site │ nextjs-compact only │ - │
|
|
253
|
+
└────────────────────┴───────────────────────────────┴────────────────────────────┴──────────────┘
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
### `devkit info`
|
|
259
|
+
|
|
260
|
+
Show full details for a component: description, version, variants, required config, files created, and changelog.
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
devkit info auth
|
|
264
|
+
devkit info hero-section
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
### `devkit update`
|
|
270
|
+
|
|
271
|
+
Update a specific component to its latest version (or a target version).
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
devkit update auth
|
|
275
|
+
devkit update auth@2.2.0
|
|
276
|
+
devkit update --all
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Only **managed files** (those DevKit originally created and you have not modified) are updated. User-modified files are left alone with a warning shown.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
### `devkit upgrade`
|
|
284
|
+
|
|
285
|
+
Upgrade all installed components to their latest versions in one step.
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
devkit upgrade
|
|
289
|
+
|
|
290
|
+
# Preview changes without applying them
|
|
291
|
+
devkit upgrade --dry-run
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
### `devkit doctor`
|
|
297
|
+
|
|
298
|
+
Check the project for configuration issues, missing environment variables, and available updates. Run this whenever something doesn't work — it tells you exactly what is wrong.
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
devkit doctor
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Example output:**
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
✓ Template detected: vite-express-tauri
|
|
308
|
+
✓ DevKit initialized
|
|
309
|
+
✓ auth@2.1.0 — OK
|
|
310
|
+
⚠ profile@1.0.0 — Update available: 1.2.0
|
|
311
|
+
✗ auth — Missing: GOOGLE_CLIENT_SECRET (Google OAuth will not work)
|
|
312
|
+
✗ auth — Missing: SMTP_HOST (email sending disabled)
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
### `devkit theme`
|
|
318
|
+
|
|
319
|
+
Manage the global design token system. All DevKit components use CSS variables — change one token and every component updates instantly.
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Regenerate globals.css from your current devkit.config.json
|
|
323
|
+
devkit theme apply
|
|
324
|
+
|
|
325
|
+
# Preview generated CSS without writing any files
|
|
326
|
+
devkit theme preview
|
|
327
|
+
|
|
328
|
+
# Switch to a named preset
|
|
329
|
+
devkit theme preset bold
|
|
330
|
+
|
|
331
|
+
# Set a single token
|
|
332
|
+
devkit theme set colors.primary "#e11d48"
|
|
333
|
+
|
|
334
|
+
# List all current theme settings
|
|
335
|
+
devkit theme list
|
|
336
|
+
|
|
337
|
+
# Scan component files for hardcoded colors (anti-pattern detector)
|
|
338
|
+
devkit theme audit
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Built-in presets:**
|
|
342
|
+
|
|
343
|
+
| Preset | Primary | Secondary | Radius | Style |
|
|
344
|
+
|--------|---------|-----------|--------|-------|
|
|
345
|
+
| `default` | Indigo `#6366f1` | Amber `#f59e0b` | `md` | Modern SaaS |
|
|
346
|
+
| `minimal` | Slate `#475569` | Sky `#0ea5e9` | `sm` | Clean, editorial |
|
|
347
|
+
| `bold` | Violet `#7c3aed` | Pink `#ec4899` | `lg` | Vibrant, expressive |
|
|
348
|
+
| `playful` | Emerald `#10b981` | Orange `#f97316` | `full` | Friendly, rounded |
|
|
349
|
+
| `corporate` | Blue `#1d4ed8` | Gray `#374151` | `none` | Formal, enterprise |
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
### `devkit install`
|
|
354
|
+
|
|
355
|
+
Restore all components from `devkit.lock.json`. Designed for CI/CD pipelines and fresh checkouts — the equivalent of `npm ci` but for DevKit components.
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
devkit install
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
### `devkit eject`
|
|
364
|
+
|
|
365
|
+
Stop DevKit from tracking a component without deleting its files. After ejecting, the files become entirely yours — no more updates via `devkit update`.
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
devkit eject auth
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Configuration Files
|
|
374
|
+
|
|
375
|
+
### `devkit.config.json`
|
|
376
|
+
|
|
377
|
+
The single source of truth for all component configuration. Committed to git. Sensitive values (API keys, secrets) are **referenced by env var name**, not stored directly.
|
|
378
|
+
|
|
379
|
+
```json
|
|
380
|
+
{
|
|
381
|
+
"$schema": "https://registry.devkit.roboticela.com/schemas/devkit-config.json",
|
|
382
|
+
"devkit": "1.0",
|
|
383
|
+
"template": "vite-express-tauri",
|
|
384
|
+
"site": {
|
|
385
|
+
"name": "My App",
|
|
386
|
+
"url": "https://myapp.com",
|
|
387
|
+
"description": "My awesome application"
|
|
388
|
+
},
|
|
389
|
+
"theme": {
|
|
390
|
+
"preset": "default",
|
|
391
|
+
"colors": {
|
|
392
|
+
"primary": "#6366f1",
|
|
393
|
+
"secondary": "#f59e0b"
|
|
394
|
+
},
|
|
395
|
+
"fonts": {
|
|
396
|
+
"sans": "Inter",
|
|
397
|
+
"mono": "JetBrains Mono"
|
|
398
|
+
},
|
|
399
|
+
"radius": "md",
|
|
400
|
+
"darkMode": true,
|
|
401
|
+
"darkModeStrategy": "class"
|
|
402
|
+
},
|
|
403
|
+
"auth": {
|
|
404
|
+
"enabled": true,
|
|
405
|
+
"providers": ["email", "google"],
|
|
406
|
+
"google": {
|
|
407
|
+
"clientId": "${GOOGLE_CLIENT_ID}",
|
|
408
|
+
"clientSecret": "${GOOGLE_CLIENT_SECRET}"
|
|
409
|
+
},
|
|
410
|
+
"smtp": {
|
|
411
|
+
"host": "${SMTP_HOST}",
|
|
412
|
+
"port": 587,
|
|
413
|
+
"user": "${SMTP_USER}",
|
|
414
|
+
"password": "${SMTP_PASSWORD}",
|
|
415
|
+
"from": "noreply@myapp.com"
|
|
416
|
+
},
|
|
417
|
+
"jwt": {
|
|
418
|
+
"accessSecret": "${JWT_ACCESS_SECRET}",
|
|
419
|
+
"refreshSecret": "${JWT_REFRESH_SECRET}",
|
|
420
|
+
"accessExpiresIn": "15m",
|
|
421
|
+
"refreshExpiresIn": "30d"
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### `devkit.lock.json`
|
|
428
|
+
|
|
429
|
+
Version lock file — committed to git to ensure deterministic installs across machines and CI environments.
|
|
430
|
+
|
|
431
|
+
```json
|
|
432
|
+
{
|
|
433
|
+
"lockVersion": 1,
|
|
434
|
+
"template": "vite-express-tauri",
|
|
435
|
+
"components": {
|
|
436
|
+
"auth": {
|
|
437
|
+
"version": "2.1.0",
|
|
438
|
+
"variant": null,
|
|
439
|
+
"resolved": "https://registry.devkit.roboticela.com/components/auth/2.1.0/vite-express-tauri.tar.gz",
|
|
440
|
+
"integrity": "sha512:...",
|
|
441
|
+
"installedAt": "2026-04-05T10:30:00Z"
|
|
442
|
+
},
|
|
443
|
+
"hero-section": {
|
|
444
|
+
"version": "1.3.0",
|
|
445
|
+
"variant": "split-image",
|
|
446
|
+
"resolved": "https://registry.devkit.roboticela.com/components/hero-section/1.3.0/variants/split-image/vite-express-tauri.tar.gz",
|
|
447
|
+
"integrity": "sha512:...",
|
|
448
|
+
"installedAt": "2026-04-05T11:00:00Z"
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## Design Token System
|
|
457
|
+
|
|
458
|
+
Every DevKit component uses **CSS custom properties** (variables) — no hardcoded colors, font sizes, or spacing values. This means changing your brand color in one place updates every button, form, card, and section across the entire app.
|
|
459
|
+
|
|
460
|
+
```
|
|
461
|
+
devkit.config.json → devkit theme apply → globals.css → all components
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
**Token categories:**
|
|
465
|
+
|
|
466
|
+
- **Brand colors** — primary, secondary with auto-derived hover, active, subtle, and text variants (WCAG AA contrast guaranteed)
|
|
467
|
+
- **Neutral / surface** — background, border, and card colors with dark mode variants
|
|
468
|
+
- **Semantic** — success, warning, error, info
|
|
469
|
+
- **Typography** — font families, sizes (`--text-xs` → `--text-6xl`), weights, line heights
|
|
470
|
+
- **Spacing** — `--space-1` through `--space-24`
|
|
471
|
+
- **Border radius** — `--radius-sm` through `--radius-full`
|
|
472
|
+
- **Shadows** and **transitions**
|
|
473
|
+
|
|
474
|
+
When you run `devkit theme set colors.primary "#e11d48"`, DevKit automatically computes and writes:
|
|
475
|
+
|
|
476
|
+
```
|
|
477
|
+
--color-primary #e11d48 (your value)
|
|
478
|
+
--color-primary-hover #c01140 (10% darker)
|
|
479
|
+
--color-primary-active #9e0d35 (20% darker)
|
|
480
|
+
--color-primary-subtle #fde8ed (90% lighter tint)
|
|
481
|
+
--color-primary-text #ffffff (WCAG-compliant contrast)
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
## Environment Variables
|
|
487
|
+
|
|
488
|
+
All secrets live in `.env` and are never committed. DevKit generates a `.env.example` listing everything your installed components need:
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
# auth component
|
|
492
|
+
JWT_ACCESS_SECRET= # generate: openssl rand -hex 32
|
|
493
|
+
JWT_REFRESH_SECRET= # generate: openssl rand -hex 32
|
|
494
|
+
GOOGLE_CLIENT_ID= # optional — enables Google OAuth
|
|
495
|
+
GOOGLE_CLIENT_SECRET= # optional — enables Google OAuth
|
|
496
|
+
SMTP_HOST= # optional — enables email sending
|
|
497
|
+
SMTP_PORT=587
|
|
498
|
+
SMTP_USER=
|
|
499
|
+
SMTP_PASSWORD=
|
|
500
|
+
|
|
501
|
+
# subscriptions component (if installed)
|
|
502
|
+
PADDLE_API_KEY=
|
|
503
|
+
PADDLE_WEBHOOK_SECRET=
|
|
504
|
+
PADDLE_PRICE_BASIC=
|
|
505
|
+
PADDLE_PRICE_PRO=
|
|
506
|
+
PADDLE_PRICE_LIFETIME=
|
|
507
|
+
|
|
508
|
+
# storage component (if installed)
|
|
509
|
+
R2_ACCOUNT_ID=
|
|
510
|
+
R2_ACCESS_KEY_ID=
|
|
511
|
+
R2_SECRET_ACCESS_KEY=
|
|
512
|
+
R2_BUCKET_NAME=
|
|
513
|
+
R2_PUBLIC_URL=
|
|
514
|
+
|
|
515
|
+
# database (vite-express-tauri)
|
|
516
|
+
DATABASE_URL=
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
Run `devkit doctor` at any time to see which variables are missing and what breaks without them.
|
|
520
|
+
|
|
521
|
+
**CLI registry override:**
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
# Point the CLI at a local registry during development
|
|
525
|
+
DEVKIT_REGISTRY=http://localhost:4000 devkit list
|
|
526
|
+
DEVKIT_REGISTRY=http://localhost:4000 devkit add auth
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
## Local Development
|
|
532
|
+
|
|
533
|
+
To work on the CLI itself:
|
|
534
|
+
|
|
535
|
+
```bash
|
|
536
|
+
# Install dependencies
|
|
537
|
+
cd cli
|
|
538
|
+
npm install
|
|
539
|
+
|
|
540
|
+
# Run directly with tsx (no build step needed)
|
|
541
|
+
npx tsx src/index.ts --help
|
|
542
|
+
npx tsx src/index.ts list
|
|
543
|
+
npx tsx src/index.ts create my-app
|
|
544
|
+
|
|
545
|
+
# Run against a local registry
|
|
546
|
+
DEVKIT_REGISTRY=http://localhost:4000 npx tsx src/index.ts list
|
|
547
|
+
|
|
548
|
+
# Lint
|
|
549
|
+
npm run lint
|
|
550
|
+
|
|
551
|
+
# Build to dist/
|
|
552
|
+
npm run build
|
|
553
|
+
|
|
554
|
+
# Run the compiled output
|
|
555
|
+
node dist/index.js --help
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
**Project structure:**
|
|
559
|
+
|
|
560
|
+
```
|
|
561
|
+
cli/
|
|
562
|
+
├── src/
|
|
563
|
+
│ ├── index.ts ← Entry point — registers all commands
|
|
564
|
+
│ ├── commands/
|
|
565
|
+
│ │ ├── create.ts ← devkit create
|
|
566
|
+
│ │ ├── init.ts ← devkit init
|
|
567
|
+
│ │ ├── add.ts ← devkit add
|
|
568
|
+
│ │ ├── remove.ts ← devkit remove
|
|
569
|
+
│ │ ├── list.ts ← devkit list
|
|
570
|
+
│ │ ├── info.ts ← devkit info
|
|
571
|
+
│ │ ├── update.ts ← devkit update / upgrade
|
|
572
|
+
│ │ ├── doctor.ts ← devkit doctor
|
|
573
|
+
│ │ └── theme.ts ← devkit theme *
|
|
574
|
+
│ └── lib/
|
|
575
|
+
│ ├── config.ts ← Read/write devkit.config.json & devkit.lock.json
|
|
576
|
+
│ ├── installer.ts ← Download + extract component tarballs
|
|
577
|
+
│ └── logger.ts ← Consistent terminal output helpers
|
|
578
|
+
├── dist/ ← Compiled output (generated by npm run build)
|
|
579
|
+
├── scripts/
|
|
580
|
+
│ └── post-build.js ← Makes dist/index.js executable after tsc
|
|
581
|
+
├── package.json
|
|
582
|
+
└── tsconfig.json
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
---
|
|
586
|
+
|
|
587
|
+
## Publishing a Release
|
|
588
|
+
|
|
589
|
+
The CLI is published as `@roboticela/devkit` on npm.
|
|
590
|
+
|
|
591
|
+
```bash
|
|
592
|
+
cd cli
|
|
593
|
+
|
|
594
|
+
# Login once
|
|
595
|
+
npm login
|
|
596
|
+
|
|
597
|
+
# Publish a patch release (2.0.0 → 2.0.1)
|
|
598
|
+
npm run release:patch
|
|
599
|
+
|
|
600
|
+
# Publish a minor release (2.0.0 → 2.1.0)
|
|
601
|
+
npm run release:minor
|
|
602
|
+
|
|
603
|
+
# Publish a major release (2.0.0 → 3.0.0)
|
|
604
|
+
npm run release:major
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
Each release script bumps the version in `package.json`, runs `npm run build` via `prepublishOnly`, and publishes with `--access public`.
|
|
608
|
+
|
|
609
|
+
After publishing:
|
|
610
|
+
|
|
611
|
+
```bash
|
|
612
|
+
npx @roboticela/devkit create my-app # always runs the latest published version
|
|
613
|
+
npm install -g @roboticela/devkit # or install globally
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
---
|
|
617
|
+
|
|
618
|
+
## License
|
|
619
|
+
|
|
620
|
+
MIT — [Roboticela](https://roboticela.com)
|
package/dist/index.js
CHANGED
|
@@ -150,6 +150,6 @@ ${chalk.bold("Examples:")}
|
|
|
150
150
|
${chalk.cyan("devkit doctor")} Check configuration
|
|
151
151
|
${chalk.cyan("devkit list")} Browse all components
|
|
152
152
|
|
|
153
|
-
${chalk.dim("Registry:")} ${process.env.DEVKIT_REGISTRY ?? "https://
|
|
153
|
+
${chalk.dim("Registry:")} ${process.env.DEVKIT_REGISTRY ?? "https://registry.devkit.roboticela.com"}
|
|
154
154
|
`);
|
|
155
155
|
program.parse();
|
package/dist/lib/config.js
CHANGED
|
@@ -32,7 +32,7 @@ export function isComponentInstalled(name, cwd = process.cwd()) {
|
|
|
32
32
|
}
|
|
33
33
|
export function defaultConfig(template, siteName, siteUrl) {
|
|
34
34
|
return {
|
|
35
|
-
$schema: "https://registry.roboticela.com/schemas/devkit-config.json",
|
|
35
|
+
$schema: "https://registry.devkit.roboticela.com/schemas/devkit-config.json",
|
|
36
36
|
devkit: "1.0",
|
|
37
37
|
template,
|
|
38
38
|
site: { name: siteName, url: siteUrl },
|
package/dist/lib/installer.js
CHANGED
|
@@ -7,7 +7,7 @@ import { pipeline } from "stream/promises";
|
|
|
7
7
|
import { getManifest } from "./registry.js";
|
|
8
8
|
import { readLock, writeLock } from "./config.js";
|
|
9
9
|
import { log } from "./logger.js";
|
|
10
|
-
const REGISTRY_URL = process.env.DEVKIT_REGISTRY ?? "https://
|
|
10
|
+
const REGISTRY_URL = process.env.DEVKIT_REGISTRY ?? "https://registry.devkit.roboticela.com";
|
|
11
11
|
function hashFile(path) {
|
|
12
12
|
const content = readFileSync(path);
|
|
13
13
|
return createHash("sha256").update(content).digest("hex");
|
package/dist/lib/registry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const REGISTRY_URL = process.env.DEVKIT_REGISTRY ?? "https://
|
|
1
|
+
const REGISTRY_URL = process.env.DEVKIT_REGISTRY ?? "https://registry.devkit.roboticela.com";
|
|
2
2
|
async function get(path) {
|
|
3
3
|
const res = await fetch(`${REGISTRY_URL}${path}`);
|
|
4
4
|
if (!res.ok)
|