@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
@@ -71,7 +71,9 @@ const NOM = /^(?:\*|[\p{ID_Start}$_][\p{ID_Continue}$‌‍]*)$/u;
71
71
  // « : » is not a name (`NOM`), a bullet of prose; null for a line that is no bullet (a paragraph).
72
72
  // The one reading of such a line, for this guard and for scripts/langages/typescript/consommateurs-arbitres.mjs.
73
73
  export function lireLigne(ligne) {
74
- if (!/^[-*]\s+\S/.test(ligne)) return null;
74
+ if (!/^[-*]\s+\S/.test(ligne)) {
75
+ return null;
76
+ }
75
77
  const m = /^[-*]\s+`?([^`:\s]+)`?\s*:\s*(.+)$/.exec(ligne);
76
78
  const noms = m
77
79
  ? m[2]
@@ -97,7 +99,9 @@ function lignesDeConsommateurs(texte) {
97
99
  continue;
98
100
  }
99
101
  const lue = dedans ? lireLigne(l.trim()) : null;
100
- if (lue) out.push({ texte: l.trim(), ...lue });
102
+ if (lue) {
103
+ out.push({ texte: l.trim(), ...lue });
104
+ }
101
105
  }
102
106
  return out;
103
107
  }
@@ -147,7 +151,9 @@ export function imports(source) {
147
151
  .replace(/^\s*type\s+/, '')
148
152
  .split(/\s+as\s+/)[0]
149
153
  .trim();
150
- if (nom) noms.push(nom);
154
+ if (nom) {
155
+ noms.push(nom);
156
+ }
151
157
  }
152
158
  }
153
159
  if (
@@ -155,8 +161,9 @@ export function imports(source) {
155
161
  .replace(/\{[^}]*\}/, '')
156
162
  .replace(/,/g, '')
157
163
  .trim()
158
- )
164
+ ) {
159
165
  noms.push('*');
166
+ }
160
167
  out.push({ spec: m[2], noms });
161
168
  }
162
169
  return out;
@@ -208,11 +215,19 @@ export function utilise(racine, tous = composants(racine), parLesTests = null) {
208
215
  }
209
216
  parLesTests.get(c).add(p);
210
217
  }
211
- if (!p || (test && !matiere.has(p.nom))) continue;
212
- if (!out.has(p.nom)) out.set(p.nom, new Map());
218
+ if (!p || (test && !matiere.has(p.nom))) {
219
+ continue;
220
+ }
221
+ if (!out.has(p.nom)) {
222
+ out.set(p.nom, new Map());
223
+ }
213
224
  const parConsommateur = out.get(p.nom);
214
- if (!parConsommateur.has(c.nom)) parConsommateur.set(c.nom, new Set());
215
- for (const n of noms) parConsommateur.get(c.nom).add(n);
225
+ if (!parConsommateur.has(c.nom)) {
226
+ parConsommateur.set(c.nom, new Set());
227
+ }
228
+ for (const n of noms) {
229
+ parConsommateur.get(c.nom).add(n);
230
+ }
216
231
  }
217
232
  }
218
233
  }
@@ -269,19 +284,22 @@ export function verifier(racine) {
269
284
  for (const [consommateur, noms] of utilises) {
270
285
  const permis = declare.get(consommateur) ?? new Set();
271
286
  for (const n of noms) {
272
- if (!permis.has(n))
287
+ if (!permis.has(n)) {
273
288
  refus.push({
274
289
  fichier: rel,
275
290
  regle: 'usage-non-declare',
276
291
  message: `${consommateur} utilise « ${n} » de ${p.nom}, que ${rel} ne déclare pas.`,
277
292
  });
293
+ }
278
294
  }
279
295
  }
280
296
  for (const [consommateur, noms] of declare) {
281
- if (hors.has(consommateur)) continue;
297
+ if (hors.has(consommateur)) {
298
+ continue;
299
+ }
282
300
  const faits = utilises.get(consommateur) ?? new Set();
283
301
  for (const n of noms) {
284
- if (!faits.has(n))
302
+ if (!faits.has(n)) {
285
303
  refus.push({
286
304
  fichier: rel,
287
305
  regle: DECLARE_NON_UTILISE,
@@ -289,6 +307,7 @@ export function verifier(racine) {
289
307
  nom: n,
290
308
  message: `${rel} déclare « ${n} » pour ${consommateur}, qu'aucun code de ${consommateur} n'utilise.`,
291
309
  });
310
+ }
292
311
  }
293
312
  }
294
313
  }
@@ -299,8 +318,12 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
299
318
  const racine = process.cwd();
300
319
  const verdict = verifier(racine);
301
320
  const { refus, lignes } = trancher(racine, 'consommateurs', verdict.refus);
302
- for (const r of refus) process.stderr.write(`⛔ ${r.message}\n`);
303
- for (const l of lignes) process.stderr.write(`${l}\n`);
321
+ for (const r of refus) {
322
+ process.stderr.write(`⛔ ${r.message}\n`);
323
+ }
324
+ for (const l of lignes) {
325
+ process.stderr.write(`${l}\n`);
326
+ }
304
327
  if (refus.some(r => r.regle !== DECLARE_NON_UTILISE && r.regle !== LIGNE_MAL_FORMEE)) {
305
328
  process.stderr.write(
306
329
  "Une consommation nouvelle se décide (le titre du ticket, sa section « Architecture » ou sa section « Noms publiés » qui la nomment, sinon l'arbitrage du superviseur), puis entre dans la section « Consommateurs » de l'interface du fournisseur.\n"
@@ -311,5 +334,7 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
311
334
  "Un nom que son consommateur n'utilise plus sort de sa ligne dans la section « Consommateurs » de l'interface du fournisseur.\n"
312
335
  );
313
336
  }
314
- if (refus.length) process.exitCode = 1;
337
+ if (refus.length) {
338
+ process.exitCode = 1;
339
+ }
315
340
  }
@@ -83,12 +83,16 @@ function declarationsDe(ts, sf) {
83
83
  } else if (ts.isVariableStatement(st)) {
84
84
  const decls = st.declarationList.declarations;
85
85
  for (const d of decls) {
86
- for (const n of noms(d.name)) ajouter(n.text, 'constante', n, decls.length > 1 ? d : st);
86
+ for (const n of noms(d.name)) {
87
+ ajouter(n.text, 'constante', n, decls.length > 1 ? d : st);
88
+ }
87
89
  }
88
90
  } else if (ts.isExportDeclaration(st)) {
89
91
  const clause = st.exportClause;
90
92
  if (clause && ts.isNamedExports(clause)) {
91
- for (const s of clause.elements) ajouter(s.name.text, 'export', s.name, st);
93
+ for (const s of clause.elements) {
94
+ ajouter(s.name.text, 'export', s.name, st);
95
+ }
92
96
  } else if (clause) {
93
97
  ajouter(clause.name.text, 'export', clause.name, st);
94
98
  } else {
@@ -104,10 +108,14 @@ function declarationsDe(ts, sf) {
104
108
  // The declarations of an API report's text <texte>, as declarationsDe gives them, each line that
105
109
  // of the report file; an empty Map without a report.
106
110
  function declarationsDuRapport(ts, texte) {
107
- if (texte === null) return new Map();
111
+ if (texte === null) {
112
+ return new Map();
113
+ }
108
114
  const lignes = texte.split('\n');
109
115
  const debut = lignes.indexOf(`${CLOTURE}ts`);
110
- if (debut < 0) return new Map();
116
+ if (debut < 0) {
117
+ return new Map();
118
+ }
111
119
  const fin = lignes.indexOf(CLOTURE, debut + 1);
112
120
  const code = lignes.slice(debut + 1, fin < 0 ? undefined : fin).join('\n');
113
121
  const sf = ts.createSourceFile('rapport.d.ts', code, ts.ScriptTarget.Latest, true);
@@ -180,7 +188,9 @@ function calculer(copie, avant, apres) {
180
188
  for (const { fichier, supprime } of changes) {
181
189
  const c = composantDe(fichier);
182
190
  const abs = path.resolve(copie, fichier);
183
- if (!c || !SOURCE.test(fichier) || estTest(c, abs)) continue;
191
+ if (!c || !SOURCE.test(fichier) || estTest(c, abs)) {
192
+ continue;
193
+ }
184
194
  const lu = supprime ? null : lus.get(abs);
185
195
  const lisible = supprime
186
196
  ? !s.raison && existsSync(path.join(c.dir, 'tsconfig.json'))
@@ -211,11 +221,16 @@ function calculer(copie, avant, apres) {
211
221
  rapportApres.has(d.nom) || (d.noeud ? s.publie(c, d.noeud) : abs === s.entree(c));
212
222
  for (const d of decApres.values()) {
213
223
  const avantLui = decAvant.get(d.nom);
214
- if (!avantLui) element(d, 'neuf', exporteApres(d));
215
- else if (avantLui.texte !== d.texte) element(d, 'changé', exporteApres(d));
224
+ if (!avantLui) {
225
+ element(d, 'neuf', exporteApres(d));
226
+ } else if (avantLui.texte !== d.texte) {
227
+ element(d, 'changé', exporteApres(d));
228
+ }
216
229
  }
217
230
  for (const d of decAvant.values()) {
218
- if (!decApres.has(d.nom)) element(d, 'supprimé', rapportAvant.has(d.nom));
231
+ if (!decApres.has(d.nom)) {
232
+ element(d, 'supprimé', rapportAvant.has(d.nom));
233
+ }
219
234
  }
220
235
  }
221
236
 
@@ -223,7 +238,9 @@ function calculer(copie, avant, apres) {
223
238
  const changesEnSet = new Set(changes.map(x => enPosix(x.fichier)));
224
239
  for (const c of tous) {
225
240
  const { fichier, avant: a, apres: p } = rapportsDe(c);
226
- if (!changesEnSet.has(fichier)) continue;
241
+ if (!changesEnSet.has(fichier)) {
242
+ continue;
243
+ }
227
244
  const nommes = new Set(elements.filter(e => e.paquet === nomDe(c)).map(e => e.nom));
228
245
  const ajouter = (d, statut) =>
229
246
  nommes.has(d.nom) ||
@@ -239,10 +256,17 @@ function calculer(copie, avant, apres) {
239
256
  });
240
257
  for (const d of p.values()) {
241
258
  const avantLui = a.get(d.nom);
242
- if (!avantLui) ajouter(d, 'neuf');
243
- else if (avantLui.texte !== d.texte) ajouter(d, 'changé');
259
+ if (!avantLui) {
260
+ ajouter(d, 'neuf');
261
+ } else if (avantLui.texte !== d.texte) {
262
+ ajouter(d, 'changé');
263
+ }
264
+ }
265
+ for (const d of a.values()) {
266
+ if (!p.has(d.nom)) {
267
+ ajouter(d, 'supprimé');
268
+ }
244
269
  }
245
- for (const d of a.values()) if (!p.has(d.nom)) ajouter(d, 'supprimé');
246
270
  }
247
271
 
248
272
  elements.sort(
@@ -83,7 +83,9 @@ function ecrire(regle, retrait) {
83
83
  .map(l => {
84
84
  const ligne = retrait + l;
85
85
  const m = /^(\s*(?:"[^"]*": )?)"(.*)"(,?)$/.exec(ligne);
86
- if (ligne.length <= LARGEUR || !m) return ligne;
86
+ if (ligne.length <= LARGEUR || !m) {
87
+ return ligne;
88
+ }
87
89
  const [, tete, valeur, virgule] = m;
88
90
  const pieces = [];
89
91
  let reste = valeur;
@@ -91,8 +93,12 @@ function ecrire(regle, retrait) {
91
93
  while (reste.length > place) {
92
94
  const dans = reste.slice(0, place);
93
95
  let coupe = Math.max(dans.lastIndexOf(' '), dans.lastIndexOf('|')) + 1;
94
- if (coupe === 0) coupe = place;
95
- while (reste[coupe - 1] === '\\') coupe -= 1;
96
+ if (coupe === 0) {
97
+ coupe = place;
98
+ }
99
+ while (reste[coupe - 1] === '\\') {
100
+ coupe -= 1;
101
+ }
96
102
  pieces.push(reste.slice(0, coupe));
97
103
  reste = reste.slice(coupe);
98
104
  }
@@ -108,7 +114,9 @@ function ecrire(regle, retrait) {
108
114
  function entreesBin(racine) {
109
115
  return composants(racine).flatMap(({ dir }) => {
110
116
  const fichier = path.join(dir, 'package.json');
111
- if (!existsSync(fichier)) return [];
117
+ if (!existsSync(fichier)) {
118
+ return [];
119
+ }
112
120
  const { bin } = JSON.parse(readFileSync(fichier, 'utf8'));
113
121
  const cibles = typeof bin === 'string' ? [bin] : Object.values(bin ?? {});
114
122
  return cibles
@@ -165,7 +173,9 @@ export function configuration(racine) {
165
173
  severity: 'warn',
166
174
  from: {
167
175
  orphan: true,
168
- pathNot: [`${TESTS}|(^|/)index[.][a-z]+$|[.]d[.][mc]?ts$|[.]config[.][a-z]+$`, ...bin].join('|'),
176
+ pathNot: [`${TESTS}|(^|/)index[.][a-z]+$|[.]d[.][mc]?ts$|[.]config[.][a-z]+$`, ...bin].join(
177
+ '|'
178
+ ),
169
179
  },
170
180
  to: {},
171
181
  },
@@ -263,15 +273,23 @@ export function sorties(dir) {
263
273
  const hote = { ...ts.sys, onUnRecoverableConfigFileDiagnostic: () => {} };
264
274
  const table = new Map();
265
275
  for (const e of readdirSync(dir, { withFileTypes: true })) {
266
- if (!e.isFile() || !/^tsconfig.*[.]json$/.test(e.name)) continue;
276
+ if (!e.isFile() || !/^tsconfig.*[.]json$/.test(e.name)) {
277
+ continue;
278
+ }
267
279
  const analyse = ts.getParsedCommandLineOfConfigFile(path.join(dir, e.name), {}, hote);
268
- if (!analyse || analyse.options.noEmit) continue;
280
+ if (!analyse || analyse.options.noEmit) {
281
+ continue;
282
+ }
269
283
  for (const source of analyse.fileNames.map(f => path.resolve(f))) {
270
- if (DECLARATION.test(source) || !existsSync(source)) continue;
284
+ if (DECLARATION.test(source) || !existsSync(source)) {
285
+ continue;
286
+ }
271
287
  const emises = ts.getOutputFileNames(analyse, source, ts.sys.useCaseSensitiveFileNames);
272
288
  for (const sortie of emises) {
273
289
  const chemin = path.resolve(sortie);
274
- if (chemin !== source) table.set(chemin, new Set([...(table.get(chemin) ?? []), source]));
290
+ if (chemin !== source) {
291
+ table.set(chemin, new Set([...(table.get(chemin) ?? []), source]));
292
+ }
275
293
  }
276
294
  }
277
295
  }
@@ -281,7 +299,9 @@ export function sorties(dir) {
281
299
  // The targets of an `exports` value: the string itself, or the targets of each value of an object
282
300
  // (its subpaths and its conditions).
283
301
  function cibles(valeur) {
284
- if (typeof valeur === 'string') return [valeur];
302
+ if (typeof valeur === 'string') {
303
+ return [valeur];
304
+ }
285
305
  return valeur && typeof valeur === 'object' ? Object.values(valeur).flatMap(cibles) : [];
286
306
  }
287
307
 
@@ -293,13 +313,19 @@ function sourcesDuPaquet(racine, dir) {
293
313
  const sources = new Set();
294
314
  const refus = [];
295
315
  const fichier = path.join(dir, 'package.json');
296
- if (!existsSync(fichier)) return { sources, refus };
316
+ if (!existsSync(fichier)) {
317
+ return { sources, refus };
318
+ }
297
319
  const entrees = cibles(JSON.parse(readFileSync(fichier, 'utf8')).exports);
298
- if (entrees.length === 0) return { sources, refus };
320
+ if (entrees.length === 0) {
321
+ return { sources, refus };
322
+ }
299
323
  const emis = sorties(dir);
300
324
  for (const cible of entrees) {
301
325
  const abs = path.resolve(dir, cible);
302
- if (DECLARATION.test(abs) || abs.endsWith('.json')) continue;
326
+ if (DECLARATION.test(abs) || abs.endsWith('.json')) {
327
+ continue;
328
+ }
303
329
  const source =
304
330
  SOURCE_TS.test(abs) || (SOURCE_JS.test(abs) && !emis.has(abs) && existsSync(abs));
305
331
  const trouvees = source ? [abs].filter(f => existsSync(f)) : [...(emis.get(abs) ?? [])];
@@ -309,7 +335,9 @@ function sourcesDuPaquet(racine, dir) {
309
335
  'ni fichier source, ni configuration TypeScript du paquet qui la produise.'
310
336
  );
311
337
  }
312
- for (const f of trouvees) sources.add(f);
338
+ for (const f of trouvees) {
339
+ sources.add(f);
340
+ }
313
341
  }
314
342
  return { sources, refus };
315
343
  }
@@ -321,7 +349,9 @@ export function publiees(racine) {
321
349
  const refus = [];
322
350
  for (const { dir } of composants(racine)) {
323
351
  const trouve = sourcesDuPaquet(racine, dir);
324
- for (const f of trouve.sources) sources.add(posix(path.relative(racine, f)));
352
+ for (const f of trouve.sources) {
353
+ sources.add(posix(path.relative(racine, f)));
354
+ }
325
355
  refus.push(...trouve.refus);
326
356
  }
327
357
  return { sources, refus };
@@ -367,11 +397,15 @@ function aJuger(graphe, sources) {
367
397
  const pile = [...sources];
368
398
  while (pile.length) {
369
399
  const f = pile.pop();
370
- if (atteints.has(f)) continue;
400
+ if (atteints.has(f)) {
401
+ continue;
402
+ }
371
403
  atteints.add(f);
372
404
  juges.add(f);
373
405
  for (const d of modules.get(f)?.dependencies ?? []) {
374
- if (d.couldNotResolve || d.coreModule || /(^|\/)node_modules\//.test(d.resolved)) continue;
406
+ if (d.couldNotResolve || d.coreModule || /(^|\/)node_modules\//.test(d.resolved)) {
407
+ continue;
408
+ }
375
409
  pile.push(d.resolved);
376
410
  }
377
411
  }
@@ -420,21 +454,27 @@ function frontieres(racine, args) {
420
454
  return 1;
421
455
  }
422
456
  const racines = RACINES.filter(r => existsSync(path.join(racine, r)));
423
- if (racines.length === 0) return 0;
457
+ if (racines.length === 0) {
458
+ return 0;
459
+ }
424
460
  const environnement = { ...process.env };
425
461
  delete environnement[JUGES];
426
462
  let dossier = null;
427
463
  try {
428
464
  if (sources.size > 0) {
429
465
  const graphe = depcruise(racine, racines, 'json', environnement);
430
- if (!graphe.stdout) return graphe.status || 1;
466
+ if (!graphe.stdout) {
467
+ return graphe.status || 1;
468
+ }
431
469
  dossier = mkdtempSync(path.join(tmpdir(), 'frontieres-'));
432
470
  const fichier = path.join(dossier, 'juges.txt');
433
471
  writeFileSync(fichier, motifDes(aJuger(JSON.parse(graphe.stdout), sources)));
434
472
  environnement[JUGES] = fichier;
435
473
  }
436
474
  const r = depcruise(racine, racines, 'json', environnement);
437
- if (!r.stdout) return r.status || 1;
475
+ if (!r.stdout) {
476
+ return r.status || 1;
477
+ }
438
478
  const resultat = JSON.parse(r.stdout);
439
479
  const { refus, lignes } = trancher(racine, 'frontieres', constats(resultat));
440
480
  // The report is dependency-cruiser's own (`err-long`): the result formatted as it is when the
@@ -457,10 +497,14 @@ function frontieres(racine, args) {
457
497
  stdio: 'inherit',
458
498
  });
459
499
  }
460
- for (const l of lignes) process.stderr.write(`${l}\n`);
500
+ for (const l of lignes) {
501
+ process.stderr.write(`${l}\n`);
502
+ }
461
503
  return refus.length ? 1 : 0;
462
504
  } finally {
463
- if (dossier) rmSync(dossier, { recursive: true, force: true });
505
+ if (dossier) {
506
+ rmSync(dossier, { recursive: true, force: true });
507
+ }
464
508
  }
465
509
  }
466
510
 
@@ -48,7 +48,9 @@ export function interfaces(racine) {
48
48
  const found = composants(racine)
49
49
  .map(c => path.relative(racine, path.join(c.dir, 'docs', 'INTERFACE.md')))
50
50
  .filter(rel => existsSync(path.join(racine, rel)));
51
- if (existsSync(path.join(racine, 'docs', 'INTERFACE.md'))) found.push('docs/INTERFACE.md');
51
+ if (existsSync(path.join(racine, 'docs', 'INTERFACE.md'))) {
52
+ found.push('docs/INTERFACE.md');
53
+ }
52
54
  return found.sort();
53
55
  }
54
56
 
@@ -85,7 +87,9 @@ export function lire(rel, contenu) {
85
87
  // A code block is skipped whole: a `## …` written inside it is code, not a heading.
86
88
  const f = /^\s*(```|~~~)/.exec(l);
87
89
  if (cloture) {
88
- if (f && f[1] === cloture) cloture = null;
90
+ if (f && f[1] === cloture) {
91
+ cloture = null;
92
+ }
89
93
  continue;
90
94
  }
91
95
  if (f) {
@@ -100,7 +104,9 @@ export function lire(rel, contenu) {
100
104
  }
101
105
  const m = /^(#{1,3}) (.+)$/.exec(l);
102
106
  if (m) {
103
- if (m[1].length === 1) continue;
107
+ if (m[1].length === 1) {
108
+ continue;
109
+ }
104
110
  fermer();
105
111
  courante = { niveau: m[1].length, titre: m[2].trim(), corps: [], generee };
106
112
  } else if (courante.generee && (courante.fermee || /^\*\*[^*]+\*\*/.test(l))) {
@@ -108,17 +114,22 @@ export function lire(rel, contenu) {
108
114
  // `**Paramètres**`…) are read at its address.
109
115
  courante.fermee = true;
110
116
  } else if (!l.trim()) {
111
- if (courante.generee && courante.corps.length) courante.fermee = true;
117
+ if (courante.generee && courante.corps.length) {
118
+ courante.fermee = true;
119
+ }
112
120
  } else if (!l.startsWith('|')) {
113
- if (courante.corps.length < 6 || courante.titre === 'Consommateurs')
121
+ if (courante.corps.length < 6 || courante.titre === 'Consommateurs') {
114
122
  courante.corps.push(l.replace(/^[-*]\s+/, ''));
123
+ }
115
124
  }
116
125
  }
117
126
  fermer();
118
127
  const [tete, ...reste] = sections;
119
128
  const parties = [];
120
129
  for (const s of reste) {
121
- if (s.ignoree) continue;
130
+ if (s.ignoree) {
131
+ continue;
132
+ }
122
133
  if (s.niveau === 2 && s.titre === 'Consommateurs') {
123
134
  parties.push({
124
135
  consommateurs: declares(`## Consommateurs\n${s.corps.map(l => `- ${l}`).join('\n')}`),
@@ -161,17 +172,23 @@ const TITRE_PUBLIE = "## Ce que les composants d'avant publient";
161
172
  // `{ absent: true }` without the file, null without the rubric.
162
173
  function rend(racine, rel) {
163
174
  const fichier = path.join(racine, rel);
164
- if (!existsSync(fichier)) return { absent: true };
175
+ if (!existsSync(fichier)) {
176
+ return { absent: true };
177
+ }
165
178
  let cloture = null;
166
179
  for (const l of readFileSync(fichier, 'utf8').split('\n')) {
167
180
  const f = /^\s*(```|~~~)/.exec(l);
168
181
  if (cloture) {
169
- if (f && f[1] === cloture) cloture = null;
182
+ if (f && f[1] === cloture) {
183
+ cloture = null;
184
+ }
170
185
  } else if (f) {
171
186
  cloture = f[1];
172
187
  } else {
173
188
  const m = /^## ((?:\d+\.\s*)?Rend)\s*$/.exec(l);
174
- if (m) return { titre: m[1] };
189
+ if (m) {
190
+ return { titre: m[1] };
191
+ }
175
192
  }
176
193
  }
177
194
  return null;
@@ -254,9 +271,13 @@ export function publie(racine, composant) {
254
271
  }
255
272
  const cadre = path.join(path.dirname(f.rel), 'CADRE.md');
256
273
  const r = rend(racine, cadre);
257
- if (r?.absent) out.push(`Son cadre manque : \`${cadre}\` n’existe pas.`);
258
- else if (!r) out.push(`Son cadre n’a pas de rubrique « Rend » (\`${cadre}\`).`);
259
- else out.push(`Son cadre rend : \`${cadre}\` § ${r.titre}.`);
274
+ if (r?.absent) {
275
+ out.push(`Son cadre manque : \`${cadre}\` n’existe pas.`);
276
+ } else if (!r) {
277
+ out.push(`Son cadre n’a pas de rubrique « Rend » (\`${cadre}\`).`);
278
+ } else {
279
+ out.push(`Son cadre rend : \`${cadre}\` § ${r.titre}.`);
280
+ }
260
281
  }
261
282
  return out.join('\n');
262
283
  }
@@ -310,7 +331,9 @@ function commande(racine, args) {
310
331
  message: `${SORTIE} n'est pas à jour avec les interfaces : npx grillhouse index-interfaces le régénère.`,
311
332
  },
312
333
  ];
313
- for (const r of refus) process.stderr.write(`⛔ ${r.message}\n`);
334
+ for (const r of refus) {
335
+ process.stderr.write(`⛔ ${r.message}\n`);
336
+ }
314
337
  ecrireSarif({ garde: 'index-interfaces', racine, constats: refus });
315
338
  return refus.length ? 1 : 0;
316
339
  }
@@ -51,7 +51,7 @@ import { elementsDuLot } from './elements-du-lot.mjs';
51
51
  import { A_ELAGUER, lireSarif, RESULTATS } from '../../resultats.mjs';
52
52
  import { lecteurs } from './lecteurs.mjs';
53
53
  import { estUnTest, manifestes, soeurDAvant } from './regle-des-tests.mjs';
54
- import { SCRIPT_DES_TESTS } from '../../services-du-noyau.mjs';
54
+ import { empreintesDesTaches, SCRIPT_DES_TESTS } from '../../services-du-noyau.mjs';
55
55
  import { verdict } from './verdict.mjs';
56
56
  import { miseAJour } from './mise-a-jour.mjs';
57
57
  import { squelette } from './squelette.mjs';
@@ -164,12 +164,16 @@ export default {
164
164
  // directory, through the graph of the project's packages, the cache reading what did not move;
165
165
  // inside the graph's own run (`TURBO_HASH`) the providers are built already, nothing plays.
166
166
  construireLesPaquets: noms => {
167
- if (process.env.TURBO_HASH) return;
167
+ if (process.env.TURBO_HASH) {
168
+ return;
169
+ }
168
170
  for (const nom of noms) {
169
171
  const r = spawnSync('npx', ['--no-install', 'turbo', 'run', 'build', `--filter=${nom}`], {
170
172
  stdio: 'inherit',
171
173
  });
172
- if (r.status !== 0) throw new Error(`la construction du fournisseur ${nom} échoue.`);
174
+ if (r.status !== 0) {
175
+ throw new Error(`la construction du fournisseur ${nom} échoue.`);
176
+ }
173
177
  }
174
178
  },
175
179
  // No output of a package of TypeScript is a datum of another package's tests.
@@ -227,6 +231,9 @@ export default {
227
231
  joueDesTests,
228
232
  lecteurs,
229
233
  elementsDuLot,
234
+ // The hashes of the inputs of the tests tasks of the packages and their dependents, as
235
+ // Turborepo plans them.
236
+ empreintes: (racine, noms) => empreintesDesTaches('turbo', racine, noms),
230
237
  commandes: racine => ({
231
238
  tester: { script: ici('tests.mjs'), args: [] },
232
239
  verifier: { script: ici('verifier.mjs'), args: [] },