@coze-arch/cli 0.0.1-beta.5 → 0.0.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 (324) hide show
  1. package/README.md +1 -0
  2. package/lib/__templates__/expo/.coze +7 -2
  3. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +46 -0
  4. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +229 -0
  5. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +47 -0
  6. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +34 -0
  7. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +46 -0
  8. package/lib/__templates__/expo/README.md +68 -7
  9. package/lib/__templates__/expo/_gitignore +1 -1
  10. package/lib/__templates__/{react-rsbuild → expo}/_npmrc +4 -5
  11. package/lib/__templates__/expo/client/app/+not-found.tsx +15 -64
  12. package/lib/__templates__/expo/client/app/_layout.tsx +15 -12
  13. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  14. package/lib/__templates__/expo/client/app.config.ts +76 -0
  15. package/lib/__templates__/expo/client/components/Screen.tsx +22 -38
  16. package/lib/__templates__/expo/client/components/ThemedText.tsx +33 -0
  17. package/lib/__templates__/expo/client/components/ThemedView.tsx +37 -0
  18. package/lib/__templates__/expo/client/constants/theme.ts +117 -58
  19. package/lib/__templates__/expo/client/contexts/AuthContext.tsx +14 -107
  20. package/lib/__templates__/expo/client/declarations.d.ts +5 -0
  21. package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +40 -10
  22. package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
  23. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  24. package/lib/__templates__/expo/client/hooks/useTheme.ts +26 -6
  25. package/lib/__templates__/expo/client/metro.config.js +124 -0
  26. package/lib/__templates__/expo/client/package.json +95 -0
  27. package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
  28. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  29. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +47 -22
  30. package/lib/__templates__/expo/client/tsconfig.json +24 -0
  31. package/lib/__templates__/expo/client/utils/index.ts +23 -2
  32. package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
  33. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
  34. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
  35. package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
  36. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
  37. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
  38. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
  39. package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
  40. package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
  41. package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
  42. package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
  43. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/index.js +9 -0
  44. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/rule.js +120 -0
  45. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/tech.md +58 -0
  46. package/lib/__templates__/expo/package.json +16 -91
  47. package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
  48. package/lib/__templates__/expo/pnpm-lock.yaml +1805 -3126
  49. package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
  50. package/lib/__templates__/expo/server/build.js +21 -0
  51. package/lib/__templates__/expo/server/package.json +34 -0
  52. package/lib/__templates__/expo/server/src/index.ts +20 -0
  53. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  54. package/lib/__templates__/expo/template.config.js +58 -1
  55. package/lib/__templates__/expo/tsconfig.json +1 -24
  56. package/lib/__templates__/native-static/.coze +11 -0
  57. package/lib/__templates__/native-static/index.html +33 -0
  58. package/lib/__templates__/native-static/styles/main.css +136 -0
  59. package/lib/__templates__/native-static/template.config.js +22 -0
  60. package/lib/__templates__/nextjs/.babelrc +15 -0
  61. package/lib/__templates__/nextjs/.coze +4 -3
  62. package/lib/__templates__/nextjs/README.md +346 -19
  63. package/lib/__templates__/nextjs/_npmrc +2 -1
  64. package/lib/__templates__/nextjs/components.json +21 -0
  65. package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
  66. package/lib/__templates__/nextjs/next.config.ts +11 -0
  67. package/lib/__templates__/nextjs/package.json +63 -2
  68. package/lib/__templates__/nextjs/pnpm-lock.yaml +10053 -1710
  69. package/lib/__templates__/nextjs/scripts/build.sh +4 -1
  70. package/lib/__templates__/nextjs/scripts/dev.sh +15 -27
  71. package/lib/__templates__/{react-rsbuild/scripts/build.sh → nextjs/scripts/prepare.sh} +0 -5
  72. package/lib/__templates__/nextjs/scripts/start.sh +7 -1
  73. package/lib/__templates__/nextjs/src/app/globals.css +124 -13
  74. package/lib/__templates__/nextjs/src/app/layout.tsx +56 -16
  75. package/lib/__templates__/nextjs/src/app/page.tsx +18 -49
  76. package/lib/__templates__/nextjs/src/app/robots.ts +11 -0
  77. package/lib/__templates__/nextjs/src/components/ui/accordion.tsx +66 -0
  78. package/lib/__templates__/nextjs/src/components/ui/alert-dialog.tsx +157 -0
  79. package/lib/__templates__/nextjs/src/components/ui/alert.tsx +66 -0
  80. package/lib/__templates__/nextjs/src/components/ui/aspect-ratio.tsx +11 -0
  81. package/lib/__templates__/nextjs/src/components/ui/avatar.tsx +53 -0
  82. package/lib/__templates__/nextjs/src/components/ui/badge.tsx +46 -0
  83. package/lib/__templates__/nextjs/src/components/ui/breadcrumb.tsx +109 -0
  84. package/lib/__templates__/nextjs/src/components/ui/button-group.tsx +83 -0
  85. package/lib/__templates__/nextjs/src/components/ui/button.tsx +62 -0
  86. package/lib/__templates__/nextjs/src/components/ui/calendar.tsx +220 -0
  87. package/lib/__templates__/nextjs/src/components/ui/card.tsx +92 -0
  88. package/lib/__templates__/nextjs/src/components/ui/carousel.tsx +241 -0
  89. package/lib/__templates__/nextjs/src/components/ui/chart.tsx +357 -0
  90. package/lib/__templates__/nextjs/src/components/ui/checkbox.tsx +32 -0
  91. package/lib/__templates__/nextjs/src/components/ui/collapsible.tsx +33 -0
  92. package/lib/__templates__/nextjs/src/components/ui/command.tsx +184 -0
  93. package/lib/__templates__/nextjs/src/components/ui/context-menu.tsx +252 -0
  94. package/lib/__templates__/nextjs/src/components/ui/dialog.tsx +143 -0
  95. package/lib/__templates__/nextjs/src/components/ui/drawer.tsx +135 -0
  96. package/lib/__templates__/nextjs/src/components/ui/dropdown-menu.tsx +257 -0
  97. package/lib/__templates__/nextjs/src/components/ui/empty.tsx +104 -0
  98. package/lib/__templates__/nextjs/src/components/ui/field.tsx +248 -0
  99. package/lib/__templates__/nextjs/src/components/ui/form.tsx +167 -0
  100. package/lib/__templates__/nextjs/src/components/ui/hover-card.tsx +44 -0
  101. package/lib/__templates__/nextjs/src/components/ui/input-group.tsx +170 -0
  102. package/lib/__templates__/nextjs/src/components/ui/input-otp.tsx +77 -0
  103. package/lib/__templates__/nextjs/src/components/ui/input.tsx +21 -0
  104. package/lib/__templates__/nextjs/src/components/ui/item.tsx +193 -0
  105. package/lib/__templates__/nextjs/src/components/ui/kbd.tsx +28 -0
  106. package/lib/__templates__/nextjs/src/components/ui/label.tsx +24 -0
  107. package/lib/__templates__/nextjs/src/components/ui/menubar.tsx +276 -0
  108. package/lib/__templates__/nextjs/src/components/ui/navigation-menu.tsx +168 -0
  109. package/lib/__templates__/nextjs/src/components/ui/pagination.tsx +127 -0
  110. package/lib/__templates__/nextjs/src/components/ui/popover.tsx +48 -0
  111. package/lib/__templates__/nextjs/src/components/ui/progress.tsx +31 -0
  112. package/lib/__templates__/nextjs/src/components/ui/radio-group.tsx +45 -0
  113. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +63 -0
  114. package/lib/__templates__/nextjs/src/components/ui/scroll-area.tsx +58 -0
  115. package/lib/__templates__/nextjs/src/components/ui/select.tsx +190 -0
  116. package/lib/__templates__/nextjs/src/components/ui/separator.tsx +28 -0
  117. package/lib/__templates__/nextjs/src/components/ui/sheet.tsx +139 -0
  118. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +724 -0
  119. package/lib/__templates__/nextjs/src/components/ui/skeleton.tsx +13 -0
  120. package/lib/__templates__/nextjs/src/components/ui/slider.tsx +63 -0
  121. package/lib/__templates__/nextjs/src/components/ui/sonner.tsx +40 -0
  122. package/lib/__templates__/nextjs/src/components/ui/spinner.tsx +16 -0
  123. package/lib/__templates__/nextjs/src/components/ui/switch.tsx +31 -0
  124. package/lib/__templates__/nextjs/src/components/ui/table.tsx +116 -0
  125. package/lib/__templates__/nextjs/src/components/ui/tabs.tsx +66 -0
  126. package/lib/__templates__/nextjs/src/components/ui/textarea.tsx +18 -0
  127. package/lib/__templates__/nextjs/src/components/ui/toggle-group.tsx +83 -0
  128. package/lib/__templates__/nextjs/src/components/ui/toggle.tsx +47 -0
  129. package/lib/__templates__/nextjs/src/components/ui/tooltip.tsx +61 -0
  130. package/lib/__templates__/nextjs/src/hooks/use-mobile.ts +19 -0
  131. package/lib/__templates__/nextjs/src/lib/utils.ts +6 -0
  132. package/lib/__templates__/nextjs/src/server.ts +35 -0
  133. package/lib/__templates__/nextjs/template.config.js +70 -5
  134. package/lib/__templates__/nextjs/tsconfig.json +1 -1
  135. package/lib/__templates__/nuxt-vue/.coze +12 -0
  136. package/lib/__templates__/nuxt-vue/README.md +73 -0
  137. package/lib/__templates__/nuxt-vue/_gitignore +24 -0
  138. package/lib/__templates__/{rsbuild → nuxt-vue}/_npmrc +2 -1
  139. package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
  140. package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
  141. package/lib/__templates__/{rsbuild/src/index.css → nuxt-vue/assets/css/main.css} +7 -4
  142. package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
  143. package/lib/__templates__/nuxt-vue/package.json +35 -0
  144. package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
  145. package/lib/__templates__/nuxt-vue/postcss.config.mjs +8 -0
  146. package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
  147. package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
  148. package/lib/__templates__/{rsbuild → nuxt-vue}/scripts/build.sh +2 -2
  149. package/lib/__templates__/nuxt-vue/scripts/dev.sh +39 -0
  150. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
  151. package/lib/__templates__/nuxt-vue/scripts/start.sh +21 -0
  152. package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
  153. package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
  154. package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
  155. package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
  156. package/lib/__templates__/nuxt-vue/template.config.js +87 -0
  157. package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
  158. package/lib/__templates__/taro/.coze +14 -0
  159. package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
  160. package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +14 -0
  161. package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +2 -0
  162. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +151 -0
  163. package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
  164. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -0
  165. package/lib/__templates__/taro/README.md +763 -0
  166. package/lib/__templates__/taro/_gitignore +40 -0
  167. package/lib/__templates__/taro/_npmrc +18 -0
  168. package/lib/__templates__/taro/babel.config.js +12 -0
  169. package/lib/__templates__/taro/config/dev.ts +9 -0
  170. package/lib/__templates__/taro/config/index.ts +238 -0
  171. package/lib/__templates__/taro/config/prod.ts +34 -0
  172. package/lib/__templates__/taro/eslint.config.mjs +135 -0
  173. package/lib/__templates__/taro/key/private.appid.key +0 -0
  174. package/lib/__templates__/taro/package.json +112 -0
  175. package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
  176. package/lib/__templates__/taro/pnpm-lock.yaml +23412 -0
  177. package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
  178. package/lib/__templates__/taro/project.config.json +15 -0
  179. package/lib/__templates__/taro/server/nest-cli.json +10 -0
  180. package/lib/__templates__/taro/server/package.json +40 -0
  181. package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
  182. package/lib/__templates__/taro/server/src/app.module.ts +10 -0
  183. package/lib/__templates__/taro/server/src/app.service.ts +8 -0
  184. package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
  185. package/lib/__templates__/taro/server/src/main.ts +49 -0
  186. package/lib/__templates__/taro/server/tsconfig.json +24 -0
  187. package/lib/__templates__/taro/src/app.config.ts +11 -0
  188. package/lib/__templates__/taro/src/app.css +156 -0
  189. package/lib/__templates__/taro/src/app.tsx +9 -0
  190. package/lib/__templates__/taro/src/components/ui/accordion.tsx +159 -0
  191. package/lib/__templates__/taro/src/components/ui/alert-dialog.tsx +260 -0
  192. package/lib/__templates__/taro/src/components/ui/alert.tsx +60 -0
  193. package/lib/__templates__/taro/src/components/ui/aspect-ratio.tsx +36 -0
  194. package/lib/__templates__/taro/src/components/ui/avatar.tsx +84 -0
  195. package/lib/__templates__/taro/src/components/ui/badge.tsx +37 -0
  196. package/lib/__templates__/taro/src/components/ui/breadcrumb.tsx +117 -0
  197. package/lib/__templates__/taro/src/components/ui/button-group.tsx +83 -0
  198. package/lib/__templates__/taro/src/components/ui/button.tsx +67 -0
  199. package/lib/__templates__/taro/src/components/ui/calendar.tsx +394 -0
  200. package/lib/__templates__/taro/src/components/ui/card.tsx +108 -0
  201. package/lib/__templates__/taro/src/components/ui/carousel.tsx +228 -0
  202. package/lib/__templates__/taro/src/components/ui/checkbox.tsx +58 -0
  203. package/lib/__templates__/taro/src/components/ui/code-block.tsx +169 -0
  204. package/lib/__templates__/taro/src/components/ui/collapsible.tsx +71 -0
  205. package/lib/__templates__/taro/src/components/ui/command.tsx +385 -0
  206. package/lib/__templates__/taro/src/components/ui/context-menu.tsx +614 -0
  207. package/lib/__templates__/taro/src/components/ui/dialog.tsx +256 -0
  208. package/lib/__templates__/taro/src/components/ui/drawer.tsx +192 -0
  209. package/lib/__templates__/taro/src/components/ui/dropdown-menu.tsx +561 -0
  210. package/lib/__templates__/taro/src/components/ui/field.tsx +228 -0
  211. package/lib/__templates__/taro/src/components/ui/hover-card.tsx +282 -0
  212. package/lib/__templates__/taro/src/components/ui/input-group.tsx +197 -0
  213. package/lib/__templates__/taro/src/components/ui/input-otp.tsx +136 -0
  214. package/lib/__templates__/taro/src/components/ui/input.tsx +56 -0
  215. package/lib/__templates__/taro/src/components/ui/label.tsx +24 -0
  216. package/lib/__templates__/taro/src/components/ui/menubar.tsx +595 -0
  217. package/lib/__templates__/taro/src/components/ui/navigation-menu.tsx +264 -0
  218. package/lib/__templates__/taro/src/components/ui/pagination.tsx +118 -0
  219. package/lib/__templates__/taro/src/components/ui/popover.tsx +291 -0
  220. package/lib/__templates__/taro/src/components/ui/portal.tsx +19 -0
  221. package/lib/__templates__/taro/src/components/ui/progress.tsx +28 -0
  222. package/lib/__templates__/taro/src/components/ui/radio-group.tsx +64 -0
  223. package/lib/__templates__/taro/src/components/ui/resizable.tsx +346 -0
  224. package/lib/__templates__/taro/src/components/ui/scroll-area.tsx +34 -0
  225. package/lib/__templates__/taro/src/components/ui/select.tsx +438 -0
  226. package/lib/__templates__/taro/src/components/ui/separator.tsx +30 -0
  227. package/lib/__templates__/taro/src/components/ui/sheet.tsx +262 -0
  228. package/lib/__templates__/taro/src/components/ui/skeleton.tsx +17 -0
  229. package/lib/__templates__/taro/src/components/ui/slider.tsx +203 -0
  230. package/lib/__templates__/taro/src/components/ui/sonner.tsx +1 -0
  231. package/lib/__templates__/taro/src/components/ui/switch.tsx +55 -0
  232. package/lib/__templates__/taro/src/components/ui/table.tsx +142 -0
  233. package/lib/__templates__/taro/src/components/ui/tabs.tsx +114 -0
  234. package/lib/__templates__/taro/src/components/ui/textarea.tsx +54 -0
  235. package/lib/__templates__/taro/src/components/ui/toast.tsx +517 -0
  236. package/lib/__templates__/taro/src/components/ui/toggle-group.tsx +120 -0
  237. package/lib/__templates__/taro/src/components/ui/toggle.tsx +77 -0
  238. package/lib/__templates__/taro/src/components/ui/tooltip.tsx +455 -0
  239. package/lib/__templates__/taro/src/index.html +39 -0
  240. package/lib/__templates__/taro/src/lib/hooks/use-keyboard-offset.ts +37 -0
  241. package/lib/__templates__/taro/src/lib/measure.ts +115 -0
  242. package/lib/__templates__/taro/src/lib/platform.ts +12 -0
  243. package/lib/__templates__/taro/src/lib/utils.ts +6 -0
  244. package/lib/__templates__/taro/src/network.ts +39 -0
  245. package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
  246. package/lib/__templates__/taro/src/pages/index/index.css +1 -0
  247. package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
  248. package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
  249. package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
  250. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +238 -0
  251. package/lib/__templates__/taro/src/presets/h5-styles.ts +220 -0
  252. package/lib/__templates__/taro/src/presets/index.tsx +18 -0
  253. package/lib/__templates__/taro/stylelint.config.mjs +4 -0
  254. package/lib/__templates__/taro/template.config.js +68 -0
  255. package/lib/__templates__/taro/tsconfig.json +29 -0
  256. package/lib/__templates__/taro/types/global.d.ts +32 -0
  257. package/lib/__templates__/templates.json +126 -64
  258. package/lib/__templates__/vite/.coze +4 -3
  259. package/lib/__templates__/vite/README.md +383 -26
  260. package/lib/__templates__/vite/_gitignore +1 -0
  261. package/lib/__templates__/vite/_npmrc +2 -1
  262. package/lib/__templates__/vite/eslint.config.mjs +14 -0
  263. package/lib/__templates__/vite/package.json +23 -3
  264. package/lib/__templates__/vite/pnpm-lock.yaml +2509 -293
  265. package/lib/__templates__/vite/scripts/build.sh +4 -1
  266. package/lib/__templates__/vite/scripts/dev.sh +16 -28
  267. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  268. package/lib/__templates__/vite/scripts/start.sh +9 -3
  269. package/lib/__templates__/vite/server/routes/index.ts +31 -0
  270. package/lib/__templates__/vite/server/server.ts +65 -0
  271. package/lib/__templates__/vite/server/vite.ts +67 -0
  272. package/lib/__templates__/vite/src/main.ts +17 -48
  273. package/lib/__templates__/vite/template.config.js +82 -10
  274. package/lib/__templates__/vite/tsconfig.json +4 -3
  275. package/lib/__templates__/vite/vite.config.ts +8 -3
  276. package/lib/cli.js +1544 -488
  277. package/package.json +18 -7
  278. package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +0 -109
  279. package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +0 -257
  280. package/lib/__templates__/expo/app.json +0 -63
  281. package/lib/__templates__/expo/babel.config.js +0 -9
  282. package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
  283. package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
  284. package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
  285. package/lib/__templates__/expo/client/hooks/useColorScheme.ts +0 -1
  286. package/lib/__templates__/expo/client/index.js +0 -11
  287. package/lib/__templates__/expo/client/screens/home/index.tsx +0 -54
  288. package/lib/__templates__/expo/client/screens/home/styles.ts +0 -332
  289. package/lib/__templates__/expo/metro.config.js +0 -53
  290. package/lib/__templates__/expo/src/index.ts +0 -12
  291. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  292. package/lib/__templates__/react-rsbuild/.coze +0 -11
  293. package/lib/__templates__/react-rsbuild/.vscode/settings.json +0 -121
  294. package/lib/__templates__/react-rsbuild/README.md +0 -61
  295. package/lib/__templates__/react-rsbuild/_gitignore +0 -97
  296. package/lib/__templates__/react-rsbuild/package.json +0 -31
  297. package/lib/__templates__/react-rsbuild/pnpm-lock.yaml +0 -997
  298. package/lib/__templates__/react-rsbuild/rsbuild.config.ts +0 -13
  299. package/lib/__templates__/react-rsbuild/scripts/dev.sh +0 -51
  300. package/lib/__templates__/react-rsbuild/scripts/start.sh +0 -15
  301. package/lib/__templates__/react-rsbuild/src/App.tsx +0 -60
  302. package/lib/__templates__/react-rsbuild/src/index.css +0 -21
  303. package/lib/__templates__/react-rsbuild/src/index.html +0 -12
  304. package/lib/__templates__/react-rsbuild/src/index.tsx +0 -16
  305. package/lib/__templates__/react-rsbuild/tailwind.config.js +0 -9
  306. package/lib/__templates__/react-rsbuild/template.config.js +0 -54
  307. package/lib/__templates__/react-rsbuild/tsconfig.json +0 -17
  308. package/lib/__templates__/rsbuild/.coze +0 -11
  309. package/lib/__templates__/rsbuild/.vscode/settings.json +0 -7
  310. package/lib/__templates__/rsbuild/README.md +0 -61
  311. package/lib/__templates__/rsbuild/_gitignore +0 -97
  312. package/lib/__templates__/rsbuild/package.json +0 -24
  313. package/lib/__templates__/rsbuild/pnpm-lock.yaml +0 -888
  314. package/lib/__templates__/rsbuild/rsbuild.config.ts +0 -12
  315. package/lib/__templates__/rsbuild/scripts/dev.sh +0 -51
  316. package/lib/__templates__/rsbuild/scripts/start.sh +0 -15
  317. package/lib/__templates__/rsbuild/src/index.html +0 -12
  318. package/lib/__templates__/rsbuild/src/index.ts +0 -5
  319. package/lib/__templates__/rsbuild/src/main.ts +0 -65
  320. package/lib/__templates__/rsbuild/tailwind.config.js +0 -9
  321. package/lib/__templates__/rsbuild/template.config.js +0 -54
  322. package/lib/__templates__/rsbuild/tsconfig.json +0 -16
  323. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  324. /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
@@ -1,36 +1,363 @@
1
1
  # <%= appName %>
2
2
 
3
- This is a [Next.js](https://nextjs.org) project created with coze-coding CLI.
3
+ 这是一个基于 [Next.js 16](https://nextjs.org) + [shadcn/ui](https://ui.shadcn.com) 的全栈应用项目,由扣子编程 CLI 创建。
4
4
 
5
- ## Getting Started
5
+ ## 快速开始
6
6
 
7
- First, run the development server:
7
+ ### 启动开发服务器
8
8
 
9
9
  ```bash
10
- npm run dev
11
- # or
12
- pnpm dev
13
- # or
14
- yarn dev
10
+ coze dev
15
11
  ```
16
12
 
17
- Open [http://localhost:<%= port %>](http://localhost:<%= port %>) with your browser to see the result.
13
+ 启动后,在浏览器中打开 [http://localhost:<%= port %>](http://localhost:<%= port %>) 查看应用。
18
14
 
19
- You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
15
+ 开发服务器支持热更新,修改代码后页面会自动刷新。
20
16
 
21
- This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
17
+ ### 构建生产版本
22
18
 
23
- ## Learn More
19
+ ```bash
20
+ coze build
21
+ ```
22
+
23
+ ### 启动生产服务器
24
+
25
+ ```bash
26
+ coze start
27
+ ```
28
+
29
+ ## 项目结构
30
+
31
+ ```
32
+ src/
33
+ ├── app/ # Next.js App Router 目录
34
+ │ ├── layout.tsx # 根布局组件
35
+ │ ├── page.tsx # 首页
36
+ │ ├── globals.css # 全局样式(包含 shadcn 主题变量)
37
+ │ └── [route]/ # 其他路由页面
38
+ ├── components/ # React 组件目录
39
+ │ └── ui/ # shadcn/ui 基础组件(优先使用)
40
+ │ ├── button.tsx
41
+ │ ├── card.tsx
42
+ │ └── ...
43
+ ├── lib/ # 工具函数库
44
+ │ └── utils.ts # cn() 等工具函数
45
+ └── hooks/ # 自定义 React Hooks(可选)
46
+
47
+ server/
48
+ ├── index.ts # 自定义服务器入口
49
+ ├── tsconfig.json # Server TypeScript 配置
50
+ └── dist/ # 编译输出目录(自动生成)
51
+ ```
52
+
53
+ ## 核心开发规范
54
+
55
+ ### 1. 组件开发
56
+
57
+ **优先使用 shadcn/ui 基础组件**
58
+
59
+ 本项目已预装完整的 shadcn/ui 组件库,位于 `src/components/ui/` 目录。开发时应优先使用这些组件作为基础:
60
+
61
+ ```tsx
62
+ // ✅ 推荐:使用 shadcn 基础组件
63
+ import { Button } from '@/components/ui/button';
64
+ import { Card, CardContent, CardHeader } from '@/components/ui/card';
65
+ import { Input } from '@/components/ui/input';
66
+
67
+ export default function MyComponent() {
68
+ return (
69
+ <Card>
70
+ <CardHeader>标题</CardHeader>
71
+ <CardContent>
72
+ <Input placeholder="输入内容" />
73
+ <Button>提交</Button>
74
+ </CardContent>
75
+ </Card>
76
+ );
77
+ }
78
+ ```
79
+
80
+ **可用的 shadcn 组件清单**
81
+
82
+ - 表单:`button`, `input`, `textarea`, `select`, `checkbox`, `radio-group`, `switch`, `slider`
83
+ - 布局:`card`, `separator`, `tabs`, `accordion`, `collapsible`, `scroll-area`
84
+ - 反馈:`alert`, `alert-dialog`, `dialog`, `toast`, `sonner`, `progress`
85
+ - 导航:`dropdown-menu`, `menubar`, `navigation-menu`, `context-menu`
86
+ - 数据展示:`table`, `avatar`, `badge`, `hover-card`, `tooltip`, `popover`
87
+ - 其他:`calendar`, `command`, `carousel`, `resizable`, `sidebar`
88
+
89
+ 详见 `src/components/ui/` 目录下的具体组件实现。
90
+
91
+ ### 2. 路由开发
92
+
93
+ Next.js 使用文件系统路由,在 `src/app/` 目录下创建文件夹即可添加路由:
94
+
95
+ ```bash
96
+ # 创建新路由 /about
97
+ src/app/about/page.tsx
98
+
99
+ # 创建动态路由 /posts/[id]
100
+ src/app/posts/[id]/page.tsx
101
+
102
+ # 创建路由组(不影响 URL)
103
+ src/app/(marketing)/about/page.tsx
104
+
105
+ # 创建 API 路由
106
+ src/app/api/users/route.ts
107
+ ```
108
+
109
+ **页面组件示例**
110
+
111
+ ```tsx
112
+ // src/app/about/page.tsx
113
+ import { Button } from '@/components/ui/button';
114
+
115
+ export const metadata = {
116
+ title: '关于我们',
117
+ description: '关于页面描述',
118
+ };
119
+
120
+ export default function AboutPage() {
121
+ return (
122
+ <div>
123
+ <h1>关于我们</h1>
124
+ <Button>了解更多</Button>
125
+ </div>
126
+ );
127
+ }
128
+ ```
129
+
130
+ **动态路由示例**
131
+
132
+ ```tsx
133
+ // src/app/posts/[id]/page.tsx
134
+ export default async function PostPage({
135
+ params,
136
+ }: {
137
+ params: Promise<{ id: string }>;
138
+ }) {
139
+ const { id } = await params;
140
+
141
+ return <div>文章 ID: {id}</div>;
142
+ }
143
+ ```
144
+
145
+ **API 路由示例**
146
+
147
+ ```tsx
148
+ // src/app/api/users/route.ts
149
+ import { NextResponse } from 'next/server';
150
+
151
+ export async function GET() {
152
+ return NextResponse.json({ users: [] });
153
+ }
154
+
155
+ export async function POST(request: Request) {
156
+ const body = await request.json();
157
+ return NextResponse.json({ success: true });
158
+ }
159
+ ```
160
+
161
+ ### 3. 依赖管理
162
+
163
+ **必须使用 pnpm 管理依赖**
164
+
165
+ ```bash
166
+ # ✅ 安装依赖
167
+ pnpm install
168
+
169
+ # ✅ 添加新依赖
170
+ pnpm add package-name
171
+
172
+ # ✅ 添加开发依赖
173
+ pnpm add -D package-name
174
+
175
+ # ❌ 禁止使用 npm 或 yarn
176
+ # npm install # 错误!
177
+ # yarn add # 错误!
178
+ ```
179
+
180
+ 项目已配置 `preinstall` 脚本,使用其他包管理器会报错。
181
+
182
+ ### 4. 样式开发
183
+
184
+ **使用 Tailwind CSS v4**
185
+
186
+ 本项目使用 Tailwind CSS v4 进行样式开发,并已配置 shadcn 主题变量。
187
+
188
+ ```tsx
189
+ // 使用 Tailwind 类名
190
+ <div className="flex items-center gap-4 p-4 rounded-lg bg-background">
191
+ <Button className="bg-primary text-primary-foreground">
192
+ 主要按钮
193
+ </Button>
194
+ </div>
195
+
196
+ // 使用 cn() 工具函数合并类名
197
+ import { cn } from '@/lib/utils';
198
+
199
+ <div className={cn(
200
+ "base-class",
201
+ condition && "conditional-class",
202
+ className
203
+ )}>
204
+ 内容
205
+ </div>
206
+ ```
207
+
208
+ **主题变量**
209
+
210
+ 主题变量定义在 `src/app/globals.css` 中,支持亮色/暗色模式:
211
+
212
+ - `--background`, `--foreground`
213
+ - `--primary`, `--primary-foreground`
214
+ - `--secondary`, `--secondary-foreground`
215
+ - `--muted`, `--muted-foreground`
216
+ - `--accent`, `--accent-foreground`
217
+ - `--destructive`, `--destructive-foreground`
218
+ - `--border`, `--input`, `--ring`
219
+
220
+ ### 5. 表单开发
221
+
222
+ 推荐使用 `react-hook-form` + `zod` 进行表单开发:
223
+
224
+ ```tsx
225
+ import { useForm } from 'react-hook-form';
226
+ import { zodResolver } from '@hookform/resolvers/zod';
227
+ import * as z from 'zod';
228
+ import { Button } from '@/components/ui/button';
229
+ import { Input } from '@/components/ui/input';
230
+
231
+ const formSchema = z.object({
232
+ username: z.string().min(2, '用户名至少 2 个字符'),
233
+ email: z.string().email('请输入有效的邮箱'),
234
+ });
235
+
236
+ export default function MyForm() {
237
+ const form = useForm({
238
+ resolver: zodResolver(formSchema),
239
+ defaultValues: { username: '', email: '' },
240
+ });
241
+
242
+ const onSubmit = (data: z.infer<typeof formSchema>) => {
243
+ console.log(data);
244
+ };
245
+
246
+ return (
247
+ <form onSubmit={form.handleSubmit(onSubmit)}>
248
+ <Input {...form.register('username')} />
249
+ <Input {...form.register('email')} />
250
+ <Button type="submit">提交</Button>
251
+ </form>
252
+ );
253
+ }
254
+ ```
255
+
256
+ ### 6. 数据获取
257
+
258
+ **服务端组件(推荐)**
259
+
260
+ ```tsx
261
+ // src/app/posts/page.tsx
262
+ async function getPosts() {
263
+ const res = await fetch('https://api.example.com/posts', {
264
+ cache: 'no-store', // 或 'force-cache'
265
+ });
266
+ return res.json();
267
+ }
268
+
269
+ export default async function PostsPage() {
270
+ const posts = await getPosts();
271
+
272
+ return (
273
+ <div>
274
+ {posts.map(post => (
275
+ <div key={post.id}>{post.title}</div>
276
+ ))}
277
+ </div>
278
+ );
279
+ }
280
+ ```
281
+
282
+ **客户端组件**
283
+
284
+ ```tsx
285
+ 'use client';
286
+
287
+ import { useEffect, useState } from 'react';
288
+
289
+ export default function ClientComponent() {
290
+ const [data, setData] = useState(null);
291
+
292
+ useEffect(() => {
293
+ fetch('/api/data')
294
+ .then(res => res.json())
295
+ .then(setData);
296
+ }, []);
297
+
298
+ return <div>{JSON.stringify(data)}</div>;
299
+ }
300
+ ```
301
+
302
+ ## 常见开发场景
303
+
304
+ ### 添加新页面
305
+
306
+ 1. 在 `src/app/` 下创建文件夹和 `page.tsx`
307
+ 2. 使用 shadcn 组件构建 UI
308
+ 3. 根据需要添加 `layout.tsx` 和 `loading.tsx`
309
+
310
+ ### 创建业务组件
311
+
312
+ 1. 在 `src/components/` 下创建组件文件(非 UI 组件)
313
+ 2. 优先组合使用 `src/components/ui/` 中的基础组件
314
+ 3. 使用 TypeScript 定义 Props 类型
315
+
316
+ ### 添加全局状态
317
+
318
+ 推荐使用 React Context 或 Zustand:
319
+
320
+ ```tsx
321
+ // src/lib/store.ts
322
+ import { create } from 'zustand';
323
+
324
+ interface Store {
325
+ count: number;
326
+ increment: () => void;
327
+ }
328
+
329
+ export const useStore = create<Store>((set) => ({
330
+ count: 0,
331
+ increment: () => set((state) => ({ count: state.count + 1 })),
332
+ }));
333
+ ```
334
+
335
+ ### 集成数据库
336
+
337
+ 推荐使用 Prisma 或 Drizzle ORM,在 `src/lib/db.ts` 中配置。
24
338
 
25
- To learn more about Next.js, take a look at the following resources:
339
+ ## 技术栈
26
340
 
27
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
341
+ - **框架**: Next.js 16.1.1 (App Router)
342
+ - **UI 组件**: shadcn/ui (基于 Radix UI)
343
+ - **样式**: Tailwind CSS v4
344
+ - **表单**: React Hook Form + Zod
345
+ - **图标**: Lucide React
346
+ - **字体**: Geist Sans & Geist Mono
347
+ - **包管理器**: pnpm 9+
348
+ - **TypeScript**: 5.x
29
349
 
30
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
350
+ ## 参考文档
31
351
 
32
- ## Deploy on Vercel
352
+ - [Next.js 官方文档](https://nextjs.org/docs)
353
+ - [shadcn/ui 组件文档](https://ui.shadcn.com)
354
+ - [Tailwind CSS 文档](https://tailwindcss.com/docs)
355
+ - [React Hook Form](https://react-hook-form.com)
33
356
 
34
- The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
357
+ ## 重要提示
35
358
 
36
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
359
+ 1. **必须使用 pnpm** 作为包管理器
360
+ 2. **优先使用 shadcn/ui 组件** 而不是从零开发基础组件
361
+ 3. **遵循 Next.js App Router 规范**,正确区分服务端/客户端组件
362
+ 4. **使用 TypeScript** 进行类型安全开发
363
+ 5. **使用 `@/` 路径别名** 导入模块(已配置)
@@ -1,4 +1,5 @@
1
- registry=https://registry.npmjs.org
1
+ loglevel=error
2
+ registry=https://registry.npmmirror.com
2
3
 
3
4
  strictStorePkgContentCheck=false
4
5
  verifyStoreIntegrity=false
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "src/app/globals.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "aliases": {
14
+ "components": "@/components",
15
+ "utils": "@/lib/utils",
16
+ "ui": "@/components/ui",
17
+ "lib": "@/lib",
18
+ "hooks": "@/hooks"
19
+ },
20
+ "iconLibrary": "lucide"
21
+ }
@@ -12,6 +12,11 @@ const eslintConfig = defineConfig([
12
12
  'out/**',
13
13
  'build/**',
14
14
  'next-env.d.ts',
15
+ // Build artifacts:
16
+ 'server.js',
17
+ 'dist/**',
18
+ // Script files (CommonJS):
19
+ 'scripts/**/*.js',
15
20
  ]),
16
21
  ]);
17
22
 
@@ -1,7 +1,18 @@
1
1
  import type { NextConfig } from 'next';
2
2
 
3
3
  const nextConfig: NextConfig = {
4
+ // outputFileTracingRoot: path.resolve(__dirname, '../../'), // Uncomment and add 'import path from "path"' if needed
4
5
  /* config options here */
6
+ allowedDevOrigins: ['*.dev.coze.site'],
7
+ images: {
8
+ remotePatterns: [
9
+ {
10
+ protocol: 'https',
11
+ hostname: 'lf-coze-web-cdn.coze.cn',
12
+ pathname: '/**',
13
+ },
14
+ ],
15
+ },
5
16
  };
6
17
 
7
18
  export default nextConfig;
@@ -7,22 +7,83 @@
7
7
  "dev": "bash ./scripts/dev.sh",
8
8
  "preinstall": "npx only-allow pnpm",
9
9
  "lint": "eslint",
10
- "start": "bash ./scripts/start.sh"
10
+ "start": "bash ./scripts/start.sh",
11
+ "ts-check": "tsc -p tsconfig.json"
11
12
  },
12
13
  "dependencies": {
14
+ "@aws-sdk/client-s3": "^3.958.0",
15
+ "@aws-sdk/lib-storage": "^3.958.0",
16
+ "@hookform/resolvers": "^5.2.2",
17
+ "@radix-ui/react-accordion": "^1.2.12",
18
+ "@radix-ui/react-alert-dialog": "^1.1.15",
19
+ "@radix-ui/react-aspect-ratio": "^1.1.8",
20
+ "@radix-ui/react-avatar": "^1.1.11",
21
+ "@radix-ui/react-checkbox": "^1.3.3",
22
+ "@radix-ui/react-collapsible": "^1.1.12",
23
+ "@radix-ui/react-context-menu": "^2.2.16",
24
+ "@radix-ui/react-dialog": "^1.1.15",
25
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
26
+ "@radix-ui/react-hover-card": "^1.1.15",
27
+ "@radix-ui/react-label": "^2.1.8",
28
+ "@radix-ui/react-menubar": "^1.1.16",
29
+ "@radix-ui/react-navigation-menu": "^1.2.14",
30
+ "@radix-ui/react-popover": "^1.1.15",
31
+ "@radix-ui/react-progress": "^1.1.8",
32
+ "@radix-ui/react-radio-group": "^1.3.8",
33
+ "@radix-ui/react-scroll-area": "^1.2.10",
34
+ "@radix-ui/react-select": "^2.2.6",
35
+ "@radix-ui/react-separator": "^1.1.8",
36
+ "@radix-ui/react-slider": "^1.3.6",
37
+ "@radix-ui/react-slot": "^1.2.4",
38
+ "@radix-ui/react-switch": "^1.2.6",
39
+ "@radix-ui/react-tabs": "^1.1.13",
40
+ "@radix-ui/react-toggle": "^1.1.10",
41
+ "@radix-ui/react-toggle-group": "^1.1.11",
42
+ "@radix-ui/react-tooltip": "^1.2.8",
43
+ "@supabase/supabase-js": "2.95.3",
44
+ "class-variance-authority": "^0.7.1",
45
+ "clsx": "^2.1.1",
46
+ "cmdk": "^1.1.1",
47
+ "coze-coding-dev-sdk": "^0.7.16",
48
+ "date-fns": "^4.1.0",
49
+ "dotenv": "^17.2.3",
50
+ "drizzle-kit": "^0.31.8",
51
+ "drizzle-orm": "^0.45.1",
52
+ "drizzle-zod": "^0.8.3",
53
+ "embla-carousel-react": "^8.6.0",
54
+ "input-otp": "^1.4.2",
55
+ "lucide-react": "^0.468.0",
13
56
  "next": "16.1.1",
57
+ "next-themes": "^0.4.6",
58
+ "pg": "^8.16.3",
14
59
  "react": "19.2.3",
15
- "react-dom": "19.2.3"
60
+ "react-day-picker": "^9.13.0",
61
+ "react-dom": "19.2.3",
62
+ "react-hook-form": "^7.70.0",
63
+ "react-resizable-panels": "^4.2.0",
64
+ "recharts": "2.15.4",
65
+ "sonner": "^2.0.7",
66
+ "tailwind-merge": "^2.6.0",
67
+ "tw-animate-css": "^1.4.0",
68
+ "vaul": "^1.1.2",
69
+ "zod": "^4.3.5"
16
70
  },
17
71
  "devDependencies": {
72
+ "@react-dev-inspector/babel-plugin": "^2.0.1",
73
+ "@react-dev-inspector/middleware": "^2.0.1",
18
74
  "@tailwindcss/postcss": "^4",
19
75
  "@types/node": "^20",
76
+ "@types/pg": "^8.16.0",
20
77
  "@types/react": "^19",
21
78
  "@types/react-dom": "^19",
22
79
  "eslint": "^9",
23
80
  "eslint-config-next": "16.1.1",
24
81
  "only-allow": "^1.2.2",
82
+ "react-dev-inspector": "^2.0.1",
83
+ "shadcn": "latest",
25
84
  "tailwindcss": "^4",
85
+ "tsup": "^8.3.5",
86
+ "tsx": "^4.19.2",
26
87
  "typescript": "^5"
27
88
  },
28
89
  "packageManager": "pnpm@9.0.0",