@roomi-fields/grillhouse 0.52.0 → 0.53.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 (130) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +48 -0
  3. package/agents/direct.md +1 -1
  4. package/cadre/templates/projet/vitest.config.cjs +45 -0
  5. package/charte/superviseur.md +36 -37
  6. package/charte.md +1 -1
  7. package/dist/temporal/circuit/appel.d.ts +2 -0
  8. package/dist/temporal/circuit/appel.js +24 -2
  9. package/dist/temporal/circuit/appel.js.map +1 -1
  10. package/dist/temporal/circuit/client.d.ts +14 -5
  11. package/dist/temporal/circuit/client.js +41 -9
  12. package/dist/temporal/circuit/client.js.map +1 -1
  13. package/dist/temporal/circuit/commande.js +17 -6
  14. package/dist/temporal/circuit/commande.js.map +1 -1
  15. package/dist/temporal/circuit/contrat.d.ts +9 -0
  16. package/dist/temporal/circuit/contrat.js +6 -0
  17. package/dist/temporal/circuit/contrat.js.map +1 -1
  18. package/dist/temporal/circuit/deroule.js +25 -4
  19. package/dist/temporal/circuit/deroule.js.map +1 -1
  20. package/dist/temporal/client.d.ts +35 -1
  21. package/dist/temporal/client.js +144 -1
  22. package/dist/temporal/client.js.map +1 -1
  23. package/dist/temporal/commande.js +31 -13
  24. package/dist/temporal/commande.js.map +1 -1
  25. package/dist/temporal/etat.d.ts +3 -1
  26. package/dist/temporal/etat.js +31 -17
  27. package/dist/temporal/etat.js.map +1 -1
  28. package/dist/temporal/file/activites.js +1 -1
  29. package/dist/temporal/file/activites.js.map +1 -1
  30. package/dist/temporal/file/contrat.d.ts +4 -5
  31. package/dist/temporal/file/contrat.js +2 -2
  32. package/dist/temporal/file/contrat.js.map +1 -1
  33. package/dist/temporal/file/deroule.js +7 -5
  34. package/dist/temporal/file/deroule.js.map +1 -1
  35. package/dist/temporal/installation.d.ts +103 -53
  36. package/dist/temporal/installation.js +842 -237
  37. package/dist/temporal/installation.js.map +1 -1
  38. package/dist/temporal/nuits/deroule.js +3 -1
  39. package/dist/temporal/nuits/deroule.js.map +1 -1
  40. package/dist/temporal/places/deroule.js +2 -1
  41. package/dist/temporal/places/deroule.js.map +1 -1
  42. package/dist/temporal/sonde/deroule.js +2 -1
  43. package/dist/temporal/sonde/deroule.js.map +1 -1
  44. package/dist/temporal/tickets/deroule.js +4 -3
  45. package/dist/temporal/tickets/deroule.js.map +1 -1
  46. package/dist/temporal/travailleur.d.ts +7 -1
  47. package/dist/temporal/travailleur.js +49 -25
  48. package/dist/temporal/travailleur.js.map +1 -1
  49. package/docs/INTERFACE.md +17 -12
  50. package/docs/architecture/circuit.md +18 -15
  51. package/docs/architecture/entree.md +7 -8
  52. package/docs/architecture/greffon.md +30 -21
  53. package/docs/architecture/installation.md +87 -58
  54. package/docs/architecture/machine.md +1 -1
  55. package/docs/architecture/tests.md +14 -5
  56. package/docs/lexique.md +2 -2
  57. package/hooks/hooks.json +10 -0
  58. package/hooks/register.tsx +19 -25
  59. package/package.json +3 -2
  60. package/scripts/activites.mjs +5 -4
  61. package/scripts/aiguillage.mjs +1 -0
  62. package/scripts/circuit.mjs +254 -42
  63. package/scripts/circuits-du-serveur.mjs +3 -2
  64. package/scripts/circuits-tenus.d.mts +7 -0
  65. package/scripts/circuits-tenus.mjs +17 -0
  66. package/scripts/copie-de-montee.mjs +354 -0
  67. package/scripts/copies-du-depot.d.mts +13 -0
  68. package/scripts/copies-du-depot.mjs +66 -0
  69. package/scripts/copies-finies.mjs +6 -40
  70. package/scripts/crochets.mjs +16 -2
  71. package/scripts/direct.mjs +2 -2
  72. package/scripts/droits.mjs +2 -2
  73. package/scripts/engendres.mjs +5 -3
  74. package/scripts/enveloppe/travail-de-la-copie.mjs +77 -0
  75. package/scripts/etapes.mjs +11 -3
  76. package/scripts/faits-du-circuit.mjs +12 -5
  77. package/scripts/file-des-tickets.d.mts +13 -2
  78. package/scripts/file-des-tickets.mjs +44 -12
  79. package/scripts/greffons.mjs +42 -27
  80. package/scripts/grillhouse-maj.mjs +105 -85
  81. package/scripts/init.mjs +1 -1
  82. package/scripts/integration/file.mjs +5 -2
  83. package/scripts/integration/integrer.mjs +14 -4
  84. package/scripts/jointure.d.ts +16 -0
  85. package/scripts/langages/c/commandes.mjs +17 -7
  86. package/scripts/langages/cargo/commandes.mjs +87 -34
  87. package/scripts/langages/cargo/index.mjs +6 -3
  88. package/scripts/langages/cargo/sccache.mjs +15 -12
  89. package/scripts/langages/python/commandes.mjs +18 -8
  90. package/scripts/langages/python/squelette.mjs +2 -2
  91. package/scripts/langages/typescript/configurations-de-vitest.mjs +118 -0
  92. package/scripts/langages/typescript/index.mjs +2 -0
  93. package/scripts/langages/typescript/migrations/configurations-en-commonjs.mjs +299 -0
  94. package/scripts/langages/typescript/squelette.mjs +20 -17
  95. package/scripts/langages/typescript/tests-de-nuit.mjs +3 -3
  96. package/scripts/langages/typescript/turbo-des-paquets.mjs +24 -37
  97. package/scripts/langages/typescript/vitest-config/base.mjs +1 -1
  98. package/scripts/langages/typescript/vitest-config/bornes.mjs +1 -1
  99. package/scripts/langages/typescript/vitest-config/cibles.mjs +2 -2
  100. package/scripts/langages/typescript/{vitest.nuit.config.mjs → vitest.nuit.config.cjs} +61 -50
  101. package/scripts/mesure/pression.mjs +5 -3
  102. package/scripts/montee.mjs +524 -0
  103. package/scripts/outil.mjs +5 -3
  104. package/scripts/paquet-npm.mjs +22 -0
  105. package/scripts/paquet.mjs +5 -5
  106. package/scripts/pre-compact.mjs +25 -0
  107. package/scripts/reponses-du-circuit.d.mts +17 -2
  108. package/scripts/reponses-du-circuit.mjs +78 -20
  109. package/scripts/resultats.mjs +40 -12
  110. package/scripts/retirer-les-copies-finies.mjs +4 -7
  111. package/scripts/seances.mjs +28 -3
  112. package/scripts/services-du-noyau.mjs +7 -2
  113. package/scripts/session-start.sh +18 -11
  114. package/scripts/sortie.mjs +4 -7
  115. package/scripts/sous-commandes.mjs +1 -0
  116. package/scripts/superviseur.mjs +110 -70
  117. package/scripts/tableau.mjs +127 -108
  118. package/scripts/ticket-du-circuit.mjs +22 -0
  119. package/scripts/transitions.d.mts +6 -9
  120. package/scripts/transitions.mjs +123 -36
  121. package/scripts/verrou-de-fichier.d.mts +11 -0
  122. package/skills/direct/SKILL.md +21 -11
  123. package/skills/explorateur/SKILL.md +6 -1
  124. package/skills/grill/SKILL.md +9 -7
  125. package/skills/grill/references/paquets.md +4 -4
  126. package/skills/pitmaster/SKILL.md +45 -33
  127. package/skills/pitmaster/references/consigne-agent.md +1 -1
  128. package/skills/relecteur/SKILL.md +8 -1
  129. package/skills/testwriter/SKILL.md +1 -1
  130. package/cadre/templates/projet/vitest.config.ts +0 -44
@@ -1,12 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  // The frame's update: brings what the frame writes in a project to the version of the package
3
3
  // installed, as `npx @turbo/codemod migrate` brings a repository to the version of Turborepo.
4
- // npx grillhouse maj update (npm run grillhouse:maj), after `npm install` of the version wanted
5
- // The mechanism is installation.md §5.2 (the migrations, §5.4), under
6
- // packages/grillhouse/docs/architecture/. The update reads the package's own scripts and template
7
- // (scripts/cadre.mjs, `miseAJour.gabarit` of each declared language), never the network. Any
8
- // argument is refused, `--help` included: the usage is shown, the exit code is non-zero, nothing
9
- // is updated. The frame copies no other file into a project.
4
+ // npx grillhouse maj [<x.y.z>] the montée of the project (npm run grillhouse:maj)
5
+ // The command is the montée (scripts/montee.mjs, installation.md §5.2): a copy of its own on the
6
+ // tip of main, the package installed there, the files below, the machine's part, the verification,
7
+ // the commit and the advance of main. This module holds the files: what the frame writes in a
8
+ // project (`mettreAJour`, `regenerer`, `ecrireLeProjet`, which the montée calls in its copy; the
9
+ // migrations, §5.4), read in the package's own scripts and template (scripts/cadre.mjs,
10
+ // `miseAJour.gabarit` of each declared language), never the network. Another argument than one
11
+ // version, a second one, `--help` included: the usage is shown, exit code 2, nothing is touched.
12
+ // The frame copies no other file into a project.
10
13
  //
11
14
  // In order:
12
15
  // - The languages (`declarerLesLangages`): the column « Langage » of docs/ARCHITECTURE.md
@@ -48,32 +51,28 @@
48
51
  // One that imports a tool the project has not installed (`importe`: the graph's, jsonc-parser) is
49
52
  // not run, as `nx migrate` installs before it runs a migration: its line asks for `npm install`,
50
53
  // then its command.
51
- // - The binaries of the language (`binaires`; cargo: nextest, cargo-deny): installed when missing
52
- // or at another version by `miseAJour.installation`; one that fails has its line, exit code non-zero.
53
- // `npx grillhouse binaires` plays the same alone (scripts/binaires.mjs).
54
- // - The plugins (scripts/greffons.mjs): installed for the project, the frame's mod brought to the
55
- // package's version; a failure has its line naming the command, exit code non-zero.
56
54
  // - The group: `grillhouse.groupe` of the main tree (`groupeDe`) sets each other project as a Beads
57
55
  // `external_projects.<name>`, the ones set left alone; a group badly declared is refused first.
58
56
  //
59
- // The report names first the frame's version and, in `LIGNE_DU_CADRE`, the command that installs
60
- // another one (npm never brings the next minor of a 0.x). Last, `npm run verifier` is played from
61
- // the root, unless files are left to finish, there is no `verifier` script, or `npm install` is
62
- // asked first; its green keeps the last green (scripts/dernier-vert.mjs). The last line says the
63
- // outcome: green; red, its code; 75, « à repasser ».
57
+ // The report names first the frame's version and, in `LIGNE_DU_CADRE`, the command that takes
58
+ // another one, then the version of the montée, the key written, each migration, each entry written,
59
+ // and what stays to the project, « reste au projet ». An `aFaire`, a failed `npm install` or
60
+ // generator leaves the montée to finish: it commits nothing. `verifier` plays `npm run verifier`
61
+ // in the copy, of the sort « Montée », its line saying green, red with its code, or 75, « à
62
+ // repasser ».
64
63
  import { spawnSync } from 'node:child_process';
65
64
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
66
65
  import path from 'node:path';
67
66
  import { pathToFileURL } from 'node:url';
67
+ import { X_Y_Z } from './aiguillage.mjs';
68
68
  import { CADRE, VERSION } from './cadre.mjs';
69
- import { installerBinaires } from './binaires.mjs';
70
69
  import { poserCrochets } from './crochets.mjs';
71
70
  import { SORTE_DE_LA_MONTEE } from './places-de-la-machine.mjs';
72
71
  import { ATTRIBUT } from './fusion-du-changelog.mjs';
73
72
  import { fluxSansEntree } from './flux-des-paquets.mjs';
74
- import { installerGreffons } from './greffons.mjs';
75
73
  import { groupeDe, projetsExternes } from './groupe-cles.mjs';
76
74
  import { migrer, restesAuProjet } from './migrations.mjs';
75
+ import { ecrireLaCle } from './outil.mjs';
77
76
  import { arbrePrincipal } from './outils-cles.mjs';
78
77
  import { generateursDe, langageDe, langagesDe } from './langages.mjs';
79
78
  import * as langagesDansLArchitecture from './migrations/0.27.0-langages-dans-l-architecture.mjs';
@@ -295,7 +294,11 @@ function cleActive(projet) {
295
294
  * trial's own in the tests); <inscrite> is the version it records (the package's; null records
296
295
  * none, the project keeping its own). Returns what changed.
297
296
  */
298
- export function mettreAJour(projet, source, { inscrite = VERSION, bd = jouerBd } = {}) {
297
+ export function mettreAJour(
298
+ projet,
299
+ source,
300
+ { inscrite = VERSION, bd = jouerBd, crochetsDansLArbre = false } = {}
301
+ ) {
299
302
  // The group the project declares, read in its main tree (`groupeDe`), refused by its key before
300
303
  // any work.
301
304
  const groupe = groupeDe(projet);
@@ -433,7 +436,7 @@ export function mettreAJour(projet, source, { inscrite = VERSION, bd = jouerBd }
433
436
  }
434
437
  bilan.ligneEtat = reglerLigneEtat(projet);
435
438
  bilan.greffon = declarerGreffon(projet);
436
- poserCrochets(projet);
439
+ poserCrochets(projet, { dansLArbre: crochetsDansLArbre });
437
440
  attribuer(projet);
438
441
  bilan.workflows = poserLesWorkflows(projet, source);
439
442
  bilan.projetsExternes = poserLesProjetsExternes(projet, groupe, bd);
@@ -488,12 +491,17 @@ export function regenerer(projet, { tous = false, langage = null } = {}) {
488
491
  return lignes;
489
492
  }
490
493
 
491
- /** The report of an update, from the bilan <b> of `mettreAJour`: one line per change. */
492
- export function rapport(b) {
494
+ /**
495
+ * The report of an update, from the bilan <b> of `mettreAJour`: one line per change; `installe`:
496
+ * the caller installs the dependencies added itself.
497
+ */
498
+ export function rapport(b, { installe = false } = {}) {
493
499
  const lignes = [];
494
500
  if (b.dependances.length > 0) {
495
501
  lignes.push(
496
- `Dépendances de développement ajoutées : ${b.dependances.join(', ')}. \`npm install\` les installe.`
502
+ `Dépendances de développement ajoutées : ${b.dependances.join(', ')}. ${
503
+ installe ? 'La montée joue `npm install`.' : '`npm install` les installe.'
504
+ }`
497
505
  );
498
506
  }
499
507
  lignes.push(...(b.duLangage?.lignes ?? []));
@@ -560,7 +568,7 @@ export function verifier(projet, { fichiersAFinir, installer, sansVerifier }) {
560
568
  return {
561
569
  code: null,
562
570
  erreur: true,
563
- ligne: `Vérification non jouée : la mise à jour laisse à faire ci-dessus ; ${VERT_INTACT}. Fais-le, puis \`npm run verifier\`.${POSTE_FERME}`,
571
+ ligne: `Vérification non jouée : la mise à jour laisse à faire ci-dessus ; ${VERT_INTACT}. Fais-le, puis \`npm run verifier\`, ou rejoue la montée.${POSTE_FERME}`,
564
572
  };
565
573
  }
566
574
  if (typeof lireJson(path.join(projet, 'package.json'), {})?.scripts?.verifier !== 'string') {
@@ -592,14 +600,14 @@ export function verifier(projet, { fichiersAFinir, installer, sansVerifier }) {
592
600
  code,
593
601
  erreur: false,
594
602
  ligne:
595
- 'Vérification : `npm run verifier` vert ; il pose le dernier vert sur l’arbre que laisse la mise à jour. Commite ces changements tels quels : une copie partie de ce commit mesure contre ce vert.',
603
+ 'Vérification : `npm run verifier` vert ; il pose le dernier vert sur l’arbre que laisse la mise à jour.',
596
604
  };
597
605
  }
598
606
  if (code === 75) {
599
607
  return {
600
608
  code,
601
609
  erreur: true,
602
- ligne: `Vérification : \`npm run verifier\` à repasser (code 75) ; ni vert ni rouge, ${VERT_INTACT}. Relance \`npm run verifier\` plus tard.${POSTE_FERME}`,
610
+ ligne: `Vérification : \`npm run verifier\` à repasser (code 75) ; ni vert ni rouge, ${VERT_INTACT}. Rejoue la montée plus tard.${POSTE_FERME}`,
603
611
  };
604
612
  }
605
613
  const cause = r.error ? ` (${r.error.message})` : '';
@@ -611,87 +619,99 @@ export function verifier(projet, { fichiersAFinir, installer, sansVerifier }) {
611
619
  }
612
620
 
613
621
  const USAGE =
614
- 'Usage : npx grillhouse maj met le projet à jour du paquet installé (npm install -D @roomi-fields/grillhouse@<version> d’abord)\n';
622
+ 'Usage : npx grillhouse maj [<x.y.z>] monte le projet à la version voulue, la version gardée sans elle\n';
615
623
 
616
- /** The first line of the report: the version installed, and the command that installs another. */
617
- export const LIGNE_DU_CADRE = `Cadre ${VERSION}, la version installée ; une autre s'installe d'abord par \`npm install -D @roomi-fields/grillhouse@<version>\` (une plage ^0.x n'admet pas la mineure suivante).`;
618
-
619
- if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
620
- if (process.argv.length > 2) {
621
- process.stderr.write(USAGE);
622
- process.exitCode = 2;
623
- } else {
624
- const projet = process.cwd();
625
- // The languages first: the migrations of the declared languages play with the core's.
626
- let premiere;
627
- try {
628
- premiere = declarerLesLangages(projet);
629
- } catch (e) {
630
- process.stderr.write(`⛔ ${e.message.replace(/^⛔ /, '')}\n`);
631
- process.exitCode = 1;
632
- }
633
- if (premiere !== undefined) {
634
- mettreAJourLeProjet(projet, premiere);
635
- }
636
- }
637
- }
624
+ /** The first line of the report: the version installed, and the command that takes another. */
625
+ export const LIGNE_DU_CADRE = `Cadre ${VERSION}, la version installée ; une autre se prend par \`npx grillhouse maj <x.y.z>\`.`;
638
626
 
639
627
  // A migration as the report names it: its version, none before the release that numbers it.
640
628
  function titre(version, nom) {
641
629
  return `Migration ${version ?? 'de la prochaine sortie'} (${nom})`;
642
630
  }
643
631
 
644
- // The update of the project at <projet>, its languages declared (declarerLesLangages), <premiere>
645
- // what the migration of its languages did, null for nothing.
646
- function mettreAJourLeProjet(projet, premiere) {
632
+ /**
633
+ * Brings the files of the copy `projet` of the montée to `version` (see the header), the report on
634
+ * the standard output; `duCadre`: the repository of the frame, whose key `grillhouse.outil` it
635
+ * writes, as it writes that of a project that holds one; `noterSansVerifier` receives the line of
636
+ * the language on a project without script `verifier`, which `verifier` says. Returns whether
637
+ * something is left to finish, said on the error stream.
638
+ */
639
+ export function ecrireLeProjet(projet, { version, duCadre, noterSansVerifier = () => {} }) {
640
+ const signaler = l => process.stderr.write(`${l}\n`);
641
+ // The languages first: the migrations of the declared languages play with the core's.
642
+ let premiere;
643
+ try {
644
+ premiere = declarerLesLangages(projet);
645
+ } catch (e) {
646
+ signaler(`⛔ ${e.message.replace(/^⛔ /, '')}`);
647
+ return true;
648
+ }
649
+ process.stdout.write(`${LIGNE_DU_CADRE}\nMontée à ${version}.\n`);
650
+ const pkg = lireJson(path.join(projet, 'package.json'), {});
651
+ if (duCadre || typeof pkg.grillhouse?.outil === 'string') {
652
+ if (pkg.grillhouse?.outil !== version) {
653
+ ecrireLaCle(projet, version);
654
+ process.stdout.write(`Clé grillhouse.outil : ${version}.\n`);
655
+ }
656
+ }
647
657
  const depuis = versionDuProjet(projet);
648
658
  const migrations = [...(premiere ? [premiere] : []), ...migrer(projet, depuis)];
649
659
  const resteAFaire = migrations.some(m => m.aFaire.length > 0);
650
- const b = mettreAJour(projet, CADRE, resteAFaire ? { inscrite: null } : {});
651
- process.stdout.write(`${LIGNE_DU_CADRE}\n`);
652
- for (const { version, nom, lignes, aFaire } of migrations) {
653
- process.stdout.write(`${titre(version, nom)} :\n${lignes.map(l => `- ${l}\n`).join('')}`);
660
+ const b = mettreAJour(projet, CADRE, {
661
+ crochetsDansLArbre: true,
662
+ ...(resteAFaire ? { inscrite: null } : {}),
663
+ });
664
+ for (const { version: v, nom, lignes, aFaire } of migrations) {
665
+ process.stdout.write(`${titre(v, nom)} :\n${lignes.map(l => `- ${l}\n`).join('')}`);
654
666
  if (aFaire.length > 0) {
655
- process.stderr.write(
656
- `${titre(version, nom)}, à faire :\n${aFaire.map(l => `- ${l}\n`).join('')}`
657
- );
658
- process.exitCode = 1;
667
+ signaler(`${titre(v, nom)}, à faire :\n${aFaire.map(l => `- ${l}`).join('\n')}`);
659
668
  }
660
669
  }
661
- process.stdout.write(rapport(b));
670
+ process.stdout.write(rapport(b, { installe: true }));
671
+ noterSansVerifier(b.duLangage.sansVerifier);
662
672
  // What the language leaves to the project comes first, before any of its tools runs.
663
673
  const duLangage = b.duLangage.aFaire;
664
- for (const l of duLangage) {
665
- process.stderr.write(`${l}\n`);
666
- process.exitCode = 1;
667
- }
674
+ duLangage.forEach(signaler);
668
675
  if (b.prefixe?.manque) {
669
- process.stderr.write(
670
- `Préfixe des tickets : le store de Beads n'en donne aucun ; pose \`issue-prefix: "<préfixe des tickets du projet>"\` dans ${CONFIG_BEADS}, le préfixe étant celui que le projet choisit.\n`
676
+ signaler(
677
+ `Préfixe des tickets : le store de Beads n'en donne aucun ; pose \`issue-prefix: "<préfixe des tickets du projet>"\` dans ${CONFIG_BEADS}, le préfixe étant celui que le projet choisit.`
671
678
  );
672
- process.exitCode = 1;
673
679
  }
674
- const binaires = installerBinaires(projet);
675
- if (binaires.installes.length > 0) {
676
- process.stdout.write(`Binaires installés : ${binaires.installes.join(', ')}.\n`);
680
+ let installationEnEchec = false;
681
+ if (aInstaller(b)) {
682
+ const r = spawnSync('npm', ['install'], { cwd: projet, stdio: 'inherit' });
683
+ if (r.status !== 0) {
684
+ installationEnEchec = true;
685
+ signaler(`⛔ \`npm install\` dans ${projet} échoue (code ${r.status}).`);
686
+ }
677
687
  }
678
688
  const echecsDesGeneres = regenerer(projet);
679
- for (const l of [...binaires.lignes, ...echecsDesGeneres, ...installerGreffons(projet)]) {
680
- process.stderr.write(`${l}\n`);
681
- process.exitCode = 1;
682
- }
683
- for (const { version, nom, lignes } of restesAuProjet(projet, depuis)) {
689
+ echecsDesGeneres.forEach(signaler);
690
+ for (const { version: v, nom, lignes } of restesAuProjet(projet, depuis)) {
684
691
  process.stdout.write(
685
- `${titre(version, nom)}, reste au projet :\n${lignes.map(l => `- ${l}\n`).join('')}`
692
+ `${titre(v, nom)}, reste au projet :\n${lignes.map(l => `- ${l}\n`).join('')}`
686
693
  );
687
694
  }
688
- const v = verifier(projet, {
689
- fichiersAFinir: resteAFaire || duLangage.length > 0 || echecsDesGeneres.length > 0,
690
- installer: aInstaller(b),
691
- sansVerifier: b.duLangage.sansVerifier,
692
- });
693
- (v.erreur ? process.stderr : process.stdout).write(`${v.ligne}\n`);
694
- if (v.code !== null && !process.exitCode) {
695
- process.exitCode = v.code;
695
+ return (
696
+ resteAFaire ||
697
+ duLangage.length > 0 ||
698
+ Boolean(b.prefixe?.manque) ||
699
+ installationEnEchec ||
700
+ echecsDesGeneres.length > 0
701
+ );
702
+ }
703
+
704
+ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
705
+ const args = process.argv.slice(2);
706
+ if (args.length > 1 || (args[0] !== undefined && !X_Y_Z.test(args[0]))) {
707
+ process.stderr.write(USAGE);
708
+ process.exitCode = 2;
709
+ } else {
710
+ // Loaded for the command alone: the readers of the files above need nothing of the montée.
711
+ import('./montee.mjs').then(({ monter, monteeRecue, suivre }) => {
712
+ const recue = monteeRecue();
713
+ const deLaMaj = { ecrireLeProjet, verifier };
714
+ process.exitCode = recue ? suivre(recue, deLaMaj) : monter(args[0] ?? null, deLaMaj);
715
+ });
696
716
  }
697
717
  }
package/scripts/init.mjs CHANGED
@@ -86,7 +86,7 @@ export function initialiser(dossier, prefixe) {
86
86
  const projet = path.resolve(dossier);
87
87
  if (existsSync(projet) && readdirSync(projet).length > 0) {
88
88
  throw new Error(
89
- `${dossier} n'est pas vide : grillhouse init crée un projet neuf. Un projet existant adopte le cadre par npm install -D ${PAQUET_DU_CADRE}, puis npx grillhouse maj.`
89
+ `${dossier} n'est pas vide : grillhouse init crée un projet neuf. Un projet existant adopte le cadre : il copie les fichiers du gabarit, les commite, puis lance npx -p ${PAQUET_DU_CADRE}@${VERSION} grillhouse maj ${VERSION}.`
90
90
  );
91
91
  }
92
92
  mkdirSync(projet, { recursive: true });
@@ -286,7 +286,7 @@ function remplacer(o, tip, tete) {
286
286
  if (!engendresSeuls) {
287
287
  dansCopie('rebase', '--abort');
288
288
  return {
289
- conflit: true,
289
+ conflit: conflits.length > 0,
290
290
  sortie: [
291
291
  'elle ne se replace pas sur main.',
292
292
  conflits.length
@@ -607,7 +607,10 @@ export function direLIssue(o, entree, r) {
607
607
  const commenter = texte => commenterAu(o, entree.ticket, texte);
608
608
  if (r.sortie) {
609
609
  const [titre, detail] = r.sortie;
610
- const texte = `## Sortie de la file\n\nLa branche ${entree.branche} ne peut pas entrer sur ${o.principale} : ${titre}\n${detail}\n\nLa branche reste en place ; la relance du ticket remet son lot en travail local sur ${o.principale}.`;
610
+ const suite = r.conflit
611
+ ? 'son circuit remet son lot en travail local à sa base, puis revient à la passe qui le juge, qui avance la copie.'
612
+ : `la relance du ticket remet son lot en travail local sur ${o.principale}.`;
613
+ const texte = `## Sortie de la file\n\nLa branche ${entree.branche} ne peut pas entrer sur ${o.principale} : ${titre}\n${detail}\n\nLa branche reste en place ; ${suite}`;
611
614
  o.bd('update', entree.ticket, '--status', 'open', '--remove-label', 'en-file');
612
615
  commenter(texte);
613
616
  o.dire(`✗ ${entree.branche} sort de la file : ${titre}`);
@@ -79,7 +79,8 @@
79
79
  // The main tree is not touched. The duration is written at the end.
80
80
  // One integration runs at a time (`.git/integration.lock`): another waits for the end of the
81
81
  // running one; a lock whose process is gone is taken over. Exit code: 0 committed, 1 refused,
82
- // 2 usage.
82
+ // 2 usage, 3 refused because a lot does not apply on main (`LOT_NE_S_APPLIQUE_PAS` of
83
+ // scripts/etapes.mjs).
83
84
  // Called without a lot to apply (neither `--tests` nor `--code`), it does not commit: the lot is
84
85
  // already on main (`lotSurMain`, exit 0, nothing done) or it is refused by the name `lot-absent`
85
86
  // (exit 1), the same rule the circuit's resumption reads (scripts/activites.mjs).
@@ -96,6 +97,7 @@ import {
96
97
  poserLesRetires,
97
98
  touchesPar,
98
99
  } from '../engendres.mjs';
100
+ import { LOT_NE_S_APPLIQUE_PAS } from '../etapes.mjs';
99
101
  import { langageDe } from '../langages.mjs';
100
102
  import { prefixe } from '../prefixe-des-tickets.mjs';
101
103
  import { commitsDelivering, gitLog } from '../un-commit-par-ticket.mjs';
@@ -494,7 +496,8 @@ export function main(argv, ou = process.cwd()) {
494
496
  for (const p of lots) {
495
497
  const r = dansCopie('apply', '--3way', '--index', ...sansEntiers, p);
496
498
  if (r.status !== 0) {
497
- return refuser(`Le lot ${p} ne s'applique pas :\n${r.stdout}${r.stderr}`);
499
+ refuser(`Le lot ${p} ne s'applique pas :\n${r.stdout}${r.stderr}`);
500
+ return LOT_NE_S_APPLIQUE_PAS;
498
501
  }
499
502
  }
500
503
  // The generated files the lots remove from the key follow the lots: main's version is not kept.
@@ -505,9 +508,16 @@ export function main(argv, ou = process.cwd()) {
505
508
  touchees: aRegenerer,
506
509
  arbre: copie,
507
510
  });
508
- const suivis = poserLesRetires({ lots, fichiers: part.suivis, dansCopie });
511
+ let neSAppliquePas = false;
512
+ const suivis = poserLesRetires({
513
+ lots,
514
+ fichiers: part.suivis,
515
+ dansCopie,
516
+ surNonApplique: () => (neSAppliquePas = true),
517
+ });
509
518
  if (suivis) {
510
- return refuser(suivis);
519
+ const refus = refuser(suivis);
520
+ return neSAppliquePas ? LOT_NE_S_APPLIQUE_PAS : refus;
511
521
  }
512
522
  const divergents = avecCopie ? differents(copieTicket, lots, fichiers, tmp) : [];
513
523
  if (divergents.length) {
@@ -479,6 +479,17 @@ export function ecrireLePrefixe(racine: string, valeur: string): string | null;
479
479
  export function lirePression(fichier?: string): number | null;
480
480
  /** The pressure `p` as a line says it. */
481
481
  export function ecrirePression(p: number | null): string;
482
+ /** Waits until the pressure (`lire`) is under the threshold, or until the instant `limite` (ms),
483
+ * saying through `dire` that it waits, one line per 30 s at most: true at rest, or on a pressure
484
+ * that does not read, said; false at the bound (scripts/mesure/pression.mjs). */
485
+ export function attendreLeRepos(o: {
486
+ lire?: () => number | null;
487
+ maintenant?: () => number;
488
+ dormir?: (ms: number) => void;
489
+ limite: number;
490
+ pasMs?: number;
491
+ dire: (ligne: string) => void;
492
+ }): boolean;
482
493
  /** The variable naming the files changed since the last green (scripts/dernier-vert.mjs). */
483
494
  export const CHANGEMENTS: string;
484
495
  /** The variable naming the commit of the last green a run measures itself from. */
@@ -526,6 +537,11 @@ export function sources(racine: string, dossier?: string): string[];
526
537
  export function paquetsSansPackageJson(
527
538
  racine: string
528
539
  ): { langage: string; chemin: string; nom: string }[];
540
+ /** The gesture by hand, said to the user, that makes the package `nom` of the folder `dossier`
541
+ * (absolute) a package of the graph of the project at `racine`: its package.json in full, and its
542
+ * entry in the root `workspaces` when no pattern selects it; null for the root itself
543
+ * (scripts/paquet-npm.mjs). */
544
+ export function gesteDuPackageJson(racine: string, dossier: string, nom: string): string | null;
529
545
  /** The names of the providers of `grillhouse.donnees` of the consumer that holds `chemin` (its
530
546
  * folder from the root), in the project at `dir` (scripts/donnees-cles.mjs); throws the faults of a
531
547
  * faulty key, one per line. */
@@ -47,6 +47,7 @@ import {
47
47
  cheminsDeLaTache,
48
48
  construireDepuisLesArguments,
49
49
  constructionDuGraphe,
50
+ gesteDuPackageJson,
50
51
  GRAPHE_JOUE,
51
52
  joueCeQuiNeSeDivisePas,
52
53
  lancerLesTaches,
@@ -297,7 +298,7 @@ function nomsDuGraphe(racine, projets) {
297
298
  for (const c of projets) {
298
299
  const nom = nomDuPaquet(racine, c.dossier);
299
300
  if (nom === null) {
300
- absents.push(c.nom);
301
+ absents.push(c);
301
302
  } else {
302
303
  noms.add(nom);
303
304
  }
@@ -306,14 +307,20 @@ function nomsDuGraphe(racine, projets) {
306
307
  }
307
308
 
308
309
  // Says each project of <absents> that is no package of the graph: its tests do not play.
309
- function direLesAbsents(absents) {
310
- for (const nom of absents) {
310
+ function direLesAbsents(racine, absents) {
311
+ for (const c of absents) {
311
312
  process.stderr.write(
312
- `⚠️ ${nom} : pas un paquet du graphe (package.json absent) ; ses tests ne se jouent pas : npx grillhouse maj\n`
313
+ `⚠️ ${c.nom} : pas un paquet du graphe (package.json absent) ; ses tests ne se jouent pas${suiteDuGeste(racine, c)}\n`
313
314
  );
314
315
  }
315
316
  }
316
317
 
318
+ // The gesture by hand for the component <c> that is no package of the graph, as the end of its line.
319
+ function suiteDuGeste(racine, c) {
320
+ const geste = gesteDuPackageJson(racine, c.dossier, c.paquet ?? c.nom);
321
+ return geste ? ` : ${geste}` : '.';
322
+ }
323
+
317
324
  // The pass of `tester` in <racine>, its arguments <args>, under <env>: the tasks `test:unit` of the
318
325
  // projects the paths choose (every project that plays tests without a path) as Turborepo's.
319
326
  function tester(racine, args, env) {
@@ -334,11 +341,14 @@ function tester(racine, args, env) {
334
341
  const { noms, absents } = nomsDuGraphe(racine, choisis);
335
342
  if (chemins.length && absents.length) {
336
343
  process.stderr.write(
337
- `⛔ ${absents.join(', ')} : pas un paquet du graphe (package.json absent) : npx grillhouse maj\n`
344
+ `⛔ ${absents.map(c => c.nom).join(', ')} : pas un paquet du graphe (package.json absent)\n`
338
345
  );
346
+ for (const c of absents) {
347
+ process.stderr.write(`${c.nom}${suiteDuGeste(racine, c)}\n`);
348
+ }
339
349
  return 2;
340
350
  }
341
- direLesAbsents(absents);
351
+ direLesAbsents(racine, absents);
342
352
  if (noms.size === 0) {
343
353
  return 0;
344
354
  }
@@ -395,7 +405,7 @@ function verifier(racine, args, env) {
395
405
  return 0;
396
406
  }
397
407
  const { noms, absents } = nomsDuGraphe(racine, composants(racine));
398
- direLesAbsents(absents);
408
+ direLesAbsents(racine, absents);
399
409
  if (noms.size === 0) {
400
410
  return 0;
401
411
  }