@roomi-fields/grillhouse 0.31.0 → 0.33.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 (149) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +40 -0
  3. package/bin/grillhouse.mjs +6 -4
  4. package/cadre/templates/projet/.github/workflows/ci.yml +136 -16
  5. package/cadre/templates/projet/.github/workflows/nuit.yml +111 -0
  6. package/cadre/templates/projet/deployment/docs/01-INSTALL.md +4 -4
  7. package/cadre/templates/projet/package.json +2 -2
  8. package/charte.md +8 -5
  9. package/dist/temporal/circuit/contrat.d.ts +15 -0
  10. package/dist/temporal/circuit/deroule.js +37 -14
  11. package/dist/temporal/circuit/deroule.js.map +1 -1
  12. package/dist/temporal/deroules.d.ts +1 -0
  13. package/dist/temporal/deroules.js +3 -1
  14. package/dist/temporal/deroules.js.map +1 -1
  15. package/dist/temporal/file/activites.d.ts +1 -0
  16. package/dist/temporal/file/activites.js +5 -2
  17. package/dist/temporal/file/activites.js.map +1 -1
  18. package/dist/temporal/file/contrat.d.ts +50 -33
  19. package/dist/temporal/file/contrat.js +2 -2
  20. package/dist/temporal/file/contrat.js.map +1 -1
  21. package/dist/temporal/file/deroule.d.ts +3 -1
  22. package/dist/temporal/file/deroule.js +128 -26
  23. package/dist/temporal/file/deroule.js.map +1 -1
  24. package/dist/temporal/installation.d.ts +3 -2
  25. package/dist/temporal/installation.js +7 -4
  26. package/dist/temporal/installation.js.map +1 -1
  27. package/dist/temporal/nuits/activites.d.ts +10 -0
  28. package/dist/temporal/nuits/activites.js +114 -0
  29. package/dist/temporal/nuits/activites.js.map +1 -0
  30. package/dist/temporal/nuits/appel.d.ts +23 -0
  31. package/dist/temporal/nuits/appel.js +40 -0
  32. package/dist/temporal/nuits/appel.js.map +1 -0
  33. package/dist/temporal/nuits/choix.d.ts +14 -0
  34. package/dist/temporal/nuits/choix.js +119 -0
  35. package/dist/temporal/nuits/choix.js.map +1 -0
  36. package/dist/temporal/nuits/client.d.ts +28 -0
  37. package/dist/temporal/nuits/client.js +83 -0
  38. package/dist/temporal/nuits/client.js.map +1 -0
  39. package/dist/temporal/nuits/commande.d.ts +2 -0
  40. package/dist/temporal/nuits/commande.js +107 -0
  41. package/dist/temporal/nuits/commande.js.map +1 -0
  42. package/dist/temporal/nuits/contrat.d.ts +98 -0
  43. package/dist/temporal/nuits/contrat.js +30 -0
  44. package/dist/temporal/nuits/contrat.js.map +1 -0
  45. package/dist/temporal/nuits/deroule.d.ts +5 -0
  46. package/dist/temporal/nuits/deroule.js +100 -0
  47. package/dist/temporal/nuits/deroule.js.map +1 -0
  48. package/dist/temporal/tickets/activites.d.ts +1 -0
  49. package/dist/temporal/tickets/activites.js +5 -0
  50. package/dist/temporal/tickets/activites.js.map +1 -1
  51. package/dist/temporal/tickets/contrat.d.ts +10 -0
  52. package/dist/temporal/tickets/deroule.js +8 -1
  53. package/dist/temporal/tickets/deroule.js.map +1 -1
  54. package/dist/temporal/travailleur.js +4 -1
  55. package/dist/temporal/travailleur.js.map +1 -1
  56. package/docs/ARCHITECTURE.md +257 -54
  57. package/docs/CADRE.md +41 -1
  58. package/docs/INTERFACE.md +54 -7
  59. package/hooks/hooks.json +4 -0
  60. package/hooks/register.tsx +11 -3
  61. package/package.json +4 -1
  62. package/scripts/abi-des-dependances.mjs +105 -0
  63. package/scripts/activites.mjs +99 -48
  64. package/scripts/aiguillage.mjs +3 -0
  65. package/scripts/attente-au-tour.mjs +99 -0
  66. package/scripts/avancement.mjs +8 -18
  67. package/scripts/base-des-workflows.mjs +57 -0
  68. package/scripts/ci-des-branches.mjs +91 -0
  69. package/scripts/circuit.mjs +99 -5
  70. package/scripts/composants-affectes.mjs +24 -7
  71. package/scripts/composition-des-langages.mjs +3 -0
  72. package/scripts/copies-finies.mjs +8 -1
  73. package/scripts/crochets.mjs +4 -0
  74. package/scripts/dernier-vert.mjs +30 -4
  75. package/scripts/effets.mjs +9 -0
  76. package/scripts/enveloppe/enveloppe.mjs +3 -1
  77. package/scripts/enveloppe/lancer.sh +1 -1
  78. package/scripts/enveloppe/travail-de-la-copie.mjs +219 -59
  79. package/scripts/etapes.mjs +19 -2
  80. package/scripts/faits-du-circuit.mjs +43 -20
  81. package/scripts/fichier-du-poste.mjs +87 -0
  82. package/scripts/grillhouse-maj.mjs +15 -1
  83. package/scripts/integration/file.mjs +215 -275
  84. package/scripts/integration/integrer.mjs +82 -41
  85. package/scripts/integration/rejeu.mjs +13 -64
  86. package/scripts/jointure.d.ts +30 -2
  87. package/scripts/journal-des-etats.d.mts +41 -0
  88. package/scripts/journal-des-etats.mjs +273 -0
  89. package/scripts/journal.mjs +119 -0
  90. package/scripts/langages/cargo/commandes.mjs +81 -19
  91. package/scripts/langages/cargo/exemples.mjs +2 -2
  92. package/scripts/langages/cargo/index.mjs +14 -5
  93. package/scripts/langages/cargo/tailles-des-tests.mjs +19 -11
  94. package/scripts/langages/python/commandes.mjs +11 -7
  95. package/scripts/langages/python/exemples.mjs +1 -1
  96. package/scripts/langages/python/index.mjs +11 -2
  97. package/scripts/langages/python/tailles-des-tests.mjs +19 -11
  98. package/scripts/langages/typescript/code-mort.mjs +41 -24
  99. package/scripts/langages/typescript/consommateurs.mjs +28 -17
  100. package/scripts/langages/typescript/exemples.mjs +2 -0
  101. package/scripts/langages/typescript/frontieres.mjs +46 -0
  102. package/scripts/langages/typescript/index.mjs +24 -3
  103. package/scripts/langages/typescript/migrations/0.33.0-binaire-de-jour.mjs +34 -0
  104. package/scripts/langages/typescript/migrations/0.33.0-tests-du-poste.mjs +31 -0
  105. package/scripts/langages/typescript/resumes.mjs +17 -7
  106. package/scripts/langages/typescript/tailles-des-tests.mjs +251 -22
  107. package/scripts/langages/typescript/tests-de-nuit.mjs +101 -9
  108. package/scripts/langages/typescript/tests-du-poste.mjs +172 -0
  109. package/scripts/langages/typescript/tranches.mjs +273 -0
  110. package/scripts/langages/typescript/verifier.mjs +154 -23
  111. package/scripts/langages/typescript/vitest-config/base.mjs +3 -0
  112. package/scripts/langages/typescript/vitest-config/cibles.mjs +78 -7
  113. package/scripts/langages/typescript/vitest-config/lances.mjs +4 -4
  114. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +9 -0
  115. package/scripts/langages/typescript/vitest.nuit.config.mjs +3 -2
  116. package/scripts/langages.d.mts +20 -0
  117. package/scripts/lint-des-scripts.mjs +23 -6
  118. package/scripts/matiere-de-test.d.ts +11 -0
  119. package/scripts/migrations/0.33.0-cache-distant.mjs +36 -0
  120. package/scripts/migrations/0.33.0-ci-des-branches-de-ticket.mjs +31 -0
  121. package/scripts/migrations/0.33.0-ci-du-cadre.mjs +31 -0
  122. package/scripts/migrations/0.33.0-node-26.mjs +58 -0
  123. package/scripts/migrations.mjs +8 -0
  124. package/scripts/newday.mjs +18 -0
  125. package/scripts/nuit.sh +40 -13
  126. package/scripts/places-de-la-machine.mjs +6 -0
  127. package/scripts/registre.d.mts +90 -0
  128. package/scripts/registre.mjs +28 -3
  129. package/scripts/reprise.mjs +12 -8
  130. package/scripts/services-du-noyau.mjs +4 -0
  131. package/scripts/session-start.sh +28 -32
  132. package/scripts/sous-commandes.mjs +31 -10
  133. package/scripts/superviseur.mjs +127 -75
  134. package/scripts/tableau.mjs +222 -17
  135. package/scripts/taches-du-graphe.mjs +39 -6
  136. package/scripts/ticket-du-circuit.mjs +37 -7
  137. package/scripts/transitions.mjs +60 -8
  138. package/scripts/verrou-de-machine.mjs +1 -2
  139. package/scripts/workflows-du-cadre.mjs +75 -0
  140. package/skills/developpeur/SKILL.md +1 -1
  141. package/skills/explorateur/SKILL.md +1 -1
  142. package/skills/grill/SKILL.md +10 -62
  143. package/skills/grill/references/paquets.md +60 -0
  144. package/skills/pitmaster/SKILL.md +21 -31
  145. package/skills/questionneur/SKILL.md +1 -1
  146. package/skills/relecteur/SKILL.md +1 -1
  147. package/skills/testwriter/SKILL.md +7 -1
  148. package/skills/release/SKILL.md +0 -134
  149. package/skills/release/scripts/update-version.cjs +0 -92
@@ -0,0 +1,87 @@
1
+ // The variables of the poste a tool of a language reads: a file of the poste, out of every
2
+ // repository, under the frame's directory of configuration (`$XDG_CONFIG_HOME/grillhouse/`,
3
+ // `~/.config/grillhouse/` without it, as the XDG Base Directory Specification places a user's
4
+ // configuration), whose name the module of the language gives (`environnementDuPoste`,
5
+ // scripts/jointure.d.ts): the server of a remote cache, its token, which never enter a
6
+ // repository.
7
+ //
8
+ // - The file holds one `VARIABLE=valeur` per line, as a `.env` of the shell: `export ` before the
9
+ // name, a value between quotes, a blank line and a line of comment (`#`) are read too; any
10
+ // other line is passed over.
11
+ // - The caller decides: when the environment already holds one of the file's variables (a CI
12
+ // that names its own server, empty or not), the file is not applied, and the environment stays
13
+ // as it is. Otherwise the file's variables enter, then the additions of the module (the cache
14
+ // read-only).
15
+ // - A file absent or unreadable, an environment without HOME nor XDG_CONFIG_HOME (the session of
16
+ // an agent, whose home the envelope empties, has no such file): the environment stays as it
17
+ // is.
18
+ import { readFileSync } from 'node:fs';
19
+ import path from 'node:path';
20
+
21
+ const NOM = /^[A-Za-z_][A-Za-z0-9_]*$/;
22
+
23
+ /**
24
+ * The frame's directory of configuration on the poste, from <env>: `$XDG_CONFIG_HOME/grillhouse`,
25
+ * `$HOME/.config/grillhouse` without it; null without either.
26
+ * @param {Record<string, string | undefined>} env
27
+ * @returns {string | null}
28
+ */
29
+ export function configurationDuPoste(env) {
30
+ const base = env.XDG_CONFIG_HOME || (env.HOME ? path.join(env.HOME, '.config') : '');
31
+ return base ? path.join(base, 'grillhouse') : null;
32
+ }
33
+
34
+ /**
35
+ * The variables of the text <texte> of a file of the poste (see the header).
36
+ * @param {string} texte
37
+ * @returns {Record<string, string>}
38
+ */
39
+ export function variablesDuTexte(texte) {
40
+ /** @type {Record<string, string>} */
41
+ const variables = {};
42
+ for (const brute of texte.split('\n')) {
43
+ const ligne = brute.trim().replace(/^export\s+/, '');
44
+ const egal = ligne.indexOf('=');
45
+ if (ligne.startsWith('#') || egal <= 0) {
46
+ continue;
47
+ }
48
+ const nom = ligne.slice(0, egal).trim();
49
+ let valeur = ligne.slice(egal + 1).trim();
50
+ if (/^(['"]).*\1$/.test(valeur) && valeur.length >= 2) {
51
+ valeur = valeur.slice(1, -1);
52
+ }
53
+ if (NOM.test(nom)) {
54
+ variables[nom] = valeur;
55
+ }
56
+ }
57
+ return variables;
58
+ }
59
+
60
+ // The text of <fichier>, or null when it does not read.
61
+ const lireLeFichier = fichier => {
62
+ try {
63
+ return readFileSync(fichier, 'utf8');
64
+ } catch {
65
+ return null;
66
+ }
67
+ };
68
+
69
+ /**
70
+ * The environment <env> with the variables of the file <fichier> of the poste, then <ajouts>; <env>
71
+ * itself when the file is absent, holds no variable, or names one that <env> already holds (see
72
+ * the header).
73
+ * @template {Record<string, string | undefined>} T
74
+ * @param {T} env
75
+ * @param {{ fichier: string, ajouts?: Record<string, string>, lire?: (f: string) => string | null }} o
76
+ * @returns {T}
77
+ */
78
+ export function avecLeFichierDuPoste(env, { fichier, ajouts = {}, lire = lireLeFichier }) {
79
+ const dossier = configurationDuPoste(env);
80
+ const texte = dossier === null ? null : lire(path.join(dossier, fichier));
81
+ const variables = texte === null ? {} : variablesDuTexte(texte);
82
+ const noms = Object.keys(variables);
83
+ if (noms.length === 0 || noms.some(n => env[n] !== undefined)) {
84
+ return env;
85
+ }
86
+ return { ...env, ...variables, ...ajouts };
87
+ }
@@ -22,7 +22,13 @@
22
22
  // migration played, scripts/migrations.mjs: in 0.24.0, a file that still calls a former copy of
23
23
  // the frame; in 0.24.2, API Extractor still declared by the project) is reported on the standard output, « reste au projet », with no effect on the exit
24
24
  // code nor on the version recorded.
25
- // - The frame copies no file into a project: its scripts are the package's, its skills, agents,
25
+ // - The frame's workflows of GitHub Actions (scripts/workflows-du-cadre.mjs): each workflow of the
26
+ // template's `.github/workflows/` (the CI of a lot, `ci.yml`; the night of a shared machine,
27
+ // `nuit.yml`) that the project holds with the frame's mark on its first line is rewritten when
28
+ // it differs, and one it lacks is written once the project holds one of them; a workflow without
29
+ // the mark is the project's, and stays. Their machine is the repository's variable RUNNER on
30
+ // GitHub, which no file holds. The report names each workflow written.
31
+ // - The frame copies no other file into a project: its scripts are the package's, its skills, agents,
26
32
  // hooks of Claude Code, common charter and meta-frame the plugin's, which the package carries
27
33
  // (scripts/cadre.mjs): the frame arrives in one piece, at the version npm installs.
28
34
  // - The frame's plugin is a setting of the project: in a project whose `.claude/settings.json`
@@ -149,6 +155,7 @@ import { installerGreffons } from './greffons.mjs';
149
155
  import { migrer, restesAuProjet } from './migrations.mjs';
150
156
  import { langageDe, langagesDe } from './langages.mjs';
151
157
  import * as langagesDansLArchitecture from './migrations/0.27.0-langages-dans-l-architecture.mjs';
158
+ import { poserLesWorkflows } from './workflows-du-cadre.mjs';
152
159
 
153
160
  const SCRIPTS = {
154
161
  tableau: 'grillhouse tableau --texte',
@@ -321,6 +328,7 @@ export function mettreAJour(projet, source, { inscrite = VERSION } = {}) {
321
328
  gardes: null,
322
329
  ligneEtat: false,
323
330
  greffon: false,
331
+ workflows: [],
324
332
  duLangage: { lignes: [], aFaire: [], installer: false, sansVerifier: null },
325
333
  };
326
334
  const pkg = path.join(projet, 'package.json');
@@ -431,6 +439,7 @@ export function mettreAJour(projet, source, { inscrite = VERSION } = {}) {
431
439
  bilan.greffon = declarerGreffon(projet);
432
440
  poserCrochets(projet);
433
441
  attribuer(projet);
442
+ bilan.workflows = poserLesWorkflows(projet, source);
434
443
  return bilan;
435
444
  }
436
445
 
@@ -544,6 +553,11 @@ export function rapport(b) {
544
553
  `Greffon du cadre : .claude/settings.json déclare la place de marché ${MARCHE_DU_CADRE} (${SOURCE_DU_MARCHE.repo}) et active ${GREFFON_DU_CADRE}.`
545
554
  );
546
555
  }
556
+ if (b.workflows?.length > 0) {
557
+ lignes.push(
558
+ `Workflows du cadre : ${b.workflows.join(', ')} écrit(s) depuis le gabarit ; leur machine est la variable RUNNER du dépôt sur GitHub (ubuntu-latest sans elle), que la mise à jour ne touche pas.`
559
+ );
560
+ }
547
561
  if (b.gardes?.deplace) {
548
562
  lignes.push(
549
563
  `Gardes du projet : le script integration:gardes devient gardes, que \`npm run verifier\` joue à côté des tests.`