@liasse/cli 0.2.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Liasse
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.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,219 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { spawnSync } from "child_process";
5
+ import { existsSync as existsSync3 } from "fs";
6
+ import { join as join3 } from "path";
7
+ import * as p from "@clack/prompts";
8
+ import { Command } from "commander";
9
+
10
+ // src/add.ts
11
+ import { existsSync as existsSync2, mkdirSync, writeFileSync } from "fs";
12
+ import { dirname as dirname2, join as join2, resolve as resolve2 } from "path";
13
+
14
+ // src/registry.ts
15
+ import { existsSync, readFileSync, statSync } from "fs";
16
+ import { dirname, isAbsolute, join, resolve } from "path";
17
+ import { fileURLToPath } from "url";
18
+ var DEFAULT_REGISTRY_URL = "https://liasse.tnjl.me/registry/registry.json";
19
+ function resolveSource(explicit) {
20
+ if (explicit) return explicit;
21
+ if (process.env.LIASSE_REGISTRY) return process.env.LIASSE_REGISTRY;
22
+ const here = dirname(fileURLToPath(import.meta.url));
23
+ for (const start of [here, process.cwd()]) {
24
+ let dir = start;
25
+ for (let i = 0; i < 6; i++) {
26
+ for (const candidate of [
27
+ join(dir, "registry.json"),
28
+ join(dir, "registry", "registry.json"),
29
+ join(dir, "dist", "registry.json")
30
+ ]) {
31
+ if (existsSync(candidate)) return candidate;
32
+ }
33
+ const parent = dirname(dir);
34
+ if (parent === dir) break;
35
+ dir = parent;
36
+ }
37
+ }
38
+ return DEFAULT_REGISTRY_URL;
39
+ }
40
+ function isUrl(source) {
41
+ return /^https?:\/\//i.test(source);
42
+ }
43
+ async function loadRegistry(explicit) {
44
+ const source = resolveSource(explicit);
45
+ let raw;
46
+ if (isUrl(source)) {
47
+ const res = await fetch(source);
48
+ if (!res.ok) {
49
+ throw new Error(`Failed to fetch registry from ${source} (${res.status})`);
50
+ }
51
+ raw = await res.text();
52
+ } else {
53
+ let filePath = isAbsolute(source) ? source : resolve(process.cwd(), source);
54
+ if (existsSync(filePath) && statSync(filePath).isDirectory()) {
55
+ filePath = join(filePath, "registry.json");
56
+ }
57
+ if (!existsSync(filePath)) {
58
+ throw new Error(`Registry file not found: ${filePath}`);
59
+ }
60
+ raw = readFileSync(filePath, "utf8");
61
+ }
62
+ let registry;
63
+ try {
64
+ registry = JSON.parse(raw);
65
+ } catch (err) {
66
+ throw new Error(`Invalid registry JSON from ${source}: ${err.message}`);
67
+ }
68
+ if (!registry.components || typeof registry.components !== "object") {
69
+ throw new Error(`Registry from ${source} has no "components" map`);
70
+ }
71
+ return { registry, source };
72
+ }
73
+ function resolveComponents(registry, names) {
74
+ const ordered = [];
75
+ const seen = /* @__PURE__ */ new Set();
76
+ const visit = (name, trail) => {
77
+ if (seen.has(name)) return;
78
+ const component = registry.components[name];
79
+ if (!component) {
80
+ const available = Object.keys(registry.components).sort().join(", ");
81
+ throw new Error(`Unknown component "${name}". Available: ${available}`);
82
+ }
83
+ if (trail.includes(name)) return;
84
+ for (const dep of component.registryDependencies ?? []) {
85
+ visit(dep, [...trail, name]);
86
+ }
87
+ seen.add(name);
88
+ ordered.push(component);
89
+ };
90
+ for (const name of names) visit(name, []);
91
+ return ordered;
92
+ }
93
+ function collectDependencies(components) {
94
+ const deps = /* @__PURE__ */ new Set();
95
+ for (const c of components) {
96
+ for (const d of c.dependencies ?? []) deps.add(d);
97
+ }
98
+ return [...deps].sort();
99
+ }
100
+
101
+ // src/add.ts
102
+ async function addComponents(options) {
103
+ const cwd = options.cwd ? resolve2(options.cwd) : process.cwd();
104
+ const registry = options.registry ?? (await loadRegistry(options.registrySource)).registry;
105
+ const components = resolveComponents(registry, options.components);
106
+ const targetDir = options.targetDir ?? registry.targetDir ?? "src/liasse";
107
+ const written = [];
108
+ for (const component of components) {
109
+ for (const file of component.files) {
110
+ const relPath = join2(targetDir, file.path);
111
+ const absPath = join2(cwd, relPath);
112
+ const exists = existsSync2(absPath);
113
+ if (exists && !options.force) {
114
+ written.push({ path: relPath, absPath, skipped: true });
115
+ continue;
116
+ }
117
+ mkdirSync(dirname2(absPath), { recursive: true });
118
+ writeFileSync(absPath, file.content, "utf8");
119
+ written.push({ path: relPath, absPath, skipped: false });
120
+ }
121
+ }
122
+ return {
123
+ components: components.map((c) => c.name),
124
+ written,
125
+ dependencies: collectDependencies(components),
126
+ targetDir
127
+ };
128
+ }
129
+
130
+ // src/index.ts
131
+ var VERSION = "0.1.0";
132
+ function detectPackageManager(cwd) {
133
+ if (existsSync3(join3(cwd, "pnpm-lock.yaml"))) return "pnpm";
134
+ if (existsSync3(join3(cwd, "yarn.lock"))) return "yarn";
135
+ if (existsSync3(join3(cwd, "bun.lockb"))) return "bun";
136
+ return "npm";
137
+ }
138
+ function installCommand(pm, deps) {
139
+ if (pm === "npm") return { cmd: "npm", args: ["install", ...deps] };
140
+ if (pm === "yarn") return { cmd: "yarn", args: ["add", ...deps] };
141
+ return { cmd: pm, args: ["add", ...deps] };
142
+ }
143
+ var program = new Command();
144
+ program.name("liasse").description("Office-as-code: copy Liasse components into your repo, shadcn-style.").version(VERSION);
145
+ program.command("add", { isDefault: true }).description("Add one or more components to your project").argument("[components...]", "component names to add").option("-c, --cwd <dir>", "project root", process.cwd()).option("-d, --dir <dir>", "target directory for component files (default: src/liasse)").option("-r, --registry <source>", "registry path, directory or URL").option("-f, --force", "overwrite existing files", false).option("--no-install", "skip installing npm dependencies").action(async (components, opts) => {
146
+ p.intro("liasse");
147
+ let registry;
148
+ try {
149
+ registry = (await loadRegistry(opts.registry)).registry;
150
+ } catch (err) {
151
+ p.cancel(err.message);
152
+ process.exitCode = 1;
153
+ return;
154
+ }
155
+ let selected = components;
156
+ if (!selected || selected.length === 0) {
157
+ const choice = await p.multiselect({
158
+ message: "Which components do you want to add?",
159
+ options: Object.values(registry.components).map((c) => ({
160
+ value: c.name,
161
+ label: c.name,
162
+ hint: c.description
163
+ })),
164
+ required: true
165
+ });
166
+ if (p.isCancel(choice)) {
167
+ p.cancel("Cancelled.");
168
+ return;
169
+ }
170
+ selected = choice;
171
+ }
172
+ const spinner2 = p.spinner();
173
+ spinner2.start("Copying component files");
174
+ let result;
175
+ try {
176
+ result = await addComponents({
177
+ components: selected,
178
+ cwd: opts.cwd,
179
+ targetDir: opts.dir,
180
+ registry,
181
+ force: opts.force
182
+ });
183
+ } catch (err) {
184
+ spinner2.stop("Failed");
185
+ p.cancel(err.message);
186
+ process.exitCode = 1;
187
+ return;
188
+ }
189
+ const added = result.written.filter((f) => !f.skipped);
190
+ const skipped = result.written.filter((f) => f.skipped);
191
+ spinner2.stop(`Added ${added.length} file(s) under ${result.targetDir}/`);
192
+ for (const f of added) p.log.success(f.path);
193
+ for (const f of skipped) p.log.warn(`${f.path} (exists \u2014 use --force to overwrite)`);
194
+ if (result.dependencies.length > 0) {
195
+ if (opts.install === false) {
196
+ p.log.info(`Dependencies to install: ${result.dependencies.join(", ")}`);
197
+ } else {
198
+ const pm = detectPackageManager(opts.cwd);
199
+ const confirmed = await p.confirm({
200
+ message: `Install ${result.dependencies.join(", ")} with ${pm}?`
201
+ });
202
+ if (!p.isCancel(confirmed) && confirmed) {
203
+ const { cmd, args } = installCommand(pm, result.dependencies);
204
+ const ran = spawnSync(cmd, args, { cwd: opts.cwd, stdio: "inherit" });
205
+ if (ran.status !== 0) {
206
+ p.log.warn(`"${cmd} ${args.join(" ")}" did not complete cleanly.`);
207
+ }
208
+ } else {
209
+ p.log.info(`Skipped. Install later: ${result.dependencies.join(", ")}`);
210
+ }
211
+ }
212
+ }
213
+ p.outro(`Done \u2014 ${result.components.join(", ")} now lives in your repo.`);
214
+ });
215
+ program.parseAsync().catch((err) => {
216
+ console.error(err instanceof Error ? err.message : err);
217
+ process.exitCode = 1;
218
+ });
219
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/add.ts","../src/registry.ts"],"sourcesContent":["import { spawnSync } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport * as p from \"@clack/prompts\";\nimport { Command } from \"commander\";\nimport { addComponents } from \"./add.js\";\nimport { loadRegistry } from \"./registry.js\";\n\nconst VERSION = \"0.1.0\";\n\nfunction detectPackageManager(cwd: string): \"pnpm\" | \"yarn\" | \"bun\" | \"npm\" {\n if (existsSync(join(cwd, \"pnpm-lock.yaml\"))) return \"pnpm\";\n if (existsSync(join(cwd, \"yarn.lock\"))) return \"yarn\";\n if (existsSync(join(cwd, \"bun.lockb\"))) return \"bun\";\n return \"npm\";\n}\n\nfunction installCommand(pm: string, deps: string[]): { cmd: string; args: string[] } {\n if (pm === \"npm\") return { cmd: \"npm\", args: [\"install\", ...deps] };\n if (pm === \"yarn\") return { cmd: \"yarn\", args: [\"add\", ...deps] };\n return { cmd: pm, args: [\"add\", ...deps] }; // pnpm, bun\n}\n\nconst program = new Command();\n\nprogram\n .name(\"liasse\")\n .description(\"Office-as-code: copy Liasse components into your repo, shadcn-style.\")\n .version(VERSION);\n\nprogram\n .command(\"add\", { isDefault: true })\n .description(\"Add one or more components to your project\")\n .argument(\"[components...]\", \"component names to add\")\n .option(\"-c, --cwd <dir>\", \"project root\", process.cwd())\n .option(\"-d, --dir <dir>\", \"target directory for component files (default: src/liasse)\")\n .option(\"-r, --registry <source>\", \"registry path, directory or URL\")\n .option(\"-f, --force\", \"overwrite existing files\", false)\n .option(\"--no-install\", \"skip installing npm dependencies\")\n .action(async (components: string[], opts) => {\n p.intro(\"liasse\");\n\n let registry;\n try {\n registry = (await loadRegistry(opts.registry)).registry;\n } catch (err) {\n p.cancel((err as Error).message);\n process.exitCode = 1;\n return;\n }\n\n let selected = components;\n if (!selected || selected.length === 0) {\n const choice = await p.multiselect({\n message: \"Which components do you want to add?\",\n options: Object.values(registry.components).map((c) => ({\n value: c.name,\n label: c.name,\n hint: c.description,\n })),\n required: true,\n });\n if (p.isCancel(choice)) {\n p.cancel(\"Cancelled.\");\n return;\n }\n selected = choice as string[];\n }\n\n const spinner = p.spinner();\n spinner.start(\"Copying component files\");\n\n let result;\n try {\n result = await addComponents({\n components: selected,\n cwd: opts.cwd,\n targetDir: opts.dir,\n registry,\n force: opts.force,\n });\n } catch (err) {\n spinner.stop(\"Failed\");\n p.cancel((err as Error).message);\n process.exitCode = 1;\n return;\n }\n\n const added = result.written.filter((f) => !f.skipped);\n const skipped = result.written.filter((f) => f.skipped);\n spinner.stop(`Added ${added.length} file(s) under ${result.targetDir}/`);\n\n for (const f of added) p.log.success(f.path);\n for (const f of skipped) p.log.warn(`${f.path} (exists — use --force to overwrite)`);\n\n if (result.dependencies.length > 0) {\n if (opts.install === false) {\n p.log.info(`Dependencies to install: ${result.dependencies.join(\", \")}`);\n } else {\n const pm = detectPackageManager(opts.cwd);\n const confirmed = await p.confirm({\n message: `Install ${result.dependencies.join(\", \")} with ${pm}?`,\n });\n if (!p.isCancel(confirmed) && confirmed) {\n const { cmd, args } = installCommand(pm, result.dependencies);\n const ran = spawnSync(cmd, args, { cwd: opts.cwd, stdio: \"inherit\" });\n if (ran.status !== 0) {\n p.log.warn(`\"${cmd} ${args.join(\" \")}\" did not complete cleanly.`);\n }\n } else {\n p.log.info(`Skipped. Install later: ${result.dependencies.join(\", \")}`);\n }\n }\n }\n\n p.outro(`Done — ${result.components.join(\", \")} now lives in your repo.`);\n });\n\nprogram.parseAsync().catch((err: unknown) => {\n console.error(err instanceof Error ? err.message : err);\n process.exitCode = 1;\n});\n","import { existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport {\n collectDependencies,\n loadRegistry,\n resolveComponents,\n type Registry,\n type RegistryComponent,\n} from \"./registry.js\";\n\nexport interface AddOptions {\n components: string[];\n cwd?: string;\n /** Overrides `registry.targetDir`. Defaults to \"src/liasse\". */\n targetDir?: string;\n /** Registry source (path/dir/url). Ignored when `registry` is provided. */\n registrySource?: string;\n /** Pre-loaded registry (used in tests to avoid I/O). */\n registry?: Registry;\n /** Overwrite files that already exist. */\n force?: boolean;\n}\n\nexport interface WrittenFile {\n /** Path relative to cwd. */\n path: string;\n absPath: string;\n skipped: boolean;\n}\n\nexport interface AddResult {\n components: string[];\n written: WrittenFile[];\n dependencies: string[];\n targetDir: string;\n}\n\n/**\n * Copy the requested components' source files into the user's repo. Pure file\n * I/O — never installs packages (the caller decides) — so it is easy to test.\n */\nexport async function addComponents(options: AddOptions): Promise<AddResult> {\n const cwd = options.cwd ? resolve(options.cwd) : process.cwd();\n\n const registry =\n options.registry ?? (await loadRegistry(options.registrySource)).registry;\n\n const components: RegistryComponent[] = resolveComponents(registry, options.components);\n const targetDir = options.targetDir ?? registry.targetDir ?? \"src/liasse\";\n\n const written: WrittenFile[] = [];\n for (const component of components) {\n for (const file of component.files) {\n const relPath = join(targetDir, file.path);\n const absPath = join(cwd, relPath);\n const exists = existsSync(absPath);\n if (exists && !options.force) {\n written.push({ path: relPath, absPath, skipped: true });\n continue;\n }\n mkdirSync(dirname(absPath), { recursive: true });\n writeFileSync(absPath, file.content, \"utf8\");\n written.push({ path: relPath, absPath, skipped: false });\n }\n }\n\n return {\n components: components.map((c) => c.name),\n written,\n dependencies: collectDependencies(components),\n targetDir,\n };\n}\n","import { existsSync, readFileSync, statSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/** A single file shipped by a registry component. */\nexport interface RegistryFile {\n /** Path relative to the target base dir, e.g. `components/financial-table.ts`. */\n path: string;\n content: string;\n}\n\nexport interface RegistryComponent {\n name: string;\n version?: string;\n description?: string;\n /** npm packages this component needs at runtime. */\n dependencies?: string[];\n /** Other registry components this one depends on. */\n registryDependencies?: string[];\n files: RegistryFile[];\n}\n\nexport interface Registry {\n $schema?: string;\n version?: number;\n /** Default base dir (relative to cwd) where files are written. */\n targetDir?: string;\n components: Record<string, RegistryComponent>;\n}\n\nconst DEFAULT_REGISTRY_URL = \"https://liasse.tnjl.me/registry/registry.json\";\n\n/** Resolve where to load the registry from, honouring flag → env → discovery. */\nfunction resolveSource(explicit?: string): string {\n if (explicit) return explicit;\n if (process.env.LIASSE_REGISTRY) return process.env.LIASSE_REGISTRY;\n\n // Walk up from this module and from cwd looking for a local registry.\n const here = dirname(fileURLToPath(import.meta.url));\n for (const start of [here, process.cwd()]) {\n let dir = start;\n for (let i = 0; i < 6; i++) {\n for (const candidate of [\n join(dir, \"registry.json\"),\n join(dir, \"registry\", \"registry.json\"),\n join(dir, \"dist\", \"registry.json\"),\n ]) {\n if (existsSync(candidate)) return candidate;\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n }\n return DEFAULT_REGISTRY_URL;\n}\n\nfunction isUrl(source: string): boolean {\n return /^https?:\\/\\//i.test(source);\n}\n\n/** Load and parse the registry from a file path, directory or URL. */\nexport async function loadRegistry(explicit?: string): Promise<{ registry: Registry; source: string }> {\n const source = resolveSource(explicit);\n\n let raw: string;\n if (isUrl(source)) {\n const res = await fetch(source);\n if (!res.ok) {\n throw new Error(`Failed to fetch registry from ${source} (${res.status})`);\n }\n raw = await res.text();\n } else {\n let filePath = isAbsolute(source) ? source : resolve(process.cwd(), source);\n if (existsSync(filePath) && statSync(filePath).isDirectory()) {\n filePath = join(filePath, \"registry.json\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`Registry file not found: ${filePath}`);\n }\n raw = readFileSync(filePath, \"utf8\");\n }\n\n let registry: Registry;\n try {\n registry = JSON.parse(raw) as Registry;\n } catch (err) {\n throw new Error(`Invalid registry JSON from ${source}: ${(err as Error).message}`);\n }\n if (!registry.components || typeof registry.components !== \"object\") {\n throw new Error(`Registry from ${source} has no \"components\" map`);\n }\n return { registry, source };\n}\n\n/**\n * Expand the requested component names, pulling in `registryDependencies`,\n * and return them de-duplicated with dependencies before dependents.\n */\nexport function resolveComponents(registry: Registry, names: string[]): RegistryComponent[] {\n const ordered: RegistryComponent[] = [];\n const seen = new Set<string>();\n\n const visit = (name: string, trail: string[]): void => {\n if (seen.has(name)) return;\n const component = registry.components[name];\n if (!component) {\n const available = Object.keys(registry.components).sort().join(\", \");\n throw new Error(`Unknown component \"${name}\". Available: ${available}`);\n }\n if (trail.includes(name)) return; // guard against cycles\n for (const dep of component.registryDependencies ?? []) {\n visit(dep, [...trail, name]);\n }\n seen.add(name);\n ordered.push(component);\n };\n\n for (const name of names) visit(name, []);\n return ordered;\n}\n\n/** All npm dependencies needed by a set of components, de-duplicated + sorted. */\nexport function collectDependencies(components: RegistryComponent[]): string[] {\n const deps = new Set<string>();\n for (const c of components) {\n for (const d of c.dependencies ?? []) deps.add(d);\n }\n return [...deps].sort();\n}\n"],"mappings":";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,cAAAA,mBAAkB;AAC3B,SAAS,QA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OAAO,UAAU,CAAC;AACpE,YAAI,IAAI,WAAW,GAAG;AACpB,UAAE,MAAI,KAAK,IAAI,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,6BAA6B;AAAA,QACnE;AAAA,MACF,OAAO;AACL,QAAE,MAAI,KAAK,2BAA2B,OAAO,aAAa,KAAK,IAAI,CAAC,EAAE;AAAA,MACxE;AAAA,IACF;AAAA,EACF;AAEA,EAAE,QAAM,eAAU,OAAO,WAAW,KAAK,IAAI,CAAC,0BAA0B;AAC1E,CAAC;AAEH,QAAQ,WAAW,EAAE,MAAM,CAAC,QAAiB;AAC3C,UAAQ,MAAM,eAAe,QAAQ,IAAI,UAAU,GAAG;AACtD,UAAQ,WAAW;AACrB,CAAC;","names":["existsSync","join","existsSync","dirname","join","resolve","resolve","join","existsSync","dirname","existsSync","join","spinner"]}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@liasse/cli",
3
+ "version": "0.2.0",
4
+ "description": "Liasse CLI — `liasse add <component>` copies a component's source into your repo from the Liasse registry (shadcn-style).",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "liasse": "./dist/index.js"
9
+ },
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "dependencies": {
16
+ "@clack/prompts": "^0.8.2",
17
+ "commander": "^12.1.0"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "^22.10.2",
21
+ "tsup": "^8.3.5",
22
+ "typescript": "^5.7.2",
23
+ "vitest": "^2.1.8"
24
+ },
25
+ "scripts": {
26
+ "build": "tsup",
27
+ "typecheck": "tsc --noEmit",
28
+ "test": "vitest run"
29
+ }
30
+ }