@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 +20 -0
- package/README.md +16 -12
- package/dist/cli.js +352 -52
- package/dist/config.d.ts +3 -3
- package/dist/delivery-bundle-protocol.d.ts +7 -2
- package/dist/delivery-bundle-worker.js +16 -4
- package/dist/effect-governance.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +353 -52
- package/dist/inspect.d.ts +5 -0
- package/dist/migration-app-version.d.ts +1 -1
- package/dist/migration-elysia-version.d.ts +1 -1
- package/dist/source-semantics.d.ts +7 -1
- package/dist/type-safety.d.ts +4 -0
- package/dist/types.d.ts +3 -0
- package/package.json +4 -4
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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
14
|
-
and explicitly
|
|
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).
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|