@absolutejs/changelog 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/changelog.json +27 -0
- package/dist/cli.js +75 -24
- package/dist/cli.js.map +5 -5
- package/dist/entries.d.ts +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +115 -65
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/cli.js.map
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli.ts", "../src/entries.ts", "../src/types.ts", "../src/versioning.ts", "../src/read.ts", "../src/surface.ts", "../src/tarball.ts", "../src/json.ts", "../src/reconcile.ts", "../src/registry.ts", "../src/write.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"#!/usr/bin/env bun\n/* absolute-changelog — the release-time companion for every package that\n * keeps a changelog.\n *\n * absolute-changelog add --kind added --summary \"…\"\n * Write a pending entry under changelog/unreleased/.\n *\n * absolute-changelog release [--as major|minor|patch|prerelease]\n * [--version x.y.z] [--date YYYY-MM-DD] [--dry]\n * Turn the pending entries into a release: work out the version, write\n * changelog.json and CHANGELOG.md, bump package.json, and clear the\n * entries it consumed.\n *\n * absolute-changelog check [--offline]\n * The gate. Entries parse; the generated files are what the entries say\n * they should be; the version lines up; and the exports that moved since\n * the last published version are the exports the entries name.\n *\n * absolute-changelog adopt\n * One-time: create the entry directory, keep whatever CHANGELOG.md\n * already said as history, and wire the package's files list.\n */\nimport { existsSync } from \"node:fs\";\nimport ts from \"typescript\";\nimport { mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport {\n builtSurface,\n changelogPaths,\n loadUnreleased,\n readJsonFile,\n strayEntries,\n} from \"./entries\";\nimport { writeJsonLike } from \"./json\";\nimport { parseChangelog } from \"./read\";\nimport { describeReconciliation, reconcile } from \"./reconcile\";\nimport { packageVersions, publishedSurface } from \"./registry\";\nimport { declaresTypes, diffSurface } from \"./surface\";\nimport {\n CHANGELOG_CONTRACT,\n CHANGELOG_FILE,\n CHANGELOG_MARKDOWN,\n CHANGE_KINDS,\n UNRELEASED_DIRECTORY,\n type Changelog,\n type ChangeKind,\n type Release,\n} from \"./types\";\nimport { compareVersions, nextVersion, type ReleaseKind } from \"./versioning\";\nimport { GENERATED_MARKER, renderChangelogJson, renderMarkdown } from \"./write\";\n\nclass CliError extends Error {}\n\nconst isChangeKind = (value: unknown): value is ChangeKind =>\n CHANGE_KINDS.some((kind) => kind === value);\n\nconst isReleaseKind = (value: unknown): value is ReleaseKind =>\n RELEASE_KINDS.some((kind) => kind === value);\n\nconst RELEASE_KINDS = [\"major\", \"minor\", \"patch\", \"prerelease\"] as const;\n/** Long enough to recognise the change in a file listing, short enough to\n * read. */\nconst SLUG_MAX_LENGTH = 48;\n/** `2026-09-10`. */\nconst ISO_DATE_LENGTH = 10;\n/** Enough of a dry run to see the release taking shape. */\nconst PREVIEW_LINES = 40;\n\ntype Flags = Record<string, string | true>;\n\nconst readFlags = (argv: readonly string[]) => {\n const flags: Flags = {};\n let skip = false;\n for (const [index, argument] of argv.entries()) {\n const consumed = skip;\n skip = false;\n if (consumed || !argument.startsWith(\"--\")) continue;\n const [name, inline] = argument.slice(2).split(\"=\");\n if (name === undefined || name === \"\") continue;\n const next = argv[index + 1];\n const takesNext =\n inline === undefined && next !== undefined && !next.startsWith(\"--\");\n skip = takesNext;\n flags[name] = inline ?? (takesNext && next !== undefined ? next : true);\n }\n\n return flags;\n};\n\nconst text = (flags: Flags, name: string) => {\n const value = flags[name];\n\n return typeof value === \"string\" ? value : undefined;\n};\n\nconst list = (flags: Flags, name: string) => {\n const value = text(flags, name);\n\n return value === undefined\n ? []\n : value\n .split(\",\")\n .map((part) => part.trim())\n .filter((part) => part !== \"\");\n};\n\ntype PackageShape = {\n exports?: unknown;\n scripts?: Record<string, unknown>;\n files?: string[];\n include?: unknown[];\n name?: string;\n version?: string;\n};\n\nconst isPackage = (value: unknown): value is PackageShape =>\n typeof value === \"object\" && value !== null;\n\nconst readPackage = async (root: string) => {\n const document = await readJsonFile(join(root, \"package.json\"));\n if (\n !isPackage(document) ||\n typeof document.name !== \"string\" ||\n typeof document.version !== \"string\"\n )\n throw new CliError(\n \"No package.json with a name and a version here. Run this from a package root.\",\n );\n const manifest: PackageShape & { name: string; version: string } = {\n ...document,\n name: document.name,\n version: document.version,\n };\n\n return manifest;\n};\n\nconst readChangelog = async (root: string, name: string) => {\n const document = await readJsonFile(changelogPaths(root).json);\n if (document === undefined) {\n const empty: Changelog = {\n contract: CHANGELOG_CONTRACT,\n name,\n releases: [],\n };\n\n return empty;\n }\n const read = parseChangelog(document);\n if (read.problems)\n throw new CliError(\n [`${CHANGELOG_FILE} is not a changelog:`, ...read.problems].join(\"\\n \"),\n );\n\n return read.changelog;\n};\n\nconst historyOf = async (root: string) =>\n readFile(changelogPaths(root).history, \"utf8\").catch(() => undefined);\n\nconst writeBoth = async (root: string, changelog: Changelog) => {\n const paths = changelogPaths(root);\n const history = await historyOf(root);\n await writeFile(paths.json, renderChangelogJson(changelog));\n await writeFile(\n paths.markdown,\n renderMarkdown(changelog, history === undefined ? {} : { history }),\n );\n};\n\nconst slug = (summary: string) =>\n summary\n .toLowerCase()\n .replace(/[^a-z0-9]+/gu, \"-\")\n .replace(/^-|-$/gu, \"\")\n .slice(0, SLUG_MAX_LENGTH) || \"change\";\n\n/**\n * Where the package's public API is declared, if it is where it usually is.\n *\n * An entry that imports it gets its symbols checked by the compiler at the\n * moment somebody types them, which is the difference between a typo caught\n * in an editor and a typo caught by a release gate a fortnight later.\n */\nconst sourceEntryOf = (root: string) => {\n for (const candidate of [\"src/index.ts\", \"src/index.tsx\", \"index.ts\"])\n if (existsSync(join(root, candidate)))\n return `../../${candidate.replace(/\\.tsx?$/u, \"\")}`;\n\n return undefined;\n};\n\nconst add = async (root: string, flags: Flags) => {\n const kind = text(flags, \"kind\");\n const summary = text(flags, \"summary\");\n if (!isChangeKind(kind))\n throw new CliError(`--kind must be one of: ${CHANGE_KINDS.join(\", \")}`);\n if (summary === undefined)\n throw new CliError(\"--summary is what the change is, in one line\");\n const symbols = list(flags, \"symbol\");\n const disruptive = kind === \"breaking\" || kind === \"removed\";\n if (disruptive && symbols.length === 0)\n throw new CliError(\n `a ${kind} change must name the exports it affects: --symbol serve,createServer`,\n );\n const instruction = text(flags, \"instruction\");\n if (disruptive && instruction === undefined)\n throw new CliError(\n `a ${kind} change must say how to migrate: --instruction \"…\"`,\n );\n const renameTo = text(flags, \"rename-to\");\n const migration =\n renameTo !== undefined && symbols[0] !== undefined\n ? [\n \"\\tmigration: {\",\n `\\t\\tinstruction: ${JSON.stringify(instruction)},`,\n `\\t\\trename: { from: ${JSON.stringify(\n symbols[0],\n )}, to: ${JSON.stringify(renameTo)} }`,\n \"\\t},\",\n ]\n : [\n `\\tmigration: { instruction: ${JSON.stringify(\n instruction,\n )}, manual: true },`,\n ];\n /* A type-only import, so the entry has nothing to resolve at run time.\n * The release gate reads these files back, and a gate that only works\n * where the dev dependencies are installed is a gate that fails in the\n * one place it matters.\n *\n * A named export rather than a default one: the ecosystem's lint config\n * restricts default exports, and an entry that trips the linter of every\n * package that writes one is a contract nobody keeps. */\n const api = sourceEntryOf(root);\n const body = [\n ...(api === undefined ? [] : [`import type * as Api from '${api}';`]),\n \"import type { Change } from '@absolutejs/changelog';\",\n \"\",\n `export const change: Change${api === undefined ? \"\" : \"<typeof Api>\"} = {`,\n `\\tkind: ${JSON.stringify(kind)},`,\n ...(disruptive ? migration : []),\n `\\tsummary: ${JSON.stringify(summary)}${symbols.length > 0 ? \",\" : \"\"}`,\n ...(symbols.length > 0 ? [`\\tsymbols: ${JSON.stringify(symbols)}`] : []),\n \"};\",\n \"\",\n ].join(\"\\n\");\n const directory = join(root, UNRELEASED_DIRECTORY);\n await mkdir(directory, { recursive: true });\n const file = join(directory, `${slug(summary)}.ts`);\n await writeFile(file, body);\n console.log(`wrote ${file}`);\n};\n\nconst release = async (root: string, flags: Flags) => {\n const manifest = await readPackage(root);\n const { entries, problems } = await loadUnreleased(root);\n if (problems.length > 0)\n throw new CliError(\n [\"These entries are not usable:\", ...problems].join(\"\\n \"),\n );\n if (entries.length === 0)\n throw new CliError(\n `Nothing to release: ${UNRELEASED_DIRECTORY} is empty. Add a change first.`,\n );\n const asked = text(flags, \"as\");\n if (asked !== undefined && !isReleaseKind(asked))\n throw new CliError(`--as must be one of: ${RELEASE_KINDS.join(\", \")}`);\n const changes = entries.map((entry) => entry.change);\n const version =\n text(flags, \"version\") ??\n nextVersion({\n ...(isReleaseKind(asked) ? { asked } : {}),\n changes,\n current: manifest.version ?? \"0.0.0\",\n });\n if (version === undefined)\n throw new CliError(\n `Could not work out the next version from ${manifest.version}.`,\n );\n const changelog = await readChangelog(root, manifest.name ?? \"\");\n if (changelog.releases.some((entry) => entry.version === version))\n throw new CliError(`${version} is already in the changelog.`);\n const [first, ...rest] = changes;\n if (first === undefined)\n throw new CliError(`Nothing to release: ${UNRELEASED_DIRECTORY} is empty.`);\n const next: Release = {\n changes: [first, ...rest],\n date:\n text(flags, \"date\") ?? new Date().toISOString().slice(0, ISO_DATE_LENGTH),\n version,\n };\n const written: Changelog = {\n ...changelog,\n releases: [next, ...changelog.releases],\n };\n if (flags.dry === true) {\n console.log(\n renderMarkdown(written).split(\"\\n\").slice(0, PREVIEW_LINES).join(\"\\n\"),\n );\n console.log(`\\n(dry run: ${manifest.version} → ${version})`);\n\n return;\n }\n await writeBoth(root, written);\n await writeJsonLike(join(root, \"package.json\"), { ...manifest, version });\n await Promise.all(\n entries.map((entry) => rm(join(root, entry.file), { force: true })),\n );\n console.log(\n `${manifest.name} ${manifest.version} → ${version} (${entries.length} change${\n entries.length === 1 ? \"\" : \"s\"\n })`,\n );\n};\n\nconst check = async (root: string, flags: Flags) => {\n const manifest = await readPackage(root);\n const failures: string[] = [];\n const { entries, problems } = await loadUnreleased(root);\n failures.push(...problems);\n const document = await readJsonFile(changelogPaths(root).json);\n const read = document === undefined ? undefined : parseChangelog(document);\n if (read?.problems)\n throw new CliError(\n [`${CHANGELOG_FILE} is not a changelog:`, ...read.problems].join(\"\\n \"),\n );\n /* A package that has adopted this and not released yet has no document,\n * which is a state to check rather than a failure: the entries are still\n * checked, and so is everything that does not need a release to compare\n * against. */\n const current: Changelog = read?.changelog ?? {\n contract: CHANGELOG_CONTRACT,\n name: manifest.name ?? \"\",\n releases: [],\n };\n const [newest] = current.releases;\n /* The version in the manifest is the version that was last released, and\n * the newest release in the changelog is the same thing said twice.\n * Whenever the two disagree, one of them was edited by hand. */\n if (newest !== undefined && newest.version !== manifest.version)\n failures.push(\n `package.json is ${manifest.version} and the newest release in ${CHANGELOG_FILE} is ${newest.version}`,\n );\n if (newest !== undefined && current.name !== manifest.name)\n failures.push(\n `${CHANGELOG_FILE} is for ${current.name}, not ${manifest.name}`,\n );\n /* The markdown is generated. If it does not match what the entries say it\n * should be, somebody edited the copy rather than the original. */\n const history = await historyOf(root);\n const expected = renderMarkdown(\n current,\n history === undefined ? {} : { history },\n );\n const actual = await readFile(changelogPaths(root).markdown, \"utf8\").catch(\n () => undefined,\n );\n /* Checked whether or not anything has been released. It used to wait for a\n * first release, which meant every package in a freshly adopted ecosystem\n * had a generated file nothing was watching -- and a second adoption\n * quietly rewrote 65 of them. */\n if (actual !== expected)\n failures.push(\n `${CHANGELOG_MARKDOWN} is not what the entries say it should be — it is generated; run \\`absolute-changelog release\\` or restore it`,\n );\n const tsconfig = await readTsconfig(join(root, \"tsconfig.json\"));\n const include = includeOf(tsconfig?.config);\n if (Array.isArray(include) && !coversEntries(include))\n failures.push(\n 'tsconfig.json does not compile changelog/, so nothing is checking the entries — add \"changelog/**/*\" to its include list',\n );\n for (const stray of await strayEntries(root))\n failures.push(\n `${UNRELEASED_DIRECTORY}/${stray} is not an entry, so no release will ever read it`,\n );\n /* Both documents have to ship, or a consumer that reads them gets a\n * package that quietly has none. */\n const shipped = Array.isArray(manifest.files) ? manifest.files : [];\n for (const file of [CHANGELOG_FILE, CHANGELOG_MARKDOWN])\n if (shipped.length > 0 && !shipped.includes(file))\n failures.push(`package.json does not ship ${file}`);\n /* And the part nobody can do by remembering: what the types say happened\n * against what the entries say happened.\n *\n * The baseline is the newest version the registry actually has, which is\n * not always the version in package.json -- between `release` and `publish`\n * the manifest names a version nobody can fetch. Comparing against that\n * asks the registry for something that is not there, gets nothing, and\n * passes: the gate would go quiet at the one moment it exists for.\n *\n * So the entries that speak are every entry newer than what is published:\n * the ones still waiting, and the ones a release has already folded in. */\n const offline = flags.offline === true;\n const built = await builtSurface(root);\n /* A package about to publish types it has not built. The old gate warned\n * and passed, which is the same thing as not having a gate on a clean\n * checkout -- and `prepublishOnly` runs before `prepack`, so a package that\n * builds there arrives here with nothing on disk every time.\n *\n * A package that ships no types at all has no promise of this kind to\n * check, and is left alone. */\n const shipsTypes = declaresTypes(\n await readJsonFile(join(root, \"package.json\")),\n );\n if (built === undefined && shipsTypes)\n failures.push(\n \"there are no declaration files where package.json says its types are — build before the gate, or nothing compares them\",\n );\n if (!shipsTypes)\n console.warn(\" (this package ships no types, so none were compared)\");\n const versions = offline\n ? undefined\n : await packageVersions(manifest.name ?? \"\");\n /* The registry did not answer. Every reason for that -- an outage, a rate\n * limit, a private registry this does not know about, a scoped package\n * needing auth -- ends with the types unchecked, and a gate that passes\n * when it could not check is a gate that disarms itself on a bad afternoon.\n * `--offline` is how somebody says they meant it. */\n if (!offline && versions === undefined)\n failures.push(\n `the registry did not answer for ${manifest.name}, so nothing was compared — pass --offline to skip the comparison deliberately`,\n );\n /* Answered, with nothing on it. A first release has no previous version to\n * be checked against, and refusing it would mean no package could ever have\n * one. */\n if (versions !== undefined && versions.published.length === 0)\n console.warn(\n ` (${manifest.name} has never been published, so there was nothing to compare)`,\n );\n const baseline = (versions?.published ?? [])\n .filter((version) => compareVersions(version, manifest.version) <= 0)\n .sort(compareVersions)\n .at(LAST);\n /* Published versions exist and none of them is at or below this one: the\n * manifest is behind the registry, which is its own problem. */\n if (\n versions !== undefined &&\n versions.published.length > 0 &&\n baseline === undefined &&\n !offline\n )\n console.warn(\n ` (nothing published at or below ${manifest.version}, so there was nothing to compare)`,\n );\n if (built !== undefined && baseline !== undefined) {\n const published = await publishedSurface(manifest.name ?? \"\", baseline);\n if (published === undefined)\n failures.push(\n `could not read the published types of ${manifest.name}@${baseline}, so nothing was compared`,\n );\n const speaking = [\n ...entries.map((entry) => entry.change),\n ...current.releases\n .filter((entry) => compareVersions(entry.version, baseline) > 0)\n .flatMap((entry) => [...entry.changes]),\n ];\n failures.push(\n ...(published === undefined\n ? []\n : describeReconciliation(\n reconcile({\n after: new Set(built.keys()),\n changes: speaking,\n diff: diffSurface(published, built),\n known: new Set([...published.keys(), ...built.keys()]),\n subpaths: subpathsOf(manifest),\n }),\n )),\n );\n }\n if (failures.length > 0)\n throw new CliError(\n [\"This package’s changelog does not hold:\", ...failures].join(\"\\n \"),\n );\n console.log(\n `${manifest.name}@${manifest.version}: changelog holds (${entries.length} pending, ${current.releases.length} released)`,\n );\n};\n\n/**\n * Make sure the entries are compiled by whatever compiles this package.\n *\n * The whole claim of the contract is that the compiler reviews every entry --\n * which it does not, if the package's `include` only names `src`. Nothing\n * else about the setup gives that away: entries would sit there looking\n * checked and be checked by nobody.\n */\n/** The last of a sorted list. */\nconst LAST = -1;\n\n/**\n * The entry points a package offers, as the specifiers somebody would import.\n *\n * Taken from the exports map, so a migration cannot point at a subpath that\n * does not exist -- the kind of typo that is invisible in a changelog and\n * fatal in a codemod.\n */\nconst subpathsOf = (manifest: PackageShape) => {\n const { exports } = manifest;\n if (typeof exports !== \"object\" || exports === null) return new Set<string>();\n\n return new Set(\n Object.keys(exports).map((key) =>\n key === \".\" ? (manifest.name ?? \"\") : `${manifest.name}${key.slice(1)}`,\n ),\n );\n};\n\nconst CHECKING_CONFIGS = [\"tsconfig.json\", \"tsconfig.eslint.json\"] as const;\n\n/** A tsconfig is JSON with comments, which `JSON.parse` refuses. TypeScript's\n * own reader takes it, and this package already depends on it. */\nconst readTsconfig = async (path: string) => {\n const source = await readFile(path, \"utf8\").catch(() => undefined);\n if (source === undefined) return undefined;\n const read = ts.parseConfigFileTextToJson(path, source);\n\n if (read.error !== undefined) return undefined;\n const { config } = read;\n const parsed: unknown = config;\n\n return { config: parsed, source };\n};\n\nconst coversEntries = (include: unknown) =>\n Array.isArray(include) &&\n include.some(\n (entry) => typeof entry === \"string\" && entry.startsWith(\"changelog\"),\n );\n\nconst includeOf = (config: unknown) =>\n typeof config === \"object\" && config !== null\n ? new Map(Object.entries(config)).get(\"include\")\n : undefined;\n\n/**\n * Add the entries to an include list without reformatting the file.\n *\n * A surgical insertion rather than a re-serialisation, because a tsconfig\n * carries comments -- the framework's own explains why `src/build/` is not\n * excluded -- and rewriting it as JSON would delete them.\n */\nconst includeEntriesIn = async (root: string, file: string) => {\n const path = join(root, file);\n const read = await readTsconfig(path);\n if (read === undefined) return false;\n const include = includeOf(read.config);\n if (!Array.isArray(include) || coversEntries(include)) return false;\n const opened = /\"include\"\\s*:\\s*\\[/u.exec(read.source);\n if (opened === null) return false;\n const opens = opened.index + opened[0].length;\n await writeFile(\n path,\n `${read.source.slice(0, opens)}\\n\\t\\t\"changelog/**/*\",${read.source.slice(opens)}`,\n );\n\n return true;\n};\n\nconst includeEntries = async (root: string) => {\n const wired = await Promise.all(\n CHECKING_CONFIGS.map((file) => includeEntriesIn(root, file)),\n );\n\n return wired.some(Boolean)\n ? undefined\n : \"no tsconfig include list to wire — make sure changelog/ is compiled by something\";\n};\n\n/**\n * Keep the formatter off the generated copies.\n *\n * Every package here runs prettier over `**\\/*.{ts,json,md}`, which is both of\n * these -- and the gate compares `CHANGELOG.md` byte for byte against what the\n * entries say it should be. A formatter rewrapping a line would fail a release\n * for a reason nobody could see.\n */\nconst ignoreGenerated = async (root: string) => {\n const path = join(root, \".prettierignore\");\n const existing = await readFile(path, \"utf8\").catch(() => \"\");\n const wanted = [CHANGELOG_FILE, CHANGELOG_MARKDOWN].filter(\n (name) => !existing.split(\"\\n\").includes(name),\n );\n if (wanted.length === 0) return;\n const head =\n existing.trim() === \"\"\n ? \"# Generated by absolute-changelog. Edit the entries, not these.\\n\"\n : `${existing.trimEnd()}\\n`;\n await writeFile(path, `${head}${wanted.join(\"\\n\")}\\n`);\n};\n\n/**\n * The gate on the way out, not only on the way to it.\n *\n * `check:package` is a chain somebody chooses to run. `prepublishOnly` is one\n * npm and bun run themselves, whatever the publish was started by -- a release\n * script, a bare `npm publish`, a CI job, somebody in a hurry at the end of a\n * day. A rule that can be walked around eventually is.\n *\n * It runs the whole chain rather than the changelog check alone, because the\n * weaker version had a hole this package fell into itself: a publish that\n * skipped `check:package` skipped the typecheck, the lint, the tests and the\n * build with it. Running the build here settles a subtler thing too --\n * `prepublishOnly` fires before `prepack`, so a package that builds in\n * `prepack` used to reach the gate with whatever `dist` was lying about, or\n * with none at all.\n */\n/* Never the bare binary. `bun publish` runs lifecycle scripts without\n * `node_modules/.bin` on the PATH, so `absolute-changelog check` written\n * plainly is `command not found` and every publish fails -- which is what\n * ninety-five packages were quietly set up to do. `bun run` and `bunx` both\n * resolve it; the bare name is the one spelling that does not. */\nconst PUBLISH_GATE = \"bunx absolute-changelog check\";\n\nconst publishGateFor = (scripts: Record<string, unknown>) =>\n typeof scripts[\"check:package\"] === \"string\"\n ? \"bun run check:package\"\n : PUBLISH_GATE;\n\nconst withPublishGate = (scripts: Record<string, unknown>) => {\n const wanted = publishGateFor(scripts);\n const existing = scripts.prepublishOnly;\n if (typeof existing === \"string\" && existing.includes(wanted))\n return undefined;\n /* A gate that runs only the changelog check is replaced by the chain that\n * contains it, rather than run twice. */\n const replaceable =\n typeof existing !== \"string\" ||\n existing.trim() === \"\" ||\n existing.trim() === PUBLISH_GATE ||\n existing.trim() === \"absolute-changelog check\";\n\n return {\n ...scripts,\n prepublishOnly: replaceable ? wanted : `${existing} && ${wanted}`,\n };\n};\n\nconst adopt = async (root: string) => {\n const manifest = await readPackage(root);\n const paths = changelogPaths(root);\n await mkdir(paths.unreleased, { recursive: true });\n await writeFile(\n join(paths.unreleased, \".gitkeep\"),\n \"# Entries wait here. One file per change; `absolute-changelog release` consumes them.\\n\",\n );\n /* Whatever the package said before this takes over. It is kept rather\n * than parsed: prose written by hand over two years is history, and\n * guessing structure out of it would invent facts.\n *\n * Except our own output, which is what a second adoption finds. Filing that\n * as history prints the header underneath itself, and a third run would\n * nest it again -- adopting has to be a thing you can run twice. */\n const previous = existsSync(paths.markdown)\n ? await readFile(paths.markdown, \"utf8\")\n : undefined;\n if (\n previous !== undefined &&\n !previous.includes(GENERATED_MARKER) &&\n !existsSync(paths.history)\n ) {\n await mkdir(join(root, \"changelog\"), { recursive: true });\n await writeFile(\n paths.history,\n previous.replace(/^#\\s+Changelog\\s*/u, \"\").trimStart(),\n );\n await rm(paths.markdown, { force: true });\n }\n const files = manifest.files ?? [];\n const wanted = [CHANGELOG_FILE, CHANGELOG_MARKDOWN].filter(\n (entry) => !files.includes(entry),\n );\n const scripts =\n typeof manifest.scripts === \"object\" && manifest.scripts !== null\n ? withPublishGate(manifest.scripts)\n : undefined;\n if (wanted.length > 0 || scripts !== undefined)\n await writeJsonLike(join(root, \"package.json\"), {\n ...manifest,\n ...(scripts === undefined ? {} : { scripts }),\n files: [...files, ...wanted].sort(),\n });\n await ignoreGenerated(root);\n const note = await includeEntries(root);\n if (note !== undefined) console.warn(` (${note})`);\n const changelog = await readChangelog(root, manifest.name ?? \"\");\n await writeBoth(root, changelog);\n console.log(\n `${manifest.name}: ready. Add changes with \\`absolute-changelog add\\`, release with \\`absolute-changelog release\\`.`,\n );\n};\n\nconst main = async () => {\n const [command = \"\", ...argv] = process.argv.slice(2);\n const flags = readFlags(argv);\n const root = process.cwd();\n if (command === \"add\") return add(root, flags);\n if (command === \"release\") return release(root, flags);\n if (command === \"check\") return check(root, flags);\n if (command === \"adopt\") return adopt(root);\n\n throw new CliError(\n \"Usage: absolute-changelog <add|release|check|adopt> [options]\",\n );\n};\n\nawait main().catch((error: unknown) => {\n console.error(\n error instanceof CliError\n ? error.message\n : `absolute-changelog failed: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n process.exit(1);\n});\n",
|
|
6
|
-
"import { readdir, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { validateChange } from \"./read\";\nimport { surfaceOfFiles, typeEntriesOf } from \"./surface\";\nimport {\n CHANGELOG_FILE,\n CHANGELOG_MARKDOWN,\n UNRELEASED_DIRECTORY,\n type Change,\n} from \"./types\";\n\n/*\n * The package on disk: its pending entries, its history, and the types it is\n * about to publish.\n *\n * Entries are TypeScript modules rather than data files, so an author writing\n * one is typing against the contract with the compiler watching. Reading them\n * back is an import, which is the same thing the compiler did, so a file that\n * would not build is a file that does not release.\n */\n\nexport type LoadedEntry = {\n change: Change;\n /** Relative, because it is printed at somebody who has to go and fix it. */\n file: string;\n};\n\n/**\n * Import one entry file, and say what went wrong rather than throwing.\n *\n * An entry that will not import is a problem to report beside the others --\n * a release that stops at the first bad file makes somebody fix them one at a\n * time.\n */\nconst loadEntry = async (path: string) => {\n try {\n const module: unknown = await import(pathToFileURL(path).href);\n /* `change` is what the template writes; `default` is accepted because a\n * default export is the shape somebody reaches for by habit, and\n * refusing it would be pedantry rather than a check. */\n const named =\n typeof module === \"object\" && module !== null && \"change\" in module\n ? module.change\n : undefined;\n const exported =\n named ??\n (typeof module === \"object\" && module !== null && \"default\" in module\n ? module.default\n : undefined);\n const read: { exported: unknown; failure?: string } = { exported };\n\n return read;\n } catch (error) {\n const failed: { exported?: undefined; failure: string } = {\n failure: error instanceof Error ? error.message : String(error),\n };\n\n return failed;\n }\n};\n\nexport type LoadedEntries = {\n entries: LoadedEntry[];\n problems: string[];\n};\n\nconst ENTRY = /\\.[cm]?ts$/u;\n\nconst DECLARATION = /\\.d\\.[cm]?ts$/u;\n/** Where a build puts its declaration files. Which of them a package actually\n * publishes comes from its manifest; this is only where to look. */\nconst OUTPUT_DIRECTORIES = [\"dist\", \"build\", \"lib\", \"types\", \"out\"];\n\n/**\n * The public surface a build produced, read the way a consumer would.\n *\n * From the entry points the manifest declares, following the export graph --\n * not by heaping every declaration file together, which counts names no\n * consumer can import and cannot see one being withdrawn.\n *\n * Nothing when the manifest's entry points are not on disk: that is a package\n * about to publish types it has not built, and passing it would be the gate\n * going quiet at the worst possible moment.\n */\nexport const builtSurface = async (packageRoot: string) => {\n const manifest = await readJsonFile(join(packageRoot, \"package.json\"));\n const files = new Map<string, string>();\n const walk = async (directory: string): Promise<void> => {\n const found = await readdir(join(packageRoot, directory), {\n withFileTypes: true,\n }).catch(() => []);\n await Promise.all(\n found.map(async (entry) => {\n const relative = `${directory}/${entry.name}`;\n if (entry.isDirectory()) return walk(relative);\n if (!DECLARATION.test(entry.name)) return undefined;\n files.set(\n relative,\n await readFile(join(packageRoot, relative), \"utf8\").catch(() => \"\"),\n );\n\n return undefined;\n }),\n );\n };\n await Promise.all(OUTPUT_DIRECTORIES.map((directory) => walk(directory)));\n const entries = typeEntriesOf(manifest, files);\n\n return entries.length === 0 ? undefined : surfaceOfFiles(files, entries);\n};\n\nexport const changelogPaths = (packageRoot: string) => ({\n history: join(packageRoot, \"changelog\", \"history.md\"),\n json: join(packageRoot, CHANGELOG_FILE),\n markdown: join(packageRoot, CHANGELOG_MARKDOWN),\n unreleased: join(packageRoot, UNRELEASED_DIRECTORY),\n});\n/** Every pending entry, in a stable order so a release reads the same twice. */\nexport const loadUnreleased = async (packageRoot: string) => {\n const directory = join(packageRoot, UNRELEASED_DIRECTORY);\n const names = await readdir(directory).catch(() => []);\n const entries: LoadedEntry[] = [];\n const problems: string[] = [];\n for (const name of names.filter((file) => ENTRY.test(file)).sort()) {\n const file = join(UNRELEASED_DIRECTORY, name);\n // Serial on purpose: the count is small and the failure messages read\n // in file order.\n // eslint-disable-next-line no-await-in-loop\n const loaded = await loadEntry(join(directory, name));\n if (loaded.failure !== undefined)\n problems.push(`${file}: ${loaded.failure}`);\n const checked =\n loaded.failure === undefined\n ? validateChange(loaded.exported, file)\n : undefined;\n if (checked?.problems) problems.push(...checked.problems);\n if (checked?.change !== undefined)\n entries.push({ change: checked.change, file });\n }\n\n return { entries, problems };\n};\nexport const readJsonFile = async (path: string) => {\n const source = await readFile(path, \"utf8\").catch(() => undefined);\n if (source === undefined) return undefined;\n try {\n const document: unknown = JSON.parse(source);\n\n return document;\n } catch {\n return undefined;\n }\n};\n\n/**\n * Anything in the entry directory that is not an entry.\n *\n * A `.md` note dropped in here, or a `.txt` somebody meant as a placeholder,\n * is read by nothing and consumed by nothing -- it sits there through every\n * release looking like a change that was recorded.\n */\nexport const strayEntries = async (packageRoot: string) => {\n const names = await readdir(join(packageRoot, UNRELEASED_DIRECTORY)).catch(\n () => [],\n );\n\n return names.filter(\n (name) => !ENTRY.test(name) && name !== \".gitkeep\" && !name.startsWith(\".\"),\n );\n};\n",
|
|
5
|
+
"#!/usr/bin/env bun\n/* absolute-changelog — the release-time companion for every package that\n * keeps a changelog.\n *\n * absolute-changelog add --kind added --summary \"…\"\n * Write a pending entry under changelog/unreleased/.\n *\n * absolute-changelog release [--as major|minor|patch|prerelease]\n * [--version x.y.z] [--date YYYY-MM-DD] [--dry]\n * Turn the pending entries into a release: work out the version, write\n * changelog.json and CHANGELOG.md, bump package.json, and clear the\n * entries it consumed.\n *\n * absolute-changelog check [--offline]\n * The gate. Entries parse; the generated files are what the entries say\n * they should be; the version lines up; and the exports that moved since\n * the last published version are the exports the entries name.\n *\n * absolute-changelog adopt\n * One-time: create the entry directory, keep whatever CHANGELOG.md\n * already said as history, and wire the package's files list.\n */\nimport { existsSync } from \"node:fs\";\nimport ts from \"typescript\";\nimport { mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport {\n buildIsStale,\n builtSurface,\n changelogPaths,\n loadUnreleased,\n readJsonFile,\n strayEntries,\n} from \"./entries\";\nimport { writeJsonLike } from \"./json\";\nimport { parseChangelog } from \"./read\";\nimport { describeReconciliation, reconcile } from \"./reconcile\";\nimport { packageVersions, publishedSurface } from \"./registry\";\nimport { declaresTypes, diffSurface } from \"./surface\";\nimport {\n CHANGELOG_CONTRACT,\n CHANGELOG_FILE,\n CHANGELOG_MARKDOWN,\n CHANGE_KINDS,\n UNRELEASED_DIRECTORY,\n type Changelog,\n type ChangeKind,\n type Release,\n} from \"./types\";\nimport { compareVersions, nextVersion, type ReleaseKind } from \"./versioning\";\nimport { GENERATED_MARKER, renderChangelogJson, renderMarkdown } from \"./write\";\n\nclass CliError extends Error {}\n\nconst isChangeKind = (value: unknown): value is ChangeKind =>\n CHANGE_KINDS.some((kind) => kind === value);\n\nconst isReleaseKind = (value: unknown): value is ReleaseKind =>\n RELEASE_KINDS.some((kind) => kind === value);\n\nconst RELEASE_KINDS = [\"major\", \"minor\", \"patch\", \"prerelease\"] as const;\n/** Long enough to recognise the change in a file listing, short enough to\n * read. */\nconst SLUG_MAX_LENGTH = 48;\n/** `2026-09-10`. */\nconst ISO_DATE_LENGTH = 10;\n/** Enough of a dry run to see the release taking shape. */\nconst PREVIEW_LINES = 40;\n\ntype Flags = Record<string, string | true>;\n\nconst readFlags = (argv: readonly string[]) => {\n const flags: Flags = {};\n let skip = false;\n for (const [index, argument] of argv.entries()) {\n const consumed = skip;\n skip = false;\n if (consumed || !argument.startsWith(\"--\")) continue;\n const [name, inline] = argument.slice(2).split(\"=\");\n if (name === undefined || name === \"\") continue;\n const next = argv[index + 1];\n const takesNext =\n inline === undefined && next !== undefined && !next.startsWith(\"--\");\n skip = takesNext;\n flags[name] = inline ?? (takesNext && next !== undefined ? next : true);\n }\n\n return flags;\n};\n\nconst text = (flags: Flags, name: string) => {\n const value = flags[name];\n\n return typeof value === \"string\" ? value : undefined;\n};\n\nconst list = (flags: Flags, name: string) => {\n const value = text(flags, name);\n\n return value === undefined\n ? []\n : value\n .split(\",\")\n .map((part) => part.trim())\n .filter((part) => part !== \"\");\n};\n\ntype PackageShape = {\n exports?: unknown;\n scripts?: Record<string, unknown>;\n files?: string[];\n include?: unknown[];\n name?: string;\n version?: string;\n};\n\nconst isPackage = (value: unknown): value is PackageShape =>\n typeof value === \"object\" && value !== null;\n\nconst readPackage = async (root: string) => {\n const document = await readJsonFile(join(root, \"package.json\"));\n if (\n !isPackage(document) ||\n typeof document.name !== \"string\" ||\n typeof document.version !== \"string\"\n )\n throw new CliError(\n \"No package.json with a name and a version here. Run this from a package root.\",\n );\n const manifest: PackageShape & { name: string; version: string } = {\n ...document,\n name: document.name,\n version: document.version,\n };\n\n return manifest;\n};\n\nconst readChangelog = async (root: string, name: string) => {\n const document = await readJsonFile(changelogPaths(root).json);\n if (document === undefined) {\n const empty: Changelog = {\n contract: CHANGELOG_CONTRACT,\n name,\n releases: [],\n };\n\n return empty;\n }\n const read = parseChangelog(document);\n if (read.problems)\n throw new CliError(\n [`${CHANGELOG_FILE} is not a changelog:`, ...read.problems].join(\"\\n \"),\n );\n\n return read.changelog;\n};\n\nconst historyOf = async (root: string) =>\n readFile(changelogPaths(root).history, \"utf8\").catch(() => undefined);\n\nconst writeBoth = async (root: string, changelog: Changelog) => {\n const paths = changelogPaths(root);\n const history = await historyOf(root);\n await writeFile(paths.json, renderChangelogJson(changelog));\n await writeFile(\n paths.markdown,\n renderMarkdown(changelog, history === undefined ? {} : { history }),\n );\n};\n\nconst slug = (summary: string) =>\n summary\n .toLowerCase()\n .replace(/[^a-z0-9]+/gu, \"-\")\n .replace(/^-|-$/gu, \"\")\n .slice(0, SLUG_MAX_LENGTH) || \"change\";\n\n/**\n * Where the package's public API is declared, if it is where it usually is.\n *\n * An entry that imports it gets its symbols checked by the compiler at the\n * moment somebody types them, which is the difference between a typo caught\n * in an editor and a typo caught by a release gate a fortnight later.\n */\nconst sourceEntryOf = (root: string) => {\n for (const candidate of [\"src/index.ts\", \"src/index.tsx\", \"index.ts\"])\n if (existsSync(join(root, candidate)))\n return `../../${candidate.replace(/\\.tsx?$/u, \"\")}`;\n\n return undefined;\n};\n\nconst add = async (root: string, flags: Flags) => {\n const kind = text(flags, \"kind\");\n const summary = text(flags, \"summary\");\n if (!isChangeKind(kind))\n throw new CliError(`--kind must be one of: ${CHANGE_KINDS.join(\", \")}`);\n if (summary === undefined)\n throw new CliError(\"--summary is what the change is, in one line\");\n const symbols = list(flags, \"symbol\");\n const disruptive = kind === \"breaking\" || kind === \"removed\";\n if (disruptive && symbols.length === 0)\n throw new CliError(\n `a ${kind} change must name the exports it affects: --symbol serve,createServer`,\n );\n const instruction = text(flags, \"instruction\");\n if (disruptive && instruction === undefined)\n throw new CliError(\n `a ${kind} change must say how to migrate: --instruction \"…\"`,\n );\n const renameTo = text(flags, \"rename-to\");\n const migration =\n renameTo !== undefined && symbols[0] !== undefined\n ? [\n \"\\tmigration: {\",\n `\\t\\tinstruction: ${JSON.stringify(instruction)},`,\n `\\t\\trename: { from: ${JSON.stringify(\n symbols[0],\n )}, to: ${JSON.stringify(renameTo)} }`,\n \"\\t},\",\n ]\n : [\n `\\tmigration: { instruction: ${JSON.stringify(\n instruction,\n )}, manual: true },`,\n ];\n /* A type-only import, so the entry has nothing to resolve at run time.\n * The release gate reads these files back, and a gate that only works\n * where the dev dependencies are installed is a gate that fails in the\n * one place it matters.\n *\n * A named export rather than a default one: the ecosystem's lint config\n * restricts default exports, and an entry that trips the linter of every\n * package that writes one is a contract nobody keeps. */\n const api = sourceEntryOf(root);\n const body = [\n ...(api === undefined ? [] : [`import type * as Api from '${api}';`]),\n \"import type { Change } from '@absolutejs/changelog';\",\n \"\",\n `export const change: Change${api === undefined ? \"\" : \"<typeof Api>\"} = {`,\n `\\tkind: ${JSON.stringify(kind)},`,\n ...(disruptive ? migration : []),\n `\\tsummary: ${JSON.stringify(summary)}${symbols.length > 0 ? \",\" : \"\"}`,\n ...(symbols.length > 0 ? [`\\tsymbols: ${JSON.stringify(symbols)}`] : []),\n \"};\",\n \"\",\n ].join(\"\\n\");\n const directory = join(root, UNRELEASED_DIRECTORY);\n await mkdir(directory, { recursive: true });\n const file = join(directory, `${slug(summary)}.ts`);\n await writeFile(file, body);\n console.log(`wrote ${file}`);\n};\n\nconst release = async (root: string, flags: Flags) => {\n const manifest = await readPackage(root);\n const { entries, problems } = await loadUnreleased(root);\n if (problems.length > 0)\n throw new CliError(\n [\"These entries are not usable:\", ...problems].join(\"\\n \"),\n );\n if (entries.length === 0)\n throw new CliError(\n `Nothing to release: ${UNRELEASED_DIRECTORY} is empty. Add a change first.`,\n );\n const asked = text(flags, \"as\");\n if (asked !== undefined && !isReleaseKind(asked))\n throw new CliError(`--as must be one of: ${RELEASE_KINDS.join(\", \")}`);\n const changes = entries.map((entry) => entry.change);\n const version =\n text(flags, \"version\") ??\n nextVersion({\n ...(isReleaseKind(asked) ? { asked } : {}),\n changes,\n current: manifest.version ?? \"0.0.0\",\n });\n if (version === undefined)\n throw new CliError(\n `Could not work out the next version from ${manifest.version}.`,\n );\n const changelog = await readChangelog(root, manifest.name ?? \"\");\n if (changelog.releases.some((entry) => entry.version === version))\n throw new CliError(`${version} is already in the changelog.`);\n const [first, ...rest] = changes;\n if (first === undefined)\n throw new CliError(`Nothing to release: ${UNRELEASED_DIRECTORY} is empty.`);\n const next: Release = {\n changes: [first, ...rest],\n date:\n text(flags, \"date\") ?? new Date().toISOString().slice(0, ISO_DATE_LENGTH),\n version,\n };\n const written: Changelog = {\n ...changelog,\n releases: [next, ...changelog.releases],\n };\n if (flags.dry === true) {\n console.log(\n renderMarkdown(written).split(\"\\n\").slice(0, PREVIEW_LINES).join(\"\\n\"),\n );\n console.log(`\\n(dry run: ${manifest.version} → ${version})`);\n\n return;\n }\n await writeBoth(root, written);\n await writeJsonLike(join(root, \"package.json\"), { ...manifest, version });\n await Promise.all(\n entries.map((entry) => rm(join(root, entry.file), { force: true })),\n );\n console.log(\n `${manifest.name} ${manifest.version} → ${version} (${entries.length} change${\n entries.length === 1 ? \"\" : \"s\"\n })`,\n );\n};\n\nconst check = async (root: string, flags: Flags) => {\n const manifest = await readPackage(root);\n const failures: string[] = [];\n const { entries, problems } = await loadUnreleased(root);\n failures.push(...problems);\n const document = await readJsonFile(changelogPaths(root).json);\n const read = document === undefined ? undefined : parseChangelog(document);\n if (read?.problems)\n throw new CliError(\n [`${CHANGELOG_FILE} is not a changelog:`, ...read.problems].join(\"\\n \"),\n );\n /* A package that has adopted this and not released yet has no document,\n * which is a state to check rather than a failure: the entries are still\n * checked, and so is everything that does not need a release to compare\n * against. */\n const current: Changelog = read?.changelog ?? {\n contract: CHANGELOG_CONTRACT,\n name: manifest.name ?? \"\",\n releases: [],\n };\n const [newest] = current.releases;\n /* The version in the manifest is the version that was last released, and\n * the newest release in the changelog is the same thing said twice.\n * Whenever the two disagree, one of them was edited by hand. */\n if (newest !== undefined && newest.version !== manifest.version)\n failures.push(\n `package.json is ${manifest.version} and the newest release in ${CHANGELOG_FILE} is ${newest.version}`,\n );\n if (newest !== undefined && current.name !== manifest.name)\n failures.push(\n `${CHANGELOG_FILE} is for ${current.name}, not ${manifest.name}`,\n );\n /* The markdown is generated. If it does not match what the entries say it\n * should be, somebody edited the copy rather than the original. */\n const history = await historyOf(root);\n const expected = renderMarkdown(\n current,\n history === undefined ? {} : { history },\n );\n const actual = await readFile(changelogPaths(root).markdown, \"utf8\").catch(\n () => undefined,\n );\n /* Checked whether or not anything has been released. It used to wait for a\n * first release, which meant every package in a freshly adopted ecosystem\n * had a generated file nothing was watching -- and a second adoption\n * quietly rewrote 65 of them. */\n if (actual !== expected)\n failures.push(\n `${CHANGELOG_MARKDOWN} is not what the entries say it should be — it is generated; run \\`absolute-changelog release\\` or restore it`,\n );\n const tsconfig = await readTsconfig(join(root, \"tsconfig.json\"));\n const include = includeOf(tsconfig?.config);\n if (Array.isArray(include) && !coversEntries(include))\n failures.push(\n 'tsconfig.json does not compile changelog/, so nothing is checking the entries — add \"changelog/**/*\" to its include list',\n );\n for (const stray of await strayEntries(root))\n failures.push(\n `${UNRELEASED_DIRECTORY}/${stray} is not an entry, so no release will ever read it`,\n );\n /* Both documents have to ship, or a consumer that reads them gets a\n * package that quietly has none. */\n const shipped = Array.isArray(manifest.files) ? manifest.files : [];\n for (const file of [CHANGELOG_FILE, CHANGELOG_MARKDOWN])\n if (shipped.length > 0 && !shipped.includes(file))\n failures.push(`package.json does not ship ${file}`);\n /* And the part nobody can do by remembering: what the types say happened\n * against what the entries say happened.\n *\n * The baseline is the newest version the registry actually has, which is\n * not always the version in package.json -- between `release` and `publish`\n * the manifest names a version nobody can fetch. Comparing against that\n * asks the registry for something that is not there, gets nothing, and\n * passes: the gate would go quiet at the one moment it exists for.\n *\n * So the entries that speak are every entry newer than what is published:\n * the ones still waiting, and the ones a release has already folded in. */\n const offline = flags.offline === true;\n const built = await builtSurface(root);\n /* A package about to publish types it has not built. The old gate warned\n * and passed, which is the same thing as not having a gate on a clean\n * checkout -- and `prepublishOnly` runs before `prepack`, so a package that\n * builds there arrives here with nothing on disk every time.\n *\n * A package that ships no types at all has no promise of this kind to\n * check, and is left alone. */\n const shipsTypes = declaresTypes(\n await readJsonFile(join(root, \"package.json\")),\n );\n if (await buildIsStale(root))\n console.warn(\n \" (the build is older than the source it was built from, so this compared yesterday's package — run the build first)\",\n );\n if (built === undefined && shipsTypes)\n failures.push(\n \"there are no declaration files where package.json says its types are — build before the gate, or nothing compares them\",\n );\n if (!shipsTypes)\n console.warn(\" (this package ships no types, so none were compared)\");\n const versions = offline\n ? undefined\n : await packageVersions(manifest.name ?? \"\");\n /* The registry did not answer. Every reason for that -- an outage, a rate\n * limit, a private registry this does not know about, a scoped package\n * needing auth -- ends with the types unchecked, and a gate that passes\n * when it could not check is a gate that disarms itself on a bad afternoon.\n * `--offline` is how somebody says they meant it. */\n if (!offline && versions === undefined)\n failures.push(\n `the registry did not answer for ${manifest.name}, so nothing was compared — pass --offline to skip the comparison deliberately`,\n );\n /* Answered, with nothing on it. A first release has no previous version to\n * be checked against, and refusing it would mean no package could ever have\n * one. */\n if (versions !== undefined && versions.published.length === 0)\n console.warn(\n ` (${manifest.name} has never been published, so there was nothing to compare)`,\n );\n const baseline = (versions?.published ?? [])\n .filter((version) => compareVersions(version, manifest.version) <= 0)\n .sort(compareVersions)\n .at(LAST);\n /* Published versions exist and none of them is at or below this one: the\n * manifest is behind the registry, which is its own problem. */\n if (\n versions !== undefined &&\n versions.published.length > 0 &&\n baseline === undefined &&\n !offline\n )\n console.warn(\n ` (nothing published at or below ${manifest.version}, so there was nothing to compare)`,\n );\n if (built !== undefined && baseline !== undefined) {\n const published = await publishedSurface(manifest.name ?? \"\", baseline);\n if (published === undefined)\n failures.push(\n `could not read the published types of ${manifest.name}@${baseline}, so nothing was compared`,\n );\n const speaking = [\n ...entries.map((entry) => entry.change),\n ...current.releases\n .filter((entry) => compareVersions(entry.version, baseline) > 0)\n .flatMap((entry) => [...entry.changes]),\n ];\n failures.push(\n ...(published === undefined\n ? []\n : describeReconciliation(\n reconcile({\n after: new Set(built.keys()),\n changes: speaking,\n diff: diffSurface(published, built),\n known: new Set([...published.keys(), ...built.keys()]),\n subpaths: subpathsOf(manifest),\n }),\n )),\n );\n }\n if (failures.length > 0)\n throw new CliError(\n [\"This package’s changelog does not hold:\", ...failures].join(\"\\n \"),\n );\n console.log(\n `${manifest.name}@${manifest.version}: changelog holds (${entries.length} pending, ${current.releases.length} released)`,\n );\n};\n\n/**\n * Make sure the entries are compiled by whatever compiles this package.\n *\n * The whole claim of the contract is that the compiler reviews every entry --\n * which it does not, if the package's `include` only names `src`. Nothing\n * else about the setup gives that away: entries would sit there looking\n * checked and be checked by nobody.\n */\n/** The last of a sorted list. */\nconst LAST = -1;\n\n/**\n * The entry points a package offers, as the specifiers somebody would import.\n *\n * Taken from the exports map, so a migration cannot point at a subpath that\n * does not exist -- the kind of typo that is invisible in a changelog and\n * fatal in a codemod.\n */\nconst subpathsOf = (manifest: PackageShape) => {\n const { exports } = manifest;\n if (typeof exports !== \"object\" || exports === null) return new Set<string>();\n\n return new Set(\n Object.keys(exports).map((key) =>\n key === \".\" ? (manifest.name ?? \"\") : `${manifest.name}${key.slice(1)}`,\n ),\n );\n};\n\nconst CHECKING_CONFIGS = [\"tsconfig.json\", \"tsconfig.eslint.json\"] as const;\n\n/** A tsconfig is JSON with comments, which `JSON.parse` refuses. TypeScript's\n * own reader takes it, and this package already depends on it. */\nconst readTsconfig = async (path: string) => {\n const source = await readFile(path, \"utf8\").catch(() => undefined);\n if (source === undefined) return undefined;\n const read = ts.parseConfigFileTextToJson(path, source);\n\n if (read.error !== undefined) return undefined;\n const { config } = read;\n const parsed: unknown = config;\n\n return { config: parsed, source };\n};\n\nconst coversEntries = (include: unknown) =>\n Array.isArray(include) &&\n include.some(\n (entry) => typeof entry === \"string\" && entry.startsWith(\"changelog\"),\n );\n\nconst includeOf = (config: unknown) =>\n typeof config === \"object\" && config !== null\n ? new Map(Object.entries(config)).get(\"include\")\n : undefined;\n\n/**\n * Add the entries to an include list without reformatting the file.\n *\n * A surgical insertion rather than a re-serialisation, because a tsconfig\n * carries comments -- the framework's own explains why `src/build/` is not\n * excluded -- and rewriting it as JSON would delete them.\n */\nconst includeEntriesIn = async (root: string, file: string) => {\n const path = join(root, file);\n const read = await readTsconfig(path);\n if (read === undefined) return false;\n const include = includeOf(read.config);\n if (!Array.isArray(include) || coversEntries(include)) return false;\n const opened = /\"include\"\\s*:\\s*\\[/u.exec(read.source);\n if (opened === null) return false;\n const opens = opened.index + opened[0].length;\n await writeFile(\n path,\n `${read.source.slice(0, opens)}\\n\\t\\t\"changelog/**/*\",${read.source.slice(opens)}`,\n );\n\n return true;\n};\n\nconst includeEntries = async (root: string) => {\n const wired = await Promise.all(\n CHECKING_CONFIGS.map((file) => includeEntriesIn(root, file)),\n );\n\n return wired.some(Boolean)\n ? undefined\n : \"no tsconfig include list to wire — make sure changelog/ is compiled by something\";\n};\n\n/**\n * Keep the formatter off the generated copies.\n *\n * Every package here runs prettier over `**\\/*.{ts,json,md}`, which is both of\n * these -- and the gate compares `CHANGELOG.md` byte for byte against what the\n * entries say it should be. A formatter rewrapping a line would fail a release\n * for a reason nobody could see.\n */\nconst ignoreGenerated = async (root: string) => {\n const path = join(root, \".prettierignore\");\n const existing = await readFile(path, \"utf8\").catch(() => \"\");\n const wanted = [CHANGELOG_FILE, CHANGELOG_MARKDOWN].filter(\n (name) => !existing.split(\"\\n\").includes(name),\n );\n if (wanted.length === 0) return;\n const head =\n existing.trim() === \"\"\n ? \"# Generated by absolute-changelog. Edit the entries, not these.\\n\"\n : `${existing.trimEnd()}\\n`;\n await writeFile(path, `${head}${wanted.join(\"\\n\")}\\n`);\n};\n\n/**\n * The gate on the way out, not only on the way to it.\n *\n * `check:package` is a chain somebody chooses to run. `prepublishOnly` is one\n * npm and bun run themselves, whatever the publish was started by -- a release\n * script, a bare `npm publish`, a CI job, somebody in a hurry at the end of a\n * day. A rule that can be walked around eventually is.\n *\n * It runs the whole chain rather than the changelog check alone, because the\n * weaker version had a hole this package fell into itself: a publish that\n * skipped `check:package` skipped the typecheck, the lint, the tests and the\n * build with it. Running the build here settles a subtler thing too --\n * `prepublishOnly` fires before `prepack`, so a package that builds in\n * `prepack` used to reach the gate with whatever `dist` was lying about, or\n * with none at all.\n */\n/* Never the bare binary. `bun publish` runs lifecycle scripts without\n * `node_modules/.bin` on the PATH, so `absolute-changelog check` written\n * plainly is `command not found` and every publish fails -- which is what\n * ninety-five packages were quietly set up to do. `bun run` and `bunx` both\n * resolve it; the bare name is the one spelling that does not. */\nconst PUBLISH_GATE = \"bunx absolute-changelog check\";\n\nconst publishGateFor = (scripts: Record<string, unknown>) =>\n typeof scripts[\"check:package\"] === \"string\"\n ? \"bun run check:package\"\n : PUBLISH_GATE;\n\nconst withPublishGate = (scripts: Record<string, unknown>) => {\n const wanted = publishGateFor(scripts);\n const existing = scripts.prepublishOnly;\n if (typeof existing === \"string\" && existing.includes(wanted))\n return undefined;\n /* A gate that runs only the changelog check is replaced by the chain that\n * contains it, rather than run twice. */\n const replaceable =\n typeof existing !== \"string\" ||\n existing.trim() === \"\" ||\n existing.trim() === PUBLISH_GATE ||\n existing.trim() === \"absolute-changelog check\";\n\n return {\n ...scripts,\n prepublishOnly: replaceable ? wanted : `${existing} && ${wanted}`,\n };\n};\n\nconst adopt = async (root: string) => {\n const manifest = await readPackage(root);\n const paths = changelogPaths(root);\n await mkdir(paths.unreleased, { recursive: true });\n await writeFile(\n join(paths.unreleased, \".gitkeep\"),\n \"# Entries wait here. One file per change; `absolute-changelog release` consumes them.\\n\",\n );\n /* Whatever the package said before this takes over. It is kept rather\n * than parsed: prose written by hand over two years is history, and\n * guessing structure out of it would invent facts.\n *\n * Except our own output, which is what a second adoption finds. Filing that\n * as history prints the header underneath itself, and a third run would\n * nest it again -- adopting has to be a thing you can run twice. */\n const previous = existsSync(paths.markdown)\n ? await readFile(paths.markdown, \"utf8\")\n : undefined;\n if (\n previous !== undefined &&\n !previous.includes(GENERATED_MARKER) &&\n !existsSync(paths.history)\n ) {\n await mkdir(join(root, \"changelog\"), { recursive: true });\n await writeFile(\n paths.history,\n previous.replace(/^#\\s+Changelog\\s*/u, \"\").trimStart(),\n );\n await rm(paths.markdown, { force: true });\n }\n const files = manifest.files ?? [];\n const wanted = [CHANGELOG_FILE, CHANGELOG_MARKDOWN].filter(\n (entry) => !files.includes(entry),\n );\n const scripts =\n typeof manifest.scripts === \"object\" && manifest.scripts !== null\n ? withPublishGate(manifest.scripts)\n : undefined;\n if (wanted.length > 0 || scripts !== undefined)\n await writeJsonLike(join(root, \"package.json\"), {\n ...manifest,\n ...(scripts === undefined ? {} : { scripts }),\n files: [...files, ...wanted].sort(),\n });\n await ignoreGenerated(root);\n const note = await includeEntries(root);\n if (note !== undefined) console.warn(` (${note})`);\n const changelog = await readChangelog(root, manifest.name ?? \"\");\n await writeBoth(root, changelog);\n console.log(\n `${manifest.name}: ready. Add changes with \\`absolute-changelog add\\`, release with \\`absolute-changelog release\\`.`,\n );\n};\n\nconst main = async () => {\n const [command = \"\", ...argv] = process.argv.slice(2);\n const flags = readFlags(argv);\n const root = process.cwd();\n if (command === \"add\") return add(root, flags);\n if (command === \"release\") return release(root, flags);\n if (command === \"check\") return check(root, flags);\n if (command === \"adopt\") return adopt(root);\n\n throw new CliError(\n \"Usage: absolute-changelog <add|release|check|adopt> [options]\",\n );\n};\n\nawait main().catch((error: unknown) => {\n console.error(\n error instanceof CliError\n ? error.message\n : `absolute-changelog failed: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n process.exit(1);\n});\n",
|
|
6
|
+
"import { readdir, readFile, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { validateChange } from \"./read\";\nimport { surfaceOfFiles, typeEntriesOf } from \"./surface\";\nimport {\n CHANGELOG_FILE,\n CHANGELOG_MARKDOWN,\n UNRELEASED_DIRECTORY,\n type Change,\n} from \"./types\";\n\n/*\n * The package on disk: its pending entries, its history, and the types it is\n * about to publish.\n *\n * Entries are TypeScript modules rather than data files, so an author writing\n * one is typing against the contract with the compiler watching. Reading them\n * back is an import, which is the same thing the compiler did, so a file that\n * would not build is a file that does not release.\n */\n\nexport type LoadedEntry = {\n change: Change;\n /** Relative, because it is printed at somebody who has to go and fix it. */\n file: string;\n};\n\n/**\n * Import one entry file, and say what went wrong rather than throwing.\n *\n * An entry that will not import is a problem to report beside the others --\n * a release that stops at the first bad file makes somebody fix them one at a\n * time.\n */\nconst loadEntry = async (path: string) => {\n try {\n const module: unknown = await import(pathToFileURL(path).href);\n /* `change` is what the template writes; `default` is accepted because a\n * default export is the shape somebody reaches for by habit, and\n * refusing it would be pedantry rather than a check. */\n const named =\n typeof module === \"object\" && module !== null && \"change\" in module\n ? module.change\n : undefined;\n const exported =\n named ??\n (typeof module === \"object\" && module !== null && \"default\" in module\n ? module.default\n : undefined);\n const read: { exported: unknown; failure?: string } = { exported };\n\n return read;\n } catch (error) {\n const failed: { exported?: undefined; failure: string } = {\n failure: error instanceof Error ? error.message : String(error),\n };\n\n return failed;\n }\n};\n\nexport type LoadedEntries = {\n entries: LoadedEntry[];\n problems: string[];\n};\n\nconst ENTRY = /\\.[cm]?ts$/u;\n\nconst DECLARATION = /\\.d\\.[cm]?ts$/u;\n/** Where a build puts its declaration files. Which of them a package actually\n * publishes comes from its manifest; this is only where to look. */\nconst OUTPUT_DIRECTORIES = [\"dist\", \"build\", \"lib\", \"types\", \"out\"];\n\n/** The newest thing under a directory, by modification time. */\nconst newestUnder = async (root: string): Promise<number> => {\n const found = await readdir(root, { withFileTypes: true }).catch(() => []);\n const times = await Promise.all(\n found.map(async (entry) => {\n const path = join(root, entry.name);\n if (entry.isDirectory()) return newestUnder(path);\n\n return stat(path).then(\n (stats) => stats.mtimeMs,\n () => 0,\n );\n }),\n );\n\n return Math.max(0, ...times);\n};\n\n/**\n * Whether the build is older than the source it was built from.\n *\n * The gate compares what is on disk against what was published, so a `dist`\n * from yesterday reports yesterday's package. It cost an afternoon once: six\n * exports reported as withdrawn from a package that had withdrawn nothing,\n * because the build predated the source by a day.\n *\n * A warning rather than a failure -- a fresh checkout has every file at the\n * same moment, and the publish path builds first anyway.\n */\nexport const buildIsStale = async (packageRoot: string) => {\n const [source, built] = await Promise.all([\n newestUnder(join(packageRoot, \"src\")),\n Promise.all(\n OUTPUT_DIRECTORIES.map((directory) =>\n newestUnder(join(packageRoot, directory)),\n ),\n ).then((times) => Math.max(0, ...times)),\n ]);\n\n return source > 0 && built > 0 && source > built;\n};\n\n/**\n * The public surface a build produced, read the way a consumer would.\n *\n * From the entry points the manifest declares, following the export graph --\n * not by heaping every declaration file together, which counts names no\n * consumer can import and cannot see one being withdrawn.\n *\n * Nothing when the manifest's entry points are not on disk: that is a package\n * about to publish types it has not built, and passing it would be the gate\n * going quiet at the worst possible moment.\n */\nexport const builtSurface = async (packageRoot: string) => {\n const manifest = await readJsonFile(join(packageRoot, \"package.json\"));\n const files = new Map<string, string>();\n const walk = async (directory: string): Promise<void> => {\n const found = await readdir(join(packageRoot, directory), {\n withFileTypes: true,\n }).catch(() => []);\n await Promise.all(\n found.map(async (entry) => {\n const relative = `${directory}/${entry.name}`;\n if (entry.isDirectory()) return walk(relative);\n if (!DECLARATION.test(entry.name)) return undefined;\n files.set(\n relative,\n await readFile(join(packageRoot, relative), \"utf8\").catch(() => \"\"),\n );\n\n return undefined;\n }),\n );\n };\n await Promise.all(OUTPUT_DIRECTORIES.map((directory) => walk(directory)));\n const entries = typeEntriesOf(manifest, files);\n\n return entries.length === 0 ? undefined : surfaceOfFiles(files, entries);\n};\n\nexport const changelogPaths = (packageRoot: string) => ({\n history: join(packageRoot, \"changelog\", \"history.md\"),\n json: join(packageRoot, CHANGELOG_FILE),\n markdown: join(packageRoot, CHANGELOG_MARKDOWN),\n unreleased: join(packageRoot, UNRELEASED_DIRECTORY),\n});\n/** Every pending entry, in a stable order so a release reads the same twice. */\nexport const loadUnreleased = async (packageRoot: string) => {\n const directory = join(packageRoot, UNRELEASED_DIRECTORY);\n const names = await readdir(directory).catch(() => []);\n const entries: LoadedEntry[] = [];\n const problems: string[] = [];\n for (const name of names.filter((file) => ENTRY.test(file)).sort()) {\n const file = join(UNRELEASED_DIRECTORY, name);\n // Serial on purpose: the count is small and the failure messages read\n // in file order.\n // eslint-disable-next-line no-await-in-loop\n const loaded = await loadEntry(join(directory, name));\n if (loaded.failure !== undefined)\n problems.push(`${file}: ${loaded.failure}`);\n const checked =\n loaded.failure === undefined\n ? validateChange(loaded.exported, file)\n : undefined;\n if (checked?.problems) problems.push(...checked.problems);\n if (checked?.change !== undefined)\n entries.push({ change: checked.change, file });\n }\n\n return { entries, problems };\n};\nexport const readJsonFile = async (path: string) => {\n const source = await readFile(path, \"utf8\").catch(() => undefined);\n if (source === undefined) return undefined;\n try {\n const document: unknown = JSON.parse(source);\n\n return document;\n } catch {\n return undefined;\n }\n};\n\n/**\n * Anything in the entry directory that is not an entry.\n *\n * A `.md` note dropped in here, or a `.txt` somebody meant as a placeholder,\n * is read by nothing and consumed by nothing -- it sits there through every\n * release looking like a change that was recorded.\n */\nexport const strayEntries = async (packageRoot: string) => {\n const names = await readdir(join(packageRoot, UNRELEASED_DIRECTORY)).catch(\n () => [],\n );\n\n return names.filter(\n (name) => !ENTRY.test(name) && name !== \".gitkeep\" && !name.startsWith(\".\"),\n );\n};\n",
|
|
7
7
|
"/*\n * What a change is, said in types strict enough that the important ones cannot\n * be written badly.\n *\n * A changelog is only worth having if the entries that matter carry what a\n * reader needs to act. Prose changelogs fail at exactly that: \"refactored the\n * server options\" is a true sentence and a useless one, because it does not\n * say which export moved or what to write instead. Nothing here can stop a\n * summary being vague, but the compiler can insist that a breaking change\n * names the exports it breaks and says how to migrate -- so the entries that\n * cost somebody an afternoon are the ones that cannot be filed empty.\n *\n * That is also what makes the machine half possible. `symbols` is the join\n * between an entry and the package's own type surface, so a release can be\n * checked against what actually changed; `migration` is the join between an\n * entry and the edit a project needs, so most upgrades can be applied rather\n * than described.\n */\n\n/** At least one, so a type says \"named\" rather than hoping a list is not\n * empty. */\nexport type NonEmpty<T> = readonly [T, ...T[]];\n\nexport const CHANGE_KINDS = [\n \"breaking\",\n \"removed\",\n \"added\",\n \"changed\",\n \"deprecated\",\n \"fixed\",\n \"security\",\n \"internal\",\n] as const;\n\nexport type ChangeKind = (typeof CHANGE_KINDS)[number];\n\n/** The kinds that cost a consumer work, and so must say what work. */\nexport const DISRUPTIVE_KINDS = [\"breaking\", \"removed\"] as const;\n\nexport type DisruptiveKind = (typeof DISRUPTIVE_KINDS)[number];\n\n/**\n * How to move code from before to after.\n *\n * Three of these are data rather than instructions, and that is the point: a\n * rename and a move are the overwhelming majority of real breaking changes,\n * and both are mechanical. Described as data they can be applied by anything\n * -- a CLI, an editor, a hosted upgrade button -- without running code that\n * arrived from a registry, which is the difference between an upgrade that\n * happens and an upgrade somebody schedules for a quiet week.\n *\n * `manual` is the honest escape hatch. A changed meaning is not a rewrite\n * anybody should automate, and pretending otherwise is worse than saying so.\n */\nexport type Migration<TSymbol extends string = string> =\n /** An export kept its meaning and changed its name. */\n | {\n readonly instruction: string;\n readonly rename: { readonly from: TSymbol; readonly to: string };\n }\n /** An export kept its name and moved to another entry point. */\n | {\n readonly instruction: string;\n readonly moved: {\n readonly symbol: TSymbol;\n readonly from: string;\n readonly to: string;\n };\n }\n /** A whole entry point moved; every import of it is rewritten. */\n | {\n readonly instruction: string;\n readonly resubpath: { readonly from: string; readonly to: string };\n }\n /** Neither a rename nor a move: somebody has to read the call. */\n | { readonly instruction: string; readonly manual: true };\n\n/**\n * The names a package exports, for an entry that wants them checked.\n *\n * An entry can be written against the package's own public API:\n *\n * ```ts\n * import type * as Api from \"../../src/index\";\n * import type { Change } from \"@absolutejs/changelog\";\n *\n * export const change: Change<typeof Api> = {\n * kind: \"fixed\",\n * summary: \"stops throwing on an empty list\",\n * symbols: [\"listen\"] // an export, or the compiler says so\n * };\n * ```\n *\n * Suggested rather than required, for two reasons that both matter. A\n * disruptive change is usually about something that has just stopped\n * existing -- the release that removes `start` is the release that writes the\n * entry about it -- and `typeof Api` cannot see type-only exports at all, so\n * insisting would reject an entry about `Change` or `Release` for being\n * something this package definitely exports.\n *\n * What that leaves is an editor that completes the name and a gate that is\n * certain: the release check reads the published `.d.ts`, which does carry\n * the type exports, and refuses an entry naming something the package has\n * never exported.\n */\ntype Exported<TApi> = TApi extends object\n ? Extract<keyof TApi, string>\n : string;\n\n/** Autocompleted, not restricted: an entry may name an export that has just\n * stopped being one. */\ntype Suggested<TApi> = Exported<TApi> | (string & {});\n\ntype ChangeBase = {\n /** One line, imperative, in the reader's terms rather than the\n * implementation's. */\n readonly summary: string;\n /** The why, when the summary cannot carry it. */\n readonly detail?: string;\n /** Where the discussion is. */\n readonly reference?: string;\n};\n\n/**\n * A change that costs a consumer work.\n *\n * `symbols` is not decoration: it is what lets a release be checked against\n * the package's published types, and what lets a project be told whether the\n * change reaches any of its files. An entry without it can only ever be read.\n */\nexport type DisruptiveChange<TApi = unknown> = ChangeBase & {\n readonly kind: DisruptiveKind;\n readonly symbols: NonEmpty<Suggested<TApi>>;\n readonly migration: Migration<Suggested<TApi>>;\n};\n\nexport type OrdinaryChange<TApi = unknown> = ChangeBase & {\n readonly kind: Exclude<ChangeKind, DisruptiveKind>;\n /** Optional here, and still worth filling in: it is what connects a fix\n * to the export somebody is looking at. */\n readonly symbols?: readonly Suggested<TApi>[];\n readonly migration?: never;\n};\n\nexport type Change<TApi = unknown> =\n DisruptiveChange<TApi> | OrdinaryChange<TApi>;\n\nexport type Release = {\n readonly version: string;\n /** ISO date, the day it was published. */\n readonly date: string;\n readonly changes: NonEmpty<Change>;\n /** Anything that is true of the release rather than of one change. */\n readonly note?: string;\n};\n\n/**\n * A package's history, newest first.\n *\n * Published alongside the package so that upgrading is a question anybody can\n * answer offline: what changed between the version I have and the version I\n * am being offered, and which of it reaches me.\n */\nexport type Changelog = {\n readonly name: string;\n /** The shape of this document, so a reader written today can refuse a\n * document written against a later contract instead of misreading it. */\n readonly contract: 1;\n readonly releases: readonly Release[];\n};\n\nexport const CHANGELOG_CONTRACT = 1;\n\n/** Where the machine-readable copy lives in a published package. */\nexport const CHANGELOG_FILE = \"changelog.json\";\n\n/** Where the human-readable copy lives. */\nexport const CHANGELOG_MARKDOWN = \"CHANGELOG.md\";\n\n/** Where entries wait between releases, one file each so two branches adding\n * a change do not conflict over the same line. */\nexport const UNRELEASED_DIRECTORY = \"changelog/unreleased\";\n\nexport const isDisruptive = (change: Change): change is DisruptiveChange =>\n change.kind === \"breaking\" || change.kind === \"removed\";\n\n/** Whether a migration can be applied rather than read. */\nexport const isMechanical = (\n migration: Migration,\n): migration is Exclude<Migration, { manual: true }> =>\n !(\"manual\" in migration);\n",
|
|
8
8
|
"import { isDisruptive, type Change } from \"./types\";\n\n/*\n * Which version a set of changes adds up to.\n *\n * Written out rather than pulled in, for the same reason the rest of this\n * package has no dependencies: forty lines of arithmetic is not worth a\n * supply chain, and every consumer of a changelog -- a CLI, an editor, a\n * control plane deciding what to offer -- needs the comparison as much as the\n * bumping.\n *\n * The rules that are not the textbook ones are the two that match how these\n * packages are actually versioned:\n *\n * - Below 1.0.0 a breaking change moves the minor. The major is reserved\n * for the release that means it, and `0.x` is the place the ecosystem\n * lives.\n * - A version already on a prerelease line moves along that line by\n * default, whatever the changes are. Somebody publishing `beta.88` is not\n * asking to be moved to `1.0.0` because they fixed a bug.\n */\n\nexport type ReleaseKind = \"major\" | \"minor\" | \"patch\" | \"prerelease\";\n\ntype Parsed = {\n prerelease: string[];\n release: [number, number, number];\n};\n\n/** What a comparator returns: the left one is older, or it is newer. */\nconst OLDER = -1;\n/** The last element, and everything but it. */\nconst LAST = -1;\nconst NEWER = 1;\n\nconst VERSION =\n /^(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?(?:\\+[0-9A-Za-z.-]+)?$/u;\n\nexport const parseVersion = (version: string) => {\n const found = VERSION.exec(version.trim());\n if (!found) return undefined;\n const [, major, minor, patch, prerelease] = found;\n\n return {\n prerelease: prerelease === undefined ? [] : prerelease.split(\".\"),\n release: [Number(major), Number(minor), Number(patch)],\n } satisfies Parsed;\n};\n\nconst isNumeric = (value: string) => /^\\d+$/u.test(value);\n\nconst comparePrerelease = (left: string[], right: string[]) => {\n // A release outranks any prerelease of the same numbers.\n if (left.length === 0 || right.length === 0)\n return right.length - left.length;\n for (const [index, mine] of left.entries()) {\n const theirs = right[index];\n if (theirs === undefined) return NEWER;\n if (mine === theirs) continue;\n if (isNumeric(mine) && isNumeric(theirs))\n return Number(mine) - Number(theirs);\n // Numeric identifiers rank below alphanumeric ones.\n if (isNumeric(mine)) return OLDER;\n if (isNumeric(theirs)) return NEWER;\n\n return mine < theirs ? OLDER : NEWER;\n }\n\n return left.length - right.length;\n};\n\n/** Semver order. Negative when the left version is the older one. */\nexport const compareVersions = (left: string, right: string) => {\n const mine = parseVersion(left);\n const theirs = parseVersion(right);\n if (!mine || !theirs) return 0;\n for (const [index, part] of mine.release.entries()) {\n const other = theirs.release[index] ?? 0;\n if (part !== other) return part - other;\n }\n\n return comparePrerelease(mine.prerelease, theirs.prerelease);\n};\n\nexport const isPrerelease = (version: string) =>\n (parseVersion(version)?.prerelease.length ?? 0) > 0;\n\n/** The largest step any of these changes asks for. */\nexport const releaseKindFor = (changes: readonly Change[]) => {\n if (changes.some(isDisruptive)) {\n const major: ReleaseKind = \"major\";\n\n return major;\n }\n const asked: ReleaseKind = changes.some((entry) => entry.kind === \"added\")\n ? \"minor\"\n : \"patch\";\n\n return asked;\n};\n\nconst bumpPrerelease = (parsed: Parsed) => {\n const { prerelease, release } = parsed;\n const last = prerelease.at(LAST);\n const counted =\n last !== undefined && isNumeric(last)\n ? [...prerelease.slice(0, LAST), String(Number(last) + 1)]\n : [...prerelease, \"1\"];\n\n return `${release.join(\".\")}-${counted.join(\".\")}`;\n};\n\n/**\n * The version these changes make of this one.\n *\n * `asked` overrides the changes: a release that means to leave a prerelease\n * line, or to cut the major it has been putting off, says so rather than\n * being inferred into it.\n */\nexport const nextVersion = (input: {\n asked?: ReleaseKind;\n changes: readonly Change[];\n current: string;\n /** The identifier a first prerelease uses: `beta` gives `1.0.0-beta.1`. */\n prereleaseIdentifier?: string;\n}) => {\n const parsed = parseVersion(input.current);\n if (!parsed) return undefined;\n const [major, minor, patch] = parsed.release;\n /* A prerelease line moves along itself unless told otherwise -- including\n * for a breaking change, which is what a prerelease line is for. */\n const kind =\n input.asked ??\n (parsed.prerelease.length > 0\n ? \"prerelease\"\n : releaseKindFor(input.changes));\n if (kind === \"prerelease\")\n return parsed.prerelease.length > 0\n ? bumpPrerelease(parsed)\n : `${major}.${minor}.${patch + 1}-${\n input.prereleaseIdentifier ?? \"beta\"\n }.1`;\n /* Leaving a prerelease line for the release it was leading up to: the\n * numbers are already right, the suffix is what goes. */\n if (parsed.prerelease.length > 0 && kind === \"patch\")\n return `${major}.${minor}.${patch}`;\n /* Below 1.0.0 the major is reserved for the release that means it, so a\n * breaking change moves the minor instead. */\n if (kind === \"major\")\n return major === 0 ? `${major}.${minor + 1}.0` : `${major + 1}.0.0`;\n\n return kind === \"minor\"\n ? `${major}.${minor + 1}.0`\n : `${major}.${minor}.${patch + 1}`;\n};\n",
|
|
9
9
|
"import {\n CHANGELOG_CONTRACT,\n CHANGE_KINDS,\n isDisruptive,\n isMechanical,\n type Change,\n type ChangeKind,\n type Changelog,\n type DisruptiveChange,\n type Migration,\n type NonEmpty,\n type Release,\n} from \"./types\";\nimport { compareVersions, parseVersion } from \"./versioning\";\n\n/*\n * Reading a changelog somebody else wrote.\n *\n * The document arrives from a registry, which means it arrives from the\n * internet: nothing here trusts a field until it has looked at it, and a\n * document that is wrong is refused with the reasons rather than half-read\n * into a shape the rest of the program will misuse. That matters more than it\n * usually would, because the thing on the other end of this is a program\n * deciding whether an upgrade is safe -- a changelog that parses loosely is\n * how \"no breaking changes\" gets said about a release that had them.\n *\n * Every query below answers oldest-first. An upgrade is walked forwards: the\n * changes are read in the order they happened and the migrations are applied\n * in that order, because two of them may touch the same name.\n */\n\ntype Problem = string;\n\nconst isKind = (value: unknown): value is ChangeKind =>\n typeof value === \"string\" && CHANGE_KINDS.some((known) => known === value);\n\n/** Narrowing that keeps the ordinary branch's `kind` out of the disruptive\n * union without an assertion. */\nconst isDisruptiveKind = (kind: ChangeKind): kind is \"breaking\" | \"removed\" =>\n kind === \"breaking\" || kind === \"removed\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isText = (value: unknown): value is string =>\n typeof value === \"string\" && value.trim().length > 0;\n\n/** A list of names, or nothing -- and `nothing` is reported rather than\n * quietly dropped. An entry whose `symbols` is `[123, \"serve\"]` used to be\n * accepted with no symbols at all, so a consumer asking \"does this release\n * touch me?\" was told no about a change that named `serve`. */\nconst textList = (value: unknown, where: string, problems: Problem[]) => {\n if (value === undefined) return undefined;\n if (Array.isArray(value) && value.length > 0 && value.every(isText))\n return value.filter((entry) => typeof entry === \"string\");\n problems.push(`${where}: symbols is not a list of names`);\n\n return undefined;\n};\n\nconst readMigration = (value: unknown, where: string, problems: Problem[]) => {\n if (!isRecord(value) || !isText(value.instruction)) {\n problems.push(`${where}: migration needs an instruction`);\n\n return undefined;\n }\n const { instruction } = value;\n const { rename } = value;\n if (isRecord(rename) && isText(rename.from) && isText(rename.to))\n return {\n instruction,\n rename: { from: rename.from, to: rename.to },\n } satisfies Migration;\n const { moved } = value;\n if (\n isRecord(moved) &&\n isText(moved.symbol) &&\n isText(moved.from) &&\n isText(moved.to)\n )\n return {\n instruction,\n moved: { from: moved.from, symbol: moved.symbol, to: moved.to },\n } satisfies Migration;\n const { resubpath } = value;\n if (isRecord(resubpath) && isText(resubpath.from) && isText(resubpath.to))\n return {\n instruction,\n resubpath: { from: resubpath.from, to: resubpath.to },\n } satisfies Migration;\n if (value.manual === true) return { instruction, manual: true } as const;\n problems.push(\n `${where}: migration says neither rename, moved, resubpath nor manual`,\n );\n\n return undefined;\n};\n\nconst readChange = (value: unknown, where: string, problems: Problem[]) => {\n if (!isRecord(value)) {\n problems.push(`${where}: not an object`);\n\n return undefined;\n }\n const { kind } = value;\n if (!isKind(kind)) {\n problems.push(`${where}: unknown kind ${JSON.stringify(kind)}`);\n\n return undefined;\n }\n if (!isText(value.summary)) {\n problems.push(`${where}: needs a summary`);\n\n return undefined;\n }\n const shared: Pick<Change, \"detail\" | \"reference\" | \"summary\"> = {\n ...(isText(value.detail) ? { detail: value.detail } : {}),\n ...(isText(value.reference) ? { reference: value.reference } : {}),\n summary: value.summary,\n };\n const symbols = textList(value.symbols, where, problems);\n const [first, ...rest] = symbols ?? [];\n /* The rule the whole document exists to enforce: a change that costs a\n * consumer work says which exports it costs them and what to do. */\n if (kind === \"breaking\" || kind === \"removed\") {\n const migration = readMigration(value.migration, where, problems);\n if (first === undefined)\n problems.push(`${where}: a ${kind} change must name symbols`);\n if (!migration || first === undefined) return undefined;\n const named: NonEmpty<string> = [first, ...rest];\n const disruptive: Change = {\n ...shared,\n kind,\n migration,\n symbols: named,\n };\n\n return disruptive;\n }\n if (isDisruptiveKind(kind)) return undefined;\n const ordinary: Change = {\n ...shared,\n kind,\n ...(symbols ? { symbols } : {}),\n };\n\n return ordinary;\n};\n\nconst readRelease = (value: unknown, where: string, problems: Problem[]) => {\n if (!isRecord(value)) {\n problems.push(`${where}: not an object`);\n\n return undefined;\n }\n const version = isText(value.version) ? value.version.trim() : undefined;\n /* Trimmed where it is read as well as where it is parsed: `\" 1.0.0 \"`\n * parsed fine, was stored with its spaces, and then failed a string\n * comparison against the manifest's version for a reason nobody could\n * see. */\n if (version === undefined || parseVersion(version) === undefined) {\n problems.push(`${where}: version is not a version`);\n\n return undefined;\n }\n if (!isText(value.date)) {\n problems.push(`${where}: needs a date`);\n\n return undefined;\n }\n const raw = value.changes;\n if (!Array.isArray(raw) || raw.length === 0) {\n problems.push(`${where}: a release with no changes is not a release`);\n\n return undefined;\n }\n const changes = raw\n .map((entry, index) =>\n readChange(entry, `${where}.changes[${index}]`, problems),\n )\n .filter((entry): entry is Change => entry !== undefined);\n if (changes.length !== raw.length) return undefined;\n\n const [head, ...tail] = changes;\n if (head === undefined) return undefined;\n const release: Release = {\n changes: [head, ...tail],\n date: value.date,\n ...(isText(value.note) ? { note: value.note } : {}),\n version,\n };\n\n return release;\n};\n\n/**\n * Read one entry on its own, the way the authoring files are checked.\n *\n * The compiler already refused the shapes it can see; this is for the moment\n * the file is read back as data, where a `kind` typed into a string and a\n * migration deleted in a merge are both still possible.\n */\nexport const validateChange = (value: unknown, where = \"entry\") => {\n const problems: Problem[] = [];\n const change = readChange(value, where, problems);\n\n if (change === undefined) {\n const failed: { change?: undefined; problems: Problem[] } = { problems };\n\n return failed;\n }\n const read: { change: Change; problems?: undefined } = { change };\n\n return read;\n};\n\nexport type ChangelogRead =\n | { changelog: Changelog; problems?: undefined }\n | { changelog?: undefined; problems: Problem[] };\n\n/**\n * Read a changelog document, or say why it is not one.\n *\n * A later contract is refused rather than read: a reader written today cannot\n * know what a field added tomorrow means, and guessing is how a document that\n * grew a \"this one is worse than it looks\" flag gets summarised without it.\n */\nexport const parseChangelog = (value: unknown): ChangelogRead => {\n const problems: Problem[] = [];\n if (!isRecord(value)) return { problems: [\"not an object\"] };\n if (!isText(value.name)) problems.push(\"needs a package name\");\n /* A document from an older contract is one this reader was written after\n * and still understands. A newer one is not: a field added tomorrow could\n * be the one that says \"this release is worse than it looks\", and a reader\n * that skips it summarises the release without it. */\n if (\n !Number.isInteger(value.contract) ||\n Number(value.contract) > CHANGELOG_CONTRACT\n )\n problems.push(\n `contract ${JSON.stringify(value.contract)} is newer than ${CHANGELOG_CONTRACT}, which this reader understands`,\n );\n const raw = value.releases;\n if (!Array.isArray(raw)) problems.push(\"releases is not a list\");\n const releases = (Array.isArray(raw) ? raw : [])\n .map((entry, index) => readRelease(entry, `releases[${index}]`, problems))\n .filter((entry) => entry !== undefined);\n if (problems.length > 0) return { problems };\n\n return {\n changelog: {\n contract: CHANGELOG_CONTRACT,\n name: String(value.name),\n // Newest first is how it is read; the queries below reverse it.\n releases: [...releases].sort((left, right) =>\n compareVersions(right.version, left.version),\n ),\n },\n };\n};\n\n/** The releases strictly after `from` and up to and including `to`, oldest\n * first -- the order an upgrade happens in. */\nexport const releasesBetween = (\n changelog: Changelog,\n from: string,\n upto: string,\n) =>\n [...changelog.releases]\n .filter(\n (release) =>\n compareVersions(release.version, from) > 0 &&\n compareVersions(release.version, upto) <= 0,\n )\n .sort((left, right) => compareVersions(left.version, right.version));\n\nexport type ChangeAt = { change: Change; version: string };\n\nexport const changesBetween = (\n changelog: Changelog,\n from: string,\n upto: string,\n) =>\n releasesBetween(changelog, from, upto).flatMap((release) =>\n release.changes.map((change) => {\n const found: ChangeAt = { change, version: release.version };\n\n return found;\n }),\n );\n\nexport type DisruptiveAt = { change: DisruptiveChange; version: string };\n\nconst isDisruptiveAt = (found: ChangeAt): found is DisruptiveAt =>\n isDisruptive(found.change);\n\n/** Only the ones that cost a consumer work. */\nexport const disruptiveBetween = (\n changelog: Changelog,\n from: string,\n upto: string,\n) => changesBetween(changelog, from, upto).filter(isDisruptiveAt);\n\nexport type MigrationAt = {\n migration: Migration;\n symbols: readonly string[];\n version: string;\n};\n\n/** The ones that can be applied rather than read. */\nexport const mechanicalMigrations = (migrations: readonly MigrationAt[]) =>\n migrations.filter((found) => isMechanical(found.migration));\n/**\n * The migrations an upgrade needs, in the order they happened.\n *\n * Order is not a nicety: a symbol renamed in one release and moved in the next\n * has to be renamed first, or the move looks for a name that is no longer\n * there.\n */\nexport const migrationsBetween = (\n changelog: Changelog,\n from: string,\n upto: string,\n) =>\n disruptiveBetween(changelog, from, upto).map(({ change, version }) => {\n const found: MigrationAt = {\n migration: change.migration,\n symbols: change.symbols,\n version,\n };\n\n return found;\n });\n/** Every export named by a disruptive change in the window. */\nexport const symbolsDisturbedBetween = (\n changelog: Changelog,\n from: string,\n upto: string,\n) =>\n new Set(\n disruptiveBetween(changelog, from, upto).flatMap(\n ({ change }) => change.symbols,\n ),\n );\n",
|
|
10
|
-
"import path from \"node:path\";\nimport ts from \"typescript\";\nimport { asText, readTar } from \"./tarball\";\n\n/*\n * What a package promises, and what moved between two versions of it.\n *\n * This exists to check a changelog against reality. An entry says a release\n * broke `serve`; the types say what the release actually did to `serve`, and\n * to the nine other exports nobody wrote an entry for.\n *\n * Two things about how it reads them are load-bearing, and the first version\n * of this file got both wrong.\n *\n * **It follows the entry points.** The promise a package makes is what you can\n * import from it, not every name declared somewhere under `dist`. Reading the\n * declaration files as a heap made the two differ by a factor of three on a\n * real package -- 1,103 names tracked against 377 actually exported -- and,\n * far worse, made the most ordinary breaking change of all invisible:\n * withdrawing a name from the entry point while its module file stays where it\n * was. So the surface is built by walking the export graph from the entry\n * points the manifest declares, the way a consumer's compiler does.\n *\n * **It parses.** A `.d.ts` read with regular expressions cannot tell a\n * declaration from a sentence about one: the phrase \"reads as\n * `export { syncSocket }` in one version\", written in a comment in this very\n * package, became an export in its published surface -- and, because two files\n * then claimed the same name, made this package's own release gate fail two\n * runs in three. Comments are not nodes. Parsing ends the whole class.\n */\n\n/** One exported name: what it is declared as, and which entry points of the\n * package offer it. */\nexport type SurfaceName = {\n declaration: string;\n /** Import specifiers, so `@absolutejs/auth` and `@absolutejs/auth/server`\n * are the two different promises they are. */\n entries: string[];\n};\n\nexport type PackageSurface = Map<string, SurfaceName>;\n\n/** An entry point, as a file inside the package and as the specifier somebody\n * writes to import from it. */\nexport type TypeEntry = { path: string; specifier: string };\n\n/** What one declaration file exports: a name, and the text it stands for.\n * A module's own view, before the entry points are merged into a surface. */\ntype ModuleExports = Map<string, string>;\n\n/** Declaration files, in every spelling a build might emit. */\nconst DECLARATION = /\\.d\\.[cm]?ts$/u;\n\nconst parse = (source: string, name: string) =>\n ts.createSourceFile(\n name,\n source,\n ts.ScriptTarget.Latest,\n true,\n ts.ScriptKind.TS,\n );\n\nconst normalize = (text: string) => text.replace(/\\s+/gu, \" \").trim();\n\n/**\n * Where a relative specifier lands among a package's files.\n *\n * A declaration file names its neighbours the way source does -- `./read` --\n * and the file is `read.d.ts`, or `read/index.d.ts`, or the `.mts` spelling of\n * either.\n */\nconst resolveFrom = (\n files: ReadonlyMap<string, string>,\n from: string,\n specifier: string,\n) => {\n if (!specifier.startsWith(\".\")) return undefined;\n const base = path.posix.join(path.posix.dirname(from), specifier);\n const candidates = [\n base,\n `${base.replace(/\\.js$/u, \"\")}.d.ts`,\n `${base.replace(/\\.js$/u, \"\")}.d.mts`,\n `${base.replace(/\\.js$/u, \"\")}.d.cts`,\n `${base}/index.d.ts`,\n `${base}/index.d.mts`,\n `${base}/index.d.cts`,\n ];\n\n return candidates.find((candidate) => files.has(candidate));\n};\n\nconst declaredNameOf = (statement: ts.Statement) => {\n if (\n ts.isFunctionDeclaration(statement) ||\n ts.isClassDeclaration(statement) ||\n ts.isInterfaceDeclaration(statement) ||\n ts.isTypeAliasDeclaration(statement) ||\n ts.isEnumDeclaration(statement) ||\n ts.isModuleDeclaration(statement)\n )\n return statement.name !== undefined && ts.isIdentifier(statement.name)\n ? statement.name.text\n : undefined;\n\n return undefined;\n};\n\nconst isExported = (statement: ts.Statement) =>\n ts.canHaveModifiers(statement) &&\n ts\n .getModifiers(statement)\n ?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ===\n true;\n\nconst variableNamesOf = (statement: ts.VariableStatement) =>\n statement.declarationList.declarations\n .map((declaration) => declaration.name)\n .filter((name) => ts.isIdentifier(name))\n .map((name) => name.text);\n\n/** Everything a module declares, exported or not, so `export { a }` can find\n * what `a` is. */\nconst declarationsIn = (file: ts.SourceFile) => {\n const found = new Map<string, string>();\n for (const statement of file.statements) {\n const text = normalize(statement.getText(file));\n const named = declaredNameOf(statement);\n if (named !== undefined) found.set(named, text);\n if (!ts.isVariableStatement(statement)) continue;\n for (const name of variableNamesOf(statement)) found.set(name, text);\n }\n\n return found;\n};\n\n/** Whether a manifest claims to ship types at all. A package that ships none\n * has no promise of this kind to check; one that claims some and has none is\n * a package about to publish types it did not build. */\nexport const declaresTypes = (manifest: unknown) => {\n if (typeof manifest !== \"object\" || manifest === null) return false;\n const record = new Map(Object.entries(manifest));\n if (typeof record.get(\"types\") === \"string\") return true;\n if (typeof record.get(\"typings\") === \"string\") return true;\n\n return JSON.stringify(record.get(\"exports\") ?? {}).includes('\"types\"');\n};\n\n/** What one statement of a declaration file contributes to its module's\n * exports. Split out so the walk over a file is one loop rather than three\n * levels of them. */\nconst contributionOf = (input: {\n file: ts.SourceFile;\n files: ReadonlyMap<string, string>;\n from: string;\n local: ReadonlyMap<string, string>;\n seen: ReadonlySet<string>;\n statement: ts.Statement;\n}) => {\n const { file, files, from, local, seen, statement } = input;\n const nothing: ReadonlyArray<readonly [string, string]> = [];\n // `export default x` and `export = x`.\n if (ts.isExportAssignment(statement))\n return [\n [\n statement.isExportEquals === true ? \"export=\" : \"default\",\n normalize(statement.getText(file)),\n ] as const,\n ];\n const named = declaredNameOf(statement);\n if (named !== undefined && isExported(statement))\n return [\n [named, local.get(named) ?? normalize(statement.getText(file))] as const,\n ];\n if (ts.isVariableStatement(statement) && isExported(statement)) {\n const text = normalize(statement.getText(file));\n\n return variableNamesOf(statement).map((name) => [name, text] as const);\n }\n if (!ts.isExportDeclaration(statement)) return nothing;\n const specifier =\n statement.moduleSpecifier !== undefined &&\n ts.isStringLiteral(statement.moduleSpecifier)\n ? statement.moduleSpecifier.text\n : undefined;\n const target =\n specifier === undefined ? undefined : resolveFrom(files, from, specifier);\n /* A re-export of a package we do not have the files for -- a dependency --\n * contributes names we cannot describe. They are still exports, so they are\n * recorded as such rather than dropped. */\n const theirs =\n target === undefined\n ? new Map<string, string>()\n : exportsOf(files, target, new Set(seen));\n const clause = statement.exportClause;\n // `export * from './m'` -- everything but the default.\n if (clause === undefined)\n return [...theirs].filter(\n ([name]) => name !== \"default\" && name !== \"export=\",\n );\n if (ts.isNamespaceExport(clause))\n return [[clause.name.text, `export * as ${clause.name.text}`] as const];\n\n return clause.elements.map((element) => {\n const sourceName = (element.propertyName ?? element.name).text;\n const text =\n (specifier === undefined\n ? local.get(sourceName)\n : theirs.get(sourceName)) ?? `export { ${sourceName} }`;\n\n return [element.name.text, text] as const;\n });\n};\n\n/**\n * The names a module exports, following re-exports to where they are declared.\n *\n * `seen` is the cycle guard: a package whose entry point re-exports a module\n * that re-exports the entry point is unusual and not impossible, and reading\n * it must terminate.\n */\nconst exportsOf = (\n files: ReadonlyMap<string, string>,\n from: string,\n seen: Set<string>,\n) => {\n const surface: ModuleExports = new Map();\n const source = files.get(from);\n if (source === undefined || seen.has(from)) return surface;\n seen.add(from);\n const file = parse(source, from);\n const local = declarationsIn(file);\n const contributed = file.statements.flatMap((statement) =>\n contributionOf({ file, files, from, local, seen, statement }),\n );\n for (const [name, text] of contributed) surface.set(name, text);\n\n return surface;\n};\n\n/** The surface of a package tarball, already gunzipped. */\nexport const surfaceOfArchive = (archive: Uint8Array) => {\n const held = readTar(\n archive,\n (name) => DECLARATION.test(name) || name === \"package.json\",\n );\n const files = new Map(\n [...held].map(([name, bytes]) => [name, asText(bytes)] as const),\n );\n const manifest = files.get(\"package.json\");\n let parsed: unknown;\n try {\n parsed = manifest === undefined ? undefined : JSON.parse(manifest);\n } catch {\n parsed = undefined;\n }\n const entries = typeEntriesOf(parsed, files);\n\n return entries.length === 0 ? undefined : surfaceOfFiles(files, entries);\n};\n\n/**\n * The public surface of a package: what its entry points export, and what\n * each of those names is declared as.\n */\nexport const surfaceOfFiles = (\n files: ReadonlyMap<string, string>,\n entries: readonly TypeEntry[],\n) => {\n const surface: PackageSurface = new Map();\n /* A name offered by two entry points is one name with two ways in. The\n * declaration is whichever was read first -- they agree in every case that\n * is not already a bug in the package -- and both specifiers are kept,\n * because losing one of them is a break for everybody importing through\n * it. */\n const offered = entries.flatMap((entry) =>\n [...exportsOf(files, entry.path, new Set())].map(\n ([name, declaration]) =>\n ({ declaration, name, specifier: entry.specifier }) as const,\n ),\n );\n for (const { declaration, name, specifier } of offered) {\n const known = surface.get(name);\n if (known === undefined)\n surface.set(name, { declaration, entries: [specifier] });\n else if (!known.entries.includes(specifier)) known.entries.push(specifier);\n }\n for (const value of surface.values()) value.entries.sort();\n\n return surface;\n};\n\n/**\n * Every candidate declaration file in an exports map, paired with the\n * specifier it would be imported by.\n *\n * The subpath matters: an export that leaves `@pkg` and stays on\n * `@pkg/server` is gone for everybody importing it from the root, and a\n * surface that knows only names cannot see that at all.\n */\nconst exportEntries = (\n value: unknown,\n packageName: string,\n specifier?: string,\n): Array<{ specifier: string; value: unknown }> => {\n const here = specifier ?? packageName;\n if (typeof value === \"string\") return [{ specifier: here, value }];\n if (typeof value !== \"object\" || value === null) return [];\n\n return Object.entries(value).flatMap(([key, nested]) =>\n key.startsWith(\".\")\n ? exportEntries(\n nested,\n packageName,\n key === \".\" ? packageName : `${packageName}${key.slice(1)}`,\n )\n : exportEntries(nested, packageName, here),\n );\n};\n\n/** The declaration files a manifest points at, with the specifier each one is\n * imported by. */\nexport const typeEntriesOf = (\n manifest: unknown,\n files: ReadonlyMap<string, string>,\n) => {\n const record =\n typeof manifest === \"object\" && manifest !== null\n ? new Map(Object.entries(manifest))\n : new Map<string, unknown>();\n const named = record.get(\"name\");\n const packageName = typeof named === \"string\" ? named : \"\";\n const resolved = (value: unknown, specifier: string) => {\n if (typeof value !== \"string\") return [];\n const cleaned = value.replace(/^\\.\\//u, \"\");\n const candidates = DECLARATION.test(cleaned)\n ? [cleaned]\n : [\n cleaned.replace(/\\.[cm]?js$/u, \".d.ts\"),\n cleaned.replace(/\\.[cm]?js$/u, \".d.mts\"),\n cleaned.replace(/\\.[cm]?js$/u, \".d.cts\"),\n ];\n\n return candidates\n .filter((candidate) => files.has(candidate))\n .map((resolvedPath) => ({ path: resolvedPath, specifier }));\n };\n const found = [\n ...resolved(record.get(\"types\"), packageName),\n ...resolved(record.get(\"typings\"), packageName),\n ...exportEntries(record.get(\"exports\"), packageName).flatMap((entry) =>\n resolved(entry.value, entry.specifier),\n ),\n ];\n /* Nothing declared, or nothing that resolved. `dist/index.d.ts` is where\n * every package in this ecosystem puts it; a package that declares types\n * and has none is one the gate refuses rather than passes. */\n const fallback =\n found.length === 0 && files.has(\"dist/index.d.ts\")\n ? [{ path: \"dist/index.d.ts\", specifier: packageName }]\n : [];\n const seen = new Set<string>();\n\n return [...found, ...fallback].filter((entry) => {\n const key = `${entry.specifier}\\u0000${entry.path}`;\n if (seen.has(key)) return false;\n seen.add(key);\n\n return true;\n });\n};\n\n/*\n * How much of a change a change is.\n *\n * Two declarations differing is not the same as a caller having to do\n * anything. Generated types carry inference all the way down, so a version\n * bump can move the innards of a return type -- `store: {}` becoming\n * `store: {} | {}` -- while everything anybody wrote at the call site is\n * exactly as valid as it was.\n *\n * This is information, not a filter, and the difference matters. The release\n * gate reports every change and lets the shape describe it, because the person\n * who made the change knows what they did and writing one line is cheap. A\n * consumer's upgrade advisor leans on the shape to sort sixty inference\n * wobbles behind the two things that will actually break them. Using it as a\n * filter in both places is how a constructor gaining a required argument went\n * unreported.\n */\nconst SHAPE = {\n members: \"members\",\n parameters: \"parameters\",\n types: \"types\",\n unknown: \"unknown\",\n} as const;\n\nexport type ChangeShape = (typeof SHAPE)[keyof typeof SHAPE];\n\n/** A name a file only passes along: it says the export exists and nothing\n * about what it is. */\nconst isStub = (declaration: string) => declaration.startsWith(\"export {\");\n\nconst signatureOf = (declaration: string) => {\n const file = parse(`${declaration}\\n`, \"declaration.d.ts\");\n const [statement] = file.statements;\n if (statement === undefined) return undefined;\n\n return statement;\n};\n\n/** What a caller passes, as text, for every declaration that takes anything. */\nconst parametersOf = (declaration: string) => {\n const statement = signatureOf(declaration);\n if (statement === undefined) return \"\";\n const found: string[] = [];\n const visit = (node: ts.Node) => {\n if (\n ts.isFunctionTypeNode(node) ||\n ts.isFunctionDeclaration(node) ||\n ts.isMethodSignature(node) ||\n ts.isMethodDeclaration(node) ||\n ts.isConstructSignatureDeclaration(node) ||\n ts.isConstructorDeclaration(node)\n )\n found.push(\n node.parameters\n .map((parameter) => normalize(parameter.getText()))\n .join(\", \"),\n );\n ts.forEachChild(node, visit);\n };\n visit(statement);\n\n return found.join(\" | \");\n};\n\n/** What a caller reaches for. */\nconst membersOf = (declaration: string) => {\n const statement = signatureOf(declaration);\n const members = new Set<string>();\n if (statement === undefined) return members;\n const visit = (node: ts.Node) => {\n if (\n (ts.isPropertySignature(node) ||\n ts.isMethodSignature(node) ||\n ts.isPropertyDeclaration(node) ||\n ts.isMethodDeclaration(node) ||\n ts.isEnumMember(node)) &&\n node.name !== undefined &&\n (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name))\n )\n members.add(node.name.text);\n ts.forEachChild(node, visit);\n };\n visit(statement);\n\n return members;\n};\n\nconst sameNames = (left: ReadonlySet<string>, right: ReadonlySet<string>) =>\n left.size === right.size && [...left].every((name) => right.has(name));\n\nexport const changeShape = (change: { after: string; before: string }) => {\n /* One side is a re-export and the other is the declaration behind it. That\n * is this reader finding the name in a different file, not the package\n * changing anything. */\n if (isStub(change.before) !== isStub(change.after)) return SHAPE.unknown;\n if (parametersOf(change.before) !== parametersOf(change.after))\n return SHAPE.parameters;\n if (!sameNames(membersOf(change.before), membersOf(change.after)))\n return SHAPE.members;\n\n return SHAPE.types;\n};\n\nexport type SurfaceChange = {\n after: string;\n before: string;\n name: string;\n shape: ChangeShape;\n};\n\n/** A name that is still exported, but not from every entry point it was. */\nexport type Withdrawal = { from: string[]; name: string };\n\nexport type SurfaceDiff = {\n added: string[];\n changed: SurfaceChange[];\n removed: string[];\n withdrawn: Withdrawal[];\n};\n\n/**\n * What moved between two surfaces.\n *\n * Removed is the one that breaks a build outright. Changed is the one that\n * may: a widened parameter is not a break and a narrowed one is, and telling\n * them apart is a job for whoever reads the two declarations -- so both are\n * carried rather than judged here.\n */\nexport const diffSurface = (\n before: PackageSurface,\n after: PackageSurface,\n): SurfaceDiff => {\n const removed: string[] = [];\n const withdrawn: Withdrawal[] = [];\n const changed: SurfaceChange[] = [];\n for (const [name, was] of before) {\n const now = after.get(name);\n if (now === undefined) removed.push(name);\n if (now === undefined) continue;\n /* Still exported, and not from everywhere it was. An export that leaves\n * `@pkg` and stays on `@pkg/server` is gone for everybody importing it\n * from the root -- which a surface keyed only by name cannot see, and\n * which this package has a migration kind for. */\n const lost = was.entries.filter((entry) => !now.entries.includes(entry));\n if (lost.length > 0) withdrawn.push({ from: lost, name });\n if (now.declaration !== was.declaration)\n changed.push({\n after: now.declaration,\n before: was.declaration,\n name,\n shape: changeShape({\n after: now.declaration,\n before: was.declaration,\n }),\n });\n }\n\n return {\n added: [...after.keys()].filter((name) => !before.has(name)),\n changed,\n removed,\n withdrawn,\n };\n};\n\n/**\n * The changes a consumer would notice, for an advisor deciding what to put in\n * front of somebody.\n *\n * Not for the gate: `types` changes are still changes, and the package that\n * made one is the party that can say in one line whether it matters.\n */\nexport const notable = (diff: SurfaceDiff) =>\n diff.changed.filter(\n (change) => change.shape === \"parameters\" || change.shape === \"members\",\n );\n",
|
|
10
|
+
"import path from \"node:path\";\nimport ts from \"typescript\";\nimport { asText, readTar } from \"./tarball\";\n\n/*\n * What a package promises, and what moved between two versions of it.\n *\n * This exists to check a changelog against reality. An entry says a release\n * broke `serve`; the types say what the release actually did to `serve`, and\n * to the nine other exports nobody wrote an entry for.\n *\n * Two things about how it reads them are load-bearing, and the first version\n * of this file got both wrong.\n *\n * **It follows the entry points.** The promise a package makes is what you can\n * import from it, not every name declared somewhere under `dist`. Reading the\n * declaration files as a heap made the two differ by a factor of three on a\n * real package -- 1,103 names tracked against 377 actually exported -- and,\n * far worse, made the most ordinary breaking change of all invisible:\n * withdrawing a name from the entry point while its module file stays where it\n * was. So the surface is built by walking the export graph from the entry\n * points the manifest declares, the way a consumer's compiler does.\n *\n * **It parses.** A `.d.ts` read with regular expressions cannot tell a\n * declaration from a sentence about one: the phrase \"reads as\n * `export { syncSocket }` in one version\", written in a comment in this very\n * package, became an export in its published surface -- and, because two files\n * then claimed the same name, made this package's own release gate fail two\n * runs in three. Comments are not nodes. Parsing ends the whole class.\n */\n\n/** One exported name: what it is declared as, and which entry points of the\n * package offer it. */\nexport type SurfaceName = {\n declaration: string;\n /** Import specifiers, so `@absolutejs/auth` and `@absolutejs/auth/server`\n * are the two different promises they are. */\n entries: string[];\n};\n\nexport type PackageSurface = Map<string, SurfaceName>;\n\n/** An entry point, as a file inside the package and as the specifier somebody\n * writes to import from it. */\nexport type TypeEntry = { path: string; specifier: string };\n\n/** What one declaration file exports: a name, and the text it stands for.\n * A module's own view, before the entry points are merged into a surface. */\ntype ModuleExports = Map<string, string>;\n\n/** Declaration files, in every spelling a build might emit. */\nconst DECLARATION = /\\.d\\.[cm]?ts$/u;\n\nconst parse = (source: string, name: string) =>\n ts.createSourceFile(\n name,\n source,\n ts.ScriptTarget.Latest,\n true,\n ts.ScriptKind.TS,\n );\n\n/*\n * A declaration's text, reduced to what it says. Two builds of the same API\n * can print it differently -- a formatter swaps 'quotes' for \"quotes\", wraps\n * a parameter list and adds a trailing comma, a doc comment is reworded --\n * and none of that is a change a consumer can see, so none of it may read as\n * one. The text is rebuilt from its tokens: string literals written one way\n * (double-quoted), comments dropped, a trailing comma before a closing\n * bracket dropped, and a space kept only where two words would otherwise\n * run together. Everything else is kept exactly.\n */\n/** A declaration as it is shown: its own text, on one line. */\nconst normalize = (text: string) => text.replace(/\\s+/gu, \" \").trim();\n\nconst CLOSERS = new Set([\"}\", \")\", \"]\", \">\"]);\nconst wordy = (token: string) =>\n /^[\\w$#@]/u.test(token) || /[\\w$]$/u.test(token);\n\ntype ScanState = { depth: number; templates: number[] };\nconst LAST = -1;\n\n/* One token's canonical text. `state` tracks the brace depth at each open\n * `${` of a template literal, so the `}` that closes it is rescanned as the\n * template's continuation rather than read as a brace and stray text. */\nconst tokenText = (\n scanner: ts.Scanner,\n scanned: ts.SyntaxKind,\n state: ScanState,\n) => {\n const closesTemplate =\n scanned === ts.SyntaxKind.CloseBraceToken &&\n state.templates.at(LAST) === state.depth;\n const token = closesTemplate ? scanner.reScanTemplateToken(false) : scanned;\n if (closesTemplate && token === ts.SyntaxKind.TemplateTail)\n state.templates.pop();\n if (closesTemplate) return scanner.getTokenText();\n if (token === ts.SyntaxKind.StringLiteral)\n return JSON.stringify(scanner.getTokenValue());\n if (token === ts.SyntaxKind.TemplateHead) state.templates.push(state.depth);\n if (token === ts.SyntaxKind.OpenBraceToken) state.depth += 1;\n if (token === ts.SyntaxKind.CloseBraceToken) state.depth -= 1;\n\n return scanner.getTokenText();\n};\n\nconst canonical = (text: string) => {\n const scanner = ts.createScanner(\n ts.ScriptTarget.Latest,\n true,\n ts.LanguageVariant.Standard,\n text,\n );\n const state: ScanState = { depth: 0, templates: [] };\n const tokens: string[] = [];\n for (\n let token = scanner.scan();\n token !== ts.SyntaxKind.EndOfFileToken;\n token = scanner.scan()\n ) {\n const value = tokenText(scanner, token, state);\n if (CLOSERS.has(value) && tokens.at(LAST) === \",\") tokens.pop();\n tokens.push(value);\n }\n\n return tokens.reduce(\n (joined, token, index) =>\n index > 0 && wordy(tokens[index - 1] ?? \"\") && wordy(token)\n ? `${joined} ${token}`\n : `${joined}${token}`,\n \"\",\n );\n};\n\n/**\n * Where a relative specifier lands among a package's files.\n *\n * A declaration file names its neighbours the way source does -- `./read` --\n * and the file is `read.d.ts`, or `read/index.d.ts`, or the `.mts` spelling of\n * either.\n */\nconst resolveFrom = (\n files: ReadonlyMap<string, string>,\n from: string,\n specifier: string,\n) => {\n if (!specifier.startsWith(\".\")) return undefined;\n const base = path.posix.join(path.posix.dirname(from), specifier);\n const candidates = [\n base,\n `${base.replace(/\\.js$/u, \"\")}.d.ts`,\n `${base.replace(/\\.js$/u, \"\")}.d.mts`,\n `${base.replace(/\\.js$/u, \"\")}.d.cts`,\n `${base}/index.d.ts`,\n `${base}/index.d.mts`,\n `${base}/index.d.cts`,\n ];\n\n return candidates.find((candidate) => files.has(candidate));\n};\n\nconst declaredNameOf = (statement: ts.Statement) => {\n if (\n ts.isFunctionDeclaration(statement) ||\n ts.isClassDeclaration(statement) ||\n ts.isInterfaceDeclaration(statement) ||\n ts.isTypeAliasDeclaration(statement) ||\n ts.isEnumDeclaration(statement) ||\n ts.isModuleDeclaration(statement)\n )\n return statement.name !== undefined && ts.isIdentifier(statement.name)\n ? statement.name.text\n : undefined;\n\n return undefined;\n};\n\nconst isExported = (statement: ts.Statement) =>\n ts.canHaveModifiers(statement) &&\n ts\n .getModifiers(statement)\n ?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ===\n true;\n\nconst variableNamesOf = (statement: ts.VariableStatement) =>\n statement.declarationList.declarations\n .map((declaration) => declaration.name)\n .filter((name) => ts.isIdentifier(name))\n .map((name) => name.text);\n\n/** Everything a module declares, exported or not, so `export { a }` can find\n * what `a` is. */\nconst declarationsIn = (file: ts.SourceFile) => {\n const found = new Map<string, string>();\n for (const statement of file.statements) {\n const text = normalize(statement.getText(file));\n const named = declaredNameOf(statement);\n if (named !== undefined) found.set(named, text);\n if (!ts.isVariableStatement(statement)) continue;\n for (const name of variableNamesOf(statement)) found.set(name, text);\n }\n\n return found;\n};\n\n/** Whether a manifest claims to ship types at all. A package that ships none\n * has no promise of this kind to check; one that claims some and has none is\n * a package about to publish types it did not build. */\nexport const declaresTypes = (manifest: unknown) => {\n if (typeof manifest !== \"object\" || manifest === null) return false;\n const record = new Map(Object.entries(manifest));\n if (typeof record.get(\"types\") === \"string\") return true;\n if (typeof record.get(\"typings\") === \"string\") return true;\n\n return JSON.stringify(record.get(\"exports\") ?? {}).includes('\"types\"');\n};\n\n/** What one statement of a declaration file contributes to its module's\n * exports. Split out so the walk over a file is one loop rather than three\n * levels of them. */\nconst contributionOf = (input: {\n file: ts.SourceFile;\n files: ReadonlyMap<string, string>;\n from: string;\n local: ReadonlyMap<string, string>;\n seen: ReadonlySet<string>;\n statement: ts.Statement;\n}) => {\n const { file, files, from, local, seen, statement } = input;\n const nothing: ReadonlyArray<readonly [string, string]> = [];\n // `export default x` and `export = x`.\n if (ts.isExportAssignment(statement))\n return [\n [\n statement.isExportEquals === true ? \"export=\" : \"default\",\n normalize(statement.getText(file)),\n ] as const,\n ];\n const named = declaredNameOf(statement);\n if (named !== undefined && isExported(statement))\n return [\n [named, local.get(named) ?? normalize(statement.getText(file))] as const,\n ];\n if (ts.isVariableStatement(statement) && isExported(statement)) {\n const text = normalize(statement.getText(file));\n\n return variableNamesOf(statement).map((name) => [name, text] as const);\n }\n if (!ts.isExportDeclaration(statement)) return nothing;\n const specifier =\n statement.moduleSpecifier !== undefined &&\n ts.isStringLiteral(statement.moduleSpecifier)\n ? statement.moduleSpecifier.text\n : undefined;\n const target =\n specifier === undefined ? undefined : resolveFrom(files, from, specifier);\n /* A re-export of a package we do not have the files for -- a dependency --\n * contributes names we cannot describe. They are still exports, so they are\n * recorded as such rather than dropped. */\n const theirs =\n target === undefined\n ? new Map<string, string>()\n : exportsOf(files, target, new Set(seen));\n const clause = statement.exportClause;\n // `export * from './m'` -- everything but the default.\n if (clause === undefined)\n return [...theirs].filter(\n ([name]) => name !== \"default\" && name !== \"export=\",\n );\n if (ts.isNamespaceExport(clause))\n return [[clause.name.text, `export * as ${clause.name.text}`] as const];\n\n return clause.elements.map((element) => {\n const sourceName = (element.propertyName ?? element.name).text;\n const text =\n (specifier === undefined\n ? local.get(sourceName)\n : theirs.get(sourceName)) ?? `export { ${sourceName} }`;\n\n return [element.name.text, text] as const;\n });\n};\n\n/**\n * The names a module exports, following re-exports to where they are declared.\n *\n * `seen` is the cycle guard: a package whose entry point re-exports a module\n * that re-exports the entry point is unusual and not impossible, and reading\n * it must terminate.\n */\nconst exportsOf = (\n files: ReadonlyMap<string, string>,\n from: string,\n seen: Set<string>,\n) => {\n const surface: ModuleExports = new Map();\n const source = files.get(from);\n if (source === undefined || seen.has(from)) return surface;\n seen.add(from);\n const file = parse(source, from);\n const local = declarationsIn(file);\n const contributed = file.statements.flatMap((statement) =>\n contributionOf({ file, files, from, local, seen, statement }),\n );\n for (const [name, text] of contributed) surface.set(name, text);\n\n return surface;\n};\n\n/** The surface of a package tarball, already gunzipped. */\nexport const surfaceOfArchive = (archive: Uint8Array) => {\n const held = readTar(\n archive,\n (name) => DECLARATION.test(name) || name === \"package.json\",\n );\n const files = new Map(\n [...held].map(([name, bytes]) => [name, asText(bytes)] as const),\n );\n const manifest = files.get(\"package.json\");\n let parsed: unknown;\n try {\n parsed = manifest === undefined ? undefined : JSON.parse(manifest);\n } catch {\n parsed = undefined;\n }\n const entries = typeEntriesOf(parsed, files);\n\n return entries.length === 0 ? undefined : surfaceOfFiles(files, entries);\n};\n\n/**\n * The public surface of a package: what its entry points export, and what\n * each of those names is declared as.\n */\nexport const surfaceOfFiles = (\n files: ReadonlyMap<string, string>,\n entries: readonly TypeEntry[],\n) => {\n const surface: PackageSurface = new Map();\n /* A name offered by two entry points is one name with two ways in. The\n * declaration is whichever was read first -- they agree in every case that\n * is not already a bug in the package -- and both specifiers are kept,\n * because losing one of them is a break for everybody importing through\n * it. */\n const offered = entries.flatMap((entry) =>\n [...exportsOf(files, entry.path, new Set())].map(\n ([name, declaration]) =>\n ({ declaration, name, specifier: entry.specifier }) as const,\n ),\n );\n for (const { declaration, name, specifier } of offered) {\n const known = surface.get(name);\n if (known === undefined)\n surface.set(name, { declaration, entries: [specifier] });\n else if (!known.entries.includes(specifier)) known.entries.push(specifier);\n }\n for (const value of surface.values()) value.entries.sort();\n\n return surface;\n};\n\n/**\n * Every candidate declaration file in an exports map, paired with the\n * specifier it would be imported by.\n *\n * The subpath matters: an export that leaves `@pkg` and stays on\n * `@pkg/server` is gone for everybody importing it from the root, and a\n * surface that knows only names cannot see that at all.\n */\nconst exportEntries = (\n value: unknown,\n packageName: string,\n specifier?: string,\n): Array<{ specifier: string; value: unknown }> => {\n const here = specifier ?? packageName;\n if (typeof value === \"string\") return [{ specifier: here, value }];\n if (typeof value !== \"object\" || value === null) return [];\n\n return Object.entries(value).flatMap(([key, nested]) =>\n key.startsWith(\".\")\n ? exportEntries(\n nested,\n packageName,\n key === \".\" ? packageName : `${packageName}${key.slice(1)}`,\n )\n : exportEntries(nested, packageName, here),\n );\n};\n\n/** The declaration files a manifest points at, with the specifier each one is\n * imported by. */\nexport const typeEntriesOf = (\n manifest: unknown,\n files: ReadonlyMap<string, string>,\n) => {\n const record =\n typeof manifest === \"object\" && manifest !== null\n ? new Map(Object.entries(manifest))\n : new Map<string, unknown>();\n const named = record.get(\"name\");\n const packageName = typeof named === \"string\" ? named : \"\";\n const resolved = (value: unknown, specifier: string) => {\n if (typeof value !== \"string\") return [];\n const cleaned = value.replace(/^\\.\\//u, \"\");\n const candidates = DECLARATION.test(cleaned)\n ? [cleaned]\n : [\n cleaned.replace(/\\.[cm]?js$/u, \".d.ts\"),\n cleaned.replace(/\\.[cm]?js$/u, \".d.mts\"),\n cleaned.replace(/\\.[cm]?js$/u, \".d.cts\"),\n ];\n\n return candidates\n .filter((candidate) => files.has(candidate))\n .map((resolvedPath) => ({ path: resolvedPath, specifier }));\n };\n const found = [\n ...resolved(record.get(\"types\"), packageName),\n ...resolved(record.get(\"typings\"), packageName),\n ...exportEntries(record.get(\"exports\"), packageName).flatMap((entry) =>\n resolved(entry.value, entry.specifier),\n ),\n ];\n /* Nothing declared, or nothing that resolved. `dist/index.d.ts` is where\n * every package in this ecosystem puts it; a package that declares types\n * and has none is one the gate refuses rather than passes. */\n const fallback =\n found.length === 0 && files.has(\"dist/index.d.ts\")\n ? [{ path: \"dist/index.d.ts\", specifier: packageName }]\n : [];\n const seen = new Set<string>();\n\n return [...found, ...fallback].filter((entry) => {\n const key = `${entry.specifier}\\u0000${entry.path}`;\n if (seen.has(key)) return false;\n seen.add(key);\n\n return true;\n });\n};\n\n/*\n * How much of a change a change is.\n *\n * Two declarations differing is not the same as a caller having to do\n * anything. Generated types carry inference all the way down, so a version\n * bump can move the innards of a return type -- `store: {}` becoming\n * `store: {} | {}` -- while everything anybody wrote at the call site is\n * exactly as valid as it was.\n *\n * This is information, not a filter, and the difference matters. The release\n * gate reports every change and lets the shape describe it, because the person\n * who made the change knows what they did and writing one line is cheap. A\n * consumer's upgrade advisor leans on the shape to sort sixty inference\n * wobbles behind the two things that will actually break them. Using it as a\n * filter in both places is how a constructor gaining a required argument went\n * unreported.\n */\nconst SHAPE = {\n members: \"members\",\n parameters: \"parameters\",\n types: \"types\",\n unknown: \"unknown\",\n} as const;\n\nexport type ChangeShape = (typeof SHAPE)[keyof typeof SHAPE];\n\n/** A name a file only passes along: it says the export exists and nothing\n * about what it is. */\nconst isStub = (declaration: string) => /^export\\s*\\{/u.test(declaration);\n\nconst signatureOf = (declaration: string) => {\n const file = parse(`${declaration}\\n`, \"declaration.d.ts\");\n const [statement] = file.statements;\n if (statement === undefined) return undefined;\n\n return statement;\n};\n\n/** What a caller passes, as text, for every declaration that takes anything. */\nconst parametersOf = (declaration: string) => {\n const statement = signatureOf(declaration);\n if (statement === undefined) return \"\";\n const found: string[] = [];\n const visit = (node: ts.Node) => {\n if (\n ts.isFunctionTypeNode(node) ||\n ts.isFunctionDeclaration(node) ||\n ts.isMethodSignature(node) ||\n ts.isMethodDeclaration(node) ||\n ts.isConstructSignatureDeclaration(node) ||\n ts.isConstructorDeclaration(node)\n )\n found.push(\n node.parameters\n .map((parameter) => canonical(parameter.getText()))\n .join(\", \"),\n );\n ts.forEachChild(node, visit);\n };\n visit(statement);\n\n return found.join(\" | \");\n};\n\n/** What a caller reaches for. */\nconst membersOf = (declaration: string) => {\n const statement = signatureOf(declaration);\n const members = new Set<string>();\n if (statement === undefined) return members;\n const visit = (node: ts.Node) => {\n if (\n (ts.isPropertySignature(node) ||\n ts.isMethodSignature(node) ||\n ts.isPropertyDeclaration(node) ||\n ts.isMethodDeclaration(node) ||\n ts.isEnumMember(node)) &&\n node.name !== undefined &&\n (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name))\n )\n members.add(node.name.text);\n ts.forEachChild(node, visit);\n };\n visit(statement);\n\n return members;\n};\n\nconst sameNames = (left: ReadonlySet<string>, right: ReadonlySet<string>) =>\n left.size === right.size && [...left].every((name) => right.has(name));\n\nexport const changeShape = (change: { after: string; before: string }) => {\n /* One side is a re-export and the other is the declaration behind it. That\n * is this reader finding the name in a different file, not the package\n * changing anything. */\n if (isStub(change.before) !== isStub(change.after)) return SHAPE.unknown;\n if (parametersOf(change.before) !== parametersOf(change.after))\n return SHAPE.parameters;\n if (!sameNames(membersOf(change.before), membersOf(change.after)))\n return SHAPE.members;\n\n return SHAPE.types;\n};\n\nexport type SurfaceChange = {\n after: string;\n before: string;\n name: string;\n shape: ChangeShape;\n};\n\n/** A name that is still exported, but not from every entry point it was. */\nexport type Withdrawal = { from: string[]; name: string };\n\nexport type SurfaceDiff = {\n added: string[];\n changed: SurfaceChange[];\n removed: string[];\n withdrawn: Withdrawal[];\n};\n\n/**\n * What moved between two surfaces.\n *\n * Removed is the one that breaks a build outright. Changed is the one that\n * may: a widened parameter is not a break and a narrowed one is, and telling\n * them apart is a job for whoever reads the two declarations -- so both are\n * carried rather than judged here.\n */\nexport const diffSurface = (\n before: PackageSurface,\n after: PackageSurface,\n): SurfaceDiff => {\n const removed: string[] = [];\n const withdrawn: Withdrawal[] = [];\n const changed: SurfaceChange[] = [];\n for (const [name, was] of before) {\n const now = after.get(name);\n if (now === undefined) removed.push(name);\n if (now === undefined) continue;\n /* Still exported, and not from everywhere it was. An export that leaves\n * `@pkg` and stays on `@pkg/server` is gone for everybody importing it\n * from the root -- which a surface keyed only by name cannot see, and\n * which this package has a migration kind for. */\n const lost = was.entries.filter((entry) => !now.entries.includes(entry));\n if (lost.length > 0) withdrawn.push({ from: lost, name });\n if (canonical(now.declaration) !== canonical(was.declaration))\n changed.push({\n after: now.declaration,\n before: was.declaration,\n name,\n shape: changeShape({\n after: now.declaration,\n before: was.declaration,\n }),\n });\n }\n\n return {\n added: [...after.keys()].filter((name) => !before.has(name)),\n changed,\n removed,\n withdrawn,\n };\n};\n\n/**\n * The changes a consumer would notice, for an advisor deciding what to put in\n * front of somebody.\n *\n * Not for the gate: `types` changes are still changes, and the package that\n * made one is the party that can say in one line whether it matters.\n */\nexport const notable = (diff: SurfaceDiff) =>\n diff.changed.filter(\n (change) => change.shape === \"parameters\" || change.shape === \"members\",\n );\n",
|
|
11
11
|
"/*\n * Reading a package tarball.\n *\n * A published package is a gzipped tar and two things inside it are worth\n * having: the declaration files, which say what the package promises, and\n * `changelog.json`, which says what it changed. Both are read the same way, so\n * the reader is one function and neither caller carries an archive library.\n *\n * A tar is fixed-size headers each followed by their file's bytes, padded up\n * to the block size. Anything that is not a plain file is skipped by its\n * recorded length, which is what makes directories, symlinks and pax headers\n * harmless rather than special.\n */\n\nconst TAR_BLOCK = 512;\nconst NAME_LENGTH = 100;\nconst SIZE_OFFSET = 124;\nconst SIZE_LENGTH = 12;\nconst TYPE_OFFSET = 156;\nconst PREFIX_OFFSET = 345;\nconst PREFIX_LENGTH = 155;\nconst OCTAL = 8;\n\nexport type TarLimits = {\n /** Past this, a file is not something we are going to learn from. */\n maxFileBytes?: number;\n /** The whole archive's worth of kept files. A tarball from a registry is\n * a stranger's bytes; it does not get to decide how much memory we\n * spend on it. */\n maxTotalBytes?: number;\n};\n\nconst KIBIBYTE = 1024;\nconst MEBIBYTE = KIBIBYTE * KIBIBYTE;\nconst DEFAULT_FILE_MEBIBYTES = 4;\nconst DEFAULT_TOTAL_MEBIBYTES = 64;\nconst DEFAULT_FILE_BYTES = DEFAULT_FILE_MEBIBYTES * MEBIBYTE;\nconst DEFAULT_TOTAL_BYTES = DEFAULT_TOTAL_MEBIBYTES * MEBIBYTE;\n\nconst decoder = new TextDecoder();\n\nconst cString = (bytes: Uint8Array) => {\n const end = bytes.indexOf(0);\n\n return decoder.decode(end < 0 ? bytes : bytes.subarray(0, end)).trim();\n};\n\nexport const asText = (bytes: Uint8Array) => decoder.decode(bytes);\n/**\n * The files an archive holds, by path, with the `package/` prefix npm wraps\n * everything in removed.\n *\n * `keep` decides what is worth reading before it is read, so an archive of\n * five hundred files costs the memory of the four that were asked for.\n */\nexport const readTar = (\n archive: Uint8Array,\n keep: (path: string) => boolean,\n limits: TarLimits = {},\n) => {\n const maxFile = limits.maxFileBytes ?? DEFAULT_FILE_BYTES;\n const maxTotal = limits.maxTotalBytes ?? DEFAULT_TOTAL_BYTES;\n const files = new Map<string, Uint8Array>();\n let offset = 0;\n let total = 0;\n while (offset + TAR_BLOCK <= archive.length) {\n const header = archive.subarray(offset, offset + TAR_BLOCK);\n const name = cString(header.subarray(0, NAME_LENGTH));\n // Two zero blocks end an archive; one empty name is enough to stop.\n if (name === \"\") break;\n const prefix = cString(\n header.subarray(PREFIX_OFFSET, PREFIX_OFFSET + PREFIX_LENGTH),\n );\n const size = Number.parseInt(\n cString(header.subarray(SIZE_OFFSET, SIZE_OFFSET + SIZE_LENGTH)),\n OCTAL,\n );\n if (!Number.isSafeInteger(size) || size < 0) break;\n const kind = String.fromCharCode(header[TYPE_OFFSET] ?? 0);\n const start = offset + TAR_BLOCK;\n const path = (prefix === \"\" ? name : `${prefix}/${name}`).replace(\n /^package\\//u,\n \"\",\n );\n const plain = kind === \"0\" || kind === \"\\0\";\n const wanted = plain && size <= maxFile && keep(path);\n total += wanted ? size : 0;\n if (total > maxTotal) break;\n if (wanted) files.set(path, archive.subarray(start, start + size));\n offset = start + Math.ceil(size / TAR_BLOCK) * TAR_BLOCK;\n }\n\n return files;\n};\n",
|
|
12
12
|
"import { readFile, writeFile } from \"node:fs/promises\";\n\n/*\n * Writing somebody else's JSON back.\n *\n * A tool that reformats a file to change two lines has changed every line, and\n * every reviewer of that diff now has to read a hundred and forty of them to\n * find the two. The indentation a file already uses is part of the file, and\n * the packages this runs across do not agree on it.\n */\n\n/** What this file indents with: a tab, or however many spaces it uses. */\nexport const indentOf = (source: string) => {\n const found = /\\n([\\t ]+)\\S/u.exec(source)?.[1];\n\n return found === undefined || found === \"\" ? \"\\t\" : found;\n};\n\n/** Rewrite a JSON file, keeping the indentation it already had. */\nexport const writeJsonLike = async (path: string, document: unknown) => {\n const source = await readFile(path, \"utf8\").catch(() => \"\");\n await writeFile(\n path,\n `${JSON.stringify(document, null, indentOf(source))}\\n`,\n );\n};\n",
|
|
13
13
|
"import type { SurfaceChange, SurfaceDiff } from \"./surface\";\nimport { isDisruptive, type Change, type DisruptiveChange } from \"./types\";\n\n/*\n * Checking what a release says against what it did.\n *\n * A changelog is a promise about a package, and the package is right there to\n * check it against. Every release this runs at the gate: the exports that\n * disappeared or changed shape, against the exports the entries name. A\n * mismatch either way is worth stopping for.\n *\n * This is the part that makes the whole thing hold. Changelogs rot because\n * writing them is a discipline and discipline is what gives out at 6pm on a\n * Friday. Nothing here asks anybody to remember: forget an entry and the\n * release does not go out.\n */\n\nexport type Unannounced = {\n /** Which entry points stopped offering it, for a withdrawal. */\n from?: string[];\n /** Gone entirely, gone from an entry point, or what about its declaration\n * moved. */\n kind: \"removed\" | \"withdrawn\" | \"parameters\" | \"members\" | \"types\";\n name: string;\n};\n\nexport type Reconciliation = {\n /** Entries whose migration does not describe what the package did. */\n wrongMigrations: string[];\n /** Exports that moved with nothing written about them. */\n unannounced: Unannounced[];\n /** Names entries claim that this package has never exported. A typo, or\n * an entry left behind by a rename three releases ago. */\n unknownSymbols: string[];\n};\n\n/**\n * Whether a migration describes what actually happened.\n *\n * This is what makes a migration worth applying. An entry saying `start` is\n * now `listen` is a promise that a project rewriting `start` to `listen`\n * still compiles -- and the types of the version being published say whether\n * that is true. A rename whose destination does not exist, or whose source is\n * still exported, is not a rename; it is a sentence.\n *\n * Every one of these has been somebody's afternoon: the entry written from\n * memory a week after the change, the rename that was really two renames, the\n * typo in the name nobody reads because it is in a changelog.\n */\nconst migrationHolds = (input: {\n after: ReadonlySet<string>;\n change: DisruptiveChange;\n subpaths: ReadonlySet<string>;\n}) => {\n const { after, change, subpaths } = input;\n const wrong: string[] = [];\n const { migration } = change;\n if (\"rename\" in migration) {\n const { from } = migration.rename;\n const into = migration.rename.to;\n if (!after.has(into))\n wrong.push(\n `\\`${change.summary}\\` renames to \\`${into}\\`, which this version does not export`,\n );\n if (after.has(from))\n wrong.push(\n `\\`${change.summary}\\` renames \\`${from}\\` away, but this version still exports it`,\n );\n if (!change.symbols.includes(from))\n wrong.push(\n `\\`${change.summary}\\` renames \\`${from}\\`, which is not in its own symbols`,\n );\n }\n if (\"moved\" in migration) {\n const { symbol } = migration.moved;\n const into = migration.moved.to;\n if (!after.has(symbol))\n wrong.push(\n `\\`${change.summary}\\` moves \\`${symbol}\\`, which this version does not export`,\n );\n if (subpaths.size > 0 && !subpaths.has(into))\n wrong.push(\n `\\`${change.summary}\\` moves \\`${symbol}\\` to \\`${into}\\`, which is not an entry point of this package`,\n );\n }\n if (\n \"resubpath\" in migration &&\n subpaths.size > 0 &&\n !subpaths.has(migration.resubpath.to)\n )\n wrong.push(\n `\\`${change.summary}\\` points at \\`${migration.resubpath.to}\\`, which is not an entry point of this package`,\n );\n /* Gone means gone. An entry claiming a removal that did not happen sends\n * everybody who reads it looking for work that is not there. */\n if (change.kind === \"removed\")\n for (const symbol of change.symbols)\n if (after.has(symbol))\n wrong.push(\n `\\`${change.summary}\\` says \\`${symbol}\\` was removed, but this version still exports it`,\n );\n\n return wrong;\n};\n\n/** What to print when it fails, in the order somebody fixes them. */\nexport const describeReconciliation = (found: Reconciliation) => {\n const lines: string[] = [];\n const moved: Record<Unannounced[\"kind\"], string> = {\n members: \"changed the members of its type\",\n parameters: \"changed what it is called with\",\n removed: \"is no longer exported\",\n types: \"changed its declaration\",\n withdrawn: \"is no longer exported from\",\n };\n for (const entry of found.unannounced)\n lines.push(\n entry.kind === \"withdrawn\"\n ? `\\`${entry.name}\\` ${moved.withdrawn} ${(entry.from ?? []).join(\", \")} and no entry says so`\n : `\\`${entry.name}\\` ${moved[entry.kind]} and no entry says so`,\n );\n for (const name of found.unknownSymbols)\n lines.push(\n `an entry names \\`${name}\\`, which this package does not export`,\n );\n lines.push(...found.wrongMigrations);\n\n return lines;\n};\n\nexport const reconcile = (input: {\n /** Every entry that speaks for the versions being compared: the ones\n * waiting for a release, and the ones a release already consumed but the\n * registry has not seen yet. */\n changes: readonly Change[];\n diff: SurfaceDiff;\n /** Every name the package exported before or after, for catching entries\n * that name something that was never there. */\n known: ReadonlySet<string>;\n /** What the package exports now, for checking that a migration describes\n * what it says it describes. */\n after?: ReadonlySet<string>;\n /** The package's entry points, so a migration cannot point at one that is\n * not there. Empty means \"not known\", and the check is skipped. */\n subpaths?: ReadonlySet<string>;\n}): Reconciliation => {\n /* Two standards, because the two cases are not the same shape of mistake.\n *\n * An export that is gone is never additive, so only a `breaking` or\n * `removed` entry accounts for it -- a `fixed` entry naming the same symbol\n * is somebody describing a different thing.\n *\n * A declaration whose parameters or members moved may well be additive: an\n * optional argument, a new field on a returned object. Insisting those be\n * filed as breaking would push people to mislabel them, and a changelog\n * that cries breaking is one whose consumers stop reading it -- which costs\n * more than the check is worth. Any entry naming the symbol accounts for\n * one; what the check is really asking is whether anybody wrote it down.\n */\n const disruptive = new Set(\n input.changes.filter(isDisruptive).flatMap((change) => [...change.symbols]),\n );\n const mentioned = new Set(\n input.changes.flatMap((change) => [...(change.symbols ?? [])]),\n );\n /* Every declaration that moved, not only the two shapes a consumer's\n * advisor bothers them about. A constructor gaining a required argument, an\n * interface member changing type, a union losing a case, a return type\n * narrowing -- all of them are breaking, none of them changes a top-level\n * parameter list or a member name, and all of them used to pass without an\n * entry. The package that made the change is the one party who can say in\n * one line whether it matters. */\n const unannounced: Unannounced[] = [\n ...input.diff.removed\n .filter((name) => !disruptive.has(name))\n .map((name) => ({ kind: \"removed\", name }) as const),\n /* Still exported, from fewer places. Never additive, so it wants the same\n * kind of entry a removal does. */\n ...input.diff.withdrawn\n .filter((entry) => !disruptive.has(entry.name))\n .map(\n (entry) =>\n ({ from: entry.from, kind: \"withdrawn\", name: entry.name }) as const,\n ),\n ...input.diff.changed\n .filter(\n (change): change is SurfaceChange & { shape: Unannounced[\"kind\"] } =>\n !mentioned.has(change.name) && change.shape !== \"unknown\",\n )\n .map((change) => ({ kind: change.shape, name: change.name })),\n ];\n const unknownSymbols = [\n ...new Set(\n input.changes\n .flatMap((change) => [...(change.symbols ?? [])])\n .filter((name) => !input.known.has(name)),\n ),\n ];\n const { after } = input;\n const wrongMigrations =\n after === undefined\n ? []\n : input.changes.filter(isDisruptive).flatMap((change) =>\n migrationHolds({\n after,\n change,\n subpaths: input.subpaths ?? new Set(),\n }),\n );\n\n return { unannounced, unknownSymbols, wrongMigrations };\n};\n",
|
|
14
14
|
"import { gunzipSync } from \"node:zlib\";\nimport { parseChangelog } from \"./read\";\nimport { surfaceOfArchive } from \"./surface\";\nimport { asText, readTar } from \"./tarball\";\nimport { CHANGELOG_FILE } from \"./types\";\n\n/*\n * What the registry can tell us about a package.\n *\n * Two documents and no more: the abbreviated packument, which says which\n * versions exist and where their tarballs are, and the tarballs themselves,\n * which hold the types and the changelog.\n *\n * The abbreviated form is asked for by name. The full packument for a package\n * that publishes daily is tens of megabytes of README and maintainer history\n * for the two fields below.\n */\n\nconst ABBREVIATED = \"application/vnd.npm.install-v1+json\";\nconst DEFAULT_REGISTRY = \"https://registry.npmjs.org\";\nconst KIBIBYTE = 1024;\nconst MEBIBYTE = KIBIBYTE * KIBIBYTE;\n/** A published package past this is not one anybody is upgrading through a\n * changelog, and the bytes are a stranger's. */\nconst MAX_ARCHIVE_MEBIBYTES = 96;\nconst MAX_ARCHIVE_BYTES = MAX_ARCHIVE_MEBIBYTES * MEBIBYTE;\nconst MAX_DOWNLOAD_MEBIBYTES = 32;\nconst MAX_DOWNLOAD_BYTES = MAX_DOWNLOAD_MEBIBYTES * MEBIBYTE;\n/** Long enough for a slow registry, short enough that a hung connection does\n * not hold a release open. */\nexport type PackageVersions = {\n latest?: string;\n published: string[];\n tarballs: Record<string, string>;\n};\n\nconst TIMEOUT_MS = 20_000;\nconst NOT_FOUND = 404;\n\n/** The registry answered, and the answer is that this name has nothing on it\n * -- which a first release is, and an outage is not. */\nconst NOTHING_PUBLISHED: PackageVersions = { published: [], tarballs: {} };\n\n/** npm's own grammar, near enough: no path segments, no traversal. A name\n * from a customer's manifest reaches this, and `@scope/../../thing`\n * normalises to somebody else's package. */\nconst PACKAGE_NAME = /^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/u;\n\n/** npm's own limit. */\nconst MAX_NAME_LENGTH = 214;\n\nexport const isPackageName = (name: string) =>\n name.length <= MAX_NAME_LENGTH && PACKAGE_NAME.test(name);\n\nexport type RegistryOptions = {\n fetch?: typeof fetch;\n /** For a private registry, or a test. */\n registry?: string;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null;\n\nconst readPackument = (body: unknown): PackageVersions | undefined => {\n if (!isRecord(body) || !isRecord(body.versions)) return undefined;\n const tarballs: Record<string, string> = {};\n for (const [version, entry] of Object.entries(body.versions)) {\n if (!isRecord(entry) || !isRecord(entry.dist)) continue;\n const { tarball } = entry.dist;\n if (typeof tarball === \"string\") tarballs[version] = tarball;\n }\n const tags = body[\"dist-tags\"];\n const latest = isRecord(tags) ? tags.latest : undefined;\n\n return {\n ...(typeof latest === \"string\" ? { latest } : {}),\n published: Object.keys(body.versions),\n tarballs,\n };\n};\n\n/** One version's tarball, gunzipped. */\n/**\n * One version's tarball, gunzipped.\n *\n * A failure is not remembered. Callers cache the promise this returns, and a\n * transient 503 stored as \"there is no archive\" sticks for the life of the\n * process -- the registry recovers and the answer does not.\n */\nexport const packageArchive = async (\n name: string,\n version: string,\n options: RegistryOptions = {},\n) => {\n const call = options.fetch ?? fetch;\n const versions = await packageVersions(name, options);\n const url = versions?.tarballs[version];\n if (url === undefined) return undefined;\n try {\n const response = await call(url, {\n signal: AbortSignal.timeout(TIMEOUT_MS),\n });\n if (!response.ok) return undefined;\n const compressed = new Uint8Array(await response.arrayBuffer());\n /* Both ends bounded. Half a megabyte of gzip expands to half a gigabyte\n * if you let it, and the thing doing the expanding here is a control\n * plane holding other people's secrets. */\n if (compressed.byteLength > MAX_DOWNLOAD_BYTES) return undefined;\n\n return new Uint8Array(\n gunzipSync(compressed, { maxOutputLength: MAX_ARCHIVE_BYTES }),\n );\n } catch {\n return undefined;\n }\n};\n/**\n * Every version published under a name, or nothing when the registry could not\n * say.\n *\n * Nothing is not an error to throw: a caller deciding what to offer somebody\n * can say \"we could not check\", and that is a better answer than a failed\n * page.\n */\nconst packuments = new Map<\n string,\n { asked: number; value: Promise<PackageVersions | undefined> }\n>();\n\n/** Long enough that a page asking about twenty packages asks once each, short\n * enough that a release published while somebody reads is offered to them. */\nconst SECONDS_PER_MINUTE = 60;\nconst MILLISECONDS_PER_SECOND = 1000;\nconst PACKUMENT_MINUTES = 5;\nconst PACKUMENT_TTL_MS =\n PACKUMENT_MINUTES * SECONDS_PER_MINUTE * MILLISECONDS_PER_SECOND;\n\n/** Forget what the registry said, for a test that means to say it again. */\nexport const forgetRegistry = () => packuments.clear();\n\nexport const packageVersions = async (\n name: string,\n options: RegistryOptions = {},\n) => {\n if (!isPackageName(name)) return undefined;\n /* Cached, because the alternative is what the consumer of this library was\n * doing: one request per package per page load, from a control plane, to\n * somebody else's registry, for an answer that changes daily.\n *\n * Only when nobody passed their own `fetch` -- a caller with a fetch double\n * means to control the answers, and a cache shared with the real registry\n * would hand them somebody else's. */\n const cacheable =\n options.fetch === undefined && options.registry === undefined;\n const known = cacheable ? packuments.get(name) : undefined;\n if (known !== undefined && Date.now() - known.asked < PACKUMENT_TTL_MS)\n return known.value;\n const value = askRegistry(name, options);\n if (cacheable) packuments.set(name, { asked: Date.now(), value });\n\n return value;\n};\n\nconst askRegistry = async (name: string, options: RegistryOptions) => {\n const call = options.fetch ?? fetch;\n const url = `${options.registry ?? DEFAULT_REGISTRY}/${name.replace(\"/\", \"%2f\")}`;\n try {\n const abbreviated = await call(url, {\n headers: { accept: ABBREVIATED },\n signal: AbortSignal.timeout(TIMEOUT_MS),\n });\n /* A package published minutes ago answers the full document and 404s the\n * abbreviated one -- the registry builds that form on its own schedule.\n * Taking the 404 at face value says \"no such package\" about a package\n * that is right there, which is a confusing few minutes for whoever just\n * published it. */\n const response = abbreviated.ok\n ? abbreviated\n : await call(url, { signal: AbortSignal.timeout(TIMEOUT_MS) });\n if (response.ok) return readPackument(await response.json());\n\n /* A definite 404 is an answer: this name has never been published. That\n * is not the same as the registry being unreachable, and a caller that\n * cannot tell them apart refuses a package's first release forever. */\n return response.status === NOT_FOUND ? NOTHING_PUBLISHED : undefined;\n } catch {\n return undefined;\n }\n};\n/**\n * A published version's changelog, when it ships one.\n *\n * Nothing is the ordinary answer for a package that has not adopted this yet,\n * and callers are expected to fall back to comparing type surfaces rather than\n * to give up: an unannotated release is still a release somebody has to\n * decide about.\n */\nexport const publishedChangelog = async (\n name: string,\n version: string,\n options: RegistryOptions = {},\n) => {\n const archive = await packageArchive(name, version, options);\n if (!archive) return undefined;\n const file = readTar(archive, (path) => path === CHANGELOG_FILE).get(\n CHANGELOG_FILE,\n );\n if (!file) return undefined;\n try {\n return parseChangelog(JSON.parse(asText(file))).changelog;\n } catch {\n return undefined;\n }\n};\n/** A published version's type surface, for comparing against another. */\nexport const publishedSurface = async (\n name: string,\n version: string,\n options: RegistryOptions = {},\n) => {\n const archive = await packageArchive(name, version, options);\n\n return archive === undefined ? undefined : surfaceOfArchive(archive);\n};\n",
|
|
15
15
|
"import {\n CHANGELOG_CONTRACT,\n isDisruptive,\n type Change,\n type ChangeKind,\n type Changelog,\n type Migration,\n type Release,\n} from \"./types\";\nimport { compareVersions } from \"./versioning\";\n\n/*\n * Writing the two copies.\n *\n * `changelog.json` is the document programs read and the one that ships in the\n * package. `CHANGELOG.md` is the same content for people, generated from it\n * rather than written beside it -- two files kept in step by hand is one file\n * and a lie.\n *\n * Both are produced from the entries, so the markdown is never edited: a\n * change to it is a change to an entry, and the file says so at the top for\n * whoever arrives with a fix.\n */\n\nconst HEADING: Record<ChangeKind, string> = {\n added: \"Added\",\n breaking: \"Breaking\",\n changed: \"Changed\",\n deprecated: \"Deprecated\",\n fixed: \"Fixed\",\n internal: \"Internal\",\n removed: \"Removed\",\n security: \"Security\",\n};\n\n/* Read in the order somebody cares about them: what will cost me an\n * afternoon, then what I can now do, then what stopped being wrong. */\nconst ORDER: readonly ChangeKind[] = [\n \"breaking\",\n \"removed\",\n \"deprecated\",\n \"security\",\n \"added\",\n \"changed\",\n \"fixed\",\n \"internal\",\n];\n\nconst migrationLine = (migration: Migration) => {\n if (\"rename\" in migration)\n return `Rename \\`${migration.rename.from}\\` to \\`${migration.rename.to}\\`.`;\n if (\"moved\" in migration)\n return `Import \\`${migration.moved.symbol}\\` from \\`${migration.moved.to}\\` instead of \\`${migration.moved.from}\\`.`;\n if (\"resubpath\" in migration)\n return `Import from \\`${migration.resubpath.to}\\` instead of \\`${migration.resubpath.from}\\`.`;\n\n return migration.instruction;\n};\n\nconst renderChange = (change: Change) => {\n const symbols =\n change.symbols && change.symbols.length > 0\n ? ` (${change.symbols.map((name) => `\\`${name}\\``).join(\", \")})`\n : \"\";\n const lines = [`- **${change.summary}**${symbols}`];\n if (change.detail !== undefined) lines.push(` ${change.detail}`);\n if (isDisruptive(change)) {\n lines.push(` _Migration:_ ${change.migration.instruction}`);\n const mechanical = migrationLine(change.migration);\n if (mechanical !== change.migration.instruction)\n lines.push(` _Applied automatically:_ ${mechanical}`);\n }\n if (change.reference !== undefined) lines.push(` See ${change.reference}.`);\n\n return lines.join(\"\\n\");\n};\n\nconst renderRelease = (release: Release) => {\n const sections = ORDER.map((kind) => {\n const changes = release.changes.filter((entry) => entry.kind === kind);\n if (changes.length === 0) return null;\n\n return [`### ${HEADING[kind]}`, \"\", ...changes.map(renderChange)].join(\n \"\\n\",\n );\n }).filter((section): section is string => section !== null);\n\n return [\n `## ${release.version} — ${release.date}`,\n ...(release.note === undefined ? [] : [\"\", release.note]),\n \"\",\n sections.join(\"\\n\\n\"),\n ].join(\"\\n\");\n};\n\n/**\n * The line that says this file was generated.\n *\n * Load-bearing: adopting a package reads whatever `CHANGELOG.md` said before\n * and keeps it as history, and on a second adoption the file it generated the\n * first time is what it finds. Without a way to recognise its own output it\n * files that as history and prints the header underneath itself.\n */\nexport const GENERATED_MARKER =\n \"This file is generated by `absolute-changelog`\";\n\nexport type MarkdownOptions = {\n /** Whatever the package's changelog said before it was generated, kept\n * under the releases that came after it. History is not noise. */\n history?: string;\n};\n\n/** The document that ships in the package: stable key order, so a release\n * that changed nothing produces no diff. */\nexport const renderChangelogJson = (changelog: Changelog) =>\n `${JSON.stringify(\n {\n contract: CHANGELOG_CONTRACT,\n name: changelog.name,\n releases: [...changelog.releases]\n .sort((left, right) => compareVersions(right.version, left.version))\n .map((release) => ({\n changes: release.changes.map((change) => ({\n ...(change.detail === undefined ? {} : { detail: change.detail }),\n kind: change.kind,\n ...(isDisruptive(change) ? { migration: change.migration } : {}),\n ...(change.reference === undefined\n ? {}\n : { reference: change.reference }),\n summary: change.summary,\n ...(change.symbols && change.symbols.length > 0\n ? { symbols: change.symbols }\n : {}),\n })),\n date: release.date,\n ...(release.note === undefined ? {} : { note: release.note }),\n version: release.version,\n })),\n },\n null,\n \"\\t\",\n )}\\n`;\nexport const renderMarkdown = (\n changelog: Changelog,\n options: MarkdownOptions = {},\n) => {\n const releases = [...changelog.releases].sort((left, right) =>\n compareVersions(right.version, left.version),\n );\n const head = [\n \"# Changelog\",\n \"\",\n `All notable changes to \\`${changelog.name}\\`.`,\n \"\",\n `${GENERATED_MARKER} from the entries in`,\n \"`changelog/`. Edit an entry, not this file — and add new ones under\",\n \"`changelog/unreleased/`.\",\n ].join(\"\\n\");\n const body = releases.map(renderRelease).join(\"\\n\\n\");\n const tail =\n options.history === undefined || options.history.trim() === \"\"\n ? \"\"\n : [\"---\", \"\", \"## Earlier releases\", \"\", options.history.trim()].join(\n \"\\n\",\n );\n\n return `${[head, body, tail].filter((part) => part !== \"\").join(\"\\n\\n\")}\\n`;\n};\n"
|
|
16
16
|
],
|
|
17
|
-
"mappings": ";;;;AAsBA;AACA;AACA,4BAAgB,4BAAc;AAC9B,iBAAS;;;ACzBT;AACA;AACA;;;ACqBO,IAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKO,IAAM,mBAAmB,CAAC,YAAY,SAAS;AAsI/C,IAAM,qBAAqB;AAG3B,IAAM,iBAAiB;AAGvB,IAAM,qBAAqB;AAI3B,IAAM,uBAAuB;AAE7B,IAAM,eAAe,CAAC,WAC3B,OAAO,SAAS,cAAc,OAAO,SAAS;AAGzC,IAAM,eAAe,CAC1B,cAEA,EAAE,YAAY;;;AChKhB,IAAM,QAAQ;AAEd,IAAM,OAAO;AACb,IAAM,QAAQ;AAEd,IAAM,UACJ;AAEK,IAAM,eAAe,CAAC,YAAoB;AAAA,EAC/C,MAAM,QAAQ,QAAQ,KAAK,QAAQ,KAAK,CAAC;AAAA,EACzC,IAAI,CAAC;AAAA,IAAO;AAAA,EACZ,SAAS,OAAO,OAAO,OAAO,cAAc;AAAA,EAE5C,OAAO;AAAA,IACL,YAAY,eAA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