create-next-imagicma 0.0.6 → 0.0.7
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/package.json +1 -1
- package/template-hono/AGENTS.md +6 -6
- package/template-hono/README.md +10 -0
- package/template-hono/{index.html → client/index.html} +1 -1
- package/template-hono/package.json +1 -0
- package/template-hono/pnpm-lock.yaml +14 -0
- package/template-hono/tailwind.config.mjs +1 -4
- package/template-hono/tsconfig.json +1 -7
- package/template-hono/vite.config.ts +3 -2
- package/template-hono/.imagicma/AGENTS.md +0 -7
- package/template-hono/.imagicma/port.json +0 -5
- /package/template-hono/{public → client/public}/favicon.ico +0 -0
- /package/template-hono/{public → client/public}/file.svg +0 -0
- /package/template-hono/{public → client/public}/globe.svg +0 -0
- /package/template-hono/{public → client/public}/imagicma-picker-bridge.js +0 -0
- /package/template-hono/{public → client/public}/next.svg +0 -0
- /package/template-hono/{public → client/public}/vercel.svg +0 -0
- /package/template-hono/{public → client/public}/window.svg +0 -0
- /package/template-hono/{components → client/src/components}/ui/accordion.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/alert-dialog.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/alert.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/aspect-ratio.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/avatar.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/badge.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/breadcrumb.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/button.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/calendar.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/card.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/carousel.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/chart.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/checkbox.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/collapsible.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/command.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/context-menu.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/dialog.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/drawer.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/dropdown-menu.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/form.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/hover-card.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/input-otp.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/input.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/label.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/menubar.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/navigation-menu.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/pagination.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/popover.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/progress.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/radio-group.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/resizable.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/scroll-area.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/select.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/separator.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/sheet.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/sidebar.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/skeleton.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/slider.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/switch.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/table.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/tabs.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/textarea.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/toast.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/toaster.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/toggle-group.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/toggle.tsx +0 -0
- /package/template-hono/{components → client/src/components}/ui/tooltip.tsx +0 -0
- /package/template-hono/{hooks → client/src/hooks}/use-greeting.ts +0 -0
- /package/template-hono/{hooks → client/src/hooks}/use-mobile.ts +0 -0
- /package/template-hono/{hooks → client/src/hooks}/use-toast.ts +0 -0
- /package/template-hono/{lib → client/src/lib}/queryClient.ts +0 -0
- /package/template-hono/{lib → client/src/lib}/theme/default-theme.ts +0 -0
- /package/template-hono/{lib → client/src/lib}/utils.ts +0 -0
package/package.json
CHANGED
package/template-hono/AGENTS.md
CHANGED
|
@@ -12,13 +12,14 @@
|
|
|
12
12
|
|
|
13
13
|
## 目录约定
|
|
14
14
|
|
|
15
|
+
- `client/index.html`:Vite 前端入口 HTML
|
|
16
|
+
- `client/public/`:前端静态资源
|
|
15
17
|
- `client/src/`:前端应用入口、页面、Provider、错误边界
|
|
18
|
+
- `client/src/components/ui/`:shadcn/ui 组件
|
|
19
|
+
- `client/src/hooks/`:客户端 hooks
|
|
20
|
+
- `client/src/lib/`:通用工具
|
|
16
21
|
- `server/`:Hono 入口、路由、存储、DB
|
|
17
|
-
- `components/ui/`:shadcn/ui 组件
|
|
18
|
-
- `hooks/`:客户端 hooks
|
|
19
|
-
- `lib/`:通用工具
|
|
20
22
|
- `shared/`:前后端共享 schema/契约
|
|
21
|
-
- `public/`:静态资源(由 Vite/Hono 提供)
|
|
22
23
|
|
|
23
24
|
## 常用命令
|
|
24
25
|
|
|
@@ -34,6 +35,5 @@
|
|
|
34
35
|
- 服务端数据库逻辑放在 `server/`,不要泄漏到客户端。
|
|
35
36
|
- API 响应必须经过 `shared/routes.ts` 的 Zod schema 校验。
|
|
36
37
|
- 不提交 `.env.local`、数据库密钥。
|
|
37
|
-
- 优先复用 `components/ui`
|
|
38
|
-
|
|
38
|
+
- 优先复用 `client/src/components/ui` 与 `client/src/hooks`,避免重复造轮子。
|
|
39
39
|
|
package/template-hono/README.md
CHANGED
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
- 数据层:Drizzle ORM + PostgreSQL (`pg`)
|
|
10
10
|
- 校验契约:Zod(`shared/routes.ts`)
|
|
11
11
|
|
|
12
|
+
## 目录结构(重点)
|
|
13
|
+
|
|
14
|
+
- `client/index.html`:前端入口 HTML
|
|
15
|
+
- `client/public/`:前端静态资源
|
|
16
|
+
- `client/src/components/ui/`:shadcn/ui 组件
|
|
17
|
+
- `client/src/hooks/`:前端 hooks
|
|
18
|
+
- `client/src/lib/`:前端通用工具
|
|
19
|
+
- `server/`:Hono 后端入口与路由
|
|
20
|
+
- `shared/`:前后端共享契约与 schema
|
|
21
|
+
|
|
12
22
|
## 开发
|
|
13
23
|
|
|
14
24
|
```bash
|
|
@@ -11,6 +11,9 @@ importers:
|
|
|
11
11
|
'@hono/node-server':
|
|
12
12
|
specifier: ^1.19.9
|
|
13
13
|
version: 1.19.9(hono@4.11.9)
|
|
14
|
+
'@hono/zod-validator':
|
|
15
|
+
specifier: ^0.7.6
|
|
16
|
+
version: 0.7.6(hono@4.11.9)(zod@3.25.76)
|
|
14
17
|
'@radix-ui/react-accordion':
|
|
15
18
|
specifier: ^1.2.4
|
|
16
19
|
version: 1.2.12(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
|
@@ -822,6 +825,12 @@ packages:
|
|
|
822
825
|
wrangler:
|
|
823
826
|
optional: true
|
|
824
827
|
|
|
828
|
+
'@hono/zod-validator@0.7.6':
|
|
829
|
+
resolution: {integrity: sha512-Io1B6d011Gj1KknV4rXYz4le5+5EubcWEU/speUjuw9XMMIaP3n78yXLhjd2A3PXaXaUwEAluOiAyLqhBEJgsw==}
|
|
830
|
+
peerDependencies:
|
|
831
|
+
hono: '>=3.9.0'
|
|
832
|
+
zod: ^3.25.0 || ^4.0.0
|
|
833
|
+
|
|
825
834
|
'@humanfs/core@0.19.1':
|
|
826
835
|
resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==}
|
|
827
836
|
engines: {node: '>=18.18.0'}
|
|
@@ -3280,6 +3289,11 @@ snapshots:
|
|
|
3280
3289
|
hono: 4.11.9
|
|
3281
3290
|
minimatch: 9.0.5
|
|
3282
3291
|
|
|
3292
|
+
'@hono/zod-validator@0.7.6(hono@4.11.9)(zod@3.25.76)':
|
|
3293
|
+
dependencies:
|
|
3294
|
+
hono: 4.11.9
|
|
3295
|
+
zod: 3.25.76
|
|
3296
|
+
|
|
3283
3297
|
'@humanfs/core@0.19.1': {}
|
|
3284
3298
|
|
|
3285
3299
|
'@humanfs/node@0.16.7':
|
|
@@ -4,11 +4,8 @@ import animate from "tailwindcss-animate";
|
|
|
4
4
|
const config = {
|
|
5
5
|
darkMode: ["class"],
|
|
6
6
|
content: [
|
|
7
|
-
"./index.html",
|
|
7
|
+
"./client/index.html",
|
|
8
8
|
"./client/src/**/*.{ts,tsx}",
|
|
9
|
-
"./components/**/*.{ts,tsx}",
|
|
10
|
-
"./hooks/**/*.{ts,tsx}",
|
|
11
|
-
"./lib/**/*.{ts,tsx}",
|
|
12
9
|
"./shared/**/*.{ts,tsx}",
|
|
13
10
|
],
|
|
14
11
|
theme: {
|
|
@@ -15,19 +15,13 @@
|
|
|
15
15
|
"incremental": true,
|
|
16
16
|
"types": ["node", "vite/client"],
|
|
17
17
|
"paths": {
|
|
18
|
-
"@/*": ["
|
|
18
|
+
"@/*": ["./client/src/*"],
|
|
19
19
|
"@shared/*": ["./shared/*"]
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"include": [
|
|
23
23
|
"client/src/**/*.ts",
|
|
24
24
|
"client/src/**/*.tsx",
|
|
25
|
-
"components/**/*.ts",
|
|
26
|
-
"components/**/*.tsx",
|
|
27
|
-
"hooks/**/*.ts",
|
|
28
|
-
"hooks/**/*.tsx",
|
|
29
|
-
"lib/**/*.ts",
|
|
30
|
-
"lib/**/*.tsx",
|
|
31
25
|
"shared/**/*.ts",
|
|
32
26
|
"shared/**/*.tsx",
|
|
33
27
|
"server/**/*.ts",
|
|
@@ -84,6 +84,7 @@ export default defineConfig(async ({ command }) => {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
return {
|
|
87
|
+
root: path.resolve(__dirname, "client"),
|
|
87
88
|
server: {
|
|
88
89
|
host: "0.0.0.0",
|
|
89
90
|
port: lockedPort,
|
|
@@ -92,7 +93,7 @@ export default defineConfig(async ({ command }) => {
|
|
|
92
93
|
plugins: [
|
|
93
94
|
react(),
|
|
94
95
|
devServer({
|
|
95
|
-
entry: "server/dev-app.ts",
|
|
96
|
+
entry: path.resolve(__dirname, "server/dev-app.ts"),
|
|
96
97
|
adapter: nodeAdapter,
|
|
97
98
|
exclude: [/^\/(?!api(?:\/|$)).*/, ...defaultOptions.exclude],
|
|
98
99
|
}),
|
|
@@ -113,7 +114,7 @@ export default defineConfig(async ({ command }) => {
|
|
|
113
114
|
],
|
|
114
115
|
resolve: {
|
|
115
116
|
alias: {
|
|
116
|
-
"@": path.resolve(__dirname, "
|
|
117
|
+
"@": path.resolve(__dirname, "client/src"),
|
|
117
118
|
"@shared": path.resolve(__dirname, "shared"),
|
|
118
119
|
},
|
|
119
120
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
## 开发规则
|
|
3
|
-
|
|
4
|
-
- `/.imagicma/port.json` 是初始化生成的锁定端口文件,禁止修改。
|
|
5
|
-
- 禁止修改 `scripts/` 下的受保护启动文件:`imagicma-common.mjs`、`imagicma-guard.mjs`、`imagicma-dev.mjs`、`imagicma-start.mjs`。
|
|
6
|
-
- 禁止修改 `package.json` 中 `scripts.dev` 与 `scripts.start`(以及对应 `predev`、`prestart`)命令。
|
|
7
|
-
- 禁止直接执行 `vite` 或 `node dist/server/index.js` 启动项目;只能通过 `pnpm dev` / `pnpm start` 启动。
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|