@rtrentjones/greenlight 0.5.0 → 0.5.1

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.
@@ -37,7 +37,11 @@ plain `.sql`); the app's own build runs its migrate against the wired **`DIRECT_
37
37
  prod branch, preview build → preview branch; a failed migrate fails the build = a natural gate). The
38
38
  **native Neon↔Vercel integration** owns ephemeral per-PR preview branches (don't put those in
39
39
  Terraform). Greenlight's only role is the **dangerous-SQL gate**: run `greenlight migrations scan`
40
- (auto-detects `supabase/migrations | migrations | drizzle/migrations | …`) in CI before the migrate.
40
+ (auto-detects `supabase/migrations | migrations | drizzle/migrations | …`) **before** the migrate.
41
+ For a Vercel-git tool the migrate runs in the build, so wire the scan there — first in the build/migrate
42
+ script: `"migrate": "greenlight migrations scan && node scripts/migrate.mjs"`, `"build": "pnpm run
43
+ migrate && next build"` (add `@rtrentjones/greenlight` as a devDep so the bin resolves in the build).
44
+ `doctor` recognizes the scan wired in the build script **or** a workflow.
41
45
  See [migrations.md](https://github.com/RTrentJones/greenlight/blob/main/docs/migrations.md).
42
46
 
43
47
  ## Sharing one DB + multi-account
package/dist/bin.js CHANGED
@@ -601,7 +601,7 @@ function tokensForTool(tool) {
601
601
  }
602
602
 
603
603
  // src/version.ts
604
- var MODULE_REF = "v0.5.0";
604
+ var MODULE_REF = "v0.5.1";
605
605
  var MODULE_SOURCE_BASE = "git::https://github.com/RTrentJones/greenlight.git//infra/modules";
606
606
  function moduleSource(module, ref = MODULE_REF) {
607
607
  return `${MODULE_SOURCE_BASE}/${module}?ref=${ref}`;
@@ -2475,7 +2475,7 @@ function conformanceChecks(t, root) {
2475
2475
  const migBase = join6(root, toolDir);
2476
2476
  const migDir = resolveMigrationsDir(void 0, migBase);
2477
2477
  if (existsSync9(join6(migBase, migDir))) {
2478
- const wired = [join6(migBase, ".github/workflows"), join6(root, ".github/workflows")].some(
2478
+ const inWorkflow = [join6(migBase, ".github/workflows"), join6(root, ".github/workflows")].some(
2479
2479
  (d) => {
2480
2480
  try {
2481
2481
  return readdirSync4(d).filter((f) => /\.ya?ml$/.test(f)).some((f) => readFileSync8(join6(d, f), "utf8").includes("migrations scan"));
@@ -2484,10 +2484,19 @@ function conformanceChecks(t, root) {
2484
2484
  }
2485
2485
  }
2486
2486
  );
2487
+ const inScripts = (() => {
2488
+ try {
2489
+ const pkg = JSON.parse(readFileSync8(join6(migBase, "package.json"), "utf8"));
2490
+ return Object.values(pkg.scripts ?? {}).some((s) => s.includes("migrations scan"));
2491
+ } catch {
2492
+ return false;
2493
+ }
2494
+ })();
2495
+ const wired = inWorkflow || inScripts;
2487
2496
  out.push({
2488
2497
  name: `${t.name}: migrations gate`,
2489
2498
  status: wired ? "ok" : "warn",
2490
- detail: wired ? `${migDir} scanned in CI` : `${migDir} present but no workflow runs \`greenlight migrations scan\` \u2014 wire the dangerous-SQL gate before the apply step`
2499
+ detail: wired ? `${migDir} scanned before apply (${inWorkflow ? "CI workflow" : "build script"})` : `${migDir} present but no workflow or build script runs \`greenlight migrations scan\` \u2014 wire the dangerous-SQL gate before the apply step`
2491
2500
  });
2492
2501
  }
2493
2502
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtrentjones/greenlight",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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.5.0",
35
- "@rtrentjones/greenlight-loop": "0.5.0",
36
- "@rtrentjones/greenlight-shared": "0.5.0",
37
- "@rtrentjones/greenlight-verify": "0.5.0"
34
+ "@rtrentjones/greenlight-adapters": "0.5.1",
35
+ "@rtrentjones/greenlight-loop": "0.5.1",
36
+ "@rtrentjones/greenlight-verify": "0.5.1",
37
+ "@rtrentjones/greenlight-shared": "0.5.1"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "node scripts/copy-assets.mjs && tsup",