create-bubbles 0.1.18 → 0.1.20

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 (380) hide show
  1. package/dist/index.js +406 -11
  2. package/package.json +3 -2
  3. package/template-nextjs-vinext-eslint/.dockerignore +3 -0
  4. package/template-nextjs-vinext-eslint/.vscode/settings.json +53 -0
  5. package/template-nextjs-vinext-eslint/Dockerfile +21 -0
  6. package/template-nextjs-vinext-eslint/README.md +100 -0
  7. package/template-nextjs-vinext-eslint/commitlint.config.js +1 -0
  8. package/template-nextjs-vinext-eslint/docker-compose.yaml +22 -0
  9. package/template-nextjs-vinext-eslint/eslint.config.js +20 -0
  10. package/template-nextjs-vinext-eslint/lefthook.yml +11 -0
  11. package/template-nextjs-vinext-eslint/next.config.ts +8 -0
  12. package/template-nextjs-vinext-eslint/nginx.conf +14 -0
  13. package/template-nextjs-vinext-eslint/package.json +50 -0
  14. package/template-nextjs-vinext-eslint/pnpm-workspace.yaml +7 -0
  15. package/template-nextjs-vinext-eslint/public/file.svg +1 -0
  16. package/template-nextjs-vinext-eslint/public/globe.svg +1 -0
  17. package/template-nextjs-vinext-eslint/public/logo-white.svg +128 -0
  18. package/template-nextjs-vinext-eslint/public/next.svg +1 -0
  19. package/template-nextjs-vinext-eslint/public/vercel.svg +1 -0
  20. package/template-nextjs-vinext-eslint/public/window.svg +1 -0
  21. package/template-nextjs-vinext-eslint/src/app/_components/Header/header.module.css +0 -0
  22. package/template-nextjs-vinext-eslint/src/app/_components/Header/header.tsx +7 -0
  23. package/template-nextjs-vinext-eslint/src/app/_components/Main/index.tsx +13 -0
  24. package/template-nextjs-vinext-eslint/src/app/antd-provider.tsx +30 -0
  25. package/template-nextjs-vinext-eslint/src/app/icon.svg +26 -0
  26. package/template-nextjs-vinext-eslint/src/app/layout.tsx +68 -0
  27. package/template-nextjs-vinext-eslint/src/app/page.module.css +141 -0
  28. package/template-nextjs-vinext-eslint/src/app/page.tsx +43 -0
  29. package/template-nextjs-vinext-eslint/src/app/uno-css.tsx +7 -0
  30. package/template-nextjs-vinext-eslint/src/assets/icon/logo-white.svg +128 -0
  31. package/template-nextjs-vinext-eslint/src/assets/icon/logo.svg +26 -0
  32. package/template-nextjs-vinext-eslint/src/assets/image/QR.png +0 -0
  33. package/template-nextjs-vinext-eslint/src/assets/image/banner_1.png +0 -0
  34. package/template-nextjs-vinext-eslint/src/assets/image/banner_2.png +0 -0
  35. package/template-nextjs-vinext-eslint/src/assets/image/banner_3.png +0 -0
  36. package/template-nextjs-vinext-eslint/src/assets/image/banner_4.png +0 -0
  37. package/template-nextjs-vinext-eslint/src/assets/image/banner_top.png +0 -0
  38. package/template-nextjs-vinext-eslint/src/assets/image/icon_title_left.png +0 -0
  39. package/template-nextjs-vinext-eslint/src/assets/image/icon_title_right.png +0 -0
  40. package/template-nextjs-vinext-eslint/src/assets/image/img.png +0 -0
  41. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_COCT.png +0 -0
  42. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/207/347/247/221.png +0 -0
  43. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/205/264.png +0 -0
  44. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/206/266/345/273/272/345/267/245.png +0 -0
  45. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/344/270/255/351/223/201.png +0 -0
  46. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/344/272/224/345/206/266.png +0 -0
  47. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/344/272/244/351/200/232/345/273/272/350/256/276.png +0 -0
  48. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/345/273/272/344/270/232.png +0 -0
  49. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/345/273/272/347/255/221/347/247/221/345/255/246/351/231/242.png +0 -0
  50. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/347/224/265/345/273/272.png +0 -0
  51. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/351/223/201/345/273/272.png +0 -0
  52. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/345/256/234/351/200/232/344/270/226/347/272/252.png +0 -0
  53. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/346/225/260/347/273/264/347/251/272/351/227/264.png +0 -0
  54. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/346/226/260/346/230/212/350/276/260/345/273/272/350/256/276.png +0 -0
  55. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/346/236/227/345/220/214/346/243/252/345/233/275/351/231/205.png +0 -0
  56. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/346/270/235/351/232/206/351/233/206/345/233/242.png +0 -0
  57. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/347/273/264/345/241/224/347/247/221/346/212/200.png +0 -0
  58. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/350/205/276/350/256/257.png +0 -0
  59. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/350/265/233/350/277/252/344/277/241/346/201/257.png +0 -0
  60. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/344/272/244/351/200/232/345/244/247/345/255/246.png +0 -0
  61. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/344/272/244/351/200/232/350/201/214/344/270/232/345/255/246/351/231/242.png +0 -0
  62. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/345/244/247/345/255/246.png +0 -0
  63. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/345/267/245/345/225/206/350/201/214/344/270/232/345/255/246/351/231/242.png +0 -0
  64. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/345/267/245/347/250/213/350/201/214/344/270/232/346/212/200/346/234/257/345/255/246/351/231/242.png +0 -0
  65. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/345/273/272/345/267/245.png +0 -0
  66. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/230/277/351/207/214/344/272/221.png +0 -0
  67. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/231/206/345/206/233/345/206/233/345/214/273/345/244/247/345/255/246.png +0 -0
  68. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/276/231/346/271/226.png +0 -0
  69. package/template-nextjs-vinext-eslint/src/styles/globals.css +47 -0
  70. package/template-nextjs-vinext-eslint/src/types/vite-env.d.ts +18 -0
  71. package/template-nextjs-vinext-eslint/src/utils/env.ts +14 -0
  72. package/template-nextjs-vinext-eslint/src/utils/index.ts +0 -0
  73. package/template-nextjs-vinext-eslint/src/utils/request/core/index.ts +425 -0
  74. package/template-nextjs-vinext-eslint/src/utils/request/core/utils.ts +39 -0
  75. package/template-nextjs-vinext-eslint/src/utils/request/index.ts +48 -0
  76. package/template-nextjs-vinext-eslint/tsconfig.json +34 -0
  77. package/template-nextjs-vinext-eslint/uno.config.ts +8 -0
  78. package/template-nextjs-vinext-eslint/vite.config.ts +8 -0
  79. package/template-react-rsbuild-biome/.env +5 -0
  80. package/template-react-rsbuild-biome/.env.development +1 -0
  81. package/template-react-rsbuild-biome/.env.production +1 -0
  82. package/template-react-rsbuild-biome/.prettierignore +34 -0
  83. package/template-react-rsbuild-biome/.prettierrc +16 -0
  84. package/template-react-rsbuild-biome/.vscode/settings.json +10 -0
  85. package/template-react-rsbuild-biome/README.md +29 -0
  86. package/template-react-rsbuild-biome/biome.json +116 -0
  87. package/template-react-rsbuild-biome/commitlint.config.js +1 -0
  88. package/template-react-rsbuild-biome/index.html +7 -0
  89. package/template-react-rsbuild-biome/lefthook.yml +14 -0
  90. package/template-react-rsbuild-biome/package.json +42 -0
  91. package/template-react-rsbuild-biome/public/.gitkeep +0 -0
  92. package/template-react-rsbuild-biome/rsbuild.config.ts +44 -0
  93. package/template-react-rsbuild-biome/src/App.tsx +9 -0
  94. package/template-react-rsbuild-biome/src/assets/font/AlimamaShuHeiTi-Bold.ttf +0 -0
  95. package/template-react-rsbuild-biome/src/assets/icon/logo.svg +7 -0
  96. package/template-react-rsbuild-biome/src/components/Loading/PageLoading.tsx +11 -0
  97. package/template-react-rsbuild-biome/src/env.d.ts +1 -0
  98. package/template-react-rsbuild-biome/src/index.tsx +18 -0
  99. package/template-react-rsbuild-biome/src/layout/default/index.tsx +10 -0
  100. package/template-react-rsbuild-biome/src/pages/home/index.tsx +5 -0
  101. package/template-react-rsbuild-biome/src/router/index.tsx +38 -0
  102. package/template-react-rsbuild-biome/src/store/index.ts +0 -0
  103. package/template-react-rsbuild-biome/src/store/modules/user.ts +11 -0
  104. package/template-react-rsbuild-biome/src/styles/fonts.scss +4 -0
  105. package/template-react-rsbuild-biome/src/styles/index.scss +19 -0
  106. package/template-react-rsbuild-biome/src/styles/variables.scss +4 -0
  107. package/template-react-rsbuild-biome/src/types/auto-import.d.ts +49 -0
  108. package/template-react-rsbuild-biome/src/utils/env.ts +10 -0
  109. package/template-react-rsbuild-biome/src/utils/request/core/index.ts +425 -0
  110. package/template-react-rsbuild-biome/src/utils/request/core/utils.ts +39 -0
  111. package/template-react-rsbuild-biome/src/utils/request/index.ts +42 -0
  112. package/template-react-rsbuild-biome/tsconfig.json +35 -0
  113. package/template-react-rsbuild-biome/uno.config.ts +8 -0
  114. package/template-taro-react-oxc/.editorconfig +12 -0
  115. package/template-taro-react-oxc/.env +1 -0
  116. package/template-taro-react-oxc/.env.development +6 -0
  117. package/template-taro-react-oxc/.env.production +5 -0
  118. package/template-taro-react-oxc/.oxfmtrc.json +12 -0
  119. package/template-taro-react-oxc/.oxlintrc.json +9 -0
  120. package/template-taro-react-oxc/.vscode/settings.json +13 -0
  121. package/template-taro-react-oxc/babel.config.js +45 -0
  122. package/template-taro-react-oxc/commitlint.config.mjs +1 -0
  123. package/template-taro-react-oxc/config/dev.ts +10 -0
  124. package/template-taro-react-oxc/config/index.ts +172 -0
  125. package/template-taro-react-oxc/config/prod.ts +39 -0
  126. package/template-taro-react-oxc/config/release.ts +106 -0
  127. package/template-taro-react-oxc/key/.gitkeep +0 -0
  128. package/template-taro-react-oxc/lefthook.yaml +18 -0
  129. package/template-taro-react-oxc/package.json +118 -0
  130. package/template-taro-react-oxc/patches/@tarojs__plugin-mini-ci.patch +13 -0
  131. package/template-taro-react-oxc/pnpm-workspace.yaml +13 -0
  132. package/template-taro-react-oxc/postcss.config.js +6 -0
  133. package/template-taro-react-oxc/project.config.json +15 -0
  134. package/template-taro-react-oxc/src/app.config.ts +11 -0
  135. package/template-taro-react-oxc/src/app.ts +14 -0
  136. package/template-taro-react-oxc/src/index.html +17 -0
  137. package/template-taro-react-oxc/src/pages/index/index.config.ts +3 -0
  138. package/template-taro-react-oxc/src/pages/index/index.scss +0 -0
  139. package/template-taro-react-oxc/src/pages/index/index.tsx +44 -0
  140. package/template-taro-react-oxc/src/store/taroStorage.ts +7 -0
  141. package/template-taro-react-oxc/src/store/user.ts +13 -0
  142. package/template-taro-react-oxc/src/styles/index.css +1 -0
  143. package/template-taro-react-oxc/src/utils/env.ts +10 -0
  144. package/template-taro-react-oxc/src/utils/request/core/index.ts +425 -0
  145. package/template-taro-react-oxc/src/utils/request/core/utils.ts +39 -0
  146. package/template-taro-react-oxc/src/utils/request/index.ts +37 -0
  147. package/template-taro-react-oxc/stylelint.config.mjs +28 -0
  148. package/template-taro-react-oxc/tailwind.config.js +12 -0
  149. package/template-taro-react-oxc/tsconfig.json +28 -0
  150. package/template-taro-react-oxc/types/global.d.ts +29 -0
  151. package/template-taro-vue-eslint/.editorconfig +12 -0
  152. package/template-taro-vue-eslint/.env +3 -0
  153. package/template-taro-vue-eslint/.env.development +5 -0
  154. package/template-taro-vue-eslint/.env.production +5 -0
  155. package/template-taro-vue-eslint/.vscode/settings.json +57 -0
  156. package/template-taro-vue-eslint/babel.config.js +12 -0
  157. package/template-taro-vue-eslint/commitlint.config.mjs +1 -0
  158. package/template-taro-vue-eslint/config/dev.ts +27 -0
  159. package/template-taro-vue-eslint/config/index.ts +134 -0
  160. package/template-taro-vue-eslint/config/output-root.ts +11 -0
  161. package/template-taro-vue-eslint/config/prod.ts +39 -0
  162. package/template-taro-vue-eslint/config/release.ts +113 -0
  163. package/template-taro-vue-eslint/eslint.config.mjs +22 -0
  164. package/template-taro-vue-eslint/lefthook.yaml +13 -0
  165. package/template-taro-vue-eslint/package.json +115 -0
  166. package/template-taro-vue-eslint/patches/@tarojs__plugin-mini-ci.patch +13 -0
  167. package/template-taro-vue-eslint/pnpm-workspace.yaml +13 -0
  168. package/template-taro-vue-eslint/project.config.json +16 -0
  169. package/template-taro-vue-eslint/src/api/common/upload.ts +53 -0
  170. package/template-taro-vue-eslint/src/app.config.ts +19 -0
  171. package/template-taro-vue-eslint/src/app.ts +14 -0
  172. package/template-taro-vue-eslint/src/assets/image/.gitkeep +0 -0
  173. package/template-taro-vue-eslint/src/index.html +17 -0
  174. package/template-taro-vue-eslint/src/pages/example/upload/index.config.ts +3 -0
  175. package/template-taro-vue-eslint/src/pages/example/upload/index.module.scss +4 -0
  176. package/template-taro-vue-eslint/src/pages/example/upload/index.vue +71 -0
  177. package/template-taro-vue-eslint/src/pages/index/index.config.ts +3 -0
  178. package/template-taro-vue-eslint/src/pages/index/index.module.scss +4 -0
  179. package/template-taro-vue-eslint/src/pages/index/index.vue +77 -0
  180. package/template-taro-vue-eslint/src/store/index.ts +10 -0
  181. package/template-taro-vue-eslint/src/store/modules/user.ts +15 -0
  182. package/template-taro-vue-eslint/src/store/taroStorage.ts +7 -0
  183. package/template-taro-vue-eslint/src/styles/index.css +1 -0
  184. package/template-taro-vue-eslint/src/styles/nut-theme.css +4 -0
  185. package/template-taro-vue-eslint/src/utils/env.ts +13 -0
  186. package/template-taro-vue-eslint/src/utils/index.ts +40 -0
  187. package/template-taro-vue-eslint/src/utils/request/core/index.ts +425 -0
  188. package/template-taro-vue-eslint/src/utils/request/core/utils.ts +39 -0
  189. package/template-taro-vue-eslint/src/utils/request/index.ts +73 -0
  190. package/template-taro-vue-eslint/tsconfig.json +30 -0
  191. package/template-taro-vue-eslint/types/components.d.ts +16 -0
  192. package/template-taro-vue-eslint/types/global.d.ts +31 -0
  193. package/template-taro-vue-eslint/types/vue.d.ts +10 -0
  194. package/template-taro-vue-eslint/unocss.config.ts +42 -0
  195. package/template-vp-monorepo-react-nestjs/.oxfmtrc.jsonc +8 -0
  196. package/template-vp-monorepo-react-nestjs/.oxlintrc.jsonc +3 -0
  197. package/template-vp-monorepo-react-nestjs/.specs//351/234/200/346/261/202.md +5 -0
  198. package/template-vp-monorepo-react-nestjs/.vite-hooks/commit-msg +1 -0
  199. package/template-vp-monorepo-react-nestjs/.vite-hooks/pre-commit +1 -0
  200. package/template-vp-monorepo-react-nestjs/README.md +29 -0
  201. package/template-vp-monorepo-react-nestjs/apps/service/.oxlintrc.jsonc +3 -0
  202. package/template-vp-monorepo-react-nestjs/apps/web/.env +1 -0
  203. package/template-vp-monorepo-react-nestjs/apps/web/.oxlintrc.jsonc +4 -0
  204. package/template-vp-monorepo-react-nestjs/apps/web/index.html +13 -0
  205. package/template-vp-monorepo-react-nestjs/apps/web/package.json +39 -0
  206. package/template-vp-monorepo-react-nestjs/apps/web/public/favicon.svg +1 -0
  207. package/template-vp-monorepo-react-nestjs/apps/web/public/icons.svg +24 -0
  208. package/template-vp-monorepo-react-nestjs/apps/web/src/App.tsx +24 -0
  209. package/template-vp-monorepo-react-nestjs/apps/web/src/assets/hero.png +0 -0
  210. package/template-vp-monorepo-react-nestjs/apps/web/src/assets/react.svg +1 -0
  211. package/template-vp-monorepo-react-nestjs/apps/web/src/assets/vite.svg +1 -0
  212. package/template-vp-monorepo-react-nestjs/apps/web/src/components/Loading/PageLoading.tsx +11 -0
  213. package/template-vp-monorepo-react-nestjs/apps/web/src/main.tsx +5 -0
  214. package/template-vp-monorepo-react-nestjs/apps/web/src/pages/home/index.tsx +17 -0
  215. package/template-vp-monorepo-react-nestjs/apps/web/src/router/index.tsx +25 -0
  216. package/template-vp-monorepo-react-nestjs/apps/web/src/router/modules/.gitkeep +0 -0
  217. package/template-vp-monorepo-react-nestjs/apps/web/src/styles/index.css +7 -0
  218. package/template-vp-monorepo-react-nestjs/apps/web/src/types/auto-imports.d.ts +58 -0
  219. package/template-vp-monorepo-react-nestjs/apps/web/tsconfig.json +32 -0
  220. package/template-vp-monorepo-react-nestjs/apps/web/vite.config.ts +32 -0
  221. package/template-vp-monorepo-react-nestjs/commitlint.config.js +0 -0
  222. package/template-vp-monorepo-react-nestjs/package.json +20 -0
  223. package/template-vp-monorepo-react-nestjs/packages/utils/README.md +23 -0
  224. package/template-vp-monorepo-react-nestjs/packages/utils/package.json +39 -0
  225. package/template-vp-monorepo-react-nestjs/packages/utils/src/index.ts +3 -0
  226. package/template-vp-monorepo-react-nestjs/packages/utils/tests/index.test.ts +6 -0
  227. package/template-vp-monorepo-react-nestjs/packages/utils/tsconfig.json +20 -0
  228. package/template-vp-monorepo-react-nestjs/packages/utils/tsdown.config.ts +9 -0
  229. package/template-vp-monorepo-react-nestjs/packages/utils/vite.config.ts +7 -0
  230. package/template-vp-monorepo-react-nestjs/pnpm-workspace.yaml +23 -0
  231. package/template-vp-monorepo-react-nestjs/tsconfig.json +9 -0
  232. package/template-vp-monorepo-react-nestjs/vite.config.ts +8 -0
  233. package/template-vp-react/.env +1 -0
  234. package/template-vp-react/.oxfmtrc.jsonc +8 -0
  235. package/template-vp-react/.oxlintrc.jsonc +11 -0
  236. package/template-vp-react/.vite-hooks/commit-msg +1 -0
  237. package/template-vp-react/.vite-hooks/pre-commit +1 -0
  238. package/template-vp-react/.vscode/extensions.json +3 -0
  239. package/template-vp-react/.vscode/settings.json +11 -0
  240. package/template-vp-react/commitlint.config.js +0 -0
  241. package/template-vp-react/index.html +13 -0
  242. package/template-vp-react/package.json +44 -0
  243. package/template-vp-react/public/favicon.svg +1 -0
  244. package/template-vp-react/public/icons.svg +24 -0
  245. package/template-vp-react/src/App.tsx +24 -0
  246. package/template-vp-react/src/assets/hero.png +0 -0
  247. package/template-vp-react/src/assets/react.svg +1 -0
  248. package/template-vp-react/src/assets/vite.svg +1 -0
  249. package/template-vp-react/src/components/Loading/PageLoading.tsx +11 -0
  250. package/template-vp-react/src/main.tsx +5 -0
  251. package/template-vp-react/src/pages/home/index.tsx +17 -0
  252. package/template-vp-react/src/router/index.tsx +25 -0
  253. package/template-vp-react/src/router/modules/.gitkeep +0 -0
  254. package/template-vp-react/src/styles/index.css +7 -0
  255. package/template-vp-react/src/types/auto-imports.d.ts +58 -0
  256. package/template-vp-react/src/utils/env/index.ts +6 -0
  257. package/template-vp-react/src/utils/request/core/index.ts +420 -0
  258. package/template-vp-react/src/utils/request/core/utils.ts +39 -0
  259. package/template-vp-react/src/utils/request/index.ts +48 -0
  260. package/template-vp-react/tsconfig.json +32 -0
  261. package/template-vp-react/vite.config.ts +35 -0
  262. package/template-vp-react-shadcn/.agents/skills/alova-client-usage/README.md +28 -0
  263. package/template-vp-react-shadcn/.agents/skills/alova-client-usage/SKILL.md +249 -0
  264. package/template-vp-react-shadcn/.agents/skills/alova-client-usage/references/SETUP.md +146 -0
  265. package/template-vp-react-shadcn/.agents/skills/shadcn/SKILL.md +260 -0
  266. package/template-vp-react-shadcn/.agents/skills/shadcn/agents/openai.yml +5 -0
  267. package/template-vp-react-shadcn/.agents/skills/shadcn/assets/shadcn-small.png +0 -0
  268. package/template-vp-react-shadcn/.agents/skills/shadcn/assets/shadcn.png +0 -0
  269. package/template-vp-react-shadcn/.agents/skills/shadcn/cli.md +276 -0
  270. package/template-vp-react-shadcn/.agents/skills/shadcn/customization.md +209 -0
  271. package/template-vp-react-shadcn/.agents/skills/shadcn/evals/evals.json +47 -0
  272. package/template-vp-react-shadcn/.agents/skills/shadcn/mcp.md +94 -0
  273. package/template-vp-react-shadcn/.agents/skills/shadcn/rules/base-vs-radix.md +306 -0
  274. package/template-vp-react-shadcn/.agents/skills/shadcn/rules/composition.md +195 -0
  275. package/template-vp-react-shadcn/.agents/skills/shadcn/rules/forms.md +192 -0
  276. package/template-vp-react-shadcn/.agents/skills/shadcn/rules/icons.md +101 -0
  277. package/template-vp-react-shadcn/.agents/skills/shadcn/rules/styling.md +162 -0
  278. package/template-vp-react-shadcn/.agents/skills/vite-plus/README.md +75 -0
  279. package/template-vp-react-shadcn/.agents/skills/vite-plus/SKILL.md +322 -0
  280. package/template-vp-react-shadcn/.agents/skills/vite-plus/evals.json +182 -0
  281. package/template-vp-react-shadcn/.agents/skills/vite-plus/references/config.md +162 -0
  282. package/template-vp-react-shadcn/.agents/skills/vite-plus/references/env-management.md +76 -0
  283. package/template-vp-react-shadcn/.agents/skills/vite-plus/references/task-runner.md +152 -0
  284. package/template-vp-react-shadcn/.agents/skills/vite-plus/sources.yaml +142 -0
  285. package/template-vp-react-shadcn/.env +1 -0
  286. package/template-vp-react-shadcn/.oxfmtrc.jsonc +8 -0
  287. package/template-vp-react-shadcn/.oxlintrc.jsonc +3 -0
  288. package/template-vp-react-shadcn/.vite-hooks/commit-msg +1 -0
  289. package/template-vp-react-shadcn/.vite-hooks/pre-commit +1 -0
  290. package/template-vp-react-shadcn/.vscode/extensions.json +3 -0
  291. package/template-vp-react-shadcn/.vscode/settings.json +12 -0
  292. package/template-vp-react-shadcn/agents.md +44 -0
  293. package/template-vp-react-shadcn/commitlint.config.js +1 -0
  294. package/template-vp-react-shadcn/components.json +25 -0
  295. package/template-vp-react-shadcn/index.html +13 -0
  296. package/template-vp-react-shadcn/package.json +56 -0
  297. package/template-vp-react-shadcn/public/favicon.svg +1 -0
  298. package/template-vp-react-shadcn/public/icons.svg +24 -0
  299. package/template-vp-react-shadcn/skills-lock.json +11 -0
  300. package/template-vp-react-shadcn/src/App.tsx +24 -0
  301. package/template-vp-react-shadcn/src/api/.gitkeep +0 -0
  302. package/template-vp-react-shadcn/src/assets/hero.png +0 -0
  303. package/template-vp-react-shadcn/src/assets/react.svg +1 -0
  304. package/template-vp-react-shadcn/src/assets/vite.svg +1 -0
  305. package/template-vp-react-shadcn/src/components/Loading/PageLoading.tsx +11 -0
  306. package/template-vp-react-shadcn/src/components/Player/VideoJS/index.tsx +163 -0
  307. package/template-vp-react-shadcn/src/components/Player/index.ts +7 -0
  308. package/template-vp-react-shadcn/src/components/ui/button.tsx +67 -0
  309. package/template-vp-react-shadcn/src/components/ui/sonner.tsx +43 -0
  310. package/template-vp-react-shadcn/src/components/ui/spinner.tsx +17 -0
  311. package/template-vp-react-shadcn/src/hooks/.gitkeep +0 -0
  312. package/template-vp-react-shadcn/src/lib/utils.ts +6 -0
  313. package/template-vp-react-shadcn/src/main.tsx +5 -0
  314. package/template-vp-react-shadcn/src/pages/home/index.tsx +96 -0
  315. package/template-vp-react-shadcn/src/router/index.tsx +25 -0
  316. package/template-vp-react-shadcn/src/router/modules/.gitkeep +0 -0
  317. package/template-vp-react-shadcn/src/store/.gitkeep +0 -0
  318. package/template-vp-react-shadcn/src/styles/index.css +16 -0
  319. package/template-vp-react-shadcn/src/styles/shadcn.css +127 -0
  320. package/template-vp-react-shadcn/src/types/auto-imports.d.ts +58 -0
  321. package/template-vp-react-shadcn/src/utils/env/index.tsx +6 -0
  322. package/template-vp-react-shadcn/src/utils/request/alova-core/index.ts +425 -0
  323. package/template-vp-react-shadcn/src/utils/request/alova-core/utils.ts +39 -0
  324. package/template-vp-react-shadcn/src/utils/request/index.ts +48 -0
  325. package/template-vp-react-shadcn/src/utils/request/readme.md +176 -0
  326. package/template-vp-react-shadcn/tsconfig.json +32 -0
  327. package/template-vp-react-shadcn/vite.config.ts +35 -0
  328. package/template-vue-vite-eslint/.env +6 -0
  329. package/template-vue-vite-eslint/.env.development +2 -0
  330. package/template-vue-vite-eslint/.env.production +1 -0
  331. package/template-vue-vite-eslint/README.md +3 -0
  332. package/template-vue-vite-eslint/commitlint.config.js +1 -0
  333. package/template-vue-vite-eslint/eslint.config.js +69 -0
  334. package/template-vue-vite-eslint/index.html +13 -0
  335. package/template-vue-vite-eslint/lefthook.yml +11 -0
  336. package/template-vue-vite-eslint/package.json +56 -0
  337. package/template-vue-vite-eslint/public/vite.svg +1 -0
  338. package/template-vue-vite-eslint/src/App.vue +19 -0
  339. package/template-vue-vite-eslint/src/api/index.ts +12 -0
  340. package/template-vue-vite-eslint/src/assets/icon/computer-data.svg +3 -0
  341. package/template-vue-vite-eslint/src/assets/icon/cpu.svg +3 -0
  342. package/template-vue-vite-eslint/src/assets/icon/data-search.svg +3 -0
  343. package/template-vue-vite-eslint/src/assets/icon/home.svg +3 -0
  344. package/template-vue-vite-eslint/src/assets/icon/knowledge-graph.svg +3 -0
  345. package/template-vue-vite-eslint/src/assets/icon/logo.svg +1 -0
  346. package/template-vue-vite-eslint/src/assets/icon/robot.svg +3 -0
  347. package/template-vue-vite-eslint/src/assets/image/.gitkeep +0 -0
  348. package/template-vue-vite-eslint/src/components/Icon/svg-icon.vue +29 -0
  349. package/template-vue-vite-eslint/src/hooks/chart/lib.ts +57 -0
  350. package/template-vue-vite-eslint/src/hooks/chart/useEcharts.ts +65 -0
  351. package/template-vue-vite-eslint/src/layout/default/header/index.vue +12 -0
  352. package/template-vue-vite-eslint/src/layout/default/index.vue +55 -0
  353. package/template-vue-vite-eslint/src/main.ts +16 -0
  354. package/template-vue-vite-eslint/src/router/guard/index.ts +7 -0
  355. package/template-vue-vite-eslint/src/router/guard/permissionGuard.ts +13 -0
  356. package/template-vue-vite-eslint/src/router/index.ts +18 -0
  357. package/template-vue-vite-eslint/src/router/interface.ts +9 -0
  358. package/template-vue-vite-eslint/src/router/modules/example.ts +21 -0
  359. package/template-vue-vite-eslint/src/router/modules/index.ts +36 -0
  360. package/template-vue-vite-eslint/src/store/index.ts +11 -0
  361. package/template-vue-vite-eslint/src/store/modules/user.ts +20 -0
  362. package/template-vue-vite-eslint/src/styles/font.scss +0 -0
  363. package/template-vue-vite-eslint/src/styles/index.scss +29 -0
  364. package/template-vue-vite-eslint/src/styles/variables.scss +3 -0
  365. package/template-vue-vite-eslint/src/types/auto-import.d.ts +78 -0
  366. package/template-vue-vite-eslint/src/types/components.d.ts +18 -0
  367. package/template-vue-vite-eslint/src/types/vite-env.d.ts +15 -0
  368. package/template-vue-vite-eslint/src/utils/env.ts +11 -0
  369. package/template-vue-vite-eslint/src/utils/request/core/index.ts +425 -0
  370. package/template-vue-vite-eslint/src/utils/request/core/utils.ts +39 -0
  371. package/template-vue-vite-eslint/src/utils/request/index.ts +42 -0
  372. package/template-vue-vite-eslint/src/views/example/echart/config.ts +1794 -0
  373. package/template-vue-vite-eslint/src/views/example/echart/index.vue +22 -0
  374. package/template-vue-vite-eslint/src/views/example/h-full.vue +24 -0
  375. package/template-vue-vite-eslint/src/views/example/tree-chart.vue +94 -0
  376. package/template-vue-vite-eslint/src/views/home/index.vue +25 -0
  377. package/template-vue-vite-eslint/src/views/login/index.vue +9 -0
  378. package/template-vue-vite-eslint/tsconfig.json +36 -0
  379. package/template-vue-vite-eslint/uno.config.ts +21 -0
  380. package/template-vue-vite-eslint/vite.config.ts +60 -0
package/dist/index.js CHANGED
@@ -1,4 +1,36 @@
1
- import e from"node:fs";import t from"node:path";import{fileURLToPath as n}from"node:url";import*as r from"@clack/prompts";import i from"cross-spawn";import a from"gradient-string";import o from"mri";const s={vue:a([`#42B883`,`#42B883`]),react:a([`#087EA4`,`#087EA4`]),taro:a([`#0000C2`,`#fff`]),nextjs:a([`#000`,`#fff`]),others:a([`#8B5CF6`,`#A855F7`])},c=o(process.argv.slice(2),{alias:{h:`help`,t:`template`},boolean:[`help`,`overwrite`],string:[`template`]}),l=process.cwd(),u=`\
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import * as prompts from "@clack/prompts";
5
+ import spawn from "cross-spawn";
6
+ import gradient from "gradient-string";
7
+ import mri from "mri";
8
+
9
+ //#region src/index.ts
10
+ const colorMap = {
11
+ vue: gradient(["#42B883", "#42B883"]),
12
+ react: gradient(["#087EA4", "#087EA4"]),
13
+ taro: gradient(["#0000C2", "#fff"]),
14
+ nextjs: gradient(["#000", "#fff"]),
15
+ others: gradient(["#8B5CF6", "#A855F7"])
16
+ };
17
+ /**
18
+ * process.argv 是 node index.js 前两个参数
19
+ * 第一个参数是 node 可执行文件的路径
20
+ * 第二个参数是当前执行的脚本文件的路径
21
+ * 虽然最终使用的是 pnpm create bubbles 但最后都会指向bin 执行 node index.js
22
+ */
23
+ const argv = mri(process.argv.slice(2), {
24
+ alias: {
25
+ h: "help",
26
+ t: "template"
27
+ },
28
+ boolean: ["help", "overwrite"],
29
+ string: ["template"]
30
+ });
31
+ /** 执行命令的绝对路径 代指执行命令的地方 */
32
+ const cwd = process.cwd();
33
+ const helpMessage = `\
2
34
  Usage: create-bubbles [OPTION]... [DIRECTORY]
3
35
 
4
36
  Create a new Bubbles project in JavaScript or TypeScript.
@@ -8,13 +40,376 @@ Options:
8
40
  -t, --template NAME use a specific template
9
41
 
10
42
  Available templates:
11
- ${s.vue(`vue-vite-eslint vue`)}
12
- ${s.react(`react-rsbuild-biome react`)}
13
- ${s.react(`vp-react react`)}
14
- ${s.react(`vp-react-shadcn react`)}
15
- ${s.react(`vp-monorepo-react-nestjs react`)}
16
- ${s.taro(`taro-vue-eslint taro`)}
17
- ${s.nextjs(`nextjs-vinext-eslint nextjs`)}`,d=e=>e.trim().replace(/\/+$/g,``),f=e=>{if(!e)return;let t=e.split(` `)[0].split(`/`);return{name:t[0],version:t[1]}},p=t=>{let n=e.readdirSync(t);return n.length===0||n.length===1&&n[0]===`.git`},m=async n=>{await Promise.all(e.readdirSync(n).filter(e=>e!==`.git`).map(r=>e.promises.rm(t.resolve(n,r),{recursive:!0,force:!0})))},h=e=>/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e),g=e=>e.trim().toLowerCase().replace(/\s+/g,`-`).replace(/^[._]/,``).replace(/[^a-z\d\-~]+g/,`-`),_=[{name:`vue`,display:`Vue`,color:s.vue,variants:[{name:`vue-vite-eslint`,display:`vite + eslint`,color:s.vue}]},{name:`react`,display:`React`,color:s.react,variants:[{name:`react-rsbuild-biome`,display:`rsbuild-biome`,color:s.react},{name:`vp-react`,display:`vp-react`,color:s.react},{name:`vp-react-shadcn`,display:`vp-react-shadcn`,color:s.react},{name:`vp-monorepo-react-nestjs`,display:`vp-monorepo-react-nestjs`,color:s.react}]},{name:`taro`,display:`Taro`,color:s.taro,variants:[{name:`taro-vue-eslint`,display:`taro-vue + eslint`,color:s.taro},{name:`taro-react-oxc`,display:`taro-react + oxc`,color:s.taro}]},{name:`nextjs`,display:`NextJS`,color:s.nextjs,variants:[{name:`nextjs-vinext-eslint`,display:`nextjs + vinext + eslint`,color:s.nextjs}]},{name:`others`,display:`Others`,color:s.others,variants:[{name:`create-eletron-vite`,display:`Electron ↗`,color:s.others,customCommand:`pnpm create electron-vite@latest TARGET_DIR`}]}],v=_.map(e=>e.variants.map(e=>`${e.name}`)).reduce((e,t)=>e.concat(t),[]),y=(e,t)=>{console.log(`💦customCommand`,e,t);let n=t?t.name:`npm`,r=n===`yarn`&&t?.version.startsWith(`1.`);return e.replace(/^npm create (?:-- )?/,()=>n===`bun`?`bun x create-`:n===`pnpm`?`pnpm create `:e.startsWith(`npm create -- `)?`${n} create -- `:`${n} create `).replace(`@latest`,()=>r?``:`@latest`).replace(/^npm exec/,()=>n===`pnpm`?`pnpm dlx`:n===`yarn`&&!r?`yarn dlx`:n===`bun`?`bun x`:`npm exec`)},b={_gitignore:`.gitignore`},x=(n,r)=>{e.mkdirSync(r,{recursive:!0});for(let i of e.readdirSync(n))S(t.resolve(n,i),t.resolve(r,i))},S=(t,n)=>{e.statSync(t).isDirectory()?x(t,n):e.copyFileSync(t,n)},C=(t,n)=>{let r=e.readFileSync(t,`utf-8`);e.writeFileSync(t,n(r),`utf-8`)},w=(e,n)=>{C(t.resolve(e,`package.json`),e=>e.replace(/"@vitejs\/plugin-react": ".+?"/,`"@vitejs/plugin-react-swc": "^4.0.1"`)),C(t.resolve(e,`vite.config.${n?`ts`:`js`}`),e=>e.replace(`@vitejs/plugin-react`,`@vitejs/plugin-react-swc`))};(async()=>{console.log(c);let o=c._[0]?d(c._[0]):void 0,x=c.template,C=c.overwrite,T=`bubbles-project`;if(c.help){console.log(u);return}let E=f(process.env.npm_config_user_agent),D=()=>r.cancel(`Operation cancelled`),O=o;if(!O){let e=await r.text({message:`Project name`,defaultValue:T,placeholder:T,validate:e=>e.length===0||d(e).length>0?void 0:`Invalid project name`});if(r.isCancel(e))return D();O=d(e)}if(e.existsSync(O)&&!p(O)){let e=C?`yes`:await r.select({message:O===`.`?`Current directory`:`Target directory "${O}" is not empty. Please choose how to proceed:`,options:[{label:`${s.vue(`Cancel operation`)}`,value:`no`},{label:`Remove existing files and continue`,value:`yes`},{label:`Ignore files and continue`,value:`ignore`}]});if(r.isCancel(e))return D();switch(e){case`yes`:m(O);break;case`no`:D();return}}let k=t.basename(t.resolve(O));if(!h(k)){let e=await r.text({message:`Package name is invalid. please input again:`,defaultValue:g(k),placeholder:g(k),validate(e){if(!h(e))return`Invalid package.json name`}});if(r.isCancel(e))return D();k=e}let A=x,j=!1;if(x&&!v.includes(x)&&(A=void 0,j=!0),!A){let e=await r.select({message:j?`"${x}" isn't a valia template. please choose from below:`:`Select a framework`,options:_.map(e=>{let t=e.color;return{label:t(e.display),value:e}})});if(r.isCancel(e))return D();console.log(`💦pkgInfo`,E);let t=await r.select({message:`Select a variant:`,options:e.variants.map(e=>{let t=e.color,n=e.customCommand?y(e.customCommand,E).replace(/ TARGET_DIR$/,``):void 0;return{label:t(e.display||e.name),value:e.name,hint:n}})});if(r.isCancel(t))return D();A=t}let M=t.join(l,O);e.mkdirSync(M,{recursive:!0});let N=!1;A.includes(`-swc`)&&(N=!0,A=A.replace(`-swc`,``));let P=E?E.name:`npm`,{customCommand:F}=_.flatMap(e=>e.variants).find(e=>e.name===A)??{};if(F){let[e,...t]=y(F,E).split(` `),n=t.map(e=>e.replace(`TARGET_DIR`,()=>O));console.log(`💦replacedArgs`,n);let{status:r}=i.sync(e,n,{stdio:`inherit`});process.exit(r??0)}r.log.step(`scaffolding project in ${M}...`);let I=t.resolve(n(import.meta.url),`../..`,`template-${A}`),L=(n,r)=>{let i=t.join(M,b[n]??n);r?e.writeFileSync(i,r):S(t.join(I,n),i)},R=e.readdirSync(I);for(let e of R)e!==`package.json`&&L(e);let z=JSON.parse(e.readFileSync(t.join(I,`package.json`),`utf-8`));z.name=k,L(`package.json`,`${JSON.stringify(z,null,2)}\n`),N&&w(M,A.endsWith(`-ts`));let B=``,V=t.relative(l,M);switch(console.log(`💦cwd`,l),console.log(`💦root`,M),console.log(`💦cdProjectName`,V),B+=`Done. Now run:
18
- `,M!==l&&(B+=`\n cd ${V.includes(` `)?`"${V}"`:V} `),P){case`yarn`:B+=`
19
- yarn`,B+=`
20
- yarn dev`;break;default:B+=a([`pink`,`white`])(`\n ${P} install`),B+=a([`pink`,`white`])(`\n ${P} run dev`);break}r.outro(B)})().catch(e=>{console.error(`💦`,e)});export{};
43
+ ${colorMap.vue("vue-vite-eslint vue")}
44
+ ${colorMap.react("react-rsbuild-biome react")}
45
+ ${colorMap.react("vp-react react")}
46
+ ${colorMap.react("vp-react-shadcn react")}
47
+ ${colorMap.react("vp-monorepo-react-nestjs react")}
48
+ ${colorMap.taro("taro-vue-eslint taro")}
49
+ ${colorMap.nextjs("nextjs-vinext-eslint nextjs")}`;
50
+ /**
51
+ * 去除空格并且替换掉末尾一个或者多个“/”
52
+ * @param targetDir
53
+ * @returns
54
+ */
55
+ const formatTargetDir = (targetDir) => {
56
+ return targetDir.trim().replace(/\/+$/g, "");
57
+ };
58
+ const pkgFromUserAgent = (userAgent) => {
59
+ if (!userAgent) return;
60
+ const pkgSpecArr = userAgent.split(" ")[0].split("/");
61
+ return {
62
+ name: pkgSpecArr[0],
63
+ version: pkgSpecArr[1]
64
+ };
65
+ };
66
+ /**
67
+ * 要么没有文件要么只有一个.git 文件夹
68
+ * @param path
69
+ * @returns
70
+ */
71
+ const isEmpty = (path) => {
72
+ const files = fs.readdirSync(path);
73
+ return files.length === 0 || files.length === 1 && files[0] === ".git";
74
+ };
75
+ const emptyDir = async (dir) => {
76
+ await Promise.all(fs.readdirSync(dir).filter((file) => file !== ".git").map((file) => fs.promises.rm(path.resolve(dir, file), {
77
+ recursive: true,
78
+ force: true
79
+ })));
80
+ };
81
+ /**
82
+ * 验证包名是否满足以 @ - * ~ 字母 数字 开头 并且
83
+ * 第一个?: 代表非捕获模式 第二个代表 可有可无
84
+ * @scope/abc abc
85
+ * (?:@[a-z\d\-*~][a-z\d\-*._~]*\/)? => 匹配 @scope/
86
+ * [a-z\d\-~][a-z\d\-._~]* 匹配 / 后面
87
+ *
88
+ * @param packageName
89
+ * @returns
90
+ */
91
+ const isValidPackageName = (packageName) => {
92
+ return /^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(packageName);
93
+ };
94
+ /**
95
+ * 把不合法的包名元素替换掉
96
+ * @param packageName
97
+ * @returns
98
+ */
99
+ const toValidPackageName = (packageName) => {
100
+ return packageName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z\d\-~]+g/, "-");
101
+ };
102
+ const FRAMEWORKS = [
103
+ {
104
+ name: "vue",
105
+ display: "Vue",
106
+ color: colorMap.vue,
107
+ variants: [{
108
+ name: "vue-vite-eslint",
109
+ display: "vite + eslint",
110
+ color: colorMap.vue
111
+ }]
112
+ },
113
+ {
114
+ name: "react",
115
+ display: "React",
116
+ color: colorMap.react,
117
+ variants: [
118
+ {
119
+ name: "react-rsbuild-biome",
120
+ display: "rsbuild-biome",
121
+ color: colorMap.react
122
+ },
123
+ {
124
+ name: "vp-react",
125
+ display: "vp-react",
126
+ color: colorMap.react
127
+ },
128
+ {
129
+ name: "vp-react-shadcn",
130
+ display: "vp-react-shadcn",
131
+ color: colorMap.react
132
+ },
133
+ {
134
+ name: "vp-monorepo-react-nestjs",
135
+ display: "vp-monorepo-react-nestjs",
136
+ color: colorMap.react
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ name: "taro",
142
+ display: "Taro",
143
+ color: colorMap.taro,
144
+ variants: [{
145
+ name: "taro-vue-eslint",
146
+ display: "taro-vue + eslint",
147
+ color: colorMap.taro
148
+ }, {
149
+ name: "taro-react-oxc",
150
+ display: "taro-react + oxc",
151
+ color: colorMap.taro
152
+ }]
153
+ },
154
+ {
155
+ name: "nextjs",
156
+ display: "NextJS",
157
+ color: colorMap.nextjs,
158
+ variants: [{
159
+ name: "nextjs-vinext-eslint",
160
+ display: "nextjs + vinext + eslint",
161
+ color: colorMap.nextjs
162
+ }]
163
+ },
164
+ {
165
+ name: "others",
166
+ display: "Others",
167
+ color: colorMap.others,
168
+ variants: [{
169
+ name: "create-eletron-vite",
170
+ display: "Electron ↗",
171
+ color: colorMap.others,
172
+ customCommand: "pnpm create electron-vite@latest TARGET_DIR"
173
+ }]
174
+ }
175
+ ];
176
+ const TEMPLATES = FRAMEWORKS.map((f) => f.variants.map((v) => `${v.name}`)).reduce((a, b) => a.concat(b), []);
177
+ /**
178
+ *
179
+ * @param customCommand
180
+ * @param pkgInfo { name: 'pnpm', version: '10.0.0' }
181
+ * @returns
182
+ */
183
+ const getFullCustomCommand = (customCommand, pkgInfo) => {
184
+ console.log("💦customCommand", customCommand, pkgInfo);
185
+ const pkgManager = pkgInfo ? pkgInfo.name : "npm";
186
+ const isYarn1 = pkgManager === "yarn" && pkgInfo?.version.startsWith("1.");
187
+ return customCommand.replace(/^npm create (?:-- )?/, () => {
188
+ if (pkgManager === "bun") return "bun x create-";
189
+ if (pkgManager === "pnpm") return "pnpm create ";
190
+ /** 这里的 -- 时参数分隔符 前面的给 npm create 后面的 给 create-vite 这个脚手架 */
191
+ return customCommand.startsWith("npm create -- ") ? `${pkgManager} create -- ` : `${pkgManager} create `;
192
+ }).replace("@latest", () => isYarn1 ? "" : "@latest").replace(/^npm exec/, () => {
193
+ if (pkgManager === "pnpm") return "pnpm dlx";
194
+ if (pkgManager === "yarn" && !isYarn1) return "yarn dlx";
195
+ if (pkgManager === "bun") return "bun x";
196
+ return "npm exec";
197
+ });
198
+ };
199
+ /**
200
+ * 历史遗留问题 npmjs 会把.gitignore 忽略掉,于是vite官方把.g
201
+ */
202
+ const renameFiles = { _gitignore: ".gitignore" };
203
+ const copyDir = (srcDir, destDir) => {
204
+ fs.mkdirSync(destDir, { recursive: true });
205
+ for (const file of fs.readdirSync(srcDir)) copy(path.resolve(srcDir, file), path.resolve(destDir, file));
206
+ };
207
+ const copy = (src, dest) => {
208
+ if (fs.statSync(src).isDirectory()) copyDir(src, dest);
209
+ else fs.copyFileSync(src, dest);
210
+ };
211
+ /**
212
+ * 修改文件内容
213
+ * @param file 文件路径
214
+ * @param callback 修改内容的回调 参数是当前内容
215
+ */
216
+ const editFile = (file, callback) => {
217
+ const content = fs.readFileSync(file, "utf-8");
218
+ fs.writeFileSync(file, callback(content), "utf-8");
219
+ };
220
+ /**
221
+ * 对 react swc 的处理 就是将plugin-react 换成 plugin-react-swc
222
+ * @param src 源目录
223
+ * @param dest 目标目录
224
+ */
225
+ const setupReactSwc = (root, isTs) => {
226
+ const reactSwcPluginVersion = "4.0.1";
227
+ editFile(path.resolve(root, "package.json"), (content) => {
228
+ return content.replace(/"@vitejs\/plugin-react": ".+?"/, `"@vitejs/plugin-react-swc": "^${reactSwcPluginVersion}"`);
229
+ });
230
+ editFile(path.resolve(root, `vite.config.${isTs ? "ts" : "js"}`), (content) => content.replace("@vitejs/plugin-react", "@vitejs/plugin-react-swc"));
231
+ };
232
+ const init = async () => {
233
+ console.log(argv);
234
+ /**
235
+ * 取的是那些没有 --key value的参数 这里代指模板
236
+ * bun index.js template-vue -t vue -s 12321 template-react
237
+ * {
238
+ * _: [ "template-vue", "template-react" ],
239
+ * t: "vue",
240
+ * s: 12321,
241
+ * template: "vue",
242
+ * }
243
+ */
244
+ const argTargetDir = argv._[0] ? formatTargetDir(argv._[0]) : void 0;
245
+ const argTemplate = argv.template;
246
+ const argOverwrite = argv.overwrite;
247
+ const defaultTargetDir = "bubbles-project";
248
+ if (argv.help) {
249
+ console.log(helpMessage);
250
+ return;
251
+ }
252
+ /**
253
+ * 获取用户执行命令的包管理工具的详细信息 包含 name 和 版本
254
+ *
255
+ * - bun x node packages/create-bubbles-tsdown/index.js
256
+ * - pnpm exec node packages/create-bubbles-tsdown/index.js
257
+ * - 或 npm exec node packages/create-bubbles-tsdown/index.js
258
+ */
259
+ const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
260
+ const cancel = () => prompts.cancel("Operation cancelled");
261
+ /** 项目名 */
262
+ let targetDir = argTargetDir;
263
+ if (!targetDir) {
264
+ const projectName = await prompts.text({
265
+ message: "Project name",
266
+ defaultValue: defaultTargetDir,
267
+ placeholder: defaultTargetDir,
268
+ validate: (value) => {
269
+ return (value || []).length === 0 || formatTargetDir(value || "").length > 0 ? void 0 : "Invalid project name";
270
+ }
271
+ });
272
+ if (prompts.isCancel(projectName)) return cancel();
273
+ targetDir = formatTargetDir(projectName);
274
+ }
275
+ if (fs.existsSync(targetDir) && !isEmpty(targetDir)) {
276
+ const overwrite = argOverwrite ? "yes" : await prompts.select({
277
+ message: targetDir === "." ? "Current directory" : `Target directory "${targetDir}" is not empty. Please choose how to proceed:`,
278
+ options: [
279
+ {
280
+ label: `${colorMap.vue("Cancel operation")}`,
281
+ value: "no"
282
+ },
283
+ {
284
+ label: "Remove existing files and continue",
285
+ value: "yes"
286
+ },
287
+ {
288
+ label: "Ignore files and continue",
289
+ value: "ignore"
290
+ }
291
+ ]
292
+ });
293
+ if (prompts.isCancel(overwrite)) return cancel();
294
+ switch (overwrite) {
295
+ case "yes":
296
+ emptyDir(targetDir);
297
+ break;
298
+ case "no":
299
+ cancel();
300
+ return;
301
+ }
302
+ }
303
+ /** 提取绝对路径最后的path 与 targetDir 不同 因为 targetDir 可以输入 xxx/xxx */
304
+ let packageName = path.basename(path.resolve(targetDir));
305
+ if (!isValidPackageName(packageName)) {
306
+ const packageNameResult = await prompts.text({
307
+ message: "Package name is invalid. please input again:",
308
+ defaultValue: toValidPackageName(packageName),
309
+ placeholder: toValidPackageName(packageName),
310
+ validate(dir) {
311
+ if (!isValidPackageName(dir)) return "Invalid package.json name";
312
+ }
313
+ });
314
+ if (prompts.isCancel(packageNameResult)) return cancel();
315
+ packageName = packageNameResult;
316
+ }
317
+ let template = argTemplate;
318
+ let hasInvalidArgTemplate = false;
319
+ /** 输入的-t 模板不能存在 */
320
+ if (argTemplate && !TEMPLATES.includes(argTemplate)) {
321
+ template = void 0;
322
+ hasInvalidArgTemplate = true;
323
+ }
324
+ if (!template) {
325
+ const framework = await prompts.select({
326
+ message: hasInvalidArgTemplate ? `"${argTemplate}" isn't a valia template. please choose from below:` : "Select a framework",
327
+ options: FRAMEWORKS.map((framework) => {
328
+ const frameworkColor = framework.color;
329
+ return {
330
+ label: frameworkColor(framework.display),
331
+ value: framework
332
+ };
333
+ })
334
+ });
335
+ if (prompts.isCancel(framework)) return cancel();
336
+ console.log("💦pkgInfo", pkgInfo);
337
+ const variant = await prompts.select({
338
+ message: "Select a variant:",
339
+ options: framework.variants.map((variant) => {
340
+ const variantColor = variant.color;
341
+ const command = variant.customCommand ? getFullCustomCommand(variant.customCommand, pkgInfo).replace(/ TARGET_DIR$/, "") : void 0;
342
+ return {
343
+ label: variantColor(variant.display || variant.name),
344
+ value: variant.name,
345
+ hint: command
346
+ };
347
+ })
348
+ });
349
+ if (prompts.isCancel(variant)) return cancel();
350
+ template = variant;
351
+ }
352
+ /** 合起来就是 项目文件夹的 绝对路径 */
353
+ const root = path.join(cwd, targetDir);
354
+ fs.mkdirSync(root, { recursive: true });
355
+ let isReactSwc = false;
356
+ if (template.includes("-swc")) {
357
+ isReactSwc = true;
358
+ template = template.replace("-swc", "");
359
+ }
360
+ /**
361
+ * 用户输入命令的包管理工具
362
+ */
363
+ const pkgManager = pkgInfo ? pkgInfo.name : "npm";
364
+ const { customCommand } = FRAMEWORKS.flatMap((f) => f.variants).find((v) => v.name === template) ?? {};
365
+ if (customCommand) {
366
+ const [command, ...args] = getFullCustomCommand(customCommand, pkgInfo).split(" ");
367
+ const replacedArgs = args.map((arg) => arg.replace("TARGET_DIR", () => targetDir));
368
+ console.log("💦replacedArgs", replacedArgs);
369
+ /** 这里的 inherit 表示继承父进程的输入输出 */
370
+ const { status } = spawn.sync(command, replacedArgs, { stdio: "inherit" });
371
+ process.exit(status ?? 0);
372
+ }
373
+ prompts.log.step(`scaffolding project in ${root}...`);
374
+ /** 选则的模板地址 */
375
+ const templateDir = path.resolve(fileURLToPath(import.meta.url), "../..", `template-${template}`);
376
+ const write = (file, content) => {
377
+ const targetPath = path.join(root, renameFiles[file] ?? file);
378
+ if (content) fs.writeFileSync(targetPath, content);
379
+ else copy(path.join(templateDir, file), targetPath);
380
+ };
381
+ const files = fs.readdirSync(templateDir);
382
+ for (const file of files) if (file !== "package.json") write(file);
383
+ const pkg = JSON.parse(fs.readFileSync(path.join(templateDir, "package.json"), "utf-8"));
384
+ pkg.name = packageName;
385
+ /** null => replacer 主要是用于序列化的时候 做一些操作 数组 每一个属性都会执行该函数 如果是数组就是只有这些属性会留下
386
+ * 2 代表 缩进级别
387
+ */
388
+ write("package.json", `${JSON.stringify(pkg, null, 2)}\n`);
389
+ if (isReactSwc) setupReactSwc(root, template.endsWith("-ts"));
390
+ let doneMessage = "";
391
+ /** 克隆文件夹之后 目录的 的相对路径 其实就是 root 和 cwd 的差值 */
392
+ const cdProjectName = path.relative(cwd, root);
393
+ console.log("💦cwd", cwd);
394
+ console.log("💦root", root);
395
+ console.log("💦cdProjectName", cdProjectName);
396
+ doneMessage += `Done. Now run:\n`;
397
+ if (root !== cwd) doneMessage += `\n cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName} `;
398
+ switch (pkgManager) {
399
+ case "yarn":
400
+ doneMessage += `\n yarn`;
401
+ doneMessage += `\n yarn dev`;
402
+ break;
403
+ default:
404
+ doneMessage += gradient(["pink", "white"])(`\n ${pkgManager} install`);
405
+ doneMessage += gradient(["pink", "white"])(`\n ${pkgManager} run dev`);
406
+ break;
407
+ }
408
+ prompts.outro(doneMessage);
409
+ };
410
+ init().catch((e) => {
411
+ console.error("💦", e);
412
+ });
413
+
414
+ //#endregion
415
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bubbles",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "author": "bubbles plant",
6
6
  "bin": {
@@ -10,7 +10,8 @@
10
10
  "files": [
11
11
  "index.js",
12
12
  "template-*",
13
- "dist"
13
+ "dist",
14
+ "template-*/**"
14
15
  ],
15
16
  "engines": {
16
17
  "node": "^20.19.0 || >=22.12.0"
@@ -0,0 +1,3 @@
1
+ node_modules/
2
+ .vscode/
3
+ .agents/
@@ -0,0 +1,53 @@
1
+ {
2
+ // Disable the default formatter, use eslint instead
3
+ "biome.enabled": false,
4
+ "oxc.enable": false,
5
+ "prettier.enable": false,
6
+ "editor.formatOnSave": false,
7
+
8
+ // Auto fix
9
+ "editor.codeActionsOnSave": {
10
+ "source.fixAll.eslint": "explicit",
11
+ "source.organizeImports": "never"
12
+ },
13
+
14
+ // Silent the stylistic rules in your IDE, but still auto fix them
15
+ "eslint.rules.customizations": [
16
+ { "rule": "style/*", "severity": "off", "fixable": true },
17
+ { "rule": "format/*", "severity": "off", "fixable": true },
18
+ { "rule": "*-indent", "severity": "off", "fixable": true },
19
+ { "rule": "*-spacing", "severity": "off", "fixable": true },
20
+ { "rule": "*-spaces", "severity": "off", "fixable": true },
21
+ { "rule": "*-order", "severity": "off", "fixable": true },
22
+ { "rule": "*-dangle", "severity": "off", "fixable": true },
23
+ { "rule": "*-newline", "severity": "off", "fixable": true },
24
+ { "rule": "*quotes", "severity": "off", "fixable": true },
25
+ { "rule": "*semi", "severity": "off", "fixable": true }
26
+ ],
27
+
28
+ // Enable eslint for all supported languages
29
+ "eslint.validate": [
30
+ "javascript",
31
+ "javascriptreact",
32
+ "typescript",
33
+ "typescriptreact",
34
+ "vue",
35
+ "html",
36
+ "markdown",
37
+ "json",
38
+ "json5",
39
+ "jsonc",
40
+ "yaml",
41
+ "toml",
42
+ "xml",
43
+ "gql",
44
+ "graphql",
45
+ "astro",
46
+ "svelte",
47
+ "css",
48
+ "less",
49
+ "scss",
50
+ "pcss",
51
+ "postcss"
52
+ ]
53
+ }
@@ -0,0 +1,21 @@
1
+ # nodejs 版本
2
+ FROM node:24-alpine
3
+
4
+ # 使用pnpm
5
+ RUN corepack enable && corepack prepare pnpm@10.17.1 --activate
6
+
7
+ # 设置工作目录
8
+ WORKDIR /app
9
+
10
+ # 复制 package.json 和 package-lock.json 并安装依赖
11
+ COPY package.json pnpm-lock.yaml ./
12
+ RUN pnpm install --frozen-lockfile
13
+
14
+ COPY . .
15
+
16
+ RUN pnpm build
17
+
18
+ ENV PORT=9980
19
+ EXPOSE 9980
20
+
21
+ CMD ["pnpm", "start"]
@@ -0,0 +1,100 @@
1
+ # Bee Portal
2
+
3
+ ---
4
+
5
+ ## 技术栈
6
+
7
+ | 类别 | 技术 |
8
+ | -------- | ----------------------------------- |
9
+ | 框架 | Next.js 16 App Router(via vinext) |
10
+ | 运行时 | Node.js 24 |
11
+ | 包管理 | pnpm |
12
+ | 语言 | TypeScript 5(严格模式) |
13
+ | UI | Ant Design 6 |
14
+ | CSS | UnoCSS(presetWind4 + Attributify) |
15
+ | 动画 | GSAP 3 |
16
+ | 代码检查 | ESLint 10 |
17
+
18
+ ---
19
+
20
+ ## 代码规范
21
+
22
+ ```bash
23
+ # 仅检查
24
+ pnpm lint
25
+
26
+ # 检查并自动修复
27
+ pnpm lint:fix
28
+ ```
29
+
30
+ ### Git 提交规范
31
+
32
+ 提交信息须遵循 [约定式提交(Conventional Commits)](https://www.conventionalcommits.org/) 格式:
33
+
34
+ ```
35
+ type(scope): description
36
+ ```
37
+
38
+ 常用类型:`feat`、`fix`、`refactor`、`style`、`docs`、`chore`
39
+
40
+ 示例:
41
+
42
+ ```
43
+ feat(header): 添加导航链接
44
+ fix(layout): 修复移动端溢出问题
45
+ ```
46
+
47
+ > pre-commit 钩子会自动对暂存文件执行 `lint:fix`,commit-msg 钩子通过 commitlint 校验提交信息格式。
48
+
49
+ ---
50
+
51
+ ## 分支与发布流程
52
+
53
+ ### 开发环境(服务器:245)
54
+
55
+ 1. 在自己的功能分支上开发
56
+ 2. 将功能分支合并到**迭代主分支**
57
+ 3. 将迭代主分支合并到 **`dev`** 分支
58
+ 4. 推送后自动触发部署到开发环境
59
+
60
+ ```
61
+ 个人分支 → 迭代主分支 → dev(自动发布)
62
+ ```
63
+
64
+ ### 生产环境(服务器:214)
65
+
66
+ 1. 在自己的功能分支上开发
67
+ 2. 将功能分支合并到**迭代主分支**
68
+ 3. 将迭代主分支合并到 **`release`** 分支
69
+ 4. 对 `release` 分支打 tag 触发自动部署
70
+
71
+ ```
72
+ 个人分支 → 迭代主分支 → release → 打 tag(自动发布)
73
+ ```
74
+
75
+ Tag 命名规范:`release@v<major>.<minor>.<patch>`
76
+
77
+ 示例:
78
+
79
+ ```bash
80
+ git tag release@v1.0.0
81
+ git push origin release@v1.0.0
82
+ ```
83
+
84
+ ---
85
+
86
+ ## 项目结构
87
+
88
+ ```
89
+ src/
90
+ app/ # Next.js App Router
91
+ _components/ # 路由私有组件
92
+ antd-provider.tsx # Ant Design SSR 包装器
93
+ layout.tsx # 根布局
94
+ page.tsx # 首页
95
+ assets/
96
+ icon/ # SVG 图标
97
+ image/ # 位图资源
98
+ styles/
99
+ globals.css # 全局样式 & 品牌 Token
100
+ ```
@@ -0,0 +1 @@
1
+ export default { extends: ['@commitlint/config-conventional'] }
@@ -0,0 +1,22 @@
1
+ version: "0.1"
2
+
3
+ services:
4
+ web:
5
+ container_name: bee-portal
6
+ image: bee-portal
7
+ ports:
8
+ - "9980:9980"
9
+ nginx:
10
+ image: nginx:latest
11
+ container_name: nginx
12
+ volumes:
13
+ # 这边Nginx配置是跟docker-compose文件同目录,可根据自己需要更改
14
+ - ./nginx.conf:/etc/nginx/nginx.conf
15
+ - ./logs:/var/log/nginx
16
+ ports:
17
+ - "8080:80"
18
+ - "8443:443"
19
+ restart: always
20
+ # 依赖于哪个服务,这边是依赖于web服务
21
+ depends_on:
22
+ - web
@@ -0,0 +1,20 @@
1
+ import antfu from '@antfu/eslint-config'
2
+
3
+ export default antfu({
4
+ formatters: {
5
+ html: true,
6
+ css: true,
7
+ markdown: 'prettier',
8
+ },
9
+ unocss: true,
10
+ nextjs: true,
11
+ jsx: {
12
+ a11y: true,
13
+ },
14
+ ignores: [
15
+ '**/node_modules/**',
16
+ '**/dist/**',
17
+ '**/public/**',
18
+ '**/*.md',
19
+ ],
20
+ })
@@ -0,0 +1,11 @@
1
+ pre-commit:
2
+ commands:
3
+ check:
4
+ glob: '*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc,vue}'
5
+ run: pnpm lint:fix {staged_files}
6
+ stage_fixed: true
7
+
8
+ commit-msg:
9
+ commands:
10
+ lint commit message:
11
+ run: npx commitlint --edit {1}