@batijs/cli 0.0.653 → 0.0.654
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/dist/{asset-package.json-Si0Lg6sw.js → asset-package.json-B9hqkASo.js} +1 -1
- package/dist/{asset-package.json-Cr9kL--9.js → asset-package.json-BTRRukgq.js} +1 -1
- package/dist/{asset-package.json-CK8Focys.js → asset-package.json-D0F4ITHn.js} +1 -1
- package/dist/{asset-package.json-DP7v-FYq.js → asset-package.json-DbnTcIM5.js} +1 -1
- package/dist/boilerplates/@batijs/auth0/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/authjs/bati.config.mjs +16 -2
- package/dist/boilerplates/@batijs/aws/bati.config.mjs +13 -1
- package/dist/boilerplates/@batijs/better-auth/bati.config.mjs +17 -2
- package/dist/boilerplates/@batijs/biome/bati.config.mjs +16 -2
- package/dist/boilerplates/@batijs/cloudflare/bati.config.mjs +15 -1
- package/dist/boilerplates/@batijs/compiled/bati.config.mjs +13 -1
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/compiled/files/asset-package.json.mjs +1 -1
- package/dist/boilerplates/@batijs/d1/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/d1-kysely/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/d1-sqlite/bati.config.mjs +18 -4
- package/dist/boilerplates/@batijs/docker-compose/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/dokploy/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/drizzle/bati.config.mjs +17 -1
- package/dist/boilerplates/@batijs/edgeone/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/elysia/bati.config.mjs +15 -2
- package/dist/boilerplates/@batijs/elysia/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/elysia/files/asset-package.json.mjs +1 -1
- package/dist/boilerplates/@batijs/eslint/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/express/bati.config.mjs +15 -2
- package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/files/asset-package.json.mjs +1 -1
- package/dist/boilerplates/@batijs/fastify/bati.config.mjs +15 -2
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/fastify/files/asset-package.json.mjs +1 -1
- package/dist/boilerplates/@batijs/google-analytics/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/hono/bati.config.mjs +15 -2
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/hono/files/asset-package.json.mjs +1 -1
- package/dist/boilerplates/@batijs/kysely/bati.config.mjs +16 -2
- package/dist/boilerplates/@batijs/mantine/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/netlify/bati.config.mjs +18 -4
- package/dist/boilerplates/@batijs/oxlint/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/plausible.io/bati.config.mjs +18 -4
- package/dist/boilerplates/@batijs/pnpm/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/postgres/bati.config.mjs +13 -1
- package/dist/boilerplates/@batijs/prettier/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/prisma/bati.config.mjs +20 -2
- package/dist/boilerplates/@batijs/react/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/react-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/react-sentry/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/sentry/bati.config.mjs +14 -1
- package/dist/boilerplates/@batijs/shadcn-ui/bati.config.mjs +19 -4
- package/dist/boilerplates/@batijs/shared/bati.config.mjs +94 -1
- package/dist/boilerplates/@batijs/shared-agents/bati.config.mjs +17 -0
- package/dist/boilerplates/@batijs/shared-agents/hooks/after.mjs +15 -0
- package/dist/boilerplates/@batijs/shared-agents/hooks/asset-boilerplates/shared-agents/agents-md.mjs +70 -0
- package/dist/boilerplates/@batijs/shared-agents/hooks/asset-boilerplates/shared-agents/compose.mjs +44 -0
- package/dist/boilerplates/@batijs/shared-agents/hooks/asset-packages/features/dist/features-CStxEDu3.mjs +690 -0
- package/dist/boilerplates/@batijs/shared-agents/hooks/asset-packages/features/dist/index.mjs +160 -0
- package/dist/boilerplates/@batijs/shared-db/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-env/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-server/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-todo/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/solid/bati.config.mjs +18 -4
- package/dist/boilerplates/@batijs/solid-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/solid-sentry/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/sqlite/bati.config.mjs +13 -1
- package/dist/boilerplates/@batijs/storybook/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/tailwindcss/bati.config.mjs +27 -2
- package/dist/boilerplates/@batijs/telefunc/bati.config.mjs +20 -4
- package/dist/boilerplates/@batijs/trpc/bati.config.mjs +19 -4
- package/dist/boilerplates/@batijs/ts-rest/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/universal-deploy/bati.config.mjs +21 -4
- package/dist/boilerplates/@batijs/vercel/bati.config.mjs +13 -1
- package/dist/boilerplates/@batijs/vue/bati.config.mjs +14 -2
- package/dist/boilerplates/@batijs/vue-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/vue-sentry/bati.config.mjs +1 -1
- package/dist/boilerplates/boilerplates.json +6 -0
- package/dist/index.js +6 -2
- package/package.json +5 -5
- package/dist/{asset-package.json-uf2g2h8M.js → asset-package.json-C5reKTg3.js} +1 -1
|
@@ -29,7 +29,7 @@ var package_default = {
|
|
|
29
29
|
"@trpc/server": "^11.17.0",
|
|
30
30
|
"@types/express": "^5.0.6",
|
|
31
31
|
"@types/node": "^20.19.37",
|
|
32
|
-
"@vikejs/fastify": "^0.2.
|
|
32
|
+
"@vikejs/fastify": "^0.2.5",
|
|
33
33
|
"fastify": "^5.8.5",
|
|
34
34
|
"fastify-raw-body": "^5.0.0",
|
|
35
35
|
"telefunc": "^0.2.20",
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -11,7 +11,21 @@ var bati_config_default = t({
|
|
|
11
11
|
if(meta) {
|
|
12
12
|
return meta.BATI.has("authjs") || meta.BATI.has("auth0");
|
|
13
13
|
},
|
|
14
|
-
knip: { entry: ["server/authjs-handler.ts"] }
|
|
14
|
+
knip: { entry: ["server/authjs-handler.ts"] },
|
|
15
|
+
skills(meta) {
|
|
16
|
+
return [{
|
|
17
|
+
name: "auth",
|
|
18
|
+
description: "How authentication works in this app (Auth.js). Use when reading the session, protecting a route, or configuring providers.",
|
|
19
|
+
body: `Auth.js. Config + providers live in \`server/authjs-handler.ts\` (\`authjsConfig.providers\`, base path \`/api/auth\`); \`authjsSessionMiddleware\` populates \`pageContext.session\`.
|
|
20
|
+
|
|
21
|
+
- **Read the session:** \`pageContext.session\` (an Auth.js \`Session | null\`; the user is \`session.user\`).
|
|
22
|
+
- **Protect a route:** add a \`+guard.ts\` beside the page — \`if (!pageContext.session) throw redirect("/login")\`.
|
|
23
|
+
- **Add a provider:** add it to the \`providers\` array in \`server/authjs-handler.ts\`${meta.BATI.has("auth0") ? " (the Auth0 provider is already wired; its credentials are in `.env`)" : ""}.
|
|
24
|
+
- **Secret:** replace the placeholder \`secret\` (\`"MY_SECRET"\`) — see https://authjs.dev/reference/core#secret.
|
|
25
|
+
|
|
26
|
+
See https://authjs.dev.`
|
|
27
|
+
}];
|
|
28
|
+
}
|
|
15
29
|
});
|
|
16
30
|
//#endregion
|
|
17
31
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -31,6 +31,18 @@ var bati_config_default = t({
|
|
|
31
31
|
"esbuild",
|
|
32
32
|
"npm-run-all2"
|
|
33
33
|
]
|
|
34
|
+
},
|
|
35
|
+
skills(meta) {
|
|
36
|
+
return [{
|
|
37
|
+
name: "deploy",
|
|
38
|
+
description: "How to deploy this app to AWS Lambda. Use when deploying or configuring the CDK stack.",
|
|
39
|
+
body: `Deploys to AWS Lambda via AWS CDK. The Lambda entry is \`entry_aws_lambda.ts\`; the stack is \`cdk/lib/vike-stack.ts\`.
|
|
40
|
+
|
|
41
|
+
- **Deploy:** \`${meta.BATI.pmRun} deploy:aws\` (builds, then \`cdk deploy --all\`). Ensure AWS credentials are configured.
|
|
42
|
+
- **Env vars:** configure them on the Lambda via the CDK stack; locally they're in \`.env\`.
|
|
43
|
+
|
|
44
|
+
See https://docs.aws.amazon.com/cdk and \`TODO.md\`.`
|
|
45
|
+
}];
|
|
34
46
|
}
|
|
35
47
|
});
|
|
36
48
|
//#endregion
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -42,7 +42,22 @@ var bati_config_default = t({
|
|
|
42
42
|
step: `Configure Better Auth (secret, GitHub OAuth, migrations). Check ${bold("TODO.md")} for details`
|
|
43
43
|
}];
|
|
44
44
|
},
|
|
45
|
-
knip: { entry: ["server/better-auth-handler.ts", "database/better-auth/migrate.ts"] }
|
|
45
|
+
knip: { entry: ["server/better-auth-handler.ts", "database/better-auth/migrate.ts"] },
|
|
46
|
+
skills(meta) {
|
|
47
|
+
const run = meta.BATI.pmRun;
|
|
48
|
+
return [{
|
|
49
|
+
name: "auth",
|
|
50
|
+
description: "How authentication works in this app (Better Auth). Use when reading the signed-in user, protecting a route, or configuring providers.",
|
|
51
|
+
body: `Better Auth. Server config + providers live in \`server/better-auth.ts\`; the route and session middleware are in \`server/better-auth-handler.ts\` (the middleware populates \`pageContext.user\`). Login/signup/account pages and the \`AuthNav\` component are framework-specific (under \`pages/\` and \`components/\`).
|
|
52
|
+
|
|
53
|
+
- **Read the user:** \`pageContext.user\` (on the server and during client-side navigation).
|
|
54
|
+
- **Protect a route:** add a \`+guard.ts\` beside the page — \`if (!pageContext.user) throw redirect("/login")\` (see \`pages/account/+guard.ts\`).
|
|
55
|
+
- **Add a provider:** configure it in \`server/better-auth.ts\`; OAuth credentials go in \`.env\`.
|
|
56
|
+
- **Tables:** Better Auth owns its user/session tables — ${meta.BATI.has("drizzle") ? "they're created by Drizzle's migrate flow" : meta.BATI.hasD1 ? "they're applied via a wrangler D1 migration" : `run \`${run} better-auth:migrate\` to create them`}.
|
|
57
|
+
|
|
58
|
+
See https://better-auth.com/docs.`
|
|
59
|
+
}];
|
|
60
|
+
}
|
|
46
61
|
});
|
|
47
62
|
//#endregion
|
|
48
63
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -11,7 +11,21 @@ var bati_config_default = t({
|
|
|
11
11
|
if(meta) {
|
|
12
12
|
return meta.BATI.has("biome");
|
|
13
13
|
},
|
|
14
|
-
knip: { ignoreDependencies: ["@biomejs/biome"] }
|
|
14
|
+
knip: { ignoreDependencies: ["@biomejs/biome"] },
|
|
15
|
+
skills(meta) {
|
|
16
|
+
const run = meta.BATI.pmRun;
|
|
17
|
+
return [{
|
|
18
|
+
name: "biome",
|
|
19
|
+
description: "How linting and formatting work in this app (Biome). Use when running lint/format or adjusting rules.",
|
|
20
|
+
body: `Biome handles both linting and formatting (config in \`biome.json\`).
|
|
21
|
+
|
|
22
|
+
- **Lint:** \`${run} lint\` (\`biome lint --write .\`).
|
|
23
|
+
- **Format:** \`${run} format\` (\`biome format --write .\`).
|
|
24
|
+
- **Rules:** edit \`biome.json\`.
|
|
25
|
+
|
|
26
|
+
See https://biomejs.dev.`
|
|
27
|
+
}];
|
|
28
|
+
}
|
|
15
29
|
});
|
|
16
30
|
//#endregion
|
|
17
31
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -25,6 +25,20 @@ var bati_config_default = t({
|
|
|
25
25
|
"cloudflare",
|
|
26
26
|
"@cloudflare/vite-plugin"
|
|
27
27
|
]
|
|
28
|
+
},
|
|
29
|
+
skills(meta) {
|
|
30
|
+
const run = meta.BATI.pmRun;
|
|
31
|
+
return [{
|
|
32
|
+
name: "deploy",
|
|
33
|
+
description: "How to deploy this app to Cloudflare. Use when deploying, configuring bindings, or managing secrets.",
|
|
34
|
+
body: `Deploys to Cloudflare Workers via Wrangler. The worker entry is \`cloudflare-entry.ts\`; config is \`wrangler.jsonc\`.
|
|
35
|
+
|
|
36
|
+
- **Deploy:** \`${run} deploy\` (runs \`vike build && wrangler deploy\`).
|
|
37
|
+
- **Types:** \`${run} generate-types\` after changing bindings.
|
|
38
|
+
- **Secrets:** \`wrangler secret put <NAME>\` for production; non-secret vars live in \`wrangler.jsonc\` (\`vars\`).${meta.BATI.hasD1 ? " D1 is bound as `DB`; apply migrations with `wrangler d1 migrations apply`." : ""}
|
|
39
|
+
|
|
40
|
+
See https://developers.cloudflare.com/workers and \`TODO.md\`.`
|
|
41
|
+
}];
|
|
28
42
|
}
|
|
29
43
|
});
|
|
30
44
|
//#endregion
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -19,6 +19,18 @@ var bati_config_default = t({
|
|
|
19
19
|
"vite-plugin-compiled-react"
|
|
20
20
|
],
|
|
21
21
|
vite: false
|
|
22
|
+
},
|
|
23
|
+
skills() {
|
|
24
|
+
return [{
|
|
25
|
+
name: "styling",
|
|
26
|
+
description: "How styling works in this app (Compiled CSS-in-JS). Use when styling a component.",
|
|
27
|
+
body: `This app uses Compiled (\`@compiled/react\`) for CSS-in-JS; styles are extracted at build time by the Vite plugin (already configured).
|
|
28
|
+
|
|
29
|
+
- **Style components:** pass a \`css={{ ... }}\` prop with an object of CSS properties, e.g. \`<div css={{ fontWeight: "700", fontSize: "1.875rem" }} />\`.
|
|
30
|
+
- Styles are colocated with components; there is no global utility framework.
|
|
31
|
+
|
|
32
|
+
See https://compiledcssinjs.com.`
|
|
33
|
+
}];
|
|
22
34
|
}
|
|
23
35
|
});
|
|
24
36
|
//#endregion
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { loadPackageJson } from "@batijs/core";
|
|
4
4
|
//#region ../../boilerplates/compiled/dist/files/$package.json.mjs
|
|
5
5
|
async function getPackageJson(props) {
|
|
6
|
-
return (await loadPackageJson(props, await import("../../../../asset-package.json-
|
|
6
|
+
return (await loadPackageJson(props, await import("../../../../asset-package.json-C5reKTg3.js").then((x) => x.default))).addDevDependencies(["vite-plugin-compiled-react"]).addDependencies(["@compiled/react"]);
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
export { getPackageJson as default };
|
|
@@ -13,9 +13,9 @@ var package_default = {
|
|
|
13
13
|
author: "",
|
|
14
14
|
license: "MIT",
|
|
15
15
|
devDependencies: {
|
|
16
|
-
"@compiled/react": "^0.21.3",
|
|
17
16
|
"@batijs/compile": "workspace:*",
|
|
18
17
|
"@batijs/core": "workspace:*",
|
|
18
|
+
"@compiled/react": "^0.21.3",
|
|
19
19
|
"@types/node": "^20.19.37",
|
|
20
20
|
"vite": "^8.0.16",
|
|
21
21
|
"vite-plugin-compiled-react": "^1.3.1"
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -3,12 +3,26 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
10
|
-
var bati_config_default = t({
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var bati_config_default = t({
|
|
11
|
+
if(meta) {
|
|
12
|
+
return meta.BATI.hasD1 && !meta.BATI.hasOrm;
|
|
13
|
+
},
|
|
14
|
+
skills(meta) {
|
|
15
|
+
return [{
|
|
16
|
+
name: "database",
|
|
17
|
+
description: "How to work with the database in this app (raw Cloudflare D1 / SQLite, no ORM). Use when querying, adding a table, or migrating.",
|
|
18
|
+
body: `Raw Cloudflare D1 (SQLite) with no ORM. Queries are in \`database/d1/queries/\`; SQL migrations in \`database/migrations/\`. The D1 binding is \`DB\`, available on the server as \`context.db\` (a \`D1Database\`).
|
|
19
|
+
|
|
20
|
+
- **Add a table:** add a \`.sql\` migration to \`database/migrations/\`, then apply it with \`${meta.BATI.pmRun} d1:migrate\` (locally) or \`wrangler d1 migrations apply <name>\`.
|
|
21
|
+
- **Write queries:** add functions in \`database/d1/queries/\` using D1's prepared-statement API, e.g. \`db.prepare("SELECT * FROM todos").all()\` or \`db.prepare("INSERT INTO todos (text) VALUES (?)").bind(text).run()\`.
|
|
22
|
+
|
|
23
|
+
See https://developers.cloudflare.com/d1.`
|
|
24
|
+
}];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
13
27
|
//#endregion
|
|
14
28
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -11,7 +11,19 @@ var bati_config_default = t({
|
|
|
11
11
|
if(meta) {
|
|
12
12
|
return meta.BATI.has("docker");
|
|
13
13
|
},
|
|
14
|
-
enforce: "post"
|
|
14
|
+
enforce: "post",
|
|
15
|
+
skills() {
|
|
16
|
+
return [{
|
|
17
|
+
name: "deploy",
|
|
18
|
+
description: "How to build and run this app with Docker. Use when containerizing or deploying via Docker.",
|
|
19
|
+
body: `Ships a multi-stage \`Dockerfile\` and \`docker-compose.yml\`.
|
|
20
|
+
|
|
21
|
+
- **Build & run:** \`docker compose up --build\` (or \`docker build\` + \`docker run\`).
|
|
22
|
+
- **Env vars:** set them in \`docker-compose.yml\` / the container environment; don't bake secrets into the image.
|
|
23
|
+
|
|
24
|
+
See https://docs.docker.com and \`TODO.md\`.`
|
|
25
|
+
}];
|
|
26
|
+
}
|
|
15
27
|
});
|
|
16
28
|
//#endregion
|
|
17
29
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -17,7 +17,19 @@ var bati_config_default = t({
|
|
|
17
17
|
step: `${bold("dokploy")}: Check ${bold("TODO.md")} for remaining steps.`
|
|
18
18
|
}];
|
|
19
19
|
},
|
|
20
|
-
enforce: "post"
|
|
20
|
+
enforce: "post",
|
|
21
|
+
skills() {
|
|
22
|
+
return [{
|
|
23
|
+
name: "deploy",
|
|
24
|
+
description: "How to deploy this app with Dokploy. Use when deploying to a Dokploy server.",
|
|
25
|
+
body: `Deploys via Dokploy (self-hosted PaaS) using the app's \`Dockerfile\`.
|
|
26
|
+
|
|
27
|
+
- **Deploy:** connect the Git repo in your Dokploy dashboard; Dokploy builds and runs the container.
|
|
28
|
+
- **Env vars:** set them in the Dokploy app's Environment settings.
|
|
29
|
+
|
|
30
|
+
See https://docs.dokploy.com and \`TODO.md\`.`
|
|
31
|
+
}];
|
|
32
|
+
}
|
|
21
33
|
});
|
|
22
34
|
//#endregion
|
|
23
35
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -31,6 +31,22 @@ var bati_config_default = t({
|
|
|
31
31
|
step: `${packageManager} drizzle:migrate`
|
|
32
32
|
}
|
|
33
33
|
];
|
|
34
|
+
},
|
|
35
|
+
skills(meta) {
|
|
36
|
+
const run = meta.BATI.pmRun;
|
|
37
|
+
return [{
|
|
38
|
+
name: "drizzle",
|
|
39
|
+
description: "How to work with the database via Drizzle ORM in this app. Use when adding or changing a table, writing a query, or running a migration.",
|
|
40
|
+
body: `Drizzle ORM on ${meta.BATI.has("postgres") ? "PostgreSQL" : meta.BATI.hasD1 ? "Cloudflare D1 (SQLite)" : "SQLite"}. Schema in \`database/drizzle/schema/\`, queries in \`database/drizzle/queries/\`, connection in \`database/drizzle/db.ts\`, drizzle-kit config in \`drizzle.config.ts\`.
|
|
41
|
+
|
|
42
|
+
- **Add or change a table:** edit the schema in \`database/drizzle/schema/\`.
|
|
43
|
+
- **Generate a migration:** \`${run} drizzle:generate\`.
|
|
44
|
+
- **Apply migrations:** \`${meta.BATI.hasD1 ? "wrangler d1 migrations apply MY_VIKE_DEMO_DATABASE --local" : `${run} drizzle:migrate`}\`.
|
|
45
|
+
- **Write queries:** add functions in \`database/drizzle/queries/\`; on the server the db is available as \`context.db\`.
|
|
46
|
+
- **Inspect data:** \`${run} drizzle:studio\`.
|
|
47
|
+
|
|
48
|
+
See https://orm.drizzle.team.`
|
|
49
|
+
}];
|
|
34
50
|
}
|
|
35
51
|
});
|
|
36
52
|
//#endregion
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -11,7 +11,19 @@ var bati_config_default = t({
|
|
|
11
11
|
if(meta) {
|
|
12
12
|
return meta.BATI.has("edgeone");
|
|
13
13
|
},
|
|
14
|
-
knip: { ignore: [".edgeone/**"] }
|
|
14
|
+
knip: { ignore: [".edgeone/**"] },
|
|
15
|
+
skills(meta) {
|
|
16
|
+
return [{
|
|
17
|
+
name: "deploy",
|
|
18
|
+
description: "How to deploy this app to EdgeOne Pages. Use when deploying or managing environment variables.",
|
|
19
|
+
body: `Deploys to Tencent EdgeOne Pages.
|
|
20
|
+
|
|
21
|
+
- **Deploy:** push to an EdgeOne-connected Git repo (or use the EdgeOne CLI). \`${meta.BATI.pmRun} build\` builds locally.
|
|
22
|
+
- **Env vars:** set them in the EdgeOne Pages dashboard; locally they're in \`.env\`.
|
|
23
|
+
|
|
24
|
+
See https://edgeone.ai/document/pages and \`TODO.md\`.`
|
|
25
|
+
}];
|
|
26
|
+
}
|
|
15
27
|
});
|
|
16
28
|
//#endregion
|
|
17
29
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -11,7 +11,20 @@ var bati_config_default = t({
|
|
|
11
11
|
if(meta) {
|
|
12
12
|
return meta.BATI.has("elysia");
|
|
13
13
|
},
|
|
14
|
-
knip: { entry: ["+server.ts"] }
|
|
14
|
+
knip: { entry: ["+server.ts"] },
|
|
15
|
+
skills() {
|
|
16
|
+
return [{
|
|
17
|
+
name: "server",
|
|
18
|
+
description: "How to add a server route or middleware in this Elysia + Vike app. Use when adding an API endpoint, middleware, or changing server behavior.",
|
|
19
|
+
body: `The server entry is \`+server.ts\` (it exports a Vike \`Server\`). The Elysia \`app\` is built in \`server/elysia.ts\`, where \`vike(app, [...])\` mounts Vike as the catch-all and the array holds Universal Middlewares (db, auth, RPC handlers).
|
|
20
|
+
|
|
21
|
+
- **Add an API route:** register it on the Elysia \`app\` in \`server/elysia.ts\`, e.g. \`app.get("/api/hello", () => ({ ok: true }))\`.
|
|
22
|
+
- **Add middleware:** chain Elysia methods on \`app\`, or push a Universal Middleware handler into the \`vike(app, [...])\` array to share Vike's \`context\`.
|
|
23
|
+
- \`PORT\` is read from the environment.
|
|
24
|
+
|
|
25
|
+
See https://vike.dev/server and https://elysiajs.com.`
|
|
26
|
+
}];
|
|
27
|
+
}
|
|
15
28
|
});
|
|
16
29
|
//#endregion
|
|
17
30
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { loadPackageJson } from "@batijs/core";
|
|
4
4
|
//#region ../../boilerplates/elysia/dist/files/$package.json.mjs
|
|
5
5
|
async function getPackageJson(props) {
|
|
6
|
-
return (await loadPackageJson(props, await import("../../../../asset-package.json-
|
|
6
|
+
return (await loadPackageJson(props, await import("../../../../asset-package.json-D0F4ITHn.js").then((x) => x.default))).addDevDependencies(["@types/node", "vite"]).addDependencies([
|
|
7
7
|
"@vikejs/elysia",
|
|
8
8
|
"elysia",
|
|
9
9
|
"vike"
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -11,7 +11,19 @@ var bati_config_default = t({
|
|
|
11
11
|
if(meta) {
|
|
12
12
|
return meta.BATI.has("eslint");
|
|
13
13
|
},
|
|
14
|
-
knip: { ignoreDependencies: ["eslint"] }
|
|
14
|
+
knip: { ignoreDependencies: ["eslint"] },
|
|
15
|
+
skills(meta) {
|
|
16
|
+
return [{
|
|
17
|
+
name: "eslint",
|
|
18
|
+
description: "How linting works in this app (ESLint). Use when running the linter or adjusting lint rules.",
|
|
19
|
+
body: `ESLint with a flat config in \`eslint.config.ts\`.
|
|
20
|
+
|
|
21
|
+
- **Lint:** \`${meta.BATI.pmRun} lint\` (\`eslint .\`).
|
|
22
|
+
- **Rules:** edit \`eslint.config.ts\`.
|
|
23
|
+
|
|
24
|
+
See https://eslint.org.`
|
|
25
|
+
}];
|
|
26
|
+
}
|
|
15
27
|
});
|
|
16
28
|
//#endregion
|
|
17
29
|
export { bati_config_default as default };
|
|
@@ -3,7 +3,7 @@ function e(e, t) {
|
|
|
3
3
|
if (!e) throw Error(t);
|
|
4
4
|
}
|
|
5
5
|
function t(t) {
|
|
6
|
-
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), t;
|
|
6
|
+
return `enforce` in t && e(t.enforce === `pre` || t.enforce === `post`, `'enforce' must be 'pre' or 'post', was ${t.enforce}`), `if` in t && e(typeof t.if == `function`, `'if' must be a function`), `nextSteps` in t && e(typeof t.nextSteps == `function`, `'nextSteps' must be a function`), `knip` in t && (e(typeof t.knip == `object` && t.knip !== null, `'knip' must be an object`), `entry` in t.knip && e(Array.isArray(t.knip.entry), `'knip.entry' must be an array`), `ignoreDependencies` in t.knip && e(Array.isArray(t.knip.ignoreDependencies), `'knip.ignoreDependencies' must be an array`), `ignore` in t.knip && e(Array.isArray(t.knip.ignore), `'knip.ignore' must be an array`), `vite` in t.knip && e(typeof t.knip.vite == `boolean`, `'knip.vite' must be a boolean`)), `env` in t && e(typeof t.env == `function`, `'env' must be a function of meta`), `deploy` in t && e(Array.isArray(t.deploy) || typeof t.deploy == `function`, `'deploy' must be an array or a function of meta`), `skills` in t && e(typeof t.skills == `function`, `'skills' must be a function of meta`), t;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region bati.config.ts
|
|
@@ -11,7 +11,20 @@ var bati_config_default = t({
|
|
|
11
11
|
if(meta) {
|
|
12
12
|
return meta.BATI.has("express");
|
|
13
13
|
},
|
|
14
|
-
knip: { entry: ["+server.ts"] }
|
|
14
|
+
knip: { entry: ["+server.ts"] },
|
|
15
|
+
skills() {
|
|
16
|
+
return [{
|
|
17
|
+
name: "server",
|
|
18
|
+
description: "How to add a server route or middleware in this Express + Vike app. Use when adding an API endpoint, middleware, or changing server behavior.",
|
|
19
|
+
body: `The server entry is \`+server.ts\`, which builds an Express \`app\` and mounts Vike with \`vike(app, [...])\` (the array holds Universal Middlewares: db, auth, RPC handlers).
|
|
20
|
+
|
|
21
|
+
- **Add an API route:** register it on the Express \`app\` before the \`vike(app, …)\` call, e.g. \`app.get("/api/hello", (req, res) => res.json({ ok: true }))\`.
|
|
22
|
+
- **Add middleware:** use \`app.use(...)\`, or push a Universal Middleware handler into the \`vike(app, [...])\` array to share Vike's \`context\`.
|
|
23
|
+
- \`PORT\` is read from the environment.
|
|
24
|
+
|
|
25
|
+
See https://vike.dev/server and https://expressjs.com.`
|
|
26
|
+
}];
|
|
27
|
+
}
|
|
15
28
|
});
|
|
16
29
|
//#endregion
|
|
17
30
|
export { bati_config_default as default };
|