@beignet/cli 0.0.36 → 0.0.38
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/CHANGELOG.md +27 -0
- package/README.md +36 -5
- package/dist/config.d.ts +15 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +30 -1
- package/dist/config.js.map +1 -1
- package/dist/inspect.js +21 -17
- package/dist/inspect.js.map +1 -1
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +27 -6
- package/dist/lint.js.map +1 -1
- package/dist/make/inbox.js +7 -7
- package/dist/make/inbox.js.map +1 -1
- package/dist/make/payments.d.ts +2 -1
- package/dist/make/payments.d.ts.map +1 -1
- package/dist/make/payments.js +15 -11
- package/dist/make/payments.js.map +1 -1
- package/dist/make/shared.d.ts +1 -1
- package/dist/make/shared.d.ts.map +1 -1
- package/dist/make/shared.js +49 -37
- package/dist/make/shared.js.map +1 -1
- package/dist/make/tenancy.js +8 -8
- package/dist/make/tenancy.js.map +1 -1
- package/dist/make.d.ts.map +1 -1
- package/dist/make.js +27 -16
- package/dist/make.js.map +1 -1
- package/dist/operational-error-reporting.d.ts +15 -0
- package/dist/operational-error-reporting.d.ts.map +1 -0
- package/dist/operational-error-reporting.js +42 -0
- package/dist/operational-error-reporting.js.map +1 -0
- package/dist/outbox.d.ts.map +1 -1
- package/dist/outbox.js +73 -0
- package/dist/outbox.js.map +1 -1
- package/dist/provider-add.js +17 -17
- package/dist/provider-add.js.map +1 -1
- package/dist/provider-audit.d.ts.map +1 -1
- package/dist/provider-audit.js +11 -6
- package/dist/provider-audit.js.map +1 -1
- package/dist/schedule.d.ts.map +1 -1
- package/dist/schedule.js +28 -1
- package/dist/schedule.js.map +1 -1
- package/dist/task.d.ts.map +1 -1
- package/dist/task.js +37 -4
- package/dist/task.js.map +1 -1
- package/dist/templates/base.d.ts.map +1 -1
- package/dist/templates/base.js +6 -1
- package/dist/templates/base.js.map +1 -1
- package/dist/templates/db/index.d.ts +1 -0
- package/dist/templates/db/index.d.ts.map +1 -1
- package/dist/templates/db/index.js.map +1 -1
- package/dist/templates/db/mysql.d.ts.map +1 -1
- package/dist/templates/db/mysql.js +16 -0
- package/dist/templates/db/mysql.js.map +1 -1
- package/dist/templates/db/postgres.d.ts.map +1 -1
- package/dist/templates/db/postgres.js +16 -0
- package/dist/templates/db/postgres.js.map +1 -1
- package/dist/templates/db/sqlite.d.ts.map +1 -1
- package/dist/templates/db/sqlite.js +16 -0
- package/dist/templates/db/sqlite.js.map +1 -1
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +4 -3
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/server.d.ts +2 -2
- package/dist/templates/server.d.ts.map +1 -1
- package/dist/templates/server.js +56 -40
- package/dist/templates/server.js.map +1 -1
- package/dist/templates/shared.js +3 -3
- package/dist/templates/shared.js.map +1 -1
- package/dist/templates/testing.js +1 -1
- package/dist/templates/todos.js +6 -6
- package/package.json +4 -4
- package/src/config.ts +66 -2
- package/src/inspect.ts +31 -19
- package/src/lint.ts +35 -4
- package/src/make/inbox.ts +7 -7
- package/src/make/payments.ts +23 -15
- package/src/make/shared.ts +56 -40
- package/src/make/tenancy.ts +8 -8
- package/src/make.ts +30 -16
- package/src/operational-error-reporting.ts +60 -0
- package/src/outbox.ts +77 -0
- package/src/provider-add.ts +21 -17
- package/src/provider-audit.ts +28 -11
- package/src/schedule.ts +32 -1
- package/src/task.ts +41 -4
- package/src/templates/base.ts +6 -1
- package/src/templates/db/index.ts +1 -0
- package/src/templates/db/mysql.ts +16 -0
- package/src/templates/db/postgres.ts +16 -0
- package/src/templates/db/sqlite.ts +16 -0
- package/src/templates/index.ts +4 -3
- package/src/templates/server.ts +56 -42
- package/src/templates/shared.ts +3 -3
- package/src/templates/testing.ts +1 -1
- package/src/templates/todos.ts +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @beignet/cli
|
|
2
2
|
|
|
3
|
+
## 0.0.38
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1081ac6: Harden HTTP response handling, synchronous upload cleanup, CLI path and registry diagnostics, provider context preservation, Redis subscription observability, and provider documentation.
|
|
8
|
+
- d23b0b3: Continue versioned W3C trace context through outbox, event bus, BullMQ, and
|
|
9
|
+
Inngest boundaries without making telemetry metadata part of delivery success.
|
|
10
|
+
- 6bd52fc: Rename the canonical runtime port wiring file, value, and CLI config path to `infra/port-wiring.ts`, `initialPorts`, and `paths.portWiring`.
|
|
11
|
+
- 7b918c4: Standardize bounded terminal-only runtime error reporting, structured Sentry metadata redaction, and isolated reporting across HTTP, jobs, schedules, tasks, listeners, and outbox drains.
|
|
12
|
+
- Updated dependencies [443b9a1]
|
|
13
|
+
- Updated dependencies [1081ac6]
|
|
14
|
+
- Updated dependencies [d23b0b3]
|
|
15
|
+
- Updated dependencies [6bd52fc]
|
|
16
|
+
- Updated dependencies [7b918c4]
|
|
17
|
+
- Updated dependencies [7e1a68e]
|
|
18
|
+
- @beignet/core@0.0.38
|
|
19
|
+
|
|
20
|
+
## 0.0.37
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- c24eb29: Require patched Nodemailer releases in the SMTP provider and generated provider presets.
|
|
25
|
+
- fb0e2b4: Require patched Next.js and Inngest versions in generated apps and provider integrations.
|
|
26
|
+
- a3f4573: Allow Drizzle providers to use explicitly owned injected clients, and generate apps with one shared, cleanly stopped database client plus configurable Postgres and MySQL pool limits. Provider audit now supports explicit required-env exceptions for clients configured through platform bindings or other non-env mechanisms.
|
|
27
|
+
- Updated dependencies [7844a16]
|
|
28
|
+
- @beignet/core@0.0.37
|
|
29
|
+
|
|
3
30
|
## 0.0.36
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -351,7 +351,7 @@ The standard app layout includes the files feature generators expect:
|
|
|
351
351
|
|
|
352
352
|
```txt
|
|
353
353
|
app-context.ts
|
|
354
|
-
infra/
|
|
354
|
+
infra/port-wiring.ts
|
|
355
355
|
ports/index.ts
|
|
356
356
|
lib/routes.ts
|
|
357
357
|
lib/use-case.ts
|
|
@@ -380,6 +380,8 @@ export default defineConfig({
|
|
|
380
380
|
appContext: "src/app-context.ts",
|
|
381
381
|
contracts: "src/features",
|
|
382
382
|
features: "src/features",
|
|
383
|
+
ports: "src/ports/index.ts",
|
|
384
|
+
portWiring: "src/infra/port-wiring.ts",
|
|
383
385
|
routesBuilder: "src/lib/routes.ts",
|
|
384
386
|
routes: "src/app/api",
|
|
385
387
|
server: "src/core/server/index.ts",
|
|
@@ -431,6 +433,24 @@ specifier such as `@acme/db/schema`. `doctor` and `providers audit` also
|
|
|
431
433
|
follow schema-like imports from app database files, but explicit schema
|
|
432
434
|
sources make shared-package layouts predictable.
|
|
433
435
|
|
|
436
|
+
Provider metadata describes the standard environment requirements checked by
|
|
437
|
+
`doctor --strict` and `providers audit`. When an injected client gets its
|
|
438
|
+
configuration from a platform binding, IAM, or another non-env mechanism,
|
|
439
|
+
declare only the irrelevant static requirement as an explicit exception:
|
|
440
|
+
|
|
441
|
+
```ts
|
|
442
|
+
import { defineConfig } from "@beignet/cli/config";
|
|
443
|
+
|
|
444
|
+
export default defineConfig({
|
|
445
|
+
providerAudit: {
|
|
446
|
+
ignoreRequiredEnv: ["POSTGRES_DB_URL"],
|
|
447
|
+
},
|
|
448
|
+
});
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
This affects CLI provider auditing only. It does not skip `createEnv(...)` or
|
|
452
|
+
provider runtime configuration validation.
|
|
453
|
+
|
|
434
454
|
## Generate a contract
|
|
435
455
|
|
|
436
456
|
Use `make contract` when you want to start with the HTTP contract only:
|
|
@@ -639,7 +659,7 @@ Use `--events` to generate created, updated, and deleted domain events and
|
|
|
639
659
|
publish them through `ctx.ports.eventBus`. The
|
|
640
660
|
starter ships no event bus, so `--events` also wires one: it adds
|
|
641
661
|
`eventBus: EventBusPort` to `AppPorts`, defers the key in
|
|
642
|
-
`infra/
|
|
662
|
+
`infra/port-wiring.ts`, registers `createMemoryEventBusProvider()` in
|
|
643
663
|
`server/providers.ts`, and adds the `@beignet/provider-event-bus-memory`
|
|
644
664
|
dependency. The wiring is skipped when the ports file already mentions
|
|
645
665
|
`eventBus`, so apps that wired their own bus are left untouched. Use
|
|
@@ -701,7 +721,7 @@ event` (and `make resource --events`) wires `eventBus: EventBusPort` with
|
|
|
701
721
|
`createMemoryMailerProvider()` and `notifications: NotificationPort` with
|
|
702
722
|
`createInlineNotificationsProvider()`, both dev-default providers from
|
|
703
723
|
`@beignet/core`. Each port is wired independently — added to `AppPorts`,
|
|
704
|
-
deferred in `infra/
|
|
724
|
+
deferred in `infra/port-wiring.ts`, and registered in `server/providers.ts` —
|
|
705
725
|
and skipped when the ports file already has the key, so integrations such as
|
|
706
726
|
resend (which contributes `mailer`) and app-owned adapters are left
|
|
707
727
|
untouched. Swap the dev-default provider for a production adapter without
|
|
@@ -916,6 +936,12 @@ paths, and `--json` emits machine-readable output with `schemaVersion: 1`.
|
|
|
916
936
|
Run it in the deploy pipeline where production configuration is present; it
|
|
917
937
|
exits `1` on any error finding.
|
|
918
938
|
|
|
939
|
+
`beignet task run`, `beignet schedule run`, and `beignet outbox drain` use an
|
|
940
|
+
optional `ctx.ports.errorReporter` from their app-owned context. They report
|
|
941
|
+
terminal command failures, dead letters, and settlement failures, then perform
|
|
942
|
+
a bounded flush before stopping context. Retryable outbox deliveries remain
|
|
943
|
+
instrumentation/log events rather than incident reports.
|
|
944
|
+
|
|
919
945
|
## Lint app architecture
|
|
920
946
|
|
|
921
947
|
Run `lint` when you want the CLI to enforce Beignet dependency direction:
|
|
@@ -933,6 +959,11 @@ feature-specific domain files importing another feature's domain unless the
|
|
|
933
959
|
target is `features/shared/domain`. Workflow folders include feature-owned
|
|
934
960
|
jobs, listeners, notifications, schedules, and uploads.
|
|
935
961
|
|
|
962
|
+
Local `@/` imports are resolved through the app's `tsconfig.json` path mapping,
|
|
963
|
+
including `@/* -> ./src/*` layouts, before dependency direction is classified.
|
|
964
|
+
The CLI uses TypeScript's config parser, so JSON comments and extended
|
|
965
|
+
tsconfigs follow the same rules as the compiler.
|
|
966
|
+
|
|
936
967
|
Import diagnostics include 1-based `line` and `column` positions. Human
|
|
937
968
|
output prints clickable `file.ts:12:3` locations; runtime-boundary
|
|
938
969
|
diagnostics report the chain root file and the full import chain in the
|
|
@@ -1095,8 +1126,8 @@ The server exposes six tools:
|
|
|
1095
1126
|
- `doctor` - drift diagnostics as JSON, `{ strict?: boolean }` defaults to
|
|
1096
1127
|
`true` (read-only)
|
|
1097
1128
|
- `doctor_fix` - apply doctor's low-risk fixes; repairs route-group,
|
|
1098
|
-
schedule, task,
|
|
1099
|
-
|
|
1129
|
+
schedule, task, outbox, and fully unregistered listener registry drift when
|
|
1130
|
+
the central registry/provider anchors are recognizable
|
|
1100
1131
|
- `lint` - architecture dependency-direction diagnostics (read-only)
|
|
1101
1132
|
- `make` - run a generator with `{ artifact, name, ...options }`, the same
|
|
1102
1133
|
artifact kinds as `beignet make`
|
package/dist/config.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type BeignetPaths = {
|
|
|
17
17
|
schedules: string;
|
|
18
18
|
appContext: string;
|
|
19
19
|
ports: string;
|
|
20
|
-
|
|
20
|
+
portWiring: string;
|
|
21
21
|
features: string;
|
|
22
22
|
policies: string;
|
|
23
23
|
useCases: string;
|
|
@@ -47,6 +47,16 @@ export type BeignetDatabaseConfig = {
|
|
|
47
47
|
tables?: Partial<BeignetDatabaseTables>;
|
|
48
48
|
schemaSources?: string[];
|
|
49
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Explicit exceptions for static provider package requirements.
|
|
52
|
+
*/
|
|
53
|
+
export type BeignetProviderAuditConfig = {
|
|
54
|
+
/**
|
|
55
|
+
* Environment variables supplied through another mechanism, such as an
|
|
56
|
+
* injected platform client, and therefore not required in app env files.
|
|
57
|
+
*/
|
|
58
|
+
ignoreRequiredEnv?: string[];
|
|
59
|
+
};
|
|
50
60
|
/**
|
|
51
61
|
* User-authored Beignet CLI config.
|
|
52
62
|
*/
|
|
@@ -54,6 +64,7 @@ export type BeignetConfig = {
|
|
|
54
64
|
framework?: BeignetFramework;
|
|
55
65
|
paths?: Partial<BeignetPaths>;
|
|
56
66
|
database?: BeignetDatabaseConfig;
|
|
67
|
+
providerAudit?: BeignetProviderAuditConfig;
|
|
57
68
|
};
|
|
58
69
|
/**
|
|
59
70
|
* Beignet config after defaults and path normalization have been applied.
|
|
@@ -65,6 +76,9 @@ export type ResolvedBeignetConfig = {
|
|
|
65
76
|
tables: BeignetDatabaseTables;
|
|
66
77
|
schemaSources: string[];
|
|
67
78
|
};
|
|
79
|
+
providerAudit: {
|
|
80
|
+
ignoreRequiredEnv: string[];
|
|
81
|
+
};
|
|
68
82
|
configFile?: string;
|
|
69
83
|
};
|
|
70
84
|
/**
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CA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AErE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAErE"}
|
package/dist/config.js
CHANGED
|
@@ -18,7 +18,7 @@ export const defaultBeignetConfig = {
|
|
|
18
18
|
schedules: "server/schedules.ts",
|
|
19
19
|
appContext: "app-context.ts",
|
|
20
20
|
ports: "ports/index.ts",
|
|
21
|
-
|
|
21
|
+
portWiring: "infra/port-wiring.ts",
|
|
22
22
|
features: "features",
|
|
23
23
|
policies: "features",
|
|
24
24
|
useCases: "features",
|
|
@@ -40,6 +40,9 @@ export const defaultBeignetConfig = {
|
|
|
40
40
|
},
|
|
41
41
|
schemaSources: [],
|
|
42
42
|
},
|
|
43
|
+
providerAudit: {
|
|
44
|
+
ignoreRequiredEnv: [],
|
|
45
|
+
},
|
|
43
46
|
};
|
|
44
47
|
/**
|
|
45
48
|
* Preserve a Beignet config object with type inference.
|
|
@@ -63,10 +66,15 @@ export function resolveConfig(config = {}, configFile) {
|
|
|
63
66
|
schemaSources: config.database?.schemaSources ??
|
|
64
67
|
defaultBeignetConfig.database.schemaSources,
|
|
65
68
|
};
|
|
69
|
+
const providerAudit = {
|
|
70
|
+
ignoreRequiredEnv: config.providerAudit?.ignoreRequiredEnv ??
|
|
71
|
+
defaultBeignetConfig.providerAudit.ignoreRequiredEnv,
|
|
72
|
+
};
|
|
66
73
|
return {
|
|
67
74
|
framework: config.framework ?? defaultBeignetConfig.framework,
|
|
68
75
|
paths: normalizeConfigPaths(paths),
|
|
69
76
|
database: normalizeDatabaseConfig(database),
|
|
77
|
+
providerAudit: normalizeProviderAuditConfig(providerAudit),
|
|
70
78
|
configFile,
|
|
71
79
|
};
|
|
72
80
|
}
|
|
@@ -173,6 +181,14 @@ function assertConfigObject(config, configFile) {
|
|
|
173
181
|
if (config.database !== undefined && !isRecord(config.database)) {
|
|
174
182
|
throw new Error(`${configFile} database must be an object.`);
|
|
175
183
|
}
|
|
184
|
+
if (config.providerAudit !== undefined && !isRecord(config.providerAudit)) {
|
|
185
|
+
throw new Error(`${configFile} providerAudit must be an object.`);
|
|
186
|
+
}
|
|
187
|
+
if (config.providerAudit !== undefined &&
|
|
188
|
+
config.providerAudit.ignoreRequiredEnv !== undefined &&
|
|
189
|
+
!Array.isArray(config.providerAudit.ignoreRequiredEnv)) {
|
|
190
|
+
throw new Error(`${configFile} providerAudit.ignoreRequiredEnv must be an array.`);
|
|
191
|
+
}
|
|
176
192
|
if (config.database !== undefined &&
|
|
177
193
|
config.database.tables !== undefined &&
|
|
178
194
|
!isRecord(config.database.tables)) {
|
|
@@ -225,6 +241,19 @@ function normalizeDatabaseSchemaSource(index, value) {
|
|
|
225
241
|
}
|
|
226
242
|
return value.trim();
|
|
227
243
|
}
|
|
244
|
+
function normalizeProviderAuditConfig(config) {
|
|
245
|
+
return {
|
|
246
|
+
ignoreRequiredEnv: [
|
|
247
|
+
...new Set(config.ignoreRequiredEnv.map((value, index) => normalizeIgnoredRequiredEnv(index, value))),
|
|
248
|
+
],
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function normalizeIgnoredRequiredEnv(index, value) {
|
|
252
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
253
|
+
throw new Error(`Beignet config providerAudit.ignoreRequiredEnv[${index}] must be a string.`);
|
|
254
|
+
}
|
|
255
|
+
return value.trim();
|
|
256
|
+
}
|
|
228
257
|
function isRecord(value) {
|
|
229
258
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
230
259
|
}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
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,EAAE,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,qBAAqB,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,SAAS,6BAA6B,CAAC,KAAa,EAAE,KAAa;IACjE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACb,yCAAyC,KAAK,qBAAqB,CACpE,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,SAAS,4BAA4B,CAAC,MAErC;IAGC,OAAO;QACL,iBAAiB,EAAE;YACjB,GAAG,IAAI,GAAG,CACR,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAC5C,2BAA2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAC1C,CACF;SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAa,EAAE,KAAa;IAC/D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACb,kDAAkD,KAAK,qBAAqB,CAC7E,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/inspect.js
CHANGED
|
@@ -267,7 +267,7 @@ function inspectConvention(files, config) {
|
|
|
267
267
|
]);
|
|
268
268
|
const missingResourceGenerator = missingRequirements(files, [
|
|
269
269
|
config.paths.appContext,
|
|
270
|
-
config.paths.
|
|
270
|
+
config.paths.portWiring,
|
|
271
271
|
config.paths.ports,
|
|
272
272
|
config.paths.server,
|
|
273
273
|
config.paths.useCaseBuilder,
|
|
@@ -892,8 +892,8 @@ async function inspectCanonicalConformance(targetDir, files, config, convention,
|
|
|
892
892
|
reason: "server/providers.ts should own provider registration, even when the provider list is small.",
|
|
893
893
|
},
|
|
894
894
|
{
|
|
895
|
-
file: config.paths.
|
|
896
|
-
reason: "infra/
|
|
895
|
+
file: config.paths.portWiring,
|
|
896
|
+
reason: "infra/port-wiring.ts should wire concrete app ports for the selected runtime.",
|
|
897
897
|
},
|
|
898
898
|
{
|
|
899
899
|
file: config.paths.routesBuilder,
|
|
@@ -1275,7 +1275,7 @@ async function inspectProductionReadiness(targetDir, files, config, convention)
|
|
|
1275
1275
|
const installedPackages = installedPackageNames(packageJson);
|
|
1276
1276
|
const providerDoctorRules = await providerDoctorRulesForInstalledPackages(targetDir, packageJson);
|
|
1277
1277
|
const configFiles = operationalConfigFiles(files, config);
|
|
1278
|
-
const infrastructurePath = directoryPath(path.dirname(config.paths.
|
|
1278
|
+
const infrastructurePath = directoryPath(path.dirname(config.paths.portWiring));
|
|
1279
1279
|
const schemaDir = `${infrastructurePath}/db/schema`;
|
|
1280
1280
|
let hasSecurityHeadersHook = false;
|
|
1281
1281
|
for (const file of files) {
|
|
@@ -1378,7 +1378,7 @@ async function inspectProductionReadiness(targetDir, files, config, convention)
|
|
|
1378
1378
|
// Multi-variant packages only require the env vars of the variants the
|
|
1379
1379
|
// app actually registers; an unused variant must not warn.
|
|
1380
1380
|
for (const variant of detectedProviderVariants(provider.variants, providerEntries)) {
|
|
1381
|
-
for (const envVar of variant.requiredEnv) {
|
|
1381
|
+
for (const envVar of configuredProviderRequiredEnv(variant.requiredEnv, config)) {
|
|
1382
1382
|
if (await providerRequiredEnvExists(targetDir, configFiles, envVar, sourceCache)) {
|
|
1383
1383
|
continue;
|
|
1384
1384
|
}
|
|
@@ -1403,7 +1403,7 @@ async function inspectProductionReadiness(targetDir, files, config, convention)
|
|
|
1403
1403
|
}
|
|
1404
1404
|
continue;
|
|
1405
1405
|
}
|
|
1406
|
-
for (const envVar of provider.requiredEnv ?? []) {
|
|
1406
|
+
for (const envVar of configuredProviderRequiredEnv(provider.requiredEnv ?? [], config)) {
|
|
1407
1407
|
if (await providerRequiredEnvExists(targetDir, configFiles, envVar, sourceCache)) {
|
|
1408
1408
|
continue;
|
|
1409
1409
|
}
|
|
@@ -1563,7 +1563,7 @@ async function inspectPaymentsProductionReadiness(targetDir, files, config, sour
|
|
|
1563
1563
|
diagnostics.push({
|
|
1564
1564
|
severity: "warning",
|
|
1565
1565
|
code: "BEIGNET_BILLING_ENTITLEMENTS_PROVIDER_MISSING",
|
|
1566
|
-
file: path.dirname(config.paths.
|
|
1566
|
+
file: path.dirname(config.paths.portWiring),
|
|
1567
1567
|
message: "features/billing/entitlements.ts exists, but no infra or server provider appears to call createBillingEntitlements(...). Wire the billing-backed entitlements port into AppPorts so paid feature gates use app billing state.",
|
|
1568
1568
|
});
|
|
1569
1569
|
}
|
|
@@ -1853,7 +1853,7 @@ async function usesEntitlementChecks(targetDir, files, sourceCache) {
|
|
|
1853
1853
|
return false;
|
|
1854
1854
|
}
|
|
1855
1855
|
async function hasBillingEntitlementsProviderWiring(targetDir, files, config, sourceCache) {
|
|
1856
|
-
const infraPath = path.dirname(config.paths.
|
|
1856
|
+
const infraPath = path.dirname(config.paths.portWiring);
|
|
1857
1857
|
const serverPath = path.dirname(config.paths.server);
|
|
1858
1858
|
const candidateFiles = files.filter((file) => /\.(?:ts|tsx|mts|cts)$/.test(file) &&
|
|
1859
1859
|
!isTestSourceFile(file) &&
|
|
@@ -2085,10 +2085,10 @@ function isRouteServerOrInfraFile(file, config) {
|
|
|
2085
2085
|
}
|
|
2086
2086
|
function isInfraOrServerFile(file, config) {
|
|
2087
2087
|
const serverDir = directoryPath(path.dirname(config.paths.server));
|
|
2088
|
-
const infrastructureDir = directoryPath(path.dirname(config.paths.
|
|
2088
|
+
const infrastructureDir = directoryPath(path.dirname(config.paths.portWiring));
|
|
2089
2089
|
return (file === config.paths.server ||
|
|
2090
2090
|
file.startsWith(`${serverDir}/`) ||
|
|
2091
|
-
file === config.paths.
|
|
2091
|
+
file === config.paths.portWiring ||
|
|
2092
2092
|
file.startsWith(`${infrastructureDir}/`));
|
|
2093
2093
|
}
|
|
2094
2094
|
function containsCallExpression(source, name) {
|
|
@@ -2150,7 +2150,7 @@ async function inspectWorkflowRegistrationDrift(targetDir, files, config, conven
|
|
|
2150
2150
|
}
|
|
2151
2151
|
}
|
|
2152
2152
|
}
|
|
2153
|
-
const infraDir = directoryPath(path.dirname(config.paths.
|
|
2153
|
+
const infraDir = directoryPath(path.dirname(config.paths.portWiring));
|
|
2154
2154
|
const listenerTarget = drift.listeners.wiringFile
|
|
2155
2155
|
? `${drift.listeners.wiringFile}, which already calls registerListeners(...)`
|
|
2156
2156
|
: drift.listeners.eventBusFile
|
|
@@ -2722,7 +2722,7 @@ async function inspectDatabaseLifecycleDrift(targetDir, files, config, conventio
|
|
|
2722
2722
|
const diagnostics = [];
|
|
2723
2723
|
const sourceCache = new Map();
|
|
2724
2724
|
const resources = await collectResourceNames(targetDir, files, config);
|
|
2725
|
-
const infrastructurePath = directoryPath(path.dirname(config.paths.
|
|
2725
|
+
const infrastructurePath = directoryPath(path.dirname(config.paths.portWiring));
|
|
2726
2726
|
const featuresPath = directoryPath(config.paths.features);
|
|
2727
2727
|
const repositoriesPath = path.join(infrastructurePath, "db", "repositories.ts");
|
|
2728
2728
|
const repositoriesSource = files.includes(repositoriesPath)
|
|
@@ -3459,6 +3459,10 @@ function tableNameFromArgs(argsSource, configuredTableName) {
|
|
|
3459
3459
|
function configuredProviderRequiredTables(tableNames, config) {
|
|
3460
3460
|
return tableNames.map((tableName) => configuredProviderRequiredTable(tableName, config));
|
|
3461
3461
|
}
|
|
3462
|
+
function configuredProviderRequiredEnv(envVars, config) {
|
|
3463
|
+
const ignored = new Set(config.providerAudit.ignoreRequiredEnv);
|
|
3464
|
+
return envVars.filter((envVar) => !ignored.has(envVar));
|
|
3465
|
+
}
|
|
3462
3466
|
function configuredProviderRequiredTable(tableName, config) {
|
|
3463
3467
|
for (const [key, defaultTableName] of Object.entries(defaultBeignetConfig.database.tables)) {
|
|
3464
3468
|
if (tableName === defaultTableName)
|
|
@@ -4585,10 +4589,10 @@ async function inspectResourceSlices(targetDir, files, config, convention, stric
|
|
|
4585
4589
|
const portFile = resourcePortFile(resource, singular, config);
|
|
4586
4590
|
const featureRouteFile = path.join(config.paths.features, resource, "routes.ts");
|
|
4587
4591
|
const sharedErrorsFile = path.join(config.paths.features, "shared", "errors.ts");
|
|
4588
|
-
const infrastructureDir = `${directoryPath(path.dirname(config.paths.
|
|
4589
|
-
const drizzleSchemaFile = path.join(path.dirname(config.paths.
|
|
4590
|
-
const drizzleRepositoryFile = path.join(path.dirname(config.paths.
|
|
4591
|
-
const memoryRepositoryFile = path.join(path.dirname(config.paths.
|
|
4592
|
+
const infrastructureDir = `${directoryPath(path.dirname(config.paths.portWiring))}/${resource}/`;
|
|
4593
|
+
const drizzleSchemaFile = path.join(path.dirname(config.paths.portWiring), "db", "schema", `${resource}.ts`);
|
|
4594
|
+
const drizzleRepositoryFile = path.join(path.dirname(config.paths.portWiring), resource, `drizzle-${singular}-repository.ts`);
|
|
4595
|
+
const memoryRepositoryFile = path.join(path.dirname(config.paths.portWiring), resource, `in-memory-${singular}-repository.ts`);
|
|
4592
4596
|
const routeFile = path.join(config.paths.routes, resource, "route.ts");
|
|
4593
4597
|
const catchAllRouteFile = path.join(config.paths.routes, "[[...path]]", "route.ts");
|
|
4594
4598
|
const testFile = resourceTestFile(resource, config);
|
|
@@ -4819,7 +4823,7 @@ async function collectResourceNames(targetDir, files, config) {
|
|
|
4819
4823
|
const resources = new Set();
|
|
4820
4824
|
const portsPath = directoryPath(path.dirname(config.paths.ports));
|
|
4821
4825
|
const featuresPath = directoryPath(config.paths.features);
|
|
4822
|
-
const infrastructurePath = directoryPath(path.dirname(config.paths.
|
|
4826
|
+
const infrastructurePath = directoryPath(path.dirname(config.paths.portWiring));
|
|
4823
4827
|
for (const file of files) {
|
|
4824
4828
|
const portMatch = new RegExp(`^${escapeRegExp(portsPath)}/([^/]+)-repository\\.ts$`).exec(file);
|
|
4825
4829
|
if (portMatch) {
|