pipecraft 0.36.2 → 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 +30 -20
- package/dist/cli/index.js +4 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/init.tpl.d.ts.map +1 -1
- package/dist/generators/init.tpl.js +7 -128
- package/dist/generators/init.tpl.js.map +1 -1
- package/dist/generators/workflows.tpl.d.ts.map +1 -1
- package/dist/generators/workflows.tpl.js +3 -15
- package/dist/generators/workflows.tpl.js.map +1 -1
- package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/calculate-version.yml.tpl.js +38 -19
- package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -1
- package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/create-pr.yml.tpl.js +9 -6
- package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -1
- package/dist/templates/actions/create-release.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/create-release.yml.tpl.js +11 -9
- package/dist/templates/actions/create-release.yml.tpl.js.map +1 -1
- package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/create-tag.yml.tpl.js +8 -7
- package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -1
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts +7 -13
- package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/detect-changes.yml.tpl.js +62 -215
- package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -1
- package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/manage-branch.yml.tpl.js +8 -7
- package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -1
- package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -1
- package/dist/templates/actions/promote-branch.yml.tpl.js +25 -29
- package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -1
- package/dist/templates/release-it.cjs.tpl.d.ts.map +1 -1
- package/dist/templates/release-it.cjs.tpl.js +14 -3
- package/dist/templates/release-it.cjs.tpl.js.map +1 -1
- package/dist/templates/workflows/pipeline.yml.tpl.d.ts.map +1 -1
- package/dist/templates/workflows/pipeline.yml.tpl.js +28 -48
- package/dist/templates/workflows/pipeline.yml.tpl.js.map +1 -1
- package/dist/templates/workflows/shared/index.d.ts +1 -0
- package/dist/templates/workflows/shared/index.d.ts.map +1 -1
- package/dist/templates/workflows/shared/index.js +1 -0
- 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 +0 -1
- package/dist/templates/workflows/shared/operations-changes.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-changes.js +1 -6
- package/dist/templates/workflows/shared/operations-changes.js.map +1 -1
- package/dist/templates/workflows/shared/operations-gate.d.ts +4 -30
- package/dist/templates/workflows/shared/operations-gate.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-gate.js +110 -71
- package/dist/templates/workflows/shared/operations-gate.js.map +1 -1
- package/dist/templates/workflows/shared/operations-header.d.ts +10 -0
- package/dist/templates/workflows/shared/operations-header.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-header.js +22 -3
- package/dist/templates/workflows/shared/operations-header.js.map +1 -1
- package/dist/templates/workflows/shared/operations-tag-promote.d.ts +1 -4
- package/dist/templates/workflows/shared/operations-tag-promote.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-tag-promote.js +21 -17
- package/dist/templates/workflows/shared/operations-tag-promote.js.map +1 -1
- package/dist/templates/workflows/shared/operations-version.d.ts +0 -1
- package/dist/templates/workflows/shared/operations-version.d.ts.map +1 -1
- package/dist/templates/workflows/shared/operations-version.js +4 -11
- 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 +16 -57
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/action-reference.d.ts +1 -1
- package/dist/utils/action-reference.js +2 -2
- package/dist/utils/action-reference.js.map +1 -1
- package/dist/utils/config.d.ts +5 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +36 -4
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/github-setup.d.ts +4 -4
- package/dist/utils/github-setup.js +28 -28
- package/dist/utils/github-setup.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 +5 -5
- package/dist/utils/messaging.js.map +1 -1
- package/dist/utils/preflight.js +2 -2
- package/dist/utils/preflight.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 +6 -5
- package/src/generators/init.tpl.ts +7 -132
- package/src/generators/workflows.tpl.ts +3 -15
- package/dist/templates/actions/run-nx-affected.yml.tpl.d.ts +0 -33
- package/dist/templates/actions/run-nx-affected.yml.tpl.d.ts.map +0 -1
- package/dist/templates/actions/run-nx-affected.yml.tpl.js +0 -346
- package/dist/templates/actions/run-nx-affected.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 -403
- package/dist/templates/workflows/pipeline-nx.yml.tpl.js.map +0 -1
|
@@ -1,403 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nx Pipeline Template
|
|
3
|
-
*
|
|
4
|
-
* Generates an Nx-optimized workflow that uses `nx affected` to intelligently test
|
|
5
|
-
* only changed projects. Runs all Nx tasks sequentially in a single job, leveraging
|
|
6
|
-
* Nx's built-in caching and parallel execution.
|
|
7
|
-
*
|
|
8
|
-
* This is Option 1 (Sequential Strategy) - simple, fast, and leverages Nx's intelligence.
|
|
9
|
-
*/
|
|
10
|
-
import { renderTemplate, toFile } from '@featherscloud/pinion';
|
|
11
|
-
import fs from 'fs';
|
|
12
|
-
import { parseDocument, Scalar, stringify } from 'yaml';
|
|
13
|
-
import { applyPathOperations, createValueFromString } from '../../utils/ast-path-operations.js';
|
|
14
|
-
import { logger } from '../../utils/logger.js';
|
|
15
|
-
import { formatIfConditions } from '../yaml-format-utils.js';
|
|
16
|
-
import { createChangesJobOperation, createGateJobOperation, createHeaderOperations, createTagPromoteReleaseOperations, createVersionJobOperation, getDomainJobNames } from './shared/index.js';
|
|
17
|
-
/**
|
|
18
|
-
* Extract user-customized section between markers from YAML content
|
|
19
|
-
* Returns content WITHOUT the markers themselves
|
|
20
|
-
* Uses unique delimiters as YAML comments (indentation-independent)
|
|
21
|
-
*/
|
|
22
|
-
function extractUserSection(yamlContent) {
|
|
23
|
-
// Match markers as YAML comments: any leading whitespace + one or more # + optional whitespace + marker
|
|
24
|
-
// Example: " ### <--START CUSTOM JOBS-->"
|
|
25
|
-
const startMarkerRegex = /^.*#+\s*<--START CUSTOM JOBS-->\s*$/m;
|
|
26
|
-
const endMarkerRegex = /^.*#+\s*<--END CUSTOM JOBS-->\s*$/m;
|
|
27
|
-
const startMatch = yamlContent.match(startMarkerRegex);
|
|
28
|
-
const endMatch = yamlContent.match(endMarkerRegex);
|
|
29
|
-
if (!startMatch || !endMatch) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const startIndex = startMatch.index + startMatch[0].length;
|
|
33
|
-
const endIndex = endMatch.index;
|
|
34
|
-
// Extract content between markers (NOT including the markers themselves)
|
|
35
|
-
let extracted = yamlContent.substring(startIndex, endIndex);
|
|
36
|
-
// Normalize whitespace: remove leading/trailing newlines
|
|
37
|
-
// These will be added back consistently during insertion
|
|
38
|
-
extracted = extracted.replace(/^\n+/, '');
|
|
39
|
-
extracted = extracted.replace(/\n+$/, '');
|
|
40
|
-
return extracted;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Create the test-nx job operation (Nx-specific)
|
|
44
|
-
*/
|
|
45
|
-
function createTestNxJobOperation(ctx) {
|
|
46
|
-
const { config } = ctx;
|
|
47
|
-
const nxConfig = config.nx;
|
|
48
|
-
const packageManager = config.packageManager || 'npm';
|
|
49
|
-
const enableCache = nxConfig.enableCache !== false;
|
|
50
|
-
const targets = nxConfig.tasks.join(',');
|
|
51
|
-
// Build the job steps
|
|
52
|
-
const cacheStep = enableCache
|
|
53
|
-
? `
|
|
54
|
-
- name: Cache Nx
|
|
55
|
-
uses: actions/cache@v4
|
|
56
|
-
with:
|
|
57
|
-
path: .nx/cache
|
|
58
|
-
key: \${{ runner.os }}-nx-\${{ hashFiles('**/nx.json', '**/.nxignore', '**/package-lock.json', '**/pnpm-lock.yaml', '**/yarn.lock') }}
|
|
59
|
-
restore-keys: |
|
|
60
|
-
\${{ runner.os }}-nx-`
|
|
61
|
-
: '';
|
|
62
|
-
// Build individual task steps
|
|
63
|
-
const taskSteps = nxConfig.tasks
|
|
64
|
-
.map(target => `
|
|
65
|
-
- name: Run nx affected --target=${target}
|
|
66
|
-
run: |
|
|
67
|
-
npx nx affected --target=${target} --base=\${{ inputs.baseRef || '${nxConfig.baseRef || 'origin/main'}' }} || echo "No affected projects"`)
|
|
68
|
-
.join('');
|
|
69
|
-
return {
|
|
70
|
-
path: 'jobs.test-nx',
|
|
71
|
-
operation: 'preserve', // User can customize this job!
|
|
72
|
-
commentBefore: `
|
|
73
|
-
=============================================================================
|
|
74
|
-
TEST-NX ( ✅ Customize these with your test logic)
|
|
75
|
-
=============================================================================
|
|
76
|
-
This job runs all Nx tasks sequentially using \`nx affected\`.
|
|
77
|
-
Nx handles dependency detection, caching, and parallel execution internally.
|
|
78
|
-
`,
|
|
79
|
-
value: createValueFromString(`
|
|
80
|
-
needs: [ changes ]
|
|
81
|
-
runs-on: ubuntu-latest
|
|
82
|
-
steps:
|
|
83
|
-
- uses: actions/checkout@v4
|
|
84
|
-
with:
|
|
85
|
-
ref: \${{ inputs.commitSha || github.sha }}
|
|
86
|
-
fetch-depth: \${{ env.FETCH_DEPTH_AFFECTED }}
|
|
87
|
-
- name: Setup Node.js
|
|
88
|
-
uses: actions/setup-node@v4
|
|
89
|
-
with:
|
|
90
|
-
node-version: \${{ env.NODE_VERSION }}
|
|
91
|
-
${packageManager === 'pnpm'
|
|
92
|
-
? `
|
|
93
|
-
- name: Setup pnpm
|
|
94
|
-
uses: pnpm/action-setup@v4
|
|
95
|
-
with:
|
|
96
|
-
version: \${{ env.PNPM_VERSION }}
|
|
97
|
-
- name: Install dependencies
|
|
98
|
-
run: pnpm install --frozen-lockfile`
|
|
99
|
-
: packageManager === 'yarn'
|
|
100
|
-
? `
|
|
101
|
-
- name: Install dependencies
|
|
102
|
-
run: yarn install --frozen-lockfile`
|
|
103
|
-
: `
|
|
104
|
-
- name: Install dependencies
|
|
105
|
-
run: npm ci`}
|
|
106
|
-
${cacheStep}${taskSteps}
|
|
107
|
-
`)
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Main generator that handles merging with existing workflow
|
|
112
|
-
*/
|
|
113
|
-
export const generate = (ctx) => Promise.resolve(ctx)
|
|
114
|
-
.then(ctx => {
|
|
115
|
-
const filePath = `${ctx.cwd || process.cwd()}/.github/workflows/pipeline.yml`;
|
|
116
|
-
const { config, branchFlow } = ctx;
|
|
117
|
-
const domains = config.domains || {};
|
|
118
|
-
const nxConfig = config.nx;
|
|
119
|
-
// Get domain job names for dependency management
|
|
120
|
-
const { testJobs, deployJobs, remoteTestJobs } = getDomainJobNames(domains);
|
|
121
|
-
// Build operations array - only managed jobs
|
|
122
|
-
const operations = [
|
|
123
|
-
// Header (name, run-name, on triggers)
|
|
124
|
-
...createHeaderOperations({ branchFlow }),
|
|
125
|
-
// Changes detection (Nx-enabled)
|
|
126
|
-
createChangesJobOperation({
|
|
127
|
-
domains,
|
|
128
|
-
useNx: true,
|
|
129
|
-
baseRef: nxConfig.baseRef || 'origin/main',
|
|
130
|
-
config
|
|
131
|
-
}),
|
|
132
|
-
// Nx test job (runs all Nx tasks)
|
|
133
|
-
createTestNxJobOperation(ctx),
|
|
134
|
-
// Version calculation (depends on test-nx and changes)
|
|
135
|
-
createVersionJobOperation({
|
|
136
|
-
testJobNames: [], // No domain test job dependencies
|
|
137
|
-
nxEnabled: true, // Depends on test-nx job
|
|
138
|
-
baseRef: nxConfig.baseRef || 'origin/main',
|
|
139
|
-
config
|
|
140
|
-
}),
|
|
141
|
-
// Gate job (runs after test-nx, gates downstream jobs)
|
|
142
|
-
createGateJobOperation({
|
|
143
|
-
testJobNames: ['test-nx'], // Gate on the Nx test job
|
|
144
|
-
deployJobNames: [] // Could add deploy jobs here if needed
|
|
145
|
-
}),
|
|
146
|
-
// Tag, promote, release
|
|
147
|
-
...createTagPromoteReleaseOperations({
|
|
148
|
-
branchFlow,
|
|
149
|
-
deployJobNames: [], // No deployment dependencies in new model
|
|
150
|
-
remoteTestJobNames: [],
|
|
151
|
-
testJobNames: ['test-nx'], // For Nx, the single test-nx job is the gate
|
|
152
|
-
autoMerge: typeof config.autoMerge === 'object' ? config.autoMerge : {},
|
|
153
|
-
config
|
|
154
|
-
})
|
|
155
|
-
];
|
|
156
|
-
// Check if file exists
|
|
157
|
-
const fileExists = fs.existsSync(filePath);
|
|
158
|
-
// Extract user-customized section and custom jobs from existing file if it exists
|
|
159
|
-
let userSection = null;
|
|
160
|
-
const customJobsFromExisting = [];
|
|
161
|
-
if (fileExists) {
|
|
162
|
-
const existingContent = fs.readFileSync(filePath, 'utf8');
|
|
163
|
-
userSection = extractUserSection(existingContent);
|
|
164
|
-
if (userSection) {
|
|
165
|
-
logger.verbose('📋 Found user-customized section between markers');
|
|
166
|
-
}
|
|
167
|
-
// Also extract custom jobs (for force mode preservation)
|
|
168
|
-
const existingDoc = parseDocument(existingContent);
|
|
169
|
-
const existingJobs = existingDoc.contents && existingDoc.contents.get
|
|
170
|
-
? existingDoc.contents.get('jobs')
|
|
171
|
-
: null;
|
|
172
|
-
const managedJobs = new Set([
|
|
173
|
-
'changes',
|
|
174
|
-
'version',
|
|
175
|
-
'gate',
|
|
176
|
-
'tag',
|
|
177
|
-
'promote',
|
|
178
|
-
'release',
|
|
179
|
-
'test-nx'
|
|
180
|
-
]);
|
|
181
|
-
if (existingJobs && existingJobs.items) {
|
|
182
|
-
for (const pair of existingJobs.items) {
|
|
183
|
-
const keyStr = pair.key instanceof Scalar ? pair.key.value : pair.key;
|
|
184
|
-
if (!managedJobs.has(keyStr)) {
|
|
185
|
-
customJobsFromExisting.push(pair);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
if (customJobsFromExisting.length > 0) {
|
|
190
|
-
logger.verbose(`📋 Found ${customJobsFromExisting.length} custom job(s) to preserve`);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
// In force mode or new file, create fresh document to ensure correct structure
|
|
194
|
-
if (!fileExists || ctx.pinion?.force) {
|
|
195
|
-
const logMessage = !fileExists
|
|
196
|
-
? '📝 Creating new Nx pipeline'
|
|
197
|
-
: '🔄 Force mode: Rebuilding Nx pipeline from scratch';
|
|
198
|
-
logger.verbose(logMessage);
|
|
199
|
-
// Create new document with empty YAML map
|
|
200
|
-
const doc = parseDocument('{}');
|
|
201
|
-
// Ensure the root map uses block style (not flow/compact)
|
|
202
|
-
if (doc.contents && doc.contents.flow !== undefined) {
|
|
203
|
-
;
|
|
204
|
-
doc.contents.flow = false;
|
|
205
|
-
}
|
|
206
|
-
// Add header comment block to document
|
|
207
|
-
const headerComment = `=============================================================================
|
|
208
|
-
PIPECRAFT MANAGED WORKFLOW
|
|
209
|
-
=============================================================================
|
|
210
|
-
|
|
211
|
-
✅ YOU CAN CUSTOMIZE:
|
|
212
|
-
- Custom jobs between the '# <--START CUSTOM JOBS-->' and '# <--END CUSTOM JOBS-->' comment markers
|
|
213
|
-
- Workflow name
|
|
214
|
-
|
|
215
|
-
⚠️ PIPECRAFT MANAGES (do not modify):
|
|
216
|
-
- Workflow triggers, job dependencies, and conditionals
|
|
217
|
-
- Changes detection, version calculation, and tag creation
|
|
218
|
-
- CreatePR, branch management, promote, and release jobs
|
|
219
|
-
|
|
220
|
-
📌 VERSION PROMOTION BEHAVIOR:
|
|
221
|
-
- Only commits that trigger a version bump will promote to staging/main
|
|
222
|
-
- Non-versioned commits (test, build, etc.) remain on develop
|
|
223
|
-
- This keeps staging/main aligned with tagged releases
|
|
224
|
-
|
|
225
|
-
Running 'pipecraft generate' updates managed sections while preserving
|
|
226
|
-
your customizations in test/deploy/smoke-test etc jobs.
|
|
227
|
-
|
|
228
|
-
📖 Learn more: https://pipecraft.thecraftlab.dev
|
|
229
|
-
=============================================================================`;
|
|
230
|
-
doc.commentBefore = headerComment;
|
|
231
|
-
if (doc.contents) {
|
|
232
|
-
applyPathOperations(doc.contents, operations, doc);
|
|
233
|
-
}
|
|
234
|
-
let yamlContent = stringify(doc, {
|
|
235
|
-
lineWidth: 0, // 0 means no line width limit for scalars
|
|
236
|
-
indent: 2,
|
|
237
|
-
defaultStringType: 'PLAIN',
|
|
238
|
-
defaultKeyType: 'PLAIN',
|
|
239
|
-
minContentWidth: 0
|
|
240
|
-
});
|
|
241
|
-
// Insert user section and custom jobs after version job if they exist
|
|
242
|
-
const hasCustomContent = userSection || customJobsFromExisting.length > 0;
|
|
243
|
-
if (hasCustomContent) {
|
|
244
|
-
// Find the insertion point (after version job outputs)
|
|
245
|
-
const versionOutputsPattern = /^ {2}version:\s*\n(?:.*\n)*? {4}outputs:\s*\n\s*version:.*$/m;
|
|
246
|
-
const match = yamlContent.match(versionOutputsPattern);
|
|
247
|
-
if (match) {
|
|
248
|
-
const insertionIndex = match.index + match[0].length;
|
|
249
|
-
let contentToInsert = '';
|
|
250
|
-
// Add user section if exists
|
|
251
|
-
if (userSection) {
|
|
252
|
-
contentToInsert += `# <--START CUSTOM JOBS-->\n\n${userSection}\n\n # <--END CUSTOM JOBS-->`;
|
|
253
|
-
}
|
|
254
|
-
// Add custom jobs if they exist (and weren't in user section)
|
|
255
|
-
if (customJobsFromExisting.length > 0 && !userSection) {
|
|
256
|
-
const customJobsYaml = customJobsFromExisting
|
|
257
|
-
.map(pair => {
|
|
258
|
-
const keyStr = pair.key instanceof Scalar ? pair.key.value : pair.key;
|
|
259
|
-
const valueYaml = stringify(pair.value, { indent: 2 });
|
|
260
|
-
return ` ${keyStr}:\n${valueYaml
|
|
261
|
-
.split('\n')
|
|
262
|
-
.map((line) => (line ? ' ' + line : line))
|
|
263
|
-
.join('\n')}`;
|
|
264
|
-
})
|
|
265
|
-
.join('\n\n');
|
|
266
|
-
contentToInsert = `# <--START CUSTOM JOBS-->\n\n${customJobsYaml}\n\n # <--END CUSTOM JOBS-->`;
|
|
267
|
-
}
|
|
268
|
-
if (contentToInsert) {
|
|
269
|
-
yamlContent =
|
|
270
|
-
yamlContent.slice(0, insertionIndex) +
|
|
271
|
-
'\n\n ' +
|
|
272
|
-
contentToInsert +
|
|
273
|
-
'\n' +
|
|
274
|
-
yamlContent.slice(insertionIndex);
|
|
275
|
-
logger.verbose('📋 Inserted user-customized section after version job');
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
logger.verbose('⚠️ Could not find version job outputs, appending user section at end');
|
|
280
|
-
const contentToInsert = userSection ||
|
|
281
|
-
(customJobsFromExisting.length > 0
|
|
282
|
-
? customJobsFromExisting
|
|
283
|
-
.map(pair => {
|
|
284
|
-
const keyStr = pair.key instanceof Scalar ? pair.key.value : pair.key;
|
|
285
|
-
const valueYaml = stringify(pair.value, { indent: 2 });
|
|
286
|
-
return ` ${keyStr}:\n${valueYaml
|
|
287
|
-
.split('\n')
|
|
288
|
-
.map((line) => (line ? ' ' + line : line))
|
|
289
|
-
.join('\n')}`;
|
|
290
|
-
})
|
|
291
|
-
.join('\n\n')
|
|
292
|
-
: '');
|
|
293
|
-
const userSectionWithMarkers = `# <--START CUSTOM JOBS-->\n\n${contentToInsert}\n\n # <--END CUSTOM JOBS-->`;
|
|
294
|
-
yamlContent = yamlContent + '\n\n ' + userSectionWithMarkers;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
else if (!fileExists) {
|
|
298
|
-
// For new files, add placeholder markers
|
|
299
|
-
const versionOutputsPattern = /^( {2}version:\s*\n(?:.*\n)*? {4}outputs:\s*\n\s*version:.*)$/m;
|
|
300
|
-
yamlContent = yamlContent.replace(versionOutputsPattern, '$1\n\n # <--START CUSTOM JOBS-->\n\n # <--END CUSTOM JOBS-->\n');
|
|
301
|
-
logger.verbose('📝 Added placeholder user section markers');
|
|
302
|
-
}
|
|
303
|
-
const formattedContent = formatIfConditions(yamlContent);
|
|
304
|
-
const status = hasCustomContent ? 'merged' : fileExists ? 'rebuilt' : 'created';
|
|
305
|
-
return { ...ctx, yamlContent: formattedContent, mergeStatus: status };
|
|
306
|
-
}
|
|
307
|
-
// Parse existing file for merge mode (no force flag)
|
|
308
|
-
const existingContent = fs.readFileSync(filePath, 'utf8');
|
|
309
|
-
const doc = parseDocument(existingContent);
|
|
310
|
-
// Get managed jobs (always overwritten)
|
|
311
|
-
const managedJobs = new Set(['changes', 'version', 'tag', 'promote', 'release', 'test-nx']);
|
|
312
|
-
// test-nx is preserved (user can customize), but still managed if it doesn't exist
|
|
313
|
-
// Extract custom jobs (not managed and not in user section between markers)
|
|
314
|
-
const existingJobs = doc.contents && doc.contents.get ? doc.contents.get('jobs') : null;
|
|
315
|
-
const customJobs = [];
|
|
316
|
-
if (existingJobs && existingJobs.items) {
|
|
317
|
-
// Preserve jobs that are not managed
|
|
318
|
-
for (const pair of existingJobs.items) {
|
|
319
|
-
const keyStr = pair.key instanceof Scalar ? pair.key.value : pair.key;
|
|
320
|
-
if (!managedJobs.has(keyStr)) {
|
|
321
|
-
customJobs.push(pair);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
// Clear all jobs before applying operations to prevent duplicates
|
|
325
|
-
;
|
|
326
|
-
existingJobs.items = [];
|
|
327
|
-
}
|
|
328
|
-
// Apply operations to update managed jobs
|
|
329
|
-
if (doc.contents) {
|
|
330
|
-
applyPathOperations(doc.contents, operations, doc);
|
|
331
|
-
}
|
|
332
|
-
// Reinsert custom jobs (preserved from existing pipeline)
|
|
333
|
-
if (existingJobs && customJobs.length > 0) {
|
|
334
|
-
for (const customPair of customJobs) {
|
|
335
|
-
existingJobs.add(customPair);
|
|
336
|
-
}
|
|
337
|
-
logger.verbose(`📋 Preserved ${customJobs.length} custom job(s) from existing pipeline`);
|
|
338
|
-
}
|
|
339
|
-
let yamlContent = stringify(doc, {
|
|
340
|
-
lineWidth: 0,
|
|
341
|
-
indent: 2,
|
|
342
|
-
defaultStringType: 'PLAIN',
|
|
343
|
-
defaultKeyType: 'PLAIN',
|
|
344
|
-
minContentWidth: 0
|
|
345
|
-
});
|
|
346
|
-
// Insert user section after version job if it exists
|
|
347
|
-
if (userSection) {
|
|
348
|
-
const versionOutputsPattern = /^ {2}version:\s*\n(?:.*\n)*? {4}outputs:\s*\n\s*version:.*$/m;
|
|
349
|
-
const match = yamlContent.match(versionOutputsPattern);
|
|
350
|
-
if (match) {
|
|
351
|
-
const insertionIndex = match.index + match[0].length;
|
|
352
|
-
const userSectionWithMarkers = `# <--START CUSTOM JOBS-->\n\n${userSection}\n\n # <--END CUSTOM JOBS-->`;
|
|
353
|
-
yamlContent =
|
|
354
|
-
yamlContent.slice(0, insertionIndex) +
|
|
355
|
-
'\n\n ' +
|
|
356
|
-
userSectionWithMarkers +
|
|
357
|
-
'\n' +
|
|
358
|
-
yamlContent.slice(insertionIndex);
|
|
359
|
-
logger.verbose('📋 Inserted user-customized section after version job');
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
// Also insert custom jobs that weren't in the user section
|
|
363
|
-
if (customJobs.length > 0 && !userSection) {
|
|
364
|
-
const versionOutputsPattern = /^ {2}version:\s*\n(?:.*\n)*? {4}outputs:\s*\n\s*version:.*$/m;
|
|
365
|
-
const match = yamlContent.match(versionOutputsPattern);
|
|
366
|
-
if (match) {
|
|
367
|
-
const insertionIndex = match.index + match[0].length;
|
|
368
|
-
const customJobsYaml = customJobs
|
|
369
|
-
.map(pair => {
|
|
370
|
-
const keyStr = pair.key instanceof Scalar ? pair.key.value : pair.key;
|
|
371
|
-
const valueYaml = stringify(pair.value, { indent: 2 });
|
|
372
|
-
return ` ${keyStr}:\n${valueYaml
|
|
373
|
-
.split('\n')
|
|
374
|
-
.map((line) => (line ? ' ' + line : line))
|
|
375
|
-
.join('\n')}`;
|
|
376
|
-
})
|
|
377
|
-
.join('\n\n');
|
|
378
|
-
yamlContent =
|
|
379
|
-
yamlContent.slice(0, insertionIndex) +
|
|
380
|
-
'\n\n # <--START CUSTOM JOBS-->\n\n' +
|
|
381
|
-
customJobsYaml +
|
|
382
|
-
'\n\n # <--END CUSTOM JOBS-->\n' +
|
|
383
|
-
yamlContent.slice(insertionIndex);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
const status = userSection || customJobs.length > 0 ? 'merged' : 'updated';
|
|
387
|
-
const formattedContent = formatIfConditions(yamlContent);
|
|
388
|
-
return { ...ctx, yamlContent: formattedContent, mergeStatus: status };
|
|
389
|
-
})
|
|
390
|
-
.then(ctx => {
|
|
391
|
-
const outputPath = ctx.outputPipelinePath || '.github/workflows/pipeline.yml';
|
|
392
|
-
const status = ctx.mergeStatus === 'merged'
|
|
393
|
-
? '🔄 Merged with existing'
|
|
394
|
-
: ctx.mergeStatus === 'updated'
|
|
395
|
-
? '🔄 Updated existing'
|
|
396
|
-
: ctx.mergeStatus === 'rebuilt'
|
|
397
|
-
? '🔄 Rebuilt from scratch'
|
|
398
|
-
: '📝 Created new';
|
|
399
|
-
logger.verbose(`${status} ${outputPath}`);
|
|
400
|
-
return ctx;
|
|
401
|
-
})
|
|
402
|
-
.then(renderTemplate((ctx) => ctx.yamlContent, toFile((ctx) => ctx.outputPipelinePath || '.github/workflows/pipeline.yml')));
|
|
403
|
-
//# sourceMappingURL=pipeline-nx.yml.tpl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-nx.yml.tpl.js","sourceRoot":"","sources":["../../../src/templates/workflows/pipeline-nx.yml.tpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAClF,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEvD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EAEtB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EACL,yBAAyB,EAIzB,sBAAsB,EACtB,sBAAsB,EACtB,iCAAiC,EACjC,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,mBAAmB,CAAA;AAQ1B;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,WAAmB;IAC7C,wGAAwG;IACxG,2CAA2C;IAC3C,MAAM,gBAAgB,GAAG,sCAAsC,CAAA;IAC/D,MAAM,cAAc,GAAG,oCAAoC,CAAA;IAE3D,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;IACtD,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IAElD,IAAI,CAAC,UAAU,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