@slats/claude-assets-sync 0.3.0 → 0.3.2
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 +15 -11
- package/dist/claude-hashes.json +7 -7
- package/dist/commands/runCli/runCli.d.ts +4 -2
- package/dist/commands/runCli/runCli.mjs +7 -2
- package/dist/commands/runCli/type.d.ts +1 -0
- package/dist/commands/runCli/utils/renderOrFallback.d.ts +6 -0
- package/dist/commands/runCli/utils/renderOrFallback.mjs +12 -0
- package/dist/commands/runCli/utils/renderPlain.d.ts +11 -0
- package/dist/commands/runCli/utils/renderPlain.mjs +89 -0
- package/dist/commands/runCli/utils/resolveScopeAlias.mjs +30 -33
- package/dist/commands/runCli/utils/resolveScopeFlag.d.ts +9 -1
- package/dist/commands/runCli/utils/resolveScopeFlag.mjs +5 -11
- package/dist/commands/runCli/utils/toConsumerPackages.d.ts +9 -0
- package/dist/commands/runCli/utils/toConsumerPackages.mjs +26 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/injectDocs/index.d.ts +3 -2
- package/dist/core/injectDocs/type.d.ts +0 -19
- package/dist/core/scope/index.d.ts +1 -1
- package/dist/core/scope/scope.d.ts +0 -1
- package/dist/core/scope/scope.mjs +1 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/ui/InjectApp/InjectApp.d.ts +2 -0
- package/dist/ui/InjectApp/InjectApp.mjs +82 -0
- package/dist/ui/InjectApp/index.d.ts +2 -0
- package/dist/ui/InjectApp/utils/eventSelectors.d.ts +5 -0
- package/dist/ui/InjectApp/utils/eventSelectors.mjs +24 -0
- package/dist/ui/InjectApp/utils/phaseReducer.d.ts +2 -0
- package/dist/ui/InjectApp/utils/phaseReducer.mjs +133 -0
- package/dist/ui/InjectApp/utils/renderInjectApp.d.ts +2 -0
- package/dist/ui/InjectApp/utils/renderInjectApp.mjs +19 -0
- package/dist/ui/InjectApp/utils/type.d.ts +5 -0
- package/dist/ui/components/ActionRow.d.ts +7 -0
- package/dist/ui/components/ActionRow.mjs +45 -0
- package/dist/ui/components/Banner.d.ts +7 -0
- package/dist/ui/components/Banner.mjs +9 -0
- package/dist/ui/components/ConfirmForce.d.ts +8 -0
- package/dist/ui/components/ConfirmForce.mjs +35 -0
- package/dist/ui/components/ErrorPanel.d.ts +6 -0
- package/dist/ui/components/ErrorPanel.mjs +14 -0
- package/dist/ui/components/Footer.d.ts +8 -0
- package/dist/ui/components/Footer.mjs +27 -0
- package/dist/ui/components/PlanTable.d.ts +8 -0
- package/dist/ui/components/PlanTable.mjs +15 -0
- package/dist/ui/components/ProgressBar.d.ts +10 -0
- package/dist/ui/components/ProgressBar.mjs +28 -0
- package/dist/ui/components/ScopePicker.d.ts +7 -0
- package/dist/ui/components/ScopePicker.mjs +26 -0
- package/dist/ui/components/Spinner.d.ts +8 -0
- package/dist/ui/components/Spinner.mjs +10 -0
- package/dist/ui/components/StatusBadge.d.ts +8 -0
- package/dist/ui/components/StepTracker.d.ts +9 -0
- package/dist/ui/components/StepTracker.mjs +43 -0
- package/dist/ui/components/Summary.d.ts +9 -0
- package/dist/ui/components/Summary.mjs +30 -0
- package/dist/ui/components/TargetCard.d.ts +11 -0
- package/dist/ui/components/TargetCard.mjs +29 -0
- package/dist/ui/hooks/useApplyStep.d.ts +12 -0
- package/dist/ui/hooks/useApplyStep.mjs +30 -0
- package/dist/ui/hooks/useExitApp.d.ts +8 -0
- package/dist/ui/hooks/useExitApp.mjs +19 -0
- package/dist/ui/hooks/useForceConfirmStep.d.ts +9 -0
- package/dist/ui/hooks/useForceConfirmStep.mjs +24 -0
- package/dist/ui/hooks/useInjectSession.d.ts +10 -0
- package/dist/ui/hooks/useInjectSession.mjs +63 -0
- package/dist/ui/hooks/useInterval.d.ts +1 -0
- package/dist/ui/hooks/usePhase.d.ts +2 -0
- package/dist/ui/hooks/usePhase.mjs +9 -0
- package/dist/ui/hooks/usePlanStep.d.ts +13 -0
- package/dist/ui/hooks/usePlanStep.mjs +95 -0
- package/dist/ui/hooks/useResolveStep.d.ts +18 -0
- package/dist/ui/hooks/useResolveStep.mjs +21 -0
- package/dist/ui/hooks/useTerminalWidth.d.ts +1 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.mjs +16 -0
- package/dist/ui/theme/colors.d.ts +12 -0
- package/dist/ui/theme/colors.mjs +9 -0
- package/dist/ui/theme/icons.d.ts +29 -0
- package/dist/ui/theme/icons.mjs +17 -0
- package/dist/ui/theme/layout.d.ts +20 -0
- package/dist/ui/theme/layout.mjs +9 -0
- package/dist/ui/types/event.d.ts +45 -0
- package/dist/ui/types/index.d.ts +4 -0
- package/dist/ui/types/phase.d.ts +44 -0
- package/dist/ui/types/render.d.ts +6 -0
- package/dist/ui/types/target.d.ts +25 -0
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.mjs +1 -1
- package/docs/claude/skills/claude-docs-asset-wiring/SKILL.md +1 -1
- package/docs/claude/skills/claude-docs-asset-wiring/knowledge/claude-md-template.md +4 -12
- package/docs/claude/skills/claude-docs-asset-wiring/knowledge/gotchas.md +17 -14
- package/docs/claude/skills/claude-docs-asset-wiring/knowledge/package-json-patches.md +18 -13
- package/docs/claude/skills/claude-docs-asset-wiring/knowledge/reference-files.md +4 -4
- package/docs/consumer-integration.md +9 -8
- package/package.json +12 -7
- package/scripts/dev-ui-fixtures.ts +288 -0
- package/scripts/dev-ui.tsx +288 -0
- package/dist/commands/runCli/runCli.cjs +0 -53
- package/dist/commands/runCli/utils/classifyTarget.cjs +0 -48
- package/dist/commands/runCli/utils/injectOne.cjs +0 -47
- package/dist/commands/runCli/utils/injectOne.d.ts +0 -3
- package/dist/commands/runCli/utils/injectOne.mjs +0 -45
- package/dist/commands/runCli/utils/resolvePackage.cjs +0 -77
- package/dist/commands/runCli/utils/resolveScopeAlias.cjs +0 -69
- package/dist/commands/runCli/utils/resolveScopeFlag.cjs +0 -28
- package/dist/commands/runCli/utils/resolveTargets.cjs +0 -40
- package/dist/commands/runCli/utils/runInject.cjs +0 -52
- package/dist/commands/runCli/utils/runInject.d.ts +0 -3
- package/dist/commands/runCli/utils/runInject.mjs +0 -50
- package/dist/core/buildPlan/buildPlan.cjs +0 -42
- package/dist/core/buildPlan/utils/toPosix.cjs +0 -9
- package/dist/core/buildPlan/utils/walkFiles.cjs +0 -25
- package/dist/core/hash/hash.cjs +0 -30
- package/dist/core/hashManifest/hashManifest.cjs +0 -27
- package/dist/core/injectDocs/injectDocs.cjs +0 -43
- package/dist/core/injectDocs/injectDocs.d.ts +0 -2
- package/dist/core/injectDocs/injectDocs.mjs +0 -41
- package/dist/core/injectDocs/utils/applyAction.cjs +0 -21
- package/dist/core/injectDocs/utils/emitCiForceList.cjs +0 -10
- package/dist/core/injectDocs/utils/emitCiForceList.d.ts +0 -2
- package/dist/core/injectDocs/utils/emitCiForceList.mjs +0 -8
- package/dist/core/injectDocs/utils/printPlan.cjs +0 -20
- package/dist/core/injectDocs/utils/printPlan.d.ts +0 -2
- package/dist/core/injectDocs/utils/printPlan.mjs +0 -18
- package/dist/core/injectDocs/utils/summarize.cjs +0 -27
- package/dist/core/scope/scope.cjs +0 -46
- package/dist/core/scope/utils/isDirectory.cjs +0 -14
- package/dist/index.cjs +0 -20
- package/dist/prompts/confirmForce.cjs +0 -27
- package/dist/prompts/confirmForce.d.ts +0 -1
- package/dist/prompts/confirmForce.mjs +0 -25
- package/dist/prompts/index.d.ts +0 -2
- package/dist/prompts/selectScope.cjs +0 -30
- package/dist/prompts/selectScope.d.ts +0 -2
- package/dist/prompts/selectScope.mjs +0 -28
- package/dist/utils/asyncPool.cjs +0 -26
- package/dist/utils/heartbeat.cjs +0 -25
- package/dist/utils/heartbeat.d.ts +0 -16
- package/dist/utils/heartbeat.mjs +0 -23
- package/dist/utils/logger.cjs +0 -74
- package/dist/utils/version.cjs +0 -5
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var prompts = require('@inquirer/prompts');
|
|
4
|
-
var pc = require('picocolors');
|
|
5
|
-
|
|
6
|
-
const CHOICES = [
|
|
7
|
-
{
|
|
8
|
-
name: 'user',
|
|
9
|
-
value: 'user',
|
|
10
|
-
description: '~/.claude (applies globally to every project)',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'project',
|
|
14
|
-
value: 'project',
|
|
15
|
-
description: 'nearest ancestor .claude (or <cwd>/.claude)',
|
|
16
|
-
},
|
|
17
|
-
];
|
|
18
|
-
async function selectScopeAsync() {
|
|
19
|
-
const answer = await prompts.select({
|
|
20
|
-
message: pc.bold(pc.cyan('Select injection scope:')),
|
|
21
|
-
choices: CHOICES.map((c) => ({
|
|
22
|
-
name: c.name,
|
|
23
|
-
value: c.value,
|
|
24
|
-
description: pc.dim(c.description),
|
|
25
|
-
})),
|
|
26
|
-
});
|
|
27
|
-
return answer;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
exports.selectScopeAsync = selectScopeAsync;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { select } from '@inquirer/prompts';
|
|
2
|
-
import pc from 'picocolors';
|
|
3
|
-
|
|
4
|
-
const CHOICES = [
|
|
5
|
-
{
|
|
6
|
-
name: 'user',
|
|
7
|
-
value: 'user',
|
|
8
|
-
description: '~/.claude (applies globally to every project)',
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
name: 'project',
|
|
12
|
-
value: 'project',
|
|
13
|
-
description: 'nearest ancestor .claude (or <cwd>/.claude)',
|
|
14
|
-
},
|
|
15
|
-
];
|
|
16
|
-
async function selectScopeAsync() {
|
|
17
|
-
const answer = await select({
|
|
18
|
-
message: pc.bold(pc.cyan('Select injection scope:')),
|
|
19
|
-
choices: CHOICES.map((c) => ({
|
|
20
|
-
name: c.name,
|
|
21
|
-
value: c.value,
|
|
22
|
-
description: pc.dim(c.description),
|
|
23
|
-
})),
|
|
24
|
-
});
|
|
25
|
-
return answer;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { selectScopeAsync };
|
package/dist/utils/asyncPool.cjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
async function asyncPool(limit, items, fn) {
|
|
4
|
-
const results = [];
|
|
5
|
-
const executing = new Set();
|
|
6
|
-
for (const [index, item] of items.entries()) {
|
|
7
|
-
const p = (async () => {
|
|
8
|
-
try {
|
|
9
|
-
const value = await fn(item);
|
|
10
|
-
results[index] = { status: 'fulfilled', value };
|
|
11
|
-
}
|
|
12
|
-
catch (reason) {
|
|
13
|
-
results[index] = { status: 'rejected', reason };
|
|
14
|
-
}
|
|
15
|
-
})();
|
|
16
|
-
executing.add(p);
|
|
17
|
-
p.then(() => executing.delete(p));
|
|
18
|
-
if (executing.size >= limit) {
|
|
19
|
-
await Promise.race(executing);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
await Promise.all(executing);
|
|
23
|
-
return results;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
exports.asyncPool = asyncPool;
|
package/dist/utils/heartbeat.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var pc = require('picocolors');
|
|
4
|
-
|
|
5
|
-
function startHeartbeat(options = {}) {
|
|
6
|
-
const intervalMs = options.intervalMs ?? 500;
|
|
7
|
-
const label = options.label ?? 'working';
|
|
8
|
-
const emit = options.emit ??
|
|
9
|
-
((line) => {
|
|
10
|
-
process.stderr.write(line);
|
|
11
|
-
});
|
|
12
|
-
const startedAt = Date.now();
|
|
13
|
-
const timer = setInterval(() => {
|
|
14
|
-
const elapsedMs = Date.now() - startedAt;
|
|
15
|
-
const seconds = (elapsedMs / 1000).toFixed(1);
|
|
16
|
-
emit(`${pc.dim(`[${seconds}s]`)} ${pc.cyan(`${label}...`)}\n`);
|
|
17
|
-
}, intervalMs);
|
|
18
|
-
if (typeof timer.unref === 'function')
|
|
19
|
-
timer.unref();
|
|
20
|
-
return () => {
|
|
21
|
-
clearInterval(timer);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
exports.startHeartbeat = startHeartbeat;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface HeartbeatOptions {
|
|
2
|
-
intervalMs?: number;
|
|
3
|
-
emit?: (line: string) => void;
|
|
4
|
-
label?: string;
|
|
5
|
-
}
|
|
6
|
-
export type StopHeartbeat = () => void;
|
|
7
|
-
/**
|
|
8
|
-
* Wall-clock heartbeat ticker for long-running async operations.
|
|
9
|
-
*
|
|
10
|
-
* Wraps operations at the command layer (NOT core) to provide in-flight
|
|
11
|
-
* visibility when stdout is quiet for several hundred milliseconds.
|
|
12
|
-
*
|
|
13
|
-
* The emitted line is written via the provided `emit` (default: stderr) so
|
|
14
|
-
* it never interferes with programmatic stdout output.
|
|
15
|
-
*/
|
|
16
|
-
export declare function startHeartbeat(options?: HeartbeatOptions): StopHeartbeat;
|
package/dist/utils/heartbeat.mjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import pc from 'picocolors';
|
|
2
|
-
|
|
3
|
-
function startHeartbeat(options = {}) {
|
|
4
|
-
const intervalMs = options.intervalMs ?? 500;
|
|
5
|
-
const label = options.label ?? 'working';
|
|
6
|
-
const emit = options.emit ??
|
|
7
|
-
((line) => {
|
|
8
|
-
process.stderr.write(line);
|
|
9
|
-
});
|
|
10
|
-
const startedAt = Date.now();
|
|
11
|
-
const timer = setInterval(() => {
|
|
12
|
-
const elapsedMs = Date.now() - startedAt;
|
|
13
|
-
const seconds = (elapsedMs / 1000).toFixed(1);
|
|
14
|
-
emit(`${pc.dim(`[${seconds}s]`)} ${pc.cyan(`${label}...`)}\n`);
|
|
15
|
-
}, intervalMs);
|
|
16
|
-
if (typeof timer.unref === 'function')
|
|
17
|
-
timer.unref();
|
|
18
|
-
return () => {
|
|
19
|
-
clearInterval(timer);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { startHeartbeat };
|
package/dist/utils/logger.cjs
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var pc = require('picocolors');
|
|
4
|
-
|
|
5
|
-
const logger = {
|
|
6
|
-
info(message) {
|
|
7
|
-
console.log(pc.blue('info'), message);
|
|
8
|
-
},
|
|
9
|
-
success(message) {
|
|
10
|
-
console.log(pc.green('success'), message);
|
|
11
|
-
},
|
|
12
|
-
warn(message) {
|
|
13
|
-
console.log(pc.yellow('warn'), message);
|
|
14
|
-
},
|
|
15
|
-
error(message) {
|
|
16
|
-
console.log(pc.red('error'), message);
|
|
17
|
-
},
|
|
18
|
-
debug(message) {
|
|
19
|
-
if (process.env.VERBOSE) {
|
|
20
|
-
console.log(pc.gray('debug'), message);
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
step(step, detail) {
|
|
24
|
-
const stepText = pc.cyan(`[${step}]`);
|
|
25
|
-
console.log(stepText, detail || '');
|
|
26
|
-
},
|
|
27
|
-
file(operation, path) {
|
|
28
|
-
const colors = {
|
|
29
|
-
create: pc.green,
|
|
30
|
-
update: pc.yellow,
|
|
31
|
-
skip: pc.gray,
|
|
32
|
-
};
|
|
33
|
-
const symbols = {
|
|
34
|
-
create: '+',
|
|
35
|
-
update: '~',
|
|
36
|
-
skip: '-',
|
|
37
|
-
};
|
|
38
|
-
console.log(` ${colors[operation](symbols[operation])} ${path}`);
|
|
39
|
-
},
|
|
40
|
-
packageStart(packageName) {
|
|
41
|
-
console.log();
|
|
42
|
-
console.log(pc.bold(pc.cyan(`Syncing ${packageName}...`)));
|
|
43
|
-
},
|
|
44
|
-
packageEnd(_packageName, result) {
|
|
45
|
-
if (result.skipped)
|
|
46
|
-
console.log(pc.gray(` Skipped: ${result.reason || 'Unknown reason'}`));
|
|
47
|
-
else if (result.success)
|
|
48
|
-
console.log(pc.green(` Completed successfully`));
|
|
49
|
-
else
|
|
50
|
-
console.log(pc.red(` Failed: ${result.reason || 'Unknown error'}`));
|
|
51
|
-
},
|
|
52
|
-
summary(results) {
|
|
53
|
-
console.log();
|
|
54
|
-
console.log(pc.bold('Summary:'));
|
|
55
|
-
console.log(` ${pc.green('Success:')} ${results.success}`);
|
|
56
|
-
console.log(` ${pc.gray('Skipped:')} ${results.skipped}`);
|
|
57
|
-
if (results.failed > 0)
|
|
58
|
-
console.log(` ${pc.red('Failed:')} ${results.failed}`);
|
|
59
|
-
},
|
|
60
|
-
dryRunNotice() {
|
|
61
|
-
console.log();
|
|
62
|
-
console.log(pc.yellow(pc.bold('[DRY RUN] No files will be created or modified.')));
|
|
63
|
-
console.log();
|
|
64
|
-
},
|
|
65
|
-
heading(message) {
|
|
66
|
-
console.log();
|
|
67
|
-
console.log(pc.bold(pc.cyan(`▸ ${message}`)));
|
|
68
|
-
},
|
|
69
|
-
accent(message) {
|
|
70
|
-
return pc.cyan(pc.bold(message));
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
exports.logger = logger;
|