shiplane 0.5.0 → 0.5.2

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.
@@ -406,6 +406,11 @@ interface StepPlace {
406
406
  index: number;
407
407
  total: number;
408
408
  }
409
+ /** A batch running at once: how many of its items are done so far, read on every redraw. */
410
+ interface BatchPlace {
411
+ done: () => number;
412
+ total: number;
413
+ }
409
414
  /**
410
415
  * Where the release is, for a person to follow: the stage of its journey, what it is reading or
411
416
  * running right now, and the mascot's mood. How much of it shows is the adapter's choice.
@@ -413,8 +418,8 @@ interface StepPlace {
413
418
  interface Progress {
414
419
  /** The release reached `stages[index]`. */
415
420
  stage: (stages: readonly string[], index: number) => void;
416
- /** Runs `work` while showing `label`; a step also shows its place in its run. */
417
- during: <T>(label: string, mood: Mood, work: () => Promise<T>, step?: StepPlace) => Promise<T>;
421
+ /** Runs `work` while showing `label`; a step also shows its place in its run, a batch its count. */
422
+ during: <T>(label: string, mood: Mood, work: () => Promise<T>, step?: StepPlace | BatchPlace) => Promise<T>;
418
423
  /** One line, said in a mood: done, failed, nothing to do. */
419
424
  say: (mood: Mood, text: string) => void;
420
425
  }
@@ -692,6 +697,8 @@ interface MobileDistributionPort<Options = Record<string, unknown>> extends Deli
692
697
  bump: AppBump | undefined; /** The person's answer to its `choice`, once asked. */
693
698
  chosen?: string;
694
699
  }): Promise<VersionContribution>;
700
+ /** The channel carries the tagged version, or a build of it is running. */
701
+ live?(context: DecideContext, input: JobInput<Options>): Promise<boolean>;
695
702
  /** What `status --json` shows for the app, read from its platform. */
696
703
  inspect?(context: DecideContext, input: JobInput<Options>): Promise<unknown>;
697
704
  /** How the tagged version does on preview, read before promoting it. Null when nothing says. */
@@ -720,5 +727,5 @@ interface StaticHostingPort<Options = Record<string, unknown>> extends Delivery<
720
727
  readonly capability: "static-hosting";
721
728
  }
722
729
  //#endregion
723
- export { OpenPr as $, releaseSource as A, LinkedPr as B, Clock as C, StepPlace as D, Prompter as E, ShellResult as F, DeployPath as G, ActionsMinutes as H, CiPipelinePort as I, onlyVersionFiles as J, deployRunTitle as K, CodeHostPort as L, CommandFailed as M, RunOptions as N, SourceControlPort as O, Shell as P, MergeMethods as Q, Deploy as R, Choice as S, Progress as T, actionsMinutes as U, issueName as V, billedMinutes as W, Approval as X, DecidedBy as Y, MergeMethod as Z, Refusal as _, Environment as _t, VersioningPort as a, UnitRef as at, VersionChoice as b, DeliveryAdapter as c, PlatformEnvPort as ct, DecideContext as d, isEnvVarName as dt, ReleaseStep as et, Decision as f, DisplayChoice as ft, JobInput as g, progressBar as gt, Job as h, Mood as ht, MobileDistributionPort as i, StatusPlan as it, yesAllowed as j, GitPosition as k, ServiceAdapter as l, ReleaseUnit as lt, Health as m, MascotMoment as mt, ServerHostingPort as n, BumpLevel as nt, Adapter as o, appBumps as ot, Delivery as p, Mascot as pt, deployState as q, PackageRegistryPort as r, PlannedChangeset as rt, AdapterContext as s, splitChangesets as st, StaticHostingPort as t, AppBump as tt, Command as u, EnvVarName as ut, Requirement as v, Output as w, VersionContribution as x, Resolved as y, IssueRef as z };
724
- //# sourceMappingURL=static-hosting.port-pfDvRESk.d.ts.map
730
+ export { MergeMethods as $, GitPosition as A, IssueRef as B, Choice as C, Prompter as D, Progress as E, Shell as F, billedMinutes as G, issueName as H, ShellResult as I, deployState as J, DeployPath as K, CiPipelinePort as L, yesAllowed as M, CommandFailed as N, StepPlace as O, RunOptions as P, MergeMethod as Q, CodeHostPort as R, BatchPlace as S, Output as T, ActionsMinutes as U, LinkedPr as V, actionsMinutes as W, DecidedBy as X, onlyVersionFiles as Y, Approval as Z, Refusal as _, progressBar as _t, VersioningPort as a, StatusPlan as at, VersionChoice as b, DeliveryAdapter as c, splitChangesets as ct, DecideContext as d, EnvVarName as dt, OpenPr as et, Decision as f, isEnvVarName as ft, JobInput as g, Mood as gt, Job as h, MascotMoment as ht, MobileDistributionPort as i, PlannedChangeset as it, releaseSource as j, SourceControlPort as k, ServiceAdapter as l, PlatformEnvPort as lt, Health as m, Mascot as mt, ServerHostingPort as n, AppBump as nt, Adapter as o, UnitRef as ot, Delivery as p, DisplayChoice as pt, deployRunTitle as q, PackageRegistryPort as r, BumpLevel as rt, AdapterContext as s, appBumps as st, StaticHostingPort as t, ReleaseStep as tt, Command as u, ReleaseUnit as ut, Requirement as v, Environment as vt, Clock as w, VersionContribution as x, Resolved as y, Deploy as z };
731
+ //# sourceMappingURL=static-hosting.port-B5i6W7eD.d.ts.map
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,6 @@
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, _t as Environment, a as VersioningPort, at as UnitRef, c as DeliveryAdapter, et as ReleaseStep, ft as DisplayChoice, ht as Mood, i as MobileDistributionPort, it as StatusPlan, l as ServiceAdapter, lt as ReleaseUnit, n as ServerHostingPort, nt as BumpLevel, p as Delivery, r as PackageRegistryPort, rt as PlannedChangeset, st as splitChangesets, t as StaticHostingPort, tt as AppBump, w as Output, x as VersionContribution, z as IssueRef } from "./static-hosting.port-pfDvRESk.js";
2
- import { _ as Feature, b as ReleaseFlow, w as ReleaseTag, x as ReleaseModule, y as Open } from "./index-CpQPaO28.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-CPAwyGn_.js";
1
+ import { B as IssueRef, C as Choice, D as Prompter, E as Progress, F as Shell, I as ShellResult, K as DeployPath, L as CiPipelinePort, O as StepPlace, P as RunOptions, R as CodeHostPort, S as BatchPlace, T as Output, Z as Approval, a as VersioningPort, at as StatusPlan, c as DeliveryAdapter, ct as splitChangesets, et as OpenPr, gt as Mood, i as MobileDistributionPort, it as PlannedChangeset, k as SourceControlPort, l as ServiceAdapter, n as ServerHostingPort, nt as AppBump, ot as UnitRef, p as Delivery, pt as DisplayChoice, r as PackageRegistryPort, rt as BumpLevel, t as StaticHostingPort, tt as ReleaseStep, ut as ReleaseUnit, vt as Environment, w as Clock, x as VersionContribution } from "./static-hosting.port-B5i6W7eD.js";
2
+ import { _ as Feature, b as ReleaseFlow, w as ReleaseTag, x as ReleaseModule, y as Open } from "./index-C_urG4yY.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-BLBdd7IQ.js";
4
4
  import { z } from "zod";
5
5
  import * as _$vitest from "vitest";
6
6
 
@@ -124,7 +124,7 @@ declare class ScriptedPrompter implements Prompter {
124
124
  confirm: (question: string, initial?: boolean) => Promise<boolean>;
125
125
  typed: (question: string, word: string) => Promise<boolean>;
126
126
  select: <Value extends string>(message: string, choices: Choice<Value>[], initial?: Value) => Promise<Awaited<Value> | null>;
127
- multiselect: <Value extends string>(message: string, _choices: Choice<Value>[]) => Promise<Value[] | null>;
127
+ multiselect: <Value extends string>(message: string, choices: Choice<Value>[], initial: Value[]) => Promise<Value[] | null>;
128
128
  text: (message: string) => Promise<string | null>;
129
129
  /** No key is ever pressed: every wait times out, unless keys were queued with `press`. */
130
130
  private keys;
@@ -467,6 +467,8 @@ interface ProgressEvent {
467
467
  text: string;
468
468
  mood?: Mood;
469
469
  step?: StepPlace;
470
+ /** How many items a batch runs at once. */
471
+ batch?: number;
470
472
  }
471
473
  /** Progress kept as events; what it says also goes to the output, as a terminal would print it. */
472
474
  declare class RecordingProgress implements Progress {
@@ -474,7 +476,7 @@ declare class RecordingProgress implements Progress {
474
476
  readonly events: ProgressEvent[];
475
477
  constructor(output: Output);
476
478
  stage: (stages: readonly string[], index: number) => void;
477
- during: <T>(label: string, mood: Mood, work: () => Promise<T>, step?: StepPlace) => Promise<T>;
479
+ during: <T>(label: string, mood: Mood, work: () => Promise<T>, step?: StepPlace | BatchPlace) => Promise<T>;
478
480
  say: (mood: Mood, text: string) => void;
479
481
  }
480
482
  //#endregion
package/dist/testing.js CHANGED
@@ -1,7 +1,7 @@
1
- import { a as releaseFlow } from "./web-app.module-Cg3SYqSo.js";
2
- import { C as refreshEditorSchema, E as ENVIRONMENTS, O as nodeFiles, T as optionsFor, _ as loadRelease, a as releaseToPreview, b as initRelease, c as promote, f as openReleasePr, h as docsFor, i as setup, l as shipTo, m as newAdapter, n as systemShell, p as prepareRelease, t as readStatus, u as planShips, v as addUnit, x as doctor, y as removeUnit } from "./readStatus-QU-K9Czb.js";
1
+ import { a as releaseFlow } from "./web-app.module-BB1fY1Kd.js";
2
+ import { C as refreshEditorSchema, E as ENVIRONMENTS, O as nodeFiles, T as optionsFor, _ as loadRelease, a as releaseToPreview, b as initRelease, c as promote, f as openReleasePr, h as docsFor, i as setup, l as shipTo, m as newAdapter, n as systemShell, p as prepareRelease, t as readStatus, u as planShips, v as addUnit, x as doctor, y as removeUnit } from "./readStatus-DypM0faL.js";
3
3
  import { _ as nextVersion, b as DEFAULT_TAG_FORMAT } from "./budget-BTnKtGF6.js";
4
- import { a as versioningFake, c as sourceControlFake, i as serverHostingFake, n as mobileDistributionFake, o as ciPipelineFake, r as staticHostingFake, s as codeHostFake, t as packageRegistryFake } from "./package-registry.fake-BuiTldHL.js";
4
+ import { a as versioningFake, c as sourceControlFake, i as serverHostingFake, n as mobileDistributionFake, o as ciPipelineFake, r as staticHostingFake, s as codeHostFake, t as packageRegistryFake } from "./package-registry.fake-CN6M1-Gi.js";
5
5
  import { z } from "zod";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
@@ -78,11 +78,12 @@ var RecordingProgress = class {
78
78
  });
79
79
  };
80
80
  during = (label, mood, work, step) => {
81
+ const place = step && "done" in step ? { batch: step.total } : step ? { step } : {};
81
82
  this.events.push({
82
83
  kind: "during",
83
84
  mood,
84
85
  text: label,
85
- ...step ? { step } : {}
86
+ ...place
86
87
  });
87
88
  return work();
88
89
  };
@@ -137,7 +138,11 @@ var ScriptedPrompter = class {
137
138
  this.choices[message] = choices;
138
139
  return Promise.resolve(this.next(message));
139
140
  };
140
- multiselect = (message, _choices) => Promise.resolve(this.next(message));
141
+ multiselect = (message, choices, initial) => {
142
+ this.initials[message] = initial;
143
+ this.choices[message] = choices;
144
+ return Promise.resolve(this.next(message));
145
+ };
141
146
  text = (message) => Promise.resolve(this.next(message));
142
147
  /** No key is ever pressed: every wait times out, unless keys were queued with `press`. */
143
148
  keys = [];
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","names":[],"sources":["../src/adapters/shell/__fakes__/shell.fake.ts","../src/adapters/terminal/__fakes__/progress.fake.ts","../src/adapters/terminal/__fakes__/terminal.fake.ts","../src/testing/releaseContext.ts","../src/testing/deliveryContract.ts","../src/adapters/server-hosting/server-hosting.contract.ts","../src/adapters/static-hosting/static-hosting.contract.ts","../src/adapters/mobile-distribution/mobile-distribution.contract.ts","../src/adapters/package-registry/package-registry.contract.ts","../src/adapters/source-control/source-control.contract.ts","../src/adapters/code-host/code-host.contract.ts","../src/adapters/ci-pipeline/ci-pipeline.contract.ts","../src/adapters/versioning/versioning.contract.ts","../src/testing/sample.ts","../src/testing/live.ts","../src/testing/plans.ts","../src/testing/consumer.ts","../src/testing/workspace.ts"],"sourcesContent":["import type { RunOptions, Shell, ShellResult } from \"../../../ports/shell.port\";\n\nexport interface ShellCall {\n command: string;\n args: string[];\n cwd?: string;\n env?: Record<string, string>;\n}\n\n/** A shell that runs nothing: it keeps every call and answers from what was seeded. */\nexport class RecordingShell implements Shell {\n readonly calls: ShellCall[] = [];\n private answers: { prefix: string; result: Partial<ShellResult>; once?: boolean }[] = [];\n private variables: Record<string, string> = {};\n\n seedEnv(variables: Record<string, string>) {\n this.variables = { ...this.variables, ...variables };\n return this;\n }\n\n env = (name: string) => this.variables[name];\n\n /** Answers every call whose `command args` line starts with `prefix`. */\n seed(prefix: string, result: Partial<ShellResult>) {\n this.answers.push({ prefix, result });\n return this;\n }\n\n /** Answers the next call starting with `prefix` only, ahead of what `seed` answers. */\n seedOnce(prefix: string, result: Partial<ShellResult>) {\n this.answers.unshift({ prefix, result, once: true });\n return this;\n }\n\n private answer(command: string, args: readonly string[], options: RunOptions): ShellResult {\n this.calls.push({ command, args: [...args], cwd: options.cwd, env: options.env });\n const line = [command, ...args].join(\" \");\n const found = this.answers.find(({ prefix }) => line.startsWith(prefix));\n if (found?.once) this.answers.splice(this.answers.indexOf(found), 1);\n return { status: 0, stdout: \"\", stderr: \"\", ...found?.result };\n }\n\n capture = (command: string, args: readonly string[], options: RunOptions = {}) =>\n Promise.resolve(this.answer(command, args, options));\n\n attach = (command: string, args: readonly string[], options: RunOptions = {}) =>\n Promise.resolve(this.answer(command, args, options).status);\n}\n","import type { Mood } from \"../../../domain/display\";\nimport type { Output, Progress, StepPlace } from \"../../../ports/terminal.port\";\n\nexport interface ProgressEvent {\n kind: \"stage\" | \"during\" | \"say\";\n text: string;\n mood?: Mood;\n step?: StepPlace;\n}\n\n/** Progress kept as events; what it says also goes to the output, as a terminal would print it. */\nexport class RecordingProgress implements Progress {\n readonly events: ProgressEvent[] = [];\n\n constructor(private readonly output: Output) {}\n\n stage = (stages: readonly string[], index: number) => {\n this.events.push({\n kind: \"stage\",\n text: stages[index] ?? \"\",\n step: { index, total: stages.length },\n });\n };\n\n during = <T>(label: string, mood: Mood, work: () => Promise<T>, step?: StepPlace) => {\n this.events.push({ kind: \"during\", mood, text: label, ...(step ? { step } : {}) });\n return work();\n };\n\n say = (mood: Mood, text: string) => {\n this.events.push({ kind: \"say\", mood, text });\n this.output.line(text);\n };\n}\n","import type { Choice, Clock, Output, Prompter } from \"../../../ports/terminal.port\";\n\n/** Everything the CLI printed, in order, without colours. */\nexport class MemoryOutput implements Output {\n readonly lines: string[] = [];\n\n line = (text = \"\") => {\n // eslint-disable-next-line no-control-regex\n this.lines.push(text.replace(/\\u001B\\[[0-9;]*m/g, \"\"));\n };\n\n get text() {\n return this.lines.join(\"\\n\");\n }\n}\n\ntype Answer = boolean | string | string[] | null;\n\n/** A person who answers from a script, in order; every question asked is kept. */\nexport class ScriptedPrompter implements Prompter {\n readonly asked: string[] = [];\n /** The answer each choice question offered first, by question. */\n readonly initials: Record<string, unknown> = {};\n /** The choices each select question offered, by question. */\n readonly choices: Record<string, Choice<string>[]> = {};\n private answers: Answer[] = [];\n\n constructor(readonly interactive = true) {}\n\n answer(...answers: Answer[]) {\n this.answers.push(...answers);\n return this;\n }\n\n private next(question: string): Answer {\n this.asked.push(question);\n if (this.answers.length === 0) throw new Error(`Unexpected question: ${question}`);\n return this.answers.shift() ?? null;\n }\n\n confirm = (question: string, initial = false) => {\n this.initials[question] = initial;\n return Promise.resolve(this.next(question) === true);\n };\n\n typed = (question: string, word: string) => Promise.resolve(this.next(question) === word);\n\n select = <Value extends string>(message: string, choices: Choice<Value>[], initial?: Value) => {\n this.initials[message] = initial;\n this.choices[message] = choices;\n return Promise.resolve(this.next(message) as Value | null);\n };\n\n multiselect = <Value extends string>(message: string, _choices: Choice<Value>[]) =>\n Promise.resolve(this.next(message) as Value[] | null);\n\n text = (message: string) => Promise.resolve(this.next(message) as string | null);\n\n /** No key is ever pressed: every wait times out, unless keys were queued with `press`. */\n private keys: string[] = [];\n\n press(...keys: string[]) {\n this.keys.push(...keys);\n return this;\n }\n\n waitForKey = () => Promise.resolve(this.keys.shift() ?? null);\n}\n\n/** A clock fixed at one moment, whose waits return at once. */\nexport class FixedClock implements Clock {\n constructor(private readonly at: Date) {}\n\n now = () => this.at;\n sleep = () => Promise.resolve();\n}\n","import type { Release } from \"../application/config/loadRelease\";\nimport type { ReleaseContext } from \"../application/context\";\nimport type { Approval } from \"../domain/releasePr\";\nimport type { ReleaseUnit } from \"../domain/unit\";\nimport type { Feature, ReleaseModule } from \"../modules/module\";\nimport { ciPipelineFake } from \"../adapters/ci-pipeline/__fakes__/ci-pipeline.fake\";\nimport { codeHostFake } from \"../adapters/code-host/__fakes__/code-host.fake\";\nimport { RecordingShell } from \"../adapters/shell/__fakes__/shell.fake\";\nimport { sourceControlFake } from \"../adapters/source-control/__fakes__/source-control.fake\";\nimport { RecordingProgress } from \"../adapters/terminal/__fakes__/progress.fake\";\nimport {\n FixedClock,\n MemoryOutput,\n ScriptedPrompter,\n} from \"../adapters/terminal/__fakes__/terminal.fake\";\nimport { versioningFake } from \"../adapters/versioning/__fakes__/versioning.fake\";\nimport { releaseFlow } from \"../application/releaseFlow\";\nimport { DEFAULT_TAG_FORMAT } from \"../domain/tags\";\n\nexport const testUnit = (name: string, overrides: Partial<ReleaseUnit> = {}): ReleaseUnit => ({\n name,\n dir: `apps/${name}`,\n file: `apps/${name}/shiplane.unit.yml`,\n packageName: `@acme/${name}`,\n version: \"0.1.0\",\n module: \"web-app\",\n options: {},\n after: [],\n ...overrides,\n});\n\n/** The flow's Fakes, as adapters a config would hold. */\ninterface FlowFakes {\n sourceControl: ReturnType<typeof sourceControlFake>;\n codeHost: ReturnType<typeof codeHostFake>;\n ciPipeline: ReturnType<typeof ciPipelineFake>;\n versioning: ReturnType<typeof versioningFake>;\n}\n\n/**\n * A release over a Fake of every port the flow runs on, answered by a scripted person. The apps are\n * in release order as given: the first is the Latest release.\n */\nexport const testContext = ({\n units,\n modules = [],\n features = [],\n yes = false,\n interactive = true,\n root = \"/repo\",\n tagFormat = DEFAULT_TAG_FORMAT,\n approval,\n}: {\n units: ReleaseUnit[];\n modules?: ReleaseModule[];\n /** The features, or how to make them from the flow's Fakes they share. */\n features?: Feature[] | ((flow: FlowFakes) => Feature[]);\n yes?: boolean;\n interactive?: boolean;\n root?: string;\n tagFormat?: string;\n /** Whether someone else approves the release PR; the config default when absent. */\n approval?: Approval;\n}) => {\n const sourceControl = sourceControlFake();\n const codeHost = codeHostFake();\n const ciPipeline = ciPipelineFake();\n const versioning = versioningFake();\n const prompter = new ScriptedPrompter(interactive);\n const output = new MemoryOutput();\n const progress = new RecordingProgress(output);\n const shell = new RecordingShell();\n const fakes = { sourceControl, codeHost, ciPipeline, versioning };\n const flow = releaseFlow({ ...fakes, approval });\n const release: Release = {\n root,\n flow,\n modules,\n features: typeof features === \"function\" ? features(fakes) : features,\n units,\n problems: [],\n tagFormat,\n };\n const context: ReleaseContext = {\n release,\n load: () => Promise.resolve(release),\n services: {\n sourceControl: sourceControl.fake,\n codeHost: codeHost.fake,\n ciPipeline: ciPipeline.fake,\n versioning: versioning.fake,\n },\n open: (adapter) => adapter.create({ root, shell }),\n prompter,\n output,\n progress,\n clock: new FixedClock(new Date(\"2026-10-12T09:00:00Z\")),\n shell,\n options: { yes, ci: false },\n };\n return {\n context,\n flow: fakes,\n source: sourceControl.fake,\n host: codeHost.fake,\n ci: ciPipeline.fake,\n versioning: versioning.fake,\n prompter,\n output,\n progress,\n shell,\n };\n};\n\nexport const changesetText = (packages: Record<string, string>, summary: string) =>\n `---\\n${Object.entries(packages)\n .map(([name, type]) => `\"${name}\": ${type}`)\n .join(\"\\n\")}\\n---\\n\\n${summary}\\n`;\n","import { describe, expect, it } from \"vitest\";\n\nimport type { Environment } from \"../domain/environment\";\nimport type { DeliveryAdapter } from \"../ports/adapter.port\";\nimport type { Delivery, FolderView } from \"../ports/delivery.port\";\nimport { RecordingShell } from \"../adapters/shell/__fakes__/shell.fake\";\nimport { optionsFor } from \"../application/config/optionsFor\";\nimport { ENVIRONMENTS } from \"../domain/environment\";\nimport { testUnit } from \"./releaseContext\";\n\n/** One adapter of a port, with settings an app's unit file could hold for it. */\nexport interface ContractCase<Port extends Delivery & { capability: string }> {\n adapter: DeliveryAdapter<Port>;\n settings: Record<string, unknown>;\n}\n\nconst EMPTY_FOLDER: FolderView = {\n dir: \"apps/empty\",\n name: \"empty\",\n files: [],\n has: () => false,\n read: () => null,\n};\n\n/** What every adapter of a delivery port must do, whatever its provider; `more` adds the port's own. */\nexport const deliveryContract = <Port extends Delivery & { capability: string }>(\n kind: string,\n cases: ContractCase<Port>[],\n more: (adapter: DeliveryAdapter<Port>, port: Port) => void = () => undefined,\n) =>\n describe.each(cases.map((entry) => [entry.adapter.name, entry] as const))(\n `%s, as ${kind}`,\n (_name, { adapter, settings }) => {\n const port = adapter.create({ root: \"/repo\", shell: new RecordingShell() });\n const unit = testUnit(\"app\", { module: \"app\", options: settings });\n const inputFor = (environment: Environment) => ({\n unit,\n tag: \"app@0.1.0\",\n environment,\n options: optionsFor({ ...unit, options: adapter.settings.parse(settings) }, environment, [\n unit,\n ]),\n commit: \"abc1234\",\n });\n\n it(\"given an app's settings, when its unit file is read, then the adapter's schema takes them\", () => {\n expect(adapter.settings.safeParse(settings).success).toBe(true);\n });\n\n it(\"given a tag on each environment, when it says where the tag lands, then a person can read it\", () => {\n ENVIRONMENTS.forEach((environment) =>\n expect(port.describe(inputFor(environment)).trim()).not.toBe(\"\"),\n );\n });\n\n it(\"given a tag on each environment, when its jobs are built, then each says what it does and what it runs\", () => {\n ENVIRONMENTS.forEach((environment) =>\n port.jobs(inputFor(environment)).forEach((job) => {\n expect(job.label.trim()).not.toBe(\"\");\n expect(job.local.length).toBeGreaterThan(0);\n job.local.forEach(({ command }) => expect(command.trim()).not.toBe(\"\"));\n }),\n );\n });\n\n it(\"given a folder with nothing in it, when init looks at it, then the adapter recognises nothing\", () => {\n expect(adapter.detect?.(EMPTY_FOLDER) ?? null).toBeNull();\n });\n\n it(\"given an app it ships, when doctor asks what it needs, then each need has a name and a check\", () => {\n (adapter.requirements?.(unit) ?? []).forEach(({ label, check }) => {\n expect(label.trim()).not.toBe(\"\");\n expect(check.command.trim()).not.toBe(\"\");\n });\n });\n\n more(adapter, port);\n },\n );\n","import { expect, it } from \"vitest\";\n\nimport type { ServerHostingPort } from \"../../ports/server-hosting.port\";\nimport type { ContractCase } from \"../../testing/deliveryContract\";\nimport { deliveryContract } from \"../../testing/deliveryContract\";\n\n/** What every server host does, whatever its provider. */\nexport const serverHostingContract = (cases: ContractCase<ServerHostingPort>[]) =>\n deliveryContract(\"server hosting\", cases, (_adapter, port) => {\n it(\"given a server host, when its kind is read, then it hosts servers\", () => {\n expect(port.capability).toBe(\"server-hosting\");\n });\n });\n","import { expect, it } from \"vitest\";\n\nimport type { StaticHostingPort } from \"../../ports/static-hosting.port\";\nimport type { ContractCase } from \"../../testing/deliveryContract\";\nimport { deliveryContract } from \"../../testing/deliveryContract\";\n\n/** What every static host does, whatever its provider. */\nexport const staticHostingContract = (cases: ContractCase<StaticHostingPort>[]) =>\n deliveryContract(\"static hosting\", cases, (_adapter, port) => {\n it(\"given a static host, when its kind is read, then it hosts static sites\", () => {\n expect(port.capability).toBe(\"static-hosting\");\n });\n });\n","import { expect, it } from \"vitest\";\n\nimport type { MobileDistributionPort } from \"../../ports/mobile-distribution.port\";\nimport type { ContractCase } from \"../../testing/deliveryContract\";\nimport { deliveryContract } from \"../../testing/deliveryContract\";\n\n/** What every mobile distribution does, whatever its provider. */\nexport const mobileDistributionContract = (cases: ContractCase<MobileDistributionPort>[]) =>\n deliveryContract(\"mobile distribution\", cases, (adapter, port) => {\n it(\"given a mobile distribution, when status asks who decides, then its platform is named\", () => {\n expect(port.capability).toBe(\"mobile-distribution\");\n expect(adapter.decidedBy?.platform.trim() ?? \"\").not.toBe(\"\");\n });\n });\n","import { expect, it } from \"vitest\";\n\nimport type { PackageRegistryPort } from \"../../ports/package-registry.port\";\nimport type { ContractCase } from \"../../testing/deliveryContract\";\nimport { deliveryContract } from \"../../testing/deliveryContract\";\n\n/** What every package registry does, whatever its provider. */\nexport const packageRegistryContract = (cases: ContractCase<PackageRegistryPort>[]) =>\n deliveryContract(\"a package registry\", cases, (_adapter, port) => {\n it(\"given a package registry, when its kind is read, then it publishes packages\", () => {\n expect(port.capability).toBe(\"package-registry\");\n });\n });\n","import { describe, expect, it } from \"vitest\";\n\nimport type { SourceControlPort } from \"../../ports/source-control.port\";\n\n/** A repository on main with one commit, and the ways a test arranges it beyond the port. */\nexport interface SourceControlSubject {\n port: SourceControlPort;\n /** The commit main is on. */\n head: () => Promise<string>;\n /** Writes a file the repository does not track yet. */\n change: (file: string, text: string) => Promise<void>;\n}\n\n/** What every source control does, whatever its provider. */\nexport const sourceControlContract = (name: string, subject: () => Promise<SourceControlSubject>) =>\n describe(`${name}, as source control`, () => {\n it(\"given a fresh checkout, when its position is read, then it is on main with nothing to commit\", async () => {\n const { port } = await subject();\n\n expect((await port.position()).branch).toBe(\"main\");\n expect(await port.isClean()).toBe(true);\n });\n\n it(\"given a commit tagged, when the tags are read, then the tag is there and names that commit\", async () => {\n const { port, head } = await subject();\n const sha = await head();\n\n await port.tag(\"app@1.0.0\", sha, \"app 1.0.0\");\n\n expect(await port.tags()).toContain(\"app@1.0.0\");\n expect(await port.tagCommit(\"app@1.0.0\")).toBe(sha);\n });\n\n it(\"given tags in every format a config names, when the tags are read, then each one is there\", async () => {\n const { port, head } = await subject();\n const sha = await head();\n for (const tag of [\"arnaud-zg--v0.2.1\", \"v1.0.0\", \"app@1.0.0\"]) {\n await port.tag(tag, sha, tag);\n }\n\n expect([...(await port.tags())].sort()).toEqual([\"app@1.0.0\", \"arnaud-zg--v0.2.1\", \"v1.0.0\"]);\n });\n\n it(\"given a tag deleted, when the tags are read, then it is gone and names no commit\", async () => {\n const { port, head } = await subject();\n await port.tag(\"app@1.0.0\", await head(), \"app 1.0.0\");\n\n await port.deleteTag(\"app@1.0.0\");\n\n expect(await port.tags()).not.toContain(\"app@1.0.0\");\n expect(await port.tagCommit(\"app@1.0.0\")).toBeNull();\n });\n\n it(\"given a branch created, when the position is read, then it is on it, and switching back returns to main\", async () => {\n const { port } = await subject();\n\n await port.createBranch(\"release/next\");\n const onBranch = (await port.position()).branch;\n await port.switchTo(\"main\");\n\n expect(onBranch).toBe(\"release/next\");\n expect((await port.position()).branch).toBe(\"main\");\n });\n\n it(\"given a new file committed, when the changes are read, then it is no longer among them\", async () => {\n const { port, change } = await subject();\n await change(\"notes.md\", \"notes\\n\");\n const before = await port.changedFiles();\n\n await port.commit([\"notes.md\"], \"docs: notes\");\n\n expect(before).toContain(\"notes.md\");\n expect(await port.changedFiles()).not.toContain(\"notes.md\");\n });\n });\n","import { describe, expect, it } from \"vitest\";\n\nimport type { IssueRef } from \"../../domain/issues\";\nimport type { CodeHostPort } from \"../../ports/code-host.port\";\n\n/** A repository on a code host, and the ways a test arranges it beyond the port. */\nexport interface CodeHostSubject {\n port: CodeHostPort;\n /** A branch the host can open a pull request from, pushed with one commit on it. */\n branch: (name: string) => Promise<string>;\n /** A tag the host can publish release notes for. */\n tag: () => Promise<string>;\n /** An issue or pull request comments can go on. */\n issue: IssueRef;\n}\n\n/** What every code host does, whatever its provider. */\nexport const codeHostContract = (name: string, subject: () => Promise<CodeHostSubject>) =>\n describe(`${name}, as a code host`, () => {\n it(\"given a pull request opened, when the open ones are read, then it is there and open\", async () => {\n const { port, branch } = await subject();\n const head = await branch(\"release/contract-open\");\n\n const pr = await port.createPr({\n base: \"main\",\n head,\n title: \"chore: contract\",\n body: \"Opened by the contract suite.\",\n label: \"release\",\n });\n\n expect(pr.head).toEqual(expect.any(String));\n expect(await port.openPrsFrom(\"release/contract-open\")).toContainEqual(pr);\n expect(await port.prState(pr)).toBe(\"OPEN\");\n });\n\n it(\"given a pull request closed, when the open ones are read, then it is gone and closed\", async () => {\n const { port, branch } = await subject();\n const head = await branch(\"release/contract-close\");\n const pr = await port.createPr({\n base: \"main\",\n head,\n title: \"chore: contract\",\n body: \"Opened by the contract suite.\",\n label: \"release\",\n });\n\n await port.closePr(pr, \"Closed by the contract suite.\");\n\n expect(await port.openPrsFrom(\"release/contract-close\")).not.toContainEqual(pr);\n expect(await port.prState(pr)).toBe(\"CLOSED\");\n });\n\n it(\"given release notes published for a tag, when the released tags are read, then it is among them\", async () => {\n const { port, tag } = await subject();\n const name = await tag();\n\n await port.createRelease(name, \"Published by the contract suite.\", false);\n\n expect(await port.releasedTags()).toContain(name);\n });\n\n it(\"given a deploy recorded, when the deploys are read, then it is there and done\", async () => {\n const { port, tag } = await subject();\n const name = await tag();\n\n await port.recordDeployment(name, \"preview\");\n\n expect(await port.deployments()).toContainEqual({\n title: `Deploy ${name} to preview`,\n state: \"done\",\n });\n });\n\n it(\"given a comment posted, when the comments are read, then it is among them\", async () => {\n const { port, issue } = await subject();\n const body = `Posted by the contract suite at ${new Date().toISOString()}.`;\n\n await port.comment(issue, body);\n\n expect((await port.comments([issue])).flat()).toContain(body);\n });\n });\n","import { describe, expect, it } from \"vitest\";\n\nimport type { CiPipelinePort } from \"../../ports/ci-pipeline.port\";\n\n/** A CI pipeline, and the ways a test reads it beyond the port. */\nexport interface CiPipelineSubject {\n port: CiPipelinePort;\n /** A workflow that exists and has never run. */\n idle: string;\n}\n\n/** What every CI pipeline does, whatever its provider. */\nexport const ciPipelineContract = (name: string, subject: () => Promise<CiPipelineSubject>) =>\n describe(`${name}, as a CI pipeline`, () => {\n it(\"given a workflow that never ran, when its runs are read, then there are none\", async () => {\n const { port, idle } = await subject();\n\n expect(await port.workflowRuns(idle)).toEqual([]);\n });\n\n it(\"given a workflow that never succeeded, when its billed minutes are read, then none are measured\", async () => {\n const { port, idle } = await subject();\n\n expect(await port.measuredMinutes(idle)).toEqual([]);\n });\n\n it(\"given this month's budget, when it is read, then what is left is never more than included\", async () => {\n const { port } = await subject();\n\n const minutes = await port.minutes();\n\n if (minutes) expect(minutes.left).toBeLessThanOrEqual(minutes.included);\n else expect(minutes).toBeNull();\n });\n });\n","import { describe, expect, it } from \"vitest\";\n\nimport type { VersioningPort } from \"../../ports/versioning.port\";\n\n/** A workspace with one package, and the ways a test arranges it beyond the port. */\nexport interface VersioningSubject {\n port: VersioningPort;\n /** The package the workspace holds, and its folder. */\n workspace: { name: string; folder: string };\n}\n\n/** What every versioning does, whatever its provider. */\nexport const versioningContract = (name: string, subject: () => Promise<VersioningSubject>) =>\n describe(`${name}, as versioning`, () => {\n it(\"given a change written, when the pending changes are read, then it is there naming its package and bump\", async () => {\n const { port, workspace } = await subject();\n\n await port.write({\n id: \"contract-change\",\n releases: [{ name: workspace.name, type: \"minor\" }],\n summary: \"Written by the contract suite.\",\n });\n\n const pending = await port.pending();\n expect(pending.map(({ id }) => id)).toContain(\"contract-change\");\n expect(pending.find(({ id }) => id === \"contract-change\")?.text).toContain(\n `\"${workspace.name}\": minor`,\n );\n });\n\n it(\"given a person with nothing queued, when they are told what to do, then the port says it\", async () => {\n const { port } = await subject();\n\n expect(port.nextChange).not.toBe(\"\");\n });\n\n it(\"given a workspace package, when the folders are read, then it is found in its folder\", async () => {\n const { port, workspace } = await subject();\n\n expect(await port.folders()).toMatchObject({ [workspace.name]: workspace.folder });\n });\n\n it(\"given a change and a folder, when their files are named, then they sit where a person looks\", async () => {\n const { port, workspace } = await subject();\n\n expect(port.changesetFile(\"contract-change\")).toBe(\".changeset/contract-change.md\");\n expect(port.changelogFile(workspace.folder)).toBe(`${workspace.folder}/CHANGELOG.md`);\n });\n });\n","import type { UnitRef } from \"../domain/changes\";\nimport type { DecidedBy } from \"../domain/scope\";\n\n/** This repository's four shipping units, as the rule tests were written against them. */\nexport const SAMPLE_UNITS: UnitRef[] = [\"expo\", \"api\", \"admin\", \"landing\"].map((name) => ({\n name,\n packageName: `@acme/${name}`,\n}));\n\nexport const SAMPLE_VERSION_FILES = new Set([\n \"apps/expo/app-version.json\",\n \"apps/api/public/app-version.preview.json\",\n \"apps/api/public/app-version.production.json\",\n]);\n\n// Billed minutes per deploy with no successful run to measure: the api validates before deploying.\nexport const SAMPLE_TYPICAL_MINUTES: Record<string, number> = {\n api: 13,\n admin: 5,\n landing: 4,\n expo: 8,\n};\n\nexport const EAS_DECIDES: DecidedBy = {\n platform: \"EAS\",\n choice: \"build or update\",\n check: \"shiplane status\",\n};\n","import { execFileSync } from \"node:child_process\";\nimport { z } from \"zod\";\n\nimport { systemShell } from \"../adapters/shell/system-shell.adapter\";\n\n/**\n * Contract suites against hosted services run only with RELEASE_CONTRACT_LIVE=1, on a sandbox\n * repository checked out at RELEASE_CONTRACT_REPO: they open pull requests, publish releases and\n * dispatch workflows there.\n */\nexport const LIVE = systemShell.env(\"RELEASE_CONTRACT_LIVE\") === \"1\";\n\n/** The sandbox checkout, refused when unset so a live run never touches this repository. */\nexport const sandbox = () =>\n z\n .string({ message: \"RELEASE_CONTRACT_REPO names a sandbox checkout for live contracts\" })\n .min(1)\n .parse(systemShell.env(\"RELEASE_CONTRACT_REPO\"));\n\n/** Runs git in the sandbox and returns what it printed. */\nexport const inSandbox = (args: string[]) =>\n execFileSync(\"git\", args, { cwd: sandbox(), encoding: \"utf8\" }).trim();\n","import type { BumpLevel, PlannedChangeset, StatusPlan } from \"../domain/changes\";\nimport { nextVersion } from \"../domain/versions\";\n\n/**\n * What `changeset status` answers for these pending changesets, plus the ones a release adds, minus\n * the lines it holds back: every named package moves once, by its biggest bump, up to `ceiling`.\n */\nexport const planFrom =\n (pending: PlannedChangeset[], versions: Record<string, string>) =>\n (added: PlannedChangeset[], held: PlannedChangeset[], ceiling?: BumpLevel): StatusPlan => {\n const heldLines = new Set(\n held.flatMap(({ id, releases }) => releases.map(({ name }) => `${id}:${name}`)),\n );\n const changesets = [...pending, ...added]\n .map((changeset) => ({\n ...changeset,\n releases: changeset.releases.filter(\n ({ name }) => !heldLines.has(`${changeset.id}:${name}`),\n ),\n }))\n .filter(({ releases }) => releases.length > 0);\n const order: BumpLevel[] = [\"major\", \"minor\", \"patch\"];\n const capped = ceiling ? order.slice(order.indexOf(ceiling)) : order;\n const names = [\n ...new Set(changesets.flatMap(({ releases }) => releases.map(({ name }) => name))),\n ];\n return {\n changesets,\n releases: names.map((name) => {\n const lines = changesets.filter(({ releases }) =>\n releases.some((line) => line.name === name),\n );\n const named =\n order.find((candidate) =>\n lines.some(({ releases }) =>\n releases.some((line) => line.name === name && line.type === candidate),\n ),\n ) ?? \"patch\";\n const type = capped.includes(named) ? named : (ceiling ?? named);\n const oldVersion = versions[name] ?? \"0.1.0\";\n return {\n name,\n type,\n oldVersion,\n newVersion: nextVersion(oldVersion, type),\n changesets: lines.map(({ id }) => id),\n };\n }),\n };\n };\n","import { execFileSync, spawnSync } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nimport { systemShell } from \"../adapters/shell/system-shell.adapter\";\n\n/** What the built CLI printed and the code it exited with. */\nexport interface CliRun {\n status: number;\n output: string;\n}\n\nexport interface ConsumerRepository {\n root: string;\n /** The bare repository the checkout pushes to, standing in for GitHub. */\n origin: string;\n write: (file: string, text: string) => void;\n read: (file: string) => string;\n /** Runs git in the checkout, or in the bare origin with `{ in: \"origin\" }`. */\n git: (args: string[], where?: { in: \"origin\" }) => string;\n /** Commits every file as it stands and pushes the branch to the origin. */\n commitAndPush: (title: string) => void;\n /** Runs the built `shiplane` CLI in the checkout, as a person types it. */\n shiplane: (args: string[]) => CliRun;\n remove: () => void;\n}\n\nconst CORE = \"shiplane\";\n\nconst coreDir = (from: string): string => {\n const manifest = path.join(from, \"package.json\");\n if (fs.existsSync(manifest)) {\n const { name } = JSON.parse(fs.readFileSync(manifest, \"utf8\")) as { name?: string };\n if (name === CORE) return from;\n }\n const parent = path.dirname(from);\n if (parent === from) throw new Error(`${CORE} not found above ${import.meta.dirname}`);\n return coreDir(parent);\n};\n\n/** The built CLI, as `pnpm add shiplane` installs it. */\nexport const builtCli = (): string => {\n const cli = path.join(coreDir(import.meta.dirname), \"dist\", \"cli.js\");\n if (!fs.existsSync(cli)) {\n throw new Error(`shiplane is not built: run pnpm turbo run build --filter=${CORE}`);\n }\n return cli;\n};\n\n// No global git config, signing key, token or CI marker leaks in: a run sees only this repository.\nconst LEAKS = new Set([\"GITHUB_ACTIONS\", \"CI\", \"GITHUB_TOKEN\", \"GH_TOKEN\"]);\n\nconst hermeticEnv = (home: string, bin: string): NodeJS.ProcessEnv => ({\n ...Object.fromEntries(Object.entries(process.env).filter(([name]) => !LEAKS.has(name))),\n PATH: [bin, systemShell.env(\"PATH\") ?? \"\"].join(path.delimiter),\n HOME: home,\n GIT_CONFIG_GLOBAL: path.join(home, \".gitconfig\"),\n GIT_CONFIG_NOSYSTEM: \"1\",\n NO_COLOR: \"1\",\n // A fixed date makes each commit's hash depend on its files only, so docs can quote a run.\n GIT_AUTHOR_DATE: \"2026-01-01T00:00:00Z\",\n GIT_COMMITTER_DATE: \"2026-01-01T00:00:00Z\",\n});\n\n// The tools that reach a platform answer offline, so a run that would call one fails at once.\nconst OFFLINE = [\"gh\", \"npm\", \"flyctl\"];\n\nconst offlineTools = (bin: string) => {\n fs.mkdirSync(bin);\n OFFLINE.forEach((tool) => {\n const file = path.join(bin, tool);\n fs.writeFileSync(file, `#!/bin/sh\\necho \"${tool}: offline in this repository\" >&2\\nexit 1\\n`);\n fs.chmodSync(file, 0o755);\n });\n};\n\n/**\n * A repository as a consumer has it: its files, the packages it installed linked in its\n * node_modules, one commit pushed to a local bare origin. gh, npm and flyctl answer offline.\n */\nexport const consumerRepository = ({\n files,\n packages = {},\n branch = \"main\",\n}: {\n files: Record<string, string>;\n /** The branch releases start from, created first and pushed. */\n branch?: string;\n /** Package name to the folder it installs from, such as a plugin's workspace folder. */\n packages?: Record<string, string>;\n}): ConsumerRepository => {\n const dir = fs.mkdtempSync(path.join(os.tmpdir(), \"shiplane-consumer-\"));\n const root = path.join(dir, \"checkout\");\n const origin = path.join(dir, \"origin.git\");\n const home = path.join(dir, \"home\");\n fs.mkdirSync(home);\n fs.writeFileSync(\n path.join(home, \".gitconfig\"),\n \"[user]\\n\\tname = Shiplane Consumer\\n\\temail = consumer@example.com\\n\" +\n \"[commit]\\n\\tgpgsign = false\\n[tag]\\n\\tgpgsign = false\\n[core]\\n\\thooksPath = /dev/null\\n\",\n );\n const bin = path.join(dir, \"bin\");\n offlineTools(bin);\n const env = hermeticEnv(home, bin);\n const git = (args: string[], where?: { in: \"origin\" }) =>\n execFileSync(\"git\", args, {\n cwd: where ? origin : root,\n env,\n stdio: \"pipe\",\n encoding: \"utf8\",\n }).trim();\n const write = (file: string, text: string) => {\n const target = path.join(root, file);\n fs.mkdirSync(path.dirname(target), { recursive: true });\n fs.writeFileSync(target, text);\n };\n\n fs.mkdirSync(root);\n execFileSync(\"git\", [\"init\", \"--quiet\", \"--bare\", `--initial-branch=${branch}`, origin], { env });\n git([\"init\", \"--quiet\", `--initial-branch=${branch}`]);\n git([\"remote\", \"add\", \"origin\", origin]);\n write(\".gitignore\", \"node_modules\\n\");\n Object.entries(files).forEach(([file, text]) => write(file, text));\n Object.entries({ [CORE]: coreDir(import.meta.dirname), ...packages }).forEach(([name, from]) => {\n const link = path.join(root, \"node_modules\", name);\n fs.mkdirSync(path.dirname(link), { recursive: true });\n fs.symlinkSync(from, link, \"dir\");\n });\n const commitAndPush = (title: string) => {\n git([\"add\", \"--all\"]);\n git([\"commit\", \"--quiet\", \"-m\", title]);\n git([\"push\", \"--quiet\", \"origin\", branch]);\n };\n commitAndPush(\"chore: start\");\n\n const cli = builtCli();\n return {\n root,\n origin,\n write,\n read: (file) => fs.readFileSync(path.join(root, file), \"utf8\"),\n git,\n commitAndPush,\n shiplane: (args) => {\n const run = spawnSync(process.execPath, [cli, ...args], {\n cwd: root,\n env,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n return { status: run.status ?? 1, output: `${run.stdout}${run.stderr}` };\n },\n remove: () => fs.rmSync(dir, { recursive: true, force: true }),\n };\n};\n","import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\n/** The public API a test config imports, resolved to source since tests run before any build. */\nexport const SOURCE_ALIASES: Record<string, string> = {\n shiplane: path.resolve(import.meta.dirname, \"../index.ts\"),\n \"shiplane/plugin\": path.resolve(import.meta.dirname, \"../plugin.ts\"),\n \"shiplane/testing\": path.resolve(import.meta.dirname, \"public.ts\"),\n};\n\nexport interface Workspace {\n root: string;\n write: (file: string, text: string) => void;\n read: (file: string) => string;\n exists: (file: string) => boolean;\n remove: () => void;\n}\n\n/** A throwaway repository on disk, one entry per file, removed by `remove()`. */\nexport const createWorkspace = (files: Record<string, string>): Workspace => {\n const root = fs.mkdtempSync(path.join(os.tmpdir(), \"release-workspace-\"));\n const write = (file: string, text: string) => {\n const target = path.join(root, file);\n fs.mkdirSync(path.dirname(target), { recursive: true });\n fs.writeFileSync(target, text);\n };\n Object.entries(files).forEach(([file, text]) => write(file, text));\n return {\n root,\n write,\n read: (file) => fs.readFileSync(path.join(root, file), \"utf8\"),\n exists: (file) => fs.existsSync(path.join(root, file)),\n remove: () => fs.rmSync(root, { recursive: true, force: true }),\n };\n};\n\nexport const packageJson = (name: string, version = \"1.0.0\", extra: object = {}) =>\n JSON.stringify({ name, version, ...extra }, null, 2);\n"],"mappings":";;;;;;;;;;;;AAUA,IAAa,iBAAb,MAA6C;CAC3C,QAA8B,EAAE;CAChC,UAAsF,EAAE;CACxF,YAA4C,EAAE;CAE9C,QAAQ,WAAmC;AACzC,OAAK,YAAY;GAAE,GAAG,KAAK;GAAW,GAAG;GAAW;AACpD,SAAO;;CAGT,OAAO,SAAiB,KAAK,UAAU;;CAGvC,KAAK,QAAgB,QAA8B;AACjD,OAAK,QAAQ,KAAK;GAAE;GAAQ;GAAQ,CAAC;AACrC,SAAO;;;CAIT,SAAS,QAAgB,QAA8B;AACrD,OAAK,QAAQ,QAAQ;GAAE;GAAQ;GAAQ,MAAM;GAAM,CAAC;AACpD,SAAO;;CAGT,OAAe,SAAiB,MAAyB,SAAkC;AACzF,OAAK,MAAM,KAAK;GAAE;GAAS,MAAM,CAAC,GAAG,KAAK;GAAE,KAAK,QAAQ;GAAK,KAAK,QAAQ;GAAK,CAAC;EACjF,MAAM,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,IAAI;EACzC,MAAM,QAAQ,KAAK,QAAQ,MAAM,EAAE,aAAa,KAAK,WAAW,OAAO,CAAC;AACxE,MAAI,OAAO,KAAM,MAAK,QAAQ,OAAO,KAAK,QAAQ,QAAQ,M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/progress.fake.ts","../src/adapters/terminal/__fakes__/terminal.fake.ts","../src/testing/releaseContext.ts","../src/testing/deliveryContract.ts","../src/adapters/server-hosting/server-hosting.contract.ts","../src/adapters/static-hosting/static-hosting.contract.ts","../src/adapters/mobile-distribution/mobile-distribution.contract.ts","../src/adapters/package-registry/package-registry.contract.ts","../src/adapters/source-control/source-control.contract.ts","../src/adapters/code-host/code-host.contract.ts","../src/adapters/ci-pipeline/ci-pipeline.contract.ts","../src/adapters/versioning/versioning.contract.ts","../src/testing/sample.ts","../src/testing/live.ts","../src/testing/plans.ts","../src/testing/consumer.ts","../src/testing/workspace.ts"],"sourcesContent":["import type { RunOptions, Shell, ShellResult } from \"../../../ports/shell.port\";\n\nexport interface ShellCall {\n command: string;\n args: string[];\n cwd?: string;\n env?: Record<string, string>;\n}\n\n/** A shell that runs nothing: it keeps every call and answers from what was seeded. */\nexport class RecordingShell implements Shell {\n readonly calls: ShellCall[] = [];\n private answers: { prefix: string; result: Partial<ShellResult>; once?: boolean }[] = [];\n private variables: Record<string, string> = {};\n\n seedEnv(variables: Record<string, string>) {\n this.variables = { ...this.variables, ...variables };\n return this;\n }\n\n env = (name: string) => this.variables[name];\n\n /** Answers every call whose `command args` line starts with `prefix`. */\n seed(prefix: string, result: Partial<ShellResult>) {\n this.answers.push({ prefix, result });\n return this;\n }\n\n /** Answers the next call starting with `prefix` only, ahead of what `seed` answers. */\n seedOnce(prefix: string, result: Partial<ShellResult>) {\n this.answers.unshift({ prefix, result, once: true });\n return this;\n }\n\n private answer(command: string, args: readonly string[], options: RunOptions): ShellResult {\n this.calls.push({ command, args: [...args], cwd: options.cwd, env: options.env });\n const line = [command, ...args].join(\" \");\n const found = this.answers.find(({ prefix }) => line.startsWith(prefix));\n if (found?.once) this.answers.splice(this.answers.indexOf(found), 1);\n return { status: 0, stdout: \"\", stderr: \"\", ...found?.result };\n }\n\n capture = (command: string, args: readonly string[], options: RunOptions = {}) =>\n Promise.resolve(this.answer(command, args, options));\n\n attach = (command: string, args: readonly string[], options: RunOptions = {}) =>\n Promise.resolve(this.answer(command, args, options).status);\n}\n","import type { Mood } from \"../../../domain/display\";\nimport type { BatchPlace, Output, Progress, StepPlace } from \"../../../ports/terminal.port\";\n\nexport interface ProgressEvent {\n kind: \"stage\" | \"during\" | \"say\";\n text: string;\n mood?: Mood;\n step?: StepPlace;\n /** How many items a batch runs at once. */\n batch?: number;\n}\n\n/** Progress kept as events; what it says also goes to the output, as a terminal would print it. */\nexport class RecordingProgress implements Progress {\n readonly events: ProgressEvent[] = [];\n\n constructor(private readonly output: Output) {}\n\n stage = (stages: readonly string[], index: number) => {\n this.events.push({\n kind: \"stage\",\n text: stages[index] ?? \"\",\n step: { index, total: stages.length },\n });\n };\n\n during = <T>(\n label: string,\n mood: Mood,\n work: () => Promise<T>,\n step?: StepPlace | BatchPlace,\n ) => {\n const place = step && \"done\" in step ? { batch: step.total } : step ? { step } : {};\n this.events.push({ kind: \"during\", mood, text: label, ...place });\n return work();\n };\n\n say = (mood: Mood, text: string) => {\n this.events.push({ kind: \"say\", mood, text });\n this.output.line(text);\n };\n}\n","import type { Choice, Clock, Output, Prompter } from \"../../../ports/terminal.port\";\n\n/** Everything the CLI printed, in order, without colours. */\nexport class MemoryOutput implements Output {\n readonly lines: string[] = [];\n\n line = (text = \"\") => {\n // eslint-disable-next-line no-control-regex\n this.lines.push(text.replace(/\\u001B\\[[0-9;]*m/g, \"\"));\n };\n\n get text() {\n return this.lines.join(\"\\n\");\n }\n}\n\ntype Answer = boolean | string | string[] | null;\n\n/** A person who answers from a script, in order; every question asked is kept. */\nexport class ScriptedPrompter implements Prompter {\n readonly asked: string[] = [];\n /** The answer each choice question offered first, by question. */\n readonly initials: Record<string, unknown> = {};\n /** The choices each select question offered, by question. */\n readonly choices: Record<string, Choice<string>[]> = {};\n private answers: Answer[] = [];\n\n constructor(readonly interactive = true) {}\n\n answer(...answers: Answer[]) {\n this.answers.push(...answers);\n return this;\n }\n\n private next(question: string): Answer {\n this.asked.push(question);\n if (this.answers.length === 0) throw new Error(`Unexpected question: ${question}`);\n return this.answers.shift() ?? null;\n }\n\n confirm = (question: string, initial = false) => {\n this.initials[question] = initial;\n return Promise.resolve(this.next(question) === true);\n };\n\n typed = (question: string, word: string) => Promise.resolve(this.next(question) === word);\n\n select = <Value extends string>(message: string, choices: Choice<Value>[], initial?: Value) => {\n this.initials[message] = initial;\n this.choices[message] = choices;\n return Promise.resolve(this.next(message) as Value | null);\n };\n\n multiselect = <Value extends string>(\n message: string,\n choices: Choice<Value>[],\n initial: Value[],\n ) => {\n this.initials[message] = initial;\n this.choices[message] = choices;\n return Promise.resolve(this.next(message) as Value[] | null);\n };\n\n text = (message: string) => Promise.resolve(this.next(message) as string | null);\n\n /** No key is ever pressed: every wait times out, unless keys were queued with `press`. */\n private keys: string[] = [];\n\n press(...keys: string[]) {\n this.keys.push(...keys);\n return this;\n }\n\n waitForKey = () => Promise.resolve(this.keys.shift() ?? null);\n}\n\n/** A clock fixed at one moment, whose waits return at once. */\nexport class FixedClock implements Clock {\n constructor(private readonly at: Date) {}\n\n now = () => this.at;\n sleep = () => Promise.resolve();\n}\n","import type { Release } from \"../application/config/loadRelease\";\nimport type { ReleaseContext } from \"../application/context\";\nimport type { Approval } from \"../domain/releasePr\";\nimport type { ReleaseUnit } from \"../domain/unit\";\nimport type { Feature, ReleaseModule } from \"../modules/module\";\nimport { ciPipelineFake } from \"../adapters/ci-pipeline/__fakes__/ci-pipeline.fake\";\nimport { codeHostFake } from \"../adapters/code-host/__fakes__/code-host.fake\";\nimport { RecordingShell } from \"../adapters/shell/__fakes__/shell.fake\";\nimport { sourceControlFake } from \"../adapters/source-control/__fakes__/source-control.fake\";\nimport { RecordingProgress } from \"../adapters/terminal/__fakes__/progress.fake\";\nimport {\n FixedClock,\n MemoryOutput,\n ScriptedPrompter,\n} from \"../adapters/terminal/__fakes__/terminal.fake\";\nimport { versioningFake } from \"../adapters/versioning/__fakes__/versioning.fake\";\nimport { releaseFlow } from \"../application/releaseFlow\";\nimport { DEFAULT_TAG_FORMAT } from \"../domain/tags\";\n\nexport const testUnit = (name: string, overrides: Partial<ReleaseUnit> = {}): ReleaseUnit => ({\n name,\n dir: `apps/${name}`,\n file: `apps/${name}/shiplane.unit.yml`,\n packageName: `@acme/${name}`,\n version: \"0.1.0\",\n module: \"web-app\",\n options: {},\n after: [],\n ...overrides,\n});\n\n/** The flow's Fakes, as adapters a config would hold. */\ninterface FlowFakes {\n sourceControl: ReturnType<typeof sourceControlFake>;\n codeHost: ReturnType<typeof codeHostFake>;\n ciPipeline: ReturnType<typeof ciPipelineFake>;\n versioning: ReturnType<typeof versioningFake>;\n}\n\n/**\n * A release over a Fake of every port the flow runs on, answered by a scripted person. The apps are\n * in release order as given: the first is the Latest release.\n */\nexport const testContext = ({\n units,\n modules = [],\n features = [],\n yes = false,\n interactive = true,\n root = \"/repo\",\n tagFormat = DEFAULT_TAG_FORMAT,\n approval,\n}: {\n units: ReleaseUnit[];\n modules?: ReleaseModule[];\n /** The features, or how to make them from the flow's Fakes they share. */\n features?: Feature[] | ((flow: FlowFakes) => Feature[]);\n yes?: boolean;\n interactive?: boolean;\n root?: string;\n tagFormat?: string;\n /** Whether someone else approves the release PR; the config default when absent. */\n approval?: Approval;\n}) => {\n const sourceControl = sourceControlFake();\n const codeHost = codeHostFake();\n const ciPipeline = ciPipelineFake();\n const versioning = versioningFake();\n const prompter = new ScriptedPrompter(interactive);\n const output = new MemoryOutput();\n const progress = new RecordingProgress(output);\n const shell = new RecordingShell();\n const fakes = { sourceControl, codeHost, ciPipeline, versioning };\n const flow = releaseFlow({ ...fakes, approval });\n const release: Release = {\n root,\n flow,\n modules,\n features: typeof features === \"function\" ? features(fakes) : features,\n units,\n problems: [],\n tagFormat,\n };\n const context: ReleaseContext = {\n release,\n load: () => Promise.resolve(release),\n services: {\n sourceControl: sourceControl.fake,\n codeHost: codeHost.fake,\n ciPipeline: ciPipeline.fake,\n versioning: versioning.fake,\n },\n open: (adapter) => adapter.create({ root, shell }),\n prompter,\n output,\n progress,\n clock: new FixedClock(new Date(\"2026-10-12T09:00:00Z\")),\n shell,\n options: { yes, ci: false },\n };\n return {\n context,\n flow: fakes,\n source: sourceControl.fake,\n host: codeHost.fake,\n ci: ciPipeline.fake,\n versioning: versioning.fake,\n prompter,\n output,\n progress,\n shell,\n };\n};\n\nexport const changesetText = (packages: Record<string, string>, summary: string) =>\n `---\\n${Object.entries(packages)\n .map(([name, type]) => `\"${name}\": ${type}`)\n .join(\"\\n\")}\\n---\\n\\n${summary}\\n`;\n","import { describe, expect, it } from \"vitest\";\n\nimport type { Environment } from \"../domain/environment\";\nimport type { DeliveryAdapter } from \"../ports/adapter.port\";\nimport type { Delivery, FolderView } from \"../ports/delivery.port\";\nimport { RecordingShell } from \"../adapters/shell/__fakes__/shell.fake\";\nimport { optionsFor } from \"../application/config/optionsFor\";\nimport { ENVIRONMENTS } from \"../domain/environment\";\nimport { testUnit } from \"./releaseContext\";\n\n/** One adapter of a port, with settings an app's unit file could hold for it. */\nexport interface ContractCase<Port extends Delivery & { capability: string }> {\n adapter: DeliveryAdapter<Port>;\n settings: Record<string, unknown>;\n}\n\nconst EMPTY_FOLDER: FolderView = {\n dir: \"apps/empty\",\n name: \"empty\",\n files: [],\n has: () => false,\n read: () => null,\n};\n\n/** What every adapter of a delivery port must do, whatever its provider; `more` adds the port's own. */\nexport const deliveryContract = <Port extends Delivery & { capability: string }>(\n kind: string,\n cases: ContractCase<Port>[],\n more: (adapter: DeliveryAdapter<Port>, port: Port) => void = () => undefined,\n) =>\n describe.each(cases.map((entry) => [entry.adapter.name, entry] as const))(\n `%s, as ${kind}`,\n (_name, { adapter, settings }) => {\n const port = adapter.create({ root: \"/repo\", shell: new RecordingShell() });\n const unit = testUnit(\"app\", { module: \"app\", options: settings });\n const inputFor = (environment: Environment) => ({\n unit,\n tag: \"app@0.1.0\",\n environment,\n options: optionsFor({ ...unit, options: adapter.settings.parse(settings) }, environment, [\n unit,\n ]),\n commit: \"abc1234\",\n });\n\n it(\"given an app's settings, when its unit file is read, then the adapter's schema takes them\", () => {\n expect(adapter.settings.safeParse(settings).success).toBe(true);\n });\n\n it(\"given a tag on each environment, when it says where the tag lands, then a person can read it\", () => {\n ENVIRONMENTS.forEach((environment) =>\n expect(port.describe(inputFor(environment)).trim()).not.toBe(\"\"),\n );\n });\n\n it(\"given a tag on each environment, when its jobs are built, then each says what it does and what it runs\", () => {\n ENVIRONMENTS.forEach((environment) =>\n port.jobs(inputFor(environment)).forEach((job) => {\n expect(job.label.trim()).not.toBe(\"\");\n expect(job.local.length).toBeGreaterThan(0);\n job.local.forEach(({ command }) => expect(command.trim()).not.toBe(\"\"));\n }),\n );\n });\n\n it(\"given a folder with nothing in it, when init looks at it, then the adapter recognises nothing\", () => {\n expect(adapter.detect?.(EMPTY_FOLDER) ?? null).toBeNull();\n });\n\n it(\"given an app it ships, when doctor asks what it needs, then each need has a name and a check\", () => {\n (adapter.requirements?.(unit) ?? []).forEach(({ label, check }) => {\n expect(label.trim()).not.toBe(\"\");\n expect(check.command.trim()).not.toBe(\"\");\n });\n });\n\n more(adapter, port);\n },\n );\n","import { expect, it } from \"vitest\";\n\nimport type { ServerHostingPort } from \"../../ports/server-hosting.port\";\nimport type { ContractCase } from \"../../testing/deliveryContract\";\nimport { deliveryContract } from \"../../testing/deliveryContract\";\n\n/** What every server host does, whatever its provider. */\nexport const serverHostingContract = (cases: ContractCase<ServerHostingPort>[]) =>\n deliveryContract(\"server hosting\", cases, (_adapter, port) => {\n it(\"given a server host, when its kind is read, then it hosts servers\", () => {\n expect(port.capability).toBe(\"server-hosting\");\n });\n });\n","import { expect, it } from \"vitest\";\n\nimport type { StaticHostingPort } from \"../../ports/static-hosting.port\";\nimport type { ContractCase } from \"../../testing/deliveryContract\";\nimport { deliveryContract } from \"../../testing/deliveryContract\";\n\n/** What every static host does, whatever its provider. */\nexport const staticHostingContract = (cases: ContractCase<StaticHostingPort>[]) =>\n deliveryContract(\"static hosting\", cases, (_adapter, port) => {\n it(\"given a static host, when its kind is read, then it hosts static sites\", () => {\n expect(port.capability).toBe(\"static-hosting\");\n });\n });\n","import { expect, it } from \"vitest\";\n\nimport type { MobileDistributionPort } from \"../../ports/mobile-distribution.port\";\nimport type { ContractCase } from \"../../testing/deliveryContract\";\nimport { deliveryContract } from \"../../testing/deliveryContract\";\n\n/** What every mobile distribution does, whatever its provider. */\nexport const mobileDistributionContract = (cases: ContractCase<MobileDistributionPort>[]) =>\n deliveryContract(\"mobile distribution\", cases, (adapter, port) => {\n it(\"given a mobile distribution, when status asks who decides, then its platform is named\", () => {\n expect(port.capability).toBe(\"mobile-distribution\");\n expect(adapter.decidedBy?.platform.trim() ?? \"\").not.toBe(\"\");\n });\n });\n","import { expect, it } from \"vitest\";\n\nimport type { PackageRegistryPort } from \"../../ports/package-registry.port\";\nimport type { ContractCase } from \"../../testing/deliveryContract\";\nimport { deliveryContract } from \"../../testing/deliveryContract\";\n\n/** What every package registry does, whatever its provider. */\nexport const packageRegistryContract = (cases: ContractCase<PackageRegistryPort>[]) =>\n deliveryContract(\"a package registry\", cases, (_adapter, port) => {\n it(\"given a package registry, when its kind is read, then it publishes packages\", () => {\n expect(port.capability).toBe(\"package-registry\");\n });\n });\n","import { describe, expect, it } from \"vitest\";\n\nimport type { SourceControlPort } from \"../../ports/source-control.port\";\n\n/** A repository on main with one commit, and the ways a test arranges it beyond the port. */\nexport interface SourceControlSubject {\n port: SourceControlPort;\n /** The commit main is on. */\n head: () => Promise<string>;\n /** Writes a file the repository does not track yet. */\n change: (file: string, text: string) => Promise<void>;\n}\n\n/** What every source control does, whatever its provider. */\nexport const sourceControlContract = (name: string, subject: () => Promise<SourceControlSubject>) =>\n describe(`${name}, as source control`, () => {\n it(\"given a fresh checkout, when its position is read, then it is on main with nothing to commit\", async () => {\n const { port } = await subject();\n\n expect((await port.position()).branch).toBe(\"main\");\n expect(await port.isClean()).toBe(true);\n });\n\n it(\"given a commit tagged, when the tags are read, then the tag is there and names that commit\", async () => {\n const { port, head } = await subject();\n const sha = await head();\n\n await port.tag(\"app@1.0.0\", sha, \"app 1.0.0\");\n\n expect(await port.tags()).toContain(\"app@1.0.0\");\n expect(await port.tagCommit(\"app@1.0.0\")).toBe(sha);\n });\n\n it(\"given tags in every format a config names, when the tags are read, then each one is there\", async () => {\n const { port, head } = await subject();\n const sha = await head();\n for (const tag of [\"arnaud-zg--v0.2.1\", \"v1.0.0\", \"app@1.0.0\"]) {\n await port.tag(tag, sha, tag);\n }\n\n expect([...(await port.tags())].sort()).toEqual([\"app@1.0.0\", \"arnaud-zg--v0.2.1\", \"v1.0.0\"]);\n });\n\n it(\"given a tag deleted, when the tags are read, then it is gone and names no commit\", async () => {\n const { port, head } = await subject();\n await port.tag(\"app@1.0.0\", await head(), \"app 1.0.0\");\n\n await port.deleteTag(\"app@1.0.0\");\n\n expect(await port.tags()).not.toContain(\"app@1.0.0\");\n expect(await port.tagCommit(\"app@1.0.0\")).toBeNull();\n });\n\n it(\"given a branch created, when the position is read, then it is on it, and switching back returns to main\", async () => {\n const { port } = await subject();\n\n await port.createBranch(\"release/next\");\n const onBranch = (await port.position()).branch;\n await port.switchTo(\"main\");\n\n expect(onBranch).toBe(\"release/next\");\n expect((await port.position()).branch).toBe(\"main\");\n });\n\n it(\"given a new file committed, when the changes are read, then it is no longer among them\", async () => {\n const { port, change } = await subject();\n await change(\"notes.md\", \"notes\\n\");\n const before = await port.changedFiles();\n\n await port.commit([\"notes.md\"], \"docs: notes\");\n\n expect(before).toContain(\"notes.md\");\n expect(await port.changedFiles()).not.toContain(\"notes.md\");\n });\n });\n","import { describe, expect, it } from \"vitest\";\n\nimport type { IssueRef } from \"../../domain/issues\";\nimport type { CodeHostPort } from \"../../ports/code-host.port\";\n\n/** A repository on a code host, and the ways a test arranges it beyond the port. */\nexport interface CodeHostSubject {\n port: CodeHostPort;\n /** A branch the host can open a pull request from, pushed with one commit on it. */\n branch: (name: string) => Promise<string>;\n /** A tag the host can publish release notes for. */\n tag: () => Promise<string>;\n /** An issue or pull request comments can go on. */\n issue: IssueRef;\n}\n\n/** What every code host does, whatever its provider. */\nexport const codeHostContract = (name: string, subject: () => Promise<CodeHostSubject>) =>\n describe(`${name}, as a code host`, () => {\n it(\"given a pull request opened, when the open ones are read, then it is there and open\", async () => {\n const { port, branch } = await subject();\n const head = await branch(\"release/contract-open\");\n\n const pr = await port.createPr({\n base: \"main\",\n head,\n title: \"chore: contract\",\n body: \"Opened by the contract suite.\",\n label: \"release\",\n });\n\n expect(pr.head).toEqual(expect.any(String));\n expect(await port.openPrsFrom(\"release/contract-open\")).toContainEqual(pr);\n expect(await port.prState(pr)).toBe(\"OPEN\");\n });\n\n it(\"given a pull request closed, when the open ones are read, then it is gone and closed\", async () => {\n const { port, branch } = await subject();\n const head = await branch(\"release/contract-close\");\n const pr = await port.createPr({\n base: \"main\",\n head,\n title: \"chore: contract\",\n body: \"Opened by the contract suite.\",\n label: \"release\",\n });\n\n await port.closePr(pr, \"Closed by the contract suite.\");\n\n expect(await port.openPrsFrom(\"release/contract-close\")).not.toContainEqual(pr);\n expect(await port.prState(pr)).toBe(\"CLOSED\");\n });\n\n it(\"given release notes published for a tag, when the released tags are read, then it is among them\", async () => {\n const { port, tag } = await subject();\n const name = await tag();\n\n await port.createRelease(name, \"Published by the contract suite.\", false);\n\n expect(await port.releasedTags()).toContain(name);\n });\n\n it(\"given a deploy recorded, when the deploys are read, then it is there and done\", async () => {\n const { port, tag } = await subject();\n const name = await tag();\n\n await port.recordDeployment(name, \"preview\");\n\n expect(await port.deployments()).toContainEqual({\n title: `Deploy ${name} to preview`,\n state: \"done\",\n });\n });\n\n it(\"given a comment posted, when the comments are read, then it is among them\", async () => {\n const { port, issue } = await subject();\n const body = `Posted by the contract suite at ${new Date().toISOString()}.`;\n\n await port.comment(issue, body);\n\n expect((await port.comments([issue])).flat()).toContain(body);\n });\n });\n","import { describe, expect, it } from \"vitest\";\n\nimport type { CiPipelinePort } from \"../../ports/ci-pipeline.port\";\n\n/** A CI pipeline, and the ways a test reads it beyond the port. */\nexport interface CiPipelineSubject {\n port: CiPipelinePort;\n /** A workflow that exists and has never run. */\n idle: string;\n}\n\n/** What every CI pipeline does, whatever its provider. */\nexport const ciPipelineContract = (name: string, subject: () => Promise<CiPipelineSubject>) =>\n describe(`${name}, as a CI pipeline`, () => {\n it(\"given a workflow that never ran, when its runs are read, then there are none\", async () => {\n const { port, idle } = await subject();\n\n expect(await port.workflowRuns(idle)).toEqual([]);\n });\n\n it(\"given a workflow that never succeeded, when its billed minutes are read, then none are measured\", async () => {\n const { port, idle } = await subject();\n\n expect(await port.measuredMinutes(idle)).toEqual([]);\n });\n\n it(\"given this month's budget, when it is read, then what is left is never more than included\", async () => {\n const { port } = await subject();\n\n const minutes = await port.minutes();\n\n if (minutes) expect(minutes.left).toBeLessThanOrEqual(minutes.included);\n else expect(minutes).toBeNull();\n });\n });\n","import { describe, expect, it } from \"vitest\";\n\nimport type { VersioningPort } from \"../../ports/versioning.port\";\n\n/** A workspace with one package, and the ways a test arranges it beyond the port. */\nexport interface VersioningSubject {\n port: VersioningPort;\n /** The package the workspace holds, and its folder. */\n workspace: { name: string; folder: string };\n}\n\n/** What every versioning does, whatever its provider. */\nexport const versioningContract = (name: string, subject: () => Promise<VersioningSubject>) =>\n describe(`${name}, as versioning`, () => {\n it(\"given a change written, when the pending changes are read, then it is there naming its package and bump\", async () => {\n const { port, workspace } = await subject();\n\n await port.write({\n id: \"contract-change\",\n releases: [{ name: workspace.name, type: \"minor\" }],\n summary: \"Written by the contract suite.\",\n });\n\n const pending = await port.pending();\n expect(pending.map(({ id }) => id)).toContain(\"contract-change\");\n expect(pending.find(({ id }) => id === \"contract-change\")?.text).toContain(\n `\"${workspace.name}\": minor`,\n );\n });\n\n it(\"given a person with nothing queued, when they are told what to do, then the port says it\", async () => {\n const { port } = await subject();\n\n expect(port.nextChange).not.toBe(\"\");\n });\n\n it(\"given a workspace package, when the folders are read, then it is found in its folder\", async () => {\n const { port, workspace } = await subject();\n\n expect(await port.folders()).toMatchObject({ [workspace.name]: workspace.folder });\n });\n\n it(\"given a change and a folder, when their files are named, then they sit where a person looks\", async () => {\n const { port, workspace } = await subject();\n\n expect(port.changesetFile(\"contract-change\")).toBe(\".changeset/contract-change.md\");\n expect(port.changelogFile(workspace.folder)).toBe(`${workspace.folder}/CHANGELOG.md`);\n });\n });\n","import type { UnitRef } from \"../domain/changes\";\nimport type { DecidedBy } from \"../domain/scope\";\n\n/** This repository's four shipping units, as the rule tests were written against them. */\nexport const SAMPLE_UNITS: UnitRef[] = [\"expo\", \"api\", \"admin\", \"landing\"].map((name) => ({\n name,\n packageName: `@acme/${name}`,\n}));\n\nexport const SAMPLE_VERSION_FILES = new Set([\n \"apps/expo/app-version.json\",\n \"apps/api/public/app-version.preview.json\",\n \"apps/api/public/app-version.production.json\",\n]);\n\n// Billed minutes per deploy with no successful run to measure: the api validates before deploying.\nexport const SAMPLE_TYPICAL_MINUTES: Record<string, number> = {\n api: 13,\n admin: 5,\n landing: 4,\n expo: 8,\n};\n\nexport const EAS_DECIDES: DecidedBy = {\n platform: \"EAS\",\n choice: \"build or update\",\n check: \"shiplane status\",\n};\n","import { execFileSync } from \"node:child_process\";\nimport { z } from \"zod\";\n\nimport { systemShell } from \"../adapters/shell/system-shell.adapter\";\n\n/**\n * Contract suites against hosted services run only with RELEASE_CONTRACT_LIVE=1, on a sandbox\n * repository checked out at RELEASE_CONTRACT_REPO: they open pull requests, publish releases and\n * dispatch workflows there.\n */\nexport const LIVE = systemShell.env(\"RELEASE_CONTRACT_LIVE\") === \"1\";\n\n/** The sandbox checkout, refused when unset so a live run never touches this repository. */\nexport const sandbox = () =>\n z\n .string({ message: \"RELEASE_CONTRACT_REPO names a sandbox checkout for live contracts\" })\n .min(1)\n .parse(systemShell.env(\"RELEASE_CONTRACT_REPO\"));\n\n/** Runs git in the sandbox and returns what it printed. */\nexport const inSandbox = (args: string[]) =>\n execFileSync(\"git\", args, { cwd: sandbox(), encoding: \"utf8\" }).trim();\n","import type { BumpLevel, PlannedChangeset, StatusPlan } from \"../domain/changes\";\nimport { nextVersion } from \"../domain/versions\";\n\n/**\n * What `changeset status` answers for these pending changesets, plus the ones a release adds, minus\n * the lines it holds back: every named package moves once, by its biggest bump, up to `ceiling`.\n */\nexport const planFrom =\n (pending: PlannedChangeset[], versions: Record<string, string>) =>\n (added: PlannedChangeset[], held: PlannedChangeset[], ceiling?: BumpLevel): StatusPlan => {\n const heldLines = new Set(\n held.flatMap(({ id, releases }) => releases.map(({ name }) => `${id}:${name}`)),\n );\n const changesets = [...pending, ...added]\n .map((changeset) => ({\n ...changeset,\n releases: changeset.releases.filter(\n ({ name }) => !heldLines.has(`${changeset.id}:${name}`),\n ),\n }))\n .filter(({ releases }) => releases.length > 0);\n const order: BumpLevel[] = [\"major\", \"minor\", \"patch\"];\n const capped = ceiling ? order.slice(order.indexOf(ceiling)) : order;\n const names = [\n ...new Set(changesets.flatMap(({ releases }) => releases.map(({ name }) => name))),\n ];\n return {\n changesets,\n releases: names.map((name) => {\n const lines = changesets.filter(({ releases }) =>\n releases.some((line) => line.name === name),\n );\n const named =\n order.find((candidate) =>\n lines.some(({ releases }) =>\n releases.some((line) => line.name === name && line.type === candidate),\n ),\n ) ?? \"patch\";\n const type = capped.includes(named) ? named : (ceiling ?? named);\n const oldVersion = versions[name] ?? \"0.1.0\";\n return {\n name,\n type,\n oldVersion,\n newVersion: nextVersion(oldVersion, type),\n changesets: lines.map(({ id }) => id),\n };\n }),\n };\n };\n","import { execFileSync, spawnSync } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nimport { systemShell } from \"../adapters/shell/system-shell.adapter\";\n\n/** What the built CLI printed and the code it exited with. */\nexport interface CliRun {\n status: number;\n output: string;\n}\n\nexport interface ConsumerRepository {\n root: string;\n /** The bare repository the checkout pushes to, standing in for GitHub. */\n origin: string;\n write: (file: string, text: string) => void;\n read: (file: string) => string;\n /** Runs git in the checkout, or in the bare origin with `{ in: \"origin\" }`. */\n git: (args: string[], where?: { in: \"origin\" }) => string;\n /** Commits every file as it stands and pushes the branch to the origin. */\n commitAndPush: (title: string) => void;\n /** Runs the built `shiplane` CLI in the checkout, as a person types it. */\n shiplane: (args: string[]) => CliRun;\n remove: () => void;\n}\n\nconst CORE = \"shiplane\";\n\nconst coreDir = (from: string): string => {\n const manifest = path.join(from, \"package.json\");\n if (fs.existsSync(manifest)) {\n const { name } = JSON.parse(fs.readFileSync(manifest, \"utf8\")) as { name?: string };\n if (name === CORE) return from;\n }\n const parent = path.dirname(from);\n if (parent === from) throw new Error(`${CORE} not found above ${import.meta.dirname}`);\n return coreDir(parent);\n};\n\n/** The built CLI, as `pnpm add shiplane` installs it. */\nexport const builtCli = (): string => {\n const cli = path.join(coreDir(import.meta.dirname), \"dist\", \"cli.js\");\n if (!fs.existsSync(cli)) {\n throw new Error(`shiplane is not built: run pnpm turbo run build --filter=${CORE}`);\n }\n return cli;\n};\n\n// No global git config, signing key, token or CI marker leaks in: a run sees only this repository.\nconst LEAKS = new Set([\"GITHUB_ACTIONS\", \"CI\", \"GITHUB_TOKEN\", \"GH_TOKEN\"]);\n\nconst hermeticEnv = (home: string, bin: string): NodeJS.ProcessEnv => ({\n ...Object.fromEntries(Object.entries(process.env).filter(([name]) => !LEAKS.has(name))),\n PATH: [bin, systemShell.env(\"PATH\") ?? \"\"].join(path.delimiter),\n HOME: home,\n GIT_CONFIG_GLOBAL: path.join(home, \".gitconfig\"),\n GIT_CONFIG_NOSYSTEM: \"1\",\n NO_COLOR: \"1\",\n // A fixed date makes each commit's hash depend on its files only, so docs can quote a run.\n GIT_AUTHOR_DATE: \"2026-01-01T00:00:00Z\",\n GIT_COMMITTER_DATE: \"2026-01-01T00:00:00Z\",\n});\n\n// The tools that reach a platform answer offline, so a run that would call one fails at once.\nconst OFFLINE = [\"gh\", \"npm\", \"flyctl\"];\n\nconst offlineTools = (bin: string) => {\n fs.mkdirSync(bin);\n OFFLINE.forEach((tool) => {\n const file = path.join(bin, tool);\n fs.writeFileSync(file, `#!/bin/sh\\necho \"${tool}: offline in this repository\" >&2\\nexit 1\\n`);\n fs.chmodSync(file, 0o755);\n });\n};\n\n/**\n * A repository as a consumer has it: its files, the packages it installed linked in its\n * node_modules, one commit pushed to a local bare origin. gh, npm and flyctl answer offline.\n */\nexport const consumerRepository = ({\n files,\n packages = {},\n branch = \"main\",\n}: {\n files: Record<string, string>;\n /** The branch releases start from, created first and pushed. */\n branch?: string;\n /** Package name to the folder it installs from, such as a plugin's workspace folder. */\n packages?: Record<string, string>;\n}): ConsumerRepository => {\n const dir = fs.mkdtempSync(path.join(os.tmpdir(), \"shiplane-consumer-\"));\n const root = path.join(dir, \"checkout\");\n const origin = path.join(dir, \"origin.git\");\n const home = path.join(dir, \"home\");\n fs.mkdirSync(home);\n fs.writeFileSync(\n path.join(home, \".gitconfig\"),\n \"[user]\\n\\tname = Shiplane Consumer\\n\\temail = consumer@example.com\\n\" +\n \"[commit]\\n\\tgpgsign = false\\n[tag]\\n\\tgpgsign = false\\n[core]\\n\\thooksPath = /dev/null\\n\",\n );\n const bin = path.join(dir, \"bin\");\n offlineTools(bin);\n const env = hermeticEnv(home, bin);\n const git = (args: string[], where?: { in: \"origin\" }) =>\n execFileSync(\"git\", args, {\n cwd: where ? origin : root,\n env,\n stdio: \"pipe\",\n encoding: \"utf8\",\n }).trim();\n const write = (file: string, text: string) => {\n const target = path.join(root, file);\n fs.mkdirSync(path.dirname(target), { recursive: true });\n fs.writeFileSync(target, text);\n };\n\n fs.mkdirSync(root);\n execFileSync(\"git\", [\"init\", \"--quiet\", \"--bare\", `--initial-branch=${branch}`, origin], { env });\n git([\"init\", \"--quiet\", `--initial-branch=${branch}`]);\n git([\"remote\", \"add\", \"origin\", origin]);\n write(\".gitignore\", \"node_modules\\n\");\n Object.entries(files).forEach(([file, text]) => write(file, text));\n Object.entries({ [CORE]: coreDir(import.meta.dirname), ...packages }).forEach(([name, from]) => {\n const link = path.join(root, \"node_modules\", name);\n fs.mkdirSync(path.dirname(link), { recursive: true });\n fs.symlinkSync(from, link, \"dir\");\n });\n const commitAndPush = (title: string) => {\n git([\"add\", \"--all\"]);\n git([\"commit\", \"--quiet\", \"-m\", title]);\n git([\"push\", \"--quiet\", \"origin\", branch]);\n };\n commitAndPush(\"chore: start\");\n\n const cli = builtCli();\n return {\n root,\n origin,\n write,\n read: (file) => fs.readFileSync(path.join(root, file), \"utf8\"),\n git,\n commitAndPush,\n shiplane: (args) => {\n const run = spawnSync(process.execPath, [cli, ...args], {\n cwd: root,\n env,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n return { status: run.status ?? 1, output: `${run.stdout}${run.stderr}` };\n },\n remove: () => fs.rmSync(dir, { recursive: true, force: true }),\n };\n};\n","import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\n/** The public API a test config imports, resolved to source since tests run before any build. */\nexport const SOURCE_ALIASES: Record<string, string> = {\n shiplane: path.resolve(import.meta.dirname, \"../index.ts\"),\n \"shiplane/plugin\": path.resolve(import.meta.dirname, \"../plugin.ts\"),\n \"shiplane/testing\": path.resolve(import.meta.dirname, \"public.ts\"),\n};\n\nexport interface Workspace {\n root: string;\n write: (file: string, text: string) => void;\n read: (file: string) => string;\n exists: (file: string) => boolean;\n remove: () => void;\n}\n\n/** A throwaway repository on disk, one entry per file, removed by `remove()`. */\nexport const createWorkspace = (files: Record<string, string>): Workspace => {\n const root = fs.mkdtempSync(path.join(os.tmpdir(), \"release-workspace-\"));\n const write = (file: string, text: string) => {\n const target = path.join(root, file);\n fs.mkdirSync(path.dirname(target), { recursive: true });\n fs.writeFileSync(target, text);\n };\n Object.entries(files).forEach(([file, text]) => write(file, text));\n return {\n root,\n write,\n read: (file) => fs.readFileSync(path.join(root, file), \"utf8\"),\n exists: (file) => fs.existsSync(path.join(root, file)),\n remove: () => fs.rmSync(root, { recursive: true, force: true }),\n };\n};\n\nex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ACrJH,MAAa,iBAAyC;CACpD,UAAU,KAAK,QAAQ,OAAO,KAAK,SAAS,cAAc;CAC1D,mBAAmB,KAAK,QAAQ,OAAO,KAAK,SAAS,eAAe;CACpE,oBAAoB,KAAK,QAAQ,OAAO,KAAK,SAAS,YAAY;CACnE;;AAWD,MAAa,mBAAmB,UAA6C;CAC3E,MAAM,OAAO,GAAG,YAAY,KAAK,KAAK,GAAG,QAAQ,EAAE,qBAAqB,CAAC;CACzE,MAAM,SAAS,MAAc,SAAiB;EAC5C,MAAM,SAAS,KAAK,KAAK,MAAM,KAAK;AACpC,KAAG,UAAU,KAAK,QAAQ,OAAO,EAAE,EAAE,WAAW,MAAM,CAAC;AACvD,KAAG,cAAc,QAAQ,KAAK;;AAEhC,QAAO,QAAQ,MAAM,CAAC,SAAS,CAAC,MAAM,UAAU,MAAM,MAAM,KAAK,CAAC;AAClE,QAAO;EACL;EACA;EACA,OAAO,SAAS,GAAG,aAAa,KAAK,KAAK,MAAM,KAAK,EAAE,OAAO;EAC9D,SAAS,SAAS,GAAG,WAAW,KAAK,KAAK,MAAM,KAAK,CAAC;EACtD,cAAc,GAAG,OAAO,MAAM;GAAE,WAAW;GAAM,OAAO;GAAM,CAAC;EAChE;;AAGH,MAAa,eAAe,MAAc,UAAU,SAAS,QAAgB,EAAE,KAC7E,KAAK,UAAU;CAAE;CAAM;CAAS,GAAG;CAAO,EAAE,MAAM,EAAE"}
@@ -94,6 +94,10 @@ const mobileApp = ({ name, mobileDistribution }) => ({
94
94
  };
95
95
  },
96
96
  decide: (context, input) => context.open(mobileDistribution).decide(context, input),
97
+ live: async (context, input) => {
98
+ const port = context.open(mobileDistribution);
99
+ return port.live ? port.live(context, input) : true;
100
+ },
97
101
  health: async (context, input) => {
98
102
  const port = context.open(mobileDistribution);
99
103
  return port.health ? port.health(context, input) : null;
@@ -118,4 +122,4 @@ const webApp = ({ name, staticHosting }) => deliveryModule("web-app", staticHost
118
122
  //#endregion
119
123
  export { releaseFlow as a, findUnset as c, backendService as i, isEnvVarName as l, publishedPackage as n, ENV_VAR_NAME as o, mobileApp as r, EnvToCheck as s, webApp as t };
120
124
 
121
- //# sourceMappingURL=web-app.module-Cg3SYqSo.js.map
125
+ //# sourceMappingURL=web-app.module-BB1fY1Kd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-app.module-Cg3SYqSo.js","names":["#all","#perEnvironment","#names"],"sources":["../src/domain/checkEnvBeforeDeploy.ts","../src/application/releaseFlow.ts","../src/modules/deliveryModule.ts","../src/modules/backend-service/backend-service.module.ts","../src/modules/mobile-app/mobile-app.module.ts","../src/modules/published-package/published-package.module.ts","../src/modules/web-app/web-app.module.ts"],"sourcesContent":["import type { Environment } from \"./environment\";\n\n/** A name an app reads from its environment, as platforms store it: `SENTRY_DSN`. */\nexport type EnvVarName = string & { readonly brand: \"EnvVarName\" };\n\n/** UPPER_SNAKE: a capital letter, then capitals, digits or underscores. */\nexport const ENV_VAR_NAME = /^[A-Z][A-Z0-9_]*$/;\n\nexport const isEnvVarName = (text: string): text is EnvVarName => ENV_VAR_NAME.test(text);\n\n/** As a unit file writes it: one list for every environment, or `all` plus a list per environment. */\nexport type EnvToCheckInput =\n | readonly EnvVarName[]\n | ({ all?: readonly EnvVarName[] } & Partial<Record<Environment, readonly EnvVarName[]>>);\n\n/** The names a deploy checks on the platform before it ships, per environment. */\nexport class EnvToCheck {\n readonly #all: readonly EnvVarName[];\n readonly #perEnvironment: Partial<Record<Environment, readonly EnvVarName[]>>;\n\n constructor(input: EnvToCheckInput) {\n if (isList(input)) {\n this.#all = input;\n this.#perEnvironment = {};\n return;\n }\n const { all = [], ...perEnvironment } = input;\n this.#all = all;\n this.#perEnvironment = perEnvironment;\n }\n\n /** `all`, then that environment's own names. */\n for(environment: Environment): ReadonlySet<EnvVarName> {\n return new Set([...this.#all, ...(this.#perEnvironment[environment] ?? [])]);\n }\n\n /** Names in `all` that an environment lists again. */\n listedTwice(): EnvVarName[] {\n const extras = new Set(Object.values(this.#perEnvironment).flat());\n return [...new Set(this.#all)].filter((name) => extras.has(name));\n }\n}\n\nconst isList = (input: EnvToCheckInput): input is readonly EnvVarName[] => Array.isArray(input);\n\n/** Names a deploy checks that the platform does not hold. */\nexport class UnsetEnvVars {\n readonly #names: readonly EnvVarName[];\n\n constructor(names: readonly EnvVarName[]) {\n this.#names = names;\n }\n\n isEmpty(): boolean {\n return this.#names.length === 0;\n }\n\n names(): readonly EnvVarName[] {\n return this.#names;\n }\n}\n\nexport const findUnset = ({\n expected,\n setOnPlatform,\n}: {\n expected: ReadonlySet<EnvVarName>;\n setOnPlatform: ReadonlySet<EnvVarName>;\n}): UnsetEnvVars => new UnsetEnvVars([...expected].filter((name) => !setOnPlatform.has(name)));\n","import type { Approval } from \"../domain/releasePr\";\nimport type { ReleaseFlow } from \"../modules/module\";\nimport type { ServiceAdapter } from \"../ports/adapter.port\";\nimport type { CiPipelinePort } from \"../ports/ci-pipeline.port\";\nimport type { CodeHostPort } from \"../ports/code-host.port\";\nimport type { SourceControlPort } from \"../ports/source-control.port\";\nimport type { VersioningPort } from \"../ports/versioning.port\";\n\n/** How the release itself runs, given an adapter for each port it runs on. */\nexport const releaseFlow = (ports: {\n sourceControl: ServiceAdapter<SourceControlPort>;\n codeHost: ServiceAdapter<CodeHostPort>;\n ciPipeline: ServiceAdapter<CiPipelinePort>;\n versioning: ServiceAdapter<VersioningPort>;\n /** \"required\" when someone else approves the release PR; \"none\", the default, merges it here. */\n approval?: Approval;\n}): ReleaseFlow => ({ type: \"flow\", ...ports, approval: ports.approval ?? \"none\" });\n","import type { DeliveryAdapter } from \"../ports/adapter.port\";\nimport type { Delivery } from \"../ports/delivery.port\";\nimport type { ReleaseModule } from \"./module\";\n\n/** What every module of apps takes besides its adapter: a name, when two of a kind sit side by side. */\nexport interface Named {\n /** What an app's unit file names; the module's kind by default. */\n name?: string;\n}\n\n/** The stages every delivery adapter answers: its settings, where a tag lands and its jobs. */\nexport const deliveryModule = <Port extends Delivery & { capability: string }>(\n kind: string,\n adapter: DeliveryAdapter<Port>,\n name = kind,\n): ReleaseModule => ({\n type: \"module\",\n name,\n kind,\n provider: adapter.name,\n settings: adapter.settings,\n adapters: [adapter],\n decidedBy: adapter.decidedBy,\n typicalMinutes: adapter.typicalMinutes,\n ...(adapter.env ? { env: adapter.env } : {}),\n requirements: (apps) => apps.flatMap((unit) => adapter.requirements?.(unit) ?? []),\n ship: ({ open }, input) => {\n const port = open(adapter);\n return { where: port.describe(input), jobs: port.jobs(input) };\n },\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { ServerHostingPort } from \"../../ports/server-hosting.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A long-lived service, such as an API: deployed from its tag, recorded with the code host. */\nexport const backendService = ({\n name,\n serverHosting,\n}: Named & { serverHosting: DeliveryAdapter<ServerHostingPort> }): ReleaseModule =>\n deliveryModule(\"backend-service\", serverHosting, name);\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { MobileDistributionPort } from \"../../ports/mobile-distribution.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/**\n * A mobile app: its distribution decides between a store build and an over-the-air update, adds to\n * the release PR, and says how a version does before it is promoted.\n */\nexport const mobileApp = ({\n name,\n mobileDistribution,\n}: Named & { mobileDistribution: DeliveryAdapter<MobileDistributionPort> }): ReleaseModule => ({\n ...deliveryModule(\"mobile-app\", mobileDistribution, name),\n versionFiles: (unit, units, open) => open(mobileDistribution).versionFiles?.(unit, units) ?? [],\n version: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.beforeVersion\n ? port.beforeVersion(context, input)\n : { added: [], writes: [], summary: [], onMerge: \"\" };\n },\n decide: (context, input) => context.open(mobileDistribution).decide(context, input),\n health: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.health ? port.health(context, input) : null;\n },\n inspect: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.inspect ? port.inspect(context, input) : undefined;\n },\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { PackageRegistryPort } from \"../../ports/package-registry.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A package others install: its registry, not deploy records, knows what is out. */\nexport const publishedPackage = ({\n name,\n packageRegistry,\n}: Named & { packageRegistry: DeliveryAdapter<PackageRegistryPort> }): ReleaseModule => ({\n ...deliveryModule(\"published-package\", packageRegistry, name),\n decide: (context, input) => context.open(packageRegistry).decide(context, input),\n live: (context, input) => context.open(packageRegistry).live(context, input),\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { StaticHostingPort } from \"../../ports/static-hosting.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A static site, built against the environment it ships to. */\nexport const webApp = ({\n name,\n staticHosting,\n}: Named & { staticHosting: DeliveryAdapter<StaticHostingPort> }): ReleaseModule =>\n deliveryModule(\"web-app\", staticHosting, name);\n"],"mappings":";;AAMA,MAAa,eAAe;AAE5B,MAAa,gBAAgB,SAAqC,aAAa,KAAK,KAAK;;AAQzF,IAAa,aAAb,MAAwB;CACtB;CACA;CAEA,YAAY,OAAwB;AAClC,MAAI,OAAO,MAAM,EAAE;AACjB,SAAA,MAAY;AACZ,SAAA,iBAAuB,EAAE;AACzB;;EAEF,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,mBAAmB;AACxC,QAAA,MAAY;AACZ,QAAA,iBAAuB;;;CAIzB,IAAI,aAAmD;AACrD,SAAO,IAAI,IAAI,CAAC,GAAG,MAAA,KAAW,GAAI,MAAA,eAAqB,gBAAgB,EAAE,CAAE,CAAC;;;CAI9E,cAA4B;EAC1B,MAAM,SAAS,IAAI,IAAI,OAAO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I,EAAE;CAC/F,SAAS,OAAO,SAAS,UAAU;EACjC,MAAM,OAAO,QAAQ,KAAK,mBAAmB;AAC7C,SAAO,KAAK,gBACR,KAAK,cAAc,SAAS,MAAM,GAClC;GAAE,OAAO,EAAE;GAAE,QAAQ,EAAE;GAAE,SAAS,EAAE;GAAE,SAAS;GAAI;;CAEzD,SAAS,SAAS,UAAU,QAAQ,KAAK,mBAAmB,CAAC,OAAO,SAAS,MAAM;CACnF,QAAQ,OAAO,SAAS,UAAU;EAChC,MAAM,OAAO,QAAQ,KAAK,mBAAmB;AAC7C,SAAO,KAAK,SAAS,KAAK,OAAO,SAAS,MAAM,GAAG;;CAErD,SAAS,OAAO,SAAS,UAAU;EACjC,MAAM,OAAO,QAAQ,KAAK,mBAAmB;AAC7C,SAAO,KAAK,UAAU,KAAK,QAAQ,SAAS,MAAM,GAAG,KAAA;;CAExD;;;;ACxBD,MAAa,oBAAoB,EAC/B,MACA,uBACuF;CACvF,GAAG,eAAe,qBAAqB,iBAAiB,KAAK;CAC7D,SAAS,SAAS,UAAU,QAAQ,KAAK,gBAAgB,CAAC,OAAO,SAAS,MAAM;CAChF,OAAO,SAAS,UAAU,QAAQ,KAAK,gBAAgB,CAAC,KAAK,SAAS,MAAM;CAC7E;;;;ACPD,MAAa,UAAU,EACrB,MACA,oBAEA,eAAe,WAAW,eAAe,KAAK"}
1
+ {"version":3,"file":"web-app.module-BB1fY1Kd.js","names":["#all","#perEnvironment","#names"],"sources":["../src/domain/checkEnvBeforeDeploy.ts","../src/application/releaseFlow.ts","../src/modules/deliveryModule.ts","../src/modules/backend-service/backend-service.module.ts","../src/modules/mobile-app/mobile-app.module.ts","../src/modules/published-package/published-package.module.ts","../src/modules/web-app/web-app.module.ts"],"sourcesContent":["import type { Environment } from \"./environment\";\n\n/** A name an app reads from its environment, as platforms store it: `SENTRY_DSN`. */\nexport type EnvVarName = string & { readonly brand: \"EnvVarName\" };\n\n/** UPPER_SNAKE: a capital letter, then capitals, digits or underscores. */\nexport const ENV_VAR_NAME = /^[A-Z][A-Z0-9_]*$/;\n\nexport const isEnvVarName = (text: string): text is EnvVarName => ENV_VAR_NAME.test(text);\n\n/** As a unit file writes it: one list for every environment, or `all` plus a list per environment. */\nexport type EnvToCheckInput =\n | readonly EnvVarName[]\n | ({ all?: readonly EnvVarName[] } & Partial<Record<Environment, readonly EnvVarName[]>>);\n\n/** The names a deploy checks on the platform before it ships, per environment. */\nexport class EnvToCheck {\n readonly #all: readonly EnvVarName[];\n readonly #perEnvironment: Partial<Record<Environment, readonly EnvVarName[]>>;\n\n constructor(input: EnvToCheckInput) {\n if (isList(input)) {\n this.#all = input;\n this.#perEnvironment = {};\n return;\n }\n const { all = [], ...perEnvironment } = input;\n this.#all = all;\n this.#perEnvironment = perEnvironment;\n }\n\n /** `all`, then that environment's own names. */\n for(environment: Environment): ReadonlySet<EnvVarName> {\n return new Set([...this.#all, ...(this.#perEnvironment[environment] ?? [])]);\n }\n\n /** Names in `all` that an environment lists again. */\n listedTwice(): EnvVarName[] {\n const extras = new Set(Object.values(this.#perEnvironment).flat());\n return [...new Set(this.#all)].filter((name) => extras.has(name));\n }\n}\n\nconst isList = (input: EnvToCheckInput): input is readonly EnvVarName[] => Array.isArray(input);\n\n/** Names a deploy checks that the platform does not hold. */\nexport class UnsetEnvVars {\n readonly #names: readonly EnvVarName[];\n\n constructor(names: readonly EnvVarName[]) {\n this.#names = names;\n }\n\n isEmpty(): boolean {\n return this.#names.length === 0;\n }\n\n names(): readonly EnvVarName[] {\n return this.#names;\n }\n}\n\nexport const findUnset = ({\n expected,\n setOnPlatform,\n}: {\n expected: ReadonlySet<EnvVarName>;\n setOnPlatform: ReadonlySet<EnvVarName>;\n}): UnsetEnvVars => new UnsetEnvVars([...expected].filter((name) => !setOnPlatform.has(name)));\n","import type { Approval } from \"../domain/releasePr\";\nimport type { ReleaseFlow } from \"../modules/module\";\nimport type { ServiceAdapter } from \"../ports/adapter.port\";\nimport type { CiPipelinePort } from \"../ports/ci-pipeline.port\";\nimport type { CodeHostPort } from \"../ports/code-host.port\";\nimport type { SourceControlPort } from \"../ports/source-control.port\";\nimport type { VersioningPort } from \"../ports/versioning.port\";\n\n/** How the release itself runs, given an adapter for each port it runs on. */\nexport const releaseFlow = (ports: {\n sourceControl: ServiceAdapter<SourceControlPort>;\n codeHost: ServiceAdapter<CodeHostPort>;\n ciPipeline: ServiceAdapter<CiPipelinePort>;\n versioning: ServiceAdapter<VersioningPort>;\n /** \"required\" when someone else approves the release PR; \"none\", the default, merges it here. */\n approval?: Approval;\n}): ReleaseFlow => ({ type: \"flow\", ...ports, approval: ports.approval ?? \"none\" });\n","import type { DeliveryAdapter } from \"../ports/adapter.port\";\nimport type { Delivery } from \"../ports/delivery.port\";\nimport type { ReleaseModule } from \"./module\";\n\n/** What every module of apps takes besides its adapter: a name, when two of a kind sit side by side. */\nexport interface Named {\n /** What an app's unit file names; the module's kind by default. */\n name?: string;\n}\n\n/** The stages every delivery adapter answers: its settings, where a tag lands and its jobs. */\nexport const deliveryModule = <Port extends Delivery & { capability: string }>(\n kind: string,\n adapter: DeliveryAdapter<Port>,\n name = kind,\n): ReleaseModule => ({\n type: \"module\",\n name,\n kind,\n provider: adapter.name,\n settings: adapter.settings,\n adapters: [adapter],\n decidedBy: adapter.decidedBy,\n typicalMinutes: adapter.typicalMinutes,\n ...(adapter.env ? { env: adapter.env } : {}),\n requirements: (apps) => apps.flatMap((unit) => adapter.requirements?.(unit) ?? []),\n ship: ({ open }, input) => {\n const port = open(adapter);\n return { where: port.describe(input), jobs: port.jobs(input) };\n },\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { ServerHostingPort } from \"../../ports/server-hosting.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A long-lived service, such as an API: deployed from its tag, recorded with the code host. */\nexport const backendService = ({\n name,\n serverHosting,\n}: Named & { serverHosting: DeliveryAdapter<ServerHostingPort> }): ReleaseModule =>\n deliveryModule(\"backend-service\", serverHosting, name);\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { MobileDistributionPort } from \"../../ports/mobile-distribution.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/**\n * A mobile app: its distribution decides between a store build and an over-the-air update, adds to\n * the release PR, and says how a version does before it is promoted.\n */\nexport const mobileApp = ({\n name,\n mobileDistribution,\n}: Named & { mobileDistribution: DeliveryAdapter<MobileDistributionPort> }): ReleaseModule => ({\n ...deliveryModule(\"mobile-app\", mobileDistribution, name),\n versionFiles: (unit, units, open) => open(mobileDistribution).versionFiles?.(unit, units) ?? [],\n version: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.beforeVersion\n ? port.beforeVersion(context, input)\n : { added: [], writes: [], summary: [], onMerge: \"\" };\n },\n decide: (context, input) => context.open(mobileDistribution).decide(context, input),\n // A platform that cannot tell keeps the unit greyed, as before.\n live: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.live ? port.live(context, input) : true;\n },\n health: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.health ? port.health(context, input) : null;\n },\n inspect: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.inspect ? port.inspect(context, input) : undefined;\n },\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { PackageRegistryPort } from \"../../ports/package-registry.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A package others install: its registry, not deploy records, knows what is out. */\nexport const publishedPackage = ({\n name,\n packageRegistry,\n}: Named & { packageRegistry: DeliveryAdapter<PackageRegistryPort> }): ReleaseModule => ({\n ...deliveryModule(\"published-package\", packageRegistry, name),\n decide: (context, input) => context.open(packageRegistry).decide(context, input),\n live: (context, input) => context.open(packageRegistry).live(context, input),\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { StaticHostingPort } from \"../../ports/static-hosting.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A static site, built against the environment it ships to. */\nexport const webApp = ({\n name,\n staticHosting,\n}: Named & { staticHosting: DeliveryAdapter<StaticHostingPort> }): ReleaseModule =>\n deliveryModule(\"web-app\", staticHosting, name);\n"],"mappings":";;AAMA,MAAa,eAAe;AAE5B,MAAa,gBAAgB,SAAqC,aAAa,KAAK,KAAK;;AAQzF,IAAa,aAAb,MAAwB;CACtB;CACA;CAEA,YAAY,OAAwB;AAClC,MAAI,OAAO,MAAM,EAAE;AACjB,SAAA,MAAY;AACZ,SAAA,iBAAuB,EAAE;AACzB;;EAEF,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,mBAAmB;AACxC,QAAA,MAAY;AACZ,QAAA,iBAAuB;;;CAIzB,IAAI,aAAmD;AACrD,SAAO,IAAI,IAAI,CAAC,GAAG,MAAA,KAAW,GAAI,MAAA,eAAqB,gBAAgB,EAAE,CAAE,CAAC;;;CAI9E,cAA4B;EAC1B,MAAM,SAAS,IAAI,IAAI,OAAO,OAAO,MAAA,eAAqB,CAAC,MAAM,CAAC;AAClE,SAAO,CAAC,GAAG,IAAI,IAAI,MAAA,IAAU,CAAC,CAAC,QAAQ,SAAS,OAAO,IAAI,KAAK,CAAC;;;AAIrE,MAAM,UAAU,UAA2D,MAAM,QAAQ,MAAM;;AAG/F,IAAa,eAAb,MAA0B;CACxB;CAEA,YAAY,OAA8B;AACxC,QAAA,QAAc;;CAGhB,UAAmB;AACjB,SAAO,MAAA,MAAY,WAAW;;CAGhC,QAA+B;AAC7B,SAAO,MAAA;;;AAIX,MAAa,aAAa,EACxB,UACA,oBAIkB,IAAI,aAAa,CAAC,GAAG,SAAS,CAAC,QAAQ,SAAS,CAAC,cAAc,IAAI,KAAK,CAAC,CAAC;;;;AC3D9F,MAAa,e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;AAC7C,SAAO,KAAK,SAAS,KAAK,OAAO,SAAS,MAAM,GAAG;;CAErD,SAAS,OAAO,SAAS,UAAU;EACjC,MAAM,OAAO,QAAQ,KAAK,mBAAmB;AAC7C,SAAO,KAAK,UAAU,KAAK,QAAQ,SAAS,MAAM,GAAG,KAAA;;CAExD;;;;AC7BD,MAAa,oBAAoB,EAC/B,MACA,uBACuF;CACvF,GAAG,eAAe,qBAAqB,iBAAiB,KAAK;CAC7D,SAAS,SAAS,UAAU,QAAQ,KAAK,gBAAgB,CAAC,OAAO,SAAS,MAAM;CAChF,OAAO,SAAS,UAAU,QAAQ,KAAK,gBAAgB,CAAC,KAAK,SAAS,MAAM;CAC7E;;;;ACPD,MAAa,UAAU,EACrB,MACA,oBAEA,eAAe,WAAW,eAAe,KAAK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shiplane",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Release and deploy a monorepo in one command: finds what changed, versions, tags and ships each app through plugins (npm, Fly.io, EAS, Cloudflare Pages).",
5
5
  "keywords": [
6
6
  "release",