@tacuchi/updater 2.0.0 → 2.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 +132 -121
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { render } from "ink";
|
|
|
5
5
|
import { execaSync } from "execa";
|
|
6
6
|
|
|
7
7
|
// src/app.tsx
|
|
8
|
-
import { Box as
|
|
8
|
+
import { Box as Box9, Text as Text10, useInput as useInput6, useApp as useInkApp } from "ink";
|
|
9
9
|
|
|
10
10
|
// src/hooks/use-app-machine.tsx
|
|
11
11
|
import { createContext, useContext, useReducer, useEffect, useRef, useCallback } from "react";
|
|
@@ -529,7 +529,9 @@ function fromDescriptor(d, cfg, deps = defaultDeps) {
|
|
|
529
529
|
const startedAt = Date.now();
|
|
530
530
|
if (d.escapeHatch?.upgrade) {
|
|
531
531
|
const r = yield* d.escapeHatch.upgrade(packages, c);
|
|
532
|
-
|
|
532
|
+
const result2 = { managerId: d.id, startedAt, finishedAt: Date.now(), ...r };
|
|
533
|
+
logResult(result2);
|
|
534
|
+
return result2;
|
|
533
535
|
}
|
|
534
536
|
const manual = d.manualCommand?.(c) ?? "";
|
|
535
537
|
if (d.kind === "readonly" || d.requiresAdmin && !c.sudoMode) {
|
|
@@ -695,7 +697,6 @@ var pip = {
|
|
|
695
697
|
yield { type: "phase", phase: "verifying", message: "Verificando resultado..." };
|
|
696
698
|
const after = await listOutdated();
|
|
697
699
|
const result = reconcile(packages, before, { stillOutdated: after.map((p) => ({ name: p.name })) }, commands);
|
|
698
|
-
logResult(result);
|
|
699
700
|
return result;
|
|
700
701
|
}
|
|
701
702
|
}
|
|
@@ -836,7 +837,6 @@ var gem = {
|
|
|
836
837
|
yield { type: "phase", phase: "verifying", message: "Verificando resultado..." };
|
|
837
838
|
const after = await listOutdated2();
|
|
838
839
|
const result = reconcile(packages, before, { stillOutdated: after.map((p) => ({ name: p.name })) }, commands);
|
|
839
|
-
logResult(result);
|
|
840
840
|
return result;
|
|
841
841
|
}
|
|
842
842
|
}
|
|
@@ -1154,7 +1154,6 @@ var flutter = {
|
|
|
1154
1154
|
const latest = await latestStable(ctx.platform);
|
|
1155
1155
|
const stillOutdated = after && latest && after !== latest ? [{ name: PACKAGE_NAME }] : [];
|
|
1156
1156
|
const result = reconcile(packages, before, { stillOutdated }, commands);
|
|
1157
|
-
logResult(result);
|
|
1158
1157
|
return result;
|
|
1159
1158
|
}
|
|
1160
1159
|
}
|
|
@@ -1217,7 +1216,6 @@ var angular = {
|
|
|
1217
1216
|
yield { type: "phase", phase: "verifying", message: "Verificando resultado..." };
|
|
1218
1217
|
const after = await listOutdated4();
|
|
1219
1218
|
const result = reconcile(packages, before, { stillOutdated: after.map((p) => ({ name: p.name })) }, commands);
|
|
1220
|
-
logResult(result);
|
|
1221
1219
|
return result;
|
|
1222
1220
|
}
|
|
1223
1221
|
}
|
|
@@ -1346,7 +1344,6 @@ var goLang = {
|
|
|
1346
1344
|
yield { type: "phase", phase: "verifying", message: "Verificando resultado..." };
|
|
1347
1345
|
const after = await listOutdated5();
|
|
1348
1346
|
const result = reconcile(packages, before, { stillOutdated: after.map((p) => ({ name: p.name })) }, commands);
|
|
1349
|
-
logResult(result);
|
|
1350
1347
|
return result;
|
|
1351
1348
|
}
|
|
1352
1349
|
}
|
|
@@ -1500,7 +1497,6 @@ var pnpm = {
|
|
|
1500
1497
|
yield { type: "phase", phase: "verifying", message: "Verificando resultado..." };
|
|
1501
1498
|
const after = await listOutdated6();
|
|
1502
1499
|
const result = reconcile(packages, before, { stillOutdated: after.map((p) => ({ name: p.name })) }, commands);
|
|
1503
|
-
logResult(result);
|
|
1504
1500
|
return result;
|
|
1505
1501
|
}
|
|
1506
1502
|
}
|
|
@@ -1588,7 +1584,6 @@ var yarn = {
|
|
|
1588
1584
|
manualCommand: BERRY_MANUAL,
|
|
1589
1585
|
managerId: "yarn"
|
|
1590
1586
|
};
|
|
1591
|
-
logResult(result2);
|
|
1592
1587
|
return result2;
|
|
1593
1588
|
}
|
|
1594
1589
|
yield { type: "phase", phase: "upgrading", message: "Actualizando yarn (global)..." };
|
|
@@ -1605,7 +1600,6 @@ var yarn = {
|
|
|
1605
1600
|
yield { type: "phase", phase: "verifying", message: "Verificando resultado..." };
|
|
1606
1601
|
const after = await listClassicOutdated();
|
|
1607
1602
|
const result = reconcile(packages, before, { stillOutdated: after.map((p) => ({ name: p.name })) }, commands);
|
|
1608
|
-
logResult(result);
|
|
1609
1603
|
return result;
|
|
1610
1604
|
}
|
|
1611
1605
|
}
|
|
@@ -1669,7 +1663,6 @@ var bun = {
|
|
|
1669
1663
|
}));
|
|
1670
1664
|
const stillOutdated = candidates.filter((name) => (afterMap.get(name) ?? beforeMap.get(name)) === beforeMap.get(name)).map((name) => ({ name }));
|
|
1671
1665
|
const result = reconcile(packages, before, { stillOutdated }, commands);
|
|
1672
|
-
logResult(result);
|
|
1673
1666
|
return result;
|
|
1674
1667
|
}
|
|
1675
1668
|
}
|
|
@@ -1810,7 +1803,6 @@ var asdf = {
|
|
|
1810
1803
|
const commands = [];
|
|
1811
1804
|
if (!before.length) {
|
|
1812
1805
|
const result2 = reconcile(packages, before, { stillOutdated: [] }, commands);
|
|
1813
|
-
logResult(result2);
|
|
1814
1806
|
return result2;
|
|
1815
1807
|
}
|
|
1816
1808
|
yield { type: "log", message: `Comando manual: ${MANUAL_COMMAND}` };
|
|
@@ -1831,7 +1823,6 @@ var asdf = {
|
|
|
1831
1823
|
toVersion: p.newVersion
|
|
1832
1824
|
}))
|
|
1833
1825
|
};
|
|
1834
|
-
logResult(result);
|
|
1835
1826
|
return result;
|
|
1836
1827
|
}
|
|
1837
1828
|
}
|
|
@@ -1983,7 +1974,6 @@ var pipx = {
|
|
|
1983
1974
|
const afterSnap = await snapshot();
|
|
1984
1975
|
const stillOutdated = before.filter((p) => afterSnap[p.name] === void 0 || afterSnap[p.name] === beforeSnap[p.name]).map((p) => ({ name: p.name }));
|
|
1985
1976
|
const result = reconcile(packages, before, { stillOutdated }, commands);
|
|
1986
|
-
logResult(result);
|
|
1987
1977
|
return result;
|
|
1988
1978
|
}
|
|
1989
1979
|
}
|
|
@@ -2906,6 +2896,9 @@ function DetectScreen() {
|
|
|
2906
2896
|
import { useState } from "react";
|
|
2907
2897
|
import { Box as Box4, Text as Text5, useInput } from "ink";
|
|
2908
2898
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2899
|
+
function clip(s, n) {
|
|
2900
|
+
return s.length > n ? s.slice(0, n - 1) + "\u2026" : s;
|
|
2901
|
+
}
|
|
2909
2902
|
function SelectScreen() {
|
|
2910
2903
|
const { state, toggleItem, selectAll, selectNone, goConfirm, openSettings } = useMachine();
|
|
2911
2904
|
const [cursor, setCursor] = useState(0);
|
|
@@ -2932,45 +2925,65 @@ function SelectScreen() {
|
|
|
2932
2925
|
/* @__PURE__ */ jsxs4(Text5, { color: semantic.success, children: [
|
|
2933
2926
|
"\u2713 ",
|
|
2934
2927
|
t("ui", "noUpdates")
|
|
2935
|
-
] })
|
|
2928
|
+
] }),
|
|
2929
|
+
/* @__PURE__ */ jsx6(Box4, { marginTop: 1, children: /* @__PURE__ */ jsxs4(Text5, { color: semantic.muted, children: [
|
|
2930
|
+
"R ",
|
|
2931
|
+
t("flow", "detecting"),
|
|
2932
|
+
" \xB7 Q"
|
|
2933
|
+
] }) })
|
|
2936
2934
|
] });
|
|
2937
2935
|
}
|
|
2938
|
-
|
|
2936
|
+
const width = Math.min((process.stdout.columns ?? 90) - 4, 92);
|
|
2937
|
+
const view = Math.max(6, (process.stdout.rows ?? 24) - 11);
|
|
2938
|
+
let start = clamped - Math.floor(view / 2);
|
|
2939
|
+
start = Math.max(0, Math.min(start, Math.max(0, rows.length - view)));
|
|
2940
|
+
const end = Math.min(rows.length, start + view);
|
|
2941
|
+
const visible = rows.slice(start, end);
|
|
2942
|
+
let prevManager = "";
|
|
2939
2943
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
2940
2944
|
/* @__PURE__ */ jsx6(StepHeader, { phase: state.phase }),
|
|
2941
2945
|
/* @__PURE__ */ jsxs4(Box4, { marginBottom: 1, children: [
|
|
2942
2946
|
/* @__PURE__ */ jsx6(Text5, { color: semantic.action, bold: true, children: state.selection.size }),
|
|
2943
2947
|
/* @__PURE__ */ jsxs4(Text5, { color: semantic.muted, children: [
|
|
2944
|
-
"
|
|
2948
|
+
" ",
|
|
2949
|
+
"/ ",
|
|
2945
2950
|
rows.length,
|
|
2946
2951
|
" ",
|
|
2947
2952
|
t("ui", "selected")
|
|
2948
2953
|
] })
|
|
2949
2954
|
] }),
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2955
|
+
start > 0 && /* @__PURE__ */ jsxs4(Text5, { color: colors.outline, children: [
|
|
2956
|
+
"\u25B2 ",
|
|
2957
|
+
start,
|
|
2958
|
+
" \u2191"
|
|
2959
|
+
] }),
|
|
2960
|
+
visible.map((r) => {
|
|
2961
|
+
const header = r.managerId !== prevManager ? managerName(r.managerId) : null;
|
|
2962
|
+
prevManager = r.managerId;
|
|
2953
2963
|
const selected = state.selection.has(selectionKey(r.managerId, r.pkg.name));
|
|
2954
|
-
const isCursor =
|
|
2964
|
+
const isCursor = rows[clamped] === r;
|
|
2955
2965
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
2956
2966
|
header && /* @__PURE__ */ jsx6(Text5, { color: semantic.muted, bold: true, children: header }),
|
|
2957
2967
|
/* @__PURE__ */ jsxs4(Box4, { children: [
|
|
2958
2968
|
/* @__PURE__ */ jsx6(Text5, { color: isCursor ? semantic.action : colors.outline, children: isCursor ? "\u276F " : " " }),
|
|
2959
|
-
/* @__PURE__ */
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
/* @__PURE__ */ jsx6(Box4, { width: 22, children: /* @__PURE__ */ jsx6(Text5, { color: semantic.text, bold: isCursor, children: r.pkg.name }) }),
|
|
2964
|
-
/* @__PURE__ */ jsxs4(Text5, { color: semantic.muted, children: [
|
|
2965
|
-
r.pkg.currentVersion,
|
|
2969
|
+
/* @__PURE__ */ jsx6(Text5, { color: selected ? semantic.success : colors.outline, children: selected ? "[\u2713] " : "[ ] " }),
|
|
2970
|
+
/* @__PURE__ */ jsx6(Box4, { width: 22, children: /* @__PURE__ */ jsx6(Text5, { color: semantic.text, bold: isCursor, children: clip(r.pkg.name, 21) }) }),
|
|
2971
|
+
/* @__PURE__ */ jsxs4(Text5, { color: semantic.muted, wrap: "truncate-end", children: [
|
|
2972
|
+
clip(r.pkg.currentVersion, 14),
|
|
2966
2973
|
" ",
|
|
2967
2974
|
/* @__PURE__ */ jsx6(Text5, { color: semantic.action, children: "\u2192" }),
|
|
2968
2975
|
" ",
|
|
2969
|
-
r.pkg.newVersion
|
|
2976
|
+
clip(r.pkg.newVersion, 14)
|
|
2970
2977
|
] })
|
|
2971
2978
|
] })
|
|
2972
|
-
] }, `${r.managerId}
|
|
2973
|
-
})
|
|
2979
|
+
] }, `${r.managerId}:${r.pkg.name}`);
|
|
2980
|
+
}),
|
|
2981
|
+
end < rows.length && /* @__PURE__ */ jsxs4(Text5, { color: colors.outline, children: [
|
|
2982
|
+
"\u25BC ",
|
|
2983
|
+
rows.length - end,
|
|
2984
|
+
" \u2193"
|
|
2985
|
+
] }),
|
|
2986
|
+
/* @__PURE__ */ jsx6(Box4, { marginTop: 1, children: /* @__PURE__ */ jsx6(Text5, { color: semantic.muted, children: clip(t("ui", "selectHint"), width) }) })
|
|
2974
2987
|
] });
|
|
2975
2988
|
}
|
|
2976
2989
|
|
|
@@ -3010,11 +3023,7 @@ function ConfirmScreen() {
|
|
|
3010
3023
|
|
|
3011
3024
|
// src/screens/update.tsx
|
|
3012
3025
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
3013
|
-
import { Box as
|
|
3014
|
-
|
|
3015
|
-
// src/components/log-pane.tsx
|
|
3016
|
-
import React4 from "react";
|
|
3017
|
-
import { Box as Box6, Text as Text7 } from "ink";
|
|
3026
|
+
import { Box as Box6, Text as Text7, useInput as useInput3 } from "ink";
|
|
3018
3027
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3019
3028
|
var levelColor = {
|
|
3020
3029
|
info: colors.onSurfaceVariant,
|
|
@@ -3023,28 +3032,23 @@ var levelColor = {
|
|
|
3023
3032
|
error: semantic.error,
|
|
3024
3033
|
success: semantic.success
|
|
3025
3034
|
};
|
|
3026
|
-
function
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
slice.length === 0 ? /* @__PURE__ */ jsx8(Text7, { color: colors.outline, dimColor: true, children: "(sin actividad)" }) : slice.map((e) => /* @__PURE__ */ jsx8(Text7, { color: levelColor[e.level], wrap: "truncate-end", children: e.message.slice(0, clip) }, e.id))
|
|
3035
|
+
function clip2(s, n) {
|
|
3036
|
+
return s.length > n ? s.slice(0, n - 1) + "\u2026" : s;
|
|
3037
|
+
}
|
|
3038
|
+
function UpdateRow({ e, width }) {
|
|
3039
|
+
const detail = e.status === "running" ? `${e.percent > 0 ? `${e.percent}% ` : ""}${e.currentPackage ?? ""}` : e.status === "skipped" ? "manual" : "";
|
|
3040
|
+
return /* @__PURE__ */ jsxs6(Box6, { children: [
|
|
3041
|
+
/* @__PURE__ */ jsx8(Box6, { width: 2, children: /* @__PURE__ */ jsx8(StatusGlyph, { status: e.status }) }),
|
|
3042
|
+
/* @__PURE__ */ jsx8(Box6, { width: 16, children: /* @__PURE__ */ jsx8(Text7, { color: semantic.text, bold: e.status === "running", children: clip2(managerName(e.id), 15) }) }),
|
|
3043
|
+
/* @__PURE__ */ jsx8(Box6, { width: 13, children: /* @__PURE__ */ jsx8(Text7, { color: statusColor(e.status), children: t("status", e.status) }) }),
|
|
3044
|
+
/* @__PURE__ */ jsx8(Text7, { color: semantic.muted, children: clip2(detail, Math.max(0, width - 33)) })
|
|
3037
3045
|
] });
|
|
3038
3046
|
}
|
|
3039
|
-
var LogPane = React4.memo(LogPaneImpl);
|
|
3040
|
-
|
|
3041
|
-
// src/screens/update.tsx
|
|
3042
|
-
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3043
3047
|
function UpdateScreen() {
|
|
3044
3048
|
const { state, cancelRun } = useMachine();
|
|
3045
|
-
const [logs, setLogs] = useState2(
|
|
3049
|
+
const [logs, setLogs] = useState2(getLogEntries);
|
|
3046
3050
|
useEffect2(() => {
|
|
3047
|
-
const id = setInterval(() => setLogs(getLogEntries()),
|
|
3051
|
+
const id = setInterval(() => setLogs(getLogEntries()), 300);
|
|
3048
3052
|
return () => clearInterval(id);
|
|
3049
3053
|
}, []);
|
|
3050
3054
|
useInput3((_input, key) => {
|
|
@@ -3052,44 +3056,51 @@ function UpdateScreen() {
|
|
|
3052
3056
|
});
|
|
3053
3057
|
const total = state.run.queue.length;
|
|
3054
3058
|
const finished = state.run.doneCount + state.run.failedCount + state.run.skippedCount;
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
+
const width = Math.min((process.stdout.columns ?? 90) - 4, 92);
|
|
3060
|
+
const LOG_LINES = 6;
|
|
3061
|
+
const tail2 = logs.slice(-LOG_LINES);
|
|
3062
|
+
const pad = LOG_LINES - tail2.length;
|
|
3063
|
+
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
|
|
3064
|
+
/* @__PURE__ */ jsx8(StepHeader, { phase: state.phase }),
|
|
3065
|
+
/* @__PURE__ */ jsxs6(Box6, { marginBottom: 1, children: [
|
|
3066
|
+
/* @__PURE__ */ jsxs6(Text7, { color: semantic.text, bold: true, children: [
|
|
3059
3067
|
finished,
|
|
3060
3068
|
"/",
|
|
3061
3069
|
total,
|
|
3062
3070
|
" "
|
|
3063
3071
|
] }),
|
|
3064
|
-
/* @__PURE__ */
|
|
3065
|
-
"
|
|
3072
|
+
/* @__PURE__ */ jsxs6(Text7, { color: semantic.success, children: [
|
|
3073
|
+
"OK ",
|
|
3066
3074
|
state.run.doneCount,
|
|
3067
3075
|
" "
|
|
3068
3076
|
] }),
|
|
3069
|
-
/* @__PURE__ */
|
|
3070
|
-
"
|
|
3077
|
+
/* @__PURE__ */ jsxs6(Text7, { color: semantic.error, children: [
|
|
3078
|
+
"ERR ",
|
|
3071
3079
|
state.run.failedCount,
|
|
3072
3080
|
" "
|
|
3073
3081
|
] }),
|
|
3074
|
-
/* @__PURE__ */
|
|
3075
|
-
"
|
|
3082
|
+
/* @__PURE__ */ jsxs6(Text7, { color: semantic.warning, children: [
|
|
3083
|
+
"MAN ",
|
|
3076
3084
|
state.run.skippedCount
|
|
3077
3085
|
] })
|
|
3078
3086
|
] }),
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
+
state.run.queue.map((id) => {
|
|
3088
|
+
const e = state.managers[id];
|
|
3089
|
+
return e ? /* @__PURE__ */ jsx8(UpdateRow, { e, width }, id) : null;
|
|
3090
|
+
}),
|
|
3091
|
+
/* @__PURE__ */ jsx8(Box6, { marginTop: 1, children: /* @__PURE__ */ jsxs6(Text7, { color: colors.outline, children: [
|
|
3092
|
+
"\u2500".repeat(Math.min(width, 60)),
|
|
3093
|
+
" STDOUT"
|
|
3094
|
+
] }) }),
|
|
3095
|
+
tail2.map((e) => /* @__PURE__ */ jsx8(Text7, { color: levelColor[e.level], wrap: "truncate-end", children: clip2(e.message, width) }, e.id)),
|
|
3096
|
+
Array.from({ length: Math.max(0, pad) }, (_, i) => /* @__PURE__ */ jsx8(Text7, { children: " " }, `pad-${i}`)),
|
|
3097
|
+
/* @__PURE__ */ jsx8(Box6, { marginTop: 1, children: /* @__PURE__ */ jsx8(Text7, { color: semantic.muted, children: t("ui", "updatingHint") }) })
|
|
3087
3098
|
] });
|
|
3088
3099
|
}
|
|
3089
3100
|
|
|
3090
3101
|
// src/screens/summary.tsx
|
|
3091
|
-
import { Box as
|
|
3092
|
-
import { jsx as
|
|
3102
|
+
import { Box as Box7, Text as Text8, useInput as useInput4 } from "ink";
|
|
3103
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3093
3104
|
function SummaryScreen() {
|
|
3094
3105
|
const { state, rescan } = useMachine();
|
|
3095
3106
|
useInput4((input) => {
|
|
@@ -3116,61 +3127,61 @@ function SummaryScreen() {
|
|
|
3116
3127
|
}
|
|
3117
3128
|
}
|
|
3118
3129
|
const hasErrors = failed > 0;
|
|
3119
|
-
return /* @__PURE__ */
|
|
3120
|
-
/* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
/* @__PURE__ */
|
|
3130
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
3131
|
+
/* @__PURE__ */ jsx9(StepHeader, { phase: state.phase }),
|
|
3132
|
+
/* @__PURE__ */ jsx9(Box7, { marginBottom: 1, children: /* @__PURE__ */ jsx9(Text8, { color: hasErrors ? semantic.error : semantic.success, bold: true, children: hasErrors ? `\u2717 ${t("ui", "withErrors")}` : `\u2713 ${t("ui", "allDone")}` }) }),
|
|
3133
|
+
/* @__PURE__ */ jsxs7(Box7, { marginBottom: 1, children: [
|
|
3134
|
+
/* @__PURE__ */ jsxs7(Text8, { color: semantic.success, children: [
|
|
3124
3135
|
upgraded,
|
|
3125
3136
|
" ",
|
|
3126
3137
|
t("ui", "upgraded")
|
|
3127
3138
|
] }),
|
|
3128
|
-
/* @__PURE__ */
|
|
3129
|
-
/* @__PURE__ */
|
|
3139
|
+
/* @__PURE__ */ jsx9(Text8, { color: semantic.muted, children: " \xB7 " }),
|
|
3140
|
+
/* @__PURE__ */ jsxs7(Text8, { color: hasErrors ? semantic.error : semantic.muted, children: [
|
|
3130
3141
|
failed,
|
|
3131
3142
|
" ",
|
|
3132
3143
|
t("ui", "failed")
|
|
3133
3144
|
] }),
|
|
3134
|
-
/* @__PURE__ */
|
|
3135
|
-
/* @__PURE__ */
|
|
3145
|
+
/* @__PURE__ */ jsx9(Text8, { color: semantic.muted, children: " \xB7 " }),
|
|
3146
|
+
/* @__PURE__ */ jsxs7(Text8, { color: semantic.warning, children: [
|
|
3136
3147
|
skipped,
|
|
3137
3148
|
" ",
|
|
3138
3149
|
t("ui", "skipped")
|
|
3139
3150
|
] })
|
|
3140
3151
|
] }),
|
|
3141
|
-
failures.length > 0 && /* @__PURE__ */
|
|
3152
|
+
failures.length > 0 && /* @__PURE__ */ jsx9(Box7, { flexDirection: "column", marginBottom: 1, children: failures.slice(0, 8).map((f, i) => /* @__PURE__ */ jsxs7(Text8, { color: semantic.error, wrap: "truncate-end", children: [
|
|
3142
3153
|
"\u2717 ",
|
|
3143
3154
|
managerName(f.manager),
|
|
3144
3155
|
": ",
|
|
3145
3156
|
f.message,
|
|
3146
|
-
f.kind ? /* @__PURE__ */
|
|
3157
|
+
f.kind ? /* @__PURE__ */ jsxs7(Text8, { color: semantic.muted, children: [
|
|
3147
3158
|
" [",
|
|
3148
3159
|
f.kind,
|
|
3149
3160
|
"]"
|
|
3150
3161
|
] }) : null
|
|
3151
3162
|
] }, i)) }),
|
|
3152
|
-
manuals.length > 0 && /* @__PURE__ */
|
|
3153
|
-
/* @__PURE__ */
|
|
3154
|
-
manuals.map((m, i) => /* @__PURE__ */
|
|
3163
|
+
manuals.length > 0 && /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", marginBottom: 1, children: [
|
|
3164
|
+
/* @__PURE__ */ jsx9(Text8, { color: semantic.warning, children: t("ui", "manualNeeded") }),
|
|
3165
|
+
manuals.map((m, i) => /* @__PURE__ */ jsxs7(Text8, { color: semantic.muted, children: [
|
|
3155
3166
|
" ",
|
|
3156
3167
|
managerName(m.manager),
|
|
3157
3168
|
": ",
|
|
3158
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx9(Text8, { color: semantic.text, children: m.command })
|
|
3159
3170
|
] }, i))
|
|
3160
3171
|
] }),
|
|
3161
|
-
hasErrors && /* @__PURE__ */
|
|
3172
|
+
hasErrors && /* @__PURE__ */ jsxs7(Text8, { color: semantic.muted, children: [
|
|
3162
3173
|
t("ui", "logAt"),
|
|
3163
3174
|
" ",
|
|
3164
3175
|
getLogFilePath() ?? "~/.tacuchi-updater/logs/"
|
|
3165
3176
|
] }),
|
|
3166
|
-
/* @__PURE__ */
|
|
3177
|
+
/* @__PURE__ */ jsx9(Box7, { marginTop: 1, children: /* @__PURE__ */ jsx9(Text8, { color: semantic.muted, children: t("ui", "summaryHint") }) })
|
|
3167
3178
|
] });
|
|
3168
3179
|
}
|
|
3169
3180
|
|
|
3170
3181
|
// src/screens/settings-screen.tsx
|
|
3171
3182
|
import { useState as useState3 } from "react";
|
|
3172
|
-
import { Box as
|
|
3173
|
-
import { jsx as
|
|
3183
|
+
import { Box as Box8, Text as Text9, useInput as useInput5 } from "ink";
|
|
3184
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3174
3185
|
function SettingsScreen() {
|
|
3175
3186
|
const { state, toggleEnabled, setLang, closeSettings } = useMachine();
|
|
3176
3187
|
const ids = state.order;
|
|
@@ -3187,35 +3198,35 @@ function SettingsScreen() {
|
|
|
3187
3198
|
setLang(state.config.language === "es" ? "en" : "es");
|
|
3188
3199
|
}
|
|
3189
3200
|
});
|
|
3190
|
-
return /* @__PURE__ */
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3194
|
-
/* @__PURE__ */
|
|
3195
|
-
/* @__PURE__ */
|
|
3201
|
+
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
|
|
3202
|
+
/* @__PURE__ */ jsx10(StepHeader, { phase: "settings" }),
|
|
3203
|
+
/* @__PURE__ */ jsxs8(Box8, { marginBottom: 1, children: [
|
|
3204
|
+
/* @__PURE__ */ jsx10(Text9, { color: semantic.text, children: "Idioma / Language: " }),
|
|
3205
|
+
/* @__PURE__ */ jsx10(Text9, { color: semantic.action, bold: true, children: state.config.language.toUpperCase() }),
|
|
3206
|
+
/* @__PURE__ */ jsx10(Text9, { color: semantic.muted, children: " (L)" })
|
|
3196
3207
|
] }),
|
|
3197
3208
|
ids.map((id, i) => {
|
|
3198
3209
|
const enabled = isManagerEnabled(state.config, id);
|
|
3199
3210
|
const isCursor = i === clamped;
|
|
3200
|
-
return /* @__PURE__ */
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3211
|
+
return /* @__PURE__ */ jsxs8(Box8, { children: [
|
|
3212
|
+
/* @__PURE__ */ jsx10(Text9, { color: isCursor ? semantic.action : colors.outline, children: isCursor ? "\u276F " : " " }),
|
|
3213
|
+
/* @__PURE__ */ jsxs8(Text9, { color: enabled ? semantic.success : colors.outline, children: [
|
|
3203
3214
|
enabled ? "[on ]" : "[off]",
|
|
3204
3215
|
" "
|
|
3205
3216
|
] }),
|
|
3206
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ jsx10(Text9, { color: enabled ? semantic.text : semantic.muted, children: managerName(id) })
|
|
3207
3218
|
] }, id);
|
|
3208
3219
|
}),
|
|
3209
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ jsx10(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text9, { color: semantic.muted, children: "Espacio activar/desactivar \xB7 L idioma \xB7 Esc volver" }) })
|
|
3210
3221
|
] });
|
|
3211
3222
|
}
|
|
3212
3223
|
|
|
3213
3224
|
// src/app.tsx
|
|
3214
|
-
import { jsx as
|
|
3225
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3215
3226
|
function Header({ sudoMode: sudoMode2 }) {
|
|
3216
|
-
return /* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
3227
|
+
return /* @__PURE__ */ jsxs9(Box9, { justifyContent: "space-between", marginBottom: 1, children: [
|
|
3228
|
+
/* @__PURE__ */ jsx11(Text10, { color: semantic.action, bold: true, children: "@tacuchi/updater" }),
|
|
3229
|
+
/* @__PURE__ */ jsx11(Text10, { color: sudoMode2 ? semantic.warning : colors.outline, children: sudoMode2 ? "SUDO" : `${process.platform}` })
|
|
3219
3230
|
] });
|
|
3220
3231
|
}
|
|
3221
3232
|
function PhaseRouter() {
|
|
@@ -3224,17 +3235,17 @@ function PhaseRouter() {
|
|
|
3224
3235
|
case "boot":
|
|
3225
3236
|
case "detecting":
|
|
3226
3237
|
case "scanning":
|
|
3227
|
-
return /* @__PURE__ */
|
|
3238
|
+
return /* @__PURE__ */ jsx11(DetectScreen, {});
|
|
3228
3239
|
case "select":
|
|
3229
|
-
return /* @__PURE__ */
|
|
3240
|
+
return /* @__PURE__ */ jsx11(SelectScreen, {});
|
|
3230
3241
|
case "confirm":
|
|
3231
|
-
return /* @__PURE__ */
|
|
3242
|
+
return /* @__PURE__ */ jsx11(ConfirmScreen, {});
|
|
3232
3243
|
case "updating":
|
|
3233
|
-
return /* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsx11(UpdateScreen, {});
|
|
3234
3245
|
case "summary":
|
|
3235
|
-
return /* @__PURE__ */
|
|
3246
|
+
return /* @__PURE__ */ jsx11(SummaryScreen, {});
|
|
3236
3247
|
case "settings":
|
|
3237
|
-
return /* @__PURE__ */
|
|
3248
|
+
return /* @__PURE__ */ jsx11(SettingsScreen, {});
|
|
3238
3249
|
default:
|
|
3239
3250
|
return null;
|
|
3240
3251
|
}
|
|
@@ -3247,18 +3258,18 @@ function Shell({ sudoMode: sudoMode2 }) {
|
|
|
3247
3258
|
process.exit(0);
|
|
3248
3259
|
}
|
|
3249
3260
|
});
|
|
3250
|
-
return /* @__PURE__ */
|
|
3251
|
-
/* @__PURE__ */
|
|
3252
|
-
/* @__PURE__ */
|
|
3261
|
+
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", paddingX: 1, width: Math.min(process.stdout.columns ?? 100, 100), children: [
|
|
3262
|
+
/* @__PURE__ */ jsx11(Header, { sudoMode: sudoMode2 }),
|
|
3263
|
+
/* @__PURE__ */ jsx11(PhaseRouter, {})
|
|
3253
3264
|
] });
|
|
3254
3265
|
}
|
|
3255
3266
|
function App({ sudoMode: sudoMode2 = false }) {
|
|
3256
3267
|
const machine = useAppMachine(sudoMode2);
|
|
3257
|
-
return /* @__PURE__ */
|
|
3268
|
+
return /* @__PURE__ */ jsx11(MachineProvider, { value: machine, children: /* @__PURE__ */ jsx11(Shell, { sudoMode: sudoMode2 }) });
|
|
3258
3269
|
}
|
|
3259
3270
|
|
|
3260
3271
|
// src/cli.tsx
|
|
3261
|
-
import { jsx as
|
|
3272
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
3262
3273
|
var args = process.argv.slice(2);
|
|
3263
3274
|
var sudoRequested = args.includes("--sudo") || args.includes("-s");
|
|
3264
3275
|
var isRoot = process.getuid?.() === 0;
|
|
@@ -3284,10 +3295,10 @@ if (args.includes("--version") || args.includes("-v")) {
|
|
|
3284
3295
|
process.exit(0);
|
|
3285
3296
|
}
|
|
3286
3297
|
if (sudoRequested && process.platform === "win32") {
|
|
3287
|
-
console.log("\x1B[33m\
|
|
3298
|
+
console.log("\x1B[33m\xBB En Windows, ejecuta la terminal como Administrador en vez de usar --sudo\x1B[0m");
|
|
3288
3299
|
}
|
|
3289
3300
|
if (sudoRequested && !isRoot && process.platform !== "win32") {
|
|
3290
|
-
console.log("\x1B[35m\
|
|
3301
|
+
console.log("\x1B[35m\xBB Modo SUDO: ingresa tu contrase\xF1a para continuar...\x1B[0m");
|
|
3291
3302
|
try {
|
|
3292
3303
|
const scriptPath = process.argv[1] ?? "";
|
|
3293
3304
|
const isDevMode = scriptPath.endsWith(".tsx") || scriptPath.endsWith(".ts");
|
|
@@ -3303,7 +3314,7 @@ if (sudoRequested && !isRoot && process.platform !== "win32") {
|
|
|
3303
3314
|
}
|
|
3304
3315
|
}
|
|
3305
3316
|
var sudoMode = isRoot || sudoRequested;
|
|
3306
|
-
var { unmount } = render(/* @__PURE__ */
|
|
3317
|
+
var { unmount } = render(/* @__PURE__ */ jsx12(App, { sudoMode }));
|
|
3307
3318
|
process.on("SIGINT", () => {
|
|
3308
3319
|
unmount();
|
|
3309
3320
|
process.exit(0);
|