@supacloud/compiler 0.45.1 → 0.46.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/DELIVERY.md CHANGED
@@ -62,6 +62,26 @@ their kind. HTTP and Job ownership are independent, so one module can contribute
62
62
  HTTP to `api` and Jobs to `jobs`. Two HTTP targets cannot both own the same module.
63
63
  `api` and `jobs` are reserved for their matching workload kinds.
64
64
 
65
+ `kind: "function"` declares an Edge Function target instead of an app-module
66
+ target. It carries a `function` descriptor (`slug`, `entrypoint`, `verifyJwt`)
67
+ and must not declare `modules`. Function targets own no HTTP routes or Jobs, so
68
+ the plan surfaces them alongside the module-owned targets:
69
+
70
+ ```ts
71
+ {
72
+ version: 1,
73
+ targets: [
74
+ { name: "intake-hooks", kind: "function",
75
+ function: { slug: "fa-intake-hooks", entrypoint: "functions/intake/index.ts", verifyJwt: false } },
76
+ ],
77
+ }
78
+ ```
79
+
80
+ This version only **plans** function targets. The local delivery build still
81
+ rejects them with `delivery-function-build-unsupported`; rendering, upload and
82
+ activation belong to a later delivery phase (see the project deployment
83
+ Function/schedule work). Existing HTTP/Worker configuration is unaffected.
84
+
65
85
  No unused explicit target is accepted. Unknown modules, duplicate ownership,
66
86
  unresolved imports, cyclic dependencies, duplicate job names, and conflicting
67
87
  method/path patterns reject the plan. Parameter-name aliases such as `/:id` and
package/README.md CHANGED
@@ -2,16 +2,18 @@
2
2
 
3
3
  ## Enforced Database Governance
4
4
 
5
- Existing compiler callers retain `off`. Newly generated `command` starters set
6
- `databaseGovernance: { mode: "check" }`: compile/check/dev run the existing
7
- `@supacloud/db` source-boundary and contract-freshness gate offline, including
8
- incremental cache hits. Missing adoption files or stale contracts block generation
9
- even with `writeOnError`; checks never generate contracts. This mode does not
10
- import database modules, lint their SQL or connect to a database.
5
+ Existing compiler callers retain `off` as a compatibility migration exception.
6
+ Newly generated `command` starters set
7
+ `databaseGovernance: { mode: "enforce", moduleFile: "db/modules.ts" }`:
8
+ compile/check/build run the existing `@supacloud/db` source-boundary and
9
+ contract-freshness gate, SQL lint and live Catalog reconciliation, including
10
+ incremental cache hits. Missing adoption files, stale contracts, SQL findings or
11
+ Catalog drift block generation even with `writeOnError`; checks never generate
12
+ contracts or migrations.
11
13
  The minimal/http/edge starters remain database-free.
12
14
 
13
- For SQL lint and live Catalog reconciliation, declare the real database modules
14
- and explicitly set the following in `supacloud.config.ts`:
15
+ For an existing database project, adopt the governed path by declaring the real
16
+ database modules and explicitly setting the following in `supacloud.config.ts`:
15
17
 
16
18
  ```ts
17
19
  export default {
@@ -26,10 +28,12 @@ export default {
26
28
  ```
27
29
 
28
30
  `projectRoot` is relative to the configuration directory (or `rootDir` when
29
- calling `compileProject` / `checkProject` directly). The default mode is `off`.
30
- Use a read-only PostgreSQL credential in the named environment variable, targeting
31
- an explicitly selected local or test database. The compiler does not load `.env`
32
- files for this worker, generate migrations, repair contracts, or apply SQL.
31
+ calling `compileProject` / `checkProject` directly). Use a read-only PostgreSQL
32
+ credential in the named environment variable, targeting an explicitly selected
33
+ local or test database. The compiler does not load `.env` files for this worker,
34
+ generate migrations, repair contracts, or apply SQL. Setting `mode: "off"` is
35
+ reserved for an explicit migration exception and should not be used in a new
36
+ database starter.
33
37
 
34
38
  In `enforce` mode, compile/check/dev must pass the existing
35
39
  `@supacloud/db` source-boundary and contract-freshness check, SQL lint and live