Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 39 to 318

Compare

+73 −0 in 1 place
new file, 73 lines
1+// Packs the npm package @abso-cli/abso from this checkout: the client as scripts/build-client.mjs builds it,
2+// for Node 20 or later. It never publishes and never reads npm's sign-in.
3+//
4+// npm ci && npm run pack:npm -- <version> (e.g. 0.171.0)
5+//
6+// It writes the package to dist/npm/package/ and its tarball, as npm pack names it, to dist/npm/.
7+// The package's layout: bin/abso.mjs checks Node's version and loads dist/abso.mjs, the bundle, stamped
8+// with the version so the client knows it is an installed package.
9+import { execFileSync } from "node:child_process";
10+import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
11+import { dirname, join, resolve } from "node:path";
12+import { fileURLToPath } from "node:url";
13+import { buildClient } from "./build-client.mjs";
15+const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
16+const version = process.argv[2];
17+if (!version || !/^\d+\.\d+\.\d+$/.test(version)) {
18+ process.stderr.write("Use: npm run pack:npm -- <version>, such as 0.171.0\n");
19+ process.exit(2);
20+}
21+const node = 20;
23+const files = {
24+ "package.json": `${JSON.stringify(
25+ {
26+ name: "@abso-cli/abso",
27+ version,
28+ description: "abso: version control built for AI agents first. The command line client.",
29+ license: "MIT",
30+ homepage: "https://abso.dev",
31+ keywords: ["version control", "vcs", "agents", "ai", "abso"],
32+ type: "module",
33+ engines: { node: `>=${node}` },
34+ bin: { abso: "bin/abso.mjs" },
35+ files: ["bin", "dist"],
36+ publishConfig: { access: "public" },
37+ },
38+ null,
39+ 2,
40+ )}\n`,
41+ // A dynamic import, so an older Node reaches the version check before it reads the bundle.
42+ "bin/abso.mjs": `#!/usr/bin/env node
43+const major = Number(process.versions.node.split(".")[0]);
44+if (major < ${node}) {
45+ process.stderr.write("abso needs Node ${node} or later, and this is Node " + process.versions.node + ". Install a newer Node from https://nodejs.org and run abso again.\\n");
46+ process.exit(1);
47+}
48+await import("../dist/abso.mjs");
49+`,
50+ "dist/abso.mjs": buildClient([`globalThis.__ABSO_PACKAGE_VERSION__ = ${JSON.stringify(version)};`]),
51+ "README.md": `# abso\n\nabso is version control for agents. This package is the abso command line.\n\nIt needs Node ${node} or later. Install it with \`npm install -g @abso-cli/abso\`, or run \`npx @abso-cli/abso help\`.\n\n[abso.dev](https://abso.dev)\n`,
52+ LICENSE: readFileSync(join(root, "LICENSE"), "utf8"),
53+};
55+const out = join(root, "dist", "npm");
56+const pkg = join(out, "package");
57+rmSync(pkg, { recursive: true, force: true });
58+for (const [path, text] of Object.entries(files)) {
59+ mkdirSync(dirname(join(pkg, path)), { recursive: true });
60+ writeFileSync(join(pkg, path), text);
61+}
62+// Under npm run, npm_execpath is npm's own script, which runs without a shell on every platform.
63+const npm = process.env.npm_execpath;
64+const pack = ["pack", pkg, "--pack-destination", out, "--ignore-scripts"];
65+const tarball = (
66+ npm
67+ ? execFileSync(process.execPath, [npm, ...pack], { cwd: root, encoding: "utf8" })
68+ : execFileSync("npm", pack, { cwd: root, encoding: "utf8", shell: process.platform === "win32" })
69+)
70+ .trim()
71+ .split("\n")
72+ .pop();
73+process.stdout.write(`Packed @abso-cli/abso ${version}: dist/npm/${tarball}\n`);
MCP
compare on this site's /mcp
CLI
abso diff 39 318 scripts/pack-npm.mjs --json
JSON
/christopher/abso-core/compare/39..318?file=scripts%2Fpack-npm.mjs&format=json