create-hazejs 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +17 -2
- package/bin/create-hazejs.mjs +2 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +74 -0
- package/dist/scaffold.d.mts +29 -0
- package/dist/scaffold.mjs +76 -0
- package/package.json +77 -3
- package/templates/api/.env +4 -0
- package/templates/api/.env.test +1 -0
- package/templates/api/README.md +383 -0
- package/templates/api/_gitignore +9 -0
- package/templates/api/app/controller/AuthController.ts +45 -0
- package/templates/api/app/controller/GreetingController.ts +23 -0
- package/templates/api/app/controller/UserController.ts +38 -0
- package/templates/api/app/event/UserRegistered.ts +6 -0
- package/templates/api/app/exception/Handler.ts +13 -0
- package/templates/api/app/job/SendWelcomeEmail.ts +19 -0
- package/templates/api/app/listener/BroadcastRegistration.ts +7 -0
- package/templates/api/app/listener/QueueWelcomeEmail.ts +6 -0
- package/templates/api/app/mail/WelcomeMail.ts +17 -0
- package/templates/api/app/model/User.ts +11 -0
- package/templates/api/app/policy/UserPolicy.ts +14 -0
- package/templates/api/app/provider/AppProvider.ts +9 -0
- package/templates/api/app/provider/DatabaseProvider.ts +4 -0
- package/templates/api/app/response/Formatter.ts +17 -0
- package/templates/api/app/service/GreetingService.ts +6 -0
- package/templates/api/app/validate/auth.ts +20 -0
- package/templates/api/app/validate/greeting.ts +5 -0
- package/templates/api/app/validate/user.ts +12 -0
- package/templates/api/config/app.ts +7 -0
- package/templates/api/config/auth.ts +23 -0
- package/templates/api/config/cache.ts +23 -0
- package/templates/api/config/cors.ts +11 -0
- package/templates/api/config/database.ts +17 -0
- package/templates/api/config/filesystem.ts +32 -0
- package/templates/api/config/mail.ts +31 -0
- package/templates/api/config/middleware.ts +10 -0
- package/templates/api/config/queue.ts +21 -0
- package/templates/api/config/throttle.ts +12 -0
- package/templates/api/config/websocket.ts +12 -0
- package/templates/api/database/migrations/0000_create_users.sql +9 -0
- package/templates/api/database/migrations/0001_add_user_password.sql +1 -0
- package/templates/api/database/migrations/0002_add_user_role.sql +1 -0
- package/templates/api/database/migrations/meta/0000_snapshot.json +71 -0
- package/templates/api/database/migrations/meta/0001_snapshot.json +78 -0
- package/templates/api/database/migrations/meta/0002_snapshot.json +86 -0
- package/templates/api/database/migrations/meta/_journal.json +27 -0
- package/templates/api/database/schema/users.ts +17 -0
- package/templates/api/database/seeders/01-users.ts +15 -0
- package/templates/api/haze.config.ts +5 -0
- package/templates/api/package.json +38 -0
- package/templates/api/route/api.ts +22 -0
- package/templates/api/route/ws.ts +18 -0
- package/templates/api/schedule/app.ts +11 -0
- package/templates/api/tests/auth.test.ts +77 -0
- package/templates/api/tests/greeting.test.ts +29 -0
- package/templates/api/tests/user.test.ts +58 -0
- package/templates/api/tsconfig.json +34 -0
- package/templates/api/vitest.config.ts +4 -0
- package/templates/react/.env +8 -0
- package/templates/react/.env.test +1 -0
- package/templates/react/README.md +374 -0
- package/templates/react/_gitignore +9 -0
- package/templates/react/haze.config.ts +8 -0
- package/templates/react/index.html +12 -0
- package/templates/react/package.json +46 -0
- package/templates/react/server/app/controller/AuthController.ts +45 -0
- package/templates/react/server/app/controller/GreetingController.ts +23 -0
- package/templates/react/server/app/controller/UserController.ts +38 -0
- package/templates/react/server/app/event/UserRegistered.ts +6 -0
- package/templates/react/server/app/exception/Handler.ts +13 -0
- package/templates/react/server/app/job/SendWelcomeEmail.ts +19 -0
- package/templates/react/server/app/listener/BroadcastRegistration.ts +7 -0
- package/templates/react/server/app/listener/QueueWelcomeEmail.ts +6 -0
- package/templates/react/server/app/mail/WelcomeMail.ts +17 -0
- package/templates/react/server/app/model/User.ts +11 -0
- package/templates/react/server/app/policy/UserPolicy.ts +14 -0
- package/templates/react/server/app/provider/AppProvider.ts +9 -0
- package/templates/react/server/app/provider/DatabaseProvider.ts +4 -0
- package/templates/react/server/app/provider/SocketProvider.ts +4 -0
- package/templates/react/server/app/response/Formatter.ts +17 -0
- package/templates/react/server/app/service/GreetingService.ts +6 -0
- package/templates/react/server/app/socket/chat.ts +17 -0
- package/templates/react/server/app/validate/auth.ts +20 -0
- package/templates/react/server/app/validate/greeting.ts +5 -0
- package/templates/react/server/app/validate/user.ts +12 -0
- package/templates/react/server/config/app.ts +7 -0
- package/templates/react/server/config/auth.ts +23 -0
- package/templates/react/server/config/cache.ts +23 -0
- package/templates/react/server/config/database.ts +17 -0
- package/templates/react/server/config/filesystem.ts +32 -0
- package/templates/react/server/config/mail.ts +31 -0
- package/templates/react/server/config/middleware.ts +11 -0
- package/templates/react/server/config/queue.ts +21 -0
- package/templates/react/server/config/socketio.ts +13 -0
- package/templates/react/server/config/throttle.ts +12 -0
- package/templates/react/server/config/websocket.ts +12 -0
- package/templates/react/server/database/migrations/0000_create_users.sql +9 -0
- package/templates/react/server/database/migrations/0001_add_user_password.sql +1 -0
- package/templates/react/server/database/migrations/0002_add_user_role.sql +1 -0
- package/templates/react/server/database/migrations/meta/0000_snapshot.json +71 -0
- package/templates/react/server/database/migrations/meta/0001_snapshot.json +78 -0
- package/templates/react/server/database/migrations/meta/0002_snapshot.json +86 -0
- package/templates/react/server/database/migrations/meta/_journal.json +27 -0
- package/templates/react/server/database/schema/users.ts +17 -0
- package/templates/react/server/database/seeders/01-users.ts +15 -0
- package/templates/react/server/route/api.ts +24 -0
- package/templates/react/server/route/ws.ts +18 -0
- package/templates/react/server/schedule/app.ts +11 -0
- package/templates/react/src/App.css +22 -0
- package/templates/react/src/App.tsx +72 -0
- package/templates/react/src/api.ts +48 -0
- package/templates/react/src/main.tsx +9 -0
- package/templates/react/src/socket.ts +5 -0
- package/templates/react/src/vite-env.d.ts +5 -0
- package/templates/react/tests/auth.test.ts +77 -0
- package/templates/react/tests/greeting.test.ts +29 -0
- package/templates/react/tests/user.test.ts +58 -0
- package/templates/react/tsconfig.app.json +22 -0
- package/templates/react/tsconfig.json +7 -0
- package/templates/react/tsconfig.server.json +34 -0
- package/templates/react/vite.config.ts +18 -0
- package/templates/react/vitest.config.ts +8 -0
- package/templates/vue/.env +8 -0
- package/templates/vue/.env.test +1 -0
- package/templates/vue/README.md +374 -0
- package/templates/vue/_gitignore +9 -0
- package/templates/vue/haze.config.ts +8 -0
- package/templates/vue/index.html +12 -0
- package/templates/vue/package.json +44 -0
- package/templates/vue/server/app/controller/AuthController.ts +45 -0
- package/templates/vue/server/app/controller/GreetingController.ts +23 -0
- package/templates/vue/server/app/controller/UserController.ts +38 -0
- package/templates/vue/server/app/event/UserRegistered.ts +6 -0
- package/templates/vue/server/app/exception/Handler.ts +13 -0
- package/templates/vue/server/app/job/SendWelcomeEmail.ts +19 -0
- package/templates/vue/server/app/listener/BroadcastRegistration.ts +7 -0
- package/templates/vue/server/app/listener/QueueWelcomeEmail.ts +6 -0
- package/templates/vue/server/app/mail/WelcomeMail.ts +17 -0
- package/templates/vue/server/app/model/User.ts +11 -0
- package/templates/vue/server/app/policy/UserPolicy.ts +14 -0
- package/templates/vue/server/app/provider/AppProvider.ts +9 -0
- package/templates/vue/server/app/provider/DatabaseProvider.ts +4 -0
- package/templates/vue/server/app/provider/SocketProvider.ts +4 -0
- package/templates/vue/server/app/response/Formatter.ts +17 -0
- package/templates/vue/server/app/service/GreetingService.ts +6 -0
- package/templates/vue/server/app/socket/chat.ts +17 -0
- package/templates/vue/server/app/validate/auth.ts +20 -0
- package/templates/vue/server/app/validate/greeting.ts +5 -0
- package/templates/vue/server/app/validate/user.ts +12 -0
- package/templates/vue/server/config/app.ts +7 -0
- package/templates/vue/server/config/auth.ts +23 -0
- package/templates/vue/server/config/cache.ts +23 -0
- package/templates/vue/server/config/database.ts +17 -0
- package/templates/vue/server/config/filesystem.ts +32 -0
- package/templates/vue/server/config/mail.ts +31 -0
- package/templates/vue/server/config/middleware.ts +11 -0
- package/templates/vue/server/config/queue.ts +21 -0
- package/templates/vue/server/config/socketio.ts +13 -0
- package/templates/vue/server/config/throttle.ts +12 -0
- package/templates/vue/server/config/websocket.ts +12 -0
- package/templates/vue/server/database/migrations/0000_create_users.sql +9 -0
- package/templates/vue/server/database/migrations/0001_add_user_password.sql +1 -0
- package/templates/vue/server/database/migrations/0002_add_user_role.sql +1 -0
- package/templates/vue/server/database/migrations/meta/0000_snapshot.json +71 -0
- package/templates/vue/server/database/migrations/meta/0001_snapshot.json +78 -0
- package/templates/vue/server/database/migrations/meta/0002_snapshot.json +86 -0
- package/templates/vue/server/database/migrations/meta/_journal.json +27 -0
- package/templates/vue/server/database/schema/users.ts +17 -0
- package/templates/vue/server/database/seeders/01-users.ts +15 -0
- package/templates/vue/server/route/api.ts +24 -0
- package/templates/vue/server/route/ws.ts +18 -0
- package/templates/vue/server/schedule/app.ts +11 -0
- package/templates/vue/src/App.vue +92 -0
- package/templates/vue/src/api.ts +48 -0
- package/templates/vue/src/env.d.ts +5 -0
- package/templates/vue/src/main.ts +4 -0
- package/templates/vue/src/socket.ts +5 -0
- package/templates/vue/tests/auth.test.ts +77 -0
- package/templates/vue/tests/greeting.test.ts +29 -0
- package/templates/vue/tests/user.test.ts +58 -0
- package/templates/vue/tsconfig.app.json +22 -0
- package/templates/vue/tsconfig.json +7 -0
- package/templates/vue/tsconfig.server.json +34 -0
- package/templates/vue/vite.config.ts +18 -0
- package/templates/vue/vitest.config.ts +8 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.server.tsbuildinfo",
|
|
5
|
+
"target": "ES2023",
|
|
6
|
+
"lib": [
|
|
7
|
+
"ES2023"
|
|
8
|
+
],
|
|
9
|
+
"moduleDetection": "force",
|
|
10
|
+
"module": "ESNext",
|
|
11
|
+
"moduleResolution": "Bundler",
|
|
12
|
+
"paths": {
|
|
13
|
+
"~/*": [
|
|
14
|
+
"./server/*"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"types": [
|
|
18
|
+
"node",
|
|
19
|
+
"vite/client",
|
|
20
|
+
"@hazejs/vite/client"
|
|
21
|
+
],
|
|
22
|
+
"strict": true,
|
|
23
|
+
"noEmit": true,
|
|
24
|
+
"isolatedModules": true,
|
|
25
|
+
"verbatimModuleSyntax": true,
|
|
26
|
+
"skipLibCheck": true
|
|
27
|
+
},
|
|
28
|
+
"include": [
|
|
29
|
+
"server/**/*.ts",
|
|
30
|
+
"tests/**/*.ts",
|
|
31
|
+
"*.config.ts",
|
|
32
|
+
".haze/types/**/*.d.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
import { haze } from '@hazejs/vite'
|
|
3
|
+
import vue from '@vitejs/plugin-vue'
|
|
4
|
+
import { defineConfig } from 'vite'
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [
|
|
8
|
+
vue(),
|
|
9
|
+
// 开发时把 /api/** 交给 server/ 下的后端(同端口、热替换);
|
|
10
|
+
// vite build 一次产出 dist/client 与 dist/server
|
|
11
|
+
haze(),
|
|
12
|
+
],
|
|
13
|
+
resolve: {
|
|
14
|
+
alias: {
|
|
15
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
})
|