@rtrentjones/greenlight 0.2.27 → 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.27";
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}`;
@@ -626,16 +626,13 @@ module "${name}_neon" {
626
626
  module "${name}_vercel" {
627
627
  source = "${moduleSource("vercel", ref)}"
628
628
 
629
- project_id = var.${name}_vercel_project_id
629
+ # Non-secret id \u2014 create the Vercel project first (git-import, root dir tools/${name}), then commit
630
+ # the literal here (the heistmind pattern). No TF var / HCP workspace variable needed.
631
+ project_id = "prj_REPLACE_WITH_YOUR_VERCEL_PROJECT_ID"
630
632
  name = "${name}"
631
633
  domain = "${domain}"
632
634
  beta_branch = "develop"
633
635
  ${env}
634
- }
635
-
636
- variable "${name}_vercel_project_id" {
637
- type = string
638
- description = "Vercel project id for ${name} (prj_\u2026); the project must already exist."
639
636
  }`);
640
637
  }
641
638
  if (useOci) {
@@ -733,7 +730,7 @@ function emitWrapperMainTf(opts) {
733
730
  const providerBlocks = ['provider "cloudflare" {}', `provider "github" { owner = "${owner}" }`];
734
731
  if (need.has("vercel")) providerBlocks.push('provider "vercel" {}');
735
732
  if (need.has("supabase")) providerBlocks.push('provider "supabase" {}');
736
- if (need.has("neon")) providerBlocks.push('provider "neon" { api_key = var.neon_api_key }');
733
+ if (need.has("neon")) providerBlocks.push('provider "neon" {}');
737
734
  if (need.has("oci")) {
738
735
  providerBlocks.push(`provider "oci" {
739
736
  # trimspace guards against a trailing newline/space in a pasted secret (a malformed region
@@ -750,9 +747,6 @@ function emitWrapperMainTf(opts) {
750
747
  if (need.has("supabase")) {
751
748
  vars.push('variable "supabase_organization_id" { type = string }');
752
749
  }
753
- if (need.has("neon")) {
754
- vars.push('variable "neon_api_key" {\n type = string\n sensitive = true\n}');
755
- }
756
750
  if (need.has("oci")) {
757
751
  vars.push('variable "oci_tenancy_ocid" { type = string }');
758
752
  vars.push('variable "oci_user_ocid" { type = string }');
@@ -1147,6 +1141,30 @@ function templateDir(lane, target) {
1147
1141
  const base = join(templatesRoot(), `_template-${lane}`);
1148
1142
  return lane === "mcp" ? join(base, target) : base;
1149
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
+ }
1150
1168
  async function addCommand(args) {
1151
1169
  const name = args[0];
1152
1170
  if (!name || name.startsWith("-")) {
@@ -1189,7 +1207,10 @@ async function addCommand(args) {
1189
1207
  writeFileSync2(pkgPath, `${JSON.stringify(pkg, null, 2)}
1190
1208
  `);
1191
1209
  }
1210
+ const shippedGitignore = join(dest, "gitignore");
1211
+ if (existsSync5(shippedGitignore)) renameSync(shippedGitignore, join(dest, ".gitignore"));
1192
1212
  console.log(`\u2714 copied ${src} \u2192 tools/${name}`);
1213
+ if (existsSync5(pkgPath)) registerWorkspaceMember(process.cwd(), `tools/${name}`);
1193
1214
  } else {
1194
1215
  console.log(`! no template at ${src} \u2014 manifest entry added without scaffolding`);
1195
1216
  }
@@ -2140,6 +2161,22 @@ function conformanceChecks(t, root) {
2140
2161
  detail: generic.length ? `not tool-scoped (should contain ${tag}): ${generic.join(", ")}` : `${declared.length} scoped secret name(s)`
2141
2162
  });
2142
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
+ }
2143
2180
  return out;
2144
2181
  }
2145
2182
  function versionDriftCheck(root) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtrentjones/greenlight",
3
- "version": "0.2.27",
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.27",
35
- "@rtrentjones/greenlight-loop": "0.2.27",
36
- "@rtrentjones/greenlight-shared": "0.2.27",
37
- "@rtrentjones/greenlight-verify": "0.2.27"
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
+ }