shiplane 0.5.2 → 0.6.0-fix-shiplane-ship-node-cache.3dccda9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +157 -312
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{readStatus-DypM0faL.js → compose-BTQXZqHM.js} +2758 -1448
  5. package/dist/compose-BTQXZqHM.js.map +1 -0
  6. package/dist/{budget-BTnKtGF6.js → display-CfV4G1TR.js} +155 -52
  7. package/dist/display-CfV4G1TR.js.map +1 -0
  8. package/dist/{static-hosting.port-B5i6W7eD.d.ts → index-B1Rd22nM.d.ts} +482 -21
  9. package/dist/index.d.ts +2 -3
  10. package/dist/index.js +3 -4
  11. package/dist/{issues-TcWtMTv5.js → issues-DCRpXUBW.js} +1 -1
  12. package/dist/{issues-TcWtMTv5.js.map → issues-DCRpXUBW.js.map} +1 -1
  13. package/dist/memory.d.ts +1 -1
  14. package/dist/memory.js +1 -1
  15. package/dist/{package-registry.fake-BLBdd7IQ.d.ts → package-registry.fake-CjoePEzE.d.ts} +53 -6
  16. package/dist/{package-registry.fake-CN6M1-Gi.js → package-registry.fake-ykiSBd8M.js} +58 -6
  17. package/dist/package-registry.fake-ykiSBd8M.js.map +1 -0
  18. package/dist/plugin-D-JQhwVd.d.ts +118 -0
  19. package/dist/plugin.d.ts +3 -23
  20. package/dist/plugin.js +84 -7
  21. package/dist/plugin.js.map +1 -0
  22. package/dist/shell-server-hosting.adapter-CvOcC6Wh.js +369 -0
  23. package/dist/shell-server-hosting.adapter-CvOcC6Wh.js.map +1 -0
  24. package/dist/{src-DO7WyrfV.js → src-8BbKTQBb.js} +2 -2
  25. package/dist/src-8BbKTQBb.js.map +1 -0
  26. package/dist/testing.d.ts +103 -18
  27. package/dist/testing.js +235 -22
  28. package/dist/testing.js.map +1 -1
  29. package/package.json +2 -1
  30. package/dist/budget-BTnKtGF6.js.map +0 -1
  31. package/dist/display-IqkJ6uCw.js +0 -96
  32. package/dist/display-IqkJ6uCw.js.map +0 -1
  33. package/dist/index-C_urG4yY.d.ts +0 -252
  34. package/dist/package-registry.fake-CN6M1-Gi.js.map +0 -1
  35. package/dist/readStatus-DypM0faL.js.map +0 -1
  36. package/dist/shell-server-hosting.adapter-C7_5MWrl.js +0 -50
  37. package/dist/shell-server-hosting.adapter-C7_5MWrl.js.map +0 -1
  38. package/dist/src-DO7WyrfV.js.map +0 -1
  39. package/dist/web-app.module-BB1fY1Kd.js +0 -125
  40. package/dist/web-app.module-BB1fY1Kd.js.map +0 -1
@@ -44,6 +44,31 @@ const expandPatterns = (from, patterns) => {
44
44
  return [...new Set(folders)].sort();
45
45
  };
46
46
  //#endregion
47
+ //#region src/domain/versions.ts
48
+ const toParts = (version) => version.split(".").map((part) => Number.parseInt(part, 10) || 0);
49
+ /** Negative, zero or positive, like a sort comparator: "0.1.10" is after "0.1.9". */
50
+ const compareVersions = (left, right) => {
51
+ const leftParts = toParts(left);
52
+ const rightParts = toParts(right);
53
+ const length = Math.max(leftParts.length, rightParts.length);
54
+ for (let index = 0; index < length; index += 1) {
55
+ const difference = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);
56
+ if (difference !== 0) return difference;
57
+ }
58
+ return 0;
59
+ };
60
+ const nextPatch = (version) => {
61
+ const [major = 0, minor = 0, patch = 0] = version.split(".").map(Number);
62
+ return `${major}.${minor}.${patch + 1}`;
63
+ };
64
+ /** The version one bump of `level` after `version`. */
65
+ const nextVersion = (version, level) => {
66
+ const [major = 0, minor = 0] = version.split(".").map(Number);
67
+ if (level === "major") return `${major + 1}.0.0`;
68
+ if (level === "minor") return `${major}.${minor + 1}.0`;
69
+ return nextPatch(version);
70
+ };
71
+ //#endregion
47
72
  //#region src/domain/tags.ts
48
73
  /** Tag formats a config can name instead of writing one out. */
49
74
  const TAG_FORMATS = {
@@ -61,10 +86,18 @@ const TAG_FORMATS = {
61
86
  };
62
87
  /** How a tag names a unit's version unless the config says otherwise. */
63
88
  const DEFAULT_TAG_FORMAT = TAG_FORMATS.package;
89
+ /** Whether a config names one of the tag formats instead of writing one out. */
90
+ const isTagFormatName = (format) => Object.hasOwn(TAG_FORMATS, format);
64
91
  /** A format's name resolved to the format; anything else is a format already. */
65
- const tagFormatNamed = (format) => Object.hasOwn(TAG_FORMATS, format) ? TAG_FORMATS[format] : format;
92
+ const tagFormatNamed = (format) => isTagFormatName(format) ? TAG_FORMATS[format] : format;
66
93
  /** A unit's tag for a version, through a format like `v{version}` or `{name}--v{version}`. */
67
94
  const tagName = (app, version, format = DEFAULT_TAG_FORMAT) => format.replaceAll("{name}", app).replaceAll("{version}", version);
95
+ /** The tag a unit had before this version, by version order. Null for its first release. */
96
+ const previousTag = ({ tags, unit, version, format = DEFAULT_TAG_FORMAT }) => {
97
+ const [before = "", after = ""] = tagName(unit, "\0", format).split("\0");
98
+ const [newest] = [...tags].filter((tag) => tag.startsWith(before) && tag.endsWith(after)).map((tag) => tag.slice(before.length, tag.length - after.length)).filter((candidate) => /^\d/.test(candidate) && compareVersions(candidate, version) < 0).sort((left, right) => compareVersions(right, left));
99
+ return newest === void 0 ? null : tagName(unit, newest, format);
100
+ };
68
101
  /**
69
102
  * No tag names any version of the unit yet: the version it holds is its first release. 0.0.0 is a
70
103
  * unit never versioned, waiting for its first changeset.
@@ -113,51 +146,6 @@ const changelogSection = (changelog, version) => {
113
146
  return changelog.split(`\n## ${version}\n`)[1]?.split("\n## ")[0]?.trim() || `No changelog entry for ${version}.`;
114
147
  };
115
148
  //#endregion
116
- //#region src/domain/governance.ts
117
- /**
118
- * A binary ships what it was built from, so builds start from main as it is on origin. Preview
119
- * updates may come from a branch for testers; production updates only from main.
120
- */
121
- const releaseSource = (intent, channel, { branch, head, originMain }) => {
122
- if (!(intent === "build" || intent === "update" && channel === "production")) return { allowed: true };
123
- if (branch !== "main") return {
124
- allowed: false,
125
- why: "not-main"
126
- };
127
- if (head !== originMain) return {
128
- allowed: false,
129
- why: "behind-main"
130
- };
131
- return { allowed: true };
132
- };
133
- /** Production never runs a step nobody confirmed. */
134
- const yesAllowed = (channel, yes) => !(yes && channel === "production");
135
- //#endregion
136
- //#region src/domain/versions.ts
137
- const toParts = (version) => version.split(".").map((part) => Number.parseInt(part, 10) || 0);
138
- /** Negative, zero or positive, like a sort comparator: "0.1.10" is after "0.1.9". */
139
- const compareVersions = (left, right) => {
140
- const leftParts = toParts(left);
141
- const rightParts = toParts(right);
142
- const length = Math.max(leftParts.length, rightParts.length);
143
- for (let index = 0; index < length; index += 1) {
144
- const difference = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);
145
- if (difference !== 0) return difference;
146
- }
147
- return 0;
148
- };
149
- const nextPatch = (version) => {
150
- const [major = 0, minor = 0, patch = 0] = version.split(".").map(Number);
151
- return `${major}.${minor}.${patch + 1}`;
152
- };
153
- /** The version one bump of `level` after `version`. */
154
- const nextVersion = (version, level) => {
155
- const [major = 0, minor = 0] = version.split(".").map(Number);
156
- if (level === "major") return `${major + 1}.0.0`;
157
- if (level === "minor") return `${major}.${minor + 1}.0`;
158
- return nextPatch(version);
159
- };
160
- //#endregion
161
149
  //#region src/domain/changes.ts
162
150
  /** The units a release moves, in `units` order, each with its notes or the packages it moves with. */
163
151
  const appBumps = ({ changesets, releases }, dependencies, units) => {
@@ -243,7 +231,7 @@ const webShip = ({ environment, run, onPreview }) => {
243
231
  /** Whether a diff only moves version files: the code is still the code a release named. */
244
232
  const onlyVersionFiles = (files, versionFiles) => files.every((file) => versionFiles.has(file));
245
233
  /** This machine builds its checkout, so it ships only while that is the tagged code. */
246
- const shipsFrom = (path, { sinceTagOnlyVersionFiles }) => path === "github" || sinceTagOnlyVersionFiles;
234
+ const shipsFrom = (path, { sinceTagOnlyVersionFiles }) => path === "ci" || sinceTagOnlyVersionFiles;
247
235
  //#endregion
248
236
  //#region src/ports/shell.port.ts
249
237
  /** A command that exited non-zero, carrying all it printed so a failure can show why. */
@@ -256,6 +244,28 @@ var CommandFailed = class extends Error {
256
244
  }
257
245
  };
258
246
  //#endregion
247
+ //#region src/domain/governance.ts
248
+ /**
249
+ * A binary ships what it was built from, so builds start from the default branch (main, or
250
+ * master) as it is on origin, or from exactly the commit the release tagged (a runner checked out
251
+ * at the tag, retrying it). Preview updates may come from a branch for testers; production updates
252
+ * only from the default branch.
253
+ */
254
+ const releaseSource = (intent, channel, { branch, head, originMain }, { tagCommit = null, defaultBranch = "main" } = {}) => {
255
+ if (!(intent === "build" || intent === "update" && channel === "production") || head === tagCommit) return { allowed: true };
256
+ if (branch !== defaultBranch) return {
257
+ allowed: false,
258
+ why: "not-main"
259
+ };
260
+ if (head !== originMain) return {
261
+ allowed: false,
262
+ why: "behind-main"
263
+ };
264
+ return { allowed: true };
265
+ };
266
+ /** Production never runs a step nobody confirmed. */
267
+ const yesAllowed = (channel, yes) => !(yes && channel === "production");
268
+ //#endregion
259
269
  //#region src/domain/budget.ts
260
270
  const INCLUDED_MINUTES = {
261
271
  free: 2e3,
@@ -287,7 +297,7 @@ const STATUS = {
287
297
  * The minutes as the deploy question draws them: a bar of what is left, what this release spends,
288
298
  * and where this month ends if the pace so far holds. GitHub resets the allowance on the 1st, UTC.
289
299
  */
290
- const minutesBudget = (budget, now, width = 30, spend = 0) => {
300
+ const minutesBudget = (budget, now, width = 30, spend = 0, label = "CI") => {
291
301
  const { used, included, left } = budget;
292
302
  const start = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1);
293
303
  const end = Date.UTC(now.getUTCFullYear(), now.getUTCMonth() + 1, 1);
@@ -306,7 +316,7 @@ const minutesBudget = (budget, now, width = 30, spend = 0) => {
306
316
  const pace = `At this pace${spend > 0 ? ", with this release," : ""} about ${number(projected)} used by ${month({ month: "long" })} ${lastDay}`;
307
317
  return {
308
318
  tone,
309
- title: `GitHub Actions minutes · ${month({
319
+ title: `${label} minutes · ${month({
310
320
  month: "long",
311
321
  year: "numeric"
312
322
  })}`,
@@ -314,7 +324,7 @@ const minutesBudget = (budget, now, width = 30, spend = 0) => {
314
324
  amount: `${number(left)} of ${number(included)} left · ${Math.round(used / included * 100)}% used`,
315
325
  pace: projected > included ? `${pace}, over the ${number(included)} included: prefer this machine.` : `${pace}, within the ${number(included)} included.`,
316
326
  status: STATUS[tone],
317
- after: spend > 0 ? `This release: about ${spend} min on GitHub, about ${number(leftAfter)} left after it` : null
327
+ after: spend > 0 ? `This release: about ${spend} min on ${label}, about ${number(leftAfter)} left after it` : null
318
328
  };
319
329
  };
320
330
  /** Minutes GitHub bills for a run: each job rounds up to the minute; unfinished jobs are skipped. */
@@ -347,6 +357,99 @@ const deployEstimate = (items, measured, typical) => {
347
357
  };
348
358
  };
349
359
  //#endregion
350
- export { workspacePatterns as A, changelogSection as C, tagFormatNamed as D, releaseTags as E, tagName as O, cameWithRelease as S, isReleaseSubject as T, nextVersion as _, CommandFailed as a, DEFAULT_TAG_FORMAT as b, onlyVersionFiles as c, appBumps as d, changesetApps as f, nextPatch as g, compareVersions as h, minutesBudget as i, expandPatterns as k, shipsFrom as l, splitChangesets as m, billedMinutes as n, deployRunTitle as o, packageBumps as p, deployEstimate as r, deployState as s, actionsMinutes as t, webShip as u, releaseSource as v, firstRelease as w, TAG_FORMATS as x, yesAllowed as y };
360
+ //#region src/domain/display.ts
361
+ const MOODS = [
362
+ "thinking",
363
+ "working",
364
+ "waiting",
365
+ "happy",
366
+ "worried",
367
+ "resting"
368
+ ];
369
+ const UP = "/\\/\\/";
370
+ const DOWN = "\\/\\/\\";
371
+ const FRAMES = {
372
+ thinking: [
373
+ `${UP}(•ω•) ? `,
374
+ `${UP}(•ω•) ?`,
375
+ `${DOWN}(•ω•) ? `,
376
+ `${DOWN}(•ω•) `
377
+ ],
378
+ working: [
379
+ `${UP}(•ω•)/ `,
380
+ `${UP}(•ω•)- `,
381
+ `${DOWN}(•ω•)\\ `,
382
+ `${DOWN}(•ω•)| `
383
+ ],
384
+ waiting: [
385
+ `${UP}(-ω-) z `,
386
+ `${UP}(-ω-) zz`,
387
+ `${UP}(•ω•) `,
388
+ `${UP}(-ω-) zZ`
389
+ ],
390
+ happy: [
391
+ `${UP}(^ω^) ✦ `,
392
+ `${DOWN}(^ω^) ✧ `,
393
+ `${UP}(^ω^)✦ ✧`,
394
+ `${DOWN}(^ω^) ✧ `
395
+ ],
396
+ worried: [`${UP}(°ω°) ; `, `${DOWN}(°ω°) ;;`],
397
+ resting: [`${UP}(-ω-) zZ`, `${UP}(-ω-) z`]
398
+ };
399
+ /** `done` of `total` as a bar `width` characters wide. */
400
+ const progressBar = (done, total, width) => {
401
+ const filled = total <= 0 ? width : Math.round(width * Math.min(done, total) / total);
402
+ return `${"█".repeat(filled)}${"░".repeat(width - filled)}`;
403
+ };
404
+ const columns = (text) => [...text].length;
405
+ const pad = (text, width) => text + " ".repeat(Math.max(0, width - columns(text)));
406
+ /** Any mascot as a drawing: frames merged over the hedgehog's, a function sampled for its width. */
407
+ const drawingOf = (mascot) => {
408
+ if (typeof mascot === "function") {
409
+ const sample = MOODS.flatMap((mood) => [
410
+ 0,
411
+ 1,
412
+ 2,
413
+ 3
414
+ ].map((tick) => columns(mascot({
415
+ mood,
416
+ tick,
417
+ label: ""
418
+ }))));
419
+ const width = Math.max(0, ...sample);
420
+ return {
421
+ hedgehog: false,
422
+ width,
423
+ frames: () => 4,
424
+ draw: (moment) => pad(mascot(moment), width)
425
+ };
426
+ }
427
+ const own = mascot === true ? {} : mascot;
428
+ const frames = Object.fromEntries(MOODS.map((mood) => {
429
+ const given = own[mood];
430
+ return [mood, given && given.length > 0 ? given : FRAMES[mood]];
431
+ }));
432
+ const width = Math.max(...Object.values(frames).flat().map(columns));
433
+ return {
434
+ hedgehog: mascot === true,
435
+ width,
436
+ frames: (mood) => frames[mood].length,
437
+ draw: ({ mood, tick }) => pad(frames[mood][tick % frames[mood].length] ?? "", width)
438
+ };
439
+ };
440
+ /** A flag wins over the config, which wins over the default: verbose, with the mascot. */
441
+ const resolveDisplay = (config, flags, terminal) => {
442
+ const verbose = flags.verbose ?? config.verbose ?? true;
443
+ const configured = config.mascot ?? true;
444
+ const chosen = flags.mascot === void 0 ? configured : flags.mascot !== false && (configured === false ? true : configured);
445
+ const mascot = chosen === false ? null : drawingOf(chosen);
446
+ return {
447
+ verbose,
448
+ mascot,
449
+ motion: mascot !== null && terminal.tty && !terminal.ci && !terminal.noMotion
450
+ };
451
+ };
452
+ //#endregion
453
+ export { nextPatch as A, firstRelease as C, tagFormatNamed as D, releaseTags as E, expandPatterns as M, workspacePatterns as N, tagName as O, changelogSection as S, previousTag as T, packageBumps as _, deployEstimate as a, TAG_FORMATS as b, yesAllowed as c, deployState as d, onlyVersionFiles as f, changesetApps as g, appBumps as h, billedMinutes as i, nextVersion as j, compareVersions as k, CommandFailed as l, webShip as m, resolveDisplay as n, minutesBudget as o, shipsFrom as p, actionsMinutes as r, releaseSource as s, progressBar as t, deployRunTitle as u, splitChangesets as v, isReleaseSubject as w, cameWithRelease as x, DEFAULT_TAG_FORMAT as y };
351
454
 
352
- //# sourceMappingURL=budget-BTnKtGF6.js.map
455
+ //# sourceMappingURL=display-CfV4G1TR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display-CfV4G1TR.js","names":[],"sources":["../src/application/config/workspaceFolders.ts","../src/domain/versions.ts","../src/domain/tags.ts","../src/domain/changes.ts","../src/domain/deploys.ts","../src/ports/shell.port.ts","../src/domain/governance.ts","../src/domain/budget.ts","../src/domain/display.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { parse } from \"yaml\";\nimport { z } from \"zod\";\n\nconst PnpmWorkspaceSchema = z.object({ packages: z.array(z.string()).optional() }).nullish();\nconst PackageWorkspacesSchema = z.object({\n workspaces: z\n .union([z.array(z.string()), z.object({ packages: z.array(z.string()) })])\n .optional(),\n});\n\n/** What reading a workspace needs, by path relative to its root: a disk, or files in memory. */\nexport interface WorkspaceReader {\n read: (file: string) => string | null;\n /** The folders directly inside `dir`, by name. */\n folders: (dir: string) => string[];\n exists: (file: string) => boolean;\n}\n\n/** The repository on disk, under `root`, as a workspace reader. */\nexport const diskReader = (root: string): WorkspaceReader => ({\n read: (file) => {\n const absolute = path.join(root, file);\n return fs.existsSync(absolute) ? fs.readFileSync(absolute, \"utf8\") : null;\n },\n folders: (dir) => {\n const absolute = path.join(root, dir);\n if (!fs.existsSync(absolute)) return [];\n return fs\n .readdirSync(absolute, { withFileTypes: true })\n .filter((entry) => entry.isDirectory())\n .map((entry) => entry.name);\n },\n exists: (file) => fs.existsSync(path.join(root, file)),\n});\n\nconst readerOf = (from: string | WorkspaceReader) =>\n typeof from === \"string\" ? diskReader(from) : from;\n\n/** The folders the workspace file lists: pnpm's first, then package.json, else the root alone. */\nexport const workspacePatterns = (from: string | WorkspaceReader): string[] => {\n const reader = readerOf(from);\n const pnpm = reader.read(\"pnpm-workspace.yaml\");\n const fromPnpm = pnpm === null ? undefined : PnpmWorkspaceSchema.parse(parse(pnpm))?.packages;\n if (fromPnpm && fromPnpm.length > 0) return fromPnpm;\n const manifest = reader.read(\"package.json\");\n const { workspaces } =\n manifest === null\n ? { workspaces: undefined }\n : PackageWorkspacesSchema.parse(JSON.parse(manifest));\n if (workspaces) return Array.isArray(workspaces) ? workspaces : workspaces.packages;\n return [\".\"];\n};\n\n/** Folders matching `dir/*` or an exact path, sorted. Negations and deeper globs are skipped. */\nexport const expandPatterns = (\n from: string | WorkspaceReader,\n patterns: readonly string[],\n): string[] => {\n const reader = readerOf(from);\n const folders = patterns\n .filter((pattern) => !pattern.startsWith(\"!\"))\n .map((pattern) => pattern.replace(/\\/+$/, \"\"))\n .flatMap((pattern) => {\n if (pattern.endsWith(\"/*\")) {\n const parent = pattern.slice(0, -2);\n return reader\n .folders(parent)\n .filter((name) => !name.startsWith(\".\") && name !== \"node_modules\")\n .map((name) => path.posix.join(parent, name));\n }\n if (pattern.includes(\"*\")) return [];\n return reader.exists(pattern) ? [path.posix.normalize(pattern)] : [];\n });\n return [...new Set(folders)].sort();\n};\n","import type { BumpLevel } from \"./changes\";\n\nconst toParts = (version: string) =>\n version.split(\".\").map((part) => Number.parseInt(part, 10) || 0);\n\n/** Negative, zero or positive, like a sort comparator: \"0.1.10\" is after \"0.1.9\". */\nexport const compareVersions = (left: string, right: string): number => {\n const leftParts = toParts(left);\n const rightParts = toParts(right);\n const length = Math.max(leftParts.length, rightParts.length);\n\n for (let index = 0; index < length; index += 1) {\n const difference = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);\n if (difference !== 0) return difference;\n }\n\n return 0;\n};\n\nexport const nextPatch = (version: string) => {\n const [major = 0, minor = 0, patch = 0] = version.split(\".\").map(Number);\n return `${major}.${minor}.${patch + 1}`;\n};\n\n/** The version one bump of `level` after `version`. */\nexport const nextVersion = (version: string, level: BumpLevel) => {\n const [major = 0, minor = 0] = version.split(\".\").map(Number);\n if (level === \"major\") return `${major + 1}.0.0`;\n if (level === \"minor\") return `${major}.${minor + 1}.0`;\n return nextPatch(version);\n};\n","import { compareVersions } from \"./versions\";\n\n/** Tag formats a config can name instead of writing one out. */\nexport const TAG_FORMATS = {\n /** `api@1.2.0`: one tag per unit, as changesets tags a monorepo. */\n package: \"{name}@{version}\",\n /**\n * `my-plugin--v1.2.0`: an agent plugin's tag. Claude Code resolves versions from it; Gemini CLI and\n * Codex install from any tag, so one tag serves all three.\n */\n plugin: \"{name}--v{version}\",\n /** `v1.2.0`: a repository that releases one unit, the most common tag there is. */\n single: \"v{version}\",\n /** `api/v1.2.0`: a tag per folder, as Go requires for a module below the repository root. */\n module: \"{name}/v{version}\",\n} as const;\n\nexport type TagFormatName = keyof typeof TAG_FORMATS;\n\n/** How a tag names a unit's version unless the config says otherwise. */\nexport const DEFAULT_TAG_FORMAT = TAG_FORMATS.package;\n\n/** Whether a config names one of the tag formats instead of writing one out. */\nexport const isTagFormatName = (format: string): format is TagFormatName =>\n Object.hasOwn(TAG_FORMATS, format);\n\n/** A format's name resolved to the format; anything else is a format already. */\nexport const tagFormatNamed = (format: string): string =>\n isTagFormatName(format) ? TAG_FORMATS[format] : format;\n\n/** A unit's tag for a version, through a format like `v{version}` or `{name}--v{version}`. */\nexport const tagName = (app: string, version: string, format: string = DEFAULT_TAG_FORMAT) =>\n format.replaceAll(\"{name}\", app).replaceAll(\"{version}\", version);\n\n/** The tag a unit had before this version, by version order. Null for its first release. */\nexport const previousTag = ({\n tags,\n unit,\n version,\n format = DEFAULT_TAG_FORMAT,\n}: {\n tags: ReadonlySet<string>;\n unit: string;\n version: string;\n format?: string;\n}) => {\n const [before = \"\", after = \"\"] = tagName(unit, \"\\0\", format).split(\"\\0\");\n const [newest] = [...tags]\n .filter((tag) => tag.startsWith(before) && tag.endsWith(after))\n .map((tag) => tag.slice(before.length, tag.length - after.length))\n .filter((candidate) => /^\\d/.test(candidate) && compareVersions(candidate, version) < 0)\n .sort((left, right) => compareVersions(right, left));\n return newest === undefined ? null : tagName(unit, newest, format);\n};\n\nexport interface TagCandidate {\n /** The unit's name. */\n app: string;\n version: string;\n /** The commit that brought this version, as `git log -S` finds it. */\n commit: { sha: string; subject: string };\n /** No version of the unit was ever tagged: the commit that added it brings its first release. */\n first?: boolean;\n}\n\n/**\n * No tag names any version of the unit yet: the version it holds is its first release. 0.0.0 is a\n * unit never versioned, waiting for its first changeset.\n */\nexport const firstRelease = (\n app: string,\n version: string,\n tags: ReadonlySet<string>,\n format: string = DEFAULT_TAG_FORMAT,\n) => {\n const prefix = tagName(app, \"\", format);\n return version !== \"0.0.0\" && ![...tags].some((tag) => tag.startsWith(prefix));\n};\n\nexport interface ReleaseTag {\n /** The unit's name. */\n app: string;\n version: string;\n tag: string;\n sha: string;\n needsTag: boolean;\n needsNotes: boolean;\n}\n\nconst literal = (text: string) => text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/** A release pull request's subject: `chore(api): release v0.0.4`, or `chore(release): ...` for several. */\nexport const isReleaseSubject = (subject: string) =>\n subject.startsWith(\"chore(release):\") || /^chore\\([^)]+\\): release v\\d/.test(subject);\n\n/**\n * A family a title names by its root brings the root and every `root-*`: `shiplane and 7 plugins\n * v0.1.0` at that version, `shiplane v0.2.0 and 7 plugins` with each plugin at whichever it moved to.\n */\nconst FAMILY =\n /(?:: |, | and )(\\S+?)(?: v(\\S+?))? and \\d+ (?:plugins?|more [a-z ]+?)(?: v(\\S+?))?(?=,| and | \\(#\\d+\\)$|$)/g;\nconst inFamily = (app: string, version: string, subject: string) =>\n [...subject.matchAll(FAMILY)].some(([, root, rootVersion, shared]) => {\n if (!root) return false;\n if (app === root) return (rootVersion ?? shared) === version;\n return app.startsWith(`${root}-`) && (shared === undefined || shared === version);\n });\n\nconst familyRelease = (app: string, subject: string) => {\n const root = /^chore\\(([^)]+)\\): release v\\d/.exec(subject)?.[1];\n return root !== undefined && root !== \"release\" && app.startsWith(`${root}-`);\n};\n\n// Older titles named versions without the v (\"chore(release): api 0.0.3 brings ...\"): both count.\nexport const cameWithRelease = ({ app, version, commit }: TagCandidate) => {\n const exact = `${literal(version)}(?![\\\\w.])`;\n return (\n new RegExp(`^chore\\\\(${literal(app)}\\\\): release v${exact}`).test(commit.subject) ||\n // A family's release names its root alone: each `root-*` came with it, at whatever version.\n familyRelease(app, commit.subject) ||\n (commit.subject.startsWith(\"chore(release):\") &&\n (new RegExp(`(?:: |, | and )${literal(app)} v?${exact}`).test(commit.subject) ||\n // An early release titled by its count alone: the commit that changed the version is it.\n /^chore\\(release\\): \\d+ (?:(?:web |mobile )?apps?|packages?|services?|tools?)(?: \\(#\\d+\\))?$/.test(\n commit.subject,\n ) ||\n inFamily(app, version, commit.subject)))\n );\n};\n\n/** The tags and release notes still missing for the versions releases brought. */\nexport const releaseTags = (\n candidates: TagCandidate[],\n tags: Set<string>,\n notes: Set<string>,\n format: string = DEFAULT_TAG_FORMAT,\n): ReleaseTag[] =>\n candidates\n .filter((candidate) => candidate.first === true || cameWithRelease(candidate))\n .flatMap(({ app, version, commit }) => {\n const tag = tagName(app, version, format);\n const needsTag = !tags.has(tag);\n const needsNotes = !notes.has(tag);\n return needsTag || needsNotes\n ? [{ app, version, tag, sha: commit.sha, needsTag, needsNotes }]\n : [];\n });\n\n/** One version's section of a changesets CHANGELOG.md, used as its release notes. */\nexport const changelogSection = (changelog: string, version: string) => {\n const section = changelog.split(`\\n## ${version}\\n`)[1]?.split(\"\\n## \")[0]?.trim();\n return section || `No changelog entry for ${version}.`;\n};\n","/** A unit as changesets know it: its name here, its package name there. */\nexport interface UnitRef {\n name: string;\n packageName: string;\n}\n\nexport type BumpType = \"major\" | \"minor\" | \"patch\" | \"none\";\n\n/** A bump that moves a version. */\nexport type BumpLevel = Exclude<BumpType, \"none\">;\n\n/** One changeset, as `changeset status --output` lists it. */\nexport interface PlannedChangeset {\n id: string;\n summary: string;\n releases: { name: string; type: BumpType }[];\n}\n\n/** One package's version move, as `changeset status --output` lists it. */\nexport interface PlannedRelease {\n name: string;\n type: BumpType;\n oldVersion: string;\n newVersion: string;\n /** Empty when the package only moves because a workspace dependency did. */\n changesets: string[];\n}\n\nexport interface StatusPlan {\n changesets: PlannedChangeset[];\n releases: PlannedRelease[];\n}\n\nexport interface AppBump {\n /** The unit's name. */\n app: string;\n from: string;\n to: string;\n /** What the app's users get: the summaries of the changesets naming it. */\n notes: string[];\n /** The workspace packages it moves with, when no changeset names it. */\n movedWith: string[];\n}\n\n/** The units a release moves, in `units` order, each with its notes or the packages it moves with. */\nexport const appBumps = (\n { changesets, releases }: StatusPlan,\n dependencies: Record<string, string[]>,\n units: readonly UnitRef[],\n): AppBump[] => {\n const moving = new Set(releases.map(({ name }) => name));\n return units.flatMap(({ name: app, packageName }) => {\n const release = releases.find(({ name }) => name === packageName);\n if (!release) return [];\n const notes = changesets\n .filter(({ id }) => release.changesets.includes(id))\n .map(({ summary }) => summary);\n const movedWith =\n notes.length > 0 ? [] : (dependencies[release.name] ?? []).filter((dep) => moving.has(dep));\n return [{ app, from: release.oldVersion, to: release.newVersion, notes, movedWith }];\n });\n};\n\n/** How many internal packages a release moves: they get changelogs, nothing ships. */\nexport const packageBumps = ({ releases }: StatusPlan, units: readonly UnitRef[]) =>\n releases.filter(({ name }) => !units.some(({ packageName }) => packageName === name)).length;\n\n/**\n * Holding an app back keeps its lines pending, with any package line they came with so the package\n * does not drag the held app along. The picked apps' lines ship under the same summary.\n */\nexport const splitChangesets = (\n changesets: PlannedChangeset[],\n held: readonly string[],\n units: readonly UnitRef[],\n) => {\n const packageOf = (name: string) => units.find((unit) => unit.name === name)?.packageName;\n const heldNames = new Set(held.map(packageOf));\n const isUnit = (name: string) => units.some(({ packageName }) => packageName === name);\n return changesets.reduce<{ ships: PlannedChangeset[]; waits: PlannedChangeset[] }>(\n (split, changeset) => {\n if (!changeset.releases.some(({ name }) => heldNames.has(name))) {\n return { ...split, ships: [...split.ships, changeset] };\n }\n const picked = changeset.releases.filter(({ name }) => isUnit(name) && !heldNames.has(name));\n const waiting = changeset.releases.filter(\n ({ name }) => !picked.some((line) => line.name === name),\n );\n return {\n ships:\n picked.length > 0 ? [...split.ships, { ...changeset, releases: picked }] : split.ships,\n waits: [...split.waits, { ...changeset, releases: waiting }],\n };\n },\n { ships: [], waits: [] },\n );\n};\n\n/** The units a changeset file releases, read from its frontmatter. */\nexport const changesetApps = (text: string, units: readonly UnitRef[]): string[] => {\n const frontmatter = text.split(\"---\")[1] ?? \"\";\n return units\n .filter(({ packageName }) => frontmatter.includes(`\"${packageName}\":`))\n .map(({ name }) => name);\n};\n","import type { Environment } from \"./environment\";\n\n/** The run name the deploy workflows set, so the Actions list says which version went where. */\nexport const deployRunTitle = (tag: string, environment: Environment) =>\n `Deploy ${tag} to ${environment}`;\n\nexport type DeployState = \"none\" | \"running\" | \"done\";\n\n// INACTIVE: a later deploy to the same environment superseded a successful one.\nconst DEPLOYED = new Set([\"SUCCESS\", \"ACTIVE\", \"INACTIVE\"]);\nconst DEPLOYING = new Set([\"IN_PROGRESS\", \"QUEUED\", \"PENDING\", \"WAITING\"]);\n\n/** One version on one environment, from the states of its GitHub deployments. */\nexport const deployState = (states: string[]): DeployState => {\n if (states.some((state) => DEPLOYED.has(state))) return \"done\";\n return states.some((state) => DEPLOYING.has(state)) ? \"running\" : \"none\";\n};\n\nexport type WebShip = \"deploy\" | \"deploying\" | \"shipped\" | \"not-on-preview\";\n\n/** What one web app's tagged version still needs on an environment. */\nexport const webShip = ({\n environment,\n run,\n onPreview,\n}: {\n environment: Environment;\n /** Its deploy on that environment: none yet, queued or waiting on the approval gate, or done. */\n run: DeployState;\n onPreview: boolean;\n}): WebShip => {\n if (run === \"done\") return \"shipped\";\n if (run === \"running\") return \"deploying\";\n if (environment === \"production\" && !onPreview) return \"not-on-preview\";\n return \"deploy\";\n};\n\n/** Whether a diff only moves version files: the code is still the code a release named. */\nexport const onlyVersionFiles = (files: string[], versionFiles: ReadonlySet<string>) =>\n files.every((file) => versionFiles.has(file));\n\n/** How a unit ships: through the flow's CI pipeline, or from this machine. */\nexport type DeployPath = \"ci\" | \"local\";\n\n/** How this run deploys: --via when given, the CI pipeline under --yes, otherwise asked (null). */\nexport const deployVia = ({ via, yes }: { via: DeployPath | undefined; yes: boolean }) =>\n via ?? (yes ? (\"ci\" as const) : null);\n\nexport interface ShipItem {\n /** The unit's name. */\n app: string;\n tag: string;\n /** An EAS build, an over-the-air update, or a web deploy. */\n kind: \"build\" | \"update\" | \"deploy\";\n}\n\n/** An EAS build runs on EAS whichever way: only updates and web deploys have a path to pick. */\nexport const needsPath = (items: ShipItem[]) => items.some(({ kind }) => kind !== \"build\");\n\n/** This machine builds its checkout, so it ships only while that is the tagged code. */\nexport const shipsFrom = (\n path: DeployPath,\n { sinceTagOnlyVersionFiles }: { sinceTagOnlyVersionFiles: boolean },\n) => path === \"ci\" || sinceTagOnlyVersionFiles;\n","export interface RunOptions {\n cwd?: string;\n env?: Record<string, string>;\n input?: string;\n}\n\nexport interface ShellResult {\n status: number;\n stdout: string;\n stderr: string;\n}\n\n/** Every vendor tool this CLI drives (git, gh, eas, flyctl, wrangler) goes through here. */\nexport interface Shell {\n /** Runs and captures its output; a non-zero exit is a result, never an error. */\n capture: (command: string, args: readonly string[], options?: RunOptions) => Promise<ShellResult>;\n /** Runs in the person's terminal with its output shown; resolves with the exit status. */\n attach: (command: string, args: readonly string[], options?: RunOptions) => Promise<number>;\n /** A variable of this process's environment, such as a token a command needs. */\n env: (name: string) => string | undefined;\n /** Puts a folder first on this process's PATH, so the commands run after it find a tool there. */\n prependPath?: (dir: string) => void;\n}\n\n/** A command that exited non-zero, carrying all it printed so a failure can show why. */\nexport class CommandFailed extends Error {\n readonly output: string;\n\n constructor(message: string, output: string) {\n super(message);\n this.name = \"CommandFailed\";\n this.output = output;\n }\n}\n","import type { Environment } from \"./environment\";\n\nexport type ReleaseIntent = \"build\" | \"update\" | \"submit\";\n\nexport interface GitPosition {\n branch: string;\n head: string;\n /** The default branch on origin after a fetch: origin/main, or origin/master. The name stays. */\n originMain: string;\n}\n\nexport type SourceResult = { allowed: true } | { allowed: false; why: \"not-main\" | \"behind-main\" };\n\n/**\n * A binary ships what it was built from, so builds start from the default branch (main, or\n * master) as it is on origin, or from exactly the commit the release tagged (a runner checked out\n * at the tag, retrying it). Preview updates may come from a branch for testers; production updates\n * only from the default branch.\n */\nexport const releaseSource = (\n intent: ReleaseIntent,\n channel: Environment,\n { branch, head, originMain }: GitPosition,\n {\n tagCommit = null,\n defaultBranch = \"main\",\n }: { tagCommit?: string | null; defaultBranch?: string } = {},\n): SourceResult => {\n const needsMain = intent === \"build\" || (intent === \"update\" && channel === \"production\");\n if (!needsMain || head === tagCommit) return { allowed: true };\n if (branch !== defaultBranch) return { allowed: false, why: \"not-main\" };\n if (head !== originMain) return { allowed: false, why: \"behind-main\" };\n return { allowed: true };\n};\n\n/** Where `pnpm shiplane` goes: --channel when given, preview under --yes or with no terminal, else asked. */\nexport const channelChoice = ({\n flag,\n yes,\n interactive,\n}: {\n flag: Environment | undefined;\n yes: boolean;\n interactive: boolean;\n}): Environment | null => flag ?? (yes || !interactive ? \"preview\" : null);\n\n/** Production never runs a step nobody confirmed. */\nexport const yesAllowed = (channel: Environment, yes: boolean) =>\n !(yes && channel === \"production\");\n","import type { ShipItem } from \"./deploys\";\n\n// Minutes a private repository's plan includes each month, and how GitHub weighs each runner.\nconst INCLUDED_MINUTES: Record<string, number> = { free: 2000, team: 3000, enterprise: 50000 };\nconst MINUTE_WEIGHT: Record<string, number> = { actions_windows: 2, actions_macos: 10 };\n\nexport interface ActionsMinutes {\n used: number;\n included: number;\n left: number;\n}\n\n/** This month's Actions minutes against the plan's allowance, from GitHub's usage summary. */\nexport const actionsMinutes = (\n plan: string,\n usage: { sku: string; grossQuantity: number; unitType: string }[],\n): ActionsMinutes | null => {\n const included = INCLUDED_MINUTES[plan];\n if (!included) return null;\n const used = Math.round(\n usage\n .filter(({ unitType }) => unitType === \"minutes\")\n .reduce((sum, { sku, grossQuantity }) => sum + grossQuantity * (MINUTE_WEIGHT[sku] ?? 1), 0),\n );\n return { used, included, left: Math.max(0, included - used) };\n};\n\nexport interface MinutesBudget {\n tone: \"green\" | \"yellow\" | \"red\";\n title: string;\n /** What is left, with what this release will spend shaded in. */\n bar: string;\n amount: string;\n pace: string;\n /** The status chip: enough, running short, or about to run out. */\n status: string;\n /** What is left after this release, or null when it spends nothing on GitHub. */\n after: string | null;\n}\n\nconst LOW_MINUTES = 100;\n\nconst STATUS: Record<MinutesBudget[\"tone\"], string> = {\n green: \"● enough minutes this month\",\n yellow: \"● running short this month\",\n red: \"● about to run out: deploy from this machine\",\n};\n\n/**\n * The minutes as the deploy question draws them: a bar of what is left, what this release spends,\n * and where this month ends if the pace so far holds. GitHub resets the allowance on the 1st, UTC.\n */\nexport const minutesBudget = (\n budget: ActionsMinutes,\n now: Date,\n width = 30,\n spend = 0,\n label = \"CI\",\n): MinutesBudget => {\n const { used, included, left } = budget;\n const start = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1);\n const end = Date.UTC(now.getUTCFullYear(), now.getUTCMonth() + 1, 1);\n const elapsed = Math.max((now.getTime() - start) / (end - start), 1 / (31 * 24));\n const projected = Math.round(used / elapsed) + spend;\n const leftAfter = Math.max(0, left - spend);\n const month = (format: Intl.DateTimeFormatOptions) =>\n new Date(start).toLocaleDateString(\"en-US\", { ...format, timeZone: \"UTC\" });\n const lastDay = new Date(end - 1).getUTCDate();\n const filled = Math.round((left / included) * width);\n const filledAfter = Math.round((leftAfter / included) * width);\n const number = (value: number) => value.toLocaleString(\"en-US\");\n const tone: MinutesBudget[\"tone\"] =\n leftAfter < LOW_MINUTES\n ? \"red\"\n : leftAfter / included < 0.5 || projected > included\n ? \"yellow\"\n : \"green\";\n const pace = `At this pace${spend > 0 ? \", with this release,\" : \"\"} about ${number(projected)} used by ${month({ month: \"long\" })} ${lastDay}`;\n return {\n tone,\n title: `${label} minutes · ${month({ month: \"long\", year: \"numeric\" })}`,\n bar: `${\"█\".repeat(filledAfter)}${\"▒\".repeat(filled - filledAfter)}${\"░\".repeat(width - filled)}`,\n amount: `${number(left)} of ${number(included)} left · ${Math.round((used / included) * 100)}% used`,\n pace:\n projected > included\n ? `${pace}, over the ${number(included)} included: prefer this machine.`\n : `${pace}, within the ${number(included)} included.`,\n status: STATUS[tone],\n after:\n spend > 0\n ? `This release: about ${spend} min on ${label}, about ${number(leftAfter)} left after it`\n : null,\n };\n};\n\n/** Minutes GitHub bills for a run: each job rounds up to the minute; unfinished jobs are skipped. */\nexport const billedMinutes = (jobs: { startedAt: string | null; completedAt: string | null }[]) =>\n jobs.reduce((sum, { startedAt, completedAt }) => {\n if (!startedAt || !completedAt) return sum;\n const seconds = (Date.parse(completedAt) - Date.parse(startedAt)) / 1000;\n return sum + Math.max(1, Math.ceil(seconds / 60));\n }, 0);\n\n// A deploy with no measured run and no typical figure: about what a small web deploy bills.\nconst FALLBACK_MINUTES = 5;\n\n/**\n * What the GitHub path costs for these items: each workflow's recent runs when measured, typical\n * figures otherwise. An EAS build runs on EAS and costs no Actions minutes.\n */\nexport const deployEstimate = (\n items: ShipItem[],\n measured: Partial<Record<string, number[]>>,\n typical: Record<string, number>,\n) => {\n const lines = items\n .filter(({ kind }) => kind !== \"build\")\n .map(({ app }) => {\n const runs = measured[app] ?? [];\n return runs.length > 0\n ? { app, minutes: Math.ceil(runs.reduce((a, b) => a + b, 0) / runs.length), measured: true }\n : { app, minutes: typical[app] ?? FALLBACK_MINUTES, measured: false };\n });\n return { total: lines.reduce((sum, { minutes }) => sum + minutes, 0), lines };\n};\n","export const MOODS = [\"thinking\", \"working\", \"waiting\", \"happy\", \"worried\", \"resting\"] as const;\n\n/** What the mascot shows beside the release: reading, running, waiting on a person, done, failed, idle. */\nexport type Mood = (typeof MOODS)[number];\n\n// Spines that rise and fall, a face, then what he holds: every frame is 13 characters wide.\nconst UP = \"/\\\\/\\\\/\";\nconst DOWN = \"\\\\/\\\\/\\\\\";\n\nconst FRAMES: Record<Mood, readonly string[]> = {\n thinking: [`${UP}(•ω•) ? `, `${UP}(•ω•) ?`, `${DOWN}(•ω•) ? `, `${DOWN}(•ω•) `],\n working: [`${UP}(•ω•)/ `, `${UP}(•ω•)- `, `${DOWN}(•ω•)\\\\ `, `${DOWN}(•ω•)| `],\n waiting: [`${UP}(-ω-) z `, `${UP}(-ω-) zz`, `${UP}(•ω•) `, `${UP}(-ω-) zZ`],\n happy: [`${UP}(^ω^) ✦ `, `${DOWN}(^ω^) ✧ `, `${UP}(^ω^)✦ ✧`, `${DOWN}(^ω^) ✧ `],\n worried: [`${UP}(°ω°) ; `, `${DOWN}(°ω°) ;;`],\n resting: [`${UP}(-ω-) zZ`, `${UP}(-ω-) z`],\n};\n\nexport const mascotFrames = (mood: Mood) => FRAMES[mood];\n\n/** The mascot at a tick of his animation, looping. */\nexport const mascotFrame = (mood: Mood, tick: number) => {\n const frames = FRAMES[mood];\n return frames[tick % frames.length] ?? \"\";\n};\n\n/** `done` of `total` as a bar `width` characters wide. */\nexport const progressBar = (done: number, total: number, width: number) => {\n const filled = total <= 0 ? width : Math.round((width * Math.min(done, total)) / total);\n return `${\"█\".repeat(filled)}${\"░\".repeat(width - filled)}`;\n};\n\n/** What is happening when the mascot is drawn. */\nexport interface MascotMoment {\n mood: Mood;\n /** Its animation frame, from 0; always 0 when motion is off. */\n tick: number;\n /** What runs right now, such as \"build 3 apps\" or \"deploy api@1.2.0 to production\". */\n label: string;\n}\n\n/**\n * A mascot of your own: frames per mood, looped as it animates, or a function drawing each moment.\n * Plain text: shiplane colours it by mood, pads it to one width, and takes any mood a set of frames\n * leaves out from the hedgehog.\n */\nexport type Mascot = Partial<Record<Mood, readonly string[]>> | ((moment: MascotMoment) => string);\n\n/** A mascot ready to draw: every mood, one width. */\nexport interface MascotDrawing {\n /** True for the built-in hedgehog, coloured part by part. */\n readonly hedgehog: boolean;\n /** Columns every frame takes. */\n readonly width: number;\n /** How many frames a mood loops through. */\n frames: (mood: Mood) => number;\n draw: (moment: MascotMoment) => string;\n}\n\nconst columns = (text: string) => [...text].length;\nconst pad = (text: string, width: number) => text + \" \".repeat(Math.max(0, width - columns(text)));\n\n/** Any mascot as a drawing: frames merged over the hedgehog's, a function sampled for its width. */\nexport const drawingOf = (mascot: Mascot | true): MascotDrawing => {\n if (typeof mascot === \"function\") {\n const sample = MOODS.flatMap((mood) =>\n [0, 1, 2, 3].map((tick) => columns(mascot({ mood, tick, label: \"\" }))),\n );\n const width = Math.max(0, ...sample);\n return {\n hedgehog: false,\n width,\n frames: () => 4,\n draw: (moment) => pad(mascot(moment), width),\n };\n }\n const own = mascot === true ? {} : mascot;\n const frames = Object.fromEntries(\n MOODS.map((mood) => {\n const given = own[mood];\n return [mood, given && given.length > 0 ? given : FRAMES[mood]];\n }),\n ) as Record<Mood, readonly string[]>;\n const width = Math.max(...Object.values(frames).flat().map(columns));\n return {\n hedgehog: mascot === true,\n width,\n frames: (mood) => frames[mood].length,\n draw: ({ mood, tick }) => pad(frames[mood][tick % frames[mood].length] ?? \"\", width),\n };\n};\n\n/** How much the release says while it runs, as `shiplane.config.ts` or a flag asks. */\nexport interface DisplayChoice {\n /** Says each thing it reads and runs, with a progress bar. */\n verbose?: boolean;\n /** The mascot beside what is happening: the hedgehog (true), none (false), or your own. */\n mascot?: boolean | Mascot;\n}\n\nexport interface Display {\n verbose: boolean;\n /** The mascot to draw, or null for none. */\n mascot: MascotDrawing | null;\n /** The mascot animates: only in a terminal, never in a CI log or under NO_MOTION. */\n motion: boolean;\n}\n\n/** A flag wins over the config, which wins over the default: verbose, with the mascot. */\nexport const resolveDisplay = (\n config: DisplayChoice,\n flags: DisplayChoice,\n terminal: { tty: boolean; ci: boolean; noMotion: boolean },\n): Display => {\n const verbose = flags.verbose ?? config.verbose ?? true;\n // A flag turns it on or off; which mascot comes from the config, the hedgehog when it says none.\n const configured = config.mascot ?? true;\n const chosen =\n flags.mascot === undefined\n ? configured\n : flags.mascot !== false && (configured === false ? true : configured);\n const mascot = chosen === false ? null : drawingOf(chosen);\n return {\n verbose,\n mascot,\n motion: mascot !== null && terminal.tty && !terminal.ci && !terminal.noMotion,\n };\n};\n"],"mappings":";;;;;AAKA,MAAM,sBAAsB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,SAAS;AAC5F,MAAM,0BAA0B,EAAE,OAAO,EACvC,YAAY,EACT,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CACzE,UAAU,EACd,CAAC;;AAWF,MAAa,cAAc,UAAmC;CAC5D,OAAO,SAAS;EACd,MAAM,WAAW,KAAK,KAAK,MAAM,KAAK;AACtC,SAAO,GAAG,WAAW,SAAS,GAAG,GAAG,aAAa,UAAU,OAAO,GAAG;;CAEvE,UAAU,QAAQ;EAChB,MAAM,WAAW,KAAK,KAAK,MAAM,IAAI;AACrC,MAAI,CAAC,GAAG,WAAW,SAAS,CAAE,QAAO,EAAE;AACvC,SAAO,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