rylease 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1671 @@
1
+ import * as z from "zod";
2
+ import * as core from "zod/v4/core";
3
+ //#region src/core/options.d.ts
4
+ /** A step's options: a zod shape, from `zod` or `zod/mini`. */
5
+ type OptionsShape = core.$ZodShape;
6
+ /** What a step accepts: options with a default may be left out. */
7
+ type OptionsInput<S extends OptionsShape> = core.$InferObjectInput<S, Empty>;
8
+ /** What a step's `run` receives: every default applied. */
9
+ type OptionsValue<S extends OptionsShape> = core.$InferObjectOutput<S, Empty>;
10
+ /** An object type with no properties. */
11
+ type Empty = Record<never, never>;
12
+ /** Options that don't match a step's schema; the message lists every problem. */
13
+ declare class OptionsError extends Error {
14
+ readonly issues: readonly string[];
15
+ constructor(issues: readonly string[]);
16
+ }
17
+ /**
18
+ * Validates options against a shape, applying defaults. Unknown keys are
19
+ * rejected. Each problem is reported with `path` prepended, e.g.
20
+ * `conventional/determine-kind.types.docs: Invalid option: ...`.
21
+ */
22
+ declare function parseOptions<S extends OptionsShape>(shape: S, value: unknown, path: string): OptionsValue<S>;
23
+ declare function joinPath(path: string, keys?: readonly PropertyKey[]): string;
24
+ //#endregion
25
+ //#region src/components/cargo/workspaces.d.ts
26
+ /**
27
+ * The crates of a Cargo workspace, as components named after them, each
28
+ * depending on the workspace crates it lists as dependencies.
29
+ */
30
+ declare const cargoWorkspaces: Factory<"components", "cargo/workspaces", {
31
+ private: z.ZodDefault<z.ZodBoolean>;
32
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
33
+ }, ComponentSource>;
34
+ //#endregion
35
+ //#region src/components/dart/workspaces.d.ts
36
+ /**
37
+ * The packages of a pub workspace, or a Melos one, as components named after
38
+ * them, each depending on the workspace packages it lists as dependencies.
39
+ * The root is one too when it has a `version`, e.g. a Flutter app whose
40
+ * packages live beside it.
41
+ */
42
+ declare const dartWorkspaces: Factory<"components", "dart/workspaces", {
43
+ private: z.ZodDefault<z.ZodBoolean>;
44
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
45
+ }, ComponentSource>;
46
+ //#endregion
47
+ //#region src/components/npm/workspaces.d.ts
48
+ /**
49
+ * The packages of an npm, Yarn or pnpm workspace, as components named after
50
+ * them, each depending on the workspace packages it lists as dependencies.
51
+ */
52
+ declare const npmWorkspaces: Factory<"components", "npm/workspaces", {
53
+ private: z.ZodDefault<z.ZodBoolean>;
54
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
55
+ }, ComponentSource>;
56
+ declare namespace index_d_exports$4 {
57
+ export { cargoWorkspaces, dartWorkspaces, npmWorkspaces };
58
+ }
59
+ //#endregion
60
+ //#region src/core/factory.d.ts
61
+ /** What a factory makes: a step, preset, scheme, history or component source. */
62
+ type FactoryKind = "step" | "preset" | "scheme" | "history" | "components";
63
+ /**
64
+ * Something configured with options declared as a zod shape, the same way in
65
+ * TypeScript as in a workflow file; the options argument is optional when
66
+ * every option is.
67
+ */
68
+ interface Factory<K extends FactoryKind, N extends string, S extends OptionsShape, R> {
69
+ (...options: Empty extends OptionsInput<S> ? [options?: OptionsInput<S>] : [options: OptionsInput<S>]): R;
70
+ readonly kind: K;
71
+ readonly name: N;
72
+ readonly description: string | undefined;
73
+ readonly options: S;
74
+ }
75
+ /** Any factory of a kind, whatever its name or options. */
76
+ interface AnyFactory<K extends FactoryKind = FactoryKind, R = unknown> {
77
+ (options?: any): R;
78
+ readonly kind: K;
79
+ readonly name: string;
80
+ readonly description: string | undefined;
81
+ readonly options: OptionsShape;
82
+ }
83
+ interface FactoryDefinition<N extends string, S extends OptionsShape, R> {
84
+ /** Identifies it in reports and in workflow files, e.g. `calver`. */
85
+ name: N;
86
+ /** One line on what it does, for generated docs. */
87
+ description?: string;
88
+ /** A zod shape; use `.default()` for optional options and `.describe()` to document them. */
89
+ options?: S;
90
+ create: (options: OptionsValue<S>) => R;
91
+ }
92
+ //#endregion
93
+ //#region src/core/history.d.ts
94
+ /** Where a component's previous release is found: tags, a file, ... */
95
+ interface History {
96
+ readonly name: string;
97
+ find(input: HistoryInput): Promise<Found | undefined>;
98
+ /**
99
+ * The highest counter of a channel's versions of a target, among every
100
+ * release, not only those on HEAD, so channel versions never collide.
101
+ */
102
+ count?(input: HistoryInput & {
103
+ target: string;
104
+ }): Promise<number>;
105
+ /** Whether a release's tag exists already. */
106
+ exists?(input: HistoryInput & {
107
+ releaseTag: string;
108
+ }): Promise<boolean>;
109
+ }
110
+ interface HistoryInput {
111
+ env: Environment;
112
+ component: ComponentInfo;
113
+ scheme: Scheme;
114
+ /** The component's tag template, with `{name}` filled in, e.g. `v{version}`. */
115
+ tag: string;
116
+ /** The channel being released on; without one, only stable releases count. */
117
+ channel?: ResolvedChannel | undefined;
118
+ /** Every channel, to tell their versions from stable ones. */
119
+ channels: readonly ResolvedChannel[];
120
+ }
121
+ /** The previous release; `undefined` from `find` when there's none. */
122
+ interface Found {
123
+ /** Absent when the release's version isn't one of the scheme's. */
124
+ version?: string;
125
+ /** Its commit; without one, changes are collected from all history. */
126
+ ref?: string;
127
+ tag?: string;
128
+ /** e.g. `v1.4.0 at abc1234, nearest on HEAD`. */
129
+ reason: string;
130
+ /**
131
+ * On a channel, the nearest stable release, when `version` is a channel
132
+ * version; new versions are bumped from it.
133
+ */
134
+ stable?: {
135
+ version: string;
136
+ ref?: string;
137
+ tag?: string;
138
+ };
139
+ /**
140
+ * A release that's been prepared but not released, e.g. by a merged
141
+ * release pull request: only its `release` steps run.
142
+ */
143
+ pending?: Pending;
144
+ }
145
+ /** A prepared release, as a history finds it. */
146
+ interface Pending {
147
+ version: string;
148
+ notes?: string;
149
+ kind?: ReleaseKind;
150
+ previousVersion?: string;
151
+ /** e.g. `prepared in #12`. */
152
+ reason: string;
153
+ }
154
+ /** Defines where previous releases are found, with options as a zod shape. */
155
+ declare function defineHistory<const N extends string, S extends OptionsShape>(definition: FactoryDefinition<N, S, History>): Factory<"history", N, S, History>;
156
+ //#endregion
157
+ //#region src/core/types.d.ts
158
+ /** Every phase, in the order the engine runs its steps. */
159
+ declare const PHASES: readonly ["read-changes", "determine-kind", "determine-notes", "write", "stage", "release"];
160
+ type Phase = (typeof PHASES)[number];
161
+ /**
162
+ * How much a release changes, whatever the version scheme: the scheme decides
163
+ * what each kind bumps, e.g. semver's `MAJOR.minor.patch`.
164
+ */
165
+ declare const KINDS: readonly ["breaking", "feature", "fix", "none"];
166
+ type Kind = (typeof KINDS)[number];
167
+ /** A kind that actually produces a release; `none` releases nothing. */
168
+ type ReleaseKind = Exclude<Kind, "none">;
169
+ /** A single, source-agnostic change (a commit section, an issue, a PR, ...). */
170
+ interface Change {
171
+ title?: string;
172
+ description?: string;
173
+ /** Where this change came from, e.g. `commit aefc3af`. */
174
+ reason: string;
175
+ /** Where to read more, e.g. `{ label: "aefc3af", url: ".../commit/aefc3af..." }`. */
176
+ link?: {
177
+ label: string;
178
+ url: string;
179
+ };
180
+ /**
181
+ * How the source categorized it, e.g. a pull request's labels, or the
182
+ * `### Fixed` section of a changelog.
183
+ */
184
+ labels?: string[];
185
+ }
186
+ /**
187
+ * A versioned unit, as steps see it: one package, a Go module, a Docker
188
+ * image, or several packages released together under one version.
189
+ */
190
+ interface ComponentInfo {
191
+ name: string;
192
+ /** Its directory, relative to `env.cwd`; `.` for the whole project. */
193
+ path: string;
194
+ /** Components it depends on, by name; they're released first. */
195
+ dependsOn: readonly string[];
196
+ /**
197
+ * Pathspecs for git: its directory, without the directories of components
198
+ * inside it. Empty when every path counts.
199
+ */
200
+ pathspec: readonly string[];
201
+ }
202
+ interface ChangesOutput {
203
+ changes: Change[];
204
+ /** e.g. `6 changes in 4 commits since 1a2b3c4`. */
205
+ reason: string;
206
+ }
207
+ interface KindOutput {
208
+ kind: Kind;
209
+ /**
210
+ * Releases exactly this version instead of bumping by the kind, e.g. from
211
+ * a `Release-As:` footer. It must be valid in the scheme, and later than
212
+ * the previous version.
213
+ */
214
+ version?: string;
215
+ /** e.g. `'feat!' in title (commit aefc3af)`. */
216
+ reason: string;
217
+ }
218
+ interface NotesOutput {
219
+ notes: string;
220
+ /** e.g. `feature release, 3 features, 1 fix`. */
221
+ reason: string;
222
+ }
223
+ interface ReleaseOutput {
224
+ output: unknown;
225
+ /** Files the step changed (or would change in a dry run), relative to `cwd`. */
226
+ files?: string[];
227
+ /** e.g. `wrote 1.3.0 to package.json`. */
228
+ reason: string;
229
+ }
230
+ /** What `write` and `stage` steps return. */
231
+ interface WriteOutput extends ReleaseOutput {
232
+ /**
233
+ * Leaves the release to later, e.g. once a release pull request merges:
234
+ * every `release` step is skipped with this reason, and the run is
235
+ * `pending`.
236
+ */
237
+ defer?: string;
238
+ }
239
+ /** What the steps of each phase must return. */
240
+ interface StepOutputs {
241
+ "read-changes": ChangesOutput;
242
+ "determine-kind": KindOutput;
243
+ "determine-notes": NotesOutput;
244
+ write: WriteOutput;
245
+ stage: WriteOutput;
246
+ release: ReleaseOutput;
247
+ }
248
+ /** The output of a prior `write`, `stage` or `release` step, as later ones see it. */
249
+ interface ReleaseResult {
250
+ name: string;
251
+ output: unknown;
252
+ files: readonly string[];
253
+ }
254
+ /** Where a component's release starts from; found before any step runs. */
255
+ interface Previous {
256
+ component: ComponentInfo;
257
+ /** Absent on a first release, or when the scheme changed since the last one. */
258
+ previousVersion?: string;
259
+ /** The commit of the previous release; changes are collected since it. */
260
+ previousRef?: string;
261
+ /** The tag of the previous release, when it was found by its tag. */
262
+ previousTag?: string;
263
+ }
264
+ /** The release being made, from `determine-notes` on. */
265
+ interface Next {
266
+ kind: ReleaseKind;
267
+ version: string;
268
+ /** The release's tag, e.g. `v1.2.0`. */
269
+ tag: string;
270
+ /**
271
+ * Values for `{placeholders}` in templates: `version`, `tag`, `name`, and
272
+ * the scheme's own, e.g. semver's `major`, `minor` and `patch`.
273
+ */
274
+ placeholders: Readonly<Record<string, string>>;
275
+ /** The components it depends on that are released along with it. */
276
+ dependencies: readonly Dependency[];
277
+ }
278
+ /** A dependency released along with a component. */
279
+ interface Dependency {
280
+ name: string;
281
+ version: string;
282
+ previousVersion?: string;
283
+ kind: ReleaseKind;
284
+ }
285
+ /**
286
+ * What a step receives for one component, by phase. Values from earlier phases
287
+ * are always present; the value of a step's own phase is only present when
288
+ * an earlier step of the same phase already ran.
289
+ */
290
+ interface StepResults {
291
+ "read-changes": Previous & {
292
+ changes?: Change[];
293
+ };
294
+ "determine-kind": Previous & {
295
+ changes: Change[];
296
+ kind?: Kind;
297
+ };
298
+ "determine-notes": Previous & Next & {
299
+ changes: Change[];
300
+ notes?: string;
301
+ };
302
+ write: Previous & Next & {
303
+ changes: Change[];
304
+ notes: string;
305
+ releases: readonly ReleaseResult[];
306
+ };
307
+ stage: StepResults["write"];
308
+ release: StepResults["write"];
309
+ }
310
+ interface Environment {
311
+ /** Root directory of the project being released. */
312
+ cwd: string;
313
+ /** Current branch name. */
314
+ branch: string;
315
+ /** When set, steps must not cause side effects. */
316
+ dryRun: boolean;
317
+ /** The channel being released on; absent for a stable release. */
318
+ channel?: RunChannel;
319
+ }
320
+ /**
321
+ * How a step runs: once per component (`each`, the default), or once with
322
+ * every component (`all`), e.g. to commit or push their releases together.
323
+ */
324
+ type Scope = "each" | "all";
325
+ type StepStatus = "ok" | "skipped" | "failed";
326
+ /** What the engine itself records: the previous version, and the next. */
327
+ type EnginePhase = "read-version" | "determine-version";
328
+ /** The audit record of a single step, or of the engine's own work. */
329
+ interface StepRecord {
330
+ phase: Phase | EnginePhase;
331
+ name: string;
332
+ /** The component it ran for; absent for `all` steps. */
333
+ component?: string;
334
+ status: StepStatus;
335
+ durationMs: number;
336
+ reason: string;
337
+ output?: unknown;
338
+ error?: unknown;
339
+ }
340
+ interface Shared<Ctx> {
341
+ env: Environment;
342
+ /** User-defined state shared by every step. Never used by bundled steps. */
343
+ context: Ctx;
344
+ /** Records of every step that ran before this one. */
345
+ history: readonly StepRecord[];
346
+ }
347
+ /** What a step receives, for one component. */
348
+ type StepInput<T extends Phase, Ctx = unknown, N extends Fact = never> = Narrow<StepResults[T], N> & Shared<Ctx>;
349
+ /** What an `all` step receives: every component that's still releasing. */
350
+ type AllStepInput<T extends Phase, Ctx = unknown, N extends Fact = never> = {
351
+ components: readonly Narrow<StepResults[T], N>[];
352
+ } & Shared<Ctx>;
353
+ /** What a step returns, for one component. */
354
+ type StepOutput<T extends Phase, P extends Fact = never> = ProvidedOutput<StepOutputs[T], P>;
355
+ /**
356
+ * What an `all` step returns: in `write`, `stage` and `release`, one result for all of them;
357
+ * otherwise a result per component, by name, leaving out those it doesn't
358
+ * change.
359
+ */
360
+ type AllStepOutput<T extends Phase, P extends Fact = never> = T extends "release" ? ReleaseOutput : T extends "write" | "stage" ? WriteOutput : {
361
+ results: Partial<Record<string, StepOutput<T, P>>>;
362
+ reason: string;
363
+ };
364
+ /**
365
+ * Whether a step runs, decided just before it would, from what it would
366
+ * receive. `source` describes it in reports, e.g. the expression it came from.
367
+ */
368
+ interface StepCondition<I> {
369
+ (input: I): boolean;
370
+ readonly source?: string;
371
+ }
372
+ interface StepBase<T extends Phase> {
373
+ phase: T;
374
+ name: string;
375
+ /** Facts the step relies on, e.g. `changes.labels`; checked before anything runs. */
376
+ needs?: readonly Fact[];
377
+ /** Facts the step guarantees, e.g. that every change has `labels`; checked on its output. */
378
+ provides?: readonly Fact[];
379
+ /** The preset that made the step, with the scheme and history it provides. */
380
+ preset?: StepPreset;
381
+ }
382
+ /** A preset, as the steps it makes carry it. */
383
+ interface StepPreset {
384
+ name: string;
385
+ scheme?: Scheme;
386
+ history?: History | readonly History[];
387
+ }
388
+ interface EachStepDefinition<T extends Phase, Ctx = unknown> extends StepBase<T> {
389
+ scope?: "each";
390
+ /** When set, the step only runs if this returns true; otherwise it's skipped. */
391
+ if?: StepCondition<StepInput<T, Ctx>>;
392
+ run: (input: StepInput<T, Ctx>) => StepOutputs[T] | Promise<StepOutputs[T]>;
393
+ }
394
+ interface AllStepDefinition<T extends Phase, Ctx = unknown> extends StepBase<T> {
395
+ scope: "all";
396
+ /** When set, the step only runs if this returns true; otherwise it's skipped. */
397
+ if?: StepCondition<AllStepInput<T, Ctx>>;
398
+ run: (input: AllStepInput<T, Ctx>) => AllStepOutput<T> | Promise<AllStepOutput<T>>;
399
+ }
400
+ type StepDefinition<T extends Phase, Ctx = unknown> = EachStepDefinition<T, Ctx> | AllStepDefinition<T, Ctx>;
401
+ /** Any step, discriminated by `phase` and `scope`. */
402
+ type Step<Ctx = unknown> = { [T in Phase]: StepDefinition<T, Ctx>; }[Phase];
403
+ //#endregion
404
+ //#region src/core/facts.d.ts
405
+ /**
406
+ * What can be known about a release before it's made, beyond its shape: what
407
+ * steps declare they `need`, and what steps and schemes declare they
408
+ * `provide`. Add your own by declaration merging:
409
+ *
410
+ * ```ts
411
+ * declare module "rylease" {
412
+ * interface Facts { "changes.jira": true }
413
+ * }
414
+ * ```
415
+ */
416
+ interface Facts {
417
+ /** Every change has a `title`. */
418
+ "changes.title": true;
419
+ /** Every change has a `description`. */
420
+ "changes.description": true;
421
+ /** Every change has `labels`, if only `[]`. */
422
+ "changes.labels": true;
423
+ /** Every change has a `link`. */
424
+ "changes.link": true;
425
+ /** There's a previous version, in the release's scheme. */
426
+ previousVersion: true;
427
+ /** Versions are semantic versions, e.g. as npm requires. */
428
+ "version.semver": true;
429
+ }
430
+ type Fact = Extract<keyof Facts, string>;
431
+ type ChangeField<N> = N extends `changes.${infer K}` ? Extract<K, keyof Change> : never;
432
+ /** A change that's known to have the given fields. */
433
+ type ChangeWith<K extends keyof Change> = Change & { [P in K]-?: Exclude<Change[P], undefined>; };
434
+ /** A step's input, with what its `needs` guarantee. */
435
+ type Narrow<R, N extends Fact> = [N] extends [never] ? R : Omit<R, ([ChangeField<N>] extends [never] ? never : "changes") | ("previousVersion" extends N ? "previousVersion" : never)> & ([ChangeField<N>] extends [never] ? unknown : {
436
+ changes: ChangeWith<ChangeField<N>>[];
437
+ }) & ("previousVersion" extends N ? {
438
+ previousVersion: string;
439
+ } : unknown);
440
+ /** A step's output, with what its `provides` promise. */
441
+ type ProvidedOutput<O, P extends Fact> = [ChangeField<P>] extends [never] ? O : O extends {
442
+ changes: Change[];
443
+ } ? Omit<O, "changes"> & {
444
+ changes: ChangeWith<ChangeField<P>>[];
445
+ } : O;
446
+ //#endregion
447
+ //#region src/core/scheme.d.ts
448
+ /**
449
+ * A version scheme: the one place that knows what a version looks like. It
450
+ * recognizes and orders versions, works out the next, and names their parts
451
+ * for templates. Everything else treats versions as plain text.
452
+ */
453
+ interface Scheme {
454
+ /** Describes it in reports, e.g. `semver` or `calver YYYY.MM.MICRO`. */
455
+ readonly name: string;
456
+ /** Facts that hold for every version it makes, e.g. `version.semver`. */
457
+ readonly traits?: readonly Fact[];
458
+ /** Whether a version is one of this scheme's, strictly. */
459
+ matches(version: string): boolean;
460
+ /** Orders two of its versions. */
461
+ compare(a: string, b: string): number;
462
+ /**
463
+ * The next version: after `previous` by `kind`, or the first one without
464
+ * a previous version, e.g. on a first release.
465
+ */
466
+ bump(input: BumpInput): {
467
+ version: string;
468
+ reason: string;
469
+ };
470
+ /** `{placeholders}` for templates, e.g. `{ major: "1", minor: "2", patch: "3" }`. */
471
+ fields?(version: string): Record<string, string>;
472
+ /**
473
+ * How channel versions are written, by channel type, e.g.
474
+ * `{ prerelease: "{version}rc{n}" }`; by default `{version}-{channel}.{n}`
475
+ * and `{version}+{channel}.{n}`.
476
+ */
477
+ readonly formats?: {
478
+ readonly prerelease?: string;
479
+ readonly build?: string;
480
+ };
481
+ }
482
+ interface BumpInput {
483
+ /** Absent on a first release, or when the scheme changed since the last one. */
484
+ previous?: string;
485
+ kind: ReleaseKind;
486
+ branch: string;
487
+ date: Date;
488
+ }
489
+ /**
490
+ * Defines a version scheme whose options are declared as a zod shape. The
491
+ * result is a factory, like a step's: `calver({ format: "YY.MINOR.MICRO" })`.
492
+ */
493
+ declare function defineScheme<const N extends string, S extends OptionsShape>(definition: FactoryDefinition<N, S, Scheme>): Factory<"scheme", N, S, Scheme>;
494
+ //#endregion
495
+ //#region src/core/channels.d.ts
496
+ /**
497
+ * A release channel: versions that wrap the scheme's own in a format with a
498
+ * counter, e.g. `2.0.0-next.1`. A `prerelease` comes before the version it
499
+ * leads up to; a `build` comes after the version it numbers builds of.
500
+ */
501
+ interface Channel {
502
+ /** Branches that release on this channel, as globs, e.g. `beta/*`. */
503
+ branches?: readonly string[];
504
+ /** Defaults to `prerelease`. */
505
+ type?: ChannelType;
506
+ /**
507
+ * How its versions are written: `{version}` is the target version, `{n}`
508
+ * the counter and `{channel}` the channel's name. Defaults to the
509
+ * scheme's, or `{version}-{channel}.{n}` for a prerelease and
510
+ * `{version}+{channel}.{n}` for a build.
511
+ */
512
+ format?: string;
513
+ }
514
+ type ChannelType = "prerelease" | "build";
515
+ /** The channel a run releases on. */
516
+ interface RunChannel {
517
+ name: string;
518
+ type: ChannelType;
519
+ }
520
+ /** A channel, with its format worked out for a scheme. */
521
+ interface ResolvedChannel extends RunChannel {
522
+ format: string;
523
+ }
524
+ //#endregion
525
+ //#region src/core/components.d.ts
526
+ /** A versioned unit of the project; see {@link ComponentInfo}. */
527
+ interface Component {
528
+ name: string;
529
+ /** Its directory, relative to the project. Defaults to `.`. */
530
+ path?: string;
531
+ /** Components it depends on, by name. */
532
+ dependsOn?: readonly string[];
533
+ /** Overrides the release's scheme. */
534
+ scheme?: Scheme;
535
+ /** Overrides the release's tag template. */
536
+ tag?: string;
537
+ /** Overrides where the release finds previous versions. */
538
+ history?: History;
539
+ }
540
+ /** Finds a project's components, e.g. the packages of a workspace. */
541
+ interface ComponentSource {
542
+ readonly name: string;
543
+ resolve(env: Environment): Promise<Component[]>;
544
+ }
545
+ /** Defines a source of components, with options as a zod shape. */
546
+ declare function defineComponents<const N extends string, S extends OptionsShape>(definition: FactoryDefinition<N, S, ComponentSource>): Factory<"components", N, S, ComponentSource>;
547
+ /** A component with everything worked out. */
548
+ interface ResolvedComponent {
549
+ info: ComponentInfo;
550
+ scheme: Scheme;
551
+ history: History;
552
+ /** The tag template, with `{name}` filled in. */
553
+ tag: string;
554
+ }
555
+ interface Defaults {
556
+ scheme: Scheme;
557
+ history: History;
558
+ /** Defaults to `v{version}` for one component, `{name}@{version}` for more. */
559
+ tag: string | undefined;
560
+ }
561
+ /**
562
+ * Checks components and fills in their defaults, ordered so that each comes
563
+ * after the components it depends on.
564
+ */
565
+ declare function resolveComponents(components: readonly Component[], defaults: Defaults): ResolvedComponent[];
566
+ //#endregion
567
+ //#region src/core/reporter.d.ts
568
+ /** Receives progress from the engine; every hook is optional. */
569
+ interface Reporter {
570
+ start?(env: Environment,
571
+ /** Every step, and the engine's own rows: `read-version` and `determine-version`. */
572
+ steps: readonly {
573
+ phase: Phase | EnginePhase;
574
+ name: string;
575
+ }[], components: readonly ComponentInfo[]): void;
576
+ step?(record: StepRecord): void;
577
+ finish?(report: ReleaseReport): void;
578
+ }
579
+ interface PrettyReporterOptions {
580
+ /** Defaults to writing to stdout. */
581
+ write?: (text: string) => void;
582
+ /** Defaults to `true` on a TTY unless `NO_COLOR` is set. */
583
+ color?: boolean;
584
+ }
585
+ /** Aligned, colored output: one row per step with phase, name, duration and reason. */
586
+ declare function prettyReporter(options?: PrettyReporterOptions): Reporter;
587
+ declare function defaultReporter(): Reporter;
588
+ declare function formatDuration(ms: number): string;
589
+ //#endregion
590
+ //#region src/core/engine.d.ts
591
+ interface RunOptions {
592
+ /** Defaults to `process.cwd()`. */
593
+ cwd?: string;
594
+ /** Defaults to the CI's branch (GitHub Actions or GitLab CI), or the checked-out one. */
595
+ branch?: string;
596
+ /** Defaults to `false`. */
597
+ dryRun?: boolean;
598
+ /** Defaults to pretty output on stdout; pass `null` for silence. */
599
+ reporter?: Reporter | null;
600
+ /**
601
+ * Releases that have already been worked out, e.g. by an earlier job: only
602
+ * the `release` steps run, for these versions, and every other step is
603
+ * skipped. With several components, each names its own.
604
+ */
605
+ release?: GivenRelease | readonly GivenRelease[];
606
+ /**
607
+ * The channel to release on, e.g. `nightly`. Defaults to the first whose
608
+ * branches match, or a stable release.
609
+ */
610
+ channel?: string;
611
+ }
612
+ interface GivenRelease {
613
+ version: string;
614
+ /** Defaults to none. */
615
+ notes?: string;
616
+ /** Defaults to the version itself. */
617
+ previousVersion?: string;
618
+ /** Defaults to the difference between the versions, or `fix`. */
619
+ kind?: ReleaseKind;
620
+ /** The component it's for; needed when there are several. */
621
+ component?: string;
622
+ }
623
+ /** How a release is made: its steps, and how versions are found and made. */
624
+ interface ReleaseSetup<Ctx> {
625
+ steps: readonly Step<Ctx>[];
626
+ context: Ctx;
627
+ scheme: Scheme;
628
+ /** Defaults to `v{version}` for one component, `{name}@{version}` for several. */
629
+ tag?: string | undefined;
630
+ /** Where previous releases are found; the first that finds one wins. */
631
+ history: History | readonly History[];
632
+ /** Defaults to one component, the whole project. */
633
+ components?: readonly Component[] | ComponentSource | undefined;
634
+ /** Prerelease and build channels, by name. Defaults to none. */
635
+ channels?: Readonly<Record<string, Channel>> | undefined;
636
+ }
637
+ /**
638
+ * `pending` when a `write` step left the release to later, e.g. to a
639
+ * release pull request.
640
+ */
641
+ type ReleaseStatus = "released" | "pending" | "unchanged" | "failed";
642
+ interface ComponentReport {
643
+ name: string;
644
+ path: string;
645
+ status: ReleaseStatus;
646
+ previousVersion?: string;
647
+ previousRef?: string;
648
+ previousTag?: string;
649
+ kind?: Kind;
650
+ version?: string;
651
+ tag?: string;
652
+ notes?: string;
653
+ /** The components it depends on that were released along with it. */
654
+ dependencies: Dependency[];
655
+ releases: ReleaseResult[];
656
+ }
657
+ interface ReleaseReport {
658
+ env: Environment;
659
+ status: ReleaseStatus;
660
+ records: StepRecord[];
661
+ /** Every component, dependencies first. */
662
+ components: ComponentReport[];
663
+ /** With one component, its values, for convenience. */
664
+ previousVersion?: string;
665
+ previousRef?: string;
666
+ kind?: Kind;
667
+ version?: string;
668
+ notes?: string;
669
+ /** With one component, the results of its `write`, `stage` and `release` steps. */
670
+ releases: ReleaseResult[];
671
+ /** Why the release was left to later, when it's `pending`. */
672
+ deferred?: string;
673
+ error?: unknown;
674
+ }
675
+ declare class ReleaseError extends Error {
676
+ readonly report: ReleaseReport;
677
+ constructor(message: string, report: ReleaseReport, options?: ErrorOptions);
678
+ }
679
+ /** Stable sort of steps by phase; steps of the same phase keep their order. */
680
+ declare function sortSteps<S extends {
681
+ phase: Phase;
682
+ }>(steps: readonly S[]): S[];
683
+ declare function runRelease<Ctx>(setup: ReleaseSetup<Ctx>, options?: RunOptions): Promise<ReleaseReport>;
684
+ declare function errorMessage(error: unknown): string;
685
+ //#endregion
686
+ //#region src/core/define.d.ts
687
+ type ReleaseConfig<Context> = {
688
+ /** Steps to run; they're ordered by phase, keeping their order within a phase. */
689
+ steps: readonly Step<Context>[];
690
+ /**
691
+ * How versions look, are ordered and bumped, e.g. `semver()`. Needed
692
+ * unless a preset among `steps` provides one, as `conventional` does.
693
+ */
694
+ scheme?: Scheme;
695
+ /**
696
+ * Each release's tag; `{version}` and `{name}` (the component's) are
697
+ * filled in. Defaults to `v{version}`, or `{name}@{version}` with several
698
+ * components.
699
+ */
700
+ tag?: string;
701
+ /**
702
+ * Where previous releases are found, e.g. `gitTags()`; with several, the
703
+ * first that finds one wins. Needed unless a preset among `steps`
704
+ * provides one, as every built-in preset does.
705
+ */
706
+ history?: History | readonly History[];
707
+ /**
708
+ * What's versioned and released: a list, or a source such as
709
+ * `npmWorkspaces()`. Defaults to the whole project, as one component.
710
+ */
711
+ components?: readonly Component[] | ComponentSource;
712
+ /**
713
+ * Prerelease and build channels, by name, e.g.
714
+ * `{ next: { branches: ["next"] } }` for `2.0.0-next.1`. A run releases
715
+ * on the first whose branches match, or the one it's given.
716
+ */
717
+ channels?: Readonly<Record<string, Channel>>;
718
+ } & (undefined extends Context ? {
719
+ /** Shared, mutable state passed to every step. */
720
+ context?: Context;
721
+ } : {
722
+ /** Shared, mutable state passed to every step. */
723
+ context: Context;
724
+ });
725
+ interface Release<Context> {
726
+ readonly steps: readonly Step<Context>[];
727
+ /** Its own scheme, or its preset's. */
728
+ readonly scheme: Scheme;
729
+ /** Its own history, or its preset's. */
730
+ readonly history: History | readonly History[];
731
+ run(options?: RunOptions): Promise<ReleaseReport>;
732
+ }
733
+ /**
734
+ * Defines a release pipeline. Pass a custom context type to type the `context`
735
+ * every step receives: `defineRelease<{ slackTs?: string }>({ context: {}, steps })`.
736
+ * Its `scheme` and `history` are its own, or else the preset's its steps come from.
737
+ */
738
+ declare function defineRelease<Context = undefined>(config: ReleaseConfig<Context>): Release<Context>;
739
+ /** The step a factory makes, by scope. */
740
+ type ScopedStep<T extends Phase, Sc extends Scope> = Sc extends "all" ? AllStepDefinition<T> : EachStepDefinition<T>;
741
+ interface StepFactoryDefinition<T extends Phase, N extends string, S extends OptionsShape, Sc extends Scope, Needs extends Fact, Provides extends Fact> {
742
+ /** Its phase; a function works it out from its options, e.g. a `phase` option. */
743
+ phase: T | ((options: OptionsValue<S>) => T);
744
+ /** Identifies the step in reports and in workflow `steps`, e.g. `git/commit`. */
745
+ name: N;
746
+ /** One line on what the step does, for generated docs. */
747
+ description?: string;
748
+ /** Runs once per component (`each`, the default) or once with all of them (`all`). */
749
+ scope?: Sc;
750
+ /**
751
+ * Facts it relies on, e.g. `changes.labels`; its input is typed
752
+ * accordingly. A function works them out from its options, e.g. by format.
753
+ */
754
+ needs?: readonly Needs[] | ((options: OptionsValue<S>) => readonly Fact[]);
755
+ /** Facts it guarantees, e.g. that every change has `labels`. */
756
+ provides?: readonly Provides[];
757
+ /** A zod shape; use `.default()` for optional options and `.describe()` to document them. */
758
+ options?: S;
759
+ run: (input: (Sc extends "all" ? AllStepInput<T, unknown, Needs> : StepInput<T, unknown, Needs>) & {
760
+ options: OptionsValue<S>;
761
+ }) => Sc extends "all" ? AllStepOutput<T, Provides> | Promise<AllStepOutput<T, Provides>> : StepOutput<T, Provides> | Promise<StepOutput<T, Provides>>;
762
+ }
763
+ /** Creates a configured step; the options argument is optional when every option is. */
764
+ interface StepFactory<T extends Phase = Phase, N extends string = string, S extends OptionsShape = OptionsShape, Sc extends Scope = Scope> extends Factory<"step", N, S, ScopedStep<T, Sc>> {
765
+ /** Its phase, or a function of its options that works it out. */
766
+ readonly phase: T | ((options: OptionsValue<S>) => T);
767
+ readonly scope: Sc;
768
+ readonly needs: readonly Fact[];
769
+ readonly provides: readonly Fact[];
770
+ }
771
+ /** Any step factory, whatever its phase, name or options. */
772
+ interface AnyStepFactory extends AnyFactory<"step", Step> {
773
+ readonly phase: Phase | ((options: never) => Phase);
774
+ readonly scope: Scope;
775
+ readonly needs: readonly Fact[];
776
+ readonly provides: readonly Fact[];
777
+ }
778
+ /** What a factory accepts, e.g. `FactoryOptions<typeof gitCommit>`. */
779
+ type FactoryOptions<F extends {
780
+ options: OptionsShape;
781
+ }> = OptionsInput<F["options"]>;
782
+ /**
783
+ * Defines a reusable step whose options are declared as a zod shape. The
784
+ * result is a factory: call it with options to get a step. Its options are
785
+ * validated on every call, so they're just as safe when they come from a
786
+ * workflow file.
787
+ *
788
+ * ```ts
789
+ * export const header = defineStep({
790
+ * phase: "determine-notes",
791
+ * name: "header",
792
+ * options: { text: z.string().default("Released by rylease") },
793
+ * run: ({ notes, options }) => ({ notes: `> ${options.text}\n\n${notes}`, reason: "added header" }),
794
+ * });
795
+ * header({ text: "Hi" });
796
+ * ```
797
+ */
798
+ declare function defineStep<T extends Phase, const N extends string, S extends OptionsShape = Empty, Sc extends Scope = "each", const Needs extends Fact = never, const Provides extends Fact = never>(definition: StepFactoryDefinition<T, N, S, Sc, Needs, Provides>): StepFactory<T, N, S, Sc>;
799
+ /** Options for each step of a preset, by name; `false` leaves a step out. */
800
+ type PresetOptions<F extends readonly AnyStepFactory[]> = { [K in F[number] as K["name"]]?: FactoryOptions<K> | false; };
801
+ /** A preset's own options for its steps, by name. */
802
+ type PresetDefaults<F extends readonly AnyStepFactory[]> = { [K in F[number] as K["name"]]?: FactoryOptions<K>; };
803
+ /** A named list of step factories that's configured, and used, as one. */
804
+ interface Preset<N extends string = string, F extends readonly AnyStepFactory[] = readonly AnyStepFactory[]> {
805
+ (options?: PresetOptions<F>): Step[];
806
+ readonly kind: "preset";
807
+ readonly name: N;
808
+ readonly description: string | undefined;
809
+ readonly steps: F;
810
+ readonly defaults: PresetDefaults<F>;
811
+ /** Makes the scheme of releases made with it, unless they set their own. */
812
+ readonly scheme: (() => Scheme) | undefined;
813
+ /** Makes the history of releases made with it, unless they set their own. */
814
+ readonly history: (() => History | readonly History[]) | undefined;
815
+ }
816
+ /**
817
+ * Bundles step factories under one name. Calling the preset creates every
818
+ * step, passing each its options by name:
819
+ * `conventional({ "github/create-release": false, "conventional/determine-kind": { fallback: "none" } })`.
820
+ * `defaults` sets the preset's own options per step, under the caller's;
821
+ * `scheme` and `history` make the release's, unless it sets its own, e.g.
822
+ * `history: gitTags` for a preset that tags its releases.
823
+ */
824
+ declare function definePreset<const N extends string, const F extends readonly AnyStepFactory[]>(definition: {
825
+ name: N;
826
+ description?: string;
827
+ steps: F;
828
+ defaults?: PresetDefaults<F>;
829
+ scheme?: () => Scheme;
830
+ history?: () => History | readonly History[];
831
+ }): Preset<N, F>;
832
+ /** What a step's condition receives. */
833
+ type ConditionInput<S> = S extends {
834
+ run: (input: infer I) => unknown;
835
+ } ? I : never;
836
+ /**
837
+ * Makes a step run only when `condition` holds, on top of any condition it
838
+ * already has: `when(steps.npmPublish(), ({ env }) => !env.dryRun)`.
839
+ */
840
+ declare function when<S extends Step<never>>(step: S, condition: StepCondition<ConditionInput<S>>): S;
841
+ //#endregion
842
+ //#region src/config/workflow.d.ts
843
+ /** What a workflow gives, already parsed from YAML. */
844
+ interface WorkflowInput {
845
+ steps: unknown;
846
+ scheme?: unknown;
847
+ tag?: unknown;
848
+ history?: unknown;
849
+ components?: unknown;
850
+ channels?: unknown;
851
+ }
852
+ /** A release defined in a workflow, ready for `defineRelease`. */
853
+ type WorkflowRelease = Omit<ReleaseConfig<undefined>, "context">;
854
+ /**
855
+ * Turns a workflow's inputs into a release: its `steps`, and how versions are
856
+ * made (`scheme`), tagged (`tag`), found (`history`), and of what
857
+ * (`components`). Each of those but `tag` names what it `uses` and passes
858
+ * it options `with`, or is just a name:
859
+ *
860
+ * ```yaml
861
+ * scheme: { uses: calver, with: { format: YY.MINOR.MICRO } }
862
+ * components: npm/workspaces
863
+ * ```
864
+ */
865
+ declare function resolveWorkflow(input: WorkflowInput, options: WorkflowOptions): Promise<WorkflowRelease>;
866
+ interface WorkflowOptions {
867
+ /** Paths and packages are resolved from here. */
868
+ cwd: string;
869
+ }
870
+ /**
871
+ * Turns workflow `steps` (already parsed from YAML) into steps. Each entry
872
+ * names what it `uses`, passes it options `with`, and may run only `if` an
873
+ * expression holds:
874
+ *
875
+ * ```yaml
876
+ * - uses: conventional # a bundled preset or step
877
+ * with:
878
+ * github/create-release: false
879
+ * - uses: ./release/announce.ts # a file's default export
880
+ * if: "!dryRun && kind != 'patch'"
881
+ * with:
882
+ * channel: "#releases"
883
+ * - uses: some-package#slackNotes # a package's named export
884
+ * ```
885
+ */
886
+ declare function resolveWorkflowSteps(entries: unknown, options: WorkflowOptions): Promise<Step[]>;
887
+ //#endregion
888
+ //#region src/core/expression.d.ts
889
+ /**
890
+ * What an `if:` expression can read: the release so far, as the step itself
891
+ * would receive it.
892
+ */
893
+ interface ExpressionContext {
894
+ dryRun: boolean;
895
+ branch: string;
896
+ cwd: string;
897
+ /** The channel being released on, or `null` for a stable release. */
898
+ channel: string | null;
899
+ /** Whether the release is on a prerelease channel. */
900
+ prerelease: boolean;
901
+ /** The component the step runs for: `{ name, path }`; absent for `all` steps. */
902
+ component?: {
903
+ name: string;
904
+ path: string;
905
+ };
906
+ /** For `all` steps: every component being released, with its values. */
907
+ components?: readonly unknown[];
908
+ previousVersion?: string;
909
+ previousRef?: string;
910
+ previousTag?: string;
911
+ changes?: readonly unknown[];
912
+ kind?: string;
913
+ version?: string;
914
+ tag?: string;
915
+ notes?: string;
916
+ /** The components it depends on released along with it: `{ name, version, … }`. */
917
+ dependencies?: readonly unknown[];
918
+ /** The steps that ran before, by name: `{ phase, status, reason, output }`. */
919
+ steps: Record<string, unknown>;
920
+ }
921
+ /** What an expression reads, from what a step receives: for one component, or all. */
922
+ declare function expressionContext(input: unknown): ExpressionContext;
923
+ type Node = (context: ExpressionContext) => unknown;
924
+ /**
925
+ * Compiles an `if:` expression, in the style of GitHub's: literals (`true`,
926
+ * `'text'`, `1`, `null`), names from {@link ExpressionContext} with `.x` and
927
+ * `['x']` access, `!`, `==`, `!=`, `<`, `<=`, `>`, `>=`, `&&`, `||`,
928
+ * parentheses, and `contains`, `startsWith` and `endsWith`.
929
+ */
930
+ declare function compileExpression(source: string): Node;
931
+ //#endregion
932
+ //#region src/core/summary.d.ts
933
+ /**
934
+ * The report as Markdown, for GitHub's job summary: what happened, a row per
935
+ * step, and the release notes.
936
+ */
937
+ declare function markdownSummary(report: ReleaseReport): string;
938
+ //#endregion
939
+ //#region src/histories/fs/version-file.d.ts
940
+ /**
941
+ * Finds the previous release in the project's version file: the version in
942
+ * it, released at the commit that set it. For projects that kept their
943
+ * version in a file before tagging releases, like `package.json` or a
944
+ * `VERSION` file.
945
+ */
946
+ declare const fsVersionFile: Factory<"history", "fs/version-file", {
947
+ format: z.ZodDefault<z.ZodEnum<{
948
+ cargo: "cargo";
949
+ dart: "dart";
950
+ dotnet: "dotnet";
951
+ gradle: "gradle";
952
+ helm: "helm";
953
+ maven: "maven";
954
+ npm: "npm";
955
+ pattern: "pattern";
956
+ plain: "plain";
957
+ python: "python";
958
+ ruby: "ruby";
959
+ }>>;
960
+ path: z.ZodOptional<z.ZodString>;
961
+ pattern: z.ZodOptional<z.ZodString>;
962
+ }, History>;
963
+ //#endregion
964
+ //#region src/histories/git/git-tags.d.ts
965
+ /**
966
+ * Finds the previous release by its tag: the nearest on HEAD. Of the release
967
+ * tags merged into HEAD, only those that no other one comes after count, so
968
+ * a `1.x` branch finds its own latest release, not `main`'s; of those, the
969
+ * highest version in the scheme wins. When the scheme changed since, the
970
+ * nearest release still marks where changes start, but there's no previous
971
+ * version to bump: the release is the scheme's first.
972
+ *
973
+ * A stable release only counts stable releases. On a channel, its own
974
+ * releases count too, and the nearest stable release is what's bumped.
975
+ */
976
+ declare const gitTags: Factory<"history", "git/tags", Readonly<{
977
+ [k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
978
+ }>, History>;
979
+ //#endregion
980
+ //#region src/histories/github/release-pr.d.ts
981
+ /**
982
+ * Finds a release that a merged release pull request proposed: when HEAD is
983
+ * its merge, the release steps run for the versions it proposed, with its
984
+ * notes. Components it doesn't name, or whose tag exists already, are found
985
+ * by their tags, as with `git/tags`.
986
+ */
987
+ declare const githubReleasePr: Factory<"history", "github/release-pr", {
988
+ label: z.ZodDefault<z.ZodString>;
989
+ repo: z.ZodOptional<z.ZodString>;
990
+ token: z.ZodOptional<z.ZodString>;
991
+ }, History>;
992
+ declare namespace index_d_exports$3 {
993
+ export { fsVersionFile, gitTags, githubReleasePr };
994
+ }
995
+ //#endregion
996
+ //#region src/presets/change-files.d.ts
997
+ /**
998
+ * Change files in `.changes/` → notes by kind → the changelog written and
999
+ * the change files deleted, committed and tagged → GitHub release. Each
1000
+ * file names the components it changes and how much, so a monorepo's
1001
+ * releases don't depend on commit messages. Add files with `rylease add`.
1002
+ * Releases are found by their tags; set the release's `scheme`.
1003
+ */
1004
+ declare const changeFiles: Preset<"change-files", readonly [StepFactory<"read-changes", "change-files/read", {
1005
+ directory: import("zod").ZodDefault<import("zod").ZodString>;
1006
+ }, "all">, StepFactory<"determine-kind", "labels/determine-kind", {
1007
+ kinds: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodEnum<{
1008
+ breaking: "breaking";
1009
+ feature: "feature";
1010
+ fix: "fix";
1011
+ none: "none";
1012
+ }>>>;
1013
+ fallback: import("zod").ZodDefault<import("zod").ZodEnum<{
1014
+ breaking: "breaking";
1015
+ feature: "feature";
1016
+ fix: "fix";
1017
+ none: "none";
1018
+ }>>;
1019
+ }, "each">, StepFactory<"determine-notes", "labels/determine-notes", {
1020
+ sections: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
1021
+ title: import("zod").ZodString;
1022
+ labels: import("zod").ZodArray<import("zod").ZodString>;
1023
+ }, import("zod/v4/core").$strict>>>;
1024
+ other: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1025
+ exclude: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1026
+ descriptions: import("zod").ZodDefault<import("zod").ZodBoolean>;
1027
+ links: import("zod").ZodDefault<import("zod").ZodBoolean>;
1028
+ dependencies: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1029
+ }, "each">, StepFactory<"write", "change-files/clean", {
1030
+ directory: import("zod").ZodDefault<import("zod").ZodString>;
1031
+ channels: import("zod").ZodDefault<import("zod").ZodBoolean>;
1032
+ }, "all">, StepFactory<"write", "fs/write-changes", {
1033
+ path: import("zod").ZodDefault<import("zod").ZodString>;
1034
+ heading: import("zod").ZodDefault<import("zod").ZodString>;
1035
+ mode: import("zod").ZodDefault<import("zod").ZodEnum<{
1036
+ append: "append";
1037
+ prepend: "prepend";
1038
+ replace: "replace";
1039
+ }>>;
1040
+ channels: import("zod").ZodDefault<import("zod").ZodBoolean>;
1041
+ }, "each">, StepFactory<"stage", "git/commit", {
1042
+ files: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1043
+ message: import("zod").ZodDefault<import("zod").ZodString>;
1044
+ push: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1045
+ }, "all">, StepFactory<"release", "git/create-tag", {
1046
+ message: import("zod").ZodDefault<import("zod").ZodString>;
1047
+ move: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1048
+ push: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1049
+ }, "all">, StepFactory<"release", "github/create-release", {
1050
+ title: import("zod").ZodDefault<import("zod").ZodString>;
1051
+ draft: import("zod").ZodDefault<import("zod").ZodBoolean>;
1052
+ prerelease: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodBoolean, import("zod").ZodLiteral<"auto">]>>;
1053
+ repo: import("zod").ZodOptional<import("zod").ZodString>;
1054
+ token: import("zod").ZodOptional<import("zod").ZodString>;
1055
+ }, "each">]>;
1056
+ //#endregion
1057
+ //#region src/presets/conventional.d.ts
1058
+ /**
1059
+ * Conventional commits since the previous release → git tag → GitHub
1060
+ * release, versioned by semver and found by its tags. Nothing specific to a
1061
+ * language or ecosystem; add steps like `fs/write-version`,
1062
+ * `fs/write-changes` and `git/commit` for that. The tag is pushed, with the
1063
+ * branch, to `origin`.
1064
+ */
1065
+ declare const conventional: Preset<"conventional", readonly [StepFactory<"read-changes", "conventional/read-commits", Empty, "each">, StepFactory<"determine-kind", "conventional/determine-kind", {
1066
+ types: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodEnum<{
1067
+ breaking: "breaking";
1068
+ feature: "feature";
1069
+ fix: "fix";
1070
+ none: "none";
1071
+ }>>>;
1072
+ fallback: import("zod").ZodDefault<import("zod").ZodEnum<{
1073
+ breaking: "breaking";
1074
+ feature: "feature";
1075
+ fix: "fix";
1076
+ none: "none";
1077
+ }>>;
1078
+ }, "each">, StepFactory<"determine-notes", "conventional/determine-notes", {
1079
+ sections: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
1080
+ title: import("zod").ZodString;
1081
+ types: import("zod").ZodArray<import("zod").ZodString>;
1082
+ }, import("zod/v4/core").$strict>>>;
1083
+ breaking: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1084
+ other: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1085
+ links: import("zod").ZodDefault<import("zod").ZodBoolean>;
1086
+ dependencies: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1087
+ }, "each">, StepFactory<"release", "git/create-tag", {
1088
+ message: import("zod").ZodDefault<import("zod").ZodString>;
1089
+ move: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1090
+ push: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1091
+ }, "all">, StepFactory<"release", "github/create-release", {
1092
+ title: import("zod").ZodDefault<import("zod").ZodString>;
1093
+ draft: import("zod").ZodDefault<import("zod").ZodBoolean>;
1094
+ prerelease: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodBoolean, import("zod").ZodLiteral<"auto">]>>;
1095
+ repo: import("zod").ZodOptional<import("zod").ZodString>;
1096
+ token: import("zod").ZodOptional<import("zod").ZodString>;
1097
+ }, "each">]>;
1098
+ //#endregion
1099
+ //#region src/presets/conventional-pr.d.ts
1100
+ /**
1101
+ * Conventional commits → the changelog written and proposed in a release
1102
+ * pull request, kept up to date with each push; merging it tags the release
1103
+ * and creates its GitHub release. Versioned by semver; its history,
1104
+ * `github/release-pr`, is how the run on the merge finds what the pull
1105
+ * request proposed.
1106
+ */
1107
+ declare const conventionalPr: Preset<"conventional-pr", readonly [StepFactory<"read-changes", "conventional/read-commits", Empty, "each">, StepFactory<"determine-kind", "conventional/determine-kind", {
1108
+ types: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodEnum<{
1109
+ breaking: "breaking";
1110
+ feature: "feature";
1111
+ fix: "fix";
1112
+ none: "none";
1113
+ }>>>;
1114
+ fallback: import("zod").ZodDefault<import("zod").ZodEnum<{
1115
+ breaking: "breaking";
1116
+ feature: "feature";
1117
+ fix: "fix";
1118
+ none: "none";
1119
+ }>>;
1120
+ }, "each">, StepFactory<"determine-notes", "conventional/determine-notes", {
1121
+ sections: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
1122
+ title: import("zod").ZodString;
1123
+ types: import("zod").ZodArray<import("zod").ZodString>;
1124
+ }, import("zod/v4/core").$strict>>>;
1125
+ breaking: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1126
+ other: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1127
+ links: import("zod").ZodDefault<import("zod").ZodBoolean>;
1128
+ dependencies: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1129
+ }, "each">, StepFactory<"write", "fs/write-changes", {
1130
+ path: import("zod").ZodDefault<import("zod").ZodString>;
1131
+ heading: import("zod").ZodDefault<import("zod").ZodString>;
1132
+ mode: import("zod").ZodDefault<import("zod").ZodEnum<{
1133
+ append: "append";
1134
+ prepend: "prepend";
1135
+ replace: "replace";
1136
+ }>>;
1137
+ channels: import("zod").ZodDefault<import("zod").ZodBoolean>;
1138
+ }, "each">, StepFactory<"stage", "github/open-release-pr", {
1139
+ branch: import("zod").ZodDefault<import("zod").ZodString>;
1140
+ title: import("zod").ZodDefault<import("zod").ZodString>;
1141
+ labels: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1142
+ remote: import("zod").ZodDefault<import("zod").ZodString>;
1143
+ repo: import("zod").ZodOptional<import("zod").ZodString>;
1144
+ token: import("zod").ZodOptional<import("zod").ZodString>;
1145
+ }, "all">, StepFactory<"release", "git/create-tag", {
1146
+ message: import("zod").ZodDefault<import("zod").ZodString>;
1147
+ move: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1148
+ push: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1149
+ }, "all">, StepFactory<"release", "github/create-release", {
1150
+ title: import("zod").ZodDefault<import("zod").ZodString>;
1151
+ draft: import("zod").ZodDefault<import("zod").ZodBoolean>;
1152
+ prerelease: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodBoolean, import("zod").ZodLiteral<"auto">]>>;
1153
+ repo: import("zod").ZodOptional<import("zod").ZodString>;
1154
+ token: import("zod").ZodOptional<import("zod").ZodString>;
1155
+ }, "each">]>;
1156
+ //#endregion
1157
+ //#region src/presets/keep-a-changelog.d.ts
1158
+ /**
1159
+ * `## [Unreleased]` in CHANGELOG.md → the changelog released, committed and
1160
+ * tagged → GitHub release. Each entry's kind comes from its section:
1161
+ * `Removed` is breaking, `Added`, `Changed` and `Deprecated` features, and
1162
+ * the rest fixes. Releases are found by their tags; set the release's
1163
+ * `scheme`, e.g. `semver()`, or `calver()` to date them.
1164
+ */
1165
+ declare const keepAChangelog: Preset<"keep-a-changelog", readonly [StepFactory<"read-changes", "keep-a-changelog/read-unreleased", {
1166
+ path: import("zod").ZodDefault<import("zod").ZodString>;
1167
+ }, "each">, StepFactory<"determine-kind", "labels/determine-kind", {
1168
+ kinds: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodEnum<{
1169
+ breaking: "breaking";
1170
+ feature: "feature";
1171
+ fix: "fix";
1172
+ none: "none";
1173
+ }>>>;
1174
+ fallback: import("zod").ZodDefault<import("zod").ZodEnum<{
1175
+ breaking: "breaking";
1176
+ feature: "feature";
1177
+ fix: "fix";
1178
+ none: "none";
1179
+ }>>;
1180
+ }, "each">, StepFactory<"determine-notes", "labels/determine-notes", {
1181
+ sections: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
1182
+ title: import("zod").ZodString;
1183
+ labels: import("zod").ZodArray<import("zod").ZodString>;
1184
+ }, import("zod/v4/core").$strict>>>;
1185
+ other: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1186
+ exclude: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1187
+ descriptions: import("zod").ZodDefault<import("zod").ZodBoolean>;
1188
+ links: import("zod").ZodDefault<import("zod").ZodBoolean>;
1189
+ dependencies: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1190
+ }, "each">, StepFactory<"write", "keep-a-changelog/write-release", {
1191
+ path: import("zod").ZodDefault<import("zod").ZodString>;
1192
+ heading: import("zod").ZodDefault<import("zod").ZodString>;
1193
+ channels: import("zod").ZodDefault<import("zod").ZodBoolean>;
1194
+ }, "each">, StepFactory<"stage", "git/commit", {
1195
+ files: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1196
+ message: import("zod").ZodDefault<import("zod").ZodString>;
1197
+ push: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1198
+ }, "all">, StepFactory<"release", "git/create-tag", {
1199
+ message: import("zod").ZodDefault<import("zod").ZodString>;
1200
+ move: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
1201
+ push: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<false>]>>;
1202
+ }, "all">, StepFactory<"release", "github/create-release", {
1203
+ title: import("zod").ZodDefault<import("zod").ZodString>;
1204
+ draft: import("zod").ZodDefault<import("zod").ZodBoolean>;
1205
+ prerelease: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodBoolean, import("zod").ZodLiteral<"auto">]>>;
1206
+ repo: import("zod").ZodOptional<import("zod").ZodString>;
1207
+ token: import("zod").ZodOptional<import("zod").ZodString>;
1208
+ }, "each">]>;
1209
+ declare namespace index_d_exports$2 {
1210
+ export { changeFiles, conventional, conventionalPr, keepAChangelog };
1211
+ }
1212
+ //#endregion
1213
+ //#region src/schemes/calver.d.ts
1214
+ /**
1215
+ * Calendar versioning, as on calver.org: the format's date tokens come from
1216
+ * the release date, and its counters (`MAJOR`, `MINOR`, `MICRO`) number the
1217
+ * releases within the same period. A counter is bumped by the kind it stands
1218
+ * for (`breaking`, `feature`, `fix`), or by a higher kind when the format has
1219
+ * no counter for that; the counters after it start again from 0, as do all of
1220
+ * them in a new period.
1221
+ */
1222
+ declare const calver: Factory<"scheme", "calver", {
1223
+ format: z.ZodDefault<z.ZodString>;
1224
+ timezone: z.ZodDefault<z.ZodString>;
1225
+ }, Scheme>;
1226
+ //#endregion
1227
+ //#region src/schemes/semver.d.ts
1228
+ /** A strict semantic version. */
1229
+ interface Semver {
1230
+ major: number;
1231
+ minor: number;
1232
+ patch: number;
1233
+ prerelease?: string;
1234
+ build?: string;
1235
+ }
1236
+ /** Whether a version is valid semver: `MAJOR.MINOR.PATCH`, without leading zeros. */
1237
+ declare function isSemver(version: string): boolean;
1238
+ declare function parseSemver(version: string): Semver;
1239
+ declare function formatSemver(version: Semver): string;
1240
+ /** Bumps a version: `breaking` → major, `feature` → minor, `fix` → patch. */
1241
+ declare function bumpSemver(version: Semver, kind: ReleaseKind): Semver;
1242
+ /**
1243
+ * `MAJOR.minor.patch`: breaking changes bump the major number, features the
1244
+ * minor and fixes the patch. Before 1.0.0, bumps shift down a level by
1245
+ * default (`0.MAJOR.minorOrPatch`).
1246
+ */
1247
+ declare const semver: Factory<"scheme", "semver", {
1248
+ shiftPreMajor: z.ZodDefault<z.ZodBoolean>;
1249
+ initial: z.ZodDefault<z.ZodString>;
1250
+ }, Scheme>;
1251
+ declare namespace index_d_exports$1 {
1252
+ export { Semver, bumpSemver, calver, formatSemver, isSemver, parseSemver, semver };
1253
+ }
1254
+ //#endregion
1255
+ //#region src/steps/cargo/publish.d.ts
1256
+ /**
1257
+ * Publishes the crate to crates.io, or another registry, after earlier steps
1258
+ * wrote the new version to `Cargo.toml`. Cargo verifies the crate builds
1259
+ * first, and waits for it to be available, so dependents publish after it.
1260
+ */
1261
+ declare const cargoPublish: StepFactory<"release", "cargo/publish", {
1262
+ path: z.ZodDefault<z.ZodString>;
1263
+ registry: z.ZodOptional<z.ZodString>;
1264
+ token: z.ZodOptional<z.ZodString>;
1265
+ }, "each">;
1266
+ //#endregion
1267
+ //#region src/steps/change-files/clean.d.ts
1268
+ /**
1269
+ * Deletes the change files a release consumed, those naming a component
1270
+ * that's released, and reports them for `git/commit` to commit their
1271
+ * deletion. Releases on a channel leave them for the stable release.
1272
+ */
1273
+ declare const changeFilesClean: StepFactory<"write", "change-files/clean", {
1274
+ directory: import("zod").ZodDefault<import("zod").ZodString>;
1275
+ channels: import("zod").ZodDefault<import("zod").ZodBoolean>;
1276
+ }, "all">;
1277
+ //#endregion
1278
+ //#region src/steps/change-files/read.d.ts
1279
+ /**
1280
+ * Collects the change files in `.changes/`: each says what changed, and
1281
+ * how much for each component it names. A change's label is its kind, for
1282
+ * `labels/determine-kind` and `labels/determine-notes`.
1283
+ */
1284
+ declare const changeFilesRead: StepFactory<"read-changes", "change-files/read", {
1285
+ directory: import("zod").ZodDefault<import("zod").ZodString>;
1286
+ }, "all">;
1287
+ //#endregion
1288
+ //#region src/steps/components/dependents.d.ts
1289
+ /**
1290
+ * Releases the components that depend on a released component, so their
1291
+ * releases pick up the new version, e.g. with `fs/write-version` updating
1292
+ * their dependency on it. Dependents of dependents follow.
1293
+ */
1294
+ declare const componentsDependents: StepFactory<"determine-kind", "components/dependents", {
1295
+ kind: z.ZodDefault<z.ZodEnum<{
1296
+ breaking: "breaking";
1297
+ feature: "feature";
1298
+ fix: "fix";
1299
+ }>>;
1300
+ on: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1301
+ breaking: "breaking";
1302
+ feature: "feature";
1303
+ fix: "fix";
1304
+ }>>>;
1305
+ }, "all">;
1306
+ //#endregion
1307
+ //#region src/steps/conventional/determine-kind.d.ts
1308
+ /**
1309
+ * `!` or `BREAKING` → breaking; otherwise each change's kind comes from its
1310
+ * conventional type, and the highest kind wins.
1311
+ */
1312
+ declare const conventionalDetermineKind: StepFactory<"determine-kind", "conventional/determine-kind", {
1313
+ types: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
1314
+ breaking: "breaking";
1315
+ feature: "feature";
1316
+ fix: "fix";
1317
+ none: "none";
1318
+ }>>>;
1319
+ fallback: z.ZodDefault<z.ZodEnum<{
1320
+ breaking: "breaking";
1321
+ feature: "feature";
1322
+ fix: "fix";
1323
+ none: "none";
1324
+ }>>;
1325
+ }, "each">;
1326
+ //#endregion
1327
+ //#region src/steps/conventional/determine-notes.d.ts
1328
+ /**
1329
+ * A `### Title` section for breaking changes, then one per group of
1330
+ * conventional types, then the rest.
1331
+ */
1332
+ declare const conventionalBuildNotes: StepFactory<"determine-notes", "conventional/determine-notes", {
1333
+ sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
1334
+ title: z.ZodString;
1335
+ types: z.ZodArray<z.ZodString>;
1336
+ }, z.core.$strict>>>;
1337
+ breaking: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
1338
+ other: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
1339
+ links: z.ZodDefault<z.ZodBoolean>;
1340
+ dependencies: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
1341
+ }, "each">;
1342
+ //#endregion
1343
+ //#region src/steps/conventional/read-commits.d.ts
1344
+ /**
1345
+ * Collects every conventional section (`feat: ...`, `fix(x)!: ...`) in the
1346
+ * commits since the previous release, or in all history without one. Only
1347
+ * commits touching the component count; for the whole project, when the
1348
+ * working directory is a subdirectory of the repository, only those touching
1349
+ * it. Each change links to its commit when the repository is known: on
1350
+ * GitHub, or in GitLab CI, on GitLab.
1351
+ */
1352
+ declare const conventionalReadCommits: StepFactory<"read-changes", "conventional/read-commits", Empty, "each">;
1353
+ //#endregion
1354
+ //#region src/steps/dart/publish.d.ts
1355
+ /**
1356
+ * Publishes the package to pub.dev, or the server in its `publish_to`, after
1357
+ * earlier steps wrote the new version to `pubspec.yaml`.
1358
+ */
1359
+ declare const dartPublish: StepFactory<"release", "dart/publish", {
1360
+ path: z.ZodDefault<z.ZodString>;
1361
+ client: z.ZodOptional<z.ZodEnum<{
1362
+ dart: "dart";
1363
+ flutter: "flutter";
1364
+ }>>;
1365
+ token: z.ZodOptional<z.ZodString>;
1366
+ }, "each">;
1367
+ //#endregion
1368
+ //#region src/steps/dotnet/publish.d.ts
1369
+ /**
1370
+ * Pushes the component's packed NuGet packages to nuget.org, or another
1371
+ * source: pack them first, e.g. with `dotnet pack -c Release`. Only the
1372
+ * packages of the version being released are pushed, their symbols with them.
1373
+ */
1374
+ declare const dotnetPublish: StepFactory<"release", "dotnet/publish", {
1375
+ files: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1376
+ allowNoMatch: z.ZodDefault<z.ZodBoolean>;
1377
+ source: z.ZodDefault<z.ZodString>;
1378
+ token: z.ZodOptional<z.ZodString>;
1379
+ }, "each">;
1380
+ //#endregion
1381
+ //#region src/steps/exec/command.d.ts
1382
+ /**
1383
+ * Runs a command for each component in the phase it's given: in `write`,
1384
+ * e.g. `cargo update --workspace` to update a lockfile; in `release`, e.g.
1385
+ * `cargo publish` or `docker push app:{version}`.
1386
+ */
1387
+ declare const execCommand: StepFactory<"release" | "stage" | "write", "exec/command", {
1388
+ phase: z.ZodEnum<{
1389
+ release: "release";
1390
+ stage: "stage";
1391
+ write: "write";
1392
+ }>;
1393
+ command: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
1394
+ dryRun: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1395
+ cwd: z.ZodDefault<z.ZodString>;
1396
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1397
+ files: z.ZodDefault<z.ZodArray<z.ZodString>>;
1398
+ }, "each">;
1399
+ //#endregion
1400
+ //#region src/steps/fs/write-changes.d.ts
1401
+ /** Writes release notes to a file, creating it if needed. */
1402
+ declare const fsWriteChanges: StepFactory<"write", "fs/write-changes", {
1403
+ path: z.ZodDefault<z.ZodString>;
1404
+ heading: z.ZodDefault<z.ZodString>;
1405
+ mode: z.ZodDefault<z.ZodEnum<{
1406
+ append: "append";
1407
+ prepend: "prepend";
1408
+ replace: "replace";
1409
+ }>>;
1410
+ channels: z.ZodDefault<z.ZodBoolean>;
1411
+ }, "each">;
1412
+ //#endregion
1413
+ //#region src/steps/fs/write-version.d.ts
1414
+ /**
1415
+ * Writes each component's new version to its version file, in the project's
1416
+ * own format, keeping everything else as it was. With the `npm`, `cargo` and
1417
+ * `dart` formats, dependencies on the other components released with it are
1418
+ * pointed at their new versions too, keeping each range's operator.
1419
+ */
1420
+ declare const fsWriteVersion: StepFactory<"write", "fs/write-version", {
1421
+ format: z.ZodDefault<z.ZodEnum<{
1422
+ cargo: "cargo";
1423
+ dart: "dart";
1424
+ dotnet: "dotnet";
1425
+ gradle: "gradle";
1426
+ helm: "helm";
1427
+ maven: "maven";
1428
+ npm: "npm";
1429
+ pattern: "pattern";
1430
+ plain: "plain";
1431
+ python: "python";
1432
+ ruby: "ruby";
1433
+ }>>;
1434
+ path: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1435
+ allowNoMatch: z.ZodDefault<z.ZodBoolean>;
1436
+ pattern: z.ZodOptional<z.ZodString>;
1437
+ }, "all">;
1438
+ //#endregion
1439
+ //#region src/steps/git/commit.d.ts
1440
+ /**
1441
+ * Commits the files that earlier `release` steps changed, for every
1442
+ * component, in one commit. Without this the version bump never lands.
1443
+ * Pushing is off by default, so `git/create-tag` can push the commit and its
1444
+ * tags together.
1445
+ */
1446
+ declare const gitCommit: StepFactory<"stage", "git/commit", {
1447
+ files: z.ZodDefault<z.ZodArray<z.ZodString>>;
1448
+ message: z.ZodDefault<z.ZodString>;
1449
+ push: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
1450
+ }, "all">;
1451
+ //#endregion
1452
+ //#region src/steps/git/create-tag.d.ts
1453
+ /**
1454
+ * Tags HEAD with every component's release, moves any floating tags to it,
1455
+ * and pushes them along with the current branch in one atomic push, so a
1456
+ * commit from `git/commit` and its tags land together or not at all.
1457
+ */
1458
+ declare const gitCreateTag: StepFactory<"release", "git/create-tag", {
1459
+ message: z.ZodDefault<z.ZodString>;
1460
+ move: z.ZodDefault<z.ZodArray<z.ZodString>>;
1461
+ push: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
1462
+ }, "all">;
1463
+ //#endregion
1464
+ //#region src/steps/github/create-release.d.ts
1465
+ /**
1466
+ * Creates a GitHub release for the version, with the notes as its body, or
1467
+ * finds the one another job already created.
1468
+ */
1469
+ declare const githubCreateRelease: StepFactory<"release", "github/create-release", {
1470
+ title: import("zod").ZodDefault<import("zod").ZodString>;
1471
+ draft: import("zod").ZodDefault<import("zod").ZodBoolean>;
1472
+ prerelease: import("zod").ZodDefault<import("zod").ZodUnion<readonly [import("zod").ZodBoolean, import("zod").ZodLiteral<"auto">]>>;
1473
+ repo: import("zod").ZodOptional<import("zod").ZodString>;
1474
+ token: import("zod").ZodOptional<import("zod").ZodString>;
1475
+ }, "each">;
1476
+ //#endregion
1477
+ //#region src/steps/github/open-release-pr.d.ts
1478
+ /**
1479
+ * Proposes the release as a pull request instead of releasing it: commits
1480
+ * what earlier `write` steps changed to a release branch, and opens a pull
1481
+ * request for it, or updates the one that's open. The release steps wait
1482
+ * until it merges; then the `github/release-pr` history finds it, and they
1483
+ * run for what it proposed.
1484
+ */
1485
+ declare const githubOpenReleasePr: StepFactory<"stage", "github/open-release-pr", {
1486
+ branch: z.ZodDefault<z.ZodString>;
1487
+ title: z.ZodDefault<z.ZodString>;
1488
+ labels: z.ZodDefault<z.ZodArray<z.ZodString>>;
1489
+ remote: z.ZodDefault<z.ZodString>;
1490
+ repo: z.ZodOptional<z.ZodString>;
1491
+ token: z.ZodOptional<z.ZodString>;
1492
+ }, "all">;
1493
+ //#endregion
1494
+ //#region src/steps/github/read-pull-requests.d.ts
1495
+ /**
1496
+ * Collects the pull requests merged into the branch through the commits
1497
+ * touching the component since the previous release, or in all history
1498
+ * without one, each with its labels. Commits that weren't merged through a
1499
+ * pull request aren't counted.
1500
+ */
1501
+ declare const githubReadPullRequests: StepFactory<"read-changes", "github/read-pull-requests", {
1502
+ repo: z.ZodOptional<z.ZodString>;
1503
+ token: z.ZodOptional<z.ZodString>;
1504
+ }, "each">;
1505
+ //#endregion
1506
+ //#region src/steps/github/upload-artifact.d.ts
1507
+ /**
1508
+ * Keeps files as an artifact of the workflow run; with `dryRunArtifact`, in
1509
+ * dry runs too, e.g. to keep what a dry run built.
1510
+ */
1511
+ declare const githubUploadArtifact: StepFactory<"release", "github/upload-artifact", {
1512
+ name: z.ZodString;
1513
+ files: z.ZodArray<z.ZodString>;
1514
+ allowNoMatch: z.ZodDefault<z.ZodBoolean>;
1515
+ dryRunArtifact: z.ZodDefault<z.ZodBoolean>;
1516
+ retentionDays: z.ZodOptional<z.ZodNumber>;
1517
+ }, "each">;
1518
+ //#endregion
1519
+ //#region src/steps/github/upload-release-assets.d.ts
1520
+ /**
1521
+ * Uploads files to the version's GitHub release, creating the release if no
1522
+ * other step or job has yet, so that jobs building different files can each
1523
+ * upload their own.
1524
+ */
1525
+ declare const githubUploadReleaseAssets: StepFactory<"release", "github/upload-release-assets", {
1526
+ title: z.ZodDefault<z.ZodString>;
1527
+ draft: z.ZodDefault<z.ZodBoolean>;
1528
+ prerelease: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"auto">]>>;
1529
+ repo: z.ZodOptional<z.ZodString>;
1530
+ token: z.ZodOptional<z.ZodString>;
1531
+ files: z.ZodArray<z.ZodString>;
1532
+ allowNoMatch: z.ZodDefault<z.ZodBoolean>;
1533
+ clobber: z.ZodDefault<z.ZodBoolean>;
1534
+ dryRunArtifact: z.ZodDefault<z.ZodBoolean>;
1535
+ artifactName: z.ZodOptional<z.ZodString>;
1536
+ }, "each">;
1537
+ //#endregion
1538
+ //#region src/steps/gitlab/create-release.d.ts
1539
+ /**
1540
+ * Creates a GitLab release for the version, with the notes as its
1541
+ * description, or finds the one another job already created. In GitLab CI,
1542
+ * the project, API and job token come from the job's environment.
1543
+ */
1544
+ declare const gitlabCreateRelease: StepFactory<"release", "gitlab/create-release", {
1545
+ title: z.ZodDefault<z.ZodString>;
1546
+ project: z.ZodOptional<z.ZodString>;
1547
+ token: z.ZodOptional<z.ZodString>;
1548
+ }, "each">;
1549
+ //#endregion
1550
+ //#region src/steps/keep-a-changelog/read-unreleased.d.ts
1551
+ /**
1552
+ * Collects the entries of the `## [Unreleased]` section of a changelog kept as
1553
+ * on keepachangelog.com: each top-level bullet is a change, labeled with its
1554
+ * `### Added`, `### Fixed` … heading, and the lines under it its description.
1555
+ */
1556
+ declare const keepAChangelogReadUnreleased: StepFactory<"read-changes", "keep-a-changelog/read-unreleased", {
1557
+ path: z.ZodDefault<z.ZodString>;
1558
+ }, "each">;
1559
+ //#endregion
1560
+ //#region src/steps/keep-a-changelog/write-release.d.ts
1561
+ /**
1562
+ * Releases the `## [Unreleased]` section of a Keep a Changelog file: its
1563
+ * entries move under a heading for the version, and an empty
1564
+ * `## [Unreleased]` takes its place. A `[unreleased]: …/compare/v1.0.0...HEAD`
1565
+ * link moves on to the new tag, and the version gets its own compare link.
1566
+ */
1567
+ declare const keepAChangelogWriteRelease: StepFactory<"write", "keep-a-changelog/write-release", {
1568
+ path: z.ZodDefault<z.ZodString>;
1569
+ heading: z.ZodDefault<z.ZodString>;
1570
+ channels: z.ZodDefault<z.ZodBoolean>;
1571
+ }, "each">;
1572
+ //#endregion
1573
+ //#region src/steps/labels/determine-kind.d.ts
1574
+ /**
1575
+ * Each change's kind comes from its labels, e.g. a pull request's: the
1576
+ * highest of them, or `fallback` when none is mapped. The highest kind wins.
1577
+ */
1578
+ declare const labelsDetermineKind: StepFactory<"determine-kind", "labels/determine-kind", {
1579
+ kinds: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
1580
+ breaking: "breaking";
1581
+ feature: "feature";
1582
+ fix: "fix";
1583
+ none: "none";
1584
+ }>>>;
1585
+ fallback: z.ZodDefault<z.ZodEnum<{
1586
+ breaking: "breaking";
1587
+ feature: "feature";
1588
+ fix: "fix";
1589
+ none: "none";
1590
+ }>>;
1591
+ }, "each">;
1592
+ //#endregion
1593
+ //#region src/steps/labels/determine-notes.d.ts
1594
+ /**
1595
+ * A `### Title` section per group of labels, like GitHub's own release notes
1596
+ * categories, then the rest.
1597
+ */
1598
+ declare const labelsBuildNotes: StepFactory<"determine-notes", "labels/determine-notes", {
1599
+ sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
1600
+ title: z.ZodString;
1601
+ labels: z.ZodArray<z.ZodString>;
1602
+ }, z.core.$strict>>>;
1603
+ other: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
1604
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
1605
+ descriptions: z.ZodDefault<z.ZodBoolean>;
1606
+ links: z.ZodDefault<z.ZodBoolean>;
1607
+ dependencies: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
1608
+ }, "each">;
1609
+ //#endregion
1610
+ //#region src/steps/npm/publish.d.ts
1611
+ /**
1612
+ * Publishes the package to npm, after earlier steps wrote the new version to
1613
+ * `package.json`. Lifecycle scripts like `prepublishOnly` run as usual.
1614
+ */
1615
+ declare const npmPublish: StepFactory<"release", "npm/publish", {
1616
+ path: z.ZodDefault<z.ZodString>;
1617
+ client: z.ZodOptional<z.ZodEnum<{
1618
+ npm: "npm";
1619
+ pnpm: "pnpm";
1620
+ }>>;
1621
+ tag: z.ZodOptional<z.ZodString>;
1622
+ access: z.ZodOptional<z.ZodEnum<{
1623
+ public: "public";
1624
+ restricted: "restricted";
1625
+ }>>;
1626
+ provenance: z.ZodDefault<z.ZodBoolean>;
1627
+ registry: z.ZodOptional<z.ZodString>;
1628
+ token: z.ZodOptional<z.ZodString>;
1629
+ }, "each">;
1630
+ //#endregion
1631
+ //#region src/steps/python/publish.d.ts
1632
+ /**
1633
+ * Uploads the component's built distributions to PyPI, or another index:
1634
+ * build them first, e.g. with `uv build`. Only the files of the version
1635
+ * being released are uploaded.
1636
+ */
1637
+ declare const pythonPublish: StepFactory<"release", "python/publish", {
1638
+ files: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1639
+ allowNoMatch: z.ZodDefault<z.ZodBoolean>;
1640
+ client: z.ZodDefault<z.ZodEnum<{
1641
+ twine: "twine";
1642
+ uv: "uv";
1643
+ }>>;
1644
+ registry: z.ZodDefault<z.ZodString>;
1645
+ token: z.ZodOptional<z.ZodString>;
1646
+ }, "each">;
1647
+ //#endregion
1648
+ //#region src/steps/ruby/publish.d.ts
1649
+ /**
1650
+ * Packs the component's gem from its gemspec and pushes it to RubyGems, or
1651
+ * another host, after earlier steps wrote the new version to it.
1652
+ */
1653
+ declare const rubyPublish: StepFactory<"release", "ruby/publish", {
1654
+ gemspec: z.ZodOptional<z.ZodString>;
1655
+ host: z.ZodDefault<z.ZodString>;
1656
+ token: z.ZodOptional<z.ZodString>;
1657
+ }, "each">;
1658
+ declare namespace index_d_exports {
1659
+ export { cargoPublish, changeFilesClean, changeFilesRead, componentsDependents, conventionalBuildNotes, conventionalDetermineKind, conventionalReadCommits, dartPublish, dotnetPublish, execCommand, fsWriteChanges, fsWriteVersion, gitCommit, gitCreateTag, githubCreateRelease, githubOpenReleasePr, githubReadPullRequests, githubUploadArtifact, githubUploadReleaseAssets, gitlabCreateRelease, keepAChangelogReadUnreleased, keepAChangelogWriteRelease, labelsBuildNotes, labelsDetermineKind, npmPublish, pythonPublish, rubyPublish };
1660
+ }
1661
+ //#endregion
1662
+ //#region src/utils/git.d.ts
1663
+ /** Runs `git` in `cwd` and resolves with its trimmed stdout. */
1664
+ declare function git(cwd: string, ...args: string[]): Promise<string>;
1665
+ /** Like {@link git}, but resolves with `undefined` instead of rejecting. */
1666
+ declare function tryGit(cwd: string, ...args: string[]): Promise<string | undefined>;
1667
+ /** `GITHUB_REPOSITORY`, or `owner/repo` from the `origin` remote. */
1668
+ declare function detectRepo(cwd: string): Promise<string | undefined>;
1669
+ //#endregion
1670
+ export { Channel as $, OptionsShape as $t, defineStep as A, Step as At, runRelease as B, WriteOutput as Bt, Release as C, PHASES as Ct, StepFactoryDefinition as D, ReleaseOutput as Dt, StepFactory as E, ReleaseKind as Et, ReleaseReport as F, StepOutputs as Ft, formatDuration as G, defineHistory as Gt, PrettyReporterOptions as H, History as Ht, ReleaseSetup as I, StepPreset as It, ComponentSource as J, FactoryKind as Jt, prettyReporter as K, AnyFactory as Kt, ReleaseStatus as L, StepRecord as Lt, ComponentReport as M, StepDefinition as Mt, GivenRelease as N, StepInput as Nt, definePreset as O, ReleaseResult as Ot, ReleaseError as P, StepOutput as Pt, resolveComponents as Q, OptionsInput as Qt, RunOptions as R, StepResults as Rt, PresetOptions as S, NotesOutput as St, ScopedStep as T, Previous as Tt, Reporter as U, HistoryInput as Ut, sortSteps as V, Found as Vt, defaultReporter as W, Pending as Wt, ResolvedComponent as X, Empty as Xt, Defaults as Y, index_d_exports$4 as Yt, defineComponents as Z, OptionsError as Zt, AnyStepFactory as _, Environment as _t, index_d_exports$1 as a, ChangeWith as at, Preset as b, KindOutput as bt, markdownSummary as c, AllStepDefinition as ct, expressionContext as d, Change as dt, OptionsValue as en, ChannelType as et, WorkflowInput as f, ChangesOutput as ft, resolveWorkflowSteps as g, EnginePhase as gt, resolveWorkflow as h, EachStepDefinition as ht, index_d_exports as i, defineScheme as it, when as j, StepCondition as jt, defineRelease as k, Scope as kt, ExpressionContext as l, AllStepInput as lt, WorkflowRelease as m, Dependency as mt, git as n, parseOptions as nn, BumpInput as nt, index_d_exports$2 as o, Fact as ot, WorkflowOptions as p, ComponentInfo as pt, Component as q, Factory as qt, tryGit as r, z as rn, Scheme as rt, index_d_exports$3 as s, Facts as st, detectRepo as t, joinPath as tn, RunChannel as tt, compileExpression as u, AllStepOutput as ut, ConditionInput as v, KINDS as vt, ReleaseConfig as w, Phase as wt, PresetDefaults as x, Next as xt, FactoryOptions as y, Kind as yt, errorMessage as z, StepStatus as zt };
1671
+ //# sourceMappingURL=index-CDKUm2-t.d.mts.map