@absolutejs/changelog 0.1.1 → 0.2.0
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 +21 -0
- package/changelog.json +97 -29
- package/dist/cli.js +133 -32
- package/dist/cli.js.map +9 -8
- package/dist/entries.d.ts +8 -0
- package/dist/index.js +51 -8
- package/dist/index.js.map +6 -6
- package/dist/json.d.ts +4 -0
- package/dist/read.d.ts +1 -1
- package/dist/reconcile.d.ts +11 -0
- package/dist/types.d.ts +41 -9
- package/package.json +3 -2
package/dist/index.js.map
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/types.ts", "../src/apply.ts", "../src/authoring.ts", "../src/entries.ts", "../src/versioning.ts", "../src/read.ts", "../src/tarball.ts", "../src/surface.ts", "../src/reconcile.ts", "../src/registry.ts", "../src/write.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/*\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 =\n /** An export kept its meaning and changed its name. */\n | {\n readonly instruction: string;\n readonly rename: { readonly from:
|
|
5
|
+
"/*\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",
|
|
6
6
|
"import { isMechanical, type Migration } from \"./types\";\n\n/*\n * Doing the migration rather than describing it.\n *\n * Most breaking changes in practice are a rename or a move, and both are\n * mechanical -- which is why the migration types carry them as data. The edit\n * here is the payoff: an upgrade that would have been an afternoon of\n * following a changelog becomes a diff to read.\n *\n * Nothing loaded from a registry runs. A migration is a description, this is\n * the only code that acts on it, and it lives in the tool the developer chose\n * to run. A changelog cannot execute anything.\n *\n * The edits are textual and deliberately conservative. A scanner that skips\n * strings and comments is enough for the shapes that actually occur, and\n * where it cannot be sure it says so instead of guessing: `notes` is how an\n * edit that needs a person's eye leaves with one.\n */\n\nexport type MigrationResult = {\n /** Whether anything in this file changed. */\n changed: boolean;\n /** Anything the reader of the diff should know. */\n notes: string[];\n source: string;\n};\n\ntype ImportStatement = {\n /** The `{ … }` list, or undefined when there is none. */\n clause: string | undefined;\n end: number;\n full: string;\n module: string;\n start: number;\n};\n\n/** `skipEnd` says \"this is code, keep walking\" with a position nothing has. */\nconst IS_CODE = -1;\n\nconst IMPORT =\n /(?:import|export)\\s+(?:type\\s+)?(?<clause>[\\s\\S]*?)\\s*from\\s*(?<quote>['\"])(?<module>[^'\"]+)\\k<quote>/gu;\n\nconst importsOf = (source: string) => {\n const found: ImportStatement[] = [];\n for (const match of source.matchAll(IMPORT)) {\n const { clause, module } = match.groups ?? {};\n if (module === undefined || match.index === undefined) continue;\n const braced =\n clause === undefined ? undefined : /\\{([\\s\\S]*)\\}/u.exec(clause);\n found.push({\n clause: braced?.[1],\n end: match.index + match[0].length,\n full: match[0],\n module,\n start: match.index,\n });\n }\n\n return found;\n};\n\n/** Whether a module specifier is this package or a path inside it. */\nconst belongsTo = (specifier: string, name: string) =>\n specifier === name || specifier.startsWith(`${name}/`);\n\n/**\n * The spans of a file that are code rather than text.\n *\n * A rename that also renames the word inside a string or a comment is a\n * rename that broke somebody's error message. Cheap to avoid: walk the file\n * once and remember where the quotes and comments were.\n */\n/**\n * Where a run of text-that-is-not-code ends, or -1 when this is code.\n *\n * A comment, or a string of any of the three kinds. Escapes are stepped over\n * two characters at a time so a quote inside a string does not end it early.\n */\nconst skipEnd = (source: string, index: number) => {\n const character = source[index];\n const next = source[index + 1];\n if (character === \"/\" && next === \"/\") {\n const line = source.indexOf(\"\\n\", index);\n\n return line < 0 ? source.length : line;\n }\n if (character === \"/\" && next === \"*\") {\n const close = source.indexOf(\"*/\", index + 2);\n\n return close < 0 ? source.length : close + 2;\n }\n if (character !== \"'\" && character !== '\"' && character !== \"`\")\n return IS_CODE;\n let cursor = index + 1;\n while (cursor < source.length && source[cursor] !== character)\n cursor += source[cursor] === \"\\\\\" ? 2 : 1;\n\n return Math.min(cursor + 1, source.length);\n};\n\n/**\n * The spans of a file that are code rather than text.\n *\n * A rename that also renames the word inside a string or a comment is a\n * rename that broke somebody's error message. Cheap to avoid: walk the file\n * once and remember where the quotes and comments were.\n */\nconst codeSpans = (source: string) => {\n const spans: Array<[number, number]> = [];\n let start = 0;\n let index = 0;\n const closeSpan = (ends: number, resumes: number) => {\n spans.push([start, ends]);\n start = resumes;\n };\n while (index < source.length) {\n const skipped = skipEnd(source, index);\n if (skipped > IS_CODE) closeSpan(index, skipped);\n index = skipped === IS_CODE ? index + 1 : skipped;\n }\n spans.push([start, source.length]);\n\n return spans;\n};\n\n/** Replace whole-word occurrences of a name, in code only, leaving property\n * accesses (`thing.name`) and declarations of the same word alone. */\nconst renameInCode = (source: string, from: string, into: string) => {\n const pattern = new RegExp(\n `(?<![.\\\\w$])${from.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\")}(?![\\\\w$])`,\n \"gu\",\n );\n let out = \"\";\n let cursor = 0;\n for (const [start, end] of codeSpans(source)) {\n out += source.slice(cursor, start);\n out += source.slice(start, end).replace(pattern, into);\n cursor = end;\n }\n\n return out + source.slice(cursor);\n};\n\n/** Whether this file declares the name itself, in which case renaming every\n * occurrence would rename somebody else's variable. */\nconst declaresLocally = (source: string, name: string) =>\n new RegExp(\n `\\\\b(?:const|let|var|function|class|interface|type|enum)\\\\s+${name.replace(\n /[.*+?^${}()|[\\]\\\\]/gu,\n \"\\\\$&\",\n )}\\\\b`,\n \"u\",\n ).test(source);\n\nconst applyRename = (\n source: string,\n packageName: string,\n rename: { from: string; to: string },\n) => {\n const statements = importsOf(source).filter(\n (statement) =>\n belongsTo(statement.module, packageName) &&\n statement.clause !== undefined &&\n new RegExp(`(?<![\\\\w$])${rename.from}(?![\\\\w$])`, \"u\").test(\n statement.clause,\n ),\n );\n if (statements.length === 0) return { changed: false, notes: [], source };\n const aliased = statements.some((statement) =>\n new RegExp(`(?<![\\\\w$])${rename.from}\\\\s+as\\\\s`, \"u\").test(\n statement.clause ?? \"\",\n ),\n );\n /* Imported under another name: only the left of the `as` moves, and\n * nothing else in the file refers to the old name at all. */\n if (aliased) {\n let out = source;\n for (const statement of statements)\n out = out.replace(\n statement.full,\n statement.full.replace(\n new RegExp(`(?<![\\\\w$])${rename.from}(\\\\s+as\\\\s)`, \"u\"),\n `${rename.to}$1`,\n ),\n );\n\n return { changed: true, notes: [], source: out };\n }\n /* The file also declares something by that name. Renaming every\n * occurrence would rename theirs too, so the import is aliased back and\n * the call sites are left as they are -- correct, and visible in the\n * diff for anybody who would rather tidy it. */\n if (declaresLocally(source, rename.from)) {\n let out = source;\n for (const statement of statements)\n out = out.replace(\n statement.full,\n statement.full.replace(\n new RegExp(`(?<![\\\\w$])${rename.from}(?![\\\\w$])`, \"u\"),\n `${rename.to} as ${rename.from}`,\n ),\n );\n\n return {\n changed: true,\n notes: [\n `\\`${rename.from}\\` is also declared in this file, so the import was aliased instead of the uses being renamed`,\n ],\n source: out,\n };\n }\n\n return {\n changed: true,\n notes: [],\n source: renameInCode(source, rename.from, rename.to),\n };\n};\n\nconst applyResubpath = (\n source: string,\n resubpath: { from: string; to: string },\n) => {\n const statements = importsOf(source).filter(\n (statement) => statement.module === resubpath.from,\n );\n if (statements.length === 0) return { changed: false, notes: [], source };\n let out = source;\n for (const statement of statements)\n out = out.replace(\n statement.full,\n statement.full.replace(resubpath.from, resubpath.to),\n );\n\n return { changed: true, notes: [], source: out };\n};\n\nconst applyMoved = (\n source: string,\n moved: { from: string; symbol: string; to: string },\n) => {\n const pattern = new RegExp(`(?<![\\\\w$])${moved.symbol}(?![\\\\w$])`, \"u\");\n const statements = importsOf(source).filter(\n (statement) =>\n statement.module === moved.from &&\n statement.clause !== undefined &&\n pattern.test(statement.clause),\n );\n if (statements.length === 0) return { changed: false, notes: [], source };\n let out = source;\n for (const statement of statements) {\n const clause = statement.clause ?? \"\";\n const kept = clause\n .split(\",\")\n .map((part) => part.trim())\n .filter((part) => part !== \"\" && !pattern.test(part));\n /* The only thing it imported: the statement moves wholesale, which\n * keeps the file's import list the length it was. */\n const replacement =\n kept.length === 0\n ? statement.full.replace(moved.from, moved.to)\n : `${statement.full\n .replace(clause, ` ${kept.join(\", \")} `)\n .replace(\n /\\s+/gu,\n \" \",\n )}\\nimport { ${moved.symbol} } from '${moved.to}';`;\n out = out.replace(statement.full, replacement);\n }\n\n return { changed: true, notes: [], source: out };\n};\n\n/**\n * Apply one migration to one file.\n *\n * A file the migration does not touch comes back unchanged, which is the\n * ordinary case: a project imports a dozen names from a package that moved a\n * hundred.\n */\nexport const applyMigration = (\n source: string,\n input: { migration: Migration; packageName: string },\n) => {\n const { migration, packageName } = input;\n if (!isMechanical(migration))\n return { changed: false, notes: [migration.instruction], source };\n if (\"rename\" in migration)\n return applyRename(source, packageName, migration.rename);\n if (\"resubpath\" in migration)\n return applyResubpath(source, migration.resubpath);\n\n return applyMoved(source, migration.moved);\n};\n\n/**\n * Apply migrations in order.\n *\n * Order matters: a symbol renamed in one release and moved in the next has to\n * be renamed first, or the move goes looking for a name that is no longer\n * there.\n */\nexport const applyMigrations = (\n source: string,\n input: {\n migrations: readonly Migration[];\n packageName: string;\n },\n) =>\n input.migrations.reduce<MigrationResult>(\n (carried, migration) => {\n const result = applyMigration(carried.source, {\n migration,\n packageName: input.packageName,\n });\n\n return {\n changed: carried.changed || result.changed,\n notes: [...carried.notes, ...result.notes],\n source: result.source,\n };\n },\n { changed: false, notes: [], source },\n );\n",
|
|
7
7
|
"import type { Change, Migration } from \"./types\";\n\n/*\n * How an entry is written.\n *\n * A file per change, in TypeScript rather than markdown, for one reason: the\n * compiler is the only reviewer who reads every entry. A markdown changelog\n * gets a heading wrong, an entry with no migration, a symbol that was renamed\n * three versions ago -- and nothing says a word until somebody upgrades. Here\n * the shape is checked where it is written, and a breaking change with no\n * migration is a red squiggle rather than a bad afternoon in six months.\n *\n * `change` is identity at runtime. All it does is put the type where the\n * author is typing.\n */\n\n/**\n * Record one change.\n *\n * Written as its own file under `changelog/unreleased/`, so two branches each\n * adding a change do not meet over the same line of the same file. The file\n * name is yours; something short and about the change reads best in a diff.\n *\n * ```ts\n * import { change } from '@absolutejs/changelog';\n *\n * export default change({\n * kind: 'breaking',\n * summary: 'serve() takes an options object',\n * symbols: ['serve'],\n * migration: {\n * instruction: 'Pass { port } instead of a bare port.',\n * manual: true\n * }\n * });\n * ```\n */\nexport const change = <const T extends Change>(entry: T) => entry;\n/** A migration nobody should automate, said as such rather than left off. */\nexport const manual = (instruction: string): Migration => ({\n instruction,\n manual: true,\n});\n/**\n * Record an export moving between entry points.\n *\n * The second most common, and the one people most often discover by way of a\n * failed build with no explanation in it.\n */\nexport const moved = (input: {\n symbol: string;\n from: string;\n to: string;\n detail?: string;\n reference?: string;\n}) =>\n change({\n ...(input.detail === undefined ? {} : { detail: input.detail }),\n kind: \"breaking\",\n migration: {\n instruction: `Import \\`${input.symbol}\\` from \\`${input.to}\\`.`,\n moved: { from: input.from, symbol: input.symbol, to: input.to },\n },\n ...(input.reference === undefined ? {} : { reference: input.reference }),\n summary: `\\`${input.symbol}\\` moved to \\`${input.to}\\``,\n symbols: [input.symbol] as const,\n });\n/**\n * Record a rename.\n *\n * The most common breaking change there is, and the one worth having a\n * shorthand for -- both because it is written often and because writing it\n * this way is what makes it applicable rather than readable.\n */\nexport const renamed = (input: {\n from: string;\n to: string;\n /** Anything a reader needs beyond \"it is called this now\". */\n detail?: string;\n reference?: string;\n}) =>\n change({\n ...(input.detail === undefined ? {} : { detail: input.detail }),\n kind: \"breaking\",\n migration: {\n instruction: `Import \\`${input.to}\\` instead of \\`${input.from}\\`.`,\n rename: { from: input.from, to: input.to },\n },\n ...(input.reference === undefined ? {} : { reference: input.reference }),\n summary: `\\`${input.from}\\` is now \\`${input.to}\\``,\n symbols: [input.from] as const,\n });\n",
|
|
8
|
-
"import { readdir, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { validateChange } from \"./read\";\nimport { surfaceOfFiles } 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\n/** Every declaration file a build produced, so a release can be checked\n * against the types it is about to publish rather than against the ones it\n * published last time. */\nexport const builtSurface = async (packageRoot: string, out = \"dist\") => {\n const root = join(packageRoot, out);\n const sources: string[] = [];\n const walk = async (directory: string): Promise<void> => {\n const found = await readdir(directory, { withFileTypes: true }).catch(\n () => [],\n );\n await Promise.all(\n found.map(async (entry) => {\n const path = join(directory, entry.name);\n if (entry.isDirectory()) return walk(path);\n if (!entry.name.endsWith(\".d.ts\")) return undefined;\n sources.push(await readFile(path, \"utf8\").catch(() => \"\"));\n\n return undefined;\n }),\n );\n };\n await walk(root);\n\n return sources.length === 0 ? undefined : surfaceOfFiles(sources);\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 (\n packageRoot: string,\n): Promise<LoadedEntries> => {\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",
|
|
8
|
+
"import { readdir, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { validateChange } from \"./read\";\nimport { surfaceOfFiles } 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\n/** Every declaration file a build produced, so a release can be checked\n * against the types it is about to publish rather than against the ones it\n * published last time. */\nexport const builtSurface = async (packageRoot: string, out = \"dist\") => {\n const root = join(packageRoot, out);\n const sources: string[] = [];\n const walk = async (directory: string): Promise<void> => {\n const found = await readdir(directory, { withFileTypes: true }).catch(\n () => [],\n );\n await Promise.all(\n found.map(async (entry) => {\n const path = join(directory, entry.name);\n if (entry.isDirectory()) return walk(path);\n if (!entry.name.endsWith(\".d.ts\")) return undefined;\n sources.push(await readFile(path, \"utf8\").catch(() => \"\"));\n\n return undefined;\n }),\n );\n };\n await walk(root);\n\n return sources.length === 0 ? undefined : surfaceOfFiles(sources);\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 (\n packageRoot: string,\n): Promise<LoadedEntries> => {\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",
|
|
9
9
|
"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",
|
|
10
|
-
"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\nconst textList = (value: unknown) =>\n Array.isArray(value) && value.length > 0 && value.every(isText)\n ? value\n : undefined;\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);\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 if (!isText(value.version) || parseVersion(value.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: value.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 if (value.contract !== CHANGELOG_CONTRACT)\n problems.push(\n `contract ${JSON.stringify(value.contract)} is not ${CHANGELOG_CONTRACT}`,\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 {\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\nconst textList = (value: unknown) =>\n Array.isArray(value) && value.length > 0 && value.every(isText)\n ? value\n : undefined;\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);\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 if (!isText(value.version) || parseVersion(value.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: value.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 (typeof value.contract !== \"number\" || value.contract > CHANGELOG_CONTRACT)\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",
|
|
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 { 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. Comparing the two is\n * how \"we forgot to write it down\" stops being possible at release time\n * rather than being discovered by whoever upgrades.\n *\n * The types are the right evidence because they are the promise. An export\n * that is gone, or whose declaration is not the same declaration, is exactly\n * what stops a consumer compiling -- no more, and no less.\n *\n * A `.d.ts` is generated, not written, so it is regular enough to read with a\n * scanner rather than a compiler. The scanner tracks bracket depth and takes\n * each exported declaration whole, so an interface is compared with its body\n * and a function with its overloads rather than with its first line.\n */\n\nconst DECLARATION =\n /\\bexport\\s+(?:declare\\s+)?(?:abstract\\s+)?(?:async\\s+)?(function|const|let|var|class|interface|type|enum|namespace)\\s+([A-Za-z_$][\\w$]*)/gu;\n/** `export { a, b as c }` -- a re-export names things without declaring them,\n * and the name people import is the one on the right. */\nconst NAMED_EXPORT = /\\bexport\\s*\\{([^}]*)\\}/gu;\n/** The keywords whose declaration is a braced body rather than a statement\n * ending in a semicolon. */\nconst BODIED = new Set([\"class\", \"interface\", \"enum\", \"namespace\"]);\nconst OPENS = new Set([\"{\", \"(\", \"[\"]);\nconst CLOSES = new Set([\"}\", \")\", \"]\"]);\nconst IDENTIFIER = /^[A-Za-z_$][\\w$]*$/u;\n/** `at(-1)` is the last one; `start` has not been found yet. */\nconst LAST = -1;\nconst NOWHERE = -1;\nconst MEMBER = /([A-Za-z_$][\\w$]*)\\s*[?!]?\\s*[:(<]/u;\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\n/**\n * Where the declaration starting at `from` ends.\n *\n * A braced declaration ends with the brace that closes its body. Everything\n * else ends at the first semicolon outside any bracket -- which is not the\n * same as the first closing bracket: `function serve(o: O): Promise<void>;`\n * closes a parenthesis halfway through and is not over.\n */\nconst declarationEnd = (source: string, from: number, bodied: boolean) => {\n let depth = 0;\n for (let index = from; index < source.length; index += 1) {\n const character = source[index] ?? \"\";\n if (OPENS.has(character)) depth += 1;\n else if (CLOSES.has(character)) depth -= 1;\n else if (character === \";\" && depth <= 0) return index + 1;\n if (CLOSES.has(character) && depth <= 0 && bodied) return index + 1;\n }\n\n return source.length;\n};\n\nconst normalize = (declaration: string) =>\n declaration.replace(/\\s+/gu, \" \").trim();\n\n/** The names an `export { … }` list contributes, each with its clause. */\nconst reExported = (body: string) =>\n body\n .split(\",\")\n .map((part) => part.trim().replace(/^type\\s+/u, \"\"))\n .filter((clause) => clause !== \"\")\n .map((clause) => [\n clause\n .split(/\\s+as\\s+/u)\n .at(LAST)\n ?.trim(),\n clause,\n ])\n .filter(\n (pair): pair is [string, string] =>\n pair[0] !== undefined && IDENTIFIER.test(pair[0]),\n );\n\n/**\n * The exported names of one declaration file, each with the declaration it\n * stands for.\n *\n * Overloads and merged declarations share a name; they are joined, so adding\n * an overload reads as a change to that name rather than as a replacement.\n */\nexport const exportedDeclarations = (source: string) => {\n const found = new Map<string, string>();\n const add = (name: string, declaration: string) => {\n const existing = found.get(name);\n found.set(\n name,\n existing === undefined ? declaration : `${existing}\\n${declaration}`,\n );\n };\n for (const match of source.matchAll(DECLARATION)) {\n const [, keyword, name] = match;\n if (name === undefined || match.index === undefined) continue;\n add(\n name,\n normalize(\n source.slice(\n match.index,\n declarationEnd(\n source,\n match.index + match[0].length,\n BODIED.has(keyword ?? \"\"),\n ),\n ),\n ),\n );\n }\n for (const match of source.matchAll(NAMED_EXPORT))\n for (const [exported, clause] of reExported(match[1] ?? \"\"))\n add(exported, `export { ${clause} }`);\n\n return found;\n};\n\nexport type PackageSurface = Map<string, string>;\n\n/** The surface of a package tarball, already gunzipped. */\nexport const surfaceOfArchive = (archive: Uint8Array) =>\n surfaceOfFiles(\n [...readTar(archive, (path) => path.endsWith(\".d.ts\")).values()].map(\n asText,\n ),\n );\n/**\n * Every exported name in a package's declaration files.\n *\n * A name usually appears twice: where it is declared, and in the index that\n * passes it along. The declaration wins wherever both are found, whichever\n * file the archive happened to put first -- otherwise the same package reads\n * as `export { syncSocket }` in one version and as its full signature in the\n * next, and the two compare as a change nobody made.\n */\nexport const surfaceOfFiles = (files: Iterable<string>) => {\n const surface: PackageSurface = new Map();\n for (const source of files)\n for (const [name, declaration] of exportedDeclarations(source)) {\n const known = surface.get(name);\n if (known === undefined || (isStub(known) && !isStub(declaration)))\n surface.set(name, declaration);\n }\n\n return surface;\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. Reporting that as a breaking change is how a\n * useful list becomes a list nobody reads.\n *\n * So the comparison is made where callers live: the parameters they pass and\n * the members they reach for. What is left over is `types`, which is true,\n * boring, and kept out of the way.\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/** The first top-level parenthesis group: what a caller passes. */\nconst parametersOf = (declaration: string) => {\n let depth = 0;\n let start = NOWHERE;\n for (const [index, character] of [...declaration].entries()) {\n // A brace before any parenthesis: this is a body, not a call.\n if (character === \"{\" && depth === 0) return \"\";\n depth += character === \"(\" ? 1 : 0;\n if (character === \"(\" && depth === 1) start = index;\n depth -= character === \")\" ? 1 : 0;\n if (character === \")\" && depth === 0 && start > NOWHERE)\n return declaration.slice(start, index + 1);\n }\n\n return \"\";\n};\n\n/** The names inside a braced body, one level down: what a caller reaches\n * for. */\nconst membersOf = (declaration: string) => {\n const opened = declaration.indexOf(\"{\");\n if (opened < 0) return new Set<string>();\n const members = new Set<string>();\n let depth = 0;\n let segment = \"\";\n const take = () => {\n const [, name] = MEMBER.exec(segment.trim()) ?? [];\n if (name !== undefined) members.add(name);\n segment = \"\";\n };\n for (const character of declaration.slice(opened)) {\n const opening = OPENS.has(character);\n const closing = CLOSES.has(character);\n depth += opening ? 1 : 0;\n if (opening && depth === 1) segment = \"\";\n depth -= closing ? 1 : 0;\n if (opening || closing || depth !== 1) continue;\n if (character === \";\" || character === \",\") take();\n else segment += character;\n }\n take();\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.\n * That is this reader finding the name in a different file, not the\n * package changing anything, and reading it as a changed signature\n * invents a breaking change out of an archive's file order. */\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\nexport type SurfaceDiff = {\n added: string[];\n changed: SurfaceChange[];\n removed: string[];\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 may:\n * a widened parameter is not a break and a narrowed one is, and telling them\n * apart is a job for whoever reads the two declarations -- so both are carried\n * rather than judged here.\n */\nexport const diffSurface = (\n before: PackageSurface,\n after: PackageSurface,\n): SurfaceDiff => {\n const removed: string[] = [];\n const changed: SurfaceChange[] = [];\n for (const [name, declaration] of before) {\n const now = after.get(name);\n if (now === undefined) removed.push(name);\n else if (now !== declaration)\n changed.push({\n after: now,\n before: declaration,\n name,\n shape: changeShape({ after: now, before: declaration }),\n });\n }\n\n return {\n added: [...after.keys()].filter((name) => !before.has(name)),\n changed,\n removed,\n };\n};\n\n/** The changes in a diff that a caller would notice. */\nexport const notable = (diff: SurfaceDiff) =>\n diff.changed.filter(\n (change) => change.shape === \"parameters\" || change.shape === \"members\",\n );\n",
|
|
13
|
-
"import { notable, type SurfaceDiff } from \"./surface\";\nimport { isDisruptive, type Change } 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 /** Why it matters: gone entirely, or the call shape moved. */\n kind: \"removed\" | \"parameters\" | \"members\";\n name: string;\n};\n\nexport type Reconciliation = {\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/** What to print when it fails, in the order somebody fixes them. */\nexport const describeReconciliation = (found: Reconciliation) => {\n const lines: string[] = [];\n for (const entry of found.unannounced)\n lines.push(\n entry.kind === \"removed\"\n ? `\\`${entry.name}\\` is no longer exported and no entry says so`\n : `\\`${entry.name}\\` changed its ${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\n return lines;\n};\nexport const reconcile = (input: {\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}): Reconciliation => {\n const
|
|
13
|
+
"import { notable, type 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 /** Why it matters: gone entirely, or the call shape moved. */\n kind: \"removed\" | \"parameters\" | \"members\";\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 for (const entry of found.unannounced)\n lines.push(\n entry.kind === \"removed\"\n ? `\\`${entry.name}\\` is no longer exported and no entry says so`\n : `\\`${entry.name}\\` changed its ${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 const unannounced: Unannounced[] = [\n ...input.diff.removed\n .filter((name) => !disruptive.has(name))\n .map((name) => ({ kind: \"removed\", name }) as const),\n ...notable(input.diff)\n .filter((change) => !mentioned.has(change.name))\n .map(\n (change) =>\n ({\n kind: change.shape === \"parameters\" ? \"parameters\" : \"members\",\n name: change.name,\n }) as const,\n ),\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\";\n\nexport type RegistryOptions = {\n fetch?: typeof fetch;\n /** For a private registry, or a test. */\n registry?: string;\n};\n\nexport type PackageVersions = {\n latest?: string;\n published: string[];\n tarballs: Record<string, 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. */\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 if (!response.ok) return undefined;\n\n return new Uint8Array(\n gunzipSync(new Uint8Array(await response.arrayBuffer())),\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 */\nexport const packageVersions = async (\n name: string,\n options: RegistryOptions = {},\n) => {\n const call = options.fetch ?? fetch;\n const url = `${options.registry ?? DEFAULT_REGISTRY}/${name.replace(\"/\", \"%2f\")}`;\n try {\n const abbreviated = await call(url, { headers: { accept: ABBREVIATED } });\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 ? abbreviated : await call(url);\n if (!response.ok) return undefined;\n\n return readPackument(await response.json());\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\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 \"This file is generated by `absolute-changelog` 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": ";;AAuBO,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;AAiG/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;;;ACnHhB,IAAM,UAAU;AAEhB,IAAM,SACJ;AAEF,IAAM,YAAY,CAAC,WAAmB;AAAA,EACpC,MAAM,QAA2B,CAAC;AAAA,EAClC,WAAW,SAAS,OAAO,SAAS,MAAM,GAAG;AAAA,IAC3C,QAAQ,QAAQ,WAAW,MAAM,UAAU,CAAC;AAAA,IAC5C,IAAI,WAAW,aAAa,MAAM,UAAU;AAAA,MAAW;AAAA,IACvD,MAAM,SAC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A;AAAA,IACA;AAAA,EACF,EAAE,KAAK;AAAA,CAAI;AAAA,EACX,MAAM,OAAO,SAAS,IAAI,aAAa,EAAE,KAAK;AAAA;AAAA,CAAM;AAAA,EACpD,MAAM,OACJ,QAAQ,YAAY,aAAa,QAAQ,QAAQ,KAAK,MAAM,KACxD,KACA,CAAC,OAAO,IAAI,uBAAuB,IAAI,QAAQ,QAAQ,KAAK,CAAC,EAAE,KAC7D;AAAA,CACF;AAAA,EAEN,OAAO,GAAG,CAAC,MAAM,MAAM,IAAI,EAAE,OAAO,CAAC,SAAS,SAAS,EAAE,EAAE,KAAK;AAAA;AAAA,CAAM;AAAA;AAAA;",
|
|
18
|
+
"debugId": "7673E1441936CC9C64756E2164756E21",
|
|
19
19
|
"names": []
|
|
20
20
|
}
|
package/dist/json.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** What this file indents with: a tab, or however many spaces it uses. */
|
|
2
|
+
export declare const indentOf: (source: string) => string;
|
|
3
|
+
/** Rewrite a JSON file, keeping the indentation it already had. */
|
|
4
|
+
export declare const writeJsonLike: (path: string, document: unknown) => Promise<void>;
|
package/dist/read.d.ts
CHANGED
|
@@ -59,5 +59,5 @@ export declare const mechanicalMigrations: (migrations: readonly MigrationAt[])
|
|
|
59
59
|
*/
|
|
60
60
|
export declare const migrationsBetween: (changelog: Changelog, from: string, upto: string) => MigrationAt[];
|
|
61
61
|
/** Every export named by a disruptive change in the window. */
|
|
62
|
-
export declare const symbolsDisturbedBetween: (changelog: Changelog, from: string, upto: string) => Set<string>;
|
|
62
|
+
export declare const symbolsDisturbedBetween: (changelog: Changelog, from: string, upto: string) => Set<string | (string & {})>;
|
|
63
63
|
export {};
|
package/dist/reconcile.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export type Unannounced = {
|
|
|
6
6
|
name: string;
|
|
7
7
|
};
|
|
8
8
|
export type Reconciliation = {
|
|
9
|
+
/** Entries whose migration does not describe what the package did. */
|
|
10
|
+
wrongMigrations: string[];
|
|
9
11
|
/** Exports that moved with nothing written about them. */
|
|
10
12
|
unannounced: Unannounced[];
|
|
11
13
|
/** Names entries claim that this package has never exported. A typo, or
|
|
@@ -15,9 +17,18 @@ export type Reconciliation = {
|
|
|
15
17
|
/** What to print when it fails, in the order somebody fixes them. */
|
|
16
18
|
export declare const describeReconciliation: (found: Reconciliation) => string[];
|
|
17
19
|
export declare const reconcile: (input: {
|
|
20
|
+
/** Every entry that speaks for the versions being compared: the ones
|
|
21
|
+
* waiting for a release, and the ones a release already consumed but the
|
|
22
|
+
* registry has not seen yet. */
|
|
18
23
|
changes: readonly Change[];
|
|
19
24
|
diff: SurfaceDiff;
|
|
20
25
|
/** Every name the package exported before or after, for catching entries
|
|
21
26
|
* that name something that was never there. */
|
|
22
27
|
known: ReadonlySet<string>;
|
|
28
|
+
/** What the package exports now, for checking that a migration describes
|
|
29
|
+
* what it says it describes. */
|
|
30
|
+
after?: ReadonlySet<string>;
|
|
31
|
+
/** The package's entry points, so a migration cannot point at one that is
|
|
32
|
+
* not there. Empty means "not known", and the check is skipped. */
|
|
33
|
+
subpaths?: ReadonlySet<string>;
|
|
23
34
|
}) => Reconciliation;
|
package/dist/types.d.ts
CHANGED
|
@@ -19,12 +19,12 @@ export type DisruptiveKind = (typeof DISRUPTIVE_KINDS)[number];
|
|
|
19
19
|
* `manual` is the honest escape hatch. A changed meaning is not a rewrite
|
|
20
20
|
* anybody should automate, and pretending otherwise is worse than saying so.
|
|
21
21
|
*/
|
|
22
|
-
export type Migration =
|
|
22
|
+
export type Migration<TSymbol extends string = string> =
|
|
23
23
|
/** An export kept its meaning and changed its name. */
|
|
24
24
|
{
|
|
25
25
|
readonly instruction: string;
|
|
26
26
|
readonly rename: {
|
|
27
|
-
readonly from:
|
|
27
|
+
readonly from: TSymbol;
|
|
28
28
|
readonly to: string;
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -32,7 +32,7 @@ export type Migration =
|
|
|
32
32
|
| {
|
|
33
33
|
readonly instruction: string;
|
|
34
34
|
readonly moved: {
|
|
35
|
-
readonly symbol:
|
|
35
|
+
readonly symbol: TSymbol;
|
|
36
36
|
readonly from: string;
|
|
37
37
|
readonly to: string;
|
|
38
38
|
};
|
|
@@ -50,6 +50,38 @@ export type Migration =
|
|
|
50
50
|
readonly instruction: string;
|
|
51
51
|
readonly manual: true;
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* The names a package exports, for an entry that wants them checked.
|
|
55
|
+
*
|
|
56
|
+
* An entry can be written against the package's own public API:
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* import type * as Api from "../../src/index";
|
|
60
|
+
* import type { Change } from "@absolutejs/changelog";
|
|
61
|
+
*
|
|
62
|
+
* export const change: Change<typeof Api> = {
|
|
63
|
+
* kind: "fixed",
|
|
64
|
+
* summary: "stops throwing on an empty list",
|
|
65
|
+
* symbols: ["listen"] // an export, or the compiler says so
|
|
66
|
+
* };
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* Suggested rather than required, for two reasons that both matter. A
|
|
70
|
+
* disruptive change is usually about something that has just stopped
|
|
71
|
+
* existing -- the release that removes `start` is the release that writes the
|
|
72
|
+
* entry about it -- and `typeof Api` cannot see type-only exports at all, so
|
|
73
|
+
* insisting would reject an entry about `Change` or `Release` for being
|
|
74
|
+
* something this package definitely exports.
|
|
75
|
+
*
|
|
76
|
+
* What that leaves is an editor that completes the name and a gate that is
|
|
77
|
+
* certain: the release check reads the published `.d.ts`, which does carry
|
|
78
|
+
* the type exports, and refuses an entry naming something the package has
|
|
79
|
+
* never exported.
|
|
80
|
+
*/
|
|
81
|
+
type Exported<TApi> = TApi extends object ? Extract<keyof TApi, string> : string;
|
|
82
|
+
/** Autocompleted, not restricted: an entry may name an export that has just
|
|
83
|
+
* stopped being one. */
|
|
84
|
+
type Suggested<TApi> = Exported<TApi> | (string & {});
|
|
53
85
|
type ChangeBase = {
|
|
54
86
|
/** One line, imperative, in the reader's terms rather than the
|
|
55
87
|
* implementation's. */
|
|
@@ -66,19 +98,19 @@ type ChangeBase = {
|
|
|
66
98
|
* the package's published types, and what lets a project be told whether the
|
|
67
99
|
* change reaches any of its files. An entry without it can only ever be read.
|
|
68
100
|
*/
|
|
69
|
-
export type DisruptiveChange = ChangeBase & {
|
|
101
|
+
export type DisruptiveChange<TApi = unknown> = ChangeBase & {
|
|
70
102
|
readonly kind: DisruptiveKind;
|
|
71
|
-
readonly symbols: NonEmpty<
|
|
72
|
-
readonly migration: Migration
|
|
103
|
+
readonly symbols: NonEmpty<Suggested<TApi>>;
|
|
104
|
+
readonly migration: Migration<Suggested<TApi>>;
|
|
73
105
|
};
|
|
74
|
-
export type OrdinaryChange = ChangeBase & {
|
|
106
|
+
export type OrdinaryChange<TApi = unknown> = ChangeBase & {
|
|
75
107
|
readonly kind: Exclude<ChangeKind, DisruptiveKind>;
|
|
76
108
|
/** Optional here, and still worth filling in: it is what connects a fix
|
|
77
109
|
* to the export somebody is looking at. */
|
|
78
|
-
readonly symbols?: readonly
|
|
110
|
+
readonly symbols?: readonly Suggested<TApi>[];
|
|
79
111
|
readonly migration?: never;
|
|
80
112
|
};
|
|
81
|
-
export type Change = DisruptiveChange | OrdinaryChange
|
|
113
|
+
export type Change<TApi = unknown> = DisruptiveChange<TApi> | OrdinaryChange<TApi>;
|
|
82
114
|
export type Release = {
|
|
83
115
|
readonly version: string;
|
|
84
116
|
/** ISO date, the day it was published. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/changelog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "The changelog contract for the AbsoluteJS packages. Changes are written as typed entries the compiler checks, the release gate reconciles them against the package's own published types so a change nobody wrote down cannot ship, and migrations are data rather than prose so an upgrade can be applied instead of read.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"lint": "eslint . --max-warnings 0",
|
|
45
45
|
"changelog": "bun src/cli.ts",
|
|
46
46
|
"check:package": "bun run typecheck && bun run lint && bun run test && bun run build && bun src/cli.ts check",
|
|
47
|
-
"release": "bun run format && bun run check:package && bun publish"
|
|
47
|
+
"release": "bun run format && bun run check:package && bun publish",
|
|
48
|
+
"prepublishOnly": "bun src/cli.ts check"
|
|
48
49
|
},
|
|
49
50
|
"keywords": [
|
|
50
51
|
"absolutejs",
|