@better-t-stack/types 3.7.3-canary.8e47571f → 3.7.3-canary.98ba1e7a
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 +9 -14
- package/src/index.ts +73 -0
- package/src/json-schema.ts +130 -0
- package/src/schemas.ts +216 -0
- package/src/types.ts +90 -0
- package/dist/index.d.mts +0 -33
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -3
- package/dist/json-schema.d.mts +0 -48
- package/dist/json-schema.d.mts.map +0 -1
- package/dist/json-schema.mjs +0 -92
- package/dist/json-schema.mjs.map +0 -1
- package/dist/schemas-CH5VdN4I.mjs +0 -220
- package/dist/schemas-CH5VdN4I.mjs.map +0 -1
- package/dist/schemas-D8-YlD7-.d.mts +0 -724
- package/dist/schemas-D8-YlD7-.d.mts.map +0 -1
- package/dist/schemas.d.mts +0 -2
- package/dist/schemas.mjs +0 -3
package/dist/json-schema.mjs
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { A as ProjectConfigSchema, C as InitResultSchema, F as ServerDeploySchema, L as TemplateSchema, N as RuntimeSchema, O as PackageManagerSchema, S as FrontendSchema, _ as DatabaseSetupSchema, b as ExamplesSchema, f as CreateInputSchema, g as DatabaseSchema, k as PaymentsSchema, l as BackendSchema, n as APISchema, o as AddonsSchema, s as AuthSchema, u as BetterTStackConfigSchema, v as DirectoryConflictSchema, w as ORMSchema, z as WebDeploySchema } from "./schemas-CH5VdN4I.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/json-schema.ts
|
|
5
|
-
function getDatabaseJsonSchema() {
|
|
6
|
-
return z.toJSONSchema(DatabaseSchema);
|
|
7
|
-
}
|
|
8
|
-
function getORMJsonSchema() {
|
|
9
|
-
return z.toJSONSchema(ORMSchema);
|
|
10
|
-
}
|
|
11
|
-
function getBackendJsonSchema() {
|
|
12
|
-
return z.toJSONSchema(BackendSchema);
|
|
13
|
-
}
|
|
14
|
-
function getRuntimeJsonSchema() {
|
|
15
|
-
return z.toJSONSchema(RuntimeSchema);
|
|
16
|
-
}
|
|
17
|
-
function getFrontendJsonSchema() {
|
|
18
|
-
return z.toJSONSchema(FrontendSchema);
|
|
19
|
-
}
|
|
20
|
-
function getAddonsJsonSchema() {
|
|
21
|
-
return z.toJSONSchema(AddonsSchema);
|
|
22
|
-
}
|
|
23
|
-
function getExamplesJsonSchema() {
|
|
24
|
-
return z.toJSONSchema(ExamplesSchema);
|
|
25
|
-
}
|
|
26
|
-
function getPackageManagerJsonSchema() {
|
|
27
|
-
return z.toJSONSchema(PackageManagerSchema);
|
|
28
|
-
}
|
|
29
|
-
function getDatabaseSetupJsonSchema() {
|
|
30
|
-
return z.toJSONSchema(DatabaseSetupSchema);
|
|
31
|
-
}
|
|
32
|
-
function getAPIJsonSchema() {
|
|
33
|
-
return z.toJSONSchema(APISchema);
|
|
34
|
-
}
|
|
35
|
-
function getAuthJsonSchema() {
|
|
36
|
-
return z.toJSONSchema(AuthSchema);
|
|
37
|
-
}
|
|
38
|
-
function getPaymentsJsonSchema() {
|
|
39
|
-
return z.toJSONSchema(PaymentsSchema);
|
|
40
|
-
}
|
|
41
|
-
function getWebDeployJsonSchema() {
|
|
42
|
-
return z.toJSONSchema(WebDeploySchema);
|
|
43
|
-
}
|
|
44
|
-
function getServerDeployJsonSchema() {
|
|
45
|
-
return z.toJSONSchema(ServerDeploySchema);
|
|
46
|
-
}
|
|
47
|
-
function getDirectoryConflictJsonSchema() {
|
|
48
|
-
return z.toJSONSchema(DirectoryConflictSchema);
|
|
49
|
-
}
|
|
50
|
-
function getTemplateJsonSchema() {
|
|
51
|
-
return z.toJSONSchema(TemplateSchema);
|
|
52
|
-
}
|
|
53
|
-
function getCreateInputJsonSchema() {
|
|
54
|
-
return z.toJSONSchema(CreateInputSchema);
|
|
55
|
-
}
|
|
56
|
-
function getProjectConfigJsonSchema() {
|
|
57
|
-
return z.toJSONSchema(ProjectConfigSchema);
|
|
58
|
-
}
|
|
59
|
-
function getBetterTStackConfigJsonSchema() {
|
|
60
|
-
return z.toJSONSchema(BetterTStackConfigSchema);
|
|
61
|
-
}
|
|
62
|
-
function getInitResultJsonSchema() {
|
|
63
|
-
return z.toJSONSchema(InitResultSchema);
|
|
64
|
-
}
|
|
65
|
-
function getAllJsonSchemas() {
|
|
66
|
-
return {
|
|
67
|
-
database: getDatabaseJsonSchema(),
|
|
68
|
-
orm: getORMJsonSchema(),
|
|
69
|
-
backend: getBackendJsonSchema(),
|
|
70
|
-
runtime: getRuntimeJsonSchema(),
|
|
71
|
-
frontend: getFrontendJsonSchema(),
|
|
72
|
-
addons: getAddonsJsonSchema(),
|
|
73
|
-
examples: getExamplesJsonSchema(),
|
|
74
|
-
packageManager: getPackageManagerJsonSchema(),
|
|
75
|
-
databaseSetup: getDatabaseSetupJsonSchema(),
|
|
76
|
-
api: getAPIJsonSchema(),
|
|
77
|
-
auth: getAuthJsonSchema(),
|
|
78
|
-
payments: getPaymentsJsonSchema(),
|
|
79
|
-
webDeploy: getWebDeployJsonSchema(),
|
|
80
|
-
serverDeploy: getServerDeployJsonSchema(),
|
|
81
|
-
directoryConflict: getDirectoryConflictJsonSchema(),
|
|
82
|
-
template: getTemplateJsonSchema(),
|
|
83
|
-
createInput: getCreateInputJsonSchema(),
|
|
84
|
-
projectConfig: getProjectConfigJsonSchema(),
|
|
85
|
-
betterTStackConfig: getBetterTStackConfigJsonSchema(),
|
|
86
|
-
initResult: getInitResultJsonSchema()
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
export { getAPIJsonSchema, getAddonsJsonSchema, getAllJsonSchemas, getAuthJsonSchema, getBackendJsonSchema, getBetterTStackConfigJsonSchema, getCreateInputJsonSchema, getDatabaseJsonSchema, getDatabaseSetupJsonSchema, getDirectoryConflictJsonSchema, getExamplesJsonSchema, getFrontendJsonSchema, getInitResultJsonSchema, getORMJsonSchema, getPackageManagerJsonSchema, getPaymentsJsonSchema, getProjectConfigJsonSchema, getRuntimeJsonSchema, getServerDeployJsonSchema, getTemplateJsonSchema, getWebDeployJsonSchema };
|
|
92
|
-
//# sourceMappingURL=json-schema.mjs.map
|
package/dist/json-schema.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema.mjs","names":[],"sources":["../src/json-schema.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n DatabaseSchema,\n ORMSchema,\n BackendSchema,\n RuntimeSchema,\n FrontendSchema,\n AddonsSchema,\n ExamplesSchema,\n PackageManagerSchema,\n DatabaseSetupSchema,\n APISchema,\n AuthSchema,\n PaymentsSchema,\n WebDeploySchema,\n ServerDeploySchema,\n DirectoryConflictSchema,\n TemplateSchema,\n CreateInputSchema,\n ProjectConfigSchema,\n BetterTStackConfigSchema,\n InitResultSchema,\n} from \"./schemas\";\n\n// Generate JSON schemas for each type\nexport function getDatabaseJsonSchema() {\n return z.toJSONSchema(DatabaseSchema);\n}\n\nexport function getORMJsonSchema() {\n return z.toJSONSchema(ORMSchema);\n}\n\nexport function getBackendJsonSchema() {\n return z.toJSONSchema(BackendSchema);\n}\n\nexport function getRuntimeJsonSchema() {\n return z.toJSONSchema(RuntimeSchema);\n}\n\nexport function getFrontendJsonSchema() {\n return z.toJSONSchema(FrontendSchema);\n}\n\nexport function getAddonsJsonSchema() {\n return z.toJSONSchema(AddonsSchema);\n}\n\nexport function getExamplesJsonSchema() {\n return z.toJSONSchema(ExamplesSchema);\n}\n\nexport function getPackageManagerJsonSchema() {\n return z.toJSONSchema(PackageManagerSchema);\n}\n\nexport function getDatabaseSetupJsonSchema() {\n return z.toJSONSchema(DatabaseSetupSchema);\n}\n\nexport function getAPIJsonSchema() {\n return z.toJSONSchema(APISchema);\n}\n\nexport function getAuthJsonSchema() {\n return z.toJSONSchema(AuthSchema);\n}\n\nexport function getPaymentsJsonSchema() {\n return z.toJSONSchema(PaymentsSchema);\n}\n\nexport function getWebDeployJsonSchema() {\n return z.toJSONSchema(WebDeploySchema);\n}\n\nexport function getServerDeployJsonSchema() {\n return z.toJSONSchema(ServerDeploySchema);\n}\n\nexport function getDirectoryConflictJsonSchema() {\n return z.toJSONSchema(DirectoryConflictSchema);\n}\n\nexport function getTemplateJsonSchema() {\n return z.toJSONSchema(TemplateSchema);\n}\n\nexport function getCreateInputJsonSchema() {\n return z.toJSONSchema(CreateInputSchema);\n}\n\nexport function getProjectConfigJsonSchema() {\n return z.toJSONSchema(ProjectConfigSchema);\n}\n\nexport function getBetterTStackConfigJsonSchema() {\n return z.toJSONSchema(BetterTStackConfigSchema);\n}\n\nexport function getInitResultJsonSchema() {\n return z.toJSONSchema(InitResultSchema);\n}\n\n// Get all JSON schemas as a single object\nexport function getAllJsonSchemas() {\n return {\n database: getDatabaseJsonSchema(),\n orm: getORMJsonSchema(),\n backend: getBackendJsonSchema(),\n runtime: getRuntimeJsonSchema(),\n frontend: getFrontendJsonSchema(),\n addons: getAddonsJsonSchema(),\n examples: getExamplesJsonSchema(),\n packageManager: getPackageManagerJsonSchema(),\n databaseSetup: getDatabaseSetupJsonSchema(),\n api: getAPIJsonSchema(),\n auth: getAuthJsonSchema(),\n payments: getPaymentsJsonSchema(),\n webDeploy: getWebDeployJsonSchema(),\n serverDeploy: getServerDeployJsonSchema(),\n directoryConflict: getDirectoryConflictJsonSchema(),\n template: getTemplateJsonSchema(),\n createInput: getCreateInputJsonSchema(),\n projectConfig: getProjectConfigJsonSchema(),\n betterTStackConfig: getBetterTStackConfigJsonSchema(),\n initResult: getInitResultJsonSchema(),\n };\n}\n"],"mappings":";;;;AAyBA,SAAgB,wBAAwB;AACtC,QAAO,EAAE,aAAa,eAAe;;AAGvC,SAAgB,mBAAmB;AACjC,QAAO,EAAE,aAAa,UAAU;;AAGlC,SAAgB,uBAAuB;AACrC,QAAO,EAAE,aAAa,cAAc;;AAGtC,SAAgB,uBAAuB;AACrC,QAAO,EAAE,aAAa,cAAc;;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AAmB,gCAAgC;EACnD,UAAU,uBAAuB;EACjC,aAAa,0BAA0B;EACvC,eAAe,4BAA4B;EAC3C,oBAAoB,iCAAiC;EACrD,YAAY,yBAAyB;EACtC"}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region src/schemas.ts
|
|
4
|
-
const DatabaseSchema = z.enum([
|
|
5
|
-
"none",
|
|
6
|
-
"sqlite",
|
|
7
|
-
"postgres",
|
|
8
|
-
"mysql",
|
|
9
|
-
"mongodb"
|
|
10
|
-
]).describe("Database type");
|
|
11
|
-
const ORMSchema = z.enum([
|
|
12
|
-
"drizzle",
|
|
13
|
-
"prisma",
|
|
14
|
-
"mongoose",
|
|
15
|
-
"none"
|
|
16
|
-
]).describe("ORM type");
|
|
17
|
-
const BackendSchema = z.enum([
|
|
18
|
-
"hono",
|
|
19
|
-
"express",
|
|
20
|
-
"fastify",
|
|
21
|
-
"elysia",
|
|
22
|
-
"convex",
|
|
23
|
-
"self",
|
|
24
|
-
"none"
|
|
25
|
-
]).describe("Backend framework");
|
|
26
|
-
const RuntimeSchema = z.enum([
|
|
27
|
-
"bun",
|
|
28
|
-
"node",
|
|
29
|
-
"workers",
|
|
30
|
-
"none"
|
|
31
|
-
]).describe("Runtime environment");
|
|
32
|
-
const FrontendSchema = z.enum([
|
|
33
|
-
"tanstack-router",
|
|
34
|
-
"react-router",
|
|
35
|
-
"tanstack-start",
|
|
36
|
-
"next",
|
|
37
|
-
"nuxt",
|
|
38
|
-
"native-bare",
|
|
39
|
-
"native-uniwind",
|
|
40
|
-
"native-unistyles",
|
|
41
|
-
"svelte",
|
|
42
|
-
"solid",
|
|
43
|
-
"none"
|
|
44
|
-
]).describe("Frontend framework");
|
|
45
|
-
const AddonsSchema = z.enum([
|
|
46
|
-
"pwa",
|
|
47
|
-
"tauri",
|
|
48
|
-
"starlight",
|
|
49
|
-
"biome",
|
|
50
|
-
"husky",
|
|
51
|
-
"ruler",
|
|
52
|
-
"turborepo",
|
|
53
|
-
"fumadocs",
|
|
54
|
-
"ultracite",
|
|
55
|
-
"oxlint",
|
|
56
|
-
"none"
|
|
57
|
-
]).describe("Additional addons");
|
|
58
|
-
const ExamplesSchema = z.enum([
|
|
59
|
-
"todo",
|
|
60
|
-
"ai",
|
|
61
|
-
"none"
|
|
62
|
-
]).describe("Example templates to include");
|
|
63
|
-
const PackageManagerSchema = z.enum([
|
|
64
|
-
"npm",
|
|
65
|
-
"pnpm",
|
|
66
|
-
"bun"
|
|
67
|
-
]).describe("Package manager");
|
|
68
|
-
const DatabaseSetupSchema = z.enum([
|
|
69
|
-
"turso",
|
|
70
|
-
"neon",
|
|
71
|
-
"prisma-postgres",
|
|
72
|
-
"planetscale",
|
|
73
|
-
"mongodb-atlas",
|
|
74
|
-
"supabase",
|
|
75
|
-
"d1",
|
|
76
|
-
"docker",
|
|
77
|
-
"none"
|
|
78
|
-
]).describe("Database hosting setup");
|
|
79
|
-
const APISchema = z.enum([
|
|
80
|
-
"trpc",
|
|
81
|
-
"orpc",
|
|
82
|
-
"none"
|
|
83
|
-
]).describe("API type");
|
|
84
|
-
const AuthSchema = z.enum([
|
|
85
|
-
"better-auth",
|
|
86
|
-
"clerk",
|
|
87
|
-
"none"
|
|
88
|
-
]).describe("Authentication provider");
|
|
89
|
-
const PaymentsSchema = z.enum(["polar", "none"]).describe("Payments provider");
|
|
90
|
-
const WebDeploySchema = z.enum(["alchemy", "none"]).describe("Web deployment");
|
|
91
|
-
const ServerDeploySchema = z.enum(["alchemy", "none"]).describe("Server deployment");
|
|
92
|
-
const DirectoryConflictSchema = z.enum([
|
|
93
|
-
"merge",
|
|
94
|
-
"overwrite",
|
|
95
|
-
"increment",
|
|
96
|
-
"error"
|
|
97
|
-
]).describe("How to handle existing directory conflicts");
|
|
98
|
-
const TemplateSchema = z.enum([
|
|
99
|
-
"mern",
|
|
100
|
-
"pern",
|
|
101
|
-
"t3",
|
|
102
|
-
"uniwind",
|
|
103
|
-
"none"
|
|
104
|
-
]).describe("Predefined project template");
|
|
105
|
-
const ProjectNameSchema = z.string().min(1, "Project name cannot be empty").max(255, "Project name must be less than 255 characters").refine((name) => name === "." || !name.startsWith("."), "Project name cannot start with a dot (except for '.')").refine((name) => name === "." || !name.startsWith("-"), "Project name cannot start with a dash").refine((name) => {
|
|
106
|
-
return ![
|
|
107
|
-
"<",
|
|
108
|
-
">",
|
|
109
|
-
":",
|
|
110
|
-
"\"",
|
|
111
|
-
"|",
|
|
112
|
-
"?",
|
|
113
|
-
"*"
|
|
114
|
-
].some((char) => name.includes(char));
|
|
115
|
-
}, "Project name contains invalid characters").refine((name) => name.toLowerCase() !== "node_modules", "Project name is reserved").describe("Project name or path");
|
|
116
|
-
const CreateInputSchema = z.object({
|
|
117
|
-
projectName: z.string().optional(),
|
|
118
|
-
template: TemplateSchema.optional(),
|
|
119
|
-
yes: z.boolean().optional(),
|
|
120
|
-
yolo: z.boolean().optional(),
|
|
121
|
-
verbose: z.boolean().optional(),
|
|
122
|
-
database: DatabaseSchema.optional(),
|
|
123
|
-
orm: ORMSchema.optional(),
|
|
124
|
-
auth: AuthSchema.optional(),
|
|
125
|
-
payments: PaymentsSchema.optional(),
|
|
126
|
-
frontend: z.array(FrontendSchema).optional(),
|
|
127
|
-
addons: z.array(AddonsSchema).optional(),
|
|
128
|
-
examples: z.array(ExamplesSchema).optional(),
|
|
129
|
-
git: z.boolean().optional(),
|
|
130
|
-
packageManager: PackageManagerSchema.optional(),
|
|
131
|
-
install: z.boolean().optional(),
|
|
132
|
-
dbSetup: DatabaseSetupSchema.optional(),
|
|
133
|
-
backend: BackendSchema.optional(),
|
|
134
|
-
runtime: RuntimeSchema.optional(),
|
|
135
|
-
api: APISchema.optional(),
|
|
136
|
-
webDeploy: WebDeploySchema.optional(),
|
|
137
|
-
serverDeploy: ServerDeploySchema.optional(),
|
|
138
|
-
directoryConflict: DirectoryConflictSchema.optional(),
|
|
139
|
-
renderTitle: z.boolean().optional(),
|
|
140
|
-
disableAnalytics: z.boolean().optional(),
|
|
141
|
-
manualDb: z.boolean().optional()
|
|
142
|
-
});
|
|
143
|
-
const AddInputSchema = z.object({
|
|
144
|
-
addons: z.array(AddonsSchema).optional(),
|
|
145
|
-
webDeploy: WebDeploySchema.optional(),
|
|
146
|
-
serverDeploy: ServerDeploySchema.optional(),
|
|
147
|
-
projectDir: z.string().optional(),
|
|
148
|
-
install: z.boolean().optional(),
|
|
149
|
-
packageManager: PackageManagerSchema.optional()
|
|
150
|
-
});
|
|
151
|
-
const CLIInputSchema = CreateInputSchema.extend({ projectDirectory: z.string().optional() });
|
|
152
|
-
const ProjectConfigSchema = z.object({
|
|
153
|
-
projectName: z.string(),
|
|
154
|
-
projectDir: z.string(),
|
|
155
|
-
relativePath: z.string(),
|
|
156
|
-
database: DatabaseSchema,
|
|
157
|
-
orm: ORMSchema,
|
|
158
|
-
backend: BackendSchema,
|
|
159
|
-
runtime: RuntimeSchema,
|
|
160
|
-
frontend: z.array(FrontendSchema),
|
|
161
|
-
addons: z.array(AddonsSchema),
|
|
162
|
-
examples: z.array(ExamplesSchema),
|
|
163
|
-
auth: AuthSchema,
|
|
164
|
-
payments: PaymentsSchema,
|
|
165
|
-
git: z.boolean(),
|
|
166
|
-
packageManager: PackageManagerSchema,
|
|
167
|
-
install: z.boolean(),
|
|
168
|
-
dbSetup: DatabaseSetupSchema,
|
|
169
|
-
api: APISchema,
|
|
170
|
-
webDeploy: WebDeploySchema,
|
|
171
|
-
serverDeploy: ServerDeploySchema
|
|
172
|
-
});
|
|
173
|
-
const BetterTStackConfigSchema = z.object({
|
|
174
|
-
version: z.string(),
|
|
175
|
-
createdAt: z.string(),
|
|
176
|
-
database: DatabaseSchema,
|
|
177
|
-
orm: ORMSchema,
|
|
178
|
-
backend: BackendSchema,
|
|
179
|
-
runtime: RuntimeSchema,
|
|
180
|
-
frontend: z.array(FrontendSchema),
|
|
181
|
-
addons: z.array(AddonsSchema),
|
|
182
|
-
examples: z.array(ExamplesSchema),
|
|
183
|
-
auth: AuthSchema,
|
|
184
|
-
payments: PaymentsSchema,
|
|
185
|
-
packageManager: PackageManagerSchema,
|
|
186
|
-
dbSetup: DatabaseSetupSchema,
|
|
187
|
-
api: APISchema,
|
|
188
|
-
webDeploy: WebDeploySchema,
|
|
189
|
-
serverDeploy: ServerDeploySchema
|
|
190
|
-
});
|
|
191
|
-
const InitResultSchema = z.object({
|
|
192
|
-
success: z.boolean(),
|
|
193
|
-
projectConfig: ProjectConfigSchema,
|
|
194
|
-
reproducibleCommand: z.string(),
|
|
195
|
-
timeScaffolded: z.string(),
|
|
196
|
-
elapsedTimeMs: z.number(),
|
|
197
|
-
projectDirectory: z.string(),
|
|
198
|
-
relativePath: z.string(),
|
|
199
|
-
error: z.string().optional()
|
|
200
|
-
});
|
|
201
|
-
const DATABASE_VALUES = DatabaseSchema.options;
|
|
202
|
-
const ORM_VALUES = ORMSchema.options;
|
|
203
|
-
const BACKEND_VALUES = BackendSchema.options;
|
|
204
|
-
const RUNTIME_VALUES = RuntimeSchema.options;
|
|
205
|
-
const FRONTEND_VALUES = FrontendSchema.options;
|
|
206
|
-
const ADDONS_VALUES = AddonsSchema.options;
|
|
207
|
-
const EXAMPLES_VALUES = ExamplesSchema.options;
|
|
208
|
-
const PACKAGE_MANAGER_VALUES = PackageManagerSchema.options;
|
|
209
|
-
const DATABASE_SETUP_VALUES = DatabaseSetupSchema.options;
|
|
210
|
-
const API_VALUES = APISchema.options;
|
|
211
|
-
const AUTH_VALUES = AuthSchema.options;
|
|
212
|
-
const PAYMENTS_VALUES = PaymentsSchema.options;
|
|
213
|
-
const WEB_DEPLOY_VALUES = WebDeploySchema.options;
|
|
214
|
-
const SERVER_DEPLOY_VALUES = ServerDeploySchema.options;
|
|
215
|
-
const DIRECTORY_CONFLICT_VALUES = DirectoryConflictSchema.options;
|
|
216
|
-
const TEMPLATE_VALUES = TemplateSchema.options;
|
|
217
|
-
|
|
218
|
-
//#endregion
|
|
219
|
-
export { ProjectConfigSchema as A, InitResultSchema as C, PAYMENTS_VALUES as D, PACKAGE_MANAGER_VALUES as E, ServerDeploySchema as F, TEMPLATE_VALUES as I, TemplateSchema as L, RUNTIME_VALUES as M, RuntimeSchema as N, PackageManagerSchema as O, SERVER_DEPLOY_VALUES as P, WEB_DEPLOY_VALUES as R, FrontendSchema as S, ORM_VALUES as T, DatabaseSetupSchema as _, AddInputSchema as a, ExamplesSchema as b, BACKEND_VALUES as c, CLIInputSchema as d, CreateInputSchema as f, DatabaseSchema as g, DIRECTORY_CONFLICT_VALUES as h, AUTH_VALUES as i, ProjectNameSchema as j, PaymentsSchema as k, BackendSchema as l, DATABASE_VALUES as m, APISchema as n, AddonsSchema as o, DATABASE_SETUP_VALUES as p, API_VALUES as r, AuthSchema as s, ADDONS_VALUES as t, BetterTStackConfigSchema as u, DirectoryConflictSchema as v, ORMSchema as w, FRONTEND_VALUES as x, EXAMPLES_VALUES as y, WebDeploySchema as z };
|
|
220
|
-
//# sourceMappingURL=schemas-CH5VdN4I.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas-CH5VdN4I.mjs","names":[],"sources":["../src/schemas.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Base enum schemas\nexport const DatabaseSchema = z\n .enum([\"none\", \"sqlite\", \"postgres\", \"mysql\", \"mongodb\"])\n .describe(\"Database type\");\n\nexport const ORMSchema = z.enum([\"drizzle\", \"prisma\", \"mongoose\", \"none\"]).describe(\"ORM type\");\n\nexport const BackendSchema = z\n .enum([\"hono\", \"express\", \"fastify\", \"elysia\", \"convex\", \"self\", \"none\"])\n .describe(\"Backend framework\");\n\nexport const RuntimeSchema = z\n .enum([\"bun\", \"node\", \"workers\", \"none\"])\n .describe(\"Runtime environment\");\n\nexport const FrontendSchema = z\n .enum([\n \"tanstack-router\",\n \"react-router\",\n \"tanstack-start\",\n \"next\",\n \"nuxt\",\n \"native-bare\",\n \"native-uniwind\",\n \"native-unistyles\",\n \"svelte\",\n \"solid\",\n \"none\",\n ])\n .describe(\"Frontend framework\");\n\nexport const AddonsSchema = z\n .enum([\n \"pwa\",\n \"tauri\",\n \"starlight\",\n \"biome\",\n \"husky\",\n \"ruler\",\n \"turborepo\",\n \"fumadocs\",\n \"ultracite\",\n \"oxlint\",\n \"none\",\n ])\n .describe(\"Additional addons\");\n\nexport const ExamplesSchema = z\n .enum([\"todo\", \"ai\", \"none\"])\n .describe(\"Example templates to include\");\n\nexport const PackageManagerSchema = z.enum([\"npm\", \"pnpm\", \"bun\"]).describe(\"Package manager\");\n\nexport const DatabaseSetupSchema = z\n .enum([\n \"turso\",\n \"neon\",\n \"prisma-postgres\",\n \"planetscale\",\n \"mongodb-atlas\",\n \"supabase\",\n \"d1\",\n \"docker\",\n \"none\",\n ])\n .describe(\"Database hosting setup\");\n\nexport const APISchema = z.enum([\"trpc\", \"orpc\", \"none\"]).describe(\"API type\");\n\nexport const AuthSchema = z\n .enum([\"better-auth\", \"clerk\", \"none\"])\n .describe(\"Authentication provider\");\n\nexport const PaymentsSchema = z.enum([\"polar\", \"none\"]).describe(\"Payments provider\");\n\nexport const WebDeploySchema = z.enum([\"alchemy\", \"none\"]).describe(\"Web deployment\");\n\nexport const ServerDeploySchema = z.enum([\"alchemy\", \"none\"]).describe(\"Server deployment\");\n\nexport const DirectoryConflictSchema = z\n .enum([\"merge\", \"overwrite\", \"increment\", \"error\"])\n .describe(\"How to handle existing directory conflicts\");\n\nexport const TemplateSchema = z\n .enum([\"mern\", \"pern\", \"t3\", \"uniwind\", \"none\"])\n .describe(\"Predefined project template\");\n\nexport const ProjectNameSchema = z\n .string()\n .min(1, \"Project name cannot be empty\")\n .max(255, \"Project name must be less than 255 characters\")\n .refine(\n (name) => name === \".\" || !name.startsWith(\".\"),\n \"Project name cannot start with a dot (except for '.')\",\n )\n .refine((name) => name === \".\" || !name.startsWith(\"-\"), \"Project name cannot start with a dash\")\n .refine((name) => {\n const invalidChars = [\"<\", \">\", \":\", '\"', \"|\", \"?\", \"*\"];\n return !invalidChars.some((char) => name.includes(char));\n }, \"Project name contains invalid characters\")\n .refine((name) => name.toLowerCase() !== \"node_modules\", \"Project name is reserved\")\n .describe(\"Project name or path\");\n\n// Composite schemas\nexport const CreateInputSchema = z.object({\n projectName: z.string().optional(),\n template: TemplateSchema.optional(),\n yes: z.boolean().optional(),\n yolo: z.boolean().optional(),\n verbose: z.boolean().optional(),\n database: DatabaseSchema.optional(),\n orm: ORMSchema.optional(),\n auth: AuthSchema.optional(),\n payments: PaymentsSchema.optional(),\n frontend: z.array(FrontendSchema).optional(),\n addons: z.array(AddonsSchema).optional(),\n examples: z.array(ExamplesSchema).optional(),\n git: z.boolean().optional(),\n packageManager: PackageManagerSchema.optional(),\n install: z.boolean().optional(),\n dbSetup: DatabaseSetupSchema.optional(),\n backend: BackendSchema.optional(),\n runtime: RuntimeSchema.optional(),\n api: APISchema.optional(),\n webDeploy: WebDeploySchema.optional(),\n serverDeploy: ServerDeploySchema.optional(),\n directoryConflict: DirectoryConflictSchema.optional(),\n renderTitle: z.boolean().optional(),\n disableAnalytics: z.boolean().optional(),\n manualDb: z.boolean().optional(),\n});\n\nexport const AddInputSchema = z.object({\n addons: z.array(AddonsSchema).optional(),\n webDeploy: WebDeploySchema.optional(),\n serverDeploy: ServerDeploySchema.optional(),\n projectDir: z.string().optional(),\n install: z.boolean().optional(),\n packageManager: PackageManagerSchema.optional(),\n});\n\nexport const CLIInputSchema = CreateInputSchema.extend({\n projectDirectory: z.string().optional(),\n});\n\nexport const ProjectConfigSchema = z.object({\n projectName: z.string(),\n projectDir: z.string(),\n relativePath: z.string(),\n database: DatabaseSchema,\n orm: ORMSchema,\n backend: BackendSchema,\n runtime: RuntimeSchema,\n frontend: z.array(FrontendSchema),\n addons: z.array(AddonsSchema),\n examples: z.array(ExamplesSchema),\n auth: AuthSchema,\n payments: PaymentsSchema,\n git: z.boolean(),\n packageManager: PackageManagerSchema,\n install: z.boolean(),\n dbSetup: DatabaseSetupSchema,\n api: APISchema,\n webDeploy: WebDeploySchema,\n serverDeploy: ServerDeploySchema,\n});\n\nexport const BetterTStackConfigSchema = z.object({\n version: z.string(),\n createdAt: z.string(),\n database: DatabaseSchema,\n orm: ORMSchema,\n backend: BackendSchema,\n runtime: RuntimeSchema,\n frontend: z.array(FrontendSchema),\n addons: z.array(AddonsSchema),\n examples: z.array(ExamplesSchema),\n auth: AuthSchema,\n payments: PaymentsSchema,\n packageManager: PackageManagerSchema,\n dbSetup: DatabaseSetupSchema,\n api: APISchema,\n webDeploy: WebDeploySchema,\n serverDeploy: ServerDeploySchema,\n});\n\nexport const InitResultSchema = z.object({\n success: z.boolean(),\n projectConfig: ProjectConfigSchema,\n reproducibleCommand: z.string(),\n timeScaffolded: z.string(),\n elapsedTimeMs: z.number(),\n projectDirectory: z.string(),\n relativePath: z.string(),\n error: z.string().optional(),\n});\n\n// Extract enum values as arrays for runtime use\nexport const DATABASE_VALUES = DatabaseSchema.options;\nexport const ORM_VALUES = ORMSchema.options;\nexport const BACKEND_VALUES = BackendSchema.options;\nexport const RUNTIME_VALUES = RuntimeSchema.options;\nexport const FRONTEND_VALUES = FrontendSchema.options;\nexport const ADDONS_VALUES = AddonsSchema.options;\nexport const EXAMPLES_VALUES = ExamplesSchema.options;\nexport const PACKAGE_MANAGER_VALUES = PackageManagerSchema.options;\nexport const DATABASE_SETUP_VALUES = DatabaseSetupSchema.options;\nexport const API_VALUES = APISchema.options;\nexport const AUTH_VALUES = AuthSchema.options;\nexport const PAYMENTS_VALUES = PaymentsSchema.options;\nexport const WEB_DEPLOY_VALUES = WebDeploySchema.options;\nexport const SERVER_DEPLOY_VALUES = ServerDeploySchema.options;\nexport const DIRECTORY_CONFLICT_VALUES = DirectoryConflictSchema.options;\nexport const TEMPLATE_VALUES = TemplateSchema.options;\n"],"mappings":";;;AAGA,MAAa,iBAAiB,EAC3B,KAAK;CAAC;CAAQ;CAAU;CAAY;CAAS;CAAU,CAAC,CACxD,SAAS,gBAAgB;A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