arloui 0.1.3

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/dist/cli.cjs ADDED
@@ -0,0 +1,531 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
25
+
26
+ // src/cli.ts
27
+ var import_kleur5 = __toESM(require("kleur"), 1);
28
+
29
+ // src/program.ts
30
+ var import_commander = require("commander");
31
+
32
+ // src/commands/add.ts
33
+ var import_node_path3 = require("path");
34
+ var p = __toESM(require("@clack/prompts"), 1);
35
+ var import_kleur = __toESM(require("kleur"), 1);
36
+
37
+ // src/config.ts
38
+ var import_node_fs = require("fs");
39
+ var import_promises = require("fs/promises");
40
+ var import_node_path = require("path");
41
+ var import_zod = require("zod");
42
+ var CONFIG_FILE = "arlo.json";
43
+ var aliasesSchema = import_zod.z.object({
44
+ components: import_zod.z.string().min(1),
45
+ tokens: import_zod.z.string().min(1),
46
+ theme: import_zod.z.string().min(1),
47
+ lib: import_zod.z.string().min(1)
48
+ }).strict();
49
+ var arloConfigSchema = import_zod.z.object({
50
+ $schema: import_zod.z.string(),
51
+ /** URL of the registry index — defaults to the public CDN. */
52
+ registry: import_zod.z.string().url("registry must be a valid URL"),
53
+ /** Where to write component files (relative to project root). */
54
+ aliases: aliasesSchema,
55
+ /** Style preference. Reserved for future variants (e.g. `compact`). */
56
+ style: import_zod.z.literal("default")
57
+ }).strict();
58
+ var DEFAULT_CONFIG = {
59
+ $schema: "https://arloui.dev/schemas/arlo-config-v1.json",
60
+ registry: "https://arloui.dev/r",
61
+ aliases: {
62
+ components: "components/ui",
63
+ tokens: "lib/arloui",
64
+ theme: "lib/arloui",
65
+ lib: "lib/arloui"
66
+ },
67
+ style: "default"
68
+ };
69
+ async function loadConfig(cwd) {
70
+ const path = (0, import_node_path.resolve)(cwd, CONFIG_FILE);
71
+ if (!(0, import_node_fs.existsSync)(path)) return null;
72
+ let parsed;
73
+ try {
74
+ parsed = JSON.parse(await (0, import_promises.readFile)(path, "utf8"));
75
+ } catch {
76
+ throw new Error(`${CONFIG_FILE} is not valid JSON. Fix it or re-run \`arloui init\`.`);
77
+ }
78
+ const result = arloConfigSchema.safeParse(parsed);
79
+ if (!result.success) {
80
+ const issues = result.error.issues.map((i) => ` - ${i.path.join(".") || "(root)"}: ${i.message}`).join("\n");
81
+ throw new Error(`${CONFIG_FILE} is invalid:
82
+ ${issues}`);
83
+ }
84
+ return result.data;
85
+ }
86
+ async function saveConfig(cwd, config) {
87
+ const path = (0, import_node_path.resolve)(cwd, CONFIG_FILE);
88
+ await (0, import_promises.writeFile)(path, JSON.stringify(config, null, 2) + "\n");
89
+ }
90
+ function aliasFor(config, type) {
91
+ switch (type) {
92
+ case "tokens":
93
+ return config.aliases.tokens;
94
+ case "theme":
95
+ return config.aliases.theme;
96
+ case "utility":
97
+ return config.aliases.lib;
98
+ default:
99
+ return config.aliases.components;
100
+ }
101
+ }
102
+
103
+ // src/fs-utils.ts
104
+ var import_promises2 = require("fs/promises");
105
+ var import_node_path2 = require("path");
106
+ async function writeFileEnsuringDir(target, contents) {
107
+ await (0, import_promises2.mkdir)((0, import_node_path2.dirname)(target), { recursive: true });
108
+ await (0, import_promises2.writeFile)(target, contents);
109
+ }
110
+ async function fileExists(target) {
111
+ try {
112
+ await (0, import_promises2.access)(target);
113
+ return true;
114
+ } catch {
115
+ return false;
116
+ }
117
+ }
118
+ function resolveWithin(root, ...parts) {
119
+ const rootResolved = (0, import_node_path2.resolve)(root);
120
+ if (parts.some((part) => (0, import_node_path2.isAbsolute)(part))) {
121
+ throw new Error(`refusing to write to an absolute path: ${parts.join("/")}`);
122
+ }
123
+ const target = (0, import_node_path2.resolve)(rootResolved, ...parts);
124
+ const rel2 = (0, import_node_path2.relative)(rootResolved, target);
125
+ if (rel2 === "" || rel2.startsWith("..") || (0, import_node_path2.isAbsolute)(rel2)) {
126
+ throw new Error(`refusing to write outside the project directory: ${parts.join("/")}`);
127
+ }
128
+ return target;
129
+ }
130
+
131
+ // src/registry-schema.ts
132
+ var import_zod2 = require("zod");
133
+ var registryItemKindSchema = import_zod2.z.enum(["primitive", "pattern", "foundation", "icon"]);
134
+ var registryFileTypeSchema = import_zod2.z.enum([
135
+ "component",
136
+ "utility",
137
+ "theme",
138
+ "tokens",
139
+ "example"
140
+ ]);
141
+ var nativeDepSchema = import_zod2.z.object({
142
+ name: import_zod2.z.string().min(1),
143
+ setup: import_zod2.z.string().min(1)
144
+ });
145
+ var registryMetaSchema = import_zod2.z.object({
146
+ figma: import_zod2.z.string().optional(),
147
+ tags: import_zod2.z.array(import_zod2.z.string()).optional()
148
+ });
149
+ var entryMetaShape = {
150
+ name: import_zod2.z.string().min(1),
151
+ kind: registryItemKindSchema,
152
+ title: import_zod2.z.string().min(1),
153
+ description: import_zod2.z.string(),
154
+ registryDependencies: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
155
+ dependencies: import_zod2.z.array(import_zod2.z.string().min(1)).optional(),
156
+ nativeDeps: import_zod2.z.array(nativeDepSchema).optional(),
157
+ meta: registryMetaSchema.optional()
158
+ };
159
+ var registryIndexEntrySchema = import_zod2.z.object(entryMetaShape).strict();
160
+ var resolvedRegistryFileSchema = import_zod2.z.object({
161
+ target: import_zod2.z.string().min(1),
162
+ source: import_zod2.z.string().optional(),
163
+ type: registryFileTypeSchema.optional(),
164
+ content: import_zod2.z.string()
165
+ }).strict();
166
+ var resolvedRegistryEntrySchema = import_zod2.z.object({
167
+ ...entryMetaShape,
168
+ files: import_zod2.z.array(resolvedRegistryFileSchema).min(1),
169
+ hash: import_zod2.z.string().min(1)
170
+ }).strict();
171
+ var registryIndexSchema = import_zod2.z.object({
172
+ $schema: import_zod2.z.string().optional(),
173
+ version: import_zod2.z.string().min(1),
174
+ generatedAt: import_zod2.z.string().optional(),
175
+ items: import_zod2.z.array(registryIndexEntrySchema)
176
+ }).strict();
177
+ function parseOrThrow(schema, data, source) {
178
+ const result = schema.safeParse(data);
179
+ if (result.success) return result.data;
180
+ const issues = result.error.issues.slice(0, 5).map((i) => ` - ${i.path.join(".") || "(root)"}: ${i.message}`).join("\n");
181
+ const more = result.error.issues.length > 5 ? `
182
+ \u2026and ${result.error.issues.length - 5} more` : "";
183
+ throw new Error(`invalid registry response from ${source}:
184
+ ${issues}${more}`);
185
+ }
186
+
187
+ // src/registry-client.ts
188
+ var DEFAULT_TIMEOUT_MS = 15e3;
189
+ var KIND_ORDER = { foundation: 0, primitive: 1, pattern: 2, icon: 3 };
190
+ var RegistryClient = class {
191
+ constructor(base, options = {}) {
192
+ this.base = base;
193
+ this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
194
+ this.fetchImpl = options.fetch ?? ((input, init2) => fetch(input, init2));
195
+ }
196
+ base;
197
+ timeoutMs;
198
+ fetchImpl;
199
+ async index() {
200
+ const url = `${this.base}/index.json`;
201
+ const data = await this.fetchJson(url);
202
+ return parseOrThrow(registryIndexSchema, data, url);
203
+ }
204
+ async get(name) {
205
+ const url = `${this.base}/${encodeURIComponent(name)}.json`;
206
+ const data = await this.fetchJson(url);
207
+ return parseOrThrow(resolvedRegistryEntrySchema, data, url);
208
+ }
209
+ /**
210
+ * Returns the entry plus all transitive registry dependencies, deduped and
211
+ * ordered foundation → primitive → pattern → icon so dependencies are written
212
+ * before the components that rely on them. Safe against dependency cycles.
213
+ */
214
+ async resolve(name) {
215
+ const seen = /* @__PURE__ */ new Map();
216
+ const visiting = /* @__PURE__ */ new Set();
217
+ const visit = async (id) => {
218
+ if (seen.has(id) || visiting.has(id)) return;
219
+ visiting.add(id);
220
+ const entry = await this.get(id);
221
+ seen.set(id, entry);
222
+ for (const dep of entry.registryDependencies ?? []) {
223
+ await visit(dep);
224
+ }
225
+ visiting.delete(id);
226
+ };
227
+ await visit(name);
228
+ return [...seen.values()].sort((a, b) => KIND_ORDER[a.kind] - KIND_ORDER[b.kind]);
229
+ }
230
+ async fetchJson(url) {
231
+ const controller = new AbortController();
232
+ const timer = setTimeout(() => controller.abort(), this.timeoutMs);
233
+ let res;
234
+ try {
235
+ res = await this.fetchImpl(url, { signal: controller.signal });
236
+ } catch (err) {
237
+ if (err instanceof Error && err.name === "AbortError") {
238
+ throw new Error(`registry request timed out after ${this.timeoutMs}ms: ${url}`);
239
+ }
240
+ const reason = err instanceof Error ? err.message : String(err);
241
+ throw new Error(`registry request failed: ${url} (${reason})`);
242
+ } finally {
243
+ clearTimeout(timer);
244
+ }
245
+ if (!res.ok) {
246
+ throw new Error(`registry fetch failed: ${url} (${res.status} ${res.statusText})`);
247
+ }
248
+ try {
249
+ return await res.json();
250
+ } catch {
251
+ throw new Error(`registry returned invalid JSON: ${url}`);
252
+ }
253
+ }
254
+ };
255
+
256
+ // src/commands/add.ts
257
+ async function add({ cwd, names, yes, overwrite }) {
258
+ p.intro(import_kleur.default.bgCyan(import_kleur.default.black(" arloui ")) + import_kleur.default.dim(" add"));
259
+ const config = await loadConfig(cwd);
260
+ if (!config) {
261
+ p.log.error(`No ${import_kleur.default.cyan("arlo.json")} found. Run ${import_kleur.default.cyan("npx arloui init")} first.`);
262
+ process.exit(1);
263
+ }
264
+ const client = new RegistryClient(config.registry);
265
+ let toAdd = names;
266
+ if (toAdd.length === 0) {
267
+ const index = await client.index();
268
+ const choice = await p.multiselect({
269
+ message: "Pick components to install",
270
+ options: index.items.filter((it) => it.kind !== "foundation").map((it) => ({ label: `${it.title} ${import_kleur.default.dim(it.description)}`, value: it.name })),
271
+ required: true
272
+ });
273
+ if (p.isCancel(choice)) {
274
+ p.cancel("Add cancelled.");
275
+ return;
276
+ }
277
+ toAdd = choice;
278
+ }
279
+ const allEntries = /* @__PURE__ */ new Map();
280
+ const spinner3 = p.spinner();
281
+ spinner3.start("resolving registry");
282
+ try {
283
+ for (const name of toAdd) {
284
+ const entries = await client.resolve(name);
285
+ for (const e of entries) {
286
+ if (!allEntries.has(e.name)) allEntries.set(e.name, e);
287
+ }
288
+ }
289
+ spinner3.stop(`resolved ${allEntries.size} entr${allEntries.size === 1 ? "y" : "ies"}`);
290
+ } catch (err) {
291
+ spinner3.stop("resolution failed");
292
+ throw err;
293
+ }
294
+ for (const entry of allEntries.values()) {
295
+ await writeComponent({ cwd, config, entry, overwrite, yes });
296
+ }
297
+ const npmDeps = /* @__PURE__ */ new Set();
298
+ const nativeDeps = [];
299
+ for (const entry of allEntries.values()) {
300
+ entry.dependencies?.forEach((d) => npmDeps.add(d));
301
+ entry.nativeDeps?.forEach((d) => nativeDeps.push(d));
302
+ }
303
+ const lines = [import_kleur.default.green("Done.")];
304
+ if (npmDeps.size > 0) {
305
+ lines.push(
306
+ "",
307
+ `Install npm dependencies:`,
308
+ ` ${import_kleur.default.cyan(`npm i ${[...npmDeps].join(" ")}`)}`
309
+ );
310
+ }
311
+ if (nativeDeps.length > 0) {
312
+ lines.push("", `Native modules:`);
313
+ for (const d of nativeDeps) {
314
+ lines.push(` ${import_kleur.default.cyan(d.name)} \u2014 ${d.setup}`);
315
+ }
316
+ }
317
+ p.outro(lines.join("\n"));
318
+ }
319
+ async function writeComponent({
320
+ cwd,
321
+ config,
322
+ entry,
323
+ overwrite,
324
+ yes
325
+ }) {
326
+ for (const file of entry.files) {
327
+ const aliasRoot = aliasFor(config, file.type);
328
+ const target = resolveWithin(cwd, aliasRoot, file.target);
329
+ if (await fileExists(target) && !overwrite) {
330
+ if (yes) {
331
+ p.log.warn(`skip ${import_kleur.default.dim(rel(cwd, target))} (exists; pass --overwrite to replace)`);
332
+ continue;
333
+ }
334
+ const replace = await p.confirm({
335
+ message: `${rel(cwd, target)} already exists. Overwrite?`,
336
+ initialValue: false
337
+ });
338
+ if (p.isCancel(replace) || !replace) {
339
+ p.log.warn(`skip ${import_kleur.default.dim(rel(cwd, target))}`);
340
+ continue;
341
+ }
342
+ }
343
+ await writeFileEnsuringDir(target, file.content);
344
+ p.log.success(`wrote ${import_kleur.default.cyan(rel(cwd, target))}`);
345
+ }
346
+ }
347
+ function rel(from, to) {
348
+ return (0, import_node_path3.relative)(from, to) || to;
349
+ }
350
+
351
+ // src/commands/diff.ts
352
+ var import_promises3 = require("fs/promises");
353
+ var import_kleur2 = __toESM(require("kleur"), 1);
354
+ async function diff({ cwd, name }) {
355
+ const config = await loadConfig(cwd);
356
+ if (!config) {
357
+ console.error(`No arlo.json found. Run \`npx arloui init\` first.`);
358
+ process.exit(1);
359
+ }
360
+ const client = new RegistryClient(config.registry);
361
+ const index = await client.index();
362
+ let items = index.items;
363
+ if (name) {
364
+ const found = index.items.find((i) => i.name === name);
365
+ if (!found) {
366
+ console.error(
367
+ `Unknown component "${name}". Run \`npx arloui list\` to see what's available.`
368
+ );
369
+ process.exit(1);
370
+ }
371
+ items = [found];
372
+ }
373
+ for (const item of items) {
374
+ const entry = await client.get(item.name);
375
+ let drifted = 0;
376
+ let missing = 0;
377
+ for (const file of entry.files) {
378
+ const target = resolveWithin(cwd, aliasFor(config, file.type), file.target);
379
+ if (!await fileExists(target)) {
380
+ missing++;
381
+ continue;
382
+ }
383
+ const local = await (0, import_promises3.readFile)(target, "utf8");
384
+ if (local !== file.content) drifted++;
385
+ }
386
+ if (missing === entry.files.length) continue;
387
+ if (drifted === 0) {
388
+ console.log(
389
+ `${import_kleur2.default.green("\u25CF")} ${item.name.padEnd(20)} up to date ${import_kleur2.default.dim(entry.hash)}`
390
+ );
391
+ } else {
392
+ console.log(
393
+ `${import_kleur2.default.yellow("\u25CF")} ${item.name.padEnd(20)} ${drifted} of ${entry.files.length} files drifted ${import_kleur2.default.dim(entry.hash)}`
394
+ );
395
+ }
396
+ }
397
+ }
398
+
399
+ // src/commands/init.ts
400
+ var import_node_fs2 = require("fs");
401
+ var import_node_path4 = require("path");
402
+ var p2 = __toESM(require("@clack/prompts"), 1);
403
+ var import_kleur3 = __toESM(require("kleur"), 1);
404
+ async function init({ cwd, yes }) {
405
+ p2.intro(import_kleur3.default.bgCyan(import_kleur3.default.black(" arloui ")) + import_kleur3.default.dim(" init"));
406
+ if ((0, import_node_fs2.existsSync)((0, import_node_path4.resolve)(cwd, CONFIG_FILE)) && !yes) {
407
+ const overwrite = await p2.confirm({
408
+ message: `${CONFIG_FILE} already exists. Overwrite it?`,
409
+ initialValue: false
410
+ });
411
+ if (p2.isCancel(overwrite) || !overwrite) {
412
+ p2.cancel("Init cancelled.");
413
+ return;
414
+ }
415
+ }
416
+ const config = yes ? DEFAULT_CONFIG : await promptConfig();
417
+ await saveConfig(cwd, config);
418
+ p2.log.success(`wrote ${import_kleur3.default.cyan(CONFIG_FILE)}`);
419
+ const spinner3 = p2.spinner();
420
+ spinner3.start("installing foundation (tokens + theme provider)");
421
+ const client = new RegistryClient(config.registry);
422
+ try {
423
+ const tokens = await client.resolve("tokens");
424
+ const theme = await client.resolve("theme-provider");
425
+ const seen = /* @__PURE__ */ new Set();
426
+ for (const entry of [...tokens, ...theme]) {
427
+ if (seen.has(entry.name)) continue;
428
+ seen.add(entry.name);
429
+ await writeComponent({ cwd, config, entry });
430
+ }
431
+ spinner3.stop("foundation installed");
432
+ } catch (err) {
433
+ spinner3.stop("foundation install failed");
434
+ throw err;
435
+ }
436
+ p2.outro(
437
+ [
438
+ import_kleur3.default.green("Setup complete."),
439
+ "",
440
+ "Next steps:",
441
+ ` ${import_kleur3.default.dim("1.")} Wrap your app with ${import_kleur3.default.cyan("<ThemeProvider>")} from ${import_kleur3.default.cyan(config.aliases.theme + "/theme-provider")}`,
442
+ ` ${import_kleur3.default.dim("2.")} Add a component: ${import_kleur3.default.cyan("npx arloui add button")}`,
443
+ ` ${import_kleur3.default.dim("3.")} Browse all: ${import_kleur3.default.cyan("npx arloui list")}`
444
+ ].join("\n")
445
+ );
446
+ }
447
+ async function promptConfig() {
448
+ const components = await p2.text({
449
+ message: "Where should components live?",
450
+ placeholder: DEFAULT_CONFIG.aliases.components,
451
+ initialValue: DEFAULT_CONFIG.aliases.components
452
+ });
453
+ if (p2.isCancel(components)) process.exit(0);
454
+ const lib = await p2.text({
455
+ message: "Where should tokens / theme provider live?",
456
+ placeholder: DEFAULT_CONFIG.aliases.lib,
457
+ initialValue: DEFAULT_CONFIG.aliases.lib
458
+ });
459
+ if (p2.isCancel(lib)) process.exit(0);
460
+ const registry = await p2.text({
461
+ message: "Registry URL",
462
+ placeholder: DEFAULT_CONFIG.registry,
463
+ initialValue: DEFAULT_CONFIG.registry
464
+ });
465
+ if (p2.isCancel(registry)) process.exit(0);
466
+ return {
467
+ ...DEFAULT_CONFIG,
468
+ registry: String(registry),
469
+ aliases: {
470
+ ...DEFAULT_CONFIG.aliases,
471
+ components: String(components),
472
+ tokens: String(lib),
473
+ theme: String(lib),
474
+ lib: String(lib)
475
+ }
476
+ };
477
+ }
478
+
479
+ // src/commands/list.ts
480
+ var import_kleur4 = __toESM(require("kleur"), 1);
481
+ async function list({ cwd }) {
482
+ const config = await loadConfig(cwd) ?? DEFAULT_CONFIG;
483
+ const client = new RegistryClient(config.registry);
484
+ const index = await client.index();
485
+ console.log();
486
+ console.log(import_kleur4.default.bold(`Arlo UI registry ${import_kleur4.default.dim(`v${index.version}`)}`));
487
+ console.log();
488
+ const groups = {};
489
+ for (const it of index.items) {
490
+ (groups[it.kind] ??= []).push(it);
491
+ }
492
+ const order = ["foundation", "primitive", "pattern", "icon"];
493
+ for (const kind of order) {
494
+ const items = groups[kind];
495
+ if (!items?.length) continue;
496
+ console.log(import_kleur4.default.cyan(kind));
497
+ for (const it of items) {
498
+ console.log(` ${import_kleur4.default.bold(it.name.padEnd(20))}${import_kleur4.default.dim(it.description)}`);
499
+ }
500
+ console.log();
501
+ }
502
+ }
503
+
504
+ // src/program.ts
505
+ var cliVersion = false ? "0.1.0" : "0.1.3";
506
+ function buildProgram() {
507
+ const program = new import_commander.Command();
508
+ program.name("arloui").description(
509
+ "Arlo UI \u2014 copy-paste React Native components, tokens, and patterns into your Expo or bare RN app."
510
+ ).version(cliVersion);
511
+ program.command("init").description("initialize arloui in the current project (writes arlo.json + foundation files)").option("-y, --yes", "use defaults without prompting", false).action(async (opts) => {
512
+ await init({ cwd: process.cwd(), yes: opts.yes });
513
+ });
514
+ program.command("add [components...]").description("add one or more components from the registry").option("-y, --yes", "skip confirmation prompts and overwrite existing files", false).option("--overwrite", "replace existing files without asking", false).action(async (names, opts) => {
515
+ await add({ cwd: process.cwd(), names, yes: opts.yes, overwrite: opts.overwrite });
516
+ });
517
+ program.command("list").description("list every available registry entry").action(async () => {
518
+ await list({ cwd: process.cwd() });
519
+ });
520
+ program.command("diff [component]").description("compare locally installed component files to the latest registry version").action(async (name) => {
521
+ await diff({ cwd: process.cwd(), name });
522
+ });
523
+ return program;
524
+ }
525
+
526
+ // src/cli.ts
527
+ buildProgram().parseAsync(process.argv).catch((err) => {
528
+ console.error(import_kleur5.default.red("error: ") + (err instanceof Error ? err.message : String(err)));
529
+ process.exit(1);
530
+ });
531
+ //# sourceMappingURL=cli.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli.ts","../src/program.ts","../src/commands/add.ts","../src/config.ts","../src/fs-utils.ts","../src/registry-schema.ts","../src/registry-client.ts","../src/commands/diff.ts","../src/commands/init.ts","../src/commands/list.ts"],"sourcesContent":["import kleur from 'kleur';\nimport { buildProgram } from './program';\n\nbuildProgram()\n .parseAsync(process.argv)\n .catch((err: unknown) => {\n console.error(kleur.red('error: ') + (err instanceof Error ? err.message : String(err)));\n process.exit(1);\n });\n","import { Command } from 'commander';\nimport { add } from './commands/add';\nimport { diff } from './commands/diff';\nimport { init } from './commands/init';\nimport { list } from './commands/list';\n\ndeclare const __ARLOUI_VERSION__: string;\n\nconst cliVersion = typeof __ARLOUI_VERSION__ === 'undefined' ? '0.1.0' : __ARLOUI_VERSION__;\n\n/**\n * Build the commander program. Kept separate from `cli.ts` (the bin entry that\n * calls `parseAsync`) so the argument wiring can be unit tested without\n * executing on import.\n */\nexport function buildProgram(): Command {\n const program = new Command();\n\n program\n .name('arloui')\n .description(\n 'Arlo UI — copy-paste React Native components, tokens, and patterns into your Expo or bare RN app.',\n )\n .version(cliVersion);\n\n program\n .command('init')\n .description('initialize arloui in the current project (writes arlo.json + foundation files)')\n .option('-y, --yes', 'use defaults without prompting', false)\n .action(async (opts: { yes?: boolean }) => {\n await init({ cwd: process.cwd(), yes: opts.yes });\n });\n\n program\n .command('add [components...]')\n .description('add one or more components from the registry')\n .option('-y, --yes', 'skip confirmation prompts and overwrite existing files', false)\n .option('--overwrite', 'replace existing files without asking', false)\n .action(async (names: string[], opts: { yes?: boolean; overwrite?: boolean }) => {\n await add({ cwd: process.cwd(), names, yes: opts.yes, overwrite: opts.overwrite });\n });\n\n program\n .command('list')\n .description('list every available registry entry')\n .action(async () => {\n await list({ cwd: process.cwd() });\n });\n\n program\n .command('diff [component]')\n .description('compare locally installed component files to the latest registry version')\n .action(async (name: string | undefined) => {\n await diff({ cwd: process.cwd(), name });\n });\n\n return program;\n}\n","import { relative } from 'node:path';\nimport * as p from '@clack/prompts';\nimport kleur from 'kleur';\nimport { aliasFor, loadConfig, type ArloConfig } from '../config';\nimport { fileExists, resolveWithin, writeFileEnsuringDir } from '../fs-utils';\nimport { RegistryClient, type ResolvedRegistryEntry } from '../registry-client';\n\ntype Options = {\n cwd: string;\n names: string[];\n yes?: boolean;\n overwrite?: boolean;\n};\n\nexport async function add({ cwd, names, yes, overwrite }: Options): Promise<void> {\n p.intro(kleur.bgCyan(kleur.black(' arloui ')) + kleur.dim(' add'));\n\n const config = await loadConfig(cwd);\n if (!config) {\n p.log.error(`No ${kleur.cyan('arlo.json')} found. Run ${kleur.cyan('npx arloui init')} first.`);\n process.exit(1);\n }\n\n const client = new RegistryClient(config.registry);\n\n let toAdd = names;\n if (toAdd.length === 0) {\n const index = await client.index();\n const choice = await p.multiselect({\n message: 'Pick components to install',\n options: index.items\n .filter((it) => it.kind !== 'foundation')\n .map((it) => ({ label: `${it.title} ${kleur.dim(it.description)}`, value: it.name })),\n required: true,\n });\n if (p.isCancel(choice)) {\n p.cancel('Add cancelled.');\n return;\n }\n toAdd = choice as string[];\n }\n\n const allEntries = new Map<string, ResolvedRegistryEntry>();\n const spinner = p.spinner();\n spinner.start('resolving registry');\n try {\n for (const name of toAdd) {\n const entries = await client.resolve(name);\n for (const e of entries) {\n if (!allEntries.has(e.name)) allEntries.set(e.name, e);\n }\n }\n spinner.stop(`resolved ${allEntries.size} entr${allEntries.size === 1 ? 'y' : 'ies'}`);\n } catch (err) {\n spinner.stop('resolution failed');\n throw err;\n }\n\n for (const entry of allEntries.values()) {\n await writeComponent({ cwd, config, entry, overwrite, yes });\n }\n\n const npmDeps = new Set<string>();\n const nativeDeps: Array<{ name: string; setup: string }> = [];\n for (const entry of allEntries.values()) {\n entry.dependencies?.forEach((d) => npmDeps.add(d));\n entry.nativeDeps?.forEach((d) => nativeDeps.push(d));\n }\n\n const lines: string[] = [kleur.green('Done.')];\n if (npmDeps.size > 0) {\n lines.push(\n '',\n `Install npm dependencies:`,\n ` ${kleur.cyan(`npm i ${[...npmDeps].join(' ')}`)}`,\n );\n }\n if (nativeDeps.length > 0) {\n lines.push('', `Native modules:`);\n for (const d of nativeDeps) {\n lines.push(` ${kleur.cyan(d.name)} — ${d.setup}`);\n }\n }\n p.outro(lines.join('\\n'));\n}\n\nexport async function writeComponent({\n cwd,\n config,\n entry,\n overwrite,\n yes,\n}: {\n cwd: string;\n config: ArloConfig;\n entry: ResolvedRegistryEntry;\n overwrite?: boolean;\n yes?: boolean;\n}): Promise<void> {\n for (const file of entry.files) {\n const aliasRoot = aliasFor(config, file.type);\n const target = resolveWithin(cwd, aliasRoot, file.target);\n\n if ((await fileExists(target)) && !overwrite) {\n if (yes) {\n p.log.warn(`skip ${kleur.dim(rel(cwd, target))} (exists; pass --overwrite to replace)`);\n continue;\n }\n const replace = await p.confirm({\n message: `${rel(cwd, target)} already exists. Overwrite?`,\n initialValue: false,\n });\n if (p.isCancel(replace) || !replace) {\n p.log.warn(`skip ${kleur.dim(rel(cwd, target))}`);\n continue;\n }\n }\n\n await writeFileEnsuringDir(target, file.content);\n p.log.success(`wrote ${kleur.cyan(rel(cwd, target))}`);\n }\n}\n\nfunction rel(from: string, to: string): string {\n return relative(from, to) || to;\n}\n","import { existsSync } from 'node:fs';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { z } from 'zod';\n\nexport const CONFIG_FILE = 'arlo.json';\n\nconst aliasesSchema = z\n .object({\n components: z.string().min(1),\n tokens: z.string().min(1),\n theme: z.string().min(1),\n lib: z.string().min(1),\n })\n .strict();\n\nexport const arloConfigSchema = z\n .object({\n $schema: z.string(),\n /** URL of the registry index — defaults to the public CDN. */\n registry: z.string().url('registry must be a valid URL'),\n /** Where to write component files (relative to project root). */\n aliases: aliasesSchema,\n /** Style preference. Reserved for future variants (e.g. `compact`). */\n style: z.literal('default'),\n })\n .strict();\n\nexport type ArloConfig = z.infer<typeof arloConfigSchema>;\n\nexport const DEFAULT_CONFIG: ArloConfig = {\n $schema: 'https://arloui.dev/schemas/arlo-config-v1.json',\n registry: 'https://arloui.dev/r',\n aliases: {\n components: 'components/ui',\n tokens: 'lib/arloui',\n theme: 'lib/arloui',\n lib: 'lib/arloui',\n },\n style: 'default',\n};\n\nexport async function loadConfig(cwd: string): Promise<ArloConfig | null> {\n const path = resolve(cwd, CONFIG_FILE);\n if (!existsSync(path)) return null;\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(await readFile(path, 'utf8'));\n } catch {\n throw new Error(`${CONFIG_FILE} is not valid JSON. Fix it or re-run \\`arloui init\\`.`);\n }\n\n const result = arloConfigSchema.safeParse(parsed);\n if (!result.success) {\n const issues = result.error.issues\n .map((i) => ` - ${i.path.join('.') || '(root)'}: ${i.message}`)\n .join('\\n');\n throw new Error(`${CONFIG_FILE} is invalid:\\n${issues}`);\n }\n return result.data;\n}\n\nexport async function saveConfig(cwd: string, config: ArloConfig): Promise<void> {\n const path = resolve(cwd, CONFIG_FILE);\n await writeFile(path, JSON.stringify(config, null, 2) + '\\n');\n}\n\n/** Map a registry file's `type` to the configured alias root it belongs under. */\nexport function aliasFor(config: ArloConfig, type: string | undefined): string {\n switch (type) {\n case 'tokens':\n return config.aliases.tokens;\n case 'theme':\n return config.aliases.theme;\n case 'utility':\n return config.aliases.lib;\n default:\n return config.aliases.components;\n }\n}\n","import { access, mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { dirname, relative, resolve, isAbsolute } from 'node:path';\n\nexport async function writeFileEnsuringDir(target: string, contents: string): Promise<void> {\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, contents);\n}\n\nexport async function fileExists(target: string): Promise<boolean> {\n try {\n await access(target);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function readJson<T>(path: string): Promise<T> {\n return JSON.parse(await readFile(path, 'utf8')) as T;\n}\n\n/**\n * Resolve `parts` under `root` and guarantee the result stays inside `root`.\n *\n * Registry file targets come from a remote, user-configurable URL. Without this\n * guard a crafted entry with a `../../../etc/...` target could make the CLI\n * write outside the consumer's project. Any path that escapes `root` (or is\n * absolute) is rejected.\n */\nexport function resolveWithin(root: string, ...parts: string[]): string {\n const rootResolved = resolve(root);\n if (parts.some((part) => isAbsolute(part))) {\n throw new Error(`refusing to write to an absolute path: ${parts.join('/')}`);\n }\n const target = resolve(rootResolved, ...parts);\n const rel = relative(rootResolved, target);\n if (rel === '' || rel.startsWith('..') || isAbsolute(rel)) {\n throw new Error(`refusing to write outside the project directory: ${parts.join('/')}`);\n }\n return target;\n}\n","/**\n * Runtime validation for everything the CLI fetches from a registry.\n *\n * The registry is a *remote*, user-configurable URL — `add.ts` turns whatever\n * comes back into files written onto the user's disk. We therefore never trust\n * the shape of that JSON: every payload is parsed through these zod schemas\n * before it is used, so a malformed (or malicious) registry produces a clear\n * error instead of a confusing crash or an unsafe write.\n *\n * The shapes mirror `@arloui/registry`'s `schema.ts` and the output of\n * `tooling/build-registry`.\n */\nimport { z } from 'zod';\n\nexport const registryItemKindSchema = z.enum(['primitive', 'pattern', 'foundation', 'icon']);\n\nexport const registryFileTypeSchema = z.enum([\n 'component',\n 'utility',\n 'theme',\n 'tokens',\n 'example',\n]);\n\nexport const nativeDepSchema = z.object({\n name: z.string().min(1),\n setup: z.string().min(1),\n});\n\nexport const registryMetaSchema = z.object({\n figma: z.string().optional(),\n tags: z.array(z.string()).optional(),\n});\n\n/** Metadata common to both index entries and fully-resolved entries. */\nconst entryMetaShape = {\n name: z.string().min(1),\n kind: registryItemKindSchema,\n title: z.string().min(1),\n description: z.string(),\n registryDependencies: z.array(z.string().min(1)).optional(),\n dependencies: z.array(z.string().min(1)).optional(),\n nativeDeps: z.array(nativeDepSchema).optional(),\n meta: registryMetaSchema.optional(),\n};\n\n/**\n * An entry as it appears in `index.json` — file contents are stripped by the\n * build pipeline, so `files` is absent here.\n */\nexport const registryIndexEntrySchema = z.object(entryMetaShape).strict();\n\n/** A file inside a resolved entry — `content` is the source to write to disk. */\nexport const resolvedRegistryFileSchema = z\n .object({\n target: z.string().min(1),\n source: z.string().optional(),\n type: registryFileTypeSchema.optional(),\n content: z.string(),\n })\n .strict();\n\n/** A fully-resolved entry as served at `<base>/<name>.json`. */\nexport const resolvedRegistryEntrySchema = z\n .object({\n ...entryMetaShape,\n files: z.array(resolvedRegistryFileSchema).min(1),\n hash: z.string().min(1),\n })\n .strict();\n\nexport const registryIndexSchema = z\n .object({\n $schema: z.string().optional(),\n version: z.string().min(1),\n generatedAt: z.string().optional(),\n items: z.array(registryIndexEntrySchema),\n })\n .strict();\n\nexport type RegistryIndexEntry = z.infer<typeof registryIndexEntrySchema>;\nexport type ResolvedRegistryFile = z.infer<typeof resolvedRegistryFileSchema>;\nexport type ResolvedRegistryEntry = z.infer<typeof resolvedRegistryEntrySchema>;\nexport type RegistryIndex = z.infer<typeof registryIndexSchema>;\n\n/**\n * Parse `data` with `schema`, throwing an `Error` whose message names the\n * source URL and the first few validation issues. Keeps the failure readable\n * for end users running the CLI rather than dumping a raw zod stack.\n */\nexport function parseOrThrow<T>(schema: z.ZodType<T>, data: unknown, source: string): T {\n const result = schema.safeParse(data);\n if (result.success) return result.data;\n\n const issues = result.error.issues\n .slice(0, 5)\n .map((i) => ` - ${i.path.join('.') || '(root)'}: ${i.message}`)\n .join('\\n');\n const more =\n result.error.issues.length > 5 ? `\\n …and ${result.error.issues.length - 5} more` : '';\n throw new Error(`invalid registry response from ${source}:\\n${issues}${more}`);\n}\n","import {\n parseOrThrow,\n registryIndexSchema,\n resolvedRegistryEntrySchema,\n type RegistryIndex,\n type RegistryIndexEntry,\n type ResolvedRegistryEntry,\n type ResolvedRegistryFile,\n} from './registry-schema';\n\nexport type { RegistryIndex, RegistryIndexEntry, ResolvedRegistryEntry, ResolvedRegistryFile };\n\n/** Subset of the global `fetch` we depend on — injectable so tests can stub it. */\nexport type FetchLike = (\n input: string,\n init?: { signal?: AbortSignal },\n) => Promise<{\n ok: boolean;\n status: number;\n statusText: string;\n json: () => Promise<unknown>;\n}>;\n\nexport type RegistryClientOptions = {\n /** Abort a request that takes longer than this (ms). Default 15s. */\n timeoutMs?: number;\n /** Override the fetch implementation (tests / custom transports). */\n fetch?: FetchLike;\n};\n\nconst DEFAULT_TIMEOUT_MS = 15_000;\n\n/** Ordering used when installing an entry and its transitive dependencies. */\nconst KIND_ORDER = { foundation: 0, primitive: 1, pattern: 2, icon: 3 } as const;\n\nexport class RegistryClient {\n private readonly timeoutMs: number;\n private readonly fetchImpl: FetchLike;\n\n constructor(\n private readonly base: string,\n options: RegistryClientOptions = {},\n ) {\n this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n // Default to the global fetch (Node 18+).\n this.fetchImpl = options.fetch ?? ((input, init) => fetch(input, init));\n }\n\n async index(): Promise<RegistryIndex> {\n const url = `${this.base}/index.json`;\n const data = await this.fetchJson(url);\n return parseOrThrow(registryIndexSchema, data, url);\n }\n\n async get(name: string): Promise<ResolvedRegistryEntry> {\n const url = `${this.base}/${encodeURIComponent(name)}.json`;\n const data = await this.fetchJson(url);\n return parseOrThrow(resolvedRegistryEntrySchema, data, url);\n }\n\n /**\n * Returns the entry plus all transitive registry dependencies, deduped and\n * ordered foundation → primitive → pattern → icon so dependencies are written\n * before the components that rely on them. Safe against dependency cycles.\n */\n async resolve(name: string): Promise<ResolvedRegistryEntry[]> {\n const seen = new Map<string, ResolvedRegistryEntry>();\n const visiting = new Set<string>();\n\n const visit = async (id: string) => {\n if (seen.has(id) || visiting.has(id)) return;\n visiting.add(id);\n const entry = await this.get(id);\n seen.set(id, entry);\n for (const dep of entry.registryDependencies ?? []) {\n await visit(dep);\n }\n visiting.delete(id);\n };\n\n await visit(name);\n return [...seen.values()].sort((a, b) => KIND_ORDER[a.kind] - KIND_ORDER[b.kind]);\n }\n\n private async fetchJson(url: string): Promise<unknown> {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n\n let res: Awaited<ReturnType<FetchLike>>;\n try {\n res = await this.fetchImpl(url, { signal: controller.signal });\n } catch (err) {\n if (err instanceof Error && err.name === 'AbortError') {\n throw new Error(`registry request timed out after ${this.timeoutMs}ms: ${url}`);\n }\n const reason = err instanceof Error ? err.message : String(err);\n throw new Error(`registry request failed: ${url} (${reason})`);\n } finally {\n clearTimeout(timer);\n }\n\n if (!res.ok) {\n throw new Error(`registry fetch failed: ${url} (${res.status} ${res.statusText})`);\n }\n\n try {\n return await res.json();\n } catch {\n throw new Error(`registry returned invalid JSON: ${url}`);\n }\n }\n}\n","import { readFile } from 'node:fs/promises';\nimport kleur from 'kleur';\nimport { aliasFor, loadConfig } from '../config';\nimport { fileExists, resolveWithin } from '../fs-utils';\nimport { RegistryClient } from '../registry-client';\n\ntype Options = { cwd: string; name?: string };\n\n/**\n * Compare locally-installed component files to the latest registry version.\n * This is the equivalent of `shadcn diff` — it does NOT modify files. It just\n * surfaces drift so the user can decide whether to re-run `add --overwrite`.\n */\nexport async function diff({ cwd, name }: Options): Promise<void> {\n const config = await loadConfig(cwd);\n if (!config) {\n console.error(`No arlo.json found. Run \\`npx arloui init\\` first.`);\n process.exit(1);\n }\n const client = new RegistryClient(config.registry);\n const index = await client.index();\n\n let items = index.items;\n if (name) {\n const found = index.items.find((i) => i.name === name);\n if (!found) {\n console.error(\n `Unknown component \"${name}\". Run \\`npx arloui list\\` to see what's available.`,\n );\n process.exit(1);\n }\n items = [found];\n }\n\n for (const item of items) {\n const entry = await client.get(item.name);\n let drifted = 0;\n let missing = 0;\n\n for (const file of entry.files) {\n const target = resolveWithin(cwd, aliasFor(config, file.type), file.target);\n if (!(await fileExists(target))) {\n missing++;\n continue;\n }\n const local = await readFile(target, 'utf8');\n if (local !== file.content) drifted++;\n }\n\n if (missing === entry.files.length) continue; // not installed\n if (drifted === 0) {\n console.log(\n `${kleur.green('●')} ${item.name.padEnd(20)} up to date ${kleur.dim(entry.hash)}`,\n );\n } else {\n console.log(\n `${kleur.yellow('●')} ${item.name.padEnd(20)} ${drifted} of ${entry.files.length} files drifted ${kleur.dim(entry.hash)}`,\n );\n }\n }\n}\n","import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport * as p from '@clack/prompts';\nimport kleur from 'kleur';\nimport { DEFAULT_CONFIG, CONFIG_FILE, saveConfig, type ArloConfig } from '../config';\nimport { RegistryClient } from '../registry-client';\nimport { writeComponent } from './add';\n\ntype Options = {\n cwd: string;\n yes?: boolean;\n};\n\nexport async function init({ cwd, yes }: Options): Promise<void> {\n p.intro(kleur.bgCyan(kleur.black(' arloui ')) + kleur.dim(' init'));\n\n if (existsSync(resolve(cwd, CONFIG_FILE)) && !yes) {\n const overwrite = await p.confirm({\n message: `${CONFIG_FILE} already exists. Overwrite it?`,\n initialValue: false,\n });\n if (p.isCancel(overwrite) || !overwrite) {\n p.cancel('Init cancelled.');\n return;\n }\n }\n\n const config: ArloConfig = yes\n ? DEFAULT_CONFIG\n : await promptConfig();\n\n await saveConfig(cwd, config);\n p.log.success(`wrote ${kleur.cyan(CONFIG_FILE)}`);\n\n const spinner = p.spinner();\n spinner.start('installing foundation (tokens + theme provider)');\n const client = new RegistryClient(config.registry);\n try {\n const tokens = await client.resolve('tokens');\n const theme = await client.resolve('theme-provider');\n const seen = new Set<string>();\n for (const entry of [...tokens, ...theme]) {\n if (seen.has(entry.name)) continue;\n seen.add(entry.name);\n await writeComponent({ cwd, config, entry });\n }\n spinner.stop('foundation installed');\n } catch (err) {\n spinner.stop('foundation install failed');\n throw err;\n }\n\n p.outro(\n [\n kleur.green('Setup complete.'),\n '',\n 'Next steps:',\n ` ${kleur.dim('1.')} Wrap your app with ${kleur.cyan('<ThemeProvider>')} from ${kleur.cyan(config.aliases.theme + '/theme-provider')}`,\n ` ${kleur.dim('2.')} Add a component: ${kleur.cyan('npx arloui add button')}`,\n ` ${kleur.dim('3.')} Browse all: ${kleur.cyan('npx arloui list')}`,\n ].join('\\n'),\n );\n}\n\nasync function promptConfig(): Promise<ArloConfig> {\n const components = await p.text({\n message: 'Where should components live?',\n placeholder: DEFAULT_CONFIG.aliases.components,\n initialValue: DEFAULT_CONFIG.aliases.components,\n });\n if (p.isCancel(components)) process.exit(0);\n\n const lib = await p.text({\n message: 'Where should tokens / theme provider live?',\n placeholder: DEFAULT_CONFIG.aliases.lib,\n initialValue: DEFAULT_CONFIG.aliases.lib,\n });\n if (p.isCancel(lib)) process.exit(0);\n\n const registry = await p.text({\n message: 'Registry URL',\n placeholder: DEFAULT_CONFIG.registry,\n initialValue: DEFAULT_CONFIG.registry,\n });\n if (p.isCancel(registry)) process.exit(0);\n\n return {\n ...DEFAULT_CONFIG,\n registry: String(registry),\n aliases: {\n ...DEFAULT_CONFIG.aliases,\n components: String(components),\n tokens: String(lib),\n theme: String(lib),\n lib: String(lib),\n },\n };\n}\n","import kleur from 'kleur';\nimport { loadConfig, DEFAULT_CONFIG } from '../config';\nimport { RegistryClient } from '../registry-client';\n\ntype Options = { cwd: string };\n\nexport async function list({ cwd }: Options): Promise<void> {\n const config = (await loadConfig(cwd)) ?? DEFAULT_CONFIG;\n const client = new RegistryClient(config.registry);\n const index = await client.index();\n\n console.log();\n console.log(kleur.bold(`Arlo UI registry ${kleur.dim(`v${index.version}`)}`));\n console.log();\n\n const groups: Record<string, typeof index.items> = {};\n for (const it of index.items) {\n (groups[it.kind] ??= []).push(it);\n }\n\n const order = ['foundation', 'primitive', 'pattern', 'icon'];\n for (const kind of order) {\n const items = groups[kind];\n if (!items?.length) continue;\n console.log(kleur.cyan(kind));\n for (const it of items) {\n console.log(` ${kleur.bold(it.name.padEnd(20))}${kleur.dim(it.description)}`);\n }\n console.log();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAkB;;;ACAlB,uBAAwB;;;ACAxB,IAAAC,oBAAyB;AACzB,QAAmB;AACnB,mBAAkB;;;ACFlB,qBAA2B;AAC3B,sBAAoC;AACpC,uBAAwB;AACxB,iBAAkB;AAEX,IAAM,cAAc;AAE3B,IAAM,gBAAgB,aACnB,OAAO;AAAA,EACN,YAAY,aAAE,OAAO,EAAE,IAAI,CAAC;AA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AAAA,EACnC,CAAC;AAEH,UACG,QAAQ,kBAAkB,EAC1B,YAAY,0EAA0E,EACtF,OAAO,OAAO,SAA6B;AAC1C,UAAM,KAAK,EAAE,KAAK,QAAQ,IAAI,GAAG,KAAK,CAAC;AAAA,EACzC,CAAC;AAEH,SAAO;AACT;;;ADtDA,aAAa,EACV,WAAW,QAAQ,IAAI,EACvB,MAAM,CAAC,QAAiB;AACvB,UAAQ,MAAM,cAAAC,QAAM,IAAI,SAAS,KAAK,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE;AACvF,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["import_kleur","import_node_path","import_promises","import_node_path","rel","import_zod","init","kleur","spinner","import_promises","import_kleur","kleur","import_node_fs","import_node_path","p","import_kleur","kleur","spinner","import_kleur","kleur","kleur"]}