@aristobyte-ui/cli 2.3.6 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/package.json +58 -0
- package/es/src/main/commands/add.js +106 -0
- package/es/src/main/commands/doctor.js +166 -0
- package/es/src/main/commands/env.js +175 -0
- package/es/src/main/commands/init.js +180 -0
- package/es/src/main/commands/list.js +195 -0
- package/es/src/main/commands/remove.js +100 -0
- package/es/src/main/commands/upgrade.js +122 -0
- package/es/src/main/index.js +212 -0
- package/es/src/main/utils/checkVersion.js +8 -0
- package/es/src/main/utils/colors.js +77 -0
- package/es/src/main/utils/compareVersions.js +11 -0
- package/es/src/main/utils/getBanner.js +30 -0
- package/es/src/main/utils/getCurrentPackageManager.js +55 -0
- package/es/src/main/utils/getDescription.js +21 -0
- package/es/src/main/utils/getTip.js +21 -0
- package/es/src/main/utils/installPackage.js +75 -0
- package/es/src/main/utils/parseHelp.js +22 -0
- package/es/src/main/utils/typography.js +9 -0
- package/lib/package.json +58 -0
- package/lib/src/main/commands/add.js +112 -0
- package/lib/src/main/commands/doctor.js +172 -0
- package/lib/src/main/commands/env.js +181 -0
- package/lib/src/main/commands/init.js +186 -0
- package/lib/src/main/commands/list.js +202 -0
- package/lib/src/main/commands/remove.js +106 -0
- package/lib/src/main/commands/upgrade.js +128 -0
- package/lib/src/main/index.js +217 -0
- package/lib/src/main/utils/checkVersion.js +14 -0
- package/lib/src/main/utils/colors.js +96 -0
- package/lib/src/main/utils/compareVersions.js +14 -0
- package/lib/src/main/utils/getBanner.js +33 -0
- package/lib/src/main/utils/getCurrentPackageManager.js +61 -0
- package/lib/src/main/utils/getDescription.js +24 -0
- package/lib/src/main/utils/getTip.js +24 -0
- package/lib/src/main/utils/installPackage.js +78 -0
- package/lib/src/main/utils/parseHelp.js +25 -0
- package/lib/src/main/utils/typography.js +13 -0
- package/package.json +1 -1
- package/README.md +0 -11
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
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 __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
63
|
+
import { Command } from 'commander';
|
|
64
|
+
import { add } from './commands/add';
|
|
65
|
+
import { init } from './commands/init';
|
|
66
|
+
import { remove } from './commands/remove';
|
|
67
|
+
import { upgrade } from './commands/upgrade';
|
|
68
|
+
import { list } from './commands/list';
|
|
69
|
+
import { doctor } from './commands/doctor';
|
|
70
|
+
import { env } from './commands/env';
|
|
71
|
+
import { logoSmallGradient, logo3, logo4, darkGrey, lightGrey } from './utils/colors';
|
|
72
|
+
import { usage } from './utils/typography';
|
|
73
|
+
import { parseHelp } from './utils/parseHelp';
|
|
74
|
+
import pkg from '../../package.json';
|
|
75
|
+
var COMMANDS = ['init', 'add', 'remove', 'upgrade', 'list', 'doctor', 'env', 'help'];
|
|
76
|
+
var aristobyteui = new Command();
|
|
77
|
+
aristobyteui
|
|
78
|
+
.name('aristobyte-ui')
|
|
79
|
+
.usage(usage(['command', 'options']))
|
|
80
|
+
.description('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.')
|
|
81
|
+
.version(pkg.version, '-V, --version', 'Output the CLI version')
|
|
82
|
+
.helpOption('-H, --help', 'Show help information')
|
|
83
|
+
.configureHelp({
|
|
84
|
+
formatHelp: function (cmd, helper) { return parseHelp(cmd, helper); },
|
|
85
|
+
});
|
|
86
|
+
aristobyteui
|
|
87
|
+
.command('init [myProjectName]')
|
|
88
|
+
.usage(usage(['options', 'myProjectName']))
|
|
89
|
+
.description('Initialize a new AristoByteUI project')
|
|
90
|
+
.option('-LT, --list-templates', 'Display a list of available templates')
|
|
91
|
+
.option('-LPM, --list-package-managers', 'Display a list of available package managers')
|
|
92
|
+
.option('-T, --template <templateName>', 'Specify a template to use')
|
|
93
|
+
.option('-P, --package-manager <packageManager>', 'Select a package manager (npm, yarn, pnpm, bun)')
|
|
94
|
+
.configureHelp({
|
|
95
|
+
formatHelp: function (cmd, helper) { return parseHelp(cmd, helper); },
|
|
96
|
+
})
|
|
97
|
+
.action(init);
|
|
98
|
+
aristobyteui
|
|
99
|
+
.command('add [component]')
|
|
100
|
+
.usage(usage(['options', 'components...']))
|
|
101
|
+
.description('Add a UI component')
|
|
102
|
+
.option('-L, --list', 'Display a list of available packages, to be added')
|
|
103
|
+
.option('-P, --package-manager', 'Show the package manager used in current project')
|
|
104
|
+
.configureHelp({
|
|
105
|
+
formatHelp: function (cmd, helper) { return parseHelp(cmd, helper); },
|
|
106
|
+
})
|
|
107
|
+
.action(add);
|
|
108
|
+
aristobyteui
|
|
109
|
+
.command('remove [component]')
|
|
110
|
+
.usage(usage(['options', 'components...']))
|
|
111
|
+
.description('Remove a UI component')
|
|
112
|
+
.option('-L, --list', 'Display a list of installed packages, to be removed')
|
|
113
|
+
.option('-P, --package-manager', 'Show the package manager used in current project')
|
|
114
|
+
.configureHelp({
|
|
115
|
+
formatHelp: function (cmd, helper) { return parseHelp(cmd, helper); },
|
|
116
|
+
})
|
|
117
|
+
.action(remove);
|
|
118
|
+
aristobyteui
|
|
119
|
+
.command('upgrade [component]')
|
|
120
|
+
.usage(usage(['options', 'components...']))
|
|
121
|
+
.description('Upgrade a UI component')
|
|
122
|
+
.option('-A, --all', 'Upgrade all AristoByteUI components')
|
|
123
|
+
.option('-T, --to <version>', 'Upgrade to a specific version')
|
|
124
|
+
.configureHelp({
|
|
125
|
+
formatHelp: function (cmd, helper) { return parseHelp(cmd, helper); },
|
|
126
|
+
})
|
|
127
|
+
.action(upgrade);
|
|
128
|
+
aristobyteui
|
|
129
|
+
.command('list')
|
|
130
|
+
.usage(usage(['options']))
|
|
131
|
+
.description('List installed components')
|
|
132
|
+
.option('-A, --all', 'Display the list of all packages')
|
|
133
|
+
.option('-I, --installed', 'Display the list of installed packages')
|
|
134
|
+
.option('-O, --outdated', 'Check for available updates')
|
|
135
|
+
.configureHelp({
|
|
136
|
+
formatHelp: function (cmd, helper) { return parseHelp(cmd, helper); },
|
|
137
|
+
})
|
|
138
|
+
.action(function (options) { return list(options, true); });
|
|
139
|
+
aristobyteui
|
|
140
|
+
.command('doctor')
|
|
141
|
+
.usage(usage(['options']))
|
|
142
|
+
.description('Check system and project health')
|
|
143
|
+
.option('-A, --all', 'Run all diagnostics')
|
|
144
|
+
.option('-C, --configs', 'Validate project config files')
|
|
145
|
+
.option('-D, --deps', 'Validate installed AristoByteUI dependencies')
|
|
146
|
+
.option('-J, --json', 'Output diagnostics as JSON')
|
|
147
|
+
.option('-N, --network', 'Verify registry/network connectivity')
|
|
148
|
+
.option('-P, --pm', 'Check package manager state')
|
|
149
|
+
.option('-S, --system', 'Check system environment')
|
|
150
|
+
.configureHelp({
|
|
151
|
+
formatHelp: function (cmd, helper) { return parseHelp(cmd, helper); },
|
|
152
|
+
})
|
|
153
|
+
.action(doctor);
|
|
154
|
+
aristobyteui
|
|
155
|
+
.command('env')
|
|
156
|
+
.usage(usage(['options']))
|
|
157
|
+
.description('Display environment info')
|
|
158
|
+
.option('-A, --all', 'Display all environment diagnostics')
|
|
159
|
+
.option('-J, --json', 'Output environment info as JSON')
|
|
160
|
+
.option('-M, --pm', 'Show package manager details')
|
|
161
|
+
.option('-N, --network', 'Check registry/network connectivity')
|
|
162
|
+
.option('-P, --packages', 'Show installed AristoByteUI packages')
|
|
163
|
+
.option('-S, --system', 'Show system information')
|
|
164
|
+
.configureHelp({
|
|
165
|
+
formatHelp: function (cmd, helper) { return parseHelp(cmd, helper); },
|
|
166
|
+
})
|
|
167
|
+
.action(env);
|
|
168
|
+
aristobyteui
|
|
169
|
+
.command('help')
|
|
170
|
+
.usage(usage(['options']))
|
|
171
|
+
.description('Display help for command')
|
|
172
|
+
.action(env);
|
|
173
|
+
aristobyteui.command('help', { hidden: true });
|
|
174
|
+
aristobyteui.exitOverride(function (err) { return __awaiter(void 0, void 0, void 0, function () {
|
|
175
|
+
return __generator(this, function (_a) {
|
|
176
|
+
if (err.code === 'commander.unknownCommand') {
|
|
177
|
+
console.error.apply(console, __spreadArray([logoSmallGradient(' ◆ Possible commands are: \n')], __read(COMMANDS.map(function (cmd) {
|
|
178
|
+
return cmd === err.message.split('Did you mean ')[1].split('?')[0]
|
|
179
|
+
? "".concat(logoSmallGradient('│ ')).concat(logo4('● aristobyte-ui'), " ").concat(logo4("".concat(cmd)), "\n")
|
|
180
|
+
: "".concat(logoSmallGradient('│ ○ aristobyte-ui'), " ").concat(logo3("".concat(cmd)), "\n");
|
|
181
|
+
})), false));
|
|
182
|
+
}
|
|
183
|
+
process.exit(1);
|
|
184
|
+
return [2];
|
|
185
|
+
});
|
|
186
|
+
}); });
|
|
187
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
|
+
var args, err_1;
|
|
189
|
+
return __generator(this, function (_a) {
|
|
190
|
+
switch (_a.label) {
|
|
191
|
+
case 0:
|
|
192
|
+
args = process.argv.slice(2);
|
|
193
|
+
if (args.length === 0) {
|
|
194
|
+
aristobyteui.outputHelp();
|
|
195
|
+
process.exit(0);
|
|
196
|
+
}
|
|
197
|
+
_a.label = 1;
|
|
198
|
+
case 1:
|
|
199
|
+
_a.trys.push([1, 3, , 4]);
|
|
200
|
+
return [4, aristobyteui.parseAsync(args, { from: 'user' })];
|
|
201
|
+
case 2:
|
|
202
|
+
_a.sent();
|
|
203
|
+
return [3, 4];
|
|
204
|
+
case 3:
|
|
205
|
+
err_1 = _a.sent();
|
|
206
|
+
console.error(darkGrey('Error:'), lightGrey(err_1.message));
|
|
207
|
+
process.exit(1);
|
|
208
|
+
return [3, 4];
|
|
209
|
+
case 4: return [2];
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}); })();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { compareVersions } from "./compareVersions";
|
|
2
|
+
import color from "picocolors";
|
|
3
|
+
export function checkVersion(name, version, minVersion) {
|
|
4
|
+
if (version === "unknown" || compareVersions(version, minVersion) < 0) {
|
|
5
|
+
return color.red("\u00D7 ".concat(name, " >= ").concat(minVersion, " required"));
|
|
6
|
+
}
|
|
7
|
+
return color.green("\u2714 ".concat(version));
|
|
8
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
2
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
|
+
if (!m) return o;
|
|
4
|
+
var i = m.call(o), r, ar = [], e;
|
|
5
|
+
try {
|
|
6
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
7
|
+
}
|
|
8
|
+
catch (error) { e = { error: error }; }
|
|
9
|
+
finally {
|
|
10
|
+
try {
|
|
11
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
12
|
+
}
|
|
13
|
+
finally { if (e) throw e.error; }
|
|
14
|
+
}
|
|
15
|
+
return ar;
|
|
16
|
+
};
|
|
17
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
18
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
19
|
+
if (ar || !(i in from)) {
|
|
20
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
21
|
+
ar[i] = from[i];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
25
|
+
};
|
|
26
|
+
import chalk from "chalk";
|
|
27
|
+
import gradient from "gradient-string";
|
|
28
|
+
var LOGO_COLORS = ["#ffee27", "#fec800", "#f18e35", "#e95f32", "#e2312d"];
|
|
29
|
+
export function logo1(text) {
|
|
30
|
+
return chalk.hex(LOGO_COLORS[0])(text);
|
|
31
|
+
}
|
|
32
|
+
export function logo2(text) {
|
|
33
|
+
return chalk.hex(LOGO_COLORS[1])(text);
|
|
34
|
+
}
|
|
35
|
+
export function logo3(text) {
|
|
36
|
+
return chalk.hex(LOGO_COLORS[2])(text);
|
|
37
|
+
}
|
|
38
|
+
export function logo4(text) {
|
|
39
|
+
return chalk.hex(LOGO_COLORS[3])(text);
|
|
40
|
+
}
|
|
41
|
+
export function logo5(text) {
|
|
42
|
+
return chalk.hex(LOGO_COLORS[4])(text);
|
|
43
|
+
}
|
|
44
|
+
export function reset(text) {
|
|
45
|
+
return chalk.reset(text);
|
|
46
|
+
}
|
|
47
|
+
export function red(text) {
|
|
48
|
+
return chalk.redBright(text);
|
|
49
|
+
}
|
|
50
|
+
export function lightGrey(text) {
|
|
51
|
+
return chalk.hex("#afbfff")(text);
|
|
52
|
+
}
|
|
53
|
+
export function darkGrey(text) {
|
|
54
|
+
return chalk.hex("#7580aa")(text);
|
|
55
|
+
}
|
|
56
|
+
export function white(text) {
|
|
57
|
+
return chalk.hex("#cfd5edff")(text);
|
|
58
|
+
}
|
|
59
|
+
export function yellow(text) {
|
|
60
|
+
return chalk.yellow(text);
|
|
61
|
+
}
|
|
62
|
+
export function redBright(text) {
|
|
63
|
+
return chalk.redBright(text);
|
|
64
|
+
}
|
|
65
|
+
export function logoGradient(text) {
|
|
66
|
+
return gradient(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(LOGO_COLORS), false), __read(LOGO_COLORS.reverse()), false), __read(LOGO_COLORS), false), __read(LOGO_COLORS.reverse()), false), __read(LOGO_COLORS), false)).multiline(text);
|
|
67
|
+
}
|
|
68
|
+
export function logoSmallGradient(text) {
|
|
69
|
+
return gradient([
|
|
70
|
+
LOGO_COLORS[0],
|
|
71
|
+
LOGO_COLORS[1],
|
|
72
|
+
LOGO_COLORS[1],
|
|
73
|
+
LOGO_COLORS[0],
|
|
74
|
+
LOGO_COLORS[0],
|
|
75
|
+
LOGO_COLORS[1],
|
|
76
|
+
]).multiline(text);
|
|
77
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function compareVersions(v1, v2) {
|
|
2
|
+
var a = v1.replace(/^v/, "").split(".").map(Number);
|
|
3
|
+
var b = v2.replace(/^v/, "").split(".").map(Number);
|
|
4
|
+
for (var i = 0; i < 3; i++) {
|
|
5
|
+
if (a[i] > b[i])
|
|
6
|
+
return 1;
|
|
7
|
+
if (a[i] < b[i])
|
|
8
|
+
return -1;
|
|
9
|
+
}
|
|
10
|
+
return 0;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { logoGradient } from "./colors";
|
|
2
|
+
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 \n \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 \n \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 \n \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\n \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 \n \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 \n \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 \n\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 \n \u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \n \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588 \n \u2591\u2591\u2591\u2591\u2591\u2591 ";
|
|
3
|
+
var initBanner = " \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \n\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2591 \u2591\u2591\u2588\u2588\u2588 \n \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \n \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 \n \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \n \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\n \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 \n\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 ";
|
|
4
|
+
var addBanner = " \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\n \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \n \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \n \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 \n \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 \n \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \n \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\n\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 ";
|
|
5
|
+
var removeBanner = " \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \n\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \n \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 \n \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\n \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 \n \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 \n \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 \n\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 ";
|
|
6
|
+
var doctorBanner = " \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \n\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \n \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 \n \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\n \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 \n \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 \n \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 \n\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 ";
|
|
7
|
+
var envBanner = " \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \n\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588 \n \u2591\u2588\u2588\u2588 \u2588 \u2591 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\n \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 \n \u2591\u2588\u2588\u2588\u2591\u2591\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \n \u2591\u2588\u2588\u2588 \u2591 \u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \n \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 \n\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 ";
|
|
8
|
+
var listBanner = " \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \n\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2591 \u2591\u2591\u2588\u2588\u2588 \n \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \n \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591 \u2591\u2591\u2591\u2588\u2588\u2588\u2591 \n \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \n \u2591\u2588\u2588\u2588 \u2588 \u2591\u2588\u2588\u2588 \u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588\u2588\u2588\n \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 \n\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 ";
|
|
9
|
+
var upgradeBanner = " \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \n\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \n \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 \n \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\n \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 \n \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 \n \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 \n \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 \n \u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \n \u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588 \n \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591 ";
|
|
10
|
+
export function getBanner(id) {
|
|
11
|
+
switch (id) {
|
|
12
|
+
case "add":
|
|
13
|
+
return logoGradient(addBanner);
|
|
14
|
+
case "doctor":
|
|
15
|
+
return logoGradient(doctorBanner);
|
|
16
|
+
case "env":
|
|
17
|
+
return logoGradient(envBanner);
|
|
18
|
+
case "init":
|
|
19
|
+
return logoGradient(initBanner);
|
|
20
|
+
case "list":
|
|
21
|
+
return logoGradient(listBanner);
|
|
22
|
+
case "remove":
|
|
23
|
+
return logoGradient(removeBanner);
|
|
24
|
+
case "upgrade":
|
|
25
|
+
return logoGradient(upgradeBanner);
|
|
26
|
+
case "aristobyte-ui":
|
|
27
|
+
default:
|
|
28
|
+
return logoGradient(mainBanner);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
12
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
13
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
+
if (!m) return o;
|
|
15
|
+
var i = m.call(o), r, ar = [], e;
|
|
16
|
+
try {
|
|
17
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
+
}
|
|
19
|
+
catch (error) { e = { error: error }; }
|
|
20
|
+
finally {
|
|
21
|
+
try {
|
|
22
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
+
}
|
|
24
|
+
finally { if (e) throw e.error; }
|
|
25
|
+
}
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
import fs from "fs";
|
|
29
|
+
import path from "path";
|
|
30
|
+
export function getCurrentPackageManager(cwd) {
|
|
31
|
+
var e_1, _a;
|
|
32
|
+
if (cwd === void 0) { cwd = process.cwd(); }
|
|
33
|
+
var lockFiles = {
|
|
34
|
+
bun: "bun.lockb",
|
|
35
|
+
pnpm: "pnpm-lock.yaml",
|
|
36
|
+
yarn: "yarn.lock",
|
|
37
|
+
npm: "package-lock.json",
|
|
38
|
+
};
|
|
39
|
+
try {
|
|
40
|
+
for (var _b = __values(Object.entries(lockFiles)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
41
|
+
var _d = __read(_c.value, 2), manager = _d[0], lockFile = _d[1];
|
|
42
|
+
if (fs.existsSync(path.join(cwd, lockFile))) {
|
|
43
|
+
return manager;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
48
|
+
finally {
|
|
49
|
+
try {
|
|
50
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
51
|
+
}
|
|
52
|
+
finally { if (e_1) throw e_1.error; }
|
|
53
|
+
}
|
|
54
|
+
return "npm";
|
|
55
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function getDescription(id) {
|
|
2
|
+
switch (id) {
|
|
3
|
+
case "init":
|
|
4
|
+
return "Initialize a new AristoByteUI project from pre-configured templates.\n Supports automatic project setup, template selection, and package manager configuration.";
|
|
5
|
+
case "add":
|
|
6
|
+
return "Add new UI components to your existing AristoByteUI project.\n Handles component installation, configuration, and dependency management.";
|
|
7
|
+
case "remove":
|
|
8
|
+
return "Remove installed AristoByteUI components cleanly from your project.\n Ensures proper cleanup of related files and dependencies.";
|
|
9
|
+
case "upgrade":
|
|
10
|
+
return "Upgrade AristoByteUI components or core packages to their latest versions.\n Supports selective or full project upgrades.";
|
|
11
|
+
case "list":
|
|
12
|
+
return "List all installed AristoByteUI components in your project.\n Displays version, status, and available updates for each component.";
|
|
13
|
+
case "doctor":
|
|
14
|
+
return "Run a system and project health check.\n Detects configuration issues, missing dependencies, and environment mismatches.";
|
|
15
|
+
case "env":
|
|
16
|
+
return "Display detailed environment information.\n Includes Node.js version, package manager details, and AristoByteUI configuration paths.";
|
|
17
|
+
case "aristobyte-ui":
|
|
18
|
+
default:
|
|
19
|
+
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.";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function getTip(id) {
|
|
2
|
+
switch (id) {
|
|
3
|
+
case "init":
|
|
4
|
+
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.";
|
|
5
|
+
case "add":
|
|
6
|
+
return "Use 'aristobyte-ui add [ component ]' to install a specific UI component.\n Combine multiple components for faster setup.";
|
|
7
|
+
case "remove":
|
|
8
|
+
return "Run 'aristobyte-ui remove [ component ]' to cleanly uninstall components.\n Useful for maintaining a lightweight project.";
|
|
9
|
+
case "upgrade":
|
|
10
|
+
return "Use 'aristobyte-ui upgrade [ component ]' to update components or core packages.\n Add '--all' to upgrade everything at once.";
|
|
11
|
+
case "list":
|
|
12
|
+
return "Run 'aristobyte-ui list' to view installed components and versions.\n Add '--outdated' to check for available updates.";
|
|
13
|
+
case "doctor":
|
|
14
|
+
return "Execute 'aristobyte-ui doctor' to analyze your setup.\n Fixes and recommendations will be displayed for common issues.";
|
|
15
|
+
case "env":
|
|
16
|
+
return "Run 'aristobyte-ui env' to inspect your development environment.\n Helpful for debugging version or configuration conflicts.";
|
|
17
|
+
case "aristobyte-ui":
|
|
18
|
+
default:
|
|
19
|
+
return "Use 'aristobyte-ui [ command ] --help' for detailed info on a command.";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
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);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
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;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { execa } from 'execa';
|
|
38
|
+
export function installPackage(pkgManager_1, pkg_1) {
|
|
39
|
+
return __awaiter(this, arguments, void 0, function (pkgManager, pkg, dev) {
|
|
40
|
+
var args;
|
|
41
|
+
if (dev === void 0) { dev = false; }
|
|
42
|
+
return __generator(this, function (_a) {
|
|
43
|
+
switch (_a.label) {
|
|
44
|
+
case 0:
|
|
45
|
+
args = [];
|
|
46
|
+
switch (pkgManager) {
|
|
47
|
+
case "npm":
|
|
48
|
+
args = ["install", pkg, dev ? "--save-dev" : "--save"];
|
|
49
|
+
break;
|
|
50
|
+
case "yarn":
|
|
51
|
+
args = ["add", pkg];
|
|
52
|
+
if (dev)
|
|
53
|
+
args.push("-D");
|
|
54
|
+
break;
|
|
55
|
+
case "pnpm":
|
|
56
|
+
args = ["add", pkg];
|
|
57
|
+
if (dev)
|
|
58
|
+
args.push("-D");
|
|
59
|
+
break;
|
|
60
|
+
case "bun":
|
|
61
|
+
args = ["add", pkg];
|
|
62
|
+
if (dev)
|
|
63
|
+
args.push("-d");
|
|
64
|
+
break;
|
|
65
|
+
default:
|
|
66
|
+
throw new Error("Unsupported package manager: ".concat(pkgManager));
|
|
67
|
+
}
|
|
68
|
+
return [4, execa(pkgManager, args, { stdio: "inherit" })];
|
|
69
|
+
case 1:
|
|
70
|
+
_a.sent();
|
|
71
|
+
return [2];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
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.4.0",
|
|
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
|
+
"bin": {
|
|
44
|
+
"aristobyte-ui": "dist/index.js"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^19.1.0",
|
|
48
|
+
"react-dom": "^19.1.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@clack/prompts": "^0.11.0",
|
|
52
|
+
"axios": "^1.6.0",
|
|
53
|
+
"chalk": "^4.1.2",
|
|
54
|
+
"commander": "^10",
|
|
55
|
+
"execa": "^7",
|
|
56
|
+
"gradient-string": "^3.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|