create-better-fullstack 1.8.1 → 2.0.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/README.md +14 -0
- package/dist/addons-setup-CExVq7Mg.mjs +5 -0
- package/dist/{addons-setup-CUmA_nra.mjs → addons-setup-DqVFXnDv.mjs} +1 -1
- package/dist/bts-config-CSvxsFML.mjs +565 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +55 -9
- package/dist/index.mjs +1665 -989
- package/dist/{mcp-DoPutOIG.mjs → mcp-DfnYbMju.mjs} +1 -1
- package/dist/mcp-entry.mjs +12 -2
- package/package.json +6 -6
- package/dist/addons-setup-CJwQAWFg.mjs +0 -5
- package/dist/bts-config-YcroedMK.mjs +0 -321
package/dist/mcp-entry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { d as getLatestCLIVersion, r as writeBtsConfig, t as readBtsConfig } from "./bts-config-CSvxsFML.mjs";
|
|
3
3
|
import z from "zod";
|
|
4
4
|
import { AISchema, APISchema, AddonsSchema, AnalyticsSchema, AnimationSchema, AstroIntegrationSchema, AuthSchema, BackendSchema, CMSSchema, CSSFrameworkSchema, CachingSchema, DatabaseSchema, DatabaseSetupSchema, EcosystemSchema, EffectSchema, ElixirApiSchema, ElixirAuthSchema, ElixirCachingSchema, ElixirDeploySchema, ElixirEmailSchema, ElixirHttpSchema, ElixirJobsSchema, ElixirJsonSchema, ElixirObservabilitySchema, ElixirOrmSchema, ElixirQualitySchema, ElixirRealtimeSchema, ElixirTestingSchema, ElixirValidationSchema, ElixirWebFrameworkSchema, EmailSchema, ExamplesSchema, FeatureFlagsSchema, FileStorageSchema, FileUploadSchema, FormsSchema, FrontendSchema, GoApiSchema, GoAuthSchema, GoCliSchema, GoLoggingSchema, GoOrmSchema, GoWebFrameworkSchema, I18nSchema, JavaAuthSchema, JavaBuildToolSchema, JavaLibrariesSchema, JavaOrmSchema, JavaTestingLibrariesSchema, JavaWebFrameworkSchema, JobQueueSchema, LoggingSchema, MobileDeepLinkingSchema, MobileNavigationSchema, MobileOTASchema, MobilePushSchema, MobileStorageSchema, MobileTestingSchema, MobileUISchema, OPTION_CATEGORY_METADATA, ORMSchema, ObservabilitySchema, PackageManagerSchema, PaymentsSchema, PythonAiSchema, PythonApiSchema, PythonAuthSchema, PythonGraphqlSchema, PythonOrmSchema, PythonQualitySchema, PythonTaskQueueSchema, PythonValidationSchema, PythonWebFrameworkSchema, RealtimeSchema, RuntimeSchema, RustApiSchema, RustAuthSchema, RustCachingSchema, RustCliSchema, RustErrorHandlingSchema, RustFrontendSchema, RustLibrariesSchema, RustLoggingSchema, RustOrmSchema, RustWebFrameworkSchema, SearchSchema, ServerDeploySchema, StateManagementSchema, TestingSchema, UILibrarySchema, ValidationSchema, WebDeploySchema, analyzeStackCompatibility } from "@better-fullstack/types";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -723,6 +723,16 @@ const GETTING_STARTED_MD = `# Getting Started with Better-Fullstack MCP
|
|
|
723
723
|
- observability: "sentry" (optional)
|
|
724
724
|
2. Tell the user to run: cd my-java-app && ./mvnw test && ./mvnw spring-boot:run
|
|
725
725
|
|
|
726
|
+
## Quick Start — Elixir Project
|
|
727
|
+
1. Call bfs_create_project with:
|
|
728
|
+
- projectName: "my-elixir-app"
|
|
729
|
+
- ecosystem: "elixir"
|
|
730
|
+
- elixirWebFramework: "phoenix"
|
|
731
|
+
- elixirOrm: "ecto-sql"
|
|
732
|
+
- elixirApi: "rest"
|
|
733
|
+
- elixirRealtime: "channels"
|
|
734
|
+
2. Tell the user to run: cd my-elixir-app && mix deps.get && mix phx.server
|
|
735
|
+
|
|
726
736
|
## Adding Features to Existing Projects
|
|
727
737
|
1. Call bfs_add_feature with projectDir pointing to the project root.
|
|
728
738
|
2. Provide addons array with features to add (e.g., ["biome", "turborepo"]).
|
|
@@ -1020,7 +1030,7 @@ async function startMcpServer() {
|
|
|
1020
1030
|
await writeBtsConfig(config);
|
|
1021
1031
|
let addonWarnings = [];
|
|
1022
1032
|
if (config.addons.length > 0 && config.addons[0] !== "none") {
|
|
1023
|
-
const { setupAddons } = await import("./addons-setup-
|
|
1033
|
+
const { setupAddons } = await import("./addons-setup-CExVq7Mg.mjs");
|
|
1024
1034
|
addonWarnings = await setupAddons(config);
|
|
1025
1035
|
}
|
|
1026
1036
|
const installCmd = getInstallCommand(input.ecosystem ?? "typescript", projectName, input.packageManager, input.javaBuildTool, input.javaWebFramework);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-fullstack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Scaffold production-ready fullstack apps in seconds. Pick your stack from 425 options — the CLI wires everything together.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"algolia",
|
|
@@ -127,11 +127,11 @@
|
|
|
127
127
|
"prepublishOnly": "npm run build"
|
|
128
128
|
},
|
|
129
129
|
"dependencies": {
|
|
130
|
-
"@better-fullstack/template-generator": "^
|
|
131
|
-
"@better-fullstack/types": "^
|
|
130
|
+
"@better-fullstack/template-generator": "^2.0.1",
|
|
131
|
+
"@better-fullstack/types": "^2.0.1",
|
|
132
132
|
"@clack/core": "^0.5.0",
|
|
133
|
-
"@clack/prompts": "^1.
|
|
134
|
-
"@orpc/server": "^1.14.
|
|
133
|
+
"@clack/prompts": "^1.5.0",
|
|
134
|
+
"@orpc/server": "^1.14.4",
|
|
135
135
|
"consola": "^3.4.2",
|
|
136
136
|
"env-paths": "^4.0.0",
|
|
137
137
|
"execa": "^9.6.1",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"jsonc-parser": "^3.3.1",
|
|
142
142
|
"oxfmt": "^0.19.0",
|
|
143
143
|
"picocolors": "^1.1.1",
|
|
144
|
-
"tinyglobby": "^0.2.
|
|
144
|
+
"tinyglobby": "^0.2.17",
|
|
145
145
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
146
146
|
"trpc-cli": "^0.12.1",
|
|
147
147
|
"ts-morph": "^27.0.2",
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from "fs-extra";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { createCliDefaultProjectConfigBase } from "@better-fullstack/types";
|
|
6
|
-
import { dependencyVersionMap } from "@better-fullstack/template-generator";
|
|
7
|
-
import * as JSONC from "jsonc-parser";
|
|
8
|
-
|
|
9
|
-
//#region src/utils/get-package-manager.ts
|
|
10
|
-
const getUserPkgManager = () => {
|
|
11
|
-
const userAgent = process.env.npm_config_user_agent;
|
|
12
|
-
if (userAgent?.startsWith("pnpm")) return "pnpm";
|
|
13
|
-
if (userAgent?.startsWith("bun")) return "bun";
|
|
14
|
-
if (userAgent?.startsWith("yarn")) return "yarn";
|
|
15
|
-
return "npm";
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/constants.ts
|
|
20
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
-
const distPath = path.dirname(__filename);
|
|
22
|
-
const PKG_ROOT = path.join(distPath, "../");
|
|
23
|
-
const DEFAULT_CONFIG_BASE = createCliDefaultProjectConfigBase(getUserPkgManager());
|
|
24
|
-
function getDefaultConfig() {
|
|
25
|
-
return {
|
|
26
|
-
...DEFAULT_CONFIG_BASE,
|
|
27
|
-
projectDir: path.resolve(process.cwd(), DEFAULT_CONFIG_BASE.projectName),
|
|
28
|
-
packageManager: getUserPkgManager(),
|
|
29
|
-
frontend: [...DEFAULT_CONFIG_BASE.frontend],
|
|
30
|
-
addons: [...DEFAULT_CONFIG_BASE.addons],
|
|
31
|
-
examples: [...DEFAULT_CONFIG_BASE.examples],
|
|
32
|
-
rustLibraries: [...DEFAULT_CONFIG_BASE.rustLibraries],
|
|
33
|
-
pythonAi: [...DEFAULT_CONFIG_BASE.pythonAi],
|
|
34
|
-
javaLibraries: [...DEFAULT_CONFIG_BASE.javaLibraries],
|
|
35
|
-
javaTestingLibraries: [...DEFAULT_CONFIG_BASE.javaTestingLibraries],
|
|
36
|
-
aiDocs: [...DEFAULT_CONFIG_BASE.aiDocs]
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const DEFAULT_CONFIG = getDefaultConfig();
|
|
40
|
-
/**
|
|
41
|
-
* Default UI library for each frontend framework
|
|
42
|
-
* Falls back based on what's compatible
|
|
43
|
-
*/
|
|
44
|
-
const DEFAULT_UI_LIBRARY_BY_FRONTEND = {
|
|
45
|
-
"tanstack-router": "shadcn-ui",
|
|
46
|
-
"react-router": "shadcn-ui",
|
|
47
|
-
"react-vite": "shadcn-ui",
|
|
48
|
-
"tanstack-start": "shadcn-ui",
|
|
49
|
-
next: "shadcn-ui",
|
|
50
|
-
vinext: "shadcn-ui",
|
|
51
|
-
nuxt: "daisyui",
|
|
52
|
-
svelte: "daisyui",
|
|
53
|
-
solid: "daisyui",
|
|
54
|
-
"solid-start": "daisyui",
|
|
55
|
-
astro: "daisyui",
|
|
56
|
-
qwik: "daisyui",
|
|
57
|
-
angular: "daisyui",
|
|
58
|
-
redwood: "daisyui",
|
|
59
|
-
fresh: "daisyui",
|
|
60
|
-
"native-bare": "none",
|
|
61
|
-
"native-uniwind": "none",
|
|
62
|
-
"native-unistyles": "none",
|
|
63
|
-
none: "none"
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/utils/get-latest-cli-version.ts
|
|
68
|
-
const getLatestCLIVersion = () => {
|
|
69
|
-
const packageJsonPath = path.join(PKG_ROOT, "package.json");
|
|
70
|
-
return fs.readJSONSync(packageJsonPath).version ?? "1.0.0";
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/utils/bts-config.ts
|
|
75
|
-
const BTS_CONFIG_FILE = "bts.jsonc";
|
|
76
|
-
async function writeBtsConfig(projectConfig) {
|
|
77
|
-
const btsConfig = {
|
|
78
|
-
version: getLatestCLIVersion(),
|
|
79
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
80
|
-
ecosystem: projectConfig.ecosystem,
|
|
81
|
-
database: projectConfig.database,
|
|
82
|
-
orm: projectConfig.orm,
|
|
83
|
-
backend: projectConfig.backend,
|
|
84
|
-
runtime: projectConfig.runtime,
|
|
85
|
-
frontend: projectConfig.frontend,
|
|
86
|
-
addons: projectConfig.addons,
|
|
87
|
-
examples: projectConfig.examples,
|
|
88
|
-
auth: projectConfig.auth,
|
|
89
|
-
payments: projectConfig.payments,
|
|
90
|
-
email: projectConfig.email,
|
|
91
|
-
fileUpload: projectConfig.fileUpload,
|
|
92
|
-
effect: projectConfig.effect,
|
|
93
|
-
ai: projectConfig.ai,
|
|
94
|
-
stateManagement: projectConfig.stateManagement,
|
|
95
|
-
validation: projectConfig.validation,
|
|
96
|
-
forms: projectConfig.forms,
|
|
97
|
-
testing: projectConfig.testing,
|
|
98
|
-
packageManager: projectConfig.packageManager,
|
|
99
|
-
versionChannel: projectConfig.versionChannel,
|
|
100
|
-
dbSetup: projectConfig.dbSetup,
|
|
101
|
-
api: projectConfig.api,
|
|
102
|
-
webDeploy: projectConfig.webDeploy,
|
|
103
|
-
serverDeploy: projectConfig.serverDeploy,
|
|
104
|
-
cssFramework: projectConfig.cssFramework,
|
|
105
|
-
uiLibrary: projectConfig.uiLibrary,
|
|
106
|
-
realtime: projectConfig.realtime,
|
|
107
|
-
jobQueue: projectConfig.jobQueue,
|
|
108
|
-
animation: projectConfig.animation,
|
|
109
|
-
logging: projectConfig.logging,
|
|
110
|
-
observability: projectConfig.observability,
|
|
111
|
-
featureFlags: projectConfig.featureFlags,
|
|
112
|
-
analytics: projectConfig.analytics,
|
|
113
|
-
mobileNavigation: projectConfig.mobileNavigation,
|
|
114
|
-
mobileUI: projectConfig.mobileUI,
|
|
115
|
-
mobileStorage: projectConfig.mobileStorage,
|
|
116
|
-
mobileTesting: projectConfig.mobileTesting,
|
|
117
|
-
mobilePush: projectConfig.mobilePush,
|
|
118
|
-
mobileOTA: projectConfig.mobileOTA,
|
|
119
|
-
mobileDeepLinking: projectConfig.mobileDeepLinking,
|
|
120
|
-
cms: projectConfig.cms,
|
|
121
|
-
caching: projectConfig.caching,
|
|
122
|
-
i18n: projectConfig.i18n,
|
|
123
|
-
search: projectConfig.search,
|
|
124
|
-
fileStorage: projectConfig.fileStorage,
|
|
125
|
-
rustWebFramework: projectConfig.rustWebFramework,
|
|
126
|
-
rustFrontend: projectConfig.rustFrontend,
|
|
127
|
-
rustOrm: projectConfig.rustOrm,
|
|
128
|
-
rustApi: projectConfig.rustApi,
|
|
129
|
-
rustCli: projectConfig.rustCli,
|
|
130
|
-
rustLibraries: projectConfig.rustLibraries,
|
|
131
|
-
rustLogging: projectConfig.rustLogging,
|
|
132
|
-
rustErrorHandling: projectConfig.rustErrorHandling,
|
|
133
|
-
rustCaching: projectConfig.rustCaching,
|
|
134
|
-
rustAuth: projectConfig.rustAuth,
|
|
135
|
-
pythonWebFramework: projectConfig.pythonWebFramework,
|
|
136
|
-
pythonOrm: projectConfig.pythonOrm,
|
|
137
|
-
pythonValidation: projectConfig.pythonValidation,
|
|
138
|
-
pythonAi: projectConfig.pythonAi,
|
|
139
|
-
pythonAuth: projectConfig.pythonAuth,
|
|
140
|
-
pythonApi: projectConfig.pythonApi,
|
|
141
|
-
pythonTaskQueue: projectConfig.pythonTaskQueue,
|
|
142
|
-
pythonGraphql: projectConfig.pythonGraphql,
|
|
143
|
-
pythonQuality: projectConfig.pythonQuality,
|
|
144
|
-
goWebFramework: projectConfig.goWebFramework,
|
|
145
|
-
goOrm: projectConfig.goOrm,
|
|
146
|
-
goApi: projectConfig.goApi,
|
|
147
|
-
goCli: projectConfig.goCli,
|
|
148
|
-
goLogging: projectConfig.goLogging,
|
|
149
|
-
goAuth: projectConfig.goAuth,
|
|
150
|
-
javaWebFramework: projectConfig.javaWebFramework,
|
|
151
|
-
javaBuildTool: projectConfig.javaBuildTool,
|
|
152
|
-
javaOrm: projectConfig.javaOrm,
|
|
153
|
-
javaAuth: projectConfig.javaAuth,
|
|
154
|
-
javaLibraries: projectConfig.javaLibraries,
|
|
155
|
-
javaTestingLibraries: projectConfig.javaTestingLibraries,
|
|
156
|
-
elixirWebFramework: projectConfig.elixirWebFramework,
|
|
157
|
-
elixirOrm: projectConfig.elixirOrm,
|
|
158
|
-
elixirAuth: projectConfig.elixirAuth,
|
|
159
|
-
elixirApi: projectConfig.elixirApi,
|
|
160
|
-
elixirRealtime: projectConfig.elixirRealtime,
|
|
161
|
-
elixirJobs: projectConfig.elixirJobs,
|
|
162
|
-
elixirValidation: projectConfig.elixirValidation,
|
|
163
|
-
elixirHttp: projectConfig.elixirHttp,
|
|
164
|
-
elixirJson: projectConfig.elixirJson,
|
|
165
|
-
elixirEmail: projectConfig.elixirEmail,
|
|
166
|
-
elixirCaching: projectConfig.elixirCaching,
|
|
167
|
-
elixirObservability: projectConfig.elixirObservability,
|
|
168
|
-
elixirTesting: projectConfig.elixirTesting,
|
|
169
|
-
elixirQuality: projectConfig.elixirQuality,
|
|
170
|
-
elixirDeploy: projectConfig.elixirDeploy,
|
|
171
|
-
aiDocs: projectConfig.aiDocs
|
|
172
|
-
};
|
|
173
|
-
const baseContent = {
|
|
174
|
-
$schema: "https://better-fullstack-web.vercel.app/schema.json",
|
|
175
|
-
version: btsConfig.version,
|
|
176
|
-
createdAt: btsConfig.createdAt,
|
|
177
|
-
ecosystem: btsConfig.ecosystem,
|
|
178
|
-
database: btsConfig.database,
|
|
179
|
-
orm: btsConfig.orm,
|
|
180
|
-
backend: btsConfig.backend,
|
|
181
|
-
runtime: btsConfig.runtime,
|
|
182
|
-
frontend: btsConfig.frontend,
|
|
183
|
-
addons: btsConfig.addons,
|
|
184
|
-
examples: btsConfig.examples,
|
|
185
|
-
auth: btsConfig.auth,
|
|
186
|
-
payments: btsConfig.payments,
|
|
187
|
-
email: btsConfig.email,
|
|
188
|
-
fileUpload: btsConfig.fileUpload,
|
|
189
|
-
effect: btsConfig.effect,
|
|
190
|
-
ai: btsConfig.ai,
|
|
191
|
-
stateManagement: btsConfig.stateManagement,
|
|
192
|
-
validation: btsConfig.validation,
|
|
193
|
-
forms: btsConfig.forms,
|
|
194
|
-
testing: btsConfig.testing,
|
|
195
|
-
packageManager: btsConfig.packageManager,
|
|
196
|
-
versionChannel: btsConfig.versionChannel,
|
|
197
|
-
dbSetup: btsConfig.dbSetup,
|
|
198
|
-
api: btsConfig.api,
|
|
199
|
-
webDeploy: btsConfig.webDeploy,
|
|
200
|
-
serverDeploy: btsConfig.serverDeploy,
|
|
201
|
-
cssFramework: btsConfig.cssFramework,
|
|
202
|
-
uiLibrary: btsConfig.uiLibrary,
|
|
203
|
-
realtime: btsConfig.realtime,
|
|
204
|
-
jobQueue: btsConfig.jobQueue,
|
|
205
|
-
animation: btsConfig.animation,
|
|
206
|
-
logging: btsConfig.logging,
|
|
207
|
-
observability: btsConfig.observability,
|
|
208
|
-
featureFlags: btsConfig.featureFlags,
|
|
209
|
-
analytics: btsConfig.analytics,
|
|
210
|
-
mobileNavigation: btsConfig.mobileNavigation,
|
|
211
|
-
mobileUI: btsConfig.mobileUI,
|
|
212
|
-
mobileStorage: btsConfig.mobileStorage,
|
|
213
|
-
mobileTesting: btsConfig.mobileTesting,
|
|
214
|
-
mobilePush: btsConfig.mobilePush,
|
|
215
|
-
mobileOTA: btsConfig.mobileOTA,
|
|
216
|
-
mobileDeepLinking: btsConfig.mobileDeepLinking,
|
|
217
|
-
cms: btsConfig.cms,
|
|
218
|
-
caching: btsConfig.caching,
|
|
219
|
-
i18n: btsConfig.i18n,
|
|
220
|
-
search: btsConfig.search,
|
|
221
|
-
fileStorage: btsConfig.fileStorage,
|
|
222
|
-
rustWebFramework: btsConfig.rustWebFramework,
|
|
223
|
-
rustFrontend: btsConfig.rustFrontend,
|
|
224
|
-
rustOrm: btsConfig.rustOrm,
|
|
225
|
-
rustApi: btsConfig.rustApi,
|
|
226
|
-
rustCli: btsConfig.rustCli,
|
|
227
|
-
rustLibraries: btsConfig.rustLibraries,
|
|
228
|
-
rustLogging: btsConfig.rustLogging,
|
|
229
|
-
rustErrorHandling: btsConfig.rustErrorHandling,
|
|
230
|
-
rustCaching: btsConfig.rustCaching,
|
|
231
|
-
rustAuth: btsConfig.rustAuth,
|
|
232
|
-
pythonWebFramework: btsConfig.pythonWebFramework,
|
|
233
|
-
pythonOrm: btsConfig.pythonOrm,
|
|
234
|
-
pythonValidation: btsConfig.pythonValidation,
|
|
235
|
-
pythonAi: btsConfig.pythonAi,
|
|
236
|
-
pythonAuth: btsConfig.pythonAuth,
|
|
237
|
-
pythonApi: btsConfig.pythonApi ?? "none",
|
|
238
|
-
pythonTaskQueue: btsConfig.pythonTaskQueue,
|
|
239
|
-
pythonGraphql: btsConfig.pythonGraphql,
|
|
240
|
-
pythonQuality: btsConfig.pythonQuality,
|
|
241
|
-
goWebFramework: btsConfig.goWebFramework,
|
|
242
|
-
goOrm: btsConfig.goOrm,
|
|
243
|
-
goApi: btsConfig.goApi,
|
|
244
|
-
goCli: btsConfig.goCli,
|
|
245
|
-
goLogging: btsConfig.goLogging,
|
|
246
|
-
goAuth: btsConfig.goAuth,
|
|
247
|
-
javaWebFramework: btsConfig.javaWebFramework,
|
|
248
|
-
javaBuildTool: btsConfig.javaBuildTool,
|
|
249
|
-
javaOrm: btsConfig.javaOrm,
|
|
250
|
-
javaAuth: btsConfig.javaAuth,
|
|
251
|
-
javaLibraries: btsConfig.javaLibraries,
|
|
252
|
-
javaTestingLibraries: btsConfig.javaTestingLibraries,
|
|
253
|
-
elixirWebFramework: btsConfig.elixirWebFramework,
|
|
254
|
-
elixirOrm: btsConfig.elixirOrm,
|
|
255
|
-
elixirAuth: btsConfig.elixirAuth,
|
|
256
|
-
elixirApi: btsConfig.elixirApi,
|
|
257
|
-
elixirRealtime: btsConfig.elixirRealtime,
|
|
258
|
-
elixirJobs: btsConfig.elixirJobs,
|
|
259
|
-
elixirValidation: btsConfig.elixirValidation,
|
|
260
|
-
elixirHttp: btsConfig.elixirHttp,
|
|
261
|
-
elixirJson: btsConfig.elixirJson,
|
|
262
|
-
elixirEmail: btsConfig.elixirEmail,
|
|
263
|
-
elixirCaching: btsConfig.elixirCaching,
|
|
264
|
-
elixirObservability: btsConfig.elixirObservability,
|
|
265
|
-
elixirTesting: btsConfig.elixirTesting,
|
|
266
|
-
elixirQuality: btsConfig.elixirQuality,
|
|
267
|
-
elixirDeploy: btsConfig.elixirDeploy,
|
|
268
|
-
aiDocs: btsConfig.aiDocs
|
|
269
|
-
};
|
|
270
|
-
let configContent = JSON.stringify(baseContent);
|
|
271
|
-
const formatResult = JSONC.format(configContent, void 0, {
|
|
272
|
-
tabSize: 2,
|
|
273
|
-
insertSpaces: true,
|
|
274
|
-
eol: "\n"
|
|
275
|
-
});
|
|
276
|
-
configContent = JSONC.applyEdits(configContent, formatResult);
|
|
277
|
-
const finalContent = `// Better Fullstack configuration file
|
|
278
|
-
// safe to delete
|
|
279
|
-
|
|
280
|
-
${configContent}`;
|
|
281
|
-
const configPath = path.join(projectConfig.projectDir, BTS_CONFIG_FILE);
|
|
282
|
-
await fs.writeFile(configPath, finalContent, "utf-8");
|
|
283
|
-
}
|
|
284
|
-
async function readBtsConfig(projectDir) {
|
|
285
|
-
try {
|
|
286
|
-
const configPath = path.join(projectDir, BTS_CONFIG_FILE);
|
|
287
|
-
if (!await fs.pathExists(configPath)) return null;
|
|
288
|
-
const configContent = await fs.readFile(configPath, "utf-8");
|
|
289
|
-
const errors = [];
|
|
290
|
-
const config = JSONC.parse(configContent, errors, {
|
|
291
|
-
allowTrailingComma: true,
|
|
292
|
-
disallowComments: false
|
|
293
|
-
});
|
|
294
|
-
if (errors.length > 0) {
|
|
295
|
-
console.warn("Warning: Found errors parsing bts.jsonc:", errors);
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
298
|
-
return config;
|
|
299
|
-
} catch {
|
|
300
|
-
return null;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
async function updateBtsConfig(projectDir, updates) {
|
|
304
|
-
try {
|
|
305
|
-
const configPath = path.join(projectDir, BTS_CONFIG_FILE);
|
|
306
|
-
if (!await fs.pathExists(configPath)) return;
|
|
307
|
-
let modifiedContent = await fs.readFile(configPath, "utf-8");
|
|
308
|
-
for (const [key, value] of Object.entries(updates)) {
|
|
309
|
-
const editResult = JSONC.modify(modifiedContent, [key], value, { formattingOptions: {
|
|
310
|
-
tabSize: 2,
|
|
311
|
-
insertSpaces: true,
|
|
312
|
-
eol: "\n"
|
|
313
|
-
} });
|
|
314
|
-
modifiedContent = JSONC.applyEdits(modifiedContent, editResult);
|
|
315
|
-
}
|
|
316
|
-
await fs.writeFile(configPath, modifiedContent, "utf-8");
|
|
317
|
-
} catch {}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
//#endregion
|
|
321
|
-
export { DEFAULT_CONFIG as a, getDefaultConfig as c, getLatestCLIVersion as i, getUserPkgManager as l, updateBtsConfig as n, DEFAULT_UI_LIBRARY_BY_FRONTEND as o, writeBtsConfig as r, dependencyVersionMap as s, readBtsConfig as t };
|