mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 08:09:18 +02:00
- package.json with biome, rolldown, lightningcss devDependencies
- biome.json: add CSS formatter support
- scripts/build-css.mjs: lightningcss resolves @import chain, bundles/minifies CSS
- scripts/build-js.mjs: rolldown per-entry JS bundling (no code splitting)
- scripts/build.mjs: orchestrator for both CSS + JS
- scripts/check-build.mjs: staleness checker for CI/deploy guard
- justfile: add build, build-css, build-js, build-install, build-check recipes
- justfile: deploy recipe now runs build before deploy-code
- head.php + form-page.php: use dist/base.min.css instead of style.css
- All controllers + FormBootstrap: reference dist/*.min.{css,js}
- admin footer: load admin.min.js for all admin pages
- repertoire: use public.min.js instead of individual app JS files
- Fix stray '}' syntax error in admin.css line 305
- .gitignore: add app/public/assets/dist/
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Build all frontend assets: CSS + JS.
|
|
*
|
|
* Usage:
|
|
* node scripts/build.mjs # build everything
|
|
* node scripts/build.mjs --css # CSS only
|
|
* node scripts/build.mjs --js # JS only
|
|
*
|
|
* Requires: npm install (lightningcss-cli, rolldown)
|
|
*/
|
|
|
|
import { execSync } from "node:child_process";
|
|
import { existsSync } from "node:fs";
|
|
import { resolve, dirname } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
const root = resolve(__dirname, "..");
|
|
|
|
const args = process.argv.slice(2);
|
|
const onlyCss = args.includes("--css");
|
|
const onlyJs = args.includes("--js");
|
|
const buildAll = !onlyCss && !onlyJs;
|
|
|
|
function run(label, cmd) {
|
|
console.log(`\n📦 ${label}…`);
|
|
execSync(cmd, {
|
|
cwd: root,
|
|
stdio: "inherit",
|
|
});
|
|
}
|
|
|
|
// Ensure node_modules exist
|
|
if (!existsSync(resolve(root, "node_modules"))) {
|
|
console.log("📥 Installing dependencies (npm ci)…");
|
|
execSync("npm ci", { cwd: root, stdio: "inherit" });
|
|
}
|
|
|
|
if (buildAll || onlyCss) {
|
|
run("Building CSS bundles", "node scripts/build-css.mjs");
|
|
}
|
|
|
|
if (buildAll || onlyJs) {
|
|
run("Building JS bundles", "node scripts/build-js.mjs");
|
|
}
|
|
|
|
console.log("\n✅ Build complete\n");
|