@aristobyte-ui/cli 1.0.112 → 2.0.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.
Files changed (42) hide show
  1. package/bin/aristobyte-ui.js +3 -0
  2. package/dist/es/main/commands/add.js +106 -0
  3. package/dist/es/main/commands/doctor.js +166 -0
  4. package/dist/es/main/commands/env.js +175 -0
  5. package/dist/es/main/commands/init.js +180 -0
  6. package/dist/es/main/commands/list.js +195 -0
  7. package/dist/es/main/commands/remove.js +100 -0
  8. package/dist/es/main/commands/upgrade.js +122 -0
  9. package/dist/es/main/index.js +212 -0
  10. package/dist/es/main/utils/checkVersion.js +8 -0
  11. package/dist/es/main/utils/colors.js +77 -0
  12. package/dist/es/main/utils/compareVersions.js +11 -0
  13. package/dist/es/main/utils/getBanner.js +30 -0
  14. package/dist/es/main/utils/getCurrentPackageManager.js +55 -0
  15. package/dist/es/main/utils/getDescription.js +21 -0
  16. package/dist/es/main/utils/getTip.js +21 -0
  17. package/dist/es/main/utils/installPackage.js +75 -0
  18. package/dist/es/main/utils/parseHelp.js +22 -0
  19. package/dist/es/main/utils/typography.js +9 -0
  20. package/dist/lib/main/commands/add.js +112 -0
  21. package/dist/lib/main/commands/doctor.js +172 -0
  22. package/dist/lib/main/commands/env.js +181 -0
  23. package/dist/lib/main/commands/init.js +186 -0
  24. package/dist/lib/main/commands/list.js +202 -0
  25. package/dist/lib/main/commands/remove.js +106 -0
  26. package/dist/lib/main/commands/upgrade.js +128 -0
  27. package/dist/lib/main/index.js +217 -0
  28. package/dist/lib/main/utils/checkVersion.js +14 -0
  29. package/dist/lib/main/utils/colors.js +96 -0
  30. package/dist/lib/main/utils/compareVersions.js +14 -0
  31. package/dist/lib/main/utils/getBanner.js +33 -0
  32. package/dist/lib/main/utils/getCurrentPackageManager.js +61 -0
  33. package/dist/lib/main/utils/getDescription.js +24 -0
  34. package/dist/lib/main/utils/getTip.js +24 -0
  35. package/dist/lib/main/utils/installPackage.js +78 -0
  36. package/dist/lib/main/utils/parseHelp.js +25 -0
  37. package/dist/lib/main/utils/typography.js +13 -0
  38. package/package.json +12 -33
  39. package/dist/index.js +0 -1222
  40. package/dist/index.js.map +0 -1
  41. package/dist/index.mjs +0 -1221
  42. package/dist/index.mjs.map +0 -1
package/dist/index.js DELETED
@@ -1,1222 +0,0 @@
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 __commonJS = (cb, mod) => function __require() {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
-
29
- // ../../node_modules/picocolors/picocolors.js
30
- var require_picocolors = __commonJS({
31
- "../../node_modules/picocolors/picocolors.js"(exports2, module2) {
32
- "use strict";
33
- var p = process || {};
34
- var argv = p.argv || [];
35
- var env2 = p.env || {};
36
- var isColorSupported = !(!!env2.NO_COLOR || argv.includes("--no-color")) && (!!env2.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env2.TERM !== "dumb" || !!env2.CI);
37
- var formatter = (open, close, replace = open) => (input) => {
38
- let string = "" + input, index = string.indexOf(close, open.length);
39
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
40
- };
41
- var replaceClose = (string, close, replace, index) => {
42
- let result = "", cursor = 0;
43
- do {
44
- result += string.substring(cursor, index) + replace;
45
- cursor = index + close.length;
46
- index = string.indexOf(close, cursor);
47
- } while (~index);
48
- return result + string.substring(cursor);
49
- };
50
- var createColors = (enabled = isColorSupported) => {
51
- let f = enabled ? formatter : () => String;
52
- return {
53
- isColorSupported: enabled,
54
- reset: f("\x1B[0m", "\x1B[0m"),
55
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
56
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
57
- italic: f("\x1B[3m", "\x1B[23m"),
58
- underline: f("\x1B[4m", "\x1B[24m"),
59
- inverse: f("\x1B[7m", "\x1B[27m"),
60
- hidden: f("\x1B[8m", "\x1B[28m"),
61
- strikethrough: f("\x1B[9m", "\x1B[29m"),
62
- black: f("\x1B[30m", "\x1B[39m"),
63
- red: f("\x1B[31m", "\x1B[39m"),
64
- green: f("\x1B[32m", "\x1B[39m"),
65
- yellow: f("\x1B[33m", "\x1B[39m"),
66
- blue: f("\x1B[34m", "\x1B[39m"),
67
- magenta: f("\x1B[35m", "\x1B[39m"),
68
- cyan: f("\x1B[36m", "\x1B[39m"),
69
- white: f("\x1B[37m", "\x1B[39m"),
70
- gray: f("\x1B[90m", "\x1B[39m"),
71
- bgBlack: f("\x1B[40m", "\x1B[49m"),
72
- bgRed: f("\x1B[41m", "\x1B[49m"),
73
- bgGreen: f("\x1B[42m", "\x1B[49m"),
74
- bgYellow: f("\x1B[43m", "\x1B[49m"),
75
- bgBlue: f("\x1B[44m", "\x1B[49m"),
76
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
77
- bgCyan: f("\x1B[46m", "\x1B[49m"),
78
- bgWhite: f("\x1B[47m", "\x1B[49m"),
79
- blackBright: f("\x1B[90m", "\x1B[39m"),
80
- redBright: f("\x1B[91m", "\x1B[39m"),
81
- greenBright: f("\x1B[92m", "\x1B[39m"),
82
- yellowBright: f("\x1B[93m", "\x1B[39m"),
83
- blueBright: f("\x1B[94m", "\x1B[39m"),
84
- magentaBright: f("\x1B[95m", "\x1B[39m"),
85
- cyanBright: f("\x1B[96m", "\x1B[39m"),
86
- whiteBright: f("\x1B[97m", "\x1B[39m"),
87
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
88
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
89
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
90
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
91
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
92
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
93
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
94
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
95
- };
96
- };
97
- module2.exports = createColors();
98
- module2.exports.createColors = createColors;
99
- }
100
- });
101
-
102
- // index.ts
103
- var import_commander = require("commander");
104
-
105
- // commands/add.ts
106
- var import_prompts = require("@clack/prompts");
107
-
108
- // utils/getCurrentPackageManager.ts
109
- var import_fs = __toESM(require("fs"));
110
- var import_path = __toESM(require("path"));
111
- function getCurrentPackageManager(cwd = process.cwd()) {
112
- const lockFiles = {
113
- bun: "bun.lockb",
114
- pnpm: "pnpm-lock.yaml",
115
- yarn: "yarn.lock",
116
- npm: "package-lock.json"
117
- };
118
- for (const [manager, lockFile] of Object.entries(lockFiles)) {
119
- if (import_fs.default.existsSync(import_path.default.join(cwd, lockFile))) {
120
- return manager;
121
- }
122
- }
123
- return "npm";
124
- }
125
-
126
- // commands/add.ts
127
- var import_picocolors2 = __toESM(require_picocolors());
128
-
129
- // utils/installPackage.ts
130
- var import_execa = require("execa");
131
- async function installPackage(pkgManager, pkg, dev = false) {
132
- let args = [];
133
- switch (pkgManager) {
134
- case "npm":
135
- args = ["install", pkg, dev ? "--save-dev" : "--save"];
136
- break;
137
- case "yarn":
138
- args = ["add", pkg];
139
- if (dev) args.push("-D");
140
- break;
141
- case "pnpm":
142
- args = ["add", pkg];
143
- if (dev) args.push("-D");
144
- break;
145
- case "bun":
146
- args = ["add", pkg];
147
- if (dev) args.push("-d");
148
- break;
149
- default:
150
- throw new Error(`Unsupported package manager: ${pkgManager}`);
151
- }
152
- await (0, import_execa.execa)(pkgManager, args, { stdio: "inherit" });
153
- }
154
-
155
- // commands/list.ts
156
- var import_fs2 = __toESM(require("fs"));
157
- var import_picocolors = __toESM(require_picocolors());
158
- async function list(options, endBlock) {
159
- let handled = false;
160
- if (options.all) {
161
- handled = true;
162
- const url = "https://registry.npmjs.org/-/org/aristobyte-ui/package";
163
- const omit = ["cli", "react"];
164
- try {
165
- const res = await fetch(url);
166
- if (!res.ok) throw new Error(`Registry request failed: ${res.status}`);
167
- const data = await res.json();
168
- const packages = Object.keys(data).map((dep) => dep.split("/")[1]).filter((dep) => !omit.includes(dep)).sort();
169
- console.log(
170
- `${import_picocolors.default.green("\u25C7")} ${import_picocolors.default.white("Listing AristoByteUI packages:")}
171
- ${packages.map((dep) => `${import_picocolors.default.gray("|")} ${import_picocolors.default.cyan(dep)}`).join("\n")}`
172
- );
173
- } catch (err) {
174
- console.error(
175
- import_picocolors.default.red("\xD7 Failed to fetch package list from npm registry")
176
- );
177
- console.error(import_picocolors.default.dim(String(err)));
178
- }
179
- if (endBlock) console.log(import_picocolors.default.green("\u25C7"));
180
- process.exit(0);
181
- }
182
- if (options.installed) {
183
- handled = true;
184
- try {
185
- const pkgJson = JSON.parse(import_fs2.default.readFileSync("package.json", "utf-8"));
186
- const deps = pkgJson.dependencies || {};
187
- const aristobyteDeps = Object.keys(deps).filter((d) => d.startsWith("@aristobyte-ui/")).map((dep) => dep.includes("react") ? "all" : dep.split("/")[1]);
188
- console.log(
189
- `${import_picocolors.default.green("\u25C7")} ${import_picocolors.default.white("Listing installed AristoByteUI packages:")}
190
- ${aristobyteDeps.map((dep) => `${import_picocolors.default.gray("|")} ${import_picocolors.default.cyan(dep)}`).join("\n")}`
191
- );
192
- } catch (err) {
193
- console.error(import_picocolors.default.red("\xD7 Failed to list packages"), err);
194
- }
195
- if (endBlock) console.log(import_picocolors.default.green("\u25C7"));
196
- process.exit(0);
197
- }
198
- if (options.outdated) {
199
- handled = true;
200
- const packagesToUpdate = [];
201
- try {
202
- const pkgJson = JSON.parse(import_fs2.default.readFileSync("package.json", "utf-8"));
203
- const deps = pkgJson.dependencies || {};
204
- const installed = Object.keys(deps).filter(
205
- (d) => d.startsWith("@aristobyte-ui/")
206
- );
207
- if (installed.length === 0) {
208
- console.log(import_picocolors.default.yellow("No AristoByteUI packages installed."));
209
- process.exit(0);
210
- }
211
- console.log(
212
- `${import_picocolors.default.green("\u25C7")} ${import_picocolors.default.white("Checking for outdated AristoByteUI packages...")}`
213
- );
214
- for (const pkg of installed) {
215
- const localVersion = deps[pkg].replace(/^[^\d]*/, "");
216
- const registryUrl = `https://registry.npmjs.org/${pkg}`;
217
- try {
218
- const res = await fetch(registryUrl);
219
- if (!res.ok)
220
- throw new Error(`Registry request failed: ${res.status}`);
221
- const data = await res.json();
222
- const latest = data["dist-tags"]?.latest;
223
- if (!latest) continue;
224
- if (latest !== localVersion) {
225
- const p = pkg.replace("@aristobyte-ui/", "");
226
- packagesToUpdate.push([p, latest]);
227
- console.log(
228
- `${import_picocolors.default.gray("|")} ${import_picocolors.default.cyan(p)} ${import_picocolors.default.red(localVersion)} \u2192 ${import_picocolors.default.green(latest)}`
229
- );
230
- }
231
- } catch (err) {
232
- console.error(
233
- import_picocolors.default.red(`\xD7 Failed to check ${pkg} on npm registry`),
234
- err
235
- );
236
- }
237
- }
238
- } catch (err) {
239
- console.error(import_picocolors.default.red("\xD7 Failed to check outdated packages"), err);
240
- }
241
- const pkgManager = getCurrentPackageManager();
242
- if (endBlock)
243
- console.log(
244
- `${import_picocolors.default.gray("|")}
245
- ${import_picocolors.default.green("\u25C7")} ${packagesToUpdate.length > 0 ? import_picocolors.default.gray(`Tip: run '${pkgManager} upgrade ${packagesToUpdate.map((p) => `${p[0]}@${p[1]}`).join(" ")}'`) : import_picocolors.default.green("\u2714 Everything is up to date!")}`
246
- );
247
- process.exit(0);
248
- }
249
- if (!handled) {
250
- console.log(
251
- import_picocolors.default.gray(
252
- "No option provided. Use 'aristobyte-ui list --help' for usage."
253
- )
254
- );
255
- }
256
- }
257
-
258
- // commands/add.ts
259
- var DEFAULT_PACKAGE = "all";
260
- async function add(component, options) {
261
- if (options.list) {
262
- await list({ all: true }, true);
263
- }
264
- const pkgManager = getCurrentPackageManager();
265
- if (options.packageManager) {
266
- console.log(`${import_picocolors2.default.cyan("Current package manager:")}
267
- ${import_picocolors2.default.green("\u25C7")} ${pkgManager}`);
268
- process.exit(0);
269
- }
270
- const s = (0, import_prompts.spinner)();
271
- let packageName = DEFAULT_PACKAGE;
272
- if (!component) {
273
- console.log(
274
- `${import_picocolors2.default.green("\u25C7")} ${import_picocolors2.default.white("You did not specify, which package should be added")}
275
- ${import_picocolors2.default.gray("|")} ${import_picocolors2.default.gray("Please select one of the packages below listed to proceed.")}
276
- ${import_picocolors2.default.gray("|")}`
277
- );
278
- await list({ all: true });
279
- packageName = await (0, import_prompts.text)({
280
- message: "Component name to add (Enter to install all components)",
281
- placeholder: DEFAULT_PACKAGE,
282
- defaultValue: DEFAULT_PACKAGE
283
- });
284
- } else {
285
- packageName = component;
286
- }
287
- try {
288
- s.start(`Installing ${packageName}...`);
289
- const pkgManager2 = getCurrentPackageManager();
290
- if (packageName === "all") {
291
- await installPackage(pkgManager2, "@aristobyte-ui/react");
292
- s.stop();
293
- console.log(import_picocolors2.default.green("\u2714 All components installed!"));
294
- return;
295
- }
296
- const pkgName = `@aristobyte-ui/${packageName}`;
297
- await installPackage(pkgManager2, pkgName);
298
- s.stop();
299
- console.log(import_picocolors2.default.green(`\u2714 Component ${packageName} installed!`));
300
- } catch (err) {
301
- s.stop();
302
- console.error(import_picocolors2.default.red(`\xD7 Failed to install package ${packageName}`), err);
303
- }
304
- }
305
-
306
- // commands/init.ts
307
- var import_execa2 = require("execa");
308
- var import_prompts2 = require("@clack/prompts");
309
- var import_picocolors3 = __toESM(require_picocolors());
310
- var TEMPLATES = [
311
- {
312
- id: "aristobyte-ui-template-nextjs-15-app-router",
313
- name: "Next App Router",
314
- desc: "A Next.js 15 with app-router directory template pre-configured with AristoByteUI.",
315
- repo: "https://github.com/aristobyte-team/aristobyte-ui-template-nextjs-15-app-router.git"
316
- },
317
- {
318
- id: "aristobyte-ui-template-nextjs-15-pages",
319
- name: "Next Pages",
320
- desc: "A Next.js 15 with pages directory template pre-configured with AristoByteUI.",
321
- repo: "https://github.com/aristobyte-team/aristobyte-ui-template-nextjs-15-pages.git"
322
- },
323
- {
324
- id: "aristobyte-ui-template-vite",
325
- name: "Vite",
326
- desc: "A Vite template pre-configured with AristoByteUI.",
327
- repo: "https://github.com/aristobyte-team/aristobyte-ui-template-vite.git"
328
- },
329
- {
330
- id: "aristobyte-ui-template-vike",
331
- name: "Vike",
332
- desc: "A Vike template pre-configured with AristoByteUI.",
333
- repo: "https://github.com/aristobyte-team/aristobyte-ui-template-vike.git"
334
- },
335
- {
336
- id: "aristobyte-ui-template-astro",
337
- name: "Astro",
338
- desc: "An Astro template pre-configured with AristoByteUI.",
339
- repo: "https://github.com/aristobyte-team/aristobyte-ui-template-astro.git"
340
- },
341
- {
342
- id: "aristobyte-ui-template-rsbuild",
343
- name: "RS Build",
344
- desc: "An RS Build template pre-configured with AristoByteUI.",
345
- repo: "https://github.com/aristobyte-team/aristobyte-ui-template-rsbuild.git"
346
- }
347
- ];
348
- var PACKAGE_MANAGERS = ["npm", "yarn", "pnpm", "bun"];
349
- var DEFAULT_NAME = "aristobyte-ui-app";
350
- async function init(myProjectName, options) {
351
- if (options.listTemplates) {
352
- console.log(`${import_picocolors3.default.cyan("Available templates:")}
353
- ${TEMPLATES.map(
354
- (t) => `${import_picocolors3.default.green("\u25C7")} ${t.id.split("aristobyte-ui-template-")[1]} - ${import_picocolors3.default.gray(t.desc)}`
355
- ).join("\n")}`);
356
- process.exit(0);
357
- }
358
- if (options.listPackageManagers) {
359
- console.log(
360
- `${import_picocolors3.default.cyan("Available package managers:")}
361
- ${PACKAGE_MANAGERS.map((pm) => `${import_picocolors3.default.green("\u25C7")} ${pm}`).join("\n")}`
362
- );
363
- process.exit(0);
364
- }
365
- console.log(import_picocolors3.default.cyan("\u250C Create a new project"));
366
- let projectName = myProjectName || DEFAULT_NAME;
367
- if (!myProjectName) {
368
- projectName = await (0, import_prompts2.text)({
369
- message: "New project name (Enter to skip with default name)",
370
- placeholder: DEFAULT_NAME,
371
- defaultValue: DEFAULT_NAME
372
- });
373
- } else {
374
- console.log(
375
- `${import_picocolors3.default.gray("\u2502")}
376
- ${import_picocolors3.default.green("\u25C7")} ${import_picocolors3.default.white("Your project name is:")}
377
- ${import_picocolors3.default.gray("\u2502")} ${import_picocolors3.default.green(projectName)}`
378
- );
379
- }
380
- let template = TEMPLATES.find(
381
- (t) => t.id === `aristobyte-ui-template-${options?.template?.toLowerCase()?.replaceAll(" ", "")}`
382
- );
383
- if (!template) {
384
- const templateIndex = await (0, import_prompts2.select)({
385
- message: "Select a template (Enter to select)",
386
- options: TEMPLATES.map((t, i) => ({
387
- value: i.toString(),
388
- label: `${t.name} (${t.desc})`
389
- }))
390
- });
391
- template = TEMPLATES[Number(templateIndex)];
392
- } else {
393
- console.log(
394
- `${import_picocolors3.default.gray("\u2502")}
395
- ${import_picocolors3.default.green("\u25C7")} ${import_picocolors3.default.white("Template selected:")}
396
- ${import_picocolors3.default.gray("\u2502")} ${import_picocolors3.default.green(template.name)}`
397
- );
398
- }
399
- let packageManager = PACKAGE_MANAGERS.find(
400
- (pm) => pm.toLowerCase() === options.packageManager?.toLowerCase()
401
- );
402
- if (!packageManager) {
403
- const packageManagerIndex = await (0, import_prompts2.select)({
404
- message: "Select a package manager (Enter to select)",
405
- options: PACKAGE_MANAGERS.map((pm, i) => ({
406
- value: i.toString(),
407
- label: pm
408
- }))
409
- });
410
- packageManager = PACKAGE_MANAGERS[Number(packageManagerIndex)];
411
- } else {
412
- console.log(
413
- `${import_picocolors3.default.gray("\u2502")}
414
- ${import_picocolors3.default.green("\u25C7")} ${import_picocolors3.default.white("Package manager selected:")}
415
- ${import_picocolors3.default.gray("\u2502")} ${import_picocolors3.default.green(packageManager)}`
416
- );
417
- }
418
- console.log(
419
- `${import_picocolors3.default.gray("\u2502")}
420
- ${import_picocolors3.default.green("\u25C7")} ${import_picocolors3.default.cyan("Template created successfully!")}
421
- ${import_picocolors3.default.gray("\u2502")}`
422
- );
423
- const s = (0, import_prompts2.spinner)();
424
- try {
425
- s.start(
426
- `Preparing '${template.name}' with ${packageManager} configuration...`
427
- );
428
- await (0, import_execa2.execa)(
429
- "git",
430
- [
431
- "clone",
432
- "--branch",
433
- packageManager,
434
- "--single-branch",
435
- template.repo,
436
- projectName
437
- ],
438
- { stdio: "ignore" }
439
- );
440
- await (0, import_execa2.execa)("rm", ["-rf", ".git"], { cwd: projectName, stdio: "ignore" });
441
- s.stop(`${import_picocolors3.default.green("\u2714 Project initialized successfully!")}`);
442
- console.log(
443
- `
444
- ${import_picocolors3.default.gray("\u2502")}
445
- ${import_picocolors3.default.green("\u25C7")} ${import_picocolors3.default.cyan("To get started:")}
446
- ${import_picocolors3.default.gray("\u2502")}
447
- ${import_picocolors3.default.gray("\u251C\u2500")} ${import_picocolors3.default.white("cd " + projectName)}
448
- ${import_picocolors3.default.gray("\u251C\u2500")} ${import_picocolors3.default.white(`${packageManager} install`)}
449
- ${import_picocolors3.default.gray("\u251C\u2500")} ${import_picocolors3.default.white(`${packageManager} run dev`)}`
450
- );
451
- } catch (err) {
452
- s.stop();
453
- console.error(import_picocolors3.default.red("\xD7 Failed to initialize project"), err);
454
- }
455
- }
456
-
457
- // commands/remove.ts
458
- var import_prompts3 = require("@clack/prompts");
459
- var import_execa3 = require("execa");
460
- var import_picocolors4 = __toESM(require_picocolors());
461
- async function remove(component, options) {
462
- if (options.list) {
463
- await list({ installed: true }, true);
464
- }
465
- const pkgManager = getCurrentPackageManager();
466
- if (options.packageManager) {
467
- console.log(`${import_picocolors4.default.cyan("Current package manager:")}
468
- ${import_picocolors4.default.green("\u25C7")} ${pkgManager}`);
469
- process.exit(0);
470
- }
471
- const s = (0, import_prompts3.spinner)();
472
- let packageName;
473
- if (!component) {
474
- console.log(
475
- `${import_picocolors4.default.green("\u25C7")} ${import_picocolors4.default.white("You did not specify, which package should be removed")}
476
- ${import_picocolors4.default.gray("|")} ${import_picocolors4.default.gray("Please select one of the installed packages below to proceed.")}
477
- ${import_picocolors4.default.gray("|")}`
478
- );
479
- await list({ installed: true });
480
- packageName = await (0, import_prompts3.text)({
481
- message: `Component name to remove (Required filled)`,
482
- placeholder: "<package-name>"
483
- });
484
- } else {
485
- packageName = component;
486
- }
487
- if (!packageName) {
488
- console.log(
489
- import_picocolors4.default.red(
490
- `Invalid Package name. <package-name> should be specified:
491
- aristobyte-ui remove <package-name>`
492
- )
493
- );
494
- return;
495
- }
496
- try {
497
- const pkgName = packageName === "all" ? "@aristobyte-ui/react" : `@aristobyte-ui/${packageName}`;
498
- s.start(`Removing ${pkgName}...`);
499
- await (0, import_execa3.execa)(pkgManager, ["remove", pkgName], { stdio: "inherit" });
500
- s.stop();
501
- console.log(import_picocolors4.default.green(`\u2714 ${pkgName} removed successfully!`));
502
- } catch (err) {
503
- s.stop();
504
- console.error(
505
- import_picocolors4.default.red(`\xD7 Failed to remove component ${packageName}`),
506
- err
507
- );
508
- }
509
- }
510
-
511
- // commands/upgrade.ts
512
- var import_prompts4 = require("@clack/prompts");
513
- var import_execa4 = require("execa");
514
- var import_picocolors5 = __toESM(require_picocolors());
515
- async function upgrade(component, options) {
516
- if (!component && !options.all) {
517
- console.error(import_picocolors5.default.red("\xD7 No component specified for upgrade."));
518
- console.log(
519
- import_picocolors5.default.gray(
520
- "Use: 'aristobyte-ui upgrade <component>' or 'aristobyte-ui upgrade --all'"
521
- )
522
- );
523
- process.exit(0);
524
- }
525
- const s = (0, import_prompts4.spinner)();
526
- const pkgManager = getCurrentPackageManager();
527
- try {
528
- const isAll = options.all || component === "all";
529
- const targets = isAll ? ["@aristobyte-ui/react"] : component ? [`@aristobyte-ui/${component}`] : [];
530
- if (targets.length === 0) {
531
- console.error(import_picocolors5.default.red("\xD7 No component specified for upgrade."));
532
- console.log(
533
- import_picocolors5.default.gray("Use: aristobyte-ui upgrade <component> or --all")
534
- );
535
- process.exit(1);
536
- }
537
- const versionSuffix = options.to ? `@${options.to}` : "";
538
- const sLabel = isAll ? "Upgrading all AristoByteUI components..." : `Upgrading ${targets.join(", ")}...`;
539
- s.start(sLabel);
540
- for (const pkg of targets) {
541
- const fullSpecifier = `${pkg}${versionSuffix}`;
542
- await (0, import_execa4.execa)(pkgManager, ["upgrade", fullSpecifier], {
543
- stdio: "inherit"
544
- });
545
- }
546
- s.stop();
547
- console.log(
548
- import_picocolors5.default.green(
549
- `\u2714 Upgrade complete${options.to ? ` \u2192 version ${options.to}` : ""}!`
550
- )
551
- );
552
- } catch (err) {
553
- s.stop();
554
- console.error(import_picocolors5.default.red(`\xD7 Upgrade failed.`));
555
- console.error(import_picocolors5.default.dim(String(err)));
556
- }
557
- }
558
-
559
- // commands/doctor.ts
560
- var import_fs3 = __toESM(require("fs"));
561
- var import_path2 = __toESM(require("path"));
562
- var import_os = __toESM(require("os"));
563
- var import_child_process = require("child_process");
564
- var import_prompts5 = require("@clack/prompts");
565
- var import_picocolors7 = __toESM(require_picocolors());
566
-
567
- // utils/compareVersions.ts
568
- function compareVersions(v1, v2) {
569
- const a = v1.replace(/^v/, "").split(".").map(Number);
570
- const b = v2.replace(/^v/, "").split(".").map(Number);
571
- for (let i = 0; i < 3; i++) {
572
- if (a[i] > b[i]) return 1;
573
- if (a[i] < b[i]) return -1;
574
- }
575
- return 0;
576
- }
577
-
578
- // utils/checkVersion.ts
579
- var import_picocolors6 = __toESM(require_picocolors());
580
- function checkVersion(name, version, minVersion) {
581
- if (version === "unknown" || compareVersions(version, minVersion) < 0) {
582
- return import_picocolors6.default.red(`\xD7 ${name} >= ${minVersion} required`);
583
- }
584
- return import_picocolors6.default.green(`\u2714 ${version}`);
585
- }
586
-
587
- // commands/doctor.ts
588
- var MIN_VERSIONS = {
589
- node: "20.19.0",
590
- pnpm: "10.15.1",
591
- npm: "10.8.2",
592
- yarn: "1.22.22",
593
- bun: "1.2.21"
594
- };
595
- function getVersion(command, name) {
596
- try {
597
- return (0, import_child_process.execSync)(command).toString().trim();
598
- } catch (err) {
599
- console.error(import_picocolors7.default.red(`\xD7 Failed to detect ${name} version:`), err);
600
- return "unknown";
601
- }
602
- }
603
- function hasProjectPackage(name) {
604
- try {
605
- const pkgJson = JSON.parse(import_fs3.default.readFileSync("package.json", "utf-8"));
606
- return pkgJson.dependencies && pkgJson.dependencies[name] || pkgJson.devDependencies && pkgJson.devDependencies[name];
607
- } catch {
608
- return false;
609
- }
610
- }
611
- function detectUISetup() {
612
- const configPaths = [
613
- "tailwind.config.js",
614
- "tailwind.config.ts",
615
- "postcss.config.js",
616
- "postcss.config.ts"
617
- ];
618
- return configPaths.filter((p) => import_fs3.default.existsSync(import_path2.default.resolve(p)));
619
- }
620
- async function checkNetwork() {
621
- try {
622
- const res = await fetch(
623
- "https://registry.npmjs.org/-/org/aristobyte-ui/package",
624
- { method: "HEAD" }
625
- );
626
- return res.ok;
627
- } catch {
628
- return false;
629
- }
630
- }
631
- async function doctor(options) {
632
- const s = (0, import_prompts5.spinner)();
633
- try {
634
- s.start("Running doctor diagnostics\u2026");
635
- console.log(
636
- `${import_picocolors7.default.green("\u25C7")} ${import_picocolors7.default.cyan("Doctor Diagnostics")}
637
- ${import_picocolors7.default.gray("|")}`
638
- );
639
- const system = {
640
- os: `${import_os.default.type()} ${import_os.default.release()} (${import_os.default.platform()})`,
641
- cpu: import_os.default.cpus()[0].model,
642
- memoryMB: Math.round(import_os.default.totalmem() / 1024 / 1024),
643
- node: getVersion("node -v", "Node")
644
- };
645
- const pkgManager = getCurrentPackageManager();
646
- const pmVersion = getVersion(`${pkgManager} -v`, pkgManager);
647
- const uiInstalled = hasProjectPackage("@aristobyte-ui/react");
648
- const pluginInstalled = hasProjectPackage("@aristobyte-ui/plugin");
649
- const configs = detectUISetup();
650
- let networkOnline;
651
- if (options.network || options.all || Object.keys(options).length === 0) {
652
- networkOnline = await checkNetwork();
653
- }
654
- const payload = {
655
- system,
656
- packageManager: { name: pkgManager, version: pmVersion },
657
- installedPackages: { ui: uiInstalled, plugin: pluginInstalled },
658
- configs,
659
- network: networkOnline
660
- };
661
- if (options.json) {
662
- console.log(
663
- `${import_picocolors7.default.gray("|")}
664
- ${import_picocolors7.default.gray("\u25C7 ------ JSON start ------ \u25C7")}
665
- ${JSON.stringify(payload, null, 2)}
666
- ${import_picocolors7.default.gray("\u25C7 ------ JSON end ------ \u25C7")}
667
- ${import_picocolors7.default.gray("|")}`
668
- );
669
- }
670
- if (options.system || options.all || Object.keys(options).length === 0) {
671
- console.log(
672
- `${options.system ? "" : "\n"}${import_picocolors7.default.gray("|")}
673
- ${import_picocolors7.default.green("\u25C7")} ${import_picocolors7.default.cyan("System:")}
674
- ${import_picocolors7.default.gray("|")} ${import_picocolors7.default.white("OS:")} ${import_picocolors7.default.green(system.os)}
675
- ${import_picocolors7.default.gray("|")} ${import_picocolors7.default.white("CPU:")} ${import_picocolors7.default.green(system.cpu)}
676
- ${import_picocolors7.default.gray("|")} ${import_picocolors7.default.white("Memory:")} ${import_picocolors7.default.green(`${system.memoryMB} MB`)}
677
- ${import_picocolors7.default.gray("|")} ${import_picocolors7.default.white("Node:")} ${checkVersion("Node", system.node, MIN_VERSIONS.node)}`
678
- );
679
- }
680
- if (options.pm || options.all || Object.keys(options).length === 0) {
681
- console.log(
682
- `${import_picocolors7.default.gray("|")}
683
- ${import_picocolors7.default.green("\u25C7")} ${import_picocolors7.default.cyan("Package Manager:")}
684
- ${import_picocolors7.default.gray("|")} ${import_picocolors7.default.white("Current:")} ${import_picocolors7.default.green(pkgManager)}
685
- ${import_picocolors7.default.gray("|")} ${import_picocolors7.default.white("Version:")} ${checkVersion(pkgManager, pmVersion, MIN_VERSIONS[pkgManager])}`
686
- );
687
- }
688
- if (options.deps || options.all || Object.keys(options).length === 0) {
689
- console.log(
690
- `${import_picocolors7.default.gray("|")}
691
- ${import_picocolors7.default.green("\u25C7")} ${import_picocolors7.default.cyan("Project Dependencies:")}
692
- ${import_picocolors7.default.gray("|")} ${import_picocolors7.default.white("@aristobyte-ui/react:")} ${uiInstalled ? import_picocolors7.default.green("\u2714 Installed") : import_picocolors7.default.red("\xD7 Missing")}
693
- ${import_picocolors7.default.gray("|")} ${import_picocolors7.default.white("@aristobyte-ui/plugin:")} ${pluginInstalled ? import_picocolors7.default.green("\u2714 Installed") : import_picocolors7.default.red("\xD7 Missing")}`
694
- );
695
- }
696
- if (options.configs || options.all || Object.keys(options).length === 0) {
697
- console.log(
698
- `${import_picocolors7.default.gray("|")}
699
- ${import_picocolors7.default.green("\u25C7")} ${import_picocolors7.default.cyan("Config Files:")}`
700
- );
701
- if (!configs.length) {
702
- console.log(
703
- `${import_picocolors7.default.gray("|")} ${import_picocolors7.default.red("\xD7 No config files detected")}`
704
- );
705
- } else {
706
- configs.forEach(
707
- (cfg) => console.log(
708
- `${import_picocolors7.default.gray("|")} ${import_picocolors7.default.green("\u2714")} ${import_picocolors7.default.white(cfg)}`
709
- )
710
- );
711
- }
712
- }
713
- if ((options.network || options.all || Object.keys(options).length === 0) && networkOnline !== void 0) {
714
- console.log(
715
- `${options.network ? "\n" : ""}${import_picocolors7.default.gray("|")}
716
- ${import_picocolors7.default.green("\u25C7")} ${import_picocolors7.default.cyan("Network:")}
717
- ${import_picocolors7.default.gray("|")} ${networkOnline ? `${import_picocolors7.default.green("\u2714")} ${import_picocolors7.default.white("Registry reachable")}` : `${import_picocolors7.default.red("\xD7")} ${import_picocolors7.default.white("Registry unreachable")}`}`
718
- );
719
- }
720
- console.log(import_picocolors7.default.gray("|"));
721
- s.stop(import_picocolors7.default.green("\u2714 Doctor diagnostics finished successfully!"));
722
- } catch (err) {
723
- s.stop(import_picocolors7.default.red("\xD7 Doctor diagnostics failed"));
724
- console.error(import_picocolors7.default.red("\xD7 Diagnostics crashed"), err);
725
- }
726
- }
727
-
728
- // commands/env.ts
729
- var import_os2 = __toESM(require("os"));
730
- var import_fs4 = __toESM(require("fs"));
731
- var import_child_process2 = require("child_process");
732
- var import_prompts6 = require("@clack/prompts");
733
- var import_picocolors8 = __toESM(require_picocolors());
734
- var MIN_VERSIONS2 = {
735
- node: "20.19.0",
736
- pnpm: "10.15.1",
737
- npm: "10.8.2",
738
- yarn: "1.22.22",
739
- bun: "1.2.21"
740
- };
741
- function getVersion2(command, name) {
742
- try {
743
- return (0, import_child_process2.execSync)(command).toString().trim();
744
- } catch (err) {
745
- console.error(import_picocolors8.default.red(`\xD7 Failed to detect ${name} version:`), err);
746
- return "unknown";
747
- }
748
- }
749
- function getSystemInfo() {
750
- return {
751
- os: `${import_os2.default.type()} ${import_os2.default.release()} (${import_os2.default.platform()})`,
752
- cpu: import_os2.default.cpus()[0].model,
753
- memoryMB: Math.round(import_os2.default.totalmem() / 1024 / 1024),
754
- node: getVersion2("node -v", "Node")
755
- };
756
- }
757
- function getPackageManagerInfo() {
758
- const current = getCurrentPackageManager();
759
- return {
760
- packageManager: current,
761
- version: getVersion2(`${current} -v`, current)
762
- };
763
- }
764
- function getInstalledPackages() {
765
- try {
766
- const pkgJson = JSON.parse(import_fs4.default.readFileSync("package.json", "utf-8"));
767
- const deps = pkgJson.dependencies || {};
768
- return Object.keys(deps).filter((d) => d.startsWith("@aristobyte-ui/")).map((dep) => dep.includes("react") ? "all" : dep.split("/")[1]);
769
- } catch {
770
- return [];
771
- }
772
- }
773
- async function checkNetwork2() {
774
- const url = "https://registry.npmjs.org/-/org/aristobyte-ui/package";
775
- try {
776
- const res = await fetch(url, { method: "HEAD" });
777
- return res.ok;
778
- } catch {
779
- return false;
780
- }
781
- }
782
- async function env(options) {
783
- const s = (0, import_prompts6.spinner)();
784
- try {
785
- s.start("Collecting environment diagnostics\u2026");
786
- console.log(
787
- `${import_picocolors8.default.green("\u25C7")} ${import_picocolors8.default.cyan("Environment Diagnostics")}
788
- ${import_picocolors8.default.gray("|")}`
789
- );
790
- const system = getSystemInfo();
791
- const pm = getPackageManagerInfo();
792
- const installed = options.packages || options.all || Object.keys(options).length === 0 ? getInstalledPackages() : [];
793
- const networkOnline = options.network || options.all || Object.keys(options).length === 0 ? await checkNetwork2() : void 0;
794
- const payload = {
795
- system,
796
- packageManager: pm,
797
- installedPackages: installed,
798
- network: networkOnline
799
- };
800
- if (options.json) {
801
- console.log(`${import_picocolors8.default.gray("|")}
802
- ${import_picocolors8.default.gray("\u25C7 ------ JSON file start ------ \u25C7")}
803
- ${JSON.stringify(payload, null, 2)}
804
- ${import_picocolors8.default.gray("\u25C7 ------ JSON file end ------ \u25C7")}
805
- ${import_picocolors8.default.gray("|")}`);
806
- }
807
- if (options.system || options.all || Object.keys(options).length === 0) {
808
- console.log(`${options.all || Object.keys(options).length === 0 ? "\n" : ""}${import_picocolors8.default.gray("|")}
809
- ${import_picocolors8.default.green("\u25C7")} ${import_picocolors8.default.cyan("System:")}
810
- ${import_picocolors8.default.gray("|")} ${import_picocolors8.default.white("OS:")} ${import_picocolors8.default.green(`${system.os}`)}
811
- ${import_picocolors8.default.gray("|")} ${import_picocolors8.default.white("CPU:")} ${import_picocolors8.default.green(`${system.cpu}`)}
812
- ${import_picocolors8.default.gray("|")} ${import_picocolors8.default.white("Memory:")} ${import_picocolors8.default.green(`${system.memoryMB} MB`)}
813
- ${import_picocolors8.default.gray("|")} ${import_picocolors8.default.white("Node:")} ${checkVersion("Node", system.node, MIN_VERSIONS2.node)}`);
814
- }
815
- if (options.pm || options.all || Object.keys(options).length === 0) {
816
- console.log(`${import_picocolors8.default.gray("|")}
817
- ${import_picocolors8.default.green("\u25C7")} ${import_picocolors8.default.cyan("Package Manager:")}
818
- ${import_picocolors8.default.gray("|")} ${import_picocolors8.default.white("Current:")} ${import_picocolors8.default.green(pm.packageManager)}
819
- ${import_picocolors8.default.gray("|")} ${import_picocolors8.default.white("Version:")} ${import_picocolors8.default.green(
820
- checkVersion(
821
- pm.packageManager,
822
- pm.version,
823
- MIN_VERSIONS2[pm.packageManager]
824
- )
825
- )}`);
826
- }
827
- if (options.packages || options.all || Object.keys(options).length === 0) {
828
- console.log(
829
- `${import_picocolors8.default.gray("|")}
830
- ${import_picocolors8.default.green("\u25C7")} ${import_picocolors8.default.cyan("Installed AristoByteUI Packages:")}`
831
- );
832
- if (!installed.length) {
833
- console.log(import_picocolors8.default.gray(" (none detected)"));
834
- } else {
835
- installed.forEach(
836
- (p) => console.log(
837
- `${import_picocolors8.default.gray("|")} ${import_picocolors8.default.green("-")} ${import_picocolors8.default.white(p)}`
838
- )
839
- );
840
- }
841
- }
842
- if (options.network || options.all || Object.keys(options).length === 0) {
843
- console.log(`${options.network ? "\n" : ""}${import_picocolors8.default.gray("|")}
844
- ${import_picocolors8.default.green("\u25C7")} ${import_picocolors8.default.cyan("Network:")}
845
- ${import_picocolors8.default.gray("|")} ${networkOnline ? `${import_picocolors8.default.green("\u2714")} ${import_picocolors8.default.white('Registry reachable"')}` : `${import_picocolors8.default.red("\xD7")} ${import_picocolors8.default.white("Registry unreachable")}`}`);
846
- }
847
- console.log(import_picocolors8.default.gray("|"));
848
- s.stop(import_picocolors8.default.green("\u2714 Environment diagnostics finished with success!"));
849
- } catch (err) {
850
- s.stop(import_picocolors8.default.red("\xD7 Environment diagnostics finished with failure :("));
851
- console.error(import_picocolors8.default.red("\xD7 Environment diagnostics failed"), err);
852
- }
853
- }
854
-
855
- // utils/colors.ts
856
- var import_chalk = __toESM(require("chalk"));
857
- var import_gradient_string = __toESM(require("gradient-string"));
858
- var LOGO_COLORS = ["#ffee27", "#fec800", "#f18e35", "#e95f32", "#e2312d"];
859
- function logo3(text4) {
860
- return import_chalk.default.hex(LOGO_COLORS[2])(text4);
861
- }
862
- function logo4(text4) {
863
- return import_chalk.default.hex(LOGO_COLORS[3])(text4);
864
- }
865
- function lightGrey(text4) {
866
- return import_chalk.default.hex("#afbfff")(text4);
867
- }
868
- function darkGrey(text4) {
869
- return import_chalk.default.hex("#7580aa")(text4);
870
- }
871
- function logoGradient(text4) {
872
- return (0, import_gradient_string.default)([
873
- ...LOGO_COLORS,
874
- ...LOGO_COLORS.reverse(),
875
- ...LOGO_COLORS,
876
- ...LOGO_COLORS.reverse(),
877
- ...LOGO_COLORS
878
- ]).multiline(text4);
879
- }
880
- function logoSmallGradient(text4) {
881
- return (0, import_gradient_string.default)([
882
- LOGO_COLORS[0],
883
- LOGO_COLORS[1],
884
- LOGO_COLORS[1],
885
- LOGO_COLORS[0],
886
- LOGO_COLORS[0],
887
- LOGO_COLORS[1]
888
- ]).multiline(text4);
889
- }
890
-
891
- // utils/typography.ts
892
- function usage(params) {
893
- return params.map((param) => `${logo4("[")} ${lightGrey(param)} ${logo4("]")}`).join(" ");
894
- }
895
- function description(text4) {
896
- return darkGrey(`- ${text4}`);
897
- }
898
-
899
- // utils/getBanner.ts
900
- var mainBanner = ` \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588
901
- \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2591 \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588
902
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588
903
- \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591 \u2591\u2591\u2591\u2588\u2588\u2588\u2591 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2591\u2588\u2588\u2588\u2591 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588
904
- \u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2591 \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588
905
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2588\u2588\u2588\u2591\u2591\u2591
906
- \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588
907
- \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591
908
- \u2588\u2588\u2588 \u2591\u2588\u2588\u2588
909
- \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588
910
- \u2591\u2591\u2591\u2591\u2591\u2591 `;
911
- var initBanner = ` \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588
912
- \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2591 \u2591\u2591\u2588\u2588\u2588
913
- \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588
914
- \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2591\u2588\u2588\u2588\u2591
915
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588
916
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588
917
- \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588
918
- \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 `;
919
- var addBanner = ` \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588
920
- \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588
921
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588
922
- \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588
923
- \u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588
924
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588
925
- \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588
926
- \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 `;
927
- var removeBanner = ` \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588
928
- \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588
929
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588
930
- \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588
931
- \u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588
932
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2591 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2591
933
- \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588
934
- \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 `;
935
- var doctorBanner = ` \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588
936
- \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588
937
- \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588
938
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2588\u2588\u2588\u2591 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588
939
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2591\u2591\u2591 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2591
940
- \u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588
941
- \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588
942
- \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 `;
943
- var envBanner = ` \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588
944
- \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588
945
- \u2591\u2588\u2588\u2588 \u2588 \u2591 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588
946
- \u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588
947
- \u2591\u2588\u2588\u2588\u2591\u2591\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588
948
- \u2591\u2588\u2588\u2588 \u2591 \u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588
949
- \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588
950
- \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 `;
951
- var listBanner = ` \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588
952
- \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2591 \u2591\u2591\u2588\u2588\u2588
953
- \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588
954
- \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591 \u2591\u2591\u2591\u2588\u2588\u2588\u2591
955
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588
956
- \u2591\u2588\u2588\u2588 \u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588
957
- \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588
958
- \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 `;
959
- var upgradeBanner = ` \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588
960
- \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588
961
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588
962
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588
963
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2591 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588
964
- \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2591
965
- \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588
966
- \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2588\u2588\u2588\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591
967
- \u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588
968
- \u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588
969
- \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 `;
970
- function getBanner(id) {
971
- switch (id) {
972
- case "add":
973
- return logoGradient(addBanner);
974
- case "doctor":
975
- return logoGradient(doctorBanner);
976
- case "env":
977
- return logoGradient(envBanner);
978
- case "init":
979
- return logoGradient(initBanner);
980
- case "list":
981
- return logoGradient(listBanner);
982
- case "remove":
983
- return logoGradient(removeBanner);
984
- case "upgrade":
985
- return logoGradient(upgradeBanner);
986
- case "aristobyte-ui":
987
- default:
988
- return logoGradient(mainBanner);
989
- }
990
- }
991
-
992
- // utils/getTip.ts
993
- function getTip(id) {
994
- switch (id) {
995
- case "init":
996
- return "Run 'aristobyte-ui init' or 'aristobyte-ui init [ myProject ] --template <templateName> --package-manager <packageManagerName>' to bootstrap a new project quickly.\n Use interactive prompts to customize or provide flags for automation.";
997
- case "add":
998
- return "Use 'aristobyte-ui add [ component ]' to install a specific UI component.\n Combine multiple components for faster setup.";
999
- case "remove":
1000
- return "Run 'aristobyte-ui remove [ component ]' to cleanly uninstall components.\n Useful for maintaining a lightweight project.";
1001
- case "upgrade":
1002
- return "Use 'aristobyte-ui upgrade [ component ]' to update components or core packages.\n Add '--all' to upgrade everything at once.";
1003
- case "list":
1004
- return "Run 'aristobyte-ui list' to view installed components and versions.\n Add '--outdated' to check for available updates.";
1005
- case "doctor":
1006
- return "Execute 'aristobyte-ui doctor' to analyze your setup.\n Fixes and recommendations will be displayed for common issues.";
1007
- case "env":
1008
- return "Run 'aristobyte-ui env' to inspect your development environment.\n Helpful for debugging version or configuration conflicts.";
1009
- case "aristobyte-ui":
1010
- default:
1011
- return "Use 'aristobyte-ui [ command ] --help' for detailed info on a command.";
1012
- }
1013
- }
1014
-
1015
- // utils/getDescription.ts
1016
- function getDescription(id) {
1017
- switch (id) {
1018
- case "init":
1019
- return "Initialize a new AristoByteUI project from pre-configured templates.\n Supports automatic project setup, template selection, and package manager configuration.";
1020
- case "add":
1021
- return "Add new UI components to your existing AristoByteUI project.\n Handles component installation, configuration, and dependency management.";
1022
- case "remove":
1023
- return "Remove installed AristoByteUI components cleanly from your project.\n Ensures proper cleanup of related files and dependencies.";
1024
- case "upgrade":
1025
- return "Upgrade AristoByteUI components or core packages to their latest versions.\n Supports selective or full project upgrades.";
1026
- case "list":
1027
- return "List all installed AristoByteUI components in your project.\n Displays version, status, and available updates for each component.";
1028
- case "doctor":
1029
- return "Run a system and project health check.\n Detects configuration issues, missing dependencies, and environment mismatches.";
1030
- case "env":
1031
- return "Display detailed environment information.\n Includes Node.js version, package manager details, and AristoByteUI configuration paths.";
1032
- case "aristobyte-ui":
1033
- default:
1034
- return "Create new AristoByteUI projects or manage existing projects with full control\n over components, dependencies, and UI stack configuration. Supports initialization,\n addition, removal, upgrading of components, and project diagnostics.";
1035
- }
1036
- }
1037
-
1038
- // utils/parseHelp.ts
1039
- function parseHelp(cmd, helper) {
1040
- return `
1041
- ${getBanner(cmd.name())}
1042
-
1043
- ${logoSmallGradient("Usage:")}
1044
- ${logo3(helper.commandUsage(cmd))}
1045
-
1046
- ${logoSmallGradient("Description:")}
1047
- ${darkGrey(getDescription(cmd.name()))}
1048
-
1049
- ${helper.visibleCommands(cmd).length > 0 ? `${logoSmallGradient("Commands:")}
1050
- ${helper.visibleCommands(cmd).map(
1051
- (c) => ` ${`${logo3(c.name()).padEnd(31)} ${c.usage() || "".padEnd(30)}`.padEnd(129)} ${description(c.description())}`
1052
- ).join("\n")}
1053
-
1054
- ` : ""}${helper.visibleOptions(cmd).length > 0 ? `${logoSmallGradient("Options:")}
1055
- ${helper.visibleOptions(cmd).map(
1056
- (option) => ` ${`${logo3(option.flags.split(/,\s*/)[0])}${darkGrey(", ")}${logo4(option.flags.split(/,\s*/)[1])}`.padEnd(93)} ${description(option.description)}`
1057
- ).join("\n")}
1058
-
1059
- ` : ""}${logoSmallGradient("Tip:")}
1060
- ${lightGrey(getTip(cmd.name()))}
1061
- `;
1062
- }
1063
-
1064
- // package.json
1065
- var package_default = {
1066
- name: "@aristobyte-ui/cli",
1067
- description: "The official AristoByteUI CLI \u2014 initialize projects, install, upgrade, remove, and manage UI components seamlessly.",
1068
- version: "1.0.112",
1069
- license: "MIT",
1070
- private: false,
1071
- author: "AristoByte <info@aristobyte.com>",
1072
- homepage: "https://www.npmjs.com/package/@aristobyte-ui/cli",
1073
- repository: {
1074
- type: "git",
1075
- url: "git+https://github.com/aristobyte-team/aristobyte-ui.git",
1076
- directory: "./"
1077
- },
1078
- bugs: {
1079
- url: "https://github.com/aristobyte-team/aristobyte-ui.git/issues"
1080
- },
1081
- engines: {
1082
- node: ">=20.17.0",
1083
- npm: ">=10.8.2",
1084
- yarn: ">=1.22.22"
1085
- },
1086
- keywords: [
1087
- "aristobyte",
1088
- "cli",
1089
- "ui",
1090
- "components",
1091
- "typescript",
1092
- "node",
1093
- "developer-tools",
1094
- "project-bootstrap",
1095
- "package-management"
1096
- ],
1097
- files: [
1098
- "dist"
1099
- ],
1100
- publishConfig: {
1101
- access: "public"
1102
- },
1103
- main: "dist/index.js",
1104
- module: "dist/index.mjs",
1105
- bin: {
1106
- "aristobyte-ui": "dist/index.js"
1107
- },
1108
- exports: {
1109
- ".": {
1110
- import: "./dist/index.mjs",
1111
- require: "./dist/index.js"
1112
- }
1113
- },
1114
- scripts: {
1115
- build: "tsup",
1116
- "build:watch": "tsup ./index.ts --watch",
1117
- dev: "tsup && node ./bin/aristobyte-ui.js",
1118
- start: "node ./bin/aristobyte-ui.js",
1119
- lint: "eslint . --ext .ts,.tsx --max-warnings 0",
1120
- "lint:fix": "eslint . --ext .ts,.tsx --fix",
1121
- "check-types": "tsc --noEmit"
1122
- },
1123
- dependencies: {
1124
- "@aristobyte-ui/eslint-config": "^1.0.112",
1125
- "@aristobyte-ui/typescript-config": "^1.0.112",
1126
- "@clack/prompts": "^0.11.0",
1127
- axios: "^1.6.0",
1128
- chalk: "^5.6.1",
1129
- commander: "^11.0.0",
1130
- execa: "^8.0.0",
1131
- "gradient-string": "^3.0.0"
1132
- },
1133
- devDependencies: {
1134
- "@changesets/changelog-github": "^0.5.1",
1135
- "@changesets/cli": "^2.29.6",
1136
- "@types/node": "^24.3.1",
1137
- eslint: "^9.35.0",
1138
- "ts-node": "^10.9.2",
1139
- tsup: "^8.5.0",
1140
- typescript: "^5.9.2"
1141
- }
1142
- };
1143
-
1144
- // index.ts
1145
- var COMMANDS = [
1146
- "init",
1147
- "add",
1148
- "remove",
1149
- "upgrade",
1150
- "list",
1151
- "doctor",
1152
- "env",
1153
- "help"
1154
- ];
1155
- var aristobyteui = new import_commander.Command();
1156
- aristobyteui.name("aristobyte-ui").usage(usage(["command", "options"])).description(
1157
- "Create new AristoByteUI projects or manage existing projects with full control\n over components, dependencies, and UI stack configuration. Supports initialization,\n addition, removal, upgrading of components, and project diagnostics."
1158
- ).version(package_default.version, "-V, --version", "Output the CLI version").helpOption("-H, --help", "Show help information").configureHelp({
1159
- formatHelp: (cmd, helper) => parseHelp(cmd, helper)
1160
- });
1161
- aristobyteui.command("init [myProjectName]").usage(usage(["options", "myProjectName"])).description("Initialize a new AristoByteUI project").option("-LT, --list-templates", "Display a list of available templates").option(
1162
- "-LPM, --list-package-managers",
1163
- "Display a list of available package managers"
1164
- ).option("-T, --template <templateName>", "Specify a template to use").option(
1165
- "-P, --package-manager <packageManager>",
1166
- "Select a package manager (npm, yarn, pnpm, bun)"
1167
- ).configureHelp({
1168
- formatHelp: (cmd, helper) => parseHelp(cmd, helper)
1169
- }).action(init);
1170
- aristobyteui.command("add [component]").usage(usage(["options", "components..."])).description("Add a UI component").option("-L, --list", "Display a list of available packages, to be added").option(
1171
- "-P, --package-manager",
1172
- "Show the package manager used in current project"
1173
- ).configureHelp({
1174
- formatHelp: (cmd, helper) => parseHelp(cmd, helper)
1175
- }).action(add);
1176
- aristobyteui.command("remove [component]").usage(usage(["options", "components..."])).description("Remove a UI component").option("-L, --list", "Display a list of installed packages, to be removed").option(
1177
- "-P, --package-manager",
1178
- "Show the package manager used in current project"
1179
- ).configureHelp({
1180
- formatHelp: (cmd, helper) => parseHelp(cmd, helper)
1181
- }).action(remove);
1182
- aristobyteui.command("upgrade [component]").usage(usage(["options", "components..."])).description("Upgrade a UI component").option("-A, --all", "Upgrade all AristoByteUI components").option("-T, --to <version>", "Upgrade to a specific version").configureHelp({
1183
- formatHelp: (cmd, helper) => parseHelp(cmd, helper)
1184
- }).action(upgrade);
1185
- aristobyteui.command("list").usage(usage(["options"])).description("List installed components").option("-A, --all", "Display the list of all packages").option("-I, --installed", "Display the list of installed packages").option("-O, --outdated", "Check for available updates").configureHelp({
1186
- formatHelp: (cmd, helper) => parseHelp(cmd, helper)
1187
- }).action((options) => list(options, true));
1188
- aristobyteui.command("doctor").usage(usage(["options"])).description("Check system and project health").option("-A, --all", "Run all diagnostics").option("-C, --configs", "Validate project config files").option("-D, --deps", "Validate installed AristoByteUI dependencies").option("-J, --json", "Output diagnostics as JSON").option("-N, --network", "Verify registry/network connectivity").option("-P, --pm", "Check package manager state").option("-S, --system", "Check system environment").configureHelp({
1189
- formatHelp: (cmd, helper) => parseHelp(cmd, helper)
1190
- }).action(doctor);
1191
- aristobyteui.command("env").usage(usage(["options"])).description("Display environment info").option("-A, --all", "Display all environment diagnostics").option("-J, --json", "Output environment info as JSON").option("-M, --pm", "Show package manager details").option("-N, --network", "Check registry/network connectivity").option("-P, --packages", "Show installed AristoByteUI packages").option("-S, --system", "Show system information").configureHelp({
1192
- formatHelp: (cmd, helper) => parseHelp(cmd, helper)
1193
- }).action(env);
1194
- aristobyteui.command("help").usage(usage(["options"])).description("Display help for command").action(env);
1195
- aristobyteui.command("help", { hidden: true });
1196
- aristobyteui.exitOverride(async (err) => {
1197
- if (err.code === "commander.unknownCommand") {
1198
- console.error(
1199
- logoSmallGradient(" \u25C6 Possible commands are: \n"),
1200
- ...COMMANDS.map(
1201
- (cmd) => cmd === err.message.split("Did you mean ")[1].split("?")[0] ? `${logoSmallGradient("\u2502 ")}${logo4("\u25CF aristobyte-ui")} ${logo4(`${cmd}`)}
1202
- ` : `${logoSmallGradient("\u2502 \u25CB aristobyte-ui")} ${logo3(`${cmd}`)}
1203
- `
1204
- )
1205
- );
1206
- }
1207
- process.exit(1);
1208
- });
1209
- (async () => {
1210
- const args = process.argv.slice(2);
1211
- if (args.length === 0) {
1212
- aristobyteui.outputHelp();
1213
- process.exit(0);
1214
- }
1215
- try {
1216
- await aristobyteui.parseAsync(args, { from: "user" });
1217
- } catch (err) {
1218
- console.error(darkGrey("Error:"), lightGrey(err.message));
1219
- process.exit(1);
1220
- }
1221
- })();
1222
- //# sourceMappingURL=index.js.map