shiplane 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +9 -0
  2. package/dist/cli.js +2 -2
  3. package/dist/{index-CxyLUqKJ.d.ts → index-CpQPaO28.d.ts} +4 -2
  4. package/dist/index.d.ts +3 -3
  5. package/dist/index.js +5 -5
  6. package/dist/memory.d.ts +1 -1
  7. package/dist/memory.js +1 -1
  8. package/dist/{package-registry.fake-D6e0c_iA.js → package-registry.fake-BuiTldHL.js} +2 -2
  9. package/dist/{package-registry.fake-D6e0c_iA.js.map → package-registry.fake-BuiTldHL.js.map} +1 -1
  10. package/dist/{package-registry.fake-DOI4N4yu.d.ts → package-registry.fake-CPAwyGn_.d.ts} +2 -2
  11. package/dist/{perEnv-B7AiYnW_.js → perEnv-n2qFRplP.js} +1 -1
  12. package/dist/{perEnv-B7AiYnW_.js.map → perEnv-n2qFRplP.js.map} +1 -1
  13. package/dist/plugin.d.ts +3 -3
  14. package/dist/plugin.js +5 -5
  15. package/dist/{readStatus-Dd_pBt-6.js → readStatus-BnEVjKc8.js} +237 -18
  16. package/dist/readStatus-BnEVjKc8.js.map +1 -0
  17. package/dist/{shell-server-hosting.adapter-DobfDqFm.js → shell-server-hosting.adapter-C7_5MWrl.js} +4 -3
  18. package/dist/shell-server-hosting.adapter-C7_5MWrl.js.map +1 -0
  19. package/dist/{src-Dqo5lgrW.js → src-DO7WyrfV.js} +3 -3
  20. package/dist/{src-Dqo5lgrW.js.map → src-DO7WyrfV.js.map} +1 -1
  21. package/dist/{static-hosting.port-DaIJfr1x.d.ts → static-hosting.port-pfDvRESk.d.ts} +44 -2
  22. package/dist/testing.d.ts +7 -5
  23. package/dist/testing.js +3 -3
  24. package/dist/{web-app.module-6KrXIU7j.js → web-app.module-Cg3SYqSo.js} +47 -2
  25. package/dist/web-app.module-Cg3SYqSo.js.map +1 -0
  26. package/package.json +1 -1
  27. package/dist/readStatus-Dd_pBt-6.js.map +0 -1
  28. package/dist/shell-server-hosting.adapter-DobfDqFm.js.map +0 -1
  29. package/dist/web-app.module-6KrXIU7j.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { t as perEnv } from "./perEnv-B7AiYnW_.js";
1
+ import { t as perEnv } from "./perEnv-n2qFRplP.js";
2
2
  import { z } from "zod";
3
3
  //#region src/adapters/defineDelivery.ts
4
4
  const widen = (port) => port;
5
- const recipe = ({ name, settings, typicalMinutes, decidedBy, detect, questions, requirements, ...port }, capability) => ({
5
+ const recipe = ({ name, settings, typicalMinutes, decidedBy, detect, questions, requirements, env, ...port }, capability) => ({
6
6
  name,
7
7
  capability,
8
8
  settings,
@@ -11,6 +11,7 @@ const recipe = ({ name, settings, typicalMinutes, decidedBy, detect, questions,
11
11
  detect,
12
12
  questions,
13
13
  requirements,
14
+ ...env ? { env } : {},
14
15
  create: () => widen({
15
16
  ...port,
16
17
  capability
@@ -46,4 +47,4 @@ const shellServerHosting = () => defineServerHosting({
46
47
  //#endregion
47
48
  export { defineStaticHosting as a, defineServerHosting as i, defineMobileDistribution as n, definePackageRegistry as r, shellServerHosting as t };
48
49
 
49
- //# sourceMappingURL=shell-server-hosting.adapter-DobfDqFm.js.map
50
+ //# sourceMappingURL=shell-server-hosting.adapter-C7_5MWrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-server-hosting.adapter-C7_5MWrl.js","names":[],"sources":["../src/adapters/defineDelivery.ts","../src/adapters/server-hosting/shell-server-hosting.adapter.ts"],"sourcesContent":["import type { z } from \"zod\";\n\nimport type { DeliveryAdapter } from \"../ports/adapter.port\";\nimport type { Resolved } from \"../ports/delivery.port\";\nimport type { MobileDistributionPort } from \"../ports/mobile-distribution.port\";\nimport type { PackageRegistryPort } from \"../ports/package-registry.port\";\nimport type { ServerHostingPort } from \"../ports/server-hosting.port\";\nimport type { StaticHostingPort } from \"../ports/static-hosting.port\";\n\n/**\n * What an adapter author writes in one object: the recipe's static parts (name, settings, what init\n * and doctor ask) and the port's members, which read the settings typed.\n */\ntype Authored<Port extends { capability: string }, Schema extends z.ZodObject> = Omit<\n Port,\n \"capability\"\n> &\n Omit<DeliveryAdapter<Port>, \"create\" | \"settings\" | \"capability\"> & {\n readonly settings: Schema;\n };\n\ntype Typed<Schema extends z.ZodObject> = Resolved<z.output<Schema>>;\n\n// Its members take the settings its schema parses; the release flow only ever passes those.\nconst widen = <Port>(port: object): Port => port as Port;\n\nconst recipe = <Port extends { capability: string }>(\n {\n name,\n settings,\n typicalMinutes,\n decidedBy,\n detect,\n questions,\n requirements,\n env,\n ...port\n }: Omit<DeliveryAdapter<Port>, \"create\" | \"capability\">,\n capability: Port[\"capability\"],\n): DeliveryAdapter<Port> => ({\n name,\n capability,\n settings,\n typicalMinutes,\n decidedBy,\n detect,\n questions,\n requirements,\n ...(env ? { env } : {}),\n create: () => widen({ ...port, capability }),\n});\n\nexport const defineServerHosting = <const Schema extends z.ZodObject>(\n adapter: Authored<ServerHostingPort<Typed<Schema>>, Schema>,\n): DeliveryAdapter<ServerHostingPort> => recipe<ServerHostingPort>(adapter, \"server-hosting\");\n\nexport const defineStaticHosting = <const Schema extends z.ZodObject>(\n adapter: Authored<StaticHostingPort<Typed<Schema>>, Schema>,\n): DeliveryAdapter<StaticHostingPort> => recipe<StaticHostingPort>(adapter, \"static-hosting\");\n\nexport const defineMobileDistribution = <const Schema extends z.ZodObject>(\n adapter: Authored<MobileDistributionPort<Typed<Schema>>, Schema> &\n Required<Pick<DeliveryAdapter<MobileDistributionPort>, \"decidedBy\">>,\n): DeliveryAdapter<MobileDistributionPort> =>\n recipe<MobileDistributionPort>(adapter, \"mobile-distribution\");\n\nexport const definePackageRegistry = <const Schema extends z.ZodObject>(\n adapter: Authored<PackageRegistryPort<Typed<Schema>>, Schema>,\n): DeliveryAdapter<PackageRegistryPort> => recipe<PackageRegistryPort>(adapter, \"package-registry\");\n","import { z } from \"zod\";\n\nimport type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { ServerHostingPort } from \"../../ports/server-hosting.port\";\nimport { perEnv } from \"../../application/config/perEnv\";\nimport { defineServerHosting } from \"../defineDelivery\";\n\nconst ShellOptions = z.object({\n deploy: perEnv(z.array(z.string()).min(1)).describe(\n \"The command that ships it, run from the root, as a list: [npx, my-tool, deploy]\",\n ),\n url: perEnv(z.string()).optional().describe(\"Where it answers, for other units to read\"),\n});\n\n/** Anything a command ships: the escape hatch until a host has its own adapter. */\nexport type ShellServerHostingAdapter = DeliveryAdapter<ServerHostingPort>;\n\nexport const shellServerHosting = (): ShellServerHostingAdapter =>\n defineServerHosting({\n name: \"shell\",\n settings: ShellOptions,\n describe: ({ options }) => options.deploy.join(\" \"),\n jobs: ({ tag, environment, options }) => {\n const [command = \"true\", ...args] = options.deploy;\n return [\n {\n label: `ship ${tag}: ${options.deploy.join(\" \")}`,\n local: [{ command, args }],\n ci: { ref: tag },\n record: true,\n },\n ];\n },\n });\n"],"mappings":";;;AAwBA,MAAM,SAAe,SAAuB;AAE5C,MAAM,UACJ,EACE,MACA,UACA,gBACA,WACA,QACA,WACA,cACA,KACA,GAAG,QAEL,gBAC2B;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAI,MAAM,EAAE,KAAK,GAAG,EAAE;CACtB,cAAc,MAAM;EAAE,GAAG;EAAM;EAAY,CAAC;CAC7C;AAED,MAAa,uBACX,YACuC,OAA0B,SAAS,iBAAiB;AAE7F,MAAa,uBACX,YACuC,OAA0B,SAAS,iBAAiB;AAE7F,MAAa,4BACX,YAGA,OAA+B,SAAS,sBAAsB;AAEhE,MAAa,yBACX,YACyC,OAA4B,SAAS,mBAAmB;;;AC7DnG,MAAM,eAAe,EAAE,OAAO;CAC5B,QAAQ,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,SACzC,kFACD;CACD,KAAK,OAAO,EAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,SAAS,4CAA4C;CACzF,CAAC;AAKF,MAAa,2BACX,oBAAoB;CAClB,MAAM;CACN,UAAU;CACV,WAAW,EAAE,cAAc,QAAQ,OAAO,KAAK,IAAI;CACnD,OAAO,EAAE,KAAK,aAAa,cAAc;EACvC,MAAM,CAAC,UAAU,QAAQ,GAAG,QAAQ,QAAQ;AAC5C,SAAO,CACL;GACE,OAAO,QAAQ,IAAI,IAAI,QAAQ,OAAO,KAAK,IAAI;GAC/C,OAAO,CAAC;IAAE;IAAS;IAAM,CAAC;GAC1B,IAAI,EAAE,KAAK,KAAK;GAChB,QAAQ;GACT,CACF;;CAEJ,CAAC"}
@@ -1,5 +1,5 @@
1
- import "./perEnv-B7AiYnW_.js";
2
- import "./shell-server-hosting.adapter-DobfDqFm.js";
1
+ import "./perEnv-n2qFRplP.js";
2
+ import "./shell-server-hosting.adapter-C7_5MWrl.js";
3
3
  import { z, z as z$1 } from "zod";
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
@@ -111,4 +111,4 @@ const internalTool = ({ name = "internal-tool" } = {}) => ({
111
111
  //#endregion
112
112
  export { defineRelease as i, internalTool as n, agentPlugin as r, z$1 as t };
113
113
 
114
- //# sourceMappingURL=src-Dqo5lgrW.js.map
114
+ //# sourceMappingURL=src-DO7WyrfV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"src-Dqo5lgrW.js","names":[],"sources":["../src/application/config/defineRelease.ts","../src/modules/agent-plugin/agent-plugin.module.ts","../src/modules/internal-tool/internal-tool.module.ts"],"sourcesContent":["import type { DisplayChoice } from \"../../domain/display\";\nimport type { TagFormatName } from \"../../domain/tags\";\nimport type { Feature, ReleaseFlow, ReleaseModule } from \"../../modules/module\";\n\n/** How a repository releases: the flow, what gets released in order, and what happens around it. */\nexport interface ReleaseConfig {\n /** Folders to look in, `dir/*` or exact. Without it, the workspace file decides. */\n units?: string[];\n /** How the release itself runs: an adapter per port, each from its plugin. */\n flow: ReleaseFlow;\n /** What gets released, in this order. The first app is the repository's Latest release. */\n modules: ReleaseModule[];\n /** What happens around a release, after the ship, in this order. */\n features?: Feature[];\n /**\n * How a tag names a version: `\"package\"` (`{name}@{version}`, the default), `\"plugin\"` (`{name}--v{version}`), `\"single\"` (`v{version}`, one unit only), `\"module\"` (`{name}/v{version}`), or a format of your own.\n */\n tag?: TagFormatName | (string & {});\n /** How much the release says while it runs; `--verbose` and `--mascot` (or `--no-…`) override. */\n display?: DisplayChoice;\n}\n\nexport const defineRelease = (config: ReleaseConfig): ReleaseConfig => config;\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { z } from \"zod\";\n\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\n\n/**\n * Where each agent reads a plugin's version, relative to the plugin's folder: Claude Code and\n * Copilot CLI, Codex, Cursor, then Gemini CLI.\n */\nexport const AGENT_MANIFESTS = [\n \".claude-plugin/plugin.json\",\n \".codex-plugin/plugin.json\",\n \".cursor-plugin/plugin.json\",\n \"gemini-extension.json\",\n] as const;\n\nconst Versioned = z.object({ version: z.string() });\n\n/** A manifest's version, or null when the file is missing or holds no top-level version. */\nconst versionIn = (file: string) => {\n if (!fs.existsSync(file)) return null;\n const parsed = Versioned.safeParse(JSON.parse(fs.readFileSync(file, \"utf8\")));\n return parsed.success ? parsed.data.version : null;\n};\n\nconst literal = (text: string) => text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/** Moves only the version's value, so the release PR shows one changed line per manifest. */\nconst setVersion = (file: string, from: string, to: string) => {\n const text = fs.readFileSync(file, \"utf8\");\n const moved = text.replace(\n new RegExp(`(\"version\"\\\\s*:\\\\s*)\"${literal(from)}\"`),\n `$1${JSON.stringify(to)}`,\n );\n // The first such value may sit under another key: then the file is written whole instead.\n const top = Versioned.safeParse(JSON.parse(moved));\n const json = JSON.parse(text) as Record<string, unknown>;\n fs.writeFileSync(\n file,\n top.success && top.data.version === to\n ? moved\n : `${JSON.stringify({ ...json, version: to }, null, 2)}\\n`,\n );\n};\n\n/**\n * A plugin for coding agents, such as a Claude Code, Codex or Cursor plugin: a release versions it,\n * writes the version into each agent's manifest in the release PR, tags it and publishes its notes.\n * Nothing deploys it: agents install it from the repository, so merging the release PR ships it.\n */\nexport const agentPlugin = ({ name = \"agent-plugin\" }: Named = {}): ReleaseModule => ({\n type: \"module\",\n name,\n kind: \"agent-plugin\",\n provider: \"marketplace\",\n settings: z.object({}),\n adapters: [],\n releaseOnly: true,\n version: ({ root }, { unit, bump }) => {\n if (!bump) return Promise.resolve({ added: [], writes: [], summary: [], onMerge: \"\" });\n const manifests = AGENT_MANIFESTS.map((file) => path.posix.join(unit.dir, file)).flatMap(\n (file) => {\n const from = versionIn(path.join(root, file));\n return from === null ? [] : [{ file, from }];\n },\n );\n return Promise.resolve({\n added: [],\n writes: manifests.map(({ file, from }) => ({\n label: `${file} → ${bump.to}`,\n run: () => {\n setVersion(path.join(root, file), from, bump.to);\n return Promise.resolve();\n },\n })),\n summary: [],\n onMerge: \"Agents update to it: merging ships it\",\n });\n },\n ship: () => ({\n where: \"its tag and release notes; agents install it from the repository\",\n jobs: [],\n }),\n decide: () =>\n Promise.resolve({ action: \"none\", status: \"released, agents install it from the repository\" }),\n});\n","import { z } from \"zod\";\n\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\n\n/**\n * An app nothing deploys, such as a CLI run from the repository: a release versions it, tags it and\n * publishes its notes, and every environment counts it as shipped once tagged.\n */\nexport const internalTool = ({ name = \"internal-tool\" }: Named = {}): ReleaseModule => ({\n type: \"module\",\n name,\n kind: \"internal-tool\",\n // What output named it before modules: the release PR and status keep saying it.\n provider: \"release-only\",\n settings: z.object({}),\n adapters: [],\n releaseOnly: true,\n ship: () => ({ where: \"its tag and release notes, nothing deploys it\", jobs: [] }),\n decide: () => Promise.resolve({ action: \"none\", status: \"released, nothing deploys it\" }),\n});\n"],"mappings":";;;;;;AAsBA,MAAa,iBAAiB,WAAyC;;;;;;;ACXvE,MAAa,kBAAkB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KAAK,MAAM,KAAK,CAAC;AAC7C,UAAO,SAAS,OAAO,EAAE,GAAG,CAAC;IAAE;IAAM;IAAM,CAAC;IAE/C;AACD,SAAO,QAAQ,QAAQ;GACrB,OAAO,EAAE;GACT,QAAQ,UAAU,KAAK,EAAE,MAAM,YAAY;IACzC,OAAO,GAAG,KAAK,KAAK,KAAK;IACzB,WAAW;AACT,gBAAW,KAAK,KAAK,MAAM,KAAK,EAAE,MAAM,KAAK,GAAG;AAChD,YAAO,QAAQ,SAAS;;IAE3B,EAAE;GACH,SAAS,EAAE;GACX,SAAS;GACV,CAAC;;CAEJ,aAAa;EACX,OAAO;EACP,MAAM,EAAE;EACT;CACD,cACE,QAAQ,QAAQ;EAAE,QAAQ;EAAQ,QAAQ;EAAmD,CAAC;CACjG;;;;;;;AC9ED,MAAa,gBAAgB,EAAE,OAAO,oBAA2B,EAAE,MAAqB;CACtF,MAAM;CACN;CACA,MAAM;CAEN,UAAU;CACV,UAAU,EAAE,OAAO,EAAE,CAAC;CACtB,UAAU,EAAE;CACZ,aAAa;CACb,aAAa;EAAE,OAAO;EAAiD,MAAM,EAAE;EAAE;CACjF,cAAc,QAAQ,QAAQ;EAAE,QAAQ;EAAQ,QAAQ;EAAgC,CAAC;CAC1F"}
1
+ {"version":3,"file":"src-DO7WyrfV.js","names":[],"sources":["../src/application/config/defineRelease.ts","../src/modules/agent-plugin/agent-plugin.module.ts","../src/modules/internal-tool/internal-tool.module.ts"],"sourcesContent":["import type { DisplayChoice } from \"../../domain/display\";\nimport type { TagFormatName } from \"../../domain/tags\";\nimport type { Feature, ReleaseFlow, ReleaseModule } from \"../../modules/module\";\n\n/** How a repository releases: the flow, what gets released in order, and what happens around it. */\nexport interface ReleaseConfig {\n /** Folders to look in, `dir/*` or exact. Without it, the workspace file decides. */\n units?: string[];\n /** How the release itself runs: an adapter per port, each from its plugin. */\n flow: ReleaseFlow;\n /** What gets released, in this order. The first app is the repository's Latest release. */\n modules: ReleaseModule[];\n /** What happens around a release, after the ship, in this order. */\n features?: Feature[];\n /**\n * How a tag names a version: `\"package\"` (`{name}@{version}`, the default), `\"plugin\"` (`{name}--v{version}`), `\"single\"` (`v{version}`, one unit only), `\"module\"` (`{name}/v{version}`), or a format of your own.\n */\n tag?: TagFormatName | (string & {});\n /** How much the release says while it runs; `--verbose` and `--mascot` (or `--no-…`) override. */\n display?: DisplayChoice;\n}\n\nexport const defineRelease = (config: ReleaseConfig): ReleaseConfig => config;\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { z } from \"zod\";\n\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\n\n/**\n * Where each agent reads a plugin's version, relative to the plugin's folder: Claude Code and\n * Copilot CLI, Codex, Cursor, then Gemini CLI.\n */\nexport const AGENT_MANIFESTS = [\n \".claude-plugin/plugin.json\",\n \".codex-plugin/plugin.json\",\n \".cursor-plugin/plugin.json\",\n \"gemini-extension.json\",\n] as const;\n\nconst Versioned = z.object({ version: z.string() });\n\n/** A manifest's version, or null when the file is missing or holds no top-level version. */\nconst versionIn = (file: string) => {\n if (!fs.existsSync(file)) return null;\n const parsed = Versioned.safeParse(JSON.parse(fs.readFileSync(file, \"utf8\")));\n return parsed.success ? parsed.data.version : null;\n};\n\nconst literal = (text: string) => text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/** Moves only the version's value, so the release PR shows one changed line per manifest. */\nconst setVersion = (file: string, from: string, to: string) => {\n const text = fs.readFileSync(file, \"utf8\");\n const moved = text.replace(\n new RegExp(`(\"version\"\\\\s*:\\\\s*)\"${literal(from)}\"`),\n `$1${JSON.stringify(to)}`,\n );\n // The first such value may sit under another key: then the file is written whole instead.\n const top = Versioned.safeParse(JSON.parse(moved));\n const json = JSON.parse(text) as Record<string, unknown>;\n fs.writeFileSync(\n file,\n top.success && top.data.version === to\n ? moved\n : `${JSON.stringify({ ...json, version: to }, null, 2)}\\n`,\n );\n};\n\n/**\n * A plugin for coding agents, such as a Claude Code, Codex or Cursor plugin: a release versions it,\n * writes the version into each agent's manifest in the release PR, tags it and publishes its notes.\n * Nothing deploys it: agents install it from the repository, so merging the release PR ships it.\n */\nexport const agentPlugin = ({ name = \"agent-plugin\" }: Named = {}): ReleaseModule => ({\n type: \"module\",\n name,\n kind: \"agent-plugin\",\n provider: \"marketplace\",\n settings: z.object({}),\n adapters: [],\n releaseOnly: true,\n version: ({ root }, { unit, bump }) => {\n if (!bump) return Promise.resolve({ added: [], writes: [], summary: [], onMerge: \"\" });\n const manifests = AGENT_MANIFESTS.map((file) => path.posix.join(unit.dir, file)).flatMap(\n (file) => {\n const from = versionIn(path.join(root, file));\n return from === null ? [] : [{ file, from }];\n },\n );\n return Promise.resolve({\n added: [],\n writes: manifests.map(({ file, from }) => ({\n label: `${file} → ${bump.to}`,\n run: () => {\n setVersion(path.join(root, file), from, bump.to);\n return Promise.resolve();\n },\n })),\n summary: [],\n onMerge: \"Agents update to it: merging ships it\",\n });\n },\n ship: () => ({\n where: \"its tag and release notes; agents install it from the repository\",\n jobs: [],\n }),\n decide: () =>\n Promise.resolve({ action: \"none\", status: \"released, agents install it from the repository\" }),\n});\n","import { z } from \"zod\";\n\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\n\n/**\n * An app nothing deploys, such as a CLI run from the repository: a release versions it, tags it and\n * publishes its notes, and every environment counts it as shipped once tagged.\n */\nexport const internalTool = ({ name = \"internal-tool\" }: Named = {}): ReleaseModule => ({\n type: \"module\",\n name,\n kind: \"internal-tool\",\n // What output named it before modules: the release PR and status keep saying it.\n provider: \"release-only\",\n settings: z.object({}),\n adapters: [],\n releaseOnly: true,\n ship: () => ({ where: \"its tag and release notes, nothing deploys it\", jobs: [] }),\n decide: () => Promise.resolve({ action: \"none\", status: \"released, nothing deploys it\" }),\n});\n"],"mappings":";;;;;;AAsBA,MAAa,iBAAiB,WAAyC;;;;;;;ACXvE,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACD;AA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,UAAO,SAAS,OAAO,EAAE,GAAG,CAAC;IAAE;IAAM;IAAM,CAAC;IAE/C;AACD,SAAO,QAAQ,QAAQ;GACrB,OAAO,EAAE;GACT,QAAQ,UAAU,KAAK,EAAE,MAAM,YAAY;IACzC,OAAO,GAAG,KAAK,KAAK,KAAK;IACzB,WAAW;AACT,gBAAW,KAAK,KAAK,MAAM,KAAK,EAAE,MAAM,KAAK,GAAG;AAChD,YAAO,QAAQ,SAAS;;IAE3B,EAAE;GACH,SAAS,EAAE;GACX,SAAS;GACV,CAAC;;CAEJ,aAAa;EACX,OAAO;EACP,MAAM,EAAE;EACT;CACD,cACE,QAAQ,QAAQ;EAAE,QAAQ;EAAQ,QAAQ;EAAmD,CAAC;CACjG;;;;;;;AC9ED,MAAa,gBAAgB,EAAE,OAAO,oBAA2B,EAAE,MAAqB;CACtF,MAAM;CACN;CACA,MAAM;CAEN,UAAU;CACV,UAAU,EAAE,OAAO,EAAE,CAAC;CACtB,UAAU,EAAE;CACZ,aAAa;CACb,aAAa;EAAE,OAAO;EAAiD,MAAM,EAAE;EAAE;CACjF,cAAc,QAAQ,QAAQ;EAAE,QAAQ;EAAQ,QAAQ;EAAgC,CAAC;CAC1F"}
@@ -33,6 +33,26 @@ interface DisplayChoice {
33
33
  mascot?: boolean | Mascot;
34
34
  }
35
35
  //#endregion
36
+ //#region src/domain/checkEnvBeforeDeploy.d.ts
37
+ /** A name an app reads from its environment, as platforms store it: `SENTRY_DSN`. */
38
+ type EnvVarName = string & {
39
+ readonly brand: "EnvVarName";
40
+ };
41
+ declare const isEnvVarName: (text: string) => text is EnvVarName;
42
+ /** As a unit file writes it: one list for every environment, or `all` plus a list per environment. */
43
+ type EnvToCheckInput = readonly EnvVarName[] | ({
44
+ all?: readonly EnvVarName[];
45
+ } & Partial<Record<Environment, readonly EnvVarName[]>>);
46
+ /** The names a deploy checks on the platform before it ships, per environment. */
47
+ declare class EnvToCheck {
48
+ #private;
49
+ constructor(input: EnvToCheckInput);
50
+ /** `all`, then that environment's own names. */
51
+ for(environment: Environment): ReadonlySet<EnvVarName>;
52
+ /** Names in `all` that an environment lists again. */
53
+ listedTwice(): EnvVarName[];
54
+ }
55
+ //#endregion
36
56
  //#region src/domain/unit.d.ts
37
57
  /** Something with a version that ships somewhere: an app, a published package, this CLI. */
38
58
  interface ReleaseUnit {
@@ -48,12 +68,32 @@ interface ReleaseUnit {
48
68
  module: string;
49
69
  /** Its `buildCommand:`, when its unit file says one; else its package.json "build" script. */
50
70
  buildCommand?: string;
71
+ /** Its `checkEnvBeforeDeploy:`, when its unit file lists one. */
72
+ checkEnvBeforeDeploy?: EnvToCheck;
51
73
  /** As written: per-environment maps and references are resolved by `optionsFor`. */
52
74
  options: Record<string, unknown>;
53
75
  /** Units whose values it reads: they are dispatched before it. */
54
76
  after: string[];
55
77
  }
56
78
  //#endregion
79
+ //#region src/ports/platform-env.port.d.ts
80
+ /** Where an app's env lives on its platform, read by name only: values are never read or written. */
81
+ interface PlatformEnvPort {
82
+ /** Every env var name the platform holds for this app on this environment. */
83
+ listNames: (input: {
84
+ unit: ReleaseUnit;
85
+ environment: Environment; /** The unit's settings for that environment, as its jobs receive them. */
86
+ options: Record<string, unknown>;
87
+ }) => Promise<ReadonlySet<EnvVarName>>;
88
+ /** The command a person runs to set these names, with `...` where each value goes. */
89
+ setCommand: (input: {
90
+ unit: ReleaseUnit;
91
+ environment: Environment;
92
+ options: Record<string, unknown>;
93
+ names: readonly EnvVarName[];
94
+ }) => string;
95
+ }
96
+ //#endregion
57
97
  //#region src/domain/changes.d.ts
58
98
  /** A unit as changesets know it: its name here, its package name there. */
59
99
  interface UnitRef {
@@ -600,6 +640,8 @@ interface DeliveryAdapter<Port extends {
600
640
  readonly questions?: (folder: FolderView, found: Record<string, unknown>, repository: string) => Question[];
601
641
  /** Tools and sign-ins it needs for an app. */
602
642
  readonly requirements?: (unit: ReleaseUnit) => Requirement[];
643
+ /** Lists the env var names its platform holds, for `checkEnvBeforeDeploy`. */
644
+ readonly env?: (context: AdapterContext) => PlatformEnvPort;
603
645
  }
604
646
  //#endregion
605
647
  //#region src/ports/versioning.port.d.ts
@@ -678,5 +720,5 @@ interface StaticHostingPort<Options = Record<string, unknown>> extends Delivery<
678
720
  readonly capability: "static-hosting";
679
721
  }
680
722
  //#endregion
681
- export { OpenPr as $, releaseSource as A, LinkedPr as B, Clock as C, StepPlace as D, Prompter as E, ShellResult as F, DeployPath as G, ActionsMinutes as H, CiPipelinePort as I, onlyVersionFiles as J, deployRunTitle as K, CodeHostPort as L, CommandFailed as M, RunOptions as N, SourceControlPort as O, Shell as P, MergeMethods as Q, Deploy as R, Choice as S, Progress as T, actionsMinutes as U, issueName as V, billedMinutes as W, Approval as X, DecidedBy as Y, MergeMethod as Z, Refusal as _, VersioningPort as a, UnitRef as at, VersionChoice as b, DeliveryAdapter as c, ReleaseUnit as ct, DecideContext as d, MascotMoment as dt, ReleaseStep as et, Decision as f, Mood as ft, JobInput as g, Job as h, MobileDistributionPort as i, StatusPlan as it, yesAllowed as j, GitPosition as k, ServiceAdapter as l, DisplayChoice as lt, Health as m, Environment as mt, ServerHostingPort as n, BumpLevel as nt, Adapter as o, appBumps as ot, Delivery as p, progressBar as pt, deployState as q, PackageRegistryPort as r, PlannedChangeset as rt, AdapterContext as s, splitChangesets as st, StaticHostingPort as t, AppBump as tt, Command as u, Mascot as ut, Requirement as v, Output as w, VersionContribution as x, Resolved as y, IssueRef as z };
682
- //# sourceMappingURL=static-hosting.port-DaIJfr1x.d.ts.map
723
+ export { OpenPr as $, releaseSource as A, LinkedPr as B, Clock as C, StepPlace as D, Prompter as E, ShellResult as F, DeployPath as G, ActionsMinutes as H, CiPipelinePort as I, onlyVersionFiles as J, deployRunTitle as K, CodeHostPort as L, CommandFailed as M, RunOptions as N, SourceControlPort as O, Shell as P, MergeMethods as Q, Deploy as R, Choice as S, Progress as T, actionsMinutes as U, issueName as V, billedMinutes as W, Approval as X, DecidedBy as Y, MergeMethod as Z, Refusal as _, Environment as _t, VersioningPort as a, UnitRef as at, VersionChoice as b, DeliveryAdapter as c, PlatformEnvPort as ct, DecideContext as d, isEnvVarName as dt, ReleaseStep as et, Decision as f, DisplayChoice as ft, JobInput as g, progressBar as gt, Job as h, Mood as ht, MobileDistributionPort as i, StatusPlan as it, yesAllowed as j, GitPosition as k, ServiceAdapter as l, ReleaseUnit as lt, Health as m, MascotMoment as mt, ServerHostingPort as n, BumpLevel as nt, Adapter as o, appBumps as ot, Delivery as p, Mascot as pt, deployState as q, PackageRegistryPort as r, PlannedChangeset as rt, AdapterContext as s, splitChangesets as st, StaticHostingPort as t, AppBump as tt, Command as u, EnvVarName as ut, Requirement as v, Output as w, VersionContribution as x, Resolved as y, IssueRef as z };
724
+ //# sourceMappingURL=static-hosting.port-pfDvRESk.d.ts.map
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as OpenPr, C as Clock, D as StepPlace, E as Prompter, F as ShellResult, G as DeployPath, I as CiPipelinePort, L as CodeHostPort, N as RunOptions, O as SourceControlPort, P as Shell, S as Choice, T as Progress, X as Approval, a as VersioningPort, at as UnitRef, c as DeliveryAdapter, ct as ReleaseUnit, et as ReleaseStep, ft as Mood, i as MobileDistributionPort, it as StatusPlan, l as ServiceAdapter, lt as DisplayChoice, mt as Environment, n as ServerHostingPort, nt as BumpLevel, p as Delivery, r as PackageRegistryPort, rt as PlannedChangeset, st as splitChangesets, t as StaticHostingPort, tt as AppBump, w as Output, x as VersionContribution, z as IssueRef } from "./static-hosting.port-DaIJfr1x.js";
2
- import { _ as Feature, b as ReleaseFlow, w as ReleaseTag, x as ReleaseModule, y as Open } from "./index-CxyLUqKJ.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-DOI4N4yu.js";
1
+ import { $ as OpenPr, C as Clock, D as StepPlace, E as Prompter, F as ShellResult, G as DeployPath, I as CiPipelinePort, L as CodeHostPort, N as RunOptions, O as SourceControlPort, P as Shell, S as Choice, T as Progress, X as Approval, _t as Environment, a as VersioningPort, at as UnitRef, c as DeliveryAdapter, et as ReleaseStep, ft as DisplayChoice, ht as Mood, i as MobileDistributionPort, it as StatusPlan, l as ServiceAdapter, lt as ReleaseUnit, n as ServerHostingPort, nt as BumpLevel, p as Delivery, r as PackageRegistryPort, rt as PlannedChangeset, st as splitChangesets, t as StaticHostingPort, tt as AppBump, w as Output, x as VersionContribution, z as IssueRef } from "./static-hosting.port-pfDvRESk.js";
2
+ import { _ as Feature, b as ReleaseFlow, w as ReleaseTag, x as ReleaseModule, y as Open } from "./index-CpQPaO28.js";
3
+ import { a as VersioningFake, c as ciPipelineFake, d as codeHostFake, f as SourceControlFake, i as serverHostingFake, l as CodeHostFake, n as mobileDistributionFake, o as versioningFake, p as sourceControlFake, r as staticHostingFake, s as CiPipelineFake, t as packageRegistryFake, u as HostEvent } from "./package-registry.fake-CPAwyGn_.js";
4
4
  import { z } from "zod";
5
5
  import * as _$vitest from "vitest";
6
6
 
@@ -429,10 +429,12 @@ declare const refreshEditorSchema: (files: Files, release: Release) => boolean;
429
429
  */
430
430
  declare const shipTo: (context: ReleaseContext, environment: Environment, {
431
431
  scope,
432
- via
432
+ via,
433
+ envChecked
433
434
  }: {
434
435
  scope?: ReadonlySet<string>;
435
- via?: DeployPath;
436
+ via?: DeployPath; /** Units whose env this run already checked on this environment. */
437
+ envChecked?: ReadonlySet<string>;
436
438
  }) => Promise<boolean>;
437
439
  //#endregion
438
440
  //#region src/testing/sample.d.ts
package/dist/testing.js CHANGED
@@ -1,7 +1,7 @@
1
- import { a as releaseFlow } from "./web-app.module-6KrXIU7j.js";
2
- import { C as refreshEditorSchema, E as ENVIRONMENTS, O as nodeFiles, T as optionsFor, _ as loadRelease, a as releaseToPreview, b as initRelease, c as promote, f as openReleasePr, h as docsFor, i as setup, l as shipTo, m as newAdapter, n as systemShell, p as prepareRelease, t as readStatus, u as planShips, v as addUnit, x as doctor, y as removeUnit } from "./readStatus-Dd_pBt-6.js";
1
+ import { a as releaseFlow } from "./web-app.module-Cg3SYqSo.js";
2
+ import { C as refreshEditorSchema, E as ENVIRONMENTS, O as nodeFiles, T as optionsFor, _ as loadRelease, a as releaseToPreview, b as initRelease, c as promote, f as openReleasePr, h as docsFor, i as setup, l as shipTo, m as newAdapter, n as systemShell, p as prepareRelease, t as readStatus, u as planShips, v as addUnit, x as doctor, y as removeUnit } from "./readStatus-BnEVjKc8.js";
3
3
  import { _ as nextVersion, b as DEFAULT_TAG_FORMAT } from "./budget-BTnKtGF6.js";
4
- import { a as versioningFake, c as sourceControlFake, i as serverHostingFake, n as mobileDistributionFake, o as ciPipelineFake, r as staticHostingFake, s as codeHostFake, t as packageRegistryFake } from "./package-registry.fake-D6e0c_iA.js";
4
+ import { a as versioningFake, c as sourceControlFake, i as serverHostingFake, n as mobileDistributionFake, o as ciPipelineFake, r as staticHostingFake, s as codeHostFake, t as packageRegistryFake } from "./package-registry.fake-BuiTldHL.js";
5
5
  import { z } from "zod";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
@@ -1,3 +1,47 @@
1
+ //#region src/domain/checkEnvBeforeDeploy.ts
2
+ /** UPPER_SNAKE: a capital letter, then capitals, digits or underscores. */
3
+ const ENV_VAR_NAME = /^[A-Z][A-Z0-9_]*$/;
4
+ const isEnvVarName = (text) => ENV_VAR_NAME.test(text);
5
+ /** The names a deploy checks on the platform before it ships, per environment. */
6
+ var EnvToCheck = class {
7
+ #all;
8
+ #perEnvironment;
9
+ constructor(input) {
10
+ if (isList(input)) {
11
+ this.#all = input;
12
+ this.#perEnvironment = {};
13
+ return;
14
+ }
15
+ const { all = [], ...perEnvironment } = input;
16
+ this.#all = all;
17
+ this.#perEnvironment = perEnvironment;
18
+ }
19
+ /** `all`, then that environment's own names. */
20
+ for(environment) {
21
+ return new Set([...this.#all, ...this.#perEnvironment[environment] ?? []]);
22
+ }
23
+ /** Names in `all` that an environment lists again. */
24
+ listedTwice() {
25
+ const extras = new Set(Object.values(this.#perEnvironment).flat());
26
+ return [...new Set(this.#all)].filter((name) => extras.has(name));
27
+ }
28
+ };
29
+ const isList = (input) => Array.isArray(input);
30
+ /** Names a deploy checks that the platform does not hold. */
31
+ var UnsetEnvVars = class {
32
+ #names;
33
+ constructor(names) {
34
+ this.#names = names;
35
+ }
36
+ isEmpty() {
37
+ return this.#names.length === 0;
38
+ }
39
+ names() {
40
+ return this.#names;
41
+ }
42
+ };
43
+ const findUnset = ({ expected, setOnPlatform }) => new UnsetEnvVars([...expected].filter((name) => !setOnPlatform.has(name)));
44
+ //#endregion
1
45
  //#region src/application/releaseFlow.ts
2
46
  /** How the release itself runs, given an adapter for each port it runs on. */
3
47
  const releaseFlow = (ports) => ({
@@ -17,6 +61,7 @@ const deliveryModule = (kind, adapter, name = kind) => ({
17
61
  adapters: [adapter],
18
62
  decidedBy: adapter.decidedBy,
19
63
  typicalMinutes: adapter.typicalMinutes,
64
+ ...adapter.env ? { env: adapter.env } : {},
20
65
  requirements: (apps) => apps.flatMap((unit) => adapter.requirements?.(unit) ?? []),
21
66
  ship: ({ open }, input) => {
22
67
  const port = open(adapter);
@@ -71,6 +116,6 @@ const publishedPackage = ({ name, packageRegistry }) => ({
71
116
  /** A static site, built against the environment it ships to. */
72
117
  const webApp = ({ name, staticHosting }) => deliveryModule("web-app", staticHosting, name);
73
118
  //#endregion
74
- export { releaseFlow as a, backendService as i, publishedPackage as n, mobileApp as r, webApp as t };
119
+ export { releaseFlow as a, findUnset as c, backendService as i, isEnvVarName as l, publishedPackage as n, ENV_VAR_NAME as o, mobileApp as r, EnvToCheck as s, webApp as t };
75
120
 
76
- //# sourceMappingURL=web-app.module-6KrXIU7j.js.map
121
+ //# sourceMappingURL=web-app.module-Cg3SYqSo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-app.module-Cg3SYqSo.js","names":["#all","#perEnvironment","#names"],"sources":["../src/domain/checkEnvBeforeDeploy.ts","../src/application/releaseFlow.ts","../src/modules/deliveryModule.ts","../src/modules/backend-service/backend-service.module.ts","../src/modules/mobile-app/mobile-app.module.ts","../src/modules/published-package/published-package.module.ts","../src/modules/web-app/web-app.module.ts"],"sourcesContent":["import type { Environment } from \"./environment\";\n\n/** A name an app reads from its environment, as platforms store it: `SENTRY_DSN`. */\nexport type EnvVarName = string & { readonly brand: \"EnvVarName\" };\n\n/** UPPER_SNAKE: a capital letter, then capitals, digits or underscores. */\nexport const ENV_VAR_NAME = /^[A-Z][A-Z0-9_]*$/;\n\nexport const isEnvVarName = (text: string): text is EnvVarName => ENV_VAR_NAME.test(text);\n\n/** As a unit file writes it: one list for every environment, or `all` plus a list per environment. */\nexport type EnvToCheckInput =\n | readonly EnvVarName[]\n | ({ all?: readonly EnvVarName[] } & Partial<Record<Environment, readonly EnvVarName[]>>);\n\n/** The names a deploy checks on the platform before it ships, per environment. */\nexport class EnvToCheck {\n readonly #all: readonly EnvVarName[];\n readonly #perEnvironment: Partial<Record<Environment, readonly EnvVarName[]>>;\n\n constructor(input: EnvToCheckInput) {\n if (isList(input)) {\n this.#all = input;\n this.#perEnvironment = {};\n return;\n }\n const { all = [], ...perEnvironment } = input;\n this.#all = all;\n this.#perEnvironment = perEnvironment;\n }\n\n /** `all`, then that environment's own names. */\n for(environment: Environment): ReadonlySet<EnvVarName> {\n return new Set([...this.#all, ...(this.#perEnvironment[environment] ?? [])]);\n }\n\n /** Names in `all` that an environment lists again. */\n listedTwice(): EnvVarName[] {\n const extras = new Set(Object.values(this.#perEnvironment).flat());\n return [...new Set(this.#all)].filter((name) => extras.has(name));\n }\n}\n\nconst isList = (input: EnvToCheckInput): input is readonly EnvVarName[] => Array.isArray(input);\n\n/** Names a deploy checks that the platform does not hold. */\nexport class UnsetEnvVars {\n readonly #names: readonly EnvVarName[];\n\n constructor(names: readonly EnvVarName[]) {\n this.#names = names;\n }\n\n isEmpty(): boolean {\n return this.#names.length === 0;\n }\n\n names(): readonly EnvVarName[] {\n return this.#names;\n }\n}\n\nexport const findUnset = ({\n expected,\n setOnPlatform,\n}: {\n expected: ReadonlySet<EnvVarName>;\n setOnPlatform: ReadonlySet<EnvVarName>;\n}): UnsetEnvVars => new UnsetEnvVars([...expected].filter((name) => !setOnPlatform.has(name)));\n","import type { Approval } from \"../domain/releasePr\";\nimport type { ReleaseFlow } from \"../modules/module\";\nimport type { ServiceAdapter } from \"../ports/adapter.port\";\nimport type { CiPipelinePort } from \"../ports/ci-pipeline.port\";\nimport type { CodeHostPort } from \"../ports/code-host.port\";\nimport type { SourceControlPort } from \"../ports/source-control.port\";\nimport type { VersioningPort } from \"../ports/versioning.port\";\n\n/** How the release itself runs, given an adapter for each port it runs on. */\nexport const releaseFlow = (ports: {\n sourceControl: ServiceAdapter<SourceControlPort>;\n codeHost: ServiceAdapter<CodeHostPort>;\n ciPipeline: ServiceAdapter<CiPipelinePort>;\n versioning: ServiceAdapter<VersioningPort>;\n /** \"required\" when someone else approves the release PR; \"none\", the default, merges it here. */\n approval?: Approval;\n}): ReleaseFlow => ({ type: \"flow\", ...ports, approval: ports.approval ?? \"none\" });\n","import type { DeliveryAdapter } from \"../ports/adapter.port\";\nimport type { Delivery } from \"../ports/delivery.port\";\nimport type { ReleaseModule } from \"./module\";\n\n/** What every module of apps takes besides its adapter: a name, when two of a kind sit side by side. */\nexport interface Named {\n /** What an app's unit file names; the module's kind by default. */\n name?: string;\n}\n\n/** The stages every delivery adapter answers: its settings, where a tag lands and its jobs. */\nexport const deliveryModule = <Port extends Delivery & { capability: string }>(\n kind: string,\n adapter: DeliveryAdapter<Port>,\n name = kind,\n): ReleaseModule => ({\n type: \"module\",\n name,\n kind,\n provider: adapter.name,\n settings: adapter.settings,\n adapters: [adapter],\n decidedBy: adapter.decidedBy,\n typicalMinutes: adapter.typicalMinutes,\n ...(adapter.env ? { env: adapter.env } : {}),\n requirements: (apps) => apps.flatMap((unit) => adapter.requirements?.(unit) ?? []),\n ship: ({ open }, input) => {\n const port = open(adapter);\n return { where: port.describe(input), jobs: port.jobs(input) };\n },\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { ServerHostingPort } from \"../../ports/server-hosting.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A long-lived service, such as an API: deployed from its tag, recorded with the code host. */\nexport const backendService = ({\n name,\n serverHosting,\n}: Named & { serverHosting: DeliveryAdapter<ServerHostingPort> }): ReleaseModule =>\n deliveryModule(\"backend-service\", serverHosting, name);\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { MobileDistributionPort } from \"../../ports/mobile-distribution.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/**\n * A mobile app: its distribution decides between a store build and an over-the-air update, adds to\n * the release PR, and says how a version does before it is promoted.\n */\nexport const mobileApp = ({\n name,\n mobileDistribution,\n}: Named & { mobileDistribution: DeliveryAdapter<MobileDistributionPort> }): ReleaseModule => ({\n ...deliveryModule(\"mobile-app\", mobileDistribution, name),\n versionFiles: (unit, units, open) => open(mobileDistribution).versionFiles?.(unit, units) ?? [],\n version: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.beforeVersion\n ? port.beforeVersion(context, input)\n : { added: [], writes: [], summary: [], onMerge: \"\" };\n },\n decide: (context, input) => context.open(mobileDistribution).decide(context, input),\n health: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.health ? port.health(context, input) : null;\n },\n inspect: async (context, input) => {\n const port = context.open(mobileDistribution);\n return port.inspect ? port.inspect(context, input) : undefined;\n },\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { PackageRegistryPort } from \"../../ports/package-registry.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A package others install: its registry, not deploy records, knows what is out. */\nexport const publishedPackage = ({\n name,\n packageRegistry,\n}: Named & { packageRegistry: DeliveryAdapter<PackageRegistryPort> }): ReleaseModule => ({\n ...deliveryModule(\"published-package\", packageRegistry, name),\n decide: (context, input) => context.open(packageRegistry).decide(context, input),\n live: (context, input) => context.open(packageRegistry).live(context, input),\n});\n","import type { DeliveryAdapter } from \"../../ports/adapter.port\";\nimport type { StaticHostingPort } from \"../../ports/static-hosting.port\";\nimport type { Named } from \"../deliveryModule\";\nimport type { ReleaseModule } from \"../module\";\nimport { deliveryModule } from \"../deliveryModule\";\n\n/** A static site, built against the environment it ships to. */\nexport const webApp = ({\n name,\n staticHosting,\n}: Named & { staticHosting: DeliveryAdapter<StaticHostingPort> }): ReleaseModule =>\n deliveryModule(\"web-app\", staticHosting, name);\n"],"mappings":";;AAMA,MAAa,eAAe;AAE5B,MAAa,gBAAgB,SAAqC,aAAa,KAAK,KAAK;;AAQzF,IAAa,aAAb,MAAwB;CACtB;CACA;CAEA,YAAY,OAAwB;AAClC,MAAI,OAAO,MAAM,EAAE;AACjB,SAAA,MAAY;AACZ,SAAA,iBAAuB,EAAE;AACzB;;EAEF,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,mBAAmB;AACxC,QAAA,MAAY;AACZ,QAAA,iBAAuB;;;CAIzB,IAAI,aAAmD;AACrD,SAAO,IAAI,IAAI,CAAC,GAAG,MAAA,KAAW,GAAI,MAAA,eAAqB,gBAAgB,EAAE,CAAE,CAAC;;;CAI9E,cAA4B;EAC1B,MAAM,SAAS,IAAI,IAAI,OAAO,OAAO,MAAA,eAAqB,CAAC,MAAM,CAAC;AAClE,SAAO,CAAC,GAAG,IAAI,IAAI,MAAA,IAAU,CAAC,CAAC,QAAQ,SAAS,OAAO,IAAI,KAAK,CAAC;;;AAIrE,MAAM,UAAU,UAA2D,MAAM,QAAQ,MAAM;;AAG/F,IAAa,eAAb,MAA0B;CACxB;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AAS,SAAS,UAAU,QAAQ,KAAK,mBAAmB,CAAC,OAAO,SAAS,MAAM;CACnF,QAAQ,OAAO,SAAS,UAAU;EAChC,MAAM,OAAO,QAAQ,KAAK,mBAAmB;AAC7C,SAAO,KAAK,SAAS,KAAK,OAAO,SAAS,MAAM,GAAG;;CAErD,SAAS,OAAO,SAAS,UAAU;EACjC,MAAM,OAAO,QAAQ,KAAK,mBAAmB;AAC7C,SAAO,KAAK,UAAU,KAAK,QAAQ,SAAS,MAAM,GAAG,KAAA;;CAExD;;;;ACxBD,MAAa,oBAAoB,EAC/B,MACA,uBACuF;CACvF,GAAG,eAAe,qBAAqB,iBAAiB,KAAK;CAC7D,SAAS,SAAS,UAAU,QAAQ,KAAK,gBAAgB,CAAC,OAAO,SAAS,MAAM;CAChF,OAAO,SAAS,UAAU,QAAQ,KAAK,gBAAgB,CAAC,KAAK,SAAS,MAAM;CAC7E;;;;ACPD,MAAa,UAAU,EACrB,MACA,oBAEA,eAAe,WAAW,eAAe,KAAK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shiplane",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "The shiplane CLI: detects what changed, versions it and triggers each app's deploy through the plugins its config composes.",
5
5
  "homepage": "https://github.com/arnaud-zg/packages/tree/main/packages/shiplane#readme",
6
6
  "bugs": {