looply-cli 0.5.28 → 0.5.29
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/dist/account-connect.d.ts.map +1 -1
- package/dist/account-connect.js +10 -2
- package/dist/account-connect.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +5 -3
- package/dist/bin.js.map +1 -1
- package/dist/branch-delivery-wiring.d.ts.map +1 -1
- package/dist/branch-delivery-wiring.js +2 -0
- package/dist/branch-delivery-wiring.js.map +1 -1
- package/dist/branch-delivery.d.ts +43 -0
- package/dist/branch-delivery.d.ts.map +1 -1
- package/dist/branch-delivery.js +106 -3
- package/dist/branch-delivery.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/connect-node.d.ts.map +1 -1
- package/dist/connect-node.js +23 -1
- package/dist/connect-node.js.map +1 -1
- package/dist/connect.d.ts +2 -0
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +13 -5
- package/dist/connect.js.map +1 -1
- package/dist/daemon-cmd.d.ts +3 -0
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +5 -1
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/effective-gates.d.ts +58 -0
- package/dist/effective-gates.d.ts.map +1 -0
- package/dist/effective-gates.js +153 -0
- package/dist/effective-gates.js.map +1 -0
- package/dist/environment-hold.d.ts.map +1 -1
- package/dist/environment-hold.js +10 -0
- package/dist/environment-hold.js.map +1 -1
- package/dist/feature-report.d.ts +10 -3
- package/dist/feature-report.d.ts.map +1 -1
- package/dist/feature-report.js +44 -1
- package/dist/feature-report.js.map +1 -1
- package/dist/gate-draft.d.ts +16 -0
- package/dist/gate-draft.d.ts.map +1 -1
- package/dist/gate-draft.js +86 -4
- package/dist/gate-draft.js.map +1 -1
- package/dist/gate-health.d.ts +157 -0
- package/dist/gate-health.d.ts.map +1 -0
- package/dist/gate-health.js +432 -0
- package/dist/gate-health.js.map +1 -0
- package/dist/github-api.d.ts +2 -0
- package/dist/github-api.d.ts.map +1 -1
- package/dist/github-api.js +1 -0
- package/dist/github-api.js.map +1 -1
- package/dist/init-detect.d.ts +2 -0
- package/dist/init-detect.d.ts.map +1 -1
- package/dist/init-detect.js +4 -0
- package/dist/init-detect.js.map +1 -1
- package/dist/integration-deps.d.ts.map +1 -1
- package/dist/integration-deps.js +17 -6
- package/dist/integration-deps.js.map +1 -1
- package/dist/pair-cmd.d.ts +13 -1
- package/dist/pair-cmd.d.ts.map +1 -1
- package/dist/pair-cmd.js +30 -13
- package/dist/pair-cmd.js.map +1 -1
- package/dist/provider-cmd.d.ts +5 -0
- package/dist/provider-cmd.d.ts.map +1 -1
- package/dist/provider-cmd.js +21 -1
- package/dist/provider-cmd.js.map +1 -1
- package/dist/provider-ready.js +1 -1
- package/dist/provider-ready.js.map +1 -1
- package/dist/run-cmd.d.ts.map +1 -1
- package/dist/run-cmd.js +104 -7
- package/dist/run-cmd.js.map +1 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +5 -1
- package/dist/setup.js.map +1 -1
- package/dist/workspace-provisioner.d.ts +8 -0
- package/dist/workspace-provisioner.d.ts.map +1 -1
- package/dist/workspace-provisioner.js +9 -1
- package/dist/workspace-provisioner.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyRemoteGates = applyRemoteGates;
|
|
4
|
+
exports.deliveryRequired = deliveryRequired;
|
|
5
|
+
exports.effectiveCarry = effectiveCarry;
|
|
6
|
+
exports.gatesForReport = gatesForReport;
|
|
7
|
+
exports.remoteGatesOf = remoteGatesOf;
|
|
8
|
+
const gate_1 = require("./gate");
|
|
9
|
+
const gate_draft_1 = require("./gate-draft");
|
|
10
|
+
function applyRemoteGates(cfg, remote) {
|
|
11
|
+
// A partial config (a caller that holds only some sections) is passed through untouched.
|
|
12
|
+
if (!Array.isArray(cfg.gates))
|
|
13
|
+
return { config: cfg, quarantine: new Map(), baseCheck: remote?.baseCheck !== false, from: new Map(), notes: [] };
|
|
14
|
+
const notes = [];
|
|
15
|
+
const from = new Map();
|
|
16
|
+
const gates = cfg.gates.map((g) => ({ ...g }));
|
|
17
|
+
for (const g of gates)
|
|
18
|
+
from.set(g.name, 'config.yaml');
|
|
19
|
+
const quarantine = new Map();
|
|
20
|
+
for (const s of remote?.steps ?? []) {
|
|
21
|
+
const at = gates.findIndex((g) => g.name === s.name);
|
|
22
|
+
if (s.off === true) {
|
|
23
|
+
if (at >= 0) {
|
|
24
|
+
gates.splice(at, 1);
|
|
25
|
+
from.delete(s.name);
|
|
26
|
+
notes.push(`gate "${s.name}" is off (AutoRyn)`);
|
|
27
|
+
}
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (at < 0) {
|
|
31
|
+
if (s.run === undefined) {
|
|
32
|
+
notes.push(`gate "${s.name}" from AutoRyn was not added: it has no command and this PC's config has no step of that name`);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const added = { name: s.name, run: s.run };
|
|
36
|
+
if (s.timeoutS !== undefined)
|
|
37
|
+
added.timeoutS = s.timeoutS;
|
|
38
|
+
if (typeof s.when === 'string')
|
|
39
|
+
added.when = s.when;
|
|
40
|
+
if (s.required !== undefined)
|
|
41
|
+
added.required = s.required;
|
|
42
|
+
gates.push(added);
|
|
43
|
+
from.set(s.name, 'remote');
|
|
44
|
+
notes.push(`gate "${s.name}" added (AutoRyn)`);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const g = { ...gates[at] };
|
|
48
|
+
const changed = [];
|
|
49
|
+
if (s.run !== undefined && s.run !== g.run) {
|
|
50
|
+
g.run = s.run;
|
|
51
|
+
changed.push('command');
|
|
52
|
+
}
|
|
53
|
+
if (s.timeoutS !== undefined && s.timeoutS !== g.timeoutS) {
|
|
54
|
+
g.timeoutS = s.timeoutS;
|
|
55
|
+
changed.push(`time limit ${s.timeoutS} s`);
|
|
56
|
+
}
|
|
57
|
+
if (s.when === null && g.when !== undefined) {
|
|
58
|
+
delete g.when;
|
|
59
|
+
changed.push('no filter');
|
|
60
|
+
}
|
|
61
|
+
else if (typeof s.when === 'string' && s.when !== g.when) {
|
|
62
|
+
g.when = s.when;
|
|
63
|
+
changed.push(`only when ${s.when}`);
|
|
64
|
+
}
|
|
65
|
+
if (s.required !== undefined && s.required !== (g.required === true)) {
|
|
66
|
+
g.required = s.required;
|
|
67
|
+
changed.push(s.required ? 'required' : 'not required');
|
|
68
|
+
}
|
|
69
|
+
gates[at] = g;
|
|
70
|
+
if (changed.length) {
|
|
71
|
+
from.set(g.name, 'remote');
|
|
72
|
+
notes.push(`gate "${g.name}": ${changed.join(', ')} (AutoRyn)`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
for (const q of remote?.quarantine ?? []) {
|
|
76
|
+
if (!gates.some((g) => g.name === q.step))
|
|
77
|
+
continue;
|
|
78
|
+
const prior = quarantine.get(q.step);
|
|
79
|
+
quarantine.set(q.step, {
|
|
80
|
+
files: [...new Set([...(prior?.files ?? []), ...q.tests])],
|
|
81
|
+
because: prior ? `${prior.because}; ${q.because}` : q.because,
|
|
82
|
+
});
|
|
83
|
+
notes.push(`gate "${q.step}" leaves out ${q.tests.length} test file(s) (AutoRyn): ${q.because}`);
|
|
84
|
+
}
|
|
85
|
+
if ((0, gate_1.requiredSteps)(gates).length === 0) {
|
|
86
|
+
const pick = pickRequired(gates);
|
|
87
|
+
notes.push(pick
|
|
88
|
+
? `gate "${pick.name}" counts as required for delivery: no step is marked required, and finished work is only delivered against a required step`
|
|
89
|
+
: 'no gate is required and every gate has a filter, so finished work cannot be delivered — mark one required');
|
|
90
|
+
}
|
|
91
|
+
const declared = cfg.run?.carryIntoCheckouts ?? [];
|
|
92
|
+
const carry = [...declared];
|
|
93
|
+
for (const c of remote?.carry ?? [])
|
|
94
|
+
if (!carry.includes(c))
|
|
95
|
+
carry.push(c);
|
|
96
|
+
const carried = carry.length !== declared.length;
|
|
97
|
+
if (carried)
|
|
98
|
+
notes.push(`carried into checkouts (AutoRyn): ${carry.filter((c) => !declared.includes(c)).join(', ')}`);
|
|
99
|
+
return {
|
|
100
|
+
config: { ...cfg, gates, ...(carried ? { run: { ...cfg.run, carryIntoCheckouts: carry } } : {}) },
|
|
101
|
+
quarantine,
|
|
102
|
+
baseCheck: remote?.baseCheck !== false,
|
|
103
|
+
from,
|
|
104
|
+
notes,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** A test step reads as the main check; a typecheck is the fallback. */
|
|
108
|
+
const TEST_STEP = /\b(jest|vitest|mocha|ava|tap|playwright|pytest|go test|cargo test|test)\b/i;
|
|
109
|
+
/**
|
|
110
|
+
* The step that stands in as required when none is: the main unconditional test step, else the
|
|
111
|
+
* first unconditional step. A filtered step never does — one that may be skipped would hold a
|
|
112
|
+
* delivery the person meant to allow.
|
|
113
|
+
*/
|
|
114
|
+
function pickRequired(gates) {
|
|
115
|
+
const open = gates.filter((g) => !g.when);
|
|
116
|
+
return open.find((g) => TEST_STEP.test(g.name) || TEST_STEP.test(g.run)) ?? open[0];
|
|
117
|
+
}
|
|
118
|
+
/** The required steps a delivery is recorded against: the configured ones, else the stand-in. */
|
|
119
|
+
function deliveryRequired(gates) {
|
|
120
|
+
const named = (0, gate_1.requiredSteps)(gates);
|
|
121
|
+
if (named.length > 0)
|
|
122
|
+
return named;
|
|
123
|
+
const pick = pickRequired(gates);
|
|
124
|
+
return pick ? [pick.name] : [];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* What machine-made checkouts carry: the declared list, plus the `node_modules` of every sub-app a
|
|
128
|
+
* ROOT test runner reaches (its tests run from the root jest, with that sub-app's packages) — but
|
|
129
|
+
* only when the project carries its root `node_modules` at all, so a project that carries nothing
|
|
130
|
+
* still carries nothing.
|
|
131
|
+
*/
|
|
132
|
+
function effectiveCarry(fs, declared, workspaces = []) {
|
|
133
|
+
const carry = [...declared];
|
|
134
|
+
const added = [];
|
|
135
|
+
if (!carry.includes('node_modules'))
|
|
136
|
+
return { carry, added };
|
|
137
|
+
for (const c of (0, gate_draft_1.rootRunnerCarry)(fs, workspaces)) {
|
|
138
|
+
if (carry.includes(c))
|
|
139
|
+
continue;
|
|
140
|
+
carry.push(c);
|
|
141
|
+
added.push(c);
|
|
142
|
+
}
|
|
143
|
+
return { carry, added };
|
|
144
|
+
}
|
|
145
|
+
/** The gates in force, for the AutoRyn report. */
|
|
146
|
+
function gatesForReport(e) {
|
|
147
|
+
const required = new Set(deliveryRequired(e.config.gates));
|
|
148
|
+
return e.config.gates.map((g) => ({ name: g.name, required: required.has(g.name), when: g.when ?? null, from: e.from.get(g.name) ?? 'config.yaml' }));
|
|
149
|
+
}
|
|
150
|
+
function remoteGatesOf(settings) {
|
|
151
|
+
return settings?.gates;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=effective-gates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effective-gates.js","sourceRoot":"","sources":["../src/effective-gates.ts"],"names":[],"mappings":";;AAyCA,4CA6FC;AAgBD,4CAKC;AAQD,wCAUC;AAGD,wCAGC;AAED,sCAEC;AArLD,iCAAsD;AACtD,6CAA6D;AAsC7D,SAAgB,gBAAgB,CAAC,GAAiB,EAAE,MAA+B;IACjF,yFAAyF;IACzF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACjJ,MAAM,KAAK,GAAa,EAAE,CAAC;I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AM,EAAE,qBAAqB,GAAG,IAAI,EACpC,GAAG,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC1F,mBAAmB,CAQrB;AAED,uHAAuH;AACvH,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,QAAQ,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAK5G;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,MAAM,CAkBjF"}
|
package/dist/environment-hold.js
CHANGED
|
@@ -11,6 +11,7 @@ const node_crypto_1 = require("node:crypto");
|
|
|
11
11
|
const node_fs_1 = require("node:fs");
|
|
12
12
|
const node_os_1 = require("node:os");
|
|
13
13
|
const node_path_1 = require("node:path");
|
|
14
|
+
const git_driver_1 = require("./git-driver");
|
|
14
15
|
const core_1 = require("@looply/core");
|
|
15
16
|
/**
|
|
16
17
|
* A GOAL HELD FOR A MACHINE FAULT, AND WHEN IT IS TRIED AGAIN.
|
|
@@ -115,6 +116,15 @@ function configDigest(projectDir, home = (0, node_os_1.homedir)()) {
|
|
|
115
116
|
}
|
|
116
117
|
h.update('\0');
|
|
117
118
|
}
|
|
119
|
+
// AutoRyn's gate fixes are config too: a fix made there must release a goal held on a red base.
|
|
120
|
+
try {
|
|
121
|
+
const cached = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)((0, git_driver_1.projectStateDir)(projectDir), 'feature-settings.json'), 'utf8'));
|
|
122
|
+
if (cached.settings?.gates !== undefined)
|
|
123
|
+
h.update(JSON.stringify(cached.settings.gates));
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
/* no remote switches: the digest is the files' alone, as before */
|
|
127
|
+
}
|
|
118
128
|
return h.digest('hex').slice(0, 16);
|
|
119
129
|
}
|
|
120
130
|
//# sourceMappingURL=environment-hold.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-hold.js","sourceRoot":"","sources":["../src/environment-hold.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"environment-hold.js","sourceRoot":"","sources":["../src/environment-hold.ts"],"names":[],"mappings":";;;AA8DA,kDAcC;AAED,oDAMC;AAGD,oCAEC;AAKD,sDAWC;AAGD,oCAKC;AAOD,oCAkBC;AA1ID,6CAAyC;AACzC,qCAA6E;AAC7E,qCAAkC;AAClC,yCAAiC;AACjC,6CAA+C;AAC/C,uCAAoH;AAEpH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEU,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAE7D,mGAAmG;AACtF,QAAA,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC1C,QAAA,kBAAkB,GAAuD;IACpF,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI;IAC3B,cAAc,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;CAC/B,CAAC;AAiBF,SAAS,OAAO,CAAC,QAAgB,EAAE,YAAoB;IACrD,OAAO,IAAA,gBAAI,EAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,6BAAqB,CAAC,CAAC;AACzE,CAAC;AAED,SAAgB,mBAAmB,CAAC,QAAgB,EAAE,YAAoB;IACxE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAmC,CAAC;QAChH,IAAI,CAAC,IAAA,wBAAiB,EAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,GAAG,CA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AAC;AACtC,CAAC"}
|
package/dist/feature-report.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { type ExpoTokenState, type FeatureReport } from '@looply/core';
|
|
1
|
+
import { type ChecksReport, type ExpoTokenState, type FeatureReport } from '@looply/core';
|
|
2
2
|
import type { LooplyConfig } from './config';
|
|
3
|
+
import { applyRemoteGates } from './effective-gates';
|
|
3
4
|
import { type EasCliFacts } from './eas-cli-install';
|
|
4
5
|
/** An Expo app in this repository (so its EAS command line is installed before the first release). */
|
|
5
6
|
export declare function isExpoProject(projectDir: string): boolean;
|
|
6
7
|
export declare function expoTokenState(env?: NodeJS.ProcessEnv, home?: string): ExpoTokenState;
|
|
8
|
+
/**
|
|
9
|
+
* WHETHER THIS PC'S CHECKS ARE HEALTHY: the last base check (`gate-health.ts`), the gates in force
|
|
10
|
+
* after AutoRyn's fixes, and what this PC adjusted by itself, so the owner sees "base is red:
|
|
11
|
+
* <tests>" per component instead of finding out from a week of discarded rounds.
|
|
12
|
+
*/
|
|
13
|
+
export declare function checksFor(projectDir: string, stateDir: string, config: Pick<LooplyConfig, 'gates' | 'run'> | undefined, remote: Parameters<typeof applyRemoteGates>[1]): ChecksReport;
|
|
7
14
|
export declare function buildFeatureReport(input: {
|
|
8
15
|
projectDir: string;
|
|
9
16
|
stateDir: string;
|
|
10
|
-
config: Pick<LooplyConfig, 'preview' | 'deliver' | 'bugRepro'
|
|
17
|
+
config: Pick<LooplyConfig, 'preview' | 'deliver' | 'bugRepro'> & Partial<Pick<LooplyConfig, 'gates' | 'run'>>;
|
|
11
18
|
cliVersion: string;
|
|
12
19
|
eas: EasCliFacts;
|
|
13
20
|
browser?: () => string | null;
|
|
@@ -16,7 +23,7 @@ export declare function buildFeatureReport(input: {
|
|
|
16
23
|
export declare function makeFeatureReporter(deps: {
|
|
17
24
|
projectDir: string;
|
|
18
25
|
stateDir: string;
|
|
19
|
-
config: Pick<LooplyConfig, 'preview' | 'deliver' | 'bugRepro'
|
|
26
|
+
config: Pick<LooplyConfig, 'preview' | 'deliver' | 'bugRepro'> & Partial<Pick<LooplyConfig, 'gates' | 'run'>>;
|
|
20
27
|
cliVersion: string;
|
|
21
28
|
send(report: FeatureReport): Promise<unknown>;
|
|
22
29
|
log(line: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-report.d.ts","sourceRoot":"","sources":["../src/feature-report.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"feature-report.d.ts","sourceRoot":"","sources":["../src/feature-report.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAkC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA0BnE,sGAAsG;AACtG,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAQzD;AAED,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAIlG;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,KAAK,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAiBrL;AAWD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;IAC9G,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,WAAW,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CAC/B,GAAG,aAAa,CA0BhB;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;IAC9G,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CA+BtB"}
|
package/dist/feature-report.js
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isExpoProject = isExpoProject;
|
|
4
4
|
exports.expoTokenState = expoTokenState;
|
|
5
|
+
exports.checksFor = checksFor;
|
|
5
6
|
exports.buildFeatureReport = buildFeatureReport;
|
|
6
7
|
exports.makeFeatureReporter = makeFeatureReporter;
|
|
7
8
|
const node_crypto_1 = require("node:crypto");
|
|
8
9
|
const node_fs_1 = require("node:fs");
|
|
9
10
|
const node_path_1 = require("node:path");
|
|
10
11
|
const core_1 = require("@looply/core");
|
|
12
|
+
const effective_gates_1 = require("./effective-gates");
|
|
11
13
|
const eas_cli_install_1 = require("./eas-cli-install");
|
|
14
|
+
const gate_health_1 = require("./gate-health");
|
|
15
|
+
const branch_delivery_1 = require("./branch-delivery");
|
|
16
|
+
const repo_init_1 = require("./repo-init");
|
|
12
17
|
const expo_release_1 = require("./expo-release");
|
|
13
18
|
const feature_settings_cache_1 = require("./feature-settings-cache");
|
|
14
19
|
const machine_secrets_1 = require("./machine-secrets");
|
|
@@ -46,6 +51,42 @@ function expoTokenState(env = process.env, home) {
|
|
|
46
51
|
return 'missing';
|
|
47
52
|
return (0, machine_secrets_1.isDelivered)('EXPO_TOKEN', home) ? 'delivered' : 'file';
|
|
48
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* WHETHER THIS PC'S CHECKS ARE HEALTHY: the last base check (`gate-health.ts`), the gates in force
|
|
56
|
+
* after AutoRyn's fixes, and what this PC adjusted by itself, so the owner sees "base is red:
|
|
57
|
+
* <tests>" per component instead of finding out from a week of discarded rounds.
|
|
58
|
+
*/
|
|
59
|
+
function checksFor(projectDir, stateDir, config, remote) {
|
|
60
|
+
const record = (0, gate_health_1.readBaseHealth)(stateDir);
|
|
61
|
+
if (config === undefined || !Array.isArray(config.gates))
|
|
62
|
+
return (0, gate_health_1.checksReport)(record, [], []);
|
|
63
|
+
const effective = (0, effective_gates_1.applyRemoteGates)(config, remote);
|
|
64
|
+
const notes = [...effective.notes];
|
|
65
|
+
if (process.platform === 'win32') {
|
|
66
|
+
const fs = (0, gate_health_1.projectFs)(projectDir);
|
|
67
|
+
for (const g of effective.config.gates) {
|
|
68
|
+
const safe = (0, gate_health_1.sandboxSafeCommand)(g.run, fs);
|
|
69
|
+
if (safe.note !== null)
|
|
70
|
+
notes.push(`gate "${g.name}": ${safe.note}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const fs = { ...(0, gate_health_1.projectFs)(projectDir), listDirs: (p) => (0, repo_init_1.listDirsOf)((0, node_path_1.join)(projectDir, p)) };
|
|
74
|
+
const carried = (0, effective_gates_1.effectiveCarry)(fs, effective.config.run.carryIntoCheckouts ?? []);
|
|
75
|
+
if (carried.added.length)
|
|
76
|
+
notes.push(`carried into checkouts (the root test runner reaches them): ${carried.added.join(', ')}`);
|
|
77
|
+
if (!effective.baseCheck)
|
|
78
|
+
notes.push('the base check is off (AutoRyn)');
|
|
79
|
+
return { ...(0, gate_health_1.checksReport)(record, (0, effective_gates_1.gatesForReport)(effective), notes.slice(0, 10)), ci: ciNow(stateDir) };
|
|
80
|
+
}
|
|
81
|
+
/** The base's own CI as delivery last saw it; never throws. */
|
|
82
|
+
function ciNow(stateDir) {
|
|
83
|
+
try {
|
|
84
|
+
return (0, branch_delivery_1.ciBaseReport)((0, branch_delivery_1.fileDeliveryStore)(stateDir).all());
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
49
90
|
function buildFeatureReport(input) {
|
|
50
91
|
const cache = (0, feature_settings_cache_1.readFeatureSettingsCache)(input.stateDir);
|
|
51
92
|
const remote = cache?.settings ?? null;
|
|
@@ -72,6 +113,7 @@ function buildFeatureReport(input) {
|
|
|
72
113
|
appRelease: { easCli: input.eas.state, easCliVersion: input.eas.version, easCliProblem: input.eas.problem, expoToken: expoTokenState() },
|
|
73
114
|
skipped: cache?.skipped ?? [],
|
|
74
115
|
cliVersion: input.cliVersion,
|
|
116
|
+
checks: checksFor(input.projectDir, input.stateDir, input.config.gates === undefined || input.config.run === undefined ? undefined : { gates: input.config.gates, run: input.config.run }, remote?.gates),
|
|
75
117
|
};
|
|
76
118
|
}
|
|
77
119
|
/** Rebuild when due or when the switches changed; send only what changed. Never throws. */
|
|
@@ -83,7 +125,8 @@ function makeFeatureReporter(deps) {
|
|
|
83
125
|
return async () => {
|
|
84
126
|
const now = (deps.now ?? Date.now)();
|
|
85
127
|
const cache = (0, feature_settings_cache_1.readFeatureSettingsCache)(deps.stateDir);
|
|
86
|
-
|
|
128
|
+
// A new base check is news too: AutoRyn shows it per component.
|
|
129
|
+
const switches = JSON.stringify([cache?.settings ?? null, (0, gate_health_1.readBaseHealth)(deps.stateDir)?.checkedAt ?? null, ciNow(deps.stateDir)]);
|
|
87
130
|
try {
|
|
88
131
|
if (report === null || now - builtAt >= REBUILD_MS || switches !== builtFor || report.appRelease.easCli === 'installing') {
|
|
89
132
|
// An Expo repository gets its EAS command line ahead of its first release.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-report.js","sourceRoot":"","sources":["../src/feature-report.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"feature-report.js","sourceRoot":"","sources":["../src/feature-report.ts"],"names":[],"mappings":";;AAiCA,sCAQC;AAED,wCAIC;AAOD,8BAiBC;AAWD,gDAiCC;AAGD,kDAuCC;AA7JD,6CAAyC;AACzC,qCAAmD;AACnD,yCAAiC;AACjC,uCAA2G;AAE3G,uDAAqF;AACrF,uDAAmE;AACnE,+CAA4F;AAC5F,uDAAoE;AACpE,2CAAyC;AACzC,iDAAoD;AACpD,qEAAoE;AACpE,uDAAmE;AACnE,iEAAqD;AACrD,+DAAkG;AAElG;;;;;;;;;;;;GAYG;AAEH,MAAM,UAAU,GAAG,EAAE,GAAG,MAAM,CAAC;AAE/B,sGAAsG;AACtG,SAAgB,aAAa,CAAC,UAAkB;IAC9C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAwD,CAAC;QACtI,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvF,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,C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X,IAAI,CAAC,GAAG,CAAC,yDAA0D,CAAW,CAAC,OAAO,GAAG,CAAC,CAAC;YAC3F,OAAO;QACT,CAAC;QACD,MAAM,GAAG,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9E,IAAI,GAAG,KAAK,IAAI;YAAE,OAAO;QACzB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxB,IAAI,GAAG,GAAG,CAAC;QACb,CAAC;QAAC,MAAM,CAAC;YACP,iEAAiE;QACnE,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/gate-draft.d.ts
CHANGED
|
@@ -72,7 +72,23 @@ export interface GateDraft {
|
|
|
72
72
|
subPackages: string[];
|
|
73
73
|
/** Every drafted gate in execution order, the left-out ones included. */
|
|
74
74
|
gates: DraftGate[];
|
|
75
|
+
/**
|
|
76
|
+
* `run.carry_into_checkouts` to write, or [] to leave the key out: the root `node_modules` and
|
|
77
|
+
* the `node_modules` of every sub-app the root test runner reaches (`rootRunnerCarry`).
|
|
78
|
+
*/
|
|
79
|
+
carry: string[];
|
|
75
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* SUB-APPS WHOSE OWN PACKAGES A ROOT TEST RUNNER NEEDS.
|
|
83
|
+
*
|
|
84
|
+
* RobinBetBackend's root jest collects `admin/src` too (its testMatch begins with a double star),
|
|
85
|
+
* so its admin tests import React from `admin/node_modules` — which no checkout carried, and every
|
|
86
|
+
* round failed on "Cannot find module 'react/jsx-runtime'" (2026-10-20). The carry detection in
|
|
87
|
+
* config.ts only sees `cd <app> && …` gates. This reads what the root runner collects instead: a
|
|
88
|
+
* sub-app (own package.json with dependencies, not a workspace member) is reached unless the
|
|
89
|
+
* runner's `roots` / `testMatch` / `include` keep it out.
|
|
90
|
+
*/
|
|
91
|
+
export declare function rootRunnerCarry(fs: DraftFs, workspaces: readonly string[]): string[];
|
|
76
92
|
export declare function draftGates(fs: DraftFs, opts: {
|
|
77
93
|
packageManager: PackageManager;
|
|
78
94
|
workspaces: readonly string[];
|
package/dist/gate-draft.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-draft.d.ts","sourceRoot":"","sources":["../src/gate-draft.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gate-draft.d.ts","sourceRoot":"","sources":["../src/gate-draft.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,OAAO;IACtB,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACtC,oFAAoF;IACpF,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAiCvC;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA0BlD;AAED,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAkFD,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,qEAAsE,CAAC;AAiPrG,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CA0BpF;AAID,MAAM,WAAW,SAAS;IACxB,iDAAiD;IACjD,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;IAC/B,uEAAuE;IACvE,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,yEAAyE;IACzE,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CA+BpF;AAED,wBAAgB,UAAU,CACxB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,cAAc,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACtE,SAAS,CAuEX;AA2BD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAI7C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,QAYb,CAAC;AAEb;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAiBtF"}
|
package/dist/gate-draft.js
CHANGED
|
@@ -4,10 +4,12 @@ exports.GATES_HEADER = exports.TYPECHECK_SCRIPTS = exports.UNIT_TEST_TIMEOUT_S =
|
|
|
4
4
|
exports.stripComments = stripComments;
|
|
5
5
|
exports.parseJsonc = parseJsonc;
|
|
6
6
|
exports.findSubPackages = findSubPackages;
|
|
7
|
+
exports.rootRunnerCarry = rootRunnerCarry;
|
|
7
8
|
exports.draftGates = draftGates;
|
|
8
9
|
exports.gateLine = gateLine;
|
|
9
10
|
exports.renderGatesSection = renderGatesSection;
|
|
10
11
|
const glob_1 = require("./glob");
|
|
12
|
+
const gate_health_1 = require("./gate-health");
|
|
11
13
|
/** Per-step budgets. A gate must finish well inside one round. */
|
|
12
14
|
exports.TYPECHECK_TIMEOUT_S = 300;
|
|
13
15
|
exports.UNIT_TEST_TIMEOUT_S = 600;
|
|
@@ -358,11 +360,14 @@ function draftTests(fs, pkg, pm) {
|
|
|
358
360
|
args = `${args ? `${args} ` : ''}--ci`;
|
|
359
361
|
// A forked worker needs an IPC pipe, which the Windows gate sandbox cannot
|
|
360
362
|
// give it (win/contained-node.cjs fails that fast); worker threads and an
|
|
361
|
-
// in-band run need none, and behave the same on every platform.
|
|
363
|
+
// in-band run need none, and behave the same on every platform. jest has
|
|
364
|
+
// worker threads from 29.5 and keeps its parallelism with them — a large
|
|
365
|
+
// suite in band can outgrow a round (RobinBetBackend, 2026-10-19).
|
|
362
366
|
if (runner === 'vitest' && !/(^|\s)--pool(=|\s)/.test(args))
|
|
363
367
|
args = `${args} --pool=threads`;
|
|
364
|
-
if (runner === 'jest' && !/(^|\s)(-i|--runInBand|-w|--maxWorkers)(=|\s|$)/.test(args))
|
|
365
|
-
args = `${args}
|
|
368
|
+
if (runner === 'jest' && !/(^|\s)(-i|--runInBand|--workerThreads|-w|--maxWorkers)(=|\s|$)/.test(args)) {
|
|
369
|
+
args = `${args} ${(0, gate_health_1.jestSandboxFlag)(fs, pkg.dir)}`;
|
|
370
|
+
}
|
|
366
371
|
const t = toolCommand(fs, pkg.dir, runner, args.trim());
|
|
367
372
|
run = inDir(pkg.dir, t.cmd);
|
|
368
373
|
how = text ? `its "${scriptName}" script (\`${text}\`)${t.local ? `, run with its local ${runner}` : ''}` : `${runner}, from its dependencies`;
|
|
@@ -420,6 +425,58 @@ function findSubPackages(fs, workspaces) {
|
|
|
420
425
|
}
|
|
421
426
|
return found;
|
|
422
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* SUB-APPS WHOSE OWN PACKAGES A ROOT TEST RUNNER NEEDS.
|
|
430
|
+
*
|
|
431
|
+
* RobinBetBackend's root jest collects `admin/src` too (its testMatch begins with a double star),
|
|
432
|
+
* so its admin tests import React from `admin/node_modules` — which no checkout carried, and every
|
|
433
|
+
* round failed on "Cannot find module 'react/jsx-runtime'" (2026-10-20). The carry detection in
|
|
434
|
+
* config.ts only sees `cd <app> && …` gates. This reads what the root runner collects instead: a
|
|
435
|
+
* sub-app (own package.json with dependencies, not a workspace member) is reached unless the
|
|
436
|
+
* runner's `roots` / `testMatch` / `include` keep it out.
|
|
437
|
+
*/
|
|
438
|
+
function rootRunnerCarry(fs, workspaces) {
|
|
439
|
+
const root = loadPkg(fs, '');
|
|
440
|
+
let text = script(root, 'test');
|
|
441
|
+
if (text && text.includes('no test specified'))
|
|
442
|
+
text = null;
|
|
443
|
+
const runner = runnerOf(root, text);
|
|
444
|
+
if (runner === null)
|
|
445
|
+
return [];
|
|
446
|
+
const texts = [];
|
|
447
|
+
if (runner === 'jest' && isObj(root.json?.['jest']))
|
|
448
|
+
texts.push(JSON.stringify(root.json['jest']));
|
|
449
|
+
for (const f of runner === 'jest' ? JEST_CONFIGS : VITEST_CONFIGS) {
|
|
450
|
+
const t = fs.readFile(f);
|
|
451
|
+
if (t !== null)
|
|
452
|
+
texts.push(stripComments(t));
|
|
453
|
+
}
|
|
454
|
+
const config = texts.join('\n');
|
|
455
|
+
const listed = (key) => {
|
|
456
|
+
const m = new RegExp(`["']?${key}["']?\\s*:\\s*\\[([^\\]]*)\\]`).exec(config);
|
|
457
|
+
if (!m)
|
|
458
|
+
return null;
|
|
459
|
+
return [...m[1].matchAll(/(['"`])((?:(?!\1).)*)\1/g)].map((x) => x[2].replace(/^<rootDir>\/?/, '').replace(/^\.\//, ''));
|
|
460
|
+
};
|
|
461
|
+
const roots = listed('roots');
|
|
462
|
+
const patterns = [...(listed('testMatch') ?? []), ...(listed('include') ?? [])];
|
|
463
|
+
const out = [];
|
|
464
|
+
for (const dir of findSubPackages(fs, workspaces)) {
|
|
465
|
+
if (dir.includes('/'))
|
|
466
|
+
continue; // the carry rule takes `<top-level>/node_modules` only
|
|
467
|
+
if (workspaces.some((w) => (0, glob_1.matchesGlob)(dir, w.replace(/^\.\//, '').replace(/\/+$/, ''))))
|
|
468
|
+
continue;
|
|
469
|
+
const pkg = loadPkg(fs, dir);
|
|
470
|
+
if (Object.keys(pkg.deps).length === 0)
|
|
471
|
+
continue;
|
|
472
|
+
if (roots !== null && !roots.some((r) => r === '' || r === '.' || r === dir || r.startsWith(`${dir}/`)))
|
|
473
|
+
continue;
|
|
474
|
+
if (patterns.length > 0 && !patterns.some((p) => p.startsWith('**') || p.startsWith(`${dir}/`) || p.startsWith(`${dir}\\`)))
|
|
475
|
+
continue;
|
|
476
|
+
out.push(`${dir}/node_modules`);
|
|
477
|
+
}
|
|
478
|
+
return out;
|
|
479
|
+
}
|
|
423
480
|
function draftGates(fs, opts) {
|
|
424
481
|
const root = loadPkg(fs, '');
|
|
425
482
|
const rootTc = draftTypecheck(fs, root);
|
|
@@ -478,13 +535,38 @@ function draftGates(fs, opts) {
|
|
|
478
535
|
}
|
|
479
536
|
// Cheapest first — the order in the file is the execution order (DESIGN §4):
|
|
480
537
|
// a broken typecheck should not wait on a test suite.
|
|
538
|
+
const gates = requireOne([...typechecks, ...tests]);
|
|
539
|
+
const reached = rootTest && !rootTest.disabled ? rootRunnerCarry(fs, opts.workspaces) : [];
|
|
481
540
|
return {
|
|
482
541
|
typecheck: rootTc?.step ?? null,
|
|
483
542
|
testRunner: rootTest && !rootTest.disabled ? rootTest.step : null,
|
|
484
543
|
subPackages,
|
|
485
|
-
gates
|
|
544
|
+
gates,
|
|
545
|
+
carry: reached.length ? ['node_modules', ...reached] : [],
|
|
486
546
|
};
|
|
487
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* 🔴 AT LEAST ONE ACTIVE GATE IS REQUIRED, or finished work is never delivered: the run-end
|
|
550
|
+
* delivery is recorded against required steps only, and robinbet's config had none — "delivery:
|
|
551
|
+
* none recorded … mark at least one required step" on every goal. The main test step is
|
|
552
|
+
* preferred; a config whose every gate is filtered gets its first one unfiltered, said in its why.
|
|
553
|
+
*/
|
|
554
|
+
function requireOne(gates) {
|
|
555
|
+
const active = gates.filter((g) => !g.disabled);
|
|
556
|
+
if (active.length === 0 || active.some((g) => g.required))
|
|
557
|
+
return gates;
|
|
558
|
+
const open = active.filter((g) => !g.when);
|
|
559
|
+
const isTest = (g) => /(^|:)(jest|vitest|test)$/.test(g.name);
|
|
560
|
+
const pick = open.find(isTest) ?? open[0] ?? active.find(isTest) ?? active[0];
|
|
561
|
+
return gates.map((g) => {
|
|
562
|
+
if (g !== pick)
|
|
563
|
+
return g;
|
|
564
|
+
if (!g.when)
|
|
565
|
+
return { ...g, required: true };
|
|
566
|
+
const { when, ...rest } = g;
|
|
567
|
+
return { ...rest, required: true, why: `${g.why}; runs on every round and is required (was only when ${when}), because finished work is delivered only against a required step` };
|
|
568
|
+
});
|
|
569
|
+
}
|
|
488
570
|
/* ─────────────────────────────── rendering ─────────────────────────────── */
|
|
489
571
|
/** YAML double-quoted scalars are a superset of JSON strings, so this is safe. */
|
|
490
572
|
const yamlStr = (s) => JSON.stringify(s);
|