{"draft":null,"from":35,"to":318,"files":[{"path":"client/src/export.ts","added":24,"removed":7,"diff":"--- a/client/src/export.ts\n+++ b/client/src/export.ts\n@@ -1,24 +1,25 @@\n // abso export <dir> [--version N]: one published version of this folder's\n // space, written to a folder of its own, for a build that doesn't move while\n-// shared does (#37, Playtester 1). The folder gets .abso-export naming the\n+// shared does (#37). The folder gets .abso-export naming the\n // version, to stamp the build with: JSON on one line, in a file with no\n // extension, so the exported project's own formatter and linter pass it by.\n // Exporting again replaces the folder, keeping node_modules (and what --keep\n // names) so a build needs no new install.\n //\n // The version is rebuilt as `abso run --at` rebuilds it (at.ts), from the\n-// known copies and one compare; the server's listing of that version (#37,\n-// Engine 522be7f) then checks that no file is left out.\n+// known copies and one compare; the server's listing of that version (#37)\n+// then checks that no file is left out.\n \n import { chmodSync, existsSync, mkdirSync, readdirSync, rmSync, statSync, writeFileSync } from \"node:fs\";\n import { dirname, join, resolve } from \"node:path\";\n import type { Where } from \"./api.ts\";\n import { type Parsed, str, UsageError } from \"./args.ts\";\n-import { globTest, snapshotAt, snapshotEntries } from \"./at.ts\";\n-import { type Env, type Output, open, plural } from \"./commands.ts\";\n+import { applySide, globTest, snapshotAt, snapshotEntries } from \"./at.ts\";\n+import { type Env, EXIT, type Output, open, plural } from \"./commands.ts\";\n import { ignoredHere } from \"./fetch.ts\";\n import { loadIgnore, relativeTo } from \"./folder.ts\";\n import { type Refused, unsafePath } from \"./safety.ts\";\n+import { refusalText, versionsText, withoutArg } from \"./without.ts\";\n \n /** The file an export leaves in its folder: what it holds, and the sign that the folder is one export may replace. */\n export const EXPORT_STAMP = \".abso-export\";\n@@ -81,8 +82,11 @@\n \tconst rawVersion = str(args, \"version\");\n \tif (rawVersion !== undefined && !/^\\d+$/.test(rawVersion))\n \t\tthrow new UsageError(`--version is a version number (got ${JSON.stringify(rawVersion)})`);\n+\tconst leave = withoutArg(args);\n \tconst diff = await api.diff();\n \tconst where: Where = { draft: diff.draft };\n+\tif (leave !== undefined && diff.draft !== null)\n+\t\tthrow new UsageError(`--without reads shared, and this folder is on draft ${diff.draft}`);\n \t// The listing names the version (the newest by default) and every file it holds; a server from before it answers 404.\n \tconst listing = await api\n \t\t.filesAt(diff.draft, rawVersion === undefined ? undefined : Number(rawVersion))\n@@ -102,10 +106,22 @@\n \t\t\telse\n \t\t\t\tskipped.push({\n \t\t\t\t\tpath: rel,\n-\t\t\t\t\twhy: \"a binary file this folder has no copy of; abso sync --full, then export again\",\n+\t\t\t\t\twhy: \"a binary file this folder has no copy of; abso pull --full, then export again\",\n \t\t\t\t});\n \t\t}\n \t}\n+\t// Without some versions: the server says what differs from this version, as it is without them.\n+\tconst without = leave === undefined ? undefined : await api.without(version, leave);\n+\tif (without !== undefined && !without.ok)\n+\t\treturn {\n+\t\t\texit: EXIT.refused,\n+\t\t\ttext: refusalText(\n+\t\t\t\twithout,\n+\t\t\t\t(vs) => `abso export ${args.positionals[0]} --version ${version} --without ${vs.join(\",\")}`,\n+\t\t\t),\n+\t\t\tjson: { ...without },\n+\t\t};\n+\tif (without !== undefined) applySide(snap, without.files, \"after\");\n \tconst entries = await snapshotEntries(api, snap);\n \t// Built before anything is removed, so a failed export leaves an earlier one whole.\n \tconst keepGlob = str(args, \"keep\");\n@@ -135,13 +151,14 @@\n \t\tproject: config.project,\n \t\tspace: diff.draft ?? \"shared\",\n \t\tversion,\n+\t\t...(without !== undefined ? { without: without.without.map((w) => w.version), tree: without.tree } : {}),\n \t\tfiles: written,\n \t\texportedAt: new Date().toISOString(),\n \t};\n \twriteFileSync(join(target, EXPORT_STAMP), `${JSON.stringify(stamp)}\\n`);\n \treturn {\n \t\ttext: [\n-\t\t\t`Exported version ${version} of ${space} to ${target}: ${plural(written, \"file\")}. ${EXPORT_STAMP} there names the version; abso export to the same folder replaces it.`,\n+\t\t\t`Exported version ${version} of ${space}${without !== undefined ? ` without ${versionsText(without.without.map((w) => w.version))}` : \"\"} to ${target}: ${plural(written, \"file\")}. ${EXPORT_STAMP} there names the version; abso export to the same folder replaces it.`,\n \t\t\t...(kept.length > 0 ? [`Kept from the earlier export: ${kept.join(\", \")}.`] : []),\n \t\t\t...(skipped.length > 0\n \t\t\t\t? [`Not exported (${skipped.length}):`, ...skipped.map((s) => `  ${s.path}: ${s.why}`)]"}],"unmatched":[]}