@donotdev/cli 0.2.3 → 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.
Files changed (30) hide show
  1. package/dependencies-matrix.json +27 -26
  2. package/dist/bin/commands/build.js +64 -2
  3. package/dist/bin/commands/bump.js +98 -13
  4. package/dist/bin/commands/db-check.js +192804 -0
  5. package/dist/bin/commands/db.js +16 -1
  6. package/dist/bin/commands/make-admin.js +22 -6
  7. package/dist/bin/commands/seed.js +313 -236
  8. package/dist/bin/commands/setup.js +549 -97
  9. package/dist/bin/dndev.js +23 -7
  10. package/dist/index.js +64 -2
  11. package/package.json +1 -1
  12. package/templates/app-demo/index.html.example +1 -1
  13. package/templates/app-dndev/index.html.example +1 -1
  14. package/templates/app-dndev/src/globals.css.example +1 -1
  15. package/templates/app-next/src/app/AppDocument.tsx.example +3 -2
  16. package/templates/app-next/src/globals.css.example +1 -1
  17. package/templates/app-vite/csp.example.json +1 -1
  18. package/templates/app-vite/index.html.example +1 -1
  19. package/templates/app-vite/src/globals.css.example +1 -1
  20. package/templates/deploy-config/vercel.json.example +2 -2
  21. package/templates/functions-supabase/supabase/migrations/20250101000006_crud_bulk_status_guard.sql +258 -0
  22. package/templates/functions-supabase/supabase/migrations/20250101000007_rate_limit_check.sql +76 -0
  23. package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +3 -3
  24. package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +2 -2
  25. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +2 -2
  26. package/templates/root-consumer/.claude/rules/framework.md.example +1 -1
  27. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +1 -1
  28. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +1 -1
  29. package/templates/root-consumer/AGENTS.md.example +25 -2
  30. package/templates/root-consumer/README.md.example +1 -1
@@ -191766,7 +191766,7 @@ async function createSupabaseContext(projectRoot, appDir, framework, entities) {
191766
191766
  const { extractProjectRef: extractProjectRef2 } = await Promise.resolve().then(() => (init_supabase_management(), supabase_management_exports));
191767
191767
  const supabaseUrl = config.url;
191768
191768
  const projectRef = extractProjectRef2(supabaseUrl);
191769
- async function executeSQL(sql) {
191769
+ async function postQuery(sql) {
191770
191770
  const mgmtUrl = `https://api.supabase.com/v1/projects/${projectRef}/database/query`;
191771
191771
  const response = await fetch(mgmtUrl, {
191772
191772
  method: "POST",
@@ -191781,6 +191781,17 @@ async function createSupabaseContext(projectRoot, appDir, framework, entities) {
191781
191781
  const safe = body.replace(/sbp_[^\s"']*/g, "***").replace(/sb_secret_[^\s"']*/g, "***");
191782
191782
  throw new Error(`Supabase API error (HTTP ${response.status}): ${safe}`);
191783
191783
  }
191784
+ return response;
191785
+ }
191786
+ async function executeSQL(sql) {
191787
+ await postQuery(sql);
191788
+ }
191789
+ async function querySQL(sql) {
191790
+ const rows = await (await postQuery(sql)).json();
191791
+ if (!Array.isArray(rows)) {
191792
+ throw new Error("Supabase API error: the query did not return rows");
191793
+ }
191794
+ return rows.filter(isObjectLike);
191784
191795
  }
191785
191796
  return {
191786
191797
  provider: "supabase",
@@ -191789,6 +191800,7 @@ async function createSupabaseContext(projectRoot, appDir, framework, entities) {
191789
191800
  framework,
191790
191801
  entities,
191791
191802
  executeSQL,
191803
+ querySQL,
191792
191804
  async insertRows(collection, rows) {
191793
191805
  if (rows.length === 0) return 0;
191794
191806
  const snakeRows = rows.map((row) => {
@@ -191850,6 +191862,9 @@ async function createFirebaseContext(projectRoot, appDir, framework, entities) {
191850
191862
  "executeSQL is not supported for Firebase. Use insertRows() or write custom scripts."
191851
191863
  );
191852
191864
  },
191865
+ async querySQL(_sql) {
191866
+ throw new Error("querySQL is not supported for Firebase (no SQL).");
191867
+ },
191853
191868
  async insertRows(collection, rows) {
191854
191869
  if (rows.length === 0) return 0;
191855
191870
  const BATCH_SIZE = 500;
@@ -69685,6 +69685,20 @@ var COMMAND_REGISTRY = [
69685
69685
  loader: "../cli/db/db.ts",
69686
69686
  exportName: "db"
69687
69687
  },
69688
+ {
69689
+ name: "db-check [app]",
69690
+ description: "List, per generated CHECK constraint (<table>_<column>_<rule>, added NOT VALID), the row ids that violate it (Supabase, read-only)",
69691
+ category: "deployment",
69692
+ public: true,
69693
+ options: [
69694
+ {
69695
+ flags: "-a, --app <app>",
69696
+ description: "App name (for multi-app monorepos)"
69697
+ }
69698
+ ],
69699
+ loader: "../cli/db/check.ts",
69700
+ exportName: "dbCheck"
69701
+ },
69688
69702
  // ---------------------------------------------------------------------------
69689
69703
  // Content
69690
69704
  // ---------------------------------------------------------------------------
@@ -69824,16 +69838,18 @@ var COMMAND_REGISTRY = [
69824
69838
  },
69825
69839
  {
69826
69840
  name: "test:uat [app]",
69827
- description: "Run Playwright UAT for an app (auto-detects Supabase/Firebase)",
69841
+ description: "Run an app's Playwright e2e suite on a throwaway Supabase stack (own project_id, ports and volumes; torn down afterwards). Works in consumer projects and the monorepo; reads e2e/uat.json",
69828
69842
  category: "other",
69829
69843
  appCommand: true,
69830
69844
  options: [
69831
- { flags: "--ui", description: "open Playwright UI mode" },
69832
- { flags: "--headed", description: "run tests in headed browser" },
69845
+ { flags: "-a, --app <app>", description: "app to test (same as the positional)" },
69833
69846
  {
69834
- flags: "--fresh",
69835
- description: "nuke Docker volumes and rebuild from scratch"
69836
- }
69847
+ flags: "--keep",
69848
+ description: "keep the throwaway stack and workdir after the run"
69849
+ },
69850
+ { flags: "--headed", description: "run tests in headed browser" },
69851
+ { flags: "--ui", description: "open Playwright UI mode" },
69852
+ { flags: "--grep <pattern>", description: "only run tests matching the pattern" }
69837
69853
  ],
69838
69854
  loader: "../quality/test-uat.ts"
69839
69855
  },