@aristobyte-ui/cli 2.5.1 → 2.6.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 (112) hide show
  1. package/README.md +11 -0
  2. package/package.json +4 -4
  3. package/es/package.json +0 -60
  4. package/es/src/main/commands/add.d.ts +0 -2
  5. package/es/src/main/commands/add.d.ts.map +0 -1
  6. package/es/src/main/commands/add.js +0 -106
  7. package/es/src/main/commands/doctor.d.ts +0 -2
  8. package/es/src/main/commands/doctor.d.ts.map +0 -1
  9. package/es/src/main/commands/doctor.js +0 -166
  10. package/es/src/main/commands/env.d.ts +0 -2
  11. package/es/src/main/commands/env.d.ts.map +0 -1
  12. package/es/src/main/commands/env.js +0 -175
  13. package/es/src/main/commands/init.d.ts +0 -2
  14. package/es/src/main/commands/init.d.ts.map +0 -1
  15. package/es/src/main/commands/init.js +0 -180
  16. package/es/src/main/commands/list.d.ts +0 -3
  17. package/es/src/main/commands/list.d.ts.map +0 -1
  18. package/es/src/main/commands/list.js +0 -195
  19. package/es/src/main/commands/remove.d.ts +0 -2
  20. package/es/src/main/commands/remove.d.ts.map +0 -1
  21. package/es/src/main/commands/remove.js +0 -100
  22. package/es/src/main/commands/upgrade.d.ts +0 -2
  23. package/es/src/main/commands/upgrade.d.ts.map +0 -1
  24. package/es/src/main/commands/upgrade.js +0 -122
  25. package/es/src/main/index.d.ts +0 -3
  26. package/es/src/main/index.d.ts.map +0 -1
  27. package/es/src/main/index.js +0 -212
  28. package/es/src/main/utils/checkVersion.d.ts +0 -2
  29. package/es/src/main/utils/checkVersion.d.ts.map +0 -1
  30. package/es/src/main/utils/checkVersion.js +0 -8
  31. package/es/src/main/utils/colors.d.ts +0 -15
  32. package/es/src/main/utils/colors.d.ts.map +0 -1
  33. package/es/src/main/utils/colors.js +0 -77
  34. package/es/src/main/utils/compareVersions.d.ts +0 -2
  35. package/es/src/main/utils/compareVersions.d.ts.map +0 -1
  36. package/es/src/main/utils/compareVersions.js +0 -11
  37. package/es/src/main/utils/getBanner.d.ts +0 -2
  38. package/es/src/main/utils/getBanner.d.ts.map +0 -1
  39. package/es/src/main/utils/getBanner.js +0 -30
  40. package/es/src/main/utils/getCurrentPackageManager.d.ts +0 -3
  41. package/es/src/main/utils/getCurrentPackageManager.d.ts.map +0 -1
  42. package/es/src/main/utils/getCurrentPackageManager.js +0 -55
  43. package/es/src/main/utils/getDescription.d.ts +0 -2
  44. package/es/src/main/utils/getDescription.d.ts.map +0 -1
  45. package/es/src/main/utils/getDescription.js +0 -21
  46. package/es/src/main/utils/getTip.d.ts +0 -2
  47. package/es/src/main/utils/getTip.d.ts.map +0 -1
  48. package/es/src/main/utils/getTip.js +0 -21
  49. package/es/src/main/utils/installPackage.d.ts +0 -2
  50. package/es/src/main/utils/installPackage.d.ts.map +0 -1
  51. package/es/src/main/utils/installPackage.js +0 -75
  52. package/es/src/main/utils/parseHelp.d.ts +0 -3
  53. package/es/src/main/utils/parseHelp.d.ts.map +0 -1
  54. package/es/src/main/utils/parseHelp.js +0 -22
  55. package/es/src/main/utils/typography.d.ts +0 -3
  56. package/es/src/main/utils/typography.d.ts.map +0 -1
  57. package/es/src/main/utils/typography.js +0 -9
  58. package/lib/package.json +0 -60
  59. package/lib/src/main/commands/add.d.ts +0 -2
  60. package/lib/src/main/commands/add.d.ts.map +0 -1
  61. package/lib/src/main/commands/add.js +0 -112
  62. package/lib/src/main/commands/doctor.d.ts +0 -2
  63. package/lib/src/main/commands/doctor.d.ts.map +0 -1
  64. package/lib/src/main/commands/doctor.js +0 -172
  65. package/lib/src/main/commands/env.d.ts +0 -2
  66. package/lib/src/main/commands/env.d.ts.map +0 -1
  67. package/lib/src/main/commands/env.js +0 -181
  68. package/lib/src/main/commands/init.d.ts +0 -2
  69. package/lib/src/main/commands/init.d.ts.map +0 -1
  70. package/lib/src/main/commands/init.js +0 -186
  71. package/lib/src/main/commands/list.d.ts +0 -3
  72. package/lib/src/main/commands/list.d.ts.map +0 -1
  73. package/lib/src/main/commands/list.js +0 -202
  74. package/lib/src/main/commands/remove.d.ts +0 -2
  75. package/lib/src/main/commands/remove.d.ts.map +0 -1
  76. package/lib/src/main/commands/remove.js +0 -106
  77. package/lib/src/main/commands/upgrade.d.ts +0 -2
  78. package/lib/src/main/commands/upgrade.d.ts.map +0 -1
  79. package/lib/src/main/commands/upgrade.js +0 -128
  80. package/lib/src/main/index.d.ts +0 -3
  81. package/lib/src/main/index.d.ts.map +0 -1
  82. package/lib/src/main/index.js +0 -217
  83. package/lib/src/main/utils/checkVersion.d.ts +0 -2
  84. package/lib/src/main/utils/checkVersion.d.ts.map +0 -1
  85. package/lib/src/main/utils/checkVersion.js +0 -14
  86. package/lib/src/main/utils/colors.d.ts +0 -15
  87. package/lib/src/main/utils/colors.d.ts.map +0 -1
  88. package/lib/src/main/utils/colors.js +0 -96
  89. package/lib/src/main/utils/compareVersions.d.ts +0 -2
  90. package/lib/src/main/utils/compareVersions.d.ts.map +0 -1
  91. package/lib/src/main/utils/compareVersions.js +0 -14
  92. package/lib/src/main/utils/getBanner.d.ts +0 -2
  93. package/lib/src/main/utils/getBanner.d.ts.map +0 -1
  94. package/lib/src/main/utils/getBanner.js +0 -33
  95. package/lib/src/main/utils/getCurrentPackageManager.d.ts +0 -3
  96. package/lib/src/main/utils/getCurrentPackageManager.d.ts.map +0 -1
  97. package/lib/src/main/utils/getCurrentPackageManager.js +0 -61
  98. package/lib/src/main/utils/getDescription.d.ts +0 -2
  99. package/lib/src/main/utils/getDescription.d.ts.map +0 -1
  100. package/lib/src/main/utils/getDescription.js +0 -24
  101. package/lib/src/main/utils/getTip.d.ts +0 -2
  102. package/lib/src/main/utils/getTip.d.ts.map +0 -1
  103. package/lib/src/main/utils/getTip.js +0 -24
  104. package/lib/src/main/utils/installPackage.d.ts +0 -2
  105. package/lib/src/main/utils/installPackage.d.ts.map +0 -1
  106. package/lib/src/main/utils/installPackage.js +0 -78
  107. package/lib/src/main/utils/parseHelp.d.ts +0 -3
  108. package/lib/src/main/utils/parseHelp.d.ts.map +0 -1
  109. package/lib/src/main/utils/parseHelp.js +0 -25
  110. package/lib/src/main/utils/typography.d.ts +0 -3
  111. package/lib/src/main/utils/typography.d.ts.map +0 -1
  112. package/lib/src/main/utils/typography.js +0 -13
@@ -1,22 +0,0 @@
1
- import { logoSmallGradient, logo3, logo4, darkGrey, lightGrey } from "./colors";
2
- import { description } from "./typography";
3
- import { getBanner } from "./getBanner";
4
- import { getTip } from "./getTip";
5
- import { getDescription } from "./getDescription";
6
- export function parseHelp(cmd, helper) {
7
- return "\n".concat(getBanner(cmd.name()), "\n\n").concat(logoSmallGradient("Usage:"), " \n").concat(logo3(helper.commandUsage(cmd)), "\n\n").concat(logoSmallGradient("Description:"), "\n ").concat(darkGrey(getDescription(cmd.name())), "\n\n").concat(helper.visibleCommands(cmd).length > 0
8
- ? "".concat(logoSmallGradient("Commands:"), "\n").concat(helper
9
- .visibleCommands(cmd)
10
- .map(function (c) {
11
- return " ".concat("".concat(logo3(c.name()).padEnd(31), " ").concat(c.usage() || "".padEnd(30)).padEnd(129), " ").concat(description(c.description()));
12
- })
13
- .join("\n"), "\n\n")
14
- : "").concat(helper.visibleOptions(cmd).length > 0
15
- ? "".concat(logoSmallGradient("Options:"), "\n").concat(helper
16
- .visibleOptions(cmd)
17
- .map(function (option) {
18
- return " ".concat("".concat(logo3(option.flags.split(/,\s*/)[0])).concat(darkGrey(", ")).concat(logo4(option.flags.split(/,\s*/)[1])).padEnd(93), " ").concat(description(option.description));
19
- })
20
- .join("\n"), "\n\n")
21
- : "").concat(logoSmallGradient("Tip:"), "\n ").concat(lightGrey(getTip(cmd.name())), "\n");
22
- }
@@ -1,3 +0,0 @@
1
- export declare function usage(params: string[]): string;
2
- export declare function description(text: string): string;
3
- //# sourceMappingURL=typography.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/main/utils/typography.ts"],"names":[],"mappings":"AAEA,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,UAIrC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,UAEvC"}
@@ -1,9 +0,0 @@
1
- import { logo4, darkGrey, lightGrey } from "./colors";
2
- export function usage(params) {
3
- return params
4
- .map(function (param) { return "".concat(logo4("["), " ").concat(lightGrey(param), " ").concat(logo4("]")); })
5
- .join(" ");
6
- }
7
- export function description(text) {
8
- return darkGrey("- ".concat(text));
9
- }
package/lib/package.json DELETED
@@ -1,60 +0,0 @@
1
- {
2
- "name": "@aristobyte-ui/cli",
3
- "description": "The official AristoByteUI CLI — initialize projects, install, upgrade, remove, and manage UI components seamlessly.",
4
- "version": "2.5.1",
5
- "license": "MIT",
6
- "private": false,
7
- "author": "AristoByte <info@aristobyte.com>",
8
- "homepage": "https://www.npmjs.com/package/@aristobyte-ui/cli",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/aristobyte-team/aristobyte-ui.git",
12
- "directory": "packages/cli"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/aristobyte-team/aristobyte-ui.git/issues"
16
- },
17
- "engines": {
18
- "node": ">=20.17.0",
19
- "npm": ">=10.8.2",
20
- "yarn": ">=1.22.22"
21
- },
22
- "keywords": [
23
- "aristobyte",
24
- "cli",
25
- "ui",
26
- "components",
27
- "typescript",
28
- "node",
29
- "developer-tools",
30
- "project-bootstrap",
31
- "package-management"
32
- ],
33
- "files": [
34
- "es",
35
- "lib",
36
- "bin"
37
- ],
38
- "publishConfig": {
39
- "access": "public"
40
- },
41
- "main": "lib/src/main/index.js",
42
- "module": "es/src/main/index.js",
43
- "types": "es/src/main/index.d.ts",
44
- "bin": {
45
- "aristobyte-ui": "dist/index.js"
46
- },
47
- "peerDependencies": {
48
- "react": "^19.1.0",
49
- "react-dom": "^19.1.0",
50
- "sass": "^1.97.3"
51
- },
52
- "dependencies": {
53
- "@clack/prompts": "^0.11.0",
54
- "axios": "^1.6.0",
55
- "chalk": "^4.1.2",
56
- "commander": "^10",
57
- "execa": "^7",
58
- "gradient-string": "^3.0.0"
59
- }
60
- }
@@ -1,2 +0,0 @@
1
- export declare function add(component: string, options: Record<string, any>): Promise<void>;
2
- //# sourceMappingURL=add.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/main/commands/add.ts"],"names":[],"mappings":"AAQA,wBAAsB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBAiDxE"}
@@ -1,112 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.add = add;
43
- var prompts_1 = require("@clack/prompts");
44
- var getCurrentPackageManager_1 = require("../utils/getCurrentPackageManager");
45
- var picocolors_1 = __importDefault(require("picocolors"));
46
- var installPackage_1 = require("../utils/installPackage");
47
- var list_1 = require("./list");
48
- var DEFAULT_PACKAGE = 'all';
49
- function add(component, options) {
50
- return __awaiter(this, void 0, void 0, function () {
51
- var pkgManager, s, packageName, pkgManager_1, pkgName, err_1;
52
- return __generator(this, function (_a) {
53
- switch (_a.label) {
54
- case 0:
55
- if (!options.list) return [3, 2];
56
- return [4, (0, list_1.list)({ all: true }, true)];
57
- case 1:
58
- _a.sent();
59
- _a.label = 2;
60
- case 2:
61
- pkgManager = (0, getCurrentPackageManager_1.getCurrentPackageManager)();
62
- if (options.packageManager) {
63
- console.log("".concat(picocolors_1.default.cyan('Current package manager:'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(pkgManager));
64
- process.exit(0);
65
- }
66
- s = (0, prompts_1.spinner)();
67
- packageName = DEFAULT_PACKAGE;
68
- if (!!component) return [3, 5];
69
- console.log("".concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.white('You did not specify, which package should be added'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.gray('Please select one of the packages below listed to proceed.'), "\n").concat(picocolors_1.default.gray('|')));
70
- return [4, (0, list_1.list)({ all: true })];
71
- case 3:
72
- _a.sent();
73
- return [4, (0, prompts_1.text)({
74
- message: 'Component name to add (Enter to install all components)',
75
- placeholder: DEFAULT_PACKAGE,
76
- defaultValue: DEFAULT_PACKAGE,
77
- })];
78
- case 4:
79
- packageName = (_a.sent());
80
- return [3, 6];
81
- case 5:
82
- packageName = component;
83
- _a.label = 6;
84
- case 6:
85
- _a.trys.push([6, 10, , 11]);
86
- s.start("Installing ".concat(packageName, "..."));
87
- pkgManager_1 = (0, getCurrentPackageManager_1.getCurrentPackageManager)();
88
- if (!(packageName === 'all')) return [3, 8];
89
- return [4, (0, installPackage_1.installPackage)(pkgManager_1, '@aristobyte-ui/react')];
90
- case 7:
91
- _a.sent();
92
- s.stop();
93
- console.log(picocolors_1.default.green('✔ All components installed!'));
94
- return [2];
95
- case 8:
96
- pkgName = "@aristobyte-ui/".concat(packageName);
97
- return [4, (0, installPackage_1.installPackage)(pkgManager_1, pkgName)];
98
- case 9:
99
- _a.sent();
100
- s.stop();
101
- console.log(picocolors_1.default.green("\u2714 Component ".concat(packageName, " installed!")));
102
- return [3, 11];
103
- case 10:
104
- err_1 = _a.sent();
105
- s.stop();
106
- console.error(picocolors_1.default.red("\u00D7 Failed to install package ".concat(packageName)), err_1);
107
- return [3, 11];
108
- case 11: return [2];
109
- }
110
- });
111
- });
112
- }
@@ -1,2 +0,0 @@
1
- export declare function doctor(options: Record<string, any>): Promise<void>;
2
- //# sourceMappingURL=doctor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/main/commands/doctor.ts"],"names":[],"mappings":"AAmDA,wBAAsB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBA+ExD"}
@@ -1,172 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.doctor = doctor;
43
- var fs_1 = __importDefault(require("fs"));
44
- var path_1 = __importDefault(require("path"));
45
- var os_1 = __importDefault(require("os"));
46
- var child_process_1 = require("child_process");
47
- var prompts_1 = require("@clack/prompts");
48
- var picocolors_1 = __importDefault(require("picocolors"));
49
- var checkVersion_1 = require("../utils/checkVersion");
50
- var getCurrentPackageManager_1 = require("../utils/getCurrentPackageManager");
51
- var MIN_VERSIONS = {
52
- node: '20.19.0',
53
- pnpm: '10.15.1',
54
- npm: '10.8.2',
55
- yarn: '1.22.22',
56
- bun: '1.2.21',
57
- };
58
- function getVersion(command, name) {
59
- try {
60
- return (0, child_process_1.execSync)(command).toString().trim();
61
- }
62
- catch (err) {
63
- console.error(picocolors_1.default.red("\u00D7 Failed to detect ".concat(name, " version:")), err);
64
- return 'unknown';
65
- }
66
- }
67
- function hasProjectPackage(name) {
68
- try {
69
- var pkgJson = JSON.parse(fs_1.default.readFileSync('package.json', 'utf-8'));
70
- return ((pkgJson.dependencies && pkgJson.dependencies[name]) || (pkgJson.devDependencies && pkgJson.devDependencies[name]));
71
- }
72
- catch (_a) {
73
- return false;
74
- }
75
- }
76
- function detectUISetup() {
77
- var configPaths = ['tailwind.config.js', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.ts'];
78
- return configPaths.filter(function (p) { return fs_1.default.existsSync(path_1.default.resolve(p)); });
79
- }
80
- function checkNetwork() {
81
- return __awaiter(this, void 0, void 0, function () {
82
- var res, _a;
83
- return __generator(this, function (_b) {
84
- switch (_b.label) {
85
- case 0:
86
- _b.trys.push([0, 2, , 3]);
87
- return [4, fetch('https://registry.npmjs.org/-/org/aristobyte-ui/package', { method: 'HEAD' })];
88
- case 1:
89
- res = _b.sent();
90
- return [2, res.ok];
91
- case 2:
92
- _a = _b.sent();
93
- return [2, false];
94
- case 3: return [2];
95
- }
96
- });
97
- });
98
- }
99
- function doctor(options) {
100
- return __awaiter(this, void 0, void 0, function () {
101
- var s, system, pkgManager, pmVersion, uiInstalled, pluginInstalled, configs, networkOnline, payload, err_1;
102
- return __generator(this, function (_a) {
103
- switch (_a.label) {
104
- case 0:
105
- s = (0, prompts_1.spinner)();
106
- _a.label = 1;
107
- case 1:
108
- _a.trys.push([1, 4, , 5]);
109
- s.start('Running doctor diagnostics…');
110
- console.log("".concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Doctor Diagnostics'), "\n").concat(picocolors_1.default.gray('|')));
111
- system = {
112
- os: "".concat(os_1.default.type(), " ").concat(os_1.default.release(), " (").concat(os_1.default.platform(), ")"),
113
- cpu: os_1.default.cpus()[0].model,
114
- memoryMB: Math.round(os_1.default.totalmem() / 1024 / 1024),
115
- node: getVersion('node -v', 'Node'),
116
- };
117
- pkgManager = (0, getCurrentPackageManager_1.getCurrentPackageManager)();
118
- pmVersion = getVersion("".concat(pkgManager, " -v"), pkgManager);
119
- uiInstalled = hasProjectPackage('@aristobyte-ui/react');
120
- pluginInstalled = hasProjectPackage('@aristobyte-ui/plugin');
121
- configs = detectUISetup();
122
- networkOnline = void 0;
123
- if (!(options.network || options.all || Object.keys(options).length === 0)) return [3, 3];
124
- return [4, checkNetwork()];
125
- case 2:
126
- networkOnline = _a.sent();
127
- _a.label = 3;
128
- case 3:
129
- payload = {
130
- system: system,
131
- packageManager: { name: pkgManager, version: pmVersion },
132
- installedPackages: { ui: uiInstalled, plugin: pluginInstalled },
133
- configs: configs,
134
- network: networkOnline,
135
- };
136
- if (options.json) {
137
- console.log("".concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.gray('◇ ------ JSON start ------ ◇'), "\n").concat(JSON.stringify(payload, null, 2), "\n").concat(picocolors_1.default.gray('◇ ------ JSON end ------ ◇'), "\n").concat(picocolors_1.default.gray('|')));
138
- }
139
- if (options.system || options.all || Object.keys(options).length === 0) {
140
- console.log("".concat(options.system ? '' : '\n').concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('System:'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('OS:'), " ").concat(picocolors_1.default.green(system.os), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('CPU:'), " ").concat(picocolors_1.default.green(system.cpu), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('Memory:'), " ").concat(picocolors_1.default.green("".concat(system.memoryMB, " MB")), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('Node:'), " ").concat((0, checkVersion_1.checkVersion)('Node', system.node, MIN_VERSIONS.node)));
141
- }
142
- if (options.pm || options.all || Object.keys(options).length === 0) {
143
- console.log("".concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Package Manager:'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('Current:'), " ").concat(picocolors_1.default.green(pkgManager), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('Version:'), " ").concat((0, checkVersion_1.checkVersion)(pkgManager, pmVersion, MIN_VERSIONS[pkgManager])));
144
- }
145
- if (options.deps || options.all || Object.keys(options).length === 0) {
146
- console.log("".concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Project Dependencies:'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('@aristobyte-ui/react:'), " ").concat(uiInstalled ? picocolors_1.default.green('✔ Installed') : picocolors_1.default.red('× Missing'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('@aristobyte-ui/plugin:'), " ").concat(pluginInstalled ? picocolors_1.default.green('✔ Installed') : picocolors_1.default.red('× Missing')));
147
- }
148
- if (options.configs || options.all || Object.keys(options).length === 0) {
149
- console.log("".concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Config Files:')));
150
- if (!configs.length) {
151
- console.log("".concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.red('× No config files detected')));
152
- }
153
- else {
154
- configs.forEach(function (cfg) { return console.log("".concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.green('✔'), " ").concat(picocolors_1.default.white(cfg))); });
155
- }
156
- }
157
- if ((options.network || options.all || Object.keys(options).length === 0) && networkOnline !== undefined) {
158
- console.log("".concat(options.network ? '\n' : '').concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Network:'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(networkOnline ? "".concat(picocolors_1.default.green('✔'), " ").concat(picocolors_1.default.white('Registry reachable')) : "".concat(picocolors_1.default.red('×'), " ").concat(picocolors_1.default.white('Registry unreachable'))));
159
- }
160
- console.log(picocolors_1.default.gray('|'));
161
- s.stop(picocolors_1.default.green('✔ Doctor diagnostics finished successfully!'));
162
- return [3, 5];
163
- case 4:
164
- err_1 = _a.sent();
165
- s.stop(picocolors_1.default.red('× Doctor diagnostics failed'));
166
- console.error(picocolors_1.default.red('× Diagnostics crashed'), err_1);
167
- return [3, 5];
168
- case 5: return [2];
169
- }
170
- });
171
- });
172
- }
@@ -1,2 +0,0 @@
1
- export declare function env(options: Record<string, any>): Promise<void>;
2
- //# sourceMappingURL=env.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/main/commands/env.ts"],"names":[],"mappings":"AAiEA,wBAAsB,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBA8ErD"}
@@ -1,181 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.env = env;
43
- var os_1 = __importDefault(require("os"));
44
- var fs_1 = __importDefault(require("fs"));
45
- var child_process_1 = require("child_process");
46
- var prompts_1 = require("@clack/prompts");
47
- var checkVersion_1 = require("../utils/checkVersion");
48
- var getCurrentPackageManager_1 = require("../utils/getCurrentPackageManager");
49
- var picocolors_1 = __importDefault(require("picocolors"));
50
- var MIN_VERSIONS = {
51
- node: '20.19.0',
52
- pnpm: '10.15.1',
53
- npm: '10.8.2',
54
- yarn: '1.22.22',
55
- bun: '1.2.21',
56
- };
57
- function getVersion(command, name) {
58
- try {
59
- return (0, child_process_1.execSync)(command).toString().trim();
60
- }
61
- catch (err) {
62
- console.error(picocolors_1.default.red("\u00D7 Failed to detect ".concat(name, " version:")), err);
63
- return 'unknown';
64
- }
65
- }
66
- function getSystemInfo() {
67
- return {
68
- os: "".concat(os_1.default.type(), " ").concat(os_1.default.release(), " (").concat(os_1.default.platform(), ")"),
69
- cpu: os_1.default.cpus()[0].model,
70
- memoryMB: Math.round(os_1.default.totalmem() / 1024 / 1024),
71
- node: getVersion('node -v', 'Node'),
72
- };
73
- }
74
- function getPackageManagerInfo() {
75
- var current = (0, getCurrentPackageManager_1.getCurrentPackageManager)();
76
- return {
77
- packageManager: current,
78
- version: getVersion("".concat(current, " -v"), current),
79
- };
80
- }
81
- function getInstalledPackages() {
82
- try {
83
- var pkgJson = JSON.parse(fs_1.default.readFileSync('package.json', 'utf-8'));
84
- var deps = pkgJson.dependencies || {};
85
- return Object.keys(deps)
86
- .filter(function (d) { return d.startsWith('@aristobyte-ui/'); })
87
- .map(function (dep) { return (dep.includes('react') ? 'all' : dep.split('/')[1]); });
88
- }
89
- catch (_a) {
90
- return [];
91
- }
92
- }
93
- function checkNetwork() {
94
- return __awaiter(this, void 0, void 0, function () {
95
- var url, res, _a;
96
- return __generator(this, function (_b) {
97
- switch (_b.label) {
98
- case 0:
99
- url = 'https://registry.npmjs.org/-/org/aristobyte-ui/package';
100
- _b.label = 1;
101
- case 1:
102
- _b.trys.push([1, 3, , 4]);
103
- return [4, fetch(url, { method: 'HEAD' })];
104
- case 2:
105
- res = _b.sent();
106
- return [2, res.ok];
107
- case 3:
108
- _a = _b.sent();
109
- return [2, false];
110
- case 4: return [2];
111
- }
112
- });
113
- });
114
- }
115
- function env(options) {
116
- return __awaiter(this, void 0, void 0, function () {
117
- var s, system, pm, installed, networkOnline, _a, payload, err_1;
118
- return __generator(this, function (_b) {
119
- switch (_b.label) {
120
- case 0:
121
- s = (0, prompts_1.spinner)();
122
- _b.label = 1;
123
- case 1:
124
- _b.trys.push([1, 5, , 6]);
125
- s.start('Collecting environment diagnostics…');
126
- console.log("".concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Environment Diagnostics'), "\n").concat(picocolors_1.default.gray('|')));
127
- system = getSystemInfo();
128
- pm = getPackageManagerInfo();
129
- installed = options.packages || options.all || Object.keys(options).length === 0 ? getInstalledPackages() : [];
130
- if (!(options.network || options.all || Object.keys(options).length === 0)) return [3, 3];
131
- return [4, checkNetwork()];
132
- case 2:
133
- _a = _b.sent();
134
- return [3, 4];
135
- case 3:
136
- _a = undefined;
137
- _b.label = 4;
138
- case 4:
139
- networkOnline = _a;
140
- payload = {
141
- system: system,
142
- packageManager: pm,
143
- installedPackages: installed,
144
- network: networkOnline,
145
- };
146
- if (options.json) {
147
- console.log("".concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.gray('◇ ------ JSON file start ------ ◇'), "\n").concat(JSON.stringify(payload, null, 2), "\n").concat(picocolors_1.default.gray('◇ ------ JSON file end ------ ◇'), "\n").concat(picocolors_1.default.gray('|')));
148
- }
149
- if (options.system || options.all || Object.keys(options).length === 0) {
150
- console.log("".concat(options.all || Object.keys(options).length === 0 ? '\n' : '').concat(picocolors_1.default.gray('|'), " \n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('System:'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('OS:'), " ").concat(picocolors_1.default.green("".concat(system.os)), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('CPU:'), " ").concat(picocolors_1.default.green("".concat(system.cpu)), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('Memory:'), " ").concat(picocolors_1.default.green("".concat(system.memoryMB, " MB")), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('Node:'), " ").concat((0, checkVersion_1.checkVersion)('Node', system.node, MIN_VERSIONS.node)));
151
- }
152
- if (options.pm || options.all || Object.keys(options).length === 0) {
153
- console.log("".concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Package Manager:'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('Current:'), " ").concat(picocolors_1.default.green(pm.packageManager), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.white('Version:'), " ").concat(picocolors_1.default.green((0, checkVersion_1.checkVersion)(pm.packageManager, pm.version, MIN_VERSIONS[pm.packageManager]))));
154
- }
155
- if (options.packages || options.all || Object.keys(options).length === 0) {
156
- console.log("".concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Installed AristoByteUI Packages:')));
157
- if (!installed.length) {
158
- console.log(picocolors_1.default.gray(' (none detected)'));
159
- }
160
- else {
161
- installed.forEach(function (p) { return console.log("".concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.green('-'), " ").concat(picocolors_1.default.white(p))); });
162
- }
163
- }
164
- if (options.network || options.all || Object.keys(options).length === 0) {
165
- console.log("".concat(options.network ? '\n' : '').concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.cyan('Network:'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(networkOnline
166
- ? "".concat(picocolors_1.default.green('✔'), " ").concat(picocolors_1.default.white('Registry reachable"'))
167
- : "".concat(picocolors_1.default.red('×'), " ").concat(picocolors_1.default.white('Registry unreachable'))));
168
- }
169
- console.log(picocolors_1.default.gray('|'));
170
- s.stop(picocolors_1.default.green('✔ Environment diagnostics finished with success!'));
171
- return [3, 6];
172
- case 5:
173
- err_1 = _b.sent();
174
- s.stop(picocolors_1.default.red('× Environment diagnostics finished with failure :('));
175
- console.error(picocolors_1.default.red('× Environment diagnostics failed'), err_1);
176
- return [3, 6];
177
- case 6: return [2];
178
- }
179
- });
180
- });
181
- }
@@ -1,2 +0,0 @@
1
- export declare function init(myProjectName: string, options: Record<string, any>): Promise<void>;
2
- //# sourceMappingURL=init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/main/commands/init.ts"],"names":[],"mappings":"AA8CA,wBAAsB,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,iBAyH7E"}