@synergenius/flow-weaver 0.29.1 → 0.30.1
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 +18 -6
- package/dist/cli/commands/compile.js +40 -38
- package/dist/cli/commands/describe.js +1 -1
- package/dist/cli/commands/dev.d.ts +4 -0
- package/dist/cli/commands/dev.js +35 -3
- package/dist/cli/commands/diagram.js +3 -0
- package/dist/cli/commands/diff.js +2 -2
- package/dist/cli/commands/run.js +2 -2
- package/dist/cli/commands/serve.js +11 -0
- package/dist/cli/commands/validate.js +1 -1
- package/dist/cli/flow-weaver.mjs +174 -265
- package/dist/cli/index.js +2 -11
- package/dist/doc-metadata/extractors/cli-commands.js +0 -10
- package/dist/generated-version.d.ts +1 -1
- package/dist/generated-version.js +1 -1
- package/docs/reference/cli-reference.md +1 -25
- package/package.json +1 -1
- package/dist/cli/commands/changelog.d.ts +0 -13
- package/dist/cli/commands/changelog.js +0 -135
package/dist/cli/index.js
CHANGED
|
@@ -223,6 +223,8 @@ program
|
|
|
223
223
|
.option('--once', 'Run once then exit', false)
|
|
224
224
|
.option('--json', 'Output result as JSON', false)
|
|
225
225
|
.option('--target <target>', 'Compilation target (default: typescript)')
|
|
226
|
+
.option('--mocks <json>', 'Mock config for built-in nodes (events, invocations, agents, fast) as JSON')
|
|
227
|
+
.option('--mocks-file <path>', 'Path to JSON file with mock config for built-in nodes')
|
|
226
228
|
.action(wrapAction(async (input, options) => {
|
|
227
229
|
const { devCommand } = await import('./commands/dev.js');
|
|
228
230
|
await devCommand(input, options);
|
|
@@ -529,17 +531,6 @@ program
|
|
|
529
531
|
options.workflowName = options.workflow;
|
|
530
532
|
await implementCommand(input, nodeName, options);
|
|
531
533
|
}));
|
|
532
|
-
// Changelog command
|
|
533
|
-
program
|
|
534
|
-
.command('changelog')
|
|
535
|
-
.description('Generate changelog from git history, categorized by file path')
|
|
536
|
-
.option('--last-tag', 'From last git tag to HEAD', false)
|
|
537
|
-
.option('--since <date>', 'Date-based range (e.g., "2024-01-01")')
|
|
538
|
-
.option('-r, --range <range>', 'Custom git range (e.g., "v0.1.0..HEAD")')
|
|
539
|
-
.action(wrapAction(async (options) => {
|
|
540
|
-
const { changelogCommand } = await import('./commands/changelog.js');
|
|
541
|
-
await changelogCommand(options);
|
|
542
|
-
}));
|
|
543
534
|
// Docs command: fw docs [topic] | fw docs search <query>
|
|
544
535
|
program
|
|
545
536
|
.command('docs [args...]')
|
|
@@ -316,16 +316,6 @@ export const CLI_COMMANDS = [
|
|
|
316
316
|
{ flags: '--diff', description: 'Show semantic diff before/after' },
|
|
317
317
|
],
|
|
318
318
|
},
|
|
319
|
-
{
|
|
320
|
-
name: 'changelog',
|
|
321
|
-
syntax: 'fw changelog [options]',
|
|
322
|
-
description: 'Generate changelog from git history, categorized by file path',
|
|
323
|
-
options: [
|
|
324
|
-
{ flags: '--last-tag', description: 'From last git tag to HEAD', exclusive: 'range' },
|
|
325
|
-
{ flags: '--since', arg: '<date>', description: 'Date-based range (e.g., "2024-01-01")', exclusive: 'range' },
|
|
326
|
-
{ flags: '-r, --range', arg: '<range>', description: 'Custom git range (e.g., "v0.1.0..HEAD")', exclusive: 'range' },
|
|
327
|
-
],
|
|
328
|
-
},
|
|
329
319
|
];
|
|
330
320
|
/**
|
|
331
321
|
* Extract CLI command documentation
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.30.1";
|
|
2
2
|
//# sourceMappingURL=generated-version.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: CLI Reference
|
|
3
3
|
description: Complete reference for all Flow Weaver CLI commands, flags, and options
|
|
4
|
-
keywords: [cli, commands, compile, validate, strip, run, watch, dev, serve, export, diagram, diff, doctor, init, migrate, marketplace, plugin, grammar,
|
|
4
|
+
keywords: [cli, commands, compile, validate, strip, run, watch, dev, serve, export, diagram, diff, doctor, init, migrate, marketplace, plugin, grammar, openapi, pattern, create, templates, context, modify, implement, status]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# CLI Reference
|
|
@@ -33,7 +33,6 @@ Complete reference for all `fw` CLI commands.
|
|
|
33
33
|
| `openapi` | Generate OpenAPI specification |
|
|
34
34
|
| `migrate` | Migrate to current syntax |
|
|
35
35
|
| `grammar` | Output annotation grammar |
|
|
36
|
-
| `changelog` | Generate changelog from git |
|
|
37
36
|
| `market` | Marketplace packages |
|
|
38
37
|
| `plugin` | External plugins |
|
|
39
38
|
| `modify` | Add/remove/rename nodes, connections, positions, and labels |
|
|
@@ -1023,29 +1022,6 @@ fw mcp-server [options]
|
|
|
1023
1022
|
|
|
1024
1023
|
---
|
|
1025
1024
|
|
|
1026
|
-
### changelog
|
|
1027
|
-
|
|
1028
|
-
Generate changelog from git history, categorized by file path.
|
|
1029
|
-
|
|
1030
|
-
```bash
|
|
1031
|
-
fw changelog [options]
|
|
1032
|
-
```
|
|
1033
|
-
|
|
1034
|
-
| Flag | Description | Default |
|
|
1035
|
-
|------|-------------|---------|
|
|
1036
|
-
| `--last-tag` | From last git tag to HEAD | `false` |
|
|
1037
|
-
| `--since <date>` | Date-based range | — |
|
|
1038
|
-
| `-r, --range <range>` | Custom git range | — |
|
|
1039
|
-
|
|
1040
|
-
**Examples:**
|
|
1041
|
-
```bash
|
|
1042
|
-
fw changelog --last-tag
|
|
1043
|
-
fw changelog --range v0.1.0..HEAD
|
|
1044
|
-
fw changelog --since 2024-01-01
|
|
1045
|
-
```
|
|
1046
|
-
|
|
1047
|
-
---
|
|
1048
|
-
|
|
1049
1025
|
## Global Flag
|
|
1050
1026
|
|
|
1051
1027
|
| Flag | Description |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synergenius/flow-weaver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.1",
|
|
4
4
|
"description": "Flow Weaver: deterministic TypeScript workflow compiler. Define workflows with JSDoc annotations, compile to standalone functions with zero runtime dependencies.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Changelog command - generates changelog from git history
|
|
3
|
-
*
|
|
4
|
-
* Categorizes commits by changed file paths — no conventional commits needed.
|
|
5
|
-
* Works with any commit message style.
|
|
6
|
-
*/
|
|
7
|
-
export interface ChangelogOptions {
|
|
8
|
-
lastTag?: boolean;
|
|
9
|
-
since?: string;
|
|
10
|
-
range?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function changelogCommand(options?: ChangelogOptions): Promise<void>;
|
|
13
|
-
//# sourceMappingURL=changelog.d.ts.map
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Changelog command - generates changelog from git history
|
|
3
|
-
*
|
|
4
|
-
* Categorizes commits by changed file paths — no conventional commits needed.
|
|
5
|
-
* Works with any commit message style.
|
|
6
|
-
*/
|
|
7
|
-
import { execSync } from 'child_process';
|
|
8
|
-
import { logger } from '../utils/logger.js';
|
|
9
|
-
const CATEGORIES = [
|
|
10
|
-
{ name: 'Grammar', match: (f) => /parser|chevrotain|grammar/.test(f) },
|
|
11
|
-
{ name: 'Code Generation', match: (f) => /generator|body-generator|generate/.test(f) },
|
|
12
|
-
{ name: 'Differ', match: (f) => f.includes('diff/') },
|
|
13
|
-
{ name: 'CLI', match: (f) => f.includes('cli/commands/') },
|
|
14
|
-
{ name: 'MCP Tools', match: (f) => f.includes('mcp/') },
|
|
15
|
-
{ name: 'Deployment', match: (f) => /deployment|export/.test(f) },
|
|
16
|
-
{ name: 'Runtime', match: (f) => f.includes('runtime/') },
|
|
17
|
-
{ name: 'Migration', match: (f) => f.includes('migration/') },
|
|
18
|
-
{ name: 'Tests', match: (f) => f.includes('tests/') || f.includes('.test.') },
|
|
19
|
-
{ name: 'Documentation', match: (f) => /doc|readme|changelog/i.test(f) },
|
|
20
|
-
];
|
|
21
|
-
function categorize(files) {
|
|
22
|
-
for (const category of CATEGORIES) {
|
|
23
|
-
if (files.some(category.match)) {
|
|
24
|
-
return category.name;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return 'Other';
|
|
28
|
-
}
|
|
29
|
-
function getGitRange(options) {
|
|
30
|
-
if (options.range) {
|
|
31
|
-
return options.range;
|
|
32
|
-
}
|
|
33
|
-
if (options.lastTag) {
|
|
34
|
-
try {
|
|
35
|
-
const lastTag = execSync('git describe --tags --abbrev=0', {
|
|
36
|
-
encoding: 'utf8',
|
|
37
|
-
}).trim();
|
|
38
|
-
return `${lastTag}..HEAD`;
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
logger.warn('No git tags found, showing all commits');
|
|
42
|
-
return 'HEAD';
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (options.since) {
|
|
46
|
-
return `--since="${options.since}"`;
|
|
47
|
-
}
|
|
48
|
-
// Default: last 20 commits
|
|
49
|
-
return '-20';
|
|
50
|
-
}
|
|
51
|
-
function getCommits(rangeArg) {
|
|
52
|
-
const isSinceArg = rangeArg.startsWith('--since');
|
|
53
|
-
const isCountArg = rangeArg.startsWith('-');
|
|
54
|
-
let logCmd;
|
|
55
|
-
if (isSinceArg) {
|
|
56
|
-
logCmd = `git log ${rangeArg} --format="%H %s" --no-merges`;
|
|
57
|
-
}
|
|
58
|
-
else if (isCountArg) {
|
|
59
|
-
logCmd = `git log ${rangeArg} --format="%H %s" --no-merges`;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
logCmd = `git log ${rangeArg} --format="%H %s" --no-merges`;
|
|
63
|
-
}
|
|
64
|
-
const logOutput = execSync(logCmd, { encoding: 'utf8' }).trim();
|
|
65
|
-
if (!logOutput) {
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
const entries = [];
|
|
69
|
-
for (const line of logOutput.split(/\r?\n/)) {
|
|
70
|
-
if (!line.trim())
|
|
71
|
-
continue;
|
|
72
|
-
const spaceIdx = line.indexOf(' ');
|
|
73
|
-
const hash = line.slice(0, spaceIdx);
|
|
74
|
-
const message = line.slice(spaceIdx + 1);
|
|
75
|
-
// Get changed files for this commit
|
|
76
|
-
let files;
|
|
77
|
-
try {
|
|
78
|
-
const filesOutput = execSync(`git diff-tree --no-commit-id --name-only -r ${hash}`, {
|
|
79
|
-
encoding: 'utf8',
|
|
80
|
-
}).trim();
|
|
81
|
-
files = filesOutput ? filesOutput.split(/\r?\n/) : [];
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
files = [];
|
|
85
|
-
}
|
|
86
|
-
entries.push({ hash: hash.slice(0, 7), message, files });
|
|
87
|
-
}
|
|
88
|
-
return entries;
|
|
89
|
-
}
|
|
90
|
-
export async function changelogCommand(options = {}) {
|
|
91
|
-
const rangeArg = getGitRange(options);
|
|
92
|
-
const rangeLabel = options.range || (options.lastTag ? 'last tag' : options.since ? `since ${options.since}` : 'recent');
|
|
93
|
-
const commits = getCommits(rangeArg);
|
|
94
|
-
if (commits.length === 0) {
|
|
95
|
-
logger.info('No commits found in the specified range.');
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
// Group by category
|
|
99
|
-
const grouped = new Map();
|
|
100
|
-
for (const commit of commits) {
|
|
101
|
-
const category = categorize(commit.files);
|
|
102
|
-
if (!grouped.has(category)) {
|
|
103
|
-
grouped.set(category, []);
|
|
104
|
-
}
|
|
105
|
-
grouped.get(category).push(commit);
|
|
106
|
-
}
|
|
107
|
-
// Output as markdown
|
|
108
|
-
// eslint-disable-next-line no-console
|
|
109
|
-
console.log(`## Changes (${rangeLabel})\n`);
|
|
110
|
-
// Sort categories: defined order first, then "Other"
|
|
111
|
-
const categoryOrder = CATEGORIES.map((c) => c.name);
|
|
112
|
-
const sortedCategories = [...grouped.keys()].sort((a, b) => {
|
|
113
|
-
const idxA = categoryOrder.indexOf(a);
|
|
114
|
-
const idxB = categoryOrder.indexOf(b);
|
|
115
|
-
if (idxA === -1 && idxB === -1)
|
|
116
|
-
return a.localeCompare(b);
|
|
117
|
-
if (idxA === -1)
|
|
118
|
-
return 1;
|
|
119
|
-
if (idxB === -1)
|
|
120
|
-
return -1;
|
|
121
|
-
return idxA - idxB;
|
|
122
|
-
});
|
|
123
|
-
for (const category of sortedCategories) {
|
|
124
|
-
const categoryCommits = grouped.get(category);
|
|
125
|
-
// eslint-disable-next-line no-console
|
|
126
|
-
console.log(`### ${category} (${categoryCommits.length} commit${categoryCommits.length !== 1 ? 's' : ''})\n`);
|
|
127
|
-
for (const commit of categoryCommits) {
|
|
128
|
-
// eslint-disable-next-line no-console
|
|
129
|
-
console.log(`- ${commit.hash} ${commit.message}`);
|
|
130
|
-
}
|
|
131
|
-
// eslint-disable-next-line no-console
|
|
132
|
-
console.log('');
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=changelog.js.map
|