@roomi-fields/grillhouse 0.26.0 → 0.27.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/cadre/templates/projet/CLAUDE.md +7 -0
- package/cadre/templates/projet/docs/ARCHITECTURE.md +15 -0
- package/cadre/templates/python/package.json +18 -0
- package/charte.md +22 -0
- package/docs/ARCHITECTURE.md +58 -17
- package/docs/CADRE.md +7 -6
- package/docs/INTERFACE.md +96 -32
- package/package.json +1 -1
- package/scripts/circuit.mjs +44 -8
- package/scripts/commande-du-langage.mjs +2 -2
- package/scripts/commandes-composees.mjs +156 -0
- package/scripts/composition-des-langages.mjs +306 -0
- package/scripts/conformite.mjs +1 -3
- package/scripts/dernier-vert.mjs +15 -2
- package/scripts/engendres.mjs +170 -0
- package/scripts/enveloppe/travail-de-la-copie.mjs +82 -8
- package/scripts/gardes-du-cadre.mjs +7 -4
- package/scripts/grillhouse-maj.mjs +152 -99
- package/scripts/index-interfaces.mjs +78 -0
- package/scripts/init.mjs +5 -5
- package/scripts/integration/file.mjs +74 -13
- package/scripts/integration/integrer.mjs +50 -62
- package/scripts/jointure.d.ts +26 -13
- package/scripts/langages/cargo/binaires.mjs +29 -6
- package/scripts/langages/cargo/clippy.mjs +4 -2
- package/scripts/langages/cargo/commandes.mjs +45 -7
- package/scripts/langages/cargo/exemples.mjs +1 -15
- package/scripts/langages/cargo/index-interfaces.mjs +20 -3
- package/scripts/langages/cargo/index.mjs +9 -10
- package/scripts/langages/cargo/mise-a-jour.mjs +2 -1
- package/scripts/langages/cargo/sccache.mjs +29 -0
- package/scripts/langages/python/binaires.json +3 -0
- package/scripts/langages/python/binaires.mjs +59 -0
- package/scripts/langages/python/commandes.mjs +411 -0
- package/scripts/langages/python/composants.mjs +272 -0
- package/scripts/langages/python/exemples.mjs +260 -0
- package/scripts/langages/python/index-interfaces.mjs +77 -0
- package/scripts/langages/python/index.mjs +94 -0
- package/scripts/langages/python/lot.mjs +76 -0
- package/scripts/langages/python/mise-a-jour.mjs +54 -0
- package/scripts/langages/python/tailles-des-tests.mjs +102 -0
- package/scripts/langages/python/verdict.mjs +85 -0
- package/scripts/langages/typescript/exemples.mjs +1 -20
- package/scripts/langages/typescript/index-interfaces.mjs +10 -3
- package/scripts/langages/typescript/index.mjs +11 -15
- package/scripts/langages-des-paquets.mjs +171 -0
- package/scripts/langages.mjs +60 -41
- package/scripts/migrations/0.27.0-langages-dans-l-architecture.mjs +182 -0
- package/scripts/migrations.mjs +2 -0
- package/scripts/outils-cles.mjs +1 -1
- package/scripts/session-start.sh +34 -9
- package/scripts/sources.mjs +2 -1
- package/scripts/sous-commandes.mjs +5 -3
- package/scripts/tableau-des-composants.mjs +138 -0
- package/scripts/verrous/verrou.mjs +3 -2
- package/skills/grill/SKILL.md +9 -1
- package/skills/pitmaster/SKILL.md +6 -1
- package/skills/redacteur/references/documents-d-un-composant.md +12 -0
- package/skills/testwriter/SKILL.md +6 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// The generated files a project keeps committed, and their regeneration on a tree where a lot is
|
|
2
|
+
// applied. As npm writes package-lock.json again after a merge instead of merging it, and as a
|
|
3
|
+
// genrule of Bazel writes its output again on the merged tree, a derived file is never merged: its
|
|
4
|
+
// command writes it again from its merged sources.
|
|
5
|
+
//
|
|
6
|
+
// - The key `grillhouse.engendres` of the root package.json declares them, read from the main tree
|
|
7
|
+
// of the repository (`engendresDe`), never from a copy, as `grillhouse.outils`
|
|
8
|
+
// (scripts/outils-cles.mjs): `{ "<nom>": { "commande": "<ligne du shell>", "fichiers":
|
|
9
|
+
// ["<motif>"], "lit": ["<motif>"] } }`, each pattern from the root (a path, a directory or a glob
|
|
10
|
+
// pattern, as `couvertPar` reads it), `lit` the files it reads, empty when not given. Each one
|
|
11
|
+
// is read in the form of a file a module of language generates (`FichierEngendre` of
|
|
12
|
+
// scripts/jointure.d.ts): its command writes its `fichiers` in full (`entiers`), and no guard
|
|
13
|
+
// judges it (`gardes` empty). A key without a command, without files, or with a pattern out of
|
|
14
|
+
// the repository (absolute, or climbing above the root) is refused by its name, and gives no
|
|
15
|
+
// generated file: the circuit stops at its launch, the integration, the queue and the move of a
|
|
16
|
+
// copy onto main refuse before any work.
|
|
17
|
+
// - `touchesPar` gives the generated files a lot touches: one of their files, or one they read.
|
|
18
|
+
// - `regenerer` plays the command of each, in order, then stages every file they changed; a command
|
|
19
|
+
// of the project at another code than 0, one of the frame on a real failure (126, 127, a signal,
|
|
20
|
+
// 128 + its number), or a file changed that their `fichiers` do not cover refuses, the command,
|
|
21
|
+
// its code and its output named. The integration (scripts/integration/integrer.mjs), the queue
|
|
22
|
+
// (scripts/integration/file.mjs) and the move of a copy onto main
|
|
23
|
+
// (scripts/enveloppe/travail-de-la-copie.mjs) call it on the tree where they applied the lot,
|
|
24
|
+
// main's version of each file taken.
|
|
25
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
26
|
+
import path from 'node:path';
|
|
27
|
+
import { arbrePrincipal } from './outils-cles.mjs';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Whether one of <motifs> covers the file <fichier>, both from the root of the copy, as the inputs
|
|
31
|
+
* of Turborepo read them: a path names that file, a directory every file under it, a glob pattern
|
|
32
|
+
* (`*`, `**`) the files it matches (`path.matchesGlob` of Node).
|
|
33
|
+
* @param {string[]} motifs
|
|
34
|
+
* @param {string} fichier
|
|
35
|
+
*/
|
|
36
|
+
export function couvertPar(motifs, fichier) {
|
|
37
|
+
return motifs.some(m => {
|
|
38
|
+
const dossier = m.replace(/\/+$/, '');
|
|
39
|
+
return fichier === dossier || fichier.startsWith(`${dossier}/`) || path.matchesGlob(fichier, m);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Whether the pattern <m> leaves the repository: absolute, or climbing above the root.
|
|
44
|
+
const horsDuDepot = m => path.isAbsolute(m) || path.posix.normalize(m).split('/')[0] === '..';
|
|
45
|
+
|
|
46
|
+
// Whether <v> is a list of strings, non-empty ones.
|
|
47
|
+
const motifs = v => Array.isArray(v) && v.every(m => typeof m === 'string' && m !== '');
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The generated files that the package.json <pkg> declares (`grillhouse.engendres`): `engendres`,
|
|
51
|
+
* none when a fault is found; `fautes`, one sentence per fault, naming its key.
|
|
52
|
+
* @param {any} pkg the parsed package.json
|
|
53
|
+
* @returns {{ engendres: { nom: string, commande: string, fichiers: string[], lit: string[], gardes: string[], entiers: string[] }[], fautes: string[] }}
|
|
54
|
+
*/
|
|
55
|
+
export function lireEngendres(pkg) {
|
|
56
|
+
const e = pkg?.grillhouse?.engendres;
|
|
57
|
+
if (e === undefined || e === null) return { engendres: [], fautes: [] };
|
|
58
|
+
if (typeof e !== 'object' || Array.isArray(e)) {
|
|
59
|
+
return {
|
|
60
|
+
engendres: [],
|
|
61
|
+
fautes: [
|
|
62
|
+
`la clé grillhouse.engendres vaut ${JSON.stringify(e)}, pas un objet { nom: { commande, fichiers, lit } }.`,
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** @type {string[]} */
|
|
67
|
+
const fautes = [];
|
|
68
|
+
const engendres = [];
|
|
69
|
+
for (const [nom, v] of Object.entries(e)) {
|
|
70
|
+
const cle = `grillhouse.engendres.${nom}`;
|
|
71
|
+
if (typeof v !== 'object' || v === null || Array.isArray(v)) {
|
|
72
|
+
fautes.push(
|
|
73
|
+
`la clé ${cle} vaut ${JSON.stringify(v)}, pas un objet { commande, fichiers, lit }.`
|
|
74
|
+
);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const avant = fautes.length;
|
|
78
|
+
if (typeof v.commande !== 'string' || v.commande.trim() === '') {
|
|
79
|
+
fautes.push(`la clé ${cle} n'a pas de commande, la ligne du shell qui écrit ses fichiers.`);
|
|
80
|
+
}
|
|
81
|
+
if (!motifs(v.fichiers) || v.fichiers.length === 0) {
|
|
82
|
+
fautes.push(`la clé ${cle} n'a pas de fichiers, les motifs depuis la racine qu'elle écrit.`);
|
|
83
|
+
}
|
|
84
|
+
if (v.lit !== undefined && !motifs(v.lit)) {
|
|
85
|
+
fautes.push(`la clé ${cle}.lit vaut ${JSON.stringify(v.lit)}, pas une liste de motifs.`);
|
|
86
|
+
}
|
|
87
|
+
for (const m of [...(motifs(v.fichiers) ? v.fichiers : []), ...(motifs(v.lit) ? v.lit : [])]) {
|
|
88
|
+
if (horsDuDepot(m)) {
|
|
89
|
+
fautes.push(`la clé ${cle} nomme « ${m} », hors du dépôt : un motif part de la racine.`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (fautes.length === avant) {
|
|
93
|
+
engendres.push({
|
|
94
|
+
nom,
|
|
95
|
+
commande: v.commande,
|
|
96
|
+
fichiers: v.fichiers,
|
|
97
|
+
lit: v.lit ?? [],
|
|
98
|
+
gardes: [],
|
|
99
|
+
entiers: v.fichiers,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { engendres: fautes.length ? [] : engendres, fautes };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The generated files of the project that holds <dir>, from the package.json of its main tree,
|
|
108
|
+
* never of a copy, so that no lot writes the command line the integration then runs; the script
|
|
109
|
+
* that line launches is the one of the tree it runs in, which the lot may change. None without one.
|
|
110
|
+
* @param {string} dir a directory of the project: its main tree or a copy
|
|
111
|
+
* @throws {Error} the faults of the key, one per line
|
|
112
|
+
*/
|
|
113
|
+
export function engendresDe(dir) {
|
|
114
|
+
const f = path.join(arbrePrincipal(dir), 'package.json');
|
|
115
|
+
if (!existsSync(f)) return [];
|
|
116
|
+
const { engendres, fautes } = lireEngendres(JSON.parse(readFileSync(f, 'utf8')));
|
|
117
|
+
if (fautes.length) throw new Error(fautes.join('\n'));
|
|
118
|
+
return engendres;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The generated files of <engendres> the lot of <fichiers> touches: one of the files it writes in
|
|
123
|
+
* full, or one it reads.
|
|
124
|
+
* @template {{ entiers: string[], lit: string[] }} E
|
|
125
|
+
* @param {E[]} engendres
|
|
126
|
+
* @param {string[]} fichiers
|
|
127
|
+
* @returns {E[]}
|
|
128
|
+
*/
|
|
129
|
+
export const touchesPar = (engendres, fichiers) =>
|
|
130
|
+
engendres.filter(e => fichiers.some(f => couvertPar(e.entiers, f) || couvertPar(e.lit, f)));
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Plays the command of each of <refs>, in order (`lancer`, which runs a line of the shell at the
|
|
134
|
+
* root of the tree and gives the result of spawnSync), then stages every file they changed (`dansCopie`, git in the
|
|
135
|
+
* tree, its strings in UTF-8). Null, or the refusal (see the header). The output of a command that
|
|
136
|
+
* passes goes to <ecrire>.
|
|
137
|
+
* @param {{ refs: { nom: string, commande: string, fichiers: string[], cadre?: boolean }[], lancer: (commande: string) => import('node:child_process').SpawnSyncReturns<string>, dansCopie: (...args: string[]) => import('node:child_process').SpawnSyncReturns<string>, ecrire?: (s: string) => void }} o
|
|
138
|
+
* @returns {string | null}
|
|
139
|
+
*/
|
|
140
|
+
export function regenerer({ refs, lancer, dansCopie, ecrire = s => process.stdout.write(s) }) {
|
|
141
|
+
const etat = () => {
|
|
142
|
+
const r = dansCopie('status', '--porcelain=v1', '-z', '-uall', '--no-renames');
|
|
143
|
+
return r.status === 0 ? r.stdout.split('\0').filter(Boolean) : null;
|
|
144
|
+
};
|
|
145
|
+
const avant = etat();
|
|
146
|
+
if (avant === null) return "L'état de l'arbre ne se lit pas.";
|
|
147
|
+
for (const r of refs) {
|
|
148
|
+
const x = lancer(r.commande);
|
|
149
|
+
const sortie = `${x.stdout ?? ''}${x.stderr ?? ''}`;
|
|
150
|
+
const code = x.status ?? 1;
|
|
151
|
+
const panne =
|
|
152
|
+
x.signal !== null || x.error !== undefined || code === 126 || code === 127 || code > 128;
|
|
153
|
+
if (panne || (!r.cadre && code !== 0)) {
|
|
154
|
+
return `La commande de « ${r.nom} » (\`${r.commande}\`) rend le code ${code}. Sa sortie :\n${sortie.trim()}`;
|
|
155
|
+
}
|
|
156
|
+
ecrire(sortie);
|
|
157
|
+
}
|
|
158
|
+
const apres = etat();
|
|
159
|
+
if (apres === null) return "L'état de l'arbre ne se lit pas.";
|
|
160
|
+
const deja = new Set(avant);
|
|
161
|
+
const ecrits = apres.filter(l => !deja.has(l)).map(l => l.slice(3));
|
|
162
|
+
const horsDeclaration = ecrits.filter(f => !refs.some(r => couvertPar(r.fichiers, f)));
|
|
163
|
+
if (horsDeclaration.length) {
|
|
164
|
+
return `La régénération change des fichiers qu'aucune commande rejouée n'écrit :\n${horsDeclaration.map(f => ` ${f}`).join('\n')}`;
|
|
165
|
+
}
|
|
166
|
+
if (ecrits.length && dansCopie('add', '-A', '--', ...ecrits).status !== 0) {
|
|
167
|
+
return "Les fichiers régénérés ne s'ajoutent pas à l'index.";
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
@@ -28,10 +28,22 @@
|
|
|
28
28
|
// that fails after the work is set aside (an untracked file in the way) gives the work back
|
|
29
29
|
// on HEAD; exit 1.
|
|
30
30
|
// - A copy at <cible> already, or without local work, simply fast-forwards; exit 0.
|
|
31
|
+
// - Both: a generated file the project declares (`grillhouse.engendres`, scripts/engendres.mjs,
|
|
32
|
+
// read from the main tree) is not merged, as npm writes package-lock.json again after a merge:
|
|
33
|
+
// when the lot touches one of its files, or one it reads (the copy's untracked files counting),
|
|
34
|
+
// the application leaves its files out (main's version stays), then its command writes them
|
|
35
|
+
// again in the copy, the lot applied, with the tools of the project (`grillhouse.outils`), out
|
|
36
|
+
// of the envelope. A command that fails stops, exit 1, the command, its code and its output
|
|
37
|
+
// named, the rest of the lot in the copy; a faulty key refuses, named, before the copy is
|
|
38
|
+
// touched (OSC Bridge, 2026-10-31: four conflicts in one day on the generated files of synthhub
|
|
39
|
+
// and open-synth-descriptors, each copy moved by hand). A lot in conflict on another file is not
|
|
40
|
+
// regenerated: its conflicts come first.
|
|
31
41
|
import { spawnSync } from 'node:child_process';
|
|
32
42
|
import { existsSync, rmSync, writeFileSync } from 'node:fs';
|
|
33
43
|
import path from 'node:path';
|
|
34
44
|
import { pathToFileURL } from 'node:url';
|
|
45
|
+
import { couvertPar, engendresDe, regenerer, touchesPar } from '../engendres.mjs';
|
|
46
|
+
import { avecLesOutils, outilsDe } from '../outils-cles.mjs';
|
|
35
47
|
|
|
36
48
|
const LOT = 'grillhouse-travail.patch';
|
|
37
49
|
|
|
@@ -47,16 +59,65 @@ const lignes = r =>
|
|
|
47
59
|
// The files of <copie> unmerged in its index.
|
|
48
60
|
const enConflit = copie => lignes(git(copie, ['diff', '--name-only', '--diff-filter=U']));
|
|
49
61
|
|
|
62
|
+
// The files the lot <lot> touches in <copie>: each added, modified or deleted, a rename its source
|
|
63
|
+
// and its destination.
|
|
64
|
+
const fichiersDuLot = (copie, lot) =>
|
|
65
|
+
String(git(copie, ['apply', '--numstat', '-z', '-'], lot).stdout)
|
|
66
|
+
.split('\0')
|
|
67
|
+
.map(l => (l.includes('\t') ? l.split('\t')[2] : l))
|
|
68
|
+
.filter(Boolean);
|
|
69
|
+
|
|
50
70
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
71
|
+
* The keys of the project that holds <copie>, read before any work: `{ engendres, env }`, its
|
|
72
|
+
* generated files and the environment of their commands with its tools, or `{ refus }`.
|
|
73
|
+
* @param {string} copie
|
|
74
|
+
* @returns {{ engendres: any[], env: NodeJS.ProcessEnv, refus?: undefined } | { refus: string }}
|
|
75
|
+
*/
|
|
76
|
+
function lesCles(copie) {
|
|
77
|
+
try {
|
|
78
|
+
return { engendres: engendresDe(copie), env: avecLesOutils(outilsDe(copie), process.env) };
|
|
79
|
+
} catch (e) {
|
|
80
|
+
return {
|
|
81
|
+
refus: `⛔ Une clé grillhouse du package.json est refusée :\n${/** @type {Error} */ (e).message}`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Applies the lot <lot> (a Buffer of `git diff --binary`) three ways to <copie>: `conflits`, the
|
|
88
|
+
* files in conflict, null when git refuses the lot outright. With <cles> (`lesCles`), the generated
|
|
89
|
+
* files the lot (or one of <autres>, the copy's untracked files) touches are left out, then written
|
|
90
|
+
* again by their command once the lot applies without conflict; `refus`, a command that fails.
|
|
53
91
|
* @param {string} copie
|
|
54
92
|
* @param {Buffer} lot
|
|
93
|
+
* @param {{ engendres: any[], env: NodeJS.ProcessEnv } | null} [cles]
|
|
94
|
+
* @param {string[]} [autres]
|
|
95
|
+
* @returns {{ conflits: string[] | null, refus?: string | null }}
|
|
55
96
|
*/
|
|
56
|
-
function appliquer(copie, lot) {
|
|
57
|
-
const
|
|
97
|
+
function appliquer(copie, lot, cles = null, autres = []) {
|
|
98
|
+
const fichiers = cles ? [...fichiersDuLot(copie, lot), ...autres] : [];
|
|
99
|
+
const touches = cles ? touchesPar(cles.engendres, fichiers) : [];
|
|
100
|
+
const exclus = fichiers.filter(f => touches.some(e => couvertPar(e.entiers, f)));
|
|
101
|
+
const r = git(
|
|
102
|
+
copie,
|
|
103
|
+
['apply', '--3way', '--allow-empty', ...exclus.map(f => `--exclude=${f}`), '-'],
|
|
104
|
+
lot
|
|
105
|
+
);
|
|
58
106
|
const conflits = enConflit(copie);
|
|
59
|
-
|
|
107
|
+
if (r.status !== 0 && !conflits.length) return { conflits: null };
|
|
108
|
+
if (conflits.length || !touches.length || !cles) return { conflits };
|
|
109
|
+
const refus = regenerer({
|
|
110
|
+
refs: touches.map(e => ({ ...e, cadre: false })),
|
|
111
|
+
lancer: commande =>
|
|
112
|
+
spawnSync('bash', ['-c', commande], {
|
|
113
|
+
cwd: copie,
|
|
114
|
+
encoding: 'utf8',
|
|
115
|
+
env: cles.env,
|
|
116
|
+
maxBuffer: 1024 * 1024 * 1024,
|
|
117
|
+
}),
|
|
118
|
+
dansCopie: (...args) => spawnSync('git', ['-C', copie, ...args], { encoding: 'utf8' }),
|
|
119
|
+
});
|
|
120
|
+
return { conflits, refus };
|
|
60
121
|
}
|
|
61
122
|
|
|
62
123
|
/**
|
|
@@ -69,10 +130,14 @@ export function reporter(copie, { base, pointe }) {
|
|
|
69
130
|
if (d.status !== 0) {
|
|
70
131
|
return { ok: false, message: `⛔ Le lot de ${base} à ${pointe} ne se lit pas : ${texte(d)}` };
|
|
71
132
|
}
|
|
72
|
-
|
|
133
|
+
const cles = lesCles(copie);
|
|
134
|
+
if (cles.refus !== undefined) return { ok: false, message: cles.refus };
|
|
135
|
+
const a = appliquer(copie, d.stdout, cles);
|
|
136
|
+
if (a.conflits === null) {
|
|
73
137
|
return { ok: false, message: `⛔ Le lot ne s'applique pas à la copie ${copie}.` };
|
|
74
138
|
}
|
|
75
139
|
const r = git(copie, ['reset', '-q']);
|
|
140
|
+
if (a.refus) return { ok: false, message: `⛔ ${a.refus}` };
|
|
76
141
|
return r.status === 0 ? { ok: true, message: '' } : { ok: false, message: texte(r) };
|
|
77
142
|
}
|
|
78
143
|
|
|
@@ -106,6 +171,8 @@ export function avancer(copie, cible) {
|
|
|
106
171
|
message: `⛔ Le travail de la copie ${copie} attend dans ${garde}, que git n'a pas pu remettre en place ; il se reprend à la main (git apply --3way ${garde}, ou il se jette), puis le fichier se retire, avant une relance.`,
|
|
107
172
|
};
|
|
108
173
|
}
|
|
174
|
+
const cles = lesCles(copie);
|
|
175
|
+
if (cles.refus !== undefined) return { ok: false, message: cles.refus };
|
|
109
176
|
const tete = String(git(copie, ['rev-parse', 'HEAD']).stdout).trim();
|
|
110
177
|
const vise = git(copie, ['rev-parse', '--verify', `${cible}^{commit}`]);
|
|
111
178
|
if (vise.status !== 0) {
|
|
@@ -134,7 +201,7 @@ export function avancer(copie, cible) {
|
|
|
134
201
|
const remis = git(copie, ['reset', '-q', '--hard']);
|
|
135
202
|
const ff = remis.status === 0 ? git(copie, ['merge', '-q', '--ff-only', cible]) : remis;
|
|
136
203
|
if (ff.status !== 0) {
|
|
137
|
-
const rendu = appliquer(copie, d.stdout);
|
|
204
|
+
const rendu = appliquer(copie, d.stdout).conflits;
|
|
138
205
|
if (rendu !== null && rendu.length === 0 && git(copie, ['reset', '-q']).status === 0) {
|
|
139
206
|
rmSync(garde, { force: true });
|
|
140
207
|
return {
|
|
@@ -147,7 +214,8 @@ export function avancer(copie, cible) {
|
|
|
147
214
|
message: `⛔ La copie ${copie} ne peut pas avancer sur main : ${texte(ff)}\nSon travail ne se remet pas en place ; il reste dans ${garde}.`,
|
|
148
215
|
};
|
|
149
216
|
}
|
|
150
|
-
const
|
|
217
|
+
const libres = lignes(git(copie, ['ls-files', '--others', '--exclude-standard']));
|
|
218
|
+
const { conflits, refus } = appliquer(copie, d.stdout, cles, libres);
|
|
151
219
|
if (conflits === null) {
|
|
152
220
|
return {
|
|
153
221
|
ok: false,
|
|
@@ -166,6 +234,12 @@ export function avancer(copie, cible) {
|
|
|
166
234
|
};
|
|
167
235
|
}
|
|
168
236
|
const r = git(copie, ['reset', '-q']);
|
|
237
|
+
if (refus) {
|
|
238
|
+
return {
|
|
239
|
+
ok: false,
|
|
240
|
+
message: `⛔ ${refus}\nLe travail de la copie ${copie} est sur main, ses fichiers engendrés à la version de main.`,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
169
243
|
return r.status === 0 ? { ok: true, message: '' } : { ok: false, message: texte(r) };
|
|
170
244
|
}
|
|
171
245
|
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
// npx grillhouse gardes-du-cadre (npm run grillhouse:gardes, a task of Turborepo)
|
|
5
5
|
//
|
|
6
|
-
// - The guards are
|
|
7
|
-
//
|
|
6
|
+
// - The guards are the core's, the languages of the packages first (./langages-des-paquets.mjs:
|
|
7
|
+
// each package follows the language the architecture declares for it), then those of the
|
|
8
|
+
// modules of the project's languages (`gardes`, scripts/jointure.d.ts, scripts/langages.mjs),
|
|
9
|
+
// each module's in their order, the modules in the order of the declaration.
|
|
8
10
|
// - Each guard is a script of the package, and plays in the working directory, under the environment of the run
|
|
9
11
|
// (`GRILLHOUSE_DETTE` among it, scripts/dette.mjs), whatever the verdict of the ones before: a
|
|
10
12
|
// red does not stop the pass, as `--continue` does for Turborepo's tasks.
|
|
@@ -18,13 +20,14 @@
|
|
|
18
20
|
import { spawnSync } from 'node:child_process';
|
|
19
21
|
import path from 'node:path';
|
|
20
22
|
import { pathToFileURL } from 'node:url';
|
|
23
|
+
import { SCRIPT as LANGAGES_DES_PAQUETS } from './langages-des-paquets.mjs';
|
|
21
24
|
import { langageDe } from './langages.mjs';
|
|
22
25
|
import { A_ELAGUER, ecrireSarif, lireSarif, RESULTATS } from './resultats.mjs';
|
|
23
26
|
|
|
24
27
|
// The guards of the frame in the repository at <racine>, each its script and its arguments, in
|
|
25
|
-
// the order they play: the
|
|
28
|
+
// the order they play: the core's, then the languages'.
|
|
26
29
|
export function gardesDuCadre(racine) {
|
|
27
|
-
return langageDe(racine).gardes(racine);
|
|
30
|
+
return [[LANGAGES_DES_PAQUETS], ...langageDe(racine).gardes(racine)];
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
// The name of each guard of the frame, as its findings carry it: its script's, without extension.
|