create-hest-app 0.1.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 (139) hide show
  1. package/README.md +211 -0
  2. package/dist/index.js +127 -0
  3. package/package.json +50 -0
  4. package/templates/base/.prettierrc +33 -0
  5. package/templates/base/.vscode/extensions.json +79 -0
  6. package/templates/base/.vscode/settings.json +70 -0
  7. package/templates/base/README.md +562 -0
  8. package/templates/base/eslint.config.ts +26 -0
  9. package/templates/base/package.json +62 -0
  10. package/templates/base/src/app.controller.ts +39 -0
  11. package/templates/base/src/app.module.ts +12 -0
  12. package/templates/base/src/app.service.ts +30 -0
  13. package/templates/base/src/common/filters/http-exception.filter.ts +34 -0
  14. package/templates/base/src/common/interceptors/response.interceptor.ts +38 -0
  15. package/templates/base/src/index.ts +35 -0
  16. package/templates/base/src/modules/custom-validation/custom-validation.controller.ts +146 -0
  17. package/templates/base/src/modules/custom-validation/custom-validation.module.ts +10 -0
  18. package/templates/base/src/modules/custom-validation/custom-validation.service.ts +33 -0
  19. package/templates/base/src/modules/custom-validation/dto/custom-validation.dto.ts +132 -0
  20. package/templates/base/src/modules/users/dto/user.dto.ts +64 -0
  21. package/templates/base/src/modules/users/entities/user.entity.ts +9 -0
  22. package/templates/base/src/modules/users/users.controller.ts +68 -0
  23. package/templates/base/src/modules/users/users.module.ts +10 -0
  24. package/templates/base/src/modules/users/users.service.ts +55 -0
  25. package/templates/base/tsconfig.json +19 -0
  26. package/templates/base_scalar/.prettierrc +32 -0
  27. package/templates/base_scalar/.vscode/extensions.json +79 -0
  28. package/templates/base_scalar/.vscode/settings.json +70 -0
  29. package/templates/base_scalar/README.md +562 -0
  30. package/templates/base_scalar/eslint.config.ts +26 -0
  31. package/templates/base_scalar/package.json +63 -0
  32. package/templates/base_scalar/src/app.controller.ts +196 -0
  33. package/templates/base_scalar/src/app.module.ts +12 -0
  34. package/templates/base_scalar/src/app.service.ts +30 -0
  35. package/templates/base_scalar/src/common/filters/http-exception.filter.ts +34 -0
  36. package/templates/base_scalar/src/common/interceptors/response.interceptor.ts +38 -0
  37. package/templates/base_scalar/src/index.ts +67 -0
  38. package/templates/base_scalar/src/modules/custom-validation/custom-validation.controller.ts +146 -0
  39. package/templates/base_scalar/src/modules/custom-validation/custom-validation.module.ts +10 -0
  40. package/templates/base_scalar/src/modules/custom-validation/custom-validation.service.ts +33 -0
  41. package/templates/base_scalar/src/modules/custom-validation/dto/custom-validation.dto.ts +132 -0
  42. package/templates/base_scalar/src/modules/users/dto/user.dto.ts +64 -0
  43. package/templates/base_scalar/src/modules/users/entities/user.entity.ts +9 -0
  44. package/templates/base_scalar/src/modules/users/users.controller.ts +68 -0
  45. package/templates/base_scalar/src/modules/users/users.module.ts +10 -0
  46. package/templates/base_scalar/src/modules/users/users.service.ts +55 -0
  47. package/templates/base_scalar/tsconfig.json +19 -0
  48. package/templates/cqrs/.prettierrc +33 -0
  49. package/templates/cqrs/.vscode/extensions.json +79 -0
  50. package/templates/cqrs/.vscode/settings.json +70 -0
  51. package/templates/cqrs/README.md +234 -0
  52. package/templates/cqrs/eslint.config.ts +26 -0
  53. package/templates/cqrs/package.json +62 -0
  54. package/templates/cqrs/src/app.controller.ts +28 -0
  55. package/templates/cqrs/src/app.module.ts +12 -0
  56. package/templates/cqrs/src/app.service.ts +8 -0
  57. package/templates/cqrs/src/common/filters/http-exception.filter.ts +34 -0
  58. package/templates/cqrs/src/common/interceptors/response.interceptor.ts +38 -0
  59. package/templates/cqrs/src/index.ts +38 -0
  60. package/templates/cqrs/src/modules/custom-validation/custom-validation.controller.ts +146 -0
  61. package/templates/cqrs/src/modules/custom-validation/custom-validation.module.ts +10 -0
  62. package/templates/cqrs/src/modules/custom-validation/custom-validation.service.ts +33 -0
  63. package/templates/cqrs/src/modules/custom-validation/dto/custom-validation.dto.ts +132 -0
  64. package/templates/cqrs/src/modules/users/dto/user.dto.ts +64 -0
  65. package/templates/cqrs/src/modules/users/entities/user.entity.ts +9 -0
  66. package/templates/cqrs/src/modules/users/users.controller.ts +68 -0
  67. package/templates/cqrs/src/modules/users/users.module.ts +10 -0
  68. package/templates/cqrs/src/modules/users/users.service.ts +55 -0
  69. package/templates/cqrs/src/test-error-scenarios.ts +54 -0
  70. package/templates/cqrs/src/users/commands/create-user.command.ts +8 -0
  71. package/templates/cqrs/src/users/commands/index.ts +2 -0
  72. package/templates/cqrs/src/users/commands/update-user.command.ts +11 -0
  73. package/templates/cqrs/src/users/entities/index.ts +1 -0
  74. package/templates/cqrs/src/users/entities/user.entity.ts +22 -0
  75. package/templates/cqrs/src/users/events/index.ts +2 -0
  76. package/templates/cqrs/src/users/events/user-created.event.ts +8 -0
  77. package/templates/cqrs/src/users/events/user-updated.event.ts +8 -0
  78. package/templates/cqrs/src/users/handlers/create-user.handler.ts +26 -0
  79. package/templates/cqrs/src/users/handlers/get-all-users.handler.ts +15 -0
  80. package/templates/cqrs/src/users/handlers/get-user.handler.ts +15 -0
  81. package/templates/cqrs/src/users/handlers/index.ts +6 -0
  82. package/templates/cqrs/src/users/handlers/update-user.handler.ts +33 -0
  83. package/templates/cqrs/src/users/handlers/user-created.handler.ts +15 -0
  84. package/templates/cqrs/src/users/handlers/user-updated.handler.ts +15 -0
  85. package/templates/cqrs/src/users/index.ts +8 -0
  86. package/templates/cqrs/src/users/queries/get-all-users.query.ts +8 -0
  87. package/templates/cqrs/src/users/queries/get-user.query.ts +12 -0
  88. package/templates/cqrs/src/users/queries/index.ts +2 -0
  89. package/templates/cqrs/src/users/repositories/index.ts +1 -0
  90. package/templates/cqrs/src/users/repositories/user.repository.ts +51 -0
  91. package/templates/cqrs/src/users/user.controller.ts +66 -0
  92. package/templates/cqrs/src/users/user.module.ts +30 -0
  93. package/templates/cqrs/tsconfig.json +19 -0
  94. package/templates/cqrs_scalar/.prettierrc +33 -0
  95. package/templates/cqrs_scalar/.vscode/extensions.json +79 -0
  96. package/templates/cqrs_scalar/.vscode/settings.json +70 -0
  97. package/templates/cqrs_scalar/README.md +234 -0
  98. package/templates/cqrs_scalar/eslint.config.ts +26 -0
  99. package/templates/cqrs_scalar/package.json +62 -0
  100. package/templates/cqrs_scalar/src/app.controller.ts +28 -0
  101. package/templates/cqrs_scalar/src/app.module.ts +12 -0
  102. package/templates/cqrs_scalar/src/app.service.ts +8 -0
  103. package/templates/cqrs_scalar/src/common/filters/http-exception.filter.ts +34 -0
  104. package/templates/cqrs_scalar/src/common/interceptors/response.interceptor.ts +38 -0
  105. package/templates/cqrs_scalar/src/index.ts +38 -0
  106. package/templates/cqrs_scalar/src/modules/custom-validation/custom-validation.controller.ts +146 -0
  107. package/templates/cqrs_scalar/src/modules/custom-validation/custom-validation.module.ts +10 -0
  108. package/templates/cqrs_scalar/src/modules/custom-validation/custom-validation.service.ts +33 -0
  109. package/templates/cqrs_scalar/src/modules/custom-validation/dto/custom-validation.dto.ts +132 -0
  110. package/templates/cqrs_scalar/src/modules/users/dto/user.dto.ts +64 -0
  111. package/templates/cqrs_scalar/src/modules/users/entities/user.entity.ts +9 -0
  112. package/templates/cqrs_scalar/src/modules/users/users.controller.ts +68 -0
  113. package/templates/cqrs_scalar/src/modules/users/users.module.ts +10 -0
  114. package/templates/cqrs_scalar/src/modules/users/users.service.ts +55 -0
  115. package/templates/cqrs_scalar/src/test-error-scenarios.ts +54 -0
  116. package/templates/cqrs_scalar/src/users/commands/create-user.command.ts +8 -0
  117. package/templates/cqrs_scalar/src/users/commands/index.ts +2 -0
  118. package/templates/cqrs_scalar/src/users/commands/update-user.command.ts +11 -0
  119. package/templates/cqrs_scalar/src/users/entities/index.ts +1 -0
  120. package/templates/cqrs_scalar/src/users/entities/user.entity.ts +22 -0
  121. package/templates/cqrs_scalar/src/users/events/index.ts +2 -0
  122. package/templates/cqrs_scalar/src/users/events/user-created.event.ts +8 -0
  123. package/templates/cqrs_scalar/src/users/events/user-updated.event.ts +8 -0
  124. package/templates/cqrs_scalar/src/users/handlers/create-user.handler.ts +26 -0
  125. package/templates/cqrs_scalar/src/users/handlers/get-all-users.handler.ts +15 -0
  126. package/templates/cqrs_scalar/src/users/handlers/get-user.handler.ts +15 -0
  127. package/templates/cqrs_scalar/src/users/handlers/index.ts +6 -0
  128. package/templates/cqrs_scalar/src/users/handlers/update-user.handler.ts +33 -0
  129. package/templates/cqrs_scalar/src/users/handlers/user-created.handler.ts +15 -0
  130. package/templates/cqrs_scalar/src/users/handlers/user-updated.handler.ts +15 -0
  131. package/templates/cqrs_scalar/src/users/index.ts +8 -0
  132. package/templates/cqrs_scalar/src/users/queries/get-all-users.query.ts +8 -0
  133. package/templates/cqrs_scalar/src/users/queries/get-user.query.ts +12 -0
  134. package/templates/cqrs_scalar/src/users/queries/index.ts +2 -0
  135. package/templates/cqrs_scalar/src/users/repositories/index.ts +1 -0
  136. package/templates/cqrs_scalar/src/users/repositories/user.repository.ts +51 -0
  137. package/templates/cqrs_scalar/src/users/user.controller.ts +66 -0
  138. package/templates/cqrs_scalar/src/users/user.module.ts +30 -0
  139. package/templates/cqrs_scalar/tsconfig.json +19 -0
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "create-hest-app",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Create HestJS-powered applications with one command",
6
+ "keywords": [
7
+ "hestjs",
8
+ "hono",
9
+ "tsyringe",
10
+ "typescript",
11
+ "framework",
12
+ "web"
13
+ ],
14
+ "author": "HestJS Team",
15
+ "license": "MIT",
16
+ "bin": {
17
+ "create-hest-app": "./dist/index.js"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "templates"
22
+ ],
23
+ "scripts": {
24
+ "dev": "bun build ./src/index.ts --watch --outdir dist/",
25
+ "build": "bun build ./src/index.ts --outdir ./dist/ --minify --target=node",
26
+ "prepublishOnly": "bun run build",
27
+ "test": "echo \"Test script not yet implemented\""
28
+ },
29
+ "dependencies": {
30
+ "commander": "^14.0.0",
31
+ "inquirer": "^12.9.0",
32
+ "picocolors": "^1.1.1",
33
+ "validate-npm-package-name": "^6.0.2",
34
+ "cross-spawn": "^7.0.6",
35
+ "fs-extra": "^11.3.0",
36
+ "conf": "^14.0.0",
37
+ "update-check": "^1.5.4"
38
+ },
39
+ "devDependencies": {
40
+ "@types/cross-spawn": "^6.0.6",
41
+ "@types/fs-extra": "^11.0.4",
42
+ "@types/inquirer": "^9.0.8",
43
+ "@types/node": "^24.1.0",
44
+ "@types/validate-npm-package-name": "^4.0.2",
45
+ "typescript": "^5.8.3"
46
+ },
47
+ "engines": {
48
+ "node": ">=18.0.0"
49
+ }
50
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "trailingComma": "all",
5
+ "quoteProps": "as-needed",
6
+ "tabWidth": 2,
7
+ "printWidth": 80,
8
+ "bracketSpacing": true,
9
+ "arrowParens": "avoid",
10
+ "endOfLine": "lf",
11
+ "useTabs": false,
12
+ "overrides": [
13
+ {
14
+ "files": "*.json",
15
+ "options": {
16
+ "singleQuote": false
17
+ }
18
+ },
19
+ {
20
+ "files": "*.md",
21
+ "options": {
22
+ "proseWrap": "preserve"
23
+ }
24
+ },
25
+ {
26
+ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
27
+ "options": {
28
+ "singleQuote": true,
29
+ "semi": true
30
+ }
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "recommendations": [
3
+ // Cline
4
+ "saoudrizwan.claude-dev",
5
+
6
+ // Code Runner
7
+ "formulahendry.code-runner",
8
+
9
+ // Color Highlight
10
+ "naumovs.color-highlight",
11
+
12
+ // Draw Folder Structure
13
+ "jmkrivocapich.drawfolderstructure",
14
+
15
+ // ESLint
16
+ "dbaeumer.vscode-eslint",
17
+
18
+ // Git Graph
19
+ "mhutchie.git-graph",
20
+
21
+ // GitHub Copilot
22
+ "GitHub.copilot",
23
+
24
+ // GitHub Copilot Chat
25
+ "GitHub.copilot-chat",
26
+
27
+ // Github Actions
28
+ "github.vscode-github-actions",
29
+
30
+ // i18n Ally
31
+ "lokalise.i18n-ally",
32
+
33
+ // Iconify IntelliSense
34
+ "antfu.iconify",
35
+
36
+ // Indenticator
37
+ "SirTori.indenticator",
38
+
39
+ // Jest
40
+ "Orta.vscode-jest",
41
+
42
+ // Lingma - Alibaba
43
+ "Alibaba-Cloud.tongyi-lingma",
44
+
45
+ // Monorepo Workspace
46
+ "folke.vscode-monorepo-workspace",
47
+
48
+ // Prettier
49
+ "esbenp.prettier-vscode",
50
+
51
+ // Pretty TypeScript Errors
52
+ "YoavBls.pretty-ts-errors",
53
+
54
+ // Prisma
55
+ "Prisma.prisma",
56
+
57
+ // ,Todo Tree
58
+ "Gruntfuggly.todo-tree",
59
+
60
+ // Git Tags
61
+ "howardzuo.vscode-git-tags",
62
+
63
+ // JSON Comments
64
+ "wxzhang.json-comments",
65
+
66
+ // Markdown 相关
67
+ "kortina.vscode-markdown-notes",
68
+ "bierner.markdown-mermaid",
69
+ "DavidAnson.vscode-markdownlint",
70
+ "yzhang.markdown-all-in-one",
71
+ "zaaack.markdown-editor",
72
+
73
+ // 半透明背景
74
+ "illixion.vscode-vibrancy-continued",
75
+
76
+ // tailwindcss
77
+ "bradlc.vscode-tailwindcss"
78
+ ]
79
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "prettier.enable": true,
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
4
+ "editor.formatOnSave": true,
5
+ "[typescript]": {
6
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
7
+ },
8
+ "[javascript]": {
9
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
10
+ },
11
+
12
+ // i18n-ally
13
+ "i18n-ally.enabledParsers": ["json"],
14
+ "i18n-ally.displayLanguage": "zh-CN",
15
+ "i18n-ally.localesPaths": ["i18n", "public/messages", "script/i18n"],
16
+ "i18n-ally.keystyle": "nested",
17
+
18
+ // 文件嵌套
19
+ "explorer.fileNesting.enabled": true,
20
+ "explorer.fileNesting.expand": true,
21
+ "explorer.fileNesting.patterns": {
22
+ "*.ts": "${basename}.md, ${basename}.d.ts, ${basename}.test.ts, ${basename}.spec.ts, ${basename}.stories.ts, ${basename}.stories.tsx",
23
+ "*.tsx": "${basename}.md, ${basename}.d.ts, ${basename}.test.tsx, ${basename}.spec.tsx, ${basename}.stories.ts, ${basename}.stories.tsx",
24
+ "*.js": "${basename}.md, ${basename}.d.ts, ${basename}.test.js, ${basename}.spec.js, ${basename}.stories.js, ${basename}.stories.jsx",
25
+ "*.jsx": "${basename}.md, ${basename}.d.ts, ${basename}.test.jsx, ${basename}.spec.jsx, ${basename}.stories.js, ${basename}.stories.jsx",
26
+ "*.env": ".env.local, .env.development, .env.production, .env.test",
27
+ "package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml, .gitignore, .prettierrc, eslint.config.mjs, i18n.ts, components.json, postcss.config.mjs, tsconfig.json, eslint.config.ts, .prettierignore, bun.lock, .dockerignore",
28
+ "eslint.config.mjs": "eslint.config.cjs, eslint.config.jsx, eslint.config.ts, eslint.config.tsx",
29
+ "tsconfig.json": "tsconfig.cjs.json, tsconfig.jsx.json, tsconfig.ts.json, tsconfig.tsx.json",
30
+ "tailwind.config.mjs": "tailwind.config.cjs, tailwind.config.jsx, tailwind.config.ts, tailwind.config.tsx",
31
+ "next.config.ts": "next.config.cjs, next.config.jsx, next.config.tsx, next-env.d.ts"
32
+ },
33
+
34
+ // ESLint 配置
35
+ "eslint.enable": true,
36
+ "eslint.validate": [
37
+ "javascript",
38
+ "javascriptreact",
39
+ "typescript",
40
+ "typescriptreact"
41
+ ],
42
+ "editor.codeActionsOnSave": {
43
+ "source.fixAll.eslint": "explicit",
44
+ "source.organizeImports": "explicit"
45
+ },
46
+ "eslint.alwaysShowStatus": true,
47
+
48
+ // TypeScript 配置
49
+ "typescript.preferences.importModuleSpecifier": "relative",
50
+ "typescript.suggest.autoImports": true,
51
+
52
+ // 额外的文件排除
53
+ "files.exclude": {
54
+ "**/.git": true,
55
+ "**/.svn": true,
56
+ "**/.hg": true,
57
+ "**/CVS": true,
58
+ "**/.DS_Store": true,
59
+ "**/Thumbs.db": true
60
+ // "**/node_modules": true,
61
+ // "**/.next": true
62
+ },
63
+ "search.exclude": {
64
+ "**/node_modules": true,
65
+ "**/bower_components": true,
66
+ "**/*.code-search": true,
67
+ "**/.next": true,
68
+ "**/dist": true
69
+ }
70
+ }