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