@roomi-fields/grillhouse 0.30.0 → 0.31.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.
Files changed (129) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +30 -0
  3. package/agents/developpeur.md +0 -1
  4. package/agents/explorateur.md +0 -1
  5. package/agents/questionneur.md +0 -1
  6. package/agents/testwriter.md +0 -1
  7. package/dist/temporal/circuit/client.d.ts +2 -2
  8. package/dist/temporal/circuit/client.js.map +1 -1
  9. package/dist/temporal/circuit/commande.js +4 -4
  10. package/dist/temporal/circuit/commande.js.map +1 -1
  11. package/dist/temporal/circuit/contrat.d.ts +3 -3
  12. package/dist/temporal/circuit/contrat.js +8 -2
  13. package/dist/temporal/circuit/contrat.js.map +1 -1
  14. package/dist/temporal/circuit/deroule.js +3 -3
  15. package/dist/temporal/circuit/deroule.js.map +1 -1
  16. package/dist/temporal/commande.js +5 -6
  17. package/dist/temporal/commande.js.map +1 -1
  18. package/dist/temporal/installation.d.ts +0 -4
  19. package/dist/temporal/installation.js +12 -34
  20. package/dist/temporal/installation.js.map +1 -1
  21. package/docs/ARCHITECTURE.md +49 -19
  22. package/docs/CADRE.md +10 -0
  23. package/docs/INTERFACE.md +8 -3
  24. package/package.json +2 -2
  25. package/scripts/activites.mjs +150 -77
  26. package/scripts/aiguillage.mjs +33 -11
  27. package/scripts/avancement.mjs +27 -10
  28. package/scripts/bilan.mjs +101 -25
  29. package/scripts/cadre.mjs +5 -2
  30. package/scripts/circuit.mjs +153 -57
  31. package/scripts/composants-affectes.mjs +64 -21
  32. package/scripts/composition-des-langages.mjs +5 -3
  33. package/scripts/conformite.mjs +54 -19
  34. package/scripts/dependances-internes.mjs +9 -3
  35. package/scripts/dernier-vert.mjs +54 -19
  36. package/scripts/dette.mjs +32 -11
  37. package/scripts/donnees-cles.mjs +24 -8
  38. package/scripts/droits.mjs +40 -15
  39. package/scripts/empreinte-d-etape.mjs +17 -0
  40. package/scripts/engendres.mjs +15 -5
  41. package/scripts/enveloppe/enveloppe.mjs +141 -48
  42. package/scripts/enveloppe/travail-de-la-copie.mjs +36 -12
  43. package/scripts/faits-du-circuit.mjs +1 -1
  44. package/scripts/flux-des-paquets.mjs +21 -7
  45. package/scripts/gardes-du-cadre.mjs +9 -3
  46. package/scripts/init.mjs +11 -4
  47. package/scripts/integration/file.mjs +84 -29
  48. package/scripts/integration/integrer.mjs +70 -24
  49. package/scripts/integration/rejeu.mjs +26 -9
  50. package/scripts/jointure.d.ts +6 -1
  51. package/scripts/langages/cargo/commandes.mjs +97 -18
  52. package/scripts/langages/cargo/composants.mjs +24 -8
  53. package/scripts/langages/cargo/index.mjs +4 -0
  54. package/scripts/langages/cargo/tests-de-head.mjs +25 -9
  55. package/scripts/langages/python/commandes.mjs +3 -1
  56. package/scripts/langages/python/index.mjs +4 -0
  57. package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
  58. package/scripts/langages/typescript/composants.mjs +9 -3
  59. package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
  60. package/scripts/langages/typescript/consommateurs.mjs +39 -14
  61. package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
  62. package/scripts/langages/typescript/frontieres.mjs +66 -22
  63. package/scripts/langages/typescript/index-interfaces.mjs +36 -13
  64. package/scripts/langages/typescript/index.mjs +10 -3
  65. package/scripts/langages/typescript/interfaces-contre-code.mjs +109 -41
  66. package/scripts/langages/typescript/lecteurs.mjs +36 -11
  67. package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
  68. package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
  69. package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
  70. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +3 -1
  71. package/scripts/langages/typescript/parcours.mjs +12 -4
  72. package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
  73. package/scripts/langages/typescript/resumes.mjs +9 -3
  74. package/scripts/langages/typescript/tailles-des-tests.mjs +58 -16
  75. package/scripts/langages/typescript/tests-de-nuit.mjs +3 -1
  76. package/scripts/langages/typescript/tests.mjs +24 -8
  77. package/scripts/langages/typescript/titres-de-tests.mjs +35 -12
  78. package/scripts/langages/typescript/turbo-des-paquets.mjs +152 -51
  79. package/scripts/langages/typescript/verdict.mjs +3 -1
  80. package/scripts/langages/typescript/verifier.mjs +28 -10
  81. package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
  82. package/scripts/langages/typescript/vitest-config/base.mjs +7 -2
  83. package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
  84. package/scripts/langages/typescript/vitest-config/delais.mjs +9 -3
  85. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +12 -4
  86. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +17 -6
  87. package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
  88. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +7 -0
  89. package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
  90. package/scripts/lint-des-scripts.mjs +58 -0
  91. package/scripts/mesure/base-de-passe.mjs +117 -25
  92. package/scripts/mesure/pression.mjs +9 -3
  93. package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
  94. package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
  95. package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
  96. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +48 -16
  97. package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
  98. package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
  99. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +6 -2
  100. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +7 -7
  101. package/scripts/nuit.sh +15 -0
  102. package/scripts/outil.mjs +3 -1
  103. package/scripts/outils-cles.mjs +18 -7
  104. package/scripts/paquet-npm.mjs +15 -5
  105. package/scripts/paquets.mjs +12 -4
  106. package/scripts/passe-de-la-machine.mjs +7 -2
  107. package/scripts/places-de-la-machine.mjs +66 -12
  108. package/scripts/preparation.mjs +15 -5
  109. package/scripts/registre.mjs +6 -2
  110. package/scripts/reprise.mjs +66 -0
  111. package/scripts/resultats.mjs +105 -37
  112. package/scripts/seances.mjs +22 -4
  113. package/scripts/services-du-noyau.mjs +1 -0
  114. package/scripts/sous-commandes.mjs +3 -1
  115. package/scripts/style-a-l-ecriture.mjs +48 -17
  116. package/scripts/tableau.mjs +34 -9
  117. package/scripts/taches-du-graphe.mjs +33 -13
  118. package/scripts/ticket-du-circuit.mjs +10 -0
  119. package/scripts/transitions.mjs +141 -24
  120. package/scripts/verrou-de-fichier.mjs +6 -2
  121. package/scripts/verrou-de-machine.mjs +123 -39
  122. package/scripts/verrous/commande.mjs +50 -17
  123. package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
  124. package/scripts/verrous/verrou.mjs +42 -14
  125. package/skills/explorateur/SKILL.md +7 -1
  126. package/skills/grill/SKILL.md +1 -1
  127. package/skills/mesure/SKILL.md +3 -0
  128. package/skills/relecteur/SKILL.md +1 -1
  129. package/skills/testwriter/SKILL.md +12 -6
@@ -217,7 +217,9 @@ export function controlesDuDepot(racine) {
217
217
  // The tasks of the controls of the root at <racine> its root turbo.json lacks: [{ cle }].
218
218
  function controlesAbsents(racine) {
219
219
  const r = confRacine(racine);
220
- if (!r) return [];
220
+ if (!r) {
221
+ return [];
222
+ }
221
223
  const liste = paquets(racine);
222
224
  const prefixe = liste.length ? '//#' : '';
223
225
  // Format and lint play per package (Turborepo's advice: each red carries its package, the cache
@@ -240,8 +242,11 @@ function cheminsDuScript(script) {
240
242
  const chemins = [];
241
243
  for (let i = 1; i < mots.length; i++) {
242
244
  const m = mots[i];
243
- if (['--cache-location', '--ext', '--config', '--ignore-path', '-c'].includes(m)) i++;
244
- else if (!m.startsWith('-') && !['&&', '||', ';', '|'].includes(m)) chemins.push(m);
245
+ if (['--cache-location', '--ext', '--config', '--ignore-path', '-c'].includes(m)) {
246
+ i++;
247
+ } else if (!m.startsWith('-') && !['&&', '||', ';', '|'].includes(m)) {
248
+ chemins.push(m);
249
+ }
245
250
  }
246
251
  return chemins.map(m => m.replace(/^\.\//, ''));
247
252
  }
@@ -254,7 +259,9 @@ function controlesDeRacineRefuses(racine) {
254
259
  .map(p => p.dossier);
255
260
  /** @type {string[]} */
256
261
  const refus = [];
257
- if (dossiers.length === 0) return refus;
262
+ if (dossiers.length === 0) {
263
+ return refus;
264
+ }
258
265
  let scripts;
259
266
  try {
260
267
  scripts = JSON.parse(readFileSync(path.join(racine, 'package.json'), 'utf8')).scripts;
@@ -330,7 +337,9 @@ function variablesDeDonnees(racine) {
330
337
  }
331
338
  };
332
339
  lire(path.join(racine, 'package.json'));
333
- for (const p of paquets(racine)) lire(path.join(racine, p.dossier, 'package.json'));
340
+ for (const p of paquets(racine)) {
341
+ lire(path.join(racine, p.dossier, 'package.json'));
342
+ }
334
343
  return [...new Set(noms)];
335
344
  }
336
345
  // The prefix of a trace task.
@@ -366,7 +375,9 @@ function confRacine(racine) {
366
375
  function tachesRacine(racine) {
367
376
  const taches = new Map();
368
377
  for (const [nom, t] of Object.entries(confRacine(racine)?.conf.tasks ?? {})) {
369
- if (nom.includes('#')) continue;
378
+ if (nom.includes('#')) {
379
+ continue;
380
+ }
370
381
  taches.set(nom, {
371
382
  dependsOn: Array.isArray(t?.dependsOn) ? t.dependsOn : [],
372
383
  inputs: Array.isArray(t?.inputs) ? t.inputs : null,
@@ -384,7 +395,9 @@ function tachesRacine(racine) {
384
395
  * @param {{ racine: string, args: string[], env?: Record<string, string | undefined> }} o
385
396
  */
386
397
  export function planifier(dossier, { racine, args, env = process.env }) {
387
- if (!dossier) return;
398
+ if (!dossier) {
399
+ return;
400
+ }
388
401
  const r = spawnSync('turbo', ['run', ...args.filter(a => a !== '--summarize'), '--dry=json'], {
389
402
  cwd: racine,
390
403
  env,
@@ -420,7 +433,9 @@ const recouvre = (a, b) => sous(a, b) || sous(b, a);
420
433
 
421
434
  // The paths of the submodules the .gitmodules of <racine> declares, sorted; none without one.
422
435
  function sousModules(racine) {
423
- if (!existsSync(path.join(racine, '.gitmodules'))) return [];
436
+ if (!existsSync(path.join(racine, '.gitmodules'))) {
437
+ return [];
438
+ }
424
439
  const r = gitSort(racine, [
425
440
  'config',
426
441
  '-f',
@@ -467,21 +482,35 @@ function baseTs(base, dir) {
467
482
  // last base that sets them, `dir` the directory of the file that writes them), undefined when no
468
483
  // file sets them; null when one of them cannot be read.
469
484
  function configTs(f, vus = []) {
470
- if (vus.includes(f) || !existsSync(f)) return null;
485
+ if (vus.includes(f) || !existsSync(f)) {
486
+ return null;
487
+ }
471
488
  const conf = lireJsonc(readFileSync(f, 'utf8'));
472
- if (conf === null || typeof conf !== 'object' || Array.isArray(conf)) return null;
489
+ if (conf === null || typeof conf !== 'object' || Array.isArray(conf)) {
490
+ return null;
491
+ }
473
492
  const dir = path.dirname(f);
474
493
  const lu = { configs: [f], files: undefined, include: undefined };
475
494
  for (const base of conf.extends === undefined ? [] : [conf.extends].flat()) {
476
495
  const fb = typeof base === 'string' ? baseTs(base, dir) : null;
477
496
  const r = fb === null ? null : configTs(fb, [...vus, f]);
478
- if (r === null) return null;
497
+ if (r === null) {
498
+ return null;
499
+ }
479
500
  lu.configs.push(...r.configs);
480
- for (const cle of ['files', 'include']) if (r[cle] !== undefined) lu[cle] = r[cle];
501
+ for (const cle of ['files', 'include']) {
502
+ if (r[cle] !== undefined) {
503
+ lu[cle] = r[cle];
504
+ }
505
+ }
481
506
  }
482
507
  for (const cle of ['files', 'include']) {
483
- if (conf[cle] === undefined) continue;
484
- if (!Array.isArray(conf[cle])) return null;
508
+ if (conf[cle] === undefined) {
509
+ continue;
510
+ }
511
+ if (!Array.isArray(conf[cle])) {
512
+ return null;
513
+ }
485
514
  lu[cle] = conf[cle].map(chemin => ({ chemin: String(chemin), dir }));
486
515
  }
487
516
  return lu;
@@ -495,7 +524,9 @@ function configTs(f, vus = []) {
495
524
  // neighbours most often.
496
525
  function luParTsc(abs, projet) {
497
526
  const lu = configTs(projet);
498
- if (lu === null || (lu.files === undefined && lu.include === undefined)) return null;
527
+ if (lu === null || (lu.files === undefined && lu.include === undefined)) {
528
+ return null;
529
+ }
499
530
  const dedans = p => {
500
531
  const r = path.relative(abs, p).split(path.sep).join('/');
501
532
  return r === '' || r === '..' || r.startsWith('../') || path.isAbsolute(r) ? null : r;
@@ -511,11 +542,15 @@ function luParTsc(abs, projet) {
511
542
  ? path.join(path.dirname(projet), chemin.slice(CONFIG_DIR.length))
512
543
  : path.resolve(dir, chemin);
513
544
  const r = dedans(f);
514
- if (r === null) return null;
545
+ if (r === null) {
546
+ return null;
547
+ }
515
548
  const { fixe, glob } = partieFixe(r);
516
549
  const fichier = cle === 'files' || (existsSync(f) && statSync(f).isFile());
517
550
  const d = glob ? fixe : fichier ? path.posix.dirname(r) : r;
518
- if (d === '' || d === '.') return null;
551
+ if (d === '' || d === '.') {
552
+ return null;
553
+ }
519
554
  dossiers.push(d);
520
555
  }
521
556
  }
@@ -536,7 +571,9 @@ function luParTsc(abs, projet) {
536
571
  function entreesBuild(racine, dossier, pkg, sm) {
537
572
  const abs = path.join(racine, dossier);
538
573
  const projets = [path.join(abs, TSCONFIG_BUILD)];
539
- if (!existsSync(projets[0])) return null;
574
+ if (!existsSync(projets[0])) {
575
+ return null;
576
+ }
540
577
  const fichiers = new Set(['package.json']);
541
578
  const versProjet = m => {
542
579
  const f = path.resolve(abs, m);
@@ -548,9 +585,13 @@ function entreesBuild(racine, dossier, pkg, sm) {
548
585
  .split(/\s+/)
549
586
  .filter(Boolean)
550
587
  .map(m => m.replace(/^['"]|['"]$/g, ''));
551
- if (mots.length === 0) continue;
588
+ if (mots.length === 0) {
589
+ continue;
590
+ }
552
591
  const tsc = mots[0] === 'npx' ? 1 : 0;
553
- if (mots[tsc] !== 'tsc') return null;
592
+ if (mots[tsc] !== 'tsc') {
593
+ return null;
594
+ }
554
595
  const options = mots.slice(tsc + 1);
555
596
  const p = options.findIndex(m => m === '-p' || m === '--project');
556
597
  const b = options.findIndex(m => m === '-b' || m === '--build');
@@ -568,9 +609,15 @@ function entreesBuild(racine, dossier, pkg, sm) {
568
609
  const dossiers = new Set();
569
610
  for (const projet of new Set(projets)) {
570
611
  const lu = luParTsc(abs, projet);
571
- if (lu === null) return null;
572
- for (const f of lu.fichiers) fichiers.add(f);
573
- for (const d of lu.dossiers) dossiers.add(d);
612
+ if (lu === null) {
613
+ return null;
614
+ }
615
+ for (const f of lu.fichiers) {
616
+ fichiers.add(f);
617
+ }
618
+ for (const d of lu.dossiers) {
619
+ dossiers.add(d);
620
+ }
574
621
  }
575
622
  const lus = [...dossiers];
576
623
  return [
@@ -677,7 +724,9 @@ export function attendus(racine) {
677
724
  for (const { dossier, pkg, hors: exclu } of liste) {
678
725
  const taches = {};
679
726
  if (exclu) {
680
- for (const [nom] of racineTaches) taches[nom] = { extends: false };
727
+ for (const [nom] of racineTaches) {
728
+ taches[nom] = { extends: false };
729
+ }
681
730
  } else {
682
731
  taches.build = {
683
732
  dependsOn: internes(pkg, EXECUTION, construits).map(n => `${n}#build`),
@@ -698,9 +747,13 @@ export function attendus(racine) {
698
747
  .filter(d => !lusParBuild(d))
699
748
  .sort();
700
749
  const sansDonnees = dedans.map(d => `!${d}/**`);
701
- if (langageDuPaquet) taches.build.inputs = [...propres, ...sansDonnees];
702
- else if (propres) taches.build.inputs = [...racineBuild, ...propres, ...sansDonnees];
703
- else if (dedans.length) taches.build.inputs = [base('build'), ...sansDonnees];
750
+ if (langageDuPaquet) {
751
+ taches.build.inputs = [...propres, ...sansDonnees];
752
+ } else if (propres) {
753
+ taches.build.inputs = [...racineBuild, ...propres, ...sansDonnees];
754
+ } else if (dedans.length) {
755
+ taches.build.inputs = [base('build'), ...sansDonnees];
756
+ }
704
757
  const horsVoisin = TOPOLOGIE.some(c => Object.keys(pkg[c] ?? {}).some(n => hors.has(n)));
705
758
  const voisins = internes(pkg, TOPOLOGIE, duCadre);
706
759
  // <dependances> with each `^<task>` written out when a neighbour is out of the frame.
@@ -716,7 +769,9 @@ export function attendus(racine) {
716
769
  : dependances;
717
770
  if (horsVoisin) {
718
771
  for (const [nom, { dependsOn }] of racineTaches) {
719
- if (nom === 'build' || !dependsOn.some(d => d.startsWith('^'))) continue;
772
+ if (nom === 'build' || !dependsOn.some(d => d.startsWith('^'))) {
773
+ continue;
774
+ }
720
775
  taches[nom] = { dependsOn: deplier(dependsOn) };
721
776
  }
722
777
  }
@@ -753,7 +808,9 @@ export function attendus(racine) {
753
808
  // The `dependsOn` each guard task of the root of <racine> must hold: Map<task key, dependsOn>.
754
809
  export function gardesAttendues(racine) {
755
810
  const liste = paquets(racine);
756
- if (liste.length === 0) return new Map(GARDES.map(g => [g, ['build']]));
811
+ if (liste.length === 0) {
812
+ return new Map(GARDES.map(g => [g, ['build']]));
813
+ }
757
814
  const builds = liste
758
815
  .filter(({ pkg, hors }) => !hors && typeof pkg.scripts?.build === 'string')
759
816
  .map(({ pkg }) => `${pkg.name}#build`)
@@ -766,10 +823,14 @@ export function gardesAttendues(racine) {
766
823
  // null without a root configuration, or when it is no JSON.
767
824
  function gardesEcartees(racine) {
768
825
  const f = fichierRacine(racine);
769
- if (f === null) return null;
826
+ if (f === null) {
827
+ return null;
828
+ }
770
829
  const texte = readFileSync(path.join(racine, f), 'utf8');
771
830
  const conf = lireJsonc(texte);
772
- if (conf === null) return null;
831
+ if (conf === null) {
832
+ return null;
833
+ }
773
834
  const ecarts = [];
774
835
  for (const [cle, attendu] of gardesAttendues(racine)) {
775
836
  const tache = conf.tasks?.[cle];
@@ -788,7 +849,9 @@ function gardesEcartees(racine) {
788
849
  // task absent; null when it holds them, without a root configuration, and when it is no JSON.
789
850
  function typageEcarte(racine) {
790
851
  const r = confRacine(racine);
791
- if (!r) return null;
852
+ if (!r) {
853
+ return null;
854
+ }
792
855
  const attendu = attenteDuTypage(racine);
793
856
  const tache = r.conf.tasks?.[TYPAGE];
794
857
  if (!tache || typeof tache !== 'object') {
@@ -797,7 +860,9 @@ function typageEcarte(racine) {
797
860
  }
798
861
  const actuel = Array.isArray(tache.dependsOn) ? tache.dependsOn : [];
799
862
  const manques = attendu.filter(d => !actuel.includes(d));
800
- if (!manques.length) return null;
863
+ if (!manques.length) {
864
+ return null;
865
+ }
801
866
  const chemin = ['tasks', TYPAGE, 'dependsOn'];
802
867
  return { f: r.f, chemin, valeur: [...actuel, ...manques], manques };
803
868
  }
@@ -808,7 +873,9 @@ function typageEcarte(racine) {
808
873
  function testsSansVariable(racine) {
809
874
  const r = confRacine(racine);
810
875
  const tache = r?.conf.tasks?.[TESTS];
811
- if (!tache || typeof tache !== 'object') return null;
876
+ if (!tache || typeof tache !== 'object') {
877
+ return null;
878
+ }
812
879
  const actuel = Array.isArray(tache.env) ? tache.env : [];
813
880
  return actuel.includes(TESTS_CIBLES) ? null : { f: r.f, attendu: [...actuel, TESTS_CIBLES] };
814
881
  }
@@ -818,7 +885,9 @@ function testsSansVariable(racine) {
818
885
  // configuration, and when it is no JSON.
819
886
  function passagesManquants(racine) {
820
887
  const r = confRacine(racine);
821
- if (!r) return null;
888
+ if (!r) {
889
+ return null;
890
+ }
822
891
  const actuel = Array.isArray(r.conf.globalPassThroughEnv) ? r.conf.globalPassThroughEnv : [];
823
892
  const manques = [
824
893
  ...new Set([...PASSAGES, ...variablesDOutils(racine), ...variablesDeDonnees(racine)]),
@@ -835,23 +904,33 @@ function passagesManquants(racine) {
835
904
  function gitsAbsents(racine) {
836
905
  const r = confRacine(racine);
837
906
  const sm = r === null ? [] : sousModules(racine);
838
- if (sm.length === 0) return null;
907
+ if (sm.length === 0) {
908
+ return null;
909
+ }
839
910
  const listes = [];
840
911
  const examiner = (chemin, entrees, prefixe, ou) => {
841
- if (!Array.isArray(entrees)) return;
912
+ if (!Array.isArray(entrees)) {
913
+ return;
914
+ }
842
915
  const attendu = entrees.map(String);
843
916
  const manques = [];
844
917
  for (const e of entrees.map(String)) {
845
- if (e.startsWith('!') || !e.startsWith(prefixe)) continue;
918
+ if (e.startsWith('!') || !e.startsWith(prefixe)) {
919
+ continue;
920
+ }
846
921
  const { fixe, glob } = partieFixe(e.slice(prefixe.length));
847
922
  for (const m of sm) {
848
923
  const ligne = `!${prefixe}${m}/.git`;
849
- if (!glob || !(fixe === '' || sous(m, fixe)) || attendu.includes(ligne)) continue;
924
+ if (!glob || !(fixe === '' || sous(m, fixe)) || attendu.includes(ligne)) {
925
+ continue;
926
+ }
850
927
  attendu.splice(attendu.indexOf(e) + 1, 0, ligne);
851
928
  manques.push({ ou, e, m, ligne });
852
929
  }
853
930
  }
854
- if (manques.length) listes.push({ chemin, attendu, manques });
931
+ if (manques.length) {
932
+ listes.push({ chemin, attendu, manques });
933
+ }
855
934
  };
856
935
  for (const [nom, t] of Object.entries(r.conf.tasks ?? {})) {
857
936
  examiner(['tasks', nom, 'inputs'], t?.inputs, '$TURBO_ROOT$/', `l'entrée de \`${nom}\``);
@@ -886,7 +965,9 @@ export function ecrire(racine) {
886
965
  abs,
887
966
  applyEdits(texte, modify(texte, typage.chemin, typage.valeur, MISE_EN_FORME))
888
967
  );
889
- if (!ecrits.includes(typage.f)) ecrits.push(typage.f);
968
+ if (!ecrits.includes(typage.f)) {
969
+ ecrits.push(typage.f);
970
+ }
890
971
  }
891
972
  const controles = controlesAbsents(racine);
892
973
  if (controles.length) {
@@ -896,7 +977,9 @@ export function ecrire(racine) {
896
977
  texte = applyEdits(texte, modify(texte, ['tasks', cle], { outputs: [] }, MISE_EN_FORME));
897
978
  }
898
979
  writeFileSync(abs, texte);
899
- if (!ecrits.includes(controles[0].f)) ecrits.push(controles[0].f);
980
+ if (!ecrits.includes(controles[0].f)) {
981
+ ecrits.push(controles[0].f);
982
+ }
900
983
  }
901
984
  const tests = testsSansVariable(racine);
902
985
  if (tests) {
@@ -904,7 +987,9 @@ export function ecrire(racine) {
904
987
  const texte = readFileSync(abs, 'utf8');
905
988
  const chemin = ['tasks', TESTS, 'env'];
906
989
  writeFileSync(abs, applyEdits(texte, modify(texte, chemin, tests.attendu, MISE_EN_FORME)));
907
- if (!ecrits.includes(tests.f)) ecrits.push(tests.f);
990
+ if (!ecrits.includes(tests.f)) {
991
+ ecrits.push(tests.f);
992
+ }
908
993
  }
909
994
  const passage = passagesManquants(racine);
910
995
  if (passage) {
@@ -912,7 +997,9 @@ export function ecrire(racine) {
912
997
  const texte = readFileSync(abs, 'utf8');
913
998
  const chemin = ['globalPassThroughEnv'];
914
999
  writeFileSync(abs, applyEdits(texte, modify(texte, chemin, passage.attendu, MISE_EN_FORME)));
915
- if (!ecrits.includes(passage.f)) ecrits.push(passage.f);
1000
+ if (!ecrits.includes(passage.f)) {
1001
+ ecrits.push(passage.f);
1002
+ }
916
1003
  }
917
1004
  const gits = gitsAbsents(racine);
918
1005
  if (gits) {
@@ -922,11 +1009,15 @@ export function ecrire(racine) {
922
1009
  texte = applyEdits(texte, modify(texte, chemin, attendu, MISE_EN_FORME));
923
1010
  }
924
1011
  writeFileSync(abs, texte);
925
- if (!ecrits.includes(gits.f)) ecrits.push(gits.f);
1012
+ if (!ecrits.includes(gits.f)) {
1013
+ ecrits.push(gits.f);
1014
+ }
926
1015
  }
927
1016
  for (const [f, t] of attendus(racine)) {
928
1017
  const abs = path.join(racine, f);
929
- if (existsSync(abs) && readFileSync(abs, 'utf8') === t) continue;
1018
+ if (existsSync(abs) && readFileSync(abs, 'utf8') === t) {
1019
+ continue;
1020
+ }
930
1021
  writeFileSync(abs, t);
931
1022
  ecrits.push(f);
932
1023
  }
@@ -936,7 +1027,9 @@ export function ecrire(racine) {
936
1027
  // Whether <chemin> of <racine> (a directory, or a file, from the root) holds a file of code; what
937
1028
  // lies under one of <exclus> left out, as `parcourir` walks it.
938
1029
  function contientCode(racine, chemin, exclus) {
939
- if (exclus.some(e => sous(chemin, e))) return false;
1030
+ if (exclus.some(e => sous(chemin, e))) {
1031
+ return false;
1032
+ }
940
1033
  const rel = p => path.relative(racine, p).split(path.sep).join('/');
941
1034
  return parcourir(path.join(racine, chemin), p => exclus.some(e => sous(rel(p), e))).some(f =>
942
1035
  CODE.test(f)
@@ -1006,7 +1099,9 @@ function configsMatiereRefusees(racine) {
1006
1099
  const { type } = JSON.parse(readFileSync(path.join(dir, 'package.json'), 'utf8'));
1007
1100
  for (const ext of ['mjs', 'mts', ...(type === 'module' ? ['js', 'ts'] : [])]) {
1008
1101
  const f = path.relative(racine, path.join(dir, `vitest.config.${ext}`));
1009
- if (!existsSync(path.join(racine, f))) continue;
1102
+ if (!existsSync(path.join(racine, f))) {
1103
+ continue;
1104
+ }
1010
1105
  refus.push(
1011
1106
  `⛔ ${f} : la configuration de Vitest du paquet de la matière s'écrit en CommonJS, \`vitest.config.cjs\` ; Vite écrit un fichier à côté d'une configuration ESM pour la charger, et la matière est en lecture seule chez tout rôle autre que le testwriter.`
1012
1107
  );
@@ -1027,7 +1122,9 @@ function visePaquet(motif, dossiers) {
1027
1122
  // package directory.
1028
1123
  function racineRefusee(racine) {
1029
1124
  const r = confRacine(racine);
1030
- if (r === null) return [];
1125
+ if (r === null) {
1126
+ return [];
1127
+ }
1031
1128
  const { f, conf } = r;
1032
1129
  const dossiers = paquets(racine).map(p => p.dossier);
1033
1130
  const refus = [];
@@ -1054,7 +1151,9 @@ function racineRefusee(racine) {
1054
1151
  }
1055
1152
  }
1056
1153
  for (const e of Array.isArray(conf.globalDependencies) ? conf.globalDependencies : []) {
1057
- if (visePaquet(String(e).replace(/^!/, ''), dossiers)) entree(e, 'la dépendance globale');
1154
+ if (visePaquet(String(e).replace(/^!/, ''), dossiers)) {
1155
+ entree(e, 'la dépendance globale');
1156
+ }
1058
1157
  }
1059
1158
  return refus;
1060
1159
  }
@@ -1140,7 +1239,9 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
1140
1239
  ecrire(racine);
1141
1240
  } else {
1142
1241
  const refus = verifier(racine);
1143
- for (const l of refus) process.stderr.write(`${l}\n`);
1242
+ for (const l of refus) {
1243
+ process.stderr.write(`${l}\n`);
1244
+ }
1144
1245
  // Each refusal judges the root's configuration: a finding without a file of a component.
1145
1246
  ecrireSarif({
1146
1247
  garde: 'turbo-des-paquets',
@@ -56,7 +56,9 @@ export function garderLesResumes(racine, avant, env = process.env) {
56
56
  // The results directory may lie on another file system: a copy, then the removal.
57
57
  copyFileSync(path.join(runs, f), path.join(dossier, TURBO, f));
58
58
  rmSync(path.join(runs, f), { force: true });
59
- } else rmSync(path.join(runs, f), { force: true });
59
+ } else {
60
+ rmSync(path.join(runs, f), { force: true });
61
+ }
60
62
  }
61
63
  if (neufs.length && !avant.size && existsSync(runs) && readdirSync(runs).length === 0) {
62
64
  rmdirSync(runs);
@@ -168,7 +168,9 @@ export function verifier({
168
168
  { env, racine, dire }
169
169
  );
170
170
  } catch (e) {
171
- if (!(e instanceof AttenteDeLaMachine)) throw e;
171
+ if (!(e instanceof AttenteDeLaMachine)) {
172
+ throw e;
173
+ }
172
174
  dire(e.message);
173
175
  return e.code;
174
176
  } finally {
@@ -200,7 +202,9 @@ const filtre = args => args.some(a => a.startsWith('--filter=') || a === '--filt
200
202
  // A pass green on every package keeps its tree as the last green (`garder`): not when it is
201
203
  // restricted by a filter, measured against nothing, or run after a red module (PASSE_ROUGE).
202
204
  export function poserLeVert({ code, etat, args, env, garder }) {
203
- if (code === 0 && etat && !filtre(args) && !env[PASSE_ROUGE]) garder(etat);
205
+ if (code === 0 && etat && !filtre(args) && !env[PASSE_ROUGE]) {
206
+ garder(etat);
207
+ }
204
208
  }
205
209
 
206
210
  function passe({ racine, demandes, env, dire, coeurs }) {
@@ -209,7 +213,9 @@ function passe({ racine, demandes, env, dire, coeurs }) {
209
213
  const args = demandes.filter(a => a !== '--gardes' && a !== '--tout');
210
214
  // The measure against the last green: the guards alone need none.
211
215
  const m = gardesSeules ? null : mesure(racine, { tout, dans: env.TMPDIR });
212
- if (m) dire(m.ligne);
216
+ if (m) {
217
+ dire(m.ligne);
218
+ }
213
219
  const taches = new Set();
214
220
  try {
215
221
  const code = jouerLaPasse({
@@ -223,8 +229,9 @@ function passe({ racine, demandes, env, dire, coeurs }) {
223
229
  coeurs,
224
230
  taches,
225
231
  });
226
- if (env[ROUGES])
232
+ if (env[ROUGES]) {
227
233
  writeFileSync(env[ROUGES], [...taches].map(t => `${t}\t${rejeu(t)}\n`).join(''));
234
+ }
228
235
  // A pass green on every package keeps its tree as the last green.
229
236
  poserLeVert({ code, etat: m?.etat, args, env, garder: garderLeVert });
230
237
  return code;
@@ -277,8 +284,12 @@ function jouerLaPasse({ racine, gardesSeules, args, tout, ajouts, env, dire, coe
277
284
  }
278
285
  }
279
286
  garderLesResumes(racine, avant, e);
280
- if (!existait && existsSync(runs) && lister(runs).length === 0) rmdirSync(runs);
281
- if (r.status === 0) return 0;
287
+ if (!existait && existsSync(runs) && lister(runs).length === 0) {
288
+ rmdirSync(runs);
289
+ }
290
+ if (r.status === 0) {
291
+ return 0;
292
+ }
282
293
 
283
294
  // The verdict of each task: any code but 0 is a red, named.
284
295
  const rouges = [];
@@ -289,14 +300,21 @@ function jouerLaPasse({ racine, gardesSeules, args, tout, ajouts, env, dire, coe
289
300
  } else {
290
301
  for (const t of resume.tasks) {
291
302
  const code = t.execution?.exitCode;
292
- if (code === 0) continue;
303
+ if (code === 0) {
304
+ continue;
305
+ }
293
306
  rouges.push(`${t.taskId} (code ${code ?? 'absent'})`);
294
- if (typeof code === 'number') taches.add(t.taskId);
307
+ if (typeof code === 'number') {
308
+ taches.add(t.taskId);
309
+ }
295
310
  }
296
- if (rouges.length === 0)
311
+ if (rouges.length === 0) {
297
312
  rouges.push(`Turborepo sort en ${r.status ?? r.signal} sans tâche en échec`);
313
+ }
314
+ }
315
+ for (const l of rouges) {
316
+ dire(`⛔ ${l}`);
298
317
  }
299
- for (const l of rouges) dire(`⛔ ${l}`);
300
318
  dire('⛔ rouge.');
301
319
  return 1;
302
320
  }
@@ -10,7 +10,9 @@ import { AVANCEMENT, ecrireTache } from '../../../services-du-noyau.mjs';
10
10
  // The reporter of progress under <env>'s progress directory, as Vitest's `reporters` take it; an
11
11
  // empty list without the variable.
12
12
  export function rapportAvancement(env = process.env) {
13
- if (!env[AVANCEMENT]) return [];
13
+ if (!env[AVANCEMENT]) {
14
+ return [];
15
+ }
14
16
  return [fileURLToPath(import.meta.url)];
15
17
  }
16
18
 
@@ -49,16 +51,24 @@ export default class AvancementReporter {
49
51
  let change = false;
50
52
  for (const [id, resultat] of paquets) {
51
53
  const t = this.ctx?.state?.idMap?.get(id);
52
- if (!t?.filepath || t.file !== t || !FINIS.has(resultat?.state)) continue;
53
- if (this.faits.has(id)) continue;
54
+ if (!t?.filepath || t.file !== t || !FINIS.has(resultat?.state)) {
55
+ continue;
56
+ }
57
+ if (this.faits.has(id)) {
58
+ continue;
59
+ }
54
60
  this.faits.add(id);
55
61
  change = true;
56
62
  }
57
- if (change) this.ecrire();
63
+ if (change) {
64
+ this.ecrire();
65
+ }
58
66
  }
59
67
 
60
68
  onFinished(fichiers = []) {
61
- for (const f of fichiers) this.faits.add(f.id);
69
+ for (const f of fichiers) {
70
+ this.faits.add(f.id);
71
+ }
62
72
  this.ecrire();
63
73
  }
64
74
  }
@@ -109,13 +109,18 @@ function baseDeVitest() {
109
109
  return {
110
110
  name: 'grillhouse:base-de-passe',
111
111
  config() {
112
- if (process.env[MARQUE]?.startsWith(`${process.pid}:`)) return;
112
+ if (process.env[MARQUE]?.startsWith(`${process.pid}:`)) {
113
+ return;
114
+ }
113
115
  const b = ouvrirBase('vitest');
114
116
  process.env[MARQUE] = `${process.pid}:${b.base}`;
115
117
  Object.assign(process.env, b.env);
116
118
  retirerALInterruption(b.fermer);
117
119
  process.on('exit', () => {
118
- const ligne = ligneDesRestes(b.restes().filter(n => !CACHES_DES_OUTILS.has(n)));
120
+ const ligne = ligneDesRestes([
121
+ ...b.restes().filter(n => !CACHES_DES_OUTILS.has(n)),
122
+ ...b.essais(),
123
+ ]);
119
124
  if (ligne) {
120
125
  process.stderr.write(`${ligne}\n`);
121
126
  process.exitCode = 1;