deploy-bbc 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/README.md +253 -266
  2. package/dist/index.js +16870 -0
  3. package/dist/templates/base/.env.example +3 -0
  4. package/dist/templates/base/package.json +20 -0
  5. package/dist/templates/base/src/config/index.ts +8 -0
  6. package/dist/templates/base/src/routes/index.ts +12 -0
  7. package/dist/templates/base/src/types/index.ts +2 -0
  8. package/dist/templates/base-bun-native/.env.example +3 -0
  9. package/dist/templates/base-bun-native/package.json +19 -0
  10. package/dist/templates/base-bun-native/src/config/index.ts +8 -0
  11. package/dist/templates/base-bun-native/src/index.ts +50 -0
  12. package/dist/templates/base-bun-native/src/routes/index.ts +21 -0
  13. package/dist/templates/base-bun-native/src/types/index.ts +2 -0
  14. package/dist/templates/base-express/.env.example +3 -0
  15. package/dist/templates/base-express/package.json +21 -0
  16. package/dist/templates/base-express/src/config/index.ts +8 -0
  17. package/dist/templates/base-express/src/routes/index.ts +12 -0
  18. package/dist/templates/base-express/src/types/index.ts +2 -0
  19. package/dist/templates/templates/base/README.md +31 -0
  20. package/dist/templates/templates/base/src/index.ts +26 -0
  21. package/dist/templates/templates/base/src/middleware/error.ts +13 -0
  22. package/dist/templates/templates/base/src/middleware/logger.ts +8 -0
  23. package/dist/templates/templates/base/src/utils/env.ts +5 -0
  24. package/dist/templates/templates/base/tsconfig.json +20 -0
  25. package/dist/templates/templates/base-bun-native/README.md +31 -0
  26. package/dist/templates/templates/base-bun-native/src/middleware/error.ts +20 -0
  27. package/dist/templates/templates/base-bun-native/src/middleware/logger.ts +6 -0
  28. package/dist/templates/templates/base-bun-native/src/utils/env.ts +5 -0
  29. package/dist/templates/templates/base-bun-native/tsconfig.json +20 -0
  30. package/dist/templates/templates/base-express/README.md +31 -0
  31. package/dist/templates/templates/base-express/src/index.ts +27 -0
  32. package/dist/templates/templates/base-express/src/middleware/error.ts +15 -0
  33. package/dist/templates/templates/base-express/src/middleware/logger.ts +12 -0
  34. package/dist/templates/templates/base-express/src/utils/env.ts +5 -0
  35. package/dist/templates/templates/base-express/tsconfig.json +20 -0
  36. package/dist/templates/templates/extras/ai/anthropic/src/services/ai/anthropic.ts +0 -0
  37. package/dist/templates/templates/extras/ai/gemini/src/services/ai/gemini.ts +0 -0
  38. package/dist/templates/templates/extras/ai/openai/src/routes/ai/chat.ts +0 -0
  39. package/dist/templates/templates/extras/ai/openai/src/services/ai/openai.ts +0 -0
  40. package/dist/templates/templates/extras/ai/vercel-ai/src/routes/ai/generate.ts +0 -0
  41. package/dist/templates/templates/extras/ai/vercel-ai/src/routes/ai/stream.ts +0 -0
  42. package/dist/templates/templates/extras/ai/vercel-ai/src/services/ai/index.ts +0 -0
  43. package/dist/templates/templates/extras/auth/jwt/src/middleware/auth.ts +0 -0
  44. package/dist/templates/templates/extras/auth/jwt/src/routes/auth.ts +0 -0
  45. package/dist/templates/templates/extras/auth/jwt/src/utils/jwt.ts +0 -0
  46. package/dist/templates/templates/extras/auth/oauth/src/config/oauth.ts +0 -0
  47. package/dist/templates/templates/extras/auth/oauth/src/routes/auth.ts +0 -0
  48. package/dist/templates/templates/extras/auth/session/src/config/session.ts +0 -0
  49. package/dist/templates/templates/extras/auth/session/src/middleware/session.ts +0 -0
  50. package/dist/templates/templates/extras/cloud/aws/src/services/aws/s3.ts +0 -0
  51. package/dist/templates/templates/extras/cloud/aws/src/services/aws/ses.ts +0 -0
  52. package/dist/templates/templates/extras/cloud/azure/src/services/azure/blob.ts +0 -0
  53. package/dist/templates/templates/extras/cloud/cloudflare-r2/src/services/cloudflare/r2.ts +0 -0
  54. package/dist/templates/templates/extras/cloud/gcp/src/services/gcp/storage.ts +0 -0
  55. package/dist/templates/templates/extras/database/mongodb/src/db/index.ts +0 -0
  56. package/dist/templates/templates/extras/database/mongodb/src/db/models/user.model.ts +0 -0
  57. package/dist/templates/templates/extras/database/mysql/drizzle.config.ts +0 -0
  58. package/dist/templates/templates/extras/database/postgres/src/db/index.ts +0 -0
  59. package/dist/templates/templates/extras/database/redis/src/db/redis.ts +0 -0
  60. package/dist/templates/templates/extras/docs/scalar/src/openapi/index.ts +0 -0
  61. package/dist/templates/templates/extras/docs/scalar/src/routes/docs.ts +0 -0
  62. package/dist/templates/templates/extras/docs/swagger/src/openapi/index.ts +0 -0
  63. package/dist/templates/templates/extras/docs/swagger/src/routes/docs.ts +0 -0
  64. package/dist/templates/templates/extras/email/nodemailer/src/services/email/nodemailer.ts +0 -0
  65. package/dist/templates/templates/extras/email/resend/src/services/email/resend.ts +0 -0
  66. package/dist/templates/templates/extras/email/resend/src/templates/email/welcome.ts +0 -0
  67. package/dist/templates/templates/extras/email/sendgrid/src/services/email/sendgrid.ts +0 -0
  68. package/dist/templates/templates/extras/observability/logtail/src/config/logger.ts +0 -0
  69. package/dist/templates/templates/extras/observability/sentry/src/config/sentry.ts +0 -0
  70. package/dist/templates/templates/extras/observability/sentry/src/middleware/sentry.ts +0 -0
  71. package/dist/templates/templates/extras/queue/bullmq/src/queue/index.ts +0 -0
  72. package/dist/templates/templates/extras/queue/bullmq/src/queue/jobs/email.job.ts +0 -0
  73. package/dist/templates/templates/extras/queue/bullmq/src/queue/processors/email.processor.ts +0 -0
  74. package/dist/templates/templates/extras/queue/bullmq/src/routes/queue.ts +0 -0
  75. package/dist/templates/templates/extras/queue/inngest/src/inngest/client.ts +0 -0
  76. package/dist/templates/templates/extras/queue/inngest/src/inngest/functions/email.ts +0 -0
  77. package/dist/templates/templates/extras/queue/inngest/src/routes/inngest.ts +0 -0
  78. package/dist/templates/templates/extras/realtime/socketio/src/socket/handlers.ts +0 -0
  79. package/dist/templates/templates/extras/realtime/socketio/src/socket/index.ts +0 -0
  80. package/dist/templates/templates/extras/realtime/sse/src/routes/sse.ts +0 -0
  81. package/dist/templates/templates/extras/testing/vitest/src/__tests__/example.test.ts +0 -0
  82. package/dist/templates/templates/extras/testing/vitest/src/__tests__/setup.ts +0 -0
  83. package/dist/templates/templates/extras/testing/vitest/vitest.config.ts +0 -0
  84. package/dist/templates/templates/extras/validation/yup/src/middleware/index.ts +1 -0
  85. package/dist/templates/templates/extras/validation/yup/src/middleware/validate.ts +83 -0
  86. package/dist/templates/templates/extras/validation/yup/src/routes/users.ts +132 -0
  87. package/dist/templates/templates/extras/validation/zod/src/middleware/index.ts +1 -0
  88. package/dist/templates/templates/extras/validation/zod/src/middleware/validate.ts +80 -0
  89. package/dist/templates/templates/extras/validation/zod/src/routes/users.ts +128 -0
  90. package/package.json +43 -9
  91. package/.cspell.json +0 -38
  92. package/CLAUDE.md +0 -403
  93. package/cli/README.md +0 -345
  94. package/cli/package.json +0 -54
  95. package/cli/src/cli/index.ts +0 -454
  96. package/cli/src/helpers/create-project.ts +0 -66
  97. package/cli/src/helpers/generate-docker-compose.ts +0 -133
  98. package/cli/src/helpers/generate-dockerfile.ts +0 -45
  99. package/cli/src/helpers/init-git.ts +0 -33
  100. package/cli/src/helpers/install-dependencies.ts +0 -28
  101. package/cli/src/helpers/log-next-steps.ts +0 -87
  102. package/cli/src/helpers/scaffold-project.ts +0 -88
  103. package/cli/src/index.ts +0 -18
  104. package/cli/src/installers/ai.ts +0 -123
  105. package/cli/src/installers/auth.ts +0 -132
  106. package/cli/src/installers/base.ts +0 -16
  107. package/cli/src/installers/cloud.ts +0 -127
  108. package/cli/src/installers/database.ts +0 -212
  109. package/cli/src/installers/docs.ts +0 -93
  110. package/cli/src/installers/email.ts +0 -119
  111. package/cli/src/installers/env-variables.ts +0 -27
  112. package/cli/src/installers/index.ts +0 -145
  113. package/cli/src/installers/observability.ts +0 -103
  114. package/cli/src/installers/queue.ts +0 -103
  115. package/cli/src/installers/ratelimit.ts +0 -98
  116. package/cli/src/installers/realtime.ts +0 -79
  117. package/cli/src/installers/testing.ts +0 -88
  118. package/cli/src/installers/validation.ts +0 -85
  119. package/cli/src/types/index.ts +0 -126
  120. package/cli/src/utils/add-package-dependency.ts +0 -56
  121. package/cli/src/utils/dependency-version-map.ts +0 -85
  122. package/cli/src/utils/logger.ts +0 -19
  123. package/cli/src/utils/parse-name-and-path.ts +0 -71
  124. package/cli/src/utils/render-title.ts +0 -11
  125. package/cli/tsconfig.json +0 -35
  126. package/test-cli.sh +0 -56
  127. package/tsconfig.json +0 -15
  128. /package/{cli/src → dist}/templates/base/README.md +0 -0
  129. /package/{cli/src → dist}/templates/base/src/index.ts +0 -0
  130. /package/{cli/src → dist}/templates/base/src/middleware/error.ts +0 -0
  131. /package/{cli/src → dist}/templates/base/src/middleware/logger.ts +0 -0
  132. /package/{cli/src → dist}/templates/base/src/utils/env.ts +0 -0
  133. /package/{cli/src → dist}/templates/base/tsconfig.json +0 -0
  134. /package/{cli/src → dist}/templates/base-bun-native/README.md +0 -0
  135. /package/{cli/src → dist}/templates/base-bun-native/src/middleware/error.ts +0 -0
  136. /package/{cli/src → dist}/templates/base-bun-native/src/middleware/logger.ts +0 -0
  137. /package/{cli/src → dist}/templates/base-bun-native/src/utils/env.ts +0 -0
  138. /package/{cli/src → dist}/templates/base-bun-native/tsconfig.json +0 -0
  139. /package/{cli/src → dist}/templates/base-express/README.md +0 -0
  140. /package/{cli/src → dist}/templates/base-express/src/index.ts +0 -0
  141. /package/{cli/src → dist}/templates/base-express/src/middleware/error.ts +0 -0
  142. /package/{cli/src → dist}/templates/base-express/src/middleware/logger.ts +0 -0
  143. /package/{cli/src → dist}/templates/base-express/src/utils/env.ts +0 -0
  144. /package/{cli/src → dist}/templates/base-express/tsconfig.json +0 -0
  145. /package/{cli/src → dist}/templates/extras/ai/anthropic/src/routes/ai/claude.ts +0 -0
  146. /package/{cli/src → dist}/templates/extras/ai/anthropic/src/services/ai/anthropic.ts +0 -0
  147. /package/{cli/src → dist}/templates/extras/ai/gemini/src/services/ai/gemini.ts +0 -0
  148. /package/{cli/src → dist}/templates/extras/ai/openai/src/routes/ai/chat.ts +0 -0
  149. /package/{cli/src → dist}/templates/extras/ai/openai/src/services/ai/openai.ts +0 -0
  150. /package/{cli/src → dist}/templates/extras/ai/vercel-ai/src/routes/ai/generate.ts +0 -0
  151. /package/{cli/src → dist}/templates/extras/ai/vercel-ai/src/routes/ai/stream.ts +0 -0
  152. /package/{cli/src → dist}/templates/extras/ai/vercel-ai/src/services/ai/index.ts +0 -0
  153. /package/{cli/src → dist}/templates/extras/auth/jwt/src/middleware/auth.ts +0 -0
  154. /package/{cli/src → dist}/templates/extras/auth/jwt/src/routes/auth.ts +0 -0
  155. /package/{cli/src → dist}/templates/extras/auth/jwt/src/utils/jwt.ts +0 -0
  156. /package/{cli/src → dist}/templates/extras/auth/oauth/src/config/oauth.ts +0 -0
  157. /package/{cli/src → dist}/templates/extras/auth/oauth/src/routes/auth.ts +0 -0
  158. /package/{cli/src → dist}/templates/extras/auth/session/src/config/session.ts +0 -0
  159. /package/{cli/src → dist}/templates/extras/auth/session/src/middleware/session.ts +0 -0
  160. /package/{cli/src → dist}/templates/extras/cloud/aws/src/services/aws/s3.ts +0 -0
  161. /package/{cli/src → dist}/templates/extras/cloud/aws/src/services/aws/ses.ts +0 -0
  162. /package/{cli/src → dist}/templates/extras/cloud/azure/src/services/azure/blob.ts +0 -0
  163. /package/{cli/src → dist}/templates/extras/cloud/cloudflare-r2/src/services/cloudflare/r2.ts +0 -0
  164. /package/{cli/src → dist}/templates/extras/cloud/gcp/src/services/gcp/storage.ts +0 -0
  165. /package/{cli/src → dist}/templates/extras/database/mongodb/src/db/index.ts +0 -0
  166. /package/{cli/src → dist}/templates/extras/database/mongodb/src/db/models/user.model.ts +0 -0
  167. /package/{cli/src → dist}/templates/extras/database/mysql/drizzle.config.ts +0 -0
  168. /package/{cli/src → dist}/templates/extras/database/postgres/src/db/index.ts +0 -0
  169. /package/{cli/src → dist}/templates/extras/database/redis/src/db/redis.ts +0 -0
  170. /package/{cli/src → dist}/templates/extras/docs/scalar/src/openapi/index.ts +0 -0
  171. /package/{cli/src → dist}/templates/extras/docs/scalar/src/routes/docs.ts +0 -0
  172. /package/{cli/src → dist}/templates/extras/docs/swagger/src/openapi/index.ts +0 -0
  173. /package/{cli/src → dist}/templates/extras/docs/swagger/src/routes/docs.ts +0 -0
  174. /package/{cli/src → dist}/templates/extras/email/nodemailer/src/services/email/nodemailer.ts +0 -0
  175. /package/{cli/src → dist}/templates/extras/email/resend/src/services/email/resend.ts +0 -0
  176. /package/{cli/src → dist}/templates/extras/email/resend/src/templates/email/welcome.ts +0 -0
  177. /package/{cli/src → dist}/templates/extras/email/sendgrid/src/services/email/sendgrid.ts +0 -0
  178. /package/{cli/src → dist}/templates/extras/observability/logtail/src/config/logger.ts +0 -0
  179. /package/{cli/src → dist}/templates/extras/observability/sentry/src/config/sentry.ts +0 -0
  180. /package/{cli/src → dist}/templates/extras/observability/sentry/src/middleware/sentry.ts +0 -0
  181. /package/{cli/src → dist}/templates/extras/queue/bullmq/src/queue/index.ts +0 -0
  182. /package/{cli/src → dist}/templates/extras/queue/bullmq/src/queue/jobs/email.job.ts +0 -0
  183. /package/{cli/src → dist}/templates/extras/queue/bullmq/src/queue/processors/email.processor.ts +0 -0
  184. /package/{cli/src → dist}/templates/extras/queue/bullmq/src/routes/queue.ts +0 -0
  185. /package/{cli/src → dist}/templates/extras/queue/inngest/src/inngest/client.ts +0 -0
  186. /package/{cli/src → dist}/templates/extras/queue/inngest/src/inngest/functions/email.ts +0 -0
  187. /package/{cli/src → dist}/templates/extras/queue/inngest/src/routes/inngest.ts +0 -0
  188. /package/{cli/src → dist}/templates/extras/realtime/socketio/src/socket/handlers.ts +0 -0
  189. /package/{cli/src → dist}/templates/extras/realtime/socketio/src/socket/index.ts +0 -0
  190. /package/{cli/src → dist}/templates/extras/realtime/sse/src/routes/sse.ts +0 -0
  191. /package/{cli/src → dist}/templates/extras/testing/vitest/src/__tests__/example.test.ts +0 -0
  192. /package/{cli/src → dist}/templates/extras/testing/vitest/src/__tests__/setup.ts +0 -0
  193. /package/{cli/src → dist}/templates/extras/testing/vitest/vitest.config.ts +0 -0
  194. /package/{cli/src → dist}/templates/extras/validation/yup/src/middleware/index.ts +0 -0
  195. /package/{cli/src → dist}/templates/extras/validation/yup/src/middleware/validate.ts +0 -0
  196. /package/{cli/src → dist}/templates/extras/validation/yup/src/routes/users.ts +0 -0
  197. /package/{cli/src → dist}/templates/extras/validation/zod/src/middleware/index.ts +0 -0
  198. /package/{cli/src → dist}/templates/extras/validation/zod/src/middleware/validate.ts +0 -0
  199. /package/{cli/src → dist}/templates/extras/validation/zod/src/routes/users.ts +0 -0
  200. /package/{cli/src → dist/templates}/templates/base/.env.example +0 -0
  201. /package/{cli/src → dist/templates}/templates/base/package.json +0 -0
  202. /package/{cli/src → dist/templates}/templates/base/src/config/index.ts +0 -0
  203. /package/{cli/src → dist/templates}/templates/base/src/controllers/user/create-user.controller.ts +0 -0
  204. /package/{cli/src → dist/templates}/templates/base/src/controllers/user/delete-user.controller.ts +0 -0
  205. /package/{cli/src → dist/templates}/templates/base/src/controllers/user/get-user.controller.ts +0 -0
  206. /package/{cli/src → dist/templates}/templates/base/src/controllers/user/get-users.controller.ts +0 -0
  207. /package/{cli/src → dist/templates}/templates/base/src/controllers/user/update-user.controller.ts +0 -0
  208. /package/{cli/src → dist/templates}/templates/base/src/models/user.model.ts +0 -0
  209. /package/{cli/src → dist/templates}/templates/base/src/routes/index.ts +0 -0
  210. /package/{cli/src → dist/templates}/templates/base/src/routes/user.route.ts +0 -0
  211. /package/{cli/src → dist/templates}/templates/base/src/types/common/api-response.types.ts +0 -0
  212. /package/{cli/src → dist/templates}/templates/base/src/types/index.ts +0 -0
  213. /package/{cli/src → dist/templates}/templates/base/src/types/models/user.types.ts +0 -0
  214. /package/{cli/src → dist/templates}/templates/base-bun-native/.env.example +0 -0
  215. /package/{cli/src → dist/templates}/templates/base-bun-native/package.json +0 -0
  216. /package/{cli/src → dist/templates}/templates/base-bun-native/src/config/index.ts +0 -0
  217. /package/{cli/src → dist/templates}/templates/base-bun-native/src/controllers/user/create-user.controller.ts +0 -0
  218. /package/{cli/src → dist/templates}/templates/base-bun-native/src/controllers/user/delete-user.controller.ts +0 -0
  219. /package/{cli/src → dist/templates}/templates/base-bun-native/src/controllers/user/get-user.controller.ts +0 -0
  220. /package/{cli/src → dist/templates}/templates/base-bun-native/src/controllers/user/get-users.controller.ts +0 -0
  221. /package/{cli/src → dist/templates}/templates/base-bun-native/src/controllers/user/update-user.controller.ts +0 -0
  222. /package/{cli/src → dist/templates}/templates/base-bun-native/src/index.ts +0 -0
  223. /package/{cli/src → dist/templates}/templates/base-bun-native/src/models/user.model.ts +0 -0
  224. /package/{cli/src → dist/templates}/templates/base-bun-native/src/routes/index.ts +0 -0
  225. /package/{cli/src → dist/templates}/templates/base-bun-native/src/routes/user.route.ts +0 -0
  226. /package/{cli/src → dist/templates}/templates/base-bun-native/src/types/common/api-response.types.ts +0 -0
  227. /package/{cli/src → dist/templates}/templates/base-bun-native/src/types/index.ts +0 -0
  228. /package/{cli/src → dist/templates}/templates/base-bun-native/src/types/models/user.types.ts +0 -0
  229. /package/{cli/src → dist/templates}/templates/base-express/.env.example +0 -0
  230. /package/{cli/src → dist/templates}/templates/base-express/package.json +0 -0
  231. /package/{cli/src → dist/templates}/templates/base-express/src/config/index.ts +0 -0
  232. /package/{cli/src → dist/templates}/templates/base-express/src/controllers/user/create-user.controller.ts +0 -0
  233. /package/{cli/src → dist/templates}/templates/base-express/src/controllers/user/delete-user.controller.ts +0 -0
  234. /package/{cli/src → dist/templates}/templates/base-express/src/controllers/user/get-user.controller.ts +0 -0
  235. /package/{cli/src → dist/templates}/templates/base-express/src/controllers/user/get-users.controller.ts +0 -0
  236. /package/{cli/src → dist/templates}/templates/base-express/src/controllers/user/update-user.controller.ts +0 -0
  237. /package/{cli/src → dist/templates}/templates/base-express/src/models/user.model.ts +0 -0
  238. /package/{cli/src → dist/templates}/templates/base-express/src/routes/index.ts +0 -0
  239. /package/{cli/src → dist/templates}/templates/base-express/src/routes/user.route.ts +0 -0
  240. /package/{cli/src → dist/templates}/templates/base-express/src/types/common/api-response.types.ts +0 -0
  241. /package/{cli/src → dist/templates}/templates/base-express/src/types/index.ts +0 -0
  242. /package/{cli/src → dist/templates}/templates/base-express/src/types/models/user.types.ts +0 -0
  243. /package/{prettier.config.mjs → dist/templates/templates/extras/ai/anthropic/src/routes/ai/claude.ts} +0 -0
@@ -1,103 +0,0 @@
1
- import path from "path";
2
- import fs from "fs-extra";
3
- import { fileURLToPath } from "url";
4
- import { type InstallerOptions, AvailablePackages } from "../types/index.js";
5
- import { add_package_dependency } from "../utils/add-package-dependency.js";
6
- import { DEPENDENCY_VERSION_MAP } from "../utils/dependency-version-map.js";
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
- /**
12
- * Queue installer - handles BullMQ and Inngest.
13
- *
14
- * @param options - Installer options with selected packages
15
- */
16
- export async function queue_installer(
17
- options: InstallerOptions
18
- ): Promise<void> {
19
- const { projectDir, packages } = options;
20
-
21
- for (const pkg of packages) {
22
- switch (pkg) {
23
- case AvailablePackages.bullmq:
24
- await install_bullmq(projectDir);
25
- break;
26
- case AvailablePackages.inngest:
27
- await install_inngest(projectDir);
28
- break;
29
- }
30
- }
31
- }
32
-
33
- async function install_bullmq(projectDir: string): Promise<void> {
34
- const templateDir = path.resolve(
35
- __dirname,
36
- "templates/extras/queue/bullmq"
37
- );
38
- await copy_template_files(templateDir, projectDir);
39
-
40
- await add_package_dependency(projectDir, {
41
- bullmq: DEPENDENCY_VERSION_MAP["bullmq"],
42
- });
43
-
44
- await append_env_example(
45
- projectDir,
46
- "\n# BullMQ Configuration\nREDIS_HOST=localhost\nREDIS_PORT=6379\nREDIS_PASSWORD=\n"
47
- );
48
- }
49
-
50
- async function install_inngest(projectDir: string): Promise<void> {
51
- const templateDir = path.resolve(
52
- __dirname,
53
- "templates/extras/queue/inngest"
54
- );
55
- await copy_template_files(templateDir, projectDir);
56
-
57
- await add_package_dependency(projectDir, {
58
- inngest: DEPENDENCY_VERSION_MAP["inngest"],
59
- });
60
-
61
- await append_env_example(
62
- projectDir,
63
- "\n# Inngest Configuration\nINNGEST_EVENT_KEY=your-inngest-event-key\nINNGEST_SIGNING_KEY=your-inngest-signing-key\n"
64
- );
65
- }
66
-
67
- async function copy_template_files(
68
- templateDir: string,
69
- projectDir: string
70
- ): Promise<void> {
71
- if (!(await fs.pathExists(templateDir))) {
72
- return;
73
- }
74
-
75
- const srcDir = path.join(templateDir, "src");
76
- if (await fs.pathExists(srcDir)) {
77
- const targetSrcDir = path.join(projectDir, "src");
78
- await fs.copy(srcDir, targetSrcDir, {
79
- overwrite: false,
80
- errorOnExist: false,
81
- });
82
- }
83
-
84
- const templateFiles = await fs.readdir(templateDir);
85
- for (const file of templateFiles) {
86
- if (file !== "src" && (file.endsWith(".ts") || file.endsWith(".json"))) {
87
- const srcFile = path.join(templateDir, file);
88
- const destFile = path.join(projectDir, file);
89
-
90
- if (!(await fs.pathExists(destFile))) {
91
- await fs.copy(srcFile, destFile);
92
- }
93
- }
94
- }
95
- }
96
-
97
- async function append_env_example(
98
- projectDir: string,
99
- content: string
100
- ): Promise<void> {
101
- const envPath = path.join(projectDir, ".env.example");
102
- await fs.appendFile(envPath, content);
103
- }
@@ -1,98 +0,0 @@
1
- import path from "path";
2
- import fs from "fs-extra";
3
- import { fileURLToPath } from "url";
4
- import { type InstallerOptions, AvailablePackages } from "../types/index.js";
5
- import { add_package_dependency } from "../utils/add-package-dependency.js";
6
- import { DEPENDENCY_VERSION_MAP } from "../utils/dependency-version-map.js";
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
- /**
12
- * Rate limit installer - handles Upstash Rate Limit and custom rate limiting.
13
- *
14
- * @param options - Installer options with selected packages
15
- */
16
- export async function ratelimit_installer(
17
- options: InstallerOptions
18
- ): Promise<void> {
19
- const { projectDir, packages } = options;
20
-
21
- for (const pkg of packages) {
22
- switch (pkg) {
23
- case AvailablePackages.upstashRateLimit:
24
- await install_upstash_ratelimit(projectDir);
25
- break;
26
- case AvailablePackages.customRateLimit:
27
- await install_custom_ratelimit(projectDir);
28
- break;
29
- }
30
- }
31
- }
32
-
33
- async function install_upstash_ratelimit(projectDir: string): Promise<void> {
34
- const templateDir = path.resolve(
35
- __dirname,
36
- "templates/extras/ratelimit/upstash"
37
- );
38
- await copy_template_files(templateDir, projectDir);
39
-
40
- await add_package_dependency(projectDir, {
41
- "@upstash/ratelimit": DEPENDENCY_VERSION_MAP["@upstash/ratelimit"],
42
- "@upstash/redis": DEPENDENCY_VERSION_MAP["@upstash/redis"],
43
- });
44
-
45
- await append_env_example(
46
- projectDir,
47
- "\n# Upstash Rate Limit Configuration\nUPSTASH_REDIS_REST_URL=your-upstash-redis-rest-url\nUPSTASH_REDIS_REST_TOKEN=your-upstash-redis-rest-token\n"
48
- );
49
- }
50
-
51
- async function install_custom_ratelimit(projectDir: string): Promise<void> {
52
- const templateDir = path.resolve(
53
- __dirname,
54
- "templates/extras/ratelimit/custom"
55
- );
56
- await copy_template_files(templateDir, projectDir);
57
-
58
- // Custom rate limit doesn't require external dependencies
59
- // It uses built-in Hono middleware or custom implementation
60
- }
61
-
62
- async function copy_template_files(
63
- templateDir: string,
64
- projectDir: string
65
- ): Promise<void> {
66
- if (!(await fs.pathExists(templateDir))) {
67
- return;
68
- }
69
-
70
- const srcDir = path.join(templateDir, "src");
71
- if (await fs.pathExists(srcDir)) {
72
- const targetSrcDir = path.join(projectDir, "src");
73
- await fs.copy(srcDir, targetSrcDir, {
74
- overwrite: false,
75
- errorOnExist: false,
76
- });
77
- }
78
-
79
- const templateFiles = await fs.readdir(templateDir);
80
- for (const file of templateFiles) {
81
- if (file !== "src" && (file.endsWith(".ts") || file.endsWith(".json"))) {
82
- const srcFile = path.join(templateDir, file);
83
- const destFile = path.join(projectDir, file);
84
-
85
- if (!(await fs.pathExists(destFile))) {
86
- await fs.copy(srcFile, destFile);
87
- }
88
- }
89
- }
90
- }
91
-
92
- async function append_env_example(
93
- projectDir: string,
94
- content: string
95
- ): Promise<void> {
96
- const envPath = path.join(projectDir, ".env.example");
97
- await fs.appendFile(envPath, content);
98
- }
@@ -1,79 +0,0 @@
1
- import path from "path";
2
- import fs from "fs-extra";
3
- import { fileURLToPath } from "url";
4
- import { type InstallerOptions, AvailablePackages } from "../types/index.js";
5
- import { add_package_dependency } from "../utils/add-package-dependency.js";
6
- import { DEPENDENCY_VERSION_MAP } from "../utils/dependency-version-map.js";
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
- /**
12
- * Realtime installer - handles Socket.IO and Server-Sent Events (SSE).
13
- *
14
- * @param options - Installer options with selected packages
15
- */
16
- export async function realtime_installer(
17
- options: InstallerOptions
18
- ): Promise<void> {
19
- const { projectDir, packages } = options;
20
-
21
- for (const pkg of packages) {
22
- switch (pkg) {
23
- case AvailablePackages.socketio:
24
- await install_socketio(projectDir);
25
- break;
26
- case AvailablePackages.sse:
27
- await install_sse(projectDir);
28
- break;
29
- }
30
- }
31
- }
32
-
33
- async function install_socketio(projectDir: string): Promise<void> {
34
- const templateDir = path.resolve(
35
- __dirname,
36
- "templates/extras/realtime/socketio"
37
- );
38
- await copy_template_files(templateDir, projectDir);
39
-
40
- await add_package_dependency(projectDir, {
41
- "socket.io": DEPENDENCY_VERSION_MAP["socket.io"],
42
- });
43
-
44
- await add_package_dependency(
45
- projectDir,
46
- {},
47
- {
48
- "@types/socket.io": DEPENDENCY_VERSION_MAP["@types/socket.io"],
49
- }
50
- );
51
- }
52
-
53
- async function install_sse(projectDir: string): Promise<void> {
54
- const templateDir = path.resolve(
55
- __dirname,
56
- "templates/extras/realtime/sse"
57
- );
58
- await copy_template_files(templateDir, projectDir);
59
-
60
- // SSE has no external dependencies, it's a native web standard
61
- }
62
-
63
- async function copy_template_files(
64
- templateDir: string,
65
- projectDir: string
66
- ): Promise<void> {
67
- if (!(await fs.pathExists(templateDir))) {
68
- return;
69
- }
70
-
71
- const srcDir = path.join(templateDir, "src");
72
- if (await fs.pathExists(srcDir)) {
73
- const targetSrcDir = path.join(projectDir, "src");
74
- await fs.copy(srcDir, targetSrcDir, {
75
- overwrite: false,
76
- errorOnExist: false,
77
- });
78
- }
79
- }
@@ -1,88 +0,0 @@
1
- import path from "path";
2
- import fs from "fs-extra";
3
- import { fileURLToPath } from "url";
4
- import { type InstallerOptions, AvailablePackages } from "../types/index.js";
5
- import { add_package_dependency } from "../utils/add-package-dependency.js";
6
- import { DEPENDENCY_VERSION_MAP } from "../utils/dependency-version-map.js";
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
- /**
12
- * Testing installer - handles Vitest testing framework.
13
- *
14
- * @param options - Installer options with selected packages
15
- */
16
- export async function testing_installer(
17
- options: InstallerOptions
18
- ): Promise<void> {
19
- const { projectDir, packages } = options;
20
-
21
- for (const pkg of packages) {
22
- switch (pkg) {
23
- case AvailablePackages.vitest:
24
- await install_vitest(projectDir);
25
- break;
26
- }
27
- }
28
- }
29
-
30
- async function install_vitest(projectDir: string): Promise<void> {
31
- const templateDir = path.resolve(
32
- __dirname,
33
- "templates/extras/testing/vitest"
34
- );
35
- await copy_template_files(templateDir, projectDir);
36
-
37
- await add_package_dependency(projectDir, {
38
- vitest: DEPENDENCY_VERSION_MAP["vitest"],
39
- "@vitest/ui": DEPENDENCY_VERSION_MAP["@vitest/ui"],
40
- supertest: DEPENDENCY_VERSION_MAP["supertest"],
41
- });
42
-
43
- await add_package_dependency(
44
- projectDir,
45
- {},
46
- {
47
- "@types/supertest": DEPENDENCY_VERSION_MAP["@types/supertest"],
48
- }
49
- );
50
- }
51
-
52
- async function copy_template_files(
53
- templateDir: string,
54
- projectDir: string
55
- ): Promise<void> {
56
- if (!(await fs.pathExists(templateDir))) {
57
- return;
58
- }
59
-
60
- const srcDir = path.join(templateDir, "src");
61
- if (await fs.pathExists(srcDir)) {
62
- const targetSrcDir = path.join(projectDir, "src");
63
- await fs.copy(srcDir, targetSrcDir, {
64
- overwrite: false,
65
- errorOnExist: false,
66
- });
67
- }
68
-
69
- const templateFiles = await fs.readdir(templateDir);
70
- for (const file of templateFiles) {
71
- if (file !== "src" && (file.endsWith(".ts") || file.endsWith(".json"))) {
72
- const srcFile = path.join(templateDir, file);
73
- const destFile = path.join(projectDir, file);
74
-
75
- if (!(await fs.pathExists(destFile))) {
76
- await fs.copy(srcFile, destFile);
77
- }
78
- }
79
- }
80
- }
81
-
82
- async function append_env_example(
83
- projectDir: string,
84
- content: string
85
- ): Promise<void> {
86
- const envPath = path.join(projectDir, ".env.example");
87
- await fs.appendFile(envPath, content);
88
- }
@@ -1,85 +0,0 @@
1
- import path from "path";
2
- import fs from "fs-extra";
3
- import { fileURLToPath } from "url";
4
- import { type InstallerOptions, AvailablePackages } from "../types/index.js";
5
- import { add_package_dependency } from "../utils/add-package-dependency.js";
6
- import { DEPENDENCY_VERSION_MAP } from "../utils/dependency-version-map.js";
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
- /**
12
- * Validation installer - handles Zod and Yup validation libraries.
13
- *
14
- * @param options - Installer options with selected packages
15
- */
16
- export async function validation_installer(
17
- options: InstallerOptions
18
- ): Promise<void> {
19
- const { projectDir, packages } = options;
20
-
21
- for (const pkg of packages) {
22
- switch (pkg) {
23
- case AvailablePackages.zod:
24
- await install_zod(projectDir);
25
- break;
26
- case AvailablePackages.yup:
27
- await install_yup(projectDir);
28
- break;
29
- }
30
- }
31
- }
32
-
33
- async function install_zod(projectDir: string): Promise<void> {
34
- const templateDir = path.resolve(
35
- __dirname,
36
- "templates/extras/validation/zod"
37
- );
38
- await copy_template_files(templateDir, projectDir);
39
-
40
- await add_package_dependency(projectDir, {
41
- zod: DEPENDENCY_VERSION_MAP["zod"],
42
- });
43
- }
44
-
45
- async function install_yup(projectDir: string): Promise<void> {
46
- const templateDir = path.resolve(
47
- __dirname,
48
- "templates/extras/validation/yup"
49
- );
50
- await copy_template_files(templateDir, projectDir);
51
-
52
- await add_package_dependency(projectDir, {
53
- yup: DEPENDENCY_VERSION_MAP["yup"],
54
- });
55
- }
56
-
57
- async function copy_template_files(
58
- templateDir: string,
59
- projectDir: string
60
- ): Promise<void> {
61
- if (!(await fs.pathExists(templateDir))) {
62
- return;
63
- }
64
-
65
- const srcDir = path.join(templateDir, "src");
66
- if (await fs.pathExists(srcDir)) {
67
- const targetSrcDir = path.join(projectDir, "src");
68
- await fs.copy(srcDir, targetSrcDir, {
69
- overwrite: false,
70
- errorOnExist: false,
71
- });
72
- }
73
-
74
- const templateFiles = await fs.readdir(templateDir);
75
- for (const file of templateFiles) {
76
- if (file !== "src" && (file.endsWith(".ts") || file.endsWith(".json"))) {
77
- const srcFile = path.join(templateDir, file);
78
- const destFile = path.join(projectDir, file);
79
-
80
- if (!(await fs.pathExists(destFile))) {
81
- await fs.copy(srcFile, destFile);
82
- }
83
- }
84
- }
85
- }
@@ -1,126 +0,0 @@
1
- export interface CliFlags {
2
- noGit: boolean;
3
- noInstall: boolean;
4
- default: boolean;
5
- CI: boolean;
6
-
7
- // Database flags
8
- postgres?: boolean;
9
- mysql?: boolean;
10
- mongodb?: boolean;
11
- redis?: boolean;
12
-
13
- // Auth flags
14
- jwt?: boolean;
15
- oauth?: boolean;
16
- session?: boolean;
17
-
18
- // AI flags
19
- openai?: boolean;
20
- anthropic?: boolean;
21
- gemini?: boolean;
22
- vercelAI?: boolean;
23
-
24
- // Cloud flags
25
- aws?: boolean;
26
- gcp?: boolean;
27
- azure?: boolean;
28
- cloudflareR2?: boolean;
29
-
30
- // Communication flags
31
- resend?: boolean;
32
- sendgrid?: boolean;
33
- nodemailer?: boolean;
34
- socketio?: boolean;
35
- sse?: boolean;
36
-
37
- // Infrastructure flags
38
- bullmq?: boolean;
39
- inngest?: boolean;
40
- upstashRateLimit?: boolean;
41
- customRateLimit?: boolean;
42
- sentry?: boolean;
43
- logtail?: boolean;
44
-
45
- // DevX flags
46
- swagger?: boolean;
47
- scalar?: boolean;
48
- vitest?: boolean;
49
-
50
- // Validation flags
51
- zod?: boolean;
52
- yup?: boolean;
53
- }
54
-
55
- export type Framework = "hono" | "express" | "bun-native";
56
-
57
- export interface CliResults {
58
- appName: string;
59
- framework: Framework;
60
- packages: AvailablePackages[];
61
- flags: CliFlags;
62
- }
63
-
64
- export enum AvailablePackages {
65
- // Core
66
- postgres = "postgres",
67
- mysql = "mysql",
68
- mongodb = "mongodb",
69
- redis = "redis",
70
- jwt = "jwt",
71
- oauth = "oauth",
72
- session = "session",
73
-
74
- // AI & ML
75
- openai = "openai",
76
- anthropic = "anthropic",
77
- gemini = "gemini",
78
- vercelAI = "vercel-ai",
79
-
80
- // Cloud & Storage
81
- aws = "aws",
82
- gcp = "gcp",
83
- azure = "azure",
84
- cloudflareR2 = "cloudflare-r2",
85
-
86
- // Communications
87
- resend = "resend",
88
- sendgrid = "sendgrid",
89
- nodemailer = "nodemailer",
90
- socketio = "socketio",
91
- sse = "sse",
92
-
93
- // Infrastructure
94
- bullmq = "bullmq",
95
- inngest = "inngest",
96
- upstashRateLimit = "upstash-ratelimit",
97
- customRateLimit = "custom-ratelimit",
98
- sentry = "sentry",
99
- logtail = "logtail",
100
-
101
- // Developer Experience
102
- swagger = "swagger",
103
- scalar = "scalar",
104
- vitest = "vitest",
105
-
106
- // Validation
107
- zod = "zod",
108
- yup = "yup",
109
- }
110
-
111
- export interface InstallerOptions {
112
- projectDir: string;
113
- packages: AvailablePackages[];
114
- appName: string;
115
- framework: Framework;
116
- noInstall: boolean;
117
- }
118
-
119
- export type Installer = (opts: InstallerOptions) => Promise<void>;
120
-
121
- export interface PkgInstallerMap {
122
- [key: string]: {
123
- inUse: boolean;
124
- installer: Installer;
125
- };
126
- }
@@ -1,56 +0,0 @@
1
- import path from "path";
2
- import fs from "fs-extra";
3
-
4
- /**
5
- * Adds dependencies to a project's package.json file.
6
- * Reads the file, merges dependencies, sorts keys alphabetically, and writes back.
7
- *
8
- * @param projectDir - Absolute path to the project directory
9
- * @param dependencies - Dependencies to add to the "dependencies" section
10
- * @param devDependencies - Optional dev dependencies to add to "devDependencies" section
11
- */
12
- export async function add_package_dependency(
13
- projectDir: string,
14
- dependencies: Record<string, string>,
15
- devDependencies?: Record<string, string>
16
- ): Promise<void> {
17
- const packageJsonPath = path.join(projectDir, "package.json");
18
-
19
- // Read existing package.json
20
- const packageJson = await fs.readJson(packageJsonPath);
21
-
22
- // Merge dependencies
23
- if (dependencies && Object.keys(dependencies).length > 0) {
24
- packageJson.dependencies = {
25
- ...packageJson.dependencies,
26
- ...dependencies,
27
- };
28
-
29
- // Sort dependencies alphabetically
30
- packageJson.dependencies = Object.keys(packageJson.dependencies)
31
- .sort()
32
- .reduce((acc: Record<string, string>, key: string) => {
33
- acc[key] = packageJson.dependencies[key];
34
- return acc;
35
- }, {});
36
- }
37
-
38
- // Merge devDependencies
39
- if (devDependencies && Object.keys(devDependencies).length > 0) {
40
- packageJson.devDependencies = {
41
- ...packageJson.devDependencies,
42
- ...devDependencies,
43
- };
44
-
45
- // Sort devDependencies alphabetically
46
- packageJson.devDependencies = Object.keys(packageJson.devDependencies)
47
- .sort()
48
- .reduce((acc: Record<string, string>, key: string) => {
49
- acc[key] = packageJson.devDependencies[key];
50
- return acc;
51
- }, {});
52
- }
53
-
54
- // Write back to package.json with proper formatting
55
- await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });
56
- }