pipecraft 0.29.3 → 0.36.14

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 (142) hide show
  1. package/README.md +128 -54
  2. package/dist/cli/index.d.ts +3 -3
  3. package/dist/cli/index.js +68 -25
  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 +214 -108
  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 -36
  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 +49 -23
  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 +14 -8
  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 +16 -11
  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 +13 -9
  28. package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -1
  29. package/dist/templates/actions/detect-changes.yml.tpl.d.ts +17 -51
  30. package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -1
  31. package/dist/templates/actions/detect-changes.yml.tpl.js +130 -110
  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 +13 -9
  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 +39 -92
  40. package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -1
  41. package/dist/templates/release-it.cjs.tpl.d.ts +1 -1
  42. package/dist/templates/release-it.cjs.tpl.d.ts.map +1 -1
  43. package/dist/templates/release-it.cjs.tpl.js +38 -29
  44. package/dist/templates/release-it.cjs.tpl.js.map +1 -1
  45. package/dist/templates/workflows/enforce-pr-target.yml.tpl.d.ts +1 -1
  46. package/dist/templates/workflows/enforce-pr-target.yml.tpl.d.ts.map +1 -1
  47. package/dist/templates/workflows/enforce-pr-target.yml.tpl.js +2 -3
  48. package/dist/templates/workflows/enforce-pr-target.yml.tpl.js.map +1 -1
  49. package/dist/templates/workflows/pipeline.yml.tpl.d.ts +2 -2
  50. package/dist/templates/workflows/pipeline.yml.tpl.d.ts.map +1 -1
  51. package/dist/templates/workflows/pipeline.yml.tpl.js +337 -84
  52. package/dist/templates/workflows/pipeline.yml.tpl.js.map +1 -1
  53. package/dist/templates/workflows/pr-title-check.yml.tpl.d.ts +1 -1
  54. package/dist/templates/workflows/pr-title-check.yml.tpl.d.ts.map +1 -1
  55. package/dist/templates/workflows/pr-title-check.yml.tpl.js +101 -22
  56. package/dist/templates/workflows/pr-title-check.yml.tpl.js.map +1 -1
  57. package/dist/templates/workflows/shared/index.d.ts +4 -2
  58. package/dist/templates/workflows/shared/index.d.ts.map +1 -1
  59. package/dist/templates/workflows/shared/index.js +4 -2
  60. package/dist/templates/workflows/shared/index.js.map +1 -1
  61. package/dist/templates/workflows/shared/managed-workflow.d.ts +32 -0
  62. package/dist/templates/workflows/shared/managed-workflow.d.ts.map +1 -0
  63. package/dist/templates/workflows/shared/managed-workflow.js +51 -0
  64. package/dist/templates/workflows/shared/managed-workflow.js.map +1 -0
  65. package/dist/templates/workflows/shared/operations-changes.d.ts +13 -3
  66. package/dist/templates/workflows/shared/operations-changes.d.ts.map +1 -1
  67. package/dist/templates/workflows/shared/operations-changes.js +42 -16
  68. package/dist/templates/workflows/shared/operations-changes.js.map +1 -1
  69. package/dist/templates/workflows/shared/operations-domain-jobs.d.ts +18 -1
  70. package/dist/templates/workflows/shared/operations-domain-jobs.d.ts.map +1 -1
  71. package/dist/templates/workflows/shared/operations-domain-jobs.js +142 -17
  72. package/dist/templates/workflows/shared/operations-domain-jobs.js.map +1 -1
  73. package/dist/templates/workflows/shared/operations-gate.d.ts +6 -0
  74. package/dist/templates/workflows/shared/operations-gate.d.ts.map +1 -0
  75. package/dist/templates/workflows/shared/operations-gate.js +116 -0
  76. package/dist/templates/workflows/shared/operations-gate.js.map +1 -0
  77. package/dist/templates/workflows/shared/operations-header.d.ts +11 -1
  78. package/dist/templates/workflows/shared/operations-header.d.ts.map +1 -1
  79. package/dist/templates/workflows/shared/operations-header.js +66 -7
  80. package/dist/templates/workflows/shared/operations-header.js.map +1 -1
  81. package/dist/templates/workflows/shared/operations-tag-promote.d.ts +4 -3
  82. package/dist/templates/workflows/shared/operations-tag-promote.d.ts.map +1 -1
  83. package/dist/templates/workflows/shared/operations-tag-promote.js +144 -33
  84. package/dist/templates/workflows/shared/operations-tag-promote.js.map +1 -1
  85. package/dist/templates/workflows/shared/operations-version.d.ts +3 -2
  86. package/dist/templates/workflows/shared/operations-version.d.ts.map +1 -1
  87. package/dist/templates/workflows/shared/operations-version.js +17 -16
  88. package/dist/templates/workflows/shared/operations-version.js.map +1 -1
  89. package/dist/templates/yaml-format-utils.d.ts.map +1 -1
  90. package/dist/templates/yaml-format-utils.js +1 -5
  91. package/dist/templates/yaml-format-utils.js.map +1 -1
  92. package/dist/types/index.d.ts +65 -53
  93. package/dist/types/index.d.ts.map +1 -1
  94. package/dist/utils/action-reference.d.ts +73 -0
  95. package/dist/utils/action-reference.d.ts.map +1 -0
  96. package/dist/utils/action-reference.js +120 -0
  97. package/dist/utils/action-reference.js.map +1 -0
  98. package/dist/utils/ast-path-operations.d.ts +3 -3
  99. package/dist/utils/ast-path-operations.d.ts.map +1 -1
  100. package/dist/utils/ast-path-operations.js +58 -17
  101. package/dist/utils/ast-path-operations.js.map +1 -1
  102. package/dist/utils/config.d.ts +16 -5
  103. package/dist/utils/config.d.ts.map +1 -1
  104. package/dist/utils/config.js +69 -12
  105. package/dist/utils/config.js.map +1 -1
  106. package/dist/utils/github-setup.d.ts +7 -7
  107. package/dist/utils/github-setup.d.ts.map +1 -1
  108. package/dist/utils/github-setup.js +84 -63
  109. package/dist/utils/github-setup.js.map +1 -1
  110. package/dist/utils/logger.d.ts.map +1 -1
  111. package/dist/utils/logger.js.map +1 -1
  112. package/dist/utils/messaging.d.ts +2 -2
  113. package/dist/utils/messaging.d.ts.map +1 -1
  114. package/dist/utils/messaging.js +12 -8
  115. package/dist/utils/messaging.js.map +1 -1
  116. package/dist/utils/preflight.d.ts +2 -2
  117. package/dist/utils/preflight.d.ts.map +1 -1
  118. package/dist/utils/preflight.js +43 -41
  119. package/dist/utils/preflight.js.map +1 -1
  120. package/dist/utils/versioning.d.ts +1 -1
  121. package/dist/utils/versioning.d.ts.map +1 -1
  122. package/dist/utils/versioning.js +10 -10
  123. package/dist/utils/versioning.js.map +1 -1
  124. package/dist/utils/workflow-semantics.d.ts +61 -0
  125. package/dist/utils/workflow-semantics.d.ts.map +1 -0
  126. package/dist/utils/workflow-semantics.js +230 -0
  127. package/dist/utils/workflow-semantics.js.map +1 -0
  128. package/package.json +12 -4
  129. package/src/generators/init.tpl.ts +275 -128
  130. package/src/generators/workflows.tpl.ts +54 -57
  131. package/dist/templates/actions/detect-changes-nx.yml.tpl.d.ts +0 -32
  132. package/dist/templates/actions/detect-changes-nx.yml.tpl.d.ts.map +0 -1
  133. package/dist/templates/actions/detect-changes-nx.yml.tpl.js +0 -227
  134. package/dist/templates/actions/detect-changes-nx.yml.tpl.js.map +0 -1
  135. package/dist/templates/workflows/pipeline-nx.yml.tpl.d.ts +0 -22
  136. package/dist/templates/workflows/pipeline-nx.yml.tpl.d.ts.map +0 -1
  137. package/dist/templates/workflows/pipeline-nx.yml.tpl.js +0 -196
  138. package/dist/templates/workflows/pipeline-nx.yml.tpl.js.map +0 -1
  139. package/dist/utils/idempotency.d.ts +0 -187
  140. package/dist/utils/idempotency.d.ts.map +0 -1
  141. package/dist/utils/idempotency.js +0 -304
  142. package/dist/utils/idempotency.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Init Template Generator
3
3
  *
4
- * Generates the initial PipeCraft configuration file (.pipecraftrc.json) with default settings.
4
+ * Generates the initial PipeCraft configuration file (.pipecraftrc) with default settings.
5
5
  * This generator is invoked by the `pipecraft init` command and prompts the user for
6
6
  * basic project configuration preferences.
7
7
  *
@@ -14,7 +14,7 @@
14
14
  * // Called by CLI with Pinion context
15
15
  * await generate(pinionContext)
16
16
  *
17
- * // Creates .pipecraftrc.json with:
17
+ * // Creates .pipecraftrc with:
18
18
  * // - CI provider (GitHub/GitLab)
19
19
  * // - Merge strategy (fast-forward/merge)
20
20
  * // - Branch flow configuration
@@ -27,8 +27,7 @@
27
27
  * for the initial release to ensure consistent behavior. Future versions will
28
28
  * respect user input and allow customization.
29
29
  */
30
- import { toFile, writeJSON } from '@featherscloud/pinion';
31
- import { existsSync, readFileSync } from 'fs';
30
+ import { existsSync, writeFileSync } from 'fs';
32
31
  import inquirer from 'inquirer';
33
32
  /**
34
33
  * Default PipeCraft configuration for new projects.
@@ -50,14 +49,25 @@ const defaultConfig = {
50
49
  initialBranch: 'develop',
51
50
  finalBranch: 'main',
52
51
  branchFlow: ['develop', 'staging', 'main'],
53
- autoMerge: {
52
+ autoPromote: {
54
53
  staging: true,
55
54
  main: true
56
55
  },
57
56
  semver: {
58
57
  bumpRules: {
59
- feat: 'minor',
58
+ test: 'ignore',
59
+ build: 'ignore',
60
+ ci: 'patch',
61
+ docs: 'patch',
62
+ style: 'patch',
60
63
  fix: 'patch',
64
+ perf: 'patch',
65
+ refactor: 'patch',
66
+ chore: 'patch',
67
+ patch: 'patch',
68
+ feat: 'minor',
69
+ minor: 'minor',
70
+ major: 'major',
61
71
  breaking: 'major'
62
72
  }
63
73
  },
@@ -81,36 +91,165 @@ const defaultConfig = {
81
91
  }
82
92
  };
83
93
  /**
84
- * Generates a JSON string representation of the PipeCraft configuration.
85
- *
86
- * Serializes the configuration object with proper formatting (2-space indentation)
87
- * for writing to .pipecraftrc.json file.
94
+ * Generates a YAML configuration file with comprehensive comments.
88
95
  *
89
- * @param {PipecraftConfig} ctx - The configuration context to serialize
90
- * @returns {string} JSON string representation of the configuration
96
+ * Creates a .pipecraftrc file with:
97
+ * - Descriptive section headers
98
+ * - Inline comments for each configuration option
99
+ * - Examples and valid values
100
+ * - Proper YAML formatting
91
101
  *
92
- * @note The function extracts specific fields from the context to ensure
93
- * only valid configuration properties are included in the output file.
102
+ * @param {any} config - The configuration object to serialize
103
+ * @returns {string} YAML string with comments
94
104
  */
95
- const configTemplate = (ctx) => {
96
- const config = {
97
- ciProvider: ctx.ciProvider,
98
- mergeStrategy: ctx.mergeStrategy,
99
- requireConventionalCommits: ctx.requireConventionalCommits,
100
- initialBranch: ctx.initialBranch,
101
- finalBranch: ctx.finalBranch,
102
- branchFlow: ctx.branchFlow,
103
- autoMerge: ctx.autoMerge,
104
- semver: {
105
- bumpRules: ctx.semver.bumpRules
105
+ const generateYamlConfig = (config) => {
106
+ const lines = [];
107
+ // Header
108
+ lines.push('# PipeCraft Configuration');
109
+ lines.push('# Trunk-based development workflow automation');
110
+ lines.push('# https://pipecraft.thecraftlab.dev');
111
+ lines.push('');
112
+ // CI Provider
113
+ lines.push('# CI/CD Platform');
114
+ lines.push(`ciProvider: ${config.ciProvider}`);
115
+ lines.push('');
116
+ // Merge Strategy
117
+ lines.push('# Merge strategy for automatic promotions');
118
+ lines.push("# Options: 'fast-forward' (clean linear history, recommended) | 'merge' (creates merge commits)");
119
+ lines.push(`mergeStrategy: ${config.mergeStrategy}`);
120
+ lines.push('');
121
+ // Conventional Commits
122
+ lines.push('# Enforce conventional commit messages (feat:, fix:, etc.)');
123
+ lines.push(`requireConventionalCommits: ${config.requireConventionalCommits}`);
124
+ lines.push('');
125
+ // Branch Configuration
126
+ lines.push('# Branch flow configuration');
127
+ lines.push(`initialBranch: ${config.initialBranch} # Where features land`);
128
+ lines.push(`finalBranch: ${config.finalBranch} # Production branch`);
129
+ lines.push('');
130
+ // Branch Flow
131
+ lines.push(`# Promotion flow: ${config.branchFlow.join(' → ')}`);
132
+ lines.push('branchFlow:');
133
+ config.branchFlow.forEach((branch, index) => {
134
+ const comments = [
135
+ '# Feature integration and initial testing',
136
+ '# Pre-production validation',
137
+ '# Production releases'
138
+ ];
139
+ lines.push(` - ${branch} ${comments[index] || ''}`);
140
+ });
141
+ lines.push('');
142
+ // Auto Merge
143
+ lines.push('# Automatic promotion after successful tests');
144
+ lines.push('autoPromote:');
145
+ const autoPromoteEntries = Object.entries(config.autoPromote);
146
+ autoPromoteEntries.forEach(([key, value]) => {
147
+ const flowIndex = config.branchFlow.indexOf(key);
148
+ const fromBranch = flowIndex > 0 ? config.branchFlow[flowIndex - 1] : '';
149
+ const comment = fromBranch ? ` # Auto-promote ${fromBranch} → ${key}` : '';
150
+ lines.push(` ${key}: ${value}${comment}`);
151
+ });
152
+ lines.push('');
153
+ // Package Manager (if present)
154
+ if (config.packageManager) {
155
+ lines.push('# Package manager');
156
+ lines.push(`packageManager: ${config.packageManager}`);
157
+ lines.push('');
158
+ }
159
+ // Semantic Versioning
160
+ lines.push('# Semantic versioning rules');
161
+ lines.push('# Prefixes are used to determine the type of change and the version bump level');
162
+ lines.push('semver:');
163
+ lines.push(' bumpRules:');
164
+ const bumpRules = config.semver.bumpRules;
165
+ const ruleGroups = [
166
+ { title: '# Ignored types (no version bump)', keys: ['test', 'build'] },
167
+ {
168
+ title: '# Patch-level changes (0.0.x)',
169
+ keys: ['ci', 'docs', 'style', 'fix', 'perf', 'refactor', 'chore', 'patch']
106
170
  },
107
- domains: ctx.domains
108
- };
109
- // Include Nx configuration if detected
110
- if (ctx.nx) {
111
- config.nx = ctx.nx;
171
+ { title: '# Minor-level changes (0.x.0)', keys: ['feat', 'minor'] },
172
+ { title: '# Major-level changes (x.0.0)', keys: ['major', 'breaking'] }
173
+ ];
174
+ ruleGroups.forEach((group, groupIndex) => {
175
+ if (groupIndex > 0)
176
+ lines.push('');
177
+ lines.push(` ${group.title}`);
178
+ group.keys.forEach(key => {
179
+ if (bumpRules[key]) {
180
+ lines.push(` ${key}: '${bumpRules[key]}'`);
181
+ }
182
+ });
183
+ });
184
+ lines.push('');
185
+ // Domains
186
+ lines.push('# Domain definitions - what parts of your codebase trigger which jobs');
187
+ lines.push('# Will create placeholder jobs for each domain if no jobs are defined in the pipeline.yml');
188
+ lines.push('domains:');
189
+ Object.entries(config.domains).forEach(([domainName, domainConfig]) => {
190
+ lines.push(` ${domainName}:`);
191
+ // Description (always write as field)
192
+ if (domainConfig.description) {
193
+ lines.push(` description: '${domainConfig.description}'`);
194
+ }
195
+ // Paths
196
+ if (domainConfig.paths) {
197
+ lines.push(' paths:');
198
+ domainConfig.paths.forEach((path) => {
199
+ lines.push(` - ${path}`);
200
+ });
201
+ }
202
+ // Prefixes (if present)
203
+ if (domainConfig.prefixes) {
204
+ lines.push(` prefixes: [${domainConfig.prefixes.map((p) => `'${p}'`).join(', ')}]`);
205
+ }
206
+ lines.push('');
207
+ });
208
+ // Versioning (if present)
209
+ if (config.versioning) {
210
+ lines.push('# Version calculation and release automation');
211
+ lines.push('versioning:');
212
+ lines.push(` enabled: ${config.versioning.enabled}`);
213
+ if (config.versioning.releaseItConfig) {
214
+ lines.push(` releaseItConfig: ${config.versioning.releaseItConfig}`);
215
+ }
216
+ if (config.versioning.conventionalCommits !== undefined) {
217
+ lines.push(` conventionalCommits: ${config.versioning.conventionalCommits} # Use conventional commits for version bumps`);
218
+ }
219
+ if (config.versioning.autoTag !== undefined) {
220
+ lines.push(` autoTag: ${config.versioning.autoTag} # Automatically create git tags`);
221
+ }
222
+ if (config.versioning.autoPush !== undefined) {
223
+ lines.push(` autoPush: ${config.versioning.autoPush} # Manual control over git push`);
224
+ }
225
+ if (config.versioning.changelog !== undefined) {
226
+ lines.push(` changelog: ${config.versioning.changelog} # Generate CHANGELOG.md`);
227
+ }
228
+ // Note: bumpRules are defined in the semver section, not here
229
+ lines.push('');
230
+ }
231
+ // Rebuild configuration (if present)
232
+ if (config.rebuild) {
233
+ lines.push('# Workflow rebuild optimization');
234
+ lines.push('rebuild:');
235
+ lines.push(` enabled: ${config.rebuild.enabled} # Enable smart rebuild detection`);
236
+ if (config.rebuild.skipIfUnchanged !== undefined) {
237
+ lines.push(` skipIfUnchanged: ${config.rebuild.skipIfUnchanged} # Skip regeneration if config hasn't changed`);
238
+ }
239
+ if (config.rebuild.forceRegenerate !== undefined) {
240
+ lines.push(` forceRegenerate: ${config.rebuild.forceRegenerate} # Force regenerate even if unchanged`);
241
+ }
242
+ if (config.rebuild.cacheFile) {
243
+ lines.push(` cacheFile: ${config.rebuild.cacheFile}`);
244
+ }
245
+ lines.push('');
112
246
  }
113
- return JSON.stringify(config, null, 2);
247
+ // Remove trailing empty line
248
+ while (lines[lines.length - 1] === '') {
249
+ lines.pop();
250
+ }
251
+ lines.push(''); // Single trailing newline
252
+ return lines.join('\n');
114
253
  };
115
254
  /**
116
255
  * Init generator main entry point.
@@ -155,25 +294,31 @@ const configTemplate = (ctx) => {
155
294
  */
156
295
  export const generate = async (ctx) => {
157
296
  const cwd = ctx.cwd || process.cwd();
158
- // Detect package manager before prompting
159
- let detectedPackageManager = 'npm';
160
- if (existsSync(`${cwd}/pnpm-lock.yaml`)) {
161
- detectedPackageManager = 'pnpm';
162
- }
163
- else if (existsSync(`${cwd}/yarn.lock`)) {
164
- detectedPackageManager = 'yarn';
165
- }
166
- else if (existsSync(`${cwd}/package-lock.json`)) {
167
- detectedPackageManager = 'npm';
297
+ // Check if .pipecraftrc already exists (YAML format)
298
+ const configPath = `${cwd}/.pipecraftrc`;
299
+ const legacyConfigPath = `${cwd}/.pipecraftrc.json`;
300
+ if (existsSync(configPath) || existsSync(legacyConfigPath)) {
301
+ const existingPath = existsSync(configPath) ? '.pipecraftrc' : '.pipecraftrc.json';
302
+ const overwriteAnswer = await inquirer.prompt([
303
+ {
304
+ type: 'confirm',
305
+ name: 'overwrite',
306
+ message: `⚠️ ${existingPath} already exists. Overwrite it?`,
307
+ default: false
308
+ }
309
+ ]);
310
+ if (!overwriteAnswer.overwrite) {
311
+ console.log('\n❌ Init cancelled. Existing configuration preserved.\n');
312
+ return;
313
+ }
314
+ console.log('\n✅ Proceeding with overwrite...\n');
315
+ // Set force flag to true so Pinion will overwrite the file
316
+ if (ctx.pinion) {
317
+ ctx.pinion.force = true;
318
+ }
168
319
  }
169
320
  // Run inquirer prompts
170
321
  const answers = await inquirer.prompt([
171
- {
172
- type: 'input',
173
- name: 'projectName',
174
- message: 'What is your project name?',
175
- default: 'my-project'
176
- },
177
322
  {
178
323
  type: 'list',
179
324
  name: 'ciProvider',
@@ -219,13 +364,6 @@ export const generate = async (ctx) => {
219
364
  default: 'develop,staging,main',
220
365
  filter: (input) => input.split(',').map(b => b.trim())
221
366
  },
222
- {
223
- type: 'list',
224
- name: 'packageManager',
225
- message: `Which package manager do you use? (detected: ${detectedPackageManager})`,
226
- choices: ['npm', 'yarn', 'pnpm'],
227
- default: detectedPackageManager
228
- },
229
367
  {
230
368
  type: 'list',
231
369
  name: 'domainSelection',
@@ -251,13 +389,19 @@ export const generate = async (ctx) => {
251
389
  if (!input.trim()) {
252
390
  return 'Please enter at least one domain';
253
391
  }
254
- const domains = input.split(',').map(d => d.trim()).filter(d => d);
392
+ const domains = input
393
+ .split(',')
394
+ .map(d => d.trim())
395
+ .filter(d => d);
255
396
  if (domains.length === 0) {
256
397
  return 'Please enter valid domain names';
257
398
  }
258
399
  return true;
259
400
  },
260
- filter: (input) => input.split(',').map(d => d.trim()).filter(d => d)
401
+ filter: (input) => input
402
+ .split(',')
403
+ .map(d => d.trim())
404
+ .filter(d => d)
261
405
  }
262
406
  ]);
263
407
  selectedDomains = customDomainsAnswer.customDomains;
@@ -269,7 +413,10 @@ export const generate = async (ctx) => {
269
413
  'frontend-backend': ['frontend', 'backend'],
270
414
  'apps-libs': ['apps', 'libs']
271
415
  };
272
- selectedDomains = domainMappings[answers.domainSelection] || ['api', 'web'];
416
+ selectedDomains = domainMappings[answers.domainSelection] || [
417
+ 'api',
418
+ 'web'
419
+ ];
273
420
  }
274
421
  // Generate domain configuration
275
422
  const domainConfig = {};
@@ -281,59 +428,17 @@ export const generate = async (ctx) => {
281
428
  });
282
429
  // Add cicd domain for CI/CD changes
283
430
  domainConfig.cicd = {
284
- paths: ['.github/workflows/**'],
431
+ paths: ['.github/**'],
285
432
  description: 'CI/CD configuration changes'
286
433
  };
287
434
  // Show warning for custom domains about path editing
288
435
  if (answers.domainSelection === 'custom') {
289
436
  console.log('\n⚠️ Custom domains selected!');
290
- console.log(' You will need to edit the paths in .pipecraftrc.json after generation');
437
+ console.log(' You will need to edit the paths in .pipecraftrc after generation');
291
438
  console.log(' to match your actual project structure.\n');
292
439
  }
293
440
  // Merge answers with context and defaults
294
441
  const mergedCtx = { ...ctx, ...defaultConfig, ...answers };
295
- // Detect Nx workspace
296
- const nxJsonPath = `${cwd}/nx.json`;
297
- let nxConfig = undefined;
298
- if (existsSync(nxJsonPath)) {
299
- try {
300
- const nxJsonContent = readFileSync(nxJsonPath, 'utf8');
301
- const nxJson = JSON.parse(nxJsonContent);
302
- // Extract tasks from targetDefaults
303
- const tasks = nxJson.targetDefaults ? Object.keys(nxJson.targetDefaults) : [];
304
- // Sort tasks in a logical order (quality → test → build → e2e)
305
- const taskOrder = ['lint', 'typecheck', 'test', 'unit-test', 'build', 'integration-test', 'e2e', 'e2e-ci'];
306
- const sortedTasks = tasks.sort((a, b) => {
307
- const aIdx = taskOrder.indexOf(a);
308
- const bIdx = taskOrder.indexOf(b);
309
- if (aIdx === -1 && bIdx === -1)
310
- return 0;
311
- if (aIdx === -1)
312
- return 1;
313
- if (bIdx === -1)
314
- return -1;
315
- return aIdx - bIdx;
316
- });
317
- console.log('✅ Nx workspace detected - enabling Nx integration');
318
- console.log(` Detected tasks: ${sortedTasks.join(', ')}`);
319
- nxConfig = {
320
- enabled: true,
321
- tasks: sortedTasks,
322
- baseRef: 'origin/main',
323
- enableCache: true
324
- };
325
- }
326
- catch (error) {
327
- console.warn('⚠️ Found nx.json but could not parse it:', error);
328
- console.log(' Using default Nx configuration');
329
- nxConfig = {
330
- enabled: true,
331
- tasks: ['lint', 'test', 'build', 'integration-test'],
332
- baseRef: 'origin/main',
333
- enableCache: true
334
- };
335
- }
336
- }
337
442
  const configData = {
338
443
  ciProvider: mergedCtx.ciProvider,
339
444
  mergeStrategy: mergedCtx.mergeStrategy,
@@ -341,17 +446,18 @@ export const generate = async (ctx) => {
341
446
  initialBranch: mergedCtx.initialBranch,
342
447
  finalBranch: mergedCtx.finalBranch,
343
448
  branchFlow: mergedCtx.branchFlow,
344
- autoMerge: mergedCtx.autoMerge,
345
- packageManager: mergedCtx.packageManager,
449
+ autoPromote: mergedCtx.autoPromote,
346
450
  semver: {
347
451
  bumpRules: mergedCtx.semver.bumpRules
348
452
  },
349
453
  domains: domainConfig // Use user-selected domains instead of defaults
350
454
  };
351
- // Add Nx config if detected
352
- if (nxConfig) {
353
- configData.nx = nxConfig;
354
- }
355
- return writeJSON(() => configData, toFile('.pipecraftrc.json'))(mergedCtx);
455
+ // Generate YAML content with comments
456
+ const yamlContent = generateYamlConfig(configData);
457
+ // Write the .pipecraftrc file
458
+ const outputPath = `${cwd}/.pipecraftrc`;
459
+ writeFileSync(outputPath, yamlContent, 'utf-8');
460
+ console.log(`\n✅ Created ${outputPath}\n`);
461
+ return mergedCtx;
356
462
  };
357
463
  //# sourceMappingURL=init.tpl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.tpl.js","sourceRoot":"","sources":["../../src/generators/init.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAiB,MAAM,EAAkB,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AAC7C,OAAO,QAAQ,MAAM,UAAU,CAAA;AAK/B;;;;;;;;;;;;GAYG;AACH,MAAM,aAAa,GAAG;IACpB,UAAU,EAAE,QAAiB;IAC7B,aAAa,EAAE,cAAuB;IACtC,0BAA0B,EAAE,IAAI;IAChC,aAAa,EAAE,SAAS;IACxB,WAAW,EAAE,MAAM;IACnB,UAAU,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC;IAC1C,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,IAAI;KACX;IACD,MAAM,EAAE;QACN,SAAS,EAAE;YACT,IAAI,EAAE,OAAO;YACb,GAAG,EAAE,OAAO;YACZ,QAAQ,EAAE,OAAO;SAClB;KACF;IACD,OAAO,EAAE;QACP,GAAG,EAAE;YACH,KAAK,EAAE,CAAC,aAAa,CAAC;YACtB,WAAW,EAAE,yBAAyB;SACvC;QACD,GAAG,EAAE;YACH,KAAK,EAAE,CAAC,aAAa,CAAC;YACtB,WAAW,EAAE,yBAAyB;SACvC;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,WAAW,EAAE,wBAAwB;SACtC;QACD,IAAI,EAAE;YACJ,KA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E,SAAS,CAAC,UAAU;QAChC,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,0BAA0B,EAAE,SAAS,CAAC,0BAA0B;QAChE,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,MAAM,EAAE;YACN,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,SAAS;SACtC;QACD,OAAO,EAAE,YAAY,CAAC,gDAAgD;KACvE,CAAA;IAED,sCAAsC;IACtC,MAAM,WAAW,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAA;IAElD,8BAA8B;IAC9B,MAAM,UAAU,GAAG,GAAG,GAAG,eAAe,CAAA;IACxC,aAAa,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;IAE/C,OAAO,CAAC,GAAG,CAAC,eAAe,UAAU,IAAI,CAAC,CAAA;IAE1C,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
@@ -30,17 +30,17 @@
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 { PinionContext } from '@featherscloud/pinion';
43
+ import { type PinionContext } from '@featherscloud/pinion';
44
44
  /**
45
45
  * Workflows generator main entry point.
46
46
  *
@@ -81,7 +81,7 @@ import { PinionContext } from '@featherscloud/pinion';
81
81
  *
82
82
  * @note The generator creates 9 files:
83
83
  * - 1 main workflow (pipeline.yml)
84
- * - 7 composite actions (in .github/actions/)
84
+ * - 7 composite actions (in actions/)
85
85
  * - 1 release-it configuration (.release-it.cjs)
86
86
  *
87
87
  * All actions are generated in parallel for performance, followed by
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.tpl.d.ts","sourceRoot":"","sources":["../../src/generators/workflows.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,aAAa,EAA0C,MAAM,uBAAuB,CAAA;AAmD7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,aAAa,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAA;CAAE,iBA4D5G,CAAA"}
1
+ {"version":3,"file":"workflows.tpl.d.ts","sourceRoot":"","sources":["../../src/generators/workflows.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAY,KAAK,aAAa,EAAgC,MAAM,uBAAuB,CAAA;AA+ClG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,QAAQ,GACnB,KAAK,aAAa,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAA;CAAE,iBA4DrF,CAAA"}
@@ -30,33 +30,31 @@
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';
55
- import { generate as generatePathBasedPipeline } from '../templates/workflows/pipeline.yml.tpl.js';
56
- import { generate as generateNxPipeline } from '../templates/workflows/pipeline-nx.yml.tpl.js';
53
+ import { generate as generateReleaseItConfig } from '../templates/release-it.cjs.tpl.js';
57
54
  import { generate as generateEnforcePRTarget } from '../templates/workflows/enforce-pr-target.yml.tpl.js';
55
+ import { generate as generatePipeline } from '../templates/workflows/pipeline.yml.tpl.js';
58
56
  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';
57
+ import { logger } from '../utils/logger.js';
60
58
  /**
61
59
  * Default fallback configuration when no config file exists.
62
60
  * Mirrors `defaultConfig` from init.tpl.ts to ensure consistent behavior.
@@ -125,14 +123,14 @@ const defaultConfig = {
125
123
  *
126
124
  * @note The generator creates 9 files:
127
125
  * - 1 main workflow (pipeline.yml)
128
- * - 7 composite actions (in .github/actions/)
126
+ * - 7 composite actions (in actions/)
129
127
  * - 1 release-it configuration (.release-it.cjs)
130
128
  *
131
129
  * All actions are generated in parallel for performance, followed by
132
130
  * the main pipeline which may reference the actions.
133
131
  */
134
132
  export const generate = (ctx) => Promise.resolve(ctx)
135
- .then((ctx) => {
133
+ .then(ctx => {
136
134
  logger.info('🔧 Generating GitHub Actions...');
137
135
  // Load existing pipeline if provided
138
136
  let existingPipeline = null;
@@ -147,11 +145,20 @@ export const generate = (ctx) => Promise.resolve(ctx)
147
145
  logger.warn(`⚠️ Failed to load existing pipeline: ${error}`);
148
146
  }
149
147
  }
150
- return { ...ctx, ...defaultConfig, ...ctx.config, ...ctx, existingPipeline, existingPipelineContent, outputPipelinePath: ctx.outputPipelinePath };
148
+ return {
149
+ ...ctx,
150
+ ...defaultConfig,
151
+ ...ctx.config,
152
+ ...ctx,
153
+ existingPipeline,
154
+ existingPipelineContent,
155
+ outputPipelinePath: ctx.outputPipelinePath
156
+ };
151
157
  })
152
- .then((ctx) => {
158
+ .then(ctx => {
153
159
  // Generate individual GitHub Actions and release-it config
154
160
  const generators = [
161
+ // Unified detect-changes action works for all stacks
155
162
  generateChangesWorkflow(ctx),
156
163
  generateTagWorkflow(ctx),
157
164
  generateVersionWorkflow(ctx),
@@ -161,31 +168,21 @@ export const generate = (ctx) => Promise.resolve(ctx)
161
168
  generateReleaseWorkflow(ctx),
162
169
  generateReleaseItConfig(ctx)
163
170
  ];
164
- // Add Nx-specific action if Nx is enabled
165
- if (ctx.config?.nx?.enabled) {
166
- generators.push(generateChangesNxWorkflow(ctx));
167
- }
168
171
  return Promise.all(generators).then(() => ctx);
169
172
  })
170
- .then((ctx) => {
171
- // Generate the main pipeline (Nx or path-based)
172
- if (ctx.config?.nx?.enabled) {
173
- logger.info('🔧 Generating Nx-optimized pipeline...');
174
- return generateNxPipeline(ctx);
175
- }
176
- else {
177
- return generatePathBasedPipeline(ctx);
178
- }
173
+ .then(ctx => {
174
+ // Generate the main pipeline (path-based change detection)
175
+ return generatePipeline(ctx);
179
176
  })
180
- .then((ctx) => {
177
+ .then(ctx => {
181
178
  // Generate the enforce PR target workflow
182
179
  return generateEnforcePRTarget(ctx);
183
180
  })
184
- .then((ctx) => {
181
+ .then(ctx => {
185
182
  // Generate the PR title check workflow
186
183
  return generatePRTitleCheck(ctx);
187
184
  })
188
- .then((ctx) => {
185
+ .then(ctx => {
189
186
  logger.success('✅ Generated workflows in: .github/workflows');
190
187
  return ctx;
191
188
  });