@b64hub/sfpm-cli 0.1.0 → 0.3.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/LICENSE +21 -0
- package/README.md +406 -202
- package/dist/commands/add.d.ts +10 -0
- package/dist/commands/add.js +50 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/bootstrap.d.ts +39 -5
- package/dist/commands/bootstrap.js +463 -167
- package/dist/commands/bootstrap.js.map +1 -1
- package/dist/commands/build/index.d.ts +69 -0
- package/dist/commands/build/index.js +416 -0
- package/dist/commands/build/index.js.map +1 -0
- package/dist/commands/build/status.d.ts +3 -4
- package/dist/commands/build/status.js +13 -162
- package/dist/commands/build/status.js.map +1 -1
- package/dist/commands/deploy/artifact.d.ts +15 -13
- package/dist/commands/deploy/artifact.js +31 -88
- package/dist/commands/deploy/artifact.js.map +1 -1
- package/dist/commands/deploy/index.d.ts +50 -0
- package/dist/commands/deploy/index.js +150 -0
- package/dist/commands/deploy/index.js.map +1 -0
- package/dist/commands/dev/pool-list-replay.d.ts +11 -0
- package/dist/commands/dev/pool-list-replay.js +19 -0
- package/dist/commands/dev/pool-list-replay.js.map +1 -0
- package/dist/commands/dev/pool-replay.d.ts +16 -0
- package/dist/commands/dev/pool-replay.js +81 -0
- package/dist/commands/dev/pool-replay.js.map +1 -0
- package/dist/commands/dev/replay.d.ts +21 -0
- package/dist/commands/dev/replay.js +103 -0
- package/dist/commands/dev/replay.js.map +1 -0
- package/dist/commands/install.d.ts +10 -4
- package/dist/commands/install.js +60 -71
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/package/create.d.ts +31 -0
- package/dist/commands/package/create.js +270 -0
- package/dist/commands/package/create.js.map +1 -0
- package/dist/commands/pool/delete.d.ts +4 -5
- package/dist/commands/pool/delete.js +64 -52
- package/dist/commands/pool/delete.js.map +1 -1
- package/dist/commands/pool/fetch.d.ts +5 -4
- package/dist/commands/pool/fetch.js +90 -59
- package/dist/commands/pool/fetch.js.map +1 -1
- package/dist/commands/pool/fill.d.ts +22 -0
- package/dist/commands/pool/fill.js +171 -0
- package/dist/commands/pool/fill.js.map +1 -0
- package/dist/commands/pool/list.d.ts +3 -6
- package/dist/commands/pool/list.js +60 -58
- package/dist/commands/pool/list.js.map +1 -1
- package/dist/commands/{project.d.ts → project/index.d.ts} +1 -1
- package/dist/commands/{project.js → project/index.js} +6 -6
- package/dist/commands/project/index.js.map +1 -0
- package/dist/commands/project/init/turbo.js +3 -11
- package/dist/commands/project/init/turbo.js.map +1 -1
- package/dist/commands/project/sync.js +2 -10
- package/dist/commands/project/sync.js.map +1 -1
- package/dist/commands/project/version/bump.js +12 -13
- package/dist/commands/project/version/bump.js.map +1 -1
- package/dist/commands/publish.d.ts +14 -0
- package/dist/commands/publish.js +60 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/watch/cancel.d.ts +12 -0
- package/dist/commands/watch/cancel.js +44 -0
- package/dist/commands/watch/cancel.js.map +1 -0
- package/dist/commands/watch/clean.d.ts +10 -0
- package/dist/commands/watch/clean.js +29 -0
- package/dist/commands/watch/clean.js.map +1 -0
- package/dist/commands/watch/status.d.ts +13 -0
- package/dist/commands/watch/status.js +137 -0
- package/dist/commands/watch/status.js.map +1 -0
- package/dist/logger.d.ts +80 -0
- package/dist/logger.js +143 -0
- package/dist/logger.js.map +1 -0
- package/dist/sfpm-command.d.ts +56 -3
- package/dist/sfpm-command.js +146 -18
- package/dist/sfpm-command.js.map +1 -1
- package/dist/types/bootstrap.d.ts +67 -0
- package/dist/types/bootstrap.js +78 -0
- package/dist/types/bootstrap.js.map +1 -0
- package/dist/ui/adapters/build-event-bridge.d.ts +19 -0
- package/dist/ui/adapters/build-event-bridge.js +138 -0
- package/dist/ui/adapters/build-event-bridge.js.map +1 -0
- package/dist/ui/adapters/install-event-bridge.d.ts +9 -0
- package/dist/ui/adapters/install-event-bridge.js +91 -0
- package/dist/ui/adapters/install-event-bridge.js.map +1 -0
- package/dist/ui/adapters/pino-bridge.d.ts +11 -0
- package/dist/ui/adapters/pino-bridge.js +24 -0
- package/dist/ui/adapters/pino-bridge.js.map +1 -0
- package/dist/ui/adapters/pool-delete-event-bridge.d.ts +12 -0
- package/dist/ui/adapters/pool-delete-event-bridge.js +18 -0
- package/dist/ui/adapters/pool-delete-event-bridge.js.map +1 -0
- package/dist/ui/adapters/pool-fill-event-bridge.d.ts +9 -0
- package/dist/ui/adapters/pool-fill-event-bridge.js +51 -0
- package/dist/ui/adapters/pool-fill-event-bridge.js.map +1 -0
- package/dist/ui/apps/BuildApp.d.ts +11 -0
- package/dist/ui/apps/BuildApp.js +32 -0
- package/dist/ui/apps/BuildApp.js.map +1 -0
- package/dist/ui/apps/PoolDeleteApp.d.ts +6 -0
- package/dist/ui/apps/PoolDeleteApp.js +77 -0
- package/dist/ui/apps/PoolDeleteApp.js.map +1 -0
- package/dist/ui/apps/PoolFillApp.d.ts +7 -0
- package/dist/ui/apps/PoolFillApp.js +107 -0
- package/dist/ui/apps/PoolFillApp.js.map +1 -0
- package/dist/ui/apps/PoolListApp.d.ts +14 -0
- package/dist/ui/apps/PoolListApp.js +33 -0
- package/dist/ui/apps/PoolListApp.js.map +1 -0
- package/dist/ui/components/OrchestrationView.d.ts +20 -0
- package/dist/ui/components/OrchestrationView.js +59 -0
- package/dist/ui/components/OrchestrationView.js.map +1 -0
- package/dist/ui/components/PackageRow.d.ts +130 -0
- package/dist/ui/components/PackageRow.js +80 -0
- package/dist/ui/components/PackageRow.js.map +1 -0
- package/dist/ui/components/ValidationView.d.ts +4 -0
- package/dist/ui/components/ValidationView.js +9 -0
- package/dist/ui/components/ValidationView.js.map +1 -0
- package/dist/ui/components/base/Divider.d.ts +4 -0
- package/dist/ui/components/base/Divider.js +9 -0
- package/dist/ui/components/base/Divider.js.map +1 -0
- package/dist/ui/components/base/ElapsedTime.d.ts +14 -0
- package/dist/ui/components/base/ElapsedTime.js +19 -0
- package/dist/ui/components/base/ElapsedTime.js.map +1 -0
- package/dist/ui/components/base/Footer.d.ts +58 -0
- package/dist/ui/components/base/Footer.js +59 -0
- package/dist/ui/components/base/Footer.js.map +1 -0
- package/dist/ui/components/base/GradientBar.d.ts +7 -0
- package/dist/ui/components/base/GradientBar.js +19 -0
- package/dist/ui/components/base/GradientBar.js.map +1 -0
- package/dist/ui/components/base/OrgBadge.d.ts +8 -0
- package/dist/ui/components/base/OrgBadge.js +10 -0
- package/dist/ui/components/base/OrgBadge.js.map +1 -0
- package/dist/ui/components/base/StatusIcon.d.ts +4 -0
- package/dist/ui/components/base/StatusIcon.js +22 -0
- package/dist/ui/components/base/StatusIcon.js.map +1 -0
- package/dist/ui/components/pool/OrgRow.d.ts +17 -0
- package/dist/ui/components/pool/OrgRow.js +37 -0
- package/dist/ui/components/pool/OrgRow.js.map +1 -0
- package/dist/ui/components/pool/PoolOrgRow.d.ts +16 -0
- package/dist/ui/components/pool/PoolOrgRow.js +44 -0
- package/dist/ui/components/pool/PoolOrgRow.js.map +1 -0
- package/dist/ui/connect-devhub.d.ts +41 -0
- package/dist/ui/connect-devhub.js +52 -0
- package/dist/ui/connect-devhub.js.map +1 -0
- package/dist/ui/fixtures/happy-path.d.ts +85 -0
- package/dist/ui/fixtures/happy-path.js +62 -0
- package/dist/ui/fixtures/happy-path.js.map +1 -0
- package/dist/ui/fixtures/large-scale.d.ts +19 -0
- package/dist/ui/fixtures/large-scale.js +140 -0
- package/dist/ui/fixtures/large-scale.js.map +1 -0
- package/dist/ui/fixtures/partial-failure.d.ts +71 -0
- package/dist/ui/fixtures/partial-failure.js +21 -0
- package/dist/ui/fixtures/partial-failure.js.map +1 -0
- package/dist/ui/fixtures/pool-happy-path.d.ts +14 -0
- package/dist/ui/fixtures/pool-happy-path.js +74 -0
- package/dist/ui/fixtures/pool-happy-path.js.map +1 -0
- package/dist/ui/fixtures/pool-list.d.ts +6 -0
- package/dist/ui/fixtures/pool-list.js +44 -0
- package/dist/ui/fixtures/pool-list.js.map +1 -0
- package/dist/ui/fixtures/pool-partial-failure.d.ts +15 -0
- package/dist/ui/fixtures/pool-partial-failure.js +86 -0
- package/dist/ui/fixtures/pool-partial-failure.js.map +1 -0
- package/dist/ui/hooks/use-event-bus-wiring.d.ts +7 -0
- package/dist/ui/hooks/use-event-bus-wiring.js +32 -0
- package/dist/ui/hooks/use-event-bus-wiring.js.map +1 -0
- package/dist/ui/hooks/use-term-width.d.ts +2 -0
- package/dist/ui/hooks/use-term-width.js +7 -0
- package/dist/ui/hooks/use-term-width.js.map +1 -0
- package/dist/ui/renderers/run-orchestrator-plain.d.ts +11 -0
- package/dist/ui/renderers/run-orchestrator-plain.js +47 -0
- package/dist/ui/renderers/run-orchestrator-plain.js.map +1 -0
- package/dist/ui/renderers/run-orchestrator.d.ts +25 -0
- package/dist/ui/renderers/run-orchestrator.js +17 -0
- package/dist/ui/renderers/run-orchestrator.js.map +1 -0
- package/dist/ui/renderers/run-pool-delete-plain.d.ts +12 -0
- package/dist/ui/renderers/run-pool-delete-plain.js +31 -0
- package/dist/ui/renderers/run-pool-delete-plain.js.map +1 -0
- package/dist/ui/renderers/run-pool-delete.d.ts +12 -0
- package/dist/ui/renderers/run-pool-delete.js +20 -0
- package/dist/ui/renderers/run-pool-delete.js.map +1 -0
- package/dist/ui/renderers/run-pool-fill-plain.d.ts +10 -0
- package/dist/ui/renderers/run-pool-fill-plain.js +60 -0
- package/dist/ui/renderers/run-pool-fill-plain.js.map +1 -0
- package/dist/ui/renderers/run-pool-fill.d.ts +16 -0
- package/dist/ui/renderers/run-pool-fill.js +24 -0
- package/dist/ui/renderers/run-pool-fill.js.map +1 -0
- package/dist/ui/renderers/run-pool-list.d.ts +3 -0
- package/dist/ui/renderers/run-pool-list.js +7 -0
- package/dist/ui/renderers/run-pool-list.js.map +1 -0
- package/dist/ui/state/adapters.d.ts +4 -0
- package/dist/ui/state/adapters.js +62 -0
- package/dist/ui/state/adapters.js.map +1 -0
- package/dist/ui/state/orchestration-reducer.d.ts +7 -0
- package/dist/ui/state/orchestration-reducer.js +150 -0
- package/dist/ui/state/orchestration-reducer.js.map +1 -0
- package/dist/ui/state/pool-delete-reducer.d.ts +37 -0
- package/dist/ui/state/pool-delete-reducer.js +47 -0
- package/dist/ui/state/pool-delete-reducer.js.map +1 -0
- package/dist/ui/state/pool-fill-reducer.d.ts +87 -0
- package/dist/ui/state/pool-fill-reducer.js +109 -0
- package/dist/ui/state/pool-fill-reducer.js.map +1 -0
- package/dist/ui/state/selectors.d.ts +18 -0
- package/dist/ui/state/selectors.js +36 -0
- package/dist/ui/state/selectors.js.map +1 -0
- package/dist/ui/state/types.d.ts +35 -0
- package/dist/ui/state/types.js +2 -0
- package/dist/ui/state/types.js.map +1 -0
- package/dist/ui/table.d.ts +4 -0
- package/dist/ui/table.js +33 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/utils/pool-utils.d.ts +6 -0
- package/dist/ui/utils/pool-utils.js +49 -0
- package/dist/ui/utils/pool-utils.js.map +1 -0
- package/dist/ui/utils/renderer-utils.d.ts +133 -0
- package/dist/ui/utils/renderer-utils.js +131 -0
- package/dist/ui/utils/renderer-utils.js.map +1 -0
- package/dist/ui/utils/theme.d.ts +12 -0
- package/dist/ui/utils/theme.js +4 -0
- package/dist/ui/utils/theme.js.map +1 -0
- package/dist/utils/package-resolver.d.ts +20 -0
- package/dist/utils/package-resolver.js +44 -0
- package/dist/utils/package-resolver.js.map +1 -0
- package/dist/utils/project-dir.d.ts +9 -0
- package/dist/utils/project-dir.js +13 -0
- package/dist/utils/project-dir.js.map +1 -0
- package/dist/utils/suppress.d.ts +13 -0
- package/dist/utils/suppress.js +29 -0
- package/dist/utils/suppress.js.map +1 -0
- package/dist/utils/validation-runner.js +69 -0
- package/dist/utils/validation-runner.js.map +1 -0
- package/dist/utils/watcher-runner.d.ts +1 -0
- package/dist/utils/watcher-runner.js +148 -0
- package/dist/utils/watcher-runner.js.map +1 -0
- package/dist/utils/watcher.d.ts +27 -0
- package/dist/utils/watcher.js +51 -0
- package/dist/utils/watcher.js.map +1 -0
- package/oclif.manifest.json +1507 -494
- package/package.json +23 -9
- package/dist/commands/build.d.ts +0 -30
- package/dist/commands/build.js +0 -228
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/deploy.d.ts +0 -20
- package/dist/commands/deploy.js +0 -141
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/hello/index.d.ts +0 -12
- package/dist/commands/hello/index.js +0 -20
- package/dist/commands/hello/index.js.map +0 -1
- package/dist/commands/hello/world.d.ts +0 -8
- package/dist/commands/hello/world.js +0 -15
- package/dist/commands/hello/world.js.map +0 -1
- package/dist/commands/pool/provision.d.ts +0 -22
- package/dist/commands/pool/provision.js +0 -115
- package/dist/commands/pool/provision.js.map +0 -1
- package/dist/commands/project.js.map +0 -1
- package/dist/ui/build-progress-renderer.d.ts +0 -98
- package/dist/ui/build-progress-renderer.js +0 -684
- package/dist/ui/build-progress-renderer.js.map +0 -1
- package/dist/ui/install-progress-renderer.d.ts +0 -112
- package/dist/ui/install-progress-renderer.js +0 -443
- package/dist/ui/install-progress-renderer.js.map +0 -1
- package/dist/ui/orchestration-listr.d.ts +0 -211
- package/dist/ui/orchestration-listr.js +0 -391
- package/dist/ui/orchestration-listr.js.map +0 -1
- package/dist/ui/pool-progress-renderer.d.ts +0 -68
- package/dist/ui/pool-progress-renderer.js +0 -298
- package/dist/ui/pool-progress-renderer.js.map +0 -1
- package/dist/ui/renderer-utils.d.ts +0 -68
- package/dist/ui/renderer-utils.js +0 -66
- package/dist/ui/renderer-utils.js.map +0 -1
- package/dist/utils/validation-watcher.js +0 -114
- package/dist/utils/validation-watcher.js.map +0 -1
- /package/dist/utils/{validation-watcher.d.ts → validation-runner.d.ts} +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Static, Text, useApp, useInput, } from 'ink';
|
|
3
|
+
import { useEffect, useReducer } from 'react';
|
|
4
|
+
import { Divider } from '../components/base/Divider.js';
|
|
5
|
+
import { ElapsedTime } from '../components/base/ElapsedTime.js';
|
|
6
|
+
import { Footer } from '../components/base/Footer.js';
|
|
7
|
+
import { OrgBadge } from '../components/base/OrgBadge.js';
|
|
8
|
+
import { OrgRow } from '../components/pool/OrgRow.js';
|
|
9
|
+
import { useTermWidth } from '../hooks/use-term-width.js';
|
|
10
|
+
import { colWidth, rawSym } from '../utils/renderer-utils.js';
|
|
11
|
+
import { initialState, reducer, TERMINAL, } from '../state/pool-fill-reducer.js';
|
|
12
|
+
// ── Bus wiring ────────────────────────────────────────────────────────────────
|
|
13
|
+
const BUS_EVENTS = [
|
|
14
|
+
'pool:start',
|
|
15
|
+
'org:appeared',
|
|
16
|
+
'pool:creation:failed',
|
|
17
|
+
'org:prereqs',
|
|
18
|
+
'org:deploying',
|
|
19
|
+
'org:pkg:start',
|
|
20
|
+
'org:pkg:done',
|
|
21
|
+
'org:done',
|
|
22
|
+
'org:failed',
|
|
23
|
+
'pool:done',
|
|
24
|
+
];
|
|
25
|
+
function useBusWiring(bus, dispatch) {
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const handlers = BUS_EVENTS.map(name => {
|
|
28
|
+
const handler = (payload) => dispatch({ type: name, ...payload });
|
|
29
|
+
bus.on(name, handler);
|
|
30
|
+
return [name, handler];
|
|
31
|
+
});
|
|
32
|
+
return () => {
|
|
33
|
+
for (const [name, handler] of handlers)
|
|
34
|
+
bus.off(name, handler);
|
|
35
|
+
};
|
|
36
|
+
}, [bus, dispatch]);
|
|
37
|
+
}
|
|
38
|
+
// ── Static items ─────────────────────────────────────────────────────────────
|
|
39
|
+
const ALIAS_COL = 20;
|
|
40
|
+
function StaticOrgRow({ alias, completedPackages, failedPackages, phase, showTag, tag, totalPackages }) {
|
|
41
|
+
let icon;
|
|
42
|
+
let color;
|
|
43
|
+
let summary;
|
|
44
|
+
if (phase === 'done') {
|
|
45
|
+
icon = rawSym.success;
|
|
46
|
+
color = 'green';
|
|
47
|
+
summary = `${completedPackages}/${totalPackages} packages`;
|
|
48
|
+
}
|
|
49
|
+
else if (phase === 'warning') {
|
|
50
|
+
icon = rawSym.warn;
|
|
51
|
+
color = 'yellow';
|
|
52
|
+
const installed = completedPackages - failedPackages;
|
|
53
|
+
summary = `${installed}/${totalPackages} packages · ${failedPackages} failed`;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
icon = rawSym.fail;
|
|
57
|
+
color = 'red';
|
|
58
|
+
summary = totalPackages > 0
|
|
59
|
+
? `failed · ${completedPackages}/${totalPackages} packages before failure`
|
|
60
|
+
: 'failed';
|
|
61
|
+
}
|
|
62
|
+
return (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: color, children: icon }), _jsx(Box, { width: ALIAS_COL, children: _jsx(Text, { wrap: 'truncate', children: showTag ? `${tag}/${alias}` : alias }) }), _jsx(Text, { dimColor: true, children: summary })] }));
|
|
63
|
+
}
|
|
64
|
+
// ── Component ─────────────────────────────────────────────────────────────────
|
|
65
|
+
/** Max active org rows shown in the live area. Orgs beyond this are summarised. */
|
|
66
|
+
const MAX_ACTIVE_ROWS = 8;
|
|
67
|
+
export function PoolFillApp({ bus, devhubAlias, onAdvance }) {
|
|
68
|
+
const [state, dispatch] = useReducer(reducer, devhubAlias, initialState);
|
|
69
|
+
const { exit } = useApp();
|
|
70
|
+
const termWidth = useTermWidth();
|
|
71
|
+
const barWidth = colWidth(termWidth);
|
|
72
|
+
useBusWiring(bus, dispatch);
|
|
73
|
+
useInput((input, key) => {
|
|
74
|
+
onAdvance?.(input || (key.escape ? '\u001B' : ''));
|
|
75
|
+
}, { isActive: Boolean(onAdvance) });
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (state.phase === 'done') {
|
|
78
|
+
const t = setTimeout(exit, 80);
|
|
79
|
+
return () => clearTimeout(t);
|
|
80
|
+
}
|
|
81
|
+
}, [state.phase, exit]);
|
|
82
|
+
const multiPool = state.pools.length > 1;
|
|
83
|
+
const activeOrgs = state.orgs.filter(o => !TERMINAL.has(o.phase));
|
|
84
|
+
const doneOrgs = state.orgs.filter(o => o.phase === 'done').length;
|
|
85
|
+
const warningOrgs = state.orgs.filter(o => o.phase === 'warning').length;
|
|
86
|
+
const creationFailed = state.pools.reduce((sum, p) => sum + p.creationFailed, 0);
|
|
87
|
+
const totalFailed = state.orgs.filter(o => o.phase === 'failed').length + creationFailed;
|
|
88
|
+
const totalDone = doneOrgs + warningOrgs;
|
|
89
|
+
const total = state.pools.reduce((sum, p) => sum + p.total, 0);
|
|
90
|
+
const pending = state.pools.reduce((sum, p) => sum + Math.max(0, p.total - state.orgs.filter(o => o.tag === p.tag).length - p.creationFailed), 0);
|
|
91
|
+
const counts = {
|
|
92
|
+
failed: totalFailed,
|
|
93
|
+
pending,
|
|
94
|
+
running: activeOrgs.length,
|
|
95
|
+
skipped: 0,
|
|
96
|
+
success: totalDone,
|
|
97
|
+
total,
|
|
98
|
+
validating: 0,
|
|
99
|
+
};
|
|
100
|
+
const visibleActive = activeOrgs.slice(0, MAX_ACTIVE_ROWS);
|
|
101
|
+
const hiddenCount = activeOrgs.length - visibleActive.length;
|
|
102
|
+
const startedAt = state.pools.length > 0 ? Math.min(...state.pools.map(p => p.startedAt)) : Date.now();
|
|
103
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [state.pools.length > 0 && _jsx(OrgBadge, { alias: devhubAlias }), _jsx(Static, { items: state.staticItems, children: item => item.kind === 'header'
|
|
104
|
+
? (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { bold: true, children: ["Provisioning ", item.total, " org", item.total === 1 ? '' : 's', " \u00B7 ", item.tag] }), _jsx(Divider, { width: termWidth })] }, item.id))
|
|
105
|
+
: _jsx(StaticOrgRow, { ...item.org, showTag: multiPool }, item.id) }), _jsxs(Box, { flexDirection: 'column', marginTop: 1, children: [visibleActive.map(org => (_jsx(OrgRow, { barWidth: barWidth, ...org, alias: multiPool ? `${org.tag}/${org.alias}` : org.alias }, org.username))), hiddenCount > 0 && (_jsxs(Text, { dimColor: true, children: [" \u00B7 ", hiddenCount, " more provisioning..."] }))] }), _jsx(Footer, { activeSlot: _jsxs(Box, { gap: 1, children: [activeOrgs.length > 0 && _jsxs(Text, { color: 'yellow', children: [activeOrgs.length, " provisioning"] }), activeOrgs.length > 0 && pending > 0 && _jsx(Text, { dimColor: true, children: "\u00B7" }), pending > 0 && _jsxs(Text, { dimColor: true, children: [pending, " queued"] })] }), counts: counts, progressBar: false, resultsSlot: _jsxs(Box, { gap: 2, children: [doneOrgs > 0 && _jsxs(Text, { color: 'green', children: [doneOrgs, " done"] }), warningOrgs > 0 && _jsxs(Text, { color: 'yellow', children: [warningOrgs, " \u26A0"] }), totalFailed > 0 && _jsxs(Text, { color: 'red', children: [totalFailed, " \u2717"] })] }), timeSlot: _jsx(ElapsedTime, { dimColor: true, startedAt: startedAt }) })] }));
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=PoolFillApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolFillApp.js","sourceRoot":"","sources":["../../../src/ui/apps/PoolFillApp.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GACpC,MAAM,KAAK,CAAC;AACb,OAAc,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AAInD,OAAO,EAAC,OAAO,EAAC,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAC,QAAQ,EAAC,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAC,MAAM,4BAA4B,CA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,CAAC,QAAQ,CAAuE,CACrH,CAAC,EACD,WAAW,GAAG,CAAC,IAAI,CAClB,MAAC,IAAI,IAAC,QAAQ,gCAAM,WAAW,6BAA6B,CAC7D,IACG,EAGN,KAAC,MAAM,IACL,UAAU,EACR,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,aACR,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,MAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,aAAE,UAAU,CAAC,MAAM,qBAAqB,EACrF,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,IAAI,KAAC,IAAI,IAAC,QAAQ,6BAAS,EAC/D,OAAO,GAAG,CAAC,IAAI,MAAC,IAAI,IAAC,QAAQ,mBAAE,OAAO,eAAe,IAClD,EAER,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,KAAK,EAClB,WAAW,EACT,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,aACR,QAAQ,GAAG,CAAC,IAAO,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,aAAE,QAAQ,aAAa,EAC7D,WAAW,GAAG,CAAC,IAAI,MAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,aAAE,WAAW,eAAU,EAC9D,WAAW,GAAG,CAAC,IAAI,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,aAAE,WAAW,eAAU,IACxD,EAER,QAAQ,EAAE,KAAC,WAAW,IAAC,QAAQ,QAAC,SAAS,EAAE,SAAS,GAAI,GACxD,IAEE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PoolOrg } from '@b64hub/sfpm-orgs';
|
|
2
|
+
interface PoolListAppProps {
|
|
3
|
+
devhubAlias: string;
|
|
4
|
+
orgs: PoolOrg[];
|
|
5
|
+
tag?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Static Ink app for `pool list`.
|
|
9
|
+
*
|
|
10
|
+
* Data is fully available at mount time — no bus, no reducer.
|
|
11
|
+
* Renders once then calls exit() so control returns to the shell.
|
|
12
|
+
*/
|
|
13
|
+
export declare function PoolListApp({ devhubAlias, orgs, tag }: PoolListAppProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useApp } from 'ink';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { PackageRow } from '../components/PackageRow.js';
|
|
5
|
+
import { Divider } from '../components/base/Divider.js';
|
|
6
|
+
import { OrgBadge } from '../components/base/OrgBadge.js';
|
|
7
|
+
import { useTermWidth } from '../hooks/use-term-width.js';
|
|
8
|
+
import { POOL_ORG_COLS, PoolOrgRow } from '../components/pool/PoolOrgRow.js';
|
|
9
|
+
/**
|
|
10
|
+
* Static Ink app for `pool list`.
|
|
11
|
+
*
|
|
12
|
+
* Data is fully available at mount time — no bus, no reducer.
|
|
13
|
+
* Renders once then calls exit() so control returns to the shell.
|
|
14
|
+
*/
|
|
15
|
+
export function PoolListApp({ devhubAlias, orgs, tag }) {
|
|
16
|
+
const { exit } = useApp();
|
|
17
|
+
const termWidth = useTermWidth();
|
|
18
|
+
// Render once then hand control back to the terminal.
|
|
19
|
+
useEffect(() => { exit(); }, [exit]);
|
|
20
|
+
const header = tag
|
|
21
|
+
? `${orgs.length} org${orgs.length !== 1 ? 's' : ''} in ${tag}`
|
|
22
|
+
: `${orgs.length} org${orgs.length !== 1 ? 's' : ''}`;
|
|
23
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(OrgBadge, { alias: devhubAlias }), _jsx(Divider, { width: termWidth }), orgs.length === 0
|
|
24
|
+
? _jsxs(Text, { dimColor: true, children: ["No orgs found", tag ? ` in pool "${tag}"` : '', "."] })
|
|
25
|
+
: (_jsxs(_Fragment, { children: [_jsx(PackageRow, { width: termWidth, props: {
|
|
26
|
+
columns: _jsx(PackageRow.MetaCols, { cols: POOL_ORG_COLS, header: true }),
|
|
27
|
+
icon: _jsx(Text, { children: " " }),
|
|
28
|
+
id: '__header__',
|
|
29
|
+
primary: 'alias',
|
|
30
|
+
secondary: _jsx(PackageRow.Secondary, { children: "username" }),
|
|
31
|
+
} }), _jsx(Divider, { width: termWidth }), orgs.map(org => (_jsx(PoolOrgRow, { org: org, width: termWidth }, org.orgId)))] })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: header }) })] }));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=PoolListApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolListApp.js","sourceRoot":"","sources":["../../../src/ui/apps/PoolListApp.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,MAAM,KAAK,CAAC;AACtC,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAC,OAAO,EAAC,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAC,QAAQ,EAAC,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,kCAAkC,CAAC;AAQ3E;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAC,WAAW,EAAE,IAAI,EAAE,GAAG,EAAmB;IACpE,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,EAAE,CAAC;IACxB,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IAEjC,sDAAsD;IACtD,SAAS,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAErC,MAAM,MAAM,GAAG,GAAG;QAChB,CAAC,CAAC,G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,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TreeNode } from '../state/types.js';
|
|
3
|
+
export interface OrchestrationViewProps {
|
|
4
|
+
levels: TreeNode[];
|
|
5
|
+
/** Validation-phase nodes. Rendered below the build area when present. */
|
|
6
|
+
validation?: TreeNode[];
|
|
7
|
+
/** Show the validation section. Defaults to true when `validation` is non-empty. */
|
|
8
|
+
showValidation?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Builds the columns slot for each row. Use `PackageRow.MetaCols`.
|
|
11
|
+
* Omit to show time only.
|
|
12
|
+
*/
|
|
13
|
+
getColumns?: (node: TreeNode) => ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Header for the columns slot. Pass `<PackageRow.MetaCols cols={...} header />`
|
|
16
|
+
* using the same spec as `getColumns`.
|
|
17
|
+
*/
|
|
18
|
+
headerColumns?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare function OrchestrationView({ getColumns, headerColumns, levels, showValidation, validation, }: OrchestrationViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Static, Text } from 'ink';
|
|
3
|
+
import { useStdout } from 'ink';
|
|
4
|
+
import { deriveStatus } from '../state/selectors.js';
|
|
5
|
+
import { toRowProps } from '../state/adapters.js';
|
|
6
|
+
import { rawSym } from '../utils/renderer-utils.js';
|
|
7
|
+
import { Divider } from './base/Divider.js';
|
|
8
|
+
import { COL_TRAILING, PackageRow } from './PackageRow.js';
|
|
9
|
+
// ---- constants --------------------------------------------------------------
|
|
10
|
+
const TERMINAL = new Set(['failed', 'skipped', 'success']);
|
|
11
|
+
/**
|
|
12
|
+
* Groups with more than this many packages are collapsed into a single rollup
|
|
13
|
+
* line. Keeps the live area focused on what's actively happening.
|
|
14
|
+
*/
|
|
15
|
+
const ROLLUP_AT = 3;
|
|
16
|
+
/**
|
|
17
|
+
* Compressed summary line for a group of packages that don't need individual
|
|
18
|
+
* rows in the live area (e.g. "✓ 5 packages done — core-utils, shared-types…").
|
|
19
|
+
*/
|
|
20
|
+
function StatusRollup({ color, icon, label, pkgs }) {
|
|
21
|
+
const names = pkgs.map(p => p.label).join(', ');
|
|
22
|
+
const count = pkgs.length;
|
|
23
|
+
return (_jsxs(Box, { gap: 1, marginLeft: 2, children: [_jsx(Box, { marginRight: 1, children: _jsx(Text, { color: color, children: icon }) }), _jsxs(Text, { dimColor: true, children: [count, " ", count === 1 ? 'package' : 'packages', " ", label, ' \u2014 ', names] })] }));
|
|
24
|
+
}
|
|
25
|
+
// ---- component --------------------------------------------------------------
|
|
26
|
+
export function OrchestrationView({ getColumns, headerColumns, levels, showValidation = true, validation, }) {
|
|
27
|
+
const { stdout } = useStdout();
|
|
28
|
+
const termWidth = stdout?.columns ?? 80;
|
|
29
|
+
const totalPackages = levels.reduce((n, l) => n + l.children.length, 0);
|
|
30
|
+
const allPkgs = levels.flatMap(l => l.children);
|
|
31
|
+
// Deferred atomic flush: nothing goes to <Static> until every package is
|
|
32
|
+
// terminal. Guarantees scrollback shows packages in level order regardless
|
|
33
|
+
// of when async validation resolves for different levels.
|
|
34
|
+
const allTerminal = levels.length > 0 && levels.every(l => TERMINAL.has(deriveStatus(l.children)));
|
|
35
|
+
const donePackages = allTerminal ? allPkgs : [];
|
|
36
|
+
const rowProps = (node) => toRowProps(node, getColumns);
|
|
37
|
+
const staticItems = [
|
|
38
|
+
{ kind: 'header', totalLevels: levels.length, totalPackages },
|
|
39
|
+
...donePackages.map((node) => ({ key: node.id, kind: 'pkg', node })),
|
|
40
|
+
];
|
|
41
|
+
// Live area groups — all empty when allTerminal (Static has taken over, no duplication).
|
|
42
|
+
// Order: done (history) → validating (async in-flight) → running (active) → failed (errors) → pending (future).
|
|
43
|
+
const failed = allTerminal ? [] : allPkgs.filter(p => p.status === 'failed');
|
|
44
|
+
const validating = allTerminal ? [] : allPkgs.filter(p => p.status === 'validating');
|
|
45
|
+
const running = allTerminal ? [] : allPkgs.filter(p => p.status === 'running');
|
|
46
|
+
const done = allTerminal ? [] : allPkgs.filter(p => p.status === 'success' || p.status === 'skipped');
|
|
47
|
+
const pending = allTerminal ? [] : allPkgs.filter(p => p.status === 'pending');
|
|
48
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: staticItems, children: item => {
|
|
49
|
+
if (item.kind === 'header') {
|
|
50
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 2, width: termWidth, children: [_jsxs(Box, { justifyContent: "space-between", children: [_jsxs(Text, { dimColor: true, children: [item.totalPackages, " packages \u00B7 ", item.totalLevels, " levels"] }), _jsxs(Box, { flexShrink: 0, gap: 1, children: [headerColumns, _jsx(Box, { width: COL_TRAILING, children: _jsx(Text, { dimColor: true, children: "time" }) })] })] }), _jsx(Divider, {})] }, "__header__"));
|
|
51
|
+
}
|
|
52
|
+
return _jsx(PackageRow, { props: rowProps(item.node), width: termWidth }, item.key);
|
|
53
|
+
} }), done.length > ROLLUP_AT
|
|
54
|
+
? _jsx(StatusRollup, { color: "green", icon: rawSym.success, label: "done", pkgs: done })
|
|
55
|
+
: done.map(p => _jsx(PackageRow, { props: rowProps(p), width: termWidth }, p.id)), validating.map(p => _jsx(PackageRow, { props: rowProps(p), width: termWidth }, p.id)), running.map(p => _jsx(PackageRow, { props: rowProps(p), width: termWidth }, p.id)), failed.map(p => _jsx(PackageRow, { props: rowProps(p), width: termWidth }, p.id)), pending.length > ROLLUP_AT
|
|
56
|
+
? _jsx(StatusRollup, { icon: rawSym.pending, label: "waiting", pkgs: pending })
|
|
57
|
+
: pending.map(p => _jsx(PackageRow, { props: rowProps(p), width: termWidth }, p.id))] }));
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=OrchestrationView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrchestrationView.js","s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AAC,UAAU,IAAY,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,IAA1C,CAAC,CAAC,EAAE,CAA0C,CAAC,EAGhF,OAAO,CAAC,MAAM,GAAG,SAAS;gBACzB,CAAC,CAAC,KAAC,YAAY,IAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAC,SAAS,EAAC,IAAI,EAAE,OAAO,GAAI;gBACvE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAC,UAAU,IAAY,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,IAA1C,CAAC,CAAC,EAAE,CAA0C,CAAC,IACjF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { ElapsedTime } from './base/ElapsedTime.js';
|
|
3
|
+
export interface RowStep {
|
|
4
|
+
id: string;
|
|
5
|
+
/** Pre-rendered icon character (caller supplies from rawSym or similar). */
|
|
6
|
+
icon: string;
|
|
7
|
+
primary: string;
|
|
8
|
+
secondary?: string;
|
|
9
|
+
isLast: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Agnostic row interface — no domain types.
|
|
13
|
+
*
|
|
14
|
+
* The caller (e.g. adapters.tsx) is responsible for mapping domain data into
|
|
15
|
+
* these display slots. Each slot is a ReactNode so callers compose sub-components:
|
|
16
|
+
*
|
|
17
|
+
* icon — pre-constructed ReactNode (StatusIcon, plain char, anything)
|
|
18
|
+
* primary — main label string
|
|
19
|
+
* secondary — dim inline hint; use PackageRow.Secondary for the default style
|
|
20
|
+
* error — terminal failure detail; replaces secondary and suppresses steps
|
|
21
|
+
* trailing — right-side content; use PackageRow.Trailing for the default (meta + time)
|
|
22
|
+
*
|
|
23
|
+
* Collapse is a prop, not internal state. If steps/expanded are undefined, steps are hidden.
|
|
24
|
+
*/
|
|
25
|
+
export interface PackageRowProps {
|
|
26
|
+
id: string;
|
|
27
|
+
icon: ReactNode;
|
|
28
|
+
primary: string;
|
|
29
|
+
secondary?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Terminal failure detail. When set, it is shown in place of `secondary`
|
|
32
|
+
* and step children are suppressed entirely — a failed package's own
|
|
33
|
+
* message is the whole story; per-step status may be incomplete or stale
|
|
34
|
+
* (a step whose own completion event only fires on success never reaches
|
|
35
|
+
* a terminal state on its own).
|
|
36
|
+
*/
|
|
37
|
+
error?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Structured breakdown of `error`, one line per item (e.g. one failing
|
|
40
|
+
* deploy component). Rendered below the header row, capped at
|
|
41
|
+
* {@link ERROR_LINES_MAX} lines with a "+N more" trailer — the full list
|
|
42
|
+
* always still reaches the run log regardless of what's capped here.
|
|
43
|
+
*/
|
|
44
|
+
errorLines?: string[];
|
|
45
|
+
/**
|
|
46
|
+
* Best-effort warning badge — shown next to `primary` when the package
|
|
47
|
+
* did not fail (e.g. "\u26a0 2 warnings"). Ignored when `error` is set.
|
|
48
|
+
*/
|
|
49
|
+
warning?: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Structured breakdown of `warning`, same rendering as {@link errorLines}
|
|
52
|
+
* (capped list + "+N more"). Shown regardless of expanded/collapsed state.
|
|
53
|
+
*/
|
|
54
|
+
warningLines?: string[];
|
|
55
|
+
/** Fixed-width metadata columns, right of secondary. Use PackageRow.MetaCols. */
|
|
56
|
+
columns?: ReactNode;
|
|
57
|
+
/** Rightmost slot — time only. Use PackageRow.Trailing. */
|
|
58
|
+
trailing?: ReactNode;
|
|
59
|
+
steps?: RowStep[];
|
|
60
|
+
expanded?: boolean;
|
|
61
|
+
indent?: number;
|
|
62
|
+
}
|
|
63
|
+
export declare const COL_META = 9;
|
|
64
|
+
export declare const COL_TRAILING = 6;
|
|
65
|
+
/** Default secondary slot: dim truncating text. */
|
|
66
|
+
declare function Secondary({ children }: {
|
|
67
|
+
children: ReactNode;
|
|
68
|
+
}): import("react").JSX.Element;
|
|
69
|
+
/** Rightmost trailing slot: time only. */
|
|
70
|
+
export interface RowTrailingProps {
|
|
71
|
+
duration?: number;
|
|
72
|
+
startedAt?: number;
|
|
73
|
+
}
|
|
74
|
+
declare function Trailing({ duration, startedAt }: RowTrailingProps): import("react").JSX.Element;
|
|
75
|
+
export { Trailing as RowTrailing };
|
|
76
|
+
/** Spec for one fixed-width metadata column in MetaCols. */
|
|
77
|
+
export interface MetaColSpec {
|
|
78
|
+
key: string;
|
|
79
|
+
/** Fixed column width in characters. */
|
|
80
|
+
width: number;
|
|
81
|
+
/** Header label (defaults to key). */
|
|
82
|
+
label?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface MetaColsProps {
|
|
85
|
+
cols: MetaColSpec[];
|
|
86
|
+
meta?: Record<string, string>;
|
|
87
|
+
/** Render as header row: shows column labels instead of values. */
|
|
88
|
+
header?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Fixed-width metadata columns. Slots into PackageRowProps.columns.
|
|
92
|
+
* Use the same `cols` spec for both rows and the header.
|
|
93
|
+
* Missing keys render —. Time is handled separately by PackageRow.Trailing.
|
|
94
|
+
*/
|
|
95
|
+
declare function MetaCols({ cols, meta, header }: MetaColsProps): import("react").JSX.Element;
|
|
96
|
+
export declare function ErrorLines({ lines }: {
|
|
97
|
+
lines: string[];
|
|
98
|
+
}): import("react").JSX.Element;
|
|
99
|
+
/**
|
|
100
|
+
* @param width - Outer row width in columns. Pass `stdout.columns` from the
|
|
101
|
+
* parent so the row spans the terminal even inside `<Static>` (where
|
|
102
|
+
* `flexGrow` has no container width to expand into).
|
|
103
|
+
*/
|
|
104
|
+
declare function PackageRowFn({ props, width }: {
|
|
105
|
+
props: PackageRowProps;
|
|
106
|
+
width?: number;
|
|
107
|
+
}): import("react").JSX.Element;
|
|
108
|
+
/**
|
|
109
|
+
* PackageRow with composable slot sub-components.
|
|
110
|
+
*
|
|
111
|
+
* @example Explicit composition (via adapters.tsx)
|
|
112
|
+
* ```tsx
|
|
113
|
+
* <PackageRow props={{
|
|
114
|
+
* id, icon,
|
|
115
|
+
* primary: node.label,
|
|
116
|
+
* secondary: <PackageRow.Secondary>{hint}</PackageRow.Secondary>,
|
|
117
|
+
* trailing: <PackageRow.Trailing meta="42 cmp" startedAt={node.startedAt} />,
|
|
118
|
+
* }} />
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare const PackageRow: typeof PackageRowFn & {
|
|
122
|
+
/** Default secondary slot: dim truncating text. */
|
|
123
|
+
Secondary: typeof Secondary;
|
|
124
|
+
/** Default trailing slot: single meta label + elapsed/duration time. */
|
|
125
|
+
Trailing: typeof Trailing;
|
|
126
|
+
/** Multi-column metadata trailing with fixed-width alignment. */
|
|
127
|
+
MetaCols: typeof MetaCols;
|
|
128
|
+
/** Animated elapsed time. Same component as Footer.Elapsed. */
|
|
129
|
+
Elapsed: typeof ElapsedTime;
|
|
130
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { formatTime } from '../state/selectors.js';
|
|
4
|
+
import { ElapsedTime } from './base/ElapsedTime.js';
|
|
5
|
+
// ---- sub-components ----
|
|
6
|
+
export const COL_META = 9;
|
|
7
|
+
export const COL_TRAILING = 6;
|
|
8
|
+
/**
|
|
9
|
+
* Cap on how many `errorLines` render inline. Mirrors OrchestrationView's
|
|
10
|
+
* `ROLLUP_AT` — same problem (an unbounded list would spam the live area
|
|
11
|
+
* and the final scrollback), same fix (show a bounded sample + a count).
|
|
12
|
+
*/
|
|
13
|
+
const ERROR_LINES_MAX = 5;
|
|
14
|
+
/** Default secondary slot: dim truncating text. */
|
|
15
|
+
function Secondary({ children }) {
|
|
16
|
+
return _jsx(Text, { dimColor: true, wrap: "truncate", children: children });
|
|
17
|
+
}
|
|
18
|
+
function Trailing({ duration, startedAt }) {
|
|
19
|
+
const timeNode = (() => {
|
|
20
|
+
if (duration !== undefined)
|
|
21
|
+
return _jsx(Text, { dimColor: true, children: formatTime(duration) });
|
|
22
|
+
if (startedAt !== undefined)
|
|
23
|
+
return _jsx(ElapsedTime, { startedAt: startedAt, format: formatTime, color: "yellow" });
|
|
24
|
+
return _jsx(Text, { dimColor: true, children: "\u2014" });
|
|
25
|
+
})();
|
|
26
|
+
return _jsx(Box, { width: COL_TRAILING, children: timeNode });
|
|
27
|
+
}
|
|
28
|
+
// Keep the standalone export for callers that import RowTrailing by name.
|
|
29
|
+
export { Trailing as RowTrailing };
|
|
30
|
+
/**
|
|
31
|
+
* Fixed-width metadata columns. Slots into PackageRowProps.columns.
|
|
32
|
+
* Use the same `cols` spec for both rows and the header.
|
|
33
|
+
* Missing keys render —. Time is handled separately by PackageRow.Trailing.
|
|
34
|
+
*/
|
|
35
|
+
function MetaCols({ cols, meta, header = false }) {
|
|
36
|
+
return (_jsx(Box, { gap: 1, children: cols.map(col => (_jsx(Box, { width: col.width, children: _jsx(Text, { dimColor: true, children: header ? (col.label ?? col.key) : (meta?.[col.key] ?? '—') }) }, col.key))) }));
|
|
37
|
+
}
|
|
38
|
+
// ---- step row ----
|
|
39
|
+
function StepRow({ step }) {
|
|
40
|
+
return (_jsxs(Box, { marginLeft: 3, gap: 1, children: [_jsx(Text, { dimColor: true, children: step.isLast ? '╰' : '├' }), _jsx(Text, { dimColor: true, children: step.icon }), _jsx(Text, { dimColor: true, children: step.primary }), step.secondary && _jsx(Text, { dimColor: true, children: step.secondary })] }));
|
|
41
|
+
}
|
|
42
|
+
// ---- error detail lines ----
|
|
43
|
+
export function ErrorLines({ lines }) {
|
|
44
|
+
const shown = lines.slice(0, ERROR_LINES_MAX);
|
|
45
|
+
const remaining = lines.length - shown.length;
|
|
46
|
+
return (_jsxs(Box, { flexDirection: "column", marginLeft: 3, children: [shown.map((line, i) => (_jsx(Text, { dimColor: true, wrap: "truncate", children: line }, i))), remaining > 0 && (_jsxs(Text, { dimColor: true, children: ["+", remaining, " more \u2014 see full logs"] }))] }));
|
|
47
|
+
}
|
|
48
|
+
// ---- PackageRow ----
|
|
49
|
+
/**
|
|
50
|
+
* @param width - Outer row width in columns. Pass `stdout.columns` from the
|
|
51
|
+
* parent so the row spans the terminal even inside `<Static>` (where
|
|
52
|
+
* `flexGrow` has no container width to expand into).
|
|
53
|
+
*/
|
|
54
|
+
function PackageRowFn({ props, width = 80 }) {
|
|
55
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { width: width, justifyContent: "space-between", children: [_jsxs(Box, { gap: 1, flexShrink: 1, minWidth: 0, marginLeft: props.indent ?? 0, children: [props.icon, _jsx(Text, { wrap: "truncate", children: props.primary }), props.error ? props.error : (props.warning ?? props.secondary)] }), _jsxs(Box, { flexShrink: 0, gap: 1, children: [props.columns, props.trailing] })] }), !props.error && props.expanded && props.steps?.map(step => (_jsx(StepRow, { step: step }, step.id))), props.errorLines && props.errorLines.length > 0 && (_jsx(ErrorLines, { lines: props.errorLines })), props.warningLines && props.warningLines.length > 0 && (_jsx(ErrorLines, { lines: props.warningLines }))] }));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* PackageRow with composable slot sub-components.
|
|
59
|
+
*
|
|
60
|
+
* @example Explicit composition (via adapters.tsx)
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <PackageRow props={{
|
|
63
|
+
* id, icon,
|
|
64
|
+
* primary: node.label,
|
|
65
|
+
* secondary: <PackageRow.Secondary>{hint}</PackageRow.Secondary>,
|
|
66
|
+
* trailing: <PackageRow.Trailing meta="42 cmp" startedAt={node.startedAt} />,
|
|
67
|
+
* }} />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export const PackageRow = Object.assign(PackageRowFn, {
|
|
71
|
+
/** Default secondary slot: dim truncating text. */
|
|
72
|
+
Secondary,
|
|
73
|
+
/** Default trailing slot: single meta label + elapsed/duration time. */
|
|
74
|
+
Trailing,
|
|
75
|
+
/** Multi-column metadata trailing with fixed-width alignment. */
|
|
76
|
+
MetaCols,
|
|
77
|
+
/** Animated elapsed time. Same component as Footer.Elapsed. */
|
|
78
|
+
Elapsed: ElapsedTime,
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=PackageRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PackageRow.js","sourceRoot":"","sources":["../../../src/ui/components/PackageRow.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAE9B,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAkEpD,2BAA2B;AAE3B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC;AAC1B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAE9B;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,mDAAmD;AACnD,SAAS,SAAS,CAAC,EAAC,QAAQ,EAAwB;IAClD,OAAO,KAAC,IAAI,IAAC,QAAQ,QAAC,IAAI,EAAC,UAAU,YAAE,QAAQ,GAAQ,CAAC;AAC1D,CAAC;AAQD,SAAS,QAAQ,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAmB;IACvD,MAAM,QAAQ,GAAc,CAAC,GAAG,EAAE;QAChC,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,KAAC,IAAI,IAAC,QAAQ,kBAAE,UAAU,CAAC,QAAQ,CAAC,GAAQ,CAAC;QAChF,IAAI,SAAS,KAAK,SAAS;YAAE,OAAO,KAAC,WAAW,IAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAC,QAAQ,GAAG,CAAC;QAC7G,OAAO,KAAC,IAAI,IAAC,QAAQ,6BAAS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AK,CAAC,OAAO,EACb,KAAK,CAAC,QAAQ,IACX,IACF,EAKL,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAC1D,KAAC,OAAO,IAAe,IAAI,EAAE,IAAI,IAAnB,IAAI,CAAC,EAAE,CAAgB,CACtC,CAAC,EAGD,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CAClD,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAI,CACxC,EAGA,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CACtD,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAI,CAC1C,IACG,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE;IACpD,mDAAmD;IACnD,SAAS;IACT,wEAAwE;IACxE,QAAQ;IACR,iEAAiE;IACjE,QAAQ;IACR,+DAA+D;IAC/D,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from 'ink';
|
|
3
|
+
import { Divider } from './base/Divider.js';
|
|
4
|
+
import { PackageRow } from './PackageRow.js';
|
|
5
|
+
import { toRowProps } from '../state/adapters.js';
|
|
6
|
+
export function ValidationView({ nodes }) {
|
|
7
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Divider, { label: "Validating" }), nodes.map(n => (_jsx(PackageRow, { props: toRowProps(n) }, n.id)))] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ValidationView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationView.js","sourceRoot":"","sources":["../../../src/ui/components/ValidationView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,UAAU,cAAc,CAAC,EAAC,KAAK,EAAsB;IACzD,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,aACtC,KAAC,OAAO,IAAC,KAAK,EAAC,YAAY,GAAG,EAC7B,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACd,KAAC,UAAU,IAAY,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,IAA1B,CAAC,CAAC,EAAE,CAA0B,CAChD,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export function Divider({ label, width } = { width: 40 }) {
|
|
4
|
+
const line = _jsx(Box, { flexGrow: 1, borderStyle: "single", borderTop: false, borderLeft: false, borderRight: false, borderDimColor: true, maxWidth: width });
|
|
5
|
+
if (!label)
|
|
6
|
+
return line;
|
|
7
|
+
return (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: label }), line] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=Divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../../src/ui/components/base/Divider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAI9B,MAAM,UAAU,OAAO,CAAC,EAAC,KAAK,EAAE,KAAK,KAAsC,EAAC,KAAK,EAAE,EAAE,EAAC;IACpF,MAAM,IAAI,GAAG,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAC,QAAQ,EAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,cAAc,QAAC,QAAQ,EAAE,KAAK,GAAI,CAAC;IAEhJ,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,CACL,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,aACT,KAAC,IAAI,IAAC,QAAQ,kBAAE,KAAK,GAAQ,EAC5B,IAAI,IACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animated elapsed-time display. Re-renders every second.
|
|
3
|
+
*
|
|
4
|
+
* @param format - Defaults to m:ss. Pass `formatTime` from selectors for the
|
|
5
|
+
* package-row style ("1.5s" / "2m 30s").
|
|
6
|
+
* @param color - Ink color string (e.g. "yellow").
|
|
7
|
+
* @param dimColor - Render dimmed (e.g. for the footer's total elapsed).
|
|
8
|
+
*/
|
|
9
|
+
export declare function ElapsedTime({ startedAt, format, color, dimColor, }: {
|
|
10
|
+
startedAt: number;
|
|
11
|
+
format?: (ms: number) => string;
|
|
12
|
+
color?: string;
|
|
13
|
+
dimColor?: boolean;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text, useAnimation } from 'ink';
|
|
3
|
+
// ---- ElapsedTime ----
|
|
4
|
+
/**
|
|
5
|
+
* Animated elapsed-time display. Re-renders every second.
|
|
6
|
+
*
|
|
7
|
+
* @param format - Defaults to m:ss. Pass `formatTime` from selectors for the
|
|
8
|
+
* package-row style ("1.5s" / "2m 30s").
|
|
9
|
+
* @param color - Ink color string (e.g. "yellow").
|
|
10
|
+
* @param dimColor - Render dimmed (e.g. for the footer's total elapsed).
|
|
11
|
+
*/
|
|
12
|
+
export function ElapsedTime({ startedAt, format = (ms) => {
|
|
13
|
+
const s = Math.floor(ms / 1000);
|
|
14
|
+
return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')}`;
|
|
15
|
+
}, color, dimColor, }) {
|
|
16
|
+
useAnimation({ interval: 1000 });
|
|
17
|
+
return _jsx(Text, { color: color, dimColor: dimColor, children: format(Date.now() - startedAt) });
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ElapsedTime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElapsedTime.js","sourceRoot":"","sources":["../../../../src/ui/components/base/ElapsedTime.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAE,YAAY,EAAC,MAAM,KAAK,CAAC;AAEvC,wBAAwB;AAExB;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,MAAM,GAAG,CAAC,EAAU,EAAE,EAAE;IACtB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IAChC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACpE,CAAC,EACD,KAAK,EACL,QAAQ,GAMT;IACC,YAAY,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IAC/B,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,YAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAQ,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PackageCounts } from '../../state/selectors.js';
|
|
3
|
+
import { ElapsedTime } from './ElapsedTime.js';
|
|
4
|
+
/** Left column default: running · queued. */
|
|
5
|
+
declare function Active({ counts }: {
|
|
6
|
+
counts: PackageCounts;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
/** Middle column default: done / failed / skipped. */
|
|
9
|
+
declare function Results({ counts }: {
|
|
10
|
+
counts: PackageCounts;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export interface FooterProps {
|
|
13
|
+
/** Pre-computed package counts. Caller is responsible for deriving these. */
|
|
14
|
+
counts: PackageCounts;
|
|
15
|
+
/**
|
|
16
|
+
* Convenience: renders an `ElapsedTime` in the right column when provided.
|
|
17
|
+
* Ignored when `timeSlot` is set.
|
|
18
|
+
*/
|
|
19
|
+
startedAt?: number;
|
|
20
|
+
/** Left column: running · queued. */
|
|
21
|
+
showActive?: boolean;
|
|
22
|
+
/** Middle column: done / failed / skipped. */
|
|
23
|
+
showResults?: boolean;
|
|
24
|
+
/** Right column: elapsed time. */
|
|
25
|
+
showTime?: boolean;
|
|
26
|
+
/** Progress bar row. Caller decides when to enable (e.g. only during build phase). */
|
|
27
|
+
progressBar?: boolean;
|
|
28
|
+
activeSlot?: ReactNode;
|
|
29
|
+
resultsSlot?: ReactNode;
|
|
30
|
+
timeSlot?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
declare function FooterFn({ counts, startedAt, showActive, showResults, showTime, progressBar, activeSlot, resultsSlot, timeSlot, }: FooterProps): import("react").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* Footer with composable column sub-components.
|
|
35
|
+
*
|
|
36
|
+
* @example Default usage
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <Footer counts={counts} startedAt={startedAt} progressBar={isBuilding} />
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Explicit slot composition
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Footer counts={counts} progressBar={isBuilding}
|
|
44
|
+
* activeSlot={<Footer.Active counts={counts} />}
|
|
45
|
+
* resultsSlot={<Footer.Results counts={counts} />}
|
|
46
|
+
* timeSlot={startedAt !== undefined ? <Footer.Elapsed startedAt={startedAt} dimColor /> : undefined}
|
|
47
|
+
* />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare const Footer: typeof FooterFn & {
|
|
51
|
+
/** Left column: running · queued. */
|
|
52
|
+
Active: typeof Active;
|
|
53
|
+
/** Middle column: done / failed / skipped. */
|
|
54
|
+
Results: typeof Results;
|
|
55
|
+
/** Animated elapsed time. Re-exported from PackageRow for slot convenience. */
|
|
56
|
+
Elapsed: typeof ElapsedTime;
|
|
57
|
+
};
|
|
58
|
+
export {};
|