@roomi-fields/grillhouse 0.29.0 → 0.31.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 +769 -0
- package/agents/developpeur.md +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/bin/grillhouse.mjs +79 -18
- package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
- package/cadre/templates/projet/CLAUDE.md +5 -1
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +2 -2
- package/charte.md +24 -0
- package/dist/temporal/acte.d.ts +24 -0
- package/dist/temporal/acte.js +139 -0
- package/dist/temporal/acte.js.map +1 -0
- package/dist/temporal/attributs.d.ts +6 -0
- package/dist/temporal/attributs.js +15 -0
- package/dist/temporal/attributs.js.map +1 -0
- package/dist/temporal/circuit/activites.d.ts +13 -0
- package/dist/temporal/circuit/activites.js +33 -0
- package/dist/temporal/circuit/activites.js.map +1 -0
- package/dist/temporal/circuit/client.d.ts +72 -0
- package/dist/temporal/circuit/client.js +247 -0
- package/dist/temporal/circuit/client.js.map +1 -0
- package/dist/temporal/circuit/commande.d.ts +2 -0
- package/dist/temporal/circuit/commande.js +238 -0
- package/dist/temporal/circuit/commande.js.map +1 -0
- package/dist/temporal/circuit/contrat.d.ts +305 -0
- package/dist/temporal/circuit/contrat.js +30 -0
- package/dist/temporal/circuit/contrat.js.map +1 -0
- package/dist/temporal/circuit/deroule.d.ts +3 -0
- package/dist/temporal/circuit/deroule.js +540 -0
- package/dist/temporal/circuit/deroule.js.map +1 -0
- package/dist/temporal/client.d.ts +47 -0
- package/dist/temporal/client.js +69 -0
- package/dist/temporal/client.js.map +1 -0
- package/dist/temporal/commande.d.ts +2 -0
- package/dist/temporal/commande.js +94 -0
- package/dist/temporal/commande.js.map +1 -0
- package/dist/temporal/deroules.d.ts +5 -0
- package/dist/temporal/deroules.js +10 -0
- package/dist/temporal/deroules.js.map +1 -0
- package/dist/temporal/etat.d.ts +33 -0
- package/dist/temporal/etat.js +59 -0
- package/dist/temporal/etat.js.map +1 -0
- package/dist/temporal/file/activites.d.ts +10 -0
- package/dist/temporal/file/activites.js +25 -0
- package/dist/temporal/file/activites.js.map +1 -0
- package/dist/temporal/file/client.d.ts +4 -0
- package/dist/temporal/file/client.js +6 -0
- package/dist/temporal/file/client.js.map +1 -0
- package/dist/temporal/file/contrat.d.ts +158 -0
- package/dist/temporal/file/contrat.js +14 -0
- package/dist/temporal/file/contrat.js.map +1 -0
- package/dist/temporal/file/deroule.d.ts +15 -0
- package/dist/temporal/file/deroule.js +235 -0
- package/dist/temporal/file/deroule.js.map +1 -0
- package/dist/temporal/installation.d.ts +120 -0
- package/dist/temporal/installation.js +386 -0
- package/dist/temporal/installation.js.map +1 -0
- package/dist/temporal/places/activites.d.ts +8 -0
- package/dist/temporal/places/activites.js +13 -0
- package/dist/temporal/places/activites.js.map +1 -0
- package/dist/temporal/places/client.d.ts +28 -0
- package/dist/temporal/places/client.js +64 -0
- package/dist/temporal/places/client.js.map +1 -0
- package/dist/temporal/places/contrat.d.ts +106 -0
- package/dist/temporal/places/contrat.js +21 -0
- package/dist/temporal/places/contrat.js.map +1 -0
- package/dist/temporal/places/deroule.d.ts +3 -0
- package/dist/temporal/places/deroule.js +198 -0
- package/dist/temporal/places/deroule.js.map +1 -0
- package/dist/temporal/sonde/activites.d.ts +6 -0
- package/dist/temporal/sonde/activites.js +52 -0
- package/dist/temporal/sonde/activites.js.map +1 -0
- package/dist/temporal/sonde/contrat.d.ts +35 -0
- package/dist/temporal/sonde/contrat.js +10 -0
- package/dist/temporal/sonde/contrat.js.map +1 -0
- package/dist/temporal/sonde/deroule.d.ts +3 -0
- package/dist/temporal/sonde/deroule.js +39 -0
- package/dist/temporal/sonde/deroule.js.map +1 -0
- package/dist/temporal/tickets/activites.d.ts +7 -0
- package/dist/temporal/tickets/activites.js +81 -0
- package/dist/temporal/tickets/activites.js.map +1 -0
- package/dist/temporal/tickets/client.d.ts +10 -0
- package/dist/temporal/tickets/client.js +31 -0
- package/dist/temporal/tickets/client.js.map +1 -0
- package/dist/temporal/tickets/contrat.d.ts +56 -0
- package/dist/temporal/tickets/contrat.js +13 -0
- package/dist/temporal/tickets/contrat.js.map +1 -0
- package/dist/temporal/tickets/deroule.d.ts +3 -0
- package/dist/temporal/tickets/deroule.js +94 -0
- package/dist/temporal/tickets/deroule.js.map +1 -0
- package/dist/temporal/travailleur.d.ts +2 -0
- package/dist/temporal/travailleur.js +69 -0
- package/dist/temporal/travailleur.js.map +1 -0
- package/docs/ARCHITECTURE.md +646 -87
- package/docs/CADRE.md +27 -0
- package/docs/INTERFACE.md +139 -42
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2255 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +40 -14
- package/scripts/avancement.mjs +155 -26
- package/scripts/bilan.mjs +137 -43
- package/scripts/cadre.mjs +16 -4
- package/scripts/circuit.mjs +993 -4075
- package/scripts/circuits-cles.d.mts +4 -0
- package/scripts/circuits-cles.mjs +21 -0
- package/scripts/circuits-du-serveur.mjs +105 -0
- package/scripts/codes-de-sortie.mjs +9 -0
- package/scripts/commandes-composees.mjs +45 -41
- package/scripts/commandes-du-path.d.mts +7 -0
- package/scripts/commandes-du-path.mjs +25 -0
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +18 -12
- package/scripts/conformite.mjs +56 -28
- package/scripts/copies-finies.mjs +52 -47
- package/scripts/depart-du-ticket.d.mts +53 -0
- package/scripts/depart-du-ticket.mjs +124 -0
- package/scripts/dependances-internes.mjs +121 -0
- package/scripts/dernier-vert.mjs +61 -34
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +244 -0
- package/scripts/droits.mjs +51 -16
- package/scripts/effets.mjs +352 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +259 -55
- package/scripts/enveloppe/lancer.sh +14 -18
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
- package/scripts/etapes.mjs +5 -2
- package/scripts/faits-du-circuit.mjs +493 -0
- package/scripts/file-des-tickets.d.mts +21 -0
- package/scripts/file-des-tickets.mjs +58 -0
- package/scripts/flux-des-paquets.mjs +201 -0
- package/scripts/gardes-du-cadre.mjs +21 -5
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +544 -434
- package/scripts/integration/integrer.mjs +87 -43
- package/scripts/integration/rejeu.mjs +45 -13
- package/scripts/jointure.d.ts +151 -28
- package/scripts/langages/cargo/commandes.mjs +383 -124
- package/scripts/langages/cargo/composants.mjs +154 -42
- package/scripts/langages/cargo/exemples.mjs +12 -21
- package/scripts/langages/cargo/index.mjs +22 -8
- package/scripts/langages/cargo/sccache.mjs +8 -14
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +218 -100
- package/scripts/langages/python/composants.mjs +53 -21
- package/scripts/langages/python/exemples.mjs +6 -16
- package/scripts/langages/python/index.mjs +28 -8
- package/scripts/langages/python/lot.mjs +1 -36
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/construire.mjs +6 -163
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/exemples.mjs +3 -11
- package/scripts/langages/typescript/frontieres.mjs +66 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +50 -61
- package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
- package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
- package/scripts/langages/typescript/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +93 -20
- package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
- package/scripts/langages/typescript/tests.mjs +40 -15
- package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
- package/scripts/langages/typescript/verdict.mjs +4 -2
- package/scripts/langages/typescript/verifier.mjs +58 -20
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
- package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +12 -6
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +56 -18
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +124 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +25 -3
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +18 -8
- package/scripts/paquet-npm.mjs +157 -0
- package/scripts/paquet.mjs +73 -4
- package/scripts/paquets.mjs +46 -10
- package/scripts/passe-de-la-machine.mjs +71 -0
- package/scripts/places-de-la-machine.mjs +414 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +25 -8
- package/scripts/registre.mjs +9 -4
- package/scripts/regles-des-places.d.mts +36 -0
- package/scripts/regles-des-places.mjs +70 -0
- package/scripts/reponses-du-circuit.d.mts +6 -0
- package/scripts/reponses-du-circuit.mjs +28 -0
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +112 -46
- package/scripts/retirer-les-copies-finies.mjs +25 -0
- package/scripts/sans-reponse.d.mts +4 -0
- package/scripts/sans-reponse.mjs +13 -0
- package/scripts/seances.mjs +936 -0
- package/scripts/services-du-noyau.mjs +27 -8
- package/scripts/session-start.sh +2 -2
- package/scripts/sortie.mjs +3 -3
- package/scripts/sous-commandes.mjs +41 -10
- package/scripts/style-a-l-ecriture.mjs +260 -0
- package/scripts/superviseur.mjs +122 -111
- package/scripts/tableau.mjs +180 -117
- package/scripts/taches-du-graphe.mjs +348 -0
- package/scripts/ticket-du-circuit.mjs +216 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +1018 -0
- package/scripts/verrou-de-fichier.mjs +8 -4
- package/scripts/verrou-de-machine.mjs +150 -51
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/explorateur/SKILL.md +9 -2
- package/skills/grill/SKILL.md +1 -1
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +17 -18
- package/skills/pitmaster/references/consigne-agent.md +5 -1
- package/skills/release/SKILL.md +3 -3
- package/skills/relecteur/SKILL.md +5 -3
- package/skills/testwriter/SKILL.md +49 -31
- package/scripts/demon.mjs +0 -251
- package/scripts/integration/file-attente.mjs +0 -61
- package/scripts/langages/cargo/touches.mjs +0 -93
- package/scripts/langages/typescript/script-des-tests.mjs +0 -6
|
@@ -76,11 +76,17 @@ const lireJson = p => JSON.parse(readFileSync(p, 'utf8'));
|
|
|
76
76
|
// has none.
|
|
77
77
|
export function sansApi(c) {
|
|
78
78
|
const pj = path.join(c.dir, 'package.json');
|
|
79
|
-
if (!existsSync(pj))
|
|
79
|
+
if (!existsSync(pj)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
80
82
|
const p = lireJson(pj);
|
|
81
83
|
const exp = p.exports;
|
|
82
|
-
if (exp === undefined)
|
|
83
|
-
|
|
84
|
+
if (exp === undefined) {
|
|
85
|
+
return [p.main, p.types, p.typings].every(e => e === undefined);
|
|
86
|
+
}
|
|
87
|
+
if (!exp || typeof exp !== 'object' || Array.isArray(exp)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
84
90
|
const cles = Object.keys(exp);
|
|
85
91
|
return cles.length > 0 && cles.every(k => k.startsWith('.')) && !cles.includes('.');
|
|
86
92
|
}
|
|
@@ -97,7 +103,9 @@ export function entree(racine, c) {
|
|
|
97
103
|
}
|
|
98
104
|
const racinePj = path.join(racine, 'package.json');
|
|
99
105
|
const types = existsSync(racinePj) ? lireJson(racinePj).types : null;
|
|
100
|
-
if (!types)
|
|
106
|
+
if (!types) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
101
109
|
return path.join(racine, path.dirname(types), path.basename(c.dir), 'index.d.ts');
|
|
102
110
|
}
|
|
103
111
|
|
|
@@ -108,14 +116,22 @@ export function declare(texte) {
|
|
|
108
116
|
let section = null;
|
|
109
117
|
let bloc = false;
|
|
110
118
|
for (const l of ecrite(texte)) {
|
|
111
|
-
if (/^\s*(```|~~~)/.test(l))
|
|
119
|
+
if (/^\s*(```|~~~)/.test(l)) {
|
|
120
|
+
bloc = !bloc;
|
|
121
|
+
}
|
|
112
122
|
const titre = !bloc && /^(#{2,3}) (.+)$/.exec(l);
|
|
113
123
|
if (titre) {
|
|
114
124
|
section = titre[1] === '##' ? titre[2].trim() : section;
|
|
115
|
-
if (section === 'Les fautes' && fautes === null)
|
|
125
|
+
if (section === 'Les fautes' && fautes === null) {
|
|
126
|
+
fautes = new Set();
|
|
127
|
+
}
|
|
116
128
|
continue;
|
|
117
129
|
}
|
|
118
|
-
if (section === 'Les fautes')
|
|
130
|
+
if (section === 'Les fautes') {
|
|
131
|
+
for (const m of l.matchAll(CODE)) {
|
|
132
|
+
fautes.add(m[0]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
119
135
|
}
|
|
120
136
|
return { fautes };
|
|
121
137
|
}
|
|
@@ -131,7 +147,9 @@ function codesDuCode(dir, racine, prefixes) {
|
|
|
131
147
|
).filter(p => SOURCE.test(nom(p)) && !isTest(path.relative(racine, p)));
|
|
132
148
|
for (const p of sources) {
|
|
133
149
|
for (const m of (lireSiPresent(p) ?? '').matchAll(CODE)) {
|
|
134
|
-
if (prefixes.some(pr => m[0].startsWith(pr)))
|
|
150
|
+
if (prefixes.some(pr => m[0].startsWith(pr))) {
|
|
151
|
+
trouves.add(m[0]);
|
|
152
|
+
}
|
|
135
153
|
}
|
|
136
154
|
}
|
|
137
155
|
return trouves;
|
|
@@ -140,7 +158,7 @@ function codesDuCode(dir, racine, prefixes) {
|
|
|
140
158
|
// Runs API Extractor on one component: whether the repository's report is up to date, the exports
|
|
141
159
|
// of the documentation model built from the code (whether or not the report exists) and the TSDoc
|
|
142
160
|
// messages of its comments.
|
|
143
|
-
function rapportApi(racine, c, entreeDts, ecrire, tsdocConfigFile) {
|
|
161
|
+
export function rapportApi(racine, c, entreeDts, ecrire, tsdocConfigFile) {
|
|
144
162
|
const { Extractor, ExtractorConfig } = require('@microsoft/api-extractor');
|
|
145
163
|
const { ApiModel } = require('@microsoft/api-extractor-model');
|
|
146
164
|
const pj = existsSync(path.join(c.dir, 'package.json'))
|
|
@@ -214,7 +232,9 @@ const CODE_SEUL = new RegExp(`^${CODE.source}$`);
|
|
|
214
232
|
|
|
215
233
|
// The text of a TSDoc node, its paragraphs apart by a blank line, each on one line.
|
|
216
234
|
function texteDoc(noeud) {
|
|
217
|
-
if (!noeud)
|
|
235
|
+
if (!noeud) {
|
|
236
|
+
return '';
|
|
237
|
+
}
|
|
218
238
|
const feuilles = n =>
|
|
219
239
|
n.kind === 'Excerpt' ? n.content.toString() : n.getChildNodes().map(feuilles).join('');
|
|
220
240
|
const paragraphes = noeud.kind === 'Section' ? noeud.getChildNodes() : [noeud];
|
|
@@ -287,45 +307,54 @@ function fautesJugees(nom, textes, fautes, refus, codes) {
|
|
|
287
307
|
regle: 'faute-hors-catalogue',
|
|
288
308
|
texte: `${nom} : le @faute ${code} n'est pas au catalogue « ## Les fautes ».`,
|
|
289
309
|
});
|
|
290
|
-
} else
|
|
310
|
+
} else {
|
|
311
|
+
codes.add(code);
|
|
312
|
+
}
|
|
291
313
|
}
|
|
292
314
|
}
|
|
293
315
|
|
|
294
316
|
// The refusals for one export against its contract (`{ regle, texte }`), with the fault codes it
|
|
295
317
|
// and its members name.
|
|
296
|
-
function jugerExport(item, fautes) {
|
|
318
|
+
export function jugerExport(item, fautes) {
|
|
297
319
|
const refus = [];
|
|
298
320
|
const nom = `\`${item.displayName}\``;
|
|
299
321
|
const k = contratDe(item);
|
|
300
|
-
if (!k.resume)
|
|
322
|
+
if (!k.resume) {
|
|
323
|
+
refus.push({ regle: 'resume', texte: `${nom} n'a pas de résumé TSDoc.` });
|
|
324
|
+
}
|
|
301
325
|
const codes = new Set();
|
|
302
326
|
if (estFonction(item)) {
|
|
303
327
|
const noms = new Set(k.parametres.filter(p => !p.destructure).map(p => p.name));
|
|
304
328
|
const prises = new Set();
|
|
305
329
|
k.parametres.forEach((p, i) => {
|
|
306
330
|
const parNom = p.destructure ? -1 : k.params.findIndex(b => b.nom === p.name);
|
|
307
|
-
if (parNom >= 0)
|
|
308
|
-
|
|
331
|
+
if (parNom >= 0) {
|
|
332
|
+
prises.add(parNom);
|
|
333
|
+
} else if (!p.destructure) {
|
|
309
334
|
refus.push({
|
|
310
335
|
regle: 'param',
|
|
311
336
|
texte: `${nom} : le paramètre « ${p.name} » n'a pas de @param.`,
|
|
312
337
|
});
|
|
313
|
-
else if (!k.params[i] || noms.has(k.params[i].nom))
|
|
338
|
+
} else if (!k.params[i] || noms.has(k.params[i].nom)) {
|
|
314
339
|
refus.push({
|
|
315
340
|
regle: 'param',
|
|
316
341
|
texte: `${nom} : le paramètre déstructuré en position ${i + 1} n'a pas son @param à cette position.`,
|
|
317
342
|
});
|
|
318
|
-
else
|
|
343
|
+
} else {
|
|
344
|
+
prises.add(i);
|
|
345
|
+
}
|
|
319
346
|
});
|
|
320
347
|
k.params.forEach((b, i) => {
|
|
321
|
-
if (!prises.has(i))
|
|
348
|
+
if (!prises.has(i)) {
|
|
322
349
|
refus.push({
|
|
323
350
|
regle: 'param-orphelin',
|
|
324
351
|
texte: `${nom} : le @param « ${b.nom} » ne nomme aucun paramètre.`,
|
|
325
352
|
});
|
|
353
|
+
}
|
|
326
354
|
});
|
|
327
|
-
if (k.rendUneValeur && k.retour === null)
|
|
355
|
+
if (k.rendUneValeur && k.retour === null) {
|
|
328
356
|
refus.push({ regle: 'returns', texte: `${nom} rend une valeur mais n'a pas de @returns.` });
|
|
357
|
+
}
|
|
329
358
|
}
|
|
330
359
|
fautesJugees(nom, k.fautes, fautes, refus, codes);
|
|
331
360
|
for (const m of item.members ?? []) {
|
|
@@ -350,19 +379,28 @@ export function marques(texte) {
|
|
|
350
379
|
lignes.forEach((l, i) => {
|
|
351
380
|
const f = /^\s*(```|~~~)/.exec(l);
|
|
352
381
|
if (cloture) {
|
|
353
|
-
if (f && f[1] === cloture)
|
|
382
|
+
if (f && f[1] === cloture) {
|
|
383
|
+
cloture = null;
|
|
384
|
+
}
|
|
354
385
|
return;
|
|
355
386
|
}
|
|
356
387
|
if (f) {
|
|
357
388
|
cloture = f[1];
|
|
358
389
|
return;
|
|
359
390
|
}
|
|
360
|
-
if (l.trim() === DEBUT)
|
|
361
|
-
|
|
391
|
+
if (l.trim() === DEBUT) {
|
|
392
|
+
debuts.push(i);
|
|
393
|
+
}
|
|
394
|
+
if (l.trim() === FIN) {
|
|
395
|
+
fins.push(i);
|
|
396
|
+
}
|
|
362
397
|
});
|
|
363
|
-
if (!debuts.length && !fins.length)
|
|
364
|
-
|
|
398
|
+
if (!debuts.length && !fins.length) {
|
|
399
|
+
return { etat: 'absentes', lignes };
|
|
400
|
+
}
|
|
401
|
+
if (debuts.length === 1 && fins.length === 1 && debuts[0] < fins[0]) {
|
|
365
402
|
return { etat: 'ok', lignes, debut: debuts[0], fin: fins[0] };
|
|
403
|
+
}
|
|
366
404
|
return { etat: 'invalides', lignes };
|
|
367
405
|
}
|
|
368
406
|
|
|
@@ -379,10 +417,12 @@ const signature = item => {
|
|
|
379
417
|
/^(?:(?:export|declare|default|async)\s+)*(?:function|class|interface|type|enum|namespace|const|let|var)\b/.test(
|
|
380
418
|
texte
|
|
381
419
|
)
|
|
382
|
-
)
|
|
420
|
+
) {
|
|
383
421
|
return texte;
|
|
384
|
-
|
|
422
|
+
}
|
|
423
|
+
if (item.kind === 'Variable') {
|
|
385
424
|
return `export declare ${item.isReadonly ? 'const' : 'let'} ${texte}`;
|
|
425
|
+
}
|
|
386
426
|
return item.kind === 'Function' ? `const ${texte}` : texte;
|
|
387
427
|
};
|
|
388
428
|
|
|
@@ -391,15 +431,21 @@ const signature = item => {
|
|
|
391
431
|
function entreeDe(item) {
|
|
392
432
|
const k = contratDe(item);
|
|
393
433
|
const out = [`### \`${item.displayName}\``, ''];
|
|
394
|
-
if (k.resume)
|
|
434
|
+
if (k.resume) {
|
|
435
|
+
out.push(k.resume, '');
|
|
436
|
+
}
|
|
395
437
|
out.push('```ts', `${signature(item)};`, '```');
|
|
396
438
|
const params = k.params.filter(b => b.texte);
|
|
397
|
-
if (params.length)
|
|
439
|
+
if (params.length) {
|
|
398
440
|
out.push('', '**Paramètres**', '', ...params.map(b => `- \`${b.nom}\` — ${b.texte}`));
|
|
399
|
-
|
|
441
|
+
}
|
|
442
|
+
if (k.retour) {
|
|
443
|
+
out.push('', `**Retour** — ${k.retour}`);
|
|
444
|
+
}
|
|
400
445
|
const codes = [...new Set(k.fautes.map(f => f.replace(/\s+/g, ' ')))];
|
|
401
|
-
if (codes.length)
|
|
446
|
+
if (codes.length) {
|
|
402
447
|
out.push('', '**Fautes**', '', ...codes.map(f => `- ${f.replace(/^(\S+)/, '`$1`')}`));
|
|
448
|
+
}
|
|
403
449
|
const membres = [...(item.members ?? [])];
|
|
404
450
|
if (membres.length) {
|
|
405
451
|
out.push('', '**Membres**', '');
|
|
@@ -412,14 +458,15 @@ function entreeDe(item) {
|
|
|
412
458
|
}
|
|
413
459
|
|
|
414
460
|
// The text between the marks for <exports>: empty without export.
|
|
415
|
-
const partieGeneree = exports =>
|
|
461
|
+
export const partieGeneree = exports =>
|
|
416
462
|
exports.length ? `\n${exports.map(entreeDe).join('\n\n')}\n\n` : '\n';
|
|
417
463
|
|
|
418
464
|
// The text of an interface with its generated part replaced; the marks are added at the end of a
|
|
419
465
|
// text that has none.
|
|
420
|
-
function avecPartie(m, texte, partie) {
|
|
421
|
-
if (m.etat === 'absentes')
|
|
466
|
+
export function avecPartie(m, texte, partie) {
|
|
467
|
+
if (m.etat === 'absentes') {
|
|
422
468
|
return `${texte}${texte.endsWith('\n') ? '' : '\n'}\n${DEBUT}${partie}${FIN}\n`;
|
|
469
|
+
}
|
|
423
470
|
const avant = m.lignes.slice(0, m.debut).join('\n');
|
|
424
471
|
const apres = m.lignes.slice(m.fin + 1).join('\n');
|
|
425
472
|
return `${avant}${m.debut ? '\n' : ''}${DEBUT}${partie}${FIN}\n${apres}`;
|
|
@@ -456,7 +503,9 @@ export function verifierComposant(racine, c, { ecrire = false } = {}) {
|
|
|
456
503
|
const { fautes } = declare(texte);
|
|
457
504
|
const m = marques(texte);
|
|
458
505
|
if (sansApi(c)) {
|
|
459
|
-
if (fautes)
|
|
506
|
+
if (fautes) {
|
|
507
|
+
codesContreCatalogue(c, racine, fautes, refuser);
|
|
508
|
+
}
|
|
460
509
|
return { refus, signaux };
|
|
461
510
|
}
|
|
462
511
|
if (m.etat === 'invalides') {
|
|
@@ -474,7 +523,9 @@ export function verifierComposant(racine, c, { ecrire = false } = {}) {
|
|
|
474
523
|
const { TSDocConfigFile } = require('@microsoft/tsdoc-config');
|
|
475
524
|
const config = TSDocConfigFile.loadFile(fichierTsdoc);
|
|
476
525
|
const api = rapportApi(racine, c, dts, ecrire, config);
|
|
477
|
-
for (const msg of api.messages)
|
|
526
|
+
for (const msg of api.messages) {
|
|
527
|
+
signaux.push(`${rel} : ${msg}`);
|
|
528
|
+
}
|
|
478
529
|
for (const t of api.tsdoc) {
|
|
479
530
|
refuser(`TSDoc : ${t.texte}`, t.regle, t.fichier ?? relIface, t.ligne);
|
|
480
531
|
}
|
|
@@ -493,17 +544,24 @@ export function verifierComposant(racine, c, { ecrire = false } = {}) {
|
|
|
493
544
|
const nommees = new Set();
|
|
494
545
|
for (const item of api.exports) {
|
|
495
546
|
const j = jugerExport(item, fautes);
|
|
496
|
-
for (const r of j.refus)
|
|
497
|
-
|
|
547
|
+
for (const r of j.refus) {
|
|
548
|
+
refuser(r.texte, r.regle);
|
|
549
|
+
}
|
|
550
|
+
for (const code of j.codes) {
|
|
551
|
+
nommees.add(code);
|
|
552
|
+
}
|
|
498
553
|
}
|
|
499
554
|
for (const f of fautes ?? []) {
|
|
500
|
-
if (!nommees.has(f))
|
|
555
|
+
if (!nommees.has(f)) {
|
|
501
556
|
refuser(`la faute ${f} du catalogue n'est nommée par aucun @faute.`, 'faute-non-nommee');
|
|
557
|
+
}
|
|
502
558
|
}
|
|
503
559
|
if (m.etat !== 'invalides') {
|
|
504
560
|
const attendu = avecPartie(m, texte, partieGeneree(api.exports));
|
|
505
561
|
if (ecrire) {
|
|
506
|
-
if (attendu !== texte)
|
|
562
|
+
if (attendu !== texte) {
|
|
563
|
+
writeFileSync(iface, attendu);
|
|
564
|
+
}
|
|
507
565
|
} else if (attendu !== texte) {
|
|
508
566
|
aRegenerer(
|
|
509
567
|
`la part générée de docs/INTERFACE.md (entre ${DEBUT} et ${FIN}) n'est pas celle du code ; npm run api la refait.`,
|
|
@@ -512,7 +570,9 @@ export function verifierComposant(racine, c, { ecrire = false } = {}) {
|
|
|
512
570
|
}
|
|
513
571
|
}
|
|
514
572
|
}
|
|
515
|
-
if (fautes)
|
|
573
|
+
if (fautes) {
|
|
574
|
+
codesContreCatalogue(c, racine, fautes, refuser);
|
|
575
|
+
}
|
|
516
576
|
return { refus, signaux };
|
|
517
577
|
}
|
|
518
578
|
|
|
@@ -522,12 +582,14 @@ function codesContreCatalogue(c, racine, fautes, refuser) {
|
|
|
522
582
|
const prefixes = [...new Set([...fautes].map(f => f.slice(0, f.indexOf('_') + 1)))];
|
|
523
583
|
const dansLeCode = codesDuCode(c.dir, racine, prefixes);
|
|
524
584
|
for (const f of fautes) {
|
|
525
|
-
if (!dansLeCode.has(f))
|
|
585
|
+
if (!dansLeCode.has(f)) {
|
|
526
586
|
refuser(`la faute ${f} est listée, mais le code ne la produit pas.`, 'faute-non-produite');
|
|
587
|
+
}
|
|
527
588
|
}
|
|
528
589
|
for (const f of dansLeCode) {
|
|
529
|
-
if (!fautes.has(f))
|
|
590
|
+
if (!fautes.has(f)) {
|
|
530
591
|
refuser(`le code produit ${f}, que « Les fautes » ne liste pas.`, 'faute-non-listee');
|
|
592
|
+
}
|
|
531
593
|
}
|
|
532
594
|
}
|
|
533
595
|
|
|
@@ -546,11 +608,17 @@ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
|
546
608
|
const constats = [];
|
|
547
609
|
for (const c of aVerifier(racine)) {
|
|
548
610
|
const { refus, signaux } = verifierComposant(racine, c, { ecrire });
|
|
549
|
-
for (const s of signaux)
|
|
611
|
+
for (const s of signaux) {
|
|
612
|
+
process.stderr.write(`⚠️ ${s}\n`);
|
|
613
|
+
}
|
|
550
614
|
constats.push(...refus);
|
|
551
615
|
}
|
|
552
616
|
const { refus, lignes } = trancher(racine, 'interfaces-contre-code', constats);
|
|
553
|
-
for (const r of refus)
|
|
554
|
-
|
|
617
|
+
for (const r of refus) {
|
|
618
|
+
process.stderr.write(`⛔ ${r.message}\n`);
|
|
619
|
+
}
|
|
620
|
+
for (const l of lignes) {
|
|
621
|
+
process.stderr.write(`${l}\n`);
|
|
622
|
+
}
|
|
555
623
|
process.exitCode = refus.length ? 1 : 0;
|
|
556
624
|
}
|
|
@@ -41,7 +41,9 @@ function sourcesDe(tous) {
|
|
|
41
41
|
return tous.flatMap(c =>
|
|
42
42
|
parcourir(c.dir, p => SAUTES.has(path.basename(p)))
|
|
43
43
|
.filter(f => {
|
|
44
|
-
if (!SOURCE.test(f) || NOM_DE_TEST.test(path.basename(f)))
|
|
44
|
+
if (!SOURCE.test(f) || NOM_DE_TEST.test(path.basename(f))) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
45
47
|
return !path
|
|
46
48
|
.relative(c.dir, f)
|
|
47
49
|
.split(path.sep)
|
|
@@ -56,7 +58,9 @@ function interfacesDe(racine, tous) {
|
|
|
56
58
|
const out = new Map();
|
|
57
59
|
for (const c of tous) {
|
|
58
60
|
const f = path.join(c.dir, 'docs', 'INTERFACE.md');
|
|
59
|
-
if (!existsSync(f))
|
|
61
|
+
if (!existsSync(f)) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
60
64
|
const i = lire(path.relative(racine, f).split(path.sep).join('/'), readFileSync(f, 'utf8'));
|
|
61
65
|
const publies = new Set(
|
|
62
66
|
i.parties.filter(p => !p.consommateurs).map(p => p.titre.replace(/`/g, '').trim())
|
|
@@ -71,7 +75,9 @@ function interfacesDe(racine, tous) {
|
|
|
71
75
|
// files left out.
|
|
72
76
|
function testsDe(c) {
|
|
73
77
|
return parcourir(c.dir, p => SAUTES.has(path.basename(p))).filter(f => {
|
|
74
|
-
if (!SOURCE.test(f))
|
|
78
|
+
if (!SOURCE.test(f)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
75
81
|
const rel = path.relative(c.dir, f).split(path.sep);
|
|
76
82
|
return NOM_DE_TEST.test(path.basename(f)) || rel.some(d => DOSSIERS_DE_TEST.has(d));
|
|
77
83
|
});
|
|
@@ -102,11 +108,12 @@ export function lecteurs(racine, { composants, noms, texte, nommes }) {
|
|
|
102
108
|
const ifaces = interfacesDe(racine, tous);
|
|
103
109
|
const tests = new Map();
|
|
104
110
|
const testsDuComposant = c => {
|
|
105
|
-
if (!tests.has(c))
|
|
111
|
+
if (!tests.has(c)) {
|
|
106
112
|
tests.set(
|
|
107
113
|
c,
|
|
108
114
|
testsDe(c).map(f => ({ f, texte: lireSiPresent(f) ?? '' }))
|
|
109
115
|
);
|
|
116
|
+
}
|
|
110
117
|
return tests.get(c);
|
|
111
118
|
};
|
|
112
119
|
const elements = [];
|
|
@@ -114,25 +121,35 @@ export function lecteurs(racine, { composants, noms, texte, nommes }) {
|
|
|
114
121
|
for (const nom of noms) {
|
|
115
122
|
const fournisseurs = tous.filter(c => ifaces.get(c)?.publies.has(nom));
|
|
116
123
|
if (fournisseurs.length === 0) {
|
|
117
|
-
if (!tous.some(c => c.paquet === nom))
|
|
124
|
+
if (!tous.some(c => c.paquet === nom)) {
|
|
125
|
+
sansFournisseur.push(nom);
|
|
126
|
+
}
|
|
118
127
|
continue;
|
|
119
128
|
}
|
|
120
129
|
for (const p of fournisseurs) {
|
|
121
130
|
const lus = [];
|
|
122
131
|
for (const c of tous) {
|
|
123
|
-
if (c === p)
|
|
132
|
+
if (c === p) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
124
135
|
const par = [];
|
|
125
136
|
const declare =
|
|
126
137
|
ifaces.get(p).consommateurs.get(c.nom) ?? ifaces.get(p).consommateurs.get(c.paquet);
|
|
127
|
-
if (declare && (declare.has(nom) || declare.has('*')))
|
|
138
|
+
if (declare && (declare.has(nom) || declare.has('*'))) {
|
|
139
|
+
par.push('consommateurs');
|
|
140
|
+
}
|
|
128
141
|
const n = reel.get(p.nom)?.get(c.nom);
|
|
129
|
-
if (n && (n.has(nom) || n.has('*')))
|
|
142
|
+
if (n && (n.has(nom) || n.has('*'))) {
|
|
143
|
+
par.push('import');
|
|
144
|
+
}
|
|
130
145
|
for (const t of testsDuComposant(c)) {
|
|
131
146
|
if (identifiant(nom).test(t.texte) && importe(t.texte, t.f, p)) {
|
|
132
147
|
par.push(path.relative(racine, t.f).split(path.sep).join('/'));
|
|
133
148
|
}
|
|
134
149
|
}
|
|
135
|
-
if (par.length)
|
|
150
|
+
if (par.length) {
|
|
151
|
+
lus.push({ composant: exterieur(c), par });
|
|
152
|
+
}
|
|
136
153
|
}
|
|
137
154
|
elements.push({ nom, fournisseur: exterieur(p), lecteurs: lus });
|
|
138
155
|
}
|
|
@@ -149,10 +166,18 @@ export function lecteurs(racine, { composants, noms, texte, nommes }) {
|
|
|
149
166
|
const lit = new Map(composants.map(c => [c, new Set()]));
|
|
150
167
|
for (const p of tous) {
|
|
151
168
|
for (const nomLecteur of reel.get(p.nom)?.keys() ?? []) {
|
|
152
|
-
for (const c of tous)
|
|
169
|
+
for (const c of tous) {
|
|
170
|
+
if (c.nom === nomLecteur) {
|
|
171
|
+
lit.get(c.c).add(p.c);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
for (const e of elements) {
|
|
177
|
+
for (const l of e.lecteurs) {
|
|
178
|
+
lit.get(l.composant).add(e.fournisseur);
|
|
153
179
|
}
|
|
154
180
|
}
|
|
155
|
-
for (const e of elements) for (const l of e.lecteurs) lit.get(l.composant).add(e.fournisseur);
|
|
156
181
|
const parLesTests = new Map(composants.map(c => [c, new Set()]));
|
|
157
182
|
for (const [c, lus] of testsLisent) {
|
|
158
183
|
for (const p of lus) {
|
|
@@ -53,14 +53,18 @@ export function migrer(projet) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
const fracine = path.join(projet, 'package.json');
|
|
56
|
-
if (!existsSync(fracine))
|
|
56
|
+
if (!existsSync(fracine)) {
|
|
57
|
+
return lignes;
|
|
58
|
+
}
|
|
57
59
|
const racine = lireJson(fracine);
|
|
58
60
|
const plage =
|
|
59
61
|
CHAMPS.map(c => racine[c]?.[PAQUET]).find(v => v !== undefined) ?? `^${versionDuCadre()}`;
|
|
60
62
|
const declarer = pkg => {
|
|
61
63
|
let change = false;
|
|
62
64
|
for (const c of CHAMPS) {
|
|
63
|
-
if (pkg[c]?.[ANCIEN] === undefined)
|
|
65
|
+
if (pkg[c]?.[ANCIEN] === undefined) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
64
68
|
const { [ANCIEN]: _ancien, ...reste } = pkg[c];
|
|
65
69
|
const deja = CHAMPS.some(d => pkg[d]?.[PAQUET] !== undefined);
|
|
66
70
|
pkg[c] = Object.fromEntries(
|
|
@@ -73,12 +77,16 @@ export function migrer(projet) {
|
|
|
73
77
|
return change;
|
|
74
78
|
};
|
|
75
79
|
for (const { dossier, pkg } of paquets(projet)) {
|
|
76
|
-
if (ANCIENS_ESPACES.includes(dossier) || !declarer(pkg))
|
|
80
|
+
if (ANCIENS_ESPACES.includes(dossier) || !declarer(pkg)) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
77
83
|
ecrireJson(path.join(projet, dossier, 'package.json'), pkg);
|
|
78
84
|
lignes.push(`${dossier}/package.json : déclare ${PAQUET} à la place de ${ANCIEN}`);
|
|
79
85
|
}
|
|
80
86
|
const declare = declarer(racine);
|
|
81
|
-
if (declare)
|
|
87
|
+
if (declare) {
|
|
88
|
+
lignes.push(`package.json : déclare ${PAQUET} à la place de ${ANCIEN}`);
|
|
89
|
+
}
|
|
82
90
|
const liste = Array.isArray(racine.workspaces) ? racine.workspaces : racine.workspaces?.packages;
|
|
83
91
|
const restants = Array.isArray(liste) ? liste.filter(e => !ANCIENS_ESPACES.includes(e)) : liste;
|
|
84
92
|
const espaces = Array.isArray(liste) && restants.length !== liste.length;
|
|
@@ -88,6 +96,8 @@ export function migrer(projet) {
|
|
|
88
96
|
: { ...racine.workspaces, packages: restants };
|
|
89
97
|
lignes.push(`package.json : l'ancien dossier de ${ANCIEN} quitte les workspaces`);
|
|
90
98
|
}
|
|
91
|
-
if (declare || espaces)
|
|
99
|
+
if (declare || espaces) {
|
|
100
|
+
ecrireJson(fracine, racine);
|
|
101
|
+
}
|
|
92
102
|
return lignes;
|
|
93
103
|
}
|
|
@@ -17,9 +17,13 @@ export const nom = 'chemins des tests';
|
|
|
17
17
|
|
|
18
18
|
/** Inscribes the paths the tests of the project at <projet> name undeclared; what it did. */
|
|
19
19
|
export function migrer(projet) {
|
|
20
|
-
if (lire(projet)[GARDE])
|
|
20
|
+
if (lire(projet)[GARDE]) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
21
23
|
const constats = verifier(projet);
|
|
22
|
-
if (constats.length === 0)
|
|
24
|
+
if (constats.length === 0) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
23
27
|
trancher(projet, GARDE, constats, 'inscrire', {});
|
|
24
28
|
return [
|
|
25
29
|
`${FICHIER} : ${constats.length} chemin(s) qu'un test nomme sans que le cadre le lise, inscrit(s) dans la dette de ${GARDE}, gelée ; un neuf est refusé, et chaque test écrit le chemin entier`,
|
|
@@ -21,9 +21,13 @@ export const nom = 'tailles des tests';
|
|
|
21
21
|
|
|
22
22
|
/** Inscribes the large tests of the day of the project at <projet> in its debt; what it did. */
|
|
23
23
|
export function migrer(projet) {
|
|
24
|
-
if (lire(projet)[GARDE])
|
|
24
|
+
if (lire(projet)[GARDE]) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
25
27
|
const constats = verifier(projet);
|
|
26
|
-
if (constats.length === 0)
|
|
28
|
+
if (constats.length === 0) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
27
31
|
trancher(projet, GARDE, constats, 'inscrire', {});
|
|
28
32
|
return [
|
|
29
33
|
`${FICHIER} : ${constats.length} grand(s) test(s) de jour inscrit(s) dans la dette de ${GARDE}, gelée ; un grand test de jour neuf est refusé, et chacun passe à la nuit (*.nuit.test.*) ou se réduit`,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// From 0.30.0 the guard of the titles of the tests (scripts/langages/typescript/titres-de-tests.mjs)
|
|
2
|
+
// reads the prefix of the tickets from the key `issue-prefix` of `.beads/config.yaml`, committed,
|
|
3
|
+
// never from `bd`, which a CI does not have; a project without the key is refused by the guard.
|
|
4
|
+
// `bd init` writes that key commented out, and Beads keeps the prefix in its database.
|
|
5
|
+
//
|
|
6
|
+
// - The migration writes the key `issue-prefix: "<prefix>"` in `.beads/config.yaml` by the one
|
|
7
|
+
// writer of the key (`ecrireLePrefixe` of scripts/prefixe-des-tickets.mjs, which the preparation
|
|
8
|
+
// of a new project calls too), the prefix read once from Beads (`bd config get issue_prefix`,
|
|
9
|
+
// in the project), as the update runs at the poste, where bd is.
|
|
10
|
+
// - A file that already holds the key with a value is left, nothing said: a second pass changes
|
|
11
|
+
// nothing.
|
|
12
|
+
// - A project without `.beads/` holds no tickets of Beads in this tree: nothing to write. With
|
|
13
|
+
// `.beads/` but without its `config.yaml`, or a prefix Beads does not give, `aFaire` names the
|
|
14
|
+
// key to write.
|
|
15
|
+
import { spawnSync } from 'node:child_process';
|
|
16
|
+
import { existsSync } from 'node:fs';
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
import { CONFIG_BEADS as CONFIG, ecrireLePrefixe, prefixe } from '../../../services-du-noyau.mjs';
|
|
19
|
+
|
|
20
|
+
export const version = '0.30.0';
|
|
21
|
+
export const nom = 'préfixe des tickets';
|
|
22
|
+
|
|
23
|
+
// The prefix Beads gives in the project at <projet>, null without one.
|
|
24
|
+
function prefixeDeBeads(projet) {
|
|
25
|
+
const r = spawnSync('bd', ['config', 'get', 'issue_prefix'], {
|
|
26
|
+
cwd: projet,
|
|
27
|
+
encoding: 'utf8',
|
|
28
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
29
|
+
});
|
|
30
|
+
const valeur = r.status === 0 ? String(r.stdout ?? '').trim() : '';
|
|
31
|
+
return valeur && !/\s/.test(valeur) ? valeur : null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Writes the key `issue-prefix` of the project at <projet> when it lacks it; what it did. */
|
|
35
|
+
export function migrer(projet) {
|
|
36
|
+
const f = path.join(projet, CONFIG);
|
|
37
|
+
if (!existsSync(path.dirname(f))) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
if (!existsSync(f)) {
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
aFaire: `${CONFIG} manque : écris-y la clé \`issue-prefix: "<préfixe>"\`, que la garde des titres des tests lit.`,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
prefixe(projet);
|
|
49
|
+
return [];
|
|
50
|
+
} catch {
|
|
51
|
+
// The key is missing or empty: it is written below.
|
|
52
|
+
}
|
|
53
|
+
const valeur = prefixeDeBeads(projet);
|
|
54
|
+
if (!valeur) {
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
aFaire: `${CONFIG} : Beads ne donne pas le préfixe des tickets (\`bd config get issue_prefix\`) ; écris la clé \`issue-prefix: "<préfixe>"\`, que la garde des titres des tests lit.`,
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
const ligne = ecrireLePrefixe(projet, valeur);
|
|
62
|
+
return ligne ? [`${CONFIG} : ${ligne}, lu de Beads, que la garde des titres des tests lit`] : [];
|
|
63
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// From 0.30.0 the guard of the sizes of the tests (scripts/langages/typescript/tailles-des-tests.mjs)
|
|
2
|
+
// also sees large a test that mounts a temporary directory and starts a heavy tool of the product
|
|
3
|
+
// there (turbo, vitest, knip, depcruise, api-extractor), with a `cwd:`; the tests it classed medium
|
|
4
|
+
// become large tests of the day, and the main of a project that updates would turn red at its next
|
|
5
|
+
// pass. As the migration 0.25.0 does for the first rule, the update inscribes them as the project's
|
|
6
|
+
// known debt (scripts/dette.mjs), frozen: the count never rises and a new large test of the day is
|
|
7
|
+
// refused.
|
|
8
|
+
//
|
|
9
|
+
// - The migration inscribes the large tests of the day the guard finds that the debt does not hold
|
|
10
|
+
// yet; the debt already inscribed (the guard's, the other guards') stays.
|
|
11
|
+
// - It rewrites no test of the project: the project moves each one to the night (`*.nuit.test.*`)
|
|
12
|
+
// or reduces it, and the debt comes down with it.
|
|
13
|
+
// - Replayable without effect: once every finding is inscribed, nothing.
|
|
14
|
+
import { FICHIER, lire, trancher } from '../../../dette.mjs';
|
|
15
|
+
import { GARDE, verifier } from '../tailles-des-tests.mjs';
|
|
16
|
+
|
|
17
|
+
export const version = '0.30.0';
|
|
18
|
+
export const nom = 'tailles des outils lourds';
|
|
19
|
+
|
|
20
|
+
/** Inscribes the large tests of the day the debt of the project at <projet> lacks; what it did. */
|
|
21
|
+
export function migrer(projet) {
|
|
22
|
+
const inscrite = lire(projet)[GARDE] ?? {};
|
|
23
|
+
const constats = verifier(projet);
|
|
24
|
+
const neufs = constats.filter(c => !inscrite[c.fichier]?.[c.regle]);
|
|
25
|
+
if (neufs.length === 0) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
// Inscribed counts stay; a finding without key is added at its count.
|
|
29
|
+
trancher(projet, GARDE, constats, 'inscrire', {});
|
|
30
|
+
return [
|
|
31
|
+
`${FICHIER} : ${neufs.length} grand(s) test(s) de jour inscrit(s) dans la dette de ${GARDE}, gelée ; un grand test de jour neuf est refusé, et chacun passe à la nuit (*.nuit.test.*) ou se réduit`,
|
|
32
|
+
];
|
|
33
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// From 0.30.0 the guard of the titles of the tests (scripts/langages/typescript/titres-de-tests.mjs)
|
|
2
|
+
// refuses a test file whose titles name a ticket or a « critère N » beyond its debt; the titles a
|
|
3
|
+
// project already has would turn its main red at its next pass. As the migration of the large
|
|
4
|
+
// tests of the day does (./0.30.0-tailles-des-outils-lourds.mjs), the update inscribes them as the
|
|
5
|
+
// project's known debt (scripts/dette.mjs), frozen: the count never rises, and each title renamed
|
|
6
|
+
// by its behaviour lowers it.
|
|
7
|
+
//
|
|
8
|
+
// - It plays after the migration of the prefix of the tickets (./0.30.0-prefixe-des-tickets.mjs),
|
|
9
|
+
// whose key it reads; without the key it inscribes nothing, and the guard names the key.
|
|
10
|
+
// - The migration inscribes the files the debt does not hold yet; the debt already inscribed (the
|
|
11
|
+
// guard's, the other guards') stays.
|
|
12
|
+
// - It rewrites no test of the project.
|
|
13
|
+
// - Replayable without effect: once every finding is inscribed, nothing.
|
|
14
|
+
import { FICHIER, lire, trancher } from '../../../dette.mjs';
|
|
15
|
+
import { prefixe } from '../../../services-du-noyau.mjs';
|
|
16
|
+
import { GARDE, verifier } from '../titres-de-tests.mjs';
|
|
17
|
+
|
|
18
|
+
export const version = '0.30.0';
|
|
19
|
+
export const nom = 'titres nommant un ticket';
|
|
20
|
+
|
|
21
|
+
/** Inscribes the titles naming a ticket that the debt of the project at <projet> lacks; what it did. */
|
|
22
|
+
export function migrer(projet) {
|
|
23
|
+
let pref;
|
|
24
|
+
try {
|
|
25
|
+
pref = prefixe(projet);
|
|
26
|
+
} catch {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const inscrite = lire(projet)[GARDE] ?? {};
|
|
30
|
+
const constats = verifier(projet, pref);
|
|
31
|
+
const neufs = constats.filter(c => !inscrite[c.fichier]?.[c.regle]);
|
|
32
|
+
if (neufs.length === 0) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
trancher(projet, GARDE, constats, 'inscrire', {});
|
|
36
|
+
const fichiers = new Set(neufs.map(c => c.fichier)).size;
|
|
37
|
+
return [
|
|
38
|
+
`${FICHIER} : ${neufs.length} titre(s) de test nommant un ticket ou un « critère N », dans ${fichiers} fichier(s), inscrit(s) dans la dette de ${GARDE}, gelée ; chacun se renomme par son comportement, et la dette baisse avec lui`,
|
|
39
|
+
];
|
|
40
|
+
}
|