@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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RegistryItem } from "@dalexto/lexsys-registry";
|
|
2
|
+
import type { LexsysConfig } from "../config/config.js";
|
|
3
|
+
import type { ResolvedRegistryStyle, ResolvedRegistryUtility } from "../registry/types.js";
|
|
4
|
+
import type { InstallResourceResult } from "./results.js";
|
|
5
|
+
import { type UninstallResourceResult } from "./uninstall-results.js";
|
|
6
|
+
export declare const getRegistryTemplatePath: (templatePath: string) => string;
|
|
7
|
+
export declare const ensureProjectStructure: (config: LexsysConfig) => Promise<void>;
|
|
8
|
+
export declare const installUtilities: (utilities: ResolvedRegistryUtility[], config: LexsysConfig) => Promise<InstallResourceResult>;
|
|
9
|
+
export declare const updateUtilities: (utilities: ResolvedRegistryUtility[], config: LexsysConfig, force: boolean) => Promise<InstallResourceResult>;
|
|
10
|
+
export declare const installStyles: (styles: ResolvedRegistryStyle[], config: LexsysConfig) => Promise<InstallResourceResult>;
|
|
11
|
+
export declare const installItemFiles: (item: RegistryItem, config: LexsysConfig) => Promise<InstallResourceResult>;
|
|
12
|
+
export declare const uninstallItemFiles: (item: RegistryItem, config: LexsysConfig) => Promise<UninstallResourceResult>;
|
|
13
|
+
export declare const uninstallUtilities: (utilities: ResolvedRegistryUtility[], config: LexsysConfig) => Promise<UninstallResourceResult>;
|
|
14
|
+
export declare const uninstallStyles: (styles: ResolvedRegistryStyle[], config: LexsysConfig) => Promise<UninstallResourceResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface InstallResourceResult {
|
|
2
|
+
created: string[];
|
|
3
|
+
updated: string[];
|
|
4
|
+
skipped: string[];
|
|
5
|
+
conflicted: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const createInstallResourceResult: () => InstallResourceResult;
|
|
8
|
+
export declare const mergeInstallResults: (results: InstallResourceResult[]) => InstallResourceResult;
|
|
9
|
+
export declare const hasInstallConflicts: (result: InstallResourceResult) => boolean;
|
|
10
|
+
export declare const printResourceSummary: (label: string, result: InstallResourceResult) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RegistryItem } from "@dalexto/lexsys-registry";
|
|
2
|
+
import type { LexsysConfig } from "../config/config.js";
|
|
3
|
+
export declare const resolveComponentsRoot: (config: LexsysConfig) => string;
|
|
4
|
+
export declare const resolveItemInstallTarget: (config: LexsysConfig, item: RegistryItem) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface UninstallResourceResult {
|
|
2
|
+
removed: string[];
|
|
3
|
+
skipped: string[];
|
|
4
|
+
conflicted: string[];
|
|
5
|
+
missing: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const createUninstallResourceResult: () => UninstallResourceResult;
|
|
8
|
+
export declare const mergeUninstallResults: (results: UninstallResourceResult[]) => UninstallResourceResult;
|
|
9
|
+
export declare const hasUninstallConflicts: (result: UninstallResourceResult) => boolean;
|
|
10
|
+
export declare const printUninstallSummary: (label: string, result: UninstallResourceResult) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RegistryItem } from "@dalexto/lexsys-registry";
|
|
2
|
+
export declare const computeRegistryClosure: (rootNames: string[], items: RegistryItem[]) => Set<string>;
|
|
3
|
+
export declare const findOrphanInstalledItems: (removedTargetNames: string[], remainingInstalled: Record<string, string>, items: RegistryItem[]) => RegistryItem[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RegistryItem } from "@dalexto/lexsys-registry";
|
|
2
|
+
export interface RegistryProviderResult {
|
|
3
|
+
items: RegistryItem[];
|
|
4
|
+
source: string;
|
|
5
|
+
fallbackUsed: boolean;
|
|
6
|
+
manifestVersion: string;
|
|
7
|
+
}
|
|
8
|
+
interface RegistryProviderOptions {
|
|
9
|
+
fallback?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const getRegistryItems: (options?: RegistryProviderOptions) => Promise<RegistryItem[]>;
|
|
12
|
+
export declare const getRegistryProviderResult: (options?: RegistryProviderOptions) => Promise<RegistryProviderResult>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetchRemoteFile: (url: string) => Promise<string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RegistryItem, RegistryStyle } from "@dalexto/lexsys-registry";
|
|
2
|
+
export interface RemoteRegistryManifest {
|
|
3
|
+
version: string;
|
|
4
|
+
items: RegistryItem[];
|
|
5
|
+
styles?: RegistryStyle[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Parses a remote registry JSON payload into a manifest object.
|
|
9
|
+
*
|
|
10
|
+
* Accepts either:
|
|
11
|
+
* - a manifest object `{ version, items, styles? }`
|
|
12
|
+
* - a legacy bare array of registry items (version becomes `"unknown"`)
|
|
13
|
+
*/
|
|
14
|
+
export declare const parseRemoteRegistry: (value: unknown) => RemoteRegistryManifest;
|
|
15
|
+
export declare const fetchRemoteRegistry: (url: string) => Promise<RemoteRegistryManifest>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RegistryItem } from "@dalexto/lexsys-registry";
|
|
2
|
+
import type { ResolvedRegistryStyle, ResolvedRegistryUtility } from "./types.js";
|
|
3
|
+
interface RegistryResolverOptions {
|
|
4
|
+
fallback?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const findItem: (name: string, options?: RegistryResolverOptions) => Promise<RegistryItem | undefined>;
|
|
7
|
+
export declare const resolveRegistryItems: (names: string[], options?: RegistryResolverOptions) => Promise<RegistryItem[]>;
|
|
8
|
+
export declare const collectDependencies: (items: RegistryItem[]) => string[];
|
|
9
|
+
export declare const collectUtilities: (items: RegistryItem[]) => string[];
|
|
10
|
+
export declare const collectStyles: (items: RegistryItem[]) => string[];
|
|
11
|
+
export declare const resolveRegistryStyles: (names: string[]) => ResolvedRegistryStyle[];
|
|
12
|
+
export declare const resolveRegistryUtilities: (names: string[]) => ResolvedRegistryUtility[];
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRegistrySource: () => Promise<string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ResolvedRegistryStyleFile {
|
|
2
|
+
path: string;
|
|
3
|
+
target: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ResolvedRegistryStyle {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
files: ResolvedRegistryStyleFile[];
|
|
9
|
+
}
|
|
10
|
+
export interface ResolvedRegistryUtility {
|
|
11
|
+
name: string;
|
|
12
|
+
path: string;
|
|
13
|
+
target: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LexsysConfig } from "../config/config.js";
|
|
2
|
+
export declare const ensureTailwindCssImport: (config: LexsysConfig) => Promise<void>;
|
|
3
|
+
export declare const ensureViteTailwindPlugin: () => Promise<void>;
|
|
4
|
+
export declare const ensureViteSrcAlias: () => Promise<void>;
|
|
5
|
+
export declare const ensureTypeScriptSrcAlias: () => Promise<void>;
|
|
6
|
+
export declare const ensureNextPostCssConfig: () => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const scaffoldViteProject: (targetDirectory: string) => Promise<void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type PackageManager = "npm" | "pnpm" | "yarn";
|
|
2
|
+
interface InstallDependenciesOptions {
|
|
3
|
+
dev?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface PackageManagerInvocation {
|
|
6
|
+
command: string;
|
|
7
|
+
args: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare const getPackageManagerInvocation: (packageManager: PackageManager, args: string[]) => PackageManagerInvocation;
|
|
10
|
+
export declare const detectPackageManager: (packageJson: Record<string, unknown>) => Promise<PackageManager>;
|
|
11
|
+
export declare const installDependencies: (deps: string[], options?: InstallDependenciesOptions) => Promise<void>;
|
|
12
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dalexto/lexsys-cli",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Registry-first CLI that installs Lexsys React UI components into your project",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "DaLexto",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/DaLexto/lexsys-ui.git",
|
|
11
|
+
"directory": "packages/cli"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/DaLexto/lexsys-ui/issues"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/DaLexto/lexsys-ui#readme",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"lexsys": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=24 <25"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"prompts": "^2.4.2",
|
|
35
|
+
"@dalexto/lexsys-registry": "0.0.2"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^25.9.1",
|
|
39
|
+
"@types/prompts": "^2.4.9"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsup && tsc -p tsconfig.json --emitDeclarationOnly --outDir dist",
|
|
43
|
+
"check": "pnpm run lint && pnpm run typecheck && pnpm run test",
|
|
44
|
+
"lint": "eslint src test --max-warnings=0",
|
|
45
|
+
"lint:fix": "eslint src test --fix",
|
|
46
|
+
"test": "vitest run test --passWithNoTests --pool threads --exclude \"dist/**\"",
|
|
47
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
48
|
+
}
|
|
49
|
+
}
|