@reelout/core 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HookDispatcher-Di79rwtu.js → HookDispatcher-B_TrMRLU.js} +3 -3
- package/dist/{HookDispatcher-Di79rwtu.js.map → HookDispatcher-B_TrMRLU.js.map} +1 -1
- package/dist/analyzer.js +4 -4
- package/dist/{buildChangelog-Cxm9_lq2.js → buildChangelog-CkytKypk.js} +2 -2
- package/dist/{buildChangelog-Cxm9_lq2.js.map → buildChangelog-CkytKypk.js.map} +1 -1
- package/dist/{buildReleaseNotes-S6HcEQnE.js → buildReleaseNotes-Dk4bEclG.js} +4 -4
- package/dist/{buildReleaseNotes-S6HcEQnE.js.map → buildReleaseNotes-Dk4bEclG.js.map} +1 -1
- package/dist/builder.js +3 -3
- package/dist/changelog.js +4 -4
- package/dist/index.js +104 -20
- package/dist/index.js.map +1 -1
- package/dist/{package-Bczytil1.js → package-la-hLPRR.js} +2 -2
- package/dist/{package-Bczytil1.js.map → package-la-hLPRR.js.map} +1 -1
- package/dist/{propagateDependencyUpdates-QWn0H1qa.js → propagateDependencyUpdates-xcPvP5SP.js} +3 -3
- package/dist/{propagateDependencyUpdates-QWn0H1qa.js.map → propagateDependencyUpdates-xcPvP5SP.js.map} +1 -1
- package/dist/{readPackageHistory-CN5nqMcE.js → readPackageHistory-6dC72rZk.js} +2 -2
- package/dist/{readPackageHistory-CN5nqMcE.js.map → readPackageHistory-6dC72rZk.js.map} +1 -1
- package/dist/{resolvePackageTag-cwqG1GGt.js → resolvePackageTag-2ldvH7PC.js} +2 -2
- package/dist/{resolvePackageTag-cwqG1GGt.js.map → resolvePackageTag-2ldvH7PC.js.map} +1 -1
- package/package.json +1 -1
- package/src/types.ts +1 -0
- package/src/util/captureCommandOutput.ts +140 -0
- package/src/util/index.ts +1 -0
- package/src/util/isQuietEnvironment.ts +19 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as execGit, a as generateGitTagName, i as getGitTagMessage, n as verifyPackageTag, u as resolveGitRevision } from "./package-
|
|
2
|
-
import { a as formatFile, n as iterateChangelogVersions } from "./buildChangelog-
|
|
1
|
+
import { T as execGit, a as generateGitTagName, i as getGitTagMessage, n as verifyPackageTag, u as resolveGitRevision } from "./package-la-hLPRR.js";
|
|
2
|
+
import { a as formatFile, n as iterateChangelogVersions } from "./buildChangelog-CkytKypk.js";
|
|
3
3
|
import fs, { readFile } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
@@ -233,4 +233,4 @@ var HookDispatcher = class {
|
|
|
233
233
|
};
|
|
234
234
|
export { discoverPackageTag as a, prependChangelog as i, Priority as n, extractLatestVersion as o, writeChangelog as r, readGitFile as s, HookDispatcher as t };
|
|
235
235
|
|
|
236
|
-
//# sourceMappingURL=HookDispatcher-
|
|
236
|
+
//# sourceMappingURL=HookDispatcher-B_TrMRLU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HookDispatcher-Di79rwtu.js","names":[],"sources":["../src/git/revision/readGitFile.ts","../src/workflow/changelog/extractLatestVersion.ts","../src/workflow/discovery/discoverPackageTag.ts","../src/workflow/changelog/prependChangelog.ts","../src/workflow/changelog/writeChangelog.ts","../src/plugin/HookDispatcher.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { execGit } from '#util'\n\n/**\n * Read a file's contents from a specific Git revision.\n *\n * Runs `git show <ref>:<filePath>` and returns the command output as a\n * string. If the file does not exist at the given revision or the Git\n * command fails for any reason, the function returns `null`.\n *\n * The returned string is the raw file contents as emitted by Git; callers\n * that need binary-safe handling should decode or process the bytes\n * accordingly. This function intentionally swallows Git errors and signals\n * absence via a `null` result rather than throwing.\n *\n * @param cwd Repository working directory\n * @param ref Commit-ish reference (commit SHA, tag, or branch) to read from\n * @param filePath Path to the file relative to the repository root\n * @returns File contents as a string, or `null` if the file is unavailable at the ref\n */\nexport function readGitFile(\n cwd: string,\n ref: string,\n filePath: string\n): Promise<string | null> {\n return execGit(cwd, ['show', `${ref}:${filePath}`]).catch(() => null)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { iterateChangelogVersions } from './iterateChangelogVersions'\n\n/**\n * Find the highest semantic version from the first version-bearing element.\n *\n * Pulls the first available version string from the parsed markdown iterator.\n * Short-circuits execution immediately upon locating a match to avoid passing\n * through the remaining document structure.\n *\n * @param changelogContent The raw markdown string representing the changelog\n * @returns The highest valid semantic version string found or null\n */\nexport function extractLatestVersion(changelogContent: string): string | null {\n for (const version of iterateChangelogVersions(changelogContent)) {\n return version\n }\n\n return null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport {\n generateGitTagName,\n getGitTagMessage,\n readGitFile,\n resolveGitRevision,\n} from '#git'\nimport type { EnsureGitTagOptions } from '#git'\nimport type { Package, Tag } from '#types'\nimport { readFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport { extractLatestVersion } from '../changelog/extractLatestVersion'\nimport { verifyPackageTag } from './verifyPackageTag'\n\n/**\n * Discover and validate the Git tag for a package.\n *\n * Returns the existing tag if already present on the `pkg` object. Resolves\n * the local changelog file path, extracts the current version, and generates\n * the expected Git tag name. Verifies the tag against the repository and\n * ensures its historical changelog version matches the current local version.\n *\n * @param cwd The current working directory\n * @param pkg The package configuration object\n * @param options Dry-run and logging guards for the local tag cleanup\n * @returns The validated `Tag` object or null if validation fails\n */\nexport async function discoverPackageTag(\n cwd: string,\n pkg: Package,\n options?: EnsureGitTagOptions\n): Promise<Tag | null> {\n if (pkg.tag) {\n return pkg.tag\n }\n\n const changelogFile = pkg.changelogFile || DEFAULT_CHANGELOG_FILE\n\n const changelogFilePath = path.resolve(cwd, pkg.location, changelogFile)\n\n let localChangelogContent: string | null | undefined\n\n try {\n localChangelogContent = await readFile(changelogFilePath, 'utf-8')\n } catch {}\n\n if (!localChangelogContent) {\n return null\n }\n\n const currentVersion = extractLatestVersion(localChangelogContent)\n\n if (!currentVersion) {\n return null\n }\n\n let expectedTagName: string | null | undefined\n\n try {\n expectedTagName = generateGitTagName(pkg.entry, pkg.name, currentVersion)\n } catch {}\n\n if (!expectedTagName) {\n return null\n }\n\n if (!(await verifyPackageTag(cwd, pkg, expectedTagName, options))) {\n return null\n }\n\n const tagRef = `refs/tags/${expectedTagName}`\n\n const historicalChangelogContent = await readGitFile(\n cwd,\n await resolveGitRevision(cwd, tagRef),\n path.relative(cwd, changelogFilePath)\n )\n\n if (!historicalChangelogContent) {\n return null\n }\n\n const historicalChangelogVersion = extractLatestVersion(\n historicalChangelogContent\n )\n\n if (\n !historicalChangelogVersion ||\n historicalChangelogVersion !== currentVersion\n ) {\n return null\n }\n\n return {\n name: expectedTagName,\n message: await getGitTagMessage(cwd, expectedTagName),\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { formatFile } from '#util'\nimport type { ConsolaInstance } from 'consola/core'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { toMarkdown } from 'mdast-util-to-markdown'\nimport fs from 'node:fs/promises'\n\nconst defaultChangelogTitle = 'Changelog'\n\n/**\n * Prepend changelog content to a markdown file, creating it if necessary.\n *\n * Reads the existing file if present, prepends the new content before the main heading,\n * formats and writes the result back.\n *\n * @param filePath Path to the changelog file\n * @param revision Changelog content to prepend\n * @param logger Optional logger that receives formatting failures\n * @returns Promise that resolves when the changelog is written\n */\nexport async function prependChangelog(\n filePath: string,\n revision: string,\n logger?: ConsolaInstance\n): Promise<void> {\n let content = ''\n\n try {\n content = await fs.readFile(filePath, 'utf-8')\n } catch (err) {\n /* istanbul ignore next */\n if ((err as NodeJS.ErrnoException).code !== 'ENOENT') {\n throw err\n }\n }\n\n const root = fromMarkdown(content)\n\n let index = root.children.findIndex(\n (node) => node.type === 'heading' && node.depth === 1\n )\n\n if (index === -1) {\n index = 0\n\n root.children.unshift({\n type: 'heading',\n depth: 1,\n children: [{ type: 'text', value: defaultChangelogTitle }],\n })\n }\n\n root.children.splice(index + 1, 0, ...fromMarkdown(revision).children)\n\n content = toMarkdown(root)\n\n content = await formatFile(filePath, content, logger)\n\n await fs.writeFile(filePath, content)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport type { ReleasePlan } from '#types'\nimport type { ConsolaInstance } from 'consola/core'\nimport path from 'node:path'\nimport { prependChangelog } from './prependChangelog'\n\n/**\n * Write changelog content to the file system based on the release plan.\n *\n * @param cwd Repository working directory\n * @param plan Release plan containing package and changelog content\n * @param logger Optional logger that receives formatting failures\n * @returns Promise that resolves when the changelog file has been written\n */\nexport async function writeChangelog(\n cwd: string,\n plan: ReleasePlan,\n logger?: ConsolaInstance\n): Promise<void> {\n if (plan.release?.changelog) {\n const changelogFile = plan.package.changelogFile || DEFAULT_CHANGELOG_FILE\n\n const filePath = path.join(cwd, plan.package.location, changelogFile)\n\n await prependChangelog(filePath, plan.release.changelog, logger)\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\n/**\n * Continuation that resumes the chain with the following middleware.\n */\nexport type Next<Context> = (context: Context) => Promise<void>\n\n/**\n * Function executed as a single link in a hook dispatch chain.\n */\nexport type Middleware<Context> = {\n bivariant(context: Context, next: Next<Context>): void | Promise<void>\n}['bivariant']\n\n/**\n * Priority ranks that order middleware within a hook.\n */\nexport const Priority = {\n High: 50,\n Normal: 0,\n Low: -50,\n} as const\n\n/**\n * Registration options accepted by `on`.\n */\nexport interface RegistrationOptions<Meta> {\n priority?: number | undefined\n meta?: Meta | undefined\n}\n\n/**\n * A registration entry captured by `on`.\n *\n * Carries the `middleware`, its `priority` sort rank, and the `meta` exposed\n * to the constructor interceptor.\n */\nexport interface Registration<HookName, Context, Meta = undefined> {\n hook: HookName\n priority: number\n middleware: Middleware<Context>\n meta: Meta | undefined\n}\n\n/**\n * Intercept a registered middleware during dispatch.\n *\n * Runs in place of every registered middleware, receiving the shared\n * `context`, the `registration` being dispatched — including its `priority`\n * and `meta` — and the `next` function that continues with the following\n * middleware.\n */\nexport type Interceptor<HookName, Context, Meta = undefined> = (\n context: Context,\n registration: Registration<HookName, Context, Meta>,\n next: Next<Context>\n) => void | Promise<void>\n\ntype InferContext<M extends Middleware<unknown>> =\n M extends Middleware<infer Context> ? Context : never\n\n/**\n * Dispatch registered hooks through asynchronous execution chains.\n *\n * Stores middleware in a prioritized registry and executes them sequentially\n * in priority order.\n */\nexport class HookDispatcher<\n HookMap extends Record<keyof HookMap, Middleware<unknown>>,\n Meta = undefined,\n> {\n readonly #registry = new Map<\n keyof HookMap,\n Registration<keyof HookMap, InferContext<HookMap[keyof HookMap]>, Meta>[]\n >()\n\n readonly #interceptor:\n | Interceptor<keyof HookMap, InferContext<HookMap[keyof HookMap]>, Meta>\n | undefined\n\n /**\n * Create a hook dispatcher.\n *\n * @param interceptor Wrapper invoked in place of every registered\n * middleware during dispatch\n */\n constructor(\n interceptor?: Interceptor<\n keyof HookMap,\n InferContext<HookMap[keyof HookMap]>,\n Meta\n >\n ) {\n this.#interceptor = interceptor\n }\n\n /**\n * Register middleware for a specific hook.\n *\n * Adds the `middleware` to the internal registry for `hook` and sorts the\n * list so higher-priority middleware runs first. An omitted or `undefined`\n * `options.priority` defaults to `Priority.Normal`; `options.meta` is\n * carried on the registration for the constructor interceptor.\n *\n * @param hook Name of the hook to register\n * @param middleware Function executed when the hook dispatches\n * @param options Registration options carrying the execution order rank and\n * the metadata exposed to the constructor interceptor\n */\n on<HookName extends keyof HookMap>(\n hook: HookName,\n middleware: Middleware<InferContext<HookMap[HookName]>>,\n options?: RegistrationOptions<Meta>\n ): void {\n const registrations = this.#registry.get(hook) ?? []\n\n registrations.push({\n hook,\n middleware,\n priority: options?.priority ?? Priority.Normal,\n meta: options?.meta,\n })\n\n registrations.sort((a, b) => b.priority - a.priority)\n\n this.#registry.set(hook, registrations)\n }\n\n /**\n * Unregister middleware from a specific hook.\n *\n * Removes matching `middleware` references from the internal registry for\n * `hook`. Takes no action if `hook` has no registered middleware.\n *\n * @param hook Name of the hook to unregister from\n * @param middleware Reference of the middleware function to remove\n */\n off<HookName extends keyof HookMap>(\n hook: HookName,\n middleware: Middleware<InferContext<HookMap[HookName]>>\n ): void {\n const registrations = this.#registry.get(hook)\n\n if (!registrations) return\n\n this.#registry.set(\n hook,\n registrations.filter(\n (registration) => registration.middleware !== middleware\n )\n )\n }\n\n /**\n * Dispatch all middleware registered to a hook.\n *\n * Passes `context` through the middleware pipeline in descending priority\n * order and dispatches each registration through the constructor\n * interceptor when one is provided. Enables middleware to control\n * execution flow using `next` and executes `done` after the last\n * middleware completes.\n *\n * @param hook Name of the hook to dispatch\n * @param context Shared payload passed into each middleware\n * @param done Optional final callback run after the pipeline completes\n * @returns Promise that resolves when execution completes\n */\n async dispatch<HookName extends keyof HookMap>(\n hook: HookName,\n context: InferContext<HookMap[HookName]>,\n done?: Next<InferContext<HookMap[HookName]>>\n ): Promise<void> {\n type Context = InferContext<HookMap[HookName]>\n\n const registrations = this.#registry.get(hook) ?? []\n\n const interceptor = this.#interceptor\n\n const run = async (index: number, context: Context): Promise<void> => {\n const registration = registrations[index]\n\n if (!registration) {\n return done ? await done(context) : undefined\n }\n\n let isNextCalled = false\n\n const next: Next<Context> = async (context) => {\n if (isNextCalled) return\n isNextCalled = true\n return await run(index + 1, context)\n }\n\n const middleware: Middleware<Context> = interceptor\n ? (context, next) => interceptor(context, registration, next)\n : registration.middleware\n\n return await middleware(context, next)\n }\n\n return await run(0, context)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,YACd,KACA,KACA,UACwB;CACxB,OAAO,QAAQ,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,IAAI;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,MACA,cAAc,QACX,iBAAiB,aAAa,eAAe,UAChD,CACF;CACF;;;;;;;;;;;;;;;CAgBA,MAAM,SACJ,MACA,SACA,MACe;EAGf,MAAM,gBAAgB,KAAK,UAAU,IAAI,IAAI,KAAK,CAAC;EAEnD,MAAM,cAAc,KAAK;EAEzB,MAAM,MAAM,OAAO,OAAe,YAAoC;GACpE,MAAM,eAAe,cAAc;GAEnC,IAAI,CAAC,cACH,OAAO,OAAO,MAAM,KAAK,OAAO,IAAI,KAAA;GAGtC,IAAI,eAAe;GAEnB,MAAM,OAAsB,OAAO,YAAY;IAC7C,IAAI,cAAc;IAClB,eAAe;IACf,OAAO,MAAM,IAAI,QAAQ,GAAG,OAAO;GACrC;GAMA,OAAO,OAJiC,eACnC,SAAS,SAAS,YAAY,SAAS,cAAc,IAAI,IAC1D,aAAa,WAAA,CAEO,SAAS,IAAI;EACvC;EAEA,OAAO,MAAM,IAAI,GAAG,OAAO;CAC7B;AACF"}
|
|
1
|
+
{"version":3,"file":"HookDispatcher-B_TrMRLU.js","names":[],"sources":["../src/git/revision/readGitFile.ts","../src/workflow/changelog/extractLatestVersion.ts","../src/workflow/discovery/discoverPackageTag.ts","../src/workflow/changelog/prependChangelog.ts","../src/workflow/changelog/writeChangelog.ts","../src/plugin/HookDispatcher.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { execGit } from '#util'\n\n/**\n * Read a file's contents from a specific Git revision.\n *\n * Runs `git show <ref>:<filePath>` and returns the command output as a\n * string. If the file does not exist at the given revision or the Git\n * command fails for any reason, the function returns `null`.\n *\n * The returned string is the raw file contents as emitted by Git; callers\n * that need binary-safe handling should decode or process the bytes\n * accordingly. This function intentionally swallows Git errors and signals\n * absence via a `null` result rather than throwing.\n *\n * @param cwd Repository working directory\n * @param ref Commit-ish reference (commit SHA, tag, or branch) to read from\n * @param filePath Path to the file relative to the repository root\n * @returns File contents as a string, or `null` if the file is unavailable at the ref\n */\nexport function readGitFile(\n cwd: string,\n ref: string,\n filePath: string\n): Promise<string | null> {\n return execGit(cwd, ['show', `${ref}:${filePath}`]).catch(() => null)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { iterateChangelogVersions } from './iterateChangelogVersions'\n\n/**\n * Find the highest semantic version from the first version-bearing element.\n *\n * Pulls the first available version string from the parsed markdown iterator.\n * Short-circuits execution immediately upon locating a match to avoid passing\n * through the remaining document structure.\n *\n * @param changelogContent The raw markdown string representing the changelog\n * @returns The highest valid semantic version string found or null\n */\nexport function extractLatestVersion(changelogContent: string): string | null {\n for (const version of iterateChangelogVersions(changelogContent)) {\n return version\n }\n\n return null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport {\n generateGitTagName,\n getGitTagMessage,\n readGitFile,\n resolveGitRevision,\n} from '#git'\nimport type { EnsureGitTagOptions } from '#git'\nimport type { Package, Tag } from '#types'\nimport { readFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport { extractLatestVersion } from '../changelog/extractLatestVersion'\nimport { verifyPackageTag } from './verifyPackageTag'\n\n/**\n * Discover and validate the Git tag for a package.\n *\n * Returns the existing tag if already present on the `pkg` object. Resolves\n * the local changelog file path, extracts the current version, and generates\n * the expected Git tag name. Verifies the tag against the repository and\n * ensures its historical changelog version matches the current local version.\n *\n * @param cwd The current working directory\n * @param pkg The package configuration object\n * @param options Dry-run and logging guards for the local tag cleanup\n * @returns The validated `Tag` object or null if validation fails\n */\nexport async function discoverPackageTag(\n cwd: string,\n pkg: Package,\n options?: EnsureGitTagOptions\n): Promise<Tag | null> {\n if (pkg.tag) {\n return pkg.tag\n }\n\n const changelogFile = pkg.changelogFile || DEFAULT_CHANGELOG_FILE\n\n const changelogFilePath = path.resolve(cwd, pkg.location, changelogFile)\n\n let localChangelogContent: string | null | undefined\n\n try {\n localChangelogContent = await readFile(changelogFilePath, 'utf-8')\n } catch {}\n\n if (!localChangelogContent) {\n return null\n }\n\n const currentVersion = extractLatestVersion(localChangelogContent)\n\n if (!currentVersion) {\n return null\n }\n\n let expectedTagName: string | null | undefined\n\n try {\n expectedTagName = generateGitTagName(pkg.entry, pkg.name, currentVersion)\n } catch {}\n\n if (!expectedTagName) {\n return null\n }\n\n if (!(await verifyPackageTag(cwd, pkg, expectedTagName, options))) {\n return null\n }\n\n const tagRef = `refs/tags/${expectedTagName}`\n\n const historicalChangelogContent = await readGitFile(\n cwd,\n await resolveGitRevision(cwd, tagRef),\n path.relative(cwd, changelogFilePath)\n )\n\n if (!historicalChangelogContent) {\n return null\n }\n\n const historicalChangelogVersion = extractLatestVersion(\n historicalChangelogContent\n )\n\n if (\n !historicalChangelogVersion ||\n historicalChangelogVersion !== currentVersion\n ) {\n return null\n }\n\n return {\n name: expectedTagName,\n message: await getGitTagMessage(cwd, expectedTagName),\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { formatFile } from '#util'\nimport type { ConsolaInstance } from 'consola/core'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { toMarkdown } from 'mdast-util-to-markdown'\nimport fs from 'node:fs/promises'\n\nconst defaultChangelogTitle = 'Changelog'\n\n/**\n * Prepend changelog content to a markdown file, creating it if necessary.\n *\n * Reads the existing file if present, prepends the new content before the main heading,\n * formats and writes the result back.\n *\n * @param filePath Path to the changelog file\n * @param revision Changelog content to prepend\n * @param logger Optional logger that receives formatting failures\n * @returns Promise that resolves when the changelog is written\n */\nexport async function prependChangelog(\n filePath: string,\n revision: string,\n logger?: ConsolaInstance\n): Promise<void> {\n let content = ''\n\n try {\n content = await fs.readFile(filePath, 'utf-8')\n } catch (err) {\n /* istanbul ignore next */\n if ((err as NodeJS.ErrnoException).code !== 'ENOENT') {\n throw err\n }\n }\n\n const root = fromMarkdown(content)\n\n let index = root.children.findIndex(\n (node) => node.type === 'heading' && node.depth === 1\n )\n\n if (index === -1) {\n index = 0\n\n root.children.unshift({\n type: 'heading',\n depth: 1,\n children: [{ type: 'text', value: defaultChangelogTitle }],\n })\n }\n\n root.children.splice(index + 1, 0, ...fromMarkdown(revision).children)\n\n content = toMarkdown(root)\n\n content = await formatFile(filePath, content, logger)\n\n await fs.writeFile(filePath, content)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport type { ReleasePlan } from '#types'\nimport type { ConsolaInstance } from 'consola/core'\nimport path from 'node:path'\nimport { prependChangelog } from './prependChangelog'\n\n/**\n * Write changelog content to the file system based on the release plan.\n *\n * @param cwd Repository working directory\n * @param plan Release plan containing package and changelog content\n * @param logger Optional logger that receives formatting failures\n * @returns Promise that resolves when the changelog file has been written\n */\nexport async function writeChangelog(\n cwd: string,\n plan: ReleasePlan,\n logger?: ConsolaInstance\n): Promise<void> {\n if (plan.release?.changelog) {\n const changelogFile = plan.package.changelogFile || DEFAULT_CHANGELOG_FILE\n\n const filePath = path.join(cwd, plan.package.location, changelogFile)\n\n await prependChangelog(filePath, plan.release.changelog, logger)\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\n/**\n * Continuation that resumes the chain with the following middleware.\n */\nexport type Next<Context> = (context: Context) => Promise<void>\n\n/**\n * Function executed as a single link in a hook dispatch chain.\n */\nexport type Middleware<Context> = {\n bivariant(context: Context, next: Next<Context>): void | Promise<void>\n}['bivariant']\n\n/**\n * Priority ranks that order middleware within a hook.\n */\nexport const Priority = {\n High: 50,\n Normal: 0,\n Low: -50,\n} as const\n\n/**\n * Registration options accepted by `on`.\n */\nexport interface RegistrationOptions<Meta> {\n priority?: number | undefined\n meta?: Meta | undefined\n}\n\n/**\n * A registration entry captured by `on`.\n *\n * Carries the `middleware`, its `priority` sort rank, and the `meta` exposed\n * to the constructor interceptor.\n */\nexport interface Registration<HookName, Context, Meta = undefined> {\n hook: HookName\n priority: number\n middleware: Middleware<Context>\n meta: Meta | undefined\n}\n\n/**\n * Intercept a registered middleware during dispatch.\n *\n * Runs in place of every registered middleware, receiving the shared\n * `context`, the `registration` being dispatched — including its `priority`\n * and `meta` — and the `next` function that continues with the following\n * middleware.\n */\nexport type Interceptor<HookName, Context, Meta = undefined> = (\n context: Context,\n registration: Registration<HookName, Context, Meta>,\n next: Next<Context>\n) => void | Promise<void>\n\ntype InferContext<M extends Middleware<unknown>> =\n M extends Middleware<infer Context> ? Context : never\n\n/**\n * Dispatch registered hooks through asynchronous execution chains.\n *\n * Stores middleware in a prioritized registry and executes them sequentially\n * in priority order.\n */\nexport class HookDispatcher<\n HookMap extends Record<keyof HookMap, Middleware<unknown>>,\n Meta = undefined,\n> {\n readonly #registry = new Map<\n keyof HookMap,\n Registration<keyof HookMap, InferContext<HookMap[keyof HookMap]>, Meta>[]\n >()\n\n readonly #interceptor:\n | Interceptor<keyof HookMap, InferContext<HookMap[keyof HookMap]>, Meta>\n | undefined\n\n /**\n * Create a hook dispatcher.\n *\n * @param interceptor Wrapper invoked in place of every registered\n * middleware during dispatch\n */\n constructor(\n interceptor?: Interceptor<\n keyof HookMap,\n InferContext<HookMap[keyof HookMap]>,\n Meta\n >\n ) {\n this.#interceptor = interceptor\n }\n\n /**\n * Register middleware for a specific hook.\n *\n * Adds the `middleware` to the internal registry for `hook` and sorts the\n * list so higher-priority middleware runs first. An omitted or `undefined`\n * `options.priority` defaults to `Priority.Normal`; `options.meta` is\n * carried on the registration for the constructor interceptor.\n *\n * @param hook Name of the hook to register\n * @param middleware Function executed when the hook dispatches\n * @param options Registration options carrying the execution order rank and\n * the metadata exposed to the constructor interceptor\n */\n on<HookName extends keyof HookMap>(\n hook: HookName,\n middleware: Middleware<InferContext<HookMap[HookName]>>,\n options?: RegistrationOptions<Meta>\n ): void {\n const registrations = this.#registry.get(hook) ?? []\n\n registrations.push({\n hook,\n middleware,\n priority: options?.priority ?? Priority.Normal,\n meta: options?.meta,\n })\n\n registrations.sort((a, b) => b.priority - a.priority)\n\n this.#registry.set(hook, registrations)\n }\n\n /**\n * Unregister middleware from a specific hook.\n *\n * Removes matching `middleware` references from the internal registry for\n * `hook`. Takes no action if `hook` has no registered middleware.\n *\n * @param hook Name of the hook to unregister from\n * @param middleware Reference of the middleware function to remove\n */\n off<HookName extends keyof HookMap>(\n hook: HookName,\n middleware: Middleware<InferContext<HookMap[HookName]>>\n ): void {\n const registrations = this.#registry.get(hook)\n\n if (!registrations) return\n\n this.#registry.set(\n hook,\n registrations.filter(\n (registration) => registration.middleware !== middleware\n )\n )\n }\n\n /**\n * Dispatch all middleware registered to a hook.\n *\n * Passes `context` through the middleware pipeline in descending priority\n * order and dispatches each registration through the constructor\n * interceptor when one is provided. Enables middleware to control\n * execution flow using `next` and executes `done` after the last\n * middleware completes.\n *\n * @param hook Name of the hook to dispatch\n * @param context Shared payload passed into each middleware\n * @param done Optional final callback run after the pipeline completes\n * @returns Promise that resolves when execution completes\n */\n async dispatch<HookName extends keyof HookMap>(\n hook: HookName,\n context: InferContext<HookMap[HookName]>,\n done?: Next<InferContext<HookMap[HookName]>>\n ): Promise<void> {\n type Context = InferContext<HookMap[HookName]>\n\n const registrations = this.#registry.get(hook) ?? []\n\n const interceptor = this.#interceptor\n\n const run = async (index: number, context: Context): Promise<void> => {\n const registration = registrations[index]\n\n if (!registration) {\n return done ? await done(context) : undefined\n }\n\n let isNextCalled = false\n\n const next: Next<Context> = async (context) => {\n if (isNextCalled) return\n isNextCalled = true\n return await run(index + 1, context)\n }\n\n const middleware: Middleware<Context> = interceptor\n ? (context, next) => interceptor(context, registration, next)\n : registration.middleware\n\n return await middleware(context, next)\n }\n\n return await run(0, context)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,YACd,KACA,KACA,UACwB;CACxB,OAAO,QAAQ,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,IAAI;AACtE;;;;;;;;;;;;ACbA,SAAgB,qBAAqB,kBAA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F;CACF;;;;;;;;;;;;;;;CAgBA,MAAM,SACJ,MACA,SACA,MACe;EAGf,MAAM,gBAAgB,KAAK,UAAU,IAAI,IAAI,KAAK,CAAC;EAEnD,MAAM,cAAc,KAAK;EAEzB,MAAM,MAAM,OAAO,OAAe,YAAoC;GACpE,MAAM,eAAe,cAAc;GAEnC,IAAI,CAAC,cACH,OAAO,OAAO,MAAM,KAAK,OAAO,IAAI,KAAA;GAGtC,IAAI,eAAe;GAEnB,MAAM,OAAsB,OAAO,YAAY;IAC7C,IAAI,cAAc;IAClB,eAAe;IACf,OAAO,MAAM,IAAI,QAAQ,GAAG,OAAO;GACrC;GAMA,OAAO,OAJiC,eACnC,SAAS,SAAS,YAAY,SAAS,cAAc,IAAI,IAC1D,aAAa,WAAA,CAEO,SAAS,IAAI;EACvC;EAEA,OAAO,MAAM,IAAI,GAAG,OAAO;CAC7B;AACF"}
|
package/dist/analyzer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as deriveTransitionReleases, s as deriveChangeReleases, t as propagateDependencyUpdates } from "./propagateDependencyUpdates-
|
|
2
|
-
import { t as readPackageHistory } from "./readPackageHistory-
|
|
3
|
-
import { t as resolvePackageTag } from "./resolvePackageTag-
|
|
4
|
-
import { t as version } from "./package-
|
|
1
|
+
import { o as deriveTransitionReleases, s as deriveChangeReleases, t as propagateDependencyUpdates } from "./propagateDependencyUpdates-xcPvP5SP.js";
|
|
2
|
+
import { t as readPackageHistory } from "./readPackageHistory-6dC72rZk.js";
|
|
3
|
+
import { t as resolvePackageTag } from "./resolvePackageTag-2ldvH7PC.js";
|
|
4
|
+
import { t as version } from "./package-la-hLPRR.js";
|
|
5
5
|
// src/analyzer.ts
|
|
6
6
|
/**
|
|
7
7
|
* Built-in plugin that inspects repository history and produces release plans for packages.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as SEMVER_REGEX, w as formatError } from "./package-
|
|
1
|
+
import { N as SEMVER_REGEX, w as formatError } from "./package-la-hLPRR.js";
|
|
2
2
|
import semver from "semver";
|
|
3
3
|
import prettier from "prettier";
|
|
4
4
|
import path from "node:path";
|
|
@@ -184,4 +184,4 @@ async function buildChangelog(context, history, options = {}) {
|
|
|
184
184
|
}
|
|
185
185
|
export { formatFile as a, extractPlainText as i, iterateChangelogVersions as n, compact as o, extractSemVer as r, isDefined as s, buildChangelog as t };
|
|
186
186
|
|
|
187
|
-
//# sourceMappingURL=buildChangelog-
|
|
187
|
+
//# sourceMappingURL=buildChangelog-CkytKypk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildChangelog-Cxm9_lq2.js","names":[],"sources":["../src/util/isDefined.ts","../src/util/compact.ts","../src/util/formatFile.ts","../src/workflow/changelog/extractPlainText.ts","../src/workflow/changelog/extractSemVer.ts","../src/workflow/changelog/iterateChangelogVersions.ts","../src/workflow/changelog/buildChangelog.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\n/**\n * Type guard that asserts a value is neither `null` nor `undefined`.\n *\n * @param value Value to test\n * @returns `true` when `value` is not `null` or `undefined`\n */\nexport function isDefined<T>(value: T): value is NonNullable<T> {\n return value != null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { isDefined } from './isDefined'\n\n/**\n * Remove `null` and `undefined` values from an array.\n *\n * @param array The array to compact\n * @returns A new array that does not contain `null` or `undefined` values\n */\nexport function compact<T>(array: readonly (T | null | undefined)[]): T[] {\n return array.filter(isDefined)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ConsolaInstance } from 'consola/core'\nimport prettier from 'prettier'\nimport { formatError } from './formatError'\n\n/**\n * Format `content` for `filePath` using Prettier when possible.\n *\n * Resolves project/editorconfig settings and formats the provided content.\n * Returns the original content on error or when no parser is inferred, and\n * reports the failure through `logger` at debug level when one is provided.\n *\n * @param filePath Path used to infer parser and config\n * @param content Source content to format\n * @param logger Optional logger that receives formatting failures\n * @returns Formatted content or original content on failure\n */\nexport async function formatFile(\n filePath: string,\n content: string,\n logger?: ConsolaInstance\n): Promise<string> {\n try {\n const info = await prettier.getFileInfo(filePath, {\n resolveConfig: true,\n })\n\n const config = await prettier.resolveConfig(filePath, {\n editorconfig: true,\n })\n\n if (info.inferredParser == null) {\n return content\n }\n\n return await prettier.format(content, {\n ...config,\n parser: info.inferredParser,\n filepath: filePath,\n })\n } catch (error: unknown) {\n logger?.debug(\n `Formatting \"${filePath}\" failed and content stays unformatted: ${formatError(error)}`\n )\n\n return content\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { Heading, Paragraph, PhrasingContent } from 'mdast'\n\n/**\n * Extract trimmed plain text from a Heading, Paragraph, or PhrasingContent node.\n *\n * Performs a depth-first traversal, concatenating string `value` tokens in\n * document order. Non-string values are ignored. Returns `null` for empty or\n * missing input.\n *\n * @param node Node to extract text from\n * @returns The trimmed plain-text string, or null if empty\n */\nexport function extractPlainText(\n node: Heading | Paragraph | PhrasingContent | null | undefined\n): string | null {\n if (!node) {\n return null\n }\n\n const queue = [node]\n let result = ''\n\n while ((node = queue.shift())) {\n if ('value' in node && typeof node.value === 'string') {\n result += node.value\n }\n\n /* istanbul ignore else */\n if ('children' in node && Array.isArray(node.children)) {\n queue.unshift(...node.children)\n }\n }\n\n return result.trim() || null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { SEMVER_REGEX } from '#config'\nimport { compact } from '#util'\n\nconst ANCHORED_SEMVER_REGEX = new RegExp(`^${SEMVER_REGEX.source}$`)\n\nconst BRACKETED_SEMVER_REGEX = new RegExp(`\\\\[${SEMVER_REGEX.source}\\\\]`)\n\n/**\n * Extract SemVer core strings from a line.\n *\n * Splits the line on runs of spaces or tabs and on `..`/`...`. For each token,\n * first attempts an anchored SemVer match (must match the whole token), then\n * a bracketed match that finds a SemVer inside `[...]`. Returns the captured\n * SemVer core (capture group 2) for each successful match; falsy results are\n * filtered out.\n *\n * @param line Line to scan for SemVer cores\n * @returns Array of extracted SemVer core strings; empty if none\n */\nexport function extractSemVer(line: string): string[] {\n const tokens = line.split(/[ \\t]+|\\.{2,3}/)\n\n return compact(\n tokens.map((token) => {\n return (\n ANCHORED_SEMVER_REGEX.exec(token) ?? BRACKETED_SEMVER_REGEX.exec(token)\n )?.at(2)\n })\n )\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { RootContent } from 'mdast'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport semver from 'semver'\nimport { extractPlainText } from './extractPlainText'\nimport { extractSemVer } from './extractSemVer'\n\nconst SENTENCE_TERMINAL_REGEX = /\\p{Sentence_Terminal}$/u\n\n/**\n * Iterate over Semantic Version strings extracted from a Markdown changelog.\n *\n * Parses `changelogContent` into an AST and evaluates nodes sequentially using\n * custom extractors. Evaluates heading nodes first before checking short\n * paragraph nodes. Stops execution after the first strategy yields valid\n * versions.\n *\n * @param changelogContent Raw Markdown text of the changelog\n * @yields Valid SemVer strings found in headings or candidate paragraphs\n */\nexport function* iterateChangelogVersions(\n changelogContent: string\n): Generator<string> {\n const root = fromMarkdown(changelogContent)\n\n const nodeExtractors = [\n (node: RootContent): string | null => {\n return node.type === 'heading' ? extractPlainText(node) : null\n },\n\n (node: RootContent): string | null => {\n if (node.type !== 'paragraph') return null\n\n const paragraphText = extractPlainText(node)\n\n if (\n !paragraphText ||\n paragraphText.length > 48 ||\n SENTENCE_TERMINAL_REGEX.test(paragraphText)\n ) {\n return null\n }\n\n return paragraphText\n },\n ]\n\n for (const extractText of nodeExtractors) {\n let isVersionFound = false\n\n for (const node of root.children) {\n const extractedText = extractText(node)\n\n const candidateVersion = extractedText\n ? semver.sort(extractSemVer(extractedText)).pop()\n : null\n\n if (candidateVersion && semver.valid(candidateVersion)) {\n isVersionFound = true\n yield candidateVersion\n }\n }\n\n if (isVersionFound) {\n return\n }\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport type { GitCommit, ReleaseContext } from '#types'\nimport { formatFile } from '#util'\nimport createPreset from 'conventional-changelog-conventionalcommits'\nimport {\n writeChangelogString,\n type CommitKnownProps,\n type FinalTemplateContext,\n type Options,\n type TemplateContext,\n} from 'conventional-changelog-writer'\nimport path from 'node:path'\n\nexport interface BuildChangelogOptions {\n packageDir?: string | undefined\n changelogFile?: string | undefined\n version?: string | null | undefined\n previousTag?: string | null | undefined\n currentTag?: string | null | undefined\n}\n\ninterface ConventionalCommitsPreset {\n writer: Options\n}\n\nlet presetCache: ConventionalCommitsPreset | undefined\n\n/**\n * Load the conventional commits preset on first use.\n *\n * Creating the preset performs setup work that used to run at import time\n * through a module-level await; loading it lazily keeps importing this\n * module synchronous and skips the cost for consumers that never build a\n * changelog.\n *\n * @returns The cached preset, created on the first call\n */\nasync function loadPreset(): Promise<ConventionalCommitsPreset> {\n presetCache ??= await createPreset()\n\n return presetCache\n}\n\n/**\n * Build the changelog string for a release.\n *\n * Compiles commit history and release context into a formatted changelog using\n * conventional commits and writer configurations. Resolves file paths and handles\n * tag comparisons when repository URLs are available.\n *\n * @param context The release context containing repository and working directory details\n * @param history The iterable or async iterable collection of commits to process\n * @param options The build configuration options for the changelog\n * @returns The formatted changelog content string\n */\nexport async function buildChangelog(\n context: ReleaseContext,\n history: Iterable<GitCommit> | AsyncIterable<GitCommit>,\n options: BuildChangelogOptions = {}\n): Promise<string> {\n const preset = await loadPreset()\n\n const repository = context.repository?.url || undefined\n\n const version = options.version || undefined\n\n const previousTag = options.previousTag || undefined\n\n const currentTag = options.currentTag || undefined\n\n const filePath = path.join(\n context.cwd,\n options.packageDir || '.',\n options.changelogFile || DEFAULT_CHANGELOG_FILE\n )\n\n const headerPartial = (context: FinalTemplateContext) => {\n return context.version ? preset.writer.headerPartial?.(context) : undefined\n }\n\n const content = await writeChangelogString<CommitKnownProps>(\n history,\n {\n date: context.today,\n version,\n previousTag,\n currentTag,\n linkCompare: !!repository && !!previousTag && !!currentTag,\n linkReferences: !!repository,\n repoUrl: repository,\n commit: 'commit',\n issue: 'issues',\n headerPartial,\n } as TemplateContext,\n preset.writer\n )\n\n return formatFile(filePath, content, context.logger)\n}\n"],"mappings":";;;;;;;;;;;;;;AASA,SAAgB,UAAa,OAAmC;CAC9D,OAAO,SAAS;AAClB;;;;;;;;ACAA,SAAgB,QAAW,OAA+C;CACxE,OAAO,MAAM,OAAO,SAAS;AAC/B;;;;;;;;;;;;;;ACMA,eAAsB,WACpB,UACA,SACA,QACiB;CACjB,IAAI;EACF,MAAM,OAAO,MAAM,SAAS,YAAY,UAAU,EAChD,eAAe,KACjB,CAAC;EAED,MAAM,SAAS,MAAM,SAAS,cAAc,UAAU,EACpD,cAAc,KAChB,CAAC;EAED,IAAI,KAAK,kBAAkB,MACzB,OAAO;EAGT,OAAO,MAAM,SAAS,OAAO,SAAS;GACpC,GAAG;GACH,QAAQ,KAAK;GACb,UAAU;EACZ,CAAC;CACH,SAAS,OAAgB;EACvB,QAAQ,MACN,eAAe,SAAS,0CAA0C,YAAY,KAAK,GACrF;EAEA,OAAO;CACT;AACF;;;;;;;;;;;;AClCA,SAAgB,iBACd,MACe;CACf,IAAI,CAAC,MACH,OAAO;CAGT,MAAM,QAAQ,CAAC,IAAI;CACnB,IAAI,SAAS;CAEb,OAAQ,OAAO,MAAM,MAAM,GAAI;EAC7B,IAAI,WAAW,QAAQ,OAAO,KAAK,UAAU,UAC3C,UAAU,KAAK;;EAIjB,IAAI,cAAc,QAAQ,MAAM,QAAQ,KAAK,QAAQ,GACnD,MAAM,QAAQ,GAAG,KAAK,QAAQ;CAElC;CAEA,OAAO,OAAO,KAAK,KAAK;AAC1B;;AC/BA,IAAM,wBAAwB,IAAI,OAAO,IAAI,aAAa,OAAO,EAAE;AAEnE,IAAM,yBAAyB,IAAI,OAAO,MAAM,aAAa,OAAO,IAAI;;;;;;;;;;;;;AAcxE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,MAAM,WAAW,KAAK,KACpB,QAAQ,KACR,QAAQ,cAAc,KACtB,QAAQ,iBAAA,cACV;CAEA,MAAM,iBAAiB,YAAkC;EACvD,OAAO,QAAQ,UAAU,OAAO,OAAO,gBAAgB,OAAO,IAAI,KAAA;CACpE;CAmBA,OAAO,WAAW,UAAU,MAjBN,qBACpB,SACA;EACE,MAAM,QAAQ;EACd;EACA;EACA;EACA,aAAa,CAAC,CAAC,cAAc,CAAC,CAAC,eAAe,CAAC,CAAC;EAChD,gBAAgB,CAAC,CAAC;EAClB,SAAS;EACT,QAAQ;EACR,OAAO;EACP;CACF,GACA,OAAO,MACT,GAEqC,QAAQ,MAAM;AACrD"}
|
|
1
|
+
{"version":3,"file":"buildChangelog-CkytKypk.js","names":[],"sources":["../src/util/isDefined.ts","../src/util/compact.ts","../src/util/formatFile.ts","../src/workflow/changelog/extractPlainText.ts","../src/workflow/changelog/extractSemVer.ts","../src/workflow/changelog/iterateChangelogVersions.ts","../src/workflow/changelog/buildChangelog.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\n/**\n * Type guard that asserts a value is neither `null` nor `undefined`.\n *\n * @param value Value to test\n * @returns `true` when `value` is not `null` or `undefined`\n */\nexport function isDefined<T>(value: T): value is NonNullable<T> {\n return value != null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { isDefined } from './isDefined'\n\n/**\n * Remove `null` and `undefined` values from an array.\n *\n * @param array The array to compact\n * @returns A new array that does not contain `null` or `undefined` values\n */\nexport function compact<T>(array: readonly (T | null | undefined)[]): T[] {\n return array.filter(isDefined)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ConsolaInstance } from 'consola/core'\nimport prettier from 'prettier'\nimport { formatError } from './formatError'\n\n/**\n * Format `content` for `filePath` using Prettier when possible.\n *\n * Resolves project/editorconfig settings and formats the provided content.\n * Returns the original content on error or when no parser is inferred, and\n * reports the failure through `logger` at debug level when one is provided.\n *\n * @param filePath Path used to infer parser and config\n * @param content Source content to format\n * @param logger Optional logger that receives formatting failures\n * @returns Formatted content or original content on failure\n */\nexport async function formatFile(\n filePath: string,\n content: string,\n logger?: ConsolaInstance\n): Promise<string> {\n try {\n const info = await prettier.getFileInfo(filePath, {\n resolveConfig: true,\n })\n\n const config = await prettier.resolveConfig(filePath, {\n editorconfig: true,\n })\n\n if (info.inferredParser == null) {\n return content\n }\n\n return await prettier.format(content, {\n ...config,\n parser: info.inferredParser,\n filepath: filePath,\n })\n } catch (error: unknown) {\n logger?.debug(\n `Formatting \"${filePath}\" failed and content stays unformatted: ${formatError(error)}`\n )\n\n return content\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { Heading, Paragraph, PhrasingContent } from 'mdast'\n\n/**\n * Extract trimmed plain text from a Heading, Paragraph, or PhrasingContent node.\n *\n * Performs a depth-first traversal, concatenating string `value` tokens in\n * document order. Non-string values are ignored. Returns `null` for empty or\n * missing input.\n *\n * @param node Node to extract text from\n * @returns The trimmed plain-text string, or null if empty\n */\nexport function extractPlainText(\n node: Heading | Paragraph | PhrasingContent | null | undefined\n): string | null {\n if (!node) {\n return null\n }\n\n const queue = [node]\n let result = ''\n\n while ((node = queue.shift())) {\n if ('value' in node && typeof node.value === 'string') {\n result += node.value\n }\n\n /* istanbul ignore else */\n if ('children' in node && Array.isArray(node.children)) {\n queue.unshift(...node.children)\n }\n }\n\n return result.trim() || null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { SEMVER_REGEX } from '#config'\nimport { compact } from '#util'\n\nconst ANCHORED_SEMVER_REGEX = new RegExp(`^${SEMVER_REGEX.source}$`)\n\nconst BRACKETED_SEMVER_REGEX = new RegExp(`\\\\[${SEMVER_REGEX.source}\\\\]`)\n\n/**\n * Extract SemVer core strings from a line.\n *\n * Splits the line on runs of spaces or tabs and on `..`/`...`. For each token,\n * first attempts an anchored SemVer match (must match the whole token), then\n * a bracketed match that finds a SemVer inside `[...]`. Returns the captured\n * SemVer core (capture group 2) for each successful match; falsy results are\n * filtered out.\n *\n * @param line Line to scan for SemVer cores\n * @returns Array of extracted SemVer core strings; empty if none\n */\nexport function extractSemVer(line: string): string[] {\n const tokens = line.split(/[ \\t]+|\\.{2,3}/)\n\n return compact(\n tokens.map((token) => {\n return (\n ANCHORED_SEMVER_REGEX.exec(token) ?? BRACKETED_SEMVER_REGEX.exec(token)\n )?.at(2)\n })\n )\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { RootContent } from 'mdast'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport semver from 'semver'\nimport { extractPlainText } from './extractPlainText'\nimport { extractSemVer } from './extractSemVer'\n\nconst SENTENCE_TERMINAL_REGEX = /\\p{Sentence_Terminal}$/u\n\n/**\n * Iterate over Semantic Version strings extracted from a Markdown changelog.\n *\n * Parses `changelogContent` into an AST and evaluates nodes sequentially using\n * custom extractors. Evaluates heading nodes first before checking short\n * paragraph nodes. Stops execution after the first strategy yields valid\n * versions.\n *\n * @param changelogContent Raw Markdown text of the changelog\n * @yields Valid SemVer strings found in headings or candidate paragraphs\n */\nexport function* iterateChangelogVersions(\n changelogContent: string\n): Generator<string> {\n const root = fromMarkdown(changelogContent)\n\n const nodeExtractors = [\n (node: RootContent): string | null => {\n return node.type === 'heading' ? extractPlainText(node) : null\n },\n\n (node: RootContent): string | null => {\n if (node.type !== 'paragraph') return null\n\n const paragraphText = extractPlainText(node)\n\n if (\n !paragraphText ||\n paragraphText.length > 48 ||\n SENTENCE_TERMINAL_REGEX.test(paragraphText)\n ) {\n return null\n }\n\n return paragraphText\n },\n ]\n\n for (const extractText of nodeExtractors) {\n let isVersionFound = false\n\n for (const node of root.children) {\n const extractedText = extractText(node)\n\n const candidateVersion = extractedText\n ? semver.sort(extractSemVer(extractedText)).pop()\n : null\n\n if (candidateVersion && semver.valid(candidateVersion)) {\n isVersionFound = true\n yield candidateVersion\n }\n }\n\n if (isVersionFound) {\n return\n }\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport type { GitCommit, ReleaseContext } from '#types'\nimport { formatFile } from '#util'\nimport createPreset from 'conventional-changelog-conventionalcommits'\nimport {\n writeChangelogString,\n type CommitKnownProps,\n type FinalTemplateContext,\n type Options,\n type TemplateContext,\n} from 'conventional-changelog-writer'\nimport path from 'node:path'\n\nexport interface BuildChangelogOptions {\n packageDir?: string | undefined\n changelogFile?: string | undefined\n version?: string | null | undefined\n previousTag?: string | null | undefined\n currentTag?: string | null | undefined\n}\n\ninterface ConventionalCommitsPreset {\n writer: Options\n}\n\nlet presetCache: ConventionalCommitsPreset | undefined\n\n/**\n * Load the conventional commits preset on first use.\n *\n * Creating the preset performs setup work that used to run at import time\n * through a module-level await; loading it lazily keeps importing this\n * module synchronous and skips the cost for consumers that never build a\n * changelog.\n *\n * @returns The cached preset, created on the first call\n */\nasync function loadPreset(): Promise<ConventionalCommitsPreset> {\n presetCache ??= await createPreset()\n\n return presetCache\n}\n\n/**\n * Build the changelog string for a release.\n *\n * Compiles commit history and release context into a formatted changelog using\n * conventional commits and writer configurations. Resolves file paths and handles\n * tag comparisons when repository URLs are available.\n *\n * @param context The release context containing repository and working directory details\n * @param history The iterable or async iterable collection of commits to process\n * @param options The build configuration options for the changelog\n * @returns The formatted changelog content string\n */\nexport async function buildChangelog(\n context: ReleaseContext,\n history: Iterable<GitCommit> | AsyncIterable<GitCommit>,\n options: BuildChangelogOptions = {}\n): Promise<string> {\n const preset = await loadPreset()\n\n const repository = context.repository?.url || undefined\n\n const version = options.version || undefined\n\n const previousTag = options.previousTag || undefined\n\n const currentTag = options.currentTag || undefined\n\n const filePath = path.join(\n context.cwd,\n options.packageDir || '.',\n options.changelogFile || DEFAULT_CHANGELOG_FILE\n )\n\n const headerPartial = (context: FinalTemplateContext) => {\n return context.version ? preset.writer.headerPartial?.(context) : undefined\n }\n\n const content = await writeChangelogString<CommitKnownProps>(\n history,\n {\n date: context.today,\n version,\n previousTag,\n currentTag,\n linkCompare: !!repository && !!previousTag && !!currentTag,\n linkReferences: !!repository,\n repoUrl: repository,\n commit: 'commit',\n issue: 'issues',\n headerPartial,\n } as TemplateContext,\n preset.writer\n )\n\n return formatFile(filePath, content, context.logger)\n}\n"],"mappings":";;;;;;;;;;;;;;AASA,SAAgB,UAAa,OAAmC;CAC9D,OAAO,SAAS;AAClB;;;;;;;;ACAA,SAAgB,QAAW,OAA+C;CACxE,OAAO,MAAM,OAAO,SAAS;AAC/B;;;;;;;;;;;;;;ACMA,eAAsB,WACpB,UACA,SACA,QACiB;CACjB,IAAI;EACF,MAAM,OAAO,MAAM,SAAS,YAAY,UAAU,EAChD,eAAe,KACjB,CAAC;EAED,MAAM,SAAS,MAAM,SAAS,cAAc,UAAU,EACpD,cAAc,KAChB,CAAC;EAED,IAAI,KAAK,kBAAkB,MACzB,OAAO;EAGT,OAAO,MAAM,SAAS,OAAO,SAAS;GACpC,GAAG;GACH,QAAQ,KAAK;GACb,UAAU;EACZ,CAAC;CACH,SAAS,OAAgB;EACvB,QAAQ,MACN,eAAe,SAAS,0CAA0C,YAAY,KAAK,GACrF;EAEA,OAAO;CACT;AACF;;;;;;;;;;;;AClCA,SAAgB,iBACd,MACe;CACf,IAAI,CAAC,MACH,OAAO;CAGT,MAAM,QAAQ,CAAC,IAAI;CACnB,IAAI,SAAS;CAEb,OAAQ,OAAO,MAAM,MAAM,GAAI;EAC7B,IAAI,WAAW,QAAQ,OAAO,KAAK,UAAU,UAC3C,UAAU,KAAK;;EAIjB,IAAI,cAAc,QAAQ,MAAM,QAAQ,KAAK,QAAQ,GACnD,MAAM,QAAQ,GAAG,KAAK,QAAQ;CAElC;CAEA,OAAO,OAAO,KAAK,KAAK;AAC1B;;AC/BA,IAAM,wBAAwB,IAAI,OAAO,IAAI,aAAa,OAAO,EAAE;AAEnE,IAA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Ac,QAAQ,eAAe,KAAA;CAE3C,MAAM,aAAa,QAAQ,cAAc,KAAA;CAEzC,MAAM,WAAW,KAAK,KACpB,QAAQ,KACR,QAAQ,cAAc,KACtB,QAAQ,iBAAA,cACV;CAEA,MAAM,iBAAiB,YAAkC;EACvD,OAAO,QAAQ,UAAU,OAAO,OAAO,gBAAgB,OAAO,IAAI,KAAA;CACpE;CAmBA,OAAO,WAAW,UAAU,MAjBN,qBACpB,SACA;EACE,MAAM,QAAQ;EACd;EACA;EACA;EACA,aAAa,CAAC,CAAC,cAAc,CAAC,CAAC,eAAe,CAAC,CAAC;EAChD,gBAAgB,CAAC,CAAC;EAClB,SAAS;EACT,QAAQ;EACR,OAAO;EACP;CACF,GACA,OAAO,MACT,GAEqC,QAAQ,MAAM;AACrD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as extractVersionQualifier } from "./readPackageHistory-
|
|
2
|
-
import { a as generateGitTagName, i as getGitTagMessage, k as DEFAULT_CHANGELOG_FILE, n as verifyPackageTag } from "./package-
|
|
3
|
-
import { a as formatFile, n as iterateChangelogVersions, t as buildChangelog } from "./buildChangelog-
|
|
1
|
+
import { a as extractVersionQualifier } from "./readPackageHistory-6dC72rZk.js";
|
|
2
|
+
import { a as generateGitTagName, i as getGitTagMessage, k as DEFAULT_CHANGELOG_FILE, n as verifyPackageTag } from "./package-la-hLPRR.js";
|
|
3
|
+
import { a as formatFile, n as iterateChangelogVersions, t as buildChangelog } from "./buildChangelog-CkytKypk.js";
|
|
4
4
|
import semver from "semver";
|
|
5
5
|
import { readFile } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
@@ -138,4 +138,4 @@ async function buildReleaseNotes(context, history) {
|
|
|
138
138
|
}
|
|
139
139
|
export { bumpVersion as i, resolvePackageStableTag as n, isSameReleaseCycle as r, buildReleaseNotes as t };
|
|
140
140
|
|
|
141
|
-
//# sourceMappingURL=buildReleaseNotes-
|
|
141
|
+
//# sourceMappingURL=buildReleaseNotes-Dk4bEclG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildReleaseNotes-S6HcEQnE.js","names":[],"sources":["../src/workflow/version/bumpVersion.ts","../src/workflow/version/isSameReleaseCycle.ts","../src/workflow/discovery/resolvePackageStableTag.ts","../src/workflow/changelog/buildReleaseNotes.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseType, VersionTransition } from '#types'\nimport semver from 'semver'\nimport { extractVersionQualifier } from './extractVersionQualifier'\n\nexport interface BumpVersionOptions {\n version: string\n release: ReleaseType | null | undefined\n identifier?: string | null | undefined\n transition?: VersionTransition | null | undefined\n}\n\n/**\n * Bump a semantic version string based on release and transition rules.\n *\n * Parses the target version and determines the next version string using the\n * specified release type, prerelease identifier, and transition mode. Adjusts\n * prerelease types when continuing an existing qualifier and returns `null` when\n * `options.release` is omitted or if transition conditions fail.\n *\n * @param options Version bump configuration including release type, identifier, and transition rules\n * @returns The bumped semantic version string, or `null` if no bump occurs\n * @throws If `options.version` is not a valid semantic version\n */\nexport function bumpVersion(options: BumpVersionOptions): string | null {\n const { version } = options\n\n const parsed = semver.parse(version)\n\n if (!parsed) {\n throw new Error(`Version \"${version}\" is not a valid semantic version.`)\n }\n\n if (!options.release) {\n return null\n }\n\n if (parsed.prerelease.length > 0) {\n if (options.transition === 'advance' && options.identifier == null) {\n return null\n }\n } else {\n if (options.transition === 'continue') {\n return null\n }\n }\n\n let release: semver.ReleaseType = options.release\n let identifier: string | undefined\n\n if (typeof options.identifier === 'string') {\n release = `pre${options.release}` as const\n identifier = options.identifier\n\n const parsedIdentifier = extractVersionQualifier(parsed)\n\n const transition =\n options.transition ??\n (parsedIdentifier && identifier === '' ? 'advance' : 'continue')\n\n if (typeof parsedIdentifier === 'string' && transition === 'continue') {\n if (\n (release === 'premajor' && parsed.minor === 0 && parsed.patch === 0) ||\n (release === 'preminor' && parsed.patch === 0) ||\n release === 'prepatch'\n ) {\n release = 'prerelease'\n }\n }\n }\n\n return semver.inc(parsed, release, { loose: false }, identifier, '0')\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport semver from 'semver'\n\n/**\n * Determine whether two semantic version strings or objects belong to the same release cycle.\n *\n * Compares the main version components of `currentVersion` and `nextVersion` to\n * determine equality. Treats a transition from a non-zero `0.x` version to\n * `1.0.0` as part of the same release cycle. Returns `false` if either input\n * cannot be parsed.\n *\n * @param currentVersion Starting version string, `semver.SemVer` instance, or nullish value\n * @param nextVersion Target version string, `semver.SemVer` instance, or nullish value\n * @returns `true` if both versions belong to the same release cycle, `false` otherwise\n */\nexport function isSameReleaseCycle(\n currentVersion: string | semver.SemVer | null | undefined,\n nextVersion: string | semver.SemVer | null | undefined\n): boolean {\n const current = semver.parse(currentVersion)\n const next = semver.parse(nextVersion)\n\n if (!current || !next) return false\n\n if (current.compareMain(next) === 0) return true\n\n return (\n current.major === 0 &&\n (current.minor > 0 || current.patch > 0) &&\n next.major === 1 &&\n next.minor === 0 &&\n next.patch === 0\n )\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport { generateGitTagName, getGitTagMessage } from '#git'\nimport type { EnsureGitTagOptions } from '#git'\nimport type { Package, Tag } from '#types'\nimport { readFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport semver from 'semver'\nimport { iterateChangelogVersions } from '../changelog/iterateChangelogVersions'\nimport { verifyPackageTag } from './verifyPackageTag'\n\n/**\n * Resolve the latest stable Git tag for a package.\n *\n * Reads changelog release versions for `pkg` and verifies strict descending\n * semver order. Ignores prerelease versions unless transitioning across major\n * or prerelease boundaries, and verifies that the matching Git tag exists.\n *\n * Stable releases below `1.0.0` are only considered when the preceding\n * version was a prerelease, so a repository with exclusively 0.x releases\n * resolves to no stable tag.\n *\n * @param cwd Absolute path to the root working directory\n * @param pkg Package configuration object\n * @param options Dry-run and logging guards for the local tag cleanup\n * @returns Verified tag metadata object or `null` if no stable tag is resolved\n * @throws If a version is invalid, versions are not in strict descending\n * order, or the corresponding Git tag is missing\n */\nexport async function resolvePackageStableTag(\n cwd: string,\n pkg: Package,\n options?: EnsureGitTagOptions\n): Promise<Tag | null> {\n const changelogFile = pkg.changelogFile || DEFAULT_CHANGELOG_FILE\n\n const changelogFilePath = path.resolve(cwd, pkg.location, changelogFile)\n\n let changelogContent: string\n\n try {\n changelogContent = await readFile(changelogFilePath, 'utf-8')\n } catch (error: unknown) {\n /* istanbul ignore else */\n if ((error as NodeJS.ErrnoException)?.code === 'ENOENT') {\n return null\n }\n\n /* istanbul ignore next */\n throw error\n }\n\n let precedingVersion: semver.SemVer | null = null\n\n for (const version of iterateChangelogVersions(changelogContent)) {\n const currentVersion = semver.parse(version)\n\n if (!currentVersion) {\n throw new Error(`Version \"${version}\" is not a valid semantic version.`)\n }\n\n if (precedingVersion && semver.gte(currentVersion, precedingVersion)) {\n throw new Error(\n `Version \"${version}\" must be strictly lower than preceding version \"${precedingVersion.raw}\".`\n )\n }\n\n if (\n !semver.prerelease(currentVersion) &&\n (currentVersion.major >= 1 ||\n (precedingVersion && semver.prerelease(precedingVersion)))\n ) {\n const tagName = generateGitTagName(pkg.entry, pkg.name, version)\n\n if (!(await verifyPackageTag(cwd, pkg, tagName, options))) {\n throw new Error(\n `Git tag \"${tagName}\" is not associated with package \"${pkg.name ?? ''}\" in directory \"${pkg.location}\".`\n )\n }\n\n return {\n name: tagName,\n message: await getGitTagMessage(cwd, tagName),\n }\n }\n\n precedingVersion = currentVersion\n }\n\n return null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport type { GitCommit, ReleaseContext } from '#types'\nimport { formatFile } from '#util'\nimport type { Heading, RootContent } from 'mdast'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { toMarkdown } from 'mdast-util-to-markdown'\nimport path from 'node:path'\nimport { buildChangelog } from './buildChangelog'\n\n/**\n * Build release notes from a release context and commit history.\n *\n * Generates changelog content from commits, parses it into an abstract syntax\n * tree, shifts heading depths, and formats the resulting markdown file.\n *\n * @param context The release context containing repository and configuration details\n * @param history The iterable or async iterable collection of commits to process\n * @returns The formatted release notes as a markdown string\n */\nexport async function buildReleaseNotes(\n context: ReleaseContext,\n history: Iterable<GitCommit> | AsyncIterable<GitCommit>\n): Promise<string> {\n const changelogContent = await buildChangelog(context, history)\n\n const root = fromMarkdown(changelogContent)\n\n root.children = root.children.flatMap<RootContent>((node) => {\n if (node.type === 'heading') {\n /* istanbul ignore next */\n if (node.depth <= 2) {\n return []\n }\n\n node = {\n ...node,\n depth: (node.depth - 1) as Heading['depth'],\n }\n }\n\n return node\n })\n\n const filePath = path.join(context.cwd, DEFAULT_CHANGELOG_FILE)\n\n return formatFile(filePath, toMarkdown(root), context.logger)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,YAAY,SAA4C;CACtE,MAAM,EAAE,YAAY;CAEpB,MAAM,SAAS,OAAO,MAAM,OAAO;CAEnC,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,YAAY,QAAQ,mCAAmC;CAGzE,IAAI,CAAC,QAAQ,SACX,OAAO;CAGT,IAAI,OAAO,WAAW,SAAS,GACzB;MAAA,QAAQ,eAAe,aAAa,QAAQ,cAAc,MAC5D,OAAO;CAAA,OAGT,IAAI,QAAQ,eAAe,YACzB,OAAO;CAIX,IAAI,UAA8B,QAAQ;CAC1C,IAAI;CAEJ,IAAI,OAAO,QAAQ,eAAe,UAAU;EAC1C,UAAU,MAAM,QAAQ;EACxB,aAAa,QAAQ;EAErB,MAAM,mBAAmB,wBAAwB,MAAM;EAEvD,MAAM,aACJ,QAAQ,eACP,oBAAoB,eAAe,KAAK,YAAY;EAEvD,IAAI,OAAO,qBAAqB,YAAY,eAAe,YAEtD;OAAA,YAAY,cAAc,OAAO,UAAU,KAAK,OAAO,UAAU,KACjE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AE,MAAM,iBAAiB,KAAK,KAAK,SAAS,OAAO,GACrD,MAAM,IAAI,MACR,YAAY,QAAQ,oCAAoC,IAAI,QAAQ,GAAG,kBAAkB,IAAI,SAAS,GACxG;GAGF,OAAO;IACL,MAAM;IACN,SAAS,MAAM,iBAAiB,KAAK,OAAO;GAC9C;EACF;EAEA,mBAAmB;CACrB;CAEA,OAAO;AACT;;;;;;;;;;;;ACtEA,eAAsB,kBACpB,SACA,SACiB;CACjB,MAAM,mBAAmB,MAAM,eAAe,SAAS,OAAO;CAE9D,MAAM,OAAO,aAAa,gBAAgB;CAE1C,KAAK,WAAW,KAAK,SAAS,SAAsB,SAAS;EAC3D,IAAI,KAAK,SAAS,WAAW;;GAE3B,IAAI,KAAK,SAAS,GAChB,OAAO,CAAC;GAGV,OAAO;IACL,GAAG;IACH,OAAQ,KAAK,QAAQ;GACvB;EACF;EAEA,OAAO;CACT,CAAC;CAED,MAAM,WAAW,KAAK,KAAK,QAAQ,KAAK,sBAAsB;CAE9D,OAAO,WAAW,UAAU,WAAW,IAAI,GAAG,QAAQ,MAAM;AAC9D"}
|
|
1
|
+
{"version":3,"file":"buildReleaseNotes-Dk4bEclG.js","names":[],"sources":["../src/workflow/version/bumpVersion.ts","../src/workflow/version/isSameReleaseCycle.ts","../src/workflow/discovery/resolvePackageStableTag.ts","../src/workflow/changelog/buildReleaseNotes.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseType, VersionTransition } from '#types'\nimport semver from 'semver'\nimport { extractVersionQualifier } from './extractVersionQualifier'\n\nexport interface BumpVersionOptions {\n version: string\n release: ReleaseType | null | undefined\n identifier?: string | null | undefined\n transition?: VersionTransition | null | undefined\n}\n\n/**\n * Bump a semantic version string based on release and transition rules.\n *\n * Parses the target version and determines the next version string using the\n * specified release type, prerelease identifier, and transition mode. Adjusts\n * prerelease types when continuing an existing qualifier and returns `null` when\n * `options.release` is omitted or if transition conditions fail.\n *\n * @param options Version bump configuration including release type, identifier, and transition rules\n * @returns The bumped semantic version string, or `null` if no bump occurs\n * @throws If `options.version` is not a valid semantic version\n */\nexport function bumpVersion(options: BumpVersionOptions): string | null {\n const { version } = options\n\n const parsed = semver.parse(version)\n\n if (!parsed) {\n throw new Error(`Version \"${version}\" is not a valid semantic version.`)\n }\n\n if (!options.release) {\n return null\n }\n\n if (parsed.prerelease.length > 0) {\n if (options.transition === 'advance' && options.identifier == null) {\n return null\n }\n } else {\n if (options.transition === 'continue') {\n return null\n }\n }\n\n let release: semver.ReleaseType = options.release\n let identifier: string | undefined\n\n if (typeof options.identifier === 'string') {\n release = `pre${options.release}` as const\n identifier = options.identifier\n\n const parsedIdentifier = extractVersionQualifier(parsed)\n\n const transition =\n options.transition ??\n (parsedIdentifier && identifier === '' ? 'advance' : 'continue')\n\n if (typeof parsedIdentifier === 'string' && transition === 'continue') {\n if (\n (release === 'premajor' && parsed.minor === 0 && parsed.patch === 0) ||\n (release === 'preminor' && parsed.patch === 0) ||\n release === 'prepatch'\n ) {\n release = 'prerelease'\n }\n }\n }\n\n return semver.inc(parsed, release, { loose: false }, identifier, '0')\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport semver from 'semver'\n\n/**\n * Determine whether two semantic version strings or objects belong to the same release cycle.\n *\n * Compares the main version components of `currentVersion` and `nextVersion` to\n * determine equality. Treats a transition from a non-zero `0.x` version to\n * `1.0.0` as part of the same release cycle. Returns `false` if either input\n * cannot be parsed.\n *\n * @param currentVersion Starting version string, `semver.SemVer` instance, or nullish value\n * @param nextVersion Target version string, `semver.SemVer` instance, or nullish value\n * @returns `true` if both versions belong to the same release cycle, `false` otherwise\n */\nexport function isSameReleaseCycle(\n currentVersion: string | semver.SemVer | null | undefined,\n nextVersion: string | semver.SemVer | null | undefined\n): boolean {\n const current = semver.parse(currentVersion)\n const next = semver.parse(nextVersion)\n\n if (!current || !next) return false\n\n if (current.compareMain(next) === 0) return true\n\n return (\n current.major === 0 &&\n (current.minor > 0 || current.patch > 0) &&\n next.major === 1 &&\n next.minor === 0 &&\n next.patch === 0\n )\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport { generateGitTagName, getGitTagMessage } from '#git'\nimport type { EnsureGitTagOptions } from '#git'\nimport type { Package, Tag } from '#types'\nimport { readFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport semver from 'semver'\nimport { iterateChangelogVersions } from '../changelog/iterateChangelogVersions'\nimport { verifyPackageTag } from './verifyPackageTag'\n\n/**\n * Resolve the latest stable Git tag for a package.\n *\n * Reads changelog release versions for `pkg` and verifies strict descending\n * semver order. Ignores prerelease versions unless transitioning across major\n * or prerelease boundaries, and verifies that the matching Git tag exists.\n *\n * Stable releases below `1.0.0` are only considered when the preceding\n * version was a prerelease, so a repository with exclusively 0.x releases\n * resolves to no stable tag.\n *\n * @param cwd Absolute path to the root working directory\n * @param pkg Package configuration object\n * @param options Dry-run and logging guards for the local tag cleanup\n * @returns Verified tag metadata object or `null` if no stable tag is resolved\n * @throws If a version is invalid, versions are not in strict descending\n * order, or the corresponding Git tag is missing\n */\nexport async function resolvePackageStableTag(\n cwd: string,\n pkg: Package,\n options?: EnsureGitTagOptions\n): Promise<Tag | null> {\n const changelogFile = pkg.changelogFile || DEFAULT_CHANGELOG_FILE\n\n const changelogFilePath = path.resolve(cwd, pkg.location, changelogFile)\n\n let changelogContent: string\n\n try {\n changelogContent = await readFile(changelogFilePath, 'utf-8')\n } catch (error: unknown) {\n /* istanbul ignore else */\n if ((error as NodeJS.ErrnoException)?.code === 'ENOENT') {\n return null\n }\n\n /* istanbul ignore next */\n throw error\n }\n\n let precedingVersion: semver.SemVer | null = null\n\n for (const version of iterateChangelogVersions(changelogContent)) {\n const currentVersion = semver.parse(version)\n\n if (!currentVersion) {\n throw new Error(`Version \"${version}\" is not a valid semantic version.`)\n }\n\n if (precedingVersion && semver.gte(currentVersion, precedingVersion)) {\n throw new Error(\n `Version \"${version}\" must be strictly lower than preceding version \"${precedingVersion.raw}\".`\n )\n }\n\n if (\n !semver.prerelease(currentVersion) &&\n (currentVersion.major >= 1 ||\n (precedingVersion && semver.prerelease(precedingVersion)))\n ) {\n const tagName = generateGitTagName(pkg.entry, pkg.name, version)\n\n if (!(await verifyPackageTag(cwd, pkg, tagName, options))) {\n throw new Error(\n `Git tag \"${tagName}\" is not associated with package \"${pkg.name ?? ''}\" in directory \"${pkg.location}\".`\n )\n }\n\n return {\n name: tagName,\n message: await getGitTagMessage(cwd, tagName),\n }\n }\n\n precedingVersion = currentVersion\n }\n\n return null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { DEFAULT_CHANGELOG_FILE } from '#config'\nimport type { GitCommit, ReleaseContext } from '#types'\nimport { formatFile } from '#util'\nimport type { Heading, RootContent } from 'mdast'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { toMarkdown } from 'mdast-util-to-markdown'\nimport path from 'node:path'\nimport { buildChangelog } from './buildChangelog'\n\n/**\n * Build release notes from a release context and commit history.\n *\n * Generates changelog content from commits, parses it into an abstract syntax\n * tree, shifts heading depths, and formats the resulting markdown file.\n *\n * @param context The release context containing repository and configuration details\n * @param history The iterable or async iterable collection of commits to process\n * @returns The formatted release notes as a markdown string\n */\nexport async function buildReleaseNotes(\n context: ReleaseContext,\n history: Iterable<GitCommit> | AsyncIterable<GitCommit>\n): Promise<string> {\n const changelogContent = await buildChangelog(context, history)\n\n const root = fromMarkdown(changelogContent)\n\n root.children = root.children.flatMap<RootContent>((node) => {\n if (node.type === 'heading') {\n /* istanbul ignore next */\n if (node.depth <= 2) {\n return []\n }\n\n node = {\n ...node,\n depth: (node.depth - 1) as Heading['depth'],\n }\n }\n\n return node\n })\n\n const filePath = path.join(context.cwd, DEFAULT_CHANGELOG_FILE)\n\n return formatFile(filePath, toMarkdown(root), context.logger)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;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,KAAK,QAAQ,KAAK,sBAAsB;CAE9D,OAAO,WAAW,UAAU,WAAW,IAAI,GAAG,QAAQ,MAAM;AAC9D"}
|
package/dist/builder.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as generateGitTagName, t as version, w as formatError } from "./package-
|
|
2
|
-
import { i as bumpVersion, n as resolvePackageStableTag, r as isSameReleaseCycle, t as buildReleaseNotes } from "./buildReleaseNotes-
|
|
3
|
-
import { t as readPackageHistory } from "./readPackageHistory-
|
|
1
|
+
import { a as generateGitTagName, t as version, w as formatError } from "./package-la-hLPRR.js";
|
|
2
|
+
import { i as bumpVersion, n as resolvePackageStableTag, r as isSameReleaseCycle, t as buildReleaseNotes } from "./buildReleaseNotes-Dk4bEclG.js";
|
|
3
|
+
import { t as readPackageHistory } from "./readPackageHistory-6dC72rZk.js";
|
|
4
4
|
import { colors } from "consola/utils";
|
|
5
5
|
// src/builder.ts
|
|
6
6
|
/**
|
package/dist/changelog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as discoverPackageTag, n as Priority, r as writeChangelog } from "./HookDispatcher-
|
|
2
|
-
import { t as version, w as formatError } from "./package-
|
|
3
|
-
import { t as buildChangelog } from "./buildChangelog-
|
|
4
|
-
import { t as resolvePackageTag } from "./resolvePackageTag-
|
|
1
|
+
import { a as discoverPackageTag, n as Priority, r as writeChangelog } from "./HookDispatcher-B_TrMRLU.js";
|
|
2
|
+
import { t as version, w as formatError } from "./package-la-hLPRR.js";
|
|
3
|
+
import { t as buildChangelog } from "./buildChangelog-CkytKypk.js";
|
|
4
|
+
import { t as resolvePackageTag } from "./resolvePackageTag-2ldvH7PC.js";
|
|
5
5
|
import { colors } from "consola/utils";
|
|
6
6
|
// src/changelog.ts
|
|
7
7
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { a as extractVersionQualifier, i as unique, n as readParsedGitHistory, r as readGitHistory, t as readPackageHistory } from "./readPackageHistory-
|
|
2
|
-
import { i as bumpVersion, n as resolvePackageStableTag, r as isSameReleaseCycle, t as buildReleaseNotes } from "./buildReleaseNotes-
|
|
3
|
-
import { a as formatFile, i as extractPlainText, n as iterateChangelogVersions, o as compact, r as extractSemVer, s as isDefined, t as buildChangelog } from "./buildChangelog-
|
|
4
|
-
import { A as DEV_NULL, C as isMatch, D as buildTrailerPattern, E as execCommand, M as RELEASE_HOOK_NAMES, N as SEMVER_REGEX, O as ALL_FILES, S as packageContainsCommit, T as execGit, _ as GIT_PRETTY_FORMAT, a as generateGitTagName, b as TTLCache, c as deleteGitTag, d as isGitAncestor, f as withShallowLock, g as GIT_PRETTY_FIELD_SEPARATOR, h as getParsedGitCommit, i as getGitTagMessage, j as GIT_TRAILER_RELEASE_AGENT, k as DEFAULT_CHANGELOG_FILE, l as expandGitHistory, m as countGitHistory, n as verifyPackageTag, o as ensureGitTag, p as isGitShallowRepository, r as isGitTagConnected, s as isGitTagPresent, t as version, u as resolveGitRevision, v as parseGitPrettyFormat, w as formatError, x as extractMentions, y as parseGitCommit } from "./package-
|
|
5
|
-
import { a as detectGitRelationship, c as deriveReleaseType, i as GIT_REL_FLAGS, l as pickPriorityReleaseType, n as buildDependencyGraph, o as deriveTransitionReleases, r as mergeGitHistory, s as deriveChangeReleases, t as propagateDependencyUpdates, u as deriveCommitReleaseType } from "./propagateDependencyUpdates-
|
|
6
|
-
import { a as discoverPackageTag, i as prependChangelog, n as Priority, o as extractLatestVersion, r as writeChangelog, s as readGitFile, t as HookDispatcher } from "./HookDispatcher-
|
|
7
|
-
import { t as resolvePackageTag } from "./resolvePackageTag-
|
|
1
|
+
import { a as extractVersionQualifier, i as unique, n as readParsedGitHistory, r as readGitHistory, t as readPackageHistory } from "./readPackageHistory-6dC72rZk.js";
|
|
2
|
+
import { i as bumpVersion, n as resolvePackageStableTag, r as isSameReleaseCycle, t as buildReleaseNotes } from "./buildReleaseNotes-Dk4bEclG.js";
|
|
3
|
+
import { a as formatFile, i as extractPlainText, n as iterateChangelogVersions, o as compact, r as extractSemVer, s as isDefined, t as buildChangelog } from "./buildChangelog-CkytKypk.js";
|
|
4
|
+
import { A as DEV_NULL, C as isMatch, D as buildTrailerPattern, E as execCommand, M as RELEASE_HOOK_NAMES, N as SEMVER_REGEX, O as ALL_FILES, S as packageContainsCommit, T as execGit, _ as GIT_PRETTY_FORMAT, a as generateGitTagName, b as TTLCache, c as deleteGitTag, d as isGitAncestor, f as withShallowLock, g as GIT_PRETTY_FIELD_SEPARATOR, h as getParsedGitCommit, i as getGitTagMessage, j as GIT_TRAILER_RELEASE_AGENT, k as DEFAULT_CHANGELOG_FILE, l as expandGitHistory, m as countGitHistory, n as verifyPackageTag, o as ensureGitTag, p as isGitShallowRepository, r as isGitTagConnected, s as isGitTagPresent, t as version, u as resolveGitRevision, v as parseGitPrettyFormat, w as formatError, x as extractMentions, y as parseGitCommit } from "./package-la-hLPRR.js";
|
|
5
|
+
import { a as detectGitRelationship, c as deriveReleaseType, i as GIT_REL_FLAGS, l as pickPriorityReleaseType, n as buildDependencyGraph, o as deriveTransitionReleases, r as mergeGitHistory, s as deriveChangeReleases, t as propagateDependencyUpdates, u as deriveCommitReleaseType } from "./propagateDependencyUpdates-xcPvP5SP.js";
|
|
6
|
+
import { a as discoverPackageTag, i as prependChangelog, n as Priority, o as extractLatestVersion, r as writeChangelog, s as readGitFile, t as HookDispatcher } from "./HookDispatcher-B_TrMRLU.js";
|
|
7
|
+
import { t as resolvePackageTag } from "./resolvePackageTag-2ldvH7PC.js";
|
|
8
8
|
import "./types.js";
|
|
9
9
|
import { createRequire } from "node:module";
|
|
10
10
|
import semver from "semver";
|
|
11
11
|
import { colors } from "consola/utils";
|
|
12
|
+
import { Writable } from "node:stream";
|
|
12
13
|
import fs from "node:fs/promises";
|
|
13
14
|
import path from "node:path";
|
|
14
15
|
import { pathToFileURL } from "node:url";
|
|
@@ -34,6 +35,84 @@ function isStableVersion(version) {
|
|
|
34
35
|
if (!parsed) throw new Error(`The version "${colors.bold(version)}" is not a valid SemVer.`);
|
|
35
36
|
return parsed.major > 0 && parsed.prerelease.length === 0;
|
|
36
37
|
}
|
|
38
|
+
// src/util/captureCommandOutput.ts
|
|
39
|
+
/** Maximum bytes of command output kept per stream for failure diagnostics. */
|
|
40
|
+
var MAX_TAIL_BYTES = 65536;
|
|
41
|
+
/**
|
|
42
|
+
* Capture command output at the call site, optionally streaming it live.
|
|
43
|
+
*
|
|
44
|
+
* The returned wrappers keep a tail-bounded capture of everything written
|
|
45
|
+
* through them. When `pipe` is set they also forward the output to the
|
|
46
|
+
* context streams, so it keeps flowing live into the terminal or the CI
|
|
47
|
+
* job log; otherwise the output stays inside the capture.
|
|
48
|
+
*
|
|
49
|
+
* @param context Release context carrying the destination streams
|
|
50
|
+
* @param options Whether the captured output is forwarded to the context
|
|
51
|
+
* streams
|
|
52
|
+
* @returns Wrapping streams plus the captured tail readers
|
|
53
|
+
*/
|
|
54
|
+
function captureCommandOutput(context, options) {
|
|
55
|
+
const stdoutTail = new OutputTail();
|
|
56
|
+
const stderrTail = new OutputTail();
|
|
57
|
+
return {
|
|
58
|
+
stdout: createCapturingStream(options.pipe ? context.stdout : void 0, stdoutTail),
|
|
59
|
+
stderr: createCapturingStream(options.pipe ? context.stderr : void 0, stderrTail),
|
|
60
|
+
readStdout: () => stdoutTail.read().trim(),
|
|
61
|
+
readDiagnostics: () => stderrTail.read().trim() || stdoutTail.read().trim()
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Append captured command output to a failure error message.
|
|
66
|
+
*
|
|
67
|
+
* Command runs that stream through call-site wrappers carry no
|
|
68
|
+
* `execCommand` diagnostics of their own; this appends the captured tail
|
|
69
|
+
* so the publish-rejection classifiers keep reading the command output
|
|
70
|
+
* from the error message.
|
|
71
|
+
*
|
|
72
|
+
* @param cause The error thrown by the command
|
|
73
|
+
* @param capture The capture created for the run
|
|
74
|
+
* @returns The error, with the captured output appended to its message
|
|
75
|
+
*/
|
|
76
|
+
function appendCapturedDiagnostics(cause, capture) {
|
|
77
|
+
const error = cause instanceof Error ? cause : new Error(String(cause));
|
|
78
|
+
const diagnostics = capture.readDiagnostics();
|
|
79
|
+
if (diagnostics) error.message = `${error.message}\n${diagnostics}`;
|
|
80
|
+
return error;
|
|
81
|
+
}
|
|
82
|
+
var OutputTail = class {
|
|
83
|
+
chunks = [];
|
|
84
|
+
size = 0;
|
|
85
|
+
push(chunk) {
|
|
86
|
+
this.chunks.push(chunk);
|
|
87
|
+
this.size += chunk.length;
|
|
88
|
+
while (this.size > MAX_TAIL_BYTES && this.chunks.length > 1) {
|
|
89
|
+
const head = this.chunks.shift();
|
|
90
|
+
if (!head) break;
|
|
91
|
+
this.size -= head.length;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
read() {
|
|
95
|
+
let buffer = Buffer.concat(this.chunks);
|
|
96
|
+
if (buffer.length > MAX_TAIL_BYTES) buffer = trimUtf8Start(buffer.subarray(buffer.length - MAX_TAIL_BYTES));
|
|
97
|
+
return buffer.toString("utf-8");
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
function trimUtf8Start(buffer) {
|
|
101
|
+
let start = 0;
|
|
102
|
+
while (start < 3 && start < buffer.length) {
|
|
103
|
+
const byte = buffer[start];
|
|
104
|
+
if (byte === void 0 || (byte & 192) !== 128) break;
|
|
105
|
+
start += 1;
|
|
106
|
+
}
|
|
107
|
+
return start === 0 ? buffer : buffer.subarray(start);
|
|
108
|
+
}
|
|
109
|
+
function createCapturingStream(target, tail) {
|
|
110
|
+
return new Writable({ write(chunk, _encoding, callback) {
|
|
111
|
+
tail.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
112
|
+
if (target) target.write(chunk, callback);
|
|
113
|
+
else callback();
|
|
114
|
+
} });
|
|
115
|
+
}
|
|
37
116
|
// src/util/interpolate.ts
|
|
38
117
|
var BACKSLASH = "\\";
|
|
39
118
|
var LEFT_BRACE = "{";
|
|
@@ -204,25 +283,30 @@ function isGitHubActions(env) {
|
|
|
204
283
|
/**
|
|
205
284
|
* Determine whether the current run should stay quiet about verbose output.
|
|
206
285
|
*
|
|
207
|
-
* A run is quiet when
|
|
208
|
-
* for a human
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* `
|
|
286
|
+
* A run is quiet when its verbose output would only accumulate noise: no
|
|
287
|
+
* terminal is attached for a human to read it live, or the run is inside CI
|
|
288
|
+
* where the provider records a job log that publish noise would pollute.
|
|
289
|
+
* The debug flag opts back in: a debug run is never quiet, not even inside
|
|
290
|
+
* CI, so `--debug` keeps the verbose output flowing. Quiet runs still
|
|
291
|
+
* surface command output on failure — `execCommand` attaches it to the
|
|
292
|
+
* failure diagnostics and captured commands attach their recorded output
|
|
293
|
+
* to the thrown error — so failures stay diagnosable.
|
|
212
294
|
*
|
|
213
|
-
* CI
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* escape hatch.
|
|
295
|
+
* CI runs stay quiet even when the provider attaches a pseudo-terminal: the
|
|
296
|
+
* `isCI` check guarantees it on top of the TTY check, so the job log keeps
|
|
297
|
+
* the publish results without the package manager noise.
|
|
217
298
|
*
|
|
218
299
|
* The verdict is per environment, not per stream, so a redirected stdout inside
|
|
219
300
|
* an interactive terminal still counts as quiet.
|
|
220
301
|
*
|
|
221
|
-
* @param context Release context carrying the
|
|
222
|
-
*
|
|
302
|
+
* @param context Release context carrying the debug flag, destination
|
|
303
|
+
* stream, and environment
|
|
304
|
+
* @returns `true` when the run is part of CI or no TTY is attached, unless
|
|
305
|
+
* the debug flag is set
|
|
223
306
|
*/
|
|
224
307
|
function isQuietEnvironment(context) {
|
|
225
|
-
if (
|
|
308
|
+
if (context.debug) return false;
|
|
309
|
+
if (isCI(context.env)) return true;
|
|
226
310
|
return context.stdout?.isTTY !== true;
|
|
227
311
|
}
|
|
228
312
|
// src/util/readJson.ts
|
|
@@ -1369,6 +1453,6 @@ async function executeReleaseWorkflow(context, plugins) {
|
|
|
1369
1453
|
}
|
|
1370
1454
|
if (context.outcome.status === "failure") throw context.outcome.error;
|
|
1371
1455
|
}
|
|
1372
|
-
export { ALL_FILES, DEFAULT_CHANGELOG_FILE, DEV_NULL, GIT_PRETTY_FIELD_SEPARATOR, GIT_PRETTY_FORMAT, GIT_REL_FLAGS, GIT_TRAILER_RELEASE_AGENT, HookDispatcher, Priority, RELEASE_HOOK_NAMES, SEMVER_REGEX, TTLCache, appendReleaseReportSummary, buildChangelog, buildDependencyGraph, buildReleaseNotes, buildTrailerPattern, bumpVersion, compact, countGitHistory, createGitCommit, createGitTag, createHostReleasePlugin, createPlugin, deleteGitTag, deriveChangeReleases, deriveCommitReleaseType, deriveReleaseType, deriveTransitionReleases, detectGitRelationship, discoverPackageTag, ensureGitTag, ensureGitUserConfig, execCommand, execGit, executeReleaseWorkflow, expandGitHistory, extractLatestVersion, extractMentions, extractPlainText, extractSemVer, extractVersionQualifier, filterPackages, findReleaseRule, formatError, formatFile, generateGitTagName, generateReleaseCommitMessage, generateReleaseReport, getCurrentGitBranch, getCurrentGitCommit, getCurrentGitTag, getGitConfigValue, getGitRemote, getGitTagMessage, getLatestGitTag, getParsedGitCommit, interpolate, isCI, isClass, isDefined, isGitAncestor, isGitHubActions, isGitShallowRepository, isGitTagConnected, isGitTagExact, isGitTagPresent, isMatch, isQuietEnvironment, isSameReleaseCycle, isSemVer, isSemVerGitTag, isStableVersion, isTruthyString, iterateChangelogVersions, mergeGitHistory, normalizeCommitFilter, normalizeReleaseRule, normalizeWorkspace, packageContainsCommit, parseGitCommit, parseGitPrettyFormat, pickPriorityReleaseType, prependChangelog, printReleaseReport, printReleaseReportAnnotation, propagateDependencyUpdates, pushGitChanges, readGitFile, readGitHistory, readJson, readPackageHistory, readParsedGitHistory, resolveGitRepository, resolveGitRevision, resolvePackageStableTag, resolvePackageTag, resolvePlugin, resolveReleaseChannel, resolveVersionQualifier, restoreFullGitHistory, sanitizePrereleaseLabel, sortPackages, unique, verifyPackageTag, withShallowLock, writeChangelog, writeJson };
|
|
1456
|
+
export { ALL_FILES, DEFAULT_CHANGELOG_FILE, DEV_NULL, GIT_PRETTY_FIELD_SEPARATOR, GIT_PRETTY_FORMAT, GIT_REL_FLAGS, GIT_TRAILER_RELEASE_AGENT, HookDispatcher, Priority, RELEASE_HOOK_NAMES, SEMVER_REGEX, TTLCache, appendCapturedDiagnostics, appendReleaseReportSummary, buildChangelog, buildDependencyGraph, buildReleaseNotes, buildTrailerPattern, bumpVersion, captureCommandOutput, compact, countGitHistory, createGitCommit, createGitTag, createHostReleasePlugin, createPlugin, deleteGitTag, deriveChangeReleases, deriveCommitReleaseType, deriveReleaseType, deriveTransitionReleases, detectGitRelationship, discoverPackageTag, ensureGitTag, ensureGitUserConfig, execCommand, execGit, executeReleaseWorkflow, expandGitHistory, extractLatestVersion, extractMentions, extractPlainText, extractSemVer, extractVersionQualifier, filterPackages, findReleaseRule, formatError, formatFile, generateGitTagName, generateReleaseCommitMessage, generateReleaseReport, getCurrentGitBranch, getCurrentGitCommit, getCurrentGitTag, getGitConfigValue, getGitRemote, getGitTagMessage, getLatestGitTag, getParsedGitCommit, interpolate, isCI, isClass, isDefined, isGitAncestor, isGitHubActions, isGitShallowRepository, isGitTagConnected, isGitTagExact, isGitTagPresent, isMatch, isQuietEnvironment, isSameReleaseCycle, isSemVer, isSemVerGitTag, isStableVersion, isTruthyString, iterateChangelogVersions, mergeGitHistory, normalizeCommitFilter, normalizeReleaseRule, normalizeWorkspace, packageContainsCommit, parseGitCommit, parseGitPrettyFormat, pickPriorityReleaseType, prependChangelog, printReleaseReport, printReleaseReportAnnotation, propagateDependencyUpdates, pushGitChanges, readGitFile, readGitHistory, readJson, readPackageHistory, readParsedGitHistory, resolveGitRepository, resolveGitRevision, resolvePackageStableTag, resolvePackageTag, resolvePlugin, resolveReleaseChannel, resolveVersionQualifier, restoreFullGitHistory, sanitizePrereleaseLabel, sortPackages, unique, verifyPackageTag, withShallowLock, writeChangelog, writeJson };
|
|
1373
1457
|
|
|
1374
1458
|
//# sourceMappingURL=index.js.map
|