{"file":"scripts/build-client.mjs","version":318,"total":61,"from":1,"to":61,"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// Local projects run the open server's code in the client (client/src/local-store.ts); its Durable Object","atom":"a2827","author":"pinch","version":287},{"n":35,"text":"\t\t// base class comes from the Workers runtime, so the bundle gets the client's stand-in.","atom":"a2827","author":"pinch","version":287},{"n":36,"text":"\t\talias: { \"cloudflare:workers\": \"./client/src/durable-object-stand-in.ts\" },","atom":"a2827","author":"pinch","version":287},{"n":37,"text":"\t\t// A bundled CommonJS package (yaml) calls require(\"process\") lazily, which an ES module bundle","atom":"a1828","author":"node20","version":169},{"n":38,"text":"\t\t// can't do without a real require.","atom":"a1828","author":"node20","version":169},{"n":39,"text":"\t\tbanner: {","atom":"a1828","author":"node20","version":169},{"n":40,"text":"\t\t\tjs: [","atom":"a1828","author":"node20","version":169},{"n":41,"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":42,"text":"\t\t\t\t'import { createRequire as __absoCreateRequire } from \"node:module\";',","atom":"a1828","author":"node20","version":169},{"n":43,"text":"\t\t\t\t\"const require = __absoCreateRequire(import.meta.url);\",","atom":"a1828","author":"node20","version":169},{"n":44,"text":"\t\t\t\t...banner,","atom":"a1866","author":"node20","version":172},{"n":45,"text":"\t\t\t].join(\"\\n\"),","atom":"a1828","author":"node20","version":169},{"n":46,"text":"\t\t},","atom":"a1828","author":"node20","version":169},{"n":47,"text":"\t});","atom":"a1828","author":"node20","version":169},{"n":48,"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":49,"text":"\t// Escaped, the file is plain text that every tool shows and stores as it is.","atom":"a1839","author":"node20","version":170},{"n":50,"text":"\treturn result.outputFiles[0].text.replace(","atom":"a1839","author":"node20","version":170},{"n":51,"text":"\t\t/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/g,","atom":"a1839","author":"node20","version":170},{"n":52,"text":"\t\t(c) => `\\\\x${c.charCodeAt(0).toString(16).padStart(2, \"0\")}`,","atom":"a1839","author":"node20","version":170},{"n":53,"text":"\t);","atom":"a1839","author":"node20","version":170},{"n":54,"text":"}","atom":"a1828","author":"node20","version":169},{"n":55,"text":"","atom":"a1828","author":"node20","version":169},{"n":56,"text":"if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {","atom":"a1828","author":"node20","version":169},{"n":57,"text":"\tconst path = join(root, OUT);","atom":"a1828","author":"node20","version":169},{"n":58,"text":"\tmkdirSync(dirname(path), { recursive: true });","atom":"a1866","author":"node20","version":172},{"n":59,"text":"\twriteFileSync(path, buildClient());","atom":"a1866","author":"node20","version":172},{"n":60,"text":"\tprocess.stdout.write(`Built ${OUT}: node ${OUT} help\\n`);","atom":"a1866","author":"node20","version":172},{"n":61,"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"}},{"atom":"a2827","author":"pinch","message":"","time":1792119773277,"timeIso":"2026-10-16T03:02:53.277Z","publish":{"draft":null,"version":287,"agent":"pinch","message":"Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network\n\nA local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.\n\n- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says \"server\": \"local\".\n- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\\abso\\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.\n- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.\n- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.\n- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.\n- Each command closes the store files it opened.\n\nTests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.","time":1792119778236,"timeIso":"2026-10-16T03:02:58.236Z"}}]}