@supacloud/compiler 0.44.1 → 0.45.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.
package/dist/types.d.ts CHANGED
@@ -401,6 +401,8 @@ export interface ApplicationGraph {
401
401
  };
402
402
  }
403
403
  export interface CompileOptions {
404
+ /** Optional fail-closed database source and Catalog governance. */
405
+ databaseGovernance?: DatabaseGovernanceOptions;
404
406
  /** Opt-in, offline GraphQL query contracts backed by a role-scoped schema snapshot. */
405
407
  graphql?: GraphqlOptions;
406
408
  /** Require schemas for bound route inputs and responses. Does not prove runtime validation. */
@@ -535,6 +537,20 @@ export interface TypeSafetyOptions {
535
537
  /** Additional relative glob patterns excluded from the production-source scan. */
536
538
  exclude?: string[];
537
539
  }
540
+ export interface DatabaseGovernanceOptions {
541
+ /** Off for existing callers; check validates sources offline, enforce also checks SQL and Catalog. */
542
+ mode: "off" | "check" | "enforce";
543
+ /** Relative to the configuration directory, or rootDir for programmatic callers. */
544
+ projectRoot?: string;
545
+ /** Project-relative module file exporting defineDatabaseModule(...) results. */
546
+ moduleFile?: string;
547
+ /** Explicit URL for programmatic callers; configuration files should use databaseUrlEnv. */
548
+ databaseUrl?: string;
549
+ /** Environment variable containing a read-only PostgreSQL connection URL. */
550
+ databaseUrlEnv?: string;
551
+ /** Schemas included in the live Catalog query. */
552
+ schemas?: string[];
553
+ }
538
554
  export interface ModuleBoundaryRule {
539
555
  /** Source module tag pattern or tag (for example, 'type:ui', 'scope:case', or '*'). */
540
556
  sourceTag: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/compiler",
3
- "version": "0.44.1",
3
+ "version": "0.45.1",
4
4
  "description": "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,7 +30,10 @@
30
30
  ],
31
31
  "scripts": {
32
32
  "build": "bun run clean && bun run build:js && bun run build:types",
33
- "build:js": "bun build src/index.ts src/diagnostics.ts src/cli.ts src/delivery-bundle-worker.ts --outdir dist --target node --conditions=supacloud-source --external @typescript/typescript6 --external graphql --external '@graphql-codegen/*'",
33
+ "prepare:db": "bun install --cwd ../contracts --frozen-lockfile && bun run --cwd ../contracts build && bun install --cwd ../db --force --frozen-lockfile && bun run --cwd ../db build && bun install --force --frozen-lockfile",
34
+ "prebuild": "bun run prepare:db",
35
+ "pretypecheck": "bun run prepare:db",
36
+ "build:js": "bun build src/index.ts src/diagnostics.ts src/cli.ts src/delivery-bundle-worker.ts src/database-governance-worker.ts --outdir dist --target node --conditions=supacloud-source --external @typescript/typescript6 --external @supacloud/db --external @supacloud/db/source-contracts --external graphql --external '@graphql-codegen/*'",
34
37
  "build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
35
38
  "clean": "rm -rf dist",
36
39
  "prepublishOnly": "bun run build && bun run test:package",
@@ -54,7 +57,8 @@
54
57
  "directory": "packages/compiler"
55
58
  },
56
59
  "dependencies": {
57
- "@supacloud/delivery": "0.14.1",
60
+ "@supacloud/db": "0.16.2",
61
+ "@supacloud/delivery": "0.16.0",
58
62
  "typebox": "1.3.36",
59
63
  "@graphql-codegen/core": "^6.2.2",
60
64
  "@graphql-codegen/typed-document-node": "^7.1.1",
@@ -64,13 +68,14 @@
64
68
  "graphql": "^16"
65
69
  },
66
70
  "overrides": {
71
+ "@supacloud/contracts": "0.8.1",
67
72
  "@graphql-tools/utils": "^12.0.3",
68
73
  "@whatwg-node/promise-helpers": "1.3.2"
69
74
  },
70
75
  "devDependencies": {
71
76
  "@supabase/supabase-js": "2.117.3",
72
77
  "drizzle-orm": "1.0.0-rc.5-169397b",
73
- "@types/bun": "^1.4.2",
78
+ "@types/bun": "^1.4.3",
74
79
  "typescript": "^7.0.2"
75
80
  }
76
81
  }