@coze-arch/cli 0.0.1-alpha.01c0ee

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 (304) hide show
  1. package/README.md +143 -0
  2. package/bin/main +2 -0
  3. package/lib/__templates__/expo/.coze +12 -0
  4. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +46 -0
  5. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +229 -0
  6. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +47 -0
  7. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +34 -0
  8. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +46 -0
  9. package/lib/__templates__/expo/README.md +74 -0
  10. package/lib/__templates__/expo/_gitignore +11 -0
  11. package/lib/__templates__/expo/_npmrc +20 -0
  12. package/lib/__templates__/expo/client/app/+not-found.tsx +30 -0
  13. package/lib/__templates__/expo/client/app/_layout.tsx +36 -0
  14. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  15. package/lib/__templates__/expo/client/app.config.ts +76 -0
  16. package/lib/__templates__/expo/client/assets/fonts/SpaceMono-Regular.ttf +0 -0
  17. package/lib/__templates__/expo/client/assets/images/adaptive-icon.png +0 -0
  18. package/lib/__templates__/expo/client/assets/images/default-avatar.png +0 -0
  19. package/lib/__templates__/expo/client/assets/images/favicon.png +0 -0
  20. package/lib/__templates__/expo/client/assets/images/icon.png +0 -0
  21. package/lib/__templates__/expo/client/assets/images/partial-react-logo.png +0 -0
  22. package/lib/__templates__/expo/client/assets/images/react-logo.png +0 -0
  23. package/lib/__templates__/expo/client/assets/images/react-logo@2x.png +0 -0
  24. package/lib/__templates__/expo/client/assets/images/react-logo@3x.png +0 -0
  25. package/lib/__templates__/expo/client/assets/images/splash-icon.png +0 -0
  26. package/lib/__templates__/expo/client/components/Screen.tsx +314 -0
  27. package/lib/__templates__/expo/client/components/SmartDateInput.tsx +238 -0
  28. package/lib/__templates__/expo/client/components/ThemedText.tsx +33 -0
  29. package/lib/__templates__/expo/client/components/ThemedView.tsx +37 -0
  30. package/lib/__templates__/expo/client/constants/theme.ts +177 -0
  31. package/lib/__templates__/expo/client/contexts/AuthContext.tsx +49 -0
  32. package/lib/__templates__/expo/client/declarations.d.ts +5 -0
  33. package/lib/__templates__/expo/client/eslint-formatter-simple.mjs +49 -0
  34. package/lib/__templates__/expo/client/eslint.config.mjs +128 -0
  35. package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
  36. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  37. package/lib/__templates__/expo/client/hooks/useTheme.ts +33 -0
  38. package/lib/__templates__/expo/client/metro.config.js +124 -0
  39. package/lib/__templates__/expo/client/package.json +95 -0
  40. package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
  41. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  42. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +105 -0
  43. package/lib/__templates__/expo/client/tsconfig.json +24 -0
  44. package/lib/__templates__/expo/client/utils/index.ts +76 -0
  45. package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
  46. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
  47. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
  48. package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
  49. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
  50. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
  51. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
  52. package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
  53. package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
  54. package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
  55. package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
  56. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/index.js +9 -0
  57. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/rule.js +120 -0
  58. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/tech.md +58 -0
  59. package/lib/__templates__/expo/package.json +25 -0
  60. package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
  61. package/lib/__templates__/expo/pnpm-lock.yaml +12657 -0
  62. package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
  63. package/lib/__templates__/expo/server/build.js +21 -0
  64. package/lib/__templates__/expo/server/package.json +34 -0
  65. package/lib/__templates__/expo/server/src/index.ts +20 -0
  66. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  67. package/lib/__templates__/expo/template.config.js +106 -0
  68. package/lib/__templates__/expo/tsconfig.json +1 -0
  69. package/lib/__templates__/native-static/.coze +11 -0
  70. package/lib/__templates__/native-static/index.html +33 -0
  71. package/lib/__templates__/native-static/styles/main.css +136 -0
  72. package/lib/__templates__/native-static/template.config.js +22 -0
  73. package/lib/__templates__/nextjs/.babelrc +15 -0
  74. package/lib/__templates__/nextjs/.coze +12 -0
  75. package/lib/__templates__/nextjs/README.md +363 -0
  76. package/lib/__templates__/nextjs/_gitignore +99 -0
  77. package/lib/__templates__/nextjs/_npmrc +23 -0
  78. package/lib/__templates__/nextjs/components.json +21 -0
  79. package/lib/__templates__/nextjs/eslint.config.mjs +23 -0
  80. package/lib/__templates__/nextjs/next-env.d.ts +6 -0
  81. package/lib/__templates__/nextjs/next.config.ts +18 -0
  82. package/lib/__templates__/nextjs/package.json +93 -0
  83. package/lib/__templates__/nextjs/pnpm-lock.yaml +12404 -0
  84. package/lib/__templates__/nextjs/postcss.config.mjs +7 -0
  85. package/lib/__templates__/nextjs/public/file.svg +1 -0
  86. package/lib/__templates__/nextjs/public/globe.svg +1 -0
  87. package/lib/__templates__/nextjs/public/next.svg +1 -0
  88. package/lib/__templates__/nextjs/public/vercel.svg +1 -0
  89. package/lib/__templates__/nextjs/public/window.svg +1 -0
  90. package/lib/__templates__/nextjs/scripts/build.sh +17 -0
  91. package/lib/__templates__/nextjs/scripts/dev.sh +39 -0
  92. package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
  93. package/lib/__templates__/nextjs/scripts/start.sh +21 -0
  94. package/lib/__templates__/nextjs/src/app/favicon.ico +0 -0
  95. package/lib/__templates__/nextjs/src/app/globals.css +137 -0
  96. package/lib/__templates__/nextjs/src/app/layout.tsx +74 -0
  97. package/lib/__templates__/nextjs/src/app/page.tsx +35 -0
  98. package/lib/__templates__/nextjs/src/app/robots.ts +11 -0
  99. package/lib/__templates__/nextjs/src/components/ui/accordion.tsx +66 -0
  100. package/lib/__templates__/nextjs/src/components/ui/alert-dialog.tsx +157 -0
  101. package/lib/__templates__/nextjs/src/components/ui/alert.tsx +66 -0
  102. package/lib/__templates__/nextjs/src/components/ui/aspect-ratio.tsx +11 -0
  103. package/lib/__templates__/nextjs/src/components/ui/avatar.tsx +53 -0
  104. package/lib/__templates__/nextjs/src/components/ui/badge.tsx +46 -0
  105. package/lib/__templates__/nextjs/src/components/ui/breadcrumb.tsx +109 -0
  106. package/lib/__templates__/nextjs/src/components/ui/button-group.tsx +83 -0
  107. package/lib/__templates__/nextjs/src/components/ui/button.tsx +62 -0
  108. package/lib/__templates__/nextjs/src/components/ui/calendar.tsx +220 -0
  109. package/lib/__templates__/nextjs/src/components/ui/card.tsx +92 -0
  110. package/lib/__templates__/nextjs/src/components/ui/carousel.tsx +241 -0
  111. package/lib/__templates__/nextjs/src/components/ui/chart.tsx +357 -0
  112. package/lib/__templates__/nextjs/src/components/ui/checkbox.tsx +32 -0
  113. package/lib/__templates__/nextjs/src/components/ui/collapsible.tsx +33 -0
  114. package/lib/__templates__/nextjs/src/components/ui/command.tsx +184 -0
  115. package/lib/__templates__/nextjs/src/components/ui/context-menu.tsx +252 -0
  116. package/lib/__templates__/nextjs/src/components/ui/dialog.tsx +143 -0
  117. package/lib/__templates__/nextjs/src/components/ui/drawer.tsx +135 -0
  118. package/lib/__templates__/nextjs/src/components/ui/dropdown-menu.tsx +257 -0
  119. package/lib/__templates__/nextjs/src/components/ui/empty.tsx +104 -0
  120. package/lib/__templates__/nextjs/src/components/ui/field.tsx +248 -0
  121. package/lib/__templates__/nextjs/src/components/ui/form.tsx +167 -0
  122. package/lib/__templates__/nextjs/src/components/ui/hover-card.tsx +44 -0
  123. package/lib/__templates__/nextjs/src/components/ui/input-group.tsx +170 -0
  124. package/lib/__templates__/nextjs/src/components/ui/input-otp.tsx +77 -0
  125. package/lib/__templates__/nextjs/src/components/ui/input.tsx +21 -0
  126. package/lib/__templates__/nextjs/src/components/ui/item.tsx +193 -0
  127. package/lib/__templates__/nextjs/src/components/ui/kbd.tsx +28 -0
  128. package/lib/__templates__/nextjs/src/components/ui/label.tsx +24 -0
  129. package/lib/__templates__/nextjs/src/components/ui/menubar.tsx +276 -0
  130. package/lib/__templates__/nextjs/src/components/ui/navigation-menu.tsx +168 -0
  131. package/lib/__templates__/nextjs/src/components/ui/pagination.tsx +127 -0
  132. package/lib/__templates__/nextjs/src/components/ui/popover.tsx +48 -0
  133. package/lib/__templates__/nextjs/src/components/ui/progress.tsx +31 -0
  134. package/lib/__templates__/nextjs/src/components/ui/radio-group.tsx +45 -0
  135. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +63 -0
  136. package/lib/__templates__/nextjs/src/components/ui/scroll-area.tsx +58 -0
  137. package/lib/__templates__/nextjs/src/components/ui/select.tsx +190 -0
  138. package/lib/__templates__/nextjs/src/components/ui/separator.tsx +28 -0
  139. package/lib/__templates__/nextjs/src/components/ui/sheet.tsx +139 -0
  140. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +724 -0
  141. package/lib/__templates__/nextjs/src/components/ui/skeleton.tsx +13 -0
  142. package/lib/__templates__/nextjs/src/components/ui/slider.tsx +63 -0
  143. package/lib/__templates__/nextjs/src/components/ui/sonner.tsx +40 -0
  144. package/lib/__templates__/nextjs/src/components/ui/spinner.tsx +16 -0
  145. package/lib/__templates__/nextjs/src/components/ui/switch.tsx +31 -0
  146. package/lib/__templates__/nextjs/src/components/ui/table.tsx +116 -0
  147. package/lib/__templates__/nextjs/src/components/ui/tabs.tsx +66 -0
  148. package/lib/__templates__/nextjs/src/components/ui/textarea.tsx +18 -0
  149. package/lib/__templates__/nextjs/src/components/ui/toggle-group.tsx +83 -0
  150. package/lib/__templates__/nextjs/src/components/ui/toggle.tsx +47 -0
  151. package/lib/__templates__/nextjs/src/components/ui/tooltip.tsx +61 -0
  152. package/lib/__templates__/nextjs/src/hooks/use-mobile.ts +19 -0
  153. package/lib/__templates__/nextjs/src/lib/utils.ts +6 -0
  154. package/lib/__templates__/nextjs/src/server.ts +35 -0
  155. package/lib/__templates__/nextjs/template.config.js +120 -0
  156. package/lib/__templates__/nextjs/tsconfig.json +34 -0
  157. package/lib/__templates__/nuxt-vue/.coze +12 -0
  158. package/lib/__templates__/nuxt-vue/README.md +73 -0
  159. package/lib/__templates__/nuxt-vue/_gitignore +24 -0
  160. package/lib/__templates__/nuxt-vue/_npmrc +23 -0
  161. package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
  162. package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
  163. package/lib/__templates__/nuxt-vue/assets/css/main.css +24 -0
  164. package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
  165. package/lib/__templates__/nuxt-vue/package.json +35 -0
  166. package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
  167. package/lib/__templates__/nuxt-vue/postcss.config.mjs +8 -0
  168. package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
  169. package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
  170. package/lib/__templates__/nuxt-vue/scripts/build.sh +14 -0
  171. package/lib/__templates__/nuxt-vue/scripts/dev.sh +39 -0
  172. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
  173. package/lib/__templates__/nuxt-vue/scripts/start.sh +21 -0
  174. package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
  175. package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
  176. package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
  177. package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
  178. package/lib/__templates__/nuxt-vue/template.config.js +87 -0
  179. package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
  180. package/lib/__templates__/taro/.coze +14 -0
  181. package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
  182. package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +14 -0
  183. package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +2 -0
  184. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +151 -0
  185. package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
  186. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -0
  187. package/lib/__templates__/taro/README.md +763 -0
  188. package/lib/__templates__/taro/_gitignore +40 -0
  189. package/lib/__templates__/taro/_npmrc +18 -0
  190. package/lib/__templates__/taro/babel.config.js +12 -0
  191. package/lib/__templates__/taro/config/dev.ts +9 -0
  192. package/lib/__templates__/taro/config/index.ts +237 -0
  193. package/lib/__templates__/taro/config/prod.ts +34 -0
  194. package/lib/__templates__/taro/eslint.config.mjs +135 -0
  195. package/lib/__templates__/taro/key/private.appid.key +0 -0
  196. package/lib/__templates__/taro/package.json +112 -0
  197. package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
  198. package/lib/__templates__/taro/pnpm-lock.yaml +23412 -0
  199. package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
  200. package/lib/__templates__/taro/project.config.json +15 -0
  201. package/lib/__templates__/taro/server/nest-cli.json +10 -0
  202. package/lib/__templates__/taro/server/package.json +40 -0
  203. package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
  204. package/lib/__templates__/taro/server/src/app.module.ts +10 -0
  205. package/lib/__templates__/taro/server/src/app.service.ts +8 -0
  206. package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
  207. package/lib/__templates__/taro/server/src/main.ts +49 -0
  208. package/lib/__templates__/taro/server/tsconfig.json +24 -0
  209. package/lib/__templates__/taro/src/app.config.ts +11 -0
  210. package/lib/__templates__/taro/src/app.css +156 -0
  211. package/lib/__templates__/taro/src/app.tsx +9 -0
  212. package/lib/__templates__/taro/src/components/ui/accordion.tsx +159 -0
  213. package/lib/__templates__/taro/src/components/ui/alert-dialog.tsx +260 -0
  214. package/lib/__templates__/taro/src/components/ui/alert.tsx +60 -0
  215. package/lib/__templates__/taro/src/components/ui/aspect-ratio.tsx +36 -0
  216. package/lib/__templates__/taro/src/components/ui/avatar.tsx +84 -0
  217. package/lib/__templates__/taro/src/components/ui/badge.tsx +37 -0
  218. package/lib/__templates__/taro/src/components/ui/breadcrumb.tsx +117 -0
  219. package/lib/__templates__/taro/src/components/ui/button-group.tsx +83 -0
  220. package/lib/__templates__/taro/src/components/ui/button.tsx +67 -0
  221. package/lib/__templates__/taro/src/components/ui/calendar.tsx +394 -0
  222. package/lib/__templates__/taro/src/components/ui/card.tsx +108 -0
  223. package/lib/__templates__/taro/src/components/ui/carousel.tsx +228 -0
  224. package/lib/__templates__/taro/src/components/ui/checkbox.tsx +58 -0
  225. package/lib/__templates__/taro/src/components/ui/code-block.tsx +169 -0
  226. package/lib/__templates__/taro/src/components/ui/collapsible.tsx +71 -0
  227. package/lib/__templates__/taro/src/components/ui/command.tsx +385 -0
  228. package/lib/__templates__/taro/src/components/ui/context-menu.tsx +614 -0
  229. package/lib/__templates__/taro/src/components/ui/dialog.tsx +256 -0
  230. package/lib/__templates__/taro/src/components/ui/drawer.tsx +192 -0
  231. package/lib/__templates__/taro/src/components/ui/dropdown-menu.tsx +561 -0
  232. package/lib/__templates__/taro/src/components/ui/field.tsx +228 -0
  233. package/lib/__templates__/taro/src/components/ui/hover-card.tsx +282 -0
  234. package/lib/__templates__/taro/src/components/ui/input-group.tsx +197 -0
  235. package/lib/__templates__/taro/src/components/ui/input-otp.tsx +136 -0
  236. package/lib/__templates__/taro/src/components/ui/input.tsx +56 -0
  237. package/lib/__templates__/taro/src/components/ui/label.tsx +24 -0
  238. package/lib/__templates__/taro/src/components/ui/menubar.tsx +595 -0
  239. package/lib/__templates__/taro/src/components/ui/navigation-menu.tsx +264 -0
  240. package/lib/__templates__/taro/src/components/ui/pagination.tsx +118 -0
  241. package/lib/__templates__/taro/src/components/ui/popover.tsx +291 -0
  242. package/lib/__templates__/taro/src/components/ui/portal.tsx +19 -0
  243. package/lib/__templates__/taro/src/components/ui/progress.tsx +28 -0
  244. package/lib/__templates__/taro/src/components/ui/radio-group.tsx +64 -0
  245. package/lib/__templates__/taro/src/components/ui/resizable.tsx +346 -0
  246. package/lib/__templates__/taro/src/components/ui/scroll-area.tsx +34 -0
  247. package/lib/__templates__/taro/src/components/ui/select.tsx +438 -0
  248. package/lib/__templates__/taro/src/components/ui/separator.tsx +30 -0
  249. package/lib/__templates__/taro/src/components/ui/sheet.tsx +262 -0
  250. package/lib/__templates__/taro/src/components/ui/skeleton.tsx +17 -0
  251. package/lib/__templates__/taro/src/components/ui/slider.tsx +203 -0
  252. package/lib/__templates__/taro/src/components/ui/sonner.tsx +1 -0
  253. package/lib/__templates__/taro/src/components/ui/switch.tsx +55 -0
  254. package/lib/__templates__/taro/src/components/ui/table.tsx +142 -0
  255. package/lib/__templates__/taro/src/components/ui/tabs.tsx +114 -0
  256. package/lib/__templates__/taro/src/components/ui/textarea.tsx +54 -0
  257. package/lib/__templates__/taro/src/components/ui/toast.tsx +517 -0
  258. package/lib/__templates__/taro/src/components/ui/toggle-group.tsx +120 -0
  259. package/lib/__templates__/taro/src/components/ui/toggle.tsx +77 -0
  260. package/lib/__templates__/taro/src/components/ui/tooltip.tsx +455 -0
  261. package/lib/__templates__/taro/src/index.html +39 -0
  262. package/lib/__templates__/taro/src/lib/hooks/use-keyboard-offset.ts +37 -0
  263. package/lib/__templates__/taro/src/lib/measure.ts +115 -0
  264. package/lib/__templates__/taro/src/lib/platform.ts +12 -0
  265. package/lib/__templates__/taro/src/lib/utils.ts +6 -0
  266. package/lib/__templates__/taro/src/network.ts +39 -0
  267. package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
  268. package/lib/__templates__/taro/src/pages/index/index.css +1 -0
  269. package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
  270. package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
  271. package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
  272. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +238 -0
  273. package/lib/__templates__/taro/src/presets/h5-styles.ts +220 -0
  274. package/lib/__templates__/taro/src/presets/index.tsx +18 -0
  275. package/lib/__templates__/taro/stylelint.config.mjs +4 -0
  276. package/lib/__templates__/taro/template.config.js +68 -0
  277. package/lib/__templates__/taro/tsconfig.json +29 -0
  278. package/lib/__templates__/taro/types/global.d.ts +32 -0
  279. package/lib/__templates__/templates.json +162 -0
  280. package/lib/__templates__/vite/.coze +12 -0
  281. package/lib/__templates__/vite/README.md +418 -0
  282. package/lib/__templates__/vite/_gitignore +67 -0
  283. package/lib/__templates__/vite/_npmrc +23 -0
  284. package/lib/__templates__/vite/eslint.config.mjs +14 -0
  285. package/lib/__templates__/vite/index.html +13 -0
  286. package/lib/__templates__/vite/package.json +44 -0
  287. package/lib/__templates__/vite/pnpm-lock.yaml +3465 -0
  288. package/lib/__templates__/vite/postcss.config.js +6 -0
  289. package/lib/__templates__/vite/scripts/build.sh +17 -0
  290. package/lib/__templates__/vite/scripts/dev.sh +39 -0
  291. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  292. package/lib/__templates__/vite/scripts/start.sh +21 -0
  293. package/lib/__templates__/vite/server/routes/index.ts +31 -0
  294. package/lib/__templates__/vite/server/server.ts +65 -0
  295. package/lib/__templates__/vite/server/vite.ts +67 -0
  296. package/lib/__templates__/vite/src/index.css +21 -0
  297. package/lib/__templates__/vite/src/index.ts +5 -0
  298. package/lib/__templates__/vite/src/main.ts +34 -0
  299. package/lib/__templates__/vite/tailwind.config.js +9 -0
  300. package/lib/__templates__/vite/template.config.js +127 -0
  301. package/lib/__templates__/vite/tsconfig.json +17 -0
  302. package/lib/__templates__/vite/vite.config.ts +20 -0
  303. package/lib/cli.js +2631 -0
  304. package/package.json +81 -0
@@ -0,0 +1,363 @@
1
+ # <%= appName %>
2
+
3
+ 这是一个基于 [Next.js 16](https://nextjs.org) + [shadcn/ui](https://ui.shadcn.com) 的全栈应用项目,由扣子编程 CLI 创建。
4
+
5
+ ## 快速开始
6
+
7
+ ### 启动开发服务器
8
+
9
+ ```bash
10
+ coze dev
11
+ ```
12
+
13
+ 启动后,在浏览器中打开 [http://localhost:<%= port %>](http://localhost:<%= port %>) 查看应用。
14
+
15
+ 开发服务器支持热更新,修改代码后页面会自动刷新。
16
+
17
+ ### 构建生产版本
18
+
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` 中配置。
338
+
339
+ ## 技术栈
340
+
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
349
+
350
+ ## 参考文档
351
+
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)
356
+
357
+ ## 重要提示
358
+
359
+ 1. **必须使用 pnpm** 作为包管理器
360
+ 2. **优先使用 shadcn/ui 组件** 而不是从零开发基础组件
361
+ 3. **遵循 Next.js App Router 规范**,正确区分服务端/客户端组件
362
+ 4. **使用 TypeScript** 进行类型安全开发
363
+ 5. **使用 `@/` 路径别名** 导入模块(已配置)
@@ -0,0 +1,99 @@
1
+ .next
2
+
3
+ # Dependencies
4
+ node_modules/
5
+ .pnp
6
+ .pnp.js
7
+
8
+ # Production build
9
+ dist/
10
+ build/
11
+ out/
12
+ .next/
13
+ .rsbuild/
14
+
15
+ # Testing
16
+ coverage/
17
+ *.lcov
18
+ .nyc_output
19
+
20
+ # Environment variables
21
+ .env
22
+ .env.local
23
+ .env.development.local
24
+ .env.test.local
25
+ .env.production.local
26
+
27
+ # Logs
28
+ logs/
29
+ *.log
30
+ npm-debug.log*
31
+ yarn-debug.log*
32
+ yarn-error.log*
33
+ pnpm-debug.log*
34
+ lerna-debug.log*
35
+
36
+ # Runtime data
37
+ pids
38
+ *.pid
39
+ *.seed
40
+ *.pid.lock
41
+
42
+ # Diagnostic reports
43
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
44
+
45
+ # Cache
46
+ .cache/
47
+ .parcel-cache/
48
+ .eslintcache
49
+ .stylelintcache
50
+ .npm
51
+ .yarn/cache
52
+ .yarn/unplugged
53
+ .yarn/build-state.yml
54
+ .yarn/install-state.gz
55
+
56
+ # Editor directories and files
57
+ .vscode/*
58
+ !.vscode/extensions.json
59
+ !.vscode/settings.json
60
+ .idea/
61
+ *.suo
62
+ *.ntvs*
63
+ *.njsproj
64
+ *.sln
65
+ *.sw?
66
+ *.swp
67
+ *.swo
68
+ *~
69
+
70
+ # OS files
71
+ .DS_Store
72
+ .DS_Store?
73
+ ._*
74
+ .Spotlight-V100
75
+ .Trashes
76
+ ehthumbs.db
77
+ Thumbs.db
78
+ Desktop.ini
79
+
80
+ # Temporary files
81
+ *.tmp
82
+ *.temp
83
+ .tmp/
84
+ .temp/
85
+
86
+ # Optional files
87
+ *.tgz
88
+ *.gz
89
+ *.zip
90
+ *.tar
91
+
92
+ # TypeScript
93
+ *.tsbuildinfo
94
+
95
+ # Misc
96
+ .vercel
97
+ .turbo
98
+
99
+ .coze-logs
@@ -0,0 +1,23 @@
1
+ loglevel=error
2
+ registry=https://registry.npmmirror.com
3
+
4
+ strictStorePkgContentCheck=false
5
+ verifyStoreIntegrity=false
6
+
7
+ # 网络优化
8
+ network-concurrency=16
9
+ fetch-retries=3
10
+ fetch-timeout=60000
11
+
12
+ # 严格使用 peer dependencies
13
+ strict-peer-dependencies=false
14
+
15
+ # 自动生成 lockfile
16
+ auto-install-peers=true
17
+
18
+ # lockfile 配置
19
+ lockfile=true
20
+ prefer-frozen-lockfile=true
21
+
22
+ # 如果 lockfile 存在但过期,更新而不是失败
23
+ resolution-mode=highest
@@ -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
+ }
@@ -0,0 +1,23 @@
1
+ import nextTs from 'eslint-config-next/typescript';
2
+ import nextVitals from 'eslint-config-next/core-web-vitals';
3
+ import { defineConfig, globalIgnores } from 'eslint/config';
4
+
5
+ const eslintConfig = defineConfig([
6
+ ...nextVitals,
7
+ ...nextTs,
8
+ // Override default ignores of eslint-config-next.
9
+ globalIgnores([
10
+ // Default ignores of eslint-config-next:
11
+ '.next/**',
12
+ 'out/**',
13
+ 'build/**',
14
+ 'next-env.d.ts',
15
+ // Build artifacts:
16
+ 'server.js',
17
+ 'dist/**',
18
+ // Script files (CommonJS):
19
+ 'scripts/**/*.js',
20
+ ]),
21
+ ]);
22
+
23
+ export default eslintConfig;
@@ -0,0 +1,6 @@
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+ import "./.next/types/routes.d.ts";
4
+
5
+ // NOTE: This file should not be edited
6
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -0,0 +1,18 @@
1
+ import type { NextConfig } from 'next';
2
+
3
+ const nextConfig: NextConfig = {
4
+ // outputFileTracingRoot: path.resolve(__dirname, '../../'), // Uncomment and add 'import path from "path"' if needed
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
+ },
16
+ };
17
+
18
+ export default nextConfig;
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "<%= appName %>",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "build": "bash ./scripts/build.sh",
7
+ "dev": "bash ./scripts/dev.sh",
8
+ "preinstall": "npx only-allow pnpm",
9
+ "lint": "eslint",
10
+ "start": "bash ./scripts/start.sh",
11
+ "ts-check": "tsc -p tsconfig.json"
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",
56
+ "next": "16.1.1",
57
+ "next-themes": "^0.4.6",
58
+ "pg": "^8.16.3",
59
+ "react": "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"
70
+ },
71
+ "devDependencies": {
72
+ "@react-dev-inspector/babel-plugin": "^2.0.1",
73
+ "@react-dev-inspector/middleware": "^2.0.1",
74
+ "@tailwindcss/postcss": "^4",
75
+ "@types/node": "^20",
76
+ "@types/pg": "^8.16.0",
77
+ "@types/react": "^19",
78
+ "@types/react-dom": "^19",
79
+ "eslint": "^9",
80
+ "eslint-config-next": "16.1.1",
81
+ "only-allow": "^1.2.2",
82
+ "react-dev-inspector": "^2.0.1",
83
+ "shadcn": "latest",
84
+ "tailwindcss": "^4",
85
+ "tsup": "^8.3.5",
86
+ "tsx": "^4.19.2",
87
+ "typescript": "^5"
88
+ },
89
+ "packageManager": "pnpm@9.0.0",
90
+ "engines": {
91
+ "pnpm": ">=9.0.0"
92
+ }
93
+ }