@beignet/cli 0.0.4 → 0.0.5
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 +14 -0
- package/dist/choices.d.ts +5 -28
- package/dist/choices.d.ts.map +1 -1
- package/dist/choices.js +0 -35
- package/dist/choices.js.map +1 -1
- package/dist/create-prompts.d.ts +5 -6
- package/dist/create-prompts.d.ts.map +1 -1
- package/dist/create-prompts.js +19 -77
- package/dist/create-prompts.js.map +1 -1
- package/dist/create.d.ts +6 -4
- package/dist/create.d.ts.map +1 -1
- package/dist/create.js +15 -24
- package/dist/create.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -39
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/make.d.ts.map +1 -1
- package/dist/make.js +153 -1
- package/dist/make.js.map +1 -1
- package/dist/templates/base.d.ts +13 -0
- package/dist/templates/base.d.ts.map +1 -0
- package/dist/templates/base.js +300 -0
- package/dist/templates/base.js.map +1 -0
- package/dist/templates/db.d.ts +14 -0
- package/dist/templates/db.d.ts.map +1 -0
- package/dist/templates/db.js +962 -0
- package/dist/templates/db.js.map +1 -0
- package/dist/templates/index.d.ts +14 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +123 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/server.d.ts +26 -0
- package/dist/templates/server.d.ts.map +1 -0
- package/dist/templates/server.js +520 -0
- package/dist/templates/server.js.map +1 -0
- package/dist/templates/shadcn.d.ts +5 -0
- package/dist/templates/shadcn.d.ts.map +1 -0
- package/dist/templates/shadcn.js +555 -0
- package/dist/templates/shadcn.js.map +1 -0
- package/dist/templates/shared.d.ts +49 -0
- package/dist/templates/shared.d.ts.map +1 -0
- package/dist/templates/shared.js +57 -0
- package/dist/templates/shared.js.map +1 -0
- package/dist/templates/shell.d.ts +5 -0
- package/dist/templates/shell.d.ts.map +1 -0
- package/dist/templates/shell.js +1190 -0
- package/dist/templates/shell.js.map +1 -0
- package/dist/templates/todos.d.ts +17 -0
- package/dist/templates/todos.d.ts.map +1 -0
- package/dist/templates/todos.js +607 -0
- package/dist/templates/todos.js.map +1 -0
- package/package.json +2 -2
- package/src/choices.ts +4 -58
- package/src/create-prompts.ts +20 -88
- package/src/create.ts +21 -38
- package/src/index.ts +39 -45
- package/src/lib.ts +1 -1
- package/src/make.ts +208 -1
- package/src/templates/base.ts +377 -0
- package/src/templates/db.ts +963 -0
- package/src/templates/index.ts +148 -0
- package/src/templates/server.ts +528 -0
- package/src/templates/shadcn.ts +570 -0
- package/src/templates/shared.ts +90 -0
- package/src/templates/shell.ts +1219 -0
- package/src/templates/todos.ts +607 -0
- package/dist/templates.d.ts +0 -26
- package/dist/templates.d.ts.map +0 -1
- package/dist/templates.js +0 -3995
- package/dist/templates.js.map +0 -1
- package/src/templates.ts +0 -4280
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
# @beignet/cli
|
|
2
2
|
|
|
3
|
+
## 0.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 29653f5: beignet make schedule now maintains the app schedule registry: it creates server/schedules.ts on demand, appends new feature schedules idempotently, and with --route wires CRON_SECRET into lib/env.ts, .env.example, and an existing .env.local with a generated secret.
|
|
8
|
+
- 29653f5: beignet create scaffolds a single full-stack starter with a shadcn/Tailwind UI shell, Better Auth sign-in, and vendored Drizzle migrations; --preset and --features are replaced by --api, and base providers (Better Auth, Drizzle/libSQL, pino) are no longer --integrations choices.
|
|
9
|
+
- @beignet/core@0.0.5
|
|
10
|
+
|
|
3
11
|
## 0.0.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
6
14
|
|
|
15
|
+
- Fix the generated standard app failing `next build`: the outbox and schedule
|
|
16
|
+
registries imported `./index.js` (which Turbopack cannot resolve to a
|
|
17
|
+
TypeScript file), and the database bootstrap hit `SQLITE_BUSY` when Next's
|
|
18
|
+
parallel page-data workers booted the server concurrently (it now sets a
|
|
19
|
+
busy timeout). The generated-app conformance check now runs the README's
|
|
20
|
+
database setup and `next build` for every scenario.
|
|
7
21
|
- 8bcb31f: Mark package READMEs with Beignet's experimental alpha status and 0.0.x stability expectations.
|
|
8
22
|
- c1a834d: Generate an app-owned client error helper and align form error handling docs with
|
|
9
23
|
the canonical React Query and React Hook Form mutation path.
|
package/dist/choices.d.ts
CHANGED
|
@@ -7,22 +7,17 @@
|
|
|
7
7
|
* Package managers supported by the app template generator.
|
|
8
8
|
*/
|
|
9
9
|
export type PackageManager = "bun" | "npm" | "pnpm" | "yarn";
|
|
10
|
-
/**
|
|
11
|
-
* Starter presets supported by the app template generator.
|
|
12
|
-
*/
|
|
13
|
-
export type PresetName = "minimal" | "standard";
|
|
14
10
|
/**
|
|
15
11
|
* Application templates supported by the app template generator.
|
|
16
12
|
*/
|
|
17
13
|
export type TemplateName = "next";
|
|
18
|
-
/**
|
|
19
|
-
* Optional first-party features that can be scaffolded into a new app.
|
|
20
|
-
*/
|
|
21
|
-
export type FeatureName = "client" | "react-query" | "forms" | "openapi";
|
|
22
14
|
/**
|
|
23
15
|
* Optional provider integrations that can be scaffolded into a new app.
|
|
16
|
+
*
|
|
17
|
+
* Better Auth, Drizzle/libSQL, and pino ship in every starter, so only
|
|
18
|
+
* integrations that add an external service remain selectable.
|
|
24
19
|
*/
|
|
25
|
-
export type IntegrationName = "
|
|
20
|
+
export type IntegrationName = "inngest" | "resend" | "upstash-rate-limit";
|
|
26
21
|
/**
|
|
27
22
|
* Supported scaffold template choices.
|
|
28
23
|
*/
|
|
@@ -31,28 +26,10 @@ export declare const templateChoices: readonly ["next"];
|
|
|
31
26
|
* Supported scaffold package manager choices.
|
|
32
27
|
*/
|
|
33
28
|
export declare const packageManagerChoices: readonly ["bun", "npm", "pnpm", "yarn"];
|
|
34
|
-
/**
|
|
35
|
-
* Supported scaffold feature choices.
|
|
36
|
-
*/
|
|
37
|
-
export declare const featureChoices: readonly ["client", "react-query", "forms", "openapi"];
|
|
38
|
-
/**
|
|
39
|
-
* Supported scaffold preset choices.
|
|
40
|
-
*/
|
|
41
|
-
export declare const presetChoices: readonly ["minimal", "standard"];
|
|
42
29
|
/**
|
|
43
30
|
* Supported scaffold integration choices.
|
|
44
31
|
*/
|
|
45
|
-
export declare const integrationChoices: readonly ["
|
|
46
|
-
/**
|
|
47
|
-
* Features included by each starter preset before explicit `--features`
|
|
48
|
-
* selections are added.
|
|
49
|
-
*/
|
|
50
|
-
export declare const presetFeatureDefaults: Record<PresetName, readonly FeatureName[]>;
|
|
51
|
-
/**
|
|
52
|
-
* Integrations included by each starter preset before explicit
|
|
53
|
-
* `--integrations` selections are added.
|
|
54
|
-
*/
|
|
55
|
-
export declare const presetIntegrationDefaults: Record<PresetName, readonly IntegrationName[]>;
|
|
32
|
+
export declare const integrationChoices: readonly ["inngest", "resend", "upstash-rate-limit"];
|
|
56
33
|
/**
|
|
57
34
|
* Shells supported by `beignet completion install` and `uninstall`.
|
|
58
35
|
*/
|
package/dist/choices.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../src/choices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7D;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../src/choices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,oBAAoB,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,eAAe,mBAEgB,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,qBAAqB,yCAKY,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,kBAAkB,sDAIgB,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,sBAAsB,0BAGY,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,uBAAuB,oIAa1B,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/choices.js
CHANGED
|
@@ -18,49 +18,14 @@ export const packageManagerChoices = [
|
|
|
18
18
|
"pnpm",
|
|
19
19
|
"yarn",
|
|
20
20
|
];
|
|
21
|
-
/**
|
|
22
|
-
* Supported scaffold feature choices.
|
|
23
|
-
*/
|
|
24
|
-
export const featureChoices = [
|
|
25
|
-
"client",
|
|
26
|
-
"react-query",
|
|
27
|
-
"forms",
|
|
28
|
-
"openapi",
|
|
29
|
-
];
|
|
30
|
-
/**
|
|
31
|
-
* Supported scaffold preset choices.
|
|
32
|
-
*/
|
|
33
|
-
export const presetChoices = [
|
|
34
|
-
"minimal",
|
|
35
|
-
"standard",
|
|
36
|
-
];
|
|
37
21
|
/**
|
|
38
22
|
* Supported scaffold integration choices.
|
|
39
23
|
*/
|
|
40
24
|
export const integrationChoices = [
|
|
41
|
-
"better-auth",
|
|
42
|
-
"drizzle-turso",
|
|
43
25
|
"inngest",
|
|
44
|
-
"pino",
|
|
45
26
|
"resend",
|
|
46
27
|
"upstash-rate-limit",
|
|
47
28
|
];
|
|
48
|
-
/**
|
|
49
|
-
* Features included by each starter preset before explicit `--features`
|
|
50
|
-
* selections are added.
|
|
51
|
-
*/
|
|
52
|
-
export const presetFeatureDefaults = {
|
|
53
|
-
minimal: [],
|
|
54
|
-
standard: featureChoices,
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Integrations included by each starter preset before explicit
|
|
58
|
-
* `--integrations` selections are added.
|
|
59
|
-
*/
|
|
60
|
-
export const presetIntegrationDefaults = {
|
|
61
|
-
minimal: [],
|
|
62
|
-
standard: ["better-auth", "drizzle-turso", "pino"],
|
|
63
|
-
};
|
|
64
29
|
/**
|
|
65
30
|
* Supported completion shell choices.
|
|
66
31
|
*/
|
package/dist/choices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choices.js","sourceRoot":"","sources":["../src/choices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"choices.js","sourceRoot":"","sources":["../src/choices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;CACoC,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;CACsC,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS;IACT,QAAQ;IACR,oBAAoB;CACyB,CAAC;AAOhD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,MAAM;IACN,KAAK;CACwC,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,KAAK;IACL,MAAM;IACN,cAAc;IACd,eAAe;IACf,MAAM;IACN,OAAO;IACP,IAAI;IACJ,QAAQ;IACR,SAAS;CACD,CAAC"}
|
package/dist/create-prompts.d.ts
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* `@clack/prompts` is loaded lazily inside the prompt flow so non-interactive
|
|
6
6
|
* runs and CLI startup never pay for it.
|
|
7
7
|
*/
|
|
8
|
-
import { type
|
|
8
|
+
import { type IntegrationName, type PackageManager } from "./choices.js";
|
|
9
9
|
/**
|
|
10
10
|
* Selections shared by create flags and interactive prompt answers.
|
|
11
11
|
*/
|
|
12
12
|
export type CreateSelections = {
|
|
13
13
|
directory?: string;
|
|
14
|
-
|
|
15
|
-
features?: readonly FeatureName[];
|
|
14
|
+
api?: boolean;
|
|
16
15
|
integrations?: readonly IntegrationName[];
|
|
17
16
|
packageManager?: PackageManager;
|
|
18
17
|
};
|
|
@@ -27,9 +26,9 @@ type CreatePromptTty = {
|
|
|
27
26
|
* Decide whether `beignet create` should run the interactive prompt flow.
|
|
28
27
|
*
|
|
29
28
|
* Prompts run only on a full TTY, only when `--yes` is absent, and only when
|
|
30
|
-
* no selection flag was passed. Any explicit
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* no selection flag was passed. Any explicit api, integration, or package
|
|
30
|
+
* manager selection means the invocation is scripted, so the non-interactive
|
|
31
|
+
* path stays byte-identical for agents and CI.
|
|
33
32
|
*/
|
|
34
33
|
export declare function shouldPromptInteractively(flags: CreatePromptFlags, tty: CreatePromptTty): boolean;
|
|
35
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-prompts.d.ts","sourceRoot":"","sources":["../src/create-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"create-prompts.d.ts","sourceRoot":"","sources":["../src/create-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAC1C,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF,KAAK,iBAAiB,GAAG,gBAAgB,GAAG;IAC1C,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,eAAe,GACnB,OAAO,CAUT;AAQD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CA4CvC"}
|
package/dist/create-prompts.js
CHANGED
|
@@ -5,37 +5,27 @@
|
|
|
5
5
|
* `@clack/prompts` is loaded lazily inside the prompt flow so non-interactive
|
|
6
6
|
* runs and CLI startup never pay for it.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { integrationChoices, } from "./choices.js";
|
|
9
9
|
/**
|
|
10
10
|
* Decide whether `beignet create` should run the interactive prompt flow.
|
|
11
11
|
*
|
|
12
12
|
* Prompts run only on a full TTY, only when `--yes` is absent, and only when
|
|
13
|
-
* no selection flag was passed. Any explicit
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* no selection flag was passed. Any explicit api, integration, or package
|
|
14
|
+
* manager selection means the invocation is scripted, so the non-interactive
|
|
15
|
+
* path stays byte-identical for agents and CI.
|
|
16
16
|
*/
|
|
17
17
|
export function shouldPromptInteractively(flags, tty) {
|
|
18
18
|
if (!tty.stdin || !tty.stdout)
|
|
19
19
|
return false;
|
|
20
20
|
if (flags.yes)
|
|
21
21
|
return false;
|
|
22
|
-
const selectionFlagPassed = flags.
|
|
23
|
-
(flags.features?.length ?? 0) > 0 ||
|
|
22
|
+
const selectionFlagPassed = flags.api !== undefined ||
|
|
24
23
|
(flags.integrations?.length ?? 0) > 0 ||
|
|
25
24
|
flags.packageManager !== undefined;
|
|
26
25
|
return !selectionFlagPassed;
|
|
27
26
|
}
|
|
28
|
-
const featureHints = {
|
|
29
|
-
client: "Typed Beignet HTTP client",
|
|
30
|
-
"react-query": "TanStack Query helpers for contracts",
|
|
31
|
-
forms: "React Hook Form wired to contract bodies",
|
|
32
|
-
openapi: "OpenAPI document route generated from contracts",
|
|
33
|
-
};
|
|
34
27
|
const integrationHints = {
|
|
35
|
-
"better-auth": "Better Auth routes and auth provider wiring",
|
|
36
|
-
"drizzle-turso": "Drizzle/libSQL persistence with Turso-ready config",
|
|
37
28
|
inngest: "Inngest-backed background jobs",
|
|
38
|
-
pino: "Pino logger provider",
|
|
39
29
|
resend: "Resend-backed mail provider",
|
|
40
30
|
"upstash-rate-limit": "Upstash-backed rate limiting",
|
|
41
31
|
};
|
|
@@ -60,77 +50,29 @@ export async function promptCreateSelections(initial) {
|
|
|
60
50
|
return undefined;
|
|
61
51
|
directory = answer;
|
|
62
52
|
}
|
|
63
|
-
const
|
|
64
|
-
message: "
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
value: "standard",
|
|
68
|
-
label: "standard",
|
|
69
|
-
hint: "Full app layout with auth, database, jobs, and devtools",
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
value: "minimal",
|
|
73
|
-
label: "minimal",
|
|
74
|
-
hint: "Smallest contract/server/use-case loop",
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
initialValue: "standard",
|
|
53
|
+
const api = await prompts.confirm({
|
|
54
|
+
message: "API-only app (no UI shell)?",
|
|
55
|
+
initialValue: false,
|
|
78
56
|
});
|
|
79
|
-
if (prompts.isCancel(
|
|
57
|
+
if (prompts.isCancel(api))
|
|
80
58
|
return undefined;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
options: featureChoices.map((feature) => ({
|
|
88
|
-
value: feature,
|
|
89
|
-
label: feature,
|
|
90
|
-
hint: featureHints[feature],
|
|
91
|
-
})),
|
|
92
|
-
required: false,
|
|
93
|
-
});
|
|
94
|
-
if (prompts.isCancel(answer))
|
|
95
|
-
return undefined;
|
|
96
|
-
features = answer;
|
|
97
|
-
}
|
|
98
|
-
const presetIntegrations = new Set(presetIntegrationDefaults[preset]);
|
|
99
|
-
const integrationOptions = integrationChoices.filter((integration) => !presetIntegrations.has(integration));
|
|
100
|
-
let integrations;
|
|
101
|
-
if (integrationOptions.length > 0) {
|
|
102
|
-
const answer = await prompts.multiselect({
|
|
103
|
-
message: presetIntegrations.size > 0
|
|
104
|
-
? "Add provider integrations beyond the preset defaults? (press enter to skip)"
|
|
105
|
-
: "Add provider integrations? (press enter to skip)",
|
|
106
|
-
options: integrationOptions.map((integration) => ({
|
|
107
|
-
value: integration,
|
|
108
|
-
label: integration,
|
|
109
|
-
hint: integrationHints[integration],
|
|
110
|
-
})),
|
|
111
|
-
required: false,
|
|
112
|
-
});
|
|
113
|
-
if (prompts.isCancel(answer))
|
|
114
|
-
return undefined;
|
|
115
|
-
integrations = answer;
|
|
116
|
-
}
|
|
117
|
-
const packageManager = await prompts.select({
|
|
118
|
-
message: "Which package manager?",
|
|
119
|
-
options: packageManagerChoices.map((manager) => ({
|
|
120
|
-
value: manager,
|
|
121
|
-
label: manager,
|
|
59
|
+
const integrations = await prompts.multiselect({
|
|
60
|
+
message: "Add provider integrations? (press enter to skip)",
|
|
61
|
+
options: integrationChoices.map((integration) => ({
|
|
62
|
+
value: integration,
|
|
63
|
+
label: integration,
|
|
64
|
+
hint: integrationHints[integration],
|
|
122
65
|
})),
|
|
123
|
-
|
|
66
|
+
required: false,
|
|
124
67
|
});
|
|
125
|
-
if (prompts.isCancel(
|
|
68
|
+
if (prompts.isCancel(integrations))
|
|
126
69
|
return undefined;
|
|
127
70
|
prompts.outro(`Creating ${directory}`);
|
|
128
71
|
return {
|
|
129
72
|
directory,
|
|
130
|
-
|
|
131
|
-
features,
|
|
73
|
+
api,
|
|
132
74
|
integrations,
|
|
133
|
-
packageManager,
|
|
75
|
+
packageManager: initial.packageManager,
|
|
134
76
|
};
|
|
135
77
|
}
|
|
136
78
|
//# sourceMappingURL=create-prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-prompts.js","sourceRoot":"","sources":["../src/create-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,
|
|
1
|
+
{"version":3,"file":"create-prompts.js","sourceRoot":"","sources":["../src/create-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,kBAAkB,GAEnB,MAAM,cAAc,CAAC;AAqBtB;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAwB,EACxB,GAAoB;IAEpB,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IAE5B,MAAM,mBAAmB,GACvB,KAAK,CAAC,GAAG,KAAK,SAAS;QACvB,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;QACrC,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC;IAErC,OAAO,CAAC,mBAAmB,CAAC;AAC9B,CAAC;AAED,MAAM,gBAAgB,GAAoC;IACxD,OAAO,EAAE,gCAAgC;IACzC,MAAM,EAAE,6BAA6B;IACrC,oBAAoB,EAAE,8BAA8B;CACrD,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAyB;IAEzB,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAE/C,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEhC,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAClC,IAA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 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IntegrationName, type PackageManager, type TemplateName } from "./templates/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Options for creating a new Beignet app.
|
|
4
4
|
*/
|
|
@@ -6,8 +6,10 @@ export type CreateOptions = {
|
|
|
6
6
|
name: string;
|
|
7
7
|
cwd?: string;
|
|
8
8
|
template?: TemplateName;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Scaffold an API-only app without the UI shell.
|
|
11
|
+
*/
|
|
12
|
+
api?: boolean;
|
|
11
13
|
packageManager?: PackageManager;
|
|
12
14
|
integrations?: IntegrationName[];
|
|
13
15
|
force?: boolean;
|
|
@@ -26,7 +28,7 @@ export type CreateResult = {
|
|
|
26
28
|
packageManager: PackageManager;
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
|
-
* Create a Beignet app from
|
|
31
|
+
* Create a Beignet app from the starter template.
|
|
30
32
|
*/
|
|
31
33
|
export declare function createProject(options: CreateOptions): Promise<CreateResult>;
|
|
32
34
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAG9B;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,EAAE,CAAC,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,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,CA6CvB"}
|
package/dist/create.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { mkdir, readdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import { featureChoices, getTemplateFiles, integrationChoices, } from "./templates.js";
|
|
3
|
+
import { getTemplateFiles, integrationChoices, } from "./templates/index.js";
|
|
5
4
|
import { getCliVersion } from "./version.js";
|
|
6
5
|
/**
|
|
7
|
-
* Create a Beignet app from
|
|
6
|
+
* Create a Beignet app from the starter template.
|
|
8
7
|
*/
|
|
9
8
|
export async function createProject(options) {
|
|
10
9
|
const cwd = options.cwd ?? process.cwd();
|
|
@@ -12,9 +11,8 @@ export async function createProject(options) {
|
|
|
12
11
|
const targetDir = path.resolve(cwd, options.name);
|
|
13
12
|
const packageManager = options.packageManager ?? "bun";
|
|
14
13
|
const template = options.template ?? "next";
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const integrations = resolveIntegrations(preset, options.integrations ?? []);
|
|
14
|
+
const api = Boolean(options.api);
|
|
15
|
+
const integrations = resolveIntegrations(options.integrations ?? []);
|
|
18
16
|
if (template !== "next") {
|
|
19
17
|
throw new Error(`Unknown template "${template}". Available templates: next`);
|
|
20
18
|
}
|
|
@@ -24,8 +22,7 @@ export async function createProject(options) {
|
|
|
24
22
|
name,
|
|
25
23
|
packageManager,
|
|
26
24
|
beignetVersion: options.beignetVersion ?? getDefaultBeignetVersion(),
|
|
27
|
-
|
|
28
|
-
features,
|
|
25
|
+
api,
|
|
29
26
|
integrations,
|
|
30
27
|
});
|
|
31
28
|
if (!dryRun) {
|
|
@@ -45,24 +42,18 @@ export async function createProject(options) {
|
|
|
45
42
|
packageManager,
|
|
46
43
|
};
|
|
47
44
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
features.add("react-query");
|
|
55
|
-
}
|
|
56
|
-
if (features.has("react-query")) {
|
|
57
|
-
features.add("client");
|
|
58
|
-
}
|
|
59
|
-
return featureChoices.filter((feature) => features.has(feature));
|
|
60
|
-
}
|
|
61
|
-
function resolveIntegrations(preset, explicitIntegrations) {
|
|
62
|
-
const integrations = new Set(presetIntegrationDefaults[preset]);
|
|
45
|
+
/**
|
|
46
|
+
* Providers that ship in every starter. They used to be `--integrations`
|
|
47
|
+
* choices, so passing them gets a pointed error instead of a generic one.
|
|
48
|
+
*/
|
|
49
|
+
const baseProviderNames = new Set(["better-auth", "drizzle-turso", "pino"]);
|
|
50
|
+
function resolveIntegrations(explicitIntegrations) {
|
|
63
51
|
for (const integration of explicitIntegrations) {
|
|
64
|
-
|
|
52
|
+
if (baseProviderNames.has(integration)) {
|
|
53
|
+
throw new Error(`${integration} is part of every Beignet starter and no longer an --integrations choice.`);
|
|
54
|
+
}
|
|
65
55
|
}
|
|
56
|
+
const integrations = new Set(explicitIntegrations);
|
|
66
57
|
return integrationChoices.filter((integration) => integrations.has(integration));
|
|
67
58
|
}
|
|
68
59
|
function getDefaultBeignetVersion() {
|
package/dist/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"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":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAIL,KAAK,cAAc,EAInB,KAAK,4BAA4B,EACjC,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAiBvB,KAAK,UAAU,GAAG,cAAc,GAAG;IACjC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC,CAAC;AA86CF,wBAAsB,IAAI,CACxB,MAAM,WAAwB,EAC9B,OAAO,GAAE,4BAA4B,CAAC,UAAU,CAAe,GAC9D,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { realpathSync } from "node:fs";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { buildApplication, buildCommand, buildRouteMap, proposeCompletions, run, text_en, } from "@stricli/core";
|
|
5
|
-
import { completionShellChoices,
|
|
5
|
+
import { completionShellChoices, integrationChoices, makeFeatureAddonChoices, packageManagerChoices, templateChoices, } from "./choices.js";
|
|
6
6
|
import { getCliVersion } from "./version.js";
|
|
7
7
|
const outputFormatChoices = [
|
|
8
8
|
"human",
|
|
@@ -123,7 +123,10 @@ function useColor() {
|
|
|
123
123
|
const createCommand = buildCommand({
|
|
124
124
|
docs: {
|
|
125
125
|
brief: "Create a new Beignet app.",
|
|
126
|
-
fullDescription: `
|
|
126
|
+
fullDescription: `Scaffolds a full-stack Beignet starter: typed contracts, Better Auth,
|
|
127
|
+
Drizzle/libSQL persistence with checked-in migrations, pino logging,
|
|
128
|
+
devtools, and a shadcn UI shell. Pass --api for an API-only scaffold
|
|
129
|
+
without the UI shell.
|
|
127
130
|
|
|
128
131
|
Available integrations: ${integrationChoices.join(", ")}
|
|
129
132
|
|
|
@@ -138,11 +141,11 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
|
|
|
138
141
|
default: "next",
|
|
139
142
|
brief: "Template to use.",
|
|
140
143
|
},
|
|
141
|
-
|
|
142
|
-
kind: "
|
|
143
|
-
values: presetChoices,
|
|
144
|
+
api: {
|
|
145
|
+
kind: "boolean",
|
|
144
146
|
optional: true,
|
|
145
|
-
|
|
147
|
+
withNegated: false,
|
|
148
|
+
brief: "Scaffold an API-only app without the UI shell.",
|
|
146
149
|
},
|
|
147
150
|
packageManager: {
|
|
148
151
|
kind: "enum",
|
|
@@ -150,13 +153,6 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
|
|
|
150
153
|
optional: true,
|
|
151
154
|
brief: "Package manager to use in next-step commands.",
|
|
152
155
|
},
|
|
153
|
-
features: {
|
|
154
|
-
kind: "enum",
|
|
155
|
-
values: featureChoices,
|
|
156
|
-
optional: true,
|
|
157
|
-
variadic: ",",
|
|
158
|
-
brief: "Add starter features as a comma-separated list.",
|
|
159
|
-
},
|
|
160
156
|
integrations: {
|
|
161
157
|
kind: "enum",
|
|
162
158
|
values: integrationChoices,
|
|
@@ -192,8 +188,7 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
|
|
|
192
188
|
return async function runCreate(flags, directory) {
|
|
193
189
|
let selections = {
|
|
194
190
|
directory,
|
|
195
|
-
|
|
196
|
-
features: flags.features,
|
|
191
|
+
api: flags.api,
|
|
197
192
|
integrations: flags.integrations,
|
|
198
193
|
packageManager: flags.packageManager,
|
|
199
194
|
};
|
|
@@ -213,12 +208,12 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
|
|
|
213
208
|
if (selections.directory === undefined) {
|
|
214
209
|
throw new Error("Project directory is required. Pass beignet create <directory>, or run beignet create in an interactive terminal.");
|
|
215
210
|
}
|
|
211
|
+
const api = selections.api ?? false;
|
|
216
212
|
const integrations = uniqueValues([...(selections.integrations ?? [])]);
|
|
217
213
|
const result = await createProject({
|
|
218
214
|
name: selections.directory,
|
|
219
215
|
template: flags.template,
|
|
220
|
-
|
|
221
|
-
features: uniqueValues([...(selections.features ?? [])]),
|
|
216
|
+
api,
|
|
222
217
|
packageManager: selections.packageManager,
|
|
223
218
|
integrations,
|
|
224
219
|
force: Boolean(flags.force),
|
|
@@ -226,7 +221,7 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
|
|
|
226
221
|
});
|
|
227
222
|
writeOutput(this, flags.json
|
|
228
223
|
? JSON.stringify(result, null, 2)
|
|
229
|
-
: nextSteps(result, { integrations }));
|
|
224
|
+
: nextSteps(result, { api, integrations }));
|
|
230
225
|
};
|
|
231
226
|
},
|
|
232
227
|
});
|
|
@@ -672,7 +667,7 @@ const makeScheduleCommand = buildCommand({
|
|
|
672
667
|
});
|
|
673
668
|
writeOutput(this, flags.json
|
|
674
669
|
? JSON.stringify(result, null, 2)
|
|
675
|
-
: makeScheduleNextSteps(result));
|
|
670
|
+
: makeScheduleNextSteps(result, { route: Boolean(flags.route) }));
|
|
676
671
|
};
|
|
677
672
|
},
|
|
678
673
|
});
|
|
@@ -788,34 +783,26 @@ ${plannedFiles}`;
|
|
|
788
783
|
const pm = result.packageManager;
|
|
789
784
|
const run = pm === "npm" ? "npm run" : `${pm} run`;
|
|
790
785
|
const cli = packageRunnerFromPackageManager(pm);
|
|
791
|
-
const envFileStep = result.files.includes(".env.example")
|
|
792
|
-
? " cp .env.example .env.local\n"
|
|
793
|
-
: "";
|
|
794
786
|
const envRequiredIntegrations = options.integrations?.filter(isEnvRequiredProviderIntegration) ?? [];
|
|
795
787
|
const envStep = envRequiredIntegrations.length > 0
|
|
796
788
|
? " Fill .env.local for selected provider integrations before starting the app.\n"
|
|
797
789
|
: "";
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
Prepare the database:
|
|
802
|
-
${cli} db generate
|
|
803
|
-
${cli} db migrate
|
|
804
|
-
`
|
|
805
|
-
: "";
|
|
806
|
-
const featureDatabaseSteps = hasDatabase
|
|
807
|
-
? `
|
|
808
|
-
${cli} db generate
|
|
809
|
-
${cli} db migrate`
|
|
810
|
-
: "";
|
|
790
|
+
const openStep = options.api
|
|
791
|
+
? " open http://localhost:3000 for the API landing page"
|
|
792
|
+
: " open http://localhost:3000/sign-up";
|
|
811
793
|
return `Created ${result.name} at ${result.targetDir}
|
|
812
794
|
|
|
813
795
|
Next steps:
|
|
814
796
|
cd ${result.targetDir}
|
|
815
797
|
${pm} install
|
|
816
|
-
|
|
798
|
+
cp .env.example .env.local
|
|
799
|
+
${envStep}
|
|
800
|
+
Prepare the database:
|
|
801
|
+
${cli} db migrate
|
|
802
|
+
|
|
817
803
|
Start the app:
|
|
818
804
|
${run} dev
|
|
805
|
+
${openStep}
|
|
819
806
|
|
|
820
807
|
Inspect the app:
|
|
821
808
|
${cli} routes
|
|
@@ -823,7 +810,9 @@ Inspect the app:
|
|
|
823
810
|
${cli} doctor
|
|
824
811
|
|
|
825
812
|
Generate a feature:
|
|
826
|
-
${cli} make feature projects
|
|
813
|
+
${cli} make feature projects
|
|
814
|
+
${cli} db generate
|
|
815
|
+
${cli} db migrate
|
|
827
816
|
${run} test
|
|
828
817
|
${run} typecheck
|
|
829
818
|
${cli} lint
|
|
@@ -967,10 +956,14 @@ function makeListenerNextSteps(result) {
|
|
|
967
956
|
"Register the listener collection from infrastructure startup.",
|
|
968
957
|
]);
|
|
969
958
|
}
|
|
970
|
-
function makeScheduleNextSteps(result) {
|
|
959
|
+
function makeScheduleNextSteps(result, options = {}) {
|
|
971
960
|
return makeNextSteps(result, "schedule", [
|
|
972
961
|
"Replace the starter payload and handler with the scheduled workflow.",
|
|
973
|
-
|
|
962
|
+
...(options.route
|
|
963
|
+
? [
|
|
964
|
+
"Set CRON_SECRET in your deployment and configure a scheduled request with Authorization: Bearer $CRON_SECRET.",
|
|
965
|
+
]
|
|
966
|
+
: ["Trigger it from a cron route, worker, or provider adapter."]),
|
|
974
967
|
]);
|
|
975
968
|
}
|
|
976
969
|
function makeUploadNextSteps(result) {
|