shiplane 0.1.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.
Files changed (39) hide show
  1. package/dist/{budget-C8_aayQk.js → budget-BqtW-Ekk.js} +53 -26
  2. package/dist/budget-BqtW-Ekk.js.map +1 -0
  3. package/dist/cli.js +81 -36
  4. package/dist/cli.js.map +1 -1
  5. package/dist/display-IqkJ6uCw.js +96 -0
  6. package/dist/display-IqkJ6uCw.js.map +1 -0
  7. package/dist/index-D4qsXAis.d.ts +214 -0
  8. package/dist/index.d.ts +3 -2
  9. package/dist/index.js +4 -3
  10. package/dist/{issues-C5fKq1Jv.js → issues-TcWtMTv5.js} +1 -1
  11. package/dist/{issues-C5fKq1Jv.js.map → issues-TcWtMTv5.js.map} +1 -1
  12. package/dist/memory.d.ts +2 -0
  13. package/dist/memory.js +2 -0
  14. package/dist/package-registry.fake-CC37ptzf.d.ts +444 -0
  15. package/dist/package-registry.fake-Ciqc4ujx.js +633 -0
  16. package/dist/package-registry.fake-Ciqc4ujx.js.map +1 -0
  17. package/dist/perEnv-B7AiYnW_.js +11 -0
  18. package/dist/perEnv-B7AiYnW_.js.map +1 -0
  19. package/dist/plugin.d.ts +13 -5
  20. package/dist/plugin.js +7 -6
  21. package/dist/{readStatus-D5YVR5ZC.js → readStatus-YTZXH_Hh.js} +1387 -519
  22. package/dist/readStatus-YTZXH_Hh.js.map +1 -0
  23. package/dist/{shell-server-hosting.adapter-Bgl6-IWw.js → shell-server-hosting.adapter-DobfDqFm.js} +2 -2
  24. package/dist/{shell-server-hosting.adapter-Bgl6-IWw.js.map → shell-server-hosting.adapter-DobfDqFm.js.map} +1 -1
  25. package/dist/{src-Dlr2Sgs8.js → src-CGASfBy2.js} +3 -3
  26. package/dist/{src-Dlr2Sgs8.js.map → src-CGASfBy2.js.map} +1 -1
  27. package/dist/{index-QneBUiDD.d.ts → static-hosting.port-mknLsxwR.d.ts} +61 -244
  28. package/dist/{tags-DL74ni09.d.ts → tags-Bn3JrgPI.d.ts} +1 -1
  29. package/dist/testing.d.ts +61 -468
  30. package/dist/testing.js +11 -625
  31. package/dist/testing.js.map +1 -1
  32. package/dist/{web-app.module-Bw-npC4Z.js → web-app.module-6KrXIU7j.js} +4 -11
  33. package/dist/web-app.module-6KrXIU7j.js.map +1 -0
  34. package/package.json +6 -1
  35. package/dist/budget-C8_aayQk.js.map +0 -1
  36. package/dist/display-DM0xtQbT.js +0 -55
  37. package/dist/display-DM0xtQbT.js.map +0 -1
  38. package/dist/readStatus-D5YVR5ZC.js.map +0 -1
  39. package/dist/web-app.module-Bw-npC4Z.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-registry.fake-Ciqc4ujx.js","names":[],"sources":["../src/adapters/source-control/__fakes__/source-control.fake.ts","../src/adapters/code-host/__fakes__/code-host.fake.ts","../src/adapters/ci-pipeline/__fakes__/ci-pipeline.fake.ts","../src/adapters/versioning/__fakes__/versioning.fake.ts","../src/adapters/server-hosting/__fakes__/server-hosting.fake.ts","../src/adapters/static-hosting/__fakes__/static-hosting.fake.ts","../src/adapters/mobile-distribution/__fakes__/mobile-distribution.fake.ts","../src/adapters/package-registry/__fakes__/package-registry.fake.ts"],"sourcesContent":["import type { GitPosition } from \"../../../domain/governance\";\nimport type { ServiceAdapter } from \"../../../ports/adapter.port\";\nimport type { SourceControlPort } from \"../../../ports/source-control.port\";\n\ninterface SourceState {\n position: GitPosition;\n clean: boolean;\n /** Tag name → the commit it points at. */\n tags: Record<string, string>;\n /** `<dir>@<version>` → the commit that brought that version. */\n versionCommits: Record<string, { sha: string; subject: string }>;\n /** `<sha>:<dir>` → subjects of the commits since, newest first. */\n subjects: Record<string, string[]>;\n /** `<ref>:<file>` → its text at that ref. */\n files: Record<string, string>;\n /** `<from>..<to>` → the files that differ. */\n diffs: Record<string, string[]>;\n /** `<from>..<to>` → the commits after `from` up to `to`, newest first. */\n commits: Record<string, { subject: string; files: string[] }[]>;\n changed: string[];\n}\n\nexport type SourceEvent =\n | { type: \"branch\"; name: string }\n | { type: \"switch\"; branch: string }\n | { type: \"commit\"; files: string[]; title: string; body?: string }\n | { type: \"push\"; branch: string }\n | { type: \"pull\" }\n | { type: \"tag\"; name: string; sha: string; message: string }\n | { type: \"push-tags\"; names: string[] }\n | { type: \"discard\"; files: string[] }\n | { type: \"delete-branch\"; name: string }\n | { type: \"delete-remote\"; branch: string }\n | { type: \"delete-tag\"; name: string };\n\n/** A repository held in memory: seed what it contains, read back what it received. */\nexport class SourceControlFake implements SourceControlPort {\n private state: SourceState = {\n position: { branch: \"main\", head: \"head\", originMain: \"head\" },\n clean: true,\n tags: {},\n versionCommits: {},\n subjects: {},\n files: {},\n diffs: {},\n commits: {},\n changed: [],\n };\n\n readonly received: SourceEvent[] = [];\n private failures: { type: SourceEvent[\"type\"]; nth: number; error: Error }[] = [];\n\n seed(state: Partial<SourceState>) {\n this.state = { ...this.state, ...state };\n return this;\n }\n\n /** The `nth` call of this kind throws `error`, after it is recorded. */\n failAt(type: SourceEvent[\"type\"], nth: number, error: Error) {\n this.failures.push({ type, nth, error });\n return this;\n }\n\n private record(event: SourceEvent) {\n this.received.push(event);\n const count = this.received.filter(({ type }) => type === event.type).length;\n const failure = this.failures.find(({ type, nth }) => type === event.type && nth === count);\n return failure ? Promise.reject(failure.error) : Promise.resolve();\n }\n\n position = () => Promise.resolve(this.state.position);\n isClean = () => Promise.resolve(this.state.clean);\n tagCommit = (tag: string) => Promise.resolve(this.state.tags[tag] ?? null);\n versionCommit = (dir: string, _manifest: string, version: string) =>\n Promise.resolve(this.state.versionCommits[`${dir}@${version}`] ?? null);\n subjectsSince = (sha: string, dir: string) =>\n Promise.resolve(this.state.subjects[`${sha}:${dir}`] ?? []);\n changedFiles = () => Promise.resolve(this.state.changed);\n diffNames = (from: string, to: string) =>\n Promise.resolve(this.state.diffs[`${from}..${to}`] ?? []);\n commitsBetween = (from: string, to: string) =>\n Promise.resolve(this.state.commits[`${from}..${to}`] ?? []);\n fileAt = (ref: string, file: string) =>\n Promise.resolve(this.state.files[`${ref}:${file}`] ?? null);\n tags = () => Promise.resolve(new Set(Object.keys(this.state.tags)));\n\n createBranch = async (name: string) => {\n await this.record({ type: \"branch\", name });\n this.state.position = { ...this.state.position, branch: name };\n };\n\n switchTo = async (branch: string) => {\n await this.record({ type: \"switch\", branch });\n this.state.position = { ...this.state.position, branch };\n };\n\n commit = async (\n files: string[],\n title: string,\n body?: string,\n { skipHooks = false }: { skipHooks?: boolean } = {},\n ) => {\n await this.record({ type: \"commit\", files, title, body, ...(skipHooks ? { skipHooks } : {}) });\n this.state.changed = this.state.changed.filter((file) => !files.includes(file));\n };\n\n push = (branch: string) => this.record({ type: \"push\", branch });\n\n pull = () => this.record({ type: \"pull\" });\n\n tag = async (name: string, sha: string, message: string) => {\n await this.record({ type: \"tag\", name, sha, message });\n this.state.tags[name] = sha;\n };\n\n pushTags = (names: string[]) => this.record({ type: \"push-tags\", names });\n\n discard = async (files: string[]) => {\n await this.record({ type: \"discard\", files });\n this.state.changed = this.state.changed.filter((file) => !files.includes(file));\n };\n\n deleteBranch = (name: string) => this.record({ type: \"delete-branch\", name });\n\n deleteRemoteBranch = (branch: string) => this.record({ type: \"delete-remote\", branch });\n\n deleteTag = async (name: string) => {\n await this.record({ type: \"delete-tag\", name });\n this.state.tags = Object.fromEntries(\n Object.entries(this.state.tags).filter(([tag]) => tag !== name),\n );\n };\n}\n\n/** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */\nexport const sourceControlFake = (\n fake = new SourceControlFake(),\n): ServiceAdapter<SourceControlPort> & { fake: SourceControlFake } => ({\n name: \"fake\",\n create: () => fake,\n fake,\n});\n","import type { Environment } from \"../../../domain/environment\";\nimport type { IssueRef, LinkedPr } from \"../../../domain/issues\";\nimport type { MergeMethod, MergeMethods, OpenPr } from \"../../../domain/releasePr\";\nimport type { ServiceAdapter } from \"../../../ports/adapter.port\";\nimport type { CodeHostPort, Deploy } from \"../../../ports/code-host.port\";\nimport { issueName } from \"../../../domain/issues\";\n\ninterface HostState {\n openPrs: { branch: string; pr: OpenPr }[];\n /** States a pull request goes through, one per poll; the last one stays. */\n prStates: Record<number, (\"OPEN\" | \"MERGED\" | \"CLOSED\")[]>;\n /** The merge methods the repository allows, and the one its pull request page preselects. */\n merges: MergeMethods;\n releasedTags: string[];\n deployments: Deploy[];\n nextPrNumber: number;\n /** Merged pull requests by number, as a release reads their linked issues. */\n pullRequests: Record<number, LinkedPr>;\n /** `owner/name#123` → the text of its comments. */\n comments: Record<string, string[]>;\n}\n\nexport type HostEvent =\n | {\n type: \"pr\";\n pr: OpenPr;\n base: string;\n head: string;\n title: string;\n body: string;\n label: string;\n }\n | { type: \"merge\"; pr: OpenPr; method: MergeMethod }\n | { type: \"close\"; pr: OpenPr; comment: string }\n | { type: \"release\"; tag: string; notes: string; latest: boolean }\n | { type: \"record\"; ref: string; environment: Environment }\n | { type: \"comment\"; issue: string; body: string };\n\n/** A code host held in memory: seed its pull requests and deploys, read back what it received. */\nexport class CodeHostFake implements CodeHostPort {\n private state: HostState = {\n openPrs: [],\n prStates: {},\n merges: { allowed: [\"--squash\", \"--merge\", \"--rebase\"], preselected: \"--squash\" },\n releasedTags: [],\n deployments: [],\n nextPrNumber: 1800,\n pullRequests: {},\n comments: {},\n };\n\n readonly received: HostEvent[] = [];\n /** Each pull request number, once per state check. */\n readonly polled: number[] = [];\n /** Each batched read of pull requests or comments, in order. */\n readonly reads: (\"pull-requests\" | \"comments\")[] = [];\n\n seed(state: Partial<HostState>) {\n this.state = { ...this.state, ...state };\n return this;\n }\n\n openPrsFrom = (branchPrefix: string) =>\n Promise.resolve(\n this.state.openPrs\n .filter(({ branch }) => branch.startsWith(branchPrefix))\n .map(({ pr }) => pr),\n );\n\n private createError: Error | null = null;\n\n /** Every pull request open throws `error`. */\n failCreate(error: Error) {\n this.createError = error;\n return this;\n }\n\n createPr = (pr: { base: string; head: string; title: string; body: string; label: string }) => {\n if (this.createError) return Promise.reject(this.createError);\n const number = this.state.nextPrNumber++;\n const created = {\n number,\n url: `https://github.com/acme/repo/pull/${number}`,\n head: `sha-${number}`,\n };\n this.received.push({ type: \"pr\", pr: created, ...pr });\n this.state.openPrs.push({ branch: pr.head, pr: created });\n return Promise.resolve(created);\n };\n\n private closeError: Error | null = null;\n\n /** Every pull request close throws `error`. */\n failClose(error: Error) {\n this.closeError = error;\n return this;\n }\n\n closePr = (pr: OpenPr, comment: string) => {\n if (this.closeError) return Promise.reject(this.closeError);\n this.received.push({ type: \"close\", pr, comment });\n this.state.openPrs = this.state.openPrs.filter((open) => open.pr.number !== pr.number);\n this.state.prStates[pr.number] = [\"CLOSED\"];\n return Promise.resolve();\n };\n\n prState = (pr: OpenPr) => {\n this.polled.push(pr.number);\n const states = this.state.prStates[pr.number] ?? [\"OPEN\"];\n const [state = \"OPEN\", ...rest] = states;\n if (rest.length > 0) this.state.prStates[pr.number] = rest;\n return Promise.resolve(state);\n };\n\n mergeMethods = () => Promise.resolve(this.state.merges);\n\n merge = (pr: OpenPr, method: MergeMethod) => {\n this.received.push({ type: \"merge\", pr, method });\n this.state.prStates[pr.number] = [\"MERGED\"];\n return Promise.resolve();\n };\n\n showDiff = () => Promise.resolve();\n openInBrowser = () => Promise.resolve();\n releasedTags = () => Promise.resolve(new Set(this.state.releasedTags));\n\n private releaseError: Error | null = null;\n\n /** Every release notes publish throws `error`. */\n failRelease(error: Error) {\n this.releaseError = error;\n return this;\n }\n\n createRelease = (tag: string, notes: string, latest: boolean) => {\n if (this.releaseError) return Promise.reject(this.releaseError);\n this.received.push({ type: \"release\", tag, notes, latest });\n this.state.releasedTags.push(tag);\n return Promise.resolve();\n };\n\n deployments = () => Promise.resolve(this.state.deployments);\n\n recordDeployment = (ref: string, environment: Environment) => {\n this.received.push({ type: \"record\", ref, environment });\n this.state.deployments.push({ title: `Deploy ${ref} to ${environment}`, state: \"done\" });\n return Promise.resolve();\n };\n\n pullRequests = (numbers: readonly number[]) => {\n this.reads.push(\"pull-requests\");\n const missing = numbers.find((number) => !this.state.pullRequests[number]);\n if (missing !== undefined) return Promise.reject(new Error(`no pull request #${missing}`));\n return Promise.resolve(numbers.flatMap((number) => this.state.pullRequests[number] ?? []));\n };\n\n comments = (on: readonly IssueRef[]) => {\n this.reads.push(\"comments\");\n return Promise.resolve(on.map((ref) => this.state.comments[issueName(ref)] ?? []));\n };\n\n private commentError: Error | null = null;\n\n /** Every comment throws `error`. */\n failComment(error: Error) {\n this.commentError = error;\n return this;\n }\n\n comment = (on: IssueRef, body: string) => {\n if (this.commentError) return Promise.reject(this.commentError);\n this.received.push({ type: \"comment\", issue: issueName(on), body });\n this.state.comments[issueName(on)] = [...(this.state.comments[issueName(on)] ?? []), body];\n return Promise.resolve();\n };\n}\n\n/** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */\nexport const codeHostFake = (\n fake = new CodeHostFake(),\n): ServiceAdapter<CodeHostPort> & { fake: CodeHostFake } => ({\n name: \"fake\",\n create: () => fake,\n fake,\n});\n","import type { ActionsMinutes } from \"../../../domain/budget\";\nimport type { ServiceAdapter } from \"../../../ports/adapter.port\";\nimport type { CiPipelinePort } from \"../../../ports/ci-pipeline.port\";\nimport type { Deploy } from \"../../../ports/code-host.port\";\n\ninterface PipelineState {\n workflowRuns: Record<string, Deploy[]>;\n minutes: ActionsMinutes | null;\n measured: Record<string, number[]>;\n}\n\nexport interface Dispatched {\n type: \"dispatch\";\n workflow: string;\n ref: string;\n inputs: Record<string, string>;\n}\n\n/** A CI pipeline held in memory: seed its runs and minutes, read back what was dispatched. */\nexport class CiPipelineFake implements CiPipelinePort {\n private state: PipelineState = { workflowRuns: {}, minutes: null, measured: {} };\n\n readonly received: Dispatched[] = [];\n\n constructor(readonly shipWorkflow = \"ship.yml\") {}\n\n seed(state: Partial<PipelineState>) {\n this.state = { ...this.state, ...state };\n return this;\n }\n\n workflowRuns = (workflow: string) => Promise.resolve(this.state.workflowRuns[workflow] ?? []);\n\n dispatch = (workflow: string, ref: string, inputs: Record<string, string>) => {\n this.received.push({ type: \"dispatch\", workflow, ref, inputs });\n return Promise.resolve();\n };\n\n minutes = () => Promise.resolve(this.state.minutes);\n measuredMinutes = (workflow: string) => Promise.resolve(this.state.measured[workflow] ?? []);\n}\n\n/** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */\nexport const ciPipelineFake = (\n fake = new CiPipelineFake(),\n): ServiceAdapter<CiPipelinePort> & { fake: CiPipelineFake } => ({\n name: \"fake\",\n create: () => fake,\n fake,\n});\n","import type { PlannedChangeset, StatusPlan } from \"../../../domain/changes\";\nimport type { ServiceAdapter } from \"../../../ports/adapter.port\";\nimport type { VersioningPort } from \"../../../ports/versioning.port\";\n\n/** A changeset as its file reads: one `\"package\": bump` line each, then the summary. */\nconst changesetText = ({ releases, summary }: PlannedChangeset) =>\n `---\\n${releases.map(({ name, type }) => `\"${name}\": ${type}`).join(\"\\n\")}\\n---\\n\\n${summary}\\n`;\n\ntype PlanOf = (added: PlannedChangeset[], held: PlannedChangeset[]) => StatusPlan;\n\ninterface VersioningState {\n pending: { id: string; text: string }[];\n /** What `changeset status` would answer, given what the release adds and holds back. */\n plan: PlanOf;\n dependencies: Record<string, string[]>;\n folders: Record<string, string>;\n}\n\n/** Versioning held in memory: seed the pending changes and the plan, read back what it received. */\nexport class VersioningFake implements VersioningPort {\n private state: VersioningState = {\n pending: [],\n plan: () => ({ changesets: [], releases: [] }),\n dependencies: {},\n folders: {},\n };\n\n readonly applied: { added: PlannedChangeset[]; held: PlannedChangeset[] }[] = [];\n readonly written: PlannedChangeset[] = [];\n\n seed(state: Partial<VersioningState>) {\n this.state = { ...this.state, ...state };\n return this;\n }\n\n pending = () => Promise.resolve(this.state.pending);\n plan = (added: PlannedChangeset[], held: PlannedChangeset[]) =>\n Promise.resolve(this.state.plan(added, held));\n dependencies = () => Promise.resolve(this.state.dependencies);\n folders = () => Promise.resolve(this.state.folders);\n\n apply = (added: PlannedChangeset[], held: PlannedChangeset[]) => {\n this.applied.push({ added, held });\n return Promise.resolve();\n };\n\n write = (changeset: PlannedChangeset) => {\n this.written.push(changeset);\n this.state.pending = [\n ...this.state.pending.filter(({ id }) => id !== changeset.id),\n { id: changeset.id, text: changesetText(changeset) },\n ];\n return Promise.resolve();\n };\n\n changesetFile = (id: string) => `.changeset/${id}.md`;\n changelogFile = (dir: string) => `${dir}/CHANGELOG.md`;\n}\n\n/** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */\nexport const versioningFake = (\n fake = new VersioningFake(),\n): ServiceAdapter<VersioningPort> & { fake: VersioningFake } => ({\n name: \"fake\",\n create: () => fake,\n fake,\n});\n","import { z } from \"zod\";\n\nimport type { Environment } from \"../../../domain/environment\";\nimport type { DeliveryAdapter } from \"../../../ports/adapter.port\";\nimport type { Job, JobInput, Requirement } from \"../../../ports/delivery.port\";\nimport type { ServerHostingPort } from \"../../../ports/server-hosting.port\";\nimport { perEnv } from \"../../../application/config/perEnv\";\n\nconst ServerSettings = z.object({\n service: z.string().describe(\"The service it deploys\"),\n url: perEnv(z.string()).optional().describe(\"Where it answers, for other apps to read\"),\n});\n\nconst Resolved = z.object({ service: z.string() });\n\n/** A deploy a module asked for. */\nexport interface Asked {\n tag: string;\n environment: Environment;\n service: string;\n}\n\n/** A server host held in memory: it deploys nothing, and records each deploy it was asked for. */\nexport class ServerHostingFake implements ServerHostingPort {\n readonly capability = \"server-hosting\";\n\n private needs: Requirement[] = [];\n readonly received: Asked[] = [];\n\n /** What doctor checks for each app it ships. */\n seed({ requirements }: { requirements: Requirement[] }) {\n this.needs = requirements;\n return this;\n }\n\n describe = ({ options }: JobInput<Record<string, unknown>>) =>\n `${Resolved.parse(options).service} (fake)`;\n\n jobs = ({ tag, environment, options }: JobInput<Record<string, unknown>>): Job[] => {\n const { service } = Resolved.parse(options);\n this.received.push({ tag, environment, service });\n return [\n {\n label: `deploy ${tag} to ${service} (fake)`,\n local: [{ command: \"echo\", args: [\"deploy\", service, tag] }],\n ci: { ref: tag },\n record: true,\n },\n ];\n };\n\n requirements = () => this.needs;\n}\n\n/** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */\nexport const serverHostingFake = (\n fake = new ServerHostingFake(),\n): DeliveryAdapter<ServerHostingPort> & { fake: ServerHostingFake } => ({\n name: \"fake\",\n capability: \"server-hosting\",\n settings: ServerSettings,\n typicalMinutes: 1,\n requirements: () => fake.requirements(),\n create: () => fake,\n fake,\n});\n","import { z } from \"zod\";\n\nimport type { Environment } from \"../../../domain/environment\";\nimport type { DeliveryAdapter } from \"../../../ports/adapter.port\";\nimport type { Job, JobInput, Requirement } from \"../../../ports/delivery.port\";\nimport type { StaticHostingPort } from \"../../../ports/static-hosting.port\";\n\nconst StaticSettings = z.object({\n site: z.string().describe(\"The site it uploads to\"),\n});\n\n/** An upload a module asked for. */\nexport interface Asked {\n tag: string;\n environment: Environment;\n site: string;\n}\n\n/** A static host held in memory: it uploads nothing, and records each upload it was asked for. */\nexport class StaticHostingFake implements StaticHostingPort {\n readonly capability = \"static-hosting\";\n\n private needs: Requirement[] = [];\n readonly received: Asked[] = [];\n\n /** What doctor checks for each app it ships. */\n seed({ requirements }: { requirements: Requirement[] }) {\n this.needs = requirements;\n return this;\n }\n\n describe = ({ options, environment }: JobInput<Record<string, unknown>>) =>\n `${StaticSettings.parse(options).site} (fake, ${environment})`;\n\n jobs = ({ tag, environment, options }: JobInput<Record<string, unknown>>): Job[] => {\n const { site } = StaticSettings.parse(options);\n this.received.push({ tag, environment, site });\n return [\n {\n label: `build ${tag} and upload it to ${site} (fake)`,\n local: [{ command: \"echo\", args: [\"upload\", site, tag] }],\n ci: { ref: tag },\n record: true,\n },\n ];\n };\n\n requirements = () => this.needs;\n}\n\n/** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */\nexport const staticHostingFake = (\n fake = new StaticHostingFake(),\n): DeliveryAdapter<StaticHostingPort> & { fake: StaticHostingFake } => ({\n name: \"fake\",\n capability: \"static-hosting\",\n settings: StaticSettings,\n typicalMinutes: 1,\n requirements: () => fake.requirements(),\n create: () => fake,\n fake,\n});\n","import { z } from \"zod\";\n\nimport type { Environment } from \"../../../domain/environment\";\nimport type { DeliveryAdapter } from \"../../../ports/adapter.port\";\nimport type {\n DecideContext,\n Decision,\n Health,\n Job,\n JobInput,\n Requirement,\n} from \"../../../ports/delivery.port\";\nimport type { MobileDistributionPort } from \"../../../ports/mobile-distribution.port\";\n\nconst MobileSettings = z.object({\n app: z.string().describe(\"The app it ships to the stores and over the air\"),\n});\n\nconst DECIDED_BY = {\n platform: \"the fake platform\",\n choice: \"update or nothing\",\n check: \"shiplane status\",\n};\n\ninterface MobileState {\n /** The version each environment runs. */\n live: Partial<Record<Environment, string>>;\n /** How each tag does where it runs. */\n health: Record<string, Health>;\n requirements: Requirement[];\n}\n\n/** What a module asked of it. */\nexport interface Asked {\n stage: \"jobs\" | \"decide\" | \"health\" | \"inspect\";\n tag: string;\n environment: Environment;\n}\n\n/**\n * A mobile platform held in memory: seed what each environment runs and how a tag does; a version\n * not live yet ships as an update.\n */\nexport class MobileDistributionFake implements MobileDistributionPort {\n readonly capability = \"mobile-distribution\";\n\n private state: MobileState = { live: {}, health: {}, requirements: [] };\n readonly received: Asked[] = [];\n\n seed(state: Partial<MobileState>) {\n this.state = { ...this.state, ...state };\n return this;\n }\n\n private ask(stage: Asked[\"stage\"], { tag, environment }: JobInput<Record<string, unknown>>) {\n this.received.push({ stage, tag, environment });\n }\n\n describe = ({ options, environment }: JobInput<Record<string, unknown>>) =>\n `${MobileSettings.parse(options).app} on ${environment} (fake)`;\n\n jobs = (input: JobInput<Record<string, unknown>>): Job[] => {\n this.ask(\"jobs\", input);\n const { tag, environment, options } = input;\n const { app } = MobileSettings.parse(options);\n return [\n {\n label: `publish ${tag} to ${app} on ${environment} (fake)`,\n local: [{ command: \"echo\", args: [\"update\", app, tag] }],\n ci: { ref: tag },\n },\n ];\n };\n\n decide = (_context: DecideContext, input: JobInput<Record<string, unknown>>) => {\n this.ask(\"decide\", input);\n const { unit, environment } = input;\n const decision: Decision =\n this.state.live[environment] === unit.version\n ? { action: \"none\", status: `${unit.name} ${unit.version} is on ${environment}` }\n : { action: \"ship\", kind: \"update\", jobs: this.jobs(input) };\n return Promise.resolve(decision);\n };\n\n health = (_context: DecideContext, input: JobInput<Record<string, unknown>>) => {\n this.ask(\"health\", input);\n return Promise.resolve(this.state.health[input.tag] ?? null);\n };\n\n inspect = (_context: DecideContext, input: JobInput<Record<string, unknown>>) => {\n this.ask(\"inspect\", input);\n return Promise.resolve({ live: this.state.live[input.environment] ?? null });\n };\n\n requirements = () => this.state.requirements;\n}\n\n/** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */\nexport const mobileDistributionFake = (\n fake = new MobileDistributionFake(),\n): DeliveryAdapter<MobileDistributionPort> & { fake: MobileDistributionFake } => ({\n name: \"fake\",\n capability: \"mobile-distribution\",\n settings: MobileSettings,\n typicalMinutes: 1,\n decidedBy: DECIDED_BY,\n requirements: () => fake.requirements(),\n create: () => fake,\n fake,\n});\n","import { z } from \"zod\";\n\nimport type { Environment } from \"../../../domain/environment\";\nimport type { DeliveryAdapter } from \"../../../ports/adapter.port\";\nimport type {\n DecideContext,\n Decision,\n Job,\n JobInput,\n Requirement,\n} from \"../../../ports/delivery.port\";\nimport type { PackageRegistryPort } from \"../../../ports/package-registry.port\";\n\nconst PackageSettings = z.object({\n tag: z.string().default(\"latest\").describe(\"The dist-tag a release moves\"),\n});\n\n/** What a module asked of it. */\nexport interface Asked {\n stage: \"jobs\" | \"decide\";\n tag: string;\n environment: Environment;\n}\n\n/** A package registry held in memory: seed what is published, a version not there yet publishes. */\nexport class PackageRegistryFake implements PackageRegistryPort {\n readonly capability = \"package-registry\";\n\n /** `<package>@<version>` already published. */\n private published = new Set<string>();\n private needs: Requirement[] = [];\n readonly received: Asked[] = [];\n\n seed({\n published = [],\n requirements = [],\n }: {\n published?: string[];\n requirements?: Requirement[];\n }) {\n this.published = new Set(published);\n this.needs = requirements;\n return this;\n }\n\n describe = ({ unit, options }: JobInput<Record<string, unknown>>) =>\n `${unit.packageName} (fake, ${PackageSettings.parse(options).tag})`;\n\n jobs = ({ unit, tag, environment, options }: JobInput<Record<string, unknown>>): Job[] => {\n this.received.push({ stage: \"jobs\", tag, environment });\n return [\n {\n label: `publish ${unit.packageName}@${unit.version} under ${PackageSettings.parse(options).tag} (fake)`,\n local: [{ command: \"echo\", args: [\"publish\", unit.packageName, unit.version] }],\n },\n ];\n };\n\n decide = (_context: DecideContext, input: JobInput<Record<string, unknown>>) => {\n const { unit, tag, environment } = input;\n this.received.push({ stage: \"decide\", tag, environment });\n const decision: Decision = this.published.has(`${unit.packageName}@${unit.version}`)\n ? { action: \"none\", status: `${unit.packageName}@${unit.version} is published` }\n : { action: \"ship\", kind: \"publish\", jobs: this.jobs(input) };\n return Promise.resolve(decision);\n };\n\n live = (_context: DecideContext, { unit }: JobInput<Record<string, unknown>>) =>\n Promise.resolve(this.published.has(`${unit.packageName}@${unit.version}`));\n\n requirements = () => this.needs;\n}\n\n/** The Fake as a config holds an adapter; `.fake` is what a test seeds and reads. */\nexport const packageRegistryFake = (\n fake = new PackageRegistryFake(),\n): DeliveryAdapter<PackageRegistryPort> & { fake: PackageRegistryFake } => ({\n name: \"fake\",\n capability: \"package-registry\",\n settings: PackageSettings,\n typicalMinutes: 1,\n requirements: () => fake.requirements(),\n create: () => fake,\n fake,\n});\n"],"mappings":";;;;;AAoCA,IAAa,oBAAb,MAA4D;CAC1D,QAA6B;EAC3B,UAAU;GAAE,QAAQ;GAAQ,MAAM;GAAQ,YAAY;GAAQ;EAC9D,OAAO;EACP,MAAM,EAAE;EACR,gBAAgB,EAAE;EAClB,UAAU,EAAE;EACZ,OAAO,EAAE;EACT,OAAO,EAAE;EACT,SAAS,EAAE;EACX,SAAS,EAAE;EACZ;CAED,WAAmC,EAAE;CACrC,WAA+E,EAAE;CAEjF,KAAK,OAA6B;AAChC,OAAK,QAAQ;GAAE,GAAG,KAAK;GAAO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AAG,KAAK,YAAY,GAAG,KAAK,UAAU,CAAC;CAE5E,qBAAqB,KAAK;;;AAI5B,MAAa,uBACX,OAAO,IAAI,qBAAqB,MAC0C;CAC1E,MAAM;CACN,YAAY;CACZ,UAAU;CACV,gBAAgB;CAChB,oBAAoB,KAAK,cAAc;CACvC,cAAc;CACd;CACD"}
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ //#region src/application/config/perEnv.ts
3
+ /** A value that is the same everywhere, or written once per environment. */
4
+ const perEnv = (value) => z.union([value, z.strictObject({
5
+ preview: value,
6
+ production: value
7
+ })]);
8
+ //#endregion
9
+ export { perEnv as t };
10
+
11
+ //# sourceMappingURL=perEnv-B7AiYnW_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perEnv-B7AiYnW_.js","names":[],"sources":["../src/application/config/perEnv.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { Environment } from \"../../domain/environment\";\n\n/** A value that is the same everywhere, or written once per environment. */\nexport const perEnv = <Value extends z.ZodType>(value: Value) =>\n z.union([value, z.strictObject({ preview: value, production: value })]);\n\nexport type PerEnv<Value> = Value | Record<Environment, Value>;\n"],"mappings":";;;AAKA,MAAa,UAAmC,UAC9C,EAAE,MAAM,CAAC,OAAO,EAAE,aAAa;CAAE,SAAS;CAAO,YAAY;CAAO,CAAC,CAAC,CAAC"}
package/dist/plugin.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { $ as CommandFailed, A as ServiceAdapter, At as PerEnv, B as Resolved, C as ReleaseFlow, D as Adapter, E as VersioningPort, F as Health, I as Job, L as JobInput, M as DecideContext, Mt as ReleaseUnit, N as Decision, Nt as Environment, O as AdapterContext, Q as yesAllowed, R as Refusal, St as StatusPlan, T as Shipped, Tt as appBumps, V as VersionChoice, X as GitPosition, Y as SourceControlPort, Z as releaseSource, _ as ReleaseConfig, _t as deployRunTitle, a as mobileApp, at as Deploy, b as Feature, bt as AppBump, c as releaseFlow, d as defineServerHosting, dt as LinkedPr, f as defineStaticHosting, ft as issueName, g as MobileDistributionPort, h as PackageRegistryPort, ht as billedMinutes, i as publishedPackage, it as CodeHostPort, j as Command, jt as perEnv, k as DeliveryAdapter, kt as progressBar, l as defineMobileDistribution, m as ServerHostingPort, mt as actionsMinutes, n as shellServerHosting, nt as ShellResult, o as internalTool, p as StaticHostingPort, r as webApp, rt as CiPipelinePort, s as backendService, t as z, tt as Shell, u as definePackageRegistry, ut as IssueRef, v as defineRelease, vt as deployState, w as ReleaseModule, x as FollowUp, xt as PlannedChangeset, y as AfterShipContext, yt as onlyVersionFiles, z as Requirement } from "./index-QneBUiDD.js";
2
- import { i as tagName, r as isReleaseSubject, t as DEFAULT_TAG_FORMAT } from "./tags-DL74ni09.js";
1
+ import { A as releaseSource, B as LinkedPr, F as ShellResult, I as CiPipelinePort, J as onlyVersionFiles, K as deployRunTitle, L as CodeHostPort, M as CommandFailed, O as SourceControlPort, P as Shell, R as Deploy, U as actionsMinutes, V as issueName, W as billedMinutes, _ as Refusal, a as VersioningPort, b as VersionChoice, c as DeliveryAdapter, ct as ReleaseUnit, d as DecideContext, dt as MascotMoment, f as Decision, g as JobInput, h as Job, i as MobileDistributionPort, j as yesAllowed, k as GitPosition, l as ServiceAdapter, m as Health, mt as Environment, n as ServerHostingPort, nt as PlannedChangeset, o as Adapter, ot as appBumps, pt as progressBar, q as deployState, r as PackageRegistryPort, rt as StatusPlan, s as AdapterContext, t as StaticHostingPort, tt as AppBump, u as Command, ut as Mascot, v as Requirement, y as Resolved, z as IssueRef } from "./static-hosting.port-mknLsxwR.js";
2
+ import { C as perEnv, S as PerEnv, _ as FollowUp, a as mobileApp, b as ReleaseModule, c as releaseFlow, d as defineServerHosting, f as defineStaticHosting, g as Feature, h as AfterShipContext, i as publishedPackage, l as defineMobileDistribution, m as defineRelease, n as shellServerHosting, o as internalTool, p as ReleaseConfig, r as webApp, s as backendService, t as z, u as definePackageRegistry, x as Shipped, y as ReleaseFlow } from "./index-D4qsXAis.js";
3
+ import { i as tagName, r as isReleaseSubject, t as DEFAULT_TAG_FORMAT } from "./tags-Bn3JrgPI.js";
3
4
 
4
5
  //#region src/domain/versions.d.ts
5
6
  /** Negative, zero or positive, like a sort comparator: "0.1.10" is after "0.1.9". */
@@ -7,10 +8,17 @@ declare const compareVersions: (left: string, right: string) => number;
7
8
  declare const nextPatch: (version: string) => string;
8
9
  //#endregion
9
10
  //#region src/application/config/workspaceFolders.d.ts
11
+ /** What reading a workspace needs, by path relative to its root: a disk, or files in memory. */
12
+ interface WorkspaceReader {
13
+ read: (file: string) => string | null;
14
+ /** The folders directly inside `dir`, by name. */
15
+ folders: (dir: string) => string[];
16
+ exists: (file: string) => boolean;
17
+ }
10
18
  /** The folders the workspace file lists: pnpm's first, then package.json, else the root alone. */
11
- declare const workspacePatterns: (root: string) => string[];
19
+ declare const workspacePatterns: (from: string | WorkspaceReader) => string[];
12
20
  /** Folders matching `dir/*` or an exact path, sorted. Negations and deeper globs are skipped. */
13
- declare const expandPatterns: (root: string, patterns: readonly string[]) => string[];
21
+ declare const expandPatterns: (from: string | WorkspaceReader, patterns: readonly string[]) => string[];
14
22
  //#endregion
15
- export { Adapter, AdapterContext, type AfterShipContext, type AppBump, CiPipelinePort, CodeHostPort, type Command, CommandFailed, DEFAULT_TAG_FORMAT, type DecideContext, type Decision, DeliveryAdapter, type Deploy, Environment, Feature, type FollowUp, type GitPosition, type Health, type IssueRef, type Job, type JobInput, type LinkedPr, MobileDistributionPort, PackageRegistryPort, PerEnv, type PlannedChangeset, type Refusal, ReleaseConfig, ReleaseFlow, ReleaseModule, ReleaseUnit, type Requirement, type Resolved, ServerHostingPort, ServiceAdapter, type Shell, type ShellResult, type Shipped, SourceControlPort, StaticHostingPort, type StatusPlan, type VersionChoice, VersioningPort, actionsMinutes, appBumps, backendService, billedMinutes, compareVersions, defineMobileDistribution, definePackageRegistry, defineRelease, defineServerHosting, defineStaticHosting, deployRunTitle, deployState, expandPatterns, internalTool, isReleaseSubject, issueName, mobileApp, nextPatch, onlyVersionFiles, perEnv, progressBar, publishedPackage, releaseFlow, releaseSource, shellServerHosting, tagName, webApp, workspacePatterns, yesAllowed, z };
23
+ export { Adapter, AdapterContext, type AfterShipContext, type AppBump, CiPipelinePort, CodeHostPort, type Command, CommandFailed, DEFAULT_TAG_FORMAT, type DecideContext, type Decision, DeliveryAdapter, type Deploy, Environment, Feature, type FollowUp, type GitPosition, type Health, type IssueRef, type Job, type JobInput, type LinkedPr, Mascot, MascotMoment, MobileDistributionPort, PackageRegistryPort, PerEnv, type PlannedChangeset, type Refusal, ReleaseConfig, ReleaseFlow, ReleaseModule, ReleaseUnit, type Requirement, type Resolved, ServerHostingPort, ServiceAdapter, type Shell, type ShellResult, type Shipped, SourceControlPort, StaticHostingPort, type StatusPlan, type VersionChoice, VersioningPort, actionsMinutes, appBumps, backendService, billedMinutes, compareVersions, defineMobileDistribution, definePackageRegistry, defineRelease, defineServerHosting, defineStaticHosting, deployRunTitle, deployState, expandPatterns, internalTool, isReleaseSubject, issueName, mobileApp, nextPatch, onlyVersionFiles, perEnv, progressBar, publishedPackage, releaseFlow, releaseSource, shellServerHosting, tagName, webApp, workspacePatterns, yesAllowed, z };
16
24
  //# sourceMappingURL=plugin.d.ts.map
package/dist/plugin.js CHANGED
@@ -1,7 +1,8 @@
1
- import { a as releaseFlow, i as backendService, n as publishedPackage, o as perEnv, r as mobileApp, t as webApp } from "./web-app.module-Bw-npC4Z.js";
2
- import { n as internalTool, r as defineRelease, t as z } from "./src-Dlr2Sgs8.js";
3
- import { a as defineStaticHosting, i as defineServerHosting, n as defineMobileDistribution, r as definePackageRegistry, t as shellServerHosting } from "./shell-server-hosting.adapter-Bgl6-IWw.js";
4
- import { D as tagName, O as expandPatterns, T as isReleaseSubject, _ as nextPatch, a as deployRunTitle, b as yesAllowed, g as compareVersions, k as workspacePatterns, n as billedMinutes, o as deployState, s as onlyVersionFiles, t as actionsMinutes, u as appBumps, v as CommandFailed, x as DEFAULT_TAG_FORMAT, y as releaseSource } from "./budget-C8_aayQk.js";
5
- import { n as progressBar } from "./display-DM0xtQbT.js";
6
- import { t as issueName } from "./issues-C5fKq1Jv.js";
1
+ import { t as perEnv } from "./perEnv-B7AiYnW_.js";
2
+ import { n as internalTool, r as defineRelease, t as z } from "./src-CGASfBy2.js";
3
+ import { a as defineStaticHosting, i as defineServerHosting, n as defineMobileDistribution, r as definePackageRegistry, t as shellServerHosting } from "./shell-server-hosting.adapter-DobfDqFm.js";
4
+ import { a as releaseFlow, i as backendService, n as publishedPackage, r as mobileApp, t as webApp } from "./web-app.module-6KrXIU7j.js";
5
+ import { D as tagName, O as expandPatterns, T as isReleaseSubject, _ as compareVersions, a as CommandFailed, b as yesAllowed, c as onlyVersionFiles, d as appBumps, k as workspacePatterns, n as billedMinutes, o as deployRunTitle, s as deployState, t as actionsMinutes, v as nextPatch, x as DEFAULT_TAG_FORMAT, y as releaseSource } from "./budget-BqtW-Ekk.js";
6
+ import { t as progressBar } from "./display-IqkJ6uCw.js";
7
+ import { t as issueName } from "./issues-TcWtMTv5.js";
7
8
  export { CommandFailed, DEFAULT_TAG_FORMAT, actionsMinutes, appBumps, backendService, billedMinutes, compareVersions, defineMobileDistribution, definePackageRegistry, defineRelease, defineServerHosting, defineStaticHosting, deployRunTitle, deployState, expandPatterns, internalTool, isReleaseSubject, issueName, mobileApp, nextPatch, onlyVersionFiles, perEnv, progressBar, publishedPackage, releaseFlow, releaseSource, shellServerHosting, tagName, webApp, workspacePatterns, yesAllowed, z };