@synergenius/flow-weaver 0.30.0 → 0.30.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/dist/cli/index.js CHANGED
@@ -531,17 +531,6 @@ program
531
531
  options.workflowName = options.workflow;
532
532
  await implementCommand(input, nodeName, options);
533
533
  }));
534
- // Changelog command
535
- program
536
- .command('changelog')
537
- .description('Generate changelog from git history, categorized by file path')
538
- .option('--last-tag', 'From last git tag to HEAD', false)
539
- .option('--since <date>', 'Date-based range (e.g., "2024-01-01")')
540
- .option('-r, --range <range>', 'Custom git range (e.g., "v0.1.0..HEAD")')
541
- .action(wrapAction(async (options) => {
542
- const { changelogCommand } = await import('./commands/changelog.js');
543
- await changelogCommand(options);
544
- }));
545
534
  // Docs command: fw docs [topic] | fw docs search <query>
546
535
  program
547
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.30.0";
1
+ export declare const VERSION = "0.30.2";
2
2
  //# sourceMappingURL=generated-version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by scripts/generate-version.ts — do not edit manually
2
- export const VERSION = '0.30.0';
2
+ export const VERSION = '0.30.2';
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -1059,15 +1059,19 @@ export class JSDocParser {
1059
1059
  */
1060
1060
  parseTriggerTag(tag, config, warnings, tagRegistry) {
1061
1061
  const comment = (tag.getCommentText() || '').trim();
1062
- // Try core FW trigger parsing first (event= and/or cron=)
1062
+ // Check if the trigger looks like a CI/CD keyword (push, pull_request, etc.)
1063
+ const cicdKeywords = ['push', 'pull_request', 'dispatch', 'tag', 'schedule'];
1064
+ const firstToken = comment.split(/\s/)[0];
1065
+ // CI/CD triggers: delegate to pack handler if registered
1066
+ if (cicdKeywords.includes(firstToken) && tagRegistry && tagRegistry.has('_cicdTrigger')) {
1067
+ if (!config.deploy)
1068
+ config.deploy = {};
1069
+ tagRegistry.handle('_cicdTrigger', comment, 'workflow', config.deploy, warnings);
1070
+ return;
1071
+ }
1072
+ // Core FW trigger parsing (event= and/or cron=)
1063
1073
  const result = parseTriggerLine(`@trigger ${comment}`, warnings);
1064
1074
  if (result) {
1065
- // Warn if the event name matches a CI/CD trigger keyword (likely user error)
1066
- const cicdKeywords = ['push', 'pull_request', 'dispatch', 'tag', 'schedule'];
1067
- if (result.event && cicdKeywords.includes(result.event)) {
1068
- warnings.push(`@trigger event="${result.event}" is treated as an Inngest event trigger, not a CI/CD trigger. ` +
1069
- `For CI/CD, use: @trigger ${result.event}`);
1070
- }
1071
1075
  // Merge: multiple @trigger tags accumulate (event + cron can be separate tags)
1072
1076
  config.trigger = config.trigger || {};
1073
1077
  if (result.event)
@@ -1076,11 +1080,10 @@ export class JSDocParser {
1076
1080
  config.trigger.cron = result.cron;
1077
1081
  return;
1078
1082
  }
1079
- // Not a core trigger. Delegate to domain-specific handlers (e.g. CI/CD).
1080
- if (tagRegistry && tagRegistry.has('_cicdTrigger')) {
1081
- if (!config.deploy)
1082
- config.deploy = {};
1083
- tagRegistry.handle('_cicdTrigger', comment, 'workflow', config.deploy, warnings);
1083
+ // Not a core trigger and no CI/CD handler available. Try CI/CD keywords as fallback hint.
1084
+ if (cicdKeywords.includes(firstToken)) {
1085
+ warnings.push(`@trigger ${firstToken} looks like a CI/CD trigger but no CI/CD pack is installed. ` +
1086
+ `Install @synergenius/flow-weaver-pack-cicd to enable CI/CD pipeline annotations.`);
1084
1087
  return;
1085
1088
  }
1086
1089
  warnings.push(`Invalid @trigger format: @trigger ${comment}`);
@@ -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, changelog, openapi, pattern, create, templates, context, modify, implement, status]
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.30.0",
3
+ "version": "0.30.2",
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