@appsforgood/next-supabase-kit 0.2.0 → 0.3.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.
@@ -17,13 +17,15 @@ Protect `main` with:
17
17
  - Do not allow deletions.
18
18
  - Restrict bypasses to maintainers only.
19
19
 
20
- Required status checks:
20
+ Optional status checks, only after GitHub Actions entitlement is confirmed and the project deliberately chooses hosted CI as required:
21
21
 
22
22
  - `Verify package`
23
23
  - `Review dependency changes`
24
24
  - `Analyze JavaScript and TypeScript`
25
25
  - `Scorecard`
26
26
 
27
+ With the default `githubActions.mode: "off"`, configure no required hosted status checks. GitHub billing, spending-limit, or pre-execution failures cannot be recovered inside workflow YAML and must not block commit/push or ordinary phase progression. Preserve equivalent local test, audit, dependency, and security evidence in the council session.
28
+
27
29
  ## Release Environment
28
30
 
29
31
  Create environment `npm-publish` with:
package/SUPPLY_CHAIN.md CHANGED
@@ -37,8 +37,9 @@ The release workflow and `npm run publish:verify` both use `scripts/post-publish
37
37
 
38
38
  ## Repository Automation
39
39
 
40
- - CI verifies package behavior on push and pull request.
41
- - Dependency Review blocks pull requests that introduce moderate or worse known vulnerabilities.
40
+ - Local `npm run release:check` is the default package verification and supply-chain gate.
41
+ - Hosted CI may mirror package verification on push and pull request when Actions entitlement is deliberately enabled.
42
+ - Dependency Review can block pull requests that introduce moderate or worse known vulnerabilities when hosted Actions is available; otherwise review `npm audit` and lockfile changes locally.
42
43
  - Dependabot proposes npm and GitHub Actions updates; workflow actions remain pinned to immutable commit SHAs with reviewed version comments.
43
44
  - CodeQL scans JavaScript/TypeScript code.
44
45
  - OpenSSF Scorecard publishes repository security posture as code-scanning evidence.
package/dist/index.js CHANGED
@@ -182,11 +182,14 @@ import { join as join14, normalize } from "path";
182
182
 
183
183
  // src/config/defaults.ts
184
184
  var PACKAGE_NAME = "@appsforgood/next-supabase-kit";
185
- var PACKAGE_VERSION = "0.2.0";
185
+ var PACKAGE_VERSION = "0.3.0";
186
186
  var DEFAULT_CONFIG = {
187
187
  stack: "next-supabase",
188
188
  projectType: "saas",
189
189
  docsMode: "advisory",
190
+ githubActions: {
191
+ mode: "off"
192
+ },
190
193
  agentCouncil: {
191
194
  required: true,
192
195
  rosterPath: ".agent-kit/agent-roster.json",
@@ -1726,7 +1729,7 @@ function ideSurfaceToActivateTarget(ideSurface) {
1726
1729
  // src/install/managed-assets.ts
1727
1730
  import { readFileSync as readFileSync8 } from "fs";
1728
1731
  import { join as join10 } from "path";
1729
- function listManagedAssets(packageRoot, stack) {
1732
+ function listManagedAssets(packageRoot, stack, options = {}) {
1730
1733
  const assets = [];
1731
1734
  const templateRoot = join10(packageRoot, "templates", stack);
1732
1735
  for (const target of ROOT_DOCS) {
@@ -1741,8 +1744,10 @@ function listManagedAssets(packageRoot, stack) {
1741
1744
  { target: DEFAULT_ORCHESTRATOR_TARGET, sourcePath: join10(packageRoot, DEFAULT_ORCHESTRATOR_SOURCE), category: "orchestrator" },
1742
1745
  { target: DEFAULT_RUNTIME_IGNORE_TARGET, sourcePath: join10(packageRoot, DEFAULT_RUNTIME_IGNORE_SOURCE), category: "orchestrator" }
1743
1746
  );
1744
- for (const template of CI_TEMPLATE_FILES) {
1745
- assets.push({ target: template.target, sourcePath: join10(packageRoot, template.source), category: "ci" });
1747
+ if (options.includeCi) {
1748
+ for (const template of CI_TEMPLATE_FILES) {
1749
+ assets.push({ target: template.target, sourcePath: join10(packageRoot, template.source), category: "ci" });
1750
+ }
1746
1751
  }
1747
1752
  for (const folder of LIBRARY_FOLDERS) {
1748
1753
  for (const relativePath of listFilesRecursive(join10(packageRoot, folder))) {
@@ -1768,7 +1773,9 @@ function initProject(options) {
1768
1773
  const stack = options.stack ?? DEFAULT_CONFIG.stack;
1769
1774
  const packageRoot = findPackageRoot();
1770
1775
  const templateRoot = join11(packageRoot, "templates", stack);
1771
- const managedAssets = listManagedAssets(packageRoot, stack);
1776
+ const existingGithubActionsMode = readGithubActionsMode(cwd);
1777
+ const githubActionsMode = options.githubActions || existingGithubActionsMode === "advisory" ? "advisory" : "off";
1778
+ const managedAssets = listManagedAssets(packageRoot, stack, { includeCi: githubActionsMode !== "off" });
1772
1779
  if (!existsSync10(templateRoot)) {
1773
1780
  throw new Error(`Unsupported stack profile: ${stack}`);
1774
1781
  }
@@ -1863,20 +1870,26 @@ function initProject(options) {
1863
1870
  };
1864
1871
  writeText(join11(cwd, ".agent-kit", "manifest.json"), `${JSON.stringify(manifest, null, 2)}
1865
1872
  `);
1866
- writeText(join11(cwd, ".agent-kit", "config.json"), `${JSON.stringify(DEFAULT_CONFIG, null, 2)}
1873
+ const config = {
1874
+ ...DEFAULT_CONFIG,
1875
+ githubActions: { mode: githubActionsMode }
1876
+ };
1877
+ writeText(join11(cwd, ".agent-kit", "config.json"), `${JSON.stringify(config, null, 2)}
1867
1878
  `);
1868
1879
  const overridesPath = join11(cwd, ".agent-kit", "overrides.json");
1869
1880
  if (!existsSync10(overridesPath)) writeText(overridesPath, `${JSON.stringify({ templates: {} }, null, 2)}
1870
1881
  `);
1871
- for (const template of CI_TEMPLATE_FILES) {
1872
- const ciCopy = copyTextWithConflict(join11(packageRoot, template.source), cwd, template.target, {
1873
- force: Boolean(options.force),
1874
- conflictRoot: join11(cwd, ".agent-kit", "conflicts")
1875
- });
1876
- if (ciCopy.action === "created") result.copied.push(ciCopy.target);
1877
- if (ciCopy.action === "unchanged") result.unchanged.push(ciCopy.target);
1878
- if (ciCopy.action === "overwritten") result.overwritten.push(ciCopy.target);
1879
- if (ciCopy.action === "conflict") result.conflicts.push(`${ciCopy.target} -> ${ciCopy.conflictPath}`);
1882
+ if (githubActionsMode !== "off") {
1883
+ for (const template of CI_TEMPLATE_FILES) {
1884
+ const ciCopy = copyTextWithConflict(join11(packageRoot, template.source), cwd, template.target, {
1885
+ force: Boolean(options.force),
1886
+ conflictRoot: join11(cwd, ".agent-kit", "conflicts")
1887
+ });
1888
+ if (ciCopy.action === "created") result.copied.push(ciCopy.target);
1889
+ if (ciCopy.action === "unchanged") result.unchanged.push(ciCopy.target);
1890
+ if (ciCopy.action === "overwritten") result.overwritten.push(ciCopy.target);
1891
+ if (ciCopy.action === "conflict") result.conflicts.push(`${ciCopy.target} -> ${ciCopy.conflictPath}`);
1892
+ }
1880
1893
  }
1881
1894
  const context2 = initProjectContext(cwd);
1882
1895
  result.contextPath = context2.contextPath;
@@ -1899,6 +1912,23 @@ function readManifest(cwd) {
1899
1912
  if (!existsSync10(manifestPath)) return null;
1900
1913
  return JSON.parse(readFileSync9(manifestPath, "utf8"));
1901
1914
  }
1915
+ function readGithubActionsMode(cwd) {
1916
+ const configPath = join11(cwd, ".agent-kit", "config.json");
1917
+ if (!existsSync10(configPath)) {
1918
+ const manifest = readManifest(cwd);
1919
+ return manifest?.assetHashes?.[".github/workflows/agent-kit-audit.yml"] ? "advisory" : "off";
1920
+ }
1921
+ try {
1922
+ const config = JSON.parse(readFileSync9(configPath, "utf8"));
1923
+ const mode = config.githubActions?.mode;
1924
+ if (mode === "off" || mode === "advisory") return mode;
1925
+ const manifest = readManifest(cwd);
1926
+ return manifest?.assetHashes?.[".github/workflows/agent-kit-audit.yml"] ? "advisory" : "off";
1927
+ } catch {
1928
+ const manifest = readManifest(cwd);
1929
+ return manifest?.assetHashes?.[".github/workflows/agent-kit-audit.yml"] ? "advisory" : "off";
1930
+ }
1931
+ }
1902
1932
 
1903
1933
  // src/install/audit-rules/project-reality.ts
1904
1934
  import { execFileSync } from "child_process";
@@ -4237,10 +4267,11 @@ function diffStatus(plan) {
4237
4267
  if (plan.action === "unchanged") return "unchanged";
4238
4268
  return "changed";
4239
4269
  }
4240
- function diffProject(cwd, stack = "next-supabase") {
4270
+ function diffProject(cwd, stack = "next-supabase", options = {}) {
4241
4271
  const packageRoot = findPackageRoot();
4242
4272
  const manifest = readManifest(cwd);
4243
- const assets = listManagedAssets(packageRoot, stack);
4273
+ const includeCi = options.githubActions ?? readGithubActionsMode(cwd) !== "off";
4274
+ const assets = listManagedAssets(packageRoot, stack, { includeCi });
4244
4275
  const plans = assets.map((asset) => ({
4245
4276
  asset,
4246
4277
  plan: planFileUpdate({
@@ -4325,7 +4356,7 @@ function updateProject(options) {
4325
4356
  const stack = manifest.stack ?? "next-supabase";
4326
4357
  const templateRoot = join17(packageRoot, "templates", stack);
4327
4358
  if (!existsSync17(templateRoot)) throw new Error(`Unsupported stack profile in manifest: ${stack}`);
4328
- const assets = listManagedAssets(packageRoot, stack);
4359
+ const assets = listManagedAssets(packageRoot, stack, { includeCi: readGithubActionsMode(cwd) !== "off" });
4329
4360
  const plans = assets.map(
4330
4361
  (asset) => planFileUpdate({
4331
4362
  target: asset.target,
@@ -7891,10 +7922,10 @@ async function runSetupServer(options) {
7891
7922
  process.once("SIGTERM", shutdown);
7892
7923
  });
7893
7924
  }
7894
- program.command("init").description("Install agent-kit docs and library files into a project.").option("--stack <stack>", "Stack profile to install.", "next-supabase").option("--force", "Overwrite existing docs instead of writing conflicts.").option("--activate <targets...>", "Promote IDE/runtime adapters: cursor, claude, codex, copilot, antigravity, or all.").option("--guided", "Also create local project context files (interactive on a terminal, scan-based otherwise).").option("--dry-run", "Preview what init would create or conflict on without writing files.").option("--json", "Print machine-readable JSON output.").option("--setup", "Start the setup wizard after install.").option("--no-setup", "Skip the post-install setup wizard prompt.").option("--open", "Open the setup wizard in your default browser.").action(async (options) => {
7925
+ program.command("init").description("Install agent-kit docs and library files into a project.").option("--stack <stack>", "Stack profile to install.", "next-supabase").option("--force", "Overwrite existing docs instead of writing conflicts.").option("--activate <targets...>", "Promote IDE/runtime adapters: cursor, claude, codex, copilot, antigravity, or all.").option("--github-actions", "Install the optional advisory GitHub Actions audit workflow (off by default).").option("--guided", "Also create local project context files (interactive on a terminal, scan-based otherwise).").option("--dry-run", "Preview what init would create or conflict on without writing files.").option("--json", "Print machine-readable JSON output.").option("--setup", "Start the setup wizard after install.").option("--no-setup", "Skip the post-install setup wizard prompt.").option("--open", "Open the setup wizard in your default browser.").action(async (options) => {
7895
7926
  const cwd = process.cwd();
7896
7927
  if (options.dryRun) {
7897
- const preview = diffProject(cwd, options.stack);
7928
+ const preview = diffProject(cwd, options.stack, options.githubActions ? { githubActions: true } : {});
7898
7929
  if (options.json) {
7899
7930
  printJson({ dryRun: true, preview: preview.preview, missing: preview.missing, changed: preview.changed, unchanged: preview.unchanged });
7900
7931
  return;
@@ -7911,6 +7942,7 @@ program.command("init").description("Install agent-kit docs and library files in
7911
7942
  cwd,
7912
7943
  stack: options.stack,
7913
7944
  force: Boolean(options.force),
7945
+ githubActions: Boolean(options.githubActions),
7914
7946
  ...options.activate ? { activate: options.activate } : {}
7915
7947
  });
7916
7948
  const context2 = options.guided ? initProjectContext(cwd) : null;