@synergenius/flow-weaver 0.30.1 → 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.
@@ -627,7 +627,17 @@ export function generateNodeInstanceTag(instance) {
627
627
  if (instance.config?.x !== undefined && instance.config?.y !== undefined) {
628
628
  positionAttr = ` [position: ${Math.round(instance.config.x)} ${Math.round(instance.config.y)}]`;
629
629
  }
630
- return ` * @node ${instance.id} ${instance.nodeType}${parent}${labelAttr}${portOrderAttr}${portLabelAttr}${exprAttr}${pullExecutionAttr}${minimizedAttr}${colorAttr}${iconAttr}${tagsAttr}${suppressAttr}${sizeAttr}${positionAttr}`;
630
+ // Generate [job: "name"] attribute if present (CI/CD job group)
631
+ let jobAttr = '';
632
+ if (instance.job) {
633
+ jobAttr = ` [job: "${instance.job}"]`;
634
+ }
635
+ // Generate [environment: "name"] attribute if present (CI/CD environment)
636
+ let environmentAttr = '';
637
+ if (instance.environment) {
638
+ environmentAttr = ` [environment: "${instance.environment}"]`;
639
+ }
640
+ return ` * @node ${instance.id} ${instance.nodeType}${parent}${labelAttr}${portOrderAttr}${portLabelAttr}${exprAttr}${pullExecutionAttr}${minimizedAttr}${colorAttr}${iconAttr}${tagsAttr}${suppressAttr}${sizeAttr}${positionAttr}${jobAttr}${environmentAttr}`;
631
641
  }
632
642
  /**
633
643
  * Generate a TypeScript function signature from a node type definition.
@@ -5987,7 +5987,7 @@ var VERSION;
5987
5987
  var init_generated_version = __esm({
5988
5988
  "src/generated-version.ts"() {
5989
5989
  "use strict";
5990
- VERSION = "0.30.1";
5990
+ VERSION = "0.30.2";
5991
5991
  }
5992
5992
  });
5993
5993
 
@@ -14894,7 +14894,15 @@ function generateNodeInstanceTag(instance) {
14894
14894
  if (instance.config?.x !== void 0 && instance.config?.y !== void 0) {
14895
14895
  positionAttr = ` [position: ${Math.round(instance.config.x)} ${Math.round(instance.config.y)}]`;
14896
14896
  }
14897
- return ` * @node ${instance.id} ${instance.nodeType}${parent}${labelAttr}${portOrderAttr}${portLabelAttr}${exprAttr}${pullExecutionAttr}${minimizedAttr}${colorAttr}${iconAttr}${tagsAttr}${suppressAttr}${sizeAttr}${positionAttr}`;
14897
+ let jobAttr = "";
14898
+ if (instance.job) {
14899
+ jobAttr = ` [job: "${instance.job}"]`;
14900
+ }
14901
+ let environmentAttr = "";
14902
+ if (instance.environment) {
14903
+ environmentAttr = ` [environment: "${instance.environment}"]`;
14904
+ }
14905
+ return ` * @node ${instance.id} ${instance.nodeType}${parent}${labelAttr}${portOrderAttr}${portLabelAttr}${exprAttr}${pullExecutionAttr}${minimizedAttr}${colorAttr}${iconAttr}${tagsAttr}${suppressAttr}${sizeAttr}${positionAttr}${jobAttr}${environmentAttr}`;
14898
14906
  }
14899
14907
  function generateFunctionSignature(nodeType) {
14900
14908
  const lines = [];
@@ -26949,22 +26957,24 @@ var init_jsdoc_parser = __esm({
26949
26957
  */
26950
26958
  parseTriggerTag(tag, config2, warnings, tagRegistry) {
26951
26959
  const comment = (tag.getCommentText() || "").trim();
26960
+ const cicdKeywords = ["push", "pull_request", "dispatch", "tag", "schedule"];
26961
+ const firstToken = comment.split(/\s/)[0];
26962
+ if (cicdKeywords.includes(firstToken) && tagRegistry && tagRegistry.has("_cicdTrigger")) {
26963
+ if (!config2.deploy) config2.deploy = {};
26964
+ tagRegistry.handle("_cicdTrigger", comment, "workflow", config2.deploy, warnings);
26965
+ return;
26966
+ }
26952
26967
  const result = parseTriggerLine(`@trigger ${comment}`, warnings);
26953
26968
  if (result) {
26954
- const cicdKeywords = ["push", "pull_request", "dispatch", "tag", "schedule"];
26955
- if (result.event && cicdKeywords.includes(result.event)) {
26956
- warnings.push(
26957
- `@trigger event="${result.event}" is treated as an Inngest event trigger, not a CI/CD trigger. For CI/CD, use: @trigger ${result.event}`
26958
- );
26959
- }
26960
26969
  config2.trigger = config2.trigger || {};
26961
26970
  if (result.event) config2.trigger.event = result.event;
26962
26971
  if (result.cron) config2.trigger.cron = result.cron;
26963
26972
  return;
26964
26973
  }
26965
- if (tagRegistry && tagRegistry.has("_cicdTrigger")) {
26966
- if (!config2.deploy) config2.deploy = {};
26967
- tagRegistry.handle("_cicdTrigger", comment, "workflow", config2.deploy, warnings);
26974
+ if (cicdKeywords.includes(firstToken)) {
26975
+ warnings.push(
26976
+ `@trigger ${firstToken} looks like a CI/CD trigger but no CI/CD pack is installed. Install @synergenius/flow-weaver-pack-cicd to enable CI/CD pipeline annotations.`
26977
+ );
26968
26978
  return;
26969
26979
  }
26970
26980
  warnings.push(`Invalid @trigger format: @trigger ${comment}`);
@@ -88846,7 +88856,7 @@ function parseIntStrict(value) {
88846
88856
  // src/cli/index.ts
88847
88857
  init_logger();
88848
88858
  init_error_utils();
88849
- var version2 = true ? "0.30.1" : "0.0.0-dev";
88859
+ var version2 = true ? "0.30.2" : "0.0.0-dev";
88850
88860
  var program2 = new Command();
88851
88861
  program2.name("fw").description("Flow Weaver Annotations - Compile and validate workflow files").option("-v, --version", "Output the current version").option("--no-color", "Disable colors").option("--color", "Force colors").on("option:version", () => {
88852
88862
  logger.banner(version2);
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.30.1";
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.1';
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}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.30.1",
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",