{"draft":null,"from":14,"to":318,"files":[{"path":"client/src/export.ts","added":37,"removed":13,"diff":"--- a/client/src/export.ts\n+++ b/client/src/export.ts\n@@ -1,25 +1,30 @@\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 .avcs-export.json naming\n-// the version, to stamp the build with. Exporting again replaces the folder,\n-// keeping node_modules (and what --keep names) so a build needs no new install.\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 = \".avcs-export.json\";\n+export const EXPORT_STAMP = \".abso-export\";\n+/** Its earlier names: an export made then still counts as one. A .json name drew the project's formatter. */\n+const OLD_EXPORT_STAMPS = [\".abso-export.json\", \".avcs-export.json\"];\n \n /** Where an export may go: outside the abso folder, or in a part of it abso leaves out. Empty, or an earlier export. */\n function checkTarget(root: string, target: string): void {\n@@ -29,12 +34,15 @@\n \t}\n \tif (inside !== undefined && !ignoredHere(loadIgnore(root), inside, true)) {\n \t\tthrow new UsageError(\n-\t\t\t`${inside} is inside this abso folder, so abso would record the export as your edits. Export outside the folder, or into a folder .avcsignore leaves out`,\n+\t\t\t`${inside} is inside this abso folder, so abso would record the export as your edits. Export outside the folder, or into a folder .absoignore leaves out`,\n \t\t);\n \t}\n \tif (!existsSync(target)) return;\n \tif (!statSync(target).isDirectory()) throw new UsageError(`${target} is a file; export to a folder`);\n-\tif (readdirSync(target).length > 0 && !existsSync(join(target, EXPORT_STAMP))) {\n+\tif (\n+\t\treaddirSync(target).length > 0 &&\n+\t\t![EXPORT_STAMP, ...OLD_EXPORT_STAMPS].some((n) => existsSync(join(target, n)))\n+\t) {\n \t\tthrow new UsageError(\n \t\t\t`${target} has files in it; export to an empty folder (an export replaces only a folder an earlier export made)`,\n \t\t);\n@@ -74,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@@ -95,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@@ -128,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, null, 2)}\\n`);\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":[]}