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.
- package/README.md +128 -54
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +68 -25
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/init.tpl.d.ts +4 -4
- package/dist/generators/init.tpl.d.ts.map +1 -1
- package/dist/generators/init.tpl.js +214 -108
- package/dist/generators/init.tpl.js.map +1 -1
- package/dist/generators/workflows.tpl.d.ts +9 -9
- package/dist/generators/workflows.tpl.d.ts.map +1 -1
- package/dist/generators/workflows.tpl.js +33 -36
- package/dist/generators/workflows.tpl.js.map +1 -1
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts +7 -4
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/calculate-version.yml.tpl.js +49 -23
- package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -1
- package/dist/templates/actions/create-pr.yml.tpl.d.ts +5 -2
- package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/create-pr.yml.tpl.js +14 -8
- package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -1
- package/dist/templates/actions/create-release.yml.tpl.d.ts +5 -2
- package/dist/templates/actions/create-release.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/create-release.yml.tpl.js +16 -11
- package/dist/templates/actions/create-release.yml.tpl.js.map +1 -1
- package/dist/templates/actions/create-tag.yml.tpl.d.ts +5 -2
- package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/create-tag.yml.tpl.js +13 -9
- package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -1
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts +17 -51
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/detect-changes.yml.tpl.js +130 -110
- package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -1
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts +5 -2
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/manage-branch.yml.tpl.js +13 -9
- package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -1
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts +5 -2
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/promote-branch.yml.tpl.js +39 -92
- package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -1
- package/dist/templates/release-it.cjs.tpl.d.ts +1 -1
- package/dist/templates/release-it.cjs.tpl.d.ts.map +1 -1
- package/dist/templates/release-it.cjs.tpl.js +38 -29
- package/dist/templates/release-it.cjs.tpl.js.map +1 -1
- package/dist/templates/workflows/enforce-pr-target.yml.tpl.d.ts +1 -1
- package/dist/templates/workflows/enforce-pr-target.yml.tpl.d.ts.map +1 -1
- package/dist/templates/workflows/enforce-pr-target.yml.tpl.js +2 -3
- package/dist/templates/workflows/enforce-pr-target.yml.tpl.js.map +1 -1
- package/dist/templates/workflows/pipeline.yml.tpl.d.ts +2 -2
- package/dist/templates/workflows/pipeline.yml.tpl.d.ts.map +1 -1
- package/dist/templates/workflows/pipeline.yml.tpl.js +337 -84
- package/dist/templates/workflows/pipeline.yml.tpl.js.map +1 -1
- package/dist/templates/workflows/pr-title-check.yml.tpl.d.ts +1 -1
- package/dist/templates/workflows/pr-title-check.yml.tpl.d.ts.map +1 -1
- package/dist/templates/workflows/pr-title-check.yml.tpl.js +101 -22
- package/dist/templates/workflows/pr-title-check.yml.tpl.js.map +1 -1
- package/dist/templates/workflows/shared/index.d.ts +4 -2
- package/dist/templates/workflows/shared/index.d.ts.map +1 -1
- package/dist/templates/workflows/shared/index.js +4 -2
- package/dist/templates/workflows/shared/index.js.map +1 -1
- package/dist/templates/workflows/shared/managed-workflow.d.ts +32 -0
- package/dist/templates/workflows/shared/managed-workflow.d.ts.map +1 -0
- package/dist/templates/workflows/shared/managed-workflow.js +51 -0
- package/dist/templates/workflows/shared/managed-workflow.js.map +1 -0
- package/dist/templates/workflows/shared/operations-changes.d.ts +13 -3
- package/dist/templates/workflows/shared/operations-changes.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-changes.js +42 -16
- package/dist/templates/workflows/shared/operations-changes.js.map +1 -1
- package/dist/templates/workflows/shared/operations-domain-jobs.d.ts +18 -1
- package/dist/templates/workflows/shared/operations-domain-jobs.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-domain-jobs.js +142 -17
- package/dist/templates/workflows/shared/operations-domain-jobs.js.map +1 -1
- package/dist/templates/workflows/shared/operations-gate.d.ts +6 -0
- package/dist/templates/workflows/shared/operations-gate.d.ts.map +1 -0
- package/dist/templates/workflows/shared/operations-gate.js +116 -0
- package/dist/templates/workflows/shared/operations-gate.js.map +1 -0
- package/dist/templates/workflows/shared/operations-header.d.ts +11 -1
- package/dist/templates/workflows/shared/operations-header.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-header.js +66 -7
- package/dist/templates/workflows/shared/operations-header.js.map +1 -1
- package/dist/templates/workflows/shared/operations-tag-promote.d.ts +4 -3
- package/dist/templates/workflows/shared/operations-tag-promote.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-tag-promote.js +144 -33
- package/dist/templates/workflows/shared/operations-tag-promote.js.map +1 -1
- package/dist/templates/workflows/shared/operations-version.d.ts +3 -2
- package/dist/templates/workflows/shared/operations-version.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-version.js +17 -16
- package/dist/templates/workflows/shared/operations-version.js.map +1 -1
- package/dist/templates/yaml-format-utils.d.ts.map +1 -1
- package/dist/templates/yaml-format-utils.js +1 -5
- package/dist/templates/yaml-format-utils.js.map +1 -1
- package/dist/types/index.d.ts +65 -53
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/action-reference.d.ts +73 -0
- package/dist/utils/action-reference.d.ts.map +1 -0
- package/dist/utils/action-reference.js +120 -0
- package/dist/utils/action-reference.js.map +1 -0
- package/dist/utils/ast-path-operations.d.ts +3 -3
- package/dist/utils/ast-path-operations.d.ts.map +1 -1
- package/dist/utils/ast-path-operations.js +58 -17
- package/dist/utils/ast-path-operations.js.map +1 -1
- package/dist/utils/config.d.ts +16 -5
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +69 -12
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/github-setup.d.ts +7 -7
- package/dist/utils/github-setup.d.ts.map +1 -1
- package/dist/utils/github-setup.js +84 -63
- package/dist/utils/github-setup.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/messaging.d.ts +2 -2
- package/dist/utils/messaging.d.ts.map +1 -1
- package/dist/utils/messaging.js +12 -8
- package/dist/utils/messaging.js.map +1 -1
- package/dist/utils/preflight.d.ts +2 -2
- package/dist/utils/preflight.d.ts.map +1 -1
- package/dist/utils/preflight.js +43 -41
- package/dist/utils/preflight.js.map +1 -1
- package/dist/utils/versioning.d.ts +1 -1
- package/dist/utils/versioning.d.ts.map +1 -1
- package/dist/utils/versioning.js +10 -10
- package/dist/utils/versioning.js.map +1 -1
- package/dist/utils/workflow-semantics.d.ts +61 -0
- package/dist/utils/workflow-semantics.d.ts.map +1 -0
- package/dist/utils/workflow-semantics.js +230 -0
- package/dist/utils/workflow-semantics.js.map +1 -0
- package/package.json +12 -4
- package/src/generators/init.tpl.ts +275 -128
- package/src/generators/workflows.tpl.ts +54 -57
- package/dist/templates/actions/detect-changes-nx.yml.tpl.d.ts +0 -32
- package/dist/templates/actions/detect-changes-nx.yml.tpl.d.ts.map +0 -1
- package/dist/templates/actions/detect-changes-nx.yml.tpl.js +0 -227
- package/dist/templates/actions/detect-changes-nx.yml.tpl.js.map +0 -1
- package/dist/templates/workflows/pipeline-nx.yml.tpl.d.ts +0 -22
- package/dist/templates/workflows/pipeline-nx.yml.tpl.d.ts.map +0 -1
- package/dist/templates/workflows/pipeline-nx.yml.tpl.js +0 -196
- package/dist/templates/workflows/pipeline-nx.yml.tpl.js.map +0 -1
- package/dist/utils/idempotency.d.ts +0 -187
- package/dist/utils/idempotency.d.ts.map +0 -1
- package/dist/utils/idempotency.js +0 -304
- 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
|
|
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
|
|
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 {
|
|
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
|
-
|
|
52
|
+
autoPromote: {
|
|
54
53
|
staging: true,
|
|
55
54
|
main: true
|
|
56
55
|
},
|
|
57
56
|
semver: {
|
|
58
57
|
bumpRules: {
|
|
59
|
-
|
|
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
|
|
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
|
-
*
|
|
90
|
-
*
|
|
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
|
-
* @
|
|
93
|
-
*
|
|
102
|
+
* @param {any} config - The configuration object to serialize
|
|
103
|
+
* @returns {string} YAML string with comments
|
|
94
104
|
*/
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
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
|
-
//
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
|
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
|
|
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] || [
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
//
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
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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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
|
-
* //
|
|
34
|
-
* //
|
|
35
|
-
* //
|
|
36
|
-
* //
|
|
37
|
-
* //
|
|
38
|
-
* //
|
|
39
|
-
* //
|
|
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
|
|
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,
|
|
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
|
-
* //
|
|
34
|
-
* //
|
|
35
|
-
* //
|
|
36
|
-
* //
|
|
37
|
-
* //
|
|
38
|
-
* //
|
|
39
|
-
* //
|
|
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 {
|
|
43
|
+
import { existsSync, readFileSync } from 'fs';
|
|
44
44
|
import { parse } from 'yaml';
|
|
45
|
-
import {
|
|
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
|
|
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 {
|
|
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
|
|
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(
|
|
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 {
|
|
148
|
+
return {
|
|
149
|
+
...ctx,
|
|
150
|
+
...defaultConfig,
|
|
151
|
+
...ctx.config,
|
|
152
|
+
...ctx,
|
|
153
|
+
existingPipeline,
|
|
154
|
+
existingPipelineContent,
|
|
155
|
+
outputPipelinePath: ctx.outputPipelinePath
|
|
156
|
+
};
|
|
151
157
|
})
|
|
152
|
-
.then(
|
|
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(
|
|
171
|
-
// Generate the main pipeline (
|
|
172
|
-
|
|
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(
|
|
177
|
+
.then(ctx => {
|
|
181
178
|
// Generate the enforce PR target workflow
|
|
182
179
|
return generateEnforcePRTarget(ctx);
|
|
183
180
|
})
|
|
184
|
-
.then(
|
|
181
|
+
.then(ctx => {
|
|
185
182
|
// Generate the PR title check workflow
|
|
186
183
|
return generatePRTitleCheck(ctx);
|
|
187
184
|
})
|
|
188
|
-
.then(
|
|
185
|
+
.then(ctx => {
|
|
189
186
|
logger.success('✅ Generated workflows in: .github/workflows');
|
|
190
187
|
return ctx;
|
|
191
188
|
});
|