@reelout/core 0.7.0 → 0.8.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/dist/analyzer.js +1 -1
- package/dist/builder.js +1 -1
- package/dist/changelog.js +1 -1
- package/dist/index.js +2 -17
- package/dist/index.js.map +1 -1
- package/dist/{workflow-BolfadM0.js → workflow-MQRNVoZo.js} +120 -4
- package/dist/workflow-MQRNVoZo.js.map +1 -0
- package/package.json +1 -1
- package/src/util/index.ts +1 -0
- package/src/util/isGitHubActions.ts +18 -0
- package/src/workflow/executeReleaseWorkflow.ts +11 -2
- package/src/workflow/report/appendReleaseReportSummary.ts +115 -0
- package/src/workflow/report/index.ts +2 -0
- package/src/workflow/report/printReleaseReportAnnotation.ts +35 -0
- package/dist/workflow-BolfadM0.js.map +0 -1
package/dist/analyzer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as resolvePackageTag, dt as deriveTransitionReleases, ft as deriveChangeReleases, g as propagateDependencyUpdates, h as readPackageHistory, l as version } from "./workflow-MQRNVoZo.js";
|
|
2
2
|
// src/analyzer.ts
|
|
3
3
|
/**
|
|
4
4
|
* Built-in plugin that inspects repository history and produces release plans for packages.
|
package/dist/builder.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as generateGitTagName, Ut as isSameReleaseCycle, h as readPackageHistory, l as version, p as buildReleaseNotes, qt as bumpVersion, v as resolvePackageStableTag } from "./workflow-MQRNVoZo.js";
|
|
2
2
|
import { t as formatError } from "./formatError-BMsun8Wi.js";
|
|
3
3
|
import { colors } from "consola/utils";
|
|
4
4
|
// src/builder.ts
|
package/dist/changelog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as resolvePackageTag, b as discoverPackageTag, l as version, m as buildChangelog, s as HookPriority, u as writeChangelog } from "./workflow-MQRNVoZo.js";
|
|
2
2
|
import { t as formatError } from "./formatError-BMsun8Wi.js";
|
|
3
3
|
import { colors } from "consola/utils";
|
|
4
4
|
// src/changelog.ts
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as isGitShallowRepository, A as getGitTagMessage, At as execGit, B as getGitRemote, Bt as SEMVER_REGEX, C as iterateChangelogVersions, Ct as readJson, D as isGitTagExact, Dt as isTruthyString, E as buildDependencyGraph, Et as isClass, F as deleteGitTag, Ft as ALL_FILES, G as readGitHistory, Gt as pickPriorityReleaseType, H as getGitConfigValue, Ht as isStableVersion, I as createGitTag, It as DEFAULT_CHANGELOG_FILE, J as detectGitRelationship, Jt as extractVersionQualifier, K as mergeGitHistory, Kt as deriveCommitReleaseType, L as readGitFile, Lt as DEV_NULL, M as generateGitTagName, Mt as compact, N as ensureGitTag, Nt as isDefined, O as isGitTagConnected, Ot as interpolate, P as isGitTagPresent, Pt as buildTrailerPattern, Q as withShallowLock, R as resolveGitRepository, Rt as GIT_TRAILER_RELEASE_AGENT, S as extractLatestVersion, St as unique, T as extractPlainText, Tt as isGitHubActions, U as restoreFullGitHistory, Ut as isSameReleaseCycle, V as ensureGitUserConfig, Vt as promotePrereleaseVersions, W as readParsedGitHistory, Wt as deriveReleaseType, X as resolveGitRevision, Y as expandGitHistory, Z as isGitAncestor, _ as resolvePackageTag, _t as isSemVerGitTag, a as appendReleaseReportSummary, at as parseGitPrettyFormat, b as discoverPackageTag, bt as createPlugin, c as generateReleaseCommitMessage, ct as extractMentions, d as prependChangelog, dt as deriveTransitionReleases, et as countGitHistory, f as extractPreviousVersion, ft as deriveChangeReleases, g as propagateDependencyUpdates, gt as sanitizePrereleaseLabel, h as readPackageHistory, ht as resolveReleaseChannel, i as generateReleaseReport, it as GIT_PRETTY_FORMAT, j as getCurrentGitTag, jt as execCommand, k as getLatestGitTag, kt as formatFile, lt as createGitCommit, m as buildChangelog, mt as resolveVersionQualifier, n as printReleaseReportAnnotation, nt as getParsedGitCommit, o as HookManager, ot as parseGitCommit, p as buildReleaseNotes, pt as packageContainsCommit, q as GIT_REL_FLAGS, qt as bumpVersion, r as printReleaseReport, rt as GIT_PRETTY_FIELD_SEPARATOR, s as HookPriority, st as TTLCache, t as executeReleaseWorkflow, tt as getCurrentGitCommit, u as writeChangelog, ut as getCurrentGitBranch, v as resolvePackageStableTag, vt as isSemVer, w as extractSemVer, wt as isMatch, x as verifyPackageTag, xt as writeJson, y as filterPackages, yt as findReleaseRule, z as pushGitChanges, zt as RELEASE_HOOK_NAMES } from "./workflow-MQRNVoZo.js";
|
|
2
2
|
import { t as formatError } from "./formatError-BMsun8Wi.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
|
-
// src/util/isTruthyString.ts
|
|
7
|
-
/**
|
|
8
|
-
* Determine whether a string value represents a truthy boolean.
|
|
9
|
-
*
|
|
10
|
-
* Trims leading and trailing whitespace and coerces the target string to
|
|
11
|
-
* lowercase. Evaluates the string as truthy if it equals `'true'` or `'1'`.
|
|
12
|
-
*
|
|
13
|
-
* @param value The raw string to evaluate
|
|
14
|
-
* @returns `true` if `value` normalizes to `'true'` or `'1'`, otherwise `false`
|
|
15
|
-
*/
|
|
16
|
-
function isTruthyString(value) {
|
|
17
|
-
if (!value) return false;
|
|
18
|
-
const normalized = value.toLowerCase().trim();
|
|
19
|
-
return normalized === "true" || normalized === "1";
|
|
20
|
-
}
|
|
21
6
|
// src/util/isCI.ts
|
|
22
7
|
/**
|
|
23
8
|
* Determine whether the current process is running in a CI environment.
|
|
@@ -191,6 +176,6 @@ function sortPackages(packages) {
|
|
|
191
176
|
}
|
|
192
177
|
return packageNodes.toSorted((a, b) => b.level - a.level).map((node) => node.package);
|
|
193
178
|
}
|
|
194
|
-
export { ALL_FILES, DEFAULT_CHANGELOG_FILE, DEV_NULL, GIT_PRETTY_FIELD_SEPARATOR, GIT_PRETTY_FORMAT, GIT_REL_FLAGS, GIT_TRAILER_RELEASE_AGENT, HookManager, HookPriority, RELEASE_HOOK_NAMES, SEMVER_REGEX, TTLCache, buildChangelog, buildDependencyGraph, buildReleaseNotes, buildTrailerPattern, bumpVersion, compact, countGitHistory, createGitCommit, createGitTag, createPlugin, deleteGitTag, deriveChangeReleases, deriveCommitReleaseType, deriveReleaseType, deriveTransitionReleases, detectGitRelationship, discoverPackageTag, ensureGitTag, ensureGitUserConfig, execCommand, execGit, executeReleaseWorkflow, expandGitHistory, extractLatestVersion, extractMentions, extractPlainText, extractPreviousVersion, extractSemVer, extractVersionQualifier, filterPackages, findReleaseRule, formatError, formatFile, generateGitTagName, generateReleaseCommitMessage, generateReleaseReport, getCurrentGitBranch, getCurrentGitCommit, getCurrentGitTag, getGitConfigValue, getGitRemote, getGitTagMessage, getLatestGitTag, getParsedGitCommit, interpolate, isCI, isClass, isDefined, isGitAncestor, isGitShallowRepository, isGitTagConnected, isGitTagExact, isGitTagPresent, isMatch, isQuietEnvironment, isSameReleaseCycle, isSemVer, isSemVerGitTag, isStableVersion, isTruthyString, iterateChangelogVersions, mergeGitHistory, normalizeCommitFilter, normalizeReleaseRule, normalizeWorkspace, packageContainsCommit, parseGitCommit, parseGitPrettyFormat, pickPriorityReleaseType, prependChangelog, printReleaseReport, promotePrereleaseVersions, propagateDependencyUpdates, pushGitChanges, readGitFile, readGitHistory, readJson, readPackageHistory, readParsedGitHistory, resolveGitRepository, resolveGitRevision, resolvePackageStableTag, resolvePackageTag, resolvePlugin, resolveReleaseChannel, resolveVersionQualifier, restoreFullGitHistory, sanitizePrereleaseLabel, sortPackages, unique, verifyPackageTag, withShallowLock, writeChangelog, writeJson };
|
|
179
|
+
export { ALL_FILES, DEFAULT_CHANGELOG_FILE, DEV_NULL, GIT_PRETTY_FIELD_SEPARATOR, GIT_PRETTY_FORMAT, GIT_REL_FLAGS, GIT_TRAILER_RELEASE_AGENT, HookManager, HookPriority, RELEASE_HOOK_NAMES, SEMVER_REGEX, TTLCache, appendReleaseReportSummary, buildChangelog, buildDependencyGraph, buildReleaseNotes, buildTrailerPattern, bumpVersion, compact, countGitHistory, createGitCommit, createGitTag, createPlugin, deleteGitTag, deriveChangeReleases, deriveCommitReleaseType, deriveReleaseType, deriveTransitionReleases, detectGitRelationship, discoverPackageTag, ensureGitTag, ensureGitUserConfig, execCommand, execGit, executeReleaseWorkflow, expandGitHistory, extractLatestVersion, extractMentions, extractPlainText, extractPreviousVersion, 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, promotePrereleaseVersions, propagateDependencyUpdates, pushGitChanges, readGitFile, readGitHistory, readJson, readPackageHistory, readParsedGitHistory, resolveGitRepository, resolveGitRevision, resolvePackageStableTag, resolvePackageTag, resolvePlugin, resolveReleaseChannel, resolveVersionQualifier, restoreFullGitHistory, sanitizePrereleaseLabel, sortPackages, unique, verifyPackageTag, withShallowLock, writeChangelog, writeJson };
|
|
195
180
|
|
|
196
181
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/util/isTruthyString.ts","../src/util/isCI.ts","../src/util/isQuietEnvironment.ts","../src/config/normalizeCommitFilter.ts","../src/config/normalizeReleaseRule.ts","../src/config/normalizeWorkspace.ts","../src/config/resolvePlugin.ts","../src/workflow/discovery/sortPackages.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\n/**\n * Determine whether a string value represents a truthy boolean.\n *\n * Trims leading and trailing whitespace and coerces the target string to\n * lowercase. Evaluates the string as truthy if it equals `'true'` or `'1'`.\n *\n * @param value The raw string to evaluate\n * @returns `true` if `value` normalizes to `'true'` or `'1'`, otherwise `false`\n */\nexport function isTruthyString(value: string | undefined): boolean {\n if (!value) return false\n\n const normalized = value.toLowerCase().trim()\n\n return normalized === 'true' || normalized === '1'\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { isTruthyString } from './isTruthyString'\n\n/**\n * Determine whether the current process is running in a CI environment.\n *\n * Checks if the `CI` environment variable is set to a truthy value. Ignores\n * provider-specific variables such as `GITHUB_ACTIONS` to keep detection\n * generic.\n *\n * @param env Readonly process environment variables object\n * @returns `true` if `env.CI` normalizes to a truthy string, otherwise `false`\n */\nexport function isCI(env: Readonly<NodeJS.ProcessEnv>): boolean {\n return isTruthyString(env.CI)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseContext } from '../types'\nimport { isCI } from './isCI'\n\n/**\n * Determine whether the current run should stay quiet about verbose output.\n *\n * A run is quiet when nothing will keep what it prints: no terminal is attached\n * for a human, and no CI provider is recording a job log. A plain pipe outside\n * of CI — an agent sandbox, a script capturing output, a detached daemon — only\n * accumulates noise, so verbose output should be withheld and left to\n * `execCommand` for error reporting instead.\n *\n * CI is deliberately *not* quiet even though its streams are not TTYs: the\n * provider persists the job log, so the output does reach someone. A caller\n * that wants output from a pipe in a non-CI environment can set `CI=1` as an\n * escape hatch.\n *\n * The verdict is per environment, not per stream, so a redirected stdout inside\n * an interactive terminal still counts as quiet.\n *\n * @param context Release context carrying the destination stream and environment\n * @returns `true` when no TTY is attached and the run is not part of CI\n */\nexport function isQuietEnvironment(\n context: Pick<ReleaseContext, 'env' | 'stdout'>\n): boolean {\n if (isCI(context.env)) return false\n\n const stream = context.stdout as NodeJS.WriteStream | undefined\n\n return stream?.isTTY !== true\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { CommitClassifier, ReleaseConfig, ReleaseType } from '#types'\n\n/**\n * Normalize a commit classifier into a consistent function.\n *\n * Accepts `null`/`undefined` (returns no-op classifier), a function classifier,\n * or a config object mapping commit types to release types. Returns a classifier\n * function that maps commits to their corresponding release types.\n *\n * @param classifier Commit classifier config, function, or falsy value\n * @returns Normalized classifier function\n */\nexport function normalizeCommitFilter(\n classifier: ReleaseConfig['classifier'] | null | undefined\n): CommitClassifier {\n if (classifier == null) {\n return () => null\n }\n\n if (typeof classifier === 'function') {\n return classifier\n }\n\n const map = new Map(\n Object.entries(classifier).flatMap(([releaseType, commitTypes]) => {\n return commitTypes.map((commitType) => [\n commitType,\n releaseType as ReleaseType,\n ])\n })\n )\n\n return (commit) => (commit.type ? map.get(commit.type) : null)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseRule, ResolvedReleaseRule } from '#types'\nimport { sanitizePrereleaseLabel } from './sanitizePrereleaseLabel'\n\n/**\n * Normalize a release rule input into a resolved release rule object.\n *\n * Converts `string` shorthand inputs into structured rule objects with sanitized\n * labels. Resolves `versionQualifier` and `releaseChannel` against `pattern`.\n * Returns `null` if `rule` is invalid, falsy, or missing `pattern`.\n *\n * @param rule Raw release rule input, `string` shorthand, or falsy value\n * @returns Resolved `ResolvedReleaseRule` object, or `null` if `rule` is invalid\n */\nexport function normalizeReleaseRule(\n rule: ReleaseRule | string | false | null | undefined\n): ResolvedReleaseRule | null {\n if (typeof rule === 'string') {\n rule = {\n pattern: rule,\n qualifier: sanitizePrereleaseLabel(rule),\n channel: sanitizePrereleaseLabel(rule),\n }\n }\n\n if (typeof rule !== 'object' || rule == null) {\n return null\n }\n\n const { pattern } = rule\n\n if (pattern == null) {\n return null\n }\n\n return {\n type: rule.type,\n pattern,\n versionQualifier: resolveRuleValue(rule.qualifier, pattern),\n releaseChannel: resolveRuleValue(rule.channel, pattern),\n }\n}\n\n/**\n * Resolve a rule property value from an explicit `string` or pattern fallback.\n *\n * @param value Explicit `string` value, `boolean` flag, or `undefined`\n * @param pattern Fallback pattern string used when `value` is `true`\n * @returns Resolved `string` value or `undefined`\n */\nfunction resolveRuleValue(\n value: string | boolean | undefined,\n pattern: string\n): string | undefined {\n if (typeof value === 'string') {\n return value\n }\n\n if (value) {\n return sanitizePrereleaseLabel(pattern)\n }\n\n return undefined\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { Workspace } from '#types'\nimport path from 'node:path'\n\n/**\n * Normalize and validate workspace configuration for a repository.\n *\n * Resolves the workspace entry directory relative to `cwd` and normalizes\n * the path representation. Returns a workspace object with normalized `entry`\n * and optional workspace members.\n *\n * @param cwd Repository working directory\n * @param workspace Partial workspace configuration (optional)\n * @returns Normalized workspace object\n */\nexport function normalizeWorkspace(\n cwd: string,\n workspace?: {\n entry?: string | null | undefined\n members?: readonly string[] | null | undefined\n }\n): Workspace {\n let entry = workspace?.entry || '.'\n const members = workspace?.members ?? null\n\n entry = path.normalize(path.relative(cwd, path.resolve(cwd, entry)))\n\n return {\n entry,\n members,\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type {\n ReleasePlugin,\n ReleasePluginDefinition,\n ReleasePluginFactory,\n ReleasePluginTuple,\n} from '#types'\nimport { createRequire } from 'node:module'\nimport { pathToFileURL } from 'node:url'\n\n/**\n * Resolve a release plugin definition into a factory tuple or plugin object.\n *\n * Handles string module specifiers by dynamically importing the package relative\n * to `cwd`. Unwraps ES module default exports, array configurations containing\n * options, function factories, and direct plugin objects.\n *\n * @param cwd The working directory path used to resolve string specifiers\n * @param plugin The plugin name, path, tuple configuration, or plugin object\n * @returns A factory tuple, plugin object, or null if resolution fails\n */\nexport async function resolvePlugin(\n cwd: string,\n plugin: unknown\n): Promise<ReleasePluginDefinition | ReleasePluginTuple | null> {\n let options: unknown\n\n if (Array.isArray(plugin)) {\n ;[plugin, options] = plugin\n }\n\n if (typeof plugin === 'string') {\n const require = createRequire(pathToFileURL(cwd))\n plugin = await import(require.resolve(plugin))\n }\n\n if (plugin != null && typeof plugin === 'object' && 'default' in plugin) {\n plugin = plugin.default\n }\n\n if (typeof plugin === 'function') {\n return [plugin as ReleasePluginFactory, options]\n }\n\n if (\n plugin != null &&\n typeof plugin === 'object' &&\n Object.hasOwn(plugin, 'name') &&\n typeof (plugin as ReleasePlugin).name === 'string'\n ) {\n return plugin as ReleasePlugin\n }\n\n return null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { Package } from '#types'\n\ninterface PackageNode {\n package: Package\n level: number\n}\n\n/**\n * Sort workspace packages topologically based on their dependency graphs.\n *\n * Deepest dependents are placed first in the resulting array, ensuring that\n * a package always precedes its own dependencies. Ties and circular dependencies\n * are resolved deterministically using an alphabetical sort on the package directory (`dir`).\n *\n * @param packages The workspace packages to sort.\n * @returns A new array of packages sorted by dependency depth and directory path.\n */\nexport function sortPackages(packages: readonly Package[]): Package[] {\n const packageNodes: PackageNode[] = []\n const packageMap = new Map<string, PackageNode>()\n\n for (const pkg of packages.toSorted((a, b) =>\n a.location.localeCompare(b.location)\n )) {\n const node: PackageNode = {\n package: pkg,\n level: -1,\n }\n\n packageNodes.push(node)\n\n if (pkg.name) {\n packageMap.set(pkg.name, node)\n }\n }\n\n for (const node of packageNodes) {\n visit(node)\n }\n\n function visit(\n node: PackageNode,\n level = 0,\n visited = new Set<PackageNode>()\n ): void {\n if (node.level >= level) {\n return\n }\n\n if (visited.has(node)) {\n return\n }\n\n visited.add(node)\n\n for (const depName of node.package.dependencies) {\n const depNode = packageMap.get(depName)\n\n if (depNode && depNode !== node) {\n visit(depNode, level + 1, visited)\n }\n }\n\n node.level = level\n }\n\n const sorted = packageNodes\n .toSorted((a, b) => b.level - a.level)\n .map((node) => node.package)\n\n return sorted\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/util/isCI.ts","../src/util/isQuietEnvironment.ts","../src/config/normalizeCommitFilter.ts","../src/config/normalizeReleaseRule.ts","../src/config/normalizeWorkspace.ts","../src/config/resolvePlugin.ts","../src/workflow/discovery/sortPackages.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport { isTruthyString } from './isTruthyString'\n\n/**\n * Determine whether the current process is running in a CI environment.\n *\n * Checks if the `CI` environment variable is set to a truthy value. Ignores\n * provider-specific variables such as `GITHUB_ACTIONS` to keep detection\n * generic.\n *\n * @param env Readonly process environment variables object\n * @returns `true` if `env.CI` normalizes to a truthy string, otherwise `false`\n */\nexport function isCI(env: Readonly<NodeJS.ProcessEnv>): boolean {\n return isTruthyString(env.CI)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseContext } from '../types'\nimport { isCI } from './isCI'\n\n/**\n * Determine whether the current run should stay quiet about verbose output.\n *\n * A run is quiet when nothing will keep what it prints: no terminal is attached\n * for a human, and no CI provider is recording a job log. A plain pipe outside\n * of CI — an agent sandbox, a script capturing output, a detached daemon — only\n * accumulates noise, so verbose output should be withheld and left to\n * `execCommand` for error reporting instead.\n *\n * CI is deliberately *not* quiet even though its streams are not TTYs: the\n * provider persists the job log, so the output does reach someone. A caller\n * that wants output from a pipe in a non-CI environment can set `CI=1` as an\n * escape hatch.\n *\n * The verdict is per environment, not per stream, so a redirected stdout inside\n * an interactive terminal still counts as quiet.\n *\n * @param context Release context carrying the destination stream and environment\n * @returns `true` when no TTY is attached and the run is not part of CI\n */\nexport function isQuietEnvironment(\n context: Pick<ReleaseContext, 'env' | 'stdout'>\n): boolean {\n if (isCI(context.env)) return false\n\n const stream = context.stdout as NodeJS.WriteStream | undefined\n\n return stream?.isTTY !== true\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { CommitClassifier, ReleaseConfig, ReleaseType } from '#types'\n\n/**\n * Normalize a commit classifier into a consistent function.\n *\n * Accepts `null`/`undefined` (returns no-op classifier), a function classifier,\n * or a config object mapping commit types to release types. Returns a classifier\n * function that maps commits to their corresponding release types.\n *\n * @param classifier Commit classifier config, function, or falsy value\n * @returns Normalized classifier function\n */\nexport function normalizeCommitFilter(\n classifier: ReleaseConfig['classifier'] | null | undefined\n): CommitClassifier {\n if (classifier == null) {\n return () => null\n }\n\n if (typeof classifier === 'function') {\n return classifier\n }\n\n const map = new Map(\n Object.entries(classifier).flatMap(([releaseType, commitTypes]) => {\n return commitTypes.map((commitType) => [\n commitType,\n releaseType as ReleaseType,\n ])\n })\n )\n\n return (commit) => (commit.type ? map.get(commit.type) : null)\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { ReleaseRule, ResolvedReleaseRule } from '#types'\nimport { sanitizePrereleaseLabel } from './sanitizePrereleaseLabel'\n\n/**\n * Normalize a release rule input into a resolved release rule object.\n *\n * Converts `string` shorthand inputs into structured rule objects with sanitized\n * labels. Resolves `versionQualifier` and `releaseChannel` against `pattern`.\n * Returns `null` if `rule` is invalid, falsy, or missing `pattern`.\n *\n * @param rule Raw release rule input, `string` shorthand, or falsy value\n * @returns Resolved `ResolvedReleaseRule` object, or `null` if `rule` is invalid\n */\nexport function normalizeReleaseRule(\n rule: ReleaseRule | string | false | null | undefined\n): ResolvedReleaseRule | null {\n if (typeof rule === 'string') {\n rule = {\n pattern: rule,\n qualifier: sanitizePrereleaseLabel(rule),\n channel: sanitizePrereleaseLabel(rule),\n }\n }\n\n if (typeof rule !== 'object' || rule == null) {\n return null\n }\n\n const { pattern } = rule\n\n if (pattern == null) {\n return null\n }\n\n return {\n type: rule.type,\n pattern,\n versionQualifier: resolveRuleValue(rule.qualifier, pattern),\n releaseChannel: resolveRuleValue(rule.channel, pattern),\n }\n}\n\n/**\n * Resolve a rule property value from an explicit `string` or pattern fallback.\n *\n * @param value Explicit `string` value, `boolean` flag, or `undefined`\n * @param pattern Fallback pattern string used when `value` is `true`\n * @returns Resolved `string` value or `undefined`\n */\nfunction resolveRuleValue(\n value: string | boolean | undefined,\n pattern: string\n): string | undefined {\n if (typeof value === 'string') {\n return value\n }\n\n if (value) {\n return sanitizePrereleaseLabel(pattern)\n }\n\n return undefined\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { Workspace } from '#types'\nimport path from 'node:path'\n\n/**\n * Normalize and validate workspace configuration for a repository.\n *\n * Resolves the workspace entry directory relative to `cwd` and normalizes\n * the path representation. Returns a workspace object with normalized `entry`\n * and optional workspace members.\n *\n * @param cwd Repository working directory\n * @param workspace Partial workspace configuration (optional)\n * @returns Normalized workspace object\n */\nexport function normalizeWorkspace(\n cwd: string,\n workspace?: {\n entry?: string | null | undefined\n members?: readonly string[] | null | undefined\n }\n): Workspace {\n let entry = workspace?.entry || '.'\n const members = workspace?.members ?? null\n\n entry = path.normalize(path.relative(cwd, path.resolve(cwd, entry)))\n\n return {\n entry,\n members,\n }\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type {\n ReleasePlugin,\n ReleasePluginDefinition,\n ReleasePluginFactory,\n ReleasePluginTuple,\n} from '#types'\nimport { createRequire } from 'node:module'\nimport { pathToFileURL } from 'node:url'\n\n/**\n * Resolve a release plugin definition into a factory tuple or plugin object.\n *\n * Handles string module specifiers by dynamically importing the package relative\n * to `cwd`. Unwraps ES module default exports, array configurations containing\n * options, function factories, and direct plugin objects.\n *\n * @param cwd The working directory path used to resolve string specifiers\n * @param plugin The plugin name, path, tuple configuration, or plugin object\n * @returns A factory tuple, plugin object, or null if resolution fails\n */\nexport async function resolvePlugin(\n cwd: string,\n plugin: unknown\n): Promise<ReleasePluginDefinition | ReleasePluginTuple | null> {\n let options: unknown\n\n if (Array.isArray(plugin)) {\n ;[plugin, options] = plugin\n }\n\n if (typeof plugin === 'string') {\n const require = createRequire(pathToFileURL(cwd))\n plugin = await import(require.resolve(plugin))\n }\n\n if (plugin != null && typeof plugin === 'object' && 'default' in plugin) {\n plugin = plugin.default\n }\n\n if (typeof plugin === 'function') {\n return [plugin as ReleasePluginFactory, options]\n }\n\n if (\n plugin != null &&\n typeof plugin === 'object' &&\n Object.hasOwn(plugin, 'name') &&\n typeof (plugin as ReleasePlugin).name === 'string'\n ) {\n return plugin as ReleasePlugin\n }\n\n return null\n}\n","// SPDX-License-Identifier: MIT\n// Copyright (c) 2026 Fai\n\nimport type { Package } from '#types'\n\ninterface PackageNode {\n package: Package\n level: number\n}\n\n/**\n * Sort workspace packages topologically based on their dependency graphs.\n *\n * Deepest dependents are placed first in the resulting array, ensuring that\n * a package always precedes its own dependencies. Ties and circular dependencies\n * are resolved deterministically using an alphabetical sort on the package directory (`dir`).\n *\n * @param packages The workspace packages to sort.\n * @returns A new array of packages sorted by dependency depth and directory path.\n */\nexport function sortPackages(packages: readonly Package[]): Package[] {\n const packageNodes: PackageNode[] = []\n const packageMap = new Map<string, PackageNode>()\n\n for (const pkg of packages.toSorted((a, b) =>\n a.location.localeCompare(b.location)\n )) {\n const node: PackageNode = {\n package: pkg,\n level: -1,\n }\n\n packageNodes.push(node)\n\n if (pkg.name) {\n packageMap.set(pkg.name, node)\n }\n }\n\n for (const node of packageNodes) {\n visit(node)\n }\n\n function visit(\n node: PackageNode,\n level = 0,\n visited = new Set<PackageNode>()\n ): void {\n if (node.level >= level) {\n return\n }\n\n if (visited.has(node)) {\n return\n }\n\n visited.add(node)\n\n for (const depName of node.package.dependencies) {\n const depNode = packageMap.get(depName)\n\n if (depNode && depNode !== node) {\n visit(depNode, level + 1, visited)\n }\n }\n\n node.level = level\n }\n\n const sorted = packageNodes\n .toSorted((a, b) => b.level - a.level)\n .map((node) => node.package)\n\n return sorted\n}\n"],"mappings":"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"}
|
|
@@ -14,6 +14,7 @@ import assert from "node:assert";
|
|
|
14
14
|
import createPreset from "conventional-changelog-conventionalcommits";
|
|
15
15
|
import { writeChangelogString } from "conventional-changelog-writer";
|
|
16
16
|
import { toMarkdown } from "mdast-util-to-markdown";
|
|
17
|
+
import { appendFileSync } from "node:fs";
|
|
17
18
|
// src/workflow/version/extractVersionQualifier.ts
|
|
18
19
|
/**
|
|
19
20
|
* Extract the version qualifier string from a parsed `SemVer` instance.
|
|
@@ -549,6 +550,21 @@ function interpolate(template, data) {
|
|
|
549
550
|
}
|
|
550
551
|
return result;
|
|
551
552
|
}
|
|
553
|
+
// src/util/isTruthyString.ts
|
|
554
|
+
/**
|
|
555
|
+
* Determine whether a string value represents a truthy boolean.
|
|
556
|
+
*
|
|
557
|
+
* Trims leading and trailing whitespace and coerces the target string to
|
|
558
|
+
* lowercase. Evaluates the string as truthy if it equals `'true'` or `'1'`.
|
|
559
|
+
*
|
|
560
|
+
* @param value The raw string to evaluate
|
|
561
|
+
* @returns `true` if `value` normalizes to `'true'` or `'1'`, otherwise `false`
|
|
562
|
+
*/
|
|
563
|
+
function isTruthyString(value) {
|
|
564
|
+
if (!value) return false;
|
|
565
|
+
const normalized = value.toLowerCase().trim();
|
|
566
|
+
return normalized === "true" || normalized === "1";
|
|
567
|
+
}
|
|
552
568
|
// src/util/isClass.ts
|
|
553
569
|
/**
|
|
554
570
|
* Determine whether a given value is a constructible class.
|
|
@@ -571,6 +587,20 @@ function isClass(func) {
|
|
|
571
587
|
if (!descriptor || descriptor.writable) return false;
|
|
572
588
|
return /^class\s/.test(Function.prototype.toString.call(func));
|
|
573
589
|
}
|
|
590
|
+
// src/util/isGitHubActions.ts
|
|
591
|
+
/**
|
|
592
|
+
* Determine whether the current process runs on a GitHub Actions runner.
|
|
593
|
+
*
|
|
594
|
+
* Checks if the `GITHUB_ACTIONS` environment variable is set to a truthy
|
|
595
|
+
* value. Gates GitHub Actions-specific reporting such as job summaries and
|
|
596
|
+
* annotations.
|
|
597
|
+
*
|
|
598
|
+
* @param env Readonly process environment variables object
|
|
599
|
+
* @returns `true` if `env.GITHUB_ACTIONS` normalizes to a truthy string, otherwise `false`
|
|
600
|
+
*/
|
|
601
|
+
function isGitHubActions(env) {
|
|
602
|
+
return isTruthyString(env.GITHUB_ACTIONS);
|
|
603
|
+
}
|
|
574
604
|
// src/util/isMatch.ts
|
|
575
605
|
/**
|
|
576
606
|
* Determine whether a target string matches glob patterns.
|
|
@@ -2354,7 +2384,7 @@ async function writeChangelog(cwd, plan) {
|
|
|
2354
2384
|
}
|
|
2355
2385
|
}
|
|
2356
2386
|
// package.json
|
|
2357
|
-
var version = "0.
|
|
2387
|
+
var version = "0.7.0";
|
|
2358
2388
|
// src/workflow/commit/generateReleaseCommitMessage.ts
|
|
2359
2389
|
var NOTABLE_TYPES = [
|
|
2360
2390
|
"feat",
|
|
@@ -2497,6 +2527,69 @@ var HookManager = class {
|
|
|
2497
2527
|
return await dispatch(0, context);
|
|
2498
2528
|
}
|
|
2499
2529
|
};
|
|
2530
|
+
// src/workflow/report/appendReleaseReportSummary.ts
|
|
2531
|
+
var STATUS_LABELS = {
|
|
2532
|
+
success: "Success",
|
|
2533
|
+
failure: "Failure"
|
|
2534
|
+
};
|
|
2535
|
+
/**
|
|
2536
|
+
* Append a Markdown release report to the GitHub Actions job summary.
|
|
2537
|
+
*
|
|
2538
|
+
* Detects a GitHub Actions runner through the `GITHUB_ACTIONS` environment
|
|
2539
|
+
* variable and appends the rendered `report` to the file referenced by
|
|
2540
|
+
* `GITHUB_STEP_SUMMARY`, so GitHub displays it on the run summary page. Does
|
|
2541
|
+
* nothing outside GitHub Actions or when no summary file is configured, and
|
|
2542
|
+
* logs a warning instead of throwing when the summary file cannot be written.
|
|
2543
|
+
*
|
|
2544
|
+
* @param logger Logger instance for reporting summary write failures
|
|
2545
|
+
* @param env Readonly process environment variables object
|
|
2546
|
+
* @param report Release report containing status and package details
|
|
2547
|
+
*/
|
|
2548
|
+
function appendReleaseReportSummary(logger, env, report) {
|
|
2549
|
+
if (!isGitHubActions(env)) return;
|
|
2550
|
+
const filePath = env.GITHUB_STEP_SUMMARY;
|
|
2551
|
+
if (!filePath) return;
|
|
2552
|
+
try {
|
|
2553
|
+
appendFileSync(filePath, `\n${formatReleaseReportSummary(report)}`);
|
|
2554
|
+
} catch (error) {
|
|
2555
|
+
logger.warn(`GitHub Actions job summary could not be written to "${filePath}": ${error instanceof Error ? error.message : error}`);
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
var formatPackageLabel = (plan) => {
|
|
2559
|
+
if (plan.package.name) return `\`${plan.package.name}\``;
|
|
2560
|
+
return `\`${plan.package.location}\``;
|
|
2561
|
+
};
|
|
2562
|
+
var formatReleaseReportSummary = (report) => {
|
|
2563
|
+
const lines = ["## ReelOut Release Report", ""];
|
|
2564
|
+
if (report.status) lines.push(`**Status:** ${STATUS_LABELS[report.status]}`, "");
|
|
2565
|
+
if (report.status === "failure") {
|
|
2566
|
+
const message = report.error || "An unexpected error occurred during the release process.";
|
|
2567
|
+
lines.push(...message.split("\n").map((line) => `> ${line}`), "");
|
|
2568
|
+
return lines.join("\n");
|
|
2569
|
+
}
|
|
2570
|
+
if (report.plans.length === 0) {
|
|
2571
|
+
lines.push("No packages are scheduled for release.", "");
|
|
2572
|
+
return lines.join("\n");
|
|
2573
|
+
}
|
|
2574
|
+
const plans = report.plans.toSorted((a, b) => (a.package.name || "").localeCompare(b.package.name || ""));
|
|
2575
|
+
lines.push("| Package | Version | Type | Tag |", "| --- | --- | --- | --- |");
|
|
2576
|
+
for (const plan of plans) {
|
|
2577
|
+
const version = `\`${plan.release.version}\` ← \`${plan.package.version}\``;
|
|
2578
|
+
lines.push([
|
|
2579
|
+
`| ${formatPackageLabel(plan)}`,
|
|
2580
|
+
version,
|
|
2581
|
+
plan.release.type,
|
|
2582
|
+
plan.release.tag ? `\`${plan.release.tag}\`` : ""
|
|
2583
|
+
].join(" | ") + " |");
|
|
2584
|
+
}
|
|
2585
|
+
lines.push("");
|
|
2586
|
+
for (const plan of plans) {
|
|
2587
|
+
const changelog = plan.release.changelog?.trim();
|
|
2588
|
+
if (!changelog) continue;
|
|
2589
|
+
lines.push("<details>", `<summary>${formatPackageLabel(plan)} ${plan.release.version}</summary>`, "", changelog, "", "</details>", "");
|
|
2590
|
+
}
|
|
2591
|
+
return lines.join("\n");
|
|
2592
|
+
};
|
|
2500
2593
|
// src/workflow/report/generateReleaseReport.ts
|
|
2501
2594
|
/**
|
|
2502
2595
|
* Generate a structured release report from the current workflow state.
|
|
@@ -2580,6 +2673,26 @@ function printReleaseReport(logger, report) {
|
|
|
2580
2673
|
}).join("\n\n");
|
|
2581
2674
|
logger.info(`${header}\n\n${list}\n`);
|
|
2582
2675
|
}
|
|
2676
|
+
// src/workflow/report/printReleaseReportAnnotation.ts
|
|
2677
|
+
/**
|
|
2678
|
+
* Print a GitHub Actions error annotation for a failed release.
|
|
2679
|
+
*
|
|
2680
|
+
* Detects a GitHub Actions runner through the `GITHUB_ACTIONS` environment
|
|
2681
|
+
* variable and writes a `::error` workflow command carrying the failure
|
|
2682
|
+
* reason to `stdout`, so GitHub surfaces the failure as an annotation on the
|
|
2683
|
+
* run page. Does nothing outside GitHub Actions or when the release did not
|
|
2684
|
+
* fail.
|
|
2685
|
+
*
|
|
2686
|
+
* @param env Readonly process environment variables object
|
|
2687
|
+
* @param stdout Writable stream receiving the annotation command
|
|
2688
|
+
* @param report Release report containing status and failure details
|
|
2689
|
+
*/
|
|
2690
|
+
function printReleaseReportAnnotation(env, stdout, report) {
|
|
2691
|
+
if (!isGitHubActions(env) || report.status !== "failure") return;
|
|
2692
|
+
const message = formatAnnotationMessage(report.error || "An unexpected error occurred during the release process.");
|
|
2693
|
+
stdout.write(`::error title=Release failed::${message}\n`);
|
|
2694
|
+
}
|
|
2695
|
+
var formatAnnotationMessage = (message) => message.replaceAll("%", "%25").replaceAll("\r", "%0D").replaceAll("\n", "%0A");
|
|
2583
2696
|
// src/workflow/executeReleaseWorkflow.ts
|
|
2584
2697
|
/**
|
|
2585
2698
|
* Execute the complete release workflow across all configured plugins.
|
|
@@ -2649,9 +2762,12 @@ async function executeReleaseWorkflow(context, plugins) {
|
|
|
2649
2762
|
context.error = err;
|
|
2650
2763
|
throw err;
|
|
2651
2764
|
} finally {
|
|
2652
|
-
|
|
2765
|
+
const report = generateReleaseReport(context);
|
|
2766
|
+
printReleaseReport(context.logger, report);
|
|
2767
|
+
appendReleaseReportSummary(context.logger, context.env, report);
|
|
2768
|
+
printReleaseReportAnnotation(context.env, context.stdout, report);
|
|
2653
2769
|
}
|
|
2654
2770
|
}
|
|
2655
|
-
export {
|
|
2771
|
+
export { isGitShallowRepository as $, getGitTagMessage as A, execGit as At, getGitRemote as B, SEMVER_REGEX as Bt, iterateChangelogVersions as C, readJson as Ct, isGitTagExact as D, isTruthyString as Dt, buildDependencyGraph as E, isClass as Et, deleteGitTag as F, ALL_FILES as Ft, readGitHistory as G, pickPriorityReleaseType as Gt, getGitConfigValue as H, isStableVersion as Ht, createGitTag as I, DEFAULT_CHANGELOG_FILE as It, detectGitRelationship as J, extractVersionQualifier as Jt, mergeGitHistory as K, deriveCommitReleaseType as Kt, readGitFile as L, DEV_NULL as Lt, generateGitTagName as M, compact as Mt, ensureGitTag as N, isDefined as Nt, isGitTagConnected as O, interpolate as Ot, isGitTagPresent as P, buildTrailerPattern as Pt, withShallowLock as Q, resolveGitRepository as R, GIT_TRAILER_RELEASE_AGENT as Rt, extractLatestVersion as S, unique as St, extractPlainText as T, isGitHubActions as Tt, restoreFullGitHistory as U, isSameReleaseCycle as Ut, ensureGitUserConfig as V, promotePrereleaseVersions as Vt, readParsedGitHistory as W, deriveReleaseType as Wt, resolveGitRevision as X, expandGitHistory as Y, isGitAncestor as Z, resolvePackageTag as _, isSemVerGitTag as _t, appendReleaseReportSummary as a, parseGitPrettyFormat as at, discoverPackageTag as b, createPlugin as bt, generateReleaseCommitMessage as c, extractMentions as ct, prependChangelog as d, deriveTransitionReleases as dt, countGitHistory as et, extractPreviousVersion as f, deriveChangeReleases as ft, propagateDependencyUpdates as g, sanitizePrereleaseLabel as gt, readPackageHistory as h, resolveReleaseChannel as ht, generateReleaseReport as i, GIT_PRETTY_FORMAT as it, getCurrentGitTag as j, execCommand as jt, getLatestGitTag as k, formatFile as kt, version as l, createGitCommit as lt, buildChangelog as m, resolveVersionQualifier as mt, printReleaseReportAnnotation as n, getParsedGitCommit as nt, HookManager as o, parseGitCommit as ot, buildReleaseNotes as p, packageContainsCommit as pt, GIT_REL_FLAGS as q, bumpVersion as qt, printReleaseReport as r, GIT_PRETTY_FIELD_SEPARATOR as rt, HookPriority as s, TTLCache as st, executeReleaseWorkflow as t, getCurrentGitCommit as tt, writeChangelog as u, getCurrentGitBranch as ut, resolvePackageStableTag as v, isSemVer as vt, extractSemVer as w, isMatch as wt, verifyPackageTag as x, writeJson as xt, filterPackages as y, findReleaseRule as yt, pushGitChanges as z, RELEASE_HOOK_NAMES as zt };
|
|
2656
2772
|
|
|
2657
|
-
//# sourceMappingURL=workflow-
|
|
2773
|
+
//# sourceMappingURL=workflow-MQRNVoZo.js.map
|