Some checks failed
CI / Build & test (Node 24) (push) Has been cancelled
CI / Pack & boot smoke (Node 22) (push) Has been cancelled
CI / No em/en dashes (push) Has been cancelled
CI / Build & test (Node 22) (push) Has been cancelled
Deploy site (production) / build-and-deploy (push) Successful in 20s
Remplace les 547 tirets cadratins (U+2014) et demi-cadratins (U+2013) des fichiers versionnés par la ponctuation contextuelle adaptée (point médian, deux-points, virgule, parenthèses ; tiret simple pour les plages), sur 122 fichiers (appli, vitrine, doc, tests, workflows, scripts). Ajoute le job CI « lint-dashes » (git grep -P) qui échoue si un tiret cadratin/demi-cadratin réapparaît, hors logo binaire et captures brutes du terminal (fidélité des fixtures de détection de dialogue).
32 lines
1.4 KiB
JavaScript
32 lines
1.4 KiB
JavaScript
#!/usr/bin/env node
|
|
// Embarque la SPA buildée (packages/web/dist) dans public/ du package server,
|
|
// pour que le tarball npm soit autonome. Branché sur le hook "prepack".
|
|
// ARBORETUM_PACK_NO_WEB=1 : mode tolérant (CI/smoke), placeholder à la place du front.
|
|
import { cpSync, existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
import { join, dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const serverDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
const webDist = join(serverDir, '..', 'web', 'dist');
|
|
const publicDir = join(serverDir, 'public');
|
|
|
|
if (!existsSync(webDist)) {
|
|
if (process.env.ARBORETUM_PACK_NO_WEB === '1') {
|
|
rmSync(publicDir, { recursive: true, force: true });
|
|
mkdirSync(publicDir, { recursive: true });
|
|
writeFileSync(
|
|
join(publicDir, 'index.html'),
|
|
'<!doctype html>\n<html lang="en">\n<head><meta charset="utf-8"><title>Arboretum</title></head>\n' +
|
|
'<body><p>Arboretum server is running, but this package was built without the web UI.</p></body>\n</html>\n',
|
|
);
|
|
console.log('copy-web: ARBORETUM_PACK_NO_WEB=1: wrote placeholder public/index.html');
|
|
process.exit(0);
|
|
}
|
|
console.error(`copy-web: ${webDist} not found: run npm run build -w @arboretum/web first`);
|
|
process.exit(1);
|
|
}
|
|
|
|
rmSync(publicDir, { recursive: true, force: true });
|
|
cpSync(webDist, publicDir, { recursive: true });
|
|
console.log(`copy-web: copied ${webDist} -> ${publicDir}`);
|