agnosticui-cli 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (52) hide show
  1. package/README.md +124 -1170
  2. package/dist/cli.js +70 -28
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/add.d.ts.map +1 -1
  5. package/dist/commands/add.js +25 -34
  6. package/dist/commands/add.js.map +1 -1
  7. package/dist/commands/context.d.ts +3 -0
  8. package/dist/commands/context.d.ts.map +1 -0
  9. package/dist/commands/context.js +243 -0
  10. package/dist/commands/context.js.map +1 -0
  11. package/dist/commands/init.d.ts.map +1 -1
  12. package/dist/commands/init.js +145 -110
  13. package/dist/commands/init.js.map +1 -1
  14. package/dist/commands/list.js +4 -4
  15. package/dist/commands/list.js.map +1 -1
  16. package/dist/commands/playbook.d.ts +3 -0
  17. package/dist/commands/playbook.d.ts.map +1 -0
  18. package/dist/commands/playbook.js +189 -0
  19. package/dist/commands/playbook.js.map +1 -0
  20. package/dist/commands/remove.js +2 -2
  21. package/dist/commands/remove.js.map +1 -1
  22. package/dist/commands/storybook.d.ts +3 -0
  23. package/dist/commands/storybook.d.ts.map +1 -0
  24. package/dist/commands/storybook.js +144 -0
  25. package/dist/commands/storybook.js.map +1 -0
  26. package/dist/commands/sync.d.ts +1 -4
  27. package/dist/commands/sync.d.ts.map +1 -1
  28. package/dist/commands/sync.js +41 -33
  29. package/dist/commands/sync.js.map +1 -1
  30. package/dist/commands/view.d.ts +3 -0
  31. package/dist/commands/view.d.ts.map +1 -0
  32. package/dist/commands/view.js +109 -0
  33. package/dist/commands/view.js.map +1 -0
  34. package/dist/types/index.d.ts +24 -2
  35. package/dist/types/index.d.ts.map +1 -1
  36. package/dist/utils/logger.d.ts +1 -0
  37. package/dist/utils/logger.d.ts.map +1 -1
  38. package/dist/utils/logger.js +3 -0
  39. package/dist/utils/logger.js.map +1 -1
  40. package/dist/utils/npm.d.ts +13 -0
  41. package/dist/utils/npm.d.ts.map +1 -0
  42. package/dist/utils/npm.js +62 -0
  43. package/dist/utils/npm.js.map +1 -0
  44. package/dist/utils/stories.d.ts +11 -0
  45. package/dist/utils/stories.d.ts.map +1 -0
  46. package/dist/utils/stories.js +661 -0
  47. package/dist/utils/stories.js.map +1 -0
  48. package/dist/utils/viewer.d.ts +4 -0
  49. package/dist/utils/viewer.d.ts.map +1 -0
  50. package/dist/utils/viewer.js +1067 -0
  51. package/dist/utils/viewer.js.map +1 -0
  52. package/package.json +7 -5
package/README.md CHANGED
@@ -2,89 +2,45 @@
2
2
 
3
3
  CLI for AgnosticUI Local - The UI kit that lives in your codebase.
4
4
 
5
- ## Development Setup
5
+ > **See also:** Developer guide (build, test, publish) at [`v2/docs/CLI.md`](../docs/CLI.md)
6
6
 
7
- ### Using the Script
7
+ ## What is AgnosticUI Local?
8
8
 
9
- The process of creating a consumer test project is encapsulated in the `qa-verify.js` script for convenience which can be used as follows:
9
+ AgnosticUI Local is a new approach to UI libraries. Instead of installing components as a dependency in `node_modules/`, the entire library lives in your project as a **reference library**, and you copy components you need into your own source code.
10
10
 
11
- Move the last run if you want to preserve it:
11
+ **Benefits:**
12
12
 
13
- ```shell
14
- mv v2/qa_workspace/lit-test v2/qa_workspace/lit-test-v1
15
- ```
16
-
17
- Or, if you'd prefer to just completely obliterate the workspace you can "clean" it:
13
+ - **AI-Friendly**: Run `ag context` to generate a `CLAUDE.md` that gives AI coding tools (Claude Code, Cursor, Windsurf) full awareness of your installed components and their props
14
+ - **Complete Ownership**: Components are copied to your project - modify them however you want
15
+ - **Zero Lock-in**: No black boxes, no vendor dependencies
16
+ - **Upgrade Safety**: Reference library updates independently from your customized components
18
17
 
19
- ```shell
20
- rm -rf v2/qa_workspace/ # Optionally cleanup last run
21
- ```
18
+ ## Installation
22
19
 
23
- Create new consumer test project (for Lit in this case):
20
+ ```bash
21
+ # Initialize AgnosticUI in your project
22
+ npx agnosticui-cli@alpha init
24
23
 
25
- ```shell
26
- ./v2/cli/scripts/qa-verify.js --framework lit
24
+ # Or install globally
25
+ npm install -g agnosticui-cli@alpha
26
+ ag init
27
27
  ```
28
28
 
29
- The following goes into step by step details on this…
30
-
31
- ### Build the CLI
29
+ ## Quick Start
32
30
 
33
31
  ```bash
34
- npm install # Install dependencies (required first!)
35
- npm run build # Build TypeScript to dist/
36
- ```
37
-
38
- ### Test Locally
39
-
40
- The CLI is designed to work with a local tarball for development/dogfooding.
41
-
42
- 1. **Build the v2/lib library tarball first:**
43
-
44
- ```bash
45
- cd ../../ # Go to v2 root
46
- ./scripts/build-local-tarball.sh
47
- ```
48
-
49
- **Note:** The tarball name will be `agnosticui-local-v{VERSION}.tar.gz` where VERSION comes from `v2/lib/package.json`.
50
-
51
- 2. **Package the CLI for local testing:**
52
-
53
- **Using `npm pack`**
54
-
55
- ```bash
56
- cd cli
57
- npm install # Install dependencies (first time only)
58
- npm run build # Build TypeScript to dist/
59
- npm pack # Package it
60
- # This creates: agnosticui-cli-2.0.0-alpha.1.tgz
61
- ```
62
-
63
- Then in your test project:
64
-
65
- ```bash
66
- cd /path/to/your/test/project
67
- npm install /path/to/agnosticui/v2/cli/agnosticui-cli-2.0.0-alpha.1.tgz
68
-
69
- # Now you can use the CLI
70
- # Note: Replace VERSION with the version from v2/lib/package.json (e.g., 0.0.1)
71
- npx ag init --framework vue --tarball /path/to/v2/dist/agnosticui-local-vVERSION.tar.gz
72
- # Note: if already initialized, we can also use `sync` to update the reference library
73
- # npx ag sync --tarball /path/to/v2/dist/agnosticui-local-vVERSION.tar.gz
74
- npx ag add button input
75
- npx ag list
76
- ```
32
+ # 1. Initialize (creates reference library in ./agnosticui/)
33
+ npx ag init --framework react
77
34
 
78
- **T3. **Quick test workflow with pack:\*\*
35
+ # 2. Add components to your project
36
+ npx ag add button input checkbox
79
37
 
80
- ```bash
81
- # PREREQUISITES: Build component v2/lib and cli tarball first. See above.
38
+ # 3. List available components
39
+ npx ag list
82
40
 
83
- # In test project
84
- npm install /path/to/agnosticui/v2/cli/agnosticui-cli-2.0.0-alpha.1.tgz --force
85
- # Note: Replace VERSION with the version from v2/lib/package.json
86
- npx ag init --framework vue --tarball /path/to/v2/dist/agnosticui-local-vVERSION.tar.gz
87
- ```
41
+ # 4. Import and use in your code
42
+ import { ReactButton } from './components/ag/Button/react'
43
+ ```
88
44
 
89
45
  ## Commands
90
46
 
@@ -92,11 +48,13 @@ The CLI is designed to work with a local tarball for development/dogfooding.
92
48
 
93
49
  Initialize AgnosticUI Local in your project.
94
50
 
95
- **Options:**
51
+ ```bash
52
+ ag init [options]
96
53
 
97
- - `-f, --framework <framework>` - Framework to use (react, vue, lit, svelte)
98
- - `-p, --components-path <path>` - Path where components will be generated (default: `./src/components/ag`)
99
- - `-t, --tarball <path>` - Path to local tarball (for development)
54
+ Options:
55
+ -f, --framework <framework> Framework to use: react, vue, lit, svelte
56
+ -p, --components-path <path> Where to generate components (default: ./src/components/ag)
57
+ ```
100
58
 
101
59
  **Example:**
102
60
 
@@ -108,28 +66,21 @@ ag init --framework react --components-path ./src/components/ag
108
66
 
109
67
  Add one or more components to your project.
110
68
 
111
- **Options:**
112
-
113
- - `--force` - Overwrite existing components
114
-
115
- **Examples:**
116
-
117
69
  ```bash
118
- # Add a single component
119
- ag add button
70
+ ag add <components...> [options]
120
71
 
121
- # Add multiple components
122
- ag add button input checkbox
72
+ Options:
73
+ --force Overwrite existing components
123
74
 
124
- # Overwrite existing
125
- ag add button --force
75
+ Examples:
76
+ ag add button # Add single component
77
+ ag add button input checkbox # Add multiple components
78
+ ag add button --force # Overwrite existing
126
79
  ```
127
80
 
128
81
  ### `ag list`
129
82
 
130
- List all available components and show which ones are already added to your project.
131
-
132
- **Example:**
83
+ List all available components and show which are already added.
133
84
 
134
85
  ```bash
135
86
  ag list
@@ -137,1132 +88,135 @@ ag list
137
88
 
138
89
  ### `ag sync`
139
90
 
140
- Update the reference library from a tarball (useful during local development).
141
-
142
- **Options:**
143
-
144
- - `-t, --tarball <path>` - Path to tarball (overrides path from config)
145
-
146
- **Examples:**
91
+ Update the reference library to the latest version (your customized components are never touched).
147
92
 
148
93
  ```bash
149
- # Use tarball path from config
150
94
  ag sync
151
-
152
- # Override with specific tarball
153
- ag sync --tarball /path/to/new/agnosticui-local-v0.0.2.tar.gz
154
95
  ```
155
96
 
156
- **What it does:**
157
-
158
- 1. Reads tarball path from `agnosticui.config.json` (or uses `--tarball` flag)
159
- 2. Shows confirmation with tarball path and version
160
- 3. Extracts tarball to `./agnosticui/` (overwrites reference library)
161
- 4. Updates CSS tokens in `{componentsPath}/styles/`
162
- 5. Updates config with new tarball info and timestamp
163
-
164
- **Your components are never touched** - only the reference library is updated.
97
+ ### `ag playbook [slug]`
165
98
 
166
- **Typical workflow:**
99
+ Install a pre-built page template (playbook) into your project. Files are fetched from GitHub
100
+ and written to `src/playbooks/<slug>/` by default.
167
101
 
168
102
  ```bash
169
- # Rebuild the library
170
- cd v2
171
- ./scripts/build-local-tarball.sh
103
+ ag playbook [slug] [options]
172
104
 
173
- # Sync in your project
174
- cd ../your-project
175
- npx ag sync
176
- ```
177
-
178
- ## How It Works
105
+ Options:
106
+ -f, --framework <framework> Framework to use (react, vue, lit)
107
+ -p, --path <path> Destination path (default: src/playbooks/<slug>)
108
+ --list List all available playbooks
109
+ --force Overwrite existing destination without prompting
179
110
 
180
- 1. **`ag init`** extracts the AgnosticUI reference library to `./agnosticui/` and creates a config file (saves tarball path for sync)
181
- 2. **`ag add`** copies both the `core/` and framework-specific directories (e.g., `react/`) from the reference library to your project
182
- 3. **`ag sync`** updates the reference library by re-extracting from the tarball (your components remain untouched)
183
- 4. Components are fully yours to customize - they're copied, not linked
184
-
185
- ## Project Structure After Init
186
-
187
- ```
188
- your-project/
189
- ├── agnosticui/ # Reference library
190
- │ ├── lib/
191
- │ │ ├── dist/ # Built components
192
- │ │ └── src/ # Source files
193
- │ ├── tokens/ # Design tokens
194
- │ ├── docs/ # Documentation
195
- │ └── components.json # Component registry
196
- ├── src/
197
- │ └── components/
198
- │ └── ag/ # Your components (customizable)
199
- │ ├── Button/
200
- │ │ ├── core/ # Core Web Component
201
- │ │ └── react/ # React wrapper
202
- │ └── Input/
203
- │ ├── core/
204
- │ └── react/
205
- └── agnosticui.config.json # CLI configuration
111
+ Examples:
112
+ ag playbook --list # Show all available playbooks
113
+ ag playbook login --framework react # Install the Login playbook (React)
114
+ ag playbook dashboard --framework vue # Install the Dashboard playbook (Vue)
115
+ ag playbook login --framework lit --path ./my-login # Custom destination
206
116
  ```
207
117
 
208
- ## How Package Resolution Works
209
-
210
- The CLI uses a **two-tier resolution strategy** to find the AgnosticUI core library:
118
+ Available playbooks include: `login`, `login-v2`, `onboarding`, `onboarding-v2`,
119
+ `dashboard`, `support`, `grid`, `grid-v2`, `blog`, `landing`, `form-association`.
211
120
 
212
- ### 1. Local Development Mode (Priority)
121
+ Each playbook is a self-contained Vite project you can run directly (`npm install && npm run dev`)
122
+ or use as a reference while copying the pieces you need into your own project.
213
123
 
214
- When developing locally, the CLI first checks for a tarball at:
215
-
216
- ```
217
- ../../dist/agnosticui-local-v2.0.0-alpha.tar.gz
218
- ```
124
+ ### `ag context`
219
125
 
220
- This allows testing changes without publishing to NPM.
221
-
222
- ### 2. Production Mode (NPM Registry)
223
-
224
- If no local tarball is found, the CLI downloads from NPM:
225
-
226
- ```bash
227
- npm pack agnosticui-core@${version}
228
- ```
229
-
230
- **Package Names:**
231
-
232
- - **Development tarball**: `agnosticui-local-v*.tar.gz` (built locally)
233
- - **NPM package**: `agnosticui-core` (published to registry)
234
-
235
- ### Usage Examples
236
-
237
- **Local Development:**
238
-
239
- ```bash
240
- # Build local tarball first
241
- cd v2
242
- ./scripts/build-local-tarball.sh
243
-
244
- # Use in test project
245
- npx ag init --framework react --tarball /path/to/v2/dist/agnosticui-local-v2.0.0-alpha.tar.gz
246
- ```
247
-
248
- **Production (After Publishing):**
126
+ Generate an AI context file from your installed components. The file describes every installed
127
+ component — its import path, props, and types — so AI coding tools (Claude Code, Cursor, Windsurf,
128
+ Copilot) automatically understand your local component library.
249
129
 
250
130
  ```bash
251
- # Downloads agnosticui-core@alpha from NPM
252
- npx ag init --framework react
253
-
254
- # Or specify a version
255
- npx ag init --framework react --version latest
256
- npx ag init --framework react --version 2.0.0
257
- ```
258
-
259
- ## Testing After NPM Publication
131
+ ag context [options]
260
132
 
261
- **CRITICAL: Follow these steps to verify the published package works correctly**
133
+ Options:
134
+ -f, --format <tool> AI tool to target: claude, cursor, copilot, windsurf, openai, gemini, generic
135
+ -o, --output <path> Explicit output path (overrides --format and auto-detect)
262
136
 
263
- ### 1. Publish to NPM (Covered in Phase 4 below)
264
-
265
- ```bash
266
- cd v2/cli
267
- npm publish --tag alpha
137
+ Examples:
138
+ npx agnosticui-cli context # Auto-detect tool, default to CLAUDE.md
139
+ npx agnosticui-cli context --format cursor # Write to .cursor/rules/agnosticui.mdc
140
+ npx agnosticui-cli context --format copilot # Write to .github/copilot-instructions.md
141
+ npx agnosticui-cli context --format windsurf # Write to .windsurfrules
142
+ npx agnosticui-cli context --format openai # Write to AGENTS.md
143
+ npx agnosticui-cli context --output my-ai.md # Custom path
268
144
  ```
269
145
 
270
- ### 2. Wait for NPM Propagation
271
-
272
- Wait 1-2 minutes for NPM to propagate the package globally.
273
-
274
- ### 3. Verify in a Fresh Environment
275
-
276
- ```bash
277
- # Create a completely fresh test directory
278
- mkdir /tmp/test-agui-npm-$(date +%s)
279
- cd /tmp/test-agui-npm-$(date +%s)
280
-
281
- # Initialize a basic project
282
- npm init -y
283
-
284
- # Test global installation
285
- npm install -g agnosticui-cli@alpha
286
-
287
- # Verify CLI is available
288
- ag --version # Should show: 2.0.0-alpha.1
289
-
290
- # CRITICAL TEST: Initialize WITHOUT --tarball flag
291
- # This forces NPM download of agnosticui-core
292
- ag init --framework react
293
-
294
- # Verify the package was downloaded
295
- ls -la agnosticui/ # Should contain extracted library
146
+ When no `--format` or `--output` is given, the command auto-detects configured AI tools
147
+ (by checking for `.claude/`, `.cursor/`, `.windsurfrules`, etc.) and picks the right file.
148
+ If multiple tools are detected, an interactive prompt asks which to use.
296
149
 
297
- # Add a component
298
- ag add button
150
+ The output file uses HTML sentinel markers so re-running only replaces the AgnosticUI
151
+ section anything else in the file is preserved. Re-run after adding or updating components.
299
152
 
300
- # Verify component files exist
301
- ls -la src/components/ag/Button/
302
- ```
303
-
304
- ### 4. Test with npx (No Global Install)
305
-
306
- ```bash
307
- # Create another fresh test directory
308
- mkdir /tmp/test-npx-$(date +%s)
309
- cd /tmp/test-npx-$(date +%s)
310
- npm init -y
311
-
312
- # CRITICAL: This should work without ANY prior installation
313
- npx agnosticui-cli@alpha init --framework vue
314
- npx agnosticui-cli@alpha add button input
315
- ```
153
+ ### `ag view`
316
154
 
317
- ### 5. Test Different Version Tags
155
+ Launch a lightweight Vite-powered component viewer for all your installed (ejected) components.
156
+ No Storybook setup required — just run the command from your project root.
318
157
 
319
158
  ```bash
320
- # Test specific version
321
- ag init --framework react --version 2.0.0-alpha.1
322
-
323
- # Test 'latest' tag (after stable release)
324
- ag init --framework react --version latest
325
- ```
326
-
327
- ### 6. Verification Checklist
328
-
329
- After publishing, verify:
330
-
331
- - [ ] `npm info agnosticui-cli` shows correct version
332
- - [ ] `npm info agnosticui-core` shows correct version
333
- - [ ] `ag init` downloads from NPM (without --tarball flag)
334
- - [ ] Fresh install in `/tmp` directory works
335
- - [ ] `npx agnosticui-cli@alpha init` works without global install
336
- - [ ] Components are correctly copied to project
337
- - [ ] Config file is created properly
338
-
339
- ### Troubleshooting Published Package
340
-
341
- **Problem: "Failed to download agnosticui-core from NPM"**
159
+ ag view [options]
342
160
 
343
- ```bash
344
- # Check if package is published
345
- npm info agnosticui-core@alpha
161
+ Options:
162
+ -p, --port <number> Dev server port (default: 7173)
163
+ --clean Delete .agnosticui-viewer/ and rebuild from scratch
164
+ --no-open Skip auto-opening the browser
346
165
 
347
- # Check if you can manually download it
348
- npm pack agnosticui-core@alpha
349
- tar -tzf agnosticui-core-*.tgz # Should show package contents
166
+ Examples:
167
+ ag view # Start viewer at http://localhost:7173
168
+ ag view --port 8080 # Use a custom port
169
+ ag view --clean # Full rebuild (use after ag add / ag sync)
170
+ ag view --no-open # Don't auto-open browser
350
171
  ```
351
172
 
352
- **Problem: CLI not found after global install**
353
-
354
- ```bash
355
- # Check install location
356
- npm list -g agnosticui-cli
357
-
358
- # Verify bin path
359
- npm bin -g
173
+ The viewer generates a self-contained Vite app in `.agnosticui-viewer/` (gitignored) using
174
+ your project's framework (React, Vue, or Lit/vanilla). It shows each installed component with
175
+ a three-tab panel: **Preview**, **HTML** import snippet, and **Info** metadata.
360
176
 
361
- # Reinstall
362
- npm uninstall -g agnosticui-cli
363
- npm install -g agnosticui-cli@alpha
364
- ```
177
+ CSS tokens and any `ag-theme.css` skin override in your styles directory are automatically
178
+ applied so components look exactly as they do in your app.
365
179
 
366
- ## Development Notes
180
+ `node_modules` inside `.agnosticui-viewer/` are cached between runs. The App entry file is
181
+ always regenerated (cheap) so the component list stays current. Run `ag view --clean` after
182
+ a `ag add` or `ag sync` when you want a guaranteed fresh install.
367
183
 
368
- - All file operations preserve the structure: `core/` + `framework/`
369
- - `npm pack` is more reliable than `npm link` for local testing
370
- - Remember to rebuild (`npm run build`) and repack after making CLI changes
371
- - The temp download directory `.tmp-ag-download` is automatically cleaned up after init
372
-
373
- # AgnosticUI v2 - Publishing & Transition Guide
374
-
375
- ## Package Naming Decision
376
-
377
- Since `@agnosticui` organization is unavailable on npm, we'll use non-scoped packages matching your v1 pattern:
378
-
379
- - **v1 packages**: `agnostic-angular`, `agnostic-react`, `agnostic-vue`, `agnostic-svelte`
380
- - **v2 packages**: `agnosticui-core`, `agnosticui-cli`
381
-
382
- This maintains consistency and leverages your existing npm namespace.
383
-
384
- ---
385
-
386
- ## CORRECTED EXECUTION ORDER
387
-
388
- ### Phase 1: Repository Restructuring (DO THIS FIRST!)
389
-
390
- **Why first?** Clean up the repo structure before publishing. Publishing is the final validation step.
391
-
392
- #### 1.1 Create Safety Backups
393
-
394
- ```bash
395
- # Ensure you're on the latest master
396
- git checkout master
397
- git pull origin master
398
-
399
- # Create backup branch
400
- git branch backup-before-v2-transition
401
- git push origin backup-before-v2-transition
402
-
403
- # Create v1-legacy branch for historical reference
404
- git checkout -b v1-legacy
405
- git push origin v1-legacy
406
- ```
407
-
408
- #### 1.2 Protect v1-legacy Branch (GitHub Settings)
409
-
410
- - Go to: Settings → Branches → Add branch protection rule
411
- - Branch name: `v1-legacy`
412
- - Enable: "Lock branch" (read-only)
413
- - Save
414
-
415
- #### 1.3 Clean Master Branch
416
-
417
- ```bash
418
- # Return to master
419
- git checkout master
420
-
421
- # Document what's being removed
422
- ls -la | grep -E "(agnostic-|site)" > v1-directories-removed.txt
423
- git add v1-directories-removed.txt
424
- git commit -m "docs: record v1 directories before removal"
425
-
426
- # Remove v1 directories
427
- git rm -rf agnostic-angular/
428
- git rm -rf agnostic-react/
429
- git rm -rf agnostic-vue/
430
- git rm -rf agnostic-svelte/
431
- git rm -rf site/
432
- git rm -rf agnostic-astro/ # if exists
433
- git rm -rf agnostic-preact/ # if exists
434
- # Remove any other v1-specific directories
435
-
436
- git commit -m "chore: remove v1 directories, preparing for v2 as primary"
437
- ```
438
-
439
- #### 1.4 Merge v2 into Master
440
-
441
- ```bash
442
- # Merge v2 feature branch
443
- git merge feature/agnosticui-v2-integration --no-ff -m "feat: merge AgnosticUI v2
444
-
445
- - Complete rewrite with CLI-first approach
446
- - Web Components architecture
447
- - Support for React, Vue, Lit, Svelte
448
- - Local component management
449
- - Zero runtime dependencies"
450
-
451
- # Push to master
452
- git push origin master
453
- ```
454
-
455
- #### 1.5 Update Root Files
456
-
457
- **Root README.md:**
458
-
459
- ````markdown
460
- # AgnosticUI v2
461
-
462
- > The UI component kit that lives in your codebase
463
-
464
- AgnosticUI v2 is a CLI-based UI component library that copies components directly into your project. You own the code, customize it freely, and avoid dependency lock-in.
465
-
466
- ## Installation
184
+ ## How It Works
467
185
 
468
- ```bash
469
- # Install CLI globally
470
- npm install -g agnosticui-cli@alpha
186
+ After running `ag init`, your project structure looks like this:
471
187
 
472
- # Or use with npx
473
- npx agnosticui-cli@alpha init
474
188
  ```
475
- ````
476
-
477
- ## Quick Start
478
-
479
- ```bash
480
- # Initialize in your project
481
- ag init --framework react
482
-
483
- # Add components
484
- ag add button input card
485
-
486
- # The components are now in your src/ - customize freely!
189
+ your-project/
190
+ ├── agnosticui/ # Reference library (all components)
191
+ │ ├── lib/src/components/ # Source for all 56 components
192
+ │ └── docs/ # Documentation
193
+ ├── src/components/ag/ # YOUR components (copied, customizable)
194
+ │ ├── Button/ # You own this code
195
+ │ └── Input/ # Modify freely
196
+ └── agnosticui.config.json # CLI configuration
487
197
  ```
488
198
 
489
- ## Features
490
-
491
- - 🎯 **CLI-First**: Copy components directly to your project
492
- - 🔧 **You Own It**: Full control, no black boxes
493
- - 🌐 **Framework Agnostic**: React, Vue, Lit, Svelte support
494
- - 🎨 **Design Token System**: Consistent theming
495
- - 📦 **Zero Runtime Deps**: Components work standalone
496
- - ♿ **Accessible**: WCAG 2.1 AA compliant
199
+ **The workflow:**
497
200
 
498
- ## Documentation
201
+ 1. **Reference library** (`./agnosticui/`) - Full library for context, visible to AI tools
202
+ 2. **Your components** (`./src/components/ag/`) - Copied components you can customize
203
+ 3. **Update safely** - `ag sync` updates reference, never touches your code
499
204
 
500
- Visit [your-docs-url] for full documentation.
205
+ ## Framework Support
501
206
 
502
- ## Looking for v1?
207
+ AgnosticUI supports React, Vue 3, Lit, and Svelte:
503
208
 
504
- AgnosticUI v1 packages are available on the `v1-legacy` branch and still published on npm:
209
+ - **React**: Components using @lit/react wrappers
210
+ - **Vue 3**: Vue components using Composition API
211
+ - **Lit**: Native web components
212
+ - **Svelte**: Direct web component support (excellent compatibility)
505
213
 
506
- - `agnostic-angular`
507
- - `agnostic-react`
508
- - `agnostic-vue`
509
- - `agnostic-svelte`
214
+ ## More Information
510
215
 
511
- [View v1 Documentation](link-to-v1-docs)
216
+ - [GitHub Repository](https://github.com/AgnosticUI/agnosticui)
217
+ - [Documentation](https://www.agnosticui.com)
218
+ - [Component Library Package](https://www.npmjs.com/package/agnosticui-core)
512
219
 
513
220
  ## License
514
221
 
515
- MIT
516
-
517
- ````
518
-
519
- **Root package.json:**
520
-
521
- ```json
522
- {
523
- "name": "agnosticui-monorepo",
524
- "version": "2.0.0-alpha.1",
525
- "private": true,
526
- "description": "AgnosticUI v2 - The UI kit that lives in your codebase",
527
- "workspaces": [
528
- "v2/lib",
529
- "v2/cli",
530
- "v2/docs"
531
- ],
532
- "scripts": {
533
- "build": "npm run build --workspaces",
534
- "test": "npm run test --workspaces",
535
- "docs:dev": "npm run dev --workspace=v2/docs",
536
- "docs:build": "npm run build --workspace=v2/docs"
537
- },
538
- "repository": {
539
- "type": "git",
540
- "url": "https://github.com/yourusername/agnosticui.git"
541
- },
542
- "keywords": ["ui", "components", "cli", "design-system", "web-components"],
543
- "author": "Your Name",
544
- "license": "MIT"
545
- }
546
- ````
547
-
548
- #### 1.6 Delete Feature Branch (After Verification)
549
-
550
- ```bash
551
- # Verify everything looks good on master
552
- git log --oneline -10
553
- git status
554
-
555
- # Delete local feature branch
556
- git branch -d feature/agnosticui-v2-integration
557
-
558
- # Delete remote feature branch
559
- git push origin --delete feature/agnosticui-v2-integration
560
- ```
561
-
562
- ---
563
-
564
- ### Phase 2: Update Package Names for Non-Scoped Publishing
565
-
566
- #### 2.1 Update Core Library package.json
567
-
568
- **File: `v2/lib/package.json`**
569
-
570
- ```json
571
- {
572
- "name": "agnosticui-core",
573
- "version": "2.0.0-alpha.1",
574
- "description": "AgnosticUI v2 Core - Web Components and framework adapters",
575
- "main": "./dist/index.js",
576
- "types": "./dist/index.d.ts",
577
- "files": ["dist", "src", "README.md", "LICENSE"],
578
- "publishConfig": {
579
- "access": "public"
580
- },
581
- "keywords": [
582
- "agnosticui",
583
- "ui-components",
584
- "web-components",
585
- "design-system",
586
- "react",
587
- "vue",
588
- "svelte",
589
- "lit"
590
- ],
591
- "repository": {
592
- "type": "git",
593
- "url": "https://github.com/yourusername/agnosticui.git",
594
- "directory": "v2/lib"
595
- },
596
- "author": "Rob Levin <rlevin@example.com>",
597
- "license": "MIT",
598
- "scripts": {
599
- "build": "tsc",
600
- "prepublishOnly": "npm run build"
601
- }
602
- }
603
- ```
604
-
605
- #### 2.2 Update CLI package.json
606
-
607
- **File: `v2/cli/package.json`**
608
-
609
- ```json
610
- {
611
- "name": "agnosticui-cli",
612
- "version": "2.0.0-alpha.1",
613
- "description": "AgnosticUI v2 CLI - Copy components directly to your project",
614
- "bin": {
615
- "ag": "./dist/cli.js"
616
- },
617
- "main": "./dist/index.js",
618
- "types": "./dist/index.d.ts",
619
- "files": ["dist", "README.md", "LICENSE"],
620
- "publishConfig": {
621
- "access": "public"
622
- },
623
- "keywords": [
624
- "agnosticui",
625
- "cli",
626
- "ui-components",
627
- "code-generator",
628
- "component-library"
629
- ],
630
- "repository": {
631
- "type": "git",
632
- "url": "https://github.com/yourusername/agnosticui.git",
633
- "directory": "v2/cli"
634
- },
635
- "author": "Rob Levin <rlevin@example.com>",
636
- "license": "MIT",
637
- "dependencies": {
638
- "commander": "^12.0.0",
639
- "ora": "^8.0.0",
640
- "chalk": "^5.3.0",
641
- "prompts": "^2.4.2",
642
- "tar": "^7.0.0"
643
- },
644
- "scripts": {
645
- "build": "tsc",
646
- "prepublishOnly": "npm run build"
647
- }
648
- }
649
- ```
650
-
651
- #### 2.3 Update CLI to Reference New Package Name
652
-
653
- **File: `v2/cli/src/commands/init.ts`**
654
-
655
- Find and replace all references:
656
-
657
- - `@agnosticui/core` → `agnosticui-core`
658
- - `@agnosticui/cli` → `agnosticui-cli`
659
-
660
- ```typescript
661
- // Example: Update determineTarballPath() function
662
- async function determineTarballPath(
663
- version: string = "alpha"
664
- ): Promise<string | null> {
665
- try {
666
- const { execSync } = await import("child_process");
667
- const tmpDir = path.join(process.cwd(), ".tmp-ag-download");
668
- await ensureDir(tmpDir);
669
-
670
- // Download package - UPDATED PACKAGE NAME
671
- execSync(`npm pack agnosticui-core@${version}`, {
672
- cwd: tmpDir,
673
- stdio: "pipe",
674
- });
675
-
676
- const files = await readdir(tmpDir);
677
- const tarball = files.find(
678
- (f) => f.startsWith("agnosticui-core-") && f.endsWith(".tgz")
679
- );
680
-
681
- if (tarball) {
682
- return path.join(tmpDir, tarball);
683
- }
684
- } catch (error) {
685
- logger.error("Failed to download agnosticui-core from npm");
686
- }
687
-
688
- return null;
689
- }
690
- ```
691
-
692
- #### 2.4 Update Documentation References
693
-
694
- Search and replace in all documentation files:
695
-
696
- - `@agnosticui/core` → `agnosticui-core`
697
- - `@agnosticui/cli` → `agnosticui-cli`
698
-
699
- ---
700
-
701
- ### Phase 3: Pre-Publishing Preparation
702
-
703
- #### 3.1 Build and Verify Both Packages
704
-
705
- ```bash
706
- # Build core library
707
- cd v2/lib
708
- rm -rf dist/
709
- npm install
710
- npm run build
711
- ls -la dist/ # Verify output
712
-
713
- # Build CLI
714
- cd v2/cli
715
- rm -rf dist/
716
- npm install
717
- npm run build
718
- ls -la dist/ # Verify output
719
- node dist/cli.js --version # Should show 2.0.0-alpha.1
720
- ```
721
- And so we need to update src/cli.ts when version bumps.
722
-
723
- #### 3.2 Test Locally with Pack
724
-
725
- ```bash
726
- # Test core library
727
- cd v2/lib
728
- npm pack --dry-run # Preview
729
- npm pack # Creates: agnosticui-core-2.0.0-alpha.1.tgz
730
- tar -tzf agnosticui-core-2.0.0-alpha.1.tgz # Inspect contents
731
-
732
- # Test CLI
733
- cd v2/cli
734
- npm pack --dry-run
735
- npm pack # Creates: agnosticui-cli-2.0.0-alpha.1.tgz
736
- tar -tzf agnosticui-cli-2.0.0-alpha.1.tgz
737
- ```
738
-
739
- #### 3.3 Commit All Changes
740
-
741
- ```bash
742
- # From repo root
743
- git status
744
- git add .
745
- git commit -m "chore: prepare v2.0.0-alpha.1 for npm publication
746
-
747
- - Update package names to agnosticui-core and agnosticui-cli
748
- - Configure publishConfig for public access
749
- - Update CLI to reference new package names
750
- - Update all documentation"
751
-
752
- git push origin master
753
- ```
754
-
755
- #### 3.4 Verify v2/examples/{lit|react|vue}-test
756
-
757
- Uninstall then reintall the CLI via local tarball then sync the core tarball:
758
-
759
- ```shell
760
- npm uninstall @agnosticui/cli
761
- npm i ../../cli/agnosticui-cli-VERSION.tgz
762
- npx ag sync --tarball ../lib/agnosticui-core-VERSION.tgz
763
- # Test npx ag add COMPONENT(s) --force
764
- npm run dev
765
- ```
766
-
767
- ---
768
-
769
- ### Phase 4: Publish to npm
770
-
771
- #### 4.1 Verify npm Login
772
-
773
- ```bash
774
- npm whoami # Should show: rlevin
775
- ```
776
-
777
- #### 4.2 Publish Core Library First
778
-
779
- ```bash
780
- cd v2/lib
781
-
782
- # Final dry-run check
783
- npm publish --dry-run --tag alpha
784
-
785
- # Publish!
786
- npm publish --tag alpha
787
- ```
788
-
789
- **Expected output:**
790
-
791
- ```
792
- + agnosticui-core@2.0.0-alpha.1
793
- ```
794
-
795
- #### 4.2b
796
-
797
- I noticed the README.md had junk in it so I unfortunately did: npm unpublish, then fixed that and then went to publish but NPM will not let you republish within 24 hours, and, according to AI will require version bump.
798
-
799
- TLDR:
800
- 1) I learned my lesson about dangers of `unpublish`
801
- 2) I'll just wait 24 hours
802
- 3) Use `2.0.0-alpha.2` and continue to bump versions from there.
803
-
804
- #### 4.3 Verify Core Publication
805
-
806
- ```bash
807
- npm info agnosticui-core
808
- npm view agnosticui-core@alpha
809
-
810
- agnosticui-core@2.0.0-alpha.2 | Proprietary | deps: 3 | versions: 1
811
- AgnosticUI Core Library - Framework-agnostic, upgrade-safe web components built with Lit.
812
-
813
- dependencies:
814
- @floating-ui/dom: ^1.7.4 @lit/react: ^1.0.8 focus-trap: ^7.6.5
815
-
816
- maintainers:
817
- - rlevin <roblevinillustration@gmail.com>
818
-
819
- dist-tags:
820
- alpha: 2.0.0-alpha.1 latest: 2.0.0-alpha.1
821
-
822
- published 48 seconds ago by rlevin <roblevinillustration@gmail.com>
823
- npm view agnosticui-core dist-tags
824
-
825
- # Visit on web
826
- open https://www.npmjs.com/package/agnosticui-core
827
- ```
828
-
829
- #### 4.4 Publish CLI
830
-
831
- ```bash
832
- cd v2/cli
833
-
834
- # Dry-run
835
- npm publish --dry-run --tag alpha
836
-
837
- # Publish!
838
- npm publish --tag alpha
839
- ```
840
-
841
- **Expected output:**
842
-
843
- ```
844
- + agnosticui-cli@2.0.0-alpha.1
845
- ```
846
-
847
- #### 4.5 Verify CLI Publication
848
-
849
- ```bash
850
- npm info agnosticui-cli
851
- npm view agnosticui-cli@alpha
852
-
853
- open https://www.npmjs.com/package/agnosticui-cli
854
- ```
855
-
856
- ---
857
-
858
- ### Phase 5: End-to-End Testing
859
-
860
- #### 5.1 Test Installation Flow
861
-
862
- ```bash
863
- # Create fresh test directory
864
- mkdir /tmp/test-agui-v2 && cd /tmp/test-agui-v2
865
- npm init -y
866
-
867
- # Install CLI globally
868
- npm install -g agnosticui-cli@alpha
869
-
870
- # Verify installation
871
- ag --version
872
- which ag
873
-
874
- # Initialize project
875
- ag init --framework vue
876
-
877
- # Verify core was downloaded
878
- ls -la agnosticui/
879
-
880
- # Add components
881
- ag add button
882
- ag add input
883
-
884
- # Verify components copied
885
- ls -la src/components/ag/Button/
886
- ls -la src/components/ag/Input/
887
- ```
888
-
889
- #### 5.2 Test with npx (No Installation)
890
-
891
- ```bash
892
- mkdir /tmp/test-npx && cd /tmp/test-npx
893
- npm init -y
894
-
895
- # Should work without global install
896
- npx agnosticui-cli@alpha init --framework react
897
- npx agnosticui-cli@alpha add button
898
- ```
899
-
900
- #### 5.3 Test with Different Package Managers
901
-
902
- ```bash
903
- # pnpm
904
- pnpm add -g agnosticui-cli@alpha
905
- ag init --framework svelte
906
-
907
- # yarn
908
- yarn global add agnosticui-cli@alpha
909
- ag init --framework lit
910
-
911
- # bun
912
- bun add -g agnosticui-cli@alpha
913
- ag init --framework react
914
- ```
915
-
916
- ---
917
-
918
- ### Phase 6: Create Git Release
919
-
920
- #### 6.1 Tag the Release
921
-
922
- ```bash
923
- # Create annotated tag
924
- git tag -a v2.0.0-alpha.1 -m "AgnosticUI v2.0.0-alpha.1
925
-
926
- First alpha release of AgnosticUI v2
927
-
928
- Breaking Changes:
929
- - Complete rewrite with CLI-first approach
930
- - Web Components architecture instead of framework-specific packages
931
-
932
- New Features:
933
- - CLI for local component management
934
- - Support for React, Vue, Lit, Svelte
935
- - Design token system
936
- - Zero runtime dependencies
937
- - You own the code - customize freely
938
-
939
- Published packages:
940
- - agnosticui-core@2.0.0-alpha.1
941
- - agnosticui-cli@2.0.0-alpha.1"
942
-
943
- # Push tag
944
- git push origin v2.0.0-alpha.1
945
- ```
946
-
947
- #### 6.2 Create GitHub Release
948
-
949
- Go to: `https://github.com/yourusername/agnosticui/releases/new`
950
-
951
- - **Tag**: `v2.0.0-alpha.1`
952
- - **Title**: `AgnosticUI v2.0.0-alpha.1 - First Alpha Release 🎉`
953
- - **Description**:
954
-
955
- ````markdown
956
- # AgnosticUI v2.0.0-alpha.1 🎉
957
-
958
- This is the first alpha release of AgnosticUI v2 - a complete rewrite with a CLI-first approach.
959
-
960
- ## Installation
961
-
962
- ```bash
963
- npm install -g agnosticui-cli@alpha
964
- ag init --framework react
965
- ag add button input card
966
- ```
967
- ````
968
-
969
- ## What's New in v2
970
-
971
- - **CLI-First Approach**: Components are copied directly to your project
972
- - **You Own the Code**: Full control, no black boxes
973
- - **Web Components Core**: Framework-agnostic architecture
974
- - **Multi-Framework Support**: React, Vue, Lit, Svelte
975
- - **Design Token System**: Consistent theming across components
976
- - **Zero Runtime Dependencies**: Components work standalone
977
-
978
- ## Breaking Changes from v1
979
-
980
- AgnosticUI v2 is a complete rewrite and is not compatible with v1. If you need v1, it remains available:
981
-
982
- - Packages: `agnostic-angular`, `agnostic-react`, `agnostic-vue`, `agnostic-svelte`
983
- - Branch: `v1-legacy`
984
-
985
- ## Alpha Status
986
-
987
- This is an **alpha release** for early testing and feedback. APIs may change before stable release.
988
-
989
- ## Published Packages
990
-
991
- - [agnosticui-core@2.0.0-alpha.1](https://www.npmjs.com/package/agnosticui-core)
992
- - [agnosticui-cli@2.0.0-alpha.1](https://www.npmjs.com/package/agnosticui-cli)
993
-
994
- ## Documentation
995
-
996
- [Link to your docs]
997
-
998
- ## Feedback
999
-
1000
- Please report issues or provide feedback in [GitHub Discussions](link) or [Issues](link).
1001
-
1002
- ````
1003
-
1004
- - **Check**: "This is a pre-release"
1005
- - Click "Publish release"
1006
-
1007
- ---
1008
-
1009
- ### Phase 7: Update Documentation
1010
-
1011
- #### 7.1 Update Installation Guide
1012
-
1013
- **File: `v2/docs/installation.md`**
1014
-
1015
- ```markdown
1016
- # Installation
1017
-
1018
- ## Install the CLI
1019
-
1020
- AgnosticUI v2 uses a CLI to copy components directly into your project.
1021
-
1022
- ### Global Installation (Recommended)
1023
-
1024
- ```bash
1025
- npm install -g agnosticui-cli@alpha
1026
- ````
1027
-
1028
- ### Using npx (No Installation)
1029
-
1030
- ```bash
1031
- npx agnosticui-cli@alpha init
1032
- ```
1033
-
1034
- ### Other Package Managers
1035
-
1036
- ```bash
1037
- # pnpm
1038
- pnpm add -g agnosticui-cli@alpha
1039
-
1040
- # yarn
1041
- yarn global add agnosticui-cli@alpha
1042
-
1043
- # bun
1044
- bun add -g agnosticui-cli@alpha
1045
- ```
1046
-
1047
- ## Initialize Your Project
1048
-
1049
- ```bash
1050
- # Interactive mode
1051
- ag init
1052
-
1053
- # Specify framework
1054
- ag init --framework react
1055
- ag init --framework vue
1056
- ag init --framework svelte
1057
- ag init --framework lit
1058
- ```
1059
-
1060
- This downloads `agnosticui-core` and sets up the reference library in `./agnosticui/`.
1061
-
1062
- ## Add Components
1063
-
1064
- ```bash
1065
- # Add individual components
1066
- ag add button
1067
- ag add input card
1068
-
1069
- # Add multiple at once
1070
- ag add button input card dialog
1071
- ```
1072
-
1073
- Components are copied to `src/components/ag/` by default.
1074
-
1075
- ## What Gets Installed?
1076
-
1077
- - **Reference Library**: `./agnosticui/` contains the source components
1078
- - **Your Components**: `src/components/ag/` contains copies you can modify
1079
- - **No Dependencies**: Components work standalone, no runtime deps
1080
-
1081
- ## Next Steps
1082
-
1083
- - [Quick Start Guide](./quick-start.md)
1084
- - [Component Customization](./customization.md)
1085
- - [Design Tokens](./design-tokens.md)
1086
-
1087
- ````
1088
-
1089
- #### 7.2 Create Migration Guide
1090
-
1091
- **File: `v2/docs/migration-v1-to-v2.md`**
1092
-
1093
- ```markdown
1094
- # Migrating from AgnosticUI v1 to v2
1095
-
1096
- AgnosticUI v2 is a complete rewrite with a fundamentally different approach.
1097
-
1098
- ## Key Differences
1099
-
1100
- | Aspect | v1 | v2 |
1101
- |--------|----|----|
1102
- | **Installation** | `npm install agnostic-react` | `npm install -g agnosticui-cli` |
1103
- | **Usage** | Import from package | Copy components to your project |
1104
- | **Updates** | `npm update` | `ag sync` (opt-in) |
1105
- | **Customization** | Limited | Full control - you own the code |
1106
- | **Dependencies** | Runtime dependencies | Zero runtime deps |
1107
- | **Architecture** | Framework-specific | Web Components + adapters |
1108
-
1109
- ## Should You Migrate?
1110
-
1111
- **Stick with v1 if:**
1112
- - You have a production app working fine
1113
- - You prefer traditional npm packages
1114
- - You don't need heavy customization
1115
-
1116
- **Consider v2 if:**
1117
- - You want full control over components
1118
- - You need extensive customization
1119
- - You want to avoid dependency lock-in
1120
- - You're starting a new project
1121
-
1122
- ## Migration Steps
1123
-
1124
- There's no automatic migration path. You'll need to:
1125
-
1126
- 1. Install v2 CLI: `npm install -g agnosticui-cli@alpha`
1127
- 2. Initialize in new directory: `ag init --framework [your-framework]`
1128
- 3. Add components: `ag add button input card`
1129
- 4. Port your customizations from v1 components
1130
- 5. Update imports in your application
1131
-
1132
- ## v1 Support
1133
-
1134
- v1 packages remain available and supported:
1135
- - Packages: `agnostic-angular`, `agnostic-react`, `agnostic-vue`, `agnostic-svelte`
1136
- - Documentation: [v1 docs link]
1137
- - Branch: `v1-legacy`
1138
- ````
1139
-
1140
- ---
1141
-
1142
- ### Phase 8: Announce and Monitor
1143
-
1144
- #### 8.1 Create GitHub Discussion
1145
-
1146
- Go to your repo's Discussions → Create new
1147
-
1148
- **Title**: "AgnosticUI v2.0.0-alpha.1 Released! 🎉"
1149
-
1150
- ````markdown
1151
- Hi everyone! 👋
1152
-
1153
- I'm excited to announce the first alpha release of AgnosticUI v2!
1154
-
1155
- ## What is AgnosticUI v2?
1156
-
1157
- A CLI-based UI component library that copies components directly into your project. You own the code, customize it freely, and avoid dependency lock-in.
1158
-
1159
- ## Try it out
1160
-
1161
- ```bash
1162
- npm install -g agnosticui-cli@alpha
1163
- ag init --framework react
1164
- ag add button input
1165
- ```
1166
- ````
1167
-
1168
- ## This is Alpha
1169
-
1170
- This is an early alpha for testing and feedback. APIs may change. Please:
1171
-
1172
- - Report bugs in [Issues](link)
1173
- - Share feedback here in Discussions
1174
- - Test with your favorite framework
1175
-
1176
- ## Links
1177
-
1178
- - [Documentation](link)
1179
- - [npm: agnosticui-cli](https://www.npmjs.com/package/agnosticui-cli)
1180
- - [npm: agnosticui-core](https://www.npmjs.com/package/agnosticui-core)
1181
-
1182
- Thanks for your interest! Looking forward to your feedback. 🙏
1183
-
1184
- ````
1185
-
1186
- #### 8.2 Monitor
1187
-
1188
- - Watch GitHub Issues for bugs
1189
- - Check npm download stats: `npm info agnosticui-cli`
1190
- - Respond to feedback promptly
1191
- - Take notes for alpha.2 improvements
1192
-
1193
- ---
1194
-
1195
- ## Quick Reference: Commands
1196
-
1197
- ```bash
1198
- # Phase 1: Restructure repo
1199
- git checkout master && git pull
1200
- git branch backup-before-v2-transition
1201
- git branch v1-legacy && git push origin v1-legacy
1202
- git rm -rf agnostic-*/ site/
1203
- git merge feature/agnosticui-v2-integration
1204
- git push origin master
1205
-
1206
- # Phase 2 & 3: Update and build
1207
- # (Edit package.json files manually)
1208
- cd v2/lib && npm install && npm run build && npm pack
1209
- cd v2/cli && npm install && npm run build && npm pack
1210
-
1211
- # Phase 4: Publish
1212
- cd v2/lib && npm publish --tag alpha
1213
- cd v2/cli && npm publish --tag alpha
1214
-
1215
- # Phase 5: Test
1216
- mkdir /tmp/test && cd /tmp/test
1217
- npm install -g agnosticui-cli@alpha
1218
- ag init --framework vue
1219
- ag add button
1220
-
1221
- # Phase 6: Release
1222
- git tag -a v2.0.0-alpha.1 -m "Release v2.0.0-alpha.1"
1223
- git push origin v2.0.0-alpha.1
1224
- ````
1225
-
1226
- ---
1227
-
1228
- ## Future Alpha Releases
1229
-
1230
- When ready for alpha.2:
1231
-
1232
- ```bash
1233
- # Increment versions
1234
- cd v2/lib
1235
- npm version prerelease --preid=alpha # 2.0.0-alpha.1 → alpha.2
1236
-
1237
- cd v2/cli
1238
- npm version prerelease --preid=alpha
1239
-
1240
- # Publish
1241
- cd v2/lib && npm publish --tag alpha
1242
- cd v2/cli && npm publish --tag alpha
1243
-
1244
- # Tag git
1245
- git tag -a v2.0.0-alpha.2 -m "Release v2.0.0-alpha.2"
1246
- git push --tags
1247
- ```
1248
-
1249
- ---
1250
-
1251
- ## Troubleshooting
1252
-
1253
- ### "Package name already taken"
1254
-
1255
- Non-scoped packages (`agnosticui-core`, `agnosticui-cli`) should be available since you already use the `agnostic-*` namespace. If someone squatted them:
1256
-
1257
- 1. Check: `npm info agnosticui-core` and `npm info agnosticui-cli`
1258
- 2. If truly taken, consider: `agnostic-ui-core`, `agnostic-ui-cli`
1259
- 3. Or use scoped: `@rlevin/agnosticui-core`, `@rlevin/agnosticui-cli`
1260
-
1261
- ### CLI can't download core package
1262
-
1263
- ```bash
1264
- # Test manually
1265
- npm pack agnosticui-core@alpha
1266
-
1267
- # If that works, check CLI code in init.ts
1268
- ```
222
+ Apache-2.0