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