@aristobyte-ui/cli 1.0.112 → 2.1.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/bin/aristobyte-ui.js +3 -0
- package/dist/es/main/commands/add.js +106 -0
- package/dist/es/main/commands/doctor.js +166 -0
- package/dist/es/main/commands/env.js +175 -0
- package/dist/es/main/commands/init.js +180 -0
- package/dist/es/main/commands/list.js +195 -0
- package/dist/es/main/commands/remove.js +100 -0
- package/dist/es/main/commands/upgrade.js +122 -0
- package/dist/es/main/index.js +212 -0
- package/dist/es/main/utils/checkVersion.js +8 -0
- package/dist/es/main/utils/colors.js +77 -0
- package/dist/es/main/utils/compareVersions.js +11 -0
- package/dist/es/main/utils/getBanner.js +30 -0
- package/dist/es/main/utils/getCurrentPackageManager.js +55 -0
- package/dist/es/main/utils/getDescription.js +21 -0
- package/dist/es/main/utils/getTip.js +21 -0
- package/dist/es/main/utils/installPackage.js +75 -0
- package/dist/es/main/utils/parseHelp.js +22 -0
- package/dist/es/main/utils/typography.js +9 -0
- package/dist/lib/main/commands/add.js +112 -0
- package/dist/lib/main/commands/doctor.js +172 -0
- package/dist/lib/main/commands/env.js +181 -0
- package/dist/lib/main/commands/init.js +186 -0
- package/dist/lib/main/commands/list.js +202 -0
- package/dist/lib/main/commands/remove.js +106 -0
- package/dist/lib/main/commands/upgrade.js +128 -0
- package/dist/lib/main/index.js +217 -0
- package/dist/lib/main/utils/checkVersion.js +14 -0
- package/dist/lib/main/utils/colors.js +96 -0
- package/dist/lib/main/utils/compareVersions.js +14 -0
- package/dist/lib/main/utils/getBanner.js +33 -0
- package/dist/lib/main/utils/getCurrentPackageManager.js +61 -0
- package/dist/lib/main/utils/getDescription.js +24 -0
- package/dist/lib/main/utils/getTip.js +24 -0
- package/dist/lib/main/utils/installPackage.js +78 -0
- package/dist/lib/main/utils/parseHelp.js +25 -0
- package/dist/lib/main/utils/typography.js +13 -0
- package/package.json +12 -33
- package/dist/index.js +0 -1222
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -1221
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
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 __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.remoteList = remoteList;
|
|
54
|
+
exports.list = list;
|
|
55
|
+
var fs_1 = __importDefault(require("fs"));
|
|
56
|
+
var picocolors_1 = __importDefault(require("picocolors"));
|
|
57
|
+
var getCurrentPackageManager_1 = require("../utils/getCurrentPackageManager");
|
|
58
|
+
function remoteList() {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
60
|
+
return [2];
|
|
61
|
+
}); });
|
|
62
|
+
}
|
|
63
|
+
function list(options, endBlock) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var handled, url, omit_1, res, data, packages, err_1, pkgJson, deps, aristobyteDeps, packagesToUpdate, pkgJson, deps, installed, installed_1, installed_1_1, pkg, localVersion, registryUrl, res, data, latest, p, err_2, e_1_1, err_3, pkgManager;
|
|
66
|
+
var e_1, _a;
|
|
67
|
+
var _b;
|
|
68
|
+
return __generator(this, function (_c) {
|
|
69
|
+
switch (_c.label) {
|
|
70
|
+
case 0:
|
|
71
|
+
handled = false;
|
|
72
|
+
if (!options.all) return [3, 6];
|
|
73
|
+
handled = true;
|
|
74
|
+
url = 'https://registry.npmjs.org/-/org/aristobyte-ui/package';
|
|
75
|
+
omit_1 = ['cli', 'react'];
|
|
76
|
+
_c.label = 1;
|
|
77
|
+
case 1:
|
|
78
|
+
_c.trys.push([1, 4, , 5]);
|
|
79
|
+
return [4, fetch(url)];
|
|
80
|
+
case 2:
|
|
81
|
+
res = _c.sent();
|
|
82
|
+
if (!res.ok)
|
|
83
|
+
throw new Error("Registry request failed: ".concat(res.status));
|
|
84
|
+
return [4, res.json()];
|
|
85
|
+
case 3:
|
|
86
|
+
data = _c.sent();
|
|
87
|
+
packages = Object.keys(data)
|
|
88
|
+
.map(function (dep) { return dep.split('/')[1]; })
|
|
89
|
+
.filter(function (dep) { return !omit_1.includes(dep); })
|
|
90
|
+
.sort();
|
|
91
|
+
console.log("".concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.white('Listing AristoByteUI packages:'), "\n").concat(packages.map(function (dep) { return "".concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.cyan(dep)); }).join('\n')));
|
|
92
|
+
return [3, 5];
|
|
93
|
+
case 4:
|
|
94
|
+
err_1 = _c.sent();
|
|
95
|
+
console.error(picocolors_1.default.red('× Failed to fetch package list from npm registry'));
|
|
96
|
+
console.error(picocolors_1.default.dim(String(err_1)));
|
|
97
|
+
return [3, 5];
|
|
98
|
+
case 5:
|
|
99
|
+
if (endBlock)
|
|
100
|
+
console.log(picocolors_1.default.green('◇'));
|
|
101
|
+
process.exit(0);
|
|
102
|
+
_c.label = 6;
|
|
103
|
+
case 6:
|
|
104
|
+
if (options.installed) {
|
|
105
|
+
handled = true;
|
|
106
|
+
try {
|
|
107
|
+
pkgJson = JSON.parse(fs_1.default.readFileSync('package.json', 'utf-8'));
|
|
108
|
+
deps = pkgJson.dependencies || {};
|
|
109
|
+
aristobyteDeps = Object.keys(deps)
|
|
110
|
+
.filter(function (d) { return d.startsWith('@aristobyte-ui/'); })
|
|
111
|
+
.map(function (dep) { return (dep.includes('react') ? 'all' : dep.split('/')[1]); });
|
|
112
|
+
console.log("".concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.white('Listing installed AristoByteUI packages:'), "\n").concat(aristobyteDeps.map(function (dep) { return "".concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.cyan(dep)); }).join('\n')));
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
console.error(picocolors_1.default.red('× Failed to list packages'), err);
|
|
116
|
+
}
|
|
117
|
+
if (endBlock)
|
|
118
|
+
console.log(picocolors_1.default.green('◇'));
|
|
119
|
+
process.exit(0);
|
|
120
|
+
}
|
|
121
|
+
if (!options.outdated) return [3, 21];
|
|
122
|
+
handled = true;
|
|
123
|
+
packagesToUpdate = [];
|
|
124
|
+
_c.label = 7;
|
|
125
|
+
case 7:
|
|
126
|
+
_c.trys.push([7, 19, , 20]);
|
|
127
|
+
pkgJson = JSON.parse(fs_1.default.readFileSync('package.json', 'utf-8'));
|
|
128
|
+
deps = pkgJson.dependencies || {};
|
|
129
|
+
installed = Object.keys(deps).filter(function (d) { return d.startsWith('@aristobyte-ui/'); });
|
|
130
|
+
if (installed.length === 0) {
|
|
131
|
+
console.log(picocolors_1.default.yellow('No AristoByteUI packages installed.'));
|
|
132
|
+
process.exit(0);
|
|
133
|
+
}
|
|
134
|
+
console.log("".concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.white('Checking for outdated AristoByteUI packages...')));
|
|
135
|
+
_c.label = 8;
|
|
136
|
+
case 8:
|
|
137
|
+
_c.trys.push([8, 16, 17, 18]);
|
|
138
|
+
installed_1 = __values(installed), installed_1_1 = installed_1.next();
|
|
139
|
+
_c.label = 9;
|
|
140
|
+
case 9:
|
|
141
|
+
if (!!installed_1_1.done) return [3, 15];
|
|
142
|
+
pkg = installed_1_1.value;
|
|
143
|
+
localVersion = deps[pkg].replace(/^[^\d]*/, '');
|
|
144
|
+
registryUrl = "https://registry.npmjs.org/".concat(pkg);
|
|
145
|
+
_c.label = 10;
|
|
146
|
+
case 10:
|
|
147
|
+
_c.trys.push([10, 13, , 14]);
|
|
148
|
+
return [4, fetch(registryUrl)];
|
|
149
|
+
case 11:
|
|
150
|
+
res = _c.sent();
|
|
151
|
+
if (!res.ok)
|
|
152
|
+
throw new Error("Registry request failed: ".concat(res.status));
|
|
153
|
+
return [4, res.json()];
|
|
154
|
+
case 12:
|
|
155
|
+
data = _c.sent();
|
|
156
|
+
latest = (_b = data['dist-tags']) === null || _b === void 0 ? void 0 : _b.latest;
|
|
157
|
+
if (!latest)
|
|
158
|
+
return [3, 14];
|
|
159
|
+
if (latest !== localVersion) {
|
|
160
|
+
p = pkg.replace('@aristobyte-ui/', '');
|
|
161
|
+
packagesToUpdate.push([p, latest]);
|
|
162
|
+
console.log("".concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.cyan(p), " ") + "".concat(picocolors_1.default.red(localVersion), " \u2192 ").concat(picocolors_1.default.green(latest)));
|
|
163
|
+
}
|
|
164
|
+
return [3, 14];
|
|
165
|
+
case 13:
|
|
166
|
+
err_2 = _c.sent();
|
|
167
|
+
console.error(picocolors_1.default.red("\u00D7 Failed to check ".concat(pkg, " on npm registry")), err_2);
|
|
168
|
+
return [3, 14];
|
|
169
|
+
case 14:
|
|
170
|
+
installed_1_1 = installed_1.next();
|
|
171
|
+
return [3, 9];
|
|
172
|
+
case 15: return [3, 18];
|
|
173
|
+
case 16:
|
|
174
|
+
e_1_1 = _c.sent();
|
|
175
|
+
e_1 = { error: e_1_1 };
|
|
176
|
+
return [3, 18];
|
|
177
|
+
case 17:
|
|
178
|
+
try {
|
|
179
|
+
if (installed_1_1 && !installed_1_1.done && (_a = installed_1.return)) _a.call(installed_1);
|
|
180
|
+
}
|
|
181
|
+
finally { if (e_1) throw e_1.error; }
|
|
182
|
+
return [7];
|
|
183
|
+
case 18: return [3, 20];
|
|
184
|
+
case 19:
|
|
185
|
+
err_3 = _c.sent();
|
|
186
|
+
console.error(picocolors_1.default.red('× Failed to check outdated packages'), err_3);
|
|
187
|
+
return [3, 20];
|
|
188
|
+
case 20:
|
|
189
|
+
pkgManager = (0, getCurrentPackageManager_1.getCurrentPackageManager)();
|
|
190
|
+
if (endBlock)
|
|
191
|
+
console.log("".concat(picocolors_1.default.gray('|'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(packagesToUpdate.length > 0 ? picocolors_1.default.gray("Tip: run '".concat(pkgManager, " upgrade ").concat(packagesToUpdate.map(function (p) { return "".concat(p[0], "@").concat(p[1]); }).join(' '), "'")) : picocolors_1.default.green('✔ Everything is up to date!')));
|
|
192
|
+
process.exit(0);
|
|
193
|
+
_c.label = 21;
|
|
194
|
+
case 21:
|
|
195
|
+
if (!handled) {
|
|
196
|
+
console.log(picocolors_1.default.gray("No option provided. Use 'aristobyte-ui list --help' for usage."));
|
|
197
|
+
}
|
|
198
|
+
return [2];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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.remove = remove;
|
|
43
|
+
var getCurrentPackageManager_1 = require("../utils/getCurrentPackageManager");
|
|
44
|
+
var prompts_1 = require("@clack/prompts");
|
|
45
|
+
var execa_1 = require("execa");
|
|
46
|
+
var picocolors_1 = __importDefault(require("picocolors"));
|
|
47
|
+
var list_1 = require("./list");
|
|
48
|
+
function remove(component, options) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var pkgManager, s, packageName, pkgName, err_1;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
if (!options.list) return [3, 2];
|
|
55
|
+
return [4, (0, list_1.list)({ installed: true }, true)];
|
|
56
|
+
case 1:
|
|
57
|
+
_a.sent();
|
|
58
|
+
_a.label = 2;
|
|
59
|
+
case 2:
|
|
60
|
+
pkgManager = (0, getCurrentPackageManager_1.getCurrentPackageManager)();
|
|
61
|
+
if (options.packageManager) {
|
|
62
|
+
console.log("".concat(picocolors_1.default.cyan('Current package manager:'), "\n").concat(picocolors_1.default.green('◇'), " ").concat(pkgManager));
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
s = (0, prompts_1.spinner)();
|
|
66
|
+
if (!!component) return [3, 5];
|
|
67
|
+
console.log("".concat(picocolors_1.default.green('◇'), " ").concat(picocolors_1.default.white('You did not specify, which package should be removed'), "\n").concat(picocolors_1.default.gray('|'), " ").concat(picocolors_1.default.gray('Please select one of the installed packages below to proceed.'), "\n").concat(picocolors_1.default.gray('|')));
|
|
68
|
+
return [4, (0, list_1.list)({ installed: true })];
|
|
69
|
+
case 3:
|
|
70
|
+
_a.sent();
|
|
71
|
+
return [4, (0, prompts_1.text)({
|
|
72
|
+
message: "Component name to remove (Required filled)",
|
|
73
|
+
placeholder: '<package-name>',
|
|
74
|
+
})];
|
|
75
|
+
case 4:
|
|
76
|
+
packageName = (_a.sent());
|
|
77
|
+
return [3, 6];
|
|
78
|
+
case 5:
|
|
79
|
+
packageName = component;
|
|
80
|
+
_a.label = 6;
|
|
81
|
+
case 6:
|
|
82
|
+
if (!packageName) {
|
|
83
|
+
console.log(picocolors_1.default.red("Invalid Package name. <package-name> should be specified:\naristobyte-ui remove <package-name>"));
|
|
84
|
+
return [2];
|
|
85
|
+
}
|
|
86
|
+
_a.label = 7;
|
|
87
|
+
case 7:
|
|
88
|
+
_a.trys.push([7, 9, , 10]);
|
|
89
|
+
pkgName = packageName === 'all' ? '@aristobyte-ui/react' : "@aristobyte-ui/".concat(packageName);
|
|
90
|
+
s.start("Removing ".concat(pkgName, "..."));
|
|
91
|
+
return [4, (0, execa_1.execa)(pkgManager, ['remove', pkgName], { stdio: 'inherit' })];
|
|
92
|
+
case 8:
|
|
93
|
+
_a.sent();
|
|
94
|
+
s.stop();
|
|
95
|
+
console.log(picocolors_1.default.green("\u2714 ".concat(pkgName, " removed successfully!")));
|
|
96
|
+
return [3, 10];
|
|
97
|
+
case 9:
|
|
98
|
+
err_1 = _a.sent();
|
|
99
|
+
s.stop();
|
|
100
|
+
console.error(picocolors_1.default.red("\u00D7 Failed to remove component ".concat(packageName)), err_1);
|
|
101
|
+
return [3, 10];
|
|
102
|
+
case 10: return [2];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
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 __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.upgrade = upgrade;
|
|
54
|
+
var getCurrentPackageManager_1 = require("../utils/getCurrentPackageManager");
|
|
55
|
+
var prompts_1 = require("@clack/prompts");
|
|
56
|
+
var execa_1 = require("execa");
|
|
57
|
+
var picocolors_1 = __importDefault(require("picocolors"));
|
|
58
|
+
function upgrade(component, options) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60
|
+
var s, pkgManager, isAll, targets, versionSuffix, sLabel, targets_1, targets_1_1, pkg, fullSpecifier, e_1_1, err_1;
|
|
61
|
+
var e_1, _a;
|
|
62
|
+
return __generator(this, function (_b) {
|
|
63
|
+
switch (_b.label) {
|
|
64
|
+
case 0:
|
|
65
|
+
if (!component && !options.all) {
|
|
66
|
+
console.error(picocolors_1.default.red('× No component specified for upgrade.'));
|
|
67
|
+
console.log(picocolors_1.default.gray("Use: 'aristobyte-ui upgrade <component>' or 'aristobyte-ui upgrade --all'"));
|
|
68
|
+
process.exit(0);
|
|
69
|
+
}
|
|
70
|
+
s = (0, prompts_1.spinner)();
|
|
71
|
+
pkgManager = (0, getCurrentPackageManager_1.getCurrentPackageManager)();
|
|
72
|
+
_b.label = 1;
|
|
73
|
+
case 1:
|
|
74
|
+
_b.trys.push([1, 10, , 11]);
|
|
75
|
+
isAll = options.all || component === 'all';
|
|
76
|
+
targets = isAll ? ['@aristobyte-ui/react'] : component ? ["@aristobyte-ui/".concat(component)] : [];
|
|
77
|
+
if (targets.length === 0) {
|
|
78
|
+
console.error(picocolors_1.default.red('× No component specified for upgrade.'));
|
|
79
|
+
console.log(picocolors_1.default.gray('Use: aristobyte-ui upgrade <component> or --all'));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
versionSuffix = options.to ? "@".concat(options.to) : '';
|
|
83
|
+
sLabel = isAll ? 'Upgrading all AristoByteUI components...' : "Upgrading ".concat(targets.join(', '), "...");
|
|
84
|
+
s.start(sLabel);
|
|
85
|
+
_b.label = 2;
|
|
86
|
+
case 2:
|
|
87
|
+
_b.trys.push([2, 7, 8, 9]);
|
|
88
|
+
targets_1 = __values(targets), targets_1_1 = targets_1.next();
|
|
89
|
+
_b.label = 3;
|
|
90
|
+
case 3:
|
|
91
|
+
if (!!targets_1_1.done) return [3, 6];
|
|
92
|
+
pkg = targets_1_1.value;
|
|
93
|
+
fullSpecifier = "".concat(pkg).concat(versionSuffix);
|
|
94
|
+
return [4, (0, execa_1.execa)(pkgManager, ['upgrade', fullSpecifier], {
|
|
95
|
+
stdio: 'inherit',
|
|
96
|
+
})];
|
|
97
|
+
case 4:
|
|
98
|
+
_b.sent();
|
|
99
|
+
_b.label = 5;
|
|
100
|
+
case 5:
|
|
101
|
+
targets_1_1 = targets_1.next();
|
|
102
|
+
return [3, 3];
|
|
103
|
+
case 6: return [3, 9];
|
|
104
|
+
case 7:
|
|
105
|
+
e_1_1 = _b.sent();
|
|
106
|
+
e_1 = { error: e_1_1 };
|
|
107
|
+
return [3, 9];
|
|
108
|
+
case 8:
|
|
109
|
+
try {
|
|
110
|
+
if (targets_1_1 && !targets_1_1.done && (_a = targets_1.return)) _a.call(targets_1);
|
|
111
|
+
}
|
|
112
|
+
finally { if (e_1) throw e_1.error; }
|
|
113
|
+
return [7];
|
|
114
|
+
case 9:
|
|
115
|
+
s.stop();
|
|
116
|
+
console.log(picocolors_1.default.green("\u2714 Upgrade complete".concat(options.to ? " \u2192 version ".concat(options.to) : '', "!")));
|
|
117
|
+
return [3, 11];
|
|
118
|
+
case 10:
|
|
119
|
+
err_1 = _b.sent();
|
|
120
|
+
s.stop();
|
|
121
|
+
console.error(picocolors_1.default.red("\u00D7 Upgrade failed."));
|
|
122
|
+
console.error(picocolors_1.default.dim(String(err_1)));
|
|
123
|
+
return [3, 11];
|
|
124
|
+
case 11: return [2];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
+
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);
|
|
14
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
+
function step(op) {
|
|
17
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
+
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;
|
|
20
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
+
switch (op[0]) {
|
|
22
|
+
case 0: case 1: t = op; break;
|
|
23
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
+
default:
|
|
27
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
+
if (t[2]) _.ops.pop();
|
|
32
|
+
_.trys.pop(); continue;
|
|
33
|
+
}
|
|
34
|
+
op = body.call(thisArg, _);
|
|
35
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
40
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
41
|
+
if (!m) return o;
|
|
42
|
+
var i = m.call(o), r, ar = [], e;
|
|
43
|
+
try {
|
|
44
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
45
|
+
}
|
|
46
|
+
catch (error) { e = { error: error }; }
|
|
47
|
+
finally {
|
|
48
|
+
try {
|
|
49
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
50
|
+
}
|
|
51
|
+
finally { if (e) throw e.error; }
|
|
52
|
+
}
|
|
53
|
+
return ar;
|
|
54
|
+
};
|
|
55
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
56
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
57
|
+
if (ar || !(i in from)) {
|
|
58
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
59
|
+
ar[i] = from[i];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
63
|
+
};
|
|
64
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
65
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
66
|
+
};
|
|
67
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
|
+
var commander_1 = require("commander");
|
|
69
|
+
var add_1 = require("./commands/add");
|
|
70
|
+
var init_1 = require("./commands/init");
|
|
71
|
+
var remove_1 = require("./commands/remove");
|
|
72
|
+
var upgrade_1 = require("./commands/upgrade");
|
|
73
|
+
var list_1 = require("./commands/list");
|
|
74
|
+
var doctor_1 = require("./commands/doctor");
|
|
75
|
+
var env_1 = require("./commands/env");
|
|
76
|
+
var colors_1 = require("./utils/colors");
|
|
77
|
+
var typography_1 = require("./utils/typography");
|
|
78
|
+
var parseHelp_1 = require("./utils/parseHelp");
|
|
79
|
+
var package_json_1 = __importDefault(require("../../package.json"));
|
|
80
|
+
var COMMANDS = ['init', 'add', 'remove', 'upgrade', 'list', 'doctor', 'env', 'help'];
|
|
81
|
+
var aristobyteui = new commander_1.Command();
|
|
82
|
+
aristobyteui
|
|
83
|
+
.name('aristobyte-ui')
|
|
84
|
+
.usage((0, typography_1.usage)(['command', 'options']))
|
|
85
|
+
.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.')
|
|
86
|
+
.version(package_json_1.default.version, '-V, --version', 'Output the CLI version')
|
|
87
|
+
.helpOption('-H, --help', 'Show help information')
|
|
88
|
+
.configureHelp({
|
|
89
|
+
formatHelp: function (cmd, helper) { return (0, parseHelp_1.parseHelp)(cmd, helper); },
|
|
90
|
+
});
|
|
91
|
+
aristobyteui
|
|
92
|
+
.command('init [myProjectName]')
|
|
93
|
+
.usage((0, typography_1.usage)(['options', 'myProjectName']))
|
|
94
|
+
.description('Initialize a new AristoByteUI project')
|
|
95
|
+
.option('-LT, --list-templates', 'Display a list of available templates')
|
|
96
|
+
.option('-LPM, --list-package-managers', 'Display a list of available package managers')
|
|
97
|
+
.option('-T, --template <templateName>', 'Specify a template to use')
|
|
98
|
+
.option('-P, --package-manager <packageManager>', 'Select a package manager (npm, yarn, pnpm, bun)')
|
|
99
|
+
.configureHelp({
|
|
100
|
+
formatHelp: function (cmd, helper) { return (0, parseHelp_1.parseHelp)(cmd, helper); },
|
|
101
|
+
})
|
|
102
|
+
.action(init_1.init);
|
|
103
|
+
aristobyteui
|
|
104
|
+
.command('add [component]')
|
|
105
|
+
.usage((0, typography_1.usage)(['options', 'components...']))
|
|
106
|
+
.description('Add a UI component')
|
|
107
|
+
.option('-L, --list', 'Display a list of available packages, to be added')
|
|
108
|
+
.option('-P, --package-manager', 'Show the package manager used in current project')
|
|
109
|
+
.configureHelp({
|
|
110
|
+
formatHelp: function (cmd, helper) { return (0, parseHelp_1.parseHelp)(cmd, helper); },
|
|
111
|
+
})
|
|
112
|
+
.action(add_1.add);
|
|
113
|
+
aristobyteui
|
|
114
|
+
.command('remove [component]')
|
|
115
|
+
.usage((0, typography_1.usage)(['options', 'components...']))
|
|
116
|
+
.description('Remove a UI component')
|
|
117
|
+
.option('-L, --list', 'Display a list of installed packages, to be removed')
|
|
118
|
+
.option('-P, --package-manager', 'Show the package manager used in current project')
|
|
119
|
+
.configureHelp({
|
|
120
|
+
formatHelp: function (cmd, helper) { return (0, parseHelp_1.parseHelp)(cmd, helper); },
|
|
121
|
+
})
|
|
122
|
+
.action(remove_1.remove);
|
|
123
|
+
aristobyteui
|
|
124
|
+
.command('upgrade [component]')
|
|
125
|
+
.usage((0, typography_1.usage)(['options', 'components...']))
|
|
126
|
+
.description('Upgrade a UI component')
|
|
127
|
+
.option('-A, --all', 'Upgrade all AristoByteUI components')
|
|
128
|
+
.option('-T, --to <version>', 'Upgrade to a specific version')
|
|
129
|
+
.configureHelp({
|
|
130
|
+
formatHelp: function (cmd, helper) { return (0, parseHelp_1.parseHelp)(cmd, helper); },
|
|
131
|
+
})
|
|
132
|
+
.action(upgrade_1.upgrade);
|
|
133
|
+
aristobyteui
|
|
134
|
+
.command('list')
|
|
135
|
+
.usage((0, typography_1.usage)(['options']))
|
|
136
|
+
.description('List installed components')
|
|
137
|
+
.option('-A, --all', 'Display the list of all packages')
|
|
138
|
+
.option('-I, --installed', 'Display the list of installed packages')
|
|
139
|
+
.option('-O, --outdated', 'Check for available updates')
|
|
140
|
+
.configureHelp({
|
|
141
|
+
formatHelp: function (cmd, helper) { return (0, parseHelp_1.parseHelp)(cmd, helper); },
|
|
142
|
+
})
|
|
143
|
+
.action(function (options) { return (0, list_1.list)(options, true); });
|
|
144
|
+
aristobyteui
|
|
145
|
+
.command('doctor')
|
|
146
|
+
.usage((0, typography_1.usage)(['options']))
|
|
147
|
+
.description('Check system and project health')
|
|
148
|
+
.option('-A, --all', 'Run all diagnostics')
|
|
149
|
+
.option('-C, --configs', 'Validate project config files')
|
|
150
|
+
.option('-D, --deps', 'Validate installed AristoByteUI dependencies')
|
|
151
|
+
.option('-J, --json', 'Output diagnostics as JSON')
|
|
152
|
+
.option('-N, --network', 'Verify registry/network connectivity')
|
|
153
|
+
.option('-P, --pm', 'Check package manager state')
|
|
154
|
+
.option('-S, --system', 'Check system environment')
|
|
155
|
+
.configureHelp({
|
|
156
|
+
formatHelp: function (cmd, helper) { return (0, parseHelp_1.parseHelp)(cmd, helper); },
|
|
157
|
+
})
|
|
158
|
+
.action(doctor_1.doctor);
|
|
159
|
+
aristobyteui
|
|
160
|
+
.command('env')
|
|
161
|
+
.usage((0, typography_1.usage)(['options']))
|
|
162
|
+
.description('Display environment info')
|
|
163
|
+
.option('-A, --all', 'Display all environment diagnostics')
|
|
164
|
+
.option('-J, --json', 'Output environment info as JSON')
|
|
165
|
+
.option('-M, --pm', 'Show package manager details')
|
|
166
|
+
.option('-N, --network', 'Check registry/network connectivity')
|
|
167
|
+
.option('-P, --packages', 'Show installed AristoByteUI packages')
|
|
168
|
+
.option('-S, --system', 'Show system information')
|
|
169
|
+
.configureHelp({
|
|
170
|
+
formatHelp: function (cmd, helper) { return (0, parseHelp_1.parseHelp)(cmd, helper); },
|
|
171
|
+
})
|
|
172
|
+
.action(env_1.env);
|
|
173
|
+
aristobyteui
|
|
174
|
+
.command('help')
|
|
175
|
+
.usage((0, typography_1.usage)(['options']))
|
|
176
|
+
.description('Display help for command')
|
|
177
|
+
.action(env_1.env);
|
|
178
|
+
aristobyteui.command('help', { hidden: true });
|
|
179
|
+
aristobyteui.exitOverride(function (err) { return __awaiter(void 0, void 0, void 0, function () {
|
|
180
|
+
return __generator(this, function (_a) {
|
|
181
|
+
if (err.code === 'commander.unknownCommand') {
|
|
182
|
+
console.error.apply(console, __spreadArray([(0, colors_1.logoSmallGradient)(' ◆ Possible commands are: \n')], __read(COMMANDS.map(function (cmd) {
|
|
183
|
+
return cmd === err.message.split('Did you mean ')[1].split('?')[0]
|
|
184
|
+
? "".concat((0, colors_1.logoSmallGradient)('│ ')).concat((0, colors_1.logo4)('● aristobyte-ui'), " ").concat((0, colors_1.logo4)("".concat(cmd)), "\n")
|
|
185
|
+
: "".concat((0, colors_1.logoSmallGradient)('│ ○ aristobyte-ui'), " ").concat((0, colors_1.logo3)("".concat(cmd)), "\n");
|
|
186
|
+
})), false));
|
|
187
|
+
}
|
|
188
|
+
process.exit(1);
|
|
189
|
+
return [2];
|
|
190
|
+
});
|
|
191
|
+
}); });
|
|
192
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
193
|
+
var args, err_1;
|
|
194
|
+
return __generator(this, function (_a) {
|
|
195
|
+
switch (_a.label) {
|
|
196
|
+
case 0:
|
|
197
|
+
args = process.argv.slice(2);
|
|
198
|
+
if (args.length === 0) {
|
|
199
|
+
aristobyteui.outputHelp();
|
|
200
|
+
process.exit(0);
|
|
201
|
+
}
|
|
202
|
+
_a.label = 1;
|
|
203
|
+
case 1:
|
|
204
|
+
_a.trys.push([1, 3, , 4]);
|
|
205
|
+
return [4, aristobyteui.parseAsync(args, { from: 'user' })];
|
|
206
|
+
case 2:
|
|
207
|
+
_a.sent();
|
|
208
|
+
return [3, 4];
|
|
209
|
+
case 3:
|
|
210
|
+
err_1 = _a.sent();
|
|
211
|
+
console.error((0, colors_1.darkGrey)('Error:'), (0, colors_1.lightGrey)(err_1.message));
|
|
212
|
+
process.exit(1);
|
|
213
|
+
return [3, 4];
|
|
214
|
+
case 4: return [2];
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}); })();
|