@roomi-fields/grillhouse 0.30.0 → 0.32.0
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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +48 -0
- package/agents/developpeur.md +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/dist/temporal/circuit/client.d.ts +2 -2
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +4 -4
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +3 -3
- package/dist/temporal/circuit/contrat.js +8 -2
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +3 -3
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/commande.js +5 -6
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/installation.d.ts +3 -6
- package/dist/temporal/installation.js +19 -38
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/tickets/activites.d.ts +1 -0
- package/dist/temporal/tickets/activites.js +5 -0
- package/dist/temporal/tickets/activites.js.map +1 -1
- package/dist/temporal/tickets/contrat.d.ts +10 -0
- package/dist/temporal/tickets/deroule.js +8 -1
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/docs/ARCHITECTURE.md +119 -27
- package/docs/CADRE.md +20 -0
- package/docs/INTERFACE.md +17 -4
- package/hooks/hooks.json +4 -0
- package/package.json +2 -2
- package/scripts/activites.mjs +155 -84
- package/scripts/aiguillage.mjs +35 -11
- package/scripts/attente-au-tour.mjs +99 -0
- package/scripts/avancement.mjs +27 -10
- package/scripts/base-des-workflows.mjs +57 -0
- package/scripts/bilan.mjs +101 -25
- package/scripts/cadre.mjs +5 -2
- package/scripts/circuit.mjs +173 -58
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +5 -3
- package/scripts/conformite.mjs +54 -19
- package/scripts/copies-finies.mjs +8 -1
- package/scripts/dependances-internes.mjs +9 -3
- package/scripts/dernier-vert.mjs +84 -23
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +24 -8
- package/scripts/droits.mjs +40 -15
- package/scripts/effets.mjs +9 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +141 -48
- package/scripts/enveloppe/travail-de-la-copie.mjs +36 -12
- package/scripts/etapes.mjs +1 -1
- package/scripts/faits-du-circuit.mjs +1 -1
- package/scripts/flux-des-paquets.mjs +21 -7
- package/scripts/gardes-du-cadre.mjs +9 -3
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +84 -29
- package/scripts/integration/integrer.mjs +70 -24
- package/scripts/integration/rejeu.mjs +26 -9
- package/scripts/jointure.d.ts +10 -1
- package/scripts/journal-des-etats.d.mts +41 -0
- package/scripts/journal-des-etats.mjs +273 -0
- package/scripts/journal.mjs +119 -0
- package/scripts/langages/cargo/commandes.mjs +97 -18
- package/scripts/langages/cargo/composants.mjs +24 -8
- package/scripts/langages/cargo/index.mjs +7 -0
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +3 -1
- package/scripts/langages/python/index.mjs +6 -0
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/frontieres.mjs +112 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +12 -3
- package/scripts/langages/typescript/interfaces-contre-code.mjs +109 -41
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +3 -1
- package/scripts/langages/typescript/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +58 -16
- package/scripts/langages/typescript/tests-de-nuit.mjs +3 -1
- package/scripts/langages/typescript/tests.mjs +24 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +35 -12
- package/scripts/langages/typescript/turbo-des-paquets.mjs +152 -51
- package/scripts/langages/typescript/verdict.mjs +3 -1
- package/scripts/langages/typescript/verifier.mjs +61 -14
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +10 -2
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/delais.mjs +9 -3
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +12 -4
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +17 -6
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages.d.mts +20 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/matiere-de-test.d.ts +11 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +9 -3
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +48 -16
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +6 -2
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +7 -7
- package/scripts/nuit.sh +24 -0
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.mjs +18 -7
- package/scripts/paquet-npm.mjs +15 -5
- package/scripts/paquets.mjs +12 -4
- package/scripts/passe-de-la-machine.mjs +7 -2
- package/scripts/places-de-la-machine.mjs +72 -12
- package/scripts/preparation.mjs +15 -5
- package/scripts/registre.mjs +6 -2
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +105 -37
- package/scripts/seances.mjs +22 -4
- package/scripts/services-du-noyau.mjs +1 -0
- package/scripts/sous-commandes.mjs +5 -1
- package/scripts/style-a-l-ecriture.mjs +48 -17
- package/scripts/superviseur.mjs +127 -75
- package/scripts/tableau.mjs +133 -10
- package/scripts/taches-du-graphe.mjs +33 -13
- package/scripts/ticket-du-circuit.mjs +40 -0
- package/scripts/transitions.mjs +159 -29
- package/scripts/verrou-de-fichier.mjs +6 -2
- package/scripts/verrou-de-machine.mjs +123 -39
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/developpeur/SKILL.md +1 -1
- package/skills/explorateur/SKILL.md +8 -2
- package/skills/grill/SKILL.md +3 -57
- package/skills/grill/references/paquets.md +60 -0
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +16 -27
- package/skills/questionneur/SKILL.md +1 -1
- package/skills/relecteur/SKILL.md +2 -2
- package/skills/testwriter/SKILL.md +19 -7
- package/skills/release/SKILL.md +0 -134
- package/skills/release/scripts/update-version.cjs +0 -92
|
@@ -22,7 +22,9 @@ export function migrer(projet) {
|
|
|
22
22
|
const inscrite = lire(projet)[GARDE] ?? {};
|
|
23
23
|
const constats = verifier(projet);
|
|
24
24
|
const neufs = constats.filter(c => !inscrite[c.fichier]?.[c.regle]);
|
|
25
|
-
if (neufs.length === 0)
|
|
25
|
+
if (neufs.length === 0) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
26
28
|
// Inscribed counts stay; a finding without key is added at its count.
|
|
27
29
|
trancher(projet, GARDE, constats, 'inscrire', {});
|
|
28
30
|
return [
|
|
@@ -15,7 +15,9 @@ function siPresent(lire, f, absent) {
|
|
|
15
15
|
try {
|
|
16
16
|
return lire(f);
|
|
17
17
|
} catch (e) {
|
|
18
|
-
if (e?.code === 'ENOENT')
|
|
18
|
+
if (e?.code === 'ENOENT') {
|
|
19
|
+
return absent;
|
|
20
|
+
}
|
|
19
21
|
throw e;
|
|
20
22
|
}
|
|
21
23
|
}
|
|
@@ -32,16 +34,22 @@ export function parcourir(chemin, sauter = () => false) {
|
|
|
32
34
|
const out = [];
|
|
33
35
|
const walk = (p, dossier) => {
|
|
34
36
|
if (!dossier) {
|
|
35
|
-
if (!TEMPORAIRE_DE_VITE.test(p))
|
|
37
|
+
if (!TEMPORAIRE_DE_VITE.test(p)) {
|
|
38
|
+
out.push(p);
|
|
39
|
+
}
|
|
36
40
|
return;
|
|
37
41
|
}
|
|
38
42
|
for (const e of siPresent(d => readdirSync(d, { withFileTypes: true }), p, [])) {
|
|
39
43
|
const q = path.join(p, e.name);
|
|
40
|
-
if (!sauter(q))
|
|
44
|
+
if (!sauter(q)) {
|
|
45
|
+
walk(q, e.isDirectory());
|
|
46
|
+
}
|
|
41
47
|
}
|
|
42
48
|
};
|
|
43
49
|
const racine = siPresent(statSync, chemin, null);
|
|
44
|
-
if (racine)
|
|
50
|
+
if (racine) {
|
|
51
|
+
walk(chemin, racine.isDirectory());
|
|
52
|
+
}
|
|
45
53
|
return out;
|
|
46
54
|
}
|
|
47
55
|
|
|
@@ -55,7 +55,9 @@ export function estUnTest(chemin, racine) {
|
|
|
55
55
|
// of its file's kind (`.nuit` or `.budget` kept before `.test`);
|
|
56
56
|
// null for a file Vitest does not play.
|
|
57
57
|
export function soeurDAvant(chemin, racine) {
|
|
58
|
-
if (!estUnTest(chemin, racine)?.joue)
|
|
58
|
+
if (!estUnTest(chemin, racine)?.joue) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
59
61
|
return chemin.replace(/((?:\.nuit|\.budget)?\.(?:test|spec)\.[cm]?[jt]sx?)$/, '.circuit-avant$1');
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -67,7 +69,9 @@ const DES_TESTS = 'devDependencies';
|
|
|
67
69
|
// manifest of no package.
|
|
68
70
|
function horsDesTests(chemin, racine, avant, apres) {
|
|
69
71
|
const abs = path.resolve(racine, chemin);
|
|
70
|
-
if (!dossiers(racine).some(d => path.join(d.dir, 'package.json') === abs))
|
|
72
|
+
if (!dossiers(racine).some(d => path.join(d.dir, 'package.json') === abs)) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
71
75
|
const lire = texte => {
|
|
72
76
|
try {
|
|
73
77
|
const v = texte === null ? {} : JSON.parse(texte);
|
|
@@ -79,7 +83,9 @@ function horsDesTests(chemin, racine, avant, apres) {
|
|
|
79
83
|
}
|
|
80
84
|
};
|
|
81
85
|
const [a, b] = [lire(avant), lire(apres)];
|
|
82
|
-
if (a.faute || b.faute)
|
|
86
|
+
if (a.faute || b.faute) {
|
|
87
|
+
return [a.faute ?? b.faute];
|
|
88
|
+
}
|
|
83
89
|
return [...new Set([...Object.keys(a.valeur), ...Object.keys(b.valeur)])]
|
|
84
90
|
.filter(k => k !== DES_TESTS && !isDeepStrictEqual(a.valeur[k], b.valeur[k]))
|
|
85
91
|
.sort();
|
|
@@ -32,7 +32,9 @@ export function verifier(racine, env = process.env) {
|
|
|
32
32
|
const constats = [];
|
|
33
33
|
for (const c of aVerifier(racine, env)) {
|
|
34
34
|
const iface = path.join(c.dir, 'docs', 'INTERFACE.md');
|
|
35
|
-
if (!existsSync(iface))
|
|
35
|
+
if (!existsSync(iface)) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
36
38
|
const relIface = path.relative(racine, iface);
|
|
37
39
|
const longs = lire(relIface, readFileSync(iface, 'utf8')).parties.filter(
|
|
38
40
|
p => p.titre && [...p.phrase].length > LONGUEUR_MAX
|
|
@@ -51,7 +53,11 @@ export function verifier(racine, env = process.env) {
|
|
|
51
53
|
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
52
54
|
const racine = process.cwd();
|
|
53
55
|
const { refus, lignes } = trancher(racine, 'resumes', verifier(racine));
|
|
54
|
-
for (const r of refus)
|
|
55
|
-
|
|
56
|
+
for (const r of refus) {
|
|
57
|
+
process.stderr.write(`⛔ ${r.message}\n`);
|
|
58
|
+
}
|
|
59
|
+
for (const l of lignes) {
|
|
60
|
+
process.stderr.write(`${l}\n`);
|
|
61
|
+
}
|
|
56
62
|
process.exitCode = refus.length ? 1 : 0;
|
|
57
63
|
}
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
// `cwd:` (or `-C`, `--prefix`), starts one of the heavy tools of OUTILS_LOURDS (turbo,
|
|
23
23
|
// vitest, knip, depcruise, api-extractor), named by a literal argument or a literal path to
|
|
24
24
|
// its binary, with no `git init` (grillhouse-44b.10.4, Bazel's test-encyclopedia: a test
|
|
25
|
-
// that runs the product in a trial project is large)
|
|
25
|
+
// that runs the product in a trial project is large);
|
|
26
|
+
// or it starts a Temporal development server (the literal arguments `'server', 'start-dev'`
|
|
27
|
+
// in a process call of its text or of its test material): a test that mounts a real server
|
|
28
|
+
// is large (grillhouse-4nr.16). A tool named by a variable, or run by
|
|
26
29
|
// an npm script (`npm run verifier`), escapes the reading and the test stays medium; so
|
|
27
30
|
// does a call without `cwd` (on the repository);
|
|
28
31
|
// - medium (`moyen`): it starts a process (it imports `child_process`, `execa` or `zx`), or it
|
|
@@ -65,6 +68,8 @@ const APPEL =
|
|
|
65
68
|
const GIT = /^['"`]git(?:['"`]|\s)/;
|
|
66
69
|
/** The heavy tools of the product: a test that starts one in a trial project is large. */
|
|
67
70
|
export const OUTILS_LOURDS = ['turbo', 'vitest', 'knip', 'depcruise', 'api-extractor'];
|
|
71
|
+
// A Temporal development server started: the literal arguments `'server', 'start-dev'`.
|
|
72
|
+
const SERVEUR_TEMPORAL = /['"`]server['"`]\s*,\s*['"`]start-dev['"`]/;
|
|
68
73
|
// A temporary directory mounted.
|
|
69
74
|
const DOSSIER_TEMPORAIRE = /\bmkdtemp(?:Sync)?\b|\btmpdir\b/;
|
|
70
75
|
// An option of a call that carries the directory the process runs in.
|
|
@@ -76,15 +81,20 @@ function appelComplet(texte, debut) {
|
|
|
76
81
|
let profondeur = 0;
|
|
77
82
|
const fin = Math.min(texte.length, debut + 2000);
|
|
78
83
|
for (let i = debut; i < fin; i++) {
|
|
79
|
-
if (texte[i] === '(')
|
|
80
|
-
|
|
84
|
+
if (texte[i] === '(') {
|
|
85
|
+
profondeur++;
|
|
86
|
+
} else if (texte[i] === ')' && --profondeur === 0) {
|
|
87
|
+
return texte.slice(debut, i + 1);
|
|
88
|
+
}
|
|
81
89
|
}
|
|
82
90
|
return texte.slice(debut, fin);
|
|
83
91
|
}
|
|
84
92
|
// Whether <texte> mounts a temporary directory and, in a process call carrying `cwd`, `-C` or
|
|
85
93
|
// `--prefix`, starts a heavy tool named by a literal.
|
|
86
94
|
function outilLourdEnProjetDEssai(texte) {
|
|
87
|
-
if (!DOSSIER_TEMPORAIRE.test(texte))
|
|
95
|
+
if (!DOSSIER_TEMPORAIRE.test(texte)) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
88
98
|
return [...texte.matchAll(APPEL)].some(m => {
|
|
89
99
|
const appel = appelComplet(texte, m.index + m[0].indexOf('('));
|
|
90
100
|
return OPTION_DE_DOSSIER.test(appel) && OUTIL_LITTERAL.test(appel);
|
|
@@ -96,7 +106,9 @@ const TOUT_REEXPORTE = /\bexport\s*\*\s*from\b/;
|
|
|
96
106
|
// null for a clause without braces (a namespace, a default), which takes the whole module.
|
|
97
107
|
function nomsImportes(clause) {
|
|
98
108
|
const b = /\{([^}]*)\}/.exec(clause);
|
|
99
|
-
if (!b)
|
|
109
|
+
if (!b) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
100
112
|
return b[1]
|
|
101
113
|
.split(',')
|
|
102
114
|
.map(p =>
|
|
@@ -155,12 +167,30 @@ export function classer(fichier, lire, racine = path.parse(fichier).root, lesMat
|
|
|
155
167
|
const vus = new Set();
|
|
156
168
|
// <f> followed; with <noms>, the names a test imports of it, its re-exports of a whole module
|
|
157
169
|
// (`export * from`) are followed only to a module that declares one of them.
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
170
|
+
const lus = new Set();
|
|
171
|
+
let serveur = false;
|
|
172
|
+
const suivre = (f, noms = null, pris = noms) => {
|
|
173
|
+
const cle = noms || pris ? `${f}#${(noms ?? []).join(',')}#${(pris ?? []).join(',')}` : f;
|
|
174
|
+
if (vus.has(f) || vus.has(cle)) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
161
177
|
vus.add(cle);
|
|
162
178
|
const texte = lire(f) ?? '';
|
|
163
|
-
|
|
179
|
+
if (!lus.has(f)) {
|
|
180
|
+
textes.push(texte);
|
|
181
|
+
}
|
|
182
|
+
lus.add(f);
|
|
183
|
+
// The server counts when the part of the file the test takes starts it: the whole file for
|
|
184
|
+
// the test itself or an import without braces, the exports it names otherwise.
|
|
185
|
+
const partie = pris
|
|
186
|
+
? texte
|
|
187
|
+
.split(/(?=^export\s)/m)
|
|
188
|
+
.filter(c => pris.some(n => declare(c, n)))
|
|
189
|
+
.join('\n')
|
|
190
|
+
: texte;
|
|
191
|
+
if (SERVEUR_TEMPORAL.test(partie)) {
|
|
192
|
+
serveur = true;
|
|
193
|
+
}
|
|
164
194
|
for (const m of texte.matchAll(IMPORT)) {
|
|
165
195
|
const spec = m[1] ?? m[2] ?? m[3] ?? m[4];
|
|
166
196
|
const parSonNom = lesMatieres.find(x => spec === `${x.nom}/test-fixtures`);
|
|
@@ -168,15 +198,22 @@ export function classer(fichier, lire, racine = path.parse(fichier).root, lesMat
|
|
|
168
198
|
suivre(parSonNom.entree, nomsImportes(m[0]));
|
|
169
199
|
continue;
|
|
170
200
|
}
|
|
171
|
-
if (!spec?.startsWith('.'))
|
|
201
|
+
if (!spec?.startsWith('.')) {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
172
204
|
const cible = resoudre(f, spec, lire);
|
|
173
|
-
if (!cible)
|
|
205
|
+
if (!cible) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
174
208
|
if (noms && TOUT_REEXPORTE.test(m[0]) && !noms.some(n => declare(lire(cible) ?? '', n))) {
|
|
175
209
|
continue;
|
|
176
210
|
}
|
|
177
211
|
const rel = path.relative(racine, cible).split(path.sep).join('/');
|
|
178
|
-
if ((MATIERE.test(rel) || dansUneMatiere(cible)) && !TEST.test(rel))
|
|
179
|
-
|
|
212
|
+
if ((MATIERE.test(rel) || dansUneMatiere(cible)) && !TEST.test(rel)) {
|
|
213
|
+
suivre(cible, null, nomsImportes(m[0]));
|
|
214
|
+
} else {
|
|
215
|
+
modules.add(cible);
|
|
216
|
+
}
|
|
180
217
|
}
|
|
181
218
|
};
|
|
182
219
|
suivre(fichier);
|
|
@@ -184,7 +221,8 @@ export function classer(fichier, lire, racine = path.parse(fichier).root, lesMat
|
|
|
184
221
|
const processus = PROCESSUS.test(tout);
|
|
185
222
|
const autreQueGit = [...tout.matchAll(APPEL)].some(m => !GIT.test(m[1].trim()));
|
|
186
223
|
const taille =
|
|
187
|
-
processus &&
|
|
224
|
+
processus &&
|
|
225
|
+
((autreQueGit && DEPOT_D_ESSAI.test(tout)) || outilLourdEnProjetDEssai(tout) || serveur)
|
|
188
226
|
? 'grand'
|
|
189
227
|
: processus || modules.size > 1
|
|
190
228
|
? 'moyen'
|
|
@@ -241,8 +279,12 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
|
241
279
|
const compte = t => toutes.filter(x => x.taille === t).length;
|
|
242
280
|
const nuit = toutes.filter(x => x.nuit).length;
|
|
243
281
|
const { refus, lignes } = trancher(racine, GARDE, verifier(racine));
|
|
244
|
-
for (const r of refus)
|
|
245
|
-
|
|
282
|
+
for (const r of refus) {
|
|
283
|
+
process.stderr.write(`⛔ ${r.message}\n`);
|
|
284
|
+
}
|
|
285
|
+
for (const l of lignes) {
|
|
286
|
+
process.stderr.write(`${l}\n`);
|
|
287
|
+
}
|
|
246
288
|
process.stderr.write(
|
|
247
289
|
`ℹ️ ${GARDE} : ${toutes.length} fichier(s) de tests, ${compte('petit')} petit(s), ${compte('moyen')} moyen(s), ${compte('grand')} grand(s) ; ${nuit} de nuit ou de banc.\n`
|
|
248
290
|
);
|
|
@@ -66,7 +66,9 @@ export function testsDeNuit(racine) {
|
|
|
66
66
|
try {
|
|
67
67
|
attendreDeLaPlace();
|
|
68
68
|
} catch (e) {
|
|
69
|
-
if (e?.name !== 'AttenteDeLaMachine')
|
|
69
|
+
if (e?.name !== 'AttenteDeLaMachine') {
|
|
70
|
+
throw e;
|
|
71
|
+
}
|
|
70
72
|
process.stdout.write(`${e.message}\n`);
|
|
71
73
|
return e.code;
|
|
72
74
|
}
|
|
@@ -114,7 +114,9 @@ const options = args.filter(a => a.startsWith('-') && a !== '--force');
|
|
|
114
114
|
const chemins = args.filter(a => !a.startsWith('-'));
|
|
115
115
|
// Under the circuit's mark, the tests measured against the last green; `--force` plays them all.
|
|
116
116
|
const depuis = process.env[DEPUIS_LE_VERT] ? mesure(racine, { tout: force }) : null;
|
|
117
|
-
if (depuis)
|
|
117
|
+
if (depuis) {
|
|
118
|
+
process.stdout.write(`${depuis.ligne}\n`);
|
|
119
|
+
}
|
|
118
120
|
|
|
119
121
|
// One Turborepo run of <args>, VARIABLE set to <tests> (unset without), each task whose
|
|
120
122
|
// dependencies succeed played to its end; its exit code. While the run names a results directory
|
|
@@ -124,7 +126,9 @@ const turbo = (args, tests) => {
|
|
|
124
126
|
delete env[TESTS_CIBLES];
|
|
125
127
|
delete env[CHANGEMENTS];
|
|
126
128
|
Object.assign(env, depuis?.env ?? {});
|
|
127
|
-
if (tests)
|
|
129
|
+
if (tests) {
|
|
130
|
+
env[TESTS_CIBLES] = JSON.stringify(tests);
|
|
131
|
+
}
|
|
128
132
|
const resume = env[RESULTATS] ? ['--summarize'] : [];
|
|
129
133
|
const runs = path.join(racine, '.turbo', 'runs');
|
|
130
134
|
const avant = new Set(existsSync(runs) ? readdirSync(runs) : []);
|
|
@@ -142,7 +146,9 @@ const turbo = (args, tests) => {
|
|
|
142
146
|
stdio: 'inherit',
|
|
143
147
|
env,
|
|
144
148
|
}).status ?? 1;
|
|
145
|
-
if (resume.length)
|
|
149
|
+
if (resume.length) {
|
|
150
|
+
garderLesResumes(racine, avant, env);
|
|
151
|
+
}
|
|
146
152
|
return code;
|
|
147
153
|
};
|
|
148
154
|
|
|
@@ -167,16 +173,22 @@ const traces = (filtres, noms) => {
|
|
|
167
173
|
const cibles = (filtres, passes) => {
|
|
168
174
|
// `testsCibles` is undefined with no path and no `--force`: the variable then stays unset.
|
|
169
175
|
const tests = testsCibles({ arguments: passes, force });
|
|
170
|
-
if (!enveloppe)
|
|
176
|
+
if (!enveloppe) {
|
|
177
|
+
return turbo([SCRIPT_DES_TESTS, ...filtres], tests);
|
|
178
|
+
}
|
|
171
179
|
// A package the envelope shows read-only arrives built: only the packages it shows in writing
|
|
172
180
|
// build, as the envelope mounts them (`inscriptible`).
|
|
173
181
|
const construits = filtres.filter(f => inscriptible(dossiers.get(f.slice('--filter='.length))));
|
|
174
182
|
if (filtres.length === 0 || construits.length > 0) {
|
|
175
183
|
const noms = new Set(construits.map(f => f.slice('--filter='.length)));
|
|
176
184
|
const propres = construits.length ? traces(construits, noms) : { ids: [] };
|
|
177
|
-
if (propres.code !== undefined)
|
|
185
|
+
if (propres.code !== undefined) {
|
|
186
|
+
return propres.code;
|
|
187
|
+
}
|
|
178
188
|
const construction = turbo(['build', ...propres.ids, '--only', ...construits]);
|
|
179
|
-
if (construction !== 0)
|
|
189
|
+
if (construction !== 0) {
|
|
190
|
+
return construction;
|
|
191
|
+
}
|
|
180
192
|
}
|
|
181
193
|
return turbo([SCRIPT_DES_TESTS, '--only', ...filtres], tests);
|
|
182
194
|
};
|
|
@@ -203,7 +215,9 @@ const lancer = () => {
|
|
|
203
215
|
options.length ? { arguments: options } : undefined
|
|
204
216
|
);
|
|
205
217
|
}
|
|
206
|
-
if (liste.length === 0)
|
|
218
|
+
if (liste.length === 0) {
|
|
219
|
+
return cibles([], [...chemins, ...options]);
|
|
220
|
+
}
|
|
207
221
|
|
|
208
222
|
// The package of the frame that holds each path, the paths made absolute; the refusals.
|
|
209
223
|
const refus = [];
|
|
@@ -233,7 +247,9 @@ const lancer = () => {
|
|
|
233
247
|
}
|
|
234
248
|
}
|
|
235
249
|
if (refus.length) {
|
|
236
|
-
for (const l of refus)
|
|
250
|
+
for (const l of refus) {
|
|
251
|
+
process.stderr.write(`${l}\n`);
|
|
252
|
+
}
|
|
237
253
|
return 2;
|
|
238
254
|
}
|
|
239
255
|
return cibles(
|
|
@@ -88,8 +88,11 @@ function litteral(texte, debut) {
|
|
|
88
88
|
} else if (guillemet === '`' && texte[i] === '$' && texte[i + 1] === '{') {
|
|
89
89
|
let profondeur = 0;
|
|
90
90
|
do {
|
|
91
|
-
if (texte[i] === '{')
|
|
92
|
-
|
|
91
|
+
if (texte[i] === '{') {
|
|
92
|
+
profondeur++;
|
|
93
|
+
} else if (texte[i] === '}') {
|
|
94
|
+
profondeur--;
|
|
95
|
+
}
|
|
93
96
|
i++;
|
|
94
97
|
} while (i < texte.length && profondeur > 0);
|
|
95
98
|
titre += ' ';
|
|
@@ -153,7 +156,11 @@ function ressemblance(a, b) {
|
|
|
153
156
|
const la = new Set(a.split('\n'));
|
|
154
157
|
const lb = new Set(b.split('\n'));
|
|
155
158
|
let commun = 0;
|
|
156
|
-
for (const l of la)
|
|
159
|
+
for (const l of la) {
|
|
160
|
+
if (lb.has(l)) {
|
|
161
|
+
commun++;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
157
164
|
return commun / (la.size + lb.size - commun || 1);
|
|
158
165
|
}
|
|
159
166
|
|
|
@@ -165,7 +172,9 @@ function ressemblance(a, b) {
|
|
|
165
172
|
export function renommesDuLot(racine) {
|
|
166
173
|
const supprimes = git(racine, ['diff', 'HEAD', '--name-only', '--diff-filter=D', '-z']);
|
|
167
174
|
const connus = git(racine, ['ls-tree', '-r', '--name-only', 'HEAD', '-z']);
|
|
168
|
-
if (supprimes.status !== 0 || connus.status !== 0)
|
|
175
|
+
if (supprimes.status !== 0 || connus.status !== 0) {
|
|
176
|
+
return {};
|
|
177
|
+
}
|
|
169
178
|
const anciens = supprimes.stdout.split('\0').filter(f => f && TEST.test(f));
|
|
170
179
|
const avant = new Set(connus.stdout.split('\0'));
|
|
171
180
|
const nouveaux = testsDuDepot(racine).filter(f => !avant.has(f));
|
|
@@ -183,8 +192,10 @@ export function renommesDuLot(racine) {
|
|
|
183
192
|
}
|
|
184
193
|
return anciens.map(a => ({ n, a, s: ressemblance(texte, textesAnciens.get(a)) }));
|
|
185
194
|
});
|
|
186
|
-
for (const { n, a
|
|
187
|
-
if (out[n] || pris.has(a))
|
|
195
|
+
for (const { n, a } of paires.filter(p => p.s >= 0.5).sort((x, y) => y.s - x.s)) {
|
|
196
|
+
if (out[n] || pris.has(a)) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
188
199
|
out[n] = a;
|
|
189
200
|
pris.add(a);
|
|
190
201
|
}
|
|
@@ -201,7 +212,9 @@ export function jugerLesTitres(dette, constats, renommes = {}) {
|
|
|
201
212
|
const inscrite = dette?.[GARDE] ?? {};
|
|
202
213
|
const permis = f => inscrite[f]?.[REGLE]?.count ?? 0;
|
|
203
214
|
const comptes = new Map();
|
|
204
|
-
for (const c of constats)
|
|
215
|
+
for (const c of constats) {
|
|
216
|
+
comptes.set(c.fichier, (comptes.get(c.fichier) ?? 0) + 1);
|
|
217
|
+
}
|
|
205
218
|
const reprises = new Set(Object.values(renommes));
|
|
206
219
|
const refus = [];
|
|
207
220
|
for (const [fichier, trouve] of comptes) {
|
|
@@ -223,7 +236,9 @@ export function jugerLesTitres(dette, constats, renommes = {}) {
|
|
|
223
236
|
}
|
|
224
237
|
}
|
|
225
238
|
for (const fichier of Object.keys(inscrite)) {
|
|
226
|
-
if (comptes.has(fichier) || reprises.has(fichier) || !permis(fichier))
|
|
239
|
+
if (comptes.has(fichier) || reprises.has(fichier) || !permis(fichier)) {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
227
242
|
refus.push({
|
|
228
243
|
fichier,
|
|
229
244
|
regle: REGLE,
|
|
@@ -256,7 +271,9 @@ function main() {
|
|
|
256
271
|
const section = dette[GARDE];
|
|
257
272
|
if (section) {
|
|
258
273
|
for (const [nouveau, ancien] of Object.entries(renommes)) {
|
|
259
|
-
if (section[ancien] && !section[nouveau])
|
|
274
|
+
if (section[ancien] && !section[nouveau]) {
|
|
275
|
+
section[nouveau] = section[ancien];
|
|
276
|
+
}
|
|
260
277
|
delete section[ancien];
|
|
261
278
|
}
|
|
262
279
|
writeFileSync(path.join(racine, FICHIER), `${JSON.stringify(dette, null, 2)}\n`);
|
|
@@ -286,12 +303,18 @@ function main() {
|
|
|
286
303
|
],
|
|
287
304
|
});
|
|
288
305
|
}
|
|
289
|
-
for (const r of refus)
|
|
290
|
-
|
|
306
|
+
for (const r of refus) {
|
|
307
|
+
process.stderr.write(`⛔ ${r.message}\n`);
|
|
308
|
+
}
|
|
309
|
+
for (const l of lignes) {
|
|
310
|
+
process.stderr.write(`${l}\n`);
|
|
311
|
+
}
|
|
291
312
|
process.stderr.write(
|
|
292
313
|
`ℹ️ ${GARDE} : ${constats.length} titre(s) nommant un ticket ou un « critère N » ; les tests Rust et Python sont hors du compte.\n`
|
|
293
314
|
);
|
|
294
315
|
process.exitCode = refus.length ? 1 : 0;
|
|
295
316
|
}
|
|
296
317
|
|
|
297
|
-
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href)
|
|
318
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
319
|
+
main();
|
|
320
|
+
}
|