create-better-t-stack 3.7.3-canary.8e4d5716 → 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.
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,64 +0,0 @@
1
- import path from "node:path";
2
- import consola from "consola";
3
- import fs from "fs-extra";
4
- import handlebars from "handlebars";
5
- import type { ProjectConfig } from "../types";
6
- import { formatFileWithBiome } from "./biome-formatter";
7
-
8
- const BINARY_EXTENSIONS = new Set([".png", ".ico", ".svg"]);
9
-
10
- function isBinaryFile(filePath: string): boolean {
11
- const ext = path.extname(filePath).toLowerCase();
12
- return BINARY_EXTENSIONS.has(ext);
13
- }
14
-
15
- export async function processTemplate(srcPath: string, destPath: string, context: ProjectConfig) {
16
- try {
17
- await fs.ensureDir(path.dirname(destPath));
18
-
19
- if (isBinaryFile(srcPath) && !srcPath.endsWith(".hbs")) {
20
- await fs.copy(srcPath, destPath);
21
- return;
22
- }
23
-
24
- let content: string;
25
-
26
- if (srcPath.endsWith(".hbs")) {
27
- const templateContent = await fs.readFile(srcPath, "utf-8");
28
- const template = handlebars.compile(templateContent);
29
- content = template(context);
30
- } else {
31
- content = await fs.readFile(srcPath, "utf-8");
32
- }
33
-
34
- try {
35
- const formattedContent = await formatFileWithBiome(destPath, content);
36
- if (formattedContent) {
37
- content = formattedContent;
38
- }
39
- } catch (formatError) {
40
- consola.debug(`Failed to format ${destPath}:`, formatError);
41
- }
42
-
43
- await fs.writeFile(destPath, content);
44
- } catch (error) {
45
- consola.error(`Error processing template ${srcPath}:`, error);
46
- throw new Error(`Failed to process template ${srcPath}`);
47
- }
48
- }
49
-
50
- handlebars.registerHelper("eq", (a, b) => a === b);
51
- handlebars.registerHelper("ne", (a, b) => a !== b);
52
- handlebars.registerHelper("and", (...args) => {
53
- const values = args.slice(0, -1);
54
- return values.every((value) => value);
55
- });
56
- handlebars.registerHelper("or", (...args) => {
57
- const values = args.slice(0, -1);
58
- return values.some((value) => value);
59
- });
60
-
61
- handlebars.registerHelper(
62
- "includes",
63
- (array, value) => Array.isArray(array) && array.includes(value),
64
- );
@@ -1,94 +0,0 @@
1
- import type { CreateInput, Template } from "../types";
2
-
3
- export const TEMPLATE_PRESETS: Record<Template, CreateInput | null> = {
4
- mern: {
5
- database: "mongodb",
6
- orm: "mongoose",
7
- backend: "express",
8
- runtime: "node",
9
- frontend: ["react-router"],
10
- api: "orpc",
11
- auth: "better-auth",
12
- payments: "none",
13
- addons: ["turborepo"],
14
- examples: ["todo"],
15
- dbSetup: "mongodb-atlas",
16
- webDeploy: "none",
17
- serverDeploy: "none",
18
- },
19
- pern: {
20
- database: "postgres",
21
- orm: "drizzle",
22
- backend: "express",
23
- runtime: "node",
24
- frontend: ["tanstack-router"],
25
- api: "trpc",
26
- auth: "better-auth",
27
- payments: "none",
28
- addons: ["turborepo"],
29
- examples: ["todo"],
30
- dbSetup: "none",
31
- webDeploy: "none",
32
- serverDeploy: "none",
33
- },
34
- t3: {
35
- database: "postgres",
36
- orm: "prisma",
37
- backend: "self",
38
- runtime: "none",
39
- frontend: ["next"],
40
- api: "trpc",
41
- auth: "better-auth",
42
- payments: "none",
43
- addons: ["biome", "turborepo"],
44
- examples: ["none"],
45
- dbSetup: "none",
46
- webDeploy: "none",
47
- serverDeploy: "none",
48
- },
49
- uniwind: {
50
- database: "none",
51
- orm: "none",
52
- backend: "none",
53
- runtime: "none",
54
- frontend: ["native-uniwind"],
55
- api: "none",
56
- auth: "none",
57
- payments: "none",
58
- addons: ["none"],
59
- examples: ["none"],
60
- dbSetup: "none",
61
- webDeploy: "none",
62
- serverDeploy: "none",
63
- },
64
- none: null,
65
- };
66
-
67
- export function getTemplateConfig(template: Template) {
68
- if (template === "none" || !template) {
69
- return null;
70
- }
71
-
72
- const config = TEMPLATE_PRESETS[template];
73
- if (!config) {
74
- throw new Error(`Unknown template: ${template}`);
75
- }
76
-
77
- return config;
78
- }
79
-
80
- export function getTemplateDescription(template: Template) {
81
- const descriptions: Record<Template, string> = {
82
- mern: "MongoDB + Express + React + Node.js - Classic MERN stack",
83
- pern: "PostgreSQL + Express + React + Node.js - Popular PERN stack",
84
- t3: "T3 Stack - Next.js + tRPC + Prisma + PostgreSQL + Better Auth",
85
- uniwind: "Expo + Uniwind native app with no backend services",
86
- none: "No template - Full customization",
87
- };
88
-
89
- return descriptions[template] || "";
90
- }
91
-
92
- export function listAvailableTemplates() {
93
- return Object.keys(TEMPLATE_PRESETS).filter((t) => t !== "none") as Template[];
94
- }
@@ -1,26 +0,0 @@
1
- import {
2
- type ArrayLiteralExpression,
3
- IndentationText,
4
- type ObjectLiteralExpression,
5
- Project,
6
- QuoteKind,
7
- SyntaxKind,
8
- } from "ts-morph";
9
-
10
- export const tsProject = new Project({
11
- useInMemoryFileSystem: false,
12
- skipAddingFilesFromTsConfig: true,
13
- manipulationSettings: {
14
- quoteKind: QuoteKind.Single,
15
- indentationText: IndentationText.TwoSpaces,
16
- },
17
- });
18
-
19
- export function ensureArrayProperty(obj: ObjectLiteralExpression, name: string) {
20
- return (obj.getProperty(name)?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression) ??
21
- obj
22
- .addPropertyAssignment({ name, initializer: "[]" })
23
- .getFirstDescendantByKindOrThrow(
24
- SyntaxKind.ArrayLiteralExpression,
25
- )) as ArrayLiteralExpression;
26
- }
package/src/validation.ts DELETED
@@ -1,117 +0,0 @@
1
- import type { CLIInput, ProjectConfig } from "./types";
2
- import { getProvidedFlags, processFlags, validateArrayOptions } from "./utils/config-processing";
3
- import { validateConfigForProgrammaticUse, validateFullConfig } from "./utils/config-validation";
4
- import { exitWithError } from "./utils/errors";
5
- import { extractAndValidateProjectName } from "./utils/project-name-validation";
6
-
7
- const CORE_STACK_FLAGS = new Set([
8
- "database",
9
- "orm",
10
- "backend",
11
- "runtime",
12
- "frontend",
13
- "addons",
14
- "examples",
15
- "auth",
16
- "dbSetup",
17
- "payments",
18
- "api",
19
- "webDeploy",
20
- "serverDeploy",
21
- ]);
22
-
23
- function validateYesFlagCombination(options: CLIInput, providedFlags: Set<string>) {
24
- if (!options.yes) return;
25
-
26
- if (options.template && options.template !== "none") {
27
- return;
28
- }
29
-
30
- const coreStackFlagsProvided = Array.from(providedFlags).filter((flag) =>
31
- CORE_STACK_FLAGS.has(flag),
32
- );
33
-
34
- if (coreStackFlagsProvided.length > 0) {
35
- exitWithError(
36
- `Cannot combine --yes with core stack configuration flags: ${coreStackFlagsProvided.map((f) => `--${f}`).join(", ")}. ` +
37
- "The --yes flag uses default configuration. Remove these flags or use --yes without them.",
38
- );
39
- }
40
- }
41
-
42
- export function processAndValidateFlags(
43
- options: CLIInput,
44
- providedFlags: Set<string>,
45
- projectName?: string,
46
- ) {
47
- if (options.yolo) {
48
- const cfg = processFlags(options, projectName);
49
- const validatedProjectName = extractAndValidateProjectName(
50
- projectName,
51
- options.projectDirectory,
52
- true,
53
- );
54
- if (validatedProjectName) {
55
- cfg.projectName = validatedProjectName;
56
- }
57
- return cfg;
58
- }
59
-
60
- validateYesFlagCombination(options, providedFlags);
61
-
62
- try {
63
- validateArrayOptions(options);
64
- } catch (error) {
65
- exitWithError(error instanceof Error ? error.message : String(error));
66
- }
67
-
68
- const config = processFlags(options, projectName);
69
-
70
- const validatedProjectName = extractAndValidateProjectName(
71
- projectName,
72
- options.projectDirectory,
73
- false,
74
- );
75
- if (validatedProjectName) {
76
- config.projectName = validatedProjectName;
77
- }
78
-
79
- validateFullConfig(config, providedFlags, options);
80
-
81
- return config;
82
- }
83
-
84
- export function processProvidedFlagsWithoutValidation(options: CLIInput, projectName?: string) {
85
- if (!options.yolo) {
86
- const providedFlags = getProvidedFlags(options);
87
- validateYesFlagCombination(options, providedFlags);
88
- }
89
-
90
- const config = processFlags(options, projectName);
91
-
92
- const validatedProjectName = extractAndValidateProjectName(
93
- projectName,
94
- options.projectDirectory,
95
- true,
96
- );
97
- if (validatedProjectName) {
98
- config.projectName = validatedProjectName;
99
- }
100
-
101
- return config;
102
- }
103
-
104
- export function validateConfigCompatibility(
105
- config: Partial<ProjectConfig>,
106
- providedFlags?: Set<string>,
107
- options?: CLIInput,
108
- ) {
109
- if (options?.yolo) return;
110
- if (options && providedFlags) {
111
- validateFullConfig(config, providedFlags, options);
112
- } else {
113
- validateConfigForProgrammaticUse(config);
114
- }
115
- }
116
-
117
- export { getProvidedFlags };