@slats/claude-assets-sync 0.1.4 → 0.2.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/README.md +111 -587
- package/bin/claude-sync.mjs +24 -0
- package/dist/claude-hashes.json +20 -0
- package/dist/commands/index.d.ts +1 -112
- package/dist/commands/runCli/index.d.ts +2 -0
- package/dist/commands/runCli/runCli.cjs +31 -0
- package/dist/commands/runCli/runCli.d.ts +10 -0
- package/dist/commands/runCli/runCli.mjs +29 -0
- package/dist/commands/runCli/type.d.ts +28 -0
- package/dist/commands/runCli/utils/injectOne.cjs +48 -0
- package/dist/commands/runCli/utils/injectOne.d.ts +3 -0
- package/dist/commands/runCli/utils/injectOne.mjs +46 -0
- package/dist/commands/runCli/utils/resolveScopeFlag.cjs +28 -0
- package/dist/commands/runCli/utils/resolveScopeFlag.d.ts +2 -0
- package/dist/commands/runCli/utils/resolveScopeFlag.mjs +26 -0
- package/dist/commands/runCli/utils/runInject.cjs +36 -0
- package/dist/commands/runCli/utils/runInject.d.ts +2 -0
- package/dist/commands/runCli/utils/runInject.mjs +34 -0
- package/dist/core/buildPlan/buildPlan.cjs +42 -0
- package/dist/core/buildPlan/buildPlan.d.ts +2 -0
- package/dist/core/buildPlan/buildPlan.mjs +40 -0
- package/dist/core/buildPlan/index.d.ts +2 -0
- package/dist/core/buildPlan/type.d.ts +32 -0
- package/dist/core/buildPlan/utils/toPosix.cjs +9 -0
- package/dist/core/buildPlan/utils/toPosix.d.ts +1 -0
- package/dist/core/buildPlan/utils/toPosix.mjs +7 -0
- package/dist/core/buildPlan/utils/walkFiles.cjs +25 -0
- package/dist/core/buildPlan/utils/walkFiles.d.ts +1 -0
- package/dist/core/buildPlan/utils/walkFiles.mjs +23 -0
- package/dist/core/hash/hash.cjs +30 -0
- package/dist/core/hash/hash.d.ts +4 -0
- package/dist/core/hash/hash.mjs +26 -0
- package/dist/core/hash/index.d.ts +1 -0
- package/dist/core/hashManifest/hashManifest.cjs +27 -0
- package/dist/core/hashManifest/hashManifest.d.ts +17 -0
- package/dist/core/hashManifest/hashManifest.mjs +23 -0
- package/dist/core/hashManifest/index.d.ts +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/injectDocs/index.d.ts +2 -0
- package/dist/core/injectDocs/injectDocs.cjs +43 -0
- package/dist/core/injectDocs/injectDocs.d.ts +2 -0
- package/dist/core/injectDocs/injectDocs.mjs +41 -0
- package/dist/core/injectDocs/type.d.ts +30 -0
- package/dist/core/injectDocs/utils/applyAction.cjs +21 -0
- package/dist/core/injectDocs/utils/applyAction.d.ts +2 -0
- package/dist/core/injectDocs/utils/applyAction.mjs +19 -0
- package/dist/core/injectDocs/utils/emitCiForceList.cjs +10 -0
- package/dist/core/injectDocs/utils/emitCiForceList.d.ts +2 -0
- package/dist/core/injectDocs/utils/emitCiForceList.mjs +8 -0
- package/dist/core/injectDocs/utils/printPlan.cjs +20 -0
- package/dist/core/injectDocs/utils/printPlan.d.ts +2 -0
- package/dist/core/injectDocs/utils/printPlan.mjs +18 -0
- package/dist/core/injectDocs/utils/summarize.cjs +27 -0
- package/dist/core/injectDocs/utils/summarize.d.ts +3 -0
- package/dist/core/injectDocs/utils/summarize.mjs +25 -0
- package/dist/core/scope/index.d.ts +1 -0
- package/dist/core/scope/scope.cjs +46 -0
- package/dist/core/scope/scope.d.ts +16 -0
- package/dist/core/scope/scope.mjs +41 -0
- package/dist/core/scope/utils/isDirectory.cjs +14 -0
- package/dist/core/scope/utils/isDirectory.d.ts +1 -0
- package/dist/core/scope/utils/isDirectory.mjs +12 -0
- package/dist/index.cjs +15 -9
- package/dist/index.d.ts +3 -5
- package/dist/index.mjs +7 -3
- package/dist/prompts/confirmForce.cjs +27 -0
- package/dist/prompts/confirmForce.d.ts +1 -0
- package/dist/prompts/confirmForce.mjs +25 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/selectScope.cjs +30 -0
- package/dist/prompts/selectScope.d.ts +2 -0
- package/dist/prompts/selectScope.mjs +28 -0
- package/dist/utils/heartbeat.cjs +25 -0
- package/dist/utils/heartbeat.d.ts +16 -0
- package/dist/utils/heartbeat.mjs +23 -0
- package/dist/utils/logger.cjs +7 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/logger.mjs +7 -0
- package/dist/utils/types.d.ts +1 -252
- package/dist/utils/version.cjs +2 -14
- package/dist/utils/version.d.ts +3 -53
- package/dist/utils/version.mjs +2 -13
- package/docs/bundle-size-decision.md +36 -0
- package/docs/claude/skills/claude-sync-applier/SKILL.md +195 -0
- package/docs/claude/skills/claude-sync-applier/knowledge/claude-md-template.md +77 -0
- package/docs/claude/skills/claude-sync-applier/knowledge/dependency-cruiser.md +126 -0
- package/docs/claude/skills/claude-sync-applier/knowledge/gotchas.md +139 -0
- package/docs/claude/skills/claude-sync-applier/knowledge/package-json-patches.md +130 -0
- package/docs/claude/skills/claude-sync-applier/knowledge/reference-files.md +120 -0
- package/docs/claude/skills/claude-sync-applier/knowledge/smoke-tests.md +102 -0
- package/docs/consumer-integration.md +153 -0
- package/package.json +24 -16
- package/scripts/build-hashes.mjs +30 -0
- package/scripts/buildHashes.d.mts +15 -0
- package/scripts/buildHashes.mjs +82 -0
- package/scripts/claude-build-hashes.mjs +42 -0
- package/scripts/inject-version.js +112 -0
- package/dist/cli.cjs +0 -8
- package/dist/cli.d.ts +0 -1
- package/dist/cli.mjs +0 -7
- package/dist/commands/add.cjs +0 -80
- package/dist/commands/add.d.ts +0 -8
- package/dist/commands/add.mjs +0 -78
- package/dist/commands/list.cjs +0 -94
- package/dist/commands/list.d.ts +0 -15
- package/dist/commands/list.mjs +0 -91
- package/dist/commands/migrate.cjs +0 -9
- package/dist/commands/migrate.d.ts +0 -6
- package/dist/commands/migrate.mjs +0 -7
- package/dist/commands/remove.cjs +0 -127
- package/dist/commands/remove.d.ts +0 -6
- package/dist/commands/remove.mjs +0 -105
- package/dist/commands/status.cjs +0 -193
- package/dist/commands/status.d.ts +0 -6
- package/dist/commands/status.mjs +0 -171
- package/dist/commands/sync.cjs +0 -28
- package/dist/commands/sync.d.ts +0 -6
- package/dist/commands/sync.mjs +0 -26
- package/dist/commands/types.d.ts +0 -89
- package/dist/commands/update.cjs +0 -209
- package/dist/commands/update.d.ts +0 -29
- package/dist/commands/update.mjs +0 -206
- package/dist/components/add/AddCommand.cjs +0 -103
- package/dist/components/add/AddCommand.d.ts +0 -14
- package/dist/components/add/AddCommand.mjs +0 -101
- package/dist/components/add/BulkAddView.cjs +0 -165
- package/dist/components/add/BulkAddView.d.ts +0 -11
- package/dist/components/add/BulkAddView.mjs +0 -163
- package/dist/components/add/index.d.ts +0 -2
- package/dist/components/index.d.ts +0 -2
- package/dist/components/list/EditableTreeItem.d.ts +0 -13
- package/dist/components/list/ListCommand.cjs +0 -651
- package/dist/components/list/ListCommand.d.ts +0 -5
- package/dist/components/list/ListCommand.mjs +0 -649
- package/dist/components/list/SyncedPackageTree.d.ts +0 -14
- package/dist/components/list/index.d.ts +0 -10
- package/dist/components/list/types.d.ts +0 -14
- package/dist/components/primitives/Box.d.ts +0 -4
- package/dist/components/primitives/Spinner.d.ts +0 -6
- package/dist/components/primitives/Text.d.ts +0 -4
- package/dist/components/primitives/index.d.ts +0 -3
- package/dist/components/remove/RemoveConfirm.cjs +0 -18
- package/dist/components/remove/RemoveConfirm.d.ts +0 -11
- package/dist/components/remove/RemoveConfirm.mjs +0 -16
- package/dist/components/shared/Confirm.cjs +0 -30
- package/dist/components/shared/Confirm.d.ts +0 -8
- package/dist/components/shared/Confirm.mjs +0 -28
- package/dist/components/shared/MenuItem.cjs +0 -18
- package/dist/components/shared/MenuItem.d.ts +0 -7
- package/dist/components/shared/MenuItem.mjs +0 -16
- package/dist/components/shared/ProgressBar.d.ts +0 -7
- package/dist/components/shared/StepRunner.cjs +0 -58
- package/dist/components/shared/StepRunner.d.ts +0 -15
- package/dist/components/shared/StepRunner.mjs +0 -56
- package/dist/components/shared/Table.cjs +0 -19
- package/dist/components/shared/Table.d.ts +0 -8
- package/dist/components/shared/Table.mjs +0 -17
- package/dist/components/shared/index.d.ts +0 -6
- package/dist/components/status/PackageStatusCard.d.ts +0 -10
- package/dist/components/status/StatusDisplay.cjs +0 -26
- package/dist/components/status/StatusDisplay.d.ts +0 -23
- package/dist/components/status/StatusDisplay.mjs +0 -24
- package/dist/components/status/StatusTreeNode.cjs +0 -40
- package/dist/components/status/StatusTreeNode.d.ts +0 -15
- package/dist/components/status/StatusTreeNode.mjs +0 -38
- package/dist/components/status/index.d.ts +0 -6
- package/dist/components/tree/AssetTreeNode.cjs +0 -54
- package/dist/components/tree/AssetTreeNode.d.ts +0 -12
- package/dist/components/tree/AssetTreeNode.mjs +0 -52
- package/dist/components/tree/TreeSelect.cjs +0 -129
- package/dist/components/tree/TreeSelect.d.ts +0 -12
- package/dist/components/tree/TreeSelect.mjs +0 -127
- package/dist/components/tree/index.d.ts +0 -4
- package/dist/core/assetStructure.cjs +0 -30
- package/dist/core/assetStructure.d.ts +0 -36
- package/dist/core/assetStructure.mjs +0 -27
- package/dist/core/cli.cjs +0 -106
- package/dist/core/cli.d.ts +0 -9
- package/dist/core/cli.mjs +0 -103
- package/dist/core/constants.cjs +0 -28
- package/dist/core/constants.d.ts +0 -94
- package/dist/core/constants.mjs +0 -21
- package/dist/core/filesystem.cjs +0 -98
- package/dist/core/filesystem.d.ts +0 -94
- package/dist/core/filesystem.mjs +0 -88
- package/dist/core/github.cjs +0 -115
- package/dist/core/github.d.ts +0 -61
- package/dist/core/github.mjs +0 -107
- package/dist/core/io.cjs +0 -46
- package/dist/core/io.d.ts +0 -40
- package/dist/core/io.mjs +0 -39
- package/dist/core/listOperations.cjs +0 -228
- package/dist/core/listOperations.d.ts +0 -43
- package/dist/core/listOperations.mjs +0 -205
- package/dist/core/localSource.cjs +0 -126
- package/dist/core/localSource.d.ts +0 -33
- package/dist/core/localSource.mjs +0 -120
- package/dist/core/migration.cjs +0 -201
- package/dist/core/migration.d.ts +0 -57
- package/dist/core/migration.mjs +0 -198
- package/dist/core/packageScanner.cjs +0 -360
- package/dist/core/packageScanner.d.ts +0 -22
- package/dist/core/packageScanner.mjs +0 -356
- package/dist/core/sync.cjs +0 -400
- package/dist/core/sync.d.ts +0 -21
- package/dist/core/sync.mjs +0 -397
- package/dist/core/syncMeta.cjs +0 -242
- package/dist/core/syncMeta.d.ts +0 -75
- package/dist/core/syncMeta.mjs +0 -229
- package/dist/utils/dependencies.cjs +0 -57
- package/dist/utils/dependencies.d.ts +0 -10
- package/dist/utils/dependencies.mjs +0 -34
- package/dist/utils/nameTransform.cjs +0 -13
- package/dist/utils/nameTransform.d.ts +0 -65
- package/dist/utils/nameTransform.mjs +0 -11
- package/dist/utils/package.cjs +0 -170
- package/dist/utils/package.d.ts +0 -105
- package/dist/utils/package.mjs +0 -157
- package/dist/utils/packageName.cjs +0 -24
- package/dist/utils/packageName.d.ts +0 -32
- package/dist/utils/packageName.mjs +0 -21
- package/dist/utils/paths.cjs +0 -18
- package/dist/utils/paths.d.ts +0 -55
- package/dist/utils/paths.mjs +0 -15
- package/dist/version.cjs +0 -5
- package/dist/version.d.ts +0 -5
- package/dist/version.mjs +0 -3
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var ink = require('ink');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var Confirm = require('../shared/Confirm.cjs');
|
|
7
|
-
require('ink-spinner');
|
|
8
|
-
|
|
9
|
-
const RemoveConfirm = ({ packageName, filesToRemove, onConfirm, }) => {
|
|
10
|
-
const { exit } = ink.useApp();
|
|
11
|
-
const handleConfirm = React.useCallback((yes) => {
|
|
12
|
-
onConfirm(yes);
|
|
13
|
-
exit();
|
|
14
|
-
}, [onConfirm, exit]);
|
|
15
|
-
return (jsxRuntime.jsx(Confirm.Confirm, { message: `Remove ${filesToRemove.length} file(s) from ${packageName}?`, onConfirm: handleConfirm, defaultYes: false }));
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
exports.RemoveConfirm = RemoveConfirm;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface RemoveConfirmProps {
|
|
3
|
-
packageName: string;
|
|
4
|
-
filesToRemove: Array<{
|
|
5
|
-
assetType: string;
|
|
6
|
-
path: string;
|
|
7
|
-
}>;
|
|
8
|
-
onConfirm: (yes: boolean) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const RemoveConfirm: React.FC<RemoveConfirmProps>;
|
|
11
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useApp } from 'ink';
|
|
3
|
-
import { useCallback } from 'react';
|
|
4
|
-
import { Confirm } from '../shared/Confirm.mjs';
|
|
5
|
-
import 'ink-spinner';
|
|
6
|
-
|
|
7
|
-
const RemoveConfirm = ({ packageName, filesToRemove, onConfirm, }) => {
|
|
8
|
-
const { exit } = useApp();
|
|
9
|
-
const handleConfirm = useCallback((yes) => {
|
|
10
|
-
onConfirm(yes);
|
|
11
|
-
exit();
|
|
12
|
-
}, [onConfirm, exit]);
|
|
13
|
-
return (jsx(Confirm, { message: `Remove ${filesToRemove.length} file(s) from ${packageName}?`, onConfirm: handleConfirm, defaultYes: false }));
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { RemoveConfirm };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var ink = require('ink');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
|
|
7
|
-
const Confirm = ({ message, onConfirm, defaultYes = true, }) => {
|
|
8
|
-
const [answered, setAnswered] = React.useState(false);
|
|
9
|
-
ink.useInput((input, key) => {
|
|
10
|
-
if (answered)
|
|
11
|
-
return;
|
|
12
|
-
if (input === 'y' || input === 'Y') {
|
|
13
|
-
setAnswered(true);
|
|
14
|
-
onConfirm(true);
|
|
15
|
-
}
|
|
16
|
-
else if (input === 'n' || input === 'N') {
|
|
17
|
-
setAnswered(true);
|
|
18
|
-
onConfirm(false);
|
|
19
|
-
}
|
|
20
|
-
else if (key.return) {
|
|
21
|
-
setAnswered(true);
|
|
22
|
-
onConfirm(defaultYes);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const yText = defaultYes ? jsxRuntime.jsx(ink.Text, { bold: true, children: "Y" }) : jsxRuntime.jsx(ink.Text, { dimColor: true, children: "y" });
|
|
26
|
-
const nText = defaultYes ? jsxRuntime.jsx(ink.Text, { dimColor: true, children: "n" }) : jsxRuntime.jsx(ink.Text, { bold: true, children: "N" });
|
|
27
|
-
return (jsxRuntime.jsxs(ink.Text, { children: [jsxRuntime.jsx(ink.Text, { color: "cyan", children: "? " }), message, " ", jsxRuntime.jsx(ink.Text, { color: "gray", children: "[" }), yText, jsxRuntime.jsx(ink.Text, { color: "gray", children: "/" }), nText, jsxRuntime.jsx(ink.Text, { color: "gray", children: "]" })] }));
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.Confirm = Confirm;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useInput, Text } from 'ink';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
const Confirm = ({ message, onConfirm, defaultYes = true, }) => {
|
|
6
|
-
const [answered, setAnswered] = useState(false);
|
|
7
|
-
useInput((input, key) => {
|
|
8
|
-
if (answered)
|
|
9
|
-
return;
|
|
10
|
-
if (input === 'y' || input === 'Y') {
|
|
11
|
-
setAnswered(true);
|
|
12
|
-
onConfirm(true);
|
|
13
|
-
}
|
|
14
|
-
else if (input === 'n' || input === 'N') {
|
|
15
|
-
setAnswered(true);
|
|
16
|
-
onConfirm(false);
|
|
17
|
-
}
|
|
18
|
-
else if (key.return) {
|
|
19
|
-
setAnswered(true);
|
|
20
|
-
onConfirm(defaultYes);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const yText = defaultYes ? jsx(Text, { bold: true, children: "Y" }) : jsx(Text, { dimColor: true, children: "y" });
|
|
24
|
-
const nText = defaultYes ? jsx(Text, { dimColor: true, children: "n" }) : jsx(Text, { bold: true, children: "N" });
|
|
25
|
-
return (jsxs(Text, { children: [jsx(Text, { color: "cyan", children: "? " }), message, " ", jsx(Text, { color: "gray", children: "[" }), yText, jsx(Text, { color: "gray", children: "/" }), nText, jsx(Text, { color: "gray", children: "]" })] }));
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { Confirm };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var ink = require('ink');
|
|
5
|
-
|
|
6
|
-
const MenuItem = ({ isSelected = false, label, }) => {
|
|
7
|
-
if (label === 'Delete' || label === 'Remove') {
|
|
8
|
-
return (jsxRuntime.jsx(ink.Text, { bold: isSelected, color: "red", children: label }));
|
|
9
|
-
}
|
|
10
|
-
const match = label.match(/^(.+?)\s+\((\d+)\)$/);
|
|
11
|
-
if (match) {
|
|
12
|
-
const [, name, count] = match;
|
|
13
|
-
return (jsxRuntime.jsxs(ink.Text, { children: [jsxRuntime.jsx(ink.Text, { bold: isSelected, children: name }), " ", jsxRuntime.jsxs(ink.Text, { dimColor: true, children: ["(", count, ")"] })] }));
|
|
14
|
-
}
|
|
15
|
-
return jsxRuntime.jsx(ink.Text, { bold: isSelected, children: label });
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
exports.MenuItem = MenuItem;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Text } from 'ink';
|
|
3
|
-
|
|
4
|
-
const MenuItem = ({ isSelected = false, label, }) => {
|
|
5
|
-
if (label === 'Delete' || label === 'Remove') {
|
|
6
|
-
return (jsx(Text, { bold: isSelected, color: "red", children: label }));
|
|
7
|
-
}
|
|
8
|
-
const match = label.match(/^(.+?)\s+\((\d+)\)$/);
|
|
9
|
-
if (match) {
|
|
10
|
-
const [, name, count] = match;
|
|
11
|
-
return (jsxs(Text, { children: [jsx(Text, { bold: isSelected, children: name }), " ", jsxs(Text, { dimColor: true, children: ["(", count, ")"] })] }));
|
|
12
|
-
}
|
|
13
|
-
return jsx(Text, { bold: isSelected, children: label });
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { MenuItem };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var ink = require('ink');
|
|
5
|
-
var Spinner = require('ink-spinner');
|
|
6
|
-
|
|
7
|
-
const StepIcon = ({ status }) => {
|
|
8
|
-
switch (status) {
|
|
9
|
-
case 'success':
|
|
10
|
-
return jsxRuntime.jsx(ink.Text, { color: "green", children: "\u2713" });
|
|
11
|
-
case 'running':
|
|
12
|
-
return (jsxRuntime.jsx(ink.Text, { color: "yellow", children: jsxRuntime.jsx(Spinner, { type: "dots" }) }));
|
|
13
|
-
case 'skipped':
|
|
14
|
-
return jsxRuntime.jsx(ink.Text, { color: "blue", children: "\u23ED" });
|
|
15
|
-
case 'failed':
|
|
16
|
-
return jsxRuntime.jsx(ink.Text, { color: "red", children: "\u2717" });
|
|
17
|
-
case 'pending':
|
|
18
|
-
default:
|
|
19
|
-
return jsxRuntime.jsx(ink.Text, { color: "gray", children: "\u25CB" });
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const StepStatusText = ({ step }) => {
|
|
23
|
-
switch (step.status) {
|
|
24
|
-
case 'success':
|
|
25
|
-
return (jsxRuntime.jsxs(ink.Text, { color: "green", children: ["Done", step.duration != null
|
|
26
|
-
? ` (${Math.round(step.duration / 1000)}s)`
|
|
27
|
-
: ''] }));
|
|
28
|
-
case 'running':
|
|
29
|
-
return jsxRuntime.jsx(ink.Text, { color: "yellow", children: "Running..." });
|
|
30
|
-
case 'skipped':
|
|
31
|
-
return jsxRuntime.jsx(ink.Text, { color: "blue", children: "Skipped" });
|
|
32
|
-
case 'failed':
|
|
33
|
-
return (jsxRuntime.jsxs(ink.Text, { color: "red", children: ["Failed", step.error ? `: ${step.error}` : ''] }));
|
|
34
|
-
case 'pending':
|
|
35
|
-
default:
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const StepItemView = ({ step, index, total, isLast, }) => (jsxRuntime.jsxs(ink.Box, { flexDirection: "column", marginBottom: isLast ? 0 : 1, children: [jsxRuntime.jsxs(ink.Text, { children: [' ', jsxRuntime.jsx(StepIcon, { status: step.status }), jsxRuntime.jsxs(ink.Text, { children: [' ', jsxRuntime.jsxs(ink.Text, { bold: true, children: ["Step ", index + 1, "/", total] }), ' ', step.name] })] }), step.output && step.status !== 'pending' && (jsxRuntime.jsxs(ink.Text, { color: "gray", children: [' ', step.output] })), jsxRuntime.jsxs(ink.Text, { children: [' ', jsxRuntime.jsx(StepStatusText, { step: step })] })] }));
|
|
40
|
-
const StepRunner = ({ steps, total }) => {
|
|
41
|
-
const completedSteps = [];
|
|
42
|
-
const activeSteps = [];
|
|
43
|
-
steps.forEach((step, idx) => {
|
|
44
|
-
const indexed = { ...step, idx };
|
|
45
|
-
if (step.status === 'success' ||
|
|
46
|
-
step.status === 'failed' ||
|
|
47
|
-
step.status === 'skipped') {
|
|
48
|
-
completedSteps.push(indexed);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
activeSteps.push(indexed);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const lastIdx = steps.length - 1;
|
|
55
|
-
return (jsxRuntime.jsxs(ink.Box, { flexDirection: "column", children: [jsxRuntime.jsx(ink.Static, { items: completedSteps, children: (item) => (jsxRuntime.jsx(StepItemView, { step: item, index: item.idx, total: total, isLast: item.idx === lastIdx && activeSteps.length === 0 }, item.idx)) }), activeSteps.map((item) => (jsxRuntime.jsx(StepItemView, { step: item, index: item.idx, total: total, isLast: item.idx === lastIdx }, item.idx)))] }));
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
exports.StepRunner = StepRunner;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface StepResult {
|
|
3
|
-
name: string;
|
|
4
|
-
status: 'pending' | 'running' | 'success' | 'failed' | 'skipped';
|
|
5
|
-
error?: string;
|
|
6
|
-
duration?: number;
|
|
7
|
-
output?: string;
|
|
8
|
-
}
|
|
9
|
-
interface StepRunnerProps {
|
|
10
|
-
steps: StepResult[];
|
|
11
|
-
currentStep: number;
|
|
12
|
-
total: number;
|
|
13
|
-
}
|
|
14
|
-
export declare const StepRunner: React.FC<StepRunnerProps>;
|
|
15
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Box, Static, Text } from 'ink';
|
|
3
|
-
import Spinner from 'ink-spinner';
|
|
4
|
-
|
|
5
|
-
const StepIcon = ({ status }) => {
|
|
6
|
-
switch (status) {
|
|
7
|
-
case 'success':
|
|
8
|
-
return jsx(Text, { color: "green", children: "\u2713" });
|
|
9
|
-
case 'running':
|
|
10
|
-
return (jsx(Text, { color: "yellow", children: jsx(Spinner, { type: "dots" }) }));
|
|
11
|
-
case 'skipped':
|
|
12
|
-
return jsx(Text, { color: "blue", children: "\u23ED" });
|
|
13
|
-
case 'failed':
|
|
14
|
-
return jsx(Text, { color: "red", children: "\u2717" });
|
|
15
|
-
case 'pending':
|
|
16
|
-
default:
|
|
17
|
-
return jsx(Text, { color: "gray", children: "\u25CB" });
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const StepStatusText = ({ step }) => {
|
|
21
|
-
switch (step.status) {
|
|
22
|
-
case 'success':
|
|
23
|
-
return (jsxs(Text, { color: "green", children: ["Done", step.duration != null
|
|
24
|
-
? ` (${Math.round(step.duration / 1000)}s)`
|
|
25
|
-
: ''] }));
|
|
26
|
-
case 'running':
|
|
27
|
-
return jsx(Text, { color: "yellow", children: "Running..." });
|
|
28
|
-
case 'skipped':
|
|
29
|
-
return jsx(Text, { color: "blue", children: "Skipped" });
|
|
30
|
-
case 'failed':
|
|
31
|
-
return (jsxs(Text, { color: "red", children: ["Failed", step.error ? `: ${step.error}` : ''] }));
|
|
32
|
-
case 'pending':
|
|
33
|
-
default:
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const StepItemView = ({ step, index, total, isLast, }) => (jsxs(Box, { flexDirection: "column", marginBottom: isLast ? 0 : 1, children: [jsxs(Text, { children: [' ', jsx(StepIcon, { status: step.status }), jsxs(Text, { children: [' ', jsxs(Text, { bold: true, children: ["Step ", index + 1, "/", total] }), ' ', step.name] })] }), step.output && step.status !== 'pending' && (jsxs(Text, { color: "gray", children: [' ', step.output] })), jsxs(Text, { children: [' ', jsx(StepStatusText, { step: step })] })] }));
|
|
38
|
-
const StepRunner = ({ steps, total }) => {
|
|
39
|
-
const completedSteps = [];
|
|
40
|
-
const activeSteps = [];
|
|
41
|
-
steps.forEach((step, idx) => {
|
|
42
|
-
const indexed = { ...step, idx };
|
|
43
|
-
if (step.status === 'success' ||
|
|
44
|
-
step.status === 'failed' ||
|
|
45
|
-
step.status === 'skipped') {
|
|
46
|
-
completedSteps.push(indexed);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
activeSteps.push(indexed);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
const lastIdx = steps.length - 1;
|
|
53
|
-
return (jsxs(Box, { flexDirection: "column", children: [jsx(Static, { items: completedSteps, children: (item) => (jsx(StepItemView, { step: item, index: item.idx, total: total, isLast: item.idx === lastIdx && activeSteps.length === 0 }, item.idx)) }), activeSteps.map((item) => (jsx(StepItemView, { step: item, index: item.idx, total: total, isLast: item.idx === lastIdx }, item.idx)))] }));
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export { StepRunner };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var ink = require('ink');
|
|
5
|
-
|
|
6
|
-
const Table = ({ headers, rows, columnWidths, }) => {
|
|
7
|
-
const widths = columnWidths ??
|
|
8
|
-
headers.map((header, colIdx) => {
|
|
9
|
-
const dataMax = rows.reduce((max, row) => Math.max(max, (row[colIdx] ?? '').length), 0);
|
|
10
|
-
return Math.max(header.length, dataMax) + 2;
|
|
11
|
-
});
|
|
12
|
-
const padCell = (text, width) => {
|
|
13
|
-
return text.padEnd(width);
|
|
14
|
-
};
|
|
15
|
-
const separator = widths.map((w) => '─'.repeat(w)).join(' ');
|
|
16
|
-
return (jsxRuntime.jsxs(ink.Box, { flexDirection: "column", children: [jsxRuntime.jsx(ink.Text, { children: headers.map((h, i) => (jsxRuntime.jsxs(ink.Text, { bold: true, children: [padCell(h, widths[i]), i < headers.length - 1 ? ' ' : ''] }, i))) }), jsxRuntime.jsx(ink.Text, { color: "gray", children: separator }), rows.map((row, rowIdx) => (jsxRuntime.jsx(ink.Text, { children: row.map((cell, colIdx) => (jsxRuntime.jsxs(ink.Text, { children: [padCell(cell, widths[colIdx]), colIdx < row.length - 1 ? ' ' : ''] }, colIdx))) }, rowIdx)))] }));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
exports.Table = Table;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
|
|
4
|
-
const Table = ({ headers, rows, columnWidths, }) => {
|
|
5
|
-
const widths = columnWidths ??
|
|
6
|
-
headers.map((header, colIdx) => {
|
|
7
|
-
const dataMax = rows.reduce((max, row) => Math.max(max, (row[colIdx] ?? '').length), 0);
|
|
8
|
-
return Math.max(header.length, dataMax) + 2;
|
|
9
|
-
});
|
|
10
|
-
const padCell = (text, width) => {
|
|
11
|
-
return text.padEnd(width);
|
|
12
|
-
};
|
|
13
|
-
const separator = widths.map((w) => '─'.repeat(w)).join(' ');
|
|
14
|
-
return (jsxs(Box, { flexDirection: "column", children: [jsx(Text, { children: headers.map((h, i) => (jsxs(Text, { bold: true, children: [padCell(h, widths[i]), i < headers.length - 1 ? ' ' : ''] }, i))) }), jsx(Text, { color: "gray", children: separator }), rows.map((row, rowIdx) => (jsx(Text, { children: row.map((cell, colIdx) => (jsxs(Text, { children: [padCell(cell, widths[colIdx]), colIdx < row.length - 1 ? ' ' : ''] }, colIdx))) }, rowIdx)))] }));
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { Table };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { Confirm } from './Confirm.js';
|
|
2
|
-
export { MenuItem } from './MenuItem.js';
|
|
3
|
-
export { ProgressBar } from './ProgressBar.js';
|
|
4
|
-
export { StepRunner } from './StepRunner.js';
|
|
5
|
-
export type { StepResult } from './StepRunner.js';
|
|
6
|
-
export { Table } from './Table.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface PackageStatusCardProps {
|
|
3
|
-
name: string;
|
|
4
|
-
localVersion: string;
|
|
5
|
-
remoteVersion?: string;
|
|
6
|
-
status: 'up-to-date' | 'outdated' | 'error' | 'unknown';
|
|
7
|
-
syncedAt: string;
|
|
8
|
-
error?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const PackageStatusCard: React.FC<PackageStatusCardProps>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var ink = require('ink');
|
|
5
|
-
var Spinner = require('ink-spinner');
|
|
6
|
-
var StatusTreeNode = require('./StatusTreeNode.cjs');
|
|
7
|
-
|
|
8
|
-
const StatusDisplay = ({ packages, loading, summary, }) => {
|
|
9
|
-
if (loading) {
|
|
10
|
-
return (jsxRuntime.jsx(ink.Box, { children: jsxRuntime.jsxs(ink.Text, { color: "cyan", children: [jsxRuntime.jsx(Spinner, { type: "dots" }), " Checking package versions..."] }) }));
|
|
11
|
-
}
|
|
12
|
-
return (jsxRuntime.jsxs(ink.Box, { flexDirection: "column", children: [jsxRuntime.jsx(ink.Box, { marginBottom: 1, children: jsxRuntime.jsx(ink.Text, { bold: true, children: "Package Sync Status" }) }), packages.map((pkg) => {
|
|
13
|
-
const assetTypes = Object.keys(pkg.files || {});
|
|
14
|
-
return (jsxRuntime.jsxs(ink.Box, { flexDirection: "column", marginBottom: 1, children: [jsxRuntime.jsx(StatusTreeNode.StatusTreeNode, { label: pkg.name, depth: 0, type: "package", expanded: true, status: pkg.status, version: pkg.localVersion, remoteVersion: pkg.remoteVersion, fileCount: pkg.fileCount }), assetTypes.map((assetType) => {
|
|
15
|
-
const files = pkg.files[assetType];
|
|
16
|
-
const fileArray = Array.isArray(files) ? files : [];
|
|
17
|
-
return (jsxRuntime.jsxs(ink.Box, { flexDirection: "column", children: [jsxRuntime.jsx(StatusTreeNode.StatusTreeNode, { label: assetType, depth: 1, type: "assetType", expanded: true, fileCount: fileArray.length }), fileArray.map((unit, index) => {
|
|
18
|
-
const displayName = unit.transformed ?? unit.name;
|
|
19
|
-
const label = unit.isDirectory ? `${displayName}/` : displayName;
|
|
20
|
-
return (jsxRuntime.jsx(StatusTreeNode.StatusTreeNode, { label: label, depth: 2, type: "file" }, `${assetType}-${index}`));
|
|
21
|
-
})] }, assetType));
|
|
22
|
-
}), jsxRuntime.jsx(ink.Box, { marginLeft: 2, children: jsxRuntime.jsxs(ink.Text, { dimColor: true, children: ["Last synced: ", new Date(pkg.syncedAt).toLocaleString()] }) }), pkg.error && (jsxRuntime.jsx(ink.Box, { marginLeft: 2, children: jsxRuntime.jsxs(ink.Text, { color: "red", children: ["Error: ", pkg.error] }) }))] }, pkg.name));
|
|
23
|
-
}), jsxRuntime.jsx(ink.Box, { marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderColor: "gray", children: jsxRuntime.jsxs(ink.Text, { dimColor: true, children: ["Summary: ", summary.upToDate, " up to date", summary.outdated > 0 && `, ${summary.outdated} updates available`, summary.error > 0 && `, ${summary.error} errors`, summary.unknown > 0 && `, ${summary.unknown} unknown`] }) })] }));
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
exports.StatusDisplay = StatusDisplay;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SkillUnit } from '../../utils/types.js';
|
|
3
|
-
export interface PackageStatusItem {
|
|
4
|
-
name: string;
|
|
5
|
-
localVersion: string;
|
|
6
|
-
remoteVersion?: string;
|
|
7
|
-
status: 'up-to-date' | 'outdated' | 'error' | 'unknown';
|
|
8
|
-
syncedAt: string;
|
|
9
|
-
error?: string;
|
|
10
|
-
files: Record<string, SkillUnit[]>;
|
|
11
|
-
fileCount: number;
|
|
12
|
-
}
|
|
13
|
-
export interface StatusDisplayProps {
|
|
14
|
-
packages: PackageStatusItem[];
|
|
15
|
-
loading: boolean;
|
|
16
|
-
summary: {
|
|
17
|
-
upToDate: number;
|
|
18
|
-
outdated: number;
|
|
19
|
-
error: number;
|
|
20
|
-
unknown: number;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export declare const StatusDisplay: React.FC<StatusDisplayProps>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import Spinner from 'ink-spinner';
|
|
4
|
-
import { StatusTreeNode } from './StatusTreeNode.mjs';
|
|
5
|
-
|
|
6
|
-
const StatusDisplay = ({ packages, loading, summary, }) => {
|
|
7
|
-
if (loading) {
|
|
8
|
-
return (jsx(Box, { children: jsxs(Text, { color: "cyan", children: [jsx(Spinner, { type: "dots" }), " Checking package versions..."] }) }));
|
|
9
|
-
}
|
|
10
|
-
return (jsxs(Box, { flexDirection: "column", children: [jsx(Box, { marginBottom: 1, children: jsx(Text, { bold: true, children: "Package Sync Status" }) }), packages.map((pkg) => {
|
|
11
|
-
const assetTypes = Object.keys(pkg.files || {});
|
|
12
|
-
return (jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [jsx(StatusTreeNode, { label: pkg.name, depth: 0, type: "package", expanded: true, status: pkg.status, version: pkg.localVersion, remoteVersion: pkg.remoteVersion, fileCount: pkg.fileCount }), assetTypes.map((assetType) => {
|
|
13
|
-
const files = pkg.files[assetType];
|
|
14
|
-
const fileArray = Array.isArray(files) ? files : [];
|
|
15
|
-
return (jsxs(Box, { flexDirection: "column", children: [jsx(StatusTreeNode, { label: assetType, depth: 1, type: "assetType", expanded: true, fileCount: fileArray.length }), fileArray.map((unit, index) => {
|
|
16
|
-
const displayName = unit.transformed ?? unit.name;
|
|
17
|
-
const label = unit.isDirectory ? `${displayName}/` : displayName;
|
|
18
|
-
return (jsx(StatusTreeNode, { label: label, depth: 2, type: "file" }, `${assetType}-${index}`));
|
|
19
|
-
})] }, assetType));
|
|
20
|
-
}), jsx(Box, { marginLeft: 2, children: jsxs(Text, { dimColor: true, children: ["Last synced: ", new Date(pkg.syncedAt).toLocaleString()] }) }), pkg.error && (jsx(Box, { marginLeft: 2, children: jsxs(Text, { color: "red", children: ["Error: ", pkg.error] }) }))] }, pkg.name));
|
|
21
|
-
}), jsx(Box, { marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderColor: "gray", children: jsxs(Text, { dimColor: true, children: ["Summary: ", summary.upToDate, " up to date", summary.outdated > 0 && `, ${summary.outdated} updates available`, summary.error > 0 && `, ${summary.error} errors`, summary.unknown > 0 && `, ${summary.unknown} unknown`] }) })] }));
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { StatusDisplay };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var ink = require('ink');
|
|
5
|
-
|
|
6
|
-
const StatusTreeNode = ({ label, depth, type, expanded = false, status, version, remoteVersion, fileCount, }) => {
|
|
7
|
-
const indent = ' '.repeat(depth);
|
|
8
|
-
const getIcon = () => {
|
|
9
|
-
if (type === 'package') {
|
|
10
|
-
if (status === 'up-to-date')
|
|
11
|
-
return '●';
|
|
12
|
-
if (status === 'outdated')
|
|
13
|
-
return '◐';
|
|
14
|
-
if (status === 'error')
|
|
15
|
-
return '○';
|
|
16
|
-
return '○';
|
|
17
|
-
}
|
|
18
|
-
if (type === 'assetType') {
|
|
19
|
-
return expanded ? '▼' : '▶';
|
|
20
|
-
}
|
|
21
|
-
return '•';
|
|
22
|
-
};
|
|
23
|
-
const getColor = () => {
|
|
24
|
-
if (type === 'package') {
|
|
25
|
-
if (status === 'up-to-date')
|
|
26
|
-
return 'green';
|
|
27
|
-
if (status === 'outdated')
|
|
28
|
-
return 'yellow';
|
|
29
|
-
if (status === 'error')
|
|
30
|
-
return 'red';
|
|
31
|
-
return 'gray';
|
|
32
|
-
}
|
|
33
|
-
if (type === 'assetType')
|
|
34
|
-
return 'cyan';
|
|
35
|
-
return 'white';
|
|
36
|
-
};
|
|
37
|
-
return (jsxRuntime.jsxs(ink.Box, { children: [jsxRuntime.jsx(ink.Text, { dimColor: true, children: indent }), jsxRuntime.jsxs(ink.Text, { color: getColor(), children: [getIcon(), " "] }), jsxRuntime.jsx(ink.Text, { color: getColor(), bold: type !== 'file', children: label }), type === 'package' && version && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ink.Text, { dimColor: true, children: " @ " }), jsxRuntime.jsx(ink.Text, { color: "blue", children: version }), remoteVersion && remoteVersion !== version && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ink.Text, { dimColor: true, children: " \u2192 " }), jsxRuntime.jsx(ink.Text, { color: "yellow", children: remoteVersion })] })), fileCount !== undefined && (jsxRuntime.jsxs(ink.Text, { dimColor: true, children: [" (", fileCount, " files)"] }))] }))] }));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
exports.StatusTreeNode = StatusTreeNode;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface StatusTreeNodeProps {
|
|
3
|
-
label: string;
|
|
4
|
-
depth: number;
|
|
5
|
-
type: 'package' | 'assetType' | 'file';
|
|
6
|
-
expanded?: boolean;
|
|
7
|
-
status?: 'up-to-date' | 'outdated' | 'error' | 'unknown';
|
|
8
|
-
version?: string;
|
|
9
|
-
remoteVersion?: string;
|
|
10
|
-
fileCount?: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Read-only tree node for status display
|
|
14
|
-
*/
|
|
15
|
-
export declare const StatusTreeNode: React.FC<StatusTreeNodeProps>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
|
|
4
|
-
const StatusTreeNode = ({ label, depth, type, expanded = false, status, version, remoteVersion, fileCount, }) => {
|
|
5
|
-
const indent = ' '.repeat(depth);
|
|
6
|
-
const getIcon = () => {
|
|
7
|
-
if (type === 'package') {
|
|
8
|
-
if (status === 'up-to-date')
|
|
9
|
-
return '●';
|
|
10
|
-
if (status === 'outdated')
|
|
11
|
-
return '◐';
|
|
12
|
-
if (status === 'error')
|
|
13
|
-
return '○';
|
|
14
|
-
return '○';
|
|
15
|
-
}
|
|
16
|
-
if (type === 'assetType') {
|
|
17
|
-
return expanded ? '▼' : '▶';
|
|
18
|
-
}
|
|
19
|
-
return '•';
|
|
20
|
-
};
|
|
21
|
-
const getColor = () => {
|
|
22
|
-
if (type === 'package') {
|
|
23
|
-
if (status === 'up-to-date')
|
|
24
|
-
return 'green';
|
|
25
|
-
if (status === 'outdated')
|
|
26
|
-
return 'yellow';
|
|
27
|
-
if (status === 'error')
|
|
28
|
-
return 'red';
|
|
29
|
-
return 'gray';
|
|
30
|
-
}
|
|
31
|
-
if (type === 'assetType')
|
|
32
|
-
return 'cyan';
|
|
33
|
-
return 'white';
|
|
34
|
-
};
|
|
35
|
-
return (jsxs(Box, { children: [jsx(Text, { dimColor: true, children: indent }), jsxs(Text, { color: getColor(), children: [getIcon(), " "] }), jsx(Text, { color: getColor(), bold: type !== 'file', children: label }), type === 'package' && version && (jsxs(Fragment, { children: [jsx(Text, { dimColor: true, children: " @ " }), jsx(Text, { color: "blue", children: version }), remoteVersion && remoteVersion !== version && (jsxs(Fragment, { children: [jsx(Text, { dimColor: true, children: " \u2192 " }), jsx(Text, { color: "yellow", children: remoteVersion })] })), fileCount !== undefined && (jsxs(Text, { dimColor: true, children: [" (", fileCount, " files)"] }))] }))] }));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { StatusTreeNode };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { StatusDisplay } from './StatusDisplay.js';
|
|
2
|
-
export { PackageStatusCard } from './PackageStatusCard.js';
|
|
3
|
-
export { StatusTreeNode } from './StatusTreeNode.js';
|
|
4
|
-
export type { StatusDisplayProps, PackageStatusItem } from './StatusDisplay.js';
|
|
5
|
-
export type { PackageStatusCardProps } from './PackageStatusCard.js';
|
|
6
|
-
export type { StatusTreeNodeProps } from './StatusTreeNode.js';
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var ink = require('ink');
|
|
5
|
-
|
|
6
|
-
function hasPartialSelection(node) {
|
|
7
|
-
if (!node.children || node.children.length === 0) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
const selectedCount = node.children.filter((child) => child.selected).length;
|
|
11
|
-
return selectedCount > 0 && selectedCount < node.children.length;
|
|
12
|
-
}
|
|
13
|
-
function getTreePrefix(isLastAtDepth) {
|
|
14
|
-
let prefix = '';
|
|
15
|
-
const depth = isLastAtDepth.length;
|
|
16
|
-
for (let i = 0; i < depth; i++) {
|
|
17
|
-
if (i === depth - 1) {
|
|
18
|
-
prefix += isLastAtDepth[i] ? '└─ ' : '├─ ';
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
prefix += isLastAtDepth[i] ? ' ' : '│ ';
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return prefix;
|
|
25
|
-
}
|
|
26
|
-
const AssetTreeNode = ({ node, isLastAtDepth, isSelected, }) => {
|
|
27
|
-
const treePrefix = getTreePrefix(isLastAtDepth);
|
|
28
|
-
if (node.disabled) {
|
|
29
|
-
return (jsxRuntime.jsx(ink.Box, { children: jsxRuntime.jsxs(ink.Text, { color: isSelected ? 'cyan' : undefined, dimColor: !isSelected, children: [treePrefix, node.label] }) }));
|
|
30
|
-
}
|
|
31
|
-
let selectionIcon;
|
|
32
|
-
let iconColor;
|
|
33
|
-
if (hasPartialSelection(node)) {
|
|
34
|
-
selectionIcon = '◐';
|
|
35
|
-
iconColor = 'yellow';
|
|
36
|
-
}
|
|
37
|
-
else if (node.selected) {
|
|
38
|
-
selectionIcon = '◉';
|
|
39
|
-
iconColor = 'green';
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
selectionIcon = '○';
|
|
43
|
-
iconColor = 'red';
|
|
44
|
-
}
|
|
45
|
-
const expandIcon = (node.type === 'directory' || node.type === 'skill-directory') &&
|
|
46
|
-
node.children
|
|
47
|
-
? node.expanded
|
|
48
|
-
? '▼'
|
|
49
|
-
: '▶'
|
|
50
|
-
: ' ';
|
|
51
|
-
return (jsxRuntime.jsx(ink.Box, { children: jsxRuntime.jsxs(ink.Text, { color: isSelected ? 'cyan' : undefined, children: [treePrefix, expandIcon, " ", jsxRuntime.jsx(ink.Text, { color: iconColor, children: selectionIcon }), " ", node.label] }) }));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
exports.AssetTreeNode = AssetTreeNode;
|