create-better-t-stack 3.7.3-canary.8e4d5716 → 3.7.3-canary.fe324be3

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.
Files changed (104) hide show
  1. package/dist/cli.d.ts +1 -0
  2. package/dist/cli.js +8 -0
  3. package/dist/index.d.ts +347 -0
  4. package/dist/index.js +4 -0
  5. package/dist/src-yXf02Wox.js +7077 -0
  6. package/package.json +11 -7
  7. package/src/cli.ts +0 -3
  8. package/src/constants.ts +0 -188
  9. package/src/helpers/addons/addons-setup.ts +0 -226
  10. package/src/helpers/addons/examples-setup.ts +0 -104
  11. package/src/helpers/addons/fumadocs-setup.ts +0 -103
  12. package/src/helpers/addons/ruler-setup.ts +0 -139
  13. package/src/helpers/addons/starlight-setup.ts +0 -51
  14. package/src/helpers/addons/tauri-setup.ts +0 -96
  15. package/src/helpers/addons/ultracite-setup.ts +0 -232
  16. package/src/helpers/addons/vite-pwa-setup.ts +0 -59
  17. package/src/helpers/core/add-addons.ts +0 -85
  18. package/src/helpers/core/add-deployment.ts +0 -102
  19. package/src/helpers/core/api-setup.ts +0 -280
  20. package/src/helpers/core/auth-setup.ts +0 -203
  21. package/src/helpers/core/backend-setup.ts +0 -73
  22. package/src/helpers/core/command-handlers.ts +0 -354
  23. package/src/helpers/core/convex-codegen.ts +0 -14
  24. package/src/helpers/core/create-project.ts +0 -133
  25. package/src/helpers/core/create-readme.ts +0 -687
  26. package/src/helpers/core/db-setup.ts +0 -184
  27. package/src/helpers/core/detect-project-config.ts +0 -41
  28. package/src/helpers/core/env-setup.ts +0 -449
  29. package/src/helpers/core/git.ts +0 -31
  30. package/src/helpers/core/install-dependencies.ts +0 -32
  31. package/src/helpers/core/payments-setup.ts +0 -48
  32. package/src/helpers/core/post-installation.ts +0 -383
  33. package/src/helpers/core/project-config.ts +0 -246
  34. package/src/helpers/core/runtime-setup.ts +0 -76
  35. package/src/helpers/core/template-manager.ts +0 -917
  36. package/src/helpers/core/workspace-setup.ts +0 -184
  37. package/src/helpers/database-providers/d1-setup.ts +0 -28
  38. package/src/helpers/database-providers/docker-compose-setup.ts +0 -50
  39. package/src/helpers/database-providers/mongodb-atlas-setup.ts +0 -186
  40. package/src/helpers/database-providers/neon-setup.ts +0 -243
  41. package/src/helpers/database-providers/planetscale-setup.ts +0 -78
  42. package/src/helpers/database-providers/prisma-postgres-setup.ts +0 -196
  43. package/src/helpers/database-providers/supabase-setup.ts +0 -218
  44. package/src/helpers/database-providers/turso-setup.ts +0 -309
  45. package/src/helpers/deployment/alchemy/alchemy-combined-setup.ts +0 -80
  46. package/src/helpers/deployment/alchemy/alchemy-next-setup.ts +0 -51
  47. package/src/helpers/deployment/alchemy/alchemy-nuxt-setup.ts +0 -104
  48. package/src/helpers/deployment/alchemy/alchemy-react-router-setup.ts +0 -32
  49. package/src/helpers/deployment/alchemy/alchemy-solid-setup.ts +0 -32
  50. package/src/helpers/deployment/alchemy/alchemy-svelte-setup.ts +0 -98
  51. package/src/helpers/deployment/alchemy/alchemy-tanstack-router-setup.ts +0 -33
  52. package/src/helpers/deployment/alchemy/alchemy-tanstack-start-setup.ts +0 -98
  53. package/src/helpers/deployment/alchemy/env-dts-setup.ts +0 -76
  54. package/src/helpers/deployment/alchemy/index.ts +0 -7
  55. package/src/helpers/deployment/server-deploy-setup.ts +0 -55
  56. package/src/helpers/deployment/web-deploy-setup.ts +0 -58
  57. package/src/index.ts +0 -253
  58. package/src/prompts/addons.ts +0 -178
  59. package/src/prompts/api.ts +0 -49
  60. package/src/prompts/auth.ts +0 -84
  61. package/src/prompts/backend.ts +0 -83
  62. package/src/prompts/config-prompts.ts +0 -138
  63. package/src/prompts/database-setup.ts +0 -112
  64. package/src/prompts/database.ts +0 -57
  65. package/src/prompts/examples.ts +0 -64
  66. package/src/prompts/frontend.ts +0 -118
  67. package/src/prompts/git.ts +0 -16
  68. package/src/prompts/install.ts +0 -16
  69. package/src/prompts/orm.ts +0 -53
  70. package/src/prompts/package-manager.ts +0 -32
  71. package/src/prompts/payments.ts +0 -50
  72. package/src/prompts/project-name.ts +0 -86
  73. package/src/prompts/runtime.ts +0 -47
  74. package/src/prompts/server-deploy.ts +0 -91
  75. package/src/prompts/web-deploy.ts +0 -107
  76. package/src/types.ts +0 -2
  77. package/src/utils/add-package-deps.ts +0 -57
  78. package/src/utils/analytics.ts +0 -39
  79. package/src/utils/better-auth-plugin-setup.ts +0 -71
  80. package/src/utils/biome-formatter.ts +0 -82
  81. package/src/utils/bts-config.ts +0 -122
  82. package/src/utils/command-exists.ts +0 -16
  83. package/src/utils/compatibility-rules.ts +0 -319
  84. package/src/utils/compatibility.ts +0 -11
  85. package/src/utils/config-processing.ts +0 -130
  86. package/src/utils/config-validation.ts +0 -470
  87. package/src/utils/display-config.ts +0 -96
  88. package/src/utils/docker-utils.ts +0 -70
  89. package/src/utils/errors.ts +0 -32
  90. package/src/utils/generate-reproducible-command.ts +0 -53
  91. package/src/utils/get-latest-cli-version.ts +0 -11
  92. package/src/utils/get-package-manager.ts +0 -13
  93. package/src/utils/open-url.ts +0 -25
  94. package/src/utils/package-runner.ts +0 -23
  95. package/src/utils/project-directory.ts +0 -102
  96. package/src/utils/project-name-validation.ts +0 -43
  97. package/src/utils/render-title.ts +0 -48
  98. package/src/utils/setup-catalogs.ts +0 -192
  99. package/src/utils/sponsors.ts +0 -101
  100. package/src/utils/telemetry.ts +0 -19
  101. package/src/utils/template-processor.ts +0 -64
  102. package/src/utils/templates.ts +0 -94
  103. package/src/utils/ts-morph.ts +0 -26
  104. package/src/validation.ts +0 -117
@@ -1,32 +0,0 @@
1
- import { spinner } from "@clack/prompts";
2
- import consola from "consola";
3
- import { $ } from "execa";
4
- import pc from "picocolors";
5
- import type { Addons, PackageManager } from "../../types";
6
-
7
- export async function installDependencies({
8
- projectDir,
9
- packageManager,
10
- }: {
11
- projectDir: string;
12
- packageManager: PackageManager;
13
- addons?: Addons[];
14
- }) {
15
- const s = spinner();
16
-
17
- try {
18
- s.start(`Running ${packageManager} install...`);
19
-
20
- await $({
21
- cwd: projectDir,
22
- stderr: "inherit",
23
- })`${packageManager} install`;
24
-
25
- s.stop("Dependencies installed successfully");
26
- } catch (error) {
27
- s.stop(pc.red("Failed to install dependencies"));
28
- if (error instanceof Error) {
29
- consola.error(pc.red(`Installation error: ${error.message}`));
30
- }
31
- }
32
- }
@@ -1,48 +0,0 @@
1
- import path from "node:path";
2
- import fs from "fs-extra";
3
- import type { ProjectConfig } from "../../types";
4
- import { addPackageDependency } from "../../utils/add-package-deps";
5
-
6
- export async function setupPayments(config: ProjectConfig) {
7
- const { payments, projectDir, frontend } = config;
8
-
9
- if (!payments || payments === "none") {
10
- return;
11
- }
12
-
13
- const clientDir = path.join(projectDir, "apps/web");
14
- const authDir = path.join(projectDir, "packages/auth");
15
-
16
- const clientDirExists = await fs.pathExists(clientDir);
17
- const authDirExists = await fs.pathExists(authDir);
18
-
19
- if (payments === "polar") {
20
- if (authDirExists) {
21
- await addPackageDependency({
22
- dependencies: ["@polar-sh/better-auth", "@polar-sh/sdk"],
23
- projectDir: authDir,
24
- });
25
- }
26
-
27
- if (clientDirExists) {
28
- const hasWebFrontend = frontend.some((f) =>
29
- [
30
- "react-router",
31
- "tanstack-router",
32
- "tanstack-start",
33
- "next",
34
- "nuxt",
35
- "svelte",
36
- "solid",
37
- ].includes(f),
38
- );
39
-
40
- if (hasWebFrontend) {
41
- await addPackageDependency({
42
- dependencies: ["@polar-sh/better-auth"],
43
- projectDir: clientDir,
44
- });
45
- }
46
- }
47
- }
48
- }
@@ -1,383 +0,0 @@
1
- import { consola } from "consola";
2
- import pc from "picocolors";
3
- import type { Database, DatabaseSetup, ORM, ProjectConfig, Runtime } from "../../types";
4
- import { getDockerStatus } from "../../utils/docker-utils";
5
- export async function displayPostInstallInstructions(
6
- config: ProjectConfig & { depsInstalled: boolean },
7
- ) {
8
- const {
9
- api,
10
- database,
11
- relativePath,
12
- packageManager,
13
- depsInstalled,
14
- orm,
15
- addons,
16
- runtime,
17
- frontend,
18
- backend,
19
- dbSetup,
20
- webDeploy,
21
- serverDeploy,
22
- } = config;
23
-
24
- const isConvex = backend === "convex";
25
- const isBackendSelf = backend === "self";
26
- const runCmd =
27
- packageManager === "npm" ? "npm run" : packageManager === "pnpm" ? "pnpm run" : "bun run";
28
- const cdCmd = `cd ${relativePath}`;
29
- const hasHuskyOrBiome = addons?.includes("husky") || addons?.includes("biome");
30
-
31
- const databaseInstructions =
32
- !isConvex && database !== "none"
33
- ? await getDatabaseInstructions(
34
- database,
35
- orm,
36
- runCmd,
37
- runtime,
38
- dbSetup,
39
- serverDeploy,
40
- backend,
41
- )
42
- : "";
43
-
44
- const tauriInstructions = addons?.includes("tauri") ? getTauriInstructions(runCmd) : "";
45
- const lintingInstructions = hasHuskyOrBiome ? getLintingInstructions(runCmd) : "";
46
- const nativeInstructions =
47
- (frontend?.includes("native-bare") ||
48
- frontend?.includes("native-uniwind") ||
49
- frontend?.includes("native-unistyles")) &&
50
- backend !== "none"
51
- ? getNativeInstructions(isConvex, isBackendSelf, frontend || [])
52
- : "";
53
- const pwaInstructions =
54
- addons?.includes("pwa") && frontend?.includes("react-router") ? getPwaInstructions() : "";
55
- const starlightInstructions = addons?.includes("starlight")
56
- ? getStarlightInstructions(runCmd)
57
- : "";
58
- const clerkInstructions = isConvex && config.auth === "clerk" ? getClerkInstructions() : "";
59
- const polarInstructions =
60
- config.payments === "polar" && config.auth === "better-auth"
61
- ? getPolarInstructions(backend)
62
- : "";
63
- const alchemyDeployInstructions = getAlchemyDeployInstructions(
64
- runCmd,
65
- webDeploy,
66
- serverDeploy,
67
- backend,
68
- );
69
-
70
- const hasWeb = frontend?.some((f) =>
71
- [
72
- "tanstack-router",
73
- "react-router",
74
- "next",
75
- "tanstack-start",
76
- "nuxt",
77
- "svelte",
78
- "solid",
79
- ].includes(f),
80
- );
81
- const hasNative =
82
- frontend?.includes("native-bare") ||
83
- frontend?.includes("native-uniwind") ||
84
- frontend?.includes("native-unistyles");
85
-
86
- const bunWebNativeWarning =
87
- packageManager === "bun" && hasNative && hasWeb ? getBunWebNativeWarning() : "";
88
- const noOrmWarning = !isConvex && database !== "none" && orm === "none" ? getNoOrmWarning() : "";
89
-
90
- const hasReactRouter = frontend?.includes("react-router");
91
- const hasSvelte = frontend?.includes("svelte");
92
- const webPort = hasReactRouter || hasSvelte ? "5173" : "3001";
93
-
94
- let output = `${pc.bold("Next steps")}\n${pc.cyan("1.")} ${cdCmd}\n`;
95
- let stepCounter = 2;
96
-
97
- if (!depsInstalled) {
98
- output += `${pc.cyan(`${stepCounter++}.`)} ${packageManager} install\n`;
99
- }
100
-
101
- if (
102
- database === "sqlite" &&
103
- dbSetup === "none" &&
104
- (serverDeploy === "alchemy" || webDeploy === "alchemy")
105
- ) {
106
- output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} db:local\n${pc.dim(
107
- " (starts local SQLite server for Workers compatibility)",
108
- )}\n`;
109
- }
110
-
111
- if (isConvex) {
112
- output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev:setup\n${pc.dim(
113
- " (this will guide you through Convex project setup)",
114
- )}\n`;
115
-
116
- output += `${pc.cyan(`${stepCounter++}.`)} Copy environment variables from\n${pc.white(
117
- " packages/backend/.env.local",
118
- )} to ${pc.white("apps/*/.env")}\n`;
119
- output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev\n\n`;
120
- } else if (isBackendSelf) {
121
- output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev\n`;
122
- } else {
123
- if (runtime !== "workers") {
124
- output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev\n`;
125
- }
126
-
127
- if (runtime === "workers") {
128
- if (dbSetup === "d1") {
129
- output += `${pc.yellow(
130
- "IMPORTANT:",
131
- )} Complete D1 database setup first\n (see Database commands below)\n`;
132
- }
133
- output += `${pc.cyan(`${stepCounter++}.`)} ${runCmd} dev\n`;
134
- }
135
- }
136
-
137
- const hasStandaloneBackend = backend !== "none";
138
- const hasAnyService =
139
- hasWeb || hasStandaloneBackend || addons?.includes("starlight") || addons?.includes("fumadocs");
140
-
141
- if (hasAnyService) {
142
- output += `${pc.bold("Your project will be available at:")}\n`;
143
-
144
- if (hasWeb) {
145
- output += `${pc.cyan("•")} Frontend: http://localhost:${webPort}\n`;
146
- } else if (!hasNative && !addons?.includes("starlight")) {
147
- output += `${pc.yellow(
148
- "NOTE:",
149
- )} You are creating a backend-only app\n (no frontend selected)\n`;
150
- }
151
-
152
- if (!isConvex && !isBackendSelf && hasStandaloneBackend) {
153
- output += `${pc.cyan("•")} Backend API: http://localhost:3000\n`;
154
-
155
- if (api === "orpc") {
156
- output += `${pc.cyan("•")} OpenAPI (Scalar UI): http://localhost:3000/api-reference\n`;
157
- }
158
- }
159
-
160
- if (isBackendSelf && api === "orpc") {
161
- output += `${pc.cyan("•")} OpenAPI (Scalar UI): http://localhost:${webPort}/api/rpc/api-reference\n`;
162
- }
163
-
164
- if (addons?.includes("starlight")) {
165
- output += `${pc.cyan("•")} Docs: http://localhost:4321\n`;
166
- }
167
-
168
- if (addons?.includes("fumadocs")) {
169
- output += `${pc.cyan("•")} Fumadocs: http://localhost:4000\n`;
170
- }
171
- }
172
-
173
- if (nativeInstructions) output += `\n${nativeInstructions.trim()}\n`;
174
- if (databaseInstructions) output += `\n${databaseInstructions.trim()}\n`;
175
- if (tauriInstructions) output += `\n${tauriInstructions.trim()}\n`;
176
- if (lintingInstructions) output += `\n${lintingInstructions.trim()}\n`;
177
- if (pwaInstructions) output += `\n${pwaInstructions.trim()}\n`;
178
- if (alchemyDeployInstructions) output += `\n${alchemyDeployInstructions.trim()}\n`;
179
- if (starlightInstructions) output += `\n${starlightInstructions.trim()}\n`;
180
- if (clerkInstructions) output += `\n${clerkInstructions.trim()}\n`;
181
- if (polarInstructions) output += `\n${polarInstructions.trim()}\n`;
182
-
183
- if (noOrmWarning) output += `\n${noOrmWarning.trim()}\n`;
184
- if (bunWebNativeWarning) output += `\n${bunWebNativeWarning.trim()}\n`;
185
-
186
- output += `\n${pc.bold(
187
- "Like Better-T-Stack?",
188
- )} Please consider giving us a star\n on GitHub:\n`;
189
- output += pc.cyan("https://github.com/AmanVarshney01/create-better-t-stack");
190
-
191
- consola.box(output);
192
- }
193
-
194
- function getNativeInstructions(isConvex: boolean, isBackendSelf: boolean, _frontend: string[]) {
195
- const envVar = isConvex ? "EXPO_PUBLIC_CONVEX_URL" : "EXPO_PUBLIC_SERVER_URL";
196
- const exampleUrl = isConvex
197
- ? "https://<YOUR_CONVEX_URL>"
198
- : isBackendSelf
199
- ? "http://<YOUR_LOCAL_IP>:3001"
200
- : "http://<YOUR_LOCAL_IP>:3000";
201
- const envFileName = ".env";
202
- const ipNote = isConvex
203
- ? "your Convex deployment URL (find after running 'dev:setup')"
204
- : "your local IP address";
205
-
206
- let instructions = `${pc.yellow(
207
- "NOTE:",
208
- )} For Expo connectivity issues, update\n apps/native/${envFileName} with ${ipNote}:\n ${`${envVar}=${exampleUrl}`}\n`;
209
-
210
- if (isConvex) {
211
- instructions += `\n${pc.yellow(
212
- "IMPORTANT:",
213
- )} When using local development with Convex and native apps,\n ensure you use your local IP address instead of localhost or 127.0.0.1\n for proper connectivity.\n`;
214
- }
215
-
216
- return instructions;
217
- }
218
-
219
- function getLintingInstructions(runCmd?: string) {
220
- return `${pc.bold("Linting and formatting:")}\n${pc.cyan(
221
- "•",
222
- )} Format and lint fix: ${`${runCmd} check`}\n`;
223
- }
224
-
225
- async function getDatabaseInstructions(
226
- database: Database,
227
- orm?: ORM,
228
- runCmd?: string,
229
- _runtime?: Runtime,
230
- dbSetup?: DatabaseSetup,
231
- serverDeploy?: string,
232
- _backend?: string,
233
- ) {
234
- const instructions: string[] = [];
235
-
236
- if (dbSetup === "docker") {
237
- const dockerStatus = await getDockerStatus(database);
238
-
239
- if (dockerStatus.message) {
240
- instructions.push(dockerStatus.message);
241
- instructions.push("");
242
- }
243
- }
244
-
245
- if (dbSetup === "d1" && serverDeploy === "alchemy") {
246
- if (orm === "drizzle") {
247
- instructions.push(`${pc.cyan("•")} Generate migrations: ${`${runCmd} db:generate`}`);
248
- } else if (orm === "prisma") {
249
- instructions.push(`${pc.cyan("•")} Generate Prisma client: ${`${runCmd} db:generate`}`);
250
- instructions.push(`${pc.cyan("•")} Apply migrations: ${`${runCmd} db:migrate`}`);
251
- }
252
- }
253
-
254
- if (dbSetup === "planetscale") {
255
- if (database === "mysql" && orm === "drizzle") {
256
- instructions.push(
257
- `${pc.yellow("NOTE:")} Enable foreign key constraints in PlanetScale database settings`,
258
- );
259
- }
260
- if (database === "mysql" && orm === "prisma") {
261
- instructions.push(
262
- `${pc.yellow(
263
- "NOTE:",
264
- )} How to handle Prisma migrations with PlanetScale:\n https://github.com/prisma/prisma/issues/7292`,
265
- );
266
- }
267
- }
268
-
269
- if (dbSetup === "turso" && orm === "prisma") {
270
- instructions.push(
271
- `${pc.yellow(
272
- "NOTE:",
273
- )} Follow Turso's Prisma guide for migrations via the Turso CLI:\n https://docs.turso.tech/sdk/ts/orm/prisma`,
274
- );
275
- }
276
-
277
- if (orm === "prisma") {
278
- if (database === "mongodb" && dbSetup === "docker") {
279
- instructions.push(
280
- `${pc.yellow("WARNING:")} Prisma + MongoDB + Docker combination\n may not work.`,
281
- );
282
- }
283
- if (dbSetup === "docker") {
284
- instructions.push(`${pc.cyan("•")} Start docker container: ${`${runCmd} db:start`}`);
285
- }
286
- if (!(dbSetup === "d1" && serverDeploy === "alchemy")) {
287
- instructions.push(`${pc.cyan("•")} Generate Prisma Client: ${`${runCmd} db:generate`}`);
288
- instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
289
- }
290
- if (!(dbSetup === "d1" && serverDeploy === "alchemy")) {
291
- instructions.push(`${pc.cyan("•")} Database UI: ${`${runCmd} db:studio`}`);
292
- }
293
- } else if (orm === "drizzle") {
294
- if (dbSetup === "docker") {
295
- instructions.push(`${pc.cyan("•")} Start docker container: ${`${runCmd} db:start`}`);
296
- }
297
- if (dbSetup !== "d1") {
298
- instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
299
- }
300
- if (!(dbSetup === "d1" && serverDeploy === "alchemy")) {
301
- instructions.push(`${pc.cyan("•")} Database UI: ${`${runCmd} db:studio`}`);
302
- }
303
- } else if (orm === "mongoose") {
304
- if (dbSetup === "docker") {
305
- instructions.push(`${pc.cyan("•")} Start docker container: ${`${runCmd} db:start`}`);
306
- }
307
- } else if (orm === "none") {
308
- instructions.push(`${pc.yellow("NOTE:")} Manual database schema setup\n required.`);
309
- }
310
-
311
- return instructions.length ? `${pc.bold("Database commands:")}\n${instructions.join("\n")}` : "";
312
- }
313
-
314
- function getTauriInstructions(runCmd?: string) {
315
- return `\n${pc.bold("Desktop app with Tauri:")}\n${pc.cyan(
316
- "•",
317
- )} Start desktop app: ${`cd apps/web && ${runCmd} desktop:dev`}\n${pc.cyan(
318
- "•",
319
- )} Build desktop app: ${`cd apps/web && ${runCmd} desktop:build`}\n${pc.yellow(
320
- "NOTE:",
321
- )} Tauri requires Rust and platform-specific dependencies.\n See: ${"https://v2.tauri.app/start/prerequisites/"}`;
322
- }
323
-
324
- function getPwaInstructions() {
325
- return `\n${pc.bold("PWA with React Router v7:")}\n${pc.yellow(
326
- "NOTE:",
327
- )} There is a known compatibility issue between VitePWA\n and React Router v7. See:\n https://github.com/vite-pwa/vite-plugin-pwa/issues/809`;
328
- }
329
-
330
- function getStarlightInstructions(runCmd?: string) {
331
- return `\n${pc.bold("Documentation with Starlight:")}\n${pc.cyan(
332
- "•",
333
- )} Start docs site: ${`cd apps/docs && ${runCmd} dev`}\n${pc.cyan(
334
- "•",
335
- )} Build docs site: ${`cd apps/docs && ${runCmd} build`}`;
336
- }
337
-
338
- function getNoOrmWarning() {
339
- return `\n${pc.yellow(
340
- "WARNING:",
341
- )} Database selected without an ORM. Features requiring\n database access (e.g., examples, auth) need manual setup.`;
342
- }
343
-
344
- function getBunWebNativeWarning() {
345
- return `\n${pc.yellow(
346
- "WARNING:",
347
- )} 'bun' might cause issues with web + native apps in a monorepo.\n Use 'pnpm' if problems arise.`;
348
- }
349
-
350
- function getClerkInstructions() {
351
- return `${pc.bold("Clerk Authentication Setup:")}\n${pc.cyan("•")} Follow the guide: ${pc.underline("https://docs.convex.dev/auth/clerk")}\n${pc.cyan("•")} Set CLERK_JWT_ISSUER_DOMAIN in Convex Dashboard\n${pc.cyan("•")} Set CLERK_PUBLISHABLE_KEY in apps/*/.env`;
352
- }
353
-
354
- function getPolarInstructions(backend?: string) {
355
- const envPath = backend === "self" ? "apps/web/.env" : "apps/server/.env";
356
- return `${pc.bold("Polar Payments Setup:")}\n${pc.cyan("•")} Get access token & product ID from ${pc.underline("https://sandbox.polar.sh/")}\n${pc.cyan("•")} Set POLAR_ACCESS_TOKEN in ${envPath}`;
357
- }
358
-
359
- function getAlchemyDeployInstructions(
360
- runCmd?: string,
361
- webDeploy?: string,
362
- serverDeploy?: string,
363
- backend?: string,
364
- ) {
365
- const instructions: string[] = [];
366
- const isBackendSelf = backend === "self";
367
-
368
- if (webDeploy === "alchemy" && serverDeploy !== "alchemy") {
369
- instructions.push(
370
- `${pc.bold("Deploy web with Alchemy:")}\n${pc.cyan("•")} Dev: ${`cd apps/web && ${runCmd} alchemy dev`}\n${pc.cyan("•")} Deploy: ${`cd apps/web && ${runCmd} deploy`}\n${pc.cyan("•")} Destroy: ${`cd apps/web && ${runCmd} destroy`}`,
371
- );
372
- } else if (serverDeploy === "alchemy" && webDeploy !== "alchemy" && !isBackendSelf) {
373
- instructions.push(
374
- `${pc.bold("Deploy server with Alchemy:")}\n${pc.cyan("•")} Dev: ${`cd apps/server && ${runCmd} dev`}\n${pc.cyan("•")} Deploy: ${`cd apps/server && ${runCmd} deploy`}\n${pc.cyan("•")} Destroy: ${`cd apps/server && ${runCmd} destroy`}`,
375
- );
376
- } else if (webDeploy === "alchemy" && (serverDeploy === "alchemy" || isBackendSelf)) {
377
- instructions.push(
378
- `${pc.bold("Deploy with Alchemy:")}\n${pc.cyan("•")} Dev: ${`${runCmd} dev`}\n${pc.cyan("•")} Deploy: ${`${runCmd} deploy`}\n${pc.cyan("•")} Destroy: ${`${runCmd} destroy`}`,
379
- );
380
- }
381
-
382
- return instructions.length ? `\n${instructions.join("\n")}` : "";
383
- }