@shrkcrft/cli 0.1.0-alpha.6 → 0.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/check.command.d.ts.map +1 -1
- package/dist/commands/check.command.js +19 -2
- package/dist/commands/doctor.command.d.ts.map +1 -1
- package/dist/commands/doctor.command.js +7 -5
- package/dist/commands/packs-new.d.ts.map +1 -1
- package/dist/commands/packs-new.js +3 -10
- package/dist/commands/packs.command.d.ts.map +1 -1
- package/dist/commands/packs.command.js +2 -10
- package/dist/output/watch-loop.d.ts +9 -1
- package/dist/output/watch-loop.d.ts.map +1 -1
- package/dist/output/watch-loop.js +13 -3
- package/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.command.d.ts","sourceRoot":"","sources":["../../src/commands/check.command.ts"],"names":[],"mappings":"AAmBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"check.command.d.ts","sourceRoot":"","sources":["../../src/commands/check.command.ts"],"names":[],"mappings":"AAmBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAikBhC,eAAO,MAAM,YAAY,EAAE,eAmD1B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';
|
|
|
3
3
|
import * as nodePath from 'node:path';
|
|
4
4
|
import { flagBool, flagNumber, flagString, flagVars, resolveCwd, } from "../command-registry.js";
|
|
5
5
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
6
|
+
import { maybeRunInWatchMode } from "../output/watch-loop.js";
|
|
6
7
|
import { validateTemplateVariables } from '@shrkcrft/templates';
|
|
7
8
|
import { FileChangeType, planGeneration } from '@shrkcrft/generator';
|
|
8
9
|
import { evaluateBoundaries, loadTsconfigPaths, scanImports, summarizeImports, } from '@shrkcrft/boundaries';
|
|
@@ -305,6 +306,22 @@ function readChangedScopeOptions(args, cwd) {
|
|
|
305
306
|
return out;
|
|
306
307
|
}
|
|
307
308
|
async function checkBoundaries(args) {
|
|
309
|
+
const watchExit = await maybeRunInWatchMode(args, checkBoundariesOnce, {
|
|
310
|
+
defaultPaths: BOUNDARIES_DEFAULT_WATCH_PATHS,
|
|
311
|
+
});
|
|
312
|
+
if (watchExit !== null)
|
|
313
|
+
return watchExit;
|
|
314
|
+
return checkBoundariesOnce(args);
|
|
315
|
+
}
|
|
316
|
+
const BOUNDARIES_DEFAULT_WATCH_PATHS = [
|
|
317
|
+
'sharkcraft',
|
|
318
|
+
'packages',
|
|
319
|
+
'apps',
|
|
320
|
+
'libs',
|
|
321
|
+
'src',
|
|
322
|
+
'tools',
|
|
323
|
+
];
|
|
324
|
+
async function checkBoundariesOnce(args) {
|
|
308
325
|
const cwd = resolveCwd(args);
|
|
309
326
|
const inspection = await inspectSharkcraft({ cwd });
|
|
310
327
|
const rules = inspection.boundaryRegistry.list();
|
|
@@ -504,8 +521,8 @@ async function checkBoundaries(args) {
|
|
|
504
521
|
// ────────────────────────────────────────────────────────────────────────
|
|
505
522
|
export const checkCommand = {
|
|
506
523
|
name: 'check',
|
|
507
|
-
description: 'Run SharkCraft-level validation across knowledge / rules / templates / pipelines / packs / action hints / doctor.',
|
|
508
|
-
usage: 'shrk [--cwd <dir>] check [packs|pipelines|knowledge|generation] [--strict] [--min-score <0-100>] [--json]',
|
|
524
|
+
description: 'Run SharkCraft-level validation across knowledge / rules / templates / pipelines / packs / action hints / doctor. `check boundaries [--watch [--paths a,b] [--debounce N] [--once]]` re-runs the boundary scan on file changes.',
|
|
525
|
+
usage: 'shrk [--cwd <dir>] check [packs|pipelines|knowledge|generation|boundaries|imports] [--strict] [--min-score <0-100>] [--json] [--watch [--paths <list>] [--debounce N] [--once]]',
|
|
509
526
|
async run(args) {
|
|
510
527
|
const sub = args.positional[0];
|
|
511
528
|
if (sub === 'generation')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.command.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.command.ts"],"names":[],"mappings":"AAqBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.command.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.command.ts"],"names":[],"mappings":"AAqBA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA0JhC,eAAO,MAAM,aAAa,EAAE,eAW3B,CAAC;AA0ZF,eAAO,MAAM,qBAAqB,EAAE,eAmCnC,CAAC;AAuDF,eAAO,MAAM,yBAAyB,EAAE,eAavC,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,eA2CtC,CAAC;AAgCF,eAAO,MAAM,6BAA6B,EAAE,eAa3C,CAAC"}
|
|
@@ -38,7 +38,7 @@ function describeStrictMode(mode) {
|
|
|
38
38
|
case 'all':
|
|
39
39
|
return 'strict=all (every warning fails)';
|
|
40
40
|
case 'warnings':
|
|
41
|
-
return 'strict=warnings (structural warnings fail,
|
|
41
|
+
return 'strict=warnings (structural warnings fail, advisory excluded)';
|
|
42
42
|
case 'errors':
|
|
43
43
|
return 'strict=errors (only errors fail)';
|
|
44
44
|
case 'off':
|
|
@@ -59,8 +59,10 @@ function evaluateStrict(mode, checks, errorCount) {
|
|
|
59
59
|
for (const c of checks) {
|
|
60
60
|
if (c.severity !== DoctorSeverity.Warning)
|
|
61
61
|
continue;
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
// `--strict=warnings` excludes anything the inspector flagged as
|
|
63
|
+
// advisory (action-hint quality today, any future advisory category
|
|
64
|
+
// tomorrow). `--strict=all` counts every warning, advisory or not.
|
|
65
|
+
if (mode === 'warnings' && c.advisory === true) {
|
|
64
66
|
excludedWarnings += 1;
|
|
65
67
|
}
|
|
66
68
|
else {
|
|
@@ -74,7 +76,7 @@ function evaluateStrict(mode, checks, errorCount) {
|
|
|
74
76
|
excludedWarnings,
|
|
75
77
|
reason: mode === 'all'
|
|
76
78
|
? 'any warning'
|
|
77
|
-
: 'structural warnings only (
|
|
79
|
+
: 'structural warnings only (advisory excluded)',
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
function buildFilterOptions(args, suppressions) {
|
|
@@ -420,7 +422,7 @@ async function doctorCommandImpl(args) {
|
|
|
420
422
|
void saveDoctorSuppressions;
|
|
421
423
|
void existsSync;
|
|
422
424
|
if (strictMode === 'warnings' && strictEval.excludedWarnings > 0) {
|
|
423
|
-
process.stdout.write(` (strict=warnings excluded ${strictEval.excludedWarnings}
|
|
425
|
+
process.stdout.write(` (strict=warnings excluded ${strictEval.excludedWarnings} advisory warning(s); use --strict=all to include)\n`);
|
|
424
426
|
}
|
|
425
427
|
// Surface acknowledgement state. Bare suppressions don't qualify as
|
|
426
428
|
// acknowledgements; expiring/expired ones get a callout so authors don't
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packs-new.d.ts","sourceRoot":"","sources":["../../src/commands/packs-new.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"packs-new.d.ts","sourceRoot":"","sources":["../../src/commands/packs-new.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,YAAY,GAAG,kBAAkB,CAAC;AAUpG,UAAU,aAAa;IACrB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,kDAAkD;AAClD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,mBAAmB,CA+G/E;AA4TD,eAAO,MAAM,eAAe,EAAE,eAoG7B,CAAC;AAUF,eAAO,MAAM,gBAAgB,EAAE,eAqI9B,CAAC"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
-
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
-
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
-
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
return path;
|
|
8
|
-
};
|
|
9
1
|
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
10
2
|
import * as nodePath from 'node:path';
|
|
11
3
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
12
4
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
5
|
+
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
13
6
|
const VALID_KINDS = new Set([
|
|
14
7
|
'generic',
|
|
15
8
|
'framework',
|
|
@@ -645,7 +638,7 @@ async function runRuntimePackTest(input) {
|
|
|
645
638
|
if (existsSync(entry)) {
|
|
646
639
|
try {
|
|
647
640
|
const { pathToFileURL } = await import('node:url');
|
|
648
|
-
const mod = (await
|
|
641
|
+
const mod = (await importModuleViaLoader(entry));
|
|
649
642
|
const value = mod.default ?? mod;
|
|
650
643
|
const shape = describeShape(value);
|
|
651
644
|
modules.push({
|
|
@@ -692,7 +685,7 @@ async function runRuntimePackTest(input) {
|
|
|
692
685
|
continue;
|
|
693
686
|
try {
|
|
694
687
|
const { pathToFileURL } = await import('node:url');
|
|
695
|
-
const mod = (await
|
|
688
|
+
const mod = (await importModuleViaLoader(full));
|
|
696
689
|
const value = mod.default;
|
|
697
690
|
const arr = Array.isArray(value) ? value : null;
|
|
698
691
|
modules.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packs.command.d.ts","sourceRoot":"","sources":["../../src/commands/packs.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"packs.command.d.ts","sourceRoot":"","sources":["../../src/commands/packs.command.ts"],"names":[],"mappings":"AAoBA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAQhC,eAAO,MAAM,yBAAyB,EAAE,eAoCvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,eAsGzC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eA+CnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eAuD9B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAsE7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAqDjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAyFhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAqEhC,CAAC;AA4DF,eAAO,MAAM,gBAAgB,EAAE,eA+K9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAmCtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAmFhC,CAAC;AAMF,eAAO,MAAM,qBAAqB,EAAE,eA4BnC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eA+E/B,CAAC"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
-
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
-
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
-
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
return path;
|
|
8
|
-
};
|
|
9
1
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
10
2
|
import * as nodePath from 'node:path';
|
|
11
|
-
import { pathToFileURL } from 'node:url';
|
|
12
3
|
import { buildPackDoctorReport, buildPackSignatureStatusReport, checkPackSymbolCompat, explainPackSignatureStatus, inspectSharkcraft, mergePackReleaseChecks, runPackReleaseCheck, runPackReleaseChecksForReport, } from '@shrkcrft/inspector';
|
|
13
4
|
import { PACK_SECRET_ENV, signPackManifest, validatePackManifest, verifyPackManifest, } from '@shrkcrft/plugin-api';
|
|
14
5
|
import { flagBool, flagString, resolveCwd, } from "../command-registry.js";
|
|
15
6
|
import { asJson, header, kv } from "../output/format-output.js";
|
|
7
|
+
import { importModuleViaLoader } from '@shrkcrft/core';
|
|
16
8
|
function statusLabel(valid) {
|
|
17
9
|
return valid ? 'OK ' : 'INVALID';
|
|
18
10
|
}
|
|
@@ -553,7 +545,7 @@ async function loadManifestFromPath(manifestPath) {
|
|
|
553
545
|
if (manifestPath.endsWith('.json')) {
|
|
554
546
|
return JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
555
547
|
}
|
|
556
|
-
const mod = (await
|
|
548
|
+
const mod = (await importModuleViaLoader(manifestPath));
|
|
557
549
|
return (mod.default ?? mod);
|
|
558
550
|
}
|
|
559
551
|
export const packsSignCommand = {
|
|
@@ -27,11 +27,19 @@ export interface IWatchPlan {
|
|
|
27
27
|
}
|
|
28
28
|
export declare function buildWatchPlan(options: IWatchLoopOptions, steps: readonly string[]): IWatchPlan;
|
|
29
29
|
import type { ParsedArgs } from '../command-registry.js';
|
|
30
|
+
export interface IWatchModeOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Paths to watch when the user does not pass `--paths`. Defaults to
|
|
33
|
+
* `['sharkcraft']` if omitted. Use this for commands that scan code
|
|
34
|
+
* outside `sharkcraft/` (e.g. `check boundaries` scans the whole repo).
|
|
35
|
+
*/
|
|
36
|
+
defaultPaths?: readonly string[];
|
|
37
|
+
}
|
|
30
38
|
/**
|
|
31
39
|
* Run a command's `run` function inside a watch loop when --watch is set.
|
|
32
40
|
*
|
|
33
41
|
* @returns null if --watch is not set (caller proceeds as before), otherwise
|
|
34
42
|
* the exit code of the watch loop.
|
|
35
43
|
*/
|
|
36
|
-
export declare function maybeRunInWatchMode(args: ParsedArgs, runner: (innerArgs: ParsedArgs) => Promise<number
|
|
44
|
+
export declare function maybeRunInWatchMode(args: ParsedArgs, runner: (innerArgs: ParsedArgs) => Promise<number>, options?: IWatchModeOptions): Promise<number | null>;
|
|
37
45
|
//# sourceMappingURL=watch-loop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-loop.d.ts","sourceRoot":"","sources":["../../src/output/watch-loop.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACvC;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,CAAC,CA6DjB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,0BAA0B,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,UAAU,CAYZ;AAED,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"watch-loop.d.ts","sourceRoot":"","sources":["../../src/output/watch-loop.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACvC;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,MAAM,CAAC,CA6DjB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,0BAA0B,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,UAAU,CAYZ;AAED,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,EAClD,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAqCxB"}
|
|
@@ -81,31 +81,41 @@ export function buildWatchPlan(options, steps) {
|
|
|
81
81
|
steps,
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
import { flagBool, flagNumber, resolveCwd } from "../command-registry.js";
|
|
84
|
+
import { flagBool, flagNumber, flagString, resolveCwd } from "../command-registry.js";
|
|
85
85
|
/**
|
|
86
86
|
* Run a command's `run` function inside a watch loop when --watch is set.
|
|
87
87
|
*
|
|
88
88
|
* @returns null if --watch is not set (caller proceeds as before), otherwise
|
|
89
89
|
* the exit code of the watch loop.
|
|
90
90
|
*/
|
|
91
|
-
export async function maybeRunInWatchMode(args, runner) {
|
|
91
|
+
export async function maybeRunInWatchMode(args, runner, options = {}) {
|
|
92
92
|
if (!flagBool(args, 'watch'))
|
|
93
93
|
return null;
|
|
94
94
|
const cwd = resolveCwd(args);
|
|
95
95
|
const debounce = flagNumber(args, 'debounce') ?? 300;
|
|
96
96
|
const once = flagBool(args, 'once');
|
|
97
|
+
const pathsFlag = flagString(args, 'paths');
|
|
98
|
+
const userPaths = pathsFlag
|
|
99
|
+
? pathsFlag.split(',').map((s) => s.trim()).filter((s) => s.length > 0)
|
|
100
|
+
: [];
|
|
101
|
+
const paths = userPaths.length > 0
|
|
102
|
+
? userPaths
|
|
103
|
+
: options.defaultPaths && options.defaultPaths.length > 0
|
|
104
|
+
? options.defaultPaths
|
|
105
|
+
: ['sharkcraft'];
|
|
97
106
|
// Strip --watch so the inner snapshot doesn't recurse.
|
|
98
107
|
const innerFlags = new Map(args.flags);
|
|
99
108
|
innerFlags.delete('watch');
|
|
100
109
|
innerFlags.delete('once');
|
|
101
110
|
innerFlags.delete('debounce');
|
|
111
|
+
innerFlags.delete('paths');
|
|
102
112
|
const innerArgs = {
|
|
103
113
|
positional: args.positional,
|
|
104
114
|
flags: innerFlags,
|
|
105
115
|
multiFlags: args.multiFlags,
|
|
106
116
|
...(args.globalCwd ? { globalCwd: args.globalCwd } : {}),
|
|
107
117
|
};
|
|
108
|
-
return runWatchLoop({ cwd, debounce, once }, {
|
|
118
|
+
return runWatchLoop({ cwd, debounce, once, paths }, {
|
|
109
119
|
snapshot: async () => {
|
|
110
120
|
const ts = new Date().toLocaleTimeString();
|
|
111
121
|
process.stdout.write(`\n[watch] ${ts}\n`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shrkcrft/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"description": "SharkCraft CLI (`shrk`): structured project intelligence for AI coding agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SharkCraft contributors",
|
|
@@ -47,25 +47,25 @@
|
|
|
47
47
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@shrkcrft/core": "^0.1.0-alpha.
|
|
51
|
-
"@shrkcrft/config": "^0.1.0-alpha.
|
|
52
|
-
"@shrkcrft/workspace": "^0.1.0-alpha.
|
|
53
|
-
"@shrkcrft/knowledge": "^0.1.0-alpha.
|
|
54
|
-
"@shrkcrft/context": "^0.1.0-alpha.
|
|
55
|
-
"@shrkcrft/rules": "^0.1.0-alpha.
|
|
56
|
-
"@shrkcrft/paths": "^0.1.0-alpha.
|
|
57
|
-
"@shrkcrft/templates": "^0.1.0-alpha.
|
|
58
|
-
"@shrkcrft/plugin-api": "^0.1.0-alpha.
|
|
59
|
-
"@shrkcrft/dashboard-api": "^0.1.0-alpha.
|
|
60
|
-
"@shrkcrft/pipelines": "^0.1.0-alpha.
|
|
61
|
-
"@shrkcrft/presets": "^0.1.0-alpha.
|
|
62
|
-
"@shrkcrft/boundaries": "^0.1.0-alpha.
|
|
63
|
-
"@shrkcrft/generator": "^0.1.0-alpha.
|
|
64
|
-
"@shrkcrft/importer": "^0.1.0-alpha.
|
|
65
|
-
"@shrkcrft/inspector": "^0.1.0-alpha.
|
|
66
|
-
"@shrkcrft/ai": "^0.1.0-alpha.
|
|
67
|
-
"@shrkcrft/shared": "^0.1.0-alpha.
|
|
68
|
-
"@shrkcrft/mcp-server": "^0.1.0-alpha.
|
|
50
|
+
"@shrkcrft/core": "^0.1.0-alpha.7",
|
|
51
|
+
"@shrkcrft/config": "^0.1.0-alpha.7",
|
|
52
|
+
"@shrkcrft/workspace": "^0.1.0-alpha.7",
|
|
53
|
+
"@shrkcrft/knowledge": "^0.1.0-alpha.7",
|
|
54
|
+
"@shrkcrft/context": "^0.1.0-alpha.7",
|
|
55
|
+
"@shrkcrft/rules": "^0.1.0-alpha.7",
|
|
56
|
+
"@shrkcrft/paths": "^0.1.0-alpha.7",
|
|
57
|
+
"@shrkcrft/templates": "^0.1.0-alpha.7",
|
|
58
|
+
"@shrkcrft/plugin-api": "^0.1.0-alpha.7",
|
|
59
|
+
"@shrkcrft/dashboard-api": "^0.1.0-alpha.7",
|
|
60
|
+
"@shrkcrft/pipelines": "^0.1.0-alpha.7",
|
|
61
|
+
"@shrkcrft/presets": "^0.1.0-alpha.7",
|
|
62
|
+
"@shrkcrft/boundaries": "^0.1.0-alpha.7",
|
|
63
|
+
"@shrkcrft/generator": "^0.1.0-alpha.7",
|
|
64
|
+
"@shrkcrft/importer": "^0.1.0-alpha.7",
|
|
65
|
+
"@shrkcrft/inspector": "^0.1.0-alpha.7",
|
|
66
|
+
"@shrkcrft/ai": "^0.1.0-alpha.7",
|
|
67
|
+
"@shrkcrft/shared": "^0.1.0-alpha.7",
|
|
68
|
+
"@shrkcrft/mcp-server": "^0.1.0-alpha.7"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|