shiplane 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +133 -0
- package/dist/budget-C8_aayQk.js +328 -0
- package/dist/budget-C8_aayQk.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +503 -0
- package/dist/cli.js.map +1 -0
- package/dist/display-DM0xtQbT.js +55 -0
- package/dist/display-DM0xtQbT.js.map +1 -0
- package/dist/index-QneBUiDD.d.ts +867 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/issues-C5fKq1Jv.js +6 -0
- package/dist/issues-C5fKq1Jv.js.map +1 -0
- package/dist/plugin.d.ts +16 -0
- package/dist/plugin.js +7 -0
- package/dist/readStatus-D5YVR5ZC.js +2921 -0
- package/dist/readStatus-D5YVR5ZC.js.map +1 -0
- package/dist/shell-server-hosting.adapter-Bgl6-IWw.js +49 -0
- package/dist/shell-server-hosting.adapter-Bgl6-IWw.js.map +1 -0
- package/dist/src-Dlr2Sgs8.js +32 -0
- package/dist/src-Dlr2Sgs8.js.map +1 -0
- package/dist/tags-DL74ni09.d.ts +19 -0
- package/dist/testing.d.ts +992 -0
- package/dist/testing.js +1349 -0
- package/dist/testing.js.map +1 -0
- package/dist/web-app.module-Bw-npC4Z.js +83 -0
- package/dist/web-app.module-Bw-npC4Z.js.map +1 -0
- package/package.json +58 -9
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { o as perEnv } from "./web-app.module-Bw-npC4Z.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/adapters/defineDelivery.ts
|
|
4
|
+
const widen = (port) => port;
|
|
5
|
+
const recipe = ({ name, settings, typicalMinutes, decidedBy, detect, questions, requirements, ...port }, capability) => ({
|
|
6
|
+
name,
|
|
7
|
+
capability,
|
|
8
|
+
settings,
|
|
9
|
+
typicalMinutes,
|
|
10
|
+
decidedBy,
|
|
11
|
+
detect,
|
|
12
|
+
questions,
|
|
13
|
+
requirements,
|
|
14
|
+
create: () => widen({
|
|
15
|
+
...port,
|
|
16
|
+
capability
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
const defineServerHosting = (adapter) => recipe(adapter, "server-hosting");
|
|
20
|
+
const defineStaticHosting = (adapter) => recipe(adapter, "static-hosting");
|
|
21
|
+
const defineMobileDistribution = (adapter) => recipe(adapter, "mobile-distribution");
|
|
22
|
+
const definePackageRegistry = (adapter) => recipe(adapter, "package-registry");
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/adapters/server-hosting/shell-server-hosting.adapter.ts
|
|
25
|
+
const ShellOptions = z.object({
|
|
26
|
+
deploy: perEnv(z.array(z.string()).min(1)).describe("The command that ships it, run from the root, as a list: [npx, my-tool, deploy]"),
|
|
27
|
+
url: perEnv(z.string()).optional().describe("Where it answers, for other units to read")
|
|
28
|
+
});
|
|
29
|
+
const shellServerHosting = () => defineServerHosting({
|
|
30
|
+
name: "shell",
|
|
31
|
+
settings: ShellOptions,
|
|
32
|
+
describe: ({ options }) => options.deploy.join(" "),
|
|
33
|
+
jobs: ({ tag, environment, options }) => {
|
|
34
|
+
const [command = "true", ...args] = options.deploy;
|
|
35
|
+
return [{
|
|
36
|
+
label: `ship ${tag}: ${options.deploy.join(" ")}`,
|
|
37
|
+
local: [{
|
|
38
|
+
command,
|
|
39
|
+
args
|
|
40
|
+
}],
|
|
41
|
+
ci: { ref: tag },
|
|
42
|
+
record: true
|
|
43
|
+
}];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { defineStaticHosting as a, defineServerHosting as i, defineMobileDistribution as n, definePackageRegistry as r, shellServerHosting as t };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=shell-server-hosting.adapter-Bgl6-IWw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-server-hosting.adapter-Bgl6-IWw.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 ...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 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,GAAG,QAEL,gBAC2B;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,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;;;AC3DnG,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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import "./web-app.module-Bw-npC4Z.js";
|
|
2
|
+
import "./shell-server-hosting.adapter-Bgl6-IWw.js";
|
|
3
|
+
import { z, z as z$1 } from "zod";
|
|
4
|
+
//#region src/application/config/defineRelease.ts
|
|
5
|
+
const defineRelease = (config) => config;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/modules/internal-tool/internal-tool.module.ts
|
|
8
|
+
/**
|
|
9
|
+
* An app nothing deploys, such as a CLI run from the repository: a release versions it, tags it and
|
|
10
|
+
* publishes its notes, and every environment counts it as shipped once tagged.
|
|
11
|
+
*/
|
|
12
|
+
const internalTool = ({ name = "internal-tool" } = {}) => ({
|
|
13
|
+
type: "module",
|
|
14
|
+
name,
|
|
15
|
+
kind: "internal-tool",
|
|
16
|
+
provider: "release-only",
|
|
17
|
+
settings: z.object({}),
|
|
18
|
+
adapters: [],
|
|
19
|
+
releaseOnly: true,
|
|
20
|
+
ship: () => ({
|
|
21
|
+
where: "its tag and release notes, nothing deploys it",
|
|
22
|
+
jobs: []
|
|
23
|
+
}),
|
|
24
|
+
decide: () => Promise.resolve({
|
|
25
|
+
action: "none",
|
|
26
|
+
status: "released, nothing deploys it"
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { internalTool as n, defineRelease as r, z$1 as t };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=src-Dlr2Sgs8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-Dlr2Sgs8.js","names":[],"sources":["../src/application/config/defineRelease.ts","../src/modules/internal-tool/internal-tool.module.ts"],"sourcesContent":["import type { DisplayChoice } from \"../../domain/display\";\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 /** How a tag names a version: `{name}@{version}` when absent, or e.g. `v{version}`, `{name}--v{version}`. */\n tag?: string;\n /**\n * A unit whose folder changed with no changeset naming it: `\"ignore\"` (the default, as changesets\n * does) leaves it, `\"release\"` offers it with a changelog from its commits.\n */\n commitsWithoutChangeset?: \"release\" | \"ignore\";\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 { 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":";;;;AAwBA,MAAa,iBAAiB,WAAyC;;;;;;;ACfvE,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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/domain/tags.d.ts
|
|
2
|
+
/** How a tag names a unit's version unless the config says otherwise. */
|
|
3
|
+
declare const DEFAULT_TAG_FORMAT = "{name}@{version}";
|
|
4
|
+
/** A unit's tag for a version, through a format like `v{version}` or `{name}--v{version}`. */
|
|
5
|
+
declare const tagName: (app: string, version: string, format?: string) => string;
|
|
6
|
+
interface ReleaseTag {
|
|
7
|
+
/** The unit's name. */
|
|
8
|
+
app: string;
|
|
9
|
+
version: string;
|
|
10
|
+
tag: string;
|
|
11
|
+
sha: string;
|
|
12
|
+
needsTag: boolean;
|
|
13
|
+
needsNotes: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** A release pull request's subject: `chore(api): release v0.0.4`, or `chore(release): ...` for several. */
|
|
16
|
+
declare const isReleaseSubject: (subject: string) => boolean;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { tagName as i, ReleaseTag as n, isReleaseSubject as r, DEFAULT_TAG_FORMAT as t };
|
|
19
|
+
//# sourceMappingURL=tags-DL74ni09.d.ts.map
|