Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

Plugins release: the README asks for the CLI the hooks need

The published README said the hooks need the g1t CLI 0.3.2; they need 0.4.0. It now reads the version from the CLI contract, and the test checks it against the hooks' MIN_CLI.

G1T-Session:
ses_01m56x1naveyhs08bw0cwsh2sf
syntaqxcommitted Parent570c514Browse files
2 files+16−40/2 viewed
+11−3
120120 return { ...marketplace, plugins: marketplace.plugins.map((p) => ({ ...p, source: `./${PUBLISHED}` })) };
121121 }
122122
123−export function readme(version) {
123+/**
124+ * The oldest g1t CLI the plugin's hooks work with: the CLI contract's
125+ * minimum_version, which the hooks' MIN_CLI keeps to.
126+ */
127+export function minimumCli(root = ROOT) {
128+ return readJson(root, `${SOURCE}/test/cli-contract.json`).minimum_version;
129+}
130+
131+export function readme(version, cli = minimumCli()) {
124132 return `# g1t plugins
125133
126134 g1t's plugin marketplace for Claude Code and Codex. Choose your client below.
138146
139147 Then start Claude Code again, run \`/mcp\` and sign **plugin:g1t:g1t** in.
140148 The plugin's hooks need the [g1t CLI](https://docs.g1t.sh/guides/cli/)
141−0.3.2 or later and Node 18 or later.
149+${cli} or later and Node 18 or later.
142150
143151 The guide, with what each hook records and never records and how to opt
144152 out: https://docs.g1t.sh/guides/claude-code-plugin/
209217 mkdirSync(join(out, ".agents/plugins"), { recursive: true });
210218 writeFileSync(join(out, ".agents/plugins/marketplace.json"), JSON.stringify(codexMarketplace(), null, 2) + "\n");
211219 for (const name of CODEX_FILES) cpSync(join(root, CODEX_SOURCE, name), join(out, CODEX_PUBLISHED, name), { recursive: true });
212− writeFileSync(join(out, "README.md"), readme(version) + `
220+ writeFileSync(join(out, "README.md"), readme(version, minimumCli(root)) + `
213221 ## Codex
214222
215223 Add this marketplace with:
+5−1
77 import { after, test } from "node:test";
88 import { fileURLToPath } from "node:url";
99
10−import { INSTALL, PUBLISHED, SOURCE, authEnv, tagName, build, expectedFiles, manifests, publish, scan, walk } from "./plugins-release.mjs";
10+import { INSTALL, PUBLISHED, SOURCE, authEnv, tagName, build, expectedFiles, manifests, minimumCli, publish, scan, walk } from "./plugins-release.mjs";
1111
1212 const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
1313 const temps = [];
5656 }
5757 const readme = readFileSync(join(out, "README.md"), "utf8");
5858 for (const line of INSTALL) assert.ok(readme.includes(line), line);
59+ // The CLI the README asks for is the one the hooks need.
60+ const hooks = readFileSync(join(ROOT, SOURCE, "hooks/g1t.mjs"), "utf8");
61+ assert.equal(minimumCli(), hooks.match(/export const MIN_CLI = "([^"]+)"/)?.[1]);
62+ assert.ok(readme.includes(`${minimumCli()} or later and Node`), readme);
5963 });
6064
6165 test("manifests that disagree stop the build", () => {

Comments

Sign in to comment.