deploy-bbc 1.2.1 → 1.2.3

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 +142 -281
  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
package/CLAUDE.md DELETED
@@ -1,403 +0,0 @@
1
- # Project Conventions & Guidelines
2
-
3
- This document outlines the coding conventions and guidelines for the `create-backend-app` project.
4
-
5
- ---
6
-
7
- ## 📁 File & Folder Naming Conventions
8
-
9
- ### ✅ Use `kebab-case` for ALL files and folders
10
-
11
- **Files:**
12
-
13
- ```
14
- ✅ create-project.ts
15
- ✅ install-dependencies.ts
16
- ✅ generate-docker-compose.ts
17
- ✅ scaffold-project.ts
18
-
19
- ❌ createProject.ts
20
- ❌ installDependencies.ts
21
- ❌ generate_docker_compose.ts
22
- ```
23
-
24
- **Folders:**
25
-
26
- ```
27
- ✅ src/helpers/
28
- ✅ src/templates/extras/
29
- ✅ src/utils/dependency-versions/
30
- ✅ templates/extras/ai/vercel-ai/
31
-
32
- ❌ src/Helpers/
33
- ❌ src/templates_extras/
34
- ❌ src/utils/dependencyVersions/
35
- ```
36
-
37
- **Why kebab-case?**
38
-
39
- - URL-friendly
40
- - Case-insensitive filesystem compatible
41
- - Easy to read
42
- - Industry standard for file systems
43
-
44
- ---
45
-
46
- ## 🔧 Function Naming Conventions
47
-
48
- ### ✅ Use `snake_case` for ALL function definitions
49
-
50
- **Functions:**
51
-
52
- ```typescript
53
- ✅ export async function create_project(options: CliResults) { }
54
- ✅ export function install_dependencies(projectDir: string) { }
55
- ✅ export function generate_dockerfile(options: ProjectOptions) { }
56
- ✅ function add_package_dependency(pkg: string) { }
57
-
58
- ❌ export async function createProject(options: CliResults) { }
59
- ❌ export function installDependencies(projectDir: string) { }
60
- ❌ export function generateDockerfile(options: ProjectOptions) { }
61
- ```
62
-
63
- **Why snake_case?**
64
-
65
- - Consistent with Python/Rust conventions
66
- - Clear word separation
67
- - Easy to read in longer function names
68
- - Reduces cognitive load when switching between languages
69
-
70
- ---
71
-
72
- ## 📝 Variable Naming Conventions
73
-
74
- ### Use `camelCase` for variables and parameters
75
-
76
- ```typescript
77
- ✅ const projectDir = "/path/to/project";
78
- ✅ const selectedPackages = ["postgres", "redis"];
79
- ✅ let isInstalling = false;
80
-
81
- ❌ const project_dir = "/path/to/project";
82
- ❌ const selected_packages = ["postgres", "redis"];
83
- ```
84
-
85
- **Why camelCase for variables?**
86
-
87
- - TypeScript/JavaScript standard
88
- - Matches ecosystem conventions
89
- - Better IDE support
90
-
91
- ---
92
-
93
- ## 🎯 Constants
94
-
95
- ### Use `SCREAMING_SNAKE_CASE` for constants
96
-
97
- ```typescript
98
- ✅ const DEFAULT_PORT = 3000;
99
- ✅ const MAX_RETRIES = 3;
100
- ✅ const DATABASE_URL = process.env.DATABASE_URL;
101
-
102
- ❌ const defaultPort = 3000;
103
- ❌ const maxRetries = 3;
104
- ```
105
-
106
- ---
107
-
108
- ## 📦 Type Naming & Usage
109
-
110
- ### Use `PascalCase` for types, enums, and classes
111
-
112
- ```typescript
113
- ✅ type CliResults = { }
114
- ✅ type InstallerOptions = { }
115
- ✅ enum AvailablePackages { }
116
- ✅ class ProjectScaffold { }
117
-
118
- ❌ type cli_results = { }
119
- ❌ type installer_options = { }
120
- ```
121
-
122
- ### ⚠️ ALWAYS use `type` instead of `interface`
123
-
124
- ```typescript
125
- ✅ type CliResults = {
126
- appName: string;
127
- flags: {
128
- noGit: boolean;
129
- noInstall: boolean;
130
- };
131
- packages: string[];
132
- }
133
-
134
- ✅ type ScaffoldOptions = {
135
- projectDir: string;
136
- appName: string;
137
- packages: string[];
138
- }
139
-
140
- ❌ interface CliResults {
141
- appName: string;
142
- flags: {
143
- noGit: boolean;
144
- noInstall: boolean;
145
- };
146
- packages: string[];
147
- }
148
-
149
- ❌ interface ScaffoldOptions {
150
- projectDir: string;
151
- appName: string;
152
- packages: string[];
153
- }
154
- ```
155
-
156
- **Why `type` over `interface`?**
157
-
158
- - **Consistency**: Single way to define object shapes
159
- - **Flexibility**: Types support unions, intersections, and mapped types more naturally
160
- - **Composability**: Better for complex type operations and transformations
161
- - **Simplicity**: One less concept to remember
162
- - **Modern practice**: Aligns with contemporary TypeScript patterns
163
-
164
- **Extending types:**
165
-
166
- ```typescript
167
- ✅ type BaseOptions = {
168
- projectDir: string;
169
- appName: string;
170
- }
171
-
172
- ✅ type ExtendedOptions = BaseOptions & {
173
- packages: string[];
174
- flags: Record<string, boolean>;
175
- }
176
-
177
- ❌ interface BaseOptions {
178
- projectDir: string;
179
- appName: string;
180
- }
181
-
182
- ❌ interface ExtendedOptions extends BaseOptions {
183
- packages: string[];
184
- flags: Record<string, boolean>;
185
- }
186
- ```
187
-
188
- ---
189
-
190
- ## 🗂️ Import/Export Conventions
191
-
192
- ### Named exports preferred over default exports
193
-
194
- ```typescript
195
- ✅ export function create_project() { }
196
- ✅ export const install_dependencies = () => { }
197
-
198
- ❌ export default function createProject() { }
199
- ```
200
-
201
- ### Import organization
202
-
203
- ```typescript
204
- // 1. External dependencies
205
- import chalk from "chalk";
206
- import * as p from "@clack/prompts";
207
-
208
- // 2. Internal absolute imports
209
- import { logger } from "../utils/logger.js";
210
- import { type CliResults } from "../types/index.js";
211
-
212
- // 3. Relative imports
213
- import { create_project } from "./create-project.js";
214
- ```
215
-
216
- ---
217
-
218
- ## 📋 Complete Example
219
-
220
- ```typescript
221
- // src/helpers/scaffold-project.ts
222
-
223
- import path from "path";
224
- import fs from "fs-extra";
225
- import { type CliResults, type InstallerOptions } from "../types/index.js";
226
- import { logger } from "../utils/logger.js";
227
- import { install_dependencies } from "./install-dependencies.js";
228
-
229
- const DEFAULT_PROJECT_DIR = process.cwd();
230
- const TEMPLATE_BASE_PATH = "../templates/base";
231
-
232
- type ScaffoldOptions = {
233
- projectDir: string;
234
- appName: string;
235
- packages: string[];
236
- }
237
-
238
- export async function scaffold_project(options: CliResults): Promise<void> {
239
- const projectDir = path.resolve(DEFAULT_PROJECT_DIR, options.appName);
240
-
241
- logger.info(`Creating project at: ${projectDir}`);
242
-
243
- await create_base_structure(projectDir);
244
- await copy_template_files(projectDir, options.packages);
245
-
246
- if (!options.flags.noInstall) {
247
- await install_dependencies(projectDir);
248
- }
249
-
250
- logger.success("✅ Project scaffolded successfully!");
251
- }
252
-
253
- async function create_base_structure(projectDir: string): Promise<void> {
254
- await fs.ensureDir(projectDir);
255
- await fs.ensureDir(path.join(projectDir, "src"));
256
- await fs.ensureDir(path.join(projectDir, "src", "routes"));
257
- }
258
-
259
- async function copy_template_files(
260
- projectDir: string,
261
- packages: string[]
262
- ): Promise<void> {
263
- const templatePath = path.resolve(__dirname, TEMPLATE_BASE_PATH);
264
- await fs.copy(templatePath, projectDir);
265
- }
266
-
267
- function get_package_installer(packageName: string) {
268
- // Implementation
269
- }
270
- ```
271
-
272
- ---
273
-
274
- ## 🎨 Template File Naming
275
-
276
- ### Template files should also use kebab-case
277
-
278
- ```
279
- ✅ templates/base/src/index.ts
280
- ✅ templates/extras/database/postgres/src/db/index.ts
281
- ✅ templates/extras/ai/vercel-ai/src/services/ai/index.ts
282
- ✅ templates/extras/queue/bullmq/src/queue/email-job.ts
283
-
284
- ❌ templates/base/src/Index.ts
285
- ❌ templates/extras/database/postgres/src/db/dbIndex.ts
286
- ❌ templates/extras/ai/vercel-ai/src/services/ai/aiService.ts
287
- ```
288
-
289
- ---
290
-
291
- ## 🔍 Linting Rules
292
-
293
- To enforce these conventions, configure ESLint:
294
-
295
- ```json
296
- {
297
- "rules": {
298
- "camelcase": ["error", {
299
- "properties": "never",
300
- "allow": ["^[a-z]+(_[a-z]+)*$"]
301
- }],
302
- "@typescript-eslint/naming-convention": [
303
- "error",
304
- {
305
- "selector": "function",
306
- "format": ["snake_case"]
307
- },
308
- {
309
- "selector": "variable",
310
- "format": ["camelCase", "UPPER_CASE"]
311
- },
312
- {
313
- "selector": "typeLike",
314
- "format": ["PascalCase"]
315
- }
316
- ],
317
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
318
- "@typescript-eslint/no-empty-interface": "error"
319
- }
320
- }
321
- ```
322
-
323
- ---
324
-
325
- ## 🚫 Common Mistakes to Avoid
326
-
327
- ### ❌ Don't mix conventions
328
-
329
- ```typescript
330
- ❌ function createProject() { } // camelCase function
331
- ❌ const project_dir = ""; // snake_case variable
332
- ❌ src/CreateProject.ts // PascalCase file
333
- ❌ interface CliResults { } // Using interface
334
- ```
335
-
336
- ### ✅ Do stick to the rules
337
-
338
- ```typescript
339
- ✅ function create_project() { } // snake_case function
340
- ✅ const projectDir = ""; // camelCase variable
341
- ✅ src/create-project.ts // kebab-case file
342
- ✅ type CliResults = { } // Using type
343
- ```
344
-
345
- ---
346
-
347
- ## 📚 Summary Table
348
-
349
- | Element | Convention | Example |
350
- |---------|-----------|---------|
351
- | **Files** | `kebab-case` | `create-project.ts` |
352
- | **Folders** | `kebab-case` | `src/helpers/` |
353
- | **Functions** | `snake_case` | `function create_project()` |
354
- | **Variables** | `camelCase` | `const projectDir` |
355
- | **Constants** | `SCREAMING_SNAKE_CASE` | `const MAX_RETRIES` |
356
- | **Types** | `PascalCase` + `type` keyword | `type CliResults = { }` |
357
- | **Enums** | `PascalCase` | `enum AvailablePackages` |
358
- | **Classes** | `PascalCase` | `class ProjectScaffold` |
359
- | **Object Shapes** | Use `type`, NOT `interface` | `type Config = { }` |
360
-
361
- ---
362
-
363
- ## 🤝 Contributing
364
-
365
- When contributing to this project, please:
366
-
367
- 1. ✅ Follow ALL conventions outlined in this document
368
- 2. ✅ Use `type` instead of `interface` for all object type definitions
369
- 3. ✅ Run linting before committing: `bun run lint`
370
- 4. ✅ Format code: `bun run format`
371
- 5. ✅ Use descriptive commit messages
372
- 6. ✅ Add JSDoc comments for exported functions
373
-
374
- ---
375
-
376
- ## 💡 Rationale
377
-
378
- These conventions are chosen to:
379
-
380
- - **Maintain consistency** across the codebase
381
- - **Improve readability** for all contributors
382
- - **Reduce cognitive load** when working with multiple languages
383
- - **Follow industry standards** where applicable
384
- - **Enable better tooling support**
385
- - **Simplify type definitions** by using only `type` declarations
386
-
387
- ---
388
-
389
- ## 📖 References
390
-
391
- - [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
392
- - [TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html)
393
- - [File Naming Conventions](https://github.com/kettanaito/naming-cheatsheet)
394
- - [Types vs Interfaces](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces)
395
-
396
- ---
397
-
398
- **Last Updated:** January 2026
399
- **Maintainer:** @yourname
400
-
401
- ---
402
-
403
- *Questions or suggestions? Open an issue or PR!*