Versions 170 to 318
Lines 2–16 at 318 (were 2–18 at 170)
22// as one plain-JS file for Node 20 or later. Node 20 can't run the .ts files themselves (it has no type
7−// npm run build:client rebuilds it; run it after changing the client and push the result.
8−// npm run check:client-bundle fails when the file isn't what a build of this folder gives (the check runs it).
8+// The file isn't committed (.gitignore leaves client/bin/ out); build it again after pulling. It sits one
9+// folder under client/, so the client's own folder (client-version.ts) is still client/. scripts/pack-npm.mjs
10−// The file is committed, so a fresh clone runs it with no install and no build. It sits one folder under
11−// client/, so the client's own folder (client-version.ts) is still client/. The build is deterministic:
12−// paths in it are relative to the repo, so it comes out the same on every machine.
13−//
15−import { readFileSync, writeFileSync } from "node:fs";
Lines 18–25 at 318 (were 20–27 at 170)
2220
23−/** The bundle's text, built in memory. */
24−export function buildClient() {
21+/** The bundle's text, built in memory. `banner` adds lines at its top (the npm package stamps its version). */
Lines 31–47 at 318 (were 33–45 at 170)
34+ // Local projects run the open server's code in the client (client/src/local-store.ts); its Durable Object
3637 // A bundled CommonJS package (yaml) calls require("process") lazily, which an ES module bundle
40− "// Built from client/abso.ts by scripts/build-client.mjs (npm run build:client). Don't edit it by hand.",
41+ "// Built from client/abso.ts by scripts/build-client.mjs (npm run build). Don't edit it by hand.",
Lines 55–61 at 318 (were 53–69 at 170)
5355
56− const text = buildClient();
57− if (process.argv.includes("--check")) {
58− let have = "";
59− try {
60− have = readFileSync(path, "utf8").replace(/\r\n/g, "\n");
61− } catch {}
62− if (have !== text) {
63− process.stderr.write(
64− `${OUT} is not a build of this folder's client: run npm run build:client and push the file it writes.\n`,
65− );
66− process.exit(1);
67− }
68− } else writeFileSync(path, text);
- MCP
- compare on this site's /mcp
- CLI
- abso diff 170 318 scripts/build-client.mjs --json
- JSON
- /christopher/abso-core/compare/170..318?file=scripts%2Fbuild-client.mjs&format=json