@rtrentjones/greenlight 0.2.28 → 0.2.29

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/dist/bin.js CHANGED
@@ -15,7 +15,7 @@ import "./chunk-XWTOJHLV.js";
15
15
  import "./chunk-QFKE5JKC.js";
16
16
 
17
17
  // src/commands/add.ts
18
- import { cpSync as cpSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
18
+ import { cpSync as cpSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, renameSync, writeFileSync as writeFileSync2 } from "fs";
19
19
  import { join, resolve as resolve5 } from "path";
20
20
 
21
21
  // src/asset-paths.ts
@@ -478,7 +478,7 @@ function tokensForTool(tool) {
478
478
  }
479
479
 
480
480
  // src/version.ts
481
- var MODULE_REF = "v0.2.28";
481
+ var MODULE_REF = "v0.2.29";
482
482
  var MODULE_SOURCE_BASE = "git::https://github.com/RTrentJones/greenlight.git//infra/modules";
483
483
  function moduleSource(module, ref = MODULE_REF) {
484
484
  return `${MODULE_SOURCE_BASE}/${module}?ref=${ref}`;
@@ -1141,6 +1141,30 @@ function templateDir(lane, target) {
1141
1141
  const base = join(templatesRoot(), `_template-${lane}`);
1142
1142
  return lane === "mcp" ? join(base, target) : base;
1143
1143
  }
1144
+ function registerWorkspaceMember(cwd, member) {
1145
+ const wsPath = join(cwd, "pnpm-workspace.yaml");
1146
+ if (!existsSync5(wsPath)) {
1147
+ writeFileSync2(wsPath, `packages:
1148
+ - "${member}"
1149
+ `);
1150
+ console.log(`\u2714 created pnpm-workspace.yaml (member ${member})`);
1151
+ return;
1152
+ }
1153
+ const text = readFileSync3(wsPath, "utf8");
1154
+ if (text.includes(member) || /^\s*-\s*["']?tools\/\*/m.test(text)) return;
1155
+ const lines = text.split("\n");
1156
+ const pkgIdx = lines.findIndex((l) => /^packages\s*:/.test(l));
1157
+ if (pkgIdx === -1) {
1158
+ writeFileSync2(wsPath, `${text.replace(/\s*$/, "")}
1159
+ packages:
1160
+ - "${member}"
1161
+ `);
1162
+ } else {
1163
+ lines.splice(pkgIdx + 1, 0, ` - "${member}"`);
1164
+ writeFileSync2(wsPath, lines.join("\n"));
1165
+ }
1166
+ console.log(`\u2714 registered ${member} in pnpm-workspace.yaml`);
1167
+ }
1144
1168
  async function addCommand(args) {
1145
1169
  const name = args[0];
1146
1170
  if (!name || name.startsWith("-")) {
@@ -1183,7 +1207,10 @@ async function addCommand(args) {
1183
1207
  writeFileSync2(pkgPath, `${JSON.stringify(pkg, null, 2)}
1184
1208
  `);
1185
1209
  }
1210
+ const shippedGitignore = join(dest, "gitignore");
1211
+ if (existsSync5(shippedGitignore)) renameSync(shippedGitignore, join(dest, ".gitignore"));
1186
1212
  console.log(`\u2714 copied ${src} \u2192 tools/${name}`);
1213
+ if (existsSync5(pkgPath)) registerWorkspaceMember(process.cwd(), `tools/${name}`);
1187
1214
  } else {
1188
1215
  console.log(`! no template at ${src} \u2014 manifest entry added without scaffolding`);
1189
1216
  }
@@ -2134,6 +2161,22 @@ function conformanceChecks(t, root) {
2134
2161
  detail: generic.length ? `not tool-scoped (should contain ${tag}): ${generic.join(", ")}` : `${declared.length} scoped secret name(s)`
2135
2162
  });
2136
2163
  }
2164
+ if (!t.external && t.lane === "next" && t.target === "vercel") {
2165
+ const wsPath = join4(root, "pnpm-workspace.yaml");
2166
+ const ws = existsSync7(wsPath) ? readFileSync5(wsPath, "utf8") : "";
2167
+ const member = ws.includes(toolDir) || /^\s*-\s*["']?tools\/\*/m.test(ws);
2168
+ out.push({
2169
+ name: `${t.name}: pnpm workspace member`,
2170
+ status: member ? "ok" : "warn",
2171
+ detail: member ? void 0 : `add "${toolDir}" to pnpm-workspace.yaml \u2014 else Vercel's root install skips its deps`
2172
+ });
2173
+ const hasVercelJson = existsSync7(join4(root, toolDir, "vercel.json"));
2174
+ out.push({
2175
+ name: `${t.name}: vercel.json framework`,
2176
+ status: hasVercelJson ? "ok" : "warn",
2177
+ detail: hasVercelJson ? void 0 : `no ${join4(toolDir, "vercel.json")} (framework: "nextjs") \u2014 Vercel may treat the build as static`
2178
+ });
2179
+ }
2137
2180
  return out;
2138
2181
  }
2139
2182
  function versionDriftCheck(root) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtrentjones/greenlight",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "description": "Greenlight CLI — setup and lifecycle for the harness.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,10 +31,10 @@
31
31
  "@anthropic-ai/sdk": "^0.69.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@rtrentjones/greenlight-adapters": "0.2.28",
35
- "@rtrentjones/greenlight-loop": "0.2.28",
36
- "@rtrentjones/greenlight-verify": "0.2.28",
37
- "@rtrentjones/greenlight-shared": "0.2.28"
34
+ "@rtrentjones/greenlight-adapters": "0.2.29",
35
+ "@rtrentjones/greenlight-loop": "0.2.29",
36
+ "@rtrentjones/greenlight-verify": "0.2.29",
37
+ "@rtrentjones/greenlight-shared": "0.2.29"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node scripts/copy-assets.mjs && tsup",
@@ -0,0 +1,5 @@
1
+ # Shipped as `gitignore` (no dot) so it survives the npm tarball; `greenlight add` renames it to
2
+ # `.gitignore` on scaffold. Next.js build output + generated types (regenerated on every build).
3
+ .next/
4
+ next-env.d.ts
5
+ node_modules/
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://openapi.vercel.sh/vercel.json",
3
+ "framework": "nextjs"
4
+ }