pipecraft 0.29.2 → 0.36.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.
Files changed (136) hide show
  1. package/README.md +98 -34
  2. package/dist/cli/index.d.ts +3 -3
  3. package/dist/cli/index.js +66 -24
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/generators/init.tpl.d.ts +4 -4
  6. package/dist/generators/init.tpl.d.ts.map +1 -1
  7. package/dist/generators/init.tpl.js +369 -79
  8. package/dist/generators/init.tpl.js.map +1 -1
  9. package/dist/generators/workflows.tpl.d.ts +9 -9
  10. package/dist/generators/workflows.tpl.d.ts.map +1 -1
  11. package/dist/generators/workflows.tpl.js +33 -24
  12. package/dist/generators/workflows.tpl.js.map +1 -1
  13. package/dist/templates/actions/calculate-version.yml.tpl.d.ts +7 -4
  14. package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -1
  15. package/dist/templates/actions/calculate-version.yml.tpl.js +16 -9
  16. package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -1
  17. package/dist/templates/actions/create-pr.yml.tpl.d.ts +5 -2
  18. package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -1
  19. package/dist/templates/actions/create-pr.yml.tpl.js +9 -6
  20. package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -1
  21. package/dist/templates/actions/create-release.yml.tpl.d.ts +5 -2
  22. package/dist/templates/actions/create-release.yml.tpl.d.ts.map +1 -1
  23. package/dist/templates/actions/create-release.yml.tpl.js +9 -6
  24. package/dist/templates/actions/create-release.yml.tpl.js.map +1 -1
  25. package/dist/templates/actions/create-tag.yml.tpl.d.ts +5 -2
  26. package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -1
  27. package/dist/templates/actions/create-tag.yml.tpl.js +9 -6
  28. package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -1
  29. package/dist/templates/actions/detect-changes.yml.tpl.d.ts +24 -52
  30. package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -1
  31. package/dist/templates/actions/detect-changes.yml.tpl.js +281 -108
  32. package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -1
  33. package/dist/templates/actions/manage-branch.yml.tpl.d.ts +5 -2
  34. package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -1
  35. package/dist/templates/actions/manage-branch.yml.tpl.js +9 -6
  36. package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -1
  37. package/dist/templates/actions/promote-branch.yml.tpl.d.ts +5 -2
  38. package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -1
  39. package/dist/templates/actions/promote-branch.yml.tpl.js +27 -76
  40. package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -1
  41. package/dist/templates/actions/run-nx-affected.yml.tpl.d.ts +33 -0
  42. package/dist/templates/actions/run-nx-affected.yml.tpl.d.ts.map +1 -0
  43. package/dist/templates/actions/run-nx-affected.yml.tpl.js +346 -0
  44. package/dist/templates/actions/run-nx-affected.yml.tpl.js.map +1 -0
  45. package/dist/templates/release-it.cjs.tpl.d.ts +1 -1
  46. package/dist/templates/release-it.cjs.tpl.d.ts.map +1 -1
  47. package/dist/templates/release-it.cjs.tpl.js +24 -26
  48. package/dist/templates/release-it.cjs.tpl.js.map +1 -1
  49. package/dist/templates/workflows/enforce-pr-target.yml.tpl.d.ts +1 -1
  50. package/dist/templates/workflows/enforce-pr-target.yml.tpl.d.ts.map +1 -1
  51. package/dist/templates/workflows/enforce-pr-target.yml.tpl.js +2 -3
  52. package/dist/templates/workflows/enforce-pr-target.yml.tpl.js.map +1 -1
  53. package/dist/templates/workflows/pipeline-nx.yml.tpl.d.ts +2 -2
  54. package/dist/templates/workflows/pipeline-nx.yml.tpl.d.ts.map +1 -1
  55. package/dist/templates/workflows/pipeline-nx.yml.tpl.js +300 -93
  56. package/dist/templates/workflows/pipeline-nx.yml.tpl.js.map +1 -1
  57. package/dist/templates/workflows/pipeline.yml.tpl.d.ts +2 -2
  58. package/dist/templates/workflows/pipeline.yml.tpl.d.ts.map +1 -1
  59. package/dist/templates/workflows/pipeline.yml.tpl.js +347 -74
  60. package/dist/templates/workflows/pipeline.yml.tpl.js.map +1 -1
  61. package/dist/templates/workflows/pr-title-check.yml.tpl.d.ts +1 -1
  62. package/dist/templates/workflows/pr-title-check.yml.tpl.d.ts.map +1 -1
  63. package/dist/templates/workflows/pr-title-check.yml.tpl.js +101 -22
  64. package/dist/templates/workflows/pr-title-check.yml.tpl.js.map +1 -1
  65. package/dist/templates/workflows/shared/index.d.ts +3 -2
  66. package/dist/templates/workflows/shared/index.d.ts.map +1 -1
  67. package/dist/templates/workflows/shared/index.js +3 -2
  68. package/dist/templates/workflows/shared/index.js.map +1 -1
  69. package/dist/templates/workflows/shared/operations-changes.d.ts +13 -2
  70. package/dist/templates/workflows/shared/operations-changes.d.ts.map +1 -1
  71. package/dist/templates/workflows/shared/operations-changes.js +47 -16
  72. package/dist/templates/workflows/shared/operations-changes.js.map +1 -1
  73. package/dist/templates/workflows/shared/operations-domain-jobs.d.ts +18 -1
  74. package/dist/templates/workflows/shared/operations-domain-jobs.d.ts.map +1 -1
  75. package/dist/templates/workflows/shared/operations-domain-jobs.js +143 -19
  76. package/dist/templates/workflows/shared/operations-domain-jobs.js.map +1 -1
  77. package/dist/templates/workflows/shared/operations-gate.d.ts +32 -0
  78. package/dist/templates/workflows/shared/operations-gate.d.ts.map +1 -0
  79. package/dist/templates/workflows/shared/operations-gate.js +77 -0
  80. package/dist/templates/workflows/shared/operations-gate.js.map +1 -0
  81. package/dist/templates/workflows/shared/operations-header.d.ts +1 -1
  82. package/dist/templates/workflows/shared/operations-header.d.ts.map +1 -1
  83. package/dist/templates/workflows/shared/operations-header.js +46 -6
  84. package/dist/templates/workflows/shared/operations-header.js.map +1 -1
  85. package/dist/templates/workflows/shared/operations-tag-promote.d.ts +5 -1
  86. package/dist/templates/workflows/shared/operations-tag-promote.d.ts.map +1 -1
  87. package/dist/templates/workflows/shared/operations-tag-promote.js +138 -31
  88. package/dist/templates/workflows/shared/operations-tag-promote.js.map +1 -1
  89. package/dist/templates/workflows/shared/operations-version.d.ts +3 -1
  90. package/dist/templates/workflows/shared/operations-version.d.ts.map +1 -1
  91. package/dist/templates/workflows/shared/operations-version.js +18 -10
  92. package/dist/templates/workflows/shared/operations-version.js.map +1 -1
  93. package/dist/templates/yaml-format-utils.d.ts.map +1 -1
  94. package/dist/templates/yaml-format-utils.js.map +1 -1
  95. package/dist/types/index.d.ts +57 -4
  96. package/dist/types/index.d.ts.map +1 -1
  97. package/dist/utils/action-reference.d.ts +73 -0
  98. package/dist/utils/action-reference.d.ts.map +1 -0
  99. package/dist/utils/action-reference.js +120 -0
  100. package/dist/utils/action-reference.js.map +1 -0
  101. package/dist/utils/ast-path-operations.d.ts +3 -3
  102. package/dist/utils/ast-path-operations.d.ts.map +1 -1
  103. package/dist/utils/ast-path-operations.js +58 -17
  104. package/dist/utils/ast-path-operations.js.map +1 -1
  105. package/dist/utils/config.d.ts +11 -5
  106. package/dist/utils/config.d.ts.map +1 -1
  107. package/dist/utils/config.js +33 -8
  108. package/dist/utils/config.js.map +1 -1
  109. package/dist/utils/github-setup.d.ts +4 -4
  110. package/dist/utils/github-setup.d.ts.map +1 -1
  111. package/dist/utils/github-setup.js +57 -36
  112. package/dist/utils/github-setup.js.map +1 -1
  113. package/dist/utils/logger.d.ts.map +1 -1
  114. package/dist/utils/logger.js.map +1 -1
  115. package/dist/utils/messaging.d.ts.map +1 -1
  116. package/dist/utils/messaging.js +7 -3
  117. package/dist/utils/messaging.js.map +1 -1
  118. package/dist/utils/preflight.d.ts +2 -2
  119. package/dist/utils/preflight.d.ts.map +1 -1
  120. package/dist/utils/preflight.js +43 -41
  121. package/dist/utils/preflight.js.map +1 -1
  122. package/dist/utils/versioning.d.ts +1 -1
  123. package/dist/utils/versioning.d.ts.map +1 -1
  124. package/dist/utils/versioning.js +10 -10
  125. package/dist/utils/versioning.js.map +1 -1
  126. package/package.json +11 -4
  127. package/src/generators/init.tpl.ts +434 -96
  128. package/src/generators/workflows.tpl.ts +54 -45
  129. package/dist/templates/actions/detect-changes-nx.yml.tpl.d.ts +0 -32
  130. package/dist/templates/actions/detect-changes-nx.yml.tpl.d.ts.map +0 -1
  131. package/dist/templates/actions/detect-changes-nx.yml.tpl.js +0 -227
  132. package/dist/templates/actions/detect-changes-nx.yml.tpl.js.map +0 -1
  133. package/dist/utils/idempotency.d.ts +0 -187
  134. package/dist/utils/idempotency.d.ts.map +0 -1
  135. package/dist/utils/idempotency.js +0 -304
  136. package/dist/utils/idempotency.js.map +0 -1
@@ -30,33 +30,33 @@
30
30
  *
31
31
  * // Creates:
32
32
  * // .github/workflows/pipeline.yml - Main pipeline
33
- * // .github/actions/detect-changes/... - Change detection action
34
- * // .github/actions/calculate-version/... - Version calculation action
35
- * // .github/actions/create-tag/... - Tag creation action
36
- * // .github/actions/create-pr/... - PR creation action
37
- * // .github/actions/manage-branch/... - Branch management action
38
- * // .github/actions/promote-branch/... - Branch promotion action
39
- * // .github/actions/create-release/... - Release creation action
33
+ * // actions/detect-changes/... - Change detection action
34
+ * // actions/calculate-version/... - Version calculation action
35
+ * // actions/create-tag/... - Tag creation action
36
+ * // actions/create-pr/... - PR creation action
37
+ * // actions/manage-branch/... - Branch management action
38
+ * // actions/promote-branch/... - Branch promotion action
39
+ * // actions/create-release/... - Release creation action
40
40
  * // .release-it.cjs - Release-it configuration
41
41
  * ```
42
42
  */
43
- import { readFileSync, existsSync } from 'fs';
43
+ import { existsSync, readFileSync } from 'fs';
44
44
  import { parse } from 'yaml';
45
- import { logger } from '../utils/logger.js';
45
+ import { generate as generateVersionWorkflow } from '../templates/actions/calculate-version.yml.tpl.js';
46
+ import { generate as generateCreatePRWorkflow } from '../templates/actions/create-pr.yml.tpl.js';
47
+ import { generate as generateReleaseWorkflow } from '../templates/actions/create-release.yml.tpl.js';
46
48
  // Import individual workflow templates
47
49
  import { generate as generateTagWorkflow } from '../templates/actions/create-tag.yml.tpl.js';
48
50
  import { generate as generateChangesWorkflow } from '../templates/actions/detect-changes.yml.tpl.js';
49
- import { generate as generateChangesNxWorkflow } from '../templates/actions/detect-changes-nx.yml.tpl.js';
50
- import { generate as generateVersionWorkflow } from '../templates/actions/calculate-version.yml.tpl.js';
51
- import { generate as generateCreatePRWorkflow } from '../templates/actions/create-pr.yml.tpl.js';
52
51
  import { generate as generateBranchWorkflow } from '../templates/actions/manage-branch.yml.tpl.js';
53
52
  import { generate as generatePromoteBranchWorkflow } from '../templates/actions/promote-branch.yml.tpl.js';
54
- import { generate as generateReleaseWorkflow } from '../templates/actions/create-release.yml.tpl.js';
53
+ import { generate as generateRunNxAffectedWorkflow } from '../templates/actions/run-nx-affected.yml.tpl.js';
54
+ import { generate as generateReleaseItConfig } from '../templates/release-it.cjs.tpl.js';
55
+ import { generate as generateEnforcePRTarget } from '../templates/workflows/enforce-pr-target.yml.tpl.js';
55
56
  import { generate as generatePathBasedPipeline } from '../templates/workflows/pipeline.yml.tpl.js';
56
57
  import { generate as generateNxPipeline } from '../templates/workflows/pipeline-nx.yml.tpl.js';
57
- import { generate as generateEnforcePRTarget } from '../templates/workflows/enforce-pr-target.yml.tpl.js';
58
58
  import { generate as generatePRTitleCheck } from '../templates/workflows/pr-title-check.yml.tpl.js';
59
- import { generate as generateReleaseItConfig } from '../templates/release-it.cjs.tpl.js';
59
+ import { logger } from '../utils/logger.js';
60
60
  /**
61
61
  * Default fallback configuration when no config file exists.
62
62
  * Mirrors `defaultConfig` from init.tpl.ts to ensure consistent behavior.
@@ -125,14 +125,14 @@ const defaultConfig = {
125
125
  *
126
126
  * @note The generator creates 9 files:
127
127
  * - 1 main workflow (pipeline.yml)
128
- * - 7 composite actions (in .github/actions/)
128
+ * - 7 composite actions (in actions/)
129
129
  * - 1 release-it configuration (.release-it.cjs)
130
130
  *
131
131
  * All actions are generated in parallel for performance, followed by
132
132
  * the main pipeline which may reference the actions.
133
133
  */
134
134
  export const generate = (ctx) => Promise.resolve(ctx)
135
- .then((ctx) => {
135
+ .then(ctx => {
136
136
  logger.info('🔧 Generating GitHub Actions...');
137
137
  // Load existing pipeline if provided
138
138
  let existingPipeline = null;
@@ -147,11 +147,20 @@ export const generate = (ctx) => Promise.resolve(ctx)
147
147
  logger.warn(`⚠️ Failed to load existing pipeline: ${error}`);
148
148
  }
149
149
  }
150
- return { ...ctx, ...defaultConfig, ...ctx.config, ...ctx, existingPipeline, existingPipelineContent, outputPipelinePath: ctx.outputPipelinePath };
150
+ return {
151
+ ...ctx,
152
+ ...defaultConfig,
153
+ ...ctx.config,
154
+ ...ctx,
155
+ existingPipeline,
156
+ existingPipelineContent,
157
+ outputPipelinePath: ctx.outputPipelinePath
158
+ };
151
159
  })
152
- .then((ctx) => {
160
+ .then(ctx => {
153
161
  // Generate individual GitHub Actions and release-it config
154
162
  const generators = [
163
+ // Unified detect-changes action works for all stacks
155
164
  generateChangesWorkflow(ctx),
156
165
  generateTagWorkflow(ctx),
157
166
  generateVersionWorkflow(ctx),
@@ -163,11 +172,11 @@ export const generate = (ctx) => Promise.resolve(ctx)
163
172
  ];
164
173
  // Add Nx-specific action if Nx is enabled
165
174
  if (ctx.config?.nx?.enabled) {
166
- generators.push(generateChangesNxWorkflow(ctx));
175
+ generators.push(generateRunNxAffectedWorkflow(ctx));
167
176
  }
168
177
  return Promise.all(generators).then(() => ctx);
169
178
  })
170
- .then((ctx) => {
179
+ .then(ctx => {
171
180
  // Generate the main pipeline (Nx or path-based)
172
181
  if (ctx.config?.nx?.enabled) {
173
182
  logger.info('🔧 Generating Nx-optimized pipeline...');
@@ -177,15 +186,15 @@ export const generate = (ctx) => Promise.resolve(ctx)
177
186
  return generatePathBasedPipeline(ctx);
178
187
  }
179
188
  })
180
- .then((ctx) => {
189
+ .then(ctx => {
181
190
  // Generate the enforce PR target workflow
182
191
  return generateEnforcePRTarget(ctx);
183
192
  })
184
- .then((ctx) => {
193
+ .then(ctx => {
185
194
  // Generate the PR title check workflow
186
195
  return generatePRTitleCheck(ctx);
187
196
  })
188
- .then((ctx) => {
197
+ .then(ctx => {
189
198
  logger.success('✅ Generated workflows in: .github/workflows');
190
199
  return ctx;
191
200
  });
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.tpl.js","sourceRoot":"","sources":["../../src/generators/workflows.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAKH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAE3C,uCAAuC;AACvC,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAC5F,OAAO,EAAE,QAAQ,IAAI,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AACpG,OAAO,EAAE,QAAQ,IAAI,yBAAyB,EAAE,MAAM,mDAAmD,CAAA;AACzG,OAAO,EAAE,QAAQ,IAAI,uBAAuB,EAAE,MAAM,mDAAmD,CAAA;AACvG,OAAO,EAAE,QAAQ,IAAI,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AAChG,OAAO,EAAE,QAAQ,IAAI,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AAClG,OAAO,EAAE,QAAQ,IAAI,6BAA6B,EAAE,MAAM,gDAAgD,CAAA;AAC1G,OAAO,EAAE,QAAQ,IAAI,uBAAuB,EAAE,MAAM,gDAAgD,CAAA;AACpG,OAAO,EAAE,QAAQ,IAAI,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAClG,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,+CAA+C,CAAA;AAC9F,OAAO,EAAE,QAAQ,IAAI,uBAAuB,EAAE,MAAM,qDAAqD,CAAA;AACzG,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,kDAAkD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
18
+ * `actions/calculate-version/action.yml`
19
19
  *
20
20
  * ## Usage in Workflows
21
21
  *
@@ -26,7 +26,7 @@
26
26
  * outputs:
27
27
  * version: ${{ steps.calc.outputs.version }}
28
28
  * steps:
29
- * - uses: ./.github/actions/calculate-version
29
+ * - uses: ./actions/calculate-version
30
30
  * id: calc
31
31
  * with:
32
32
  * baseRef: main
@@ -39,12 +39,15 @@
39
39
  *
40
40
  * @module templates/actions/calculate-version.yml.tpl
41
41
  */
42
- import { PinionContext } from '@featherscloud/pinion';
42
+ import { type PinionContext } from '@featherscloud/pinion';
43
+ import type { PipecraftConfig } from '../../types/index.js';
43
44
  /**
44
45
  * Generator entry point for calculate-version composite action.
45
46
  *
46
47
  * @param {PinionContext} ctx - Pinion generator context
47
48
  * @returns {Promise<PinionContext>} Updated context after file generation
48
49
  */
49
- export declare const generate: (ctx: PinionContext) => Promise<any>;
50
+ export declare const generate: (ctx: PinionContext & {
51
+ config?: Partial<PipecraftConfig>;
52
+ }) => Promise<any>;
50
53
  //# sourceMappingURL=calculate-version.yml.tpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-version.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/calculate-version.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAuI7E;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,iBAU6D,CAAA"}
1
+ {"version":3,"file":"calculate-version.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/calculate-version.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAIlF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAyI3D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,iBAiB9E,CAAA"}
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * ## Generated Action Location
17
17
  *
18
- * `.github/actions/calculate-version/action.yml`
18
+ * `actions/calculate-version/action.yml`
19
19
  *
20
20
  * ## Usage in Workflows
21
21
  *
@@ -26,7 +26,7 @@
26
26
  * outputs:
27
27
  * version: ${{ steps.calc.outputs.version }}
28
28
  * steps:
29
- * - uses: ./.github/actions/calculate-version
29
+ * - uses: ./actions/calculate-version
30
30
  * id: calc
31
31
  * with:
32
32
  * baseRef: main
@@ -39,9 +39,10 @@
39
39
  *
40
40
  * @module templates/actions/calculate-version.yml.tpl
41
41
  */
42
- import { toFile, renderTemplate } from '@featherscloud/pinion';
42
+ import { renderTemplate, toFile } from '@featherscloud/pinion';
43
43
  import fs from 'fs';
44
44
  import { logger } from '../../utils/logger.js';
45
+ import { getActionOutputDir } from '../../utils/action-reference.js';
45
46
  /**
46
47
  * Generates the calculate-version composite action YAML content.
47
48
  *
@@ -58,6 +59,10 @@ inputs:
58
59
  description: 'Base reference for version calculation'
59
60
  required: false
60
61
  default: 'main'
62
+ node-version:
63
+ description: 'Node.js version to use'
64
+ required: false
65
+ default: '24'
61
66
 
62
67
  outputs:
63
68
  version:
@@ -75,7 +80,7 @@ runs:
75
80
  - name: Install Node.js
76
81
  uses: actions/setup-node@v4
77
82
  with:
78
- node-version: 22
83
+ node-version: \${{ inputs.node-version }}
79
84
 
80
85
  - name: Configure Git
81
86
  shell: bash
@@ -179,13 +184,15 @@ runs:
179
184
  * @returns {Promise<PinionContext>} Updated context after file generation
180
185
  */
181
186
  export const generate = (ctx) => Promise.resolve(ctx)
182
- .then((ctx) => {
183
- // Check if file exists to determine merge status
184
- const filePath = '.github/actions/calculate-version/action.yml';
187
+ .then(ctx => {
188
+ // Determine output directory based on actionSourceMode
189
+ const config = ctx.config || {};
190
+ const outputDir = getActionOutputDir(config);
191
+ const filePath = `${outputDir}/calculate-version/action.yml`;
185
192
  const exists = fs.existsSync(filePath);
186
193
  const status = exists ? '🔄 Merged with existing' : '📝 Created new';
187
194
  logger.verbose(`${status} ${filePath}`);
188
- return ctx;
195
+ return { ...ctx, actionOutputPath: filePath };
189
196
  })
190
- .then(renderTemplate(versionActionTemplate, toFile('.github/actions/calculate-version/action.yml')));
197
+ .then(ctx => renderTemplate(versionActionTemplate, toFile(ctx.actionOutputPath || 'actions/calculate-version/action.yml'))(ctx));
191
198
  //# sourceMappingURL=calculate-version.yml.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculate-version.yml.tpl.js","sourceRoot":"","sources":["../../../src/templates/actions/calculate-version.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAiB,MAAM,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,CAAC,GAAQ,EAAE,EAAE;IACzC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAyHoE,CAAA;AAC7E,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAkB,EAAE,EAAE,CAC7C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;KACjB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;IACZ,iDAAiD;IACjD,MAAM,QAAQ,GAAG,8CAA8C,CAA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M,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,GAAG,SAAS,+BAA+B,CAAA;IAC5D,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,gBAAgB,CAAA;IACpE,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAA;IACvC,OAAO,EAAE,GAAG,GAAG,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAA;AAC/C,CAAC,CAAC;KACD,IAAI,CAAC,GAAG,CAAC,EAAE,CACV,cAAc,CACZ,qBAAqB,EACrB,MAAM,CAAC,GAAG,CAAC,gBAAgB,IAAI,sCAAsC,CAAC,CACvE,CAAC,GAAG,CAAC,CACP,CAAA"}
@@ -6,12 +6,15 @@
6
6
  *
7
7
  * @module templates/actions/create-pr.yml.tpl
8
8
  */
9
- import { PinionContext } from '@featherscloud/pinion';
9
+ import { type PinionContext } from '@featherscloud/pinion';
10
+ import type { PipecraftConfig } from '../../types/index.js';
10
11
  /**
11
12
  * Generator entry point for create-pr composite action.
12
13
  *
13
14
  * @param {PinionContext} ctx - Pinion generator context
14
15
  * @returns {Promise<PinionContext>} Updated context after file generation
15
16
  */
16
- export declare const generate: (ctx: PinionContext) => Promise<any>;
17
+ export declare const generate: (ctx: PinionContext & {
18
+ config?: Partial<PipecraftConfig>;
19
+ }) => Promise<any>;
17
20
  //# sourceMappingURL=create-pr.yml.tpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-pr.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/create-pr.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AA8I7E;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,iBAUsD,CAAA"}
1
+ {"version":3,"file":"create-pr.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/create-pr.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAKlF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AA2I3D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,iBAiB9E,CAAA"}
@@ -6,10 +6,11 @@
6
6
  *
7
7
  * @module templates/actions/create-pr.yml.tpl
8
8
  */
9
- import { toFile, renderTemplate } from '@featherscloud/pinion';
10
- import fs from 'fs';
9
+ import { renderTemplate, toFile } from '@featherscloud/pinion';
11
10
  import dedent from 'dedent';
11
+ import fs from 'fs';
12
12
  import { logger } from '../../utils/logger.js';
13
+ import { getActionOutputDir } from '../../utils/action-reference.js';
13
14
  /**
14
15
  * Generates the create-pr composite action YAML content.
15
16
  *
@@ -153,13 +154,15 @@ const createprActionTemplate = (ctx) => {
153
154
  * @returns {Promise<PinionContext>} Updated context after file generation
154
155
  */
155
156
  export const generate = (ctx) => Promise.resolve(ctx)
156
- .then((ctx) => {
157
+ .then(ctx => {
157
158
  // Check if file exists to determine merge status
158
- const filePath = '.github/actions/create-pr/action.yml';
159
+ const config = ctx.config || {};
160
+ const outputDir = getActionOutputDir(config);
161
+ const filePath = `${outputDir}/create-pr/action.yml`;
159
162
  const exists = fs.existsSync(filePath);
160
163
  const status = exists ? '🔄 Merged with existing' : '📝 Created new';
161
164
  logger.verbose(`${status} ${filePath}`);
162
- return ctx;
165
+ return { ...ctx, actionOutputPath: filePath };
163
166
  })
164
- .then(renderTemplate(createprActionTemplate, toFile('.github/actions/create-pr/action.yml')));
167
+ .then(ctx => renderTemplate(createprActionTemplate, toFile(ctx.actionOutputPath || 'actions/create-pr/action.yml'))(ctx));
165
168
  //# sourceMappingURL=create-pr.yml.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-pr.yml.tpl.js","sourceRoot":"","sources":["../../../src/templates/actions/create-pr.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiB,MAAM,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG,CAAC,GAAQ,EAAE,EAAE;IAC1C,OAAO,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA+HA,CAAA;AACf,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAkB,EAAE,EAAE,CAC7C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;KACjB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;IACZ,iDAAiD;IACjD,MAAM,QAAQ,GAAG,sCAAsC,CAAA;IACvD,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,gBAAgB,CAAA;IACpE,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAA;IACvC,OAAO,GAAG,CAAA;AACZ,CAAC,CAAC;KACD,IAAI,CAAC,cAAc,CAAC,sBAAsB,EAAE,MAAM,CAAC,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AAA;IACvC,OAAO,EAAE,GAAG,GAAG,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAA;AAC/C,CAAC,CAAC;KACD,IAAI,CAAC,GAAG,CAAC,EAAE,CACV,cAAc,CACZ,sBAAsB,EACtB,MAAM,CAAC,GAAG,CAAC,gBAAgB,IAAI,8BAA8B,CAAC,CAC/D,CAAC,GAAG,CAAC,CACP,CAAA"}
@@ -7,12 +7,15 @@
7
7
  *
8
8
  * @module templates/actions/create-release.yml.tpl
9
9
  */
10
- import { PinionContext } from '@featherscloud/pinion';
10
+ import { type PinionContext } from '@featherscloud/pinion';
11
+ import type { PipecraftConfig } from '../../types/index.js';
11
12
  /**
12
13
  * Generator entry point for create-release composite action.
13
14
  *
14
15
  * @param {PinionContext} ctx - Pinion generator context
15
16
  * @returns {Promise<PinionContext>} Updated context after file generation
16
17
  */
17
- export declare const generate: (ctx: PinionContext) => Promise<any>;
18
+ export declare const generate: (ctx: PinionContext & {
19
+ config?: Partial<PipecraftConfig>;
20
+ }) => Promise<any>;
18
21
  //# sourceMappingURL=create-release.yml.tpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-release.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/create-release.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAqH7E;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,iBAU0D,CAAA"}
1
+ {"version":3,"file":"create-release.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/create-release.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAKlF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAkH3D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,iBAiB9E,CAAA"}
@@ -7,10 +7,11 @@
7
7
  *
8
8
  * @module templates/actions/create-release.yml.tpl
9
9
  */
10
- import { toFile, renderTemplate } from '@featherscloud/pinion';
11
- import fs from 'fs';
10
+ import { renderTemplate, toFile } from '@featherscloud/pinion';
12
11
  import dedent from 'dedent';
12
+ import fs from 'fs';
13
13
  import { logger } from '../../utils/logger.js';
14
+ import { getActionOutputDir } from '../../utils/action-reference.js';
14
15
  /**
15
16
  * Generates the create-release composite action YAML content.
16
17
  *
@@ -129,13 +130,15 @@ const releaseActionTemplate = (ctx) => {
129
130
  * @returns {Promise<PinionContext>} Updated context after file generation
130
131
  */
131
132
  export const generate = (ctx) => Promise.resolve(ctx)
132
- .then((ctx) => {
133
+ .then(ctx => {
133
134
  // Check if file exists to determine merge status
134
- const filePath = '.github/actions/create-release/action.yml';
135
+ const config = ctx.config || {};
136
+ const outputDir = getActionOutputDir(config);
137
+ const filePath = `${outputDir}/create-release/action.yml`;
135
138
  const exists = fs.existsSync(filePath);
136
139
  const status = exists ? '🔄 Merged with existing' : '📝 Created new';
137
140
  logger.verbose(`${status} ${filePath}`);
138
- return ctx;
141
+ return { ...ctx, actionOutputPath: filePath };
139
142
  })
140
- .then(renderTemplate(releaseActionTemplate, toFile('.github/actions/create-release/action.yml')));
143
+ .then(ctx => renderTemplate(releaseActionTemplate, toFile(ctx.actionOutputPath || 'actions/create-release/action.yml'))(ctx));
141
144
  //# sourceMappingURL=create-release.yml.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-release.yml.tpl.js","sourceRoot":"","sources":["../../../src/templates/actions/create-release.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAiB,MAAM,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,MA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AE,MAAM,iCAAiC,CAAA;AAGpE;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,CAAC,GAAQ,EAAE,EAAE;IACzC,OAAO,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAsGA,CAAA;AACf,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAA0D,EAAE,EAAE,CACrF,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;KACjB,IAAI,CAAC,GAAG,CAAC,EAAE;IACV,iDAAiD;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,EAAE,CAAA;IAC/B,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,GAAG,SAAS,4BAA4B,CAAA;IACzD,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,gBAAgB,CAAA;IACpE,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAA;IACvC,OAAO,EAAE,GAAG,GAAG,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAA;AAC/C,CAAC,CAAC;KACD,IAAI,CAAC,GAAG,CAAC,EAAE,CACV,cAAc,CACZ,qBAAqB,EACrB,MAAM,CAAC,GAAG,CAAC,gBAAgB,IAAI,mCAAmC,CAAC,CACpE,CAAC,GAAG,CAAC,CACP,CAAA"}
@@ -6,12 +6,15 @@
6
6
  *
7
7
  * @module templates/actions/create-tag.yml.tpl
8
8
  */
9
- import { PinionContext } from '@featherscloud/pinion';
9
+ import { type PinionContext } from '@featherscloud/pinion';
10
+ import type { PipecraftConfig } from '../../types/index.js';
10
11
  /**
11
12
  * Generator entry point for create-tag composite action.
12
13
  *
13
14
  * @param {PinionContext} ctx - Pinion generator context
14
15
  * @returns {Promise<PinionContext>} Updated context after file generation
15
16
  */
16
- export declare const generate: (ctx: PinionContext) => Promise<any>;
17
+ export declare const generate: (ctx: PinionContext & {
18
+ config?: Partial<PipecraftConfig>;
19
+ }) => Promise<any>;
17
20
  //# sourceMappingURL=create-tag.yml.tpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-tag.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/create-tag.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AA4G7E;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,iBAUkD,CAAA"}
1
+ {"version":3,"file":"create-tag.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/create-tag.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAKlF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAyG3D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,iBAiB9E,CAAA"}
@@ -6,10 +6,11 @@
6
6
  *
7
7
  * @module templates/actions/create-tag.yml.tpl
8
8
  */
9
- import { toFile, renderTemplate } from '@featherscloud/pinion';
10
- import fs from 'fs';
9
+ import { renderTemplate, toFile } from '@featherscloud/pinion';
11
10
  import dedent from 'dedent';
11
+ import fs from 'fs';
12
12
  import { logger } from '../../utils/logger.js';
13
+ import { getActionOutputDir } from '../../utils/action-reference.js';
13
14
  /**
14
15
  * Generates the create-tag composite action YAML content.
15
16
  *
@@ -119,13 +120,15 @@ const tagActionTemplate = (ctx) => {
119
120
  * @returns {Promise<PinionContext>} Updated context after file generation
120
121
  */
121
122
  export const generate = (ctx) => Promise.resolve(ctx)
122
- .then((ctx) => {
123
+ .then(ctx => {
123
124
  // Check if file exists to determine merge status
124
- const filePath = '.github/actions/create-tag/action.yml';
125
+ const config = ctx.config || {};
126
+ const outputDir = getActionOutputDir(config);
127
+ const filePath = `${outputDir}/create-tag/action.yml`;
125
128
  const exists = fs.existsSync(filePath);
126
129
  const status = exists ? '🔄 Merged with existing' : '📝 Created new';
127
130
  logger.verbose(`${status} ${filePath}`);
128
- return ctx;
131
+ return { ...ctx, actionOutputPath: filePath };
129
132
  })
130
- .then(renderTemplate(tagActionTemplate, toFile('.github/actions/create-tag/action.yml')));
133
+ .then(ctx => renderTemplate(tagActionTemplate, toFile(ctx.actionOutputPath || 'actions/create-tag/action.yml'))(ctx));
131
134
  //# sourceMappingURL=create-tag.yml.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-tag.yml.tpl.js","sourceRoot":"","sources":["../../../src/templates/actions/create-tag.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiB,MAAM,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,GAAQ,EAAE,EAAE;IACrC,OAAO,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA6FA,CAAA;AACf,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAkB,EAAE,EAAE,CA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,CAAC,EAAE;IACV,iDAAiD;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,EAAE,CAAA;IAC/B,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,GAAG,SAAS,wBAAwB,CAAA;IACrD,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,gBAAgB,CAAA;IACpE,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAA;IACvC,OAAO,EAAE,GAAG,GAAG,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAA;AAC/C,CAAC,CAAC;KACD,IAAI,CAAC,GAAG,CAAC,EAAE,CACV,cAAc,CACZ,iBAAiB,EACjB,MAAM,CAAC,GAAG,CAAC,gBAAgB,IAAI,+BAA+B,CAAC,CAChE,CAAC,GAAG,CAAC,CACP,CAAA"}
@@ -1,73 +1,45 @@
1
1
  /**
2
2
  * Detect Changes Action Template
3
3
  *
4
- * Generates a GitHub composite action that detects which domains (application areas)
5
- * have changes in a pull request. This is the foundation for PipeCraft's path-based
6
- * conditional workflow execution.
4
+ * Generates a REUSABLE GitHub composite action that detects which domains have changed.
5
+ * Supports both Nx dependency graph analysis and path-based change detection.
7
6
  *
8
7
  * ## Purpose
9
8
  *
10
- * In monorepos or multi-domain projects, not every change affects every part of the
11
- * system. This action uses GitHub's `dorny/paths-filter` to detect which domains
12
- * have modifications, allowing subsequent jobs to run conditionally.
9
+ * This action is **configuration-driven** and accepts domain definitions as JSON input,
10
+ * making it truly reusable across any project without regeneration:
11
+ * - For Nx monorepos: Uses `nx show projects --affected` to leverage the dependency graph
12
+ * - For path-based projects: Uses path filters to detect which domains changed
13
+ * - Automatically falls back to path-based detection if Nx is unavailable
13
14
  *
14
- * ## How It Works
15
+ * ## Key Design Principle
15
16
  *
16
- * 1. Checks out the repository with full history
17
- * 2. Uses paths-filter action to check each domain's file patterns
18
- * 3. Outputs a boolean for each domain (true if changed, false if not)
19
- * 4. Logs results for debugging
17
+ * **Domains are passed as input, not hardcoded in the action.**
18
+ * This allows the same action to work with any domain configuration without regeneration.
20
19
  *
21
20
  * ## Generated Action Location
22
21
  *
23
- * `.github/actions/detect-changes/action.yml`
24
- *
25
- * ## Usage in Workflows
26
- *
27
- * ```yaml
28
- * jobs:
29
- * changes:
30
- * runs-on: ubuntu-latest
31
- * outputs:
32
- * api: ${{ steps.changes.outputs.api }}
33
- * web: ${{ steps.changes.outputs.web }}
34
- * steps:
35
- * - uses: ./.github/actions/detect-changes
36
- * id: changes
37
- * with:
38
- * baseRef: main
39
- *
40
- * test-api:
41
- * needs: changes
42
- * if: needs.changes.outputs.api == 'true'
43
- * # Only runs if API domain changed
44
- * ```
22
+ * `actions/detect-changes/action.yml`
45
23
  *
46
24
  * @module templates/actions/detect-changes.yml.tpl
47
25
  */
48
- import { PinionContext } from '@featherscloud/pinion';
26
+ import { type PinionContext } from '@featherscloud/pinion';
27
+ import type { PipecraftConfig } from '../../types/index.js';
49
28
  /**
50
29
  * Generator entry point for detect-changes composite action.
51
30
  *
52
- * Generates the `.github/actions/detect-changes/action.yml` file with domain-specific
53
- * change detection logic. This action is used by the main pipeline to determine which
54
- * domains have changes and need to run tests/deployment.
31
+ * Generates the `actions/detect-changes/action.yml` file with configuration-driven
32
+ * change detection logic. This action accepts domain configuration as input at runtime,
33
+ * making it truly reusable without regeneration.
55
34
  *
56
- * @param {PinionContext} ctx - Pinion generator context
57
- * @param {Record<string, DomainConfig>} ctx.domains - Domain configurations
58
- * @returns {Promise<PinionContext>} Updated context after file generation
35
+ * **Important:** This action no longer embeds domain configurations. Instead, it receives
36
+ * them as JSON input from the workflow, allowing the same action to work with any
37
+ * domain configuration.
59
38
  *
60
- * @example
61
- * ```typescript
62
- * await generate({
63
- * cwd: '/path/to/project',
64
- * domains: {
65
- * api: { paths: ['src/api/**'], description: 'API' },
66
- * web: { paths: ['src/web/**'], description: 'Web' }
67
- * }
68
- * })
69
- * // Creates: .github/actions/detect-changes/action.yml
70
- * ```
39
+ * @param {PinionContext} ctx - Pinion generator context (domains no longer needed in template)
40
+ * @returns {Promise<PinionContext>} Updated context after file generation
71
41
  */
72
- export declare const generate: (ctx: PinionContext) => Promise<any>;
42
+ export declare const generate: (ctx: PinionContext & {
43
+ config?: Partial<PipecraftConfig>;
44
+ }) => Promise<any>;
73
45
  //# sourceMappingURL=detect-changes.yml.tpl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"detect-changes.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/detect-changes.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EAAE,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAsG7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,iBAU0D,CAAA"}
1
+ {"version":3,"file":"detect-changes.yml.tpl.d.ts","sourceRoot":"","sources":["../../../src/templates/actions/detect-changes.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,uBAAuB,CAAA;AAIlF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAuS3D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,iBAiB9E,CAAA"}