@roomi-fields/grillhouse 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +96 -0
- package/agents/direct.md +1 -1
- package/cadre/templates/projet/docs/agents/issue-tracker.md +2 -2
- package/cadre/templates/projet/vitest.config.cjs +45 -0
- package/charte/superviseur.md +36 -37
- package/charte.md +13 -1
- package/dist/temporal/circuit/appel.d.ts +2 -0
- package/dist/temporal/circuit/appel.js +24 -2
- package/dist/temporal/circuit/appel.js.map +1 -1
- package/dist/temporal/circuit/client.d.ts +14 -5
- package/dist/temporal/circuit/client.js +41 -9
- package/dist/temporal/circuit/client.js.map +1 -1
- package/dist/temporal/circuit/commande.js +17 -6
- package/dist/temporal/circuit/commande.js.map +1 -1
- package/dist/temporal/circuit/contrat.d.ts +9 -0
- package/dist/temporal/circuit/contrat.js +6 -0
- package/dist/temporal/circuit/contrat.js.map +1 -1
- package/dist/temporal/circuit/deroule.js +29 -12
- package/dist/temporal/circuit/deroule.js.map +1 -1
- package/dist/temporal/client.d.ts +35 -1
- package/dist/temporal/client.js +144 -1
- package/dist/temporal/client.js.map +1 -1
- package/dist/temporal/commande.js +31 -13
- package/dist/temporal/commande.js.map +1 -1
- package/dist/temporal/etat.d.ts +3 -1
- package/dist/temporal/etat.js +31 -17
- package/dist/temporal/etat.js.map +1 -1
- package/dist/temporal/file/activites.js +1 -1
- package/dist/temporal/file/activites.js.map +1 -1
- package/dist/temporal/file/contrat.d.ts +4 -5
- package/dist/temporal/file/contrat.js +2 -2
- package/dist/temporal/file/contrat.js.map +1 -1
- package/dist/temporal/file/deroule.js +7 -5
- package/dist/temporal/file/deroule.js.map +1 -1
- package/dist/temporal/installation.d.ts +116 -53
- package/dist/temporal/installation.js +898 -241
- package/dist/temporal/installation.js.map +1 -1
- package/dist/temporal/nuits/deroule.js +3 -1
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/deroule.js +2 -1
- package/dist/temporal/places/deroule.js.map +1 -1
- package/dist/temporal/sonde/deroule.js +2 -1
- package/dist/temporal/sonde/deroule.js.map +1 -1
- package/dist/temporal/tickets/deroule.js +4 -3
- package/dist/temporal/tickets/deroule.js.map +1 -1
- package/dist/temporal/travailleur.d.ts +7 -1
- package/dist/temporal/travailleur.js +49 -25
- package/dist/temporal/travailleur.js.map +1 -1
- package/docs/INTERFACE.md +37 -12
- package/docs/architecture/circuit.md +21 -18
- package/docs/architecture/entree.md +10 -11
- package/docs/architecture/greffon.md +45 -27
- package/docs/architecture/installation.md +92 -59
- package/docs/architecture/machine.md +2 -2
- package/docs/architecture/tests.md +15 -6
- package/docs/lexique.md +2 -2
- package/hooks/hooks.json +10 -0
- package/hooks/register.tsx +59 -39
- package/package.json +3 -2
- package/scripts/activites.mjs +5 -4
- package/scripts/aiguillage.mjs +5 -2
- package/scripts/bd-garde.mjs +69 -0
- package/scripts/ci-de-main.mjs +259 -56
- package/scripts/circuit.mjs +274 -47
- package/scripts/circuits-du-serveur.mjs +3 -2
- package/scripts/circuits-tenus.d.mts +7 -0
- package/scripts/circuits-tenus.mjs +17 -0
- package/scripts/commandes-composees.mjs +1 -1
- package/scripts/copie-de-montee.mjs +354 -0
- package/scripts/copies-du-depot.d.mts +13 -0
- package/scripts/copies-du-depot.mjs +66 -0
- package/scripts/copies-finies.mjs +6 -40
- package/scripts/crochets.mjs +16 -2
- package/scripts/direct.mjs +2 -2
- package/scripts/droits.mjs +13 -6
- package/scripts/engendres.mjs +5 -3
- package/scripts/enveloppe/travail-de-la-copie.mjs +77 -0
- package/scripts/etapes.mjs +11 -3
- package/scripts/faits-du-circuit.mjs +12 -5
- package/scripts/file-des-tickets.d.mts +13 -2
- package/scripts/file-des-tickets.mjs +71 -21
- package/scripts/greffons.mjs +42 -27
- package/scripts/grillhouse-maj.mjs +105 -85
- package/scripts/init.mjs +1 -1
- package/scripts/integration/file.mjs +5 -2
- package/scripts/integration/integrer.mjs +14 -4
- package/scripts/jointure.d.ts +16 -0
- package/scripts/langages/c/commandes.mjs +18 -8
- package/scripts/langages/cargo/commandes.mjs +88 -35
- package/scripts/langages/cargo/index.mjs +6 -3
- package/scripts/langages/cargo/sccache.mjs +15 -12
- package/scripts/langages/cargo/tailles-des-tests.mjs +115 -6
- package/scripts/langages/python/commandes.mjs +19 -9
- package/scripts/langages/python/squelette.mjs +2 -2
- package/scripts/langages/typescript/code-mort.mjs +36 -3
- package/scripts/langages/typescript/configurations-de-vitest.mjs +118 -0
- package/scripts/langages/typescript/index.mjs +2 -0
- package/scripts/langages/typescript/migrations/configurations-en-commonjs.mjs +370 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +49 -12
- package/scripts/langages/typescript/parcours.mjs +5 -1
- package/scripts/langages/typescript/squelette.mjs +20 -17
- package/scripts/langages/typescript/tests-de-nuit.mjs +3 -3
- package/scripts/langages/typescript/turbo-des-paquets.mjs +24 -37
- package/scripts/langages/typescript/vitest-config/base.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/bornes.mjs +1 -1
- package/scripts/langages/typescript/vitest-config/cibles.mjs +2 -2
- package/scripts/langages/typescript/{vitest.nuit.config.mjs → vitest.nuit.config.cjs} +61 -50
- package/scripts/langages.d.mts +6 -0
- package/scripts/langages.mjs +6 -0
- package/scripts/lire.mjs +236 -0
- package/scripts/mesure/pression.mjs +5 -3
- package/scripts/migrations/cout-des-jetons-au-registre.mjs +136 -0
- package/scripts/migrations/lire-un-ticket.mjs +46 -0
- package/scripts/migrations.mjs +4 -0
- package/scripts/montee.mjs +588 -0
- package/scripts/nuit.sh +21 -12
- package/scripts/outil.mjs +5 -3
- package/scripts/paquet-npm.mjs +22 -0
- package/scripts/paquet.mjs +5 -5
- package/scripts/pre-compact.mjs +25 -0
- package/scripts/registre.d.mts +7 -1
- package/scripts/registre.mjs +114 -102
- package/scripts/reponses-du-circuit.d.mts +17 -2
- package/scripts/reponses-du-circuit.mjs +78 -20
- package/scripts/resultats.mjs +55 -17
- package/scripts/retirer-les-copies-finies.mjs +4 -7
- package/scripts/seances.mjs +28 -3
- package/scripts/services-du-noyau.mjs +7 -2
- package/scripts/session-start.sh +18 -11
- package/scripts/sortie.mjs +4 -7
- package/scripts/sous-commandes.mjs +2 -0
- package/scripts/suiveur.mjs +12 -4
- package/scripts/superviseur.mjs +135 -84
- package/scripts/tableau.mjs +651 -224
- package/scripts/tarifs.mjs +67 -0
- package/scripts/ticket-du-circuit.mjs +25 -4
- package/scripts/transitions.d.mts +6 -14
- package/scripts/transitions.mjs +126 -49
- package/scripts/verdict-de-la-nuit.mjs +2 -2
- package/scripts/verrou-de-fichier.d.mts +11 -0
- package/skills/direct/SKILL.md +21 -11
- package/skills/explorateur/SKILL.md +16 -6
- package/skills/grill/SKILL.md +9 -7
- package/skills/grill/references/paquets.md +4 -4
- package/skills/mesure/SKILL.md +4 -3
- package/skills/pitmaster/SKILL.md +56 -35
- package/skills/pitmaster/references/consigne-agent.md +1 -1
- package/skills/pitmaster/references/erreurs.md +4 -2
- package/skills/pitmaster/references/tour.md +11 -4
- package/skills/relecteur/SKILL.md +8 -1
- package/skills/testwriter/SKILL.md +1 -1
- package/types/index.d.ts +3 -1
- package/cadre/templates/projet/vitest.config.ts +0 -44
- package/scripts/base-des-workflows.mjs +0 -58
|
@@ -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
|
|
5
|
-
// The
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
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
|
|
60
|
-
// another one
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
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(
|
|
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
|
-
/**
|
|
492
|
-
|
|
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(', ')}.
|
|
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
|
|
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.
|
|
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}.
|
|
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
|
|
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
|
|
617
|
-
export const LIGNE_DU_CADRE = `Cadre ${VERSION}, la version installée ; une autre
|
|
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
|
-
|
|
645
|
-
|
|
646
|
-
|
|
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,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
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
|
-
|
|
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
|
-
|
|
665
|
-
process.stderr.write(`${l}\n`);
|
|
666
|
-
process.exitCode = 1;
|
|
667
|
-
}
|
|
674
|
+
duLangage.forEach(signaler);
|
|
668
675
|
if (b.prefixe?.manque) {
|
|
669
|
-
|
|
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
|
|
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
|
-
|
|
675
|
-
if (
|
|
676
|
-
|
|
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
|
-
|
|
680
|
-
|
|
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(
|
|
692
|
+
`${titre(v, nom)}, reste au projet :\n${lignes.map(l => `- ${l}\n`).join('')}`
|
|
686
693
|
);
|
|
687
694
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
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
|
|
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:
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|
package/scripts/jointure.d.ts
CHANGED
|
@@ -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. */
|
|
@@ -42,11 +42,13 @@ import path from 'node:path';
|
|
|
42
42
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
43
43
|
import { RESULTATS } from '../../resultats.mjs';
|
|
44
44
|
import {
|
|
45
|
+
A_REPASSER,
|
|
45
46
|
AttenteDeLaMachine,
|
|
46
47
|
avecLaPasse,
|
|
47
48
|
cheminsDeLaTache,
|
|
48
49
|
construireDepuisLesArguments,
|
|
49
50
|
constructionDuGraphe,
|
|
51
|
+
gesteDuPackageJson,
|
|
50
52
|
GRAPHE_JOUE,
|
|
51
53
|
joueCeQuiNeSeDivisePas,
|
|
52
54
|
lancerLesTaches,
|
|
@@ -79,7 +81,6 @@ const OUTIL = 'turbo';
|
|
|
79
81
|
const RACINE = '//';
|
|
80
82
|
/** The constructions of CMake, one directory per package, at the root. */
|
|
81
83
|
export const CONSTRUCTION = '.build-cmake';
|
|
82
|
-
const A_REPASSER = 75;
|
|
83
84
|
|
|
84
85
|
/** The guards of the module: each its name and its script beside this one. */
|
|
85
86
|
export const GARDES = [
|
|
@@ -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
|
|
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
|
|
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
|
|
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)
|
|
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
|
}
|