@reelout/core 0.9.0 → 0.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reelout/core",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Release engine for commit analysis, version planning, lifecycle hooks, and release notes.",
5
5
  "repository": {
6
6
  "type": "git",
package/src/types.ts CHANGED
@@ -244,6 +244,7 @@ export interface ReleasePlugin<P extends Package = Package> {
244
244
  export type ReleaseHookName = Exclude<keyof ReleasePlugin, 'name' | 'version'>
245
245
 
246
246
  export interface ReleaseReport {
247
+ dryRun: boolean
247
248
  outcome: ReleaseOutcome | null
248
249
  packages: {
249
250
  location: string
@@ -163,17 +163,15 @@ function throwIfCancelled(context: ReleaseContext): void {
163
163
  * send notifications and clean up: when a phase hook throws, plugin rollbacks
164
164
  * run while the error unwinds, then every `finalize` handler runs with the
165
165
  * failure recorded on `context.outcome`. When a `finalize` handler throws,
166
- * the remaining handlers still run: on a failed workflow each failure is
167
- * logged as a warning after the report, while on a successful workflow the
168
- * first failure fails the release. Failures in `finalize` never mask the
169
- * original workflow error.
166
+ * the remaining handlers still run and each failure is logged as a warning
167
+ * after the report. A failing `finalize` handler never changes the workflow
168
+ * outcome and never masks the original workflow error.
170
169
  *
171
170
  * @param context Release execution context containing runtime options and logger
172
171
  * @param plugins List of release plugins to execute
173
172
  * @returns Promise that resolves when all phases and `finalize` handlers
174
173
  * complete
175
- * @throws If a lifecycle hook fails, the workflow is cancelled, or a finalize
176
- * handler fails on an otherwise successful workflow
174
+ * @throws If a lifecycle hook fails or the workflow is cancelled
177
175
  */
178
176
  export async function executeReleaseWorkflow(
179
177
  context: ReleaseContext,
@@ -239,19 +237,6 @@ export async function executeReleaseWorkflow(
239
237
 
240
238
  await manager.emit('finalize', context)
241
239
 
242
- const [firstFinalizeFailure] = finalizeFailures
243
-
244
- if (context.outcome.status === 'success' && firstFinalizeFailure) {
245
- context.outcome = {
246
- status: 'failure',
247
- error: firstFinalizeFailure.error,
248
- phase: {
249
- hook: 'finalize',
250
- plugin: firstFinalizeFailure.plugin,
251
- },
252
- }
253
- }
254
-
255
240
  const report = generateReleaseReport(context)
256
241
 
257
242
  printReleaseReport(context.logger, report)
@@ -19,9 +19,11 @@ type ReportPlan = ReleaseReport['plans'][number]
19
19
  *
20
20
  * Detects a GitHub Actions runner through the `GITHUB_ACTIONS` environment
21
21
  * variable and appends the rendered `report` to the file referenced by
22
- * `GITHUB_STEP_SUMMARY`, so GitHub displays it on the run summary page. Does
23
- * nothing outside GitHub Actions or when no summary file is configured, and
24
- * logs a warning instead of throwing when the summary file cannot be written.
22
+ * `GITHUB_STEP_SUMMARY`, so GitHub displays it on the run summary page. Dry
23
+ * runs append a `(dry run)` marker to the status line; real releases render
24
+ * the status unmarked. Does nothing outside GitHub Actions or when no summary
25
+ * file is configured, and logs a warning instead of throwing when the summary
26
+ * file cannot be written.
25
27
  *
26
28
  * @param logger Logger instance for reporting summary write failures
27
29
  * @param env Readonly process environment variables object
@@ -57,7 +59,10 @@ const formatReleaseReportSummary = (report: ReleaseReport): string => {
57
59
  const lines: string[] = ['## ReelOut Release Report', '']
58
60
 
59
61
  if (report.outcome) {
60
- lines.push(`**Status:** ${STATUS_LABELS[report.outcome.status]}`, '')
62
+ const status = STATUS_LABELS[report.outcome.status]
63
+ const label = report.dryRun ? `${status} (dry run)` : status
64
+
65
+ lines.push(`**Status:** ${label}`, '')
61
66
  }
62
67
 
63
68
  if (report.outcome?.status === 'failure') {
@@ -8,14 +8,16 @@ import { compact } from '#util'
8
8
  * Generate a structured release report from the current workflow state.
9
9
  *
10
10
  * Extracts state information from `context` and organizes it into a report
11
- * containing the terminal release outcome, release plans, and package
12
- * metadata. Omits unversioned release plans from the finalized output.
11
+ * containing the `dryRun` flag, the terminal release outcome, release plans,
12
+ * and package metadata. Omits unversioned release plans from the finalized
13
+ * output.
13
14
  *
14
15
  * @param context Release execution context containing workflow state and plans
15
16
  * @returns Structured release report object containing workflow results
16
17
  */
17
18
  export function generateReleaseReport(context: ReleaseContext): ReleaseReport {
18
19
  return {
20
+ dryRun: context.dryRun,
19
21
  outcome: context.outcome,
20
22
  packages: context.packages.map((pkg) => ({
21
23
  location: pkg.location,
@@ -12,7 +12,8 @@ import { resolveOutcomeErrorMessage } from './resolveErrorMessage'
12
12
  *
13
13
  * Logs the terminal outcome status and details for planned package releases.
14
14
  * Displays package names, directories, and version changes on success, or
15
- * outputs the error message on failure.
15
+ * outputs the error message on failure. Dry runs append a `(dry run)` marker
16
+ * to the status line; real releases print the status unmarked.
16
17
  *
17
18
  * @param logger Logger instance for outputting messages
18
19
  * @param report Release report containing outcome and package details
@@ -27,7 +28,9 @@ export function printReleaseReport(
27
28
  failure: colors.red('FAILURE'),
28
29
  }[report.outcome.status]
29
30
 
30
- logger.info(`Status: ${statusLabel}`)
31
+ logger.info(
32
+ `Status: ${[statusLabel, report.dryRun && colors.yellow('(dry run)')].filter(Boolean).join(' ')}`
33
+ )
31
34
  }
32
35
 
33
36
  if (report.outcome?.status === 'failure') {