{"draft":null,"from":175,"to":318,"files":[{"path":"client/src/export.ts","added":20,"removed":3,"diff":"--- a/client/src/export.ts\n+++ b/client/src/export.ts\n@@ -14,11 +14,12 @@\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@@ -106,6 +110,18 @@\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":[]}