create-better-t-stack 3.7.3-canary.7cbb05fc → 3.7.3-canary.8e4d5716
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/package.json +19 -23
- package/src/cli.ts +3 -0
- package/src/constants.ts +188 -0
- package/src/helpers/addons/addons-setup.ts +226 -0
- package/src/helpers/addons/examples-setup.ts +104 -0
- package/src/helpers/addons/fumadocs-setup.ts +103 -0
- package/src/helpers/addons/ruler-setup.ts +139 -0
- package/src/helpers/addons/starlight-setup.ts +51 -0
- package/src/helpers/addons/tauri-setup.ts +96 -0
- package/src/helpers/addons/ultracite-setup.ts +232 -0
- package/src/helpers/addons/vite-pwa-setup.ts +59 -0
- package/src/helpers/core/add-addons.ts +85 -0
- package/src/helpers/core/add-deployment.ts +102 -0
- package/src/helpers/core/api-setup.ts +280 -0
- package/src/helpers/core/auth-setup.ts +203 -0
- package/src/helpers/core/backend-setup.ts +73 -0
- package/src/helpers/core/command-handlers.ts +354 -0
- package/src/helpers/core/convex-codegen.ts +14 -0
- package/src/helpers/core/create-project.ts +133 -0
- package/src/helpers/core/create-readme.ts +687 -0
- package/src/helpers/core/db-setup.ts +184 -0
- package/src/helpers/core/detect-project-config.ts +41 -0
- package/src/helpers/core/env-setup.ts +449 -0
- package/src/helpers/core/git.ts +31 -0
- package/src/helpers/core/install-dependencies.ts +32 -0
- package/src/helpers/core/payments-setup.ts +48 -0
- package/src/helpers/core/post-installation.ts +383 -0
- package/src/helpers/core/project-config.ts +246 -0
- package/src/helpers/core/runtime-setup.ts +76 -0
- package/src/helpers/core/template-manager.ts +917 -0
- package/src/helpers/core/workspace-setup.ts +184 -0
- package/src/helpers/database-providers/d1-setup.ts +28 -0
- package/src/helpers/database-providers/docker-compose-setup.ts +50 -0
- package/src/helpers/database-providers/mongodb-atlas-setup.ts +186 -0
- package/src/helpers/database-providers/neon-setup.ts +243 -0
- package/src/helpers/database-providers/planetscale-setup.ts +78 -0
- package/src/helpers/database-providers/prisma-postgres-setup.ts +196 -0
- package/src/helpers/database-providers/supabase-setup.ts +218 -0
- package/src/helpers/database-providers/turso-setup.ts +309 -0
- package/src/helpers/deployment/alchemy/alchemy-combined-setup.ts +80 -0
- package/src/helpers/deployment/alchemy/alchemy-next-setup.ts +51 -0
- package/src/helpers/deployment/alchemy/alchemy-nuxt-setup.ts +104 -0
- package/src/helpers/deployment/alchemy/alchemy-react-router-setup.ts +32 -0
- package/src/helpers/deployment/alchemy/alchemy-solid-setup.ts +32 -0
- package/src/helpers/deployment/alchemy/alchemy-svelte-setup.ts +98 -0
- package/src/helpers/deployment/alchemy/alchemy-tanstack-router-setup.ts +33 -0
- package/src/helpers/deployment/alchemy/alchemy-tanstack-start-setup.ts +98 -0
- package/src/helpers/deployment/alchemy/env-dts-setup.ts +76 -0
- package/src/helpers/deployment/alchemy/index.ts +7 -0
- package/src/helpers/deployment/server-deploy-setup.ts +55 -0
- package/src/helpers/deployment/web-deploy-setup.ts +58 -0
- package/src/index.ts +253 -0
- package/src/prompts/addons.ts +178 -0
- package/src/prompts/api.ts +49 -0
- package/src/prompts/auth.ts +84 -0
- package/src/prompts/backend.ts +83 -0
- package/src/prompts/config-prompts.ts +138 -0
- package/src/prompts/database-setup.ts +112 -0
- package/src/prompts/database.ts +57 -0
- package/src/prompts/examples.ts +64 -0
- package/src/prompts/frontend.ts +118 -0
- package/src/prompts/git.ts +16 -0
- package/src/prompts/install.ts +16 -0
- package/src/prompts/orm.ts +53 -0
- package/src/prompts/package-manager.ts +32 -0
- package/src/prompts/payments.ts +50 -0
- package/src/prompts/project-name.ts +86 -0
- package/src/prompts/runtime.ts +47 -0
- package/src/prompts/server-deploy.ts +91 -0
- package/src/prompts/web-deploy.ts +107 -0
- package/src/types.ts +2 -0
- package/src/utils/add-package-deps.ts +57 -0
- package/src/utils/analytics.ts +39 -0
- package/src/utils/better-auth-plugin-setup.ts +71 -0
- package/src/utils/biome-formatter.ts +82 -0
- package/src/utils/bts-config.ts +122 -0
- package/src/utils/command-exists.ts +16 -0
- package/src/utils/compatibility-rules.ts +319 -0
- package/src/utils/compatibility.ts +11 -0
- package/src/utils/config-processing.ts +130 -0
- package/src/utils/config-validation.ts +470 -0
- package/src/utils/display-config.ts +96 -0
- package/src/utils/docker-utils.ts +70 -0
- package/src/utils/errors.ts +32 -0
- package/src/utils/generate-reproducible-command.ts +53 -0
- package/src/utils/get-latest-cli-version.ts +11 -0
- package/src/utils/get-package-manager.ts +13 -0
- package/src/utils/open-url.ts +25 -0
- package/src/utils/package-runner.ts +23 -0
- package/src/utils/project-directory.ts +102 -0
- package/src/utils/project-name-validation.ts +43 -0
- package/src/utils/render-title.ts +48 -0
- package/src/utils/setup-catalogs.ts +192 -0
- package/src/utils/sponsors.ts +101 -0
- package/src/utils/telemetry.ts +19 -0
- package/src/utils/template-processor.ts +64 -0
- package/src/utils/templates.ts +94 -0
- package/src/utils/ts-morph.ts +26 -0
- package/src/validation.ts +117 -0
- package/dist/cli.d.mts +0 -1
- package/dist/cli.mjs +0 -8
- package/dist/index.d.mts +0 -347
- package/dist/index.mjs +0 -4
- package/dist/src-CxVxLS85.mjs +0 -7077
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import consola from "consola";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import handlebars from "handlebars";
|
|
5
|
+
import type { ProjectConfig } from "../types";
|
|
6
|
+
import { formatFileWithBiome } from "./biome-formatter";
|
|
7
|
+
|
|
8
|
+
const BINARY_EXTENSIONS = new Set([".png", ".ico", ".svg"]);
|
|
9
|
+
|
|
10
|
+
function isBinaryFile(filePath: string): boolean {
|
|
11
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
12
|
+
return BINARY_EXTENSIONS.has(ext);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function processTemplate(srcPath: string, destPath: string, context: ProjectConfig) {
|
|
16
|
+
try {
|
|
17
|
+
await fs.ensureDir(path.dirname(destPath));
|
|
18
|
+
|
|
19
|
+
if (isBinaryFile(srcPath) && !srcPath.endsWith(".hbs")) {
|
|
20
|
+
await fs.copy(srcPath, destPath);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let content: string;
|
|
25
|
+
|
|
26
|
+
if (srcPath.endsWith(".hbs")) {
|
|
27
|
+
const templateContent = await fs.readFile(srcPath, "utf-8");
|
|
28
|
+
const template = handlebars.compile(templateContent);
|
|
29
|
+
content = template(context);
|
|
30
|
+
} else {
|
|
31
|
+
content = await fs.readFile(srcPath, "utf-8");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const formattedContent = await formatFileWithBiome(destPath, content);
|
|
36
|
+
if (formattedContent) {
|
|
37
|
+
content = formattedContent;
|
|
38
|
+
}
|
|
39
|
+
} catch (formatError) {
|
|
40
|
+
consola.debug(`Failed to format ${destPath}:`, formatError);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
await fs.writeFile(destPath, content);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
consola.error(`Error processing template ${srcPath}:`, error);
|
|
46
|
+
throw new Error(`Failed to process template ${srcPath}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
handlebars.registerHelper("eq", (a, b) => a === b);
|
|
51
|
+
handlebars.registerHelper("ne", (a, b) => a !== b);
|
|
52
|
+
handlebars.registerHelper("and", (...args) => {
|
|
53
|
+
const values = args.slice(0, -1);
|
|
54
|
+
return values.every((value) => value);
|
|
55
|
+
});
|
|
56
|
+
handlebars.registerHelper("or", (...args) => {
|
|
57
|
+
const values = args.slice(0, -1);
|
|
58
|
+
return values.some((value) => value);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
handlebars.registerHelper(
|
|
62
|
+
"includes",
|
|
63
|
+
(array, value) => Array.isArray(array) && array.includes(value),
|
|
64
|
+
);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { CreateInput, Template } from "../types";
|
|
2
|
+
|
|
3
|
+
export const TEMPLATE_PRESETS: Record<Template, CreateInput | null> = {
|
|
4
|
+
mern: {
|
|
5
|
+
database: "mongodb",
|
|
6
|
+
orm: "mongoose",
|
|
7
|
+
backend: "express",
|
|
8
|
+
runtime: "node",
|
|
9
|
+
frontend: ["react-router"],
|
|
10
|
+
api: "orpc",
|
|
11
|
+
auth: "better-auth",
|
|
12
|
+
payments: "none",
|
|
13
|
+
addons: ["turborepo"],
|
|
14
|
+
examples: ["todo"],
|
|
15
|
+
dbSetup: "mongodb-atlas",
|
|
16
|
+
webDeploy: "none",
|
|
17
|
+
serverDeploy: "none",
|
|
18
|
+
},
|
|
19
|
+
pern: {
|
|
20
|
+
database: "postgres",
|
|
21
|
+
orm: "drizzle",
|
|
22
|
+
backend: "express",
|
|
23
|
+
runtime: "node",
|
|
24
|
+
frontend: ["tanstack-router"],
|
|
25
|
+
api: "trpc",
|
|
26
|
+
auth: "better-auth",
|
|
27
|
+
payments: "none",
|
|
28
|
+
addons: ["turborepo"],
|
|
29
|
+
examples: ["todo"],
|
|
30
|
+
dbSetup: "none",
|
|
31
|
+
webDeploy: "none",
|
|
32
|
+
serverDeploy: "none",
|
|
33
|
+
},
|
|
34
|
+
t3: {
|
|
35
|
+
database: "postgres",
|
|
36
|
+
orm: "prisma",
|
|
37
|
+
backend: "self",
|
|
38
|
+
runtime: "none",
|
|
39
|
+
frontend: ["next"],
|
|
40
|
+
api: "trpc",
|
|
41
|
+
auth: "better-auth",
|
|
42
|
+
payments: "none",
|
|
43
|
+
addons: ["biome", "turborepo"],
|
|
44
|
+
examples: ["none"],
|
|
45
|
+
dbSetup: "none",
|
|
46
|
+
webDeploy: "none",
|
|
47
|
+
serverDeploy: "none",
|
|
48
|
+
},
|
|
49
|
+
uniwind: {
|
|
50
|
+
database: "none",
|
|
51
|
+
orm: "none",
|
|
52
|
+
backend: "none",
|
|
53
|
+
runtime: "none",
|
|
54
|
+
frontend: ["native-uniwind"],
|
|
55
|
+
api: "none",
|
|
56
|
+
auth: "none",
|
|
57
|
+
payments: "none",
|
|
58
|
+
addons: ["none"],
|
|
59
|
+
examples: ["none"],
|
|
60
|
+
dbSetup: "none",
|
|
61
|
+
webDeploy: "none",
|
|
62
|
+
serverDeploy: "none",
|
|
63
|
+
},
|
|
64
|
+
none: null,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export function getTemplateConfig(template: Template) {
|
|
68
|
+
if (template === "none" || !template) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const config = TEMPLATE_PRESETS[template];
|
|
73
|
+
if (!config) {
|
|
74
|
+
throw new Error(`Unknown template: ${template}`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return config;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function getTemplateDescription(template: Template) {
|
|
81
|
+
const descriptions: Record<Template, string> = {
|
|
82
|
+
mern: "MongoDB + Express + React + Node.js - Classic MERN stack",
|
|
83
|
+
pern: "PostgreSQL + Express + React + Node.js - Popular PERN stack",
|
|
84
|
+
t3: "T3 Stack - Next.js + tRPC + Prisma + PostgreSQL + Better Auth",
|
|
85
|
+
uniwind: "Expo + Uniwind native app with no backend services",
|
|
86
|
+
none: "No template - Full customization",
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return descriptions[template] || "";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function listAvailableTemplates() {
|
|
93
|
+
return Object.keys(TEMPLATE_PRESETS).filter((t) => t !== "none") as Template[];
|
|
94
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ArrayLiteralExpression,
|
|
3
|
+
IndentationText,
|
|
4
|
+
type ObjectLiteralExpression,
|
|
5
|
+
Project,
|
|
6
|
+
QuoteKind,
|
|
7
|
+
SyntaxKind,
|
|
8
|
+
} from "ts-morph";
|
|
9
|
+
|
|
10
|
+
export const tsProject = new Project({
|
|
11
|
+
useInMemoryFileSystem: false,
|
|
12
|
+
skipAddingFilesFromTsConfig: true,
|
|
13
|
+
manipulationSettings: {
|
|
14
|
+
quoteKind: QuoteKind.Single,
|
|
15
|
+
indentationText: IndentationText.TwoSpaces,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export function ensureArrayProperty(obj: ObjectLiteralExpression, name: string) {
|
|
20
|
+
return (obj.getProperty(name)?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression) ??
|
|
21
|
+
obj
|
|
22
|
+
.addPropertyAssignment({ name, initializer: "[]" })
|
|
23
|
+
.getFirstDescendantByKindOrThrow(
|
|
24
|
+
SyntaxKind.ArrayLiteralExpression,
|
|
25
|
+
)) as ArrayLiteralExpression;
|
|
26
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { CLIInput, ProjectConfig } from "./types";
|
|
2
|
+
import { getProvidedFlags, processFlags, validateArrayOptions } from "./utils/config-processing";
|
|
3
|
+
import { validateConfigForProgrammaticUse, validateFullConfig } from "./utils/config-validation";
|
|
4
|
+
import { exitWithError } from "./utils/errors";
|
|
5
|
+
import { extractAndValidateProjectName } from "./utils/project-name-validation";
|
|
6
|
+
|
|
7
|
+
const CORE_STACK_FLAGS = new Set([
|
|
8
|
+
"database",
|
|
9
|
+
"orm",
|
|
10
|
+
"backend",
|
|
11
|
+
"runtime",
|
|
12
|
+
"frontend",
|
|
13
|
+
"addons",
|
|
14
|
+
"examples",
|
|
15
|
+
"auth",
|
|
16
|
+
"dbSetup",
|
|
17
|
+
"payments",
|
|
18
|
+
"api",
|
|
19
|
+
"webDeploy",
|
|
20
|
+
"serverDeploy",
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
function validateYesFlagCombination(options: CLIInput, providedFlags: Set<string>) {
|
|
24
|
+
if (!options.yes) return;
|
|
25
|
+
|
|
26
|
+
if (options.template && options.template !== "none") {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const coreStackFlagsProvided = Array.from(providedFlags).filter((flag) =>
|
|
31
|
+
CORE_STACK_FLAGS.has(flag),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
if (coreStackFlagsProvided.length > 0) {
|
|
35
|
+
exitWithError(
|
|
36
|
+
`Cannot combine --yes with core stack configuration flags: ${coreStackFlagsProvided.map((f) => `--${f}`).join(", ")}. ` +
|
|
37
|
+
"The --yes flag uses default configuration. Remove these flags or use --yes without them.",
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function processAndValidateFlags(
|
|
43
|
+
options: CLIInput,
|
|
44
|
+
providedFlags: Set<string>,
|
|
45
|
+
projectName?: string,
|
|
46
|
+
) {
|
|
47
|
+
if (options.yolo) {
|
|
48
|
+
const cfg = processFlags(options, projectName);
|
|
49
|
+
const validatedProjectName = extractAndValidateProjectName(
|
|
50
|
+
projectName,
|
|
51
|
+
options.projectDirectory,
|
|
52
|
+
true,
|
|
53
|
+
);
|
|
54
|
+
if (validatedProjectName) {
|
|
55
|
+
cfg.projectName = validatedProjectName;
|
|
56
|
+
}
|
|
57
|
+
return cfg;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
validateYesFlagCombination(options, providedFlags);
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
validateArrayOptions(options);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
exitWithError(error instanceof Error ? error.message : String(error));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const config = processFlags(options, projectName);
|
|
69
|
+
|
|
70
|
+
const validatedProjectName = extractAndValidateProjectName(
|
|
71
|
+
projectName,
|
|
72
|
+
options.projectDirectory,
|
|
73
|
+
false,
|
|
74
|
+
);
|
|
75
|
+
if (validatedProjectName) {
|
|
76
|
+
config.projectName = validatedProjectName;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
validateFullConfig(config, providedFlags, options);
|
|
80
|
+
|
|
81
|
+
return config;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function processProvidedFlagsWithoutValidation(options: CLIInput, projectName?: string) {
|
|
85
|
+
if (!options.yolo) {
|
|
86
|
+
const providedFlags = getProvidedFlags(options);
|
|
87
|
+
validateYesFlagCombination(options, providedFlags);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const config = processFlags(options, projectName);
|
|
91
|
+
|
|
92
|
+
const validatedProjectName = extractAndValidateProjectName(
|
|
93
|
+
projectName,
|
|
94
|
+
options.projectDirectory,
|
|
95
|
+
true,
|
|
96
|
+
);
|
|
97
|
+
if (validatedProjectName) {
|
|
98
|
+
config.projectName = validatedProjectName;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return config;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function validateConfigCompatibility(
|
|
105
|
+
config: Partial<ProjectConfig>,
|
|
106
|
+
providedFlags?: Set<string>,
|
|
107
|
+
options?: CLIInput,
|
|
108
|
+
) {
|
|
109
|
+
if (options?.yolo) return;
|
|
110
|
+
if (options && providedFlags) {
|
|
111
|
+
validateFullConfig(config, providedFlags, options);
|
|
112
|
+
} else {
|
|
113
|
+
validateConfigForProgrammaticUse(config);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export { getProvidedFlags };
|
package/dist/cli.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/cli.mjs
DELETED
package/dist/index.d.mts
DELETED
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import * as _orpc_server0 from "@orpc/server";
|
|
3
|
-
import * as trpc_cli0 from "trpc-cli";
|
|
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
|
-
|
|
7
|
-
//#region src/index.d.ts
|
|
8
|
-
declare const router: {
|
|
9
|
-
init: _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
|
-
template: z.ZodOptional<z.ZodEnum<{
|
|
11
|
-
none: "none";
|
|
12
|
-
mern: "mern";
|
|
13
|
-
pern: "pern";
|
|
14
|
-
t3: "t3";
|
|
15
|
-
uniwind: "uniwind";
|
|
16
|
-
}>>;
|
|
17
|
-
yes: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
18
|
-
yolo: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
19
|
-
verbose: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
20
|
-
database: z.ZodOptional<z.ZodEnum<{
|
|
21
|
-
none: "none";
|
|
22
|
-
sqlite: "sqlite";
|
|
23
|
-
postgres: "postgres";
|
|
24
|
-
mysql: "mysql";
|
|
25
|
-
mongodb: "mongodb";
|
|
26
|
-
}>>;
|
|
27
|
-
orm: z.ZodOptional<z.ZodEnum<{
|
|
28
|
-
none: "none";
|
|
29
|
-
drizzle: "drizzle";
|
|
30
|
-
prisma: "prisma";
|
|
31
|
-
mongoose: "mongoose";
|
|
32
|
-
}>>;
|
|
33
|
-
auth: z.ZodOptional<z.ZodEnum<{
|
|
34
|
-
none: "none";
|
|
35
|
-
"better-auth": "better-auth";
|
|
36
|
-
clerk: "clerk";
|
|
37
|
-
}>>;
|
|
38
|
-
payments: z.ZodOptional<z.ZodEnum<{
|
|
39
|
-
none: "none";
|
|
40
|
-
polar: "polar";
|
|
41
|
-
}>>;
|
|
42
|
-
frontend: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
43
|
-
none: "none";
|
|
44
|
-
"tanstack-router": "tanstack-router";
|
|
45
|
-
"react-router": "react-router";
|
|
46
|
-
"tanstack-start": "tanstack-start";
|
|
47
|
-
next: "next";
|
|
48
|
-
nuxt: "nuxt";
|
|
49
|
-
"native-bare": "native-bare";
|
|
50
|
-
"native-uniwind": "native-uniwind";
|
|
51
|
-
"native-unistyles": "native-unistyles";
|
|
52
|
-
svelte: "svelte";
|
|
53
|
-
solid: "solid";
|
|
54
|
-
}>>>;
|
|
55
|
-
addons: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
56
|
-
none: "none";
|
|
57
|
-
pwa: "pwa";
|
|
58
|
-
tauri: "tauri";
|
|
59
|
-
starlight: "starlight";
|
|
60
|
-
biome: "biome";
|
|
61
|
-
husky: "husky";
|
|
62
|
-
ruler: "ruler";
|
|
63
|
-
turborepo: "turborepo";
|
|
64
|
-
fumadocs: "fumadocs";
|
|
65
|
-
ultracite: "ultracite";
|
|
66
|
-
oxlint: "oxlint";
|
|
67
|
-
}>>>;
|
|
68
|
-
examples: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
69
|
-
none: "none";
|
|
70
|
-
todo: "todo";
|
|
71
|
-
ai: "ai";
|
|
72
|
-
}>>>;
|
|
73
|
-
git: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
-
packageManager: z.ZodOptional<z.ZodEnum<{
|
|
75
|
-
bun: "bun";
|
|
76
|
-
npm: "npm";
|
|
77
|
-
pnpm: "pnpm";
|
|
78
|
-
}>>;
|
|
79
|
-
install: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
-
dbSetup: z.ZodOptional<z.ZodEnum<{
|
|
81
|
-
none: "none";
|
|
82
|
-
turso: "turso";
|
|
83
|
-
neon: "neon";
|
|
84
|
-
"prisma-postgres": "prisma-postgres";
|
|
85
|
-
planetscale: "planetscale";
|
|
86
|
-
"mongodb-atlas": "mongodb-atlas";
|
|
87
|
-
supabase: "supabase";
|
|
88
|
-
d1: "d1";
|
|
89
|
-
docker: "docker";
|
|
90
|
-
}>>;
|
|
91
|
-
backend: z.ZodOptional<z.ZodEnum<{
|
|
92
|
-
none: "none";
|
|
93
|
-
hono: "hono";
|
|
94
|
-
express: "express";
|
|
95
|
-
fastify: "fastify";
|
|
96
|
-
elysia: "elysia";
|
|
97
|
-
convex: "convex";
|
|
98
|
-
self: "self";
|
|
99
|
-
}>>;
|
|
100
|
-
runtime: z.ZodOptional<z.ZodEnum<{
|
|
101
|
-
none: "none";
|
|
102
|
-
bun: "bun";
|
|
103
|
-
node: "node";
|
|
104
|
-
workers: "workers";
|
|
105
|
-
}>>;
|
|
106
|
-
api: z.ZodOptional<z.ZodEnum<{
|
|
107
|
-
none: "none";
|
|
108
|
-
trpc: "trpc";
|
|
109
|
-
orpc: "orpc";
|
|
110
|
-
}>>;
|
|
111
|
-
webDeploy: z.ZodOptional<z.ZodEnum<{
|
|
112
|
-
none: "none";
|
|
113
|
-
alchemy: "alchemy";
|
|
114
|
-
}>>;
|
|
115
|
-
serverDeploy: z.ZodOptional<z.ZodEnum<{
|
|
116
|
-
none: "none";
|
|
117
|
-
alchemy: "alchemy";
|
|
118
|
-
}>>;
|
|
119
|
-
directoryConflict: z.ZodOptional<z.ZodEnum<{
|
|
120
|
-
merge: "merge";
|
|
121
|
-
overwrite: "overwrite";
|
|
122
|
-
increment: "increment";
|
|
123
|
-
error: "error";
|
|
124
|
-
}>>;
|
|
125
|
-
renderTitle: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
-
disableAnalytics: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
127
|
-
manualDb: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
128
|
-
}, z.core.$strip>], null>, _orpc_server0.Schema<{
|
|
129
|
-
success: boolean;
|
|
130
|
-
projectConfig: {
|
|
131
|
-
projectName: string;
|
|
132
|
-
projectDir: string;
|
|
133
|
-
relativePath: string;
|
|
134
|
-
database: "none";
|
|
135
|
-
orm: "none";
|
|
136
|
-
backend: "none";
|
|
137
|
-
runtime: "none";
|
|
138
|
-
frontend: never[];
|
|
139
|
-
addons: never[];
|
|
140
|
-
examples: never[];
|
|
141
|
-
auth: "none";
|
|
142
|
-
payments: "none";
|
|
143
|
-
git: false;
|
|
144
|
-
packageManager: "npm";
|
|
145
|
-
install: false;
|
|
146
|
-
dbSetup: "none";
|
|
147
|
-
api: "none";
|
|
148
|
-
webDeploy: "none";
|
|
149
|
-
serverDeploy: "none";
|
|
150
|
-
};
|
|
151
|
-
reproducibleCommand: string;
|
|
152
|
-
timeScaffolded: string;
|
|
153
|
-
elapsedTimeMs: number;
|
|
154
|
-
projectDirectory: string;
|
|
155
|
-
relativePath: string;
|
|
156
|
-
error: string;
|
|
157
|
-
} | {
|
|
158
|
-
success: boolean;
|
|
159
|
-
projectConfig: {
|
|
160
|
-
projectName: string;
|
|
161
|
-
projectDir: string;
|
|
162
|
-
relativePath: string;
|
|
163
|
-
database: "none" | "sqlite" | "postgres" | "mysql" | "mongodb";
|
|
164
|
-
orm: "none" | "drizzle" | "prisma" | "mongoose";
|
|
165
|
-
backend: "none" | "hono" | "express" | "fastify" | "elysia" | "convex" | "self";
|
|
166
|
-
runtime: "none" | "bun" | "node" | "workers";
|
|
167
|
-
frontend: ("none" | "tanstack-router" | "react-router" | "tanstack-start" | "next" | "nuxt" | "native-bare" | "native-uniwind" | "native-unistyles" | "svelte" | "solid")[];
|
|
168
|
-
addons: ("none" | "pwa" | "tauri" | "starlight" | "biome" | "husky" | "ruler" | "turborepo" | "fumadocs" | "ultracite" | "oxlint")[];
|
|
169
|
-
examples: ("none" | "todo" | "ai")[];
|
|
170
|
-
auth: "none" | "better-auth" | "clerk";
|
|
171
|
-
payments: "none" | "polar";
|
|
172
|
-
git: boolean;
|
|
173
|
-
packageManager: "bun" | "npm" | "pnpm";
|
|
174
|
-
install: boolean;
|
|
175
|
-
dbSetup: "none" | "turso" | "neon" | "prisma-postgres" | "planetscale" | "mongodb-atlas" | "supabase" | "d1" | "docker";
|
|
176
|
-
api: "none" | "trpc" | "orpc";
|
|
177
|
-
webDeploy: "none" | "alchemy";
|
|
178
|
-
serverDeploy: "none" | "alchemy";
|
|
179
|
-
};
|
|
180
|
-
reproducibleCommand: string;
|
|
181
|
-
timeScaffolded: string;
|
|
182
|
-
elapsedTimeMs: number;
|
|
183
|
-
projectDirectory: string;
|
|
184
|
-
relativePath: string;
|
|
185
|
-
error?: undefined;
|
|
186
|
-
} | undefined, {
|
|
187
|
-
success: boolean;
|
|
188
|
-
projectConfig: {
|
|
189
|
-
projectName: string;
|
|
190
|
-
projectDir: string;
|
|
191
|
-
relativePath: string;
|
|
192
|
-
database: "none";
|
|
193
|
-
orm: "none";
|
|
194
|
-
backend: "none";
|
|
195
|
-
runtime: "none";
|
|
196
|
-
frontend: never[];
|
|
197
|
-
addons: never[];
|
|
198
|
-
examples: never[];
|
|
199
|
-
auth: "none";
|
|
200
|
-
payments: "none";
|
|
201
|
-
git: false;
|
|
202
|
-
packageManager: "npm";
|
|
203
|
-
install: false;
|
|
204
|
-
dbSetup: "none";
|
|
205
|
-
api: "none";
|
|
206
|
-
webDeploy: "none";
|
|
207
|
-
serverDeploy: "none";
|
|
208
|
-
};
|
|
209
|
-
reproducibleCommand: string;
|
|
210
|
-
timeScaffolded: string;
|
|
211
|
-
elapsedTimeMs: number;
|
|
212
|
-
projectDirectory: string;
|
|
213
|
-
relativePath: string;
|
|
214
|
-
error: string;
|
|
215
|
-
} | {
|
|
216
|
-
success: boolean;
|
|
217
|
-
projectConfig: {
|
|
218
|
-
projectName: string;
|
|
219
|
-
projectDir: string;
|
|
220
|
-
relativePath: string;
|
|
221
|
-
database: "none" | "sqlite" | "postgres" | "mysql" | "mongodb";
|
|
222
|
-
orm: "none" | "drizzle" | "prisma" | "mongoose";
|
|
223
|
-
backend: "none" | "hono" | "express" | "fastify" | "elysia" | "convex" | "self";
|
|
224
|
-
runtime: "none" | "bun" | "node" | "workers";
|
|
225
|
-
frontend: ("none" | "tanstack-router" | "react-router" | "tanstack-start" | "next" | "nuxt" | "native-bare" | "native-uniwind" | "native-unistyles" | "svelte" | "solid")[];
|
|
226
|
-
addons: ("none" | "pwa" | "tauri" | "starlight" | "biome" | "husky" | "ruler" | "turborepo" | "fumadocs" | "ultracite" | "oxlint")[];
|
|
227
|
-
examples: ("none" | "todo" | "ai")[];
|
|
228
|
-
auth: "none" | "better-auth" | "clerk";
|
|
229
|
-
payments: "none" | "polar";
|
|
230
|
-
git: boolean;
|
|
231
|
-
packageManager: "bun" | "npm" | "pnpm";
|
|
232
|
-
install: boolean;
|
|
233
|
-
dbSetup: "none" | "turso" | "neon" | "prisma-postgres" | "planetscale" | "mongodb-atlas" | "supabase" | "d1" | "docker";
|
|
234
|
-
api: "none" | "trpc" | "orpc";
|
|
235
|
-
webDeploy: "none" | "alchemy";
|
|
236
|
-
serverDeploy: "none" | "alchemy";
|
|
237
|
-
};
|
|
238
|
-
reproducibleCommand: string;
|
|
239
|
-
timeScaffolded: string;
|
|
240
|
-
elapsedTimeMs: number;
|
|
241
|
-
projectDirectory: string;
|
|
242
|
-
relativePath: string;
|
|
243
|
-
error?: undefined;
|
|
244
|
-
} | undefined>, _orpc_server0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
245
|
-
add: _orpc_server0.Procedure<_orpc_server0.MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>, z.ZodTuple<[z.ZodObject<{
|
|
246
|
-
addons: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
247
|
-
none: "none";
|
|
248
|
-
pwa: "pwa";
|
|
249
|
-
tauri: "tauri";
|
|
250
|
-
starlight: "starlight";
|
|
251
|
-
biome: "biome";
|
|
252
|
-
husky: "husky";
|
|
253
|
-
ruler: "ruler";
|
|
254
|
-
turborepo: "turborepo";
|
|
255
|
-
fumadocs: "fumadocs";
|
|
256
|
-
ultracite: "ultracite";
|
|
257
|
-
oxlint: "oxlint";
|
|
258
|
-
}>>>>;
|
|
259
|
-
webDeploy: z.ZodOptional<z.ZodEnum<{
|
|
260
|
-
none: "none";
|
|
261
|
-
alchemy: "alchemy";
|
|
262
|
-
}>>;
|
|
263
|
-
serverDeploy: z.ZodOptional<z.ZodEnum<{
|
|
264
|
-
none: "none";
|
|
265
|
-
alchemy: "alchemy";
|
|
266
|
-
}>>;
|
|
267
|
-
projectDir: z.ZodOptional<z.ZodString>;
|
|
268
|
-
install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
269
|
-
packageManager: z.ZodOptional<z.ZodEnum<{
|
|
270
|
-
bun: "bun";
|
|
271
|
-
npm: "npm";
|
|
272
|
-
pnpm: "pnpm";
|
|
273
|
-
}>>;
|
|
274
|
-
}, z.core.$strip>], null>, _orpc_server0.Schema<void, void>, _orpc_server0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
275
|
-
sponsors: _orpc_server0.Procedure<_orpc_server0.MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>, _orpc_server0.Schema<unknown, unknown>, _orpc_server0.Schema<void, void>, _orpc_server0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
276
|
-
docs: _orpc_server0.Procedure<_orpc_server0.MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>, _orpc_server0.Schema<unknown, unknown>, _orpc_server0.Schema<void, void>, _orpc_server0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
277
|
-
builder: _orpc_server0.Procedure<_orpc_server0.MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>, _orpc_server0.Schema<unknown, unknown>, _orpc_server0.Schema<void, void>, _orpc_server0.MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
|
|
278
|
-
};
|
|
279
|
-
declare function createBtsCli(): trpc_cli0.TrpcCli;
|
|
280
|
-
/**
|
|
281
|
-
* Initialize a new Better-T-Stack project
|
|
282
|
-
*
|
|
283
|
-
* @example CLI usage:
|
|
284
|
-
* ```bash
|
|
285
|
-
* npx create-better-t-stack my-app --yes
|
|
286
|
-
* ```
|
|
287
|
-
*
|
|
288
|
-
* @example Programmatic usage (always returns structured data):
|
|
289
|
-
* ```typescript
|
|
290
|
-
* import { init } from "create-better-t-stack";
|
|
291
|
-
*
|
|
292
|
-
* const result = await init("my-app", {
|
|
293
|
-
* yes: true,
|
|
294
|
-
* frontend: ["tanstack-router"],
|
|
295
|
-
* backend: "hono",
|
|
296
|
-
* database: "sqlite",
|
|
297
|
-
* orm: "drizzle",
|
|
298
|
-
* auth: "better-auth",
|
|
299
|
-
* addons: ["biome", "turborepo"],
|
|
300
|
-
* packageManager: "bun",
|
|
301
|
-
* install: false,
|
|
302
|
-
* directoryConflict: "increment", // auto-handle conflicts
|
|
303
|
-
* disableAnalytics: true, // disable analytics
|
|
304
|
-
* });
|
|
305
|
-
*
|
|
306
|
-
* if (result.success) {
|
|
307
|
-
* console.log(`Project created at: ${result.projectDirectory}`);
|
|
308
|
-
* console.log(`Reproducible command: ${result.reproducibleCommand}`);
|
|
309
|
-
* console.log(`Time taken: ${result.elapsedTimeMs}ms`);
|
|
310
|
-
* }
|
|
311
|
-
* ```
|
|
312
|
-
*/
|
|
313
|
-
declare function init(projectName?: string, options?: CreateInput): Promise<{
|
|
314
|
-
success: boolean;
|
|
315
|
-
projectConfig: {
|
|
316
|
-
projectName: string;
|
|
317
|
-
projectDir: string;
|
|
318
|
-
relativePath: string;
|
|
319
|
-
database: "none" | "sqlite" | "postgres" | "mysql" | "mongodb";
|
|
320
|
-
orm: "none" | "drizzle" | "prisma" | "mongoose";
|
|
321
|
-
backend: "none" | "hono" | "express" | "fastify" | "elysia" | "convex" | "self";
|
|
322
|
-
runtime: "none" | "bun" | "node" | "workers";
|
|
323
|
-
frontend: ("none" | "tanstack-router" | "react-router" | "tanstack-start" | "next" | "nuxt" | "native-bare" | "native-uniwind" | "native-unistyles" | "svelte" | "solid")[];
|
|
324
|
-
addons: ("none" | "pwa" | "tauri" | "starlight" | "biome" | "husky" | "ruler" | "turborepo" | "fumadocs" | "ultracite" | "oxlint")[];
|
|
325
|
-
examples: ("none" | "todo" | "ai")[];
|
|
326
|
-
auth: "none" | "better-auth" | "clerk";
|
|
327
|
-
payments: "none" | "polar";
|
|
328
|
-
git: boolean;
|
|
329
|
-
packageManager: "bun" | "npm" | "pnpm";
|
|
330
|
-
install: boolean;
|
|
331
|
-
dbSetup: "none" | "turso" | "neon" | "prisma-postgres" | "planetscale" | "mongodb-atlas" | "supabase" | "d1" | "docker";
|
|
332
|
-
api: "none" | "trpc" | "orpc";
|
|
333
|
-
webDeploy: "none" | "alchemy";
|
|
334
|
-
serverDeploy: "none" | "alchemy";
|
|
335
|
-
};
|
|
336
|
-
reproducibleCommand: string;
|
|
337
|
-
timeScaffolded: string;
|
|
338
|
-
elapsedTimeMs: number;
|
|
339
|
-
projectDirectory: string;
|
|
340
|
-
relativePath: string;
|
|
341
|
-
error?: string | undefined;
|
|
342
|
-
}>;
|
|
343
|
-
declare function sponsors(): Promise<void>;
|
|
344
|
-
declare function docs(): Promise<void>;
|
|
345
|
-
declare function builder(): Promise<void>;
|
|
346
|
-
//#endregion
|
|
347
|
-
export { type API, type AddInput, type Addons, type Backend, type BetterTStackConfig, type CreateInput, type Database, type DatabaseSetup, type DirectoryConflict, type Examples, type Frontend, type InitResult, type ORM, type PackageManager, type ProjectConfig, type Runtime, type ServerDeploy, type Template, type WebDeploy, builder, createBtsCli, docs, init, router, sponsors };
|
package/dist/index.mjs
DELETED