@jvittechs/jai1-cli 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +38 -18
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var NetworkError = class extends Jai1Error {
|
|
|
33
33
|
// package.json
|
|
34
34
|
var package_default = {
|
|
35
35
|
name: "@jvittechs/jai1-cli",
|
|
36
|
-
version: "1.0.
|
|
36
|
+
version: "1.0.1",
|
|
37
37
|
description: "A unified CLI tool for JV-IT TECHS developers to manage Jai1 Framework. Please contact TeamAI for usage instructions.",
|
|
38
38
|
type: "module",
|
|
39
39
|
bin: {
|
|
@@ -1358,6 +1358,7 @@ var UnifiedApplyApp = ({
|
|
|
1358
1358
|
const [cursorIndex, setCursorIndex] = useState(0);
|
|
1359
1359
|
const [focusArea, setFocusArea] = useState("packages");
|
|
1360
1360
|
const [selectedPackageIndex, setSelectedPackageIndex] = useState(0);
|
|
1361
|
+
const [activePackageFilter, setActivePackageFilter] = useState(null);
|
|
1361
1362
|
const [installProgress, setInstallProgress] = useState([]);
|
|
1362
1363
|
const [installStats, setInstallStats] = useState({ total: 0, completed: 0, added: 0, updated: 0, failed: 0 });
|
|
1363
1364
|
const [availableIdes, setAvailableIdes] = useState([]);
|
|
@@ -1377,6 +1378,9 @@ var UnifiedApplyApp = ({
|
|
|
1377
1378
|
setComponents(comps);
|
|
1378
1379
|
setTags(tagList);
|
|
1379
1380
|
setInstalledPaths(new Set(Object.keys(installed)));
|
|
1381
|
+
if (tagList.length > 0) {
|
|
1382
|
+
setActivePackageFilter(tagList[0].tag);
|
|
1383
|
+
}
|
|
1380
1384
|
setLoading(false);
|
|
1381
1385
|
} catch (err) {
|
|
1382
1386
|
setError(err instanceof Error ? err.message : "Failed to load");
|
|
@@ -1387,18 +1391,17 @@ var UnifiedApplyApp = ({
|
|
|
1387
1391
|
setAvailableIdes(getMigrationIDEs());
|
|
1388
1392
|
}, []);
|
|
1389
1393
|
const filteredComponents = useMemo(() => {
|
|
1390
|
-
if (
|
|
1391
|
-
|
|
1392
|
-
if (selectedTag) {
|
|
1393
|
-
return components.filter((c) => c.tags?.includes(selectedTag.tag));
|
|
1394
|
-
}
|
|
1394
|
+
if (activePackageFilter) {
|
|
1395
|
+
return components.filter((c) => c.tags?.includes(activePackageFilter));
|
|
1395
1396
|
}
|
|
1396
|
-
if (
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1397
|
+
if (searchQuery.trim()) {
|
|
1398
|
+
const query = searchQuery.toLowerCase();
|
|
1399
|
+
return components.filter(
|
|
1400
|
+
(c) => c.filepath.toLowerCase().includes(query) || c.tags?.some((t) => t.toLowerCase().includes(query))
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1403
|
+
return components;
|
|
1404
|
+
}, [components, searchQuery, activePackageFilter]);
|
|
1402
1405
|
useInput((input5, key) => {
|
|
1403
1406
|
if (viewState === "done") {
|
|
1404
1407
|
if (key.return || input5 === "q" || key.escape) {
|
|
@@ -1452,9 +1455,16 @@ var UnifiedApplyApp = ({
|
|
|
1452
1455
|
return;
|
|
1453
1456
|
}
|
|
1454
1457
|
if (key.tab) {
|
|
1455
|
-
if (focusArea === "packages")
|
|
1456
|
-
|
|
1457
|
-
else
|
|
1458
|
+
if (focusArea === "packages") {
|
|
1459
|
+
setFocusArea("components");
|
|
1460
|
+
} else if (focusArea === "components") {
|
|
1461
|
+
setFocusArea("search");
|
|
1462
|
+
setActivePackageFilter(null);
|
|
1463
|
+
} else {
|
|
1464
|
+
setFocusArea("packages");
|
|
1465
|
+
const tag = tags[selectedPackageIndex];
|
|
1466
|
+
if (tag) setActivePackageFilter(tag.tag);
|
|
1467
|
+
}
|
|
1458
1468
|
return;
|
|
1459
1469
|
}
|
|
1460
1470
|
if (key.escape || input5 === "q") {
|
|
@@ -1502,9 +1512,19 @@ var UnifiedApplyApp = ({
|
|
|
1502
1512
|
}
|
|
1503
1513
|
if (focusArea === "packages") {
|
|
1504
1514
|
if (key.leftArrow) {
|
|
1505
|
-
setSelectedPackageIndex((prev) =>
|
|
1515
|
+
setSelectedPackageIndex((prev) => {
|
|
1516
|
+
const newIndex = Math.max(0, prev - 1);
|
|
1517
|
+
const tag = tags[newIndex];
|
|
1518
|
+
if (tag) setActivePackageFilter(tag.tag);
|
|
1519
|
+
return newIndex;
|
|
1520
|
+
});
|
|
1506
1521
|
} else if (key.rightArrow) {
|
|
1507
|
-
setSelectedPackageIndex((prev) =>
|
|
1522
|
+
setSelectedPackageIndex((prev) => {
|
|
1523
|
+
const newIndex = Math.min(tags.length - 1, prev + 1);
|
|
1524
|
+
const tag = tags[newIndex];
|
|
1525
|
+
if (tag) setActivePackageFilter(tag.tag);
|
|
1526
|
+
return newIndex;
|
|
1527
|
+
});
|
|
1508
1528
|
} else if (input5 === " " || key.return) {
|
|
1509
1529
|
const tag = tags[selectedPackageIndex];
|
|
1510
1530
|
if (tag) {
|
|
@@ -1648,7 +1668,7 @@ var UnifiedApplyApp = ({
|
|
|
1648
1668
|
tag.count,
|
|
1649
1669
|
"]"
|
|
1650
1670
|
));
|
|
1651
|
-
})), focusArea === "packages" && tags.length > 0 && /* @__PURE__ */ React3.createElement(Box2, { marginTop: 1 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "\u2190 \u2192 to browse packages \xB7 Space/Enter to select package"))), /* @__PURE__ */ React3.createElement(Box2, { flexDirection: "column", borderStyle: "round", borderColor: focusArea === "components" ? "cyan" : "gray", padding: 1 }, /* @__PURE__ */ React3.createElement(Box2, { marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Text3, { bold: true }, "Components "),
|
|
1671
|
+
})), focusArea === "packages" && tags.length > 0 && /* @__PURE__ */ React3.createElement(Box2, { marginTop: 1 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "\u2190 \u2192 to browse packages \xB7 Space/Enter to select package"))), /* @__PURE__ */ React3.createElement(Box2, { flexDirection: "column", borderStyle: "round", borderColor: focusArea === "components" ? "cyan" : "gray", padding: 1 }, /* @__PURE__ */ React3.createElement(Box2, { marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Text3, { bold: true }, "Components "), activePackageFilter && /* @__PURE__ */ React3.createElement(Text3, { color: "cyan" }, "[", activePackageFilter, "] "), /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "(", filteredComponents.length, " shown", hasMore ? `, scroll for more` : "", ")")), visibleComponents.map((comp, i) => {
|
|
1652
1672
|
const isCursor = i === cursorIndex && focusArea === "components";
|
|
1653
1673
|
const isChecked = selectedPaths.has(comp.filepath);
|
|
1654
1674
|
const isInstalled = installedPaths.has(comp.filepath);
|