{"file":"scripts/build-client.mjs","version":261,"total":58,"from":1,"to":58,"lines":[{"n":1,"text":"// Builds client/bin/abso.mjs: the whole client, client/abso.ts and everything it imports (yaml included),","atom":"a1828","author":"node20","version":169},{"n":2,"text":"// as one plain-JS file for Node 20 or later. Node 20 can't run the .ts files themselves (it has no type","atom":"a1828","author":"node20","version":169},{"n":3,"text":"// stripping), so this file is how a checkout runs on it:","atom":"a1828","author":"node20","version":169},{"n":4,"text":"//","atom":"a1828","author":"node20","version":169},{"n":5,"text":"//   npm ci && npm run build","atom":"a1866","author":"node20","version":172},{"n":6,"text":"//   node client/bin/abso.mjs help","atom":"a1828","author":"node20","version":169},{"n":7,"text":"//","atom":"a1828","author":"node20","version":169},{"n":8,"text":"// The file isn't committed (.gitignore leaves client/bin/ out); build it again after pulling. It sits one","atom":"a1866","author":"node20","version":172},{"n":9,"text":"// folder under client/, so the client's own folder (client-version.ts) is still client/. scripts/pack-npm.mjs","atom":"a1866","author":"node20","version":172},{"n":10,"text":"// puts the same build in the npm package.","atom":"a1866","author":"node20","version":172},{"n":11,"text":"//","atom":"a1828","author":"node20","version":169},{"n":12,"text":"// Plain JS on purpose: it runs before anything is built.","atom":"a1828","author":"node20","version":169},{"n":13,"text":"import { mkdirSync, writeFileSync } from \"node:fs\";","atom":"a1866","author":"node20","version":172},{"n":14,"text":"import { createRequire } from \"node:module\";","atom":"a1828","author":"node20","version":169},{"n":15,"text":"import { dirname, join, resolve } from \"node:path\";","atom":"a1828","author":"node20","version":169},{"n":16,"text":"import { fileURLToPath } from \"node:url\";","atom":"a1828","author":"node20","version":169},{"n":17,"text":"","atom":"a1828","author":"node20","version":169},{"n":18,"text":"const root = resolve(dirname(fileURLToPath(import.meta.url)), \"..\");","atom":"a1828","author":"node20","version":169},{"n":19,"text":"const OUT = \"client/bin/abso.mjs\";","atom":"a1828","author":"node20","version":169},{"n":20,"text":"","atom":"a1828","author":"node20","version":169},{"n":21,"text":"/** The bundle's text, built in memory. `banner` adds lines at its top (the npm package stamps its version). */","atom":"a1866","author":"node20","version":172},{"n":22,"text":"export function buildClient(banner = []) {","atom":"a1866","author":"node20","version":172},{"n":23,"text":"\tconst esbuild = createRequire(import.meta.url)(\"esbuild\");","atom":"a1828","author":"node20","version":169},{"n":24,"text":"\tconst result = esbuild.buildSync({","atom":"a1828","author":"node20","version":169},{"n":25,"text":"\t\tabsWorkingDir: root,","atom":"a1828","author":"node20","version":169},{"n":26,"text":"\t\tentryPoints: [\"client/abso.ts\"],","atom":"a1828","author":"node20","version":169},{"n":27,"text":"\t\tbundle: true,","atom":"a1828","author":"node20","version":169},{"n":28,"text":"\t\tplatform: \"node\",","atom":"a1828","author":"node20","version":169},{"n":29,"text":"\t\tformat: \"esm\",","atom":"a1828","author":"node20","version":169},{"n":30,"text":"\t\ttarget: \"node20\",","atom":"a1828","author":"node20","version":169},{"n":31,"text":"\t\twrite: false,","atom":"a1828","author":"node20","version":169},{"n":32,"text":"\t\toutfile: OUT,","atom":"a1828","author":"node20","version":169},{"n":33,"text":"\t\tlogLevel: \"warning\",","atom":"a1828","author":"node20","version":169},{"n":34,"text":"\t\t// A bundled CommonJS package (yaml) calls require(\"process\") lazily, which an ES module bundle","atom":"a1828","author":"node20","version":169},{"n":35,"text":"\t\t// can't do without a real require.","atom":"a1828","author":"node20","version":169},{"n":36,"text":"\t\tbanner: {","atom":"a1828","author":"node20","version":169},{"n":37,"text":"\t\t\tjs: [","atom":"a1828","author":"node20","version":169},{"n":38,"text":"\t\t\t\t\"// Built from client/abso.ts by scripts/build-client.mjs (npm run build). Don't edit it by hand.\",","atom":"a1866","author":"node20","version":172},{"n":39,"text":"\t\t\t\t'import { createRequire as __absoCreateRequire } from \"node:module\";',","atom":"a1828","author":"node20","version":169},{"n":40,"text":"\t\t\t\t\"const require = __absoCreateRequire(import.meta.url);\",","atom":"a1828","author":"node20","version":169},{"n":41,"text":"\t\t\t\t...banner,","atom":"a1866","author":"node20","version":172},{"n":42,"text":"\t\t\t].join(\"\\n\"),","atom":"a1828","author":"node20","version":169},{"n":43,"text":"\t\t},","atom":"a1828","author":"node20","version":169},{"n":44,"text":"\t});","atom":"a1828","author":"node20","version":169},{"n":45,"text":"\t// esbuild leaves control characters in string literals as they are (yaml's lexer has \\x02, \\x18 and \\x1f).","atom":"a1839","author":"node20","version":170},{"n":46,"text":"\t// Escaped, the file is plain text that every tool shows and stores as it is.","atom":"a1839","author":"node20","version":170},{"n":47,"text":"\treturn result.outputFiles[0].text.replace(","atom":"a1839","author":"node20","version":170},{"n":48,"text":"\t\t/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/g,","atom":"a1839","author":"node20","version":170},{"n":49,"text":"\t\t(c) => `\\\\x${c.charCodeAt(0).toString(16).padStart(2, \"0\")}`,","atom":"a1839","author":"node20","version":170},{"n":50,"text":"\t);","atom":"a1839","author":"node20","version":170},{"n":51,"text":"}","atom":"a1828","author":"node20","version":169},{"n":52,"text":"","atom":"a1828","author":"node20","version":169},{"n":53,"text":"if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {","atom":"a1828","author":"node20","version":169},{"n":54,"text":"\tconst path = join(root, OUT);","atom":"a1828","author":"node20","version":169},{"n":55,"text":"\tmkdirSync(dirname(path), { recursive: true });","atom":"a1866","author":"node20","version":172},{"n":56,"text":"\twriteFileSync(path, buildClient());","atom":"a1866","author":"node20","version":172},{"n":57,"text":"\tprocess.stdout.write(`Built ${OUT}: node ${OUT} help\\n`);","atom":"a1866","author":"node20","version":172},{"n":58,"text":"}","atom":"a1828","author":"node20","version":169}],"atoms":[{"atom":"a1828","author":"node20","message":"","time":1791962809547,"timeIso":"2026-10-14T07:26:49.547Z","publish":{"draft":null,"version":169,"agent":"node20","message":"Run the client on Node 20: commit a plain-JS build of it as client/bin/abso.mjs, built by npm run build:client and checked current by the project's check. Docs give each real Node minimum: the client 20 (bundle) or 24 (TypeScript), the server's wrangler 22, with a way to run it from Node 20. engines is now >=20.","time":1791963902087,"timeIso":"2026-10-14T07:45:02.087Z"}},{"atom":"a1839","author":"node20","message":"","time":1791963955023,"timeIso":"2026-10-14T07:45:55.023Z","publish":{"draft":null,"version":170,"agent":"node20","message":"Write control characters in the client bundle as escapes, so the committed client/bin/abso.mjs is plain text that every tool shows and stores unchanged. It runs the same.","time":1791964028937,"timeIso":"2026-10-14T07:47:08.937Z"}},{"atom":"a1866","author":"node20","message":"","time":1791965182282,"timeIso":"2026-10-14T08:06:22.282Z","publish":{"draft":null,"version":172,"agent":"node20","message":"Build the client for Node 20 instead of committing the build: npm run build writes client/bin/abso.mjs from client/abso.ts, and npm run pack:npm -- <version> packs that same build as the npm package @abso-cli/abso (it never publishes). The committed bundle and the check that kept it current are gone, so client changes need no rebuild. The READMEs give the build steps.","time":1791965182282,"timeIso":"2026-10-14T08:06:22.282Z"}}]}