@roomi-fields/grillhouse 0.29.0 → 0.30.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 +739 -0
- 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 +24 -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 +95 -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 +124 -0
- package/dist/temporal/installation.js +408 -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 +609 -80
- package/docs/CADRE.md +17 -0
- package/docs/INTERFACE.md +134 -42
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2182 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +7 -3
- package/scripts/avancement.mjs +128 -16
- package/scripts/bilan.mjs +37 -19
- package/scripts/cadre.mjs +11 -2
- package/scripts/circuit.mjs +881 -4059
- 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/composition-des-langages.mjs +16 -12
- package/scripts/conformite.mjs +6 -13
- 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 +115 -0
- package/scripts/dernier-vert.mjs +7 -15
- package/scripts/donnees-cles.mjs +228 -0
- package/scripts/droits.mjs +11 -1
- package/scripts/effets.mjs +352 -0
- package/scripts/enveloppe/enveloppe.mjs +119 -8
- package/scripts/enveloppe/lancer.sh +14 -18
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +5 -1
- 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 +187 -0
- package/scripts/gardes-du-cadre.mjs +12 -2
- package/scripts/integration/file.mjs +475 -420
- package/scripts/integration/integrer.mjs +17 -19
- package/scripts/integration/rejeu.mjs +19 -4
- package/scripts/jointure.d.ts +145 -27
- package/scripts/langages/cargo/commandes.mjs +289 -109
- package/scripts/langages/cargo/composants.mjs +130 -34
- package/scripts/langages/cargo/exemples.mjs +12 -21
- package/scripts/langages/cargo/index.mjs +18 -8
- package/scripts/langages/cargo/sccache.mjs +8 -14
- package/scripts/langages/python/commandes.mjs +216 -100
- package/scripts/langages/python/composants.mjs +53 -21
- package/scripts/langages/python/exemples.mjs +6 -16
- package/scripts/langages/python/index.mjs +24 -8
- package/scripts/langages/python/lot.mjs +1 -36
- package/scripts/langages/typescript/construire.mjs +6 -163
- package/scripts/langages/typescript/exemples.mjs +3 -11
- package/scripts/langages/typescript/frontieres.mjs +1 -1
- package/scripts/langages/typescript/index.mjs +43 -61
- package/scripts/langages/typescript/interfaces-contre-code.mjs +4 -4
- 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 +31 -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/tailles-des-tests.mjs +40 -9
- package/scripts/langages/typescript/tests-de-nuit.mjs +12 -9
- package/scripts/langages/typescript/tests.mjs +17 -8
- package/scripts/langages/typescript/titres-de-tests.mjs +297 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +183 -38
- package/scripts/langages/typescript/verdict.mjs +1 -1
- package/scripts/langages/typescript/verifier.mjs +31 -11
- package/scripts/langages/typescript/vitest-config/base.mjs +22 -1
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
- package/scripts/langages/typescript/vitest-config/delais.mjs +54 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +100 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +49 -63
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +3 -0
- package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
- package/scripts/mesure/pression.mjs +3 -3
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +8 -2
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +120 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +10 -3
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +0 -1
- package/scripts/paquet-npm.mjs +147 -0
- package/scripts/paquet.mjs +73 -4
- package/scripts/paquets.mjs +34 -6
- package/scripts/passe-de-la-machine.mjs +66 -0
- package/scripts/places-de-la-machine.mjs +360 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +10 -3
- package/scripts/registre.mjs +3 -2
- 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/resultats.mjs +7 -9
- 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 +918 -0
- package/scripts/services-du-noyau.mjs +26 -8
- package/scripts/session-start.sh +2 -2
- package/scripts/sortie.mjs +3 -3
- package/scripts/sous-commandes.mjs +38 -9
- package/scripts/style-a-l-ecriture.mjs +229 -0
- package/scripts/superviseur.mjs +122 -111
- package/scripts/tableau.mjs +148 -110
- package/scripts/taches-du-graphe.mjs +328 -0
- package/scripts/ticket-du-circuit.mjs +206 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +901 -0
- package/scripts/verrou-de-fichier.mjs +2 -2
- package/scripts/verrou-de-machine.mjs +28 -13
- package/skills/explorateur/SKILL.md +2 -1
- 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 +4 -2
- package/skills/testwriter/SKILL.md +36 -24
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The components of a workspace of cargo, as cargo itself describes them (`cargo metadata
|
|
2
2
|
// --format-version 1 --no-deps --offline`): the crates the module cargo answers the join with
|
|
3
3
|
// (scripts/jointure.d.ts, `composants`, `composantDe`, `matieres`, `joueDesTests`, `lecteurs`,
|
|
4
|
-
// `estUnTest`, `
|
|
4
|
+
// `estUnTest`, `arbreDAvant`, `testsDeHead`).
|
|
5
5
|
//
|
|
6
6
|
// - A component is a member of the workspace (`workspace_members`): its folder, the manifest's;
|
|
7
7
|
// its name and its package, the crate's name. A directory without a Cargo.toml at its root holds
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
// `tests.rs` under `src/`, and any file of a folder `tests/` under `src/`, is a unit test file,
|
|
30
30
|
// played with its crate when it is Rust; a file of a crate of the shared test material is
|
|
31
31
|
// material; any other file of a crate (the code of `src/`) is none of them.
|
|
32
|
-
// -
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
// unit test of `src/`, whose names of tests HEAD's version holds
|
|
36
|
-
// (`testsDeHead`, ./tests-de-head.mjs), the proof holding each for
|
|
37
|
-
// a target `tests/<nom>.rs` too, when its
|
|
32
|
+
// - HEAD's version of a test file plays in a tree of its own (`arbreDAvant`), never beside the
|
|
33
|
+
// file: a target `tests/<nom>.rs`, a target cargo finds by itself, its tree the copy's with that
|
|
34
|
+
// file replaced, built in the cargo target directory of the copy (`envDArbre`); none for
|
|
35
|
+
// `tests/<dossier>/main.rs` nor a unit test of `src/`, whose names of tests HEAD's version holds
|
|
36
|
+
// are read without playing them (`testsDeHead`, ./tests-de-head.mjs), the proof holding each for
|
|
37
|
+
// a green HEAD holds; those of a target `tests/<nom>.rs` too, when its tree no longer compiles
|
|
38
|
+
// (grillhouse-3e2.2).
|
|
38
39
|
// - What the testwriter writes of the manifests (`manifestes`): the tables that declare what the
|
|
39
40
|
// tests of a crate depend on, `[dev-dependencies]` and `[target.<cible>.dev-dependencies]` of
|
|
40
41
|
// its Cargo.toml (cargo's book, « Development dependencies »), as the author of a test of Bazel
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
// when a manifest is judged, so that a project of another language, which loads this module
|
|
49
50
|
// without it, never needs it.
|
|
50
51
|
import { spawnSync } from 'node:child_process';
|
|
51
|
-
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
52
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
52
53
|
import { createRequire } from 'node:module';
|
|
53
54
|
import path from 'node:path';
|
|
54
55
|
import { isDeepStrictEqual } from 'node:util';
|
|
@@ -270,16 +271,15 @@ export const DE_NUIT = '_nuit';
|
|
|
270
271
|
export const BANC = '_budget';
|
|
271
272
|
|
|
272
273
|
/**
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
* its crate's module.
|
|
274
|
+
* Whether HEAD's version of the test file <chemin> (from the root <racine>) plays in a tree of its
|
|
275
|
+
* own, in the same proof as the lot's: a test target `tests/<nom>.rs`, a target cargo finds by
|
|
276
|
+
* itself (`autotests`), its `mod` of the same folder read as the file's; false for any other
|
|
277
|
+
* file: a target `tests/<dossier>/main.rs` holds its modules beside it, and a unit test of
|
|
278
|
+
* `src/` is compiled in its crate's module (`testsDeHead` reads their names).
|
|
279
|
+
* @param {string} chemin
|
|
280
|
+
* @param {string} racine
|
|
281
281
|
*/
|
|
282
|
-
export function
|
|
282
|
+
export function arbreDAvant(chemin, racine) {
|
|
283
283
|
const abs = path.resolve(racine, chemin);
|
|
284
284
|
const c = composantDans(
|
|
285
285
|
crates(racine).map(x => x.composant),
|
|
@@ -287,30 +287,45 @@ export function soeurDAvant(chemin, racine) {
|
|
|
287
287
|
abs
|
|
288
288
|
);
|
|
289
289
|
const parts = c ? path.relative(c.dossier, abs).split(path.sep) : [];
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
290
|
+
return parts.length === 2 && parts[0] === 'tests' && parts[1].endsWith('.rs');
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** The variable that names, to the launcher, the copy whose git tracks the `Cargo.lock` of a tree. */
|
|
294
|
+
export const COPIE_DE_L_ARBRE = 'GRILLHOUSE_COPIE_DE_L_ARBRE';
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* The environment a tree of HEAD's version plays under: the target directory of the copy's
|
|
298
|
+
* compilations, so that the tree builds there, whatever its place (`cibleDeCompilation`
|
|
299
|
+
* (./sccache.mjs) for a copy in the temporary directory, its `target/` otherwise; the caller's
|
|
300
|
+
* own `CARGO_TARGET_DIR` stays), and the copy itself (`COPIE_DE_L_ARBRE`), where git tracks the
|
|
301
|
+
* `Cargo.lock` the tree, which has no `.git`, carries.
|
|
302
|
+
* @param {string} _chemin
|
|
303
|
+
* @param {string} racine
|
|
304
|
+
* @returns {NodeJS.ProcessEnv}
|
|
305
|
+
*/
|
|
306
|
+
export function envDArbre(_chemin, racine) {
|
|
307
|
+
const cible = cibleDeCompilation(racine, process.env, { creer: false });
|
|
308
|
+
return {
|
|
309
|
+
...(process.env.CARGO_TARGET_DIR || cible.CARGO_TARGET_DIR
|
|
310
|
+
? cible
|
|
311
|
+
: { CARGO_TARGET_DIR: path.join(racine, 'target') }),
|
|
312
|
+
[COPIE_DE_L_ARBRE]: racine,
|
|
313
|
+
};
|
|
297
314
|
}
|
|
298
315
|
|
|
299
316
|
/**
|
|
300
317
|
* The names of the tests of HEAD's version of the test file <chemin> (from the root <racine>),
|
|
301
|
-
* read without playing them, for a file
|
|
302
|
-
*
|
|
303
|
-
* `
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* from the root. Null for any other file, or one HEAD does not hold.
|
|
318
|
+
* read without playing them, for a file whose tree the proof does not play: a unit test file of
|
|
319
|
+
* `src/` (`tests.rs`, a file of a folder `tests/` under `src/`, out of `src/bin/`) and a target
|
|
320
|
+
* `tests/<dossier>/main.rs` (./tests-de-head.mjs), and a target `tests/<nom>.rs`, whose tree the
|
|
321
|
+
* proof plays unless it no longer compiles (grillhouse-3e2.2): its names as nextest gives them,
|
|
322
|
+
* without the target, its out-of-line modules read (`mod common;`, `common::<fn>`). <lire> gives
|
|
323
|
+
* HEAD's text of a file from the root. Null for any other file, or one HEAD does not hold.
|
|
308
324
|
* @param {string} chemin
|
|
309
325
|
* @param {string} racine
|
|
310
326
|
* @param {(f: string) => string | null} lire
|
|
311
|
-
* @param {{ sansSoeur?: boolean }} [options]
|
|
312
327
|
*/
|
|
313
|
-
export function testsDeHead(chemin, racine, lire
|
|
328
|
+
export function testsDeHead(chemin, racine, lire) {
|
|
314
329
|
const abs = path.resolve(racine, chemin);
|
|
315
330
|
const c = composantDans(
|
|
316
331
|
crates(racine).map(x => x.composant),
|
|
@@ -324,7 +339,7 @@ export function testsDeHead(chemin, racine, lire, { sansSoeur = false } = {}) {
|
|
|
324
339
|
if (parts.length === 3 && parts[0] === 'tests' && parts[2] === 'main.rs') {
|
|
325
340
|
return nomsDeHead(chemin, null, lire);
|
|
326
341
|
}
|
|
327
|
-
if (
|
|
342
|
+
if (arbreDAvant(chemin, racine)) {
|
|
328
343
|
return nomsDeHead(chemin, null, lire);
|
|
329
344
|
}
|
|
330
345
|
if (!unitaire(parts) || parts[1] === 'bin') {
|
|
@@ -508,3 +523,84 @@ function horsDesTests(chemin, racine, avant, apres) {
|
|
|
508
523
|
|
|
509
524
|
/** What the testwriter writes of the manifests (scripts/jointure.d.ts, `manifestes`). */
|
|
510
525
|
export const manifestes = { verrous: ['Cargo.lock'], horsDesTests };
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* The name a Cargo.toml <texte> gives its package: the `name` of its `[package]`; null for none.
|
|
529
|
+
* @param {string} texte
|
|
530
|
+
*/
|
|
531
|
+
export function nomDuManifeste(texte) {
|
|
532
|
+
let section = null;
|
|
533
|
+
for (const l of texte.split('\n')) {
|
|
534
|
+
const s = /^\s*\[([^\]]+)\]\s*(?:#.*)?$/.exec(l);
|
|
535
|
+
if (s) {
|
|
536
|
+
section = s[1].trim();
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
const n = /^\s*name\s*=\s*["']([^"']+)["']/.exec(l);
|
|
540
|
+
if (section === 'package' && n) {
|
|
541
|
+
return n[1];
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return null;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
const TABLES = ['dependencies', 'dev-dependencies', 'build-dependencies'];
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* The absolute path of the binary <sortie> of the crate at <chemin> (from the root of the workspace
|
|
551
|
+
* at <racine>): a target of kind `bin` of `cargo metadata`, in its target directory, under
|
|
552
|
+
* `release` or `debug`. Throws, named, for a folder that holds no crate and for a crate without
|
|
553
|
+
* that binary.
|
|
554
|
+
* @param {string} racine
|
|
555
|
+
* @param {string} chemin
|
|
556
|
+
* @param {string} sortie
|
|
557
|
+
* @param {{ release?: boolean }} [o]
|
|
558
|
+
*/
|
|
559
|
+
export function sortieDuPaquet(racine, chemin, sortie, { release = false } = {}) {
|
|
560
|
+
const m = metadonnees(racine);
|
|
561
|
+
const crate = m?.packages.find(
|
|
562
|
+
p => path.relative(m.workspace_root, path.dirname(p.manifest_path)) === path.normalize(chemin)
|
|
563
|
+
);
|
|
564
|
+
if (!crate) {
|
|
565
|
+
throw new Error(`${chemin} ne tient aucun crate du dépôt.`);
|
|
566
|
+
}
|
|
567
|
+
const binaires = crate.targets.filter(t => t.kind.includes('bin')).map(t => t.name);
|
|
568
|
+
if (!binaires.includes(sortie)) {
|
|
569
|
+
throw new Error(
|
|
570
|
+
`le crate ${crate.name} ne produit pas de binaire « ${sortie} » (ses binaires : ${binaires.join(', ') || 'aucun'}).`
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
return path.join(m.target_directory, release ? 'release' : 'debug', sortie);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* The internal dependencies of the crate at <chemin> (from <racine>): each dependency with a
|
|
578
|
+
* `path` (in `[dependencies]`, `[dev-dependencies]`, `[build-dependencies]` and the same under
|
|
579
|
+
* `[target.*]`; a `workspace = true` one takes the `path` of `[workspace.dependencies]` of the
|
|
580
|
+
* root Cargo.toml), named by <nomA> of the folder at that path, else by its key.
|
|
581
|
+
* @param {string} racine
|
|
582
|
+
* @param {string} chemin
|
|
583
|
+
* @param {(dossier: string) => string | null} nomA
|
|
584
|
+
*/
|
|
585
|
+
export function liensDuManifeste(racine, chemin, nomA) {
|
|
586
|
+
const { parse } = require('smol-toml');
|
|
587
|
+
const lire = f => (existsSync(f) ? parse(readFileSync(f, 'utf8')) : null);
|
|
588
|
+
const dossier = path.join(racine, chemin);
|
|
589
|
+
const m = lire(path.join(dossier, 'Cargo.toml')) ?? {};
|
|
590
|
+
const communes = lire(path.join(racine, 'Cargo.toml'))?.workspace?.dependencies ?? {};
|
|
591
|
+
const noms = new Set();
|
|
592
|
+
const tables = [
|
|
593
|
+
...TABLES.map(t => m[t]),
|
|
594
|
+
...Object.values(m.target ?? {}).flatMap(c => TABLES.map(t => c?.[t])),
|
|
595
|
+
];
|
|
596
|
+
for (const table of tables) {
|
|
597
|
+
for (const [cle, spec] of Object.entries(table ?? {})) {
|
|
598
|
+
const commune = spec?.workspace === true;
|
|
599
|
+
const lien = commune ? communes[cle]?.path : spec?.path;
|
|
600
|
+
if (typeof lien === 'string') {
|
|
601
|
+
noms.add(nomA(path.resolve(commune ? racine : dossier, lien)) ?? cle);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return { noms: [...noms], table: 'path', outil: 'cargo' };
|
|
606
|
+
}
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
// `ws-outil`, which depends on `ws-app` for its tests (`dev`) and on `ws-core` for its build
|
|
9
9
|
// script (`build`); `ws-matiere`, the shared test material (`[package.metadata.grillhouse]
|
|
10
10
|
// matiere = true`); the interfaces of `ws-core`, of `ws-app` and of the root, and the index of the
|
|
11
|
-
// interfaces they give, up to date (grillhouse-pkl.6). Committed: `espace`; the same
|
|
12
|
-
// out of every crate added: `change`, measured from its commit; the same with a second commit
|
|
11
|
+
// interfaces they give, up to date (grillhouse-pkl.6). Committed: `espace`; the same with a second commit
|
|
13
12
|
// that changes `ws-core`, adds the crate `ws-neuf` and removes `ws-outil`: `lot`; the same, the
|
|
14
13
|
// interface of `ws-core` then changed, its index late: `enRetard`.
|
|
15
14
|
// - Each workspace commits its Cargo.lock, the one cargo writes (grillhouse-rph): the commands
|
|
@@ -124,6 +123,12 @@ function espace(dans) {
|
|
|
124
123
|
ecrire('Cargo.lock', verrou(Object.entries(DEPENDANCES)));
|
|
125
124
|
ecrire('.gitignore', '/target\n');
|
|
126
125
|
ecrire('README.md', "# L'espace d'essai\n");
|
|
126
|
+
ecrire(
|
|
127
|
+
'docs/ARCHITECTURE.md',
|
|
128
|
+
`# Architecture\n\n| Composant | Langage |\n| --- | --- |\n${Object.keys(CRATES)
|
|
129
|
+
.map(n => `| \`crates/${n}\` | cargo |\n`)
|
|
130
|
+
.join('')}`
|
|
131
|
+
);
|
|
127
132
|
for (const [n, m] of Object.entries(CRATES)) {
|
|
128
133
|
ecrire(`crates/${n}/Cargo.toml`, m);
|
|
129
134
|
ecrire(`crates/${n}/src/lib.rs`, `pub fn ${n}() -> i32 {\n 1\n}\n`);
|
|
@@ -245,13 +250,6 @@ export default {
|
|
|
245
250
|
'crates/aide/Cargo.toml': manifeste('aide'),
|
|
246
251
|
'crates/aide/src/lib.rs': 'pub fn aide() {}\n',
|
|
247
252
|
});
|
|
248
|
-
const change = espace(dans);
|
|
249
|
-
const depuis = tete(change);
|
|
250
|
-
writeFileSync(
|
|
251
|
-
path.join(change, 'crates/core/src/lib.rs'),
|
|
252
|
-
'pub fn core() -> i32 {\n 2\n}\n'
|
|
253
|
-
);
|
|
254
|
-
writeFileSync(path.join(change, 'notes.txt'), 'hors des crates\n');
|
|
255
253
|
const lot = espace(dans);
|
|
256
254
|
const avantLeLot = tete(lot);
|
|
257
255
|
const ecrireLot = ecrireDans(lot);
|
|
@@ -283,8 +281,6 @@ export default {
|
|
|
283
281
|
espace: aJour,
|
|
284
282
|
seul,
|
|
285
283
|
imbrique,
|
|
286
|
-
change,
|
|
287
|
-
depuis,
|
|
288
284
|
lot,
|
|
289
285
|
avantLeLot,
|
|
290
286
|
enRetard,
|
|
@@ -319,11 +315,6 @@ export default {
|
|
|
319
315
|
'ws-absent : sans fournisseur',
|
|
320
316
|
],
|
|
321
317
|
},
|
|
322
|
-
touches: {
|
|
323
|
-
valide: { racine: aJour, depuis: 'HEAD' },
|
|
324
|
-
invalide: { racine: change, depuis },
|
|
325
|
-
attendu: ['touché ws-core', 'dépendant ws-app', 'dépendant ws-outil', 'hors notes.txt'],
|
|
326
|
-
},
|
|
327
318
|
commandes: {
|
|
328
319
|
valide: ['tester', 'verifier', 'typer', 'preparer'],
|
|
329
320
|
invalide: ['tester', 'deployer'],
|
|
@@ -382,12 +373,12 @@ export default {
|
|
|
382
373
|
'crates/core/tests/scenario/main.rs',
|
|
383
374
|
'Cargo.toml',
|
|
384
375
|
],
|
|
385
|
-
// A night test and a bench
|
|
376
|
+
// A target, a night test and a bench play in a tree, under their own name.
|
|
386
377
|
invalide: [
|
|
387
378
|
'crates/core/tests/t.rs',
|
|
388
379
|
'crates/core/tests/t_nuit.rs',
|
|
389
380
|
'crates/core/tests/t_budget.rs',
|
|
390
|
-
// A unit test of `src/` and a target `tests/<dossier>/main.rs` have no
|
|
381
|
+
// A unit test of `src/` and a target `tests/<dossier>/main.rs` have no tree: the
|
|
391
382
|
// names of HEAD's tests are read, as nextest reports them (its module path), the
|
|
392
383
|
// braces of a comment, a string or a character not counted, a `mod` of main.rs read.
|
|
393
384
|
{
|
|
@@ -403,9 +394,9 @@ export default {
|
|
|
403
394
|
},
|
|
404
395
|
],
|
|
405
396
|
attendu: [
|
|
406
|
-
'crates/core/tests/t.rs →
|
|
407
|
-
'crates/core/tests/t_nuit.rs →
|
|
408
|
-
'crates/core/tests/t_budget.rs →
|
|
397
|
+
'crates/core/tests/t.rs → un arbre',
|
|
398
|
+
'crates/core/tests/t_nuit.rs → un arbre',
|
|
399
|
+
'crates/core/tests/t_budget.rs → un arbre',
|
|
409
400
|
'crates/core/src/rendu/tests.rs : rendu::tests::ancien, rendu::tests::groupe::interne',
|
|
410
401
|
'crates/core/tests/scenario/main.rs : principal, m::dedans, aide::aidant',
|
|
411
402
|
],
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
// - The components, a file's, the shared test material, the components that play tests, the
|
|
16
16
|
// readers of a crate, the rule of a test file and what the testwriter writes of the manifests
|
|
17
17
|
// (./composants.mjs).
|
|
18
|
-
// - The crates touched since a commit and their dependents (./touches.mjs).
|
|
19
18
|
// - The elements of a lot, one per crate (./elements-du-lot.mjs).
|
|
20
|
-
// - The commands `tester
|
|
19
|
+
// - The commands `tester` (the crates' tasks of Turborepo), `tests-du-paquet` (the body of a crate's
|
|
20
|
+
// task), `verifier`, `typer`, `preparer` and `tests-de-nuit` (./commandes.mjs),
|
|
21
21
|
// each described, `{ script, args }`, never run, `preparer` played by the integration before the
|
|
22
22
|
// verification, `tests-de-nuit` by the night (the test targets `tests/*_nuit.rs`, then the time
|
|
23
23
|
// budget benches `tests/*_budget.rs`, which the day leaves out);
|
|
24
24
|
// the verdict of a run (./verdict.mjs). The tool of a test's temporary directory, the crate
|
|
25
|
-
// `tempfile`, and its guard: `
|
|
25
|
+
// `tempfile`, and its guard: `tests-du-paquet` and `verifier` play under a base of their pass, named in
|
|
26
26
|
// TMPDIR, TMP and TEMP, and fail naming what the tests left there (./commandes.mjs).
|
|
27
27
|
// - The generated file, the index of the interfaces (./index-interfaces.mjs), its command and its
|
|
28
28
|
// check; the guards of structure, in the order they play: the sizes of the tests
|
|
@@ -38,17 +38,21 @@
|
|
|
38
38
|
import { readFileSync } from 'node:fs';
|
|
39
39
|
import path from 'node:path';
|
|
40
40
|
import { fileURLToPath } from 'node:url';
|
|
41
|
-
import { commandes, GARDES } from './commandes.mjs';
|
|
41
|
+
import { commandes, fichierHorsDuJour, GARDES } from './commandes.mjs';
|
|
42
42
|
import {
|
|
43
43
|
composantDans,
|
|
44
44
|
composants,
|
|
45
45
|
estUnTest,
|
|
46
|
-
|
|
46
|
+
arbreDAvant,
|
|
47
|
+
envDArbre,
|
|
47
48
|
testsDeHead,
|
|
48
49
|
joueDesTests,
|
|
49
50
|
lecteurs,
|
|
51
|
+
liensDuManifeste,
|
|
50
52
|
manifestes,
|
|
51
53
|
matieres,
|
|
54
|
+
nomDuManifeste,
|
|
55
|
+
sortieDuPaquet,
|
|
52
56
|
} from './composants.mjs';
|
|
53
57
|
import { elementsDuLot } from './elements-du-lot.mjs';
|
|
54
58
|
import { enRetard, entreesDeLIndex, SORTIE } from './index-interfaces.mjs';
|
|
@@ -56,7 +60,6 @@ import { miseAJour } from './mise-a-jour.mjs';
|
|
|
56
60
|
import * as taillesDesTests from './migrations/0.28.4-tailles-des-tests.mjs';
|
|
57
61
|
import { squelette } from './squelette.mjs';
|
|
58
62
|
import { CACHE, CIBLES } from './sccache.mjs';
|
|
59
|
-
import { touches } from './touches.mjs';
|
|
60
63
|
import { verdict } from './verdict.mjs';
|
|
61
64
|
|
|
62
65
|
// The scripts of this module, beside this file.
|
|
@@ -65,6 +68,12 @@ const ici = nom => path.join(path.dirname(fileURLToPath(import.meta.url)), nom);
|
|
|
65
68
|
export default {
|
|
66
69
|
nom: 'cargo',
|
|
67
70
|
manifeste: 'Cargo.toml',
|
|
71
|
+
nomDuManifeste,
|
|
72
|
+
liensDuManifeste,
|
|
73
|
+
sortieDuPaquet,
|
|
74
|
+
construireLesPaquets: () => {
|
|
75
|
+
throw new Error('construction non prise en charge pour cargo');
|
|
76
|
+
},
|
|
68
77
|
// The reader of TOML by which the lock judges a Cargo.toml (./composants.mjs, `manifestes`).
|
|
69
78
|
outils: ['smol-toml'],
|
|
70
79
|
// The binaries the module runs, each at an exact version: nextest and cargo-deny at the ones the
|
|
@@ -110,12 +119,13 @@ export default {
|
|
|
110
119
|
matieres,
|
|
111
120
|
joueDesTests,
|
|
112
121
|
lecteurs,
|
|
113
|
-
touches,
|
|
114
122
|
elementsDuLot,
|
|
115
123
|
commandes,
|
|
116
124
|
verdict,
|
|
117
125
|
estUnTest,
|
|
118
|
-
|
|
126
|
+
horsDuJour: fichierHorsDuJour,
|
|
127
|
+
arbreDAvant,
|
|
128
|
+
envDArbre,
|
|
119
129
|
testsDeHead,
|
|
120
130
|
manifestes,
|
|
121
131
|
fichiersEngendres: () => [
|
|
@@ -49,11 +49,16 @@
|
|
|
49
49
|
// error of cargo that cannot run its wrapper.
|
|
50
50
|
import { spawnSync } from 'node:child_process';
|
|
51
51
|
import { createHash } from 'node:crypto';
|
|
52
|
-
import {
|
|
52
|
+
import { readFileSync, readlinkSync, realpathSync } from 'node:fs';
|
|
53
53
|
import { createRequire } from 'node:module';
|
|
54
54
|
import { homedir } from 'node:os';
|
|
55
55
|
import path from 'node:path';
|
|
56
|
-
import {
|
|
56
|
+
import {
|
|
57
|
+
cacheDeCompilation,
|
|
58
|
+
cacheDeLaRacine,
|
|
59
|
+
dansLeTemporaire,
|
|
60
|
+
trouverDansLePath,
|
|
61
|
+
} from '../../services-du-noyau.mjs';
|
|
57
62
|
|
|
58
63
|
// The loader of smol-toml, an optional peer of the package, a tool of this module.
|
|
59
64
|
const require = createRequire(import.meta.url);
|
|
@@ -140,18 +145,7 @@ export function sccacheAbsent(racine, env) {
|
|
|
140
145
|
if (lanceurDuProjet(racine, env)) {
|
|
141
146
|
return null;
|
|
142
147
|
}
|
|
143
|
-
|
|
144
|
-
.split(path.delimiter)
|
|
145
|
-
.filter(Boolean)
|
|
146
|
-
.some(d => {
|
|
147
|
-
try {
|
|
148
|
-
accessSync(path.join(d, 'sccache'), constants.X_OK);
|
|
149
|
-
return true;
|
|
150
|
-
} catch {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
return present
|
|
148
|
+
return trouverDansLePath('sccache', env)
|
|
155
149
|
? null
|
|
156
150
|
: "⛔ sccache absent du PATH : cargo compile à travers lui (RUSTC_WRAPPER=sccache) ; `npx grillhouse maj` l'installe avec les autres binaires du module cargo.";
|
|
157
151
|
}
|