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.
- package/dist/index.js +406 -11
- package/package.json +3 -2
- package/template-nextjs-vinext-eslint/.dockerignore +3 -0
- package/template-nextjs-vinext-eslint/.vscode/settings.json +53 -0
- package/template-nextjs-vinext-eslint/Dockerfile +21 -0
- package/template-nextjs-vinext-eslint/README.md +100 -0
- package/template-nextjs-vinext-eslint/commitlint.config.js +1 -0
- package/template-nextjs-vinext-eslint/docker-compose.yaml +22 -0
- package/template-nextjs-vinext-eslint/eslint.config.js +20 -0
- package/template-nextjs-vinext-eslint/lefthook.yml +11 -0
- package/template-nextjs-vinext-eslint/next.config.ts +8 -0
- package/template-nextjs-vinext-eslint/nginx.conf +14 -0
- package/template-nextjs-vinext-eslint/package.json +50 -0
- package/template-nextjs-vinext-eslint/pnpm-workspace.yaml +7 -0
- package/template-nextjs-vinext-eslint/public/file.svg +1 -0
- package/template-nextjs-vinext-eslint/public/globe.svg +1 -0
- package/template-nextjs-vinext-eslint/public/logo-white.svg +128 -0
- package/template-nextjs-vinext-eslint/public/next.svg +1 -0
- package/template-nextjs-vinext-eslint/public/vercel.svg +1 -0
- package/template-nextjs-vinext-eslint/public/window.svg +1 -0
- package/template-nextjs-vinext-eslint/src/app/_components/Header/header.module.css +0 -0
- package/template-nextjs-vinext-eslint/src/app/_components/Header/header.tsx +7 -0
- package/template-nextjs-vinext-eslint/src/app/_components/Main/index.tsx +13 -0
- package/template-nextjs-vinext-eslint/src/app/antd-provider.tsx +30 -0
- package/template-nextjs-vinext-eslint/src/app/icon.svg +26 -0
- package/template-nextjs-vinext-eslint/src/app/layout.tsx +68 -0
- package/template-nextjs-vinext-eslint/src/app/page.module.css +141 -0
- package/template-nextjs-vinext-eslint/src/app/page.tsx +43 -0
- package/template-nextjs-vinext-eslint/src/app/uno-css.tsx +7 -0
- package/template-nextjs-vinext-eslint/src/assets/icon/logo-white.svg +128 -0
- package/template-nextjs-vinext-eslint/src/assets/icon/logo.svg +26 -0
- package/template-nextjs-vinext-eslint/src/assets/image/QR.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/banner_1.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/banner_2.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/banner_3.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/banner_4.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/banner_top.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/icon_title_left.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/icon_title_right.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/img.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_COCT.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/207/347/247/221.png +0 -0
- package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/205/264.png +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/350/205/276/350/256/257.png +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/230/277/351/207/214/344/272/221.png +0 -0
- 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
- package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/276/231/346/271/226.png +0 -0
- package/template-nextjs-vinext-eslint/src/styles/globals.css +47 -0
- package/template-nextjs-vinext-eslint/src/types/vite-env.d.ts +18 -0
- package/template-nextjs-vinext-eslint/src/utils/env.ts +14 -0
- package/template-nextjs-vinext-eslint/src/utils/index.ts +0 -0
- package/template-nextjs-vinext-eslint/src/utils/request/core/index.ts +425 -0
- package/template-nextjs-vinext-eslint/src/utils/request/core/utils.ts +39 -0
- package/template-nextjs-vinext-eslint/src/utils/request/index.ts +48 -0
- package/template-nextjs-vinext-eslint/tsconfig.json +34 -0
- package/template-nextjs-vinext-eslint/uno.config.ts +8 -0
- package/template-nextjs-vinext-eslint/vite.config.ts +8 -0
- package/template-react-rsbuild-biome/.env +5 -0
- package/template-react-rsbuild-biome/.env.development +1 -0
- package/template-react-rsbuild-biome/.env.production +1 -0
- package/template-react-rsbuild-biome/.prettierignore +34 -0
- package/template-react-rsbuild-biome/.prettierrc +16 -0
- package/template-react-rsbuild-biome/.vscode/settings.json +10 -0
- package/template-react-rsbuild-biome/README.md +29 -0
- package/template-react-rsbuild-biome/biome.json +116 -0
- package/template-react-rsbuild-biome/commitlint.config.js +1 -0
- package/template-react-rsbuild-biome/index.html +7 -0
- package/template-react-rsbuild-biome/lefthook.yml +14 -0
- package/template-react-rsbuild-biome/package.json +42 -0
- package/template-react-rsbuild-biome/public/.gitkeep +0 -0
- package/template-react-rsbuild-biome/rsbuild.config.ts +44 -0
- package/template-react-rsbuild-biome/src/App.tsx +9 -0
- package/template-react-rsbuild-biome/src/assets/font/AlimamaShuHeiTi-Bold.ttf +0 -0
- package/template-react-rsbuild-biome/src/assets/icon/logo.svg +7 -0
- package/template-react-rsbuild-biome/src/components/Loading/PageLoading.tsx +11 -0
- package/template-react-rsbuild-biome/src/env.d.ts +1 -0
- package/template-react-rsbuild-biome/src/index.tsx +18 -0
- package/template-react-rsbuild-biome/src/layout/default/index.tsx +10 -0
- package/template-react-rsbuild-biome/src/pages/home/index.tsx +5 -0
- package/template-react-rsbuild-biome/src/router/index.tsx +38 -0
- package/template-react-rsbuild-biome/src/store/index.ts +0 -0
- package/template-react-rsbuild-biome/src/store/modules/user.ts +11 -0
- package/template-react-rsbuild-biome/src/styles/fonts.scss +4 -0
- package/template-react-rsbuild-biome/src/styles/index.scss +19 -0
- package/template-react-rsbuild-biome/src/styles/variables.scss +4 -0
- package/template-react-rsbuild-biome/src/types/auto-import.d.ts +49 -0
- package/template-react-rsbuild-biome/src/utils/env.ts +10 -0
- package/template-react-rsbuild-biome/src/utils/request/core/index.ts +425 -0
- package/template-react-rsbuild-biome/src/utils/request/core/utils.ts +39 -0
- package/template-react-rsbuild-biome/src/utils/request/index.ts +42 -0
- package/template-react-rsbuild-biome/tsconfig.json +35 -0
- package/template-react-rsbuild-biome/uno.config.ts +8 -0
- package/template-taro-react-oxc/.editorconfig +12 -0
- package/template-taro-react-oxc/.env +1 -0
- package/template-taro-react-oxc/.env.development +6 -0
- package/template-taro-react-oxc/.env.production +5 -0
- package/template-taro-react-oxc/.oxfmtrc.json +12 -0
- package/template-taro-react-oxc/.oxlintrc.json +9 -0
- package/template-taro-react-oxc/.vscode/settings.json +13 -0
- package/template-taro-react-oxc/babel.config.js +45 -0
- package/template-taro-react-oxc/commitlint.config.mjs +1 -0
- package/template-taro-react-oxc/config/dev.ts +10 -0
- package/template-taro-react-oxc/config/index.ts +172 -0
- package/template-taro-react-oxc/config/prod.ts +39 -0
- package/template-taro-react-oxc/config/release.ts +106 -0
- package/template-taro-react-oxc/key/.gitkeep +0 -0
- package/template-taro-react-oxc/lefthook.yaml +18 -0
- package/template-taro-react-oxc/package.json +118 -0
- package/template-taro-react-oxc/patches/@tarojs__plugin-mini-ci.patch +13 -0
- package/template-taro-react-oxc/pnpm-workspace.yaml +13 -0
- package/template-taro-react-oxc/postcss.config.js +6 -0
- package/template-taro-react-oxc/project.config.json +15 -0
- package/template-taro-react-oxc/src/app.config.ts +11 -0
- package/template-taro-react-oxc/src/app.ts +14 -0
- package/template-taro-react-oxc/src/index.html +17 -0
- package/template-taro-react-oxc/src/pages/index/index.config.ts +3 -0
- package/template-taro-react-oxc/src/pages/index/index.scss +0 -0
- package/template-taro-react-oxc/src/pages/index/index.tsx +44 -0
- package/template-taro-react-oxc/src/store/taroStorage.ts +7 -0
- package/template-taro-react-oxc/src/store/user.ts +13 -0
- package/template-taro-react-oxc/src/styles/index.css +1 -0
- package/template-taro-react-oxc/src/utils/env.ts +10 -0
- package/template-taro-react-oxc/src/utils/request/core/index.ts +425 -0
- package/template-taro-react-oxc/src/utils/request/core/utils.ts +39 -0
- package/template-taro-react-oxc/src/utils/request/index.ts +37 -0
- package/template-taro-react-oxc/stylelint.config.mjs +28 -0
- package/template-taro-react-oxc/tailwind.config.js +12 -0
- package/template-taro-react-oxc/tsconfig.json +28 -0
- package/template-taro-react-oxc/types/global.d.ts +29 -0
- package/template-taro-vue-eslint/.editorconfig +12 -0
- package/template-taro-vue-eslint/.env +3 -0
- package/template-taro-vue-eslint/.env.development +5 -0
- package/template-taro-vue-eslint/.env.production +5 -0
- package/template-taro-vue-eslint/.vscode/settings.json +57 -0
- package/template-taro-vue-eslint/babel.config.js +12 -0
- package/template-taro-vue-eslint/commitlint.config.mjs +1 -0
- package/template-taro-vue-eslint/config/dev.ts +27 -0
- package/template-taro-vue-eslint/config/index.ts +134 -0
- package/template-taro-vue-eslint/config/output-root.ts +11 -0
- package/template-taro-vue-eslint/config/prod.ts +39 -0
- package/template-taro-vue-eslint/config/release.ts +113 -0
- package/template-taro-vue-eslint/eslint.config.mjs +22 -0
- package/template-taro-vue-eslint/lefthook.yaml +13 -0
- package/template-taro-vue-eslint/package.json +115 -0
- package/template-taro-vue-eslint/patches/@tarojs__plugin-mini-ci.patch +13 -0
- package/template-taro-vue-eslint/pnpm-workspace.yaml +13 -0
- package/template-taro-vue-eslint/project.config.json +16 -0
- package/template-taro-vue-eslint/src/api/common/upload.ts +53 -0
- package/template-taro-vue-eslint/src/app.config.ts +19 -0
- package/template-taro-vue-eslint/src/app.ts +14 -0
- package/template-taro-vue-eslint/src/assets/image/.gitkeep +0 -0
- package/template-taro-vue-eslint/src/index.html +17 -0
- package/template-taro-vue-eslint/src/pages/example/upload/index.config.ts +3 -0
- package/template-taro-vue-eslint/src/pages/example/upload/index.module.scss +4 -0
- package/template-taro-vue-eslint/src/pages/example/upload/index.vue +71 -0
- package/template-taro-vue-eslint/src/pages/index/index.config.ts +3 -0
- package/template-taro-vue-eslint/src/pages/index/index.module.scss +4 -0
- package/template-taro-vue-eslint/src/pages/index/index.vue +77 -0
- package/template-taro-vue-eslint/src/store/index.ts +10 -0
- package/template-taro-vue-eslint/src/store/modules/user.ts +15 -0
- package/template-taro-vue-eslint/src/store/taroStorage.ts +7 -0
- package/template-taro-vue-eslint/src/styles/index.css +1 -0
- package/template-taro-vue-eslint/src/styles/nut-theme.css +4 -0
- package/template-taro-vue-eslint/src/utils/env.ts +13 -0
- package/template-taro-vue-eslint/src/utils/index.ts +40 -0
- package/template-taro-vue-eslint/src/utils/request/core/index.ts +425 -0
- package/template-taro-vue-eslint/src/utils/request/core/utils.ts +39 -0
- package/template-taro-vue-eslint/src/utils/request/index.ts +73 -0
- package/template-taro-vue-eslint/tsconfig.json +30 -0
- package/template-taro-vue-eslint/types/components.d.ts +16 -0
- package/template-taro-vue-eslint/types/global.d.ts +31 -0
- package/template-taro-vue-eslint/types/vue.d.ts +10 -0
- package/template-taro-vue-eslint/unocss.config.ts +42 -0
- package/template-vp-monorepo-react-nestjs/.oxfmtrc.jsonc +8 -0
- package/template-vp-monorepo-react-nestjs/.oxlintrc.jsonc +3 -0
- package/template-vp-monorepo-react-nestjs/.specs//351/234/200/346/261/202.md +5 -0
- package/template-vp-monorepo-react-nestjs/.vite-hooks/commit-msg +1 -0
- package/template-vp-monorepo-react-nestjs/.vite-hooks/pre-commit +1 -0
- package/template-vp-monorepo-react-nestjs/README.md +29 -0
- package/template-vp-monorepo-react-nestjs/apps/service/.oxlintrc.jsonc +3 -0
- package/template-vp-monorepo-react-nestjs/apps/web/.env +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/.oxlintrc.jsonc +4 -0
- package/template-vp-monorepo-react-nestjs/apps/web/index.html +13 -0
- package/template-vp-monorepo-react-nestjs/apps/web/package.json +39 -0
- package/template-vp-monorepo-react-nestjs/apps/web/public/favicon.svg +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/public/icons.svg +24 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/App.tsx +24 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/assets/hero.png +0 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/assets/react.svg +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/assets/vite.svg +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/components/Loading/PageLoading.tsx +11 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/main.tsx +5 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/pages/home/index.tsx +17 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/router/index.tsx +25 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/router/modules/.gitkeep +0 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/styles/index.css +7 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/types/auto-imports.d.ts +58 -0
- package/template-vp-monorepo-react-nestjs/apps/web/tsconfig.json +32 -0
- package/template-vp-monorepo-react-nestjs/apps/web/vite.config.ts +32 -0
- package/template-vp-monorepo-react-nestjs/commitlint.config.js +0 -0
- package/template-vp-monorepo-react-nestjs/package.json +20 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/README.md +23 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/package.json +39 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/src/index.ts +3 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/tests/index.test.ts +6 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/tsconfig.json +20 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/tsdown.config.ts +9 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/vite.config.ts +7 -0
- package/template-vp-monorepo-react-nestjs/pnpm-workspace.yaml +23 -0
- package/template-vp-monorepo-react-nestjs/tsconfig.json +9 -0
- package/template-vp-monorepo-react-nestjs/vite.config.ts +8 -0
- package/template-vp-react/.env +1 -0
- package/template-vp-react/.oxfmtrc.jsonc +8 -0
- package/template-vp-react/.oxlintrc.jsonc +11 -0
- package/template-vp-react/.vite-hooks/commit-msg +1 -0
- package/template-vp-react/.vite-hooks/pre-commit +1 -0
- package/template-vp-react/.vscode/extensions.json +3 -0
- package/template-vp-react/.vscode/settings.json +11 -0
- package/template-vp-react/commitlint.config.js +0 -0
- package/template-vp-react/index.html +13 -0
- package/template-vp-react/package.json +44 -0
- package/template-vp-react/public/favicon.svg +1 -0
- package/template-vp-react/public/icons.svg +24 -0
- package/template-vp-react/src/App.tsx +24 -0
- package/template-vp-react/src/assets/hero.png +0 -0
- package/template-vp-react/src/assets/react.svg +1 -0
- package/template-vp-react/src/assets/vite.svg +1 -0
- package/template-vp-react/src/components/Loading/PageLoading.tsx +11 -0
- package/template-vp-react/src/main.tsx +5 -0
- package/template-vp-react/src/pages/home/index.tsx +17 -0
- package/template-vp-react/src/router/index.tsx +25 -0
- package/template-vp-react/src/router/modules/.gitkeep +0 -0
- package/template-vp-react/src/styles/index.css +7 -0
- package/template-vp-react/src/types/auto-imports.d.ts +58 -0
- package/template-vp-react/src/utils/env/index.ts +6 -0
- package/template-vp-react/src/utils/request/core/index.ts +420 -0
- package/template-vp-react/src/utils/request/core/utils.ts +39 -0
- package/template-vp-react/src/utils/request/index.ts +48 -0
- package/template-vp-react/tsconfig.json +32 -0
- package/template-vp-react/vite.config.ts +35 -0
- package/template-vp-react-shadcn/.agents/skills/alova-client-usage/README.md +28 -0
- package/template-vp-react-shadcn/.agents/skills/alova-client-usage/SKILL.md +249 -0
- package/template-vp-react-shadcn/.agents/skills/alova-client-usage/references/SETUP.md +146 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/SKILL.md +260 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/agents/openai.yml +5 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/assets/shadcn-small.png +0 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/assets/shadcn.png +0 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/cli.md +276 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/customization.md +209 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/evals/evals.json +47 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/mcp.md +94 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/rules/base-vs-radix.md +306 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/rules/composition.md +195 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/rules/forms.md +192 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/rules/icons.md +101 -0
- package/template-vp-react-shadcn/.agents/skills/shadcn/rules/styling.md +162 -0
- package/template-vp-react-shadcn/.agents/skills/vite-plus/README.md +75 -0
- package/template-vp-react-shadcn/.agents/skills/vite-plus/SKILL.md +322 -0
- package/template-vp-react-shadcn/.agents/skills/vite-plus/evals.json +182 -0
- package/template-vp-react-shadcn/.agents/skills/vite-plus/references/config.md +162 -0
- package/template-vp-react-shadcn/.agents/skills/vite-plus/references/env-management.md +76 -0
- package/template-vp-react-shadcn/.agents/skills/vite-plus/references/task-runner.md +152 -0
- package/template-vp-react-shadcn/.agents/skills/vite-plus/sources.yaml +142 -0
- package/template-vp-react-shadcn/.env +1 -0
- package/template-vp-react-shadcn/.oxfmtrc.jsonc +8 -0
- package/template-vp-react-shadcn/.oxlintrc.jsonc +3 -0
- package/template-vp-react-shadcn/.vite-hooks/commit-msg +1 -0
- package/template-vp-react-shadcn/.vite-hooks/pre-commit +1 -0
- package/template-vp-react-shadcn/.vscode/extensions.json +3 -0
- package/template-vp-react-shadcn/.vscode/settings.json +12 -0
- package/template-vp-react-shadcn/agents.md +44 -0
- package/template-vp-react-shadcn/commitlint.config.js +1 -0
- package/template-vp-react-shadcn/components.json +25 -0
- package/template-vp-react-shadcn/index.html +13 -0
- package/template-vp-react-shadcn/package.json +56 -0
- package/template-vp-react-shadcn/public/favicon.svg +1 -0
- package/template-vp-react-shadcn/public/icons.svg +24 -0
- package/template-vp-react-shadcn/skills-lock.json +11 -0
- package/template-vp-react-shadcn/src/App.tsx +24 -0
- package/template-vp-react-shadcn/src/api/.gitkeep +0 -0
- package/template-vp-react-shadcn/src/assets/hero.png +0 -0
- package/template-vp-react-shadcn/src/assets/react.svg +1 -0
- package/template-vp-react-shadcn/src/assets/vite.svg +1 -0
- package/template-vp-react-shadcn/src/components/Loading/PageLoading.tsx +11 -0
- package/template-vp-react-shadcn/src/components/Player/VideoJS/index.tsx +163 -0
- package/template-vp-react-shadcn/src/components/Player/index.ts +7 -0
- package/template-vp-react-shadcn/src/components/ui/button.tsx +67 -0
- package/template-vp-react-shadcn/src/components/ui/sonner.tsx +43 -0
- package/template-vp-react-shadcn/src/components/ui/spinner.tsx +17 -0
- package/template-vp-react-shadcn/src/hooks/.gitkeep +0 -0
- package/template-vp-react-shadcn/src/lib/utils.ts +6 -0
- package/template-vp-react-shadcn/src/main.tsx +5 -0
- package/template-vp-react-shadcn/src/pages/home/index.tsx +96 -0
- package/template-vp-react-shadcn/src/router/index.tsx +25 -0
- package/template-vp-react-shadcn/src/router/modules/.gitkeep +0 -0
- package/template-vp-react-shadcn/src/store/.gitkeep +0 -0
- package/template-vp-react-shadcn/src/styles/index.css +16 -0
- package/template-vp-react-shadcn/src/styles/shadcn.css +127 -0
- package/template-vp-react-shadcn/src/types/auto-imports.d.ts +58 -0
- package/template-vp-react-shadcn/src/utils/env/index.tsx +6 -0
- package/template-vp-react-shadcn/src/utils/request/alova-core/index.ts +425 -0
- package/template-vp-react-shadcn/src/utils/request/alova-core/utils.ts +39 -0
- package/template-vp-react-shadcn/src/utils/request/index.ts +48 -0
- package/template-vp-react-shadcn/src/utils/request/readme.md +176 -0
- package/template-vp-react-shadcn/tsconfig.json +32 -0
- package/template-vp-react-shadcn/vite.config.ts +35 -0
- package/template-vue-vite-eslint/.env +6 -0
- package/template-vue-vite-eslint/.env.development +2 -0
- package/template-vue-vite-eslint/.env.production +1 -0
- package/template-vue-vite-eslint/README.md +3 -0
- package/template-vue-vite-eslint/commitlint.config.js +1 -0
- package/template-vue-vite-eslint/eslint.config.js +69 -0
- package/template-vue-vite-eslint/index.html +13 -0
- package/template-vue-vite-eslint/lefthook.yml +11 -0
- package/template-vue-vite-eslint/package.json +56 -0
- package/template-vue-vite-eslint/public/vite.svg +1 -0
- package/template-vue-vite-eslint/src/App.vue +19 -0
- package/template-vue-vite-eslint/src/api/index.ts +12 -0
- package/template-vue-vite-eslint/src/assets/icon/computer-data.svg +3 -0
- package/template-vue-vite-eslint/src/assets/icon/cpu.svg +3 -0
- package/template-vue-vite-eslint/src/assets/icon/data-search.svg +3 -0
- package/template-vue-vite-eslint/src/assets/icon/home.svg +3 -0
- package/template-vue-vite-eslint/src/assets/icon/knowledge-graph.svg +3 -0
- package/template-vue-vite-eslint/src/assets/icon/logo.svg +1 -0
- package/template-vue-vite-eslint/src/assets/icon/robot.svg +3 -0
- package/template-vue-vite-eslint/src/assets/image/.gitkeep +0 -0
- package/template-vue-vite-eslint/src/components/Icon/svg-icon.vue +29 -0
- package/template-vue-vite-eslint/src/hooks/chart/lib.ts +57 -0
- package/template-vue-vite-eslint/src/hooks/chart/useEcharts.ts +65 -0
- package/template-vue-vite-eslint/src/layout/default/header/index.vue +12 -0
- package/template-vue-vite-eslint/src/layout/default/index.vue +55 -0
- package/template-vue-vite-eslint/src/main.ts +16 -0
- package/template-vue-vite-eslint/src/router/guard/index.ts +7 -0
- package/template-vue-vite-eslint/src/router/guard/permissionGuard.ts +13 -0
- package/template-vue-vite-eslint/src/router/index.ts +18 -0
- package/template-vue-vite-eslint/src/router/interface.ts +9 -0
- package/template-vue-vite-eslint/src/router/modules/example.ts +21 -0
- package/template-vue-vite-eslint/src/router/modules/index.ts +36 -0
- package/template-vue-vite-eslint/src/store/index.ts +11 -0
- package/template-vue-vite-eslint/src/store/modules/user.ts +20 -0
- package/template-vue-vite-eslint/src/styles/font.scss +0 -0
- package/template-vue-vite-eslint/src/styles/index.scss +29 -0
- package/template-vue-vite-eslint/src/styles/variables.scss +3 -0
- package/template-vue-vite-eslint/src/types/auto-import.d.ts +78 -0
- package/template-vue-vite-eslint/src/types/components.d.ts +18 -0
- package/template-vue-vite-eslint/src/types/vite-env.d.ts +15 -0
- package/template-vue-vite-eslint/src/utils/env.ts +11 -0
- package/template-vue-vite-eslint/src/utils/request/core/index.ts +425 -0
- package/template-vue-vite-eslint/src/utils/request/core/utils.ts +39 -0
- package/template-vue-vite-eslint/src/utils/request/index.ts +42 -0
- package/template-vue-vite-eslint/src/views/example/echart/config.ts +1794 -0
- package/template-vue-vite-eslint/src/views/example/echart/index.vue +22 -0
- package/template-vue-vite-eslint/src/views/example/h-full.vue +24 -0
- package/template-vue-vite-eslint/src/views/example/tree-chart.vue +94 -0
- package/template-vue-vite-eslint/src/views/home/index.vue +25 -0
- package/template-vue-vite-eslint/src/views/login/index.vue +9 -0
- package/template-vue-vite-eslint/tsconfig.json +36 -0
- package/template-vue-vite-eslint/uno.config.ts +21 -0
- package/template-vue-vite-eslint/vite.config.ts +60 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,36 @@
|
|
|
1
|
-
import
|
|
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
|
-
${
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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.
|
|
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,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
|
+
})
|