agnosticui-cli 2.0.0-alpha.10
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 +135 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +100 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +443 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +449 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +72 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/remove.d.ts +3 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/remove.js +96 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +143 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/types/index.d.ts +62 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/components.d.ts +76 -0
- package/dist/utils/components.d.ts.map +1 -0
- package/dist/utils/components.js +208 -0
- package/dist/utils/components.js.map +1 -0
- package/dist/utils/config.d.ts +9 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +78 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/dependencies.d.ts +23 -0
- package/dist/utils/dependencies.d.ts.map +1 -0
- package/dist/utils/dependencies.js +93 -0
- package/dist/utils/dependencies.js.map +1 -0
- package/dist/utils/files.d.ts +48 -0
- package/dist/utils/files.d.ts.map +1 -0
- package/dist/utils/files.js +171 -0
- package/dist/utils/files.js.map +1 -0
- package/dist/utils/logger.d.ts +12 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +37 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# agnosticui-cli
|
|
2
|
+
|
|
3
|
+
CLI for AgnosticUI Local - The UI kit that lives in your codebase.
|
|
4
|
+
|
|
5
|
+
> **See also:** Developer guide (build, test, publish) at [`v2/docs/CLI.md`](../docs/CLI.md)
|
|
6
|
+
|
|
7
|
+
## What is AgnosticUI Local?
|
|
8
|
+
|
|
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
|
+
|
|
11
|
+
**Benefits:**
|
|
12
|
+
|
|
13
|
+
- **AI-Friendly**: Your entire component library is visible to AI coding tools (Cursor, Windsurf, Claude)
|
|
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
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Initialize AgnosticUI in your project
|
|
22
|
+
npx agnosticui-cli@alpha init
|
|
23
|
+
|
|
24
|
+
# Or install globally
|
|
25
|
+
npm install -g agnosticui-cli@alpha
|
|
26
|
+
ag init
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# 1. Initialize (creates reference library in ./agnosticui/)
|
|
33
|
+
npx ag init --framework react
|
|
34
|
+
|
|
35
|
+
# 2. Add components to your project
|
|
36
|
+
npx ag add button input checkbox
|
|
37
|
+
|
|
38
|
+
# 3. List available components
|
|
39
|
+
npx ag list
|
|
40
|
+
|
|
41
|
+
# 4. Import and use in your code
|
|
42
|
+
import { ReactButton } from './components/ag/Button/react'
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Commands
|
|
46
|
+
|
|
47
|
+
### `ag init`
|
|
48
|
+
|
|
49
|
+
Initialize AgnosticUI Local in your project.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ag init [options]
|
|
53
|
+
|
|
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
|
+
```
|
|
58
|
+
|
|
59
|
+
**Example:**
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
ag init --framework react --components-path ./src/components/ag
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### `ag add <components...>`
|
|
66
|
+
|
|
67
|
+
Add one or more components to your project.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
ag add <components...> [options]
|
|
71
|
+
|
|
72
|
+
Options:
|
|
73
|
+
--force Overwrite existing components
|
|
74
|
+
|
|
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
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `ag list`
|
|
82
|
+
|
|
83
|
+
List all available components and show which are already added.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
ag list
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### `ag sync`
|
|
90
|
+
|
|
91
|
+
Update the reference library to the latest version (your customized components are never touched).
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
ag sync
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## How It Works
|
|
98
|
+
|
|
99
|
+
After running `ag init`, your project structure looks like this:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
your-project/
|
|
103
|
+
├── agnosticui/ # Reference library (all components)
|
|
104
|
+
│ ├── lib/src/components/ # Source for all 56 components
|
|
105
|
+
│ └── docs/ # Documentation
|
|
106
|
+
├── src/components/ag/ # YOUR components (copied, customizable)
|
|
107
|
+
│ ├── Button/ # You own this code
|
|
108
|
+
│ └── Input/ # Modify freely
|
|
109
|
+
└── agnosticui.config.json # CLI configuration
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**The workflow:**
|
|
113
|
+
|
|
114
|
+
1. **Reference library** (`./agnosticui/`) - Full library for context, visible to AI tools
|
|
115
|
+
2. **Your components** (`./src/components/ag/`) - Copied components you can customize
|
|
116
|
+
3. **Update safely** - `ag sync` updates reference, never touches your code
|
|
117
|
+
|
|
118
|
+
## Framework Support
|
|
119
|
+
|
|
120
|
+
AgnosticUI supports React, Vue 3, Lit, and Svelte:
|
|
121
|
+
|
|
122
|
+
- **React**: Components using @lit/react wrappers
|
|
123
|
+
- **Vue 3**: Vue components using Composition API
|
|
124
|
+
- **Lit**: Native web components
|
|
125
|
+
- **Svelte**: Direct web component support (excellent compatibility)
|
|
126
|
+
|
|
127
|
+
## More Information
|
|
128
|
+
|
|
129
|
+
- [GitHub Repository](https://github.com/AgnosticUI/agnosticui)
|
|
130
|
+
- [Documentation](https://www.agnosticui.com)
|
|
131
|
+
- [Component Library Package](https://www.npmjs.com/package/agnosticui-core)
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
Apache-2.0
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AgnosticUI CLI - Main entry point
|
|
4
|
+
*
|
|
5
|
+
* Package Resolution Strategy:
|
|
6
|
+
* ============================
|
|
7
|
+
*
|
|
8
|
+
* The CLI uses a two-tier approach to locate the AgnosticUI core library:
|
|
9
|
+
*
|
|
10
|
+
* 1. Local Development (Priority):
|
|
11
|
+
* - Checks for: ../../dist/agnosticui-local-v2.0.0-alpha.tar.gz
|
|
12
|
+
* - Built via: ./scripts/build-local-tarball.sh
|
|
13
|
+
* - Used for: Testing changes before publishing
|
|
14
|
+
*
|
|
15
|
+
* 2. Production (NPM Registry):
|
|
16
|
+
* - Downloads: agnosticui-core@{version} from NPM
|
|
17
|
+
* - Command: npm pack agnosticui-core@alpha (or latest, or specific version)
|
|
18
|
+
* - Used for: Production installations after publishing
|
|
19
|
+
*
|
|
20
|
+
* Package Naming:
|
|
21
|
+
* - Local tarball: agnosticui-local-v*.tar.gz
|
|
22
|
+
* - NPM package: agnosticui-core
|
|
23
|
+
* - This CLI: agnosticui-cli
|
|
24
|
+
*
|
|
25
|
+
* Note: The different naming prevents confusion between local dev builds
|
|
26
|
+
* and published NPM packages.
|
|
27
|
+
*
|
|
28
|
+
* See: v2/cli/README.md "Testing After NPM Publication" for verification steps.
|
|
29
|
+
*/
|
|
30
|
+
import { Command } from 'commander';
|
|
31
|
+
import { init } from './commands/init.js';
|
|
32
|
+
import { add } from './commands/add.js';
|
|
33
|
+
import { remove } from './commands/remove.js';
|
|
34
|
+
import { list } from './commands/list.js';
|
|
35
|
+
import { sync } from './commands/sync.js';
|
|
36
|
+
const program = new Command();
|
|
37
|
+
program
|
|
38
|
+
.name('ag')
|
|
39
|
+
.description('AgnosticUI Local - The UI kit that lives in your codebase')
|
|
40
|
+
.version('2.0.0-alpha.9');
|
|
41
|
+
// ag init command
|
|
42
|
+
program
|
|
43
|
+
.command('init')
|
|
44
|
+
.description('Initialize AgnosticUI Local in your project')
|
|
45
|
+
.option('-f, --framework <framework>', 'Framework to use (react, vue, lit, svelte)')
|
|
46
|
+
.option('-p, --components-path <path>', 'Path where components will be generated')
|
|
47
|
+
.option('-t, --tarball <path>', 'Path to local tarball (for development)')
|
|
48
|
+
.option('-v, --version <version>', 'NPM version to download (e.g., alpha, latest, 2.0.0)', 'alpha')
|
|
49
|
+
.option('--skip-prompts', 'Skip all interactive prompts (non-interactive mode)')
|
|
50
|
+
.action(async (options) => {
|
|
51
|
+
await init({
|
|
52
|
+
framework: options.framework,
|
|
53
|
+
componentsPath: options.componentsPath,
|
|
54
|
+
tarball: options.tarball,
|
|
55
|
+
version: options.version,
|
|
56
|
+
skipPrompts: options.skipPrompts,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
// ag add command
|
|
60
|
+
program
|
|
61
|
+
.command('add <components...>')
|
|
62
|
+
.description('Add component(s) to your project')
|
|
63
|
+
.option('--force', 'Overwrite existing components')
|
|
64
|
+
.action(async (components, options) => {
|
|
65
|
+
await add(components, {
|
|
66
|
+
force: options.force,
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
// ag remove command
|
|
70
|
+
program
|
|
71
|
+
.command('remove <components...>')
|
|
72
|
+
.description('Remove component(s) from your project')
|
|
73
|
+
.option('--force', 'Skip confirmation prompt')
|
|
74
|
+
.action(async (components, options) => {
|
|
75
|
+
await remove(components, {
|
|
76
|
+
force: options.force,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
// ag list command
|
|
80
|
+
program
|
|
81
|
+
.command('list')
|
|
82
|
+
.description('List available components')
|
|
83
|
+
.action(async () => {
|
|
84
|
+
await list();
|
|
85
|
+
});
|
|
86
|
+
// ag sync command
|
|
87
|
+
program
|
|
88
|
+
.command('sync')
|
|
89
|
+
.description('Update reference library from tarball')
|
|
90
|
+
.option('-t, --tarball <path>', 'Path to tarball (overrides config)')
|
|
91
|
+
.option('--force', 'Bypass confirmation prompt')
|
|
92
|
+
.action(async (options) => {
|
|
93
|
+
await sync({
|
|
94
|
+
tarball: options.tarball,
|
|
95
|
+
force: options.force,
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
// Parse arguments
|
|
99
|
+
program.parse();
|
|
100
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceR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