@coze-arch/cli 0.0.1-beta.5 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/__templates__/expo/.coze +7 -2
- package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +46 -0
- package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +229 -0
- package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +47 -0
- package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +34 -0
- package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +46 -0
- package/lib/__templates__/expo/README.md +68 -7
- package/lib/__templates__/expo/_gitignore +1 -1
- package/lib/__templates__/{react-rsbuild → expo}/_npmrc +4 -5
- package/lib/__templates__/expo/client/app/+not-found.tsx +15 -64
- package/lib/__templates__/expo/client/app/_layout.tsx +15 -12
- package/lib/__templates__/expo/client/app/index.tsx +1 -0
- package/lib/__templates__/expo/client/app.config.ts +76 -0
- package/lib/__templates__/expo/client/components/Screen.tsx +22 -38
- package/lib/__templates__/expo/client/components/ThemedText.tsx +33 -0
- package/lib/__templates__/expo/client/components/ThemedView.tsx +37 -0
- package/lib/__templates__/expo/client/constants/theme.ts +117 -58
- package/lib/__templates__/expo/client/contexts/AuthContext.tsx +14 -107
- package/lib/__templates__/expo/client/declarations.d.ts +5 -0
- package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +40 -10
- package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
- package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
- package/lib/__templates__/expo/client/hooks/useTheme.ts +26 -6
- package/lib/__templates__/expo/client/metro.config.js +124 -0
- package/lib/__templates__/expo/client/package.json +95 -0
- package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
- package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
- package/lib/__templates__/expo/client/scripts/install-missing-deps.js +47 -22
- package/lib/__templates__/expo/client/tsconfig.json +24 -0
- package/lib/__templates__/expo/client/utils/index.ts +23 -2
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
- package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
- package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
- package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/rule.js +120 -0
- package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/tech.md +58 -0
- package/lib/__templates__/expo/package.json +16 -91
- package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
- package/lib/__templates__/expo/pnpm-lock.yaml +1805 -3126
- package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
- package/lib/__templates__/expo/server/build.js +21 -0
- package/lib/__templates__/expo/server/package.json +34 -0
- package/lib/__templates__/expo/server/src/index.ts +20 -0
- package/lib/__templates__/expo/server/tsconfig.json +24 -0
- package/lib/__templates__/expo/template.config.js +58 -1
- package/lib/__templates__/expo/tsconfig.json +1 -24
- package/lib/__templates__/native-static/.coze +11 -0
- package/lib/__templates__/native-static/index.html +33 -0
- package/lib/__templates__/native-static/styles/main.css +136 -0
- package/lib/__templates__/native-static/template.config.js +22 -0
- package/lib/__templates__/nextjs/.babelrc +15 -0
- package/lib/__templates__/nextjs/.coze +4 -3
- package/lib/__templates__/nextjs/README.md +346 -19
- package/lib/__templates__/nextjs/_npmrc +2 -1
- package/lib/__templates__/nextjs/components.json +21 -0
- package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
- package/lib/__templates__/nextjs/next.config.ts +11 -0
- package/lib/__templates__/nextjs/package.json +63 -2
- package/lib/__templates__/nextjs/pnpm-lock.yaml +10053 -1710
- package/lib/__templates__/nextjs/scripts/build.sh +4 -1
- package/lib/__templates__/nextjs/scripts/dev.sh +15 -27
- package/lib/__templates__/{react-rsbuild/scripts/build.sh → nextjs/scripts/prepare.sh} +0 -5
- package/lib/__templates__/nextjs/scripts/start.sh +7 -1
- package/lib/__templates__/nextjs/src/app/globals.css +124 -13
- package/lib/__templates__/nextjs/src/app/layout.tsx +56 -16
- package/lib/__templates__/nextjs/src/app/page.tsx +18 -49
- package/lib/__templates__/nextjs/src/app/robots.ts +11 -0
- package/lib/__templates__/nextjs/src/components/ui/accordion.tsx +66 -0
- package/lib/__templates__/nextjs/src/components/ui/alert-dialog.tsx +157 -0
- package/lib/__templates__/nextjs/src/components/ui/alert.tsx +66 -0
- package/lib/__templates__/nextjs/src/components/ui/aspect-ratio.tsx +11 -0
- package/lib/__templates__/nextjs/src/components/ui/avatar.tsx +53 -0
- package/lib/__templates__/nextjs/src/components/ui/badge.tsx +46 -0
- package/lib/__templates__/nextjs/src/components/ui/breadcrumb.tsx +109 -0
- package/lib/__templates__/nextjs/src/components/ui/button-group.tsx +83 -0
- package/lib/__templates__/nextjs/src/components/ui/button.tsx +62 -0
- package/lib/__templates__/nextjs/src/components/ui/calendar.tsx +220 -0
- package/lib/__templates__/nextjs/src/components/ui/card.tsx +92 -0
- package/lib/__templates__/nextjs/src/components/ui/carousel.tsx +241 -0
- package/lib/__templates__/nextjs/src/components/ui/chart.tsx +357 -0
- package/lib/__templates__/nextjs/src/components/ui/checkbox.tsx +32 -0
- package/lib/__templates__/nextjs/src/components/ui/collapsible.tsx +33 -0
- package/lib/__templates__/nextjs/src/components/ui/command.tsx +184 -0
- package/lib/__templates__/nextjs/src/components/ui/context-menu.tsx +252 -0
- package/lib/__templates__/nextjs/src/components/ui/dialog.tsx +143 -0
- package/lib/__templates__/nextjs/src/components/ui/drawer.tsx +135 -0
- package/lib/__templates__/nextjs/src/components/ui/dropdown-menu.tsx +257 -0
- package/lib/__templates__/nextjs/src/components/ui/empty.tsx +104 -0
- package/lib/__templates__/nextjs/src/components/ui/field.tsx +248 -0
- package/lib/__templates__/nextjs/src/components/ui/form.tsx +167 -0
- package/lib/__templates__/nextjs/src/components/ui/hover-card.tsx +44 -0
- package/lib/__templates__/nextjs/src/components/ui/input-group.tsx +170 -0
- package/lib/__templates__/nextjs/src/components/ui/input-otp.tsx +77 -0
- package/lib/__templates__/nextjs/src/components/ui/input.tsx +21 -0
- package/lib/__templates__/nextjs/src/components/ui/item.tsx +193 -0
- package/lib/__templates__/nextjs/src/components/ui/kbd.tsx +28 -0
- package/lib/__templates__/nextjs/src/components/ui/label.tsx +24 -0
- package/lib/__templates__/nextjs/src/components/ui/menubar.tsx +276 -0
- package/lib/__templates__/nextjs/src/components/ui/navigation-menu.tsx +168 -0
- package/lib/__templates__/nextjs/src/components/ui/pagination.tsx +127 -0
- package/lib/__templates__/nextjs/src/components/ui/popover.tsx +48 -0
- package/lib/__templates__/nextjs/src/components/ui/progress.tsx +31 -0
- package/lib/__templates__/nextjs/src/components/ui/radio-group.tsx +45 -0
- package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +63 -0
- package/lib/__templates__/nextjs/src/components/ui/scroll-area.tsx +58 -0
- package/lib/__templates__/nextjs/src/components/ui/select.tsx +190 -0
- package/lib/__templates__/nextjs/src/components/ui/separator.tsx +28 -0
- package/lib/__templates__/nextjs/src/components/ui/sheet.tsx +139 -0
- package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +724 -0
- package/lib/__templates__/nextjs/src/components/ui/skeleton.tsx +13 -0
- package/lib/__templates__/nextjs/src/components/ui/slider.tsx +63 -0
- package/lib/__templates__/nextjs/src/components/ui/sonner.tsx +40 -0
- package/lib/__templates__/nextjs/src/components/ui/spinner.tsx +16 -0
- package/lib/__templates__/nextjs/src/components/ui/switch.tsx +31 -0
- package/lib/__templates__/nextjs/src/components/ui/table.tsx +116 -0
- package/lib/__templates__/nextjs/src/components/ui/tabs.tsx +66 -0
- package/lib/__templates__/nextjs/src/components/ui/textarea.tsx +18 -0
- package/lib/__templates__/nextjs/src/components/ui/toggle-group.tsx +83 -0
- package/lib/__templates__/nextjs/src/components/ui/toggle.tsx +47 -0
- package/lib/__templates__/nextjs/src/components/ui/tooltip.tsx +61 -0
- package/lib/__templates__/nextjs/src/hooks/use-mobile.ts +19 -0
- package/lib/__templates__/nextjs/src/lib/utils.ts +6 -0
- package/lib/__templates__/nextjs/src/server.ts +35 -0
- package/lib/__templates__/nextjs/template.config.js +70 -5
- package/lib/__templates__/nextjs/tsconfig.json +1 -1
- package/lib/__templates__/nuxt-vue/.coze +12 -0
- package/lib/__templates__/nuxt-vue/README.md +73 -0
- package/lib/__templates__/nuxt-vue/_gitignore +24 -0
- package/lib/__templates__/{rsbuild → nuxt-vue}/_npmrc +2 -1
- package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
- package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
- package/lib/__templates__/{rsbuild/src/index.css → nuxt-vue/assets/css/main.css} +7 -4
- package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
- package/lib/__templates__/nuxt-vue/package.json +35 -0
- package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
- package/lib/__templates__/nuxt-vue/postcss.config.mjs +8 -0
- package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
- package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
- package/lib/__templates__/{rsbuild → nuxt-vue}/scripts/build.sh +2 -2
- package/lib/__templates__/nuxt-vue/scripts/dev.sh +39 -0
- package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
- package/lib/__templates__/nuxt-vue/scripts/start.sh +21 -0
- package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
- package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
- package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
- package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
- package/lib/__templates__/nuxt-vue/template.config.js +87 -0
- package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
- package/lib/__templates__/taro/.coze +14 -0
- package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
- package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +14 -0
- package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +2 -0
- package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +151 -0
- package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
- package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -0
- package/lib/__templates__/taro/README.md +763 -0
- package/lib/__templates__/taro/_gitignore +40 -0
- package/lib/__templates__/taro/_npmrc +18 -0
- package/lib/__templates__/taro/babel.config.js +12 -0
- package/lib/__templates__/taro/config/dev.ts +9 -0
- package/lib/__templates__/taro/config/index.ts +238 -0
- package/lib/__templates__/taro/config/prod.ts +34 -0
- package/lib/__templates__/taro/eslint.config.mjs +135 -0
- package/lib/__templates__/taro/key/private.appid.key +0 -0
- package/lib/__templates__/taro/package.json +112 -0
- package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
- package/lib/__templates__/taro/pnpm-lock.yaml +23412 -0
- package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
- package/lib/__templates__/taro/project.config.json +15 -0
- package/lib/__templates__/taro/server/nest-cli.json +10 -0
- package/lib/__templates__/taro/server/package.json +40 -0
- package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
- package/lib/__templates__/taro/server/src/app.module.ts +10 -0
- package/lib/__templates__/taro/server/src/app.service.ts +8 -0
- package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
- package/lib/__templates__/taro/server/src/main.ts +49 -0
- package/lib/__templates__/taro/server/tsconfig.json +24 -0
- package/lib/__templates__/taro/src/app.config.ts +11 -0
- package/lib/__templates__/taro/src/app.css +156 -0
- package/lib/__templates__/taro/src/app.tsx +9 -0
- package/lib/__templates__/taro/src/components/ui/accordion.tsx +159 -0
- package/lib/__templates__/taro/src/components/ui/alert-dialog.tsx +260 -0
- package/lib/__templates__/taro/src/components/ui/alert.tsx +60 -0
- package/lib/__templates__/taro/src/components/ui/aspect-ratio.tsx +36 -0
- package/lib/__templates__/taro/src/components/ui/avatar.tsx +84 -0
- package/lib/__templates__/taro/src/components/ui/badge.tsx +37 -0
- package/lib/__templates__/taro/src/components/ui/breadcrumb.tsx +117 -0
- package/lib/__templates__/taro/src/components/ui/button-group.tsx +83 -0
- package/lib/__templates__/taro/src/components/ui/button.tsx +67 -0
- package/lib/__templates__/taro/src/components/ui/calendar.tsx +394 -0
- package/lib/__templates__/taro/src/components/ui/card.tsx +108 -0
- package/lib/__templates__/taro/src/components/ui/carousel.tsx +228 -0
- package/lib/__templates__/taro/src/components/ui/checkbox.tsx +58 -0
- package/lib/__templates__/taro/src/components/ui/code-block.tsx +169 -0
- package/lib/__templates__/taro/src/components/ui/collapsible.tsx +71 -0
- package/lib/__templates__/taro/src/components/ui/command.tsx +385 -0
- package/lib/__templates__/taro/src/components/ui/context-menu.tsx +614 -0
- package/lib/__templates__/taro/src/components/ui/dialog.tsx +256 -0
- package/lib/__templates__/taro/src/components/ui/drawer.tsx +192 -0
- package/lib/__templates__/taro/src/components/ui/dropdown-menu.tsx +561 -0
- package/lib/__templates__/taro/src/components/ui/field.tsx +228 -0
- package/lib/__templates__/taro/src/components/ui/hover-card.tsx +282 -0
- package/lib/__templates__/taro/src/components/ui/input-group.tsx +197 -0
- package/lib/__templates__/taro/src/components/ui/input-otp.tsx +136 -0
- package/lib/__templates__/taro/src/components/ui/input.tsx +56 -0
- package/lib/__templates__/taro/src/components/ui/label.tsx +24 -0
- package/lib/__templates__/taro/src/components/ui/menubar.tsx +595 -0
- package/lib/__templates__/taro/src/components/ui/navigation-menu.tsx +264 -0
- package/lib/__templates__/taro/src/components/ui/pagination.tsx +118 -0
- package/lib/__templates__/taro/src/components/ui/popover.tsx +291 -0
- package/lib/__templates__/taro/src/components/ui/portal.tsx +19 -0
- package/lib/__templates__/taro/src/components/ui/progress.tsx +28 -0
- package/lib/__templates__/taro/src/components/ui/radio-group.tsx +64 -0
- package/lib/__templates__/taro/src/components/ui/resizable.tsx +346 -0
- package/lib/__templates__/taro/src/components/ui/scroll-area.tsx +34 -0
- package/lib/__templates__/taro/src/components/ui/select.tsx +438 -0
- package/lib/__templates__/taro/src/components/ui/separator.tsx +30 -0
- package/lib/__templates__/taro/src/components/ui/sheet.tsx +262 -0
- package/lib/__templates__/taro/src/components/ui/skeleton.tsx +17 -0
- package/lib/__templates__/taro/src/components/ui/slider.tsx +203 -0
- package/lib/__templates__/taro/src/components/ui/sonner.tsx +1 -0
- package/lib/__templates__/taro/src/components/ui/switch.tsx +55 -0
- package/lib/__templates__/taro/src/components/ui/table.tsx +142 -0
- package/lib/__templates__/taro/src/components/ui/tabs.tsx +114 -0
- package/lib/__templates__/taro/src/components/ui/textarea.tsx +54 -0
- package/lib/__templates__/taro/src/components/ui/toast.tsx +517 -0
- package/lib/__templates__/taro/src/components/ui/toggle-group.tsx +120 -0
- package/lib/__templates__/taro/src/components/ui/toggle.tsx +77 -0
- package/lib/__templates__/taro/src/components/ui/tooltip.tsx +455 -0
- package/lib/__templates__/taro/src/index.html +39 -0
- package/lib/__templates__/taro/src/lib/hooks/use-keyboard-offset.ts +37 -0
- package/lib/__templates__/taro/src/lib/measure.ts +115 -0
- package/lib/__templates__/taro/src/lib/platform.ts +12 -0
- package/lib/__templates__/taro/src/lib/utils.ts +6 -0
- package/lib/__templates__/taro/src/network.ts +39 -0
- package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
- package/lib/__templates__/taro/src/pages/index/index.css +1 -0
- package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
- package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
- package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
- package/lib/__templates__/taro/src/presets/h5-navbar.tsx +238 -0
- package/lib/__templates__/taro/src/presets/h5-styles.ts +220 -0
- package/lib/__templates__/taro/src/presets/index.tsx +18 -0
- package/lib/__templates__/taro/stylelint.config.mjs +4 -0
- package/lib/__templates__/taro/template.config.js +68 -0
- package/lib/__templates__/taro/tsconfig.json +29 -0
- package/lib/__templates__/taro/types/global.d.ts +32 -0
- package/lib/__templates__/templates.json +126 -64
- package/lib/__templates__/vite/.coze +4 -3
- package/lib/__templates__/vite/README.md +383 -26
- package/lib/__templates__/vite/_gitignore +1 -0
- package/lib/__templates__/vite/_npmrc +2 -1
- package/lib/__templates__/vite/eslint.config.mjs +14 -0
- package/lib/__templates__/vite/package.json +23 -3
- package/lib/__templates__/vite/pnpm-lock.yaml +2509 -293
- package/lib/__templates__/vite/scripts/build.sh +4 -1
- package/lib/__templates__/vite/scripts/dev.sh +16 -28
- package/lib/__templates__/vite/scripts/prepare.sh +9 -0
- package/lib/__templates__/vite/scripts/start.sh +9 -3
- package/lib/__templates__/vite/server/routes/index.ts +31 -0
- package/lib/__templates__/vite/server/server.ts +65 -0
- package/lib/__templates__/vite/server/vite.ts +67 -0
- package/lib/__templates__/vite/src/main.ts +17 -48
- package/lib/__templates__/vite/template.config.js +82 -10
- package/lib/__templates__/vite/tsconfig.json +4 -3
- package/lib/__templates__/vite/vite.config.ts +8 -3
- package/lib/cli.js +1544 -488
- package/package.json +18 -7
- package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +0 -109
- package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +0 -257
- package/lib/__templates__/expo/app.json +0 -63
- package/lib/__templates__/expo/babel.config.js +0 -9
- package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
- package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
- package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
- package/lib/__templates__/expo/client/hooks/useColorScheme.ts +0 -1
- package/lib/__templates__/expo/client/index.js +0 -11
- package/lib/__templates__/expo/client/screens/home/index.tsx +0 -54
- package/lib/__templates__/expo/client/screens/home/styles.ts +0 -332
- package/lib/__templates__/expo/metro.config.js +0 -53
- package/lib/__templates__/expo/src/index.ts +0 -12
- package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
- package/lib/__templates__/react-rsbuild/.coze +0 -11
- package/lib/__templates__/react-rsbuild/.vscode/settings.json +0 -121
- package/lib/__templates__/react-rsbuild/README.md +0 -61
- package/lib/__templates__/react-rsbuild/_gitignore +0 -97
- package/lib/__templates__/react-rsbuild/package.json +0 -31
- package/lib/__templates__/react-rsbuild/pnpm-lock.yaml +0 -997
- package/lib/__templates__/react-rsbuild/rsbuild.config.ts +0 -13
- package/lib/__templates__/react-rsbuild/scripts/dev.sh +0 -51
- package/lib/__templates__/react-rsbuild/scripts/start.sh +0 -15
- package/lib/__templates__/react-rsbuild/src/App.tsx +0 -60
- package/lib/__templates__/react-rsbuild/src/index.css +0 -21
- package/lib/__templates__/react-rsbuild/src/index.html +0 -12
- package/lib/__templates__/react-rsbuild/src/index.tsx +0 -16
- package/lib/__templates__/react-rsbuild/tailwind.config.js +0 -9
- package/lib/__templates__/react-rsbuild/template.config.js +0 -54
- package/lib/__templates__/react-rsbuild/tsconfig.json +0 -17
- package/lib/__templates__/rsbuild/.coze +0 -11
- package/lib/__templates__/rsbuild/.vscode/settings.json +0 -7
- package/lib/__templates__/rsbuild/README.md +0 -61
- package/lib/__templates__/rsbuild/_gitignore +0 -97
- package/lib/__templates__/rsbuild/package.json +0 -24
- package/lib/__templates__/rsbuild/pnpm-lock.yaml +0 -888
- package/lib/__templates__/rsbuild/rsbuild.config.ts +0 -12
- package/lib/__templates__/rsbuild/scripts/dev.sh +0 -51
- package/lib/__templates__/rsbuild/scripts/start.sh +0 -15
- package/lib/__templates__/rsbuild/src/index.html +0 -12
- package/lib/__templates__/rsbuild/src/index.ts +0 -5
- package/lib/__templates__/rsbuild/src/main.ts +0 -65
- package/lib/__templates__/rsbuild/tailwind.config.js +0 -9
- package/lib/__templates__/rsbuild/template.config.js +0 -54
- package/lib/__templates__/rsbuild/tsconfig.json +0 -16
- package/lib/__templates__/vite/.vscode/settings.json +0 -7
- /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
.pnpm-store/
|
|
4
|
+
|
|
5
|
+
# Production
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
dist-*/
|
|
9
|
+
|
|
10
|
+
# Misc
|
|
11
|
+
.DS_Store
|
|
12
|
+
.env
|
|
13
|
+
# .env.local
|
|
14
|
+
.env.development.local
|
|
15
|
+
.env.test.local
|
|
16
|
+
.env.production.local
|
|
17
|
+
|
|
18
|
+
# Logs
|
|
19
|
+
npm-debug.log*
|
|
20
|
+
yarn-debug.log*
|
|
21
|
+
yarn-error.log*
|
|
22
|
+
pnpm-debug.log*
|
|
23
|
+
|
|
24
|
+
# Editor directories and files
|
|
25
|
+
.idea/
|
|
26
|
+
.vscode/
|
|
27
|
+
*.suo
|
|
28
|
+
*.ntvs*
|
|
29
|
+
*.njsproj
|
|
30
|
+
*.sln
|
|
31
|
+
*.sw?
|
|
32
|
+
|
|
33
|
+
# Taro specific
|
|
34
|
+
.taro/
|
|
35
|
+
|
|
36
|
+
# OS X
|
|
37
|
+
.DS_Store
|
|
38
|
+
|
|
39
|
+
# Key
|
|
40
|
+
# key/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
loglevel=error
|
|
2
|
+
registry=https://registry.npmmirror.com
|
|
3
|
+
|
|
4
|
+
strictStorePkgContentCheck=false
|
|
5
|
+
verifyStoreIntegrity=false
|
|
6
|
+
|
|
7
|
+
network-concurrency=16
|
|
8
|
+
fetch-retries=3
|
|
9
|
+
fetch-timeout=60000
|
|
10
|
+
|
|
11
|
+
strict-peer-dependencies=false
|
|
12
|
+
|
|
13
|
+
auto-install-peers=true
|
|
14
|
+
|
|
15
|
+
lockfile=true
|
|
16
|
+
prefer-frozen-lockfile=true
|
|
17
|
+
|
|
18
|
+
resolution-mode=highest
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import tailwindcss from '@tailwindcss/postcss';
|
|
5
|
+
import { UnifiedViteWeappTailwindcssPlugin } from 'weapp-tailwindcss/vite';
|
|
6
|
+
import { defineConfig, type UserConfigExport } from '@tarojs/cli';
|
|
7
|
+
import type { PluginItem } from '@tarojs/taro/types/compile/config/project';
|
|
8
|
+
import dotenv from 'dotenv';
|
|
9
|
+
import devConfig from './dev';
|
|
10
|
+
import prodConfig from './prod';
|
|
11
|
+
import pkg from '../package.json';
|
|
12
|
+
|
|
13
|
+
dotenv.config({ path: path.resolve(__dirname, '../.env.local') });
|
|
14
|
+
|
|
15
|
+
const generateTTProjectConfig = (outputRoot: string) => {
|
|
16
|
+
const config = {
|
|
17
|
+
miniprogramRoot: './',
|
|
18
|
+
projectname: '<%= appName %>',
|
|
19
|
+
appid: process.env.TARO_APP_TT_APPID || '',
|
|
20
|
+
setting: {
|
|
21
|
+
urlCheck: false,
|
|
22
|
+
es6: false,
|
|
23
|
+
postcss: false,
|
|
24
|
+
minified: false,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const outputDir = path.resolve(__dirname, '..', outputRoot);
|
|
28
|
+
if (!fs.existsSync(outputDir)) {
|
|
29
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
30
|
+
}
|
|
31
|
+
fs.writeFileSync(
|
|
32
|
+
path.resolve(outputDir, 'project.config.json'),
|
|
33
|
+
JSON.stringify(config, null, 2),
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
|
|
38
|
+
export default defineConfig<'vite'>(async (merge, _env) => {
|
|
39
|
+
const outputRootMap: Record<string, string> = {
|
|
40
|
+
weapp: 'dist-weapp',
|
|
41
|
+
tt: 'dist-tt',
|
|
42
|
+
h5: 'dist-web',
|
|
43
|
+
};
|
|
44
|
+
const defaultOutputRoot = outputRootMap[process.env.TARO_ENV || ''] || 'dist';
|
|
45
|
+
const outputRoot = process.env.OUTPUT_ROOT?.trim() || defaultOutputRoot;
|
|
46
|
+
const isH5 = process.env.TARO_ENV === 'h5';
|
|
47
|
+
|
|
48
|
+
const buildMiniCIPluginConfig = () => {
|
|
49
|
+
const hasWeappConfig = !!process.env.TARO_APP_WEAPP_APPID;
|
|
50
|
+
const hasTTConfig = !!process.env.TARO_APP_TT_EMAIL;
|
|
51
|
+
if (!hasWeappConfig && !hasTTConfig) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const miniCIConfig: Record<string, any> = {
|
|
55
|
+
version: pkg.version,
|
|
56
|
+
desc: pkg.description,
|
|
57
|
+
};
|
|
58
|
+
if (hasWeappConfig) {
|
|
59
|
+
miniCIConfig.weapp = {
|
|
60
|
+
appid: process.env.TARO_APP_WEAPP_APPID,
|
|
61
|
+
privateKeyPath: 'key/private.appid.key',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (hasTTConfig) {
|
|
65
|
+
miniCIConfig.tt = {
|
|
66
|
+
email: process.env.TARO_APP_TT_EMAIL,
|
|
67
|
+
password: process.env.TARO_APP_TT_PASSWORD,
|
|
68
|
+
setting: {
|
|
69
|
+
skipDomainCheck: true,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return [['@tarojs/plugin-mini-ci', miniCIConfig]] as PluginItem[];
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const baseConfig: UserConfigExport<'vite'> = {
|
|
77
|
+
projectName: '<%= appName %>',
|
|
78
|
+
date: '2026-1-13',
|
|
79
|
+
alias: {
|
|
80
|
+
'@': path.resolve(__dirname, '..', 'src'),
|
|
81
|
+
},
|
|
82
|
+
designWidth: 750,
|
|
83
|
+
deviceRatio: {
|
|
84
|
+
640: 2.34 / 2,
|
|
85
|
+
750: 1,
|
|
86
|
+
375: 2,
|
|
87
|
+
828: 1.81 / 2,
|
|
88
|
+
},
|
|
89
|
+
sourceRoot: 'src',
|
|
90
|
+
outputRoot,
|
|
91
|
+
plugins: ['@tarojs/plugin-generator', ...buildMiniCIPluginConfig()],
|
|
92
|
+
defineConstants: {
|
|
93
|
+
PROJECT_DOMAIN: JSON.stringify(
|
|
94
|
+
process.env.PROJECT_DOMAIN ||
|
|
95
|
+
process.env.COZE_PROJECT_DOMAIN_DEFAULT ||
|
|
96
|
+
'',
|
|
97
|
+
),
|
|
98
|
+
TARO_ENV: JSON.stringify(process.env.TARO_ENV),
|
|
99
|
+
},
|
|
100
|
+
copy: {
|
|
101
|
+
patterns: [],
|
|
102
|
+
options: {},
|
|
103
|
+
},
|
|
104
|
+
...(process.env.TARO_ENV === 'tt' && {
|
|
105
|
+
tt: {
|
|
106
|
+
appid: process.env.TARO_APP_TT_APPID,
|
|
107
|
+
projectName: '<%= appName %>',
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
jsMinimizer: 'esbuild',
|
|
111
|
+
framework: 'react',
|
|
112
|
+
compiler: {
|
|
113
|
+
type: 'vite',
|
|
114
|
+
vitePlugins: [
|
|
115
|
+
{
|
|
116
|
+
name: 'postcss-config-loader-plugin',
|
|
117
|
+
config(config) {
|
|
118
|
+
// 通过 postcss 配置注册 tailwindcss 插件
|
|
119
|
+
if (typeof config.css?.postcss === 'object') {
|
|
120
|
+
config.css?.postcss.plugins?.unshift(tailwindcss());
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'hmr-config-plugin',
|
|
126
|
+
config() {
|
|
127
|
+
if (!process.env.PROJECT_DOMAIN) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
server: {
|
|
132
|
+
hmr: {
|
|
133
|
+
overlay: true,
|
|
134
|
+
path: '/hot/vite-hmr',
|
|
135
|
+
port: 6000,
|
|
136
|
+
clientPort: 443,
|
|
137
|
+
timeout: 30000,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
...(isH5
|
|
144
|
+
? []
|
|
145
|
+
: [
|
|
146
|
+
UnifiedViteWeappTailwindcssPlugin({
|
|
147
|
+
rem2rpx: true,
|
|
148
|
+
cssEntries: [path.resolve(__dirname, '../src/app.css')],
|
|
149
|
+
}),
|
|
150
|
+
]),
|
|
151
|
+
...(process.env.TARO_ENV === 'tt'
|
|
152
|
+
? [
|
|
153
|
+
{
|
|
154
|
+
name: 'generate-tt-project-config',
|
|
155
|
+
closeBundle() {
|
|
156
|
+
generateTTProjectConfig(outputRoot);
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
]
|
|
160
|
+
: []),
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
mini: {
|
|
164
|
+
postcss: {
|
|
165
|
+
pxtransform: {
|
|
166
|
+
enable: true,
|
|
167
|
+
config: {},
|
|
168
|
+
},
|
|
169
|
+
cssModules: {
|
|
170
|
+
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
|
171
|
+
config: {
|
|
172
|
+
namingPattern: 'module', // 转换模式,取值为 global/module
|
|
173
|
+
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
h5: {
|
|
179
|
+
publicPath: './',
|
|
180
|
+
staticDirectory: 'static',
|
|
181
|
+
router: {
|
|
182
|
+
mode: 'hash',
|
|
183
|
+
},
|
|
184
|
+
devServer: {
|
|
185
|
+
port: <%= port %>,
|
|
186
|
+
host: '0.0.0.0',
|
|
187
|
+
open: false,
|
|
188
|
+
proxy: {
|
|
189
|
+
'/api': {
|
|
190
|
+
target: 'http://localhost:<%= serverPort %>',
|
|
191
|
+
changeOrigin: true,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
miniCssExtractPluginOption: {
|
|
196
|
+
ignoreOrder: true,
|
|
197
|
+
filename: 'css/[name].[hash].css',
|
|
198
|
+
chunkFilename: 'css/[name].[chunkhash].css',
|
|
199
|
+
},
|
|
200
|
+
postcss: {
|
|
201
|
+
autoprefixer: {
|
|
202
|
+
enable: true,
|
|
203
|
+
config: {},
|
|
204
|
+
},
|
|
205
|
+
pxtransform: {
|
|
206
|
+
enable: true,
|
|
207
|
+
config: {
|
|
208
|
+
platform: 'h5',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
cssModules: {
|
|
212
|
+
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
|
213
|
+
config: {
|
|
214
|
+
namingPattern: 'module', // 转换模式,取值为 global/module
|
|
215
|
+
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
rn: {
|
|
221
|
+
appName: '<%= appName %>',
|
|
222
|
+
postcss: {
|
|
223
|
+
cssModules: {
|
|
224
|
+
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
process.env.BROWSERSLIST_ENV = process.env.NODE_ENV;
|
|
231
|
+
|
|
232
|
+
if (process.env.NODE_ENV === 'development') {
|
|
233
|
+
// 本地开发构建配置(不混淆压缩)
|
|
234
|
+
return merge({}, baseConfig, devConfig);
|
|
235
|
+
}
|
|
236
|
+
// 生产构建配置(默认开启压缩混淆等)
|
|
237
|
+
return merge({}, baseConfig, prodConfig);
|
|
238
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { UserConfigExport } from '@tarojs/cli';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
mini: {},
|
|
5
|
+
h5: {
|
|
6
|
+
legacy: false,
|
|
7
|
+
/**
|
|
8
|
+
* WebpackChain 插件配置
|
|
9
|
+
* @docs https://github.com/neutrinojs/webpack-chain
|
|
10
|
+
*/
|
|
11
|
+
// webpackChain (chain) {
|
|
12
|
+
// /**
|
|
13
|
+
// * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
|
|
14
|
+
// * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
|
|
15
|
+
// */
|
|
16
|
+
// chain.plugin('analyzer')
|
|
17
|
+
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
|
|
18
|
+
// /**
|
|
19
|
+
// * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
|
|
20
|
+
// * @docs https://github.com/chrisvfritz/prerender-spa-plugin
|
|
21
|
+
// */
|
|
22
|
+
// const path = require('path')
|
|
23
|
+
// const Prerender = require('prerender-spa-plugin')
|
|
24
|
+
// const staticDir = path.join(__dirname, '..', 'dist')
|
|
25
|
+
// chain
|
|
26
|
+
// .plugin('prerender')
|
|
27
|
+
// .use(new Prerender({
|
|
28
|
+
// staticDir,
|
|
29
|
+
// routes: [ '/pages/index/index' ],
|
|
30
|
+
// postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
|
|
31
|
+
// }))
|
|
32
|
+
// }
|
|
33
|
+
},
|
|
34
|
+
} satisfies UserConfigExport<'vite'>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
const compat = new FlatCompat({
|
|
9
|
+
baseDirectory: __dirname,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export default [
|
|
13
|
+
...compat.extends('taro/react'),
|
|
14
|
+
{
|
|
15
|
+
rules: {
|
|
16
|
+
'react/jsx-uses-react': 'off',
|
|
17
|
+
'react/react-in-jsx-scope': 'off',
|
|
18
|
+
'jsx-quotes': ['error', 'prefer-double'],
|
|
19
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
20
|
+
'tailwindcss/classnames-order': 'off',
|
|
21
|
+
'tailwindcss/no-custom-classname': 'off',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
files: ['src/**/*.{js,jsx,ts,tsx}'],
|
|
26
|
+
ignores: ['src/network.ts'],
|
|
27
|
+
rules: {
|
|
28
|
+
'no-restricted-syntax': [
|
|
29
|
+
'error',
|
|
30
|
+
{
|
|
31
|
+
selector:
|
|
32
|
+
"MemberExpression[object.name='process'][property.name='env']",
|
|
33
|
+
message:
|
|
34
|
+
'工程规范:请勿在 src 目录下直接使用 process.env\n如需获取 URL 请求前缀,请使用已经注入全局的 PROJECT_DOMAIN',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
selector:
|
|
38
|
+
":matches(ExportNamedDeclaration, ExportDefaultDeclaration) :matches([id.name='Network'], [declaration.id.name='Network'])",
|
|
39
|
+
message:
|
|
40
|
+
"工程规范:禁止自行定义 Network,项目已提供 src/network.ts,请直接使用: import { Network } from '@/network'",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
selector:
|
|
44
|
+
'Literal[value=/(^|\\s)(?:[^\\s:]+:)*(bg|text|border|divide|outline|ring|ring-offset|from|to|via|decoration|shadow|accent|caret|fill|stroke)-[a-z0-9-]+\\/([0-9]+|\\[[^\\]]+\\])/], TemplateElement[value.raw=/(^|\\s)(?:[^\\s:]+:)*(bg|text|border|divide|outline|ring|ring-offset|from|to|via|decoration|shadow|accent|caret|fill|stroke)-[a-z0-9-]+\\/([0-9]+|\\[[^\\]]+\\])/]',
|
|
45
|
+
message:
|
|
46
|
+
'微信小程序兼容性:禁用 Tailwind 颜色不透明度简写(如 bg-primary/10),该语法在微信小程序下 opacity 会丢失。请拆分写(如 bg-primary bg-opacity-10)。',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
selector:
|
|
50
|
+
'Literal[value=/(^|\\s)peer-[a-z0-9-]+\\b/], TemplateElement[value.raw=/(^|\\s)peer-[a-z0-9-]+\\b/]',
|
|
51
|
+
message:
|
|
52
|
+
'微信小程序兼容性:不支持 Tailwind 的 peer-*(如 peer-checked、peer-disabled)。',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
selector:
|
|
56
|
+
'Literal[value=/(^|\\s)group-[a-z0-9-]+\\b/], TemplateElement[value.raw=/(^|\\s)group-[a-z0-9-]+\\b/]',
|
|
57
|
+
message:
|
|
58
|
+
'微信小程序兼容性:不支持 Tailwind 的 group-*(如 group-hover)。',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
selector:
|
|
62
|
+
'Literal[value=/\\b(?!gap(?:-x|-y)?-)[a-zA-Z0-9-]+\\-[0-9]+\\.[0-9]+\\b/], TemplateElement[value.raw=/\\b(?!gap(?:-x|-y)?-)[a-zA-Z0-9-]+\\-[0-9]+\\.[0-9]+\\b/]',
|
|
63
|
+
message:
|
|
64
|
+
'微信小程序兼容性:禁用 Tailwind 小数值类名(如 space-y-1.5、w-0.5),请用整数替代(如 space-y-2、w-1)。',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
selector:
|
|
68
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\:has\\(/], TemplateElement[value.raw=/\\:has\\(/])",
|
|
69
|
+
message:
|
|
70
|
+
'微信小程序兼容性:WXSS 不支持 :has(...)(会导致预览上传失败)。',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
selector:
|
|
74
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/(^|\\s)has-[^\\s]+/], TemplateElement[value.raw=/(^|\\s)has-[^\\s]+/])",
|
|
75
|
+
message:
|
|
76
|
+
'微信小程序兼容性:禁用 Tailwind 的 has-* 变体(会生成 :has,导致预览上传失败)。',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
selector:
|
|
80
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[&>\\*/], TemplateElement[value.raw=/\\[&>\\*/])",
|
|
81
|
+
message:
|
|
82
|
+
'微信小程序兼容性:禁用 [&>*...](可能生成非法 WXSS,如 >:last-child)。请改为 [&>view] 等明确标签。',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
selector:
|
|
86
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[&[^\\]]*\\[data-/], TemplateElement[value.raw=/\\[&[^\\]]*\\[data-/])",
|
|
87
|
+
message:
|
|
88
|
+
'微信小程序兼容性:禁用 Tailwind 任意选择器里的属性选择器(如 [&>[data-...]]),可能导致预览上传失败。',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
selector:
|
|
92
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[[^\\]]*&[^\\]]*~[^\\]]*\\]/], TemplateElement[value.raw=/\\[[^\\]]*&[^\\]]*~[^\\]]*\\]/])",
|
|
93
|
+
message: '微信小程序兼容性:WXSS 不支持 ~(会导致预览上传失败)。',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
'no-restricted-properties': [
|
|
97
|
+
'error',
|
|
98
|
+
{
|
|
99
|
+
object: 'Taro',
|
|
100
|
+
property: 'request',
|
|
101
|
+
message:
|
|
102
|
+
"工程规范:请使用 Network.request 替代 Taro.request,导入方式: import { Network } from '@/network'",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
object: 'Taro',
|
|
106
|
+
property: 'uploadFile',
|
|
107
|
+
message:
|
|
108
|
+
"工程规范:请使用 Network.uploadFile 替代 Taro.uploadFile,导入方式: import { Network } from '@/network'",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
object: 'Taro',
|
|
112
|
+
property: 'downloadFile',
|
|
113
|
+
message:
|
|
114
|
+
"工程规范:请使用 Network.downloadFile 替代 Taro.downloadFile,导入方式: import { Network } from '@/network'",
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
files: ['src/pages/index/index.tsx'],
|
|
121
|
+
rules: {
|
|
122
|
+
'no-restricted-syntax': [
|
|
123
|
+
'error',
|
|
124
|
+
{
|
|
125
|
+
selector: 'JSXText[value=/应用开发中/]',
|
|
126
|
+
message:
|
|
127
|
+
'工程规范:检测到首页 (src/pages/index/index) 仍为默认占位页面,这会导致用户无法进入新增页面,请根据用户需求开发实际的首页功能和界面。如果已经开发了新的首页,也需要删除旧首页,并更新 src/app.config.ts 文件',
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
ignores: ['dist/**', 'dist-*/**', 'node_modules/**'],
|
|
134
|
+
},
|
|
135
|
+
];
|
|
File without changes
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= appName %>",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Coze Mini Program Application",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "pnpm exec concurrently --kill-others-on-fail --kill-signal SIGKILL -n lint,tsc,web,weapp,tt,server -c red,blue,green,yellow,cyan,magenta \"pnpm lint:build\" \"pnpm tsc\" \"pnpm build:web\" \"pnpm build:weapp\" \"pnpm build:tt\" \"pnpm build:server\"",
|
|
8
|
+
"build:server": "pnpm --filter server build",
|
|
9
|
+
"build:tt": "taro build --type tt",
|
|
10
|
+
"build:weapp": "taro build --type weapp",
|
|
11
|
+
"build:web": "taro build --type h5",
|
|
12
|
+
"dev": "pnpm exec concurrently --kill-others --kill-signal SIGKILL -n web,server -c blue,green \"pnpm dev:web\" \"pnpm dev:server\"",
|
|
13
|
+
"dev:server": "pnpm --filter server dev",
|
|
14
|
+
"dev:tt": "taro build --type tt --watch",
|
|
15
|
+
"dev:weapp": "taro build --type weapp --watch",
|
|
16
|
+
"dev:web": "taro build --type h5 --watch",
|
|
17
|
+
"preinstall": "npx only-allow pnpm",
|
|
18
|
+
"postinstall": "weapp-tw patch",
|
|
19
|
+
"kill:all": "pkill -9 -f 'concurrently' 2>/dev/null || true; pkill -9 -f 'nest start' 2>/dev/null || true; pkill -9 -f 'taro build' 2>/dev/null || true; pkill -9 -f 'node.*dev' 2>/dev/null || true; echo 'All dev processes cleaned'",
|
|
20
|
+
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
21
|
+
"lint:build": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --max-warnings=0",
|
|
22
|
+
"lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
23
|
+
"new": "taro new",
|
|
24
|
+
"preview:tt": "taro build --type tt --preview",
|
|
25
|
+
"preview:weapp": "taro build --type weapp --preview",
|
|
26
|
+
"tsc": "npx tsc --noEmit --skipLibCheck",
|
|
27
|
+
"validate": "pnpm exec concurrently --kill-others-on-fail --kill-signal SIGKILL -n lint,tsc -c red,blue \"pnpm lint:build\" \"pnpm tsc\""
|
|
28
|
+
},
|
|
29
|
+
"lint-staged": {
|
|
30
|
+
"src/**/*.{js,jsx,ts,tsx}": [
|
|
31
|
+
"eslint"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"browserslist": [
|
|
35
|
+
"last 3 versions",
|
|
36
|
+
"Android >= 4.1",
|
|
37
|
+
"ios >= 8"
|
|
38
|
+
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@babel/runtime": "^7.24.4",
|
|
41
|
+
"@tarojs/components": "4.1.9",
|
|
42
|
+
"@tarojs/helper": "4.1.9",
|
|
43
|
+
"@tarojs/plugin-framework-react": "4.1.9",
|
|
44
|
+
"@tarojs/plugin-platform-h5": "4.1.9",
|
|
45
|
+
"@tarojs/plugin-platform-tt": "4.1.9",
|
|
46
|
+
"@tarojs/plugin-platform-weapp": "4.1.9",
|
|
47
|
+
"@tarojs/react": "4.1.9",
|
|
48
|
+
"@tarojs/runtime": "4.1.9",
|
|
49
|
+
"@tarojs/shared": "4.1.9",
|
|
50
|
+
"@tarojs/taro": "4.1.9",
|
|
51
|
+
"class-variance-authority": "^0.7.1",
|
|
52
|
+
"clsx": "^2.1.1",
|
|
53
|
+
"date-fns": "^4.1.0",
|
|
54
|
+
"lucide-react-taro": "^1.3.0",
|
|
55
|
+
"react": "^18.0.0",
|
|
56
|
+
"react-dom": "^18.0.0",
|
|
57
|
+
"tailwind-merge": "^3.5.0",
|
|
58
|
+
"tailwindcss-animate": "^1.0.7",
|
|
59
|
+
"zustand": "^5.0.9"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@babel/core": "^7.24.4",
|
|
63
|
+
"@babel/plugin-transform-class-properties": "7.25.9",
|
|
64
|
+
"@babel/preset-react": "^7.24.1",
|
|
65
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
66
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
67
|
+
"@tarojs/cli": "4.1.9",
|
|
68
|
+
"@tarojs/plugin-generator": "4.1.9",
|
|
69
|
+
"@tarojs/plugin-mini-ci": "^4.1.9",
|
|
70
|
+
"@tarojs/vite-runner": "4.1.9",
|
|
71
|
+
"@types/minimatch": "^5",
|
|
72
|
+
"@types/react": "^18.0.0",
|
|
73
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
74
|
+
"babel-preset-taro": "4.1.9",
|
|
75
|
+
"concurrently": "^9.2.1",
|
|
76
|
+
"dotenv": "^17.2.3",
|
|
77
|
+
"eslint": "^8.57.0",
|
|
78
|
+
"eslint-config-taro": "4.1.9",
|
|
79
|
+
"eslint-plugin-react": "^7.34.1",
|
|
80
|
+
"eslint-plugin-react-hooks": "^4.4.0",
|
|
81
|
+
"eslint-plugin-tailwindcss": "^3.18.2",
|
|
82
|
+
"less": "^4.2.0",
|
|
83
|
+
"lint-staged": "^16.1.2",
|
|
84
|
+
"miniprogram-ci": "^2.1.26",
|
|
85
|
+
"only-allow": "^1.2.2",
|
|
86
|
+
"postcss": "^8.5.6",
|
|
87
|
+
"react-refresh": "^0.14.0",
|
|
88
|
+
"stylelint": "^16.4.0",
|
|
89
|
+
"stylelint-config-standard": "^38.0.0",
|
|
90
|
+
"tailwindcss": "^4.1.18",
|
|
91
|
+
"terser": "^5.30.4",
|
|
92
|
+
"tt-ide-cli": "^0.1.31",
|
|
93
|
+
"typescript": "^5.4.5",
|
|
94
|
+
"vite": "^4.2.0",
|
|
95
|
+
"weapp-tailwindcss": "^4.10.3"
|
|
96
|
+
},
|
|
97
|
+
"packageManager": "pnpm@9.0.0",
|
|
98
|
+
"engines": {
|
|
99
|
+
"pnpm": ">=9.0.0"
|
|
100
|
+
},
|
|
101
|
+
"pnpm": {
|
|
102
|
+
"patchedDependencies": {
|
|
103
|
+
"@tarojs/plugin-mini-ci@4.1.9": "patches/@tarojs__plugin-mini-ci@4.1.9.patch"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"templateInfo": {
|
|
107
|
+
"name": "default",
|
|
108
|
+
"typescript": true,
|
|
109
|
+
"css": "Less",
|
|
110
|
+
"framework": "React"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
diff --git a/dist/TTCI.js b/dist/TTCI.js
|
|
2
|
+
index e5fe6a5f9a0ca8670ffa2b7e14cdfd8d49d0d792..6f24020a3388ea8fc7d1cbc41c1df104a8c37cb8 100644
|
|
3
|
+
--- a/dist/TTCI.js
|
|
4
|
+
+++ b/dist/TTCI.js
|
|
5
|
+
@@ -63,7 +63,10 @@ class TTCI extends BaseCi_1.default {
|
|
6
|
+
output: previewQrcodePath,
|
|
7
|
+
},
|
|
8
|
+
copyToClipboard: true,
|
|
9
|
+
- cache: true
|
|
10
|
+
+ cache: true,
|
|
11
|
+
+ ideConfig: {
|
|
12
|
+
+ skipDomainCheck: this.pluginOpts.tt && this.pluginOpts.tt.setting && this.pluginOpts.tt.setting.skipDomainCheck
|
|
13
|
+
+ }
|
|
14
|
+
});
|
|
15
|
+
console.log(chalk.green(`开发版上传成功 ${new Date().toLocaleString()}\n`));
|
|
16
|
+
const qrContent = previewResult.shortUrl;
|
|
17
|
+
diff --git a/dist/index.js b/dist/index.js
|
|
18
|
+
index bb245e34a477bcd738b18fdd754b252a456efe4f..588fe56131be52de2d798ee959ef257b4fa53313 100644
|
|
19
|
+
--- a/dist/index.js
|
|
20
|
+
+++ b/dist/index.js
|
|
21
|
+
@@ -43,7 +43,8 @@ exports.default = (ctx, _pluginOpts) => {
|
|
22
|
+
/** 字节跳动小程序上传配置 */
|
|
23
|
+
tt: joi.object({
|
|
24
|
+
email: joi.string().required(),
|
|
25
|
+
- password: joi.string().required()
|
|
26
|
+
+ password: joi.string().required(),
|
|
27
|
+
+ setting: joi.object()
|
|
28
|
+
}),
|
|
29
|
+
/** 阿里小程序上传配置 */
|
|
30
|
+
alipay: joi.alternatives().try(joi.object({
|