@dalexto/lexsys-cli 0.0.2
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/LICENSE +21 -0
- package/README.md +110 -0
- package/dist/commands/add.d.ts +1 -0
- package/dist/commands/config.d.ts +8 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/help.d.ts +2 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/list.d.ts +6 -0
- package/dist/commands/registry.d.ts +9 -0
- package/dist/commands/status.d.ts +5 -0
- package/dist/commands/uninstall.d.ts +1 -0
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/version.d.ts +1 -0
- package/dist/config/config.d.ts +28 -0
- package/dist/core/backup.d.ts +1 -0
- package/dist/core/cli-error.d.ts +5 -0
- package/dist/core/context.d.ts +2 -0
- package/dist/core/flags.d.ts +4 -0
- package/dist/core/fs.d.ts +3 -0
- package/dist/core/hash.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3333 -0
- package/dist/install/import-rewriter.d.ts +3 -0
- package/dist/install/installer.d.ts +14 -0
- package/dist/install/results.d.ts +10 -0
- package/dist/install/target.d.ts +4 -0
- package/dist/install/uninstall-results.d.ts +10 -0
- package/dist/install/update-engine.d.ts +2 -0
- package/dist/registry/closure.d.ts +3 -0
- package/dist/registry/provider.d.ts +13 -0
- package/dist/registry/remote-files.d.ts +1 -0
- package/dist/registry/remote.d.ts +15 -0
- package/dist/registry/resolver.d.ts +13 -0
- package/dist/registry/source.d.ts +1 -0
- package/dist/registry/types.d.ts +14 -0
- package/dist/scaffold/next.d.ts +2 -0
- package/dist/scaffold/tailwind.d.ts +6 -0
- package/dist/scaffold/template-validator.d.ts +2 -0
- package/dist/scaffold/vite.d.ts +1 -0
- package/dist/utils/package-manager.d.ts +12 -0
- package/dist/utils/suggestions.d.ts +2 -0
- package/dist/utils/version.d.ts +2 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LexSys
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# lexsys CLI
|
|
2
|
+
|
|
3
|
+
**Audience:** Maintainers, contributors, and agents
|
|
4
|
+
**Type:** Package README
|
|
5
|
+
**Source of truth for:** Package role, command surface, core module boundaries
|
|
6
|
+
**Full CLI reference:** [docs/reference/cli/CLI.md](../../docs/reference/cli/CLI.md)
|
|
7
|
+
**Verified against:** `packages/cli/src/`
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Package Role
|
|
12
|
+
|
|
13
|
+
`packages/cli` is the command-line installer. It reads registry metadata from
|
|
14
|
+
`@dalexto/lexsys-registry` and installs components, utilities, and styles into consumer
|
|
15
|
+
projects.
|
|
16
|
+
|
|
17
|
+
This package owns:
|
|
18
|
+
|
|
19
|
+
- the `lexsys` binary entry point
|
|
20
|
+
- all CLI commands and their argument parsing
|
|
21
|
+
- consumer project detection (Vite, Tailwind, package manager)
|
|
22
|
+
- idempotent file installation and conflict reporting
|
|
23
|
+
- `lexsys.config.json` read/write lifecycle
|
|
24
|
+
|
|
25
|
+
This package does not own:
|
|
26
|
+
|
|
27
|
+
- registry item metadata (owned by `@dalexto/lexsys-registry`)
|
|
28
|
+
- install templates (owned by `@dalexto/lexsys-registry/templates`)
|
|
29
|
+
- design token source (owned by `@dalexto/lexsys-tokens`)
|
|
30
|
+
- component implementations (owned by `@dalexto/lexsys-ui`)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Binary
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
lexsys
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Installed via `npm install -g lexsys` or run directly with `pnpm exec lexsys`.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Command Surface
|
|
45
|
+
|
|
46
|
+
| Command | Purpose |
|
|
47
|
+
| ------------------------------ | --------------------------------------------------------------------------- |
|
|
48
|
+
| `lexsys init` | Initialize inside an existing supported Vite app |
|
|
49
|
+
| `lexsys init vite [directory]` | Scaffold a new Vite + React consumer |
|
|
50
|
+
| `lexsys init next [directory]` | Scaffold a new Next.js App Router consumer (pinned Next.js 15.3.3) |
|
|
51
|
+
| `lexsys add <component>` | Install one or more components into the consumer project |
|
|
52
|
+
| `lexsys update [component]` | Update installed components; `--sync`, `--utilities`, `--styles`, `--force` |
|
|
53
|
+
| `lexsys list` | List available registry components |
|
|
54
|
+
| `lexsys status` | Show installed component versions vs registry versions |
|
|
55
|
+
| `lexsys doctor` | Check project health and config validity |
|
|
56
|
+
| `lexsys config` | Read or modify `lexsys.config.json` |
|
|
57
|
+
| `lexsys registry` | Inspect the active registry source |
|
|
58
|
+
| `lexsys uninstall <component>` | Remove installed component files when they match registry templates |
|
|
59
|
+
| `lexsys version` | Print CLI version |
|
|
60
|
+
| `lexsys help` | Print command list |
|
|
61
|
+
|
|
62
|
+
### Global flags
|
|
63
|
+
|
|
64
|
+
| Flag | Purpose |
|
|
65
|
+
| --------------- | ------------------------------------------------------------- |
|
|
66
|
+
| `--cwd <path>` | Override working directory for all operations |
|
|
67
|
+
| `--yes` | Skip confirmation prompts |
|
|
68
|
+
| `--no-fallback` | Disable fallback to local registry when remote is unavailable |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Core Modules
|
|
73
|
+
|
|
74
|
+
| Module | Role |
|
|
75
|
+
| --------------------------- | --------------------------------------------------------------------------- |
|
|
76
|
+
| `core/config.ts` | Read/write `lexsys.config.json`; defines `LexsysConfig` schema and defaults |
|
|
77
|
+
| `core/installer.ts` | File copy, conflict detection, idempotent installs |
|
|
78
|
+
| `core/registry-provider.ts` | Selects local vs remote registry source |
|
|
79
|
+
| `core/registry-resolver.ts` | Resolves registry items, utilities, and styles from active registry |
|
|
80
|
+
| `core/tailwind-setup.ts` | Detects and wires Tailwind v4 CSS entrypoint |
|
|
81
|
+
| `core/vite-scaffold.ts` | Detects and patches Vite config for Tailwind plugin |
|
|
82
|
+
| `core/package-manager.ts` | Detects npm/pnpm/yarn and runs installs |
|
|
83
|
+
| `core/context.ts` | Process-level `cwd` override via `--cwd` flag |
|
|
84
|
+
| `core/flags.ts` | Shared flag parsing utilities |
|
|
85
|
+
| `core/cli-error.ts` | Typed CLI error class and top-level error handler |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Config Schema and Install Behavior
|
|
90
|
+
|
|
91
|
+
Full `lexsys.config.json` schema (all fields, defaults, aliases) and install idempotency rules (created / updated / skipped / conflicted states, conflict detection, backup behavior): [docs/reference/cli/CLI.md](../../docs/reference/cli/CLI.md).
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
Root aliases (full list: [docs/operations/SCRIPTS.md](../../docs/operations/SCRIPTS.md)):
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
pnpm cli:build
|
|
101
|
+
pnpm cli:typecheck
|
|
102
|
+
pnpm cli:check
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Dependencies
|
|
108
|
+
|
|
109
|
+
- `@dalexto/lexsys-registry` — registry metadata and templates
|
|
110
|
+
- `prompts` — interactive CLI prompts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const runAdd: (args: string[]) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const runInit: (args?: string[]) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const runUninstall: (args: string[]) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const runUpdate: (args: string[]) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const runVersion: () => Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface LexsysPathsConfig {
|
|
2
|
+
components: string;
|
|
3
|
+
utilities: string;
|
|
4
|
+
styles: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LexsysAliasesConfig {
|
|
7
|
+
components: string;
|
|
8
|
+
ui: string;
|
|
9
|
+
utils: string;
|
|
10
|
+
lib: string;
|
|
11
|
+
hooks: string;
|
|
12
|
+
}
|
|
13
|
+
export interface LexsysConfig {
|
|
14
|
+
style: "default";
|
|
15
|
+
paths: LexsysPathsConfig;
|
|
16
|
+
aliases: LexsysAliasesConfig;
|
|
17
|
+
tailwind: LexsysTailwindConfig;
|
|
18
|
+
installed?: Record<string, string>;
|
|
19
|
+
registryUrl?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface LexsysTailwindConfig {
|
|
22
|
+
version: "v4";
|
|
23
|
+
css: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const defaultConfig: LexsysConfig;
|
|
26
|
+
export declare const getConfigPath: () => string;
|
|
27
|
+
export declare const loadConfig: () => Promise<LexsysConfig>;
|
|
28
|
+
export declare const saveConfig: (config: LexsysConfig) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createBackupFile: (path: string) => Promise<string | null>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const hasFlag: (args: string[], ...flags: string[]) => boolean;
|
|
2
|
+
export declare const removeFlags: (args: string[], flags: string[]) => string[];
|
|
3
|
+
export declare const getFlagValue: (args: string[], ...flags: string[]) => string | undefined;
|
|
4
|
+
export declare const removeFlagsWithValues: (args: string[], flags: string[]) => string[];
|
package/dist/index.d.ts
ADDED