shiplane 0.1.0 → 0.3.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.
Files changed (40) hide show
  1. package/dist/{budget-C8_aayQk.js → budget-CTjB1v-Z.js} +70 -27
  2. package/dist/budget-CTjB1v-Z.js.map +1 -0
  3. package/dist/cli.js +81 -36
  4. package/dist/cli.js.map +1 -1
  5. package/dist/display-IqkJ6uCw.js +96 -0
  6. package/dist/display-IqkJ6uCw.js.map +1 -0
  7. package/dist/index-oKnmZ8qV.d.ts +245 -0
  8. package/dist/index.d.ts +3 -2
  9. package/dist/index.js +4 -3
  10. package/dist/{issues-C5fKq1Jv.js → issues-TcWtMTv5.js} +1 -1
  11. package/dist/{issues-C5fKq1Jv.js.map → issues-TcWtMTv5.js.map} +1 -1
  12. package/dist/memory.d.ts +2 -0
  13. package/dist/memory.js +2 -0
  14. package/dist/package-registry.fake-CC37ptzf.d.ts +444 -0
  15. package/dist/package-registry.fake-Ciqc4ujx.js +633 -0
  16. package/dist/package-registry.fake-Ciqc4ujx.js.map +1 -0
  17. package/dist/perEnv-B7AiYnW_.js +11 -0
  18. package/dist/perEnv-B7AiYnW_.js.map +1 -0
  19. package/dist/plugin.d.ts +12 -5
  20. package/dist/plugin.js +8 -7
  21. package/dist/{readStatus-D5YVR5ZC.js → readStatus-Bo7hpUT3.js} +1397 -520
  22. package/dist/readStatus-Bo7hpUT3.js.map +1 -0
  23. package/dist/{shell-server-hosting.adapter-Bgl6-IWw.js → shell-server-hosting.adapter-DobfDqFm.js} +2 -2
  24. package/dist/{shell-server-hosting.adapter-Bgl6-IWw.js.map → shell-server-hosting.adapter-DobfDqFm.js.map} +1 -1
  25. package/dist/{src-Dlr2Sgs8.js → src-CGASfBy2.js} +3 -3
  26. package/dist/src-CGASfBy2.js.map +1 -0
  27. package/dist/{index-QneBUiDD.d.ts → static-hosting.port-mknLsxwR.d.ts} +61 -244
  28. package/dist/testing.d.ts +60 -468
  29. package/dist/testing.js +11 -625
  30. package/dist/testing.js.map +1 -1
  31. package/dist/{web-app.module-Bw-npC4Z.js → web-app.module-6KrXIU7j.js} +4 -11
  32. package/dist/web-app.module-6KrXIU7j.js.map +1 -0
  33. package/package.json +6 -1
  34. package/dist/budget-C8_aayQk.js.map +0 -1
  35. package/dist/display-DM0xtQbT.js +0 -55
  36. package/dist/display-DM0xtQbT.js.map +0 -1
  37. package/dist/readStatus-D5YVR5ZC.js.map +0 -1
  38. package/dist/src-Dlr2Sgs8.js.map +0 -1
  39. package/dist/tags-DL74ni09.d.ts +0 -19
  40. package/dist/web-app.module-Bw-npC4Z.js.map +0 -1
package/dist/testing.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { A as ServiceAdapter, C as ReleaseFlow, Ct as UnitRef, Dt as DisplayChoice, E as VersioningPort, Et as splitChangesets, F as Health, G as Output, H as VersionContribution, I as Job, J as StepPlace, K as Progress, L as JobInput, M as DecideContext, Mt as ReleaseUnit, Nt as Environment, Ot as Mood, P as Delivery, S as Open, St as StatusPlan, U as Choice, W as Clock, X as GitPosition, Y as SourceControlPort, at as Deploy, b as Feature, bt as AppBump, ct as OpenPr, dt as LinkedPr, et as RunOptions, g as MobileDistributionPort, gt as DeployPath, h as PackageRegistryPort, it as CodeHostPort, k as DeliveryAdapter, lt as ReleaseStep, m as ServerHostingPort, nt as ShellResult, ot as MergeMethod, p as StaticHostingPort, pt as ActionsMinutes, q as Prompter, rt as CiPipelinePort, st as MergeMethods, tt as Shell, ut as IssueRef, w as ReleaseModule, wt as UnreleasedApp, xt as PlannedChangeset, z as Requirement } from "./index-QneBUiDD.js";
2
- import { n as ReleaseTag } from "./tags-DL74ni09.js";
1
+ import { $ as OpenPr, C as Clock, D as StepPlace, E as Prompter, F as ShellResult, G as DeployPath, I as CiPipelinePort, L as CodeHostPort, N as RunOptions, O as SourceControlPort, P as Shell, S as Choice, T as Progress, X as Approval, a as VersioningPort, at as UnreleasedApp, c as DeliveryAdapter, ct as ReleaseUnit, et as ReleaseStep, ft as Mood, i as MobileDistributionPort, it as UnitRef, l as ServiceAdapter, lt as DisplayChoice, mt as Environment, n as ServerHostingPort, nt as PlannedChangeset, p as Delivery, r as PackageRegistryPort, rt as StatusPlan, st as splitChangesets, t as StaticHostingPort, tt as AppBump, w as Output, x as VersionContribution, z as IssueRef } from "./static-hosting.port-mknLsxwR.js";
2
+ import { C as ReleaseTag, b as ReleaseModule, g as Feature, v as Open, y as ReleaseFlow } from "./index-oKnmZ8qV.js";
3
+ import { a as VersioningFake, c as ciPipelineFake, d as codeHostFake, f as SourceControlFake, i as serverHostingFake, l as CodeHostFake, n as mobileDistributionFake, o as versioningFake, p as sourceControlFake, r as staticHostingFake, s as CiPipelineFake, t as packageRegistryFake, u as HostEvent } from "./package-registry.fake-CC37ptzf.js";
3
4
  import { z } from "zod";
4
5
  import * as _$vitest from "vitest";
5
6
 
@@ -77,438 +78,6 @@ interface VersioningSubject {
77
78
  /** What every versioning does, whatever its provider. */
78
79
  declare const versioningContract: (name: string, subject: () => Promise<VersioningSubject>) => _$vitest.SuiteCollector<object>;
79
80
  //#endregion
80
- //#region src/adapters/server-hosting/__fakes__/server-hosting.fake.d.ts
81
- /** A deploy a module asked for. */
82
- interface Asked$3 {
83
- tag: string;
84
- environment: Environment;
85
- service: string;
86
- }
87
- /** A server host held in memory: it deploys nothing, and records each deploy it was asked for. */
88
- declare class ServerHostingFake implements ServerHostingPort {
89
- readonly capability = "server-hosting";
90
- private needs;
91
- readonly received: Asked$3[];
92
- /** What doctor checks for each app it ships. */
93
- seed({
94
- requirements
95
- }: {
96
- requirements: Requirement[];
97
- }): this;
98
- describe: ({
99
- options
100
- }: JobInput<Record<string, unknown>>) => string;
101
- jobs: ({
102
- tag,
103
- environment,
104
- options
105
- }: JobInput<Record<string, unknown>>) => Job[];
106
- requirements: () => Requirement[];
107
- }
108
- /** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */
109
- declare const serverHostingFake: (fake?: ServerHostingFake) => DeliveryAdapter<ServerHostingPort> & {
110
- fake: ServerHostingFake;
111
- };
112
- //#endregion
113
- //#region src/adapters/static-hosting/__fakes__/static-hosting.fake.d.ts
114
- /** An upload a module asked for. */
115
- interface Asked$2 {
116
- tag: string;
117
- environment: Environment;
118
- site: string;
119
- }
120
- /** A static host held in memory: it uploads nothing, and records each upload it was asked for. */
121
- declare class StaticHostingFake implements StaticHostingPort {
122
- readonly capability = "static-hosting";
123
- private needs;
124
- readonly received: Asked$2[];
125
- /** What doctor checks for each app it ships. */
126
- seed({
127
- requirements
128
- }: {
129
- requirements: Requirement[];
130
- }): this;
131
- describe: ({
132
- options,
133
- environment
134
- }: JobInput<Record<string, unknown>>) => string;
135
- jobs: ({
136
- tag,
137
- environment,
138
- options
139
- }: JobInput<Record<string, unknown>>) => Job[];
140
- requirements: () => Requirement[];
141
- }
142
- /** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */
143
- declare const staticHostingFake: (fake?: StaticHostingFake) => DeliveryAdapter<StaticHostingPort> & {
144
- fake: StaticHostingFake;
145
- };
146
- //#endregion
147
- //#region src/adapters/mobile-distribution/__fakes__/mobile-distribution.fake.d.ts
148
- interface MobileState {
149
- /** The version each environment runs. */
150
- live: Partial<Record<Environment, string>>;
151
- /** How each tag does where it runs. */
152
- health: Record<string, Health>;
153
- requirements: Requirement[];
154
- }
155
- /** What a module asked of it. */
156
- interface Asked$1 {
157
- stage: "jobs" | "decide" | "health" | "inspect";
158
- tag: string;
159
- environment: Environment;
160
- }
161
- /**
162
- * A mobile platform held in memory: seed what each environment runs and how a tag does; a version
163
- * not live yet ships as an update.
164
- */
165
- declare class MobileDistributionFake implements MobileDistributionPort {
166
- readonly capability = "mobile-distribution";
167
- private state;
168
- readonly received: Asked$1[];
169
- seed(state: Partial<MobileState>): this;
170
- private ask;
171
- describe: ({
172
- options,
173
- environment
174
- }: JobInput<Record<string, unknown>>) => string;
175
- jobs: (input: JobInput<Record<string, unknown>>) => Job[];
176
- decide: (_context: DecideContext, input: JobInput<Record<string, unknown>>) => Promise<{
177
- action: "ship";
178
- kind: "build" | "submit" | "publish" | "update" | "deploy";
179
- jobs: Job[];
180
- notLocal?: string;
181
- } | {
182
- action: "none";
183
- status: string;
184
- }>;
185
- health: (_context: DecideContext, input: JobInput<Record<string, unknown>>) => Promise<Health>;
186
- inspect: (_context: DecideContext, input: JobInput<Record<string, unknown>>) => Promise<{
187
- live: string | null;
188
- }>;
189
- requirements: () => Requirement[];
190
- }
191
- /** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */
192
- declare const mobileDistributionFake: (fake?: MobileDistributionFake) => DeliveryAdapter<MobileDistributionPort> & {
193
- fake: MobileDistributionFake;
194
- };
195
- //#endregion
196
- //#region src/adapters/package-registry/__fakes__/package-registry.fake.d.ts
197
- /** What a module asked of it. */
198
- interface Asked {
199
- stage: "jobs" | "decide";
200
- tag: string;
201
- environment: Environment;
202
- }
203
- /** A package registry held in memory: seed what is published, a version not there yet publishes. */
204
- declare class PackageRegistryFake implements PackageRegistryPort {
205
- readonly capability = "package-registry";
206
- /** `<package>@<version>` already published. */
207
- private published;
208
- private needs;
209
- readonly received: Asked[];
210
- seed({
211
- published,
212
- requirements
213
- }: {
214
- published?: string[];
215
- requirements?: Requirement[];
216
- }): this;
217
- describe: ({
218
- unit,
219
- options
220
- }: JobInput<Record<string, unknown>>) => string;
221
- jobs: ({
222
- unit,
223
- tag,
224
- environment,
225
- options
226
- }: JobInput<Record<string, unknown>>) => Job[];
227
- decide: (_context: DecideContext, input: JobInput<Record<string, unknown>>) => Promise<{
228
- action: "ship";
229
- kind: "build" | "submit" | "publish" | "update" | "deploy";
230
- jobs: Job[];
231
- notLocal?: string;
232
- } | {
233
- action: "none";
234
- status: string;
235
- }>;
236
- live: (_context: DecideContext, {
237
- unit
238
- }: JobInput<Record<string, unknown>>) => Promise<boolean>;
239
- requirements: () => Requirement[];
240
- }
241
- /** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */
242
- declare const packageRegistryFake: (fake?: PackageRegistryFake) => DeliveryAdapter<PackageRegistryPort> & {
243
- fake: PackageRegistryFake;
244
- };
245
- //#endregion
246
- //#region src/adapters/source-control/__fakes__/source-control.fake.d.ts
247
- interface SourceState {
248
- position: GitPosition;
249
- clean: boolean;
250
- /** Tag name → the commit it points at. */
251
- tags: Record<string, string>;
252
- /** `<dir>@<version>` → the commit that brought that version. */
253
- versionCommits: Record<string, {
254
- sha: string;
255
- subject: string;
256
- }>;
257
- /** `<sha>:<dir>` → subjects of the commits since, newest first. */
258
- subjects: Record<string, string[]>;
259
- /** `<ref>:<file>` → its text at that ref. */
260
- files: Record<string, string>;
261
- /** `<from>..<to>` → the files that differ. */
262
- diffs: Record<string, string[]>;
263
- /** `<from>..<to>` → the commits after `from` up to `to`, newest first. */
264
- commits: Record<string, {
265
- subject: string;
266
- files: string[];
267
- }[]>;
268
- changed: string[];
269
- }
270
- type SourceEvent = {
271
- type: "branch";
272
- name: string;
273
- } | {
274
- type: "switch";
275
- branch: string;
276
- } | {
277
- type: "commit";
278
- files: string[];
279
- title: string;
280
- body?: string;
281
- } | {
282
- type: "push";
283
- branch: string;
284
- } | {
285
- type: "pull";
286
- } | {
287
- type: "tag";
288
- name: string;
289
- sha: string;
290
- message: string;
291
- } | {
292
- type: "push-tags";
293
- names: string[];
294
- } | {
295
- type: "discard";
296
- files: string[];
297
- } | {
298
- type: "delete-branch";
299
- name: string;
300
- } | {
301
- type: "delete-remote";
302
- branch: string;
303
- } | {
304
- type: "delete-tag";
305
- name: string;
306
- };
307
- /** A repository held in memory: seed what it contains, read back what it received. */
308
- declare class SourceControlFake implements SourceControlPort {
309
- private state;
310
- readonly received: SourceEvent[];
311
- private failures;
312
- seed(state: Partial<SourceState>): this;
313
- /** The `nth` call of this kind throws `error`, after it is recorded. */
314
- failAt(type: SourceEvent["type"], nth: number, error: Error): this;
315
- private record;
316
- position: () => Promise<GitPosition>;
317
- isClean: () => Promise<boolean>;
318
- tagCommit: (tag: string) => Promise<string>;
319
- versionCommit: (dir: string, _manifest: string, version: string) => Promise<{
320
- sha: string;
321
- subject: string;
322
- }>;
323
- subjectsSince: (sha: string, dir: string) => Promise<string[]>;
324
- changedFiles: () => Promise<string[]>;
325
- diffNames: (from: string, to: string) => Promise<string[]>;
326
- commitsBetween: (from: string, to: string) => Promise<{
327
- subject: string;
328
- files: string[];
329
- }[]>;
330
- fileAt: (ref: string, file: string) => Promise<string>;
331
- tags: () => Promise<Set<string>>;
332
- createBranch: (name: string) => Promise<void>;
333
- switchTo: (branch: string) => Promise<void>;
334
- commit: (files: string[], title: string, body?: string) => Promise<void>;
335
- push: (branch: string) => Promise<void>;
336
- pull: () => Promise<void>;
337
- tag: (name: string, sha: string, message: string) => Promise<void>;
338
- pushTags: (names: string[]) => Promise<void>;
339
- discard: (files: string[]) => Promise<void>;
340
- deleteBranch: (name: string) => Promise<void>;
341
- deleteRemoteBranch: (branch: string) => Promise<void>;
342
- deleteTag: (name: string) => Promise<void>;
343
- }
344
- /** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */
345
- declare const sourceControlFake: (fake?: SourceControlFake) => ServiceAdapter<SourceControlPort> & {
346
- fake: SourceControlFake;
347
- };
348
- //#endregion
349
- //#region src/adapters/code-host/__fakes__/code-host.fake.d.ts
350
- interface HostState {
351
- openPrs: {
352
- branch: string;
353
- pr: OpenPr;
354
- }[];
355
- /** States a pull request goes through, one per poll; the last one stays. */
356
- prStates: Record<number, ("OPEN" | "MERGED" | "CLOSED")[]>;
357
- /** The merge methods the repository allows, and the one its pull request page preselects. */
358
- merges: MergeMethods;
359
- releasedTags: string[];
360
- deployments: Deploy[];
361
- nextPrNumber: number;
362
- /** Merged pull requests by number, as a release reads their linked issues. */
363
- pullRequests: Record<number, LinkedPr>;
364
- /** `owner/name#123` → the text of its comments. */
365
- comments: Record<string, string[]>;
366
- }
367
- type HostEvent = {
368
- type: "pr";
369
- pr: OpenPr;
370
- base: string;
371
- head: string;
372
- title: string;
373
- body: string;
374
- label: string;
375
- } | {
376
- type: "merge";
377
- pr: OpenPr;
378
- method: MergeMethod;
379
- } | {
380
- type: "close";
381
- pr: OpenPr;
382
- comment: string;
383
- } | {
384
- type: "release";
385
- tag: string;
386
- notes: string;
387
- latest: boolean;
388
- } | {
389
- type: "record";
390
- ref: string;
391
- environment: Environment;
392
- } | {
393
- type: "comment";
394
- issue: string;
395
- body: string;
396
- };
397
- /** A code host held in memory: seed its pull requests and deploys, read back what it received. */
398
- declare class CodeHostFake implements CodeHostPort {
399
- private state;
400
- readonly received: HostEvent[];
401
- /** Each pull request number, once per state check. */
402
- readonly polled: number[];
403
- /** Each batched read of pull requests or comments, in order. */
404
- readonly reads: ("pull-requests" | "comments")[];
405
- seed(state: Partial<HostState>): this;
406
- openPrsFrom: (branchPrefix: string) => Promise<OpenPr[]>;
407
- createPr: (pr: {
408
- base: string;
409
- head: string;
410
- title: string;
411
- body: string;
412
- label: string;
413
- }) => Promise<{
414
- number: number;
415
- url: string;
416
- }>;
417
- private closeError;
418
- /** Every pull request close throws `error`. */
419
- failClose(error: Error): this;
420
- closePr: (pr: OpenPr, comment: string) => Promise<void>;
421
- prState: (pr: OpenPr) => Promise<"OPEN" | "MERGED" | "CLOSED">;
422
- mergeMethods: () => Promise<MergeMethods>;
423
- merge: (pr: OpenPr, method: MergeMethod) => Promise<void>;
424
- showDiff: () => Promise<void>;
425
- openInBrowser: () => Promise<void>;
426
- releasedTags: () => Promise<Set<string>>;
427
- private releaseError;
428
- /** Every release notes publish throws `error`. */
429
- failRelease(error: Error): this;
430
- createRelease: (tag: string, notes: string, latest: boolean) => Promise<void>;
431
- deployments: () => Promise<Deploy[]>;
432
- recordDeployment: (ref: string, environment: Environment) => Promise<void>;
433
- pullRequests: (numbers: readonly number[]) => Promise<LinkedPr[]>;
434
- comments: (on: readonly IssueRef[]) => Promise<string[][]>;
435
- private commentError;
436
- /** Every comment throws `error`. */
437
- failComment(error: Error): this;
438
- comment: (on: IssueRef, body: string) => Promise<void>;
439
- }
440
- /** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */
441
- declare const codeHostFake: (fake?: CodeHostFake) => ServiceAdapter<CodeHostPort> & {
442
- fake: CodeHostFake;
443
- };
444
- //#endregion
445
- //#region src/adapters/ci-pipeline/__fakes__/ci-pipeline.fake.d.ts
446
- interface PipelineState {
447
- workflowRuns: Record<string, Deploy[]>;
448
- minutes: ActionsMinutes | null;
449
- measured: Record<string, number[]>;
450
- }
451
- interface Dispatched {
452
- type: "dispatch";
453
- workflow: string;
454
- ref: string;
455
- inputs: Record<string, string>;
456
- }
457
- /** A CI pipeline held in memory: seed its runs and minutes, read back what was dispatched. */
458
- declare class CiPipelineFake implements CiPipelinePort {
459
- readonly shipWorkflow: string;
460
- private state;
461
- readonly received: Dispatched[];
462
- constructor(shipWorkflow?: string);
463
- seed(state: Partial<PipelineState>): this;
464
- workflowRuns: (workflow: string) => Promise<Deploy[]>;
465
- dispatch: (workflow: string, ref: string, inputs: Record<string, string>) => Promise<void>;
466
- minutes: () => Promise<ActionsMinutes | null>;
467
- measuredMinutes: (workflow: string) => Promise<number[]>;
468
- }
469
- /** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */
470
- declare const ciPipelineFake: (fake?: CiPipelineFake) => ServiceAdapter<CiPipelinePort> & {
471
- fake: CiPipelineFake;
472
- };
473
- //#endregion
474
- //#region src/adapters/versioning/__fakes__/versioning.fake.d.ts
475
- type PlanOf = (added: PlannedChangeset[], held: PlannedChangeset[]) => StatusPlan;
476
- interface VersioningState {
477
- pending: {
478
- id: string;
479
- text: string;
480
- }[];
481
- /** What `changeset status` would answer, given what the release adds and holds back. */
482
- plan: PlanOf;
483
- dependencies: Record<string, string[]>;
484
- folders: Record<string, string>;
485
- }
486
- /** Versioning held in memory: seed the pending changes and the plan, read back what it received. */
487
- declare class VersioningFake implements VersioningPort {
488
- private state;
489
- readonly applied: {
490
- added: PlannedChangeset[];
491
- held: PlannedChangeset[];
492
- }[];
493
- readonly written: PlannedChangeset[];
494
- seed(state: Partial<VersioningState>): this;
495
- pending: () => Promise<{
496
- id: string;
497
- text: string;
498
- }[]>;
499
- plan: (added: PlannedChangeset[], held: PlannedChangeset[]) => Promise<StatusPlan>;
500
- dependencies: () => Promise<Record<string, string[]>>;
501
- folders: () => Promise<Record<string, string>>;
502
- apply: (added: PlannedChangeset[], held: PlannedChangeset[]) => Promise<void>;
503
- write: (changeset: PlannedChangeset) => Promise<void>;
504
- changesetFile: (id: string) => string;
505
- changelogFile: (dir: string) => string;
506
- }
507
- /** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */
508
- declare const versioningFake: (fake?: VersioningFake) => ServiceAdapter<VersioningPort> & {
509
- fake: VersioningFake;
510
- };
511
- //#endregion
512
81
  //#region src/adapters/shell/__fakes__/shell.fake.d.ts
513
82
  interface ShellCall {
514
83
  command: string;
@@ -572,6 +141,8 @@ interface Files {
572
141
  remove: (file: string) => void;
573
142
  /** Entries directly in a folder; empty when it does not exist. */
574
143
  list: (dir: string) => string[];
144
+ /** The folders directly in a folder, by name; empty when it does not exist. */
145
+ folders: (dir: string) => string[];
575
146
  }
576
147
  //#endregion
577
148
  //#region src/adapters/files/node-files.adapter.d.ts
@@ -642,6 +213,35 @@ interface LoadOptions {
642
213
  */
643
214
  declare const loadRelease: (root: string, options?: LoadOptions) => Promise<Release>;
644
215
  //#endregion
216
+ //#region src/application/context.d.ts
217
+ /** Everything a use case reads and drives: the release as written, its services, the person. */
218
+ interface ReleaseContext {
219
+ release: Release;
220
+ /** Reads the release from disk again: a pull moves the versions a merged release PR brought. */
221
+ load: () => Promise<Release>;
222
+ services: Services;
223
+ /** Creates the port an adapter gives, for this repository. */
224
+ open: Open;
225
+ prompter: Prompter;
226
+ output: Output;
227
+ /** Where the release is: its stage, what it reads or runs, the mascot's mood. */
228
+ progress: Progress;
229
+ clock: Clock;
230
+ /** Runs the jobs plugins return, when they run from this machine. */
231
+ shell: Shell;
232
+ options: {
233
+ /** Answers yes to every confirmation; production never accepts it. */yes: boolean; /** Running inside GitHub Actions: a ship runs on this runner, never dispatching another. */
234
+ ci: boolean;
235
+ };
236
+ }
237
+ /** The ports the release flow runs on. */
238
+ interface Services {
239
+ sourceControl: SourceControlPort;
240
+ codeHost: CodeHostPort;
241
+ ciPipeline: CiPipelinePort;
242
+ versioning: VersioningPort;
243
+ }
244
+ //#endregion
645
245
  //#region src/application/setupContext.d.ts
646
246
  /** What setting a release up needs: the repository, the person, the adapters init can offer. */
647
247
  interface SetupContext {
@@ -654,6 +254,10 @@ interface SetupContext {
654
254
  adapters: AnyDeliveryAdapter[];
655
255
  /** Loads the release as the files now say. */
656
256
  load: () => Promise<Release>;
257
+ /** Spinners while setup waits; plain steps when absent. */
258
+ progress?: Progress;
259
+ /** A release's context, for the rehearsal's plan; without it, the plan is not rehearsed. */
260
+ compose?: (release: Release) => ReleaseContext;
657
261
  }
658
262
  //#endregion
659
263
  //#region src/application/addUnit.d.ts
@@ -699,35 +303,6 @@ declare const initRelease: (context: SetupContext, {
699
303
  */
700
304
  declare const newAdapter: (context: SetupContext, name: string) => Promise<boolean>;
701
305
  //#endregion
702
- //#region src/application/context.d.ts
703
- /** Everything a use case reads and drives: the release as written, its services, the person. */
704
- interface ReleaseContext {
705
- release: Release;
706
- /** Reads the release from disk again: a pull moves the versions a merged release PR brought. */
707
- load: () => Promise<Release>;
708
- services: Services;
709
- /** Creates the port an adapter gives, for this repository. */
710
- open: Open;
711
- prompter: Prompter;
712
- output: Output;
713
- /** Where the release is: its stage, what it reads or runs, the mascot's mood. */
714
- progress: Progress;
715
- clock: Clock;
716
- /** Runs the jobs plugins return, when they run from this machine. */
717
- shell: Shell;
718
- options: {
719
- /** Answers yes to every confirmation; production never accepts it. */yes: boolean; /** Running inside GitHub Actions: a ship runs on this runner, never dispatching another. */
720
- ci: boolean;
721
- };
722
- }
723
- /** The ports the release flow runs on. */
724
- interface Services {
725
- sourceControl: SourceControlPort;
726
- codeHost: CodeHostPort;
727
- ciPipeline: CiPipelinePort;
728
- versioning: VersioningPort;
729
- }
730
- //#endregion
731
306
  //#region src/domain/companions.d.ts
732
307
  /** A unit that goes out with the picked ones without being picked, and why. */
733
308
  interface Companion {
@@ -763,14 +338,16 @@ interface Prepared {
763
338
  contributions: Record<string, VersionContribution>;
764
339
  }
765
340
  /** What a release PR covering `scope` would version, computed without writing anything. */
766
- declare const prepareRelease: (context: ReleaseContext, scope: ReadonlySet<string>) => Promise<Prepared>;
341
+ declare const prepareRelease: (context: ReleaseContext, scope: ReadonlySet<string>, known?: Readonly<Record<string, VersionContribution>>) => Promise<Prepared>;
767
342
  //#endregion
768
343
  //#region src/application/openReleasePr.d.ts
769
344
  /**
770
345
  * Versions what `prepared` covers on one branch from main, opens its PR, and goes back to main.
771
346
  * Null, with what to do, when it must not run.
772
347
  */
773
- declare const openReleasePr: (context: ReleaseContext, prepared: Prepared) => Promise<OpenPr[] | null>;
348
+ declare const openReleasePr: (context: ReleaseContext, prepared: Prepared, /** Release PRs this one takes the place of, named at the top of its description. */
349
+
350
+ replaces?: readonly OpenPr[]) => Promise<OpenPr[] | null>;
774
351
  //#endregion
775
352
  //#region src/application/planShips.d.ts
776
353
  /**
@@ -816,6 +393,19 @@ declare const readStatus: (context: ReleaseContext, environment: Environment) =>
816
393
  */
817
394
  declare const releaseToPreview: (context: ReleaseContext) => Promise<boolean>;
818
395
  //#endregion
396
+ //#region src/application/setup.d.ts
397
+ /**
398
+ * `shiplane setup`: the one command to set releases up and keep them right. It reads the
399
+ * repository, takes what it can prove, asks only the rest, then rehearses a release (builds, plan,
400
+ * sign-ins) with nothing pushed or deployed. Files are kept only when the rehearsal passes. Run
401
+ * again, it says all is set or offers what changed.
402
+ */
403
+ declare const setup: (context: SetupContext, {
404
+ yes
405
+ }: {
406
+ yes: boolean;
407
+ }) => Promise<boolean>;
408
+ //#endregion
819
409
  //#region src/application/setupFiles.d.ts
820
410
  /**
821
411
  * Writes the editor schema when it no longer matches the composed modules. It is generated, never
@@ -899,7 +489,8 @@ declare const testContext: ({
899
489
  interactive,
900
490
  root,
901
491
  tagFormat,
902
- commitsWithoutChangeset
492
+ commitsWithoutChangeset,
493
+ approval
903
494
  }: {
904
495
  units: ReleaseUnit[];
905
496
  modules?: ReleaseModule[]; /** The features, or how to make them from the flow's Fakes they share. */
@@ -908,7 +499,8 @@ declare const testContext: ({
908
499
  interactive?: boolean;
909
500
  root?: string;
910
501
  tagFormat?: string; /** A release skips commits no changeset names; the config default ignores them. */
911
- commitsWithoutChangeset?: "release" | "ignore";
502
+ commitsWithoutChangeset?: "release" | "ignore"; /** Whether someone else approves the release PR; the config default when absent. */
503
+ approval?: Approval;
912
504
  }) => {
913
505
  context: ReleaseContext;
914
506
  flow: {
@@ -988,5 +580,5 @@ interface Workspace {
988
580
  declare const createWorkspace: (files: Record<string, string>) => Workspace;
989
581
  declare const packageJson: (name: string, version?: string, extra?: object) => string;
990
582
  //#endregion
991
- export { type CliRun, type ConsumerRepository, type HostEvent, LIVE, MemoryOutput, RecordingShell, SAMPLE_UNITS, SAMPLE_VERSION_FILES, SOURCE_ALIASES, ScriptedPrompter, type SetupContext, type Workspace, addUnit, builtCli, changesetText, ciPipelineContract, ciPipelineFake, codeHostContract, codeHostFake, consumerRepository, createWorkspace, docsFor, doctor, inSandbox, initRelease, loadRelease, mobileDistributionContract, mobileDistributionFake, newAdapter, nodeFiles, openReleasePr, packageJson, packageRegistryContract, packageRegistryFake, planFrom, planShips, prepareRelease, promote, readStatus, refreshEditorSchema, releaseToPreview, removeUnit, sandbox, serverHostingContract, serverHostingFake, shipTo, sourceControlContract, sourceControlFake, staticHostingContract, staticHostingFake, systemShell, testContext, testUnit, versioningContract, versioningFake };
583
+ export { type CliRun, type ConsumerRepository, type HostEvent, LIVE, MemoryOutput, RecordingShell, SAMPLE_UNITS, SAMPLE_VERSION_FILES, SOURCE_ALIASES, ScriptedPrompter, type SetupContext, type Workspace, addUnit, builtCli, changesetText, ciPipelineContract, ciPipelineFake, codeHostContract, codeHostFake, consumerRepository, createWorkspace, docsFor, doctor, inSandbox, initRelease, loadRelease, mobileDistributionContract, mobileDistributionFake, newAdapter, nodeFiles, openReleasePr, packageJson, packageRegistryContract, packageRegistryFake, planFrom, planShips, prepareRelease, promote, readStatus, refreshEditorSchema, releaseToPreview, removeUnit, sandbox, serverHostingContract, serverHostingFake, setup, shipTo, sourceControlContract, sourceControlFake, staticHostingContract, staticHostingFake, systemShell, testContext, testUnit, versioningContract, versioningFake };
992
584
  //# sourceMappingURL=testing.d.ts.map