@beignet/cli 0.0.1 → 0.0.3
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 +26 -0
- package/README.md +144 -55
- package/dist/config.d.ts +31 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +18 -0
- package/dist/config.js.map +1 -1
- package/dist/create.d.ts +9 -0
- package/dist/create.d.ts.map +1 -1
- package/dist/create.js +5 -0
- package/dist/create.js.map +1 -1
- package/dist/db.d.ts +36 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +111 -0
- package/dist/db.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +243 -2
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +24 -0
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +288 -4
- package/dist/inspect.js.map +1 -1
- package/dist/lint.d.ts +12 -0
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +30 -5
- package/dist/lint.js.map +1 -1
- package/dist/make.d.ts +91 -0
- package/dist/make.d.ts.map +1 -1
- package/dist/make.js +602 -72
- package/dist/make.js.map +1 -1
- package/dist/templates.d.ts +33 -0
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +1396 -112
- package/dist/templates.js.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +31 -0
- package/src/create.ts +11 -0
- package/src/db.ts +166 -0
- package/src/index.ts +320 -0
- package/src/inspect.ts +497 -3
- package/src/lint.ts +43 -9
- package/src/make.ts +917 -80
- package/src/templates.ts +1425 -111
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @beignet/cli
|
|
2
2
|
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5643ae6: Add feature factory and seed generators plus database lifecycle doctor checks.
|
|
8
|
+
- 80db618: Add notification generation, route-test scaffold updates, and doctor checks for upload and notification drift.
|
|
9
|
+
- 3160184: Add `beignet db generate|migrate|seed|reset`, scaffold standard seed/reset database entrypoints, and expose a factory reset helper for test data workflows.
|
|
10
|
+
- 03f07b2: Promote the standard starter to a golden-path Beignet app with Better Auth, Drizzle/libSQL persistence, UOW, outbox, audit logging, jobs/events/schedules, uploads, notifications, devtools, and deployment entrypoints wired by default.
|
|
11
|
+
- 254ef6d: Add scoped route hooks for route and route-group policy, update auth hooks to expose public/optional/required route-hook factories, and teach CLI route inspection about curried route groups.
|
|
12
|
+
- 4cb1784: Add first-class upload router primitives, a typed browser upload client, a
|
|
13
|
+
React upload adapter, Next.js upload route helper, S3-compatible direct upload
|
|
14
|
+
signing, devtools upload watcher support, an upload generator, and a
|
|
15
|
+
first-class `beignet make feature` command with optional policy, event, job,
|
|
16
|
+
and upload artifacts for the standard vertical slice. Add first-class job retry
|
|
17
|
+
helpers, outbox retry policy integration, and job retry/dead-letter devtools
|
|
18
|
+
events. Add a Next.js outbox drain route helper and doctor warnings for
|
|
19
|
+
serverless background-work footguns.
|
|
20
|
+
|
|
21
|
+
## 0.0.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 90b29ad: Add pagination primitives and generate list responses with `items` and `page`.
|
|
26
|
+
- a79f60c: Add first-class notification primitives, devtools notification watcher support,
|
|
27
|
+
and dependency-direction lint coverage for feature workflow folders.
|
|
28
|
+
|
|
3
29
|
## 0.0.1
|
|
4
30
|
|
|
5
31
|
- Initial Beignet release under the `@beignet` npm scope.
|
package/README.md
CHANGED
|
@@ -17,7 +17,11 @@ bunx -p @beignet/cli create-beignet my-app
|
|
|
17
17
|
By default the CLI creates a Next.js app with:
|
|
18
18
|
|
|
19
19
|
- Contract-first todos API routes
|
|
20
|
-
-
|
|
20
|
+
- Better Auth routes and Beignet auth provider wiring
|
|
21
|
+
- Drizzle/libSQL persistence with a local SQLite default and Turso-ready config
|
|
22
|
+
- UOW, audit logging, and a durable outbox drain route
|
|
23
|
+
- Jobs, events, listeners, schedules, mail-backed notifications, and uploads
|
|
24
|
+
- App-owned ports with provider-backed infra adapters
|
|
21
25
|
- Validated application use cases
|
|
22
26
|
- A Beignet server wired through Next.js route handlers
|
|
23
27
|
- App error helpers, auth helpers, env validation, health checks, and devtools
|
|
@@ -39,7 +43,9 @@ Common follow-up commands:
|
|
|
39
43
|
|
|
40
44
|
```bash
|
|
41
45
|
# in another terminal, from my-app
|
|
42
|
-
bunx -p @beignet/cli beignet make
|
|
46
|
+
bunx -p @beignet/cli beignet make feature projects
|
|
47
|
+
bunx -p @beignet/cli beignet db generate
|
|
48
|
+
bunx -p @beignet/cli beignet db migrate
|
|
43
49
|
bunx -p @beignet/cli beignet routes
|
|
44
50
|
bunx -p @beignet/cli beignet lint
|
|
45
51
|
bunx -p @beignet/cli beignet doctor
|
|
@@ -51,15 +57,23 @@ bunx -p @beignet/cli beignet doctor
|
|
|
51
57
|
beignet create <directory> [options]
|
|
52
58
|
beignet make contract <name> [options]
|
|
53
59
|
beignet make event <feature>/<name> [options]
|
|
60
|
+
beignet make factory <feature>/<name> [options]
|
|
61
|
+
beignet make feature <name> [options]
|
|
54
62
|
beignet make job <feature>/<name> [options]
|
|
63
|
+
beignet make notification <feature>/<name> [options]
|
|
55
64
|
beignet make listener <feature>/<name> --event <feature>/<event> [options]
|
|
56
65
|
beignet make schedule <feature>/<name> [options]
|
|
57
66
|
beignet make port <name> [options]
|
|
58
67
|
beignet make policy <name> [options]
|
|
59
68
|
beignet make adapter <name> [options]
|
|
60
69
|
beignet make resource <name> [options]
|
|
70
|
+
beignet make seed <feature>/<name> [options]
|
|
61
71
|
beignet make test <feature>/<action> [options]
|
|
62
72
|
beignet make use-case <feature>/<action> [options]
|
|
73
|
+
beignet db generate [--dry-run] [--json]
|
|
74
|
+
beignet db migrate [--dry-run] [--json]
|
|
75
|
+
beignet db seed [--dry-run] [--json]
|
|
76
|
+
beignet db reset [--dry-run] [--json]
|
|
63
77
|
beignet routes [--json]
|
|
64
78
|
beignet lint [--json]
|
|
65
79
|
beignet doctor [--json] [--strict] [--fix]
|
|
@@ -75,6 +89,7 @@ Options:
|
|
|
75
89
|
--force Write into a non-empty directory.
|
|
76
90
|
--dry-run Preview make writes without changing files.
|
|
77
91
|
--json Print machine-readable output.
|
|
92
|
+
--with policy,events Add optional artifacts to `make feature`; also supports jobs, notifications, uploads.
|
|
78
93
|
--event posts/published Event for `make listener`.
|
|
79
94
|
--cron "0 9 * * *" Cron expression for `make schedule`.
|
|
80
95
|
--timezone America/Chicago Timezone for `make schedule`.
|
|
@@ -99,7 +114,7 @@ server/routes.ts
|
|
|
99
114
|
Route inspection supports contract-group definitions and direct
|
|
100
115
|
`createContract({ method, path })` exports.
|
|
101
116
|
|
|
102
|
-
The standard app layout includes the files
|
|
117
|
+
The standard app layout includes the files feature generators expect:
|
|
103
118
|
|
|
104
119
|
```txt
|
|
105
120
|
app-context.ts
|
|
@@ -109,7 +124,7 @@ lib/use-case.ts
|
|
|
109
124
|
```
|
|
110
125
|
|
|
111
126
|
Generated apps include these files by default. The CLI uses this shape to
|
|
112
|
-
inspect routes, wire generated
|
|
127
|
+
inspect routes, wire generated features, and report drift safely. `beignet
|
|
113
128
|
doctor` reports when a directory does not match the app layout.
|
|
114
129
|
|
|
115
130
|
Use `beignet.config.ts`, `beignet.config.js`,
|
|
@@ -146,11 +161,51 @@ The command honors `beignet.config.*` path overrides and writes
|
|
|
146
161
|
`features/projects/contracts.ts`. It creates a self-contained contract group with a
|
|
147
162
|
starter list endpoint, schema, standard error response, and exported contract
|
|
148
163
|
list. It does not wire route handlers, use cases, ports, or OpenAPI; use
|
|
149
|
-
`make
|
|
164
|
+
`make feature` when you want the full path from contract to tests.
|
|
150
165
|
|
|
151
|
-
Like `make
|
|
166
|
+
Like `make feature`, `make contract` skips identical files and stops on
|
|
152
167
|
divergent files unless you pass `--force`.
|
|
153
168
|
|
|
169
|
+
## Generate a feature
|
|
170
|
+
|
|
171
|
+
Inside a Beignet app, scaffold the standard contract-first vertical slice with:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
beignet make feature projects
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The command honors `beignet.config.*` path overrides. It writes:
|
|
178
|
+
|
|
179
|
+
- `features/projects/contracts.ts`
|
|
180
|
+
- `features/projects/use-cases/`
|
|
181
|
+
- `features/projects/ports.ts`
|
|
182
|
+
- `infra/projects/drizzle-project-repository.ts`
|
|
183
|
+
- `features/projects/routes.ts`
|
|
184
|
+
- `features/projects/tests/projects.test.ts`
|
|
185
|
+
|
|
186
|
+
It also wires the slice into the central route registry (`server/routes.ts` in
|
|
187
|
+
generated apps), `ports/index.ts`, `infra/db/repositories.ts`, and adds a
|
|
188
|
+
`test` script if the app does not already have one. The generated slice uses a small
|
|
189
|
+
`name` field by default so the app stays typecheckable immediately. Treat that
|
|
190
|
+
field as a placeholder and shape the schemas, use cases, repository, and tests
|
|
191
|
+
around the feature's real workflow.
|
|
192
|
+
|
|
193
|
+
Add common feature-owned artifacts with `--with`:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
beignet make feature projects --with policy,events,jobs,uploads
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
The optional artifacts use predictable starter names:
|
|
200
|
+
|
|
201
|
+
- `features/projects/policy.ts`
|
|
202
|
+
- `features/projects/domain/events/created.ts`
|
|
203
|
+
- `features/projects/jobs/process.ts`
|
|
204
|
+
- `features/projects/uploads/attachment.ts`
|
|
205
|
+
|
|
206
|
+
Event, job, and upload registries are created or updated in the matching
|
|
207
|
+
folder `index.ts` files.
|
|
208
|
+
|
|
154
209
|
## Generate a use case
|
|
155
210
|
|
|
156
211
|
Use `make use-case` inside a Beignet app when you want a focused
|
|
@@ -229,82 +284,107 @@ was already customized, the command stops instead of guessing.
|
|
|
229
284
|
|
|
230
285
|
## Generate a resource
|
|
231
286
|
|
|
232
|
-
|
|
287
|
+
Use `make resource` when the feature you are building is CRUD-shaped and you
|
|
288
|
+
prefer resource language:
|
|
233
289
|
|
|
234
290
|
```bash
|
|
235
291
|
beignet make resource projects
|
|
236
292
|
```
|
|
237
293
|
|
|
238
|
-
|
|
294
|
+
Today `make resource` and `make feature` generate the same contract-to-test
|
|
295
|
+
slice. The feature command is the recommended default because not every Beignet
|
|
296
|
+
feature maps cleanly to a REST resource.
|
|
239
297
|
|
|
240
|
-
|
|
241
|
-
- `features/projects/use-cases/`
|
|
242
|
-
- `features/projects/ports.ts`
|
|
243
|
-
- `infra/projects/in-memory-project-repository.ts`
|
|
244
|
-
- `features/projects/routes.ts`
|
|
245
|
-
- `features/projects/tests/projects.test.ts`
|
|
246
|
-
|
|
247
|
-
It also wires the resource into the central route registry (`server/routes.ts`
|
|
248
|
-
in generated apps), `ports/index.ts`, `infra/app-ports.ts`, and adds a `test`
|
|
249
|
-
script if the app does not already have one. Apps that serve OpenAPI from
|
|
250
|
-
`server.contracts` or `contractsFromRoutes(routes)` stay in sync through the
|
|
251
|
-
registered route list. Legacy direct `createOpenAPIHandler([...])` arrays are
|
|
252
|
-
updated conservatively when possible.
|
|
253
|
-
|
|
254
|
-
In apps created with the `drizzle-turso` integration, the command also creates
|
|
298
|
+
In standard apps, the command also creates
|
|
255
299
|
`infra/db/schema/projects.ts`,
|
|
256
300
|
`infra/projects/drizzle-project-repository.ts`, and registers the repository in
|
|
257
|
-
`infra/db/repositories.ts`.
|
|
258
|
-
fake.
|
|
259
|
-
|
|
260
|
-
The generated resource uses a small `name` field by default so the app stays
|
|
261
|
-
typecheckable immediately. Rename the fields in the generated schemas,
|
|
262
|
-
repository, and tests to match your domain.
|
|
301
|
+
`infra/db/repositories.ts`.
|
|
263
302
|
|
|
264
|
-
## Generate events, jobs, listeners, and
|
|
303
|
+
## Generate events, jobs, notifications, listeners, schedules, and uploads
|
|
265
304
|
|
|
266
305
|
Use feature artifact generators when a workflow grows beyond a single use case:
|
|
267
306
|
|
|
268
307
|
```bash
|
|
269
308
|
beignet make event posts/published
|
|
270
309
|
beignet make job posts/send-published-email
|
|
310
|
+
beignet make notification posts/published
|
|
271
311
|
beignet make listener posts/enqueue-published-email --event posts/published
|
|
272
312
|
beignet make schedule posts/daily-summary --cron "0 9 * * *" --timezone America/Chicago --route
|
|
313
|
+
beignet make upload posts/attachment
|
|
273
314
|
```
|
|
274
315
|
|
|
275
316
|
These commands use `feature/name` format and write colocated feature files:
|
|
276
317
|
|
|
277
318
|
- `features/posts/domain/events/published.ts`
|
|
278
319
|
- `features/posts/jobs/send-published-email.ts`
|
|
320
|
+
- `features/posts/notifications/published.ts`
|
|
279
321
|
- `features/posts/listeners/enqueue-published-email.ts`
|
|
280
322
|
- `features/posts/schedules/daily-summary.ts`
|
|
323
|
+
- `features/posts/uploads/attachment.ts`
|
|
281
324
|
|
|
282
325
|
Each command creates or updates the folder's `index.ts` with an exported
|
|
283
|
-
registry such as `postJobs`, `
|
|
284
|
-
|
|
285
|
-
`@beignet/core/jobs`,
|
|
286
|
-
generators
|
|
326
|
+
registry such as `postJobs`, `postNotifications`, `postListeners`,
|
|
327
|
+
`postSchedules`, or `postUploads`. Event and listener generators add
|
|
328
|
+
`@beignet/core/events`, job generators use `@beignet/core/jobs`, notification
|
|
329
|
+
generators use `@beignet/core/notifications`, schedule generators use
|
|
330
|
+
`@beignet/core/schedules`, and upload generators use `@beignet/core/uploads`.
|
|
331
|
+
`--route` also writes a Next.js cron
|
|
287
332
|
route under `app/api/cron/<feature>/<name>/route.ts`. Generated cron routes
|
|
288
333
|
require `CRON_SECRET` and record schedule start, completion, and failure events
|
|
289
|
-
in devtools.
|
|
334
|
+
in devtools. Generated uploads include starter metadata, constraints,
|
|
335
|
+
authorization, storage key, storage metadata, and completion hooks.
|
|
290
336
|
|
|
291
337
|
`make listener` expects the event file to exist at the canonical generated path.
|
|
292
338
|
Run `make event <feature>/<event>` first, then generate listeners for that event.
|
|
293
339
|
|
|
294
|
-
`make resource`
|
|
295
|
-
identical files and avoid duplicate wiring. If a generated
|
|
296
|
-
different content, the command stops unless you pass `--force`.
|
|
340
|
+
`make feature` and `make resource` are idempotent for unchanged generated files:
|
|
341
|
+
repeated runs skip identical files and avoid duplicate wiring. If a generated
|
|
342
|
+
file exists with different content, the command stops unless you pass `--force`.
|
|
343
|
+
|
|
344
|
+
## Database lifecycle
|
|
345
|
+
|
|
346
|
+
Use `beignet db` from an app root to run database workflow scripts through one
|
|
347
|
+
stable framework command surface:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
beignet db generate
|
|
351
|
+
beignet db migrate
|
|
352
|
+
beignet db seed
|
|
353
|
+
beignet db reset
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
The CLI delegates to app-owned package scripts named `db:generate`,
|
|
357
|
+
`db:migrate`, `db:seed`, and `db:reset`. In standard Drizzle apps, those scripts
|
|
358
|
+
run Drizzle Kit and the generated `infra/db/seed.ts` / `infra/db/reset.ts`
|
|
359
|
+
entrypoints. This keeps schema generation and migration behavior Drizzle-native
|
|
360
|
+
while making the lifecycle discoverable through Beignet.
|
|
361
|
+
|
|
362
|
+
`db reset` is intentionally app-owned because destructive behavior depends on
|
|
363
|
+
the environment. The standard starter refuses to reset non-local database URLs
|
|
364
|
+
unless `BEIGNET_ALLOW_DATABASE_RESET=true` is set.
|
|
365
|
+
|
|
366
|
+
Generate feature-owned test factories and local/demo seeds with:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
beignet make factory posts/post
|
|
370
|
+
beignet make seed posts/demo-posts
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
Factories are written under `features/posts/tests/factories/` and persist
|
|
374
|
+
through app-owned repository ports. Seeds are written under
|
|
375
|
+
`features/posts/seeds/`; import them from the app-owned database seed entrypoint
|
|
376
|
+
and run them with `runSeeds(...)`.
|
|
297
377
|
|
|
298
378
|
Preview writes without changing files:
|
|
299
379
|
|
|
300
380
|
```bash
|
|
301
|
-
beignet make
|
|
381
|
+
beignet make feature projects --dry-run
|
|
302
382
|
```
|
|
303
383
|
|
|
304
384
|
Use JSON output when another tool needs the exact planned changes:
|
|
305
385
|
|
|
306
386
|
```bash
|
|
307
|
-
beignet make
|
|
387
|
+
beignet make feature projects --dry-run --json
|
|
308
388
|
```
|
|
309
389
|
|
|
310
390
|
## Inspect app routes
|
|
@@ -330,10 +410,11 @@ beignet lint
|
|
|
330
410
|
```
|
|
331
411
|
|
|
332
412
|
The command scans static imports and fails when core feature layers reach into
|
|
333
|
-
runtime or framework layers. It catches domain, use case,
|
|
334
|
-
contract, and route files importing things like `infra/`, UI components,
|
|
413
|
+
runtime or framework layers. It catches domain, use case, workflow, policy,
|
|
414
|
+
port, contract, and route files importing things like `infra/`, UI components,
|
|
335
415
|
client modules, provider packages, Next.js, React, or database vendors in the
|
|
336
|
-
wrong direction.
|
|
416
|
+
wrong direction. Workflow folders include feature-owned jobs, listeners,
|
|
417
|
+
notifications, schedules, and uploads.
|
|
337
418
|
|
|
338
419
|
Use JSON output in CI or custom scripts:
|
|
339
420
|
|
|
@@ -355,12 +436,19 @@ Today it detects:
|
|
|
355
436
|
- Feature route groups that are not registered in the central route list
|
|
356
437
|
- Next.js route handlers that do not map to known contracts
|
|
357
438
|
- OpenAPI drift in direct arrays and common exported contract lists
|
|
358
|
-
- Partially wired generated
|
|
439
|
+
- Partially wired generated feature slices
|
|
359
440
|
- Provider packages without matching canonical app ports
|
|
360
441
|
- Generated ports without test fakes
|
|
442
|
+
- Drizzle repository adapters that are not wired through `infra/db/repositories.ts`
|
|
443
|
+
- Repository ports whose infra folder has no repository adapter
|
|
444
|
+
- Feature seeds without a matching feature factory
|
|
445
|
+
- Feature seeds without a `db:seed` package script
|
|
446
|
+
- Upload definitions without an upload route
|
|
447
|
+
- Notification dispatchers that bypass `ctx.ports.notifications`
|
|
448
|
+
- Feature artifacts in non-canonical folders
|
|
361
449
|
|
|
362
450
|
Use `beignet doctor --strict` for CI-oriented checks that may be noisy
|
|
363
|
-
locally, such as missing generated
|
|
451
|
+
locally, such as missing generated feature tests. Use
|
|
364
452
|
`beignet doctor --json` in CI or custom scripts.
|
|
365
453
|
|
|
366
454
|
Use `beignet doctor --fix` for low-risk maintenance fixes. Today it can add
|
|
@@ -370,9 +458,12 @@ when the missing contracts are already imported in the OpenAPI route.
|
|
|
370
458
|
Available presets:
|
|
371
459
|
|
|
372
460
|
- `minimal` - choose this when you want the small contract/core/server/use-case loop without the full app conventions.
|
|
373
|
-
- `standard` - choose this when you want the full app layout with
|
|
461
|
+
- `standard` - choose this when you want the full app layout with Better Auth, Drizzle/libSQL, UOW, outbox, audit logging, devtools, provider wiring, health checks, typed clients, feature-owned jobs/events/schedules/uploads/notifications, and separated `ports/` + `infra/`.
|
|
374
462
|
|
|
375
|
-
|
|
463
|
+
The standard preset includes the local production-shaped defaults: Better Auth,
|
|
464
|
+
Drizzle/libSQL, Pino logging, local storage, devtools, UOW, outbox, audit
|
|
465
|
+
logging, and feature-owned background workflow examples. Add external service
|
|
466
|
+
integrations only when you want those providers:
|
|
376
467
|
|
|
377
468
|
```bash
|
|
378
469
|
bunx -p @beignet/cli beignet create my-app --preset standard --integrations drizzle-turso,inngest,resend
|
|
@@ -394,15 +485,13 @@ Available integrations:
|
|
|
394
485
|
- `resend`
|
|
395
486
|
- `upstash-rate-limit`
|
|
396
487
|
|
|
397
|
-
With `--preset standard`,
|
|
488
|
+
With `--preset standard`, Drizzle/libSQL is included by default. The starter scaffolds `infra/db/schema/`, `infra/db/repositories.ts`, a Drizzle todo repository adapter, `drizzle.config.ts`, database scripts, and `TURSO_*` env examples so the generated todo resource uses durable persistence instead of the in-memory repository. Later `make feature` or `make resource` calls in that app generate both a Drizzle table/repository and an in-memory test fake.
|
|
398
489
|
|
|
399
|
-
With `--preset standard`,
|
|
400
|
-
|
|
401
|
-
request-bound authorization gate, and
|
|
402
|
-
boundary authentication and use cases or
|
|
403
|
-
|
|
404
|
-
replace the anonymous adapter once your app has a real Better Auth
|
|
405
|
-
session/database setup.
|
|
490
|
+
With `--preset standard`, Better Auth is included by default. The starter adds
|
|
491
|
+
the Better Auth Next.js route, Beignet auth provider wiring, typed
|
|
492
|
+
`UNAUTHORIZED` and `FORBIDDEN` errors, a request-bound authorization gate, and
|
|
493
|
+
`requireUser(ctx)`. Use hooks for HTTP boundary authentication and use cases or
|
|
494
|
+
policies for business authorization.
|
|
406
495
|
|
|
407
496
|
## License
|
|
408
497
|
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported application framework targets for Beignet config.
|
|
3
|
+
*/
|
|
1
4
|
export type BeignetFramework = "next";
|
|
5
|
+
/**
|
|
6
|
+
* Configurable app paths used by CLI generators, inspection, linting, and
|
|
7
|
+
* doctor checks.
|
|
8
|
+
*/
|
|
2
9
|
export type BeignetPaths = {
|
|
3
10
|
contracts: string;
|
|
4
11
|
routes: string;
|
|
@@ -13,19 +20,43 @@ export type BeignetPaths = {
|
|
|
13
20
|
useCaseBuilder: string;
|
|
14
21
|
tests: string;
|
|
15
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* User-authored Beignet CLI config.
|
|
25
|
+
*/
|
|
16
26
|
export type BeignetConfig = {
|
|
17
27
|
framework?: BeignetFramework;
|
|
18
28
|
paths?: Partial<BeignetPaths>;
|
|
19
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Beignet config after defaults and path normalization have been applied.
|
|
32
|
+
*/
|
|
20
33
|
export type ResolvedBeignetConfig = {
|
|
21
34
|
framework: BeignetFramework;
|
|
22
35
|
paths: BeignetPaths;
|
|
23
36
|
configFile?: string;
|
|
24
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* Default framework conventions used when an app has no config file.
|
|
40
|
+
*/
|
|
25
41
|
export declare const defaultBeignetConfig: ResolvedBeignetConfig;
|
|
42
|
+
/**
|
|
43
|
+
* Preserve a Beignet config object with type inference.
|
|
44
|
+
*/
|
|
26
45
|
export declare function defineConfig(config: BeignetConfig): BeignetConfig;
|
|
46
|
+
/**
|
|
47
|
+
* Apply Beignet CLI defaults to a partial config.
|
|
48
|
+
*/
|
|
27
49
|
export declare function resolveConfig(config?: BeignetConfig, configFile?: string): ResolvedBeignetConfig;
|
|
50
|
+
/**
|
|
51
|
+
* Load and resolve a Beignet config file from an app directory.
|
|
52
|
+
*/
|
|
28
53
|
export declare function loadBeignetConfig(targetDir: string, files?: string[]): Promise<ResolvedBeignetConfig>;
|
|
54
|
+
/**
|
|
55
|
+
* Convert platform-specific path separators to POSIX-style separators.
|
|
56
|
+
*/
|
|
29
57
|
export declare function normalizePath(filePath: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Normalize a directory path and remove leading or trailing slashes.
|
|
60
|
+
*/
|
|
30
61
|
export declare function directoryPath(filePath: string): string;
|
|
31
62
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,qB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AC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,qBAgBlC,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAEjE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,GAAE,aAAkB,EAC1B,UAAU,CAAC,EAAE,MAAM,GAClB,qBAAqB,CAWvB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,qBAAqB,CAAC,CA+ChC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
package/dist/config.js
CHANGED
|
@@ -2,6 +2,9 @@ import { readFile, stat } from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { createJiti } from "jiti";
|
|
5
|
+
/**
|
|
6
|
+
* Default framework conventions used when an app has no config file.
|
|
7
|
+
*/
|
|
5
8
|
export const defaultBeignetConfig = {
|
|
6
9
|
framework: "next",
|
|
7
10
|
paths: {
|
|
@@ -19,9 +22,15 @@ export const defaultBeignetConfig = {
|
|
|
19
22
|
tests: "tests",
|
|
20
23
|
},
|
|
21
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Preserve a Beignet config object with type inference.
|
|
27
|
+
*/
|
|
22
28
|
export function defineConfig(config) {
|
|
23
29
|
return config;
|
|
24
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Apply Beignet CLI defaults to a partial config.
|
|
33
|
+
*/
|
|
25
34
|
export function resolveConfig(config = {}, configFile) {
|
|
26
35
|
const paths = {
|
|
27
36
|
...defaultBeignetConfig.paths,
|
|
@@ -33,6 +42,9 @@ export function resolveConfig(config = {}, configFile) {
|
|
|
33
42
|
configFile,
|
|
34
43
|
};
|
|
35
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Load and resolve a Beignet config file from an app directory.
|
|
47
|
+
*/
|
|
36
48
|
export async function loadBeignetConfig(targetDir, files) {
|
|
37
49
|
const configFiles = await findConfigFiles(targetDir, files);
|
|
38
50
|
if (configFiles.length === 0) {
|
|
@@ -65,9 +77,15 @@ export async function loadBeignetConfig(targetDir, files) {
|
|
|
65
77
|
const configModule = (await import(pathToFileURL(configPath).href));
|
|
66
78
|
return resolveConfig(assertConfigObject(configModule.default ?? {}, configFile), configFile);
|
|
67
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Convert platform-specific path separators to POSIX-style separators.
|
|
82
|
+
*/
|
|
68
83
|
export function normalizePath(filePath) {
|
|
69
84
|
return filePath.split(path.sep).join("/");
|
|
70
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Normalize a directory path and remove leading or trailing slashes.
|
|
88
|
+
*/
|
|
71
89
|
export function directoryPath(filePath) {
|
|
72
90
|
return normalizePath(filePath).replaceAll(/^\/+|\/+$/g, "");
|
|
73
91
|
}
|
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;
|
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;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACrE,IAAI,UAAU,KAAK,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CACb,wBAAwB,GAAG,wCAAwC,KAAK,EAAE,CAC3E,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC,UAAU,CAAC,CAAC;AACnC,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/create.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type FeatureName, type IntegrationName, type PackageManager, type PresetName, type TemplateName } from "./templates.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for creating a new Beignet app.
|
|
4
|
+
*/
|
|
2
5
|
export type CreateOptions = {
|
|
3
6
|
name: string;
|
|
4
7
|
cwd?: string;
|
|
@@ -10,11 +13,17 @@ export type CreateOptions = {
|
|
|
10
13
|
force?: boolean;
|
|
11
14
|
beignetVersion?: string;
|
|
12
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Result returned after a new app is scaffolded.
|
|
18
|
+
*/
|
|
13
19
|
export type CreateResult = {
|
|
14
20
|
name: string;
|
|
15
21
|
targetDir: string;
|
|
16
22
|
files: string[];
|
|
17
23
|
packageManager: PackageManager;
|
|
18
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Create a Beignet app from a starter template.
|
|
27
|
+
*/
|
|
19
28
|
export declare function createProject(options: CreateOptions): Promise<CreateResult>;
|
|
20
29
|
//# sourceMappingURL=create.d.ts.map
|
package/dist/create.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,eAAe,EAEpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAwCvB"}
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,eAAe,EAEpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAwCvB"}
|
package/dist/create.js
CHANGED
|
@@ -2,6 +2,9 @@ import { readFileSync } from "node:fs";
|
|
|
2
2
|
import { mkdir, readdir, writeFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { featureChoices, getTemplateFiles, integrationChoices, } from "./templates.js";
|
|
5
|
+
/**
|
|
6
|
+
* Create a Beignet app from a starter template.
|
|
7
|
+
*/
|
|
5
8
|
export async function createProject(options) {
|
|
6
9
|
const cwd = options.cwd ?? process.cwd();
|
|
7
10
|
const name = normalizeProjectName(options.name);
|
|
@@ -57,6 +60,8 @@ function resolveFeatures(preset, explicitFeatures) {
|
|
|
57
60
|
function resolveIntegrations(preset, explicitIntegrations) {
|
|
58
61
|
const integrations = new Set();
|
|
59
62
|
if (preset === "standard") {
|
|
63
|
+
integrations.add("better-auth");
|
|
64
|
+
integrations.add("drizzle-turso");
|
|
60
65
|
integrations.add("pino");
|
|
61
66
|
}
|
|
62
67
|
for (const integration of explicitIntegrations) {
|
package/dist/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAA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AAO,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,IAAI;SACR,QAAQ,CAAC,OAAO,CAAC;SACjB,WAAW,EAAE;SACb,UAAU,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,SAAiB,EACjB,KAAc;IAEd,IAAI,OAAiB,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,aAAa,SAAS,8CAA8C,CACrE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/db.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database lifecycle operations supported by the Beignet CLI.
|
|
3
|
+
*/
|
|
4
|
+
export type DatabaseCommand = "generate" | "migrate" | "seed" | "reset";
|
|
5
|
+
/**
|
|
6
|
+
* Options for running a database lifecycle command.
|
|
7
|
+
*/
|
|
8
|
+
export type RunDatabaseCommandOptions = {
|
|
9
|
+
command: DatabaseCommand;
|
|
10
|
+
cwd?: string;
|
|
11
|
+
captureOutput?: boolean;
|
|
12
|
+
dryRun?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Result returned by a database lifecycle command.
|
|
16
|
+
*/
|
|
17
|
+
export type RunDatabaseCommandResult = {
|
|
18
|
+
command: DatabaseCommand;
|
|
19
|
+
cwd: string;
|
|
20
|
+
script: string;
|
|
21
|
+
runner: string;
|
|
22
|
+
args: string[];
|
|
23
|
+
stdout?: string;
|
|
24
|
+
stderr?: string;
|
|
25
|
+
dryRun: boolean;
|
|
26
|
+
exitCode: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Run an app-owned database lifecycle script.
|
|
30
|
+
*
|
|
31
|
+
* Beignet owns the command surface; the app owns the actual Drizzle script.
|
|
32
|
+
* This keeps `beignet db ...` stable while leaving migrations, schema paths,
|
|
33
|
+
* database URLs, and destructive reset behavior explicit in app code.
|
|
34
|
+
*/
|
|
35
|
+
export declare function runDatabaseCommand(options: RunDatabaseCommandOptions): Promise<RunDatabaseCommandResult>;
|
|
36
|
+
//# sourceMappingURL=db.d.ts.map
|
package/dist/db.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,eAAe,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,eAAe,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAaF;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CA0CnC"}
|