@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,238 @@
1
+ import React, { useState, useMemo } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ TouchableOpacity,
6
+ StyleSheet,
7
+ Keyboard,
8
+ Platform,
9
+ useColorScheme,
10
+ ViewStyle,
11
+ TextStyle
12
+ } from 'react-native';
13
+ import DateTimePickerModal from 'react-native-modal-datetime-picker';
14
+ import dayjs from 'dayjs';
15
+ import { FontAwesome6 } from '@expo/vector-icons';
16
+
17
+ // --------------------------------------------------------
18
+ // 1. 配置 Dayjs
19
+ // --------------------------------------------------------
20
+ // 即使服务端返回 '2023-10-20T10:00:00Z' (UTC),
21
+ // dayjs(utcString).format() 会自动转为手机当前的本地时区显示。
22
+ // 如果需要传回给后端,我们再转回 ISO 格式。
23
+
24
+ interface SmartDateInputProps {
25
+ label?: string; // 表单标题 (可选)
26
+ value?: string | null; // 服务端返回的时间字符串 (ISO 8601, 带 T)
27
+ onChange: (isoDate: string) => void; // 回调给父组件的值,依然是标准 ISO 字符串
28
+ placeholder?: string;
29
+ mode?: 'date' | 'time' | 'datetime'; // 支持日期、时间、或两者
30
+ displayFormat?: string; // UI展示的格式,默认 YYYY-MM-DD
31
+ error?: string; // 错误信息
32
+
33
+ // 样式自定义(可选)
34
+ containerStyle?: ViewStyle; // 外层容器样式
35
+ inputStyle?: ViewStyle; // 输入框样式
36
+ textStyle?: TextStyle; // 文字样式
37
+ labelStyle?: TextStyle; // 标签样式
38
+ placeholderTextStyle?: TextStyle; // 占位符文字样式
39
+ errorTextStyle?: TextStyle; // 错误信息文字样式
40
+ iconColor?: string; // 图标颜色
41
+ iconSize?: number; // 图标大小
42
+ }
43
+
44
+ export const SmartDateInput = ({
45
+ label,
46
+ value,
47
+ onChange,
48
+ placeholder = '请选择',
49
+ mode = 'date',
50
+ displayFormat,
51
+ error,
52
+ containerStyle,
53
+ inputStyle,
54
+ textStyle,
55
+ labelStyle,
56
+ placeholderTextStyle,
57
+ errorTextStyle,
58
+ iconColor,
59
+ iconSize = 18
60
+ }: SmartDateInputProps) => {
61
+ const [isDatePickerVisible, setDatePickerVisibility] = useState(false);
62
+ const colorScheme = useColorScheme();
63
+ const isDark = colorScheme === 'dark';
64
+
65
+ // 默认展示格式
66
+ const format = displayFormat || (mode === 'time' ? 'HH:mm' : 'YYYY-MM-DD');
67
+
68
+ // --------------------------------------------------------
69
+ // 2. 核心:数据转换逻辑
70
+ // --------------------------------------------------------
71
+
72
+ // 解析服务端值,确保无效值不传给控件;time 模式兼容仅时间字符串
73
+ const parsedValue = useMemo(() => {
74
+ if (!value) return null;
75
+
76
+ const direct = dayjs(value);
77
+ if (direct.isValid()) return direct;
78
+
79
+ if (mode === 'time') {
80
+ const timeOnly = dayjs(`1970-01-01T${value}`);
81
+ if (timeOnly.isValid()) return timeOnly;
82
+ }
83
+
84
+ return null;
85
+ }, [value, mode]);
86
+
87
+ // A. 将字符串转为 JS Date 对象给控件使用
88
+ // 如果 value 是空或无效,回退到当前时间
89
+ const dateObjectForPicker = useMemo(() => {
90
+ return parsedValue ? parsedValue.toDate() : new Date();
91
+ }, [parsedValue]);
92
+
93
+ // B. 将 Date 对象转为展示字符串
94
+ const displayString = useMemo(() => {
95
+ if (!parsedValue) return '';
96
+ return parsedValue.format(format);
97
+ }, [parsedValue, format]);
98
+
99
+ // --------------------------------------------------------
100
+ // 3. 核心:交互逻辑 (解决键盘遮挡/无法收起)
101
+ // --------------------------------------------------------
102
+
103
+ const showDatePicker = () => {
104
+ // 【关键点】打开日期控件前,必须强制收起键盘!
105
+ // 否则键盘会遮挡 iOS 的底部滚轮,或者导致 Android 焦点混乱
106
+ Keyboard.dismiss();
107
+ setDatePickerVisibility(true);
108
+ };
109
+
110
+ const hideDatePicker = () => {
111
+ setDatePickerVisibility(false);
112
+ };
113
+
114
+ const handleConfirm = (date: Date) => {
115
+ hideDatePicker();
116
+ // 采用带本地偏移的 ISO 字符串,避免 date 模式在非 UTC 时区出现跨天
117
+ const serverString = dayjs(date).format(format);
118
+ onChange(serverString);
119
+ };
120
+
121
+ // 根据 mode 选择图标
122
+ const iconName = mode === 'time' ? 'clock' : 'calendar';
123
+
124
+ return (
125
+ <View style={[styles.container, containerStyle]}>
126
+ {/* 标题 */}
127
+ {label && <Text style={[styles.label, labelStyle]}>{label}</Text>}
128
+
129
+ {/*
130
+ 这里用 TouchableOpacity 模拟 Input。
131
+ 模拟组件永远不会唤起键盘。
132
+ */}
133
+ <TouchableOpacity
134
+ style={[
135
+ styles.inputBox,
136
+ error ? styles.inputBoxError : null,
137
+ inputStyle
138
+ ]}
139
+ onPress={showDatePicker}
140
+ activeOpacity={0.7}
141
+ >
142
+ <Text
143
+ style={[
144
+ styles.text,
145
+ textStyle,
146
+ !value && styles.placeholder,
147
+ !value && placeholderTextStyle
148
+ ]}
149
+ numberOfLines={1}
150
+ >
151
+ {displayString || placeholder}
152
+ </Text>
153
+
154
+ <FontAwesome6
155
+ name={iconName}
156
+ size={iconSize}
157
+ color={iconColor || (value ? '#4B5563' : '#9CA3AF')}
158
+ style={styles.icon}
159
+ />
160
+ </TouchableOpacity>
161
+
162
+ {error && <Text style={[styles.errorText, errorTextStyle]}>{error}</Text>}
163
+
164
+ {/*
165
+ DateTimePickerModal 是 React Native Modal。
166
+ 它会覆盖在所有 View 之上。
167
+ */}
168
+ <DateTimePickerModal
169
+ isVisible={isDatePickerVisible}
170
+ mode={mode}
171
+ date={dateObjectForPicker} // 传入 Date 对象
172
+ onConfirm={handleConfirm}
173
+ onCancel={hideDatePicker}
174
+ // iOS 只有用这个 display 样式才最稳,避免乱七八糟的 inline 样式
175
+ display={Platform.OS === 'ios' ? 'spinner' : 'default'}
176
+ // 自动适配系统深色模式,或者根据 isDark 变量控制
177
+ isDarkModeEnabled={isDark}
178
+ // 强制使用中文环境
179
+ locale="zh-CN"
180
+ confirmTextIOS="确定"
181
+ cancelTextIOS="取消"
182
+ />
183
+ </View>
184
+ );
185
+ };
186
+
187
+ // 设计样式
188
+ const styles = StyleSheet.create({
189
+ container: {
190
+ marginBottom: 20,
191
+ },
192
+ label: {
193
+ fontSize: 14,
194
+ fontWeight: '600',
195
+ color: '#374151', // Gray 700
196
+ marginBottom: 8,
197
+ marginLeft: 2,
198
+ },
199
+ inputBox: {
200
+ height: 52, // 增加高度提升触控体验
201
+ backgroundColor: '#FFFFFF',
202
+ borderRadius: 12, // 更圆润的角
203
+ flexDirection: 'row',
204
+ alignItems: 'center',
205
+ justifyContent: 'space-between',
206
+ paddingHorizontal: 16,
207
+ borderWidth: 1,
208
+ borderColor: '#E5E7EB', // Gray 200
209
+ // 增加轻微阴影提升层次感 (iOS)
210
+ shadowColor: '#000',
211
+ shadowOffset: { width: 0, height: 1 },
212
+ shadowOpacity: 0.05,
213
+ shadowRadius: 2,
214
+ // Android
215
+ elevation: 1,
216
+ },
217
+ inputBoxError: {
218
+ borderColor: '#EF4444', // Red 500
219
+ backgroundColor: '#FEF2F2', // Red 50
220
+ },
221
+ text: {
222
+ fontSize: 16,
223
+ color: '#111827', // Gray 900
224
+ flex: 1,
225
+ },
226
+ placeholder: {
227
+ color: '#9CA3AF', // Gray 400 - 标准占位符颜色
228
+ },
229
+ icon: {
230
+ marginLeft: 12,
231
+ },
232
+ errorText: {
233
+ marginTop: 4,
234
+ marginLeft: 2,
235
+ fontSize: 12,
236
+ color: '#EF4444',
237
+ }
238
+ });
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { Text, TextProps, TextStyle } from 'react-native';
3
+ import { useTheme } from '@/hooks/useTheme';
4
+ import { Typography } from '@/constants/theme';
5
+
6
+ type TypographyVariant = keyof typeof Typography;
7
+
8
+ interface ThemedTextProps extends TextProps {
9
+ variant?: TypographyVariant;
10
+ color?: string;
11
+ }
12
+
13
+ export function ThemedText({
14
+ variant = 'body',
15
+ color,
16
+ style,
17
+ children,
18
+ ...props
19
+ }: ThemedTextProps) {
20
+ const { theme } = useTheme();
21
+ const typographyStyle = Typography[variant];
22
+
23
+ const textStyle: TextStyle = {
24
+ ...typographyStyle,
25
+ color: color ?? theme.textPrimary,
26
+ };
27
+
28
+ return (
29
+ <Text style={[textStyle, style]} {...props}>
30
+ {children}
31
+ </Text>
32
+ );
33
+ }
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { View, ViewProps, ViewStyle } from 'react-native';
3
+ import { useTheme } from '@/hooks/useTheme';
4
+
5
+ type BackgroundLevel = 'root' | 'default' | 'tertiary';
6
+
7
+ interface ThemedViewProps extends ViewProps {
8
+ level?: BackgroundLevel;
9
+ backgroundColor?: string;
10
+ }
11
+
12
+ const backgroundMap: Record<BackgroundLevel, string> = {
13
+ root: 'backgroundRoot',
14
+ default: 'backgroundDefault',
15
+ tertiary: 'backgroundTertiary',
16
+ };
17
+
18
+ export function ThemedView({
19
+ level = 'root',
20
+ backgroundColor,
21
+ style,
22
+ children,
23
+ ...props
24
+ }: ThemedViewProps) {
25
+ const { theme } = useTheme();
26
+ const bgColor = backgroundColor ?? (theme as any)[backgroundMap[level]];
27
+
28
+ const viewStyle: ViewStyle = {
29
+ backgroundColor: bgColor,
30
+ };
31
+
32
+ return (
33
+ <View style={[viewStyle, style]} {...props}>
34
+ {children}
35
+ </View>
36
+ );
37
+ }
@@ -0,0 +1,177 @@
1
+ export const Colors = {
2
+ light: {
3
+ textPrimary: "#1C1917",
4
+ textSecondary: "#78716c",
5
+ textMuted: "#9CA3AF",
6
+ primary: "#4F46E5", // Indigo-600 - 品牌主色,代表科技与智能
7
+ accent: "#8B5CF6", // Violet-500 - 辅助色,代表创造力
8
+ success: "#10B981", // Emerald-500
9
+ error: "#EF4444",
10
+ backgroundRoot: "#FAFAFA",
11
+ backgroundDefault: "#FFFFFF",
12
+ backgroundTertiary: "#F9FAFB", // 更浅的背景色,用于去线留白
13
+ buttonPrimaryText: "#FFFFFF",
14
+ tabIconSelected: "#4F46E5",
15
+ border: "#E5E7EB",
16
+ borderLight: "#F3F4F6",
17
+ },
18
+ dark: {
19
+ textPrimary: "#FAFAF9",
20
+ textSecondary: "#A8A29E",
21
+ textMuted: "#6F767E",
22
+ primary: "#818CF8", // Indigo-400 - 暗色模式品牌主色
23
+ accent: "#A78BFA", // Violet-400
24
+ success: "#34D399",
25
+ error: "#F87171",
26
+ backgroundRoot: "#09090B", // 更深的背景色
27
+ backgroundDefault: "#1C1C1E",
28
+ backgroundTertiary: "#1F1F22", // 暗色模式去线留白背景
29
+ buttonPrimaryText: "#09090B",
30
+ tabIconSelected: "#818CF8",
31
+ border: "#3F3F46",
32
+ borderLight: "#27272A",
33
+ },
34
+ };
35
+
36
+ export const Spacing = {
37
+ xs: 4,
38
+ sm: 8,
39
+ md: 12,
40
+ lg: 16,
41
+ xl: 20,
42
+ "2xl": 24,
43
+ "3xl": 32,
44
+ "4xl": 40,
45
+ "5xl": 48,
46
+ "6xl": 64,
47
+ };
48
+
49
+ export const BorderRadius = {
50
+ xs: 4,
51
+ sm: 8,
52
+ md: 12,
53
+ lg: 16,
54
+ xl: 20,
55
+ "2xl": 24,
56
+ "3xl": 28,
57
+ "4xl": 32,
58
+ full: 9999,
59
+ };
60
+
61
+ export const Typography = {
62
+ display: {
63
+ fontSize: 112,
64
+ lineHeight: 112,
65
+ fontWeight: "200" as const,
66
+ letterSpacing: -4,
67
+ },
68
+ displayLarge: {
69
+ fontSize: 112,
70
+ lineHeight: 112,
71
+ fontWeight: "200" as const,
72
+ letterSpacing: -2,
73
+ },
74
+ displayMedium: {
75
+ fontSize: 48,
76
+ lineHeight: 56,
77
+ fontWeight: "200" as const,
78
+ },
79
+ h1: {
80
+ fontSize: 32,
81
+ lineHeight: 40,
82
+ fontWeight: "700" as const,
83
+ },
84
+ h2: {
85
+ fontSize: 28,
86
+ lineHeight: 36,
87
+ fontWeight: "700" as const,
88
+ },
89
+ h3: {
90
+ fontSize: 24,
91
+ lineHeight: 32,
92
+ fontWeight: "300" as const,
93
+ },
94
+ h4: {
95
+ fontSize: 20,
96
+ lineHeight: 28,
97
+ fontWeight: "600" as const,
98
+ },
99
+ title: {
100
+ fontSize: 18,
101
+ lineHeight: 24,
102
+ fontWeight: "700" as const,
103
+ },
104
+ body: {
105
+ fontSize: 16,
106
+ lineHeight: 24,
107
+ fontWeight: "400" as const,
108
+ },
109
+ bodyMedium: {
110
+ fontSize: 16,
111
+ lineHeight: 24,
112
+ fontWeight: "500" as const,
113
+ },
114
+ small: {
115
+ fontSize: 14,
116
+ lineHeight: 20,
117
+ fontWeight: "400" as const,
118
+ },
119
+ smallMedium: {
120
+ fontSize: 14,
121
+ lineHeight: 20,
122
+ fontWeight: "500" as const,
123
+ },
124
+ caption: {
125
+ fontSize: 12,
126
+ lineHeight: 16,
127
+ fontWeight: "400" as const,
128
+ },
129
+ captionMedium: {
130
+ fontSize: 12,
131
+ lineHeight: 16,
132
+ fontWeight: "500" as const,
133
+ },
134
+ label: {
135
+ fontSize: 14,
136
+ lineHeight: 20,
137
+ fontWeight: "500" as const,
138
+ letterSpacing: 2,
139
+ textTransform: "uppercase" as const,
140
+ },
141
+ labelSmall: {
142
+ fontSize: 12,
143
+ lineHeight: 16,
144
+ fontWeight: "500" as const,
145
+ letterSpacing: 1,
146
+ textTransform: "uppercase" as const,
147
+ },
148
+ labelTitle: {
149
+ fontSize: 14,
150
+ lineHeight: 20,
151
+ fontWeight: "700" as const,
152
+ letterSpacing: 2,
153
+ textTransform: "uppercase" as const,
154
+ },
155
+ link: {
156
+ fontSize: 16,
157
+ lineHeight: 24,
158
+ fontWeight: "400" as const,
159
+ },
160
+ stat: {
161
+ fontSize: 30,
162
+ lineHeight: 36,
163
+ fontWeight: "300" as const,
164
+ },
165
+ tiny: {
166
+ fontSize: 10,
167
+ lineHeight: 14,
168
+ fontWeight: "400" as const,
169
+ },
170
+ navLabel: {
171
+ fontSize: 10,
172
+ lineHeight: 14,
173
+ fontWeight: "500" as const,
174
+ },
175
+ };
176
+
177
+ export type Theme = typeof Colors.light;
@@ -0,0 +1,49 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * 通用认证上下文
4
+ *
5
+ * 基于固定的 API 接口实现,可复用到其他项目
6
+ * 其他项目使用时,只需修改 @api 的导入路径指向项目的 api 模块
7
+ *
8
+ * 注意:
9
+ * - 如果需要登录/鉴权场景,请扩展本文件,完善 login/logout、token 管理、用户信息获取与刷新等逻辑
10
+ * - 将示例中的占位实现替换为项目实际的接口调用与状态管理
11
+ */
12
+ import React, { createContext, useContext, ReactNode } from "react";
13
+
14
+ interface UserOut {
15
+
16
+ }
17
+
18
+ interface AuthContextType {
19
+ user: UserOut | null;
20
+ token: string | null;
21
+ isAuthenticated: boolean;
22
+ isLoading: boolean;
23
+ login: (token: string) => Promise<void>;
24
+ logout: () => Promise<void>;
25
+ updateUser: (userData: Partial<UserOut>) => void;
26
+ }
27
+
28
+ const AuthContext = createContext<AuthContextType | undefined>(undefined);
29
+
30
+ export const AuthProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
31
+ const value: AuthContextType = {
32
+ user: null,
33
+ token: null,
34
+ isAuthenticated: false,
35
+ isLoading: false,
36
+ login: async (token: string) => {},
37
+ logout: async () => {},
38
+ updateUser: () => {},
39
+ };
40
+ return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
41
+ };
42
+
43
+ export const useAuth = (): AuthContextType => {
44
+ const context = useContext(AuthContext);
45
+ if (context === undefined) {
46
+ throw new Error("useAuth must be used within an AuthProvider");
47
+ }
48
+ return context;
49
+ };
@@ -0,0 +1,5 @@
1
+ // declarations.d.ts
2
+
3
+ declare module 'expo-file-system/legacy' {
4
+ export * from 'expo-file-system';
5
+ }
@@ -0,0 +1,49 @@
1
+ export default function (results) {
2
+
3
+ return results
4
+ .flatMap(file =>
5
+ file.messages.map(m => {
6
+ // split into lines
7
+ const lines = m.message.split('\n');
8
+
9
+ // 第一行(句子):直接用
10
+ const first = lines[0];
11
+
12
+ // 附加解释:过滤掉所有 codeframe/箭头/行号/重复路径
13
+ const details = lines
14
+ .slice(1)
15
+ .filter(l => {
16
+ // 移除空行
17
+ if (!l.trim()) return false;
18
+
19
+ // 移除 "58 | xxx" 这样的行
20
+ if (/^\s*\d+\s*\|/.test(l)) return false;
21
+
22
+ // 移除 "> 60 | ..." 这样的箭头行
23
+ if (/^\s*>/.test(l)) return false;
24
+
25
+ // 移除只有箭头提示的行,如 "| ^^^^^"
26
+ if (/^\s*\|/.test(l)) return false;
27
+
28
+ // 移除 "…" 省略号行
29
+ if (/^\s*…/.test(l)) return false;
30
+
31
+ // 移除重复路径行(eslint message 有时夹带 file:line)
32
+ if (/\.tsx:\d+:\d+/.test(l)) return false;
33
+
34
+ return true;
35
+ })
36
+ .join('\n')
37
+ .trim();
38
+
39
+ let output = `${file.filePath}:${m.line}:${m.column} ${
40
+ m.severity === 2 ? 'error' : 'warn'
41
+ } ${first}`;
42
+
43
+ if (details) output += `\n${details}\n`;
44
+
45
+ return output;
46
+ })
47
+ )
48
+ .join('\n');
49
+ };