@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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +110 -0
  3. package/dist/commands/add.d.ts +1 -0
  4. package/dist/commands/config.d.ts +8 -0
  5. package/dist/commands/doctor.d.ts +5 -0
  6. package/dist/commands/help.d.ts +2 -0
  7. package/dist/commands/init.d.ts +1 -0
  8. package/dist/commands/list.d.ts +6 -0
  9. package/dist/commands/registry.d.ts +9 -0
  10. package/dist/commands/status.d.ts +5 -0
  11. package/dist/commands/uninstall.d.ts +1 -0
  12. package/dist/commands/update.d.ts +1 -0
  13. package/dist/commands/version.d.ts +1 -0
  14. package/dist/config/config.d.ts +28 -0
  15. package/dist/core/backup.d.ts +1 -0
  16. package/dist/core/cli-error.d.ts +5 -0
  17. package/dist/core/context.d.ts +2 -0
  18. package/dist/core/flags.d.ts +4 -0
  19. package/dist/core/fs.d.ts +3 -0
  20. package/dist/core/hash.d.ts +3 -0
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.js +3333 -0
  23. package/dist/install/import-rewriter.d.ts +3 -0
  24. package/dist/install/installer.d.ts +14 -0
  25. package/dist/install/results.d.ts +10 -0
  26. package/dist/install/target.d.ts +4 -0
  27. package/dist/install/uninstall-results.d.ts +10 -0
  28. package/dist/install/update-engine.d.ts +2 -0
  29. package/dist/registry/closure.d.ts +3 -0
  30. package/dist/registry/provider.d.ts +13 -0
  31. package/dist/registry/remote-files.d.ts +1 -0
  32. package/dist/registry/remote.d.ts +15 -0
  33. package/dist/registry/resolver.d.ts +13 -0
  34. package/dist/registry/source.d.ts +1 -0
  35. package/dist/registry/types.d.ts +14 -0
  36. package/dist/scaffold/next.d.ts +2 -0
  37. package/dist/scaffold/tailwind.d.ts +6 -0
  38. package/dist/scaffold/template-validator.d.ts +2 -0
  39. package/dist/scaffold/vite.d.ts +1 -0
  40. package/dist/utils/package-manager.d.ts +12 -0
  41. package/dist/utils/suggestions.d.ts +2 -0
  42. package/dist/utils/version.d.ts +2 -0
  43. 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,8 @@
1
+ interface RunConfigOptions {
2
+ path?: boolean;
3
+ exists?: boolean;
4
+ setRegistryUrl?: string;
5
+ clearRegistryUrl?: boolean;
6
+ }
7
+ export declare const runConfig: (options?: RunConfigOptions) => Promise<void>;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ interface RunDoctorOptions {
2
+ noFallback?: boolean;
3
+ }
4
+ export declare const runDoctor: (options?: RunDoctorOptions) => Promise<void>;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const runHelpFor: (command: string) => void;
2
+ export declare const runHelp: () => void;
@@ -0,0 +1 @@
1
+ export declare const runInit: (args?: string[]) => Promise<void>;
@@ -0,0 +1,6 @@
1
+ interface RunListOptions {
2
+ json?: boolean;
3
+ noFallback?: boolean;
4
+ }
5
+ export declare const runList: (options?: RunListOptions) => Promise<void>;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ interface RunRegistryOptions {
2
+ summary?: boolean;
3
+ source?: boolean;
4
+ local?: boolean;
5
+ remote?: boolean;
6
+ noFallback?: boolean;
7
+ }
8
+ export declare const runRegistry: (options?: RunRegistryOptions) => Promise<void>;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ interface RunStatusOptions {
2
+ noFallback?: boolean;
3
+ }
4
+ export declare const runStatus: (options?: RunStatusOptions) => Promise<void>;
5
+ export {};
@@ -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,5 @@
1
+ export declare class CliError extends Error {
2
+ suggestion?: string;
3
+ constructor(message: string, suggestion?: string);
4
+ }
5
+ export declare const handleCliError: (error: unknown) => never;
@@ -0,0 +1,2 @@
1
+ export declare const setCwd: (cwd: string) => void;
2
+ export declare const getCwd: () => string;
@@ -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[];
@@ -0,0 +1,3 @@
1
+ export declare const fileExists: (path: string) => Promise<boolean>;
2
+ export declare const filesAreEqual: (sourcePath: string, targetPath: string) => Promise<boolean>;
3
+ export declare const writeFileIfMissing: (path: string, content: string) => Promise<void>;
@@ -0,0 +1,3 @@
1
+ export declare const hashContent: (content: string) => string;
2
+ export declare const hashFile: (path: string) => Promise<string>;
3
+ export declare const hashesAreEqual: (firstContent: string, secondContent: string) => boolean;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};