@roomi-fields/grillhouse 0.25.4 → 0.26.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/agents/testwriter.md +1 -1
- package/bin/grillhouse.mjs +20 -3
- package/cadre/templates/cargo/package.json +3 -0
- package/cadre/templates/projet/.gitattributes +1 -0
- package/cadre/templates/projet/CLAUDE.md +6 -0
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/charte.md +10 -1
- package/docs/ARCHITECTURE.md +107 -19
- package/docs/INTERFACE.md +19 -5
- package/hooks/register.tsx +57 -16
- package/package.json +9 -3
- package/scripts/circuit.mjs +244 -66
- package/scripts/copies-finies.mjs +345 -0
- package/scripts/crochets.mjs +9 -3
- package/scripts/enveloppe/enveloppe.mjs +59 -17
- package/scripts/enveloppe/lancer.sh +15 -22
- package/scripts/enveloppe/travail-de-la-copie.mjs +188 -0
- package/scripts/etapes.mjs +1 -1
- package/scripts/fusion-du-changelog.mjs +120 -0
- package/scripts/grillhouse-maj.mjs +19 -0
- package/scripts/integration/file.mjs +196 -104
- package/scripts/jointure.d.ts +26 -1
- package/scripts/langages/cargo/binaires.json +2 -1
- package/scripts/langages/cargo/clippy.mjs +10 -2
- package/scripts/langages/cargo/commandes.mjs +77 -22
- package/scripts/langages/cargo/composants.mjs +236 -9
- package/scripts/langages/cargo/index.mjs +17 -8
- package/scripts/langages/cargo/sccache.mjs +143 -0
- package/scripts/langages/cargo/verdict.mjs +52 -11
- package/scripts/langages/typescript/consommateurs.mjs +10 -2
- package/scripts/langages/typescript/index.mjs +4 -2
- package/scripts/langages/typescript/lecteurs.mjs +13 -4
- package/scripts/langages/typescript/references-par-les-types.mjs +5 -1
- package/scripts/langages/typescript/regle-des-tests.mjs +37 -0
- package/scripts/nuit.sh +25 -0
- package/scripts/outils-cles.mjs +188 -0
- package/scripts/resultats.mjs +26 -7
- package/scripts/retirer-copie.sh +2 -1
- package/scripts/sous-commandes.mjs +16 -0
- package/scripts/verrou-de-machine.mjs +14 -13
- package/scripts/verrous/verrou.mjs +50 -14
- package/skills/developpeur/SKILL.md +14 -2
- package/skills/explorateur/SKILL.md +3 -1
- package/skills/pitmaster/SKILL.md +10 -3
- package/skills/pitmaster/references/consigne-agent.md +11 -10
- package/skills/relecteur/SKILL.md +13 -2
- package/skills/testwriter/SKILL.md +23 -6
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The local work of an agent's copy carried onto main, for the launcher (./lancer.sh), in the copy
|
|
3
|
+
// alone: git's stash (refs/stash) is common to every copy of a repository, so the work never goes
|
|
4
|
+
// there; the copy keeps it, as a merge or a rebase in conflict does (its conflicts marked in the
|
|
5
|
+
// files, the unmerged entries in its own index).
|
|
6
|
+
//
|
|
7
|
+
// node scripts/enveloppe/travail-de-la-copie.mjs reporter <copie> <base> <pointe>
|
|
8
|
+
// node scripts/enveloppe/travail-de-la-copie.mjs avancer <copie> <cible>
|
|
9
|
+
//
|
|
10
|
+
// - `reporter`: the lot from <base> to <pointe> (`git diff --binary`), a branch the queue sent
|
|
11
|
+
// back, becomes local work of the copy: applied three ways (`git apply --3way`), a conflict
|
|
12
|
+
// marked in its file, the rest of the lot there; the index is then left as HEAD has it, so that
|
|
13
|
+
// all of it is local work. Exit 0, the conflicts included: the agent's session resolves them.
|
|
14
|
+
// - `avancer`: the copy moves forward to <cible> (the main tree's HEAD) by a fast-forward, its
|
|
15
|
+
// local work kept by the same application: the work as a lot (`git diff --binary HEAD`, the
|
|
16
|
+
// submodules left out, which the launcher sets afterwards; untracked files stay in place), the
|
|
17
|
+
// copy brought back to HEAD, moved forward, the lot applied three ways. The lot waits in the
|
|
18
|
+
// copy's own git directory (`git rev-parse --git-dir`, `grillhouse-travail.patch`) while the
|
|
19
|
+
// copy moves, and goes once it is applied.
|
|
20
|
+
// - Applied without conflict: the index is left as HEAD has it; exit 0.
|
|
21
|
+
// - In conflict: the copy stays as `git merge` leaves it, the conflicts marked in the files and
|
|
22
|
+
// unmerged in the index; the output names the copy and each file in conflict; exit 1.
|
|
23
|
+
// - A copy whose lot still waits in its git directory (git refused it whole, as a deletion of
|
|
24
|
+
// a file main changed) is not touched: the output names the file and how to take it back;
|
|
25
|
+
// exit 1. So no relaunch loses it.
|
|
26
|
+
// - A copy still in conflict (unmerged entries in its index) or whose branch carries commits
|
|
27
|
+
// main has not (no fast-forward) is not touched; the output says why; exit 1. A fast-forward
|
|
28
|
+
// that fails after the work is set aside (an untracked file in the way) gives the work back
|
|
29
|
+
// on HEAD; exit 1.
|
|
30
|
+
// - A copy at <cible> already, or without local work, simply fast-forwards; exit 0.
|
|
31
|
+
import { spawnSync } from 'node:child_process';
|
|
32
|
+
import { existsSync, rmSync, writeFileSync } from 'node:fs';
|
|
33
|
+
import path from 'node:path';
|
|
34
|
+
import { pathToFileURL } from 'node:url';
|
|
35
|
+
|
|
36
|
+
const LOT = 'grillhouse-travail.patch';
|
|
37
|
+
|
|
38
|
+
const git = (copie, args, input) =>
|
|
39
|
+
spawnSync('git', ['-C', copie, ...args], { input, maxBuffer: 1024 * 1024 * 1024 });
|
|
40
|
+
const texte = r => String(r.stderr || r.stdout).trim();
|
|
41
|
+
const lignes = r =>
|
|
42
|
+
String(r.stdout)
|
|
43
|
+
.split('\n')
|
|
44
|
+
.map(l => l.trim())
|
|
45
|
+
.filter(Boolean);
|
|
46
|
+
|
|
47
|
+
// The files of <copie> unmerged in its index.
|
|
48
|
+
const enConflit = copie => lignes(git(copie, ['diff', '--name-only', '--diff-filter=U']));
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Applies the lot <lot> (a Buffer of `git diff --binary`) three ways to <copie>; returns the files
|
|
52
|
+
* in conflict, null when git refuses the lot outright.
|
|
53
|
+
* @param {string} copie
|
|
54
|
+
* @param {Buffer} lot
|
|
55
|
+
*/
|
|
56
|
+
function appliquer(copie, lot) {
|
|
57
|
+
const r = git(copie, ['apply', '--3way', '-'], lot);
|
|
58
|
+
const conflits = enConflit(copie);
|
|
59
|
+
return r.status === 0 || conflits.length ? conflits : null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The lot from <base> to <pointe> as local work of <copie>; returns `{ ok, message }`.
|
|
64
|
+
* @param {string} copie
|
|
65
|
+
* @param {{ base: string, pointe: string }} o
|
|
66
|
+
*/
|
|
67
|
+
export function reporter(copie, { base, pointe }) {
|
|
68
|
+
const d = git(copie, ['diff', '--binary', base, pointe]);
|
|
69
|
+
if (d.status !== 0) {
|
|
70
|
+
return { ok: false, message: `⛔ Le lot de ${base} à ${pointe} ne se lit pas : ${texte(d)}` };
|
|
71
|
+
}
|
|
72
|
+
if (appliquer(copie, d.stdout) === null) {
|
|
73
|
+
return { ok: false, message: `⛔ Le lot ne s'applique pas à la copie ${copie}.` };
|
|
74
|
+
}
|
|
75
|
+
const r = git(copie, ['reset', '-q']);
|
|
76
|
+
return r.status === 0 ? { ok: true, message: '' } : { ok: false, message: texte(r) };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const conflit = (copie, conflits, entete) =>
|
|
80
|
+
[entete, 'Fichiers en conflit :', ...conflits.map(f => ` ${f}`)].join('\n');
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Moves <copie> forward to <cible>, its local work kept in the copy; returns `{ ok, message }`.
|
|
84
|
+
* @param {string} copie
|
|
85
|
+
* @param {string} cible
|
|
86
|
+
*/
|
|
87
|
+
export function avancer(copie, cible) {
|
|
88
|
+
const restants = enConflit(copie);
|
|
89
|
+
if (restants.length) {
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
message: conflit(
|
|
93
|
+
copie,
|
|
94
|
+
restants,
|
|
95
|
+
`⛔ La copie ${copie} garde des conflits non résolus ; ils se résolvent dans la copie avant une relance.`
|
|
96
|
+
),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const garde = path.join(
|
|
100
|
+
path.resolve(copie, String(git(copie, ['rev-parse', '--git-dir']).stdout).trim()),
|
|
101
|
+
LOT
|
|
102
|
+
);
|
|
103
|
+
if (existsSync(garde)) {
|
|
104
|
+
return {
|
|
105
|
+
ok: false,
|
|
106
|
+
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
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const tete = String(git(copie, ['rev-parse', 'HEAD']).stdout).trim();
|
|
110
|
+
const vise = git(copie, ['rev-parse', '--verify', `${cible}^{commit}`]);
|
|
111
|
+
if (vise.status !== 0) {
|
|
112
|
+
return { ok: false, message: `⛔ ${cible} ne nomme aucun commit : ${texte(vise)}` };
|
|
113
|
+
}
|
|
114
|
+
if (tete === String(vise.stdout).trim()) {
|
|
115
|
+
return { ok: true, message: '' };
|
|
116
|
+
}
|
|
117
|
+
if (git(copie, ['merge-base', '--is-ancestor', 'HEAD', cible]).status !== 0) {
|
|
118
|
+
// git's own refusal, which touches nothing: no fast-forward is possible.
|
|
119
|
+
const refus = git(copie, ['merge', '-q', '--ff-only', cible]);
|
|
120
|
+
return {
|
|
121
|
+
ok: false,
|
|
122
|
+
message: `⛔ La copie ${copie} ne peut pas avancer sur main : sa branche porte des commits que main n'a pas (${texte(refus)}) ; son travail reste en place.`,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const d = git(copie, ['diff', '--binary', '--ignore-submodules=all', 'HEAD']);
|
|
126
|
+
if (d.status !== 0) {
|
|
127
|
+
return { ok: false, message: `⛔ Le travail de la copie ne se lit pas : ${texte(d)}` };
|
|
128
|
+
}
|
|
129
|
+
if (d.stdout.length === 0) {
|
|
130
|
+
const ff = git(copie, ['merge', '-q', '--ff-only', cible]);
|
|
131
|
+
return ff.status === 0 ? { ok: true, message: '' } : { ok: false, message: texte(ff) };
|
|
132
|
+
}
|
|
133
|
+
writeFileSync(garde, d.stdout);
|
|
134
|
+
const remis = git(copie, ['reset', '-q', '--hard']);
|
|
135
|
+
const ff = remis.status === 0 ? git(copie, ['merge', '-q', '--ff-only', cible]) : remis;
|
|
136
|
+
if (ff.status !== 0) {
|
|
137
|
+
const rendu = appliquer(copie, d.stdout);
|
|
138
|
+
if (rendu !== null && rendu.length === 0 && git(copie, ['reset', '-q']).status === 0) {
|
|
139
|
+
rmSync(garde, { force: true });
|
|
140
|
+
return {
|
|
141
|
+
ok: false,
|
|
142
|
+
message: `⛔ La copie ${copie} ne peut pas avancer sur main : ${texte(ff)}\nSon travail reste en place.`,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
ok: false,
|
|
147
|
+
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
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const conflits = appliquer(copie, d.stdout);
|
|
151
|
+
if (conflits === null) {
|
|
152
|
+
return {
|
|
153
|
+
ok: false,
|
|
154
|
+
message: `⛔ Le travail de la copie ${copie} ne s'applique pas sur main ; il reste dans ${garde}.`,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
rmSync(garde, { force: true });
|
|
158
|
+
if (conflits.length) {
|
|
159
|
+
return {
|
|
160
|
+
ok: false,
|
|
161
|
+
message: conflit(
|
|
162
|
+
copie,
|
|
163
|
+
conflits,
|
|
164
|
+
`⛔ Le travail en cours de la copie entre en conflit avec main ; il reste dans la copie ${copie}, ses conflits marqués dans ses fichiers.`
|
|
165
|
+
),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const r = git(copie, ['reset', '-q']);
|
|
169
|
+
return r.status === 0 ? { ok: true, message: '' } : { ok: false, message: texte(r) };
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
173
|
+
const [geste, copie, ...reste] = process.argv.slice(2);
|
|
174
|
+
const r =
|
|
175
|
+
geste === 'reporter' && reste.length === 2
|
|
176
|
+
? reporter(copie, { base: reste[0], pointe: reste[1] })
|
|
177
|
+
: geste === 'avancer' && reste.length === 1
|
|
178
|
+
? avancer(copie, reste[0])
|
|
179
|
+
: {
|
|
180
|
+
ok: false,
|
|
181
|
+
message:
|
|
182
|
+
'usage: travail-de-la-copie.mjs reporter <copie> <base> <pointe> | avancer <copie> <cible>',
|
|
183
|
+
};
|
|
184
|
+
if (r.message) {
|
|
185
|
+
process.stdout.write(`${r.message}\n`);
|
|
186
|
+
}
|
|
187
|
+
process.exitCode = r.ok ? 0 : 1;
|
|
188
|
+
}
|
package/scripts/etapes.mjs
CHANGED
|
@@ -251,7 +251,7 @@ export const MONTEES = Object.fromEntries(
|
|
|
251
251
|
'sans-livraison':
|
|
252
252
|
'Le développeur ne change rien et le rouge reste : avec quel contexte le lever, ou le plan doit-il changer ?',
|
|
253
253
|
'relecture-arret':
|
|
254
|
-
'La relecture ne rend pas le lot à un agent (un constat sans destinataire valide, un critère en cause, ou la troisième relecture rendue) : que devient le plan, et qui reprend ?',
|
|
254
|
+
'La relecture ne rend pas le lot à un agent (un constat sans destinataire valide, un constat au testwriter que le plan saute, un critère en cause, ou la troisième relecture rendue) : que devient le plan, et qui reprend ?',
|
|
255
255
|
integration:
|
|
256
256
|
'L’intégration refuse le lot, ou la file rouvre le ticket : que corrige le lot, et qui le reprend ?',
|
|
257
257
|
'hors-portee':
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The frame's merge driver of the CHANGELOG, on the model of gnulib's git-merge-changelog: two
|
|
3
|
+
// lots that each add an entry under the same heading both keep their entry, wherever git merges
|
|
4
|
+
// three ways (the integration's `git apply --3way --index`, the relaunch's `git apply --3way`, the
|
|
5
|
+
// copy's `git merge --ff-only --autostash`, a rebase, a cherry-pick).
|
|
6
|
+
//
|
|
7
|
+
// grillhouse fusion-du-changelog <base> <nous> <eux> git's %O %A %B; writes the result in <nous>
|
|
8
|
+
//
|
|
9
|
+
// - The project's `.gitattributes` names the driver for CHANGELOG.md (ATTRIBUT); git runs the
|
|
10
|
+
// command the repository's configuration gives it (`merge.grillhouse-changelog.driver`), which
|
|
11
|
+
// `poserLePilote` writes with the git hooks (`poserCrochets`, scripts/crochets.mjs), which
|
|
12
|
+
// `grillhouse hooks` (the project's `prepare`, at each `npm install`) and the update of the frame
|
|
13
|
+
// (scripts/grillhouse-maj.mjs, which writes the attribute) run. The command is the main
|
|
14
|
+
// tree's `node_modules/.bin/grillhouse`, found from git's common directory, so that a copy
|
|
15
|
+
// writes the same; without it, git's own merge (`git merge-file`) marks the conflict as git
|
|
16
|
+
// would.
|
|
17
|
+
// - The merge is git's (`git merge-file --diff3`). A conflict whose base is empty is two additions
|
|
18
|
+
// at the same place: both are kept, ours first, then theirs, each word for word. Any other
|
|
19
|
+
// conflict (a line changed on both sides, an addition beside a line the other side changes)
|
|
20
|
+
// stays one: <nous> receives git's marks, and the exit code is 1, as git expects of a driver.
|
|
21
|
+
import { spawnSync } from 'node:child_process';
|
|
22
|
+
import { writeFileSync } from 'node:fs';
|
|
23
|
+
import path from 'node:path';
|
|
24
|
+
import { pathToFileURL } from 'node:url';
|
|
25
|
+
|
|
26
|
+
/** The name of the driver, as `.gitattributes` and the configuration name it. */
|
|
27
|
+
export const PILOTE = 'grillhouse-changelog';
|
|
28
|
+
/** The line of `.gitattributes` that gives the CHANGELOG to the driver. */
|
|
29
|
+
export const ATTRIBUT = `CHANGELOG.md merge=${PILOTE}`;
|
|
30
|
+
|
|
31
|
+
// The marks of the merge the driver reads: longer than any line of a CHANGELOG starts with.
|
|
32
|
+
const TAILLE = 40;
|
|
33
|
+
const DEBUT = `${'<'.repeat(TAILLE)} `;
|
|
34
|
+
const BASE = `${'|'.repeat(TAILLE)} `;
|
|
35
|
+
const MILIEU = '='.repeat(TAILLE);
|
|
36
|
+
const FIN = `${'>'.repeat(TAILLE)} `;
|
|
37
|
+
|
|
38
|
+
const etiquettes = ['-L', 'ours', '-L', 'base', '-L', 'theirs'];
|
|
39
|
+
|
|
40
|
+
// The text of the merge of <nous> and <eux> from <base> when each conflict is two additions, else
|
|
41
|
+
// null.
|
|
42
|
+
function lesAjouts(base, nous, eux) {
|
|
43
|
+
const r = spawnSync(
|
|
44
|
+
'git',
|
|
45
|
+
['merge-file', '-p', '--diff3', `--marker-size=${TAILLE}`, ...etiquettes, nous, base, eux],
|
|
46
|
+
{ encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 }
|
|
47
|
+
);
|
|
48
|
+
if (r.status === null || r.status < 0 || r.status > 127) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const sortie = [];
|
|
52
|
+
let partie = null;
|
|
53
|
+
let conflit = { nous: [], base: [], eux: [] };
|
|
54
|
+
for (const ligne of r.stdout.split(/(?<=\n)/)) {
|
|
55
|
+
const nue = ligne.replace(/\r?\n$/, '');
|
|
56
|
+
if (partie === null && nue.startsWith(DEBUT)) {
|
|
57
|
+
partie = 'nous';
|
|
58
|
+
} else if (partie === 'nous' && nue.startsWith(BASE)) {
|
|
59
|
+
partie = 'base';
|
|
60
|
+
} else if (partie === 'base' && nue === MILIEU) {
|
|
61
|
+
partie = 'eux';
|
|
62
|
+
} else if (partie === 'eux' && nue.startsWith(FIN)) {
|
|
63
|
+
if (conflit.base.length > 0) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
sortie.push(...conflit.nous, ...conflit.eux);
|
|
67
|
+
partie = null;
|
|
68
|
+
conflit = { nous: [], base: [], eux: [] };
|
|
69
|
+
} else if (partie === null) {
|
|
70
|
+
sortie.push(ligne);
|
|
71
|
+
} else {
|
|
72
|
+
conflit[partie].push(ligne);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return partie === null ? sortie.join('') : null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Merges <nous> and <eux> from <base> (paths), the result written in <nous>: 0 when every conflict
|
|
80
|
+
* is two additions, kept both; else 1, <nous> holding git's marks.
|
|
81
|
+
*/
|
|
82
|
+
export function fusionner(base, nous, eux) {
|
|
83
|
+
const texte = lesAjouts(base, nous, eux);
|
|
84
|
+
if (texte !== null) {
|
|
85
|
+
writeFileSync(nous, texte);
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
const r = spawnSync('git', ['merge-file', ...etiquettes, nous, base, eux]);
|
|
89
|
+
return r.status === 0 ? 0 : 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Writes the driver in the configuration of the git repository at <projet> (see the header);
|
|
94
|
+
* nothing outside a repository. Returns whether it is written.
|
|
95
|
+
*/
|
|
96
|
+
export function poserLePilote(projet) {
|
|
97
|
+
const git = (...a) => spawnSync('git', ['-C', projet, ...a], { encoding: 'utf8' });
|
|
98
|
+
const commun = git('rev-parse', '--path-format=absolute', '--git-common-dir');
|
|
99
|
+
if (commun.status !== 0) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
const commande = path.join(path.dirname(commun.stdout.trim()), 'node_modules/.bin/grillhouse');
|
|
103
|
+
const pilote =
|
|
104
|
+
`c='${commande}'; if [ -x "$c" ]; then "$c" fusion-du-changelog %O %A %B; ` +
|
|
105
|
+
`else git merge-file ${etiquettes.join(' ')} %A %O %B; fi`;
|
|
106
|
+
return (
|
|
107
|
+
git('config', '--local', `merge.${PILOTE}.name`, 'the CHANGELOG of Grillhouse').status === 0 &&
|
|
108
|
+
git('config', '--local', `merge.${PILOTE}.driver`, pilote).status === 0
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
113
|
+
const [base, nous, eux] = process.argv.slice(2);
|
|
114
|
+
if (!base || !nous || !eux) {
|
|
115
|
+
process.stderr.write('usage: grillhouse fusion-du-changelog <base> <nous> <eux>\n');
|
|
116
|
+
process.exitCode = 2;
|
|
117
|
+
} else {
|
|
118
|
+
process.exitCode = fusionner(base, nous, eux);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -99,6 +99,10 @@
|
|
|
99
99
|
// `prepare`) also runs, in the hooks folder git reads for the project (`core.hooksPath`, else the
|
|
100
100
|
// default one; the configuration stays). A hook of the project keeps its lines, which still run;
|
|
101
101
|
// the frame's lines of a former version give way to the current ones.
|
|
102
|
+
// - The merge driver of the CHANGELOG (scripts/fusion-du-changelog.mjs): a `.gitattributes`
|
|
103
|
+
// without the line `CHANGELOG.md merge=grillhouse-changelog` receives it, after its own lines,
|
|
104
|
+
// and the driver's command is written in the repository's configuration with the hooks
|
|
105
|
+
// (scripts/crochets.mjs): two lots that each add an entry under the same heading both enter main.
|
|
102
106
|
// - The plugins: after the files, the command line installs the plugins the project's settings
|
|
103
107
|
// declare, for the project, by scripts/greffons.mjs (the mechanism `grillhouse init` also calls;
|
|
104
108
|
// `mettreAJour` itself never calls claude), and brings the frame's mod to the package's version,
|
|
@@ -132,6 +136,7 @@ import path from 'node:path';
|
|
|
132
136
|
import { pathToFileURL } from 'node:url';
|
|
133
137
|
import { CADRE, VERSION } from './cadre.mjs';
|
|
134
138
|
import { poserCrochets } from './crochets.mjs';
|
|
139
|
+
import { ATTRIBUT } from './fusion-du-changelog.mjs';
|
|
135
140
|
import { installerGreffons } from './greffons.mjs';
|
|
136
141
|
import { migrer, restesAuProjet } from './migrations.mjs';
|
|
137
142
|
import { LANGAGES, langage, langageDe, langagesDeclares, langagesTrouves } from './langages.mjs';
|
|
@@ -189,6 +194,19 @@ function ignorer(projet) {
|
|
|
189
194
|
}
|
|
190
195
|
}
|
|
191
196
|
|
|
197
|
+
// Adds to the `.gitattributes` of the project at <projet> the line that gives its CHANGELOG to the
|
|
198
|
+
// frame's merge driver (ATTRIBUT, scripts/fusion-du-changelog.mjs), when no line is it; its own
|
|
199
|
+
// lines stay.
|
|
200
|
+
function attribuer(projet) {
|
|
201
|
+
const f = path.join(projet, '.gitattributes');
|
|
202
|
+
const texte = existsSync(f) ? readFileSync(f, 'utf8') : '';
|
|
203
|
+
if (texte.split('\n').some(l => l.trim() === ATTRIBUT)) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const fin = texte === '' || texte.endsWith('\n') ? '' : '\n';
|
|
207
|
+
writeFileSync(f, `${texte}${fin}${ATTRIBUT}\n`);
|
|
208
|
+
}
|
|
209
|
+
|
|
192
210
|
// <deps> written sorted by name, as npm writes them.
|
|
193
211
|
const trie = deps =>
|
|
194
212
|
Object.fromEntries(Object.entries(deps).sort(([a], [b]) => a.localeCompare(b, 'en')));
|
|
@@ -369,6 +387,7 @@ export function mettreAJour(projet, source, { inscrite = VERSION } = {}) {
|
|
|
369
387
|
bilan.ligneEtat = reglerLigneEtat(projet);
|
|
370
388
|
bilan.greffon = declarerGreffon(projet);
|
|
371
389
|
poserCrochets(projet);
|
|
390
|
+
attribuer(projet);
|
|
372
391
|
return bilan;
|
|
373
392
|
}
|
|
374
393
|
|