better-ts-stack 1.1.4 → 2.0.0

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 (161) hide show
  1. package/README.md +113 -82
  2. package/dist/args.d.ts +12 -0
  3. package/dist/args.d.ts.map +1 -0
  4. package/dist/args.js +90 -0
  5. package/dist/args.js.map +1 -0
  6. package/dist/builder/configGenerator.d.ts.map +1 -1
  7. package/dist/builder/configGenerator.js +10 -3
  8. package/dist/builder/configGenerator.js.map +1 -1
  9. package/dist/builder/dependencyInstaller.d.ts.map +1 -1
  10. package/dist/builder/dependencyInstaller.js +8 -14
  11. package/dist/builder/dependencyInstaller.js.map +1 -1
  12. package/dist/builder/gitInitializer.d.ts.map +1 -1
  13. package/dist/builder/gitInitializer.js +8 -41
  14. package/dist/builder/gitInitializer.js.map +1 -1
  15. package/dist/builder/index.d.ts.map +1 -1
  16. package/dist/builder/index.js +24 -63
  17. package/dist/builder/index.js.map +1 -1
  18. package/dist/builder/moduleSelector.d.ts +1 -4
  19. package/dist/builder/moduleSelector.d.ts.map +1 -1
  20. package/dist/builder/moduleSelector.js +11 -15
  21. package/dist/builder/moduleSelector.js.map +1 -1
  22. package/dist/builder/templateContext.d.ts +2 -17
  23. package/dist/builder/templateContext.d.ts.map +1 -1
  24. package/dist/builder/templateContext.js +6 -5
  25. package/dist/builder/templateContext.js.map +1 -1
  26. package/dist/index.js +45 -20
  27. package/dist/index.js.map +1 -1
  28. package/dist/output/nextSteps.d.ts +1 -2
  29. package/dist/output/nextSteps.d.ts.map +1 -1
  30. package/dist/output/nextSteps.js +10 -19
  31. package/dist/output/nextSteps.js.map +1 -1
  32. package/dist/prompts/index.d.ts +3 -3
  33. package/dist/prompts/index.d.ts.map +1 -1
  34. package/dist/prompts/index.js +22 -58
  35. package/dist/prompts/index.js.map +1 -1
  36. package/dist/prompts/stack.d.ts +3 -2
  37. package/dist/prompts/stack.d.ts.map +1 -1
  38. package/dist/prompts/stack.js +81 -70
  39. package/dist/prompts/stack.js.map +1 -1
  40. package/dist/types/index.d.ts +20 -42
  41. package/dist/types/index.d.ts.map +1 -1
  42. package/dist/types/index.js +40 -38
  43. package/dist/types/index.js.map +1 -1
  44. package/dist/ui/index.d.ts +3 -0
  45. package/dist/ui/index.d.ts.map +1 -0
  46. package/dist/ui/index.js +19 -0
  47. package/dist/ui/index.js.map +1 -0
  48. package/dist/ui/messages.d.ts +9 -0
  49. package/dist/ui/messages.d.ts.map +1 -0
  50. package/dist/ui/messages.js +100 -0
  51. package/dist/ui/messages.js.map +1 -0
  52. package/dist/ui/prompts.d.ts +20 -0
  53. package/dist/ui/prompts.d.ts.map +1 -0
  54. package/dist/ui/prompts.js +71 -0
  55. package/dist/ui/prompts.js.map +1 -0
  56. package/dist/ui/theme.d.ts +9 -0
  57. package/dist/ui/theme.d.ts.map +1 -0
  58. package/dist/ui/theme.js +24 -0
  59. package/dist/ui/theme.js.map +1 -0
  60. package/dist/validators/index.d.ts +1 -0
  61. package/dist/validators/index.d.ts.map +1 -1
  62. package/dist/validators/index.js +6 -0
  63. package/dist/validators/index.js.map +1 -1
  64. package/package.json +70 -66
  65. package/templates/backend/express/config.json +44 -44
  66. package/templates/backend/express/eslint.config.mjs +40 -40
  67. package/templates/backend/express/gitignore +36 -36
  68. package/templates/backend/express/src/index.ts +76 -76
  69. package/templates/backend/express/src/routes/health.ts +12 -12
  70. package/templates/backend/express/tsconfig.json +25 -25
  71. package/templates/backend/nestjs/.prettierignore +52 -0
  72. package/templates/backend/nestjs/.prettierrc +16 -0
  73. package/templates/backend/nestjs/config.json +44 -0
  74. package/templates/backend/nestjs/eslint.config.mjs +40 -0
  75. package/templates/backend/nestjs/gitignore +36 -0
  76. package/templates/backend/nestjs/nest-cli.json +9 -0
  77. package/templates/backend/nestjs/src/app.module.ts.hbs +34 -0
  78. package/templates/backend/nestjs/src/health/health.controller.ts +12 -0
  79. package/templates/backend/nestjs/src/main.ts +23 -0
  80. package/templates/backend/nestjs/tsconfig.eslint.json +9 -0
  81. package/templates/backend/nestjs/tsconfig.json +25 -0
  82. package/templates/frontend/nextjs/app/layout.tsx +13 -13
  83. package/templates/frontend/nextjs/app/page.tsx.hbs +97 -97
  84. package/templates/frontend/nextjs/components/ui/button.tsx +51 -51
  85. package/templates/frontend/nextjs/components/ui/card.tsx +60 -60
  86. package/templates/frontend/nextjs/components/ui/field.tsx +67 -67
  87. package/templates/frontend/nextjs/components/ui/input.tsx +18 -18
  88. package/templates/frontend/nextjs/components.json +19 -19
  89. package/templates/frontend/nextjs/config.json +38 -38
  90. package/templates/frontend/nextjs/eslint.config.mjs +11 -11
  91. package/templates/frontend/nextjs/gitignore +42 -42
  92. package/templates/frontend/nextjs/lib/utils.ts +6 -6
  93. package/templates/frontend/nextjs/next.config.ts.hbs +12 -12
  94. package/templates/frontend/nextjs/proxy.ts.hbs +24 -24
  95. package/templates/frontend/nextjs/tsconfig.json +34 -34
  96. package/templates/frontend/tanstack/config.json +48 -48
  97. package/templates/frontend/tanstack/src/routeTree.gen.ts +68 -68
  98. package/templates/frontend/tanstack/src/styles/app.css +85 -85
  99. package/templates/modules/auth/express/config.json +27 -26
  100. package/templates/modules/auth/express/src/controllers/authController.ts.hbs +116 -130
  101. package/templates/modules/auth/express/src/middleware/requireAuth.ts.hbs +26 -26
  102. package/templates/modules/auth/express/src/services/userStore.ts.hbs +117 -117
  103. package/templates/modules/auth/nestjs/config.json +24 -0
  104. package/templates/modules/auth/nestjs/src/auth/auth.controller.ts +46 -0
  105. package/templates/modules/auth/nestjs/src/auth/auth.guard.ts +36 -0
  106. package/templates/modules/auth/nestjs/src/auth/auth.module.ts.hbs +22 -0
  107. package/templates/modules/auth/nestjs/src/auth/auth.schemas.ts +35 -0
  108. package/templates/modules/auth/nestjs/src/auth/auth.service.ts +70 -0
  109. package/templates/modules/auth/nestjs/src/auth/jwt.ts +27 -0
  110. package/templates/modules/auth/nestjs/src/auth/users.service.ts.hbs +144 -0
  111. package/templates/modules/auth/nestjs/src/auth/zod-validation.pipe.ts +16 -0
  112. package/templates/modules/auth/nextjs/app/dashboard/page.tsx +96 -96
  113. package/templates/modules/auth/nextjs/app/sign-in/page.tsx +35 -35
  114. package/templates/modules/auth/nextjs/app/sign-up/page.tsx +35 -35
  115. package/templates/modules/auth/nextjs/components/auth/sign-in-form.tsx +132 -132
  116. package/templates/modules/auth/nextjs/components/auth/sign-out-button.tsx +50 -50
  117. package/templates/modules/auth/nextjs/components/auth/sign-up-form.tsx +152 -152
  118. package/templates/modules/auth/nextjs/config.json +31 -31
  119. package/templates/modules/auth/nextjs/lib/auth-schema.ts +39 -39
  120. package/templates/modules/auth/nextjs/lib/auth.ts.hbs +37 -37
  121. package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +4 -4
  122. package/templates/modules/auth/tanstack/src/routeTree.gen.ts +140 -140
  123. package/templates/modules/docker/.dockerignore +14 -14
  124. package/templates/modules/docker/Dockerfile.hbs +137 -133
  125. package/templates/modules/docker/config.json +19 -19
  126. package/templates/modules/docker/docker-compose.yml.hbs +9 -9
  127. package/templates/modules/drizzle/express/config.json +27 -27
  128. package/templates/modules/drizzle/express/drizzle.config.ts +13 -13
  129. package/templates/modules/drizzle/express/src/lib/db.ts +13 -13
  130. package/templates/modules/drizzle/express/src/lib/schema.ts +10 -10
  131. package/templates/modules/drizzle/nestjs/config.json +27 -0
  132. package/templates/modules/drizzle/nestjs/drizzle.config.ts +13 -0
  133. package/templates/modules/drizzle/nestjs/src/database/database.module.ts +30 -0
  134. package/templates/modules/drizzle/nestjs/src/database/schema.ts +10 -0
  135. package/templates/modules/drizzle/nextjs/config.json +29 -29
  136. package/templates/modules/drizzle/nextjs/lib/db.ts +13 -13
  137. package/templates/modules/drizzle/nextjs/lib/schema.ts.hbs +84 -84
  138. package/templates/modules/mongoose/express/config.json +16 -16
  139. package/templates/modules/mongoose/nestjs/config.json +16 -0
  140. package/templates/modules/mongoose/nestjs/src/users/user.schema.ts +21 -0
  141. package/templates/modules/mongoose/nextjs/config.json +16 -16
  142. package/templates/modules/mongoose/nextjs/lib/db.ts +36 -36
  143. package/templates/modules/mongoose/tanstack/config.json +17 -17
  144. package/templates/modules/mongoose/tanstack/src/lib/db.ts +37 -37
  145. package/templates/modules/prisma/express/config.json +28 -28
  146. package/templates/modules/prisma/express/prisma/schema.prisma +1 -1
  147. package/templates/modules/prisma/express/prisma.config.ts +12 -12
  148. package/templates/modules/prisma/express/src/lib/prisma.ts +24 -24
  149. package/templates/modules/prisma/nestjs/config.json +28 -0
  150. package/templates/modules/prisma/nestjs/prisma/schema.prisma +23 -0
  151. package/templates/modules/prisma/nestjs/prisma.config.ts +12 -0
  152. package/templates/modules/prisma/nestjs/src/prisma/prisma.module.ts +11 -0
  153. package/templates/modules/prisma/nestjs/src/prisma/prisma.service.ts +17 -0
  154. package/templates/modules/prisma/nextjs/config.json +29 -29
  155. package/templates/modules/prisma/nextjs/prisma/schema.prisma.hbs +91 -91
  156. package/templates/modules/prisma/tanstack/config.json +5 -5
  157. package/dist/intro.d.ts +0 -2
  158. package/dist/intro.d.ts.map +0 -1
  159. package/dist/intro.js +0 -27
  160. package/dist/intro.js.map +0 -1
  161. package/templates/backend/express/.eslintrc.js +0 -24
@@ -1,77 +1,88 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ask = ask;
6
4
  exports.collectStackChoices = collectStackChoices;
7
- const prompts_1 = require("@clack/prompts");
8
- const consola_1 = __importDefault(require("consola"));
5
+ const core_1 = require("@clack/core");
9
6
  const types_1 = require("../types");
10
- async function collectStackChoices(applicationType) {
11
- return (0, prompts_1.group)({
12
- framework: async () => {
13
- if (applicationType === "backend") {
14
- while (true) {
15
- const selection = await (0, prompts_1.select)({
16
- message: "Select a backend framework:",
17
- options: types_1.backendFrameworkOptions,
18
- initialValue: "express",
19
- });
20
- if ((0, prompts_1.isCancel)(selection) || selection !== "nestjs")
21
- return selection;
22
- consola_1.default.warn("This framework is coming soon! Please select another option.");
23
- }
24
- }
25
- return (0, prompts_1.select)({
26
- message: "Select a frontend framework:",
27
- options: types_1.frontendFrameworkOptions,
28
- initialValue: "nextjs",
29
- });
30
- },
31
- databaseType: () => (0, prompts_1.select)({
32
- message: "Select a database:",
33
- options: types_1.databaseTypeOptions,
34
- initialValue: "none",
35
- }),
36
- orm: async ({ results }) => {
37
- if (results.databaseType === "none")
38
- return "none";
39
- const options = results.databaseType === "mongodb"
40
- ? types_1.mongodbOrmOptions
41
- : types_1.postgresqlOrmOptions;
42
- return (0, prompts_1.select)({
43
- message: `Select an ORM for ${results.databaseType}:`,
44
- options,
45
- initialValue: options[0].value,
46
- });
47
- },
48
- packageManager: () => (0, prompts_1.select)({
49
- message: "Select a package manager:",
50
- options: types_1.packageManagerOptions,
51
- initialValue: "npm",
52
- }),
53
- useDocker: () => (0, prompts_1.confirm)({ message: "Use Docker?", initialValue: false }),
54
- useAuth: async ({ results }) => {
55
- if (applicationType === "fullstack" && results.databaseType === "none")
56
- return false;
57
- return (0, prompts_1.select)({
58
- message: applicationType === "fullstack"
59
- ? "Add Better Auth?"
60
- : "Add authentication?",
61
- options: types_1.authOptions,
62
- initialValue: false,
63
- });
64
- },
65
- initGit: () => (0, prompts_1.confirm)({
66
- message: "Initialize a git repository?",
67
- initialValue: true,
68
- }),
69
- installDeps: () => (0, prompts_1.confirm)({ message: "Install dependencies now?", initialValue: false }),
70
- }, {
71
- onCancel: () => {
72
- (0, prompts_1.cancel)("Operation cancelled.");
73
- process.exit(0);
74
- },
7
+ const ui_1 = require("../ui");
8
+ // Returns the preset value when there is one, otherwise asks the user
9
+ async function ask(preset, prompt) {
10
+ if (preset !== undefined)
11
+ return preset;
12
+ const answer = await prompt();
13
+ if ((0, core_1.isCancel)(answer)) {
14
+ (0, ui_1.info)("Cancelled. Nothing was created.");
15
+ process.exit(0);
16
+ }
17
+ return answer;
18
+ }
19
+ async function askFramework() {
20
+ const applicationType = await (0, ui_1.select)({
21
+ message: "Application type",
22
+ options: types_1.applicationTypeOptions,
23
+ initialValue: "backend",
24
+ });
25
+ if ((0, core_1.isCancel)(applicationType))
26
+ return applicationType;
27
+ return applicationType === "backend"
28
+ ? (0, ui_1.select)({
29
+ message: "Backend framework",
30
+ options: types_1.backendFrameworkOptions,
31
+ initialValue: "express",
32
+ })
33
+ : (0, ui_1.select)({
34
+ message: "Frontend framework",
35
+ options: types_1.frontendFrameworkOptions,
36
+ initialValue: "nextjs",
37
+ });
38
+ }
39
+ async function askDatabase() {
40
+ const system = await (0, ui_1.select)({
41
+ message: "Database",
42
+ options: types_1.databaseSystemOptions,
43
+ initialValue: "none",
75
44
  });
45
+ if ((0, core_1.isCancel)(system) || system === "none")
46
+ return system;
47
+ const options = system === "mongodb" ? types_1.mongodbOrmOptions : types_1.postgresqlOrmOptions;
48
+ return (0, ui_1.select)({
49
+ message: "ORM",
50
+ options,
51
+ initialValue: options[0].value,
52
+ });
53
+ }
54
+ // Collects the stack choices, prompting only for those missing from the preset
55
+ async function collectStackChoices(preset) {
56
+ const framework = await ask(preset.framework, askFramework);
57
+ const database = await ask(preset.database, askDatabase);
58
+ const packageManager = await ask(preset.packageManager, () => (0, ui_1.select)({
59
+ message: "Package manager",
60
+ options: types_1.packageManagerOptions,
61
+ initialValue: "npm",
62
+ }));
63
+ const useDocker = await ask(preset.useDocker, () => (0, ui_1.confirm)({ message: "Add Docker?", initialValue: false }));
64
+ // Better Auth stores users and sessions, so full-stack auth needs a database
65
+ const isFullstack = (0, types_1.getApplicationType)(framework) === "fullstack";
66
+ const isAuthAvailable = !isFullstack || database !== "none";
67
+ if (preset.useAuth && !isAuthAvailable) {
68
+ throw (0, types_1.buildError)(`Auth for ${framework} needs a database. Add --database prisma, drizzle, or mongoose`, "INVALID_ARGUMENT");
69
+ }
70
+ const useAuth = isAuthAvailable
71
+ ? await ask(preset.useAuth, () => (0, ui_1.confirm)({
72
+ message: isFullstack ? "Add Better Auth?" : "Add JWT authentication?",
73
+ initialValue: false,
74
+ }))
75
+ : false;
76
+ const initGit = await ask(preset.initGit, () => (0, ui_1.confirm)({ message: "Initialize a git repository?", initialValue: true }));
77
+ const installDeps = await ask(preset.installDeps, () => (0, ui_1.confirm)({ message: "Install dependencies now?", initialValue: false }));
78
+ return {
79
+ framework,
80
+ database,
81
+ packageManager,
82
+ useDocker,
83
+ useAuth,
84
+ initGit,
85
+ installDeps,
86
+ };
76
87
  }
77
88
  //# sourceMappingURL=stack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stack.js","sourceRoot":"","sources":["../../src/prompts/stack.ts"],"names":[],"mappings":";;;;;AAoBA,kDA+EC;AAnGD,4CAA0E;AAC1E,sDAA8B;AAE9B,oCAekB;AAEX,KAAK,UAAU,mBAAmB,CACvC,eAAgC;IAEhC,OAAO,IAAA,eAAK,EACV;QACE,SAAS,EAAE,KAAK,IAAI,EAAE;YACpB,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;gBAClC,OAAO,IAAI,EAAE,CAAC;oBACZ,MAAM,SAAS,GAAG,MAAM,IAAA,gBAAM,EAAmB;wBAC/C,OAAO,EAAE,6BAA6B;wBACtC,OAAO,EAAE,+BAAuB;wBAChC,YAAY,EAAE,SAAS;qBACxB,CAAC,CAAC;oBACH,IAAI,IAAA,kBAAQ,EAAC,SAAS,CAAC,IAAI,SAAS,KAAK,QAAQ;wBAC/C,OAAO,SAAS,CAAC;oBACnB,iBAAO,CAAC,IAAI,CACV,8DAA8D,CAC/D,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,OAAO,IAAA,gBAAM,EAAoB;gBAC/B,OAAO,EAAE,8BAA8B;gBACvC,OAAO,EAAE,gCAAwB;gBACjC,YAAY,EAAE,QAAQ;aACvB,CAAC,CAAC;QACL,CAAC;QACD,YAAY,EAAE,GAAG,EAAE,CACjB,IAAA,gBAAM,EAAe;YACnB,OAAO,EAAE,oBAAoB;YAC7B,OAAO,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AW,GAAG,IAAA,0BAAkB,EAAC,SAAS,CAAC,KAAK,WAAW,CAAC;IAClE,MAAM,eAAe,GAAG,CAAC,WAAW,IAAI,QAAQ,KAAK,MAAM,CAAC;IAC5D,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;QACvC,MAAM,IAAA,kBAAU,EACd,YAAY,SAAS,gEAAgE,EACrF,kBAAkB,CACnB,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,eAAe;QAC7B,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,CAC7B,IAAA,YAAO,EAAC;YACN,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,yBAAyB;YACrE,YAAY,EAAE,KAAK;SACpB,CAAC,CACH;QACH,CAAC,CAAC,KAAK,CAAC;IAEV,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,CAC7C,IAAA,YAAO,EAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CACzE,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE,CACrD,IAAA,YAAO,EAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CACvE,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,cAAc;QACd,SAAS;QACT,OAAO;QACP,OAAO;QACP,WAAW;KACZ,CAAC;AACJ,CAAC"}
@@ -1,7 +1,5 @@
1
1
  export type PackageManager = "npm" | "pnpm" | "bun";
2
- export type DatabaseType = "mongodb" | "postgresql" | "none";
3
- export type OrmOption = "prisma" | "mongoose" | "drizzle" | "none";
4
- export type DatabaseOption = "none" | "prisma" | "mongoose" | "drizzle";
2
+ export type Database = "none" | "prisma" | "drizzle" | "mongoose";
5
3
  export type ApplicationType = "backend" | "fullstack";
6
4
  export type ModuleType = "base" | "database" | "feature";
7
5
  export interface Dependencies {
@@ -9,30 +7,21 @@ export interface Dependencies {
9
7
  }
10
8
  export type BackendFramework = "express" | "nestjs";
11
9
  export type FrontendFramework = "nextjs" | "tanstack";
10
+ export type Framework = BackendFramework | FrontendFramework;
12
11
  export interface ProjectConfig {
13
12
  projectName: string;
14
13
  applicationType: ApplicationType;
15
- framework: BackendFramework | FrontendFramework;
16
- databaseType: DatabaseType;
17
- orm: OrmOption;
18
- database: DatabaseOption;
14
+ framework: Framework;
15
+ database: Database;
19
16
  useDocker: boolean;
20
17
  useAuth: boolean;
21
18
  packageManager: PackageManager;
22
19
  initGit: boolean;
23
20
  installDeps: boolean;
24
21
  }
25
- /**
26
- * Shared type for prompt choices (used by both frontend and backend collectors).
27
- * This is essentially ProjectConfig without the derived/initial fields.
28
- */
29
- export type PromptChoices = Omit<ProjectConfig, "projectName" | "applicationType" | "database">;
30
- /**
31
- * Derives the database option from database type and ORM selection.
32
- * Returns "none" if either is "none", otherwise returns the ORM which
33
- * must be a valid DatabaseOption (prisma, mongoose, or drizzle).
34
- */
35
- export declare function deriveDatabase(databaseType: DatabaseType, orm: OrmOption): DatabaseOption;
22
+ export type StackChoices = Omit<ProjectConfig, "projectName" | "applicationType">;
23
+ export declare const DEFAULT_CHOICES: StackChoices;
24
+ export declare const DEFAULT_PORT = 3000;
36
25
  export interface ModuleConfig {
37
26
  id: string;
38
27
  name: string;
@@ -78,66 +67,61 @@ export interface TemplateContext {
78
67
  lowercase: (str: string) => string;
79
68
  uppercase: (str: string) => string;
80
69
  kebabCase: (str: string) => string;
70
+ eq: (a: string, b: string) => boolean;
71
+ runner: () => string;
81
72
  };
82
73
  }
83
74
  export declare const applicationTypeOptions: ({
84
75
  value: "backend";
85
76
  label: string;
77
+ hint: string;
86
78
  } | {
87
79
  value: "fullstack";
88
80
  label: string;
81
+ hint: string;
89
82
  })[];
90
83
  export declare const backendFrameworkOptions: ({
91
84
  value: "express";
92
85
  label: string;
93
- hint?: undefined;
94
86
  } | {
95
87
  value: "nestjs";
96
88
  label: string;
97
- hint: string;
98
89
  })[];
99
90
  export declare const frontendFrameworkOptions: ({
100
91
  value: "nextjs";
101
92
  label: string;
102
- hint?: undefined;
93
+ hint: string;
103
94
  } | {
104
95
  value: "tanstack";
105
96
  label: string;
106
97
  hint: string;
107
98
  })[];
108
- export declare const databaseTypeOptions: ({
99
+ export declare const databaseSystemOptions: ({
109
100
  value: "none";
110
101
  label: string;
102
+ hint: string;
111
103
  } | {
112
104
  value: "mongodb";
113
105
  label: string;
106
+ hint?: undefined;
114
107
  } | {
115
108
  value: "postgresql";
116
109
  label: string;
110
+ hint?: undefined;
117
111
  })[];
118
112
  export declare const mongodbOrmOptions: {
119
113
  value: "mongoose";
120
114
  label: string;
115
+ hint: string;
121
116
  }[];
122
117
  export declare const postgresqlOrmOptions: ({
123
118
  value: "prisma";
124
119
  label: string;
120
+ hint: string;
125
121
  } | {
126
122
  value: "drizzle";
127
123
  label: string;
128
- })[];
129
- export declare const databaseOptions: ({
130
- value: "none";
131
- label: string;
132
- } | {
133
- value: "prisma";
134
- label: string;
135
- } | {
136
- value: "mongoose";
137
- label: string;
138
- } | {
139
- value: "drizzle";
140
- label: string;
124
+ hint: string;
141
125
  })[];
142
126
  export declare const packageManagerOptions: ({
143
127
  value: "npm";
@@ -149,11 +133,5 @@ export declare const packageManagerOptions: ({
149
133
  value: "bun";
150
134
  label: string;
151
135
  })[];
152
- export declare const authOptions: ({
153
- value: false;
154
- label: string;
155
- } | {
156
- value: true;
157
- label: string;
158
- })[];
136
+ export declare function getApplicationType(framework: Framework): ApplicationType;
159
137
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;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AC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;IAIjC,CAAC;AAGF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,CAIxE"}
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
  // Core type definitions for the CLI builder
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.authOptions = exports.packageManagerOptions = exports.databaseOptions = exports.postgresqlOrmOptions = exports.mongodbOrmOptions = exports.databaseTypeOptions = exports.frontendFrameworkOptions = exports.backendFrameworkOptions = exports.applicationTypeOptions = void 0;
5
- exports.deriveDatabase = deriveDatabase;
4
+ exports.packageManagerOptions = exports.postgresqlOrmOptions = exports.mongodbOrmOptions = exports.databaseSystemOptions = exports.frontendFrameworkOptions = exports.backendFrameworkOptions = exports.applicationTypeOptions = exports.DEFAULT_PORT = exports.DEFAULT_CHOICES = void 0;
6
5
  exports.buildError = buildError;
7
- /**
8
- * Derives the database option from database type and ORM selection.
9
- * Returns "none" if either is "none", otherwise returns the ORM which
10
- * must be a valid DatabaseOption (prisma, mongoose, or drizzle).
11
- */
12
- function deriveDatabase(databaseType, orm) {
13
- if (databaseType === "none" || orm === "none") {
14
- return "none";
15
- }
16
- // At this point, orm must be one of: prisma, mongoose, drizzle
17
- // which are all valid DatabaseOption values
18
- return orm;
19
- }
6
+ exports.getApplicationType = getApplicationType;
7
+ // Used for every choice not given as a flag when --yes is passed
8
+ exports.DEFAULT_CHOICES = {
9
+ framework: "express",
10
+ database: "none",
11
+ useDocker: false,
12
+ useAuth: false,
13
+ packageManager: "npm",
14
+ initGit: true,
15
+ installDeps: false,
16
+ };
17
+ // Port the generated server listens on
18
+ exports.DEFAULT_PORT = 3000;
20
19
  // Unified error creation function
21
20
  function buildError(errorOrMessage, code, context, exitCode = 1) {
22
21
  const message = errorOrMessage instanceof Error
@@ -28,50 +27,53 @@ function buildError(errorOrMessage, code, context, exitCode = 1) {
28
27
  }
29
28
  // Type-safe option definitions
30
29
  exports.applicationTypeOptions = [
31
- { value: "backend", label: "Backend API (Express/NestJS)" },
32
- { value: "fullstack", label: "Full-stack App (Next.js/TanStack)" },
30
+ {
31
+ value: "backend",
32
+ label: "Backend API",
33
+ hint: "Express or NestJS",
34
+ },
35
+ {
36
+ value: "fullstack",
37
+ label: "Full-stack app",
38
+ hint: "Next.js or TanStack Start",
39
+ },
33
40
  ];
34
41
  exports.backendFrameworkOptions = [
35
42
  { value: "express", label: "Express" },
36
- { value: "nestjs", label: "NestJS", hint: "(Coming Soon)" },
43
+ { value: "nestjs", label: "NestJS" },
37
44
  ];
38
45
  exports.frontendFrameworkOptions = [
39
- { value: "nextjs", label: "Next.js 16 (App Router)" },
46
+ { value: "nextjs", label: "Next.js 16", hint: "App Router" },
40
47
  {
41
48
  value: "tanstack",
42
- label: "TanStack Start (React)",
43
- hint: "(Release Candidate)",
49
+ label: "TanStack Start",
50
+ hint: "React, release candidate",
44
51
  },
45
52
  ];
46
- // Database type options (what database system)
47
- exports.databaseTypeOptions = [
48
- { value: "none", label: "None (Skip database setup)" },
53
+ // Database system options; the ORM is chosen in a second step
54
+ exports.databaseSystemOptions = [
55
+ { value: "none", label: "None", hint: "skip database setup" },
49
56
  { value: "mongodb", label: "MongoDB" },
50
57
  { value: "postgresql", label: "PostgreSQL" },
51
58
  ];
52
59
  // ORM options for MongoDB
53
60
  exports.mongodbOrmOptions = [
54
- { value: "mongoose", label: "Mongoose (MongoDB ODM)" },
61
+ { value: "mongoose", label: "Mongoose", hint: "MongoDB ODM" },
55
62
  ];
56
63
  // ORM options for PostgreSQL
57
64
  exports.postgresqlOrmOptions = [
58
- { value: "prisma", label: "Prisma (Type-safe ORM)" },
59
- { value: "drizzle", label: "Drizzle (Lightweight ORM)" },
60
- ];
61
- // Legacy database options (for backward compatibility)
62
- exports.databaseOptions = [
63
- { value: "none", label: "None (Skip database setup)" },
64
- { value: "prisma", label: "Prisma (Type-safe ORM)" },
65
- { value: "mongoose", label: "Mongoose (Standard MongoDB ODM)" },
66
- { value: "drizzle", label: "Drizzle (Lightweight ORM)" },
65
+ { value: "prisma", label: "Prisma", hint: "type-safe ORM" },
66
+ { value: "drizzle", label: "Drizzle", hint: "lightweight ORM" },
67
67
  ];
68
68
  exports.packageManagerOptions = [
69
69
  { value: "npm", label: "npm" },
70
70
  { value: "pnpm", label: "pnpm" },
71
71
  { value: "bun", label: "bun" },
72
72
  ];
73
- exports.authOptions = [
74
- { value: false, label: "No" },
75
- { value: true, label: "Yes" },
76
- ];
73
+ // Backend frameworks produce an API server, the others a full-stack app
74
+ function getApplicationType(framework) {
75
+ return exports.backendFrameworkOptions.some((option) => option.value === framework)
76
+ ? "backend"
77
+ : "fullstack";
78
+ }
77
79
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA,4CAA4C;;;AAmE5C,wCAUC;AA6CD,gCAaC;AAzED;;;;GAIG;AACH,SAAgB,cAAc,CAC5B,YAA0B,EAC1B,GAAc;IAEd,IAAI,YAAY,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;QAC9C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,+DAA+D;IAC/D,4CAA4C;IAC5C,OAAO,GAAG,CAAC;AACb,CAAC;AA4CD,kCAAkC;AAClC,SAAgB,UAAU,CACxB,cAAuB,EACvB,IAAY,EACZ,OAAgB,EAChB,WAAmB,CAAC;IAEpB,MAAM,OAAO,GACX,cAAc,YAAY,KAAK;QAC7B,CAAC,CAAC,cAAc,CAAC,OAAO;QACxB,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAC7B,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC,MAAM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AK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE;CACvE,CAAC;AAEF,6BAA6B;AAChB,QAAA,oBAAoB,GAAG;IAClC,EAAE,KAAK,EAAE,QAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE;IACpE,EAAE,KAAK,EAAE,SAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE;CACzE,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,EAAE,KAAK,EAAE,KAAc,EAAE,KAAK,EAAE,KAAK,EAAE;IACvC,EAAE,KAAK,EAAE,MAAe,EAAE,KAAK,EAAE,MAAM,EAAE;IACzC,EAAE,KAAK,EAAE,KAAc,EAAE,KAAK,EAAE,KAAK,EAAE;CACxC,CAAC;AAEF,wEAAwE;AACxE,SAAgB,kBAAkB,CAAC,SAAoB;IACrD,OAAO,+BAAuB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC;QACzE,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,WAAW,CAAC;AAClB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./messages";
2
+ export * from "./prompts";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./messages"), exports);
18
+ __exportStar(require("./prompts"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,4CAA0B"}
@@ -0,0 +1,9 @@
1
+ import { ProjectConfig } from "../types";
2
+ export declare const success: (message: string) => void;
3
+ export declare const info: (message: string) => void;
4
+ export declare const warn: (message: string) => void;
5
+ export declare const error: (message: string) => void;
6
+ export declare function showBanner(version: string, isInteractive: boolean): void;
7
+ export declare function showSummary(config: ProjectConfig, targetDir: string): void;
8
+ export declare function showNextSteps(steps: string[]): void;
9
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/ui/messages.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,aAAa,EAAE,MAAM,UAAU,CAAC;AAiBvD,eAAO,MAAM,OAAO,GAAI,SAAS,MAAM,SAAqC,CAAC;AAC7E,eAAO,MAAM,IAAI,GAAI,SAAS,MAAM,SAA+B,CAAC;AACpE,eAAO,MAAM,IAAI,GAAI,SAAS,MAAM,SAAsC,CAAC;AAC3E,eAAO,MAAM,KAAK,GAAI,SAAS,MAAM,SAAoC,CAAC;AAa1E,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,QAqBjE;AAGD,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,QAkBnE;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAU5C"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.error = exports.warn = exports.info = exports.success = void 0;
7
+ exports.showBanner = showBanner;
8
+ exports.showSummary = showSummary;
9
+ exports.showNextSteps = showNextSteps;
10
+ // Everything the CLI prints outside of prompts
11
+ const node_path_1 = __importDefault(require("node:path"));
12
+ const node_process_1 = require("node:process");
13
+ const types_1 = require("../types");
14
+ const theme_1 = require("./theme");
15
+ // "better-ts-stack" in the figlet Big font
16
+ const WORDMARK = [
17
+ " _ _ _ _ _ _",
18
+ " | | | | | | | | | | | |",
19
+ " | |__ ___| |_| |_ ___ _ __ ______| |_ ___ ______ ___| |_ __ _ ___| | __",
20
+ " | '_ \\ / _ \\ __| __/ _ \\ '__|______| __/ __|______/ __| __/ _` |/ __| |/ /",
21
+ " | |_) | __/ |_| || __/ | | |_\\__ \\ \\__ \\ || (_| | (__| <",
22
+ " |_.__/ \\___|\\__|\\__\\___|_| \\__|___/ |___/\\__\\__,_|\\___|_|\\_\\",
23
+ ];
24
+ function write(line = "") {
25
+ process.stdout.write(`${line}\n`);
26
+ }
27
+ const success = (message) => write(`${(0, theme_1.lime)("✓")} ${message}`);
28
+ exports.success = success;
29
+ const info = (message) => write((0, theme_1.dim)(`· ${message}`));
30
+ exports.info = info;
31
+ const warn = (message) => write(`${(0, theme_1.amber)("!")} ${message}`);
32
+ exports.warn = warn;
33
+ const error = (message) => write(`${(0, theme_1.red)("×")} ${message}`);
34
+ exports.error = error;
35
+ const WORDMARK_WIDTH = Math.max(...WORDMARK.map((line) => line.length));
36
+ function greeting() {
37
+ const hour = new Date().getHours();
38
+ if (hour < 12)
39
+ return "Good morning.";
40
+ if (hour < 18)
41
+ return "Good afternoon.";
42
+ return "Good evening.";
43
+ }
44
+ // Opens the session with the wordmark, tagline, and key hints. An interactive
45
+ // session starts on a cleared screen; console.clear() does nothing when piped
46
+ function showBanner(version, isInteractive) {
47
+ if (isInteractive)
48
+ console.clear();
49
+ write();
50
+ if ((process.stdout.columns ?? 80) > WORDMARK_WIDTH) {
51
+ for (const line of WORDMARK)
52
+ write((0, theme_1.lime)(line));
53
+ }
54
+ else {
55
+ write((0, theme_1.lime)((0, theme_1.bold)("better-ts-stack")));
56
+ }
57
+ write();
58
+ write((0, theme_1.lavender)((0, theme_1.bold)("TypeScript projects, ready to run.")));
59
+ if (isInteractive) {
60
+ write((0, theme_1.dim)(greeting()));
61
+ write((0, theme_1.lime)((0, theme_1.bold)("Answer a few questions to get started.")));
62
+ write((0, theme_1.dim)(`v${version} · ↑↓ to move · enter to confirm · ctrl+c to cancel`));
63
+ }
64
+ else {
65
+ write((0, theme_1.dim)(`v${version}`));
66
+ }
67
+ write();
68
+ }
69
+ // Displays a summary of what will be built
70
+ function showSummary(config, targetDir) {
71
+ const stack = [
72
+ config.framework,
73
+ config.database !== "none" && config.database,
74
+ config.useAuth && "auth",
75
+ config.useDocker && "docker",
76
+ ];
77
+ const setup = [
78
+ config.packageManager,
79
+ config.initGit && "git",
80
+ config.installDeps && "install dependencies",
81
+ ];
82
+ write(` ${(0, theme_1.amber)((0, theme_1.bold)(config.projectName))}`);
83
+ write(` ${(0, theme_1.pink)("Stack")} ${stack.filter(Boolean).join(" · ")}`);
84
+ write(` ${(0, theme_1.pink)("Setup")} ${setup.filter(Boolean).join(" · ")}`);
85
+ write(` ${(0, theme_1.pink)("Path ")} ${node_path_1.default.relative((0, node_process_1.cwd)(), targetDir) || "."}`);
86
+ write();
87
+ }
88
+ // Shows the numbered next steps, with the commands to run highlighted
89
+ function showNextSteps(steps) {
90
+ write();
91
+ write(` ${(0, theme_1.amber)((0, theme_1.bold)("Next steps"))}`);
92
+ steps.forEach((step, index) => {
93
+ const isCommand = /^(cd|npm|pnpm|bun) /.test(step);
94
+ write(` ${(0, theme_1.dim)(`${index + 1}.`)} ${isCommand ? (0, theme_1.lime)(step) : step}`);
95
+ });
96
+ write();
97
+ write(` ${(0, theme_1.dim)(`Your app will run at http://localhost:${types_1.DEFAULT_PORT}`)}`);
98
+ write();
99
+ }
100
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/ui/messages.ts"],"names":[],"mappings":";;;;;;AAqCA,gCAqBC;AAGD,kCAkBC;AAGD,sCAUC;AA5FD,+CAA+C;AAC/C,0DAA6B;AAC7B,+CAAmC;AAEnC,oCAAuD;AACvD,mCAAsE;AAEtE,2CAA2C;AAC3C,MAAM,QAAQ,GAAG;IACf,yEAAyE;IACzE,0EAA0E;IAC1E,6EAA6E;IAC7E,gFAAgF;IAChF,gFAAgF;IAChF,uFAAuF;CACxF,CAAC;AAEF,SAAS,KAAK,CAAC,IAAI,GAAG,EAAE;IACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AACpC,CAAC;AAEM,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,IAAA,YAAI,EAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC;AAAhE,QAAA,OAAO,WAAyD;AACtE,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,IAAA,WAAG,EAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;AAAvD,QAAA,IAAI,QAAmD;AAC7D,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,IAAA,aAAK,EAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC;AAA9D,QAAA,IAAI,QAA0D;AACpE,MAAM,KAAK,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,IAAA,WAAG,EAAC,GAAG,CAAC,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