pipecraft 0.36.2 → 0.36.15
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-gate.d.ts","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-gate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"operations-gate.d.ts","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkC,MAAM,MAAM,CAAA;AAmE/D,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,CAAA;CACf;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,iBAAiB,QA0E7E"}
|
|
@@ -1,77 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Creates a gate job that enforces "at least one success AND no failures" pattern
|
|
5
|
-
* for all test jobs. This provides a single point of control for gating downstream
|
|
6
|
-
* jobs like tag, promote, and deploy.
|
|
7
|
-
*/
|
|
8
|
-
import { createValueFromString } from '../../../utils/ast-path-operations.js';
|
|
9
|
-
/**
|
|
10
|
-
* Create a gate job operation that runs after all test jobs
|
|
11
|
-
*
|
|
12
|
-
* The gate job:
|
|
13
|
-
* - Runs on ALL events (PRs, push to any branch)
|
|
14
|
-
* - Depends on all test jobs
|
|
15
|
-
* - Uses "at least one success AND no failures" pattern
|
|
16
|
-
* - Provides a single gate point for downstream jobs (tag, deploy, etc.)
|
|
17
|
-
* - Always runs (even if tests are skipped) using always()
|
|
18
|
-
*
|
|
19
|
-
* @param ctx - Context containing test job names
|
|
20
|
-
* @returns Path operation config for the gate job
|
|
21
|
-
*/
|
|
22
|
-
export function createGateJobOperation(ctx) {
|
|
23
|
-
const { testJobNames, deployJobNames = [], allJobsByPrefix = {} } = ctx;
|
|
24
|
-
// Collect all jobs from all prefixes
|
|
25
|
-
const allPrefixJobs = Object.values(allJobsByPrefix).flat();
|
|
26
|
-
// Combine test jobs, deploy jobs, and all prefix-based jobs
|
|
27
|
-
// Use Set to deduplicate (test/deploy jobs might also be in allJobsByPrefix)
|
|
28
|
-
const allGateJobs = Array.from(new Set([...testJobNames, ...deployJobNames, ...allPrefixJobs]));
|
|
29
|
-
if (allGateJobs.length === 0) {
|
|
30
|
-
// No jobs to gate - return a minimal gate that always succeeds
|
|
31
|
-
return {
|
|
32
|
-
path: 'jobs.gate',
|
|
33
|
-
operation: 'overwrite',
|
|
34
|
-
spaceBefore: true,
|
|
35
|
-
commentBefore: `
|
|
1
|
+
import { Pair, Scalar, YAMLMap, YAMLSeq } from 'yaml';
|
|
2
|
+
import { logger } from '../../../utils/logger.js';
|
|
3
|
+
const GATE_COMMENT = `
|
|
36
4
|
=============================================================================
|
|
37
5
|
GATE (⚠️ Managed by Pipecraft - do not modify)
|
|
38
6
|
=============================================================================
|
|
39
|
-
Gate job that ensures
|
|
40
|
-
Uses pattern:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
7
|
+
Gate job that ensures prior jobs succeed before allowing tag/promote/release.
|
|
8
|
+
Uses pattern: allow only SUCCESS or SKIPPED results (failures block progression).
|
|
9
|
+
`;
|
|
10
|
+
const DEFAULT_GATE_STEP_RUN = 'echo "All prerequisite jobs succeeded or were skipped - gate allows progression"';
|
|
11
|
+
function toKeyString(key) {
|
|
12
|
+
if (key instanceof Scalar) {
|
|
13
|
+
return typeof key.value === 'string' ? key.value : String(key.value);
|
|
14
|
+
}
|
|
15
|
+
return String(key);
|
|
16
|
+
}
|
|
17
|
+
function buildNeedsSequence(jobNames) {
|
|
18
|
+
const seq = new YAMLSeq();
|
|
19
|
+
seq.items = jobNames.map(name => new Scalar(name));
|
|
20
|
+
return seq;
|
|
21
|
+
}
|
|
22
|
+
function buildIfExpression(jobNames) {
|
|
23
|
+
const clauses = jobNames.map(name => `(needs['${name}'].result == 'success' || needs['${name}'].result == 'skipped')`);
|
|
24
|
+
const expression = clauses.length > 0 ? `always() && ${clauses.join(' && ')}` : 'always()';
|
|
25
|
+
const scalar = new Scalar(`\${{ ${expression} }}`);
|
|
26
|
+
scalar.type = Scalar.QUOTE_DOUBLE;
|
|
27
|
+
return scalar;
|
|
28
|
+
}
|
|
29
|
+
function ensureDefaultRunsAndSteps(gateMap) {
|
|
30
|
+
if (!gateMap.has('runs-on')) {
|
|
31
|
+
gateMap.set('runs-on', new Scalar('ubuntu-latest'));
|
|
32
|
+
}
|
|
33
|
+
if (!gateMap.has('steps')) {
|
|
34
|
+
const stepsSeq = new YAMLSeq();
|
|
35
|
+
const stepMap = new YAMLMap();
|
|
36
|
+
stepMap.set('name', new Scalar('Gate passed'));
|
|
37
|
+
stepMap.set('run', new Scalar(DEFAULT_GATE_STEP_RUN));
|
|
38
|
+
stepsSeq.items = [stepMap];
|
|
39
|
+
gateMap.set('steps', stepsSeq);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function dedupePreserveOrder(values) {
|
|
43
|
+
const seen = new Set();
|
|
44
|
+
const result = [];
|
|
45
|
+
for (const value of values) {
|
|
46
|
+
if (!seen.has(value)) {
|
|
47
|
+
seen.add(value);
|
|
48
|
+
result.push(value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
export function ensureGateJob(doc, options) {
|
|
54
|
+
const { force } = options;
|
|
55
|
+
const root = doc.contents;
|
|
56
|
+
if (!(root instanceof YAMLMap)) {
|
|
57
|
+
logger.warn('⚠️ Unable to update gate job - root YAML node is not a map');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
let jobsNode = root.get('jobs');
|
|
61
|
+
if (!(jobsNode instanceof YAMLMap)) {
|
|
62
|
+
jobsNode = new YAMLMap();
|
|
63
|
+
const jobsPair = new Pair(new Scalar('jobs'), jobsNode);
|
|
64
|
+
root.items.push(jobsPair);
|
|
65
|
+
}
|
|
66
|
+
const items = jobsNode.items;
|
|
67
|
+
const gateIndex = items.findIndex(pair => toKeyString(pair.key) === 'gate');
|
|
68
|
+
const tagIndex = items.findIndex(pair => toKeyString(pair.key) === 'tag');
|
|
69
|
+
let gatePair;
|
|
70
|
+
const gateExisted = gateIndex !== -1;
|
|
71
|
+
if (gateExisted) {
|
|
72
|
+
gatePair = items[gateIndex];
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
const insertionIndex = tagIndex !== -1 ? tagIndex : items.length;
|
|
76
|
+
gatePair = new Pair(new Scalar('gate'), new YAMLMap());
|
|
77
|
+
gatePair.spaceBefore = true;
|
|
78
|
+
gatePair.commentBefore = GATE_COMMENT.trimEnd();
|
|
79
|
+
items.splice(insertionIndex, 0, gatePair);
|
|
80
|
+
}
|
|
81
|
+
const currentIndex = items.indexOf(gatePair);
|
|
82
|
+
const priorJobs = items.slice(0, currentIndex);
|
|
83
|
+
// Filter out disabled jobs (those with if: false or if: ${{ false }})
|
|
84
|
+
const enabledPriorJobs = priorJobs.filter(pair => {
|
|
85
|
+
const jobMap = pair.value;
|
|
86
|
+
if (!(jobMap instanceof YAMLMap))
|
|
87
|
+
return false;
|
|
88
|
+
const ifCondition = jobMap.get('if');
|
|
89
|
+
if (!ifCondition)
|
|
90
|
+
return true; // No condition means enabled
|
|
91
|
+
// Check if explicitly disabled
|
|
92
|
+
const ifValue = ifCondition instanceof Scalar ? String(ifCondition.value).trim() : String(ifCondition).trim();
|
|
93
|
+
return ifValue !== 'false' && ifValue !== '${{ false }}';
|
|
94
|
+
});
|
|
95
|
+
const priorJobKeys = enabledPriorJobs.map(pair => toKeyString(pair.key));
|
|
96
|
+
const prerequisites = dedupePreserveOrder(priorJobKeys);
|
|
97
|
+
let gateMap = gatePair.value;
|
|
98
|
+
if (!(gateMap instanceof YAMLMap)) {
|
|
99
|
+
gateMap = new YAMLMap();
|
|
100
|
+
gatePair.value = gateMap;
|
|
101
|
+
}
|
|
102
|
+
if (!gatePair.commentBefore) {
|
|
103
|
+
;
|
|
104
|
+
gatePair.commentBefore = GATE_COMMENT.trimEnd();
|
|
105
|
+
}
|
|
106
|
+
if (!gateExisted) {
|
|
107
|
+
ensureDefaultRunsAndSteps(gateMap);
|
|
108
|
+
}
|
|
109
|
+
const shouldUpdateControlFields = force || !gateExisted;
|
|
110
|
+
if (shouldUpdateControlFields) {
|
|
111
|
+
;
|
|
112
|
+
gateMap.set('needs', buildNeedsSequence(prerequisites));
|
|
113
|
+
gateMap.set('if', buildIfExpression(prerequisites));
|
|
51
114
|
}
|
|
52
|
-
// Build the "at least one success AND no failures" condition
|
|
53
|
-
const noFailures = allGateJobs.map(job => `needs.${job}.result != 'failure'`).join(' && ');
|
|
54
|
-
const atLeastOneSuccess = allGateJobs.map(job => `needs.${job}.result == 'success'`).join(' || ');
|
|
55
|
-
const gateCondition = `always() && needs.version.result == 'success' && (${noFailures}) && (${atLeastOneSuccess})`;
|
|
56
|
-
return {
|
|
57
|
-
path: 'jobs.gate',
|
|
58
|
-
operation: 'overwrite',
|
|
59
|
-
spaceBefore: true,
|
|
60
|
-
commentBefore: `
|
|
61
|
-
=============================================================================
|
|
62
|
-
GATE (⚠️ Managed by Pipecraft - do not modify)
|
|
63
|
-
=============================================================================
|
|
64
|
-
Gate job that ensures tests pass before allowing tag/promote/deploy.
|
|
65
|
-
Uses pattern: at least ONE success AND NO failures (skipped is OK).
|
|
66
|
-
`,
|
|
67
|
-
value: createValueFromString(`
|
|
68
|
-
needs: [ version, ${allGateJobs.join(', ')} ]
|
|
69
|
-
if: \${{ ${gateCondition} }}
|
|
70
|
-
runs-on: ubuntu-latest
|
|
71
|
-
steps:
|
|
72
|
-
- name: Gate passed
|
|
73
|
-
run: echo "All tests passed - gate allows progression"
|
|
74
|
-
`)
|
|
75
|
-
};
|
|
76
115
|
}
|
|
77
116
|
//# sourceMappingURL=operations-gate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-gate.js","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-gate.ts"],"names":[],"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AAI,CAAC,CAAC,OAAO,YAAY,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;QACvB,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAA;IAC1B,CAAC;IAED,IAAI,CAAE,QAAgB,CAAC,aAAa,EAAE,CAAC;QACrC,CAAC;QAAC,QAAgB,CAAC,aAAa,GAAG,YAAY,CAAC,OAAO,EAAE,CAAA;IAC3D,CAAC;IAED,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,yBAAyB,CAAC,OAAkB,CAAC,CAAA;IAC/C,CAAC;IAED,MAAM,yBAAyB,GAAG,KAAK,IAAI,CAAC,WAAW,CAAA;IAEvD,IAAI,yBAAyB,EAAE,CAAC;QAC9B,CAAC;QAAC,OAAmB,CAAC,GAAG,CAAC,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC,CACpE;QAAC,OAAmB,CAAC,GAAG,CAAC,IAAI,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAA;IACnE,CAAC;AACH,CAAC"}
|
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
import type { PathOperationConfig } from '../../../utils/ast-path-operations.js';
|
|
8
8
|
export interface HeaderContext {
|
|
9
9
|
branchFlow: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Existing node version from the pipeline, if present.
|
|
12
|
+
* Falls back to PipeCraft defaults when not provided.
|
|
13
|
+
*/
|
|
14
|
+
nodeVersion?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Existing pnpm version from the pipeline, if present.
|
|
17
|
+
* Falls back to PipeCraft defaults when not provided.
|
|
18
|
+
*/
|
|
19
|
+
pnpmVersion?: string;
|
|
10
20
|
}
|
|
11
21
|
/**
|
|
12
22
|
* Create workflow header operations (name, run-name, on triggers)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-header.d.ts","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-header.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAEhF,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,aAAa,GAAG,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"operations-header.d.ts","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-header.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAEhF,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,aAAa,GAAG,mBAAmB,EAAE,CA4NhF"}
|
|
@@ -9,10 +9,12 @@ import { Scalar } from 'yaml';
|
|
|
9
9
|
* Create workflow header operations (name, run-name, on triggers)
|
|
10
10
|
*/
|
|
11
11
|
export function createHeaderOperations(ctx) {
|
|
12
|
-
const { branchFlow } = ctx;
|
|
12
|
+
const { branchFlow, nodeVersion, pnpmVersion } = ctx;
|
|
13
13
|
// Provide sensible defaults if branchFlow is invalid
|
|
14
14
|
const validBranchFlow = branchFlow && Array.isArray(branchFlow) && branchFlow.length > 0 ? branchFlow : ['main'];
|
|
15
15
|
const branchList = validBranchFlow.join(',');
|
|
16
|
+
const normalizedNodeVersion = typeof nodeVersion === 'string' && nodeVersion.trim().length > 0 ? nodeVersion.trim() : '22';
|
|
17
|
+
const normalizedPnpmVersion = typeof pnpmVersion === 'string' && pnpmVersion.trim().length > 0 ? pnpmVersion.trim() : '9';
|
|
16
18
|
return [
|
|
17
19
|
// =============================================================================
|
|
18
20
|
// WORKFLOW NAME
|
|
@@ -24,6 +26,23 @@ export function createHeaderOperations(ctx) {
|
|
|
24
26
|
required: true
|
|
25
27
|
},
|
|
26
28
|
// =============================================================================
|
|
29
|
+
// PERMISSIONS - Required for workflow operations
|
|
30
|
+
// =============================================================================
|
|
31
|
+
// contents: write - For creating tags and pushing changes
|
|
32
|
+
// pull-requests: write - For creating pull requests during promotion
|
|
33
|
+
// actions: write - For triggering workflow_dispatch on target branches
|
|
34
|
+
{
|
|
35
|
+
path: 'permissions',
|
|
36
|
+
operation: 'preserve',
|
|
37
|
+
value: {
|
|
38
|
+
contents: 'write',
|
|
39
|
+
'pull-requests': 'write',
|
|
40
|
+
actions: 'write'
|
|
41
|
+
},
|
|
42
|
+
required: true,
|
|
43
|
+
spaceBefore: true
|
|
44
|
+
},
|
|
45
|
+
// =============================================================================
|
|
27
46
|
// RUN NAME - Display name for workflow runs
|
|
28
47
|
// =============================================================================
|
|
29
48
|
{
|
|
@@ -72,13 +91,13 @@ Runtime versions
|
|
|
72
91
|
{
|
|
73
92
|
path: 'env.NODE_VERSION',
|
|
74
93
|
operation: 'preserve',
|
|
75
|
-
value: new Scalar(
|
|
94
|
+
value: new Scalar(normalizedNodeVersion),
|
|
76
95
|
required: true
|
|
77
96
|
},
|
|
78
97
|
{
|
|
79
98
|
path: 'env.PNPM_VERSION',
|
|
80
99
|
operation: 'preserve',
|
|
81
|
-
value: new Scalar(
|
|
100
|
+
value: new Scalar(normalizedPnpmVersion),
|
|
82
101
|
required: true
|
|
83
102
|
},
|
|
84
103
|
// =============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-header.js","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-header.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"operations-header.js","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-header.ts"],"names":[],"mapp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AAK;gBACf,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,oCAAoC;YAC1C,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE;gBACL,WAAW,EAAE,6CAA6C;gBAC1D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,mCAAmC;YACzC,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE;gBACL,WAAW,EAAE,2CAA2C;gBACxD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE,IAAI;SACf;QAED,eAAe;QACf;YACE,IAAI,EAAE,kBAAkB;YACxB,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE,IAAI;SACf;QAED,uBAAuB;QACvB;YACE,IAAI,EAAE,uBAAuB;YAC7B,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,UAAU,CAAC;YAC5C,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,0BAA0B;YAChC,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,6BAA6B;YAC1D,QAAQ,EAAE,IAAI;SACf;KACF,CAAA;AACH,CAAC"}
|
|
@@ -7,10 +7,7 @@ import { type PathOperationConfig } from '../../../utils/ast-path-operations.js'
|
|
|
7
7
|
import type { PipecraftConfig } from '../../../types/index.js';
|
|
8
8
|
export interface TagPromoteContext {
|
|
9
9
|
branchFlow: string[];
|
|
10
|
-
|
|
11
|
-
remoteTestJobNames: string[];
|
|
12
|
-
testJobNames?: string[];
|
|
13
|
-
autoMerge?: Record<string, boolean>;
|
|
10
|
+
autoPromote?: Record<string, boolean>;
|
|
14
11
|
config?: Partial<PipecraftConfig>;
|
|
15
12
|
}
|
|
16
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-tag-promote.d.ts","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-tag-promote.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,
|
|
1
|
+
{"version":3,"file":"operations-tag-promote.d.ts","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-tag-promote.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAClC;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,iBAAiB,GAAG,mBAAmB,EAAE,CAoJ/F"}
|
|
@@ -9,7 +9,7 @@ import { getActionReference } from '../../../utils/action-reference.js';
|
|
|
9
9
|
* Create tag, promote, and release job operations
|
|
10
10
|
*/
|
|
11
11
|
export function createTagPromoteReleaseOperations(ctx) {
|
|
12
|
-
const { branchFlow,
|
|
12
|
+
const { branchFlow, config = {} } = ctx;
|
|
13
13
|
// Provide sensible defaults if branchFlow is invalid
|
|
14
14
|
const validBranchFlow = branchFlow && Array.isArray(branchFlow) && branchFlow.length > 0 ? branchFlow : ['main'];
|
|
15
15
|
const initialBranch = validBranchFlow[0];
|
|
@@ -88,7 +88,6 @@ export function createTagPromoteReleaseOperations(ctx) {
|
|
|
88
88
|
- uses: ${tagActionRef}
|
|
89
89
|
with:
|
|
90
90
|
version: \${{ needs.version.outputs.version }}
|
|
91
|
-
commitSha: \${{ inputs.commitSha || github.sha }}
|
|
92
91
|
`)
|
|
93
92
|
},
|
|
94
93
|
// PROMOTE JOB
|
|
@@ -116,7 +115,7 @@ export function createTagPromoteReleaseOperations(ctx) {
|
|
|
116
115
|
version: \${{ needs.version.outputs.version }}
|
|
117
116
|
sourceBranch: \${{ github.ref_name }}
|
|
118
117
|
targetBranch: \${{ ${buildTargetBranchExpression(validBranchFlow)} }}
|
|
119
|
-
|
|
118
|
+
autoPromote: \${{ ${buildAutoPromoteExpression(validBranchFlow, ctx.autoPromote)} }}
|
|
120
119
|
run_number: \${{ inputs.run_number || github.run_number }}
|
|
121
120
|
`)
|
|
122
121
|
},
|
|
@@ -133,7 +132,7 @@ export function createTagPromoteReleaseOperations(ctx) {
|
|
|
133
132
|
`,
|
|
134
133
|
value: createValueFromString(`
|
|
135
134
|
needs: [ tag, version ]
|
|
136
|
-
if: \${{ always() && github.ref_name == '${validBranchFlow[validBranchFlow.length - 1]}' && needs.version.result == 'success' && needs.version.outputs.version != '' && needs.tag.result == 'success' }}
|
|
135
|
+
if: \${{ always() && github.ref_name == '${validBranchFlow[validBranchFlow.length - 1]}' && needs.version.result == 'success' && needs.version.outputs.version != '' && (needs.tag.result == 'success' || needs.tag.result == 'skipped') }}
|
|
137
136
|
runs-on: ubuntu-latest
|
|
138
137
|
steps:
|
|
139
138
|
- uses: actions/checkout@v4
|
|
@@ -143,7 +142,6 @@ export function createTagPromoteReleaseOperations(ctx) {
|
|
|
143
142
|
- uses: ${releaseActionRef}
|
|
144
143
|
with:
|
|
145
144
|
version: \${{ needs.version.outputs.version }}
|
|
146
|
-
commitSha: \${{ inputs.commitSha || github.sha }}
|
|
147
145
|
`)
|
|
148
146
|
}
|
|
149
147
|
];
|
|
@@ -184,9 +182,13 @@ function buildAtLeastOneSuccessNoFailuresCondition(jobNames) {
|
|
|
184
182
|
/**
|
|
185
183
|
* Helper to build promotable branches condition
|
|
186
184
|
* Returns a condition that checks if current branch is promotable (all except final branch)
|
|
185
|
+
* For single-branch workflows, returns 'false' to skip the promote job
|
|
187
186
|
*/
|
|
188
187
|
function buildPromotableBranchesCondition(branchFlow) {
|
|
189
188
|
const promotableBranches = branchFlow.slice(0, -1); // All branches except the last one
|
|
189
|
+
if (promotableBranches.length === 0) {
|
|
190
|
+
return 'false'; // Single-branch workflow - no promotion needed
|
|
191
|
+
}
|
|
190
192
|
return promotableBranches.map(branch => `github.ref_name == '${branch}'`).join(' || ');
|
|
191
193
|
}
|
|
192
194
|
/**
|
|
@@ -203,20 +205,22 @@ function buildTargetBranchExpression(branchFlow) {
|
|
|
203
205
|
return `github.ref_name == '${branchFlow[0]}' && '${branchFlow[1]}' || '${branchFlow[branchFlow.length - 1]}'`;
|
|
204
206
|
}
|
|
205
207
|
/**
|
|
206
|
-
* Helper to build the
|
|
207
|
-
* Maps each target branch to its
|
|
208
|
+
* Helper to build the autoPromote expression
|
|
209
|
+
* Maps each target branch to its autoPromote setting
|
|
208
210
|
*/
|
|
209
|
-
function
|
|
210
|
-
if (!
|
|
211
|
+
function buildAutoPromoteExpression(branchFlow, autoPromote) {
|
|
212
|
+
if (!autoPromote || branchFlow.length === 1)
|
|
213
|
+
return `'false'`;
|
|
214
|
+
const clauses = [];
|
|
215
|
+
for (let i = 0; i < branchFlow.length - 1; i += 1) {
|
|
216
|
+
const sourceBranch = branchFlow[i];
|
|
217
|
+
const targetBranch = branchFlow[i + 1];
|
|
218
|
+
const isEnabled = autoPromote[targetBranch] ? 'true' : 'false';
|
|
219
|
+
clauses.push(`(github.ref_name == '${sourceBranch}' && '${isEnabled}')`);
|
|
220
|
+
}
|
|
221
|
+
if (clauses.length === 0) {
|
|
211
222
|
return `'false'`;
|
|
212
|
-
if (branchFlow.length === 2) {
|
|
213
|
-
const target = branchFlow[1];
|
|
214
|
-
return `'${autoMerge[target] ? 'true' : 'false'}'`;
|
|
215
223
|
}
|
|
216
|
-
|
|
217
|
-
// github.ref_name == 'develop' && 'true' || 'false'
|
|
218
|
-
const stagingTarget = branchFlow[1];
|
|
219
|
-
const mainTarget = branchFlow[branchFlow.length - 1];
|
|
220
|
-
return `github.ref_name == '${branchFlow[0]}' && '${autoMerge[stagingTarget] ? 'true' : 'false'}' || '${autoMerge[mainTarget] ? 'true' : 'false'}'`;
|
|
224
|
+
return `${clauses.join(' || ')} || 'false'`;
|
|
221
225
|
}
|
|
222
226
|
//# sourceMappingURL=operations-tag-promote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-tag-promote.js","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-tag-promote.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EAEtB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;
|
|
1
|
+
{"version":3,"file":"operations-tag-promote.js","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-tag-promote.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EAEtB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AASvE;;GAEG;AACH,MAAM,UAAU,iCAAiC,CAAC,GAAsB;IACtE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,GAAG,CAAA;IACvC,qDAAqD;IACrD,MAAM,eAAe,GACnB,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IAC1F,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;IAExC,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AAS,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QAC9D,OAAO,CAAC,IAAI,CAAC,wBAAwB,YAAY,SAAS,SAAS,IAAI,CAAC,CAAA;IAC1E,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAA;AAC7C,CAAC"}
|
|
@@ -7,7 +7,6 @@ import { type PathOperationConfig } from '../../../utils/ast-path-operations.js'
|
|
|
7
7
|
import type { PipecraftConfig } from '../../../types/index.js';
|
|
8
8
|
export interface VersionContext {
|
|
9
9
|
testJobNames: string[];
|
|
10
|
-
nxEnabled?: boolean;
|
|
11
10
|
baseRef?: string;
|
|
12
11
|
config?: Partial<PipecraftConfig>;
|
|
13
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-version.d.ts","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,
|
|
1
|
+
{"version":3,"file":"operations-version.d.ts","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAClC;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,cAAc,GAAG,mBAAmB,CAoDlF"}
|
|
@@ -9,26 +9,19 @@ import { getActionReference } from '../../../utils/action-reference.js';
|
|
|
9
9
|
* Create the version calculation job operation
|
|
10
10
|
*/
|
|
11
11
|
export function createVersionJobOperation(ctx) {
|
|
12
|
-
const { testJobNames,
|
|
12
|
+
const { testJobNames, baseRef = 'main', config = {} } = ctx;
|
|
13
13
|
// Get the action reference based on configuration
|
|
14
14
|
const actionRef = getActionReference('calculate-version', config);
|
|
15
15
|
// Build the needs array
|
|
16
|
-
const
|
|
17
|
-
const needsArray = ['changes', nxJobName, ...testJobNames].filter(Boolean);
|
|
16
|
+
const needsArray = ['changes', ...testJobNames].filter(Boolean);
|
|
18
17
|
// Build the conditional logic
|
|
19
|
-
const nxCondition = nxEnabled ? "needs.test-nx.result == 'success'" : '';
|
|
20
18
|
const testConditions = testJobNames.length > 0
|
|
21
19
|
? [
|
|
22
20
|
`(${testJobNames.map(job => `needs.${job}.result == 'success'`).join(' || ')})`,
|
|
23
21
|
testJobNames.map(job => `needs.${job}.result != 'failure'`).join(' && ')
|
|
24
22
|
]
|
|
25
23
|
: [];
|
|
26
|
-
const allConditions = [
|
|
27
|
-
'always()',
|
|
28
|
-
"github.event_name != 'pull_request'",
|
|
29
|
-
nxCondition,
|
|
30
|
-
...testConditions
|
|
31
|
-
]
|
|
24
|
+
const allConditions = ['always()', "github.event_name != 'pull_request'", ...testConditions]
|
|
32
25
|
.filter(Boolean)
|
|
33
26
|
.join(' && ');
|
|
34
27
|
return {
|
|
@@ -55,7 +48,7 @@ export function createVersionJobOperation(ctx) {
|
|
|
55
48
|
id: version
|
|
56
49
|
with:
|
|
57
50
|
baseRef: \${{ inputs.baseRef || '${baseRef}' }}
|
|
58
|
-
|
|
51
|
+
version: \${{ inputs.version }}
|
|
59
52
|
node-version: \${{ env.NODE_VERSION }}
|
|
60
53
|
outputs:
|
|
61
54
|
version: \${{ steps.version.outputs.version }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-version.js","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EAEtB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;
|
|
1
|
+
{"version":3,"file":"operations-version.js","sourceRoot":"","sources":["../../../../src/templates/workflows/shared/operations-version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EAEtB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AASvE;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,GAAmB;IAC3D,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,GAAG,CAAA;IAE3D,kDAAkD;IAClD,MAAM,SAAS,GAAG,kBAAkB,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAA;IAEjE,wBAAwB;IACxB,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,GAAG,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAE/D,8BAA8B;IAC9B,MAAM,cAAc,GAClB,YAAY,CAAC,MAAM,GAAG,CAAC;QACrB,CAAC,CAAC;YACE,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,GAAG,sBAAsB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG;YAC/E,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,GAAG,sBAAsB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;SACzE;QACH,CAAC,CAAC,EAAE,CAAA;IAER,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,qCAAqC,EAAE,GAAG,cAAc,CAAC;SACzF,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,MAAM,CAAC,CAAA;IAEf,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,WAAW;QACtB,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE;;;;;;CAMlB;QACG,KAAK,EAAE,qBAAqB,CAAC;eAClB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;eACrB,aAAa;;;;;;;gBAOZ,SAAS;;;6CAGoB,OAAO;;;;;GAKjD,CAAC;KACD,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-format-utils.d.ts","sourceRoot":"","sources":["../../src/templates/yaml-format-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"yaml-format-utils.d.ts","sourceRoot":"","sources":["../../src/templates/yaml-format-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAW,GAAG,MAAM,CA0BtF"}
|
|
@@ -36,11 +36,7 @@ export function formatIfConditions(yamlContent, minLength = 80) {
|
|
|
36
36
|
// Step 2: Add line breaks for logical operators
|
|
37
37
|
formatted = formatted.replace(/\s+&&\s+/g, ' &&\n ');
|
|
38
38
|
formatted = formatted.replace(/\s+\|\|\s+/g, ' ||\n ');
|
|
39
|
-
// Step 3:
|
|
40
|
-
formatted = formatted.replace(/\(\s*/g, '(\n ');
|
|
41
|
-
formatted = formatted.replace(/\s*\)\s*(&&|\|\|)/g, '\n ) $1');
|
|
42
|
-
formatted = formatted.replace(/\s*\)(\s*)$/g, '\n )');
|
|
43
|
-
// Step 4: Restore function calls
|
|
39
|
+
// Step 3: Restore function calls
|
|
44
40
|
functionCalls.forEach((funcCall, index) => {
|
|
45
41
|
formatted = formatted.replace(`__FUNC_${index}__`, funcCall);
|
|
46
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-format-utils.js","sourceRoot":"","sources":["../../src/templates/yaml-format-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB,EAAE,YAAoB,EAAE;IAC5E,OAAO,WAAW,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;QACxE,yEAAyE;QACzE,IAAI,SAAS,CAAC,MAAM,GAAG,SAAS;YAAE,OAAO,KAAK,CAAA;QAE9C,IAAI,SAAS,GAAG,SAAS,CAAC,IAAI,EAAE,CAAA;QAEhC,8EAA8E;QAC9E,MAAM,aAAa,GAAa,EAAE,CAAA;QAClC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAa,EAAE,EAAE;YAC5D,MAAM,WAAW,GAAG,UAAU,aAAa,CAAC,MAAM,IAAI,CAAA;YACtD,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACzB,OAAO,WAAW,CAAA;QACpB,CAAC,CAAC,CAAA;QAEF,gDAAgD;QAChD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC,CAAA;QAC3D,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC,CAAA;QAE7D,
|
|
1
|
+
{"version":3,"file":"yaml-format-utils.js","sourceRoot":"","sources":["../../src/templates/yaml-format-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;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