shiplane 0.3.0 → 0.4.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/README.md +8 -7
- package/dist/budget-CTjB1v-Z.js.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/{index-oKnmZ8qV.d.ts → index-Cb8R0RIA.d.ts} +13 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +2 -2
- package/dist/{readStatus-Bo7hpUT3.js → readStatus-DmT61axf.js} +3 -3
- package/dist/readStatus-DmT61axf.js.map +1 -0
- package/dist/src-Dqo5lgrW.js +114 -0
- package/dist/src-Dqo5lgrW.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/readStatus-Bo7hpUT3.js.map +0 -1
- package/dist/src-CGASfBy2.js +0 -32
- package/dist/src-CGASfBy2.js.map +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import "./perEnv-B7AiYnW_.js";
|
|
2
|
+
import "./shell-server-hosting.adapter-DobfDqFm.js";
|
|
3
|
+
import { z, z as z$1 } from "zod";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
//#region src/application/config/defineRelease.ts
|
|
7
|
+
const defineRelease = (config) => config;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/modules/agent-plugin/agent-plugin.module.ts
|
|
10
|
+
/**
|
|
11
|
+
* Where each agent reads a plugin's version, relative to the plugin's folder: Claude Code and
|
|
12
|
+
* Copilot CLI, Codex, Cursor, then Gemini CLI.
|
|
13
|
+
*/
|
|
14
|
+
const AGENT_MANIFESTS = [
|
|
15
|
+
".claude-plugin/plugin.json",
|
|
16
|
+
".codex-plugin/plugin.json",
|
|
17
|
+
".cursor-plugin/plugin.json",
|
|
18
|
+
"gemini-extension.json"
|
|
19
|
+
];
|
|
20
|
+
const Versioned = z.object({ version: z.string() });
|
|
21
|
+
/** A manifest's version, or null when the file is missing or holds no top-level version. */
|
|
22
|
+
const versionIn = (file) => {
|
|
23
|
+
if (!fs.existsSync(file)) return null;
|
|
24
|
+
const parsed = Versioned.safeParse(JSON.parse(fs.readFileSync(file, "utf8")));
|
|
25
|
+
return parsed.success ? parsed.data.version : null;
|
|
26
|
+
};
|
|
27
|
+
const literal = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
28
|
+
/** Moves only the version's value, so the release PR shows one changed line per manifest. */
|
|
29
|
+
const setVersion = (file, from, to) => {
|
|
30
|
+
const text = fs.readFileSync(file, "utf8");
|
|
31
|
+
const moved = text.replace(new RegExp(`("version"\\s*:\\s*)"${literal(from)}"`), `$1${JSON.stringify(to)}`);
|
|
32
|
+
const top = Versioned.safeParse(JSON.parse(moved));
|
|
33
|
+
const json = JSON.parse(text);
|
|
34
|
+
fs.writeFileSync(file, top.success && top.data.version === to ? moved : `${JSON.stringify({
|
|
35
|
+
...json,
|
|
36
|
+
version: to
|
|
37
|
+
}, null, 2)}\n`);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A plugin for coding agents, such as a Claude Code, Codex or Cursor plugin: a release versions it,
|
|
41
|
+
* writes the version into each agent's manifest in the release PR, tags it and publishes its notes.
|
|
42
|
+
* Nothing deploys it: agents install it from the repository, so merging the release PR ships it.
|
|
43
|
+
*/
|
|
44
|
+
const agentPlugin = ({ name = "agent-plugin" } = {}) => ({
|
|
45
|
+
type: "module",
|
|
46
|
+
name,
|
|
47
|
+
kind: "agent-plugin",
|
|
48
|
+
provider: "marketplace",
|
|
49
|
+
settings: z.object({}),
|
|
50
|
+
adapters: [],
|
|
51
|
+
releaseOnly: true,
|
|
52
|
+
version: ({ root }, { unit, bump }) => {
|
|
53
|
+
if (!bump) return Promise.resolve({
|
|
54
|
+
added: [],
|
|
55
|
+
writes: [],
|
|
56
|
+
summary: [],
|
|
57
|
+
onMerge: ""
|
|
58
|
+
});
|
|
59
|
+
const manifests = AGENT_MANIFESTS.map((file) => path.posix.join(unit.dir, file)).flatMap((file) => {
|
|
60
|
+
const from = versionIn(path.join(root, file));
|
|
61
|
+
return from === null ? [] : [{
|
|
62
|
+
file,
|
|
63
|
+
from
|
|
64
|
+
}];
|
|
65
|
+
});
|
|
66
|
+
return Promise.resolve({
|
|
67
|
+
added: [],
|
|
68
|
+
writes: manifests.map(({ file, from }) => ({
|
|
69
|
+
label: `${file} → ${bump.to}`,
|
|
70
|
+
run: () => {
|
|
71
|
+
setVersion(path.join(root, file), from, bump.to);
|
|
72
|
+
return Promise.resolve();
|
|
73
|
+
}
|
|
74
|
+
})),
|
|
75
|
+
summary: [],
|
|
76
|
+
onMerge: "Agents update to it: merging ships it"
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
ship: () => ({
|
|
80
|
+
where: "its tag and release notes; agents install it from the repository",
|
|
81
|
+
jobs: []
|
|
82
|
+
}),
|
|
83
|
+
decide: () => Promise.resolve({
|
|
84
|
+
action: "none",
|
|
85
|
+
status: "released, agents install it from the repository"
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/modules/internal-tool/internal-tool.module.ts
|
|
90
|
+
/**
|
|
91
|
+
* An app nothing deploys, such as a CLI run from the repository: a release versions it, tags it and
|
|
92
|
+
* publishes its notes, and every environment counts it as shipped once tagged.
|
|
93
|
+
*/
|
|
94
|
+
const internalTool = ({ name = "internal-tool" } = {}) => ({
|
|
95
|
+
type: "module",
|
|
96
|
+
name,
|
|
97
|
+
kind: "internal-tool",
|
|
98
|
+
provider: "release-only",
|
|
99
|
+
settings: z.object({}),
|
|
100
|
+
adapters: [],
|
|
101
|
+
releaseOnly: true,
|
|
102
|
+
ship: () => ({
|
|
103
|
+
where: "its tag and release notes, nothing deploys it",
|
|
104
|
+
jobs: []
|
|
105
|
+
}),
|
|
106
|
+
decide: () => Promise.resolve({
|
|
107
|
+
action: "none",
|
|
108
|
+
status: "released, nothing deploys it"
|
|
109
|
+
})
|
|
110
|
+
});
|
|
111
|
+
//#endregion
|
|
112
|
+
export { defineRelease as i, internalTool as n, agentPlugin as r, z$1 as t };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=src-Dqo5lgrW.js.map
|
|
@@ -0,0 +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 /**\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 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":";;;;;;AA2BA,MAAa,iBAAiB,WAAyC;;;;;;;AChBvE,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACD;AAED,MAAM,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;;AAGnD,MAAM,aAAa,SAAiB;AAClC,KAAI,CAAC,GAAG,WAAW,KAAK,CAAE,QAAO;CACjC,MAAM,SAAS,UAAU,UAAU,KAAK,MAAM,GAAG,aAAa,MAAM,OAAO,CAAC,CAAC;AAC7E,QAAO,OAAO,UAAU,OAAO,KAAK,UAAU;;AAGhD,MAAM,WAAW,SAAiB,KAAK,QAAQ,uBAAuB,OAAO;;AAG7E,MAAM,cAAc,MAAc,MAAc,OAAe;CAC7D,MAAM,OAAO,GAAG,aAAa,MAAM,OAAO;CAC1C,MAAM,QAAQ,KAAK,QACjB,IAAI,OA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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"}
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as OpenPr, C as Clock, D as StepPlace, E as Prompter, F as ShellResult, G as DeployPath, I as CiPipelinePort, L as CodeHostPort, N as RunOptions, O as SourceControlPort, P as Shell, S as Choice, T as Progress, X as Approval, a as VersioningPort, at as UnreleasedApp, c as DeliveryAdapter, ct as ReleaseUnit, et as ReleaseStep, ft as Mood, i as MobileDistributionPort, it as UnitRef, l as ServiceAdapter, lt as DisplayChoice, mt as Environment, n as ServerHostingPort, nt as PlannedChangeset, p as Delivery, r as PackageRegistryPort, rt as StatusPlan, st as splitChangesets, t as StaticHostingPort, tt as AppBump, w as Output, x as VersionContribution, z as IssueRef } from "./static-hosting.port-mknLsxwR.js";
|
|
2
|
-
import {
|
|
2
|
+
import { _ as Feature, b as ReleaseFlow, w as ReleaseTag, x as ReleaseModule, y as Open } from "./index-Cb8R0RIA.js";
|
|
3
3
|
import { a as VersioningFake, c as ciPipelineFake, d as codeHostFake, f as SourceControlFake, i as serverHostingFake, l as CodeHostFake, n as mobileDistributionFake, o as versioningFake, p as sourceControlFake, r as staticHostingFake, s as CiPipelineFake, t as packageRegistryFake, u as HostEvent } from "./package-registry.fake-CC37ptzf.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import * as _$vitest from "vitest";
|
package/dist/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as releaseFlow } from "./web-app.module-6KrXIU7j.js";
|
|
2
|
-
import { C as refreshEditorSchema, D as nodeFiles, T as ENVIRONMENTS, _ 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, w as optionsFor, x as doctor, y as removeUnit } from "./readStatus-
|
|
2
|
+
import { C as refreshEditorSchema, D as nodeFiles, T as ENVIRONMENTS, _ 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, w as optionsFor, x as doctor, y as removeUnit } from "./readStatus-DmT61axf.js";
|
|
3
3
|
import { v as nextPatch, x as DEFAULT_TAG_FORMAT } from "./budget-CTjB1v-Z.js";
|
|
4
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-Ciqc4ujx.js";
|
|
5
5
|
import { z } from "zod";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shiplane",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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": {
|