shiplane 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +133 -0
- package/dist/budget-BqtW-Ekk.js +355 -0
- package/dist/budget-BqtW-Ekk.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +548 -0
- package/dist/cli.js.map +1 -0
- package/dist/display-IqkJ6uCw.js +96 -0
- package/dist/display-IqkJ6uCw.js.map +1 -0
- package/dist/index-D4qsXAis.d.ts +214 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/issues-TcWtMTv5.js +6 -0
- package/dist/issues-TcWtMTv5.js.map +1 -0
- package/dist/memory.d.ts +2 -0
- package/dist/memory.js +2 -0
- package/dist/package-registry.fake-CC37ptzf.d.ts +444 -0
- package/dist/package-registry.fake-Ciqc4ujx.js +633 -0
- package/dist/package-registry.fake-Ciqc4ujx.js.map +1 -0
- package/dist/perEnv-B7AiYnW_.js +11 -0
- package/dist/perEnv-B7AiYnW_.js.map +1 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/plugin.js +8 -0
- package/dist/readStatus-YTZXH_Hh.js +3789 -0
- package/dist/readStatus-YTZXH_Hh.js.map +1 -0
- package/dist/shell-server-hosting.adapter-DobfDqFm.js +49 -0
- package/dist/shell-server-hosting.adapter-DobfDqFm.js.map +1 -0
- package/dist/src-CGASfBy2.js +32 -0
- package/dist/src-CGASfBy2.js.map +1 -0
- package/dist/static-hosting.port-mknLsxwR.d.ts +684 -0
- package/dist/tags-Bn3JrgPI.d.ts +19 -0
- package/dist/testing.d.ts +585 -0
- package/dist/testing.js +735 -0
- package/dist/testing.js.map +1 -0
- package/dist/web-app.module-6KrXIU7j.js +76 -0
- package/dist/web-app.module-6KrXIU7j.js.map +1 -0
- package/package.json +63 -9
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/domain/tags.d.ts
|
|
2
|
+
/** How a tag names a unit's version unless the config says otherwise. */
|
|
3
|
+
declare const DEFAULT_TAG_FORMAT = "{name}@{version}";
|
|
4
|
+
/** A unit's tag for a version, through a format like `v{version}` or `{name}--v{version}`. */
|
|
5
|
+
declare const tagName: (app: string, version: string, format?: string) => string;
|
|
6
|
+
interface ReleaseTag {
|
|
7
|
+
/** The unit's name. */
|
|
8
|
+
app: string;
|
|
9
|
+
version: string;
|
|
10
|
+
tag: string;
|
|
11
|
+
sha: string;
|
|
12
|
+
needsTag: boolean;
|
|
13
|
+
needsNotes: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** A release pull request's subject: `chore(api): release v0.0.4`, or `chore(release): ...` for several. */
|
|
16
|
+
declare const isReleaseSubject: (subject: string) => boolean;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { tagName as i, ReleaseTag as n, isReleaseSubject as r, DEFAULT_TAG_FORMAT as t };
|
|
19
|
+
//# sourceMappingURL=tags-Bn3JrgPI.d.ts.map
|
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import { $ as OpenPr, C as Clock, D as StepPlace, E as Prompter, F as ShellResult, G as DeployPath, I as CiPipelinePort, L as CodeHostPort, N as RunOptions, O as SourceControlPort, P as Shell, S as Choice, T as Progress, X as Approval, a as VersioningPort, at as UnreleasedApp, c as DeliveryAdapter, ct as ReleaseUnit, et as ReleaseStep, ft as Mood, i as MobileDistributionPort, it as UnitRef, l as ServiceAdapter, lt as DisplayChoice, mt as Environment, n as ServerHostingPort, nt as PlannedChangeset, p as Delivery, r as PackageRegistryPort, rt as StatusPlan, st as splitChangesets, t as StaticHostingPort, tt as AppBump, w as Output, x as VersionContribution, z as IssueRef } from "./static-hosting.port-mknLsxwR.js";
|
|
2
|
+
import { b as ReleaseModule, g as Feature, v as Open, y as ReleaseFlow } from "./index-D4qsXAis.js";
|
|
3
|
+
import { a as VersioningFake, c as ciPipelineFake, d as codeHostFake, f as SourceControlFake, i as serverHostingFake, l as CodeHostFake, n as mobileDistributionFake, o as versioningFake, p as sourceControlFake, r as staticHostingFake, s as CiPipelineFake, t as packageRegistryFake, u as HostEvent } from "./package-registry.fake-CC37ptzf.js";
|
|
4
|
+
import { n as ReleaseTag } from "./tags-Bn3JrgPI.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import * as _$vitest from "vitest";
|
|
7
|
+
|
|
8
|
+
//#region src/testing/deliveryContract.d.ts
|
|
9
|
+
/** One adapter of a port, with settings an app's unit file could hold for it. */
|
|
10
|
+
interface ContractCase<Port extends Delivery & {
|
|
11
|
+
capability: string;
|
|
12
|
+
}> {
|
|
13
|
+
adapter: DeliveryAdapter<Port>;
|
|
14
|
+
settings: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/adapters/server-hosting/server-hosting.contract.d.ts
|
|
18
|
+
/** What every server host does, whatever its provider. */
|
|
19
|
+
declare const serverHostingContract: (cases: ContractCase<ServerHostingPort>[]) => void;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/adapters/static-hosting/static-hosting.contract.d.ts
|
|
22
|
+
/** What every static host does, whatever its provider. */
|
|
23
|
+
declare const staticHostingContract: (cases: ContractCase<StaticHostingPort>[]) => void;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/adapters/mobile-distribution/mobile-distribution.contract.d.ts
|
|
26
|
+
/** What every mobile distribution does, whatever its provider. */
|
|
27
|
+
declare const mobileDistributionContract: (cases: ContractCase<MobileDistributionPort>[]) => void;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/adapters/package-registry/package-registry.contract.d.ts
|
|
30
|
+
/** What every package registry does, whatever its provider. */
|
|
31
|
+
declare const packageRegistryContract: (cases: ContractCase<PackageRegistryPort>[]) => void;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/adapters/source-control/source-control.contract.d.ts
|
|
34
|
+
/** A repository on main with one commit, and the ways a test arranges it beyond the port. */
|
|
35
|
+
interface SourceControlSubject {
|
|
36
|
+
port: SourceControlPort;
|
|
37
|
+
/** The commit main is on. */
|
|
38
|
+
head: () => Promise<string>;
|
|
39
|
+
/** Writes a file the repository does not track yet. */
|
|
40
|
+
change: (file: string, text: string) => Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
/** What every source control does, whatever its provider. */
|
|
43
|
+
declare const sourceControlContract: (name: string, subject: () => Promise<SourceControlSubject>) => _$vitest.SuiteCollector<object>;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/adapters/code-host/code-host.contract.d.ts
|
|
46
|
+
/** A repository on a code host, and the ways a test arranges it beyond the port. */
|
|
47
|
+
interface CodeHostSubject {
|
|
48
|
+
port: CodeHostPort;
|
|
49
|
+
/** A branch the host can open a pull request from, pushed with one commit on it. */
|
|
50
|
+
branch: (name: string) => Promise<string>;
|
|
51
|
+
/** A tag the host can publish release notes for. */
|
|
52
|
+
tag: () => Promise<string>;
|
|
53
|
+
/** An issue or pull request comments can go on. */
|
|
54
|
+
issue: IssueRef;
|
|
55
|
+
}
|
|
56
|
+
/** What every code host does, whatever its provider. */
|
|
57
|
+
declare const codeHostContract: (name: string, subject: () => Promise<CodeHostSubject>) => _$vitest.SuiteCollector<object>;
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/adapters/ci-pipeline/ci-pipeline.contract.d.ts
|
|
60
|
+
/** A CI pipeline, and the ways a test reads it beyond the port. */
|
|
61
|
+
interface CiPipelineSubject {
|
|
62
|
+
port: CiPipelinePort;
|
|
63
|
+
/** A workflow that exists and has never run. */
|
|
64
|
+
idle: string;
|
|
65
|
+
}
|
|
66
|
+
/** What every CI pipeline does, whatever its provider. */
|
|
67
|
+
declare const ciPipelineContract: (name: string, subject: () => Promise<CiPipelineSubject>) => _$vitest.SuiteCollector<object>;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/adapters/versioning/versioning.contract.d.ts
|
|
70
|
+
/** A workspace with one package, and the ways a test arranges it beyond the port. */
|
|
71
|
+
interface VersioningSubject {
|
|
72
|
+
port: VersioningPort;
|
|
73
|
+
/** The package the workspace holds, and its folder. */
|
|
74
|
+
workspace: {
|
|
75
|
+
name: string;
|
|
76
|
+
folder: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** What every versioning does, whatever its provider. */
|
|
80
|
+
declare const versioningContract: (name: string, subject: () => Promise<VersioningSubject>) => _$vitest.SuiteCollector<object>;
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/adapters/shell/__fakes__/shell.fake.d.ts
|
|
83
|
+
interface ShellCall {
|
|
84
|
+
command: string;
|
|
85
|
+
args: string[];
|
|
86
|
+
cwd?: string;
|
|
87
|
+
env?: Record<string, string>;
|
|
88
|
+
}
|
|
89
|
+
/** A shell that runs nothing: it keeps every call and answers from what was seeded. */
|
|
90
|
+
declare class RecordingShell implements Shell {
|
|
91
|
+
readonly calls: ShellCall[];
|
|
92
|
+
private answers;
|
|
93
|
+
private variables;
|
|
94
|
+
seedEnv(variables: Record<string, string>): this;
|
|
95
|
+
env: (name: string) => string;
|
|
96
|
+
/** Answers every call whose `command args` line starts with `prefix`. */
|
|
97
|
+
seed(prefix: string, result: Partial<ShellResult>): this;
|
|
98
|
+
/** Answers the next call starting with `prefix` only, ahead of what `seed` answers. */
|
|
99
|
+
seedOnce(prefix: string, result: Partial<ShellResult>): this;
|
|
100
|
+
private answer;
|
|
101
|
+
capture: (command: string, args: readonly string[], options?: RunOptions) => Promise<ShellResult>;
|
|
102
|
+
attach: (command: string, args: readonly string[], options?: RunOptions) => Promise<number>;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/adapters/terminal/__fakes__/terminal.fake.d.ts
|
|
106
|
+
/** Everything the CLI printed, in order, without colours. */
|
|
107
|
+
declare class MemoryOutput implements Output {
|
|
108
|
+
readonly lines: string[];
|
|
109
|
+
line: (text?: string) => void;
|
|
110
|
+
get text(): string;
|
|
111
|
+
}
|
|
112
|
+
type Answer = boolean | string | string[] | null;
|
|
113
|
+
/** A person who answers from a script, in order; every question asked is kept. */
|
|
114
|
+
declare class ScriptedPrompter implements Prompter {
|
|
115
|
+
readonly interactive: boolean;
|
|
116
|
+
readonly asked: string[];
|
|
117
|
+
/** The answer each choice question offered first, by question. */
|
|
118
|
+
readonly initials: Record<string, unknown>;
|
|
119
|
+
/** The choices each select question offered, by question. */
|
|
120
|
+
readonly choices: Record<string, Choice<string>[]>;
|
|
121
|
+
private answers;
|
|
122
|
+
constructor(interactive?: boolean);
|
|
123
|
+
answer(...answers: Answer[]): this;
|
|
124
|
+
private next;
|
|
125
|
+
confirm: (question: string, initial?: boolean) => Promise<boolean>;
|
|
126
|
+
typed: (question: string, word: string) => Promise<boolean>;
|
|
127
|
+
select: <Value extends string>(message: string, choices: Choice<Value>[], initial?: Value) => Promise<Awaited<Value> | null>;
|
|
128
|
+
multiselect: <Value extends string>(message: string, _choices: Choice<Value>[]) => Promise<Value[] | null>;
|
|
129
|
+
text: (message: string) => Promise<string | null>;
|
|
130
|
+
/** No key is ever pressed: every wait times out, unless keys were queued with `press`. */
|
|
131
|
+
private keys;
|
|
132
|
+
press(...keys: string[]): this;
|
|
133
|
+
waitForKey: () => Promise<string | null>;
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/ports/files.port.d.ts
|
|
137
|
+
/** The repository's files, by path relative to its root. */
|
|
138
|
+
interface Files {
|
|
139
|
+
exists: (file: string) => boolean;
|
|
140
|
+
read: (file: string) => string | null;
|
|
141
|
+
write: (file: string, text: string) => void;
|
|
142
|
+
remove: (file: string) => void;
|
|
143
|
+
/** Entries directly in a folder; empty when it does not exist. */
|
|
144
|
+
list: (dir: string) => string[];
|
|
145
|
+
/** The folders directly in a folder, by name; empty when it does not exist. */
|
|
146
|
+
folders: (dir: string) => string[];
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/adapters/files/node-files.adapter.d.ts
|
|
150
|
+
/** The repository on disk, under `root`. */
|
|
151
|
+
declare const nodeFiles: (root: string) => Files;
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/adapters/shell/system-shell.adapter.d.ts
|
|
154
|
+
declare const systemShell: Shell;
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/modules/suggest.d.ts
|
|
157
|
+
/** An adapter of any delivery port, as `init` offers them. */
|
|
158
|
+
type AnyDeliveryAdapter = DeliveryAdapter<ServerHostingPort> | DeliveryAdapter<StaticHostingPort> | DeliveryAdapter<MobileDistributionPort> | DeliveryAdapter<PackageRegistryPort>;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/ports/manifest.port.d.ts
|
|
161
|
+
interface Manifest {
|
|
162
|
+
name: string;
|
|
163
|
+
version: string;
|
|
164
|
+
}
|
|
165
|
+
/** Reads a unit's name and version from its folder: package.json today, pom.xml or Cargo.toml later. */
|
|
166
|
+
interface ManifestReader {
|
|
167
|
+
read: (root: string, dir: string) => Manifest | null;
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/application/config/problem.d.ts
|
|
171
|
+
/** Something wrong in the config, said where a person can fix it. */
|
|
172
|
+
interface ConfigProblem {
|
|
173
|
+
/** Relative to the repository root. */
|
|
174
|
+
file: string;
|
|
175
|
+
line?: number;
|
|
176
|
+
message: string;
|
|
177
|
+
hint?: string;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/application/config/loadRelease.d.ts
|
|
181
|
+
/** A file still under its name from before shiplane, and the name it takes. */
|
|
182
|
+
interface Rename {
|
|
183
|
+
from: string;
|
|
184
|
+
to: string;
|
|
185
|
+
}
|
|
186
|
+
/** The release as composed: the flow, the modules in release order, the features, then the apps. */
|
|
187
|
+
interface Release {
|
|
188
|
+
root: string;
|
|
189
|
+
flow: ReleaseFlow;
|
|
190
|
+
/** What gets released, in release order. */
|
|
191
|
+
modules: ReleaseModule[];
|
|
192
|
+
/** What happens around a release, in the order they run. */
|
|
193
|
+
features: Feature[];
|
|
194
|
+
/** In release order: by module, then by name inside a module. The first is the Latest release. */
|
|
195
|
+
units: ReleaseUnit[];
|
|
196
|
+
problems: ConfigProblem[];
|
|
197
|
+
/** How a tag names a version, such as `{name}@{version}`. */
|
|
198
|
+
tagFormat: string;
|
|
199
|
+
/** Commits no changeset names release their unit, with a changelog from them. */
|
|
200
|
+
releasesCommits?: boolean;
|
|
201
|
+
/** How much the release says while it runs, as the config asks. */
|
|
202
|
+
display?: DisplayChoice;
|
|
203
|
+
/** Files still under their name from before shiplane. */
|
|
204
|
+
renames?: Rename[];
|
|
205
|
+
}
|
|
206
|
+
interface LoadOptions {
|
|
207
|
+
/** Where `shiplane` resolves from inside the config; by default, this very package. */
|
|
208
|
+
aliases?: Record<string, string>;
|
|
209
|
+
manifests?: ManifestReader;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The release as written: what `shiplane.config.ts` composes, and one app per folder that holds a
|
|
213
|
+
* `shiplane.unit.yml`, in release order. Every problem is collected, never thrown.
|
|
214
|
+
*/
|
|
215
|
+
declare const loadRelease: (root: string, options?: LoadOptions) => Promise<Release>;
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/application/context.d.ts
|
|
218
|
+
/** Everything a use case reads and drives: the release as written, its services, the person. */
|
|
219
|
+
interface ReleaseContext {
|
|
220
|
+
release: Release;
|
|
221
|
+
/** Reads the release from disk again: a pull moves the versions a merged release PR brought. */
|
|
222
|
+
load: () => Promise<Release>;
|
|
223
|
+
services: Services;
|
|
224
|
+
/** Creates the port an adapter gives, for this repository. */
|
|
225
|
+
open: Open;
|
|
226
|
+
prompter: Prompter;
|
|
227
|
+
output: Output;
|
|
228
|
+
/** Where the release is: its stage, what it reads or runs, the mascot's mood. */
|
|
229
|
+
progress: Progress;
|
|
230
|
+
clock: Clock;
|
|
231
|
+
/** Runs the jobs plugins return, when they run from this machine. */
|
|
232
|
+
shell: Shell;
|
|
233
|
+
options: {
|
|
234
|
+
/** Answers yes to every confirmation; production never accepts it. */yes: boolean; /** Running inside GitHub Actions: a ship runs on this runner, never dispatching another. */
|
|
235
|
+
ci: boolean;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/** The ports the release flow runs on. */
|
|
239
|
+
interface Services {
|
|
240
|
+
sourceControl: SourceControlPort;
|
|
241
|
+
codeHost: CodeHostPort;
|
|
242
|
+
ciPipeline: CiPipelinePort;
|
|
243
|
+
versioning: VersioningPort;
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/application/setupContext.d.ts
|
|
247
|
+
/** What setting a release up needs: the repository, the person, the adapters init can offer. */
|
|
248
|
+
interface SetupContext {
|
|
249
|
+
root: string;
|
|
250
|
+
files: Files;
|
|
251
|
+
shell: Shell;
|
|
252
|
+
prompter: Prompter;
|
|
253
|
+
output: Output;
|
|
254
|
+
/** The official delivery adapters, offered to folders before any config exists. */
|
|
255
|
+
adapters: AnyDeliveryAdapter[];
|
|
256
|
+
/** Loads the release as the files now say. */
|
|
257
|
+
load: () => Promise<Release>;
|
|
258
|
+
/** Spinners while setup waits; plain steps when absent. */
|
|
259
|
+
progress?: Progress;
|
|
260
|
+
/** A release's context, for the rehearsal's plan; without it, the plan is not rehearsed. */
|
|
261
|
+
compose?: (release: Release) => ReleaseContext;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/application/addUnit.d.ts
|
|
265
|
+
/** `shiplane add <folder>`: init's questions for one folder, its unit file written. */
|
|
266
|
+
declare const addUnit: (context: SetupContext, dir: string) => Promise<boolean>;
|
|
267
|
+
/** `shiplane remove <unit>`: its unit file goes; changesets still version it. */
|
|
268
|
+
declare const removeUnit: (context: SetupContext, name: string) => Promise<boolean>;
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/application/docsFor.d.ts
|
|
271
|
+
/**
|
|
272
|
+
* `shiplane docs <module or adapter>`: every key a unit file takes, described, with its default. A
|
|
273
|
+
* module name reads the release config; an adapter name, the official adapters and those composed.
|
|
274
|
+
*/
|
|
275
|
+
declare const docsFor: (context: SetupContext, name: string) => Promise<boolean>;
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/application/doctor.d.ts
|
|
278
|
+
/**
|
|
279
|
+
* `shiplane doctor`: the config as written, the editor schema refreshed, the release order, a warning
|
|
280
|
+
* for each module no app names, then every tool and sign-in the flow, modules and features need, each
|
|
281
|
+
* failure with the command that fixes it, offered to run.
|
|
282
|
+
*/
|
|
283
|
+
declare const doctor: (context: SetupContext) => Promise<boolean>;
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/application/initRelease.d.ts
|
|
286
|
+
/**
|
|
287
|
+
* `shiplane init`: finds every workspace folder, guesses how each ships from what it holds, asks only
|
|
288
|
+
* what it cannot tell, shows every file, writes them, then runs doctor. Run again, it offers the
|
|
289
|
+
* folders added since and never rewrites a unit file. `--yes` takes every guess, `--blank` writes
|
|
290
|
+
* commented templates.
|
|
291
|
+
*/
|
|
292
|
+
declare const initRelease: (context: SetupContext, {
|
|
293
|
+
yes,
|
|
294
|
+
blank
|
|
295
|
+
}: {
|
|
296
|
+
yes: boolean;
|
|
297
|
+
blank: boolean;
|
|
298
|
+
}) => Promise<boolean>;
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/application/newAdapter.d.ts
|
|
301
|
+
/**
|
|
302
|
+
* `shiplane adapter new <name>`: a server hosting adapter, the port's contract suite run on it and on
|
|
303
|
+
* its Fake, and a module for it in the root config.
|
|
304
|
+
*/
|
|
305
|
+
declare const newAdapter: (context: SetupContext, name: string) => Promise<boolean>;
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/domain/companions.d.ts
|
|
308
|
+
/** A unit that goes out with the picked ones without being picked, and why. */
|
|
309
|
+
interface Companion {
|
|
310
|
+
/** The unit's name. */
|
|
311
|
+
app: string;
|
|
312
|
+
version: string;
|
|
313
|
+
/** The picked units it goes with. */
|
|
314
|
+
with: string[];
|
|
315
|
+
/** Why, as a person reads it. */
|
|
316
|
+
why: string;
|
|
317
|
+
}
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/application/prepareRelease.d.ts
|
|
320
|
+
type Split = ReturnType<typeof splitChangesets>;
|
|
321
|
+
interface Prepared {
|
|
322
|
+
/** Changesets this release ships, the ones it writes included. */
|
|
323
|
+
pending: number;
|
|
324
|
+
/** Units the person left out: their changesets stay pending. */
|
|
325
|
+
held: string[];
|
|
326
|
+
/** Changed units the person left out: no changeset ships them. */
|
|
327
|
+
unreleased: UnreleasedApp[];
|
|
328
|
+
split: Split;
|
|
329
|
+
bumps: AppBump[];
|
|
330
|
+
/** Units the person did not pick that move anyway, with the package that drags each. */
|
|
331
|
+
companions: Companion[];
|
|
332
|
+
/** Internal packages moved along: changelogs only. */
|
|
333
|
+
packages: number;
|
|
334
|
+
/** Changesets the release writes itself. */
|
|
335
|
+
added: PlannedChangeset[];
|
|
336
|
+
/** Every changeset the release versions, with the lines it ships. */
|
|
337
|
+
shipped: PlannedChangeset[];
|
|
338
|
+
/** What plugins add to the release PR, by unit: an EAS app's build or update. */
|
|
339
|
+
contributions: Record<string, VersionContribution>;
|
|
340
|
+
}
|
|
341
|
+
/** What a release PR covering `scope` would version, computed without writing anything. */
|
|
342
|
+
declare const prepareRelease: (context: ReleaseContext, scope: ReadonlySet<string>, known?: Readonly<Record<string, VersionContribution>>) => Promise<Prepared>;
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/application/openReleasePr.d.ts
|
|
345
|
+
/**
|
|
346
|
+
* Versions what `prepared` covers on one branch from main, opens its PR, and goes back to main.
|
|
347
|
+
* Null, with what to do, when it must not run.
|
|
348
|
+
*/
|
|
349
|
+
declare const openReleasePr: (context: ReleaseContext, prepared: Prepared, /** Release PRs this one takes the place of, named at the top of its description. */
|
|
350
|
+
|
|
351
|
+
replaces?: readonly OpenPr[]) => Promise<OpenPr[] | null>;
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/application/planShips.d.ts
|
|
354
|
+
/**
|
|
355
|
+
* `shiplane plan`: every command shipping the current tags would run, both ways, in release order,
|
|
356
|
+
* then what the features would do. It runs nothing and asks nothing; it reads git, and the code host
|
|
357
|
+
* for features.
|
|
358
|
+
*/
|
|
359
|
+
declare const planShips: (context: ReleaseContext, environment: Environment) => Promise<void>;
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/application/promote.d.ts
|
|
362
|
+
/** Production, from what preview runs: every unit picked, its name typed, each step asked. */
|
|
363
|
+
declare const promote: (context: ReleaseContext, via: DeployPath | undefined) => Promise<boolean>;
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/application/readStatus.d.ts
|
|
366
|
+
interface UnitStatus {
|
|
367
|
+
unit: string;
|
|
368
|
+
target: string;
|
|
369
|
+
version: string;
|
|
370
|
+
tag: string;
|
|
371
|
+
tagged: boolean;
|
|
372
|
+
changesets: number;
|
|
373
|
+
commits: number;
|
|
374
|
+
/** Something to release to this environment. */
|
|
375
|
+
pending: boolean;
|
|
376
|
+
hint: string;
|
|
377
|
+
/** What its plugin reads from its own platform, such as each EAS build's verdict. */
|
|
378
|
+
live?: unknown;
|
|
379
|
+
}
|
|
380
|
+
interface ReleaseStatus {
|
|
381
|
+
environment: Environment;
|
|
382
|
+
units: UnitStatus[];
|
|
383
|
+
releasePrs: OpenPr[];
|
|
384
|
+
untagged: ReleaseTag[];
|
|
385
|
+
next: ReleaseStep;
|
|
386
|
+
}
|
|
387
|
+
/** Where every unit stands on an environment, and the step a release takes next. Reads only. */
|
|
388
|
+
declare const readStatus: (context: ReleaseContext, environment: Environment) => Promise<ReleaseStatus>;
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/application/releaseToPreview.d.ts
|
|
391
|
+
/**
|
|
392
|
+
* `release` on preview: the release PR, the wait for its merge, the tags, then the ship. It reads where things
|
|
393
|
+
* stand first, so a run stopped anywhere picks up where it left off. False when something failed.
|
|
394
|
+
*/
|
|
395
|
+
declare const releaseToPreview: (context: ReleaseContext) => Promise<boolean>;
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region src/application/setup.d.ts
|
|
398
|
+
/**
|
|
399
|
+
* `shiplane setup`: the one command to set releases up and keep them right. It reads the
|
|
400
|
+
* repository, takes what it can prove, asks only the rest, then rehearses a release (builds, plan,
|
|
401
|
+
* sign-ins) with nothing pushed or deployed. Files are kept only when the rehearsal passes. Run
|
|
402
|
+
* again, it says all is set or offers what changed.
|
|
403
|
+
*/
|
|
404
|
+
declare const setup: (context: SetupContext, {
|
|
405
|
+
yes
|
|
406
|
+
}: {
|
|
407
|
+
yes: boolean;
|
|
408
|
+
}) => Promise<boolean>;
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/application/setupFiles.d.ts
|
|
411
|
+
/**
|
|
412
|
+
* Writes the editor schema when it no longer matches the composed modules. It is generated, never
|
|
413
|
+
* committed: every command keeps it current. True when it wrote.
|
|
414
|
+
*/
|
|
415
|
+
declare const refreshEditorSchema: (files: Files, release: Release) => boolean;
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region src/application/ship.d.ts
|
|
418
|
+
/**
|
|
419
|
+
* Ships every picked unit its environment does not run yet, and returns once each one is
|
|
420
|
+
* triggered: EAS builds and workflows go on on their own, a Fly deploy from here once rolled out.
|
|
421
|
+
* Production asks for its name first. False on a failure.
|
|
422
|
+
*/
|
|
423
|
+
declare const shipTo: (context: ReleaseContext, environment: Environment, {
|
|
424
|
+
scope,
|
|
425
|
+
via
|
|
426
|
+
}: {
|
|
427
|
+
scope?: ReadonlySet<string>;
|
|
428
|
+
via?: DeployPath;
|
|
429
|
+
}) => Promise<boolean>;
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/testing/sample.d.ts
|
|
432
|
+
/** This repository's four shipping units, as the rule tests were written against them. */
|
|
433
|
+
declare const SAMPLE_UNITS: UnitRef[];
|
|
434
|
+
declare const SAMPLE_VERSION_FILES: Set<string>;
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/testing/live.d.ts
|
|
437
|
+
/**
|
|
438
|
+
* Contract suites against hosted services run only with RELEASE_CONTRACT_LIVE=1, on a sandbox
|
|
439
|
+
* repository checked out at RELEASE_CONTRACT_REPO: they open pull requests, publish releases and
|
|
440
|
+
* dispatch workflows there.
|
|
441
|
+
*/
|
|
442
|
+
declare const LIVE: boolean;
|
|
443
|
+
/** The sandbox checkout, refused when unset so a live run never touches this repository. */
|
|
444
|
+
declare const sandbox: () => string;
|
|
445
|
+
/** Runs git in the sandbox and returns what it printed. */
|
|
446
|
+
declare const inSandbox: (args: string[]) => string;
|
|
447
|
+
//#endregion
|
|
448
|
+
//#region src/testing/plans.d.ts
|
|
449
|
+
/**
|
|
450
|
+
* What `changeset status` answers for these pending changesets, plus the ones a release adds, minus
|
|
451
|
+
* the lines it holds back: every named package moves once, by its biggest bump.
|
|
452
|
+
*/
|
|
453
|
+
declare const planFrom: (pending: PlannedChangeset[], versions: Record<string, string>) => (added: PlannedChangeset[], held: PlannedChangeset[]) => StatusPlan;
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/adapters/terminal/__fakes__/progress.fake.d.ts
|
|
456
|
+
interface ProgressEvent {
|
|
457
|
+
kind: "stage" | "during" | "say";
|
|
458
|
+
text: string;
|
|
459
|
+
mood?: Mood;
|
|
460
|
+
step?: StepPlace;
|
|
461
|
+
}
|
|
462
|
+
/** Progress kept as events; what it says also goes to the output, as a terminal would print it. */
|
|
463
|
+
declare class RecordingProgress implements Progress {
|
|
464
|
+
private readonly output;
|
|
465
|
+
readonly events: ProgressEvent[];
|
|
466
|
+
constructor(output: Output);
|
|
467
|
+
stage: (stages: readonly string[], index: number) => void;
|
|
468
|
+
during: <T>(label: string, mood: Mood, work: () => Promise<T>, step?: StepPlace) => Promise<T>;
|
|
469
|
+
say: (mood: Mood, text: string) => void;
|
|
470
|
+
}
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/testing/releaseContext.d.ts
|
|
473
|
+
declare const testUnit: (name: string, overrides?: Partial<ReleaseUnit>) => ReleaseUnit;
|
|
474
|
+
/** The flow's Fakes, as adapters a config would hold. */
|
|
475
|
+
interface FlowFakes {
|
|
476
|
+
sourceControl: ReturnType<typeof sourceControlFake>;
|
|
477
|
+
codeHost: ReturnType<typeof codeHostFake>;
|
|
478
|
+
ciPipeline: ReturnType<typeof ciPipelineFake>;
|
|
479
|
+
versioning: ReturnType<typeof versioningFake>;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* A release over a Fake of every port the flow runs on, answered by a scripted person. The apps are
|
|
483
|
+
* in release order as given: the first is the Latest release.
|
|
484
|
+
*/
|
|
485
|
+
declare const testContext: ({
|
|
486
|
+
units,
|
|
487
|
+
modules,
|
|
488
|
+
features,
|
|
489
|
+
yes,
|
|
490
|
+
interactive,
|
|
491
|
+
root,
|
|
492
|
+
tagFormat,
|
|
493
|
+
commitsWithoutChangeset,
|
|
494
|
+
approval
|
|
495
|
+
}: {
|
|
496
|
+
units: ReleaseUnit[];
|
|
497
|
+
modules?: ReleaseModule[]; /** The features, or how to make them from the flow's Fakes they share. */
|
|
498
|
+
features?: Feature[] | ((flow: FlowFakes) => Feature[]);
|
|
499
|
+
yes?: boolean;
|
|
500
|
+
interactive?: boolean;
|
|
501
|
+
root?: string;
|
|
502
|
+
tagFormat?: string; /** A release skips commits no changeset names; the config default ignores them. */
|
|
503
|
+
commitsWithoutChangeset?: "release" | "ignore"; /** Whether someone else approves the release PR; the config default when absent. */
|
|
504
|
+
approval?: Approval;
|
|
505
|
+
}) => {
|
|
506
|
+
context: ReleaseContext;
|
|
507
|
+
flow: {
|
|
508
|
+
sourceControl: ServiceAdapter<SourceControlPort> & {
|
|
509
|
+
fake: SourceControlFake;
|
|
510
|
+
};
|
|
511
|
+
codeHost: ServiceAdapter<CodeHostPort> & {
|
|
512
|
+
fake: CodeHostFake;
|
|
513
|
+
};
|
|
514
|
+
ciPipeline: ServiceAdapter<CiPipelinePort> & {
|
|
515
|
+
fake: CiPipelineFake;
|
|
516
|
+
};
|
|
517
|
+
versioning: ServiceAdapter<VersioningPort> & {
|
|
518
|
+
fake: VersioningFake;
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
source: SourceControlFake;
|
|
522
|
+
host: CodeHostFake;
|
|
523
|
+
ci: CiPipelineFake;
|
|
524
|
+
versioning: VersioningFake;
|
|
525
|
+
prompter: ScriptedPrompter;
|
|
526
|
+
output: MemoryOutput;
|
|
527
|
+
progress: RecordingProgress;
|
|
528
|
+
shell: RecordingShell;
|
|
529
|
+
};
|
|
530
|
+
declare const changesetText: (packages: Record<string, string>, summary: string) => string;
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region src/testing/consumer.d.ts
|
|
533
|
+
/** What the built CLI printed and the code it exited with. */
|
|
534
|
+
interface CliRun {
|
|
535
|
+
status: number;
|
|
536
|
+
output: string;
|
|
537
|
+
}
|
|
538
|
+
interface ConsumerRepository {
|
|
539
|
+
root: string;
|
|
540
|
+
/** The bare repository the checkout pushes to, standing in for GitHub. */
|
|
541
|
+
origin: string;
|
|
542
|
+
write: (file: string, text: string) => void;
|
|
543
|
+
read: (file: string) => string;
|
|
544
|
+
/** Runs git in the checkout, or in the bare origin with `{ in: "origin" }`. */
|
|
545
|
+
git: (args: string[], where?: {
|
|
546
|
+
in: "origin";
|
|
547
|
+
}) => string;
|
|
548
|
+
/** Commits every file as it stands and pushes the branch to the origin. */
|
|
549
|
+
commitAndPush: (title: string) => void;
|
|
550
|
+
/** Runs the built `shiplane` CLI in the checkout, as a person types it. */
|
|
551
|
+
shiplane: (args: string[]) => CliRun;
|
|
552
|
+
remove: () => void;
|
|
553
|
+
}
|
|
554
|
+
/** The built CLI, as `pnpm add shiplane` installs it. */
|
|
555
|
+
declare const builtCli: () => string;
|
|
556
|
+
/**
|
|
557
|
+
* A repository as a consumer has it: its files, the packages it installed linked in its
|
|
558
|
+
* node_modules, one commit pushed to a local bare origin. gh, npm and flyctl answer offline.
|
|
559
|
+
*/
|
|
560
|
+
declare const consumerRepository: ({
|
|
561
|
+
files,
|
|
562
|
+
packages,
|
|
563
|
+
branch
|
|
564
|
+
}: {
|
|
565
|
+
files: Record<string, string>; /** The branch releases start from, created first and pushed. */
|
|
566
|
+
branch?: string; /** Package name to the folder it installs from, such as a plugin's workspace folder. */
|
|
567
|
+
packages?: Record<string, string>;
|
|
568
|
+
}) => ConsumerRepository;
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region src/testing/workspace.d.ts
|
|
571
|
+
/** The public API a test config imports, resolved to source since tests run before any build. */
|
|
572
|
+
declare const SOURCE_ALIASES: Record<string, string>;
|
|
573
|
+
interface Workspace {
|
|
574
|
+
root: string;
|
|
575
|
+
write: (file: string, text: string) => void;
|
|
576
|
+
read: (file: string) => string;
|
|
577
|
+
exists: (file: string) => boolean;
|
|
578
|
+
remove: () => void;
|
|
579
|
+
}
|
|
580
|
+
/** A throwaway repository on disk, one entry per file, removed by `remove()`. */
|
|
581
|
+
declare const createWorkspace: (files: Record<string, string>) => Workspace;
|
|
582
|
+
declare const packageJson: (name: string, version?: string, extra?: object) => string;
|
|
583
|
+
//#endregion
|
|
584
|
+
export { type CliRun, type ConsumerRepository, type HostEvent, LIVE, MemoryOutput, RecordingShell, SAMPLE_UNITS, SAMPLE_VERSION_FILES, SOURCE_ALIASES, ScriptedPrompter, type SetupContext, type Workspace, addUnit, builtCli, changesetText, ciPipelineContract, ciPipelineFake, codeHostContract, codeHostFake, consumerRepository, createWorkspace, docsFor, doctor, inSandbox, initRelease, loadRelease, mobileDistributionContract, mobileDistributionFake, newAdapter, nodeFiles, openReleasePr, packageJson, packageRegistryContract, packageRegistryFake, planFrom, planShips, prepareRelease, promote, readStatus, refreshEditorSchema, releaseToPreview, removeUnit, sandbox, serverHostingContract, serverHostingFake, setup, shipTo, sourceControlContract, sourceControlFake, staticHostingContract, staticHostingFake, systemShell, testContext, testUnit, versioningContract, versioningFake };
|
|
585
|
+
//# sourceMappingURL=testing.d.ts.map
|