@beignet/core 0.0.24 → 0.0.26
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 +13 -0
- package/README.md +6 -2
- package/dist/client-only.d.ts +2 -0
- package/dist/client-only.d.ts.map +1 -1
- package/dist/client-only.js +2 -0
- package/dist/client-only.js.map +1 -1
- package/dist/providers/metadata.d.ts +2 -0
- package/dist/providers/metadata.d.ts.map +1 -1
- package/dist/providers/metadata.js +12 -0
- package/dist/providers/metadata.js.map +1 -1
- package/dist/server-only.d.ts +2 -0
- package/dist/server-only.d.ts.map +1 -1
- package/dist/server-only.js +2 -0
- package/dist/server-only.js.map +1 -1
- package/package.json +1 -1
- package/skills/app-architecture/SKILL.md +40 -3
- package/src/providers/metadata.ts +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @beignet/core
|
|
2
2
|
|
|
3
|
+
## 0.0.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 104302c: Refresh package-shipped TanStack Intent skills and add package skills for Drizzle database providers, Better Auth, React Hook Form, and React uploads.
|
|
8
|
+
|
|
9
|
+
## 0.0.25
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 1f84b39: Add provider table metadata diagnostics, Drizzle operational schema exports, and `beignet db schema generate` for app-owned migration flows.
|
|
14
|
+
- 7c83da7: Refresh package-shipped TanStack Intent skills to match current Beignet app structure, generators, route helpers, and React Query cache helpers.
|
|
15
|
+
|
|
3
16
|
## 0.0.24
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -35,7 +35,8 @@ This package requires TypeScript 5.0 or higher for proper type inference.
|
|
|
35
35
|
This package ships a TanStack Intent skill for coding agents:
|
|
36
36
|
`@beignet/core#app-architecture`. Load it when adding or fixing Beignet
|
|
37
37
|
schemas, contracts, use cases, app errors, ports, policies, app context,
|
|
38
|
-
providers, workflow primitives, or core subpath
|
|
38
|
+
providers, domain events, workflow primitives, seeds, tests, or core subpath
|
|
39
|
+
imports.
|
|
39
40
|
|
|
40
41
|
## Subpaths
|
|
41
42
|
|
|
@@ -404,6 +405,7 @@ without importing provider implementation code.
|
|
|
404
405
|
"appPorts": [{ "name": "cache", "type": "CachePort" }],
|
|
405
406
|
"env": ["CACHE_URL", "CACHE_REGION"],
|
|
406
407
|
"requiredEnv": ["CACHE_URL"],
|
|
408
|
+
"requiredTables": ["cache_entries"],
|
|
407
409
|
"registration": {
|
|
408
410
|
"required": true,
|
|
409
411
|
"tokens": ["cacheProvider", "createCacheProvider"]
|
|
@@ -415,7 +417,9 @@ without importing provider implementation code.
|
|
|
415
417
|
```
|
|
416
418
|
|
|
417
419
|
`env` lists all variables the provider may read. `requiredEnv` is the subset
|
|
418
|
-
that `beignet doctor --strict` should require in app config.
|
|
420
|
+
that `beignet doctor --strict` should require in app config. `requiredTables`
|
|
421
|
+
lists database tables the provider always needs when it is installed and used;
|
|
422
|
+
doctor checks app schema, migrations, and database setup files for those names.
|
|
419
423
|
|
|
420
424
|
`registration.required: true` marks providers that apps must register in
|
|
421
425
|
`server/providers.ts`; doctor reports a missing registration as a warning,
|
package/dist/client-only.d.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Host frameworks may provide their own runtime-only enforcement. This marker
|
|
5
5
|
* is intentionally a no-op so Beignet can enforce intent through `beignet lint`.
|
|
6
|
+
* Import it for side effects at the top of client-only modules:
|
|
7
|
+
* `import "@beignet/core/client-only";`.
|
|
6
8
|
*/
|
|
7
9
|
export declare const beignetClientOnly = true;
|
|
8
10
|
//# sourceMappingURL=client-only.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-only.d.ts","sourceRoot":"","sources":["../src/client-only.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client-only.d.ts","sourceRoot":"","sources":["../src/client-only.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC"}
|
package/dist/client-only.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Host frameworks may provide their own runtime-only enforcement. This marker
|
|
5
5
|
* is intentionally a no-op so Beignet can enforce intent through `beignet lint`.
|
|
6
|
+
* Import it for side effects at the top of client-only modules:
|
|
7
|
+
* `import "@beignet/core/client-only";`.
|
|
6
8
|
*/
|
|
7
9
|
export const beignetClientOnly = true;
|
|
8
10
|
//# sourceMappingURL=client-only.js.map
|
package/dist/client-only.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-only.js","sourceRoot":"","sources":["../src/client-only.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client-only.js","sourceRoot":"","sources":["../src/client-only.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC"}
|
|
@@ -20,6 +20,7 @@ export type ProviderPackageVariantMetadata = {
|
|
|
20
20
|
displayName?: string;
|
|
21
21
|
env?: readonly string[];
|
|
22
22
|
requiredEnv?: readonly string[];
|
|
23
|
+
requiredTables?: readonly string[];
|
|
23
24
|
registration?: ProviderPackageRegistrationMetadata;
|
|
24
25
|
};
|
|
25
26
|
export type ProviderPackageMetadata = {
|
|
@@ -28,6 +29,7 @@ export type ProviderPackageMetadata = {
|
|
|
28
29
|
appPorts?: readonly ProviderPackagePortMetadata[];
|
|
29
30
|
env?: readonly string[];
|
|
30
31
|
requiredEnv?: readonly string[];
|
|
32
|
+
requiredTables?: readonly string[];
|
|
31
33
|
registration?: ProviderPackageRegistrationMetadata;
|
|
32
34
|
variants?: readonly ProviderPackageVariantMetadata[];
|
|
33
35
|
watchers?: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"met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CAAC;IACnC,YAAY,CAAC,EAAE,mCAAmC,CAAC;IACnD,QAAQ,CAAC,EAAE,SAAS,8BAA8B,EAAE,CAAC;IACrD,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAC1C;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,uBAAuB,CAAA;CAAE,GACpD;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAA;CAAE,CAAC;AAExE,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,GACb,kCAAkC,CA2GpC"}
|
|
@@ -49,6 +49,9 @@ export function parseProviderPackageMetadata(input) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
const requiredTables = parseStringArray(input.requiredTables, "beignet.provider.requiredTables", issues);
|
|
53
|
+
if (requiredTables !== undefined)
|
|
54
|
+
metadata.requiredTables = requiredTables;
|
|
52
55
|
const watchers = parseStringArray(input.watchers, "beignet.provider.watchers", issues);
|
|
53
56
|
if (watchers !== undefined)
|
|
54
57
|
metadata.watchers = watchers;
|
|
@@ -74,6 +77,12 @@ export function parseProviderPackageMetadata(input) {
|
|
|
74
77
|
message: "must not be set when beignet.provider.variants is present; declare registration on each variant instead",
|
|
75
78
|
});
|
|
76
79
|
}
|
|
80
|
+
if (input.requiredTables !== undefined) {
|
|
81
|
+
issues.push({
|
|
82
|
+
path: "beignet.provider.requiredTables",
|
|
83
|
+
message: "must not be set when beignet.provider.variants is present; declare requiredTables on each variant instead",
|
|
84
|
+
});
|
|
85
|
+
}
|
|
77
86
|
}
|
|
78
87
|
if (issues.length > 0) {
|
|
79
88
|
return { success: false, issues };
|
|
@@ -192,6 +201,7 @@ function parseVariants(value, issues) {
|
|
|
192
201
|
}
|
|
193
202
|
}
|
|
194
203
|
}
|
|
204
|
+
const requiredTables = parseStringArray(entry.requiredTables, `${entryPath}.requiredTables`, issues);
|
|
195
205
|
const registration = parseRegistration(entry.registration, issues, `${entryPath}.registration`);
|
|
196
206
|
if (name === undefined)
|
|
197
207
|
continue;
|
|
@@ -202,6 +212,8 @@ function parseVariants(value, issues) {
|
|
|
202
212
|
variant.env = env;
|
|
203
213
|
if (requiredEnv !== undefined)
|
|
204
214
|
variant.requiredEnv = requiredEnv;
|
|
215
|
+
if (requiredTables !== undefined)
|
|
216
|
+
variant.requiredTables = requiredTables;
|
|
205
217
|
if (registration !== undefined)
|
|
206
218
|
variant.registration = registration;
|
|
207
219
|
parsed.push(variant);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/providers/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/providers/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA6CH,MAAM,UAAU,4BAA4B,CAC1C,KAAc;IAEd,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,kBAAkB;oBACxB,OAAO,EAAE,mBAAmB;iBAC7B;aACF;SACF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAmC,EAAE,CAAC;IAClD,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAE7C,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACpC,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,8BAA8B;gBACpC,OAAO,EAAE,kBAAkB;aAC5B,CAAC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AO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/server-only.d.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Host frameworks may provide their own runtime-only enforcement. This marker
|
|
5
5
|
* is intentionally a no-op so Beignet can enforce intent through `beignet lint`.
|
|
6
|
+
* Import it for side effects at the top of server-only modules:
|
|
7
|
+
* `import "@beignet/core/server-only";`.
|
|
6
8
|
*/
|
|
7
9
|
export declare const beignetServerOnly = true;
|
|
8
10
|
//# sourceMappingURL=server-only.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-only.d.ts","sourceRoot":"","sources":["../src/server-only.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"server-only.d.ts","sourceRoot":"","sources":["../src/server-only.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC"}
|
package/dist/server-only.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Host frameworks may provide their own runtime-only enforcement. This marker
|
|
5
5
|
* is intentionally a no-op so Beignet can enforce intent through `beignet lint`.
|
|
6
|
+
* Import it for side effects at the top of server-only modules:
|
|
7
|
+
* `import "@beignet/core/server-only";`.
|
|
6
8
|
*/
|
|
7
9
|
export const beignetServerOnly = true;
|
|
8
10
|
//# sourceMappingURL=server-only.js.map
|
package/dist/server-only.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-only.js","sourceRoot":"","sources":["../src/server-only.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"server-only.js","sourceRoot":"","sources":["../src/server-only.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: app-architecture
|
|
3
|
-
description: "Build Beignet app feature slices with @beignet/core primitives: schemas, contracts, use cases, app errors, ports, policies, context, providers, jobs, schedules, tasks, outbox, mail, uploads, and
|
|
3
|
+
description: "Build Beignet app feature slices with @beignet/core primitives: schemas, contracts, use cases, app errors, ports, policies, context, providers, domain events, listeners, jobs, schedules, tasks, notifications, outbox, mail, uploads, seeds, tests, auth helpers, audit, idempotency, storage, cache, rate limits, flags, entitlements, payments, search, webhooks, and explicit core subpath imports. Use when adding or fixing Beignet application behavior, dependency boundaries, app-facing ports, authorization, workflow primitives, or app-bound lib builders."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Beignet App Architecture
|
|
@@ -26,15 +26,25 @@ features/<feature>/
|
|
|
26
26
|
schemas.ts
|
|
27
27
|
routes.ts
|
|
28
28
|
use-cases/
|
|
29
|
+
domain/
|
|
29
30
|
ports.ts
|
|
30
31
|
policy.ts
|
|
31
32
|
client/
|
|
32
33
|
components/
|
|
34
|
+
jobs/
|
|
35
|
+
listeners/
|
|
36
|
+
notifications/
|
|
37
|
+
schedules/
|
|
38
|
+
tasks/
|
|
39
|
+
uploads/
|
|
40
|
+
seeds/
|
|
33
41
|
tests/
|
|
34
42
|
factories/
|
|
35
43
|
```
|
|
36
44
|
|
|
37
|
-
Small features do not need every file.
|
|
45
|
+
Small features do not need every file. The starter ships a lean subset;
|
|
46
|
+
workflow folders, `lib/` builders, and central registries appear when a
|
|
47
|
+
generator or deliberate feature change introduces that concern.
|
|
38
48
|
|
|
39
49
|
## Core Boundaries
|
|
40
50
|
|
|
@@ -46,6 +56,9 @@ Small features do not need every file. Add folders when the concern exists.
|
|
|
46
56
|
clients.
|
|
47
57
|
- UI and feature client modules call server behavior through contracts and a
|
|
48
58
|
typed client, not by importing use cases.
|
|
59
|
+
- Server, provider, and infra code may import `@beignet/core/server-only`;
|
|
60
|
+
browser-reachable client helpers may import `@beignet/core/client-only` as
|
|
61
|
+
lint markers when the app uses them.
|
|
49
62
|
|
|
50
63
|
## Contracts And Schemas
|
|
51
64
|
|
|
@@ -119,7 +132,8 @@ or outbox records must commit together.
|
|
|
119
132
|
- `bound` ports are app-owned at boot, such as gates, config, clocks, IDs, or
|
|
120
133
|
no-op reporters.
|
|
121
134
|
- `deferred` ports are supplied by providers at startup, such as auth,
|
|
122
|
-
database, mail, logger, jobs, repositories, idempotency,
|
|
135
|
+
database, mail, logger, jobs, repositories, idempotency, rate limits,
|
|
136
|
+
storage, search, payments, flags, locks, and error reporting.
|
|
123
137
|
|
|
124
138
|
Do not import provider packages from contracts, use cases, routes, UI, or
|
|
125
139
|
feature client modules.
|
|
@@ -129,17 +143,40 @@ feature client modules.
|
|
|
129
143
|
Feature-owned workflow definitions belong under the feature:
|
|
130
144
|
|
|
131
145
|
```txt
|
|
146
|
+
features/<feature>/domain/events/
|
|
132
147
|
features/<feature>/jobs/
|
|
148
|
+
features/<feature>/listeners/
|
|
133
149
|
features/<feature>/schedules/
|
|
134
150
|
features/<feature>/notifications/
|
|
135
151
|
features/<feature>/tasks/
|
|
136
152
|
features/<feature>/uploads/
|
|
153
|
+
features/<feature>/seeds/
|
|
137
154
|
```
|
|
138
155
|
|
|
139
156
|
Small existing apps may use feature-root `jobs.ts` or `schedules.ts`; follow
|
|
140
157
|
local style unless migrating deliberately. Central registries and service
|
|
141
158
|
contexts live under `server/`.
|
|
142
159
|
|
|
160
|
+
Context-free declarations stay top-level, such as `defineEvent(...)`.
|
|
161
|
+
Context-bound definitions should use app-bound builders created once in `lib/`,
|
|
162
|
+
for example `createJobs<AppContext>()`, `createListeners<AppContext>()`,
|
|
163
|
+
`createSchedules<AppContext>()`, `createNotifications<AppContext>()`, and
|
|
164
|
+
`createTasks<AppContext>()`.
|
|
165
|
+
|
|
166
|
+
Register workflow artifacts explicitly:
|
|
167
|
+
|
|
168
|
+
- listeners through `registerListeners(...)` in provider or infra wiring
|
|
169
|
+
- schedules in `server/schedules.ts`
|
|
170
|
+
- tasks in `server/tasks.ts`
|
|
171
|
+
- outbox events and jobs in `server/outbox.ts`
|
|
172
|
+
- seeds through the app's seed entrypoint, usually `infra/db/seed.ts`
|
|
173
|
+
|
|
174
|
+
Uploads are feature-owned definitions under `features/<feature>/uploads/`,
|
|
175
|
+
then exposed through an app route with `createUploadRouter(...)` and the
|
|
176
|
+
platform adapter. Webhooks and payment webhooks are inbound transport concerns:
|
|
177
|
+
define reusable verification or fulfillment in feature/application modules and
|
|
178
|
+
keep provider-specific route glue in focused route files.
|
|
179
|
+
|
|
143
180
|
Providers should not start unbounded background loops on server boot. Expose
|
|
144
181
|
cron routes, worker entrypoints, task runners, schedule runners, or outbox
|
|
145
182
|
drains instead.
|
|
@@ -24,6 +24,7 @@ export type ProviderPackageVariantMetadata = {
|
|
|
24
24
|
displayName?: string;
|
|
25
25
|
env?: readonly string[];
|
|
26
26
|
requiredEnv?: readonly string[];
|
|
27
|
+
requiredTables?: readonly string[];
|
|
27
28
|
registration?: ProviderPackageRegistrationMetadata;
|
|
28
29
|
};
|
|
29
30
|
|
|
@@ -33,6 +34,7 @@ export type ProviderPackageMetadata = {
|
|
|
33
34
|
appPorts?: readonly ProviderPackagePortMetadata[];
|
|
34
35
|
env?: readonly string[];
|
|
35
36
|
requiredEnv?: readonly string[];
|
|
37
|
+
requiredTables?: readonly string[];
|
|
36
38
|
registration?: ProviderPackageRegistrationMetadata;
|
|
37
39
|
variants?: readonly ProviderPackageVariantMetadata[];
|
|
38
40
|
watchers?: readonly string[];
|
|
@@ -100,6 +102,13 @@ export function parseProviderPackageMetadata(
|
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
|
|
105
|
+
const requiredTables = parseStringArray(
|
|
106
|
+
input.requiredTables,
|
|
107
|
+
"beignet.provider.requiredTables",
|
|
108
|
+
issues,
|
|
109
|
+
);
|
|
110
|
+
if (requiredTables !== undefined) metadata.requiredTables = requiredTables;
|
|
111
|
+
|
|
103
112
|
const watchers = parseStringArray(
|
|
104
113
|
input.watchers,
|
|
105
114
|
"beignet.provider.watchers",
|
|
@@ -135,6 +144,13 @@ export function parseProviderPackageMetadata(
|
|
|
135
144
|
"must not be set when beignet.provider.variants is present; declare registration on each variant instead",
|
|
136
145
|
});
|
|
137
146
|
}
|
|
147
|
+
if (input.requiredTables !== undefined) {
|
|
148
|
+
issues.push({
|
|
149
|
+
path: "beignet.provider.requiredTables",
|
|
150
|
+
message:
|
|
151
|
+
"must not be set when beignet.provider.variants is present; declare requiredTables on each variant instead",
|
|
152
|
+
});
|
|
153
|
+
}
|
|
138
154
|
}
|
|
139
155
|
|
|
140
156
|
if (issues.length > 0) {
|
|
@@ -275,6 +291,12 @@ function parseVariants(
|
|
|
275
291
|
}
|
|
276
292
|
}
|
|
277
293
|
|
|
294
|
+
const requiredTables = parseStringArray(
|
|
295
|
+
entry.requiredTables,
|
|
296
|
+
`${entryPath}.requiredTables`,
|
|
297
|
+
issues,
|
|
298
|
+
);
|
|
299
|
+
|
|
278
300
|
const registration = parseRegistration(
|
|
279
301
|
entry.registration,
|
|
280
302
|
issues,
|
|
@@ -286,6 +308,7 @@ function parseVariants(
|
|
|
286
308
|
if (displayName !== undefined) variant.displayName = displayName;
|
|
287
309
|
if (env !== undefined) variant.env = env;
|
|
288
310
|
if (requiredEnv !== undefined) variant.requiredEnv = requiredEnv;
|
|
311
|
+
if (requiredTables !== undefined) variant.requiredTables = requiredTables;
|
|
289
312
|
if (registration !== undefined) variant.registration = registration;
|
|
290
313
|
parsed.push(variant);
|
|
291
314
|
}
|