@specship/specship-win32-arm64 0.23.0 → 0.24.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/lib/dist/bin/specship.js +45 -0
- package/lib/dist/bin/specship.js.map +1 -1
- package/lib/dist/diagram/flow-diagram.d.ts +86 -0
- package/lib/dist/diagram/flow-diagram.d.ts.map +1 -0
- package/lib/dist/diagram/flow-diagram.js +0 -0
- package/lib/dist/diagram/flow-diagram.js.map +1 -0
- package/lib/dist/index.d.ts +12 -0
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +47 -2
- package/lib/dist/index.js.map +1 -1
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/lib/dist/bin/specship.js
CHANGED
|
@@ -2918,6 +2918,51 @@ function main() {
|
|
|
2918
2918
|
// =============================================================================
|
|
2919
2919
|
// Spec layer / Workflow engine commands (v5)
|
|
2920
2920
|
// =============================================================================
|
|
2921
|
+
// @implements REQ-FLOWDIAG-001
|
|
2922
|
+
// Thin surface over SpecShip.generateFlowDiagram: render the indexed app's
|
|
2923
|
+
// entry points + call chains as a Mermaid flowchart under docs/. Once the
|
|
2924
|
+
// file exists, sync/index keep it fresh (REQ-FLOWDIAG-002).
|
|
2925
|
+
program
|
|
2926
|
+
.command('diagram [path]')
|
|
2927
|
+
.description('Generate a Mermaid flow diagram of the indexed application into docs/ (kept fresh by sync).')
|
|
2928
|
+
.option('-o, --output <path>', 'project-relative output path (default: docs/flow-diagram.md)')
|
|
2929
|
+
.option('--max-nodes <n>', 'node budget before modules collapse into summary nodes (default: 150)')
|
|
2930
|
+
.option('--depth <n>', 'max call-chain depth from each entry point (default: 6)')
|
|
2931
|
+
.option('--json', 'emit JSON')
|
|
2932
|
+
.action(async (pathArg, options) => {
|
|
2933
|
+
const projectRoot = path.resolve(pathArg ?? process.cwd());
|
|
2934
|
+
if (!(0, directory_1.isInitialized)(projectRoot)) {
|
|
2935
|
+
error(`SpecShip not initialized in ${projectRoot}. Run \`specship init -i\` first.`);
|
|
2936
|
+
process.exit(1);
|
|
2937
|
+
}
|
|
2938
|
+
const { SpecShip } = await loadSpecShip();
|
|
2939
|
+
const cg = await SpecShip.open(projectRoot);
|
|
2940
|
+
try {
|
|
2941
|
+
const override = {};
|
|
2942
|
+
if (options.output)
|
|
2943
|
+
override.output = options.output;
|
|
2944
|
+
if (options.maxNodes)
|
|
2945
|
+
override.maxNodes = Math.max(1, parseInt(options.maxNodes, 10) || 150);
|
|
2946
|
+
if (options.depth)
|
|
2947
|
+
override.depth = Math.max(1, parseInt(options.depth, 10) || 6);
|
|
2948
|
+
const result = cg.generateFlowDiagram(override);
|
|
2949
|
+
if (options.json) {
|
|
2950
|
+
// eslint-disable-next-line no-console
|
|
2951
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2952
|
+
}
|
|
2953
|
+
else {
|
|
2954
|
+
const verb = result.status === 'unchanged' ? 'is up to date' : result.status;
|
|
2955
|
+
success(`Flow diagram ${verb}: ${result.output}`);
|
|
2956
|
+
info(`${result.entryPoints} entry points · ${result.nodeCount} flow symbols · ${result.edgeCount} calls`);
|
|
2957
|
+
if (result.status === 'created') {
|
|
2958
|
+
info('Future `specship sync` / `specship index` runs will keep it fresh.');
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
finally {
|
|
2963
|
+
cg.close();
|
|
2964
|
+
}
|
|
2965
|
+
});
|
|
2921
2966
|
program
|
|
2922
2967
|
.command('drifted [path]')
|
|
2923
2968
|
.description('List spec links in concerning states (drifted, broken, orphaned).')
|