create-better-fullstack 2.0.0 → 2.0.2
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/add-handler-BPAZM8Zo.mjs +149 -0
- package/dist/addons-setup-CV5uZyhH.mjs +5 -0
- package/dist/{addons-setup-DHoByttt.mjs → addons-setup-HSghQS7c.mjs} +29 -33
- package/dist/bts-config-Bg1Qea9Y.mjs +737 -0
- package/dist/cli.mjs +2 -2
- package/dist/index.d.mts +404 -96
- package/dist/index.mjs +38 -11545
- package/dist/install-dependencies-D6-GO3BZ.mjs +1139 -0
- package/dist/mcp-58r70ZcL.mjs +5 -0
- package/dist/mcp-entry.mjs +377 -543
- package/dist/run-DQlymC4z.mjs +11546 -0
- package/dist/run-QRBymn-p.mjs +7 -0
- package/dist/update-deps-CLebIM70.mjs +189 -0
- package/package.json +7 -10
- package/dist/addons-setup-Ca069cmy.mjs +0 -5
- package/dist/bts-config-BMniWIbd.mjs +0 -497
- package/dist/mcp-YvDMaVXB.mjs +0 -5
|
@@ -1,497 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { t as __reExport } from "./chunk-CCII7kTE.mjs";
|
|
3
|
-
import fs from "fs-extra";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { createCliDefaultProjectConfigBase } from "@better-fullstack/types";
|
|
7
|
-
import { dependencyVersionMap } from "@better-fullstack/template-generator";
|
|
8
|
-
import * as JSONC from "jsonc-parser";
|
|
9
|
-
|
|
10
|
-
//#region src/utils/get-package-manager.ts
|
|
11
|
-
const getUserPkgManager = () => {
|
|
12
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
13
|
-
if (userAgent?.startsWith("pnpm")) return "pnpm";
|
|
14
|
-
if (userAgent?.startsWith("bun")) return "bun";
|
|
15
|
-
if (userAgent?.startsWith("yarn")) return "yarn";
|
|
16
|
-
return "npm";
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/constants.ts
|
|
21
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
-
const distPath = path.dirname(__filename);
|
|
23
|
-
const PKG_ROOT = path.join(distPath, "../");
|
|
24
|
-
const DEFAULT_CONFIG_BASE = createCliDefaultProjectConfigBase(getUserPkgManager());
|
|
25
|
-
function getDefaultConfig() {
|
|
26
|
-
return {
|
|
27
|
-
...DEFAULT_CONFIG_BASE,
|
|
28
|
-
projectDir: path.resolve(process.cwd(), DEFAULT_CONFIG_BASE.projectName),
|
|
29
|
-
packageManager: getUserPkgManager(),
|
|
30
|
-
frontend: [...DEFAULT_CONFIG_BASE.frontend],
|
|
31
|
-
addons: [...DEFAULT_CONFIG_BASE.addons],
|
|
32
|
-
examples: [...DEFAULT_CONFIG_BASE.examples],
|
|
33
|
-
rustLibraries: [...DEFAULT_CONFIG_BASE.rustLibraries],
|
|
34
|
-
pythonAi: [...DEFAULT_CONFIG_BASE.pythonAi],
|
|
35
|
-
javaLibraries: [...DEFAULT_CONFIG_BASE.javaLibraries],
|
|
36
|
-
javaTestingLibraries: [...DEFAULT_CONFIG_BASE.javaTestingLibraries],
|
|
37
|
-
aiDocs: [...DEFAULT_CONFIG_BASE.aiDocs]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
const DEFAULT_CONFIG = getDefaultConfig();
|
|
41
|
-
/**
|
|
42
|
-
* Default UI library for each frontend framework
|
|
43
|
-
* Falls back based on what's compatible
|
|
44
|
-
*/
|
|
45
|
-
const DEFAULT_UI_LIBRARY_BY_FRONTEND = {
|
|
46
|
-
"tanstack-router": "shadcn-ui",
|
|
47
|
-
"react-router": "shadcn-ui",
|
|
48
|
-
"react-vite": "shadcn-ui",
|
|
49
|
-
"tanstack-start": "shadcn-ui",
|
|
50
|
-
next: "shadcn-ui",
|
|
51
|
-
vinext: "shadcn-ui",
|
|
52
|
-
nuxt: "daisyui",
|
|
53
|
-
svelte: "daisyui",
|
|
54
|
-
solid: "daisyui",
|
|
55
|
-
"solid-start": "daisyui",
|
|
56
|
-
astro: "daisyui",
|
|
57
|
-
qwik: "daisyui",
|
|
58
|
-
angular: "daisyui",
|
|
59
|
-
redwood: "daisyui",
|
|
60
|
-
fresh: "daisyui",
|
|
61
|
-
"native-bare": "none",
|
|
62
|
-
"native-uniwind": "none",
|
|
63
|
-
"native-unistyles": "none",
|
|
64
|
-
none: "none"
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/utils/get-latest-cli-version.ts
|
|
69
|
-
const getLatestCLIVersion = () => {
|
|
70
|
-
const packageJsonPath = path.join(PKG_ROOT, "package.json");
|
|
71
|
-
return fs.readJSONSync(packageJsonPath).version ?? "1.0.0";
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/types.ts
|
|
76
|
-
var types_exports = {};
|
|
77
|
-
import * as import__better_fullstack_types from "@better-fullstack/types";
|
|
78
|
-
__reExport(types_exports, import__better_fullstack_types);
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/utils/graph-summary.ts
|
|
82
|
-
const FRONTEND_LABELS = {
|
|
83
|
-
next: "Next.js web app",
|
|
84
|
-
astro: "Astro web app",
|
|
85
|
-
"react-vite": "React + Vite app",
|
|
86
|
-
"react-router": "React Router app",
|
|
87
|
-
"tanstack-router": "TanStack Router app",
|
|
88
|
-
"tanstack-start": "TanStack Start app",
|
|
89
|
-
nuxt: "Nuxt app",
|
|
90
|
-
svelte: "SvelteKit app",
|
|
91
|
-
solid: "Solid app",
|
|
92
|
-
"solid-start": "SolidStart app",
|
|
93
|
-
qwik: "Qwik app",
|
|
94
|
-
angular: "Angular app",
|
|
95
|
-
redwood: "RedwoodJS app",
|
|
96
|
-
fresh: "Fresh app"
|
|
97
|
-
};
|
|
98
|
-
const BACKEND_LABELS = {
|
|
99
|
-
"rust:axum": "Rust Axum API",
|
|
100
|
-
"rust:actix-web": "Rust Actix Web API",
|
|
101
|
-
"rust:rocket": "Rust Rocket API",
|
|
102
|
-
"rust:warp": "Rust Warp API",
|
|
103
|
-
"rust:poem": "Rust Poem API",
|
|
104
|
-
"rust:salvo": "Rust Salvo API",
|
|
105
|
-
"python:fastapi": "Python FastAPI API",
|
|
106
|
-
"python:django": "Python Django API",
|
|
107
|
-
"python:flask": "Python Flask API",
|
|
108
|
-
"python:litestar": "Python Litestar API",
|
|
109
|
-
"go:gin": "Go Gin API",
|
|
110
|
-
"go:echo": "Go Echo API",
|
|
111
|
-
"go:fiber": "Go Fiber API",
|
|
112
|
-
"go:chi": "Go Chi API",
|
|
113
|
-
"java:spring-boot": "Java Spring Boot API",
|
|
114
|
-
"java:quarkus": "Java Quarkus API",
|
|
115
|
-
"elixir:phoenix": "Elixir Phoenix API",
|
|
116
|
-
"elixir:phoenix-live-view": "Elixir Phoenix LiveView API"
|
|
117
|
-
};
|
|
118
|
-
const TOOL_LABELS = {
|
|
119
|
-
postgres: "Postgres",
|
|
120
|
-
sqlite: "SQLite",
|
|
121
|
-
mysql: "MySQL",
|
|
122
|
-
mongodb: "MongoDB",
|
|
123
|
-
redis: "Redis",
|
|
124
|
-
edgedb: "EdgeDB",
|
|
125
|
-
gorm: "GORM",
|
|
126
|
-
sqlc: "sqlc",
|
|
127
|
-
ent: "Ent",
|
|
128
|
-
"ecto-sql": "Ecto SQL",
|
|
129
|
-
ecto: "Ecto",
|
|
130
|
-
sqlx: "SQLx",
|
|
131
|
-
"sea-orm": "SeaORM",
|
|
132
|
-
sqlalchemy: "SQLAlchemy",
|
|
133
|
-
sqlmodel: "SQLModel",
|
|
134
|
-
"django-orm": "Django ORM",
|
|
135
|
-
"spring-data-jpa": "Spring Data JPA"
|
|
136
|
-
};
|
|
137
|
-
function getSelectedGraphParts(config) {
|
|
138
|
-
return (config.stackParts ?? []).filter((part) => part.source !== "provided");
|
|
139
|
-
}
|
|
140
|
-
function getGraphPart(config, role, ecosystem) {
|
|
141
|
-
return getSelectedGraphParts(config).find((part) => part.role === role && (!ecosystem || part.ecosystem === ecosystem));
|
|
142
|
-
}
|
|
143
|
-
function hasGraphPart(config, role, ecosystem) {
|
|
144
|
-
return Boolean(getGraphPart(config, role, ecosystem));
|
|
145
|
-
}
|
|
146
|
-
function getPrimaryGraphPart(config, role, ecosystem) {
|
|
147
|
-
return getSelectedGraphParts(config).find((part) => part.role === role && !part.ownerPartId && (!ecosystem || part.ecosystem === ecosystem));
|
|
148
|
-
}
|
|
149
|
-
function getGraphBackendUrl(config) {
|
|
150
|
-
switch (getPrimaryGraphPart(config, "backend")?.ecosystem) {
|
|
151
|
-
case "elixir": return "http://localhost:4000";
|
|
152
|
-
case "rust": return "http://localhost:3000";
|
|
153
|
-
case "python": return "http://localhost:8000";
|
|
154
|
-
case "go":
|
|
155
|
-
case "java": return "http://localhost:8080";
|
|
156
|
-
default: return null;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function getEffectiveStack(config) {
|
|
160
|
-
const effectiveStack = {};
|
|
161
|
-
const parts = getSelectedGraphParts(config);
|
|
162
|
-
for (const part of parts) {
|
|
163
|
-
const key = part.ownerPartId ? `backend.${part.role}` : part.role;
|
|
164
|
-
effectiveStack[key] = `${part.ecosystem}:${part.toolId}`;
|
|
165
|
-
}
|
|
166
|
-
return effectiveStack;
|
|
167
|
-
}
|
|
168
|
-
function labelFor(part) {
|
|
169
|
-
if (!part) return null;
|
|
170
|
-
if (part.role === "frontend" && part.ecosystem === "typescript") return FRONTEND_LABELS[part.toolId] ?? `${part.toolId} web app`;
|
|
171
|
-
if (part.role === "backend") return BACKEND_LABELS[`${part.ecosystem}:${part.toolId}`] ?? `${part.ecosystem} ${part.toolId} API`;
|
|
172
|
-
return TOOL_LABELS[part.toolId] ?? part.toolId;
|
|
173
|
-
}
|
|
174
|
-
function getGraphSummary(config) {
|
|
175
|
-
const selectedParts = getSelectedGraphParts(config);
|
|
176
|
-
if (selectedParts.length === 0) return null;
|
|
177
|
-
const frontend = getPrimaryGraphPart(config, "frontend");
|
|
178
|
-
const backend = getPrimaryGraphPart(config, "backend");
|
|
179
|
-
const database = getPrimaryGraphPart(config, "database");
|
|
180
|
-
const orm = selectedParts.find((part) => part.role === "orm");
|
|
181
|
-
const segments = [labelFor(frontend), labelFor(backend)].filter(Boolean);
|
|
182
|
-
const dataLabel = [labelFor(orm), labelFor(database)].filter(Boolean).join("/");
|
|
183
|
-
if (dataLabel) segments.push(dataLabel);
|
|
184
|
-
return segments.length > 0 ? segments.join(" + ") : selectedParts.map((part) => (0, types_exports.formatStackPartSpec)(part, selectedParts)).join(" + ");
|
|
185
|
-
}
|
|
186
|
-
function getGraphBackendDeployInstructions(config) {
|
|
187
|
-
const backend = getPrimaryGraphPart(config, "backend");
|
|
188
|
-
if (!backend || config.serverDeploy === "none") return "";
|
|
189
|
-
const targetPath = backend.targetPath ?? "apps/server";
|
|
190
|
-
const backendLabel = labelFor(backend) ?? `${backend.ecosystem}:${backend.toolId}`;
|
|
191
|
-
switch (config.serverDeploy) {
|
|
192
|
-
case "railway": return [
|
|
193
|
-
"Server deployment with Railway:",
|
|
194
|
-
`* Backend: ${backendLabel}`,
|
|
195
|
-
`* Config: ${targetPath}/railway.toml`,
|
|
196
|
-
`* Deploy: cd ${targetPath} && railway up`
|
|
197
|
-
].join("\n");
|
|
198
|
-
case "docker": return [
|
|
199
|
-
"Server deployment with Docker:",
|
|
200
|
-
`* Backend: ${backendLabel}`,
|
|
201
|
-
`* Build: cd ${targetPath} && docker build -t better-fullstack-server .`
|
|
202
|
-
].join("\n");
|
|
203
|
-
case "fly": return [
|
|
204
|
-
"Server deployment with Fly:",
|
|
205
|
-
`* Backend: ${backendLabel}`,
|
|
206
|
-
`* Deploy: cd ${targetPath} && fly launch`
|
|
207
|
-
].join("\n");
|
|
208
|
-
case "vercel": return [
|
|
209
|
-
"Server deployment with Vercel:",
|
|
210
|
-
`* Backend: ${backendLabel}`,
|
|
211
|
-
`* Deploy from: ${targetPath}`
|
|
212
|
-
].join("\n");
|
|
213
|
-
case "cloudflare":
|
|
214
|
-
case "sst": return [
|
|
215
|
-
`Server deployment with ${config.serverDeploy}:`,
|
|
216
|
-
`* Backend: ${backendLabel}`,
|
|
217
|
-
`* Review generated files in ${targetPath}`
|
|
218
|
-
].join("\n");
|
|
219
|
-
default: return "";
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
//#endregion
|
|
224
|
-
//#region src/utils/bts-config.ts
|
|
225
|
-
const BTS_CONFIG_FILE = "bts.jsonc";
|
|
226
|
-
async function writeBtsConfig(projectConfig) {
|
|
227
|
-
const stackParts = projectConfig.stackParts ?? (0, types_exports.legacyProjectConfigToStackParts)(projectConfig);
|
|
228
|
-
const graphSummary = projectConfig.stackParts ? getGraphSummary({ stackParts }) : null;
|
|
229
|
-
const effectiveStack = projectConfig.stackParts ? getEffectiveStack({ stackParts }) : void 0;
|
|
230
|
-
const btsConfig = {
|
|
231
|
-
version: getLatestCLIVersion(),
|
|
232
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
233
|
-
...graphSummary ? {
|
|
234
|
-
graphSummary,
|
|
235
|
-
effectiveStack
|
|
236
|
-
} : {},
|
|
237
|
-
ecosystem: projectConfig.ecosystem,
|
|
238
|
-
database: projectConfig.database,
|
|
239
|
-
orm: projectConfig.orm,
|
|
240
|
-
backend: projectConfig.backend,
|
|
241
|
-
runtime: projectConfig.runtime,
|
|
242
|
-
frontend: projectConfig.frontend,
|
|
243
|
-
addons: projectConfig.addons,
|
|
244
|
-
examples: projectConfig.examples,
|
|
245
|
-
auth: projectConfig.auth,
|
|
246
|
-
payments: projectConfig.payments,
|
|
247
|
-
email: projectConfig.email,
|
|
248
|
-
fileUpload: projectConfig.fileUpload,
|
|
249
|
-
effect: projectConfig.effect,
|
|
250
|
-
ai: projectConfig.ai,
|
|
251
|
-
stateManagement: projectConfig.stateManagement,
|
|
252
|
-
validation: projectConfig.validation,
|
|
253
|
-
forms: projectConfig.forms,
|
|
254
|
-
testing: projectConfig.testing,
|
|
255
|
-
packageManager: projectConfig.packageManager,
|
|
256
|
-
versionChannel: projectConfig.versionChannel,
|
|
257
|
-
dbSetup: projectConfig.dbSetup,
|
|
258
|
-
api: projectConfig.api,
|
|
259
|
-
webDeploy: projectConfig.webDeploy,
|
|
260
|
-
serverDeploy: projectConfig.serverDeploy,
|
|
261
|
-
cssFramework: projectConfig.cssFramework,
|
|
262
|
-
uiLibrary: projectConfig.uiLibrary,
|
|
263
|
-
realtime: projectConfig.realtime,
|
|
264
|
-
jobQueue: projectConfig.jobQueue,
|
|
265
|
-
animation: projectConfig.animation,
|
|
266
|
-
logging: projectConfig.logging,
|
|
267
|
-
observability: projectConfig.observability,
|
|
268
|
-
featureFlags: projectConfig.featureFlags,
|
|
269
|
-
analytics: projectConfig.analytics,
|
|
270
|
-
mobileNavigation: projectConfig.mobileNavigation,
|
|
271
|
-
mobileUI: projectConfig.mobileUI,
|
|
272
|
-
mobileStorage: projectConfig.mobileStorage,
|
|
273
|
-
mobileTesting: projectConfig.mobileTesting,
|
|
274
|
-
mobilePush: projectConfig.mobilePush,
|
|
275
|
-
mobileOTA: projectConfig.mobileOTA,
|
|
276
|
-
mobileDeepLinking: projectConfig.mobileDeepLinking,
|
|
277
|
-
cms: projectConfig.cms,
|
|
278
|
-
caching: projectConfig.caching,
|
|
279
|
-
i18n: projectConfig.i18n,
|
|
280
|
-
search: projectConfig.search,
|
|
281
|
-
fileStorage: projectConfig.fileStorage,
|
|
282
|
-
rustWebFramework: projectConfig.rustWebFramework,
|
|
283
|
-
rustFrontend: projectConfig.rustFrontend,
|
|
284
|
-
rustOrm: projectConfig.rustOrm,
|
|
285
|
-
rustApi: projectConfig.rustApi,
|
|
286
|
-
rustCli: projectConfig.rustCli,
|
|
287
|
-
rustLibraries: projectConfig.rustLibraries,
|
|
288
|
-
rustLogging: projectConfig.rustLogging,
|
|
289
|
-
rustErrorHandling: projectConfig.rustErrorHandling,
|
|
290
|
-
rustCaching: projectConfig.rustCaching,
|
|
291
|
-
rustAuth: projectConfig.rustAuth,
|
|
292
|
-
pythonWebFramework: projectConfig.pythonWebFramework,
|
|
293
|
-
pythonOrm: projectConfig.pythonOrm,
|
|
294
|
-
pythonValidation: projectConfig.pythonValidation,
|
|
295
|
-
pythonAi: projectConfig.pythonAi,
|
|
296
|
-
pythonAuth: projectConfig.pythonAuth,
|
|
297
|
-
pythonApi: projectConfig.pythonApi,
|
|
298
|
-
pythonTaskQueue: projectConfig.pythonTaskQueue,
|
|
299
|
-
pythonGraphql: projectConfig.pythonGraphql,
|
|
300
|
-
pythonQuality: projectConfig.pythonQuality,
|
|
301
|
-
goWebFramework: projectConfig.goWebFramework,
|
|
302
|
-
goOrm: projectConfig.goOrm,
|
|
303
|
-
goApi: projectConfig.goApi,
|
|
304
|
-
goCli: projectConfig.goCli,
|
|
305
|
-
goLogging: projectConfig.goLogging,
|
|
306
|
-
goAuth: projectConfig.goAuth,
|
|
307
|
-
javaWebFramework: projectConfig.javaWebFramework,
|
|
308
|
-
javaBuildTool: projectConfig.javaBuildTool,
|
|
309
|
-
javaOrm: projectConfig.javaOrm,
|
|
310
|
-
javaAuth: projectConfig.javaAuth,
|
|
311
|
-
javaLibraries: projectConfig.javaLibraries,
|
|
312
|
-
javaTestingLibraries: projectConfig.javaTestingLibraries,
|
|
313
|
-
elixirWebFramework: projectConfig.elixirWebFramework,
|
|
314
|
-
elixirOrm: projectConfig.elixirOrm,
|
|
315
|
-
elixirAuth: projectConfig.elixirAuth,
|
|
316
|
-
elixirApi: projectConfig.elixirApi,
|
|
317
|
-
elixirRealtime: projectConfig.elixirRealtime,
|
|
318
|
-
elixirJobs: projectConfig.elixirJobs,
|
|
319
|
-
elixirValidation: projectConfig.elixirValidation,
|
|
320
|
-
elixirHttp: projectConfig.elixirHttp,
|
|
321
|
-
elixirJson: projectConfig.elixirJson,
|
|
322
|
-
elixirEmail: projectConfig.elixirEmail,
|
|
323
|
-
elixirCaching: projectConfig.elixirCaching,
|
|
324
|
-
elixirObservability: projectConfig.elixirObservability,
|
|
325
|
-
elixirTesting: projectConfig.elixirTesting,
|
|
326
|
-
elixirQuality: projectConfig.elixirQuality,
|
|
327
|
-
elixirDeploy: projectConfig.elixirDeploy,
|
|
328
|
-
aiDocs: projectConfig.aiDocs,
|
|
329
|
-
stackParts
|
|
330
|
-
};
|
|
331
|
-
const baseContent = {
|
|
332
|
-
$schema: "https://better-fullstack-web.vercel.app/schema.json",
|
|
333
|
-
version: btsConfig.version,
|
|
334
|
-
createdAt: btsConfig.createdAt,
|
|
335
|
-
...btsConfig.graphSummary ? {
|
|
336
|
-
graphSummary: btsConfig.graphSummary,
|
|
337
|
-
effectiveStack: btsConfig.effectiveStack
|
|
338
|
-
} : {},
|
|
339
|
-
ecosystem: btsConfig.ecosystem,
|
|
340
|
-
database: btsConfig.database,
|
|
341
|
-
orm: btsConfig.orm,
|
|
342
|
-
backend: btsConfig.backend,
|
|
343
|
-
runtime: btsConfig.runtime,
|
|
344
|
-
frontend: btsConfig.frontend,
|
|
345
|
-
addons: btsConfig.addons,
|
|
346
|
-
examples: btsConfig.examples,
|
|
347
|
-
auth: btsConfig.auth,
|
|
348
|
-
payments: btsConfig.payments,
|
|
349
|
-
email: btsConfig.email,
|
|
350
|
-
fileUpload: btsConfig.fileUpload,
|
|
351
|
-
effect: btsConfig.effect,
|
|
352
|
-
ai: btsConfig.ai,
|
|
353
|
-
stateManagement: btsConfig.stateManagement,
|
|
354
|
-
validation: btsConfig.validation,
|
|
355
|
-
forms: btsConfig.forms,
|
|
356
|
-
testing: btsConfig.testing,
|
|
357
|
-
packageManager: btsConfig.packageManager,
|
|
358
|
-
versionChannel: btsConfig.versionChannel,
|
|
359
|
-
dbSetup: btsConfig.dbSetup,
|
|
360
|
-
api: btsConfig.api,
|
|
361
|
-
webDeploy: btsConfig.webDeploy,
|
|
362
|
-
serverDeploy: btsConfig.serverDeploy,
|
|
363
|
-
cssFramework: btsConfig.cssFramework,
|
|
364
|
-
uiLibrary: btsConfig.uiLibrary,
|
|
365
|
-
realtime: btsConfig.realtime,
|
|
366
|
-
jobQueue: btsConfig.jobQueue,
|
|
367
|
-
animation: btsConfig.animation,
|
|
368
|
-
logging: btsConfig.logging,
|
|
369
|
-
observability: btsConfig.observability,
|
|
370
|
-
featureFlags: btsConfig.featureFlags,
|
|
371
|
-
analytics: btsConfig.analytics,
|
|
372
|
-
mobileNavigation: btsConfig.mobileNavigation,
|
|
373
|
-
mobileUI: btsConfig.mobileUI,
|
|
374
|
-
mobileStorage: btsConfig.mobileStorage,
|
|
375
|
-
mobileTesting: btsConfig.mobileTesting,
|
|
376
|
-
mobilePush: btsConfig.mobilePush,
|
|
377
|
-
mobileOTA: btsConfig.mobileOTA,
|
|
378
|
-
mobileDeepLinking: btsConfig.mobileDeepLinking,
|
|
379
|
-
cms: btsConfig.cms,
|
|
380
|
-
caching: btsConfig.caching,
|
|
381
|
-
i18n: btsConfig.i18n,
|
|
382
|
-
search: btsConfig.search,
|
|
383
|
-
fileStorage: btsConfig.fileStorage,
|
|
384
|
-
rustWebFramework: btsConfig.rustWebFramework,
|
|
385
|
-
rustFrontend: btsConfig.rustFrontend,
|
|
386
|
-
rustOrm: btsConfig.rustOrm,
|
|
387
|
-
rustApi: btsConfig.rustApi,
|
|
388
|
-
rustCli: btsConfig.rustCli,
|
|
389
|
-
rustLibraries: btsConfig.rustLibraries,
|
|
390
|
-
rustLogging: btsConfig.rustLogging,
|
|
391
|
-
rustErrorHandling: btsConfig.rustErrorHandling,
|
|
392
|
-
rustCaching: btsConfig.rustCaching,
|
|
393
|
-
rustAuth: btsConfig.rustAuth,
|
|
394
|
-
pythonWebFramework: btsConfig.pythonWebFramework,
|
|
395
|
-
pythonOrm: btsConfig.pythonOrm,
|
|
396
|
-
pythonValidation: btsConfig.pythonValidation,
|
|
397
|
-
pythonAi: btsConfig.pythonAi,
|
|
398
|
-
pythonAuth: btsConfig.pythonAuth,
|
|
399
|
-
pythonApi: btsConfig.pythonApi ?? "none",
|
|
400
|
-
pythonTaskQueue: btsConfig.pythonTaskQueue,
|
|
401
|
-
pythonGraphql: btsConfig.pythonGraphql,
|
|
402
|
-
pythonQuality: btsConfig.pythonQuality,
|
|
403
|
-
goWebFramework: btsConfig.goWebFramework,
|
|
404
|
-
goOrm: btsConfig.goOrm,
|
|
405
|
-
goApi: btsConfig.goApi,
|
|
406
|
-
goCli: btsConfig.goCli,
|
|
407
|
-
goLogging: btsConfig.goLogging,
|
|
408
|
-
goAuth: btsConfig.goAuth,
|
|
409
|
-
javaWebFramework: btsConfig.javaWebFramework,
|
|
410
|
-
javaBuildTool: btsConfig.javaBuildTool,
|
|
411
|
-
javaOrm: btsConfig.javaOrm,
|
|
412
|
-
javaAuth: btsConfig.javaAuth,
|
|
413
|
-
javaLibraries: btsConfig.javaLibraries,
|
|
414
|
-
javaTestingLibraries: btsConfig.javaTestingLibraries,
|
|
415
|
-
elixirWebFramework: btsConfig.elixirWebFramework,
|
|
416
|
-
elixirOrm: btsConfig.elixirOrm,
|
|
417
|
-
elixirAuth: btsConfig.elixirAuth,
|
|
418
|
-
elixirApi: btsConfig.elixirApi,
|
|
419
|
-
elixirRealtime: btsConfig.elixirRealtime,
|
|
420
|
-
elixirJobs: btsConfig.elixirJobs,
|
|
421
|
-
elixirValidation: btsConfig.elixirValidation,
|
|
422
|
-
elixirHttp: btsConfig.elixirHttp,
|
|
423
|
-
elixirJson: btsConfig.elixirJson,
|
|
424
|
-
elixirEmail: btsConfig.elixirEmail,
|
|
425
|
-
elixirCaching: btsConfig.elixirCaching,
|
|
426
|
-
elixirObservability: btsConfig.elixirObservability,
|
|
427
|
-
elixirTesting: btsConfig.elixirTesting,
|
|
428
|
-
elixirQuality: btsConfig.elixirQuality,
|
|
429
|
-
elixirDeploy: btsConfig.elixirDeploy,
|
|
430
|
-
aiDocs: btsConfig.aiDocs,
|
|
431
|
-
stackParts: btsConfig.stackParts
|
|
432
|
-
};
|
|
433
|
-
let configContent = JSON.stringify(baseContent);
|
|
434
|
-
const formatResult = JSONC.format(configContent, void 0, {
|
|
435
|
-
tabSize: 2,
|
|
436
|
-
insertSpaces: true,
|
|
437
|
-
eol: "\n"
|
|
438
|
-
});
|
|
439
|
-
configContent = JSONC.applyEdits(configContent, formatResult);
|
|
440
|
-
const finalContent = `// Better Fullstack configuration file
|
|
441
|
-
// safe to delete
|
|
442
|
-
${graphSummary ? "// For multi-ecosystem projects, graphSummary/effectiveStack and stackParts are the source of truth.\n// Legacy fields such as backend/orm may stay as compatibility fallbacks.\n" : ""}
|
|
443
|
-
|
|
444
|
-
${configContent}`;
|
|
445
|
-
const configPath = path.join(projectConfig.projectDir, BTS_CONFIG_FILE);
|
|
446
|
-
await fs.writeFile(configPath, finalContent, "utf-8");
|
|
447
|
-
}
|
|
448
|
-
async function readBtsConfig(projectDir) {
|
|
449
|
-
try {
|
|
450
|
-
const configPath = path.join(projectDir, BTS_CONFIG_FILE);
|
|
451
|
-
if (!await fs.pathExists(configPath)) return null;
|
|
452
|
-
const configContent = await fs.readFile(configPath, "utf-8");
|
|
453
|
-
const errors = [];
|
|
454
|
-
const config = JSONC.parse(configContent, errors, {
|
|
455
|
-
allowTrailingComma: true,
|
|
456
|
-
disallowComments: false
|
|
457
|
-
});
|
|
458
|
-
if (errors.length > 0) {
|
|
459
|
-
console.warn("Warning: Found errors parsing bts.jsonc:", errors);
|
|
460
|
-
return null;
|
|
461
|
-
}
|
|
462
|
-
if (config.stackParts && config.stackParts.length > 0) {
|
|
463
|
-
const diagnostics = (0, types_exports.compareLegacyConfigToStackParts)(config, config.stackParts);
|
|
464
|
-
if (diagnostics.length > 0) console.warn(`Warning: bts.jsonc legacy fields differ from stackParts; using stackParts for ${diagnostics.map((diagnostic) => diagnostic.path).filter(Boolean).join(", ")}.`);
|
|
465
|
-
return {
|
|
466
|
-
...config,
|
|
467
|
-
...(0, types_exports.stackPartsToLegacyProjectConfigPartial)(config.stackParts),
|
|
468
|
-
stackParts: config.stackParts
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
return {
|
|
472
|
-
...config,
|
|
473
|
-
stackParts: (0, types_exports.legacyProjectConfigToStackParts)(config)
|
|
474
|
-
};
|
|
475
|
-
} catch {
|
|
476
|
-
return null;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
async function updateBtsConfig(projectDir, updates) {
|
|
480
|
-
try {
|
|
481
|
-
const configPath = path.join(projectDir, BTS_CONFIG_FILE);
|
|
482
|
-
if (!await fs.pathExists(configPath)) return;
|
|
483
|
-
let modifiedContent = await fs.readFile(configPath, "utf-8");
|
|
484
|
-
for (const [key, value] of Object.entries(updates)) {
|
|
485
|
-
const editResult = JSONC.modify(modifiedContent, [key], value, { formattingOptions: {
|
|
486
|
-
tabSize: 2,
|
|
487
|
-
insertSpaces: true,
|
|
488
|
-
eol: "\n"
|
|
489
|
-
} });
|
|
490
|
-
modifiedContent = JSONC.applyEdits(modifiedContent, editResult);
|
|
491
|
-
}
|
|
492
|
-
await fs.writeFile(configPath, modifiedContent, "utf-8");
|
|
493
|
-
} catch {}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
//#endregion
|
|
497
|
-
export { getGraphBackendUrl as a, getPrimaryGraphPart as c, getLatestCLIVersion as d, DEFAULT_CONFIG as f, getUserPkgManager as g, getDefaultConfig as h, getGraphBackendDeployInstructions as i, hasGraphPart as l, dependencyVersionMap as m, updateBtsConfig as n, getGraphPart as o, DEFAULT_UI_LIBRARY_BY_FRONTEND as p, writeBtsConfig as r, getGraphSummary as s, readBtsConfig as t, types_exports as u };
|