create-better-t-stack 3.11.1 → 3.12.1
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/chunk-Dt3mZKp0.mjs +24 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +40 -60
- package/dist/index.mjs +2 -2
- package/dist/{src-Dc2OdxbP.mjs → src-D3EHRs6z.mjs} +645 -610
- package/package.json +2 -2
- package/templates/addons/turborepo/turbo.json.hbs +8 -0
- package/templates/api/orpc/native/utils/orpc.ts.hbs +21 -20
- package/templates/api/orpc/web/nuxt/app/plugins/orpc.ts.hbs +3 -5
- package/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs +73 -67
- package/templates/api/orpc/web/solid/src/utils/orpc.ts.hbs +15 -14
- package/templates/api/trpc/native/utils/trpc.ts.hbs +8 -7
- package/templates/api/trpc/web/react/base/src/utils/trpc.ts.hbs +59 -57
- package/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs +10 -9
- package/templates/auth/better-auth/convex/web/react/next/src/lib/auth-server.ts.hbs +10 -9
- package/templates/auth/better-auth/convex/web/react/tanstack-router/src/lib/auth-client.ts.hbs +5 -4
- package/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs +8 -7
- package/templates/auth/better-auth/native/base/lib/auth-client.ts.hbs +9 -8
- package/templates/auth/better-auth/server/base/src/index.ts.hbs +239 -235
- package/templates/auth/better-auth/web/nuxt/app/plugins/auth-client.ts.hbs +2 -3
- package/templates/auth/better-auth/web/react/base/src/lib/auth-client.ts.hbs +9 -11
- package/templates/auth/better-auth/web/solid/src/lib/auth-client.ts.hbs +3 -2
- package/templates/backend/server/elysia/src/index.ts.hbs +71 -71
- package/templates/backend/server/express/src/index.ts.hbs +57 -57
- package/templates/backend/server/fastify/src/index.ts.hbs +107 -107
- package/templates/backend/server/hono/src/index.ts.hbs +75 -85
- package/templates/base/tsconfig.json.hbs +3 -0
- package/templates/db/drizzle/mysql/src/index.ts.hbs +23 -30
- package/templates/db/drizzle/postgres/src/index.ts.hbs +6 -13
- package/templates/db/drizzle/sqlite/src/index.ts.hbs +11 -18
- package/templates/db/mongoose/mongodb/src/index.ts.hbs +3 -2
- package/templates/db/prisma/mongodb/prisma/schema/schema.prisma.hbs +1 -1
- package/templates/db/prisma/mysql/prisma/schema/schema.prisma.hbs +1 -1
- package/templates/db/prisma/mysql/prisma.config.ts.hbs +16 -16
- package/templates/db/prisma/mysql/src/index.ts.hbs +16 -15
- package/templates/db/prisma/postgres/prisma/schema/schema.prisma.hbs +1 -1
- package/templates/db/prisma/postgres/src/index.ts.hbs +10 -9
- package/templates/db/prisma/sqlite/prisma/schema/schema.prisma.hbs +1 -1
- package/templates/db/prisma/sqlite/src/index.ts.hbs +4 -7
- package/templates/examples/ai/native/bare/app/(drawer)/ai.tsx.hbs +2 -1
- package/templates/examples/ai/native/unistyles/app/(drawer)/ai.tsx.hbs +2 -1
- package/templates/examples/ai/native/uniwind/app/(drawer)/ai.tsx.hbs +2 -1
- package/templates/examples/ai/web/nuxt/app/pages/ai.vue.hbs +1 -3
- package/templates/examples/ai/web/react/next/src/app/ai/page.tsx.hbs +4 -3
- package/templates/examples/ai/web/react/react-router/src/routes/ai.tsx.hbs +2 -1
- package/templates/examples/ai/web/react/tanstack-router/src/routes/ai.tsx.hbs +4 -1
- package/templates/examples/ai/web/react/tanstack-start/src/routes/ai.tsx.hbs +4 -1
- package/templates/frontend/native/bare/app/_layout.tsx.hbs +4 -2
- package/templates/frontend/native/unistyles/app/_layout.tsx.hbs +4 -2
- package/templates/frontend/native/uniwind/app/_layout.tsx.hbs +4 -3
- package/templates/frontend/nuxt/nuxt.config.ts.hbs +6 -3
- package/templates/frontend/react/next/next.config.ts.hbs +9 -8
- package/templates/frontend/react/next/package.json.hbs +1 -1
- package/templates/frontend/react/next/src/components/providers.tsx.hbs +4 -1
- package/templates/frontend/react/next/tsconfig.json.hbs +2 -2
- package/templates/frontend/react/react-router/src/root.tsx.hbs +3 -4
- package/templates/frontend/react/tanstack-router/src/main.tsx.hbs +3 -2
- package/templates/frontend/react/tanstack-start/src/router.tsx.hbs +97 -93
- package/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs +23 -3
- package/templates/packages/config/tsconfig.base.json.hbs +1 -1
- package/templates/{deploy/alchemy → packages/env}/env.d.ts.hbs +6 -4
- package/templates/packages/env/package.json.hbs +7 -0
- package/templates/packages/env/src/native.ts.hbs +21 -0
- package/templates/packages/env/src/server.ts.hbs +38 -0
- package/templates/packages/env/src/web.ts.hbs +98 -0
- package/templates/packages/env/tsconfig.json.hbs +3 -0
- package/templates/{deploy/alchemy → packages/infra}/alchemy.run.ts.hbs +84 -80
- package/templates/packages/infra/package.json.hbs +10 -0
- package/templates/payments/polar/server/base/src/lib/payments.ts.hbs +3 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
12
|
+
__defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { __reExport as t };
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
import * as _orpc_server0 from "@orpc/server";
|
|
3
3
|
import * as trpc_cli0 from "trpc-cli";
|
|
4
4
|
import z from "zod";
|
|
5
|
-
import { API, AddInput, Addons, Backend, BetterTStackConfig, CreateInput, Database, DatabaseSetup, DirectoryConflict, Examples, Frontend, InitResult, ORM, PackageManager, ProjectConfig, Runtime, ServerDeploy, Template, WebDeploy } from "@better-t-stack/types";
|
|
6
5
|
|
|
6
|
+
//#region src/types.d.ts
|
|
7
|
+
|
|
8
|
+
import * as import__better_t_stack_types from "@better-t-stack/types";
|
|
9
|
+
//#endregion
|
|
7
10
|
//#region src/index.d.ts
|
|
8
11
|
declare const router: {
|
|
9
|
-
|
|
12
|
+
create: _orpc_server0.Procedure<_orpc_server0.MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>, z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodObject<{
|
|
10
13
|
template: z.ZodOptional<z.ZodEnum<{
|
|
11
14
|
none: "none";
|
|
12
15
|
mern: "mern";
|
|
@@ -112,11 +115,11 @@ declare const router: {
|
|
|
112
115
|
}>>;
|
|
113
116
|
webDeploy: z.ZodOptional<z.ZodEnum<{
|
|
114
117
|
none: "none";
|
|
115
|
-
|
|
118
|
+
cloudflare: "cloudflare";
|
|
116
119
|
}>>;
|
|
117
120
|
serverDeploy: z.ZodOptional<z.ZodEnum<{
|
|
118
121
|
none: "none";
|
|
119
|
-
|
|
122
|
+
cloudflare: "cloudflare";
|
|
120
123
|
}>>;
|
|
121
124
|
directoryConflict: z.ZodOptional<z.ZodEnum<{
|
|
122
125
|
merge: "merge";
|
|
@@ -176,8 +179,8 @@ declare const router: {
|
|
|
176
179
|
install: boolean;
|
|
177
180
|
dbSetup: "none" | "turso" | "neon" | "prisma-postgres" | "planetscale" | "mongodb-atlas" | "supabase" | "d1" | "docker";
|
|
178
181
|
api: "none" | "trpc" | "orpc";
|
|
179
|
-
webDeploy: "none" | "
|
|
180
|
-
serverDeploy: "none" | "
|
|
182
|
+
webDeploy: "none" | "cloudflare";
|
|
183
|
+
serverDeploy: "none" | "cloudflare";
|
|
181
184
|
};
|
|
182
185
|
reproducibleCommand: string;
|
|
183
186
|
timeScaffolded: string;
|
|
@@ -234,8 +237,8 @@ declare const router: {
|
|
|
234
237
|
install: boolean;
|
|
235
238
|
dbSetup: "none" | "turso" | "neon" | "prisma-postgres" | "planetscale" | "mongodb-atlas" | "supabase" | "d1" | "docker";
|
|
236
239
|
api: "none" | "trpc" | "orpc";
|
|
237
|
-
webDeploy: "none" | "
|
|
238
|
-
serverDeploy: "none" | "
|
|
240
|
+
webDeploy: "none" | "cloudflare";
|
|
241
|
+
serverDeploy: "none" | "cloudflare";
|
|
239
242
|
};
|
|
240
243
|
reproducibleCommand: string;
|
|
241
244
|
timeScaffolded: string;
|
|
@@ -262,11 +265,11 @@ declare const router: {
|
|
|
262
265
|
}>>>>;
|
|
263
266
|
webDeploy: z.ZodOptional<z.ZodEnum<{
|
|
264
267
|
none: "none";
|
|
265
|
-
|
|
268
|
+
cloudflare: "cloudflare";
|
|
266
269
|
}>>;
|
|
267
270
|
serverDeploy: z.ZodOptional<z.ZodEnum<{
|
|
268
271
|
none: "none";
|
|
269
|
-
|
|
272
|
+
cloudflare: "cloudflare";
|
|
270
273
|
}>>;
|
|
271
274
|
projectDir: z.ZodOptional<z.ZodString>;
|
|
272
275
|
install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -282,70 +285,47 @@ declare const router: {
|
|
|
282
285
|
};
|
|
283
286
|
declare function createBtsCli(): trpc_cli0.TrpcCli;
|
|
284
287
|
/**
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* @example CLI usage:
|
|
288
|
-
* ```bash
|
|
289
|
-
* npx create-better-t-stack my-app --yes
|
|
290
|
-
* ```
|
|
288
|
+
* Programmatic API to create a new Better-T-Stack project.
|
|
289
|
+
* Returns pure JSON - no console output, no interactive prompts.
|
|
291
290
|
*
|
|
292
|
-
* @example
|
|
291
|
+
* @example
|
|
293
292
|
* ```typescript
|
|
294
|
-
* import {
|
|
293
|
+
* import { create } from "create-better-t-stack";
|
|
295
294
|
*
|
|
296
|
-
* const result = await
|
|
297
|
-
* yes: true,
|
|
295
|
+
* const result = await create("my-app", {
|
|
298
296
|
* frontend: ["tanstack-router"],
|
|
299
297
|
* backend: "hono",
|
|
298
|
+
* runtime: "bun",
|
|
300
299
|
* database: "sqlite",
|
|
301
300
|
* orm: "drizzle",
|
|
302
|
-
* auth: "better-auth",
|
|
303
|
-
* addons: ["biome", "turborepo"],
|
|
304
|
-
* packageManager: "bun",
|
|
305
|
-
* install: false,
|
|
306
|
-
* directoryConflict: "increment", // auto-handle conflicts
|
|
307
|
-
* disableAnalytics: true, // disable analytics
|
|
308
301
|
* });
|
|
309
302
|
*
|
|
310
303
|
* if (result.success) {
|
|
311
304
|
* console.log(`Project created at: ${result.projectDirectory}`);
|
|
312
|
-
* console.log(`Reproducible command: ${result.reproducibleCommand}`);
|
|
313
|
-
* console.log(`Time taken: ${result.elapsedTimeMs}ms`);
|
|
314
305
|
* }
|
|
315
306
|
* ```
|
|
316
307
|
*/
|
|
317
|
-
declare function
|
|
318
|
-
success: boolean;
|
|
319
|
-
projectConfig: {
|
|
320
|
-
projectName: string;
|
|
321
|
-
projectDir: string;
|
|
322
|
-
relativePath: string;
|
|
323
|
-
database: "none" | "sqlite" | "postgres" | "mysql" | "mongodb";
|
|
324
|
-
orm: "none" | "drizzle" | "prisma" | "mongoose";
|
|
325
|
-
backend: "none" | "hono" | "express" | "fastify" | "elysia" | "convex" | "self";
|
|
326
|
-
runtime: "none" | "bun" | "node" | "workers";
|
|
327
|
-
frontend: ("none" | "tanstack-router" | "react-router" | "tanstack-start" | "next" | "nuxt" | "native-bare" | "native-uniwind" | "native-unistyles" | "svelte" | "solid")[];
|
|
328
|
-
addons: ("none" | "pwa" | "tauri" | "starlight" | "biome" | "husky" | "ruler" | "turborepo" | "fumadocs" | "ultracite" | "oxlint" | "opentui" | "wxt")[];
|
|
329
|
-
examples: ("none" | "todo" | "ai")[];
|
|
330
|
-
auth: "none" | "better-auth" | "clerk";
|
|
331
|
-
payments: "none" | "polar";
|
|
332
|
-
git: boolean;
|
|
333
|
-
packageManager: "bun" | "npm" | "pnpm";
|
|
334
|
-
install: boolean;
|
|
335
|
-
dbSetup: "none" | "turso" | "neon" | "prisma-postgres" | "planetscale" | "mongodb-atlas" | "supabase" | "d1" | "docker";
|
|
336
|
-
api: "none" | "trpc" | "orpc";
|
|
337
|
-
webDeploy: "none" | "alchemy";
|
|
338
|
-
serverDeploy: "none" | "alchemy";
|
|
339
|
-
};
|
|
340
|
-
reproducibleCommand: string;
|
|
341
|
-
timeScaffolded: string;
|
|
342
|
-
elapsedTimeMs: number;
|
|
343
|
-
projectDirectory: string;
|
|
344
|
-
relativePath: string;
|
|
345
|
-
error?: string | undefined;
|
|
346
|
-
}>;
|
|
308
|
+
declare function create(projectName?: string, options?: Partial<types_d_exports.CreateInput>): Promise<types_d_exports.InitResult>;
|
|
347
309
|
declare function sponsors(): Promise<void>;
|
|
348
310
|
declare function docs(): Promise<void>;
|
|
349
311
|
declare function builder(): Promise<void>;
|
|
350
|
-
|
|
351
|
-
|
|
312
|
+
type API = import__better_t_stack_types.API;
|
|
313
|
+
type Addons = import__better_t_stack_types.Addons;
|
|
314
|
+
type Auth = import__better_t_stack_types.Auth;
|
|
315
|
+
type Backend = import__better_t_stack_types.Backend;
|
|
316
|
+
type BetterTStackConfig = import__better_t_stack_types.BetterTStackConfig;
|
|
317
|
+
type CreateInput = import__better_t_stack_types.CreateInput;
|
|
318
|
+
type Database = import__better_t_stack_types.Database;
|
|
319
|
+
type DatabaseSetup = import__better_t_stack_types.DatabaseSetup;
|
|
320
|
+
type DirectoryConflict = import__better_t_stack_types.DirectoryConflict;
|
|
321
|
+
type Examples = import__better_t_stack_types.Examples;
|
|
322
|
+
type Frontend = import__better_t_stack_types.Frontend;
|
|
323
|
+
type InitResult = import__better_t_stack_types.InitResult;
|
|
324
|
+
type ORM = import__better_t_stack_types.ORM;
|
|
325
|
+
type PackageManager = import__better_t_stack_types.PackageManager;
|
|
326
|
+
type Payments = import__better_t_stack_types.Payments;
|
|
327
|
+
type Runtime = import__better_t_stack_types.Runtime;
|
|
328
|
+
type ServerDeploy = import__better_t_stack_types.ServerDeploy;
|
|
329
|
+
type Template = import__better_t_stack_types.Template;
|
|
330
|
+
type WebDeploy = import__better_t_stack_types.WebDeploy;
|
|
331
|
+
export { type API, type Addons, type Auth, type Backend, type BetterTStackConfig, type CreateInput, type Database, type DatabaseSetup, type DirectoryConflict, type Examples, type Frontend, type InitResult, type ORM, type PackageManager, type Payments, type Runtime, type ServerDeploy, type Template, type WebDeploy, builder, create, createBtsCli, docs, router, sponsors };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as router, i as
|
|
2
|
+
import { a as router, i as docs, n as create, o as sponsors, r as createBtsCli, t as builder } from "./src-D3EHRs6z.mjs";
|
|
3
3
|
|
|
4
|
-
export { builder, createBtsCli, docs,
|
|
4
|
+
export { builder, create, createBtsCli, docs, router, sponsors };
|