@4399ywkf/cli 0.0.21 → 1.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/dist/cli.js +19 -638
- package/dist/templates/404/index.tsx +5 -0
- package/dist/templates/404/page.tsx +27 -0
- package/dist/templates/404.png +0 -0
- package/dist/templates/404.tsx +5 -0
- package/dist/templates/BaseLayout.tsx +15 -0
- package/dist/templates/ColorScales/ScaleRow.tsx +74 -0
- package/dist/templates/ColorScales/index.md +168 -0
- package/dist/templates/ColorScales/index.tsx +70 -0
- package/dist/templates/ColorScales/style.ts +42 -0
- package/dist/templates/ConfigProvider/index.md +63 -0
- package/dist/templates/ConfigProvider/index.tsx +42 -0
- package/dist/templates/ContentFormWrapper.tsx +11 -0
- package/dist/templates/ContentWrapper.module.less +137 -0
- package/dist/templates/ContentWrapper.tsx +13 -0
- package/dist/templates/ErrorBoundary/index.tsx +506 -0
- package/dist/templates/FontLoader/index.md +12 -0
- package/dist/templates/FontLoader/index.tsx +41 -0
- package/dist/templates/GlobalStyle/antdOverride.ts +89 -0
- package/dist/templates/GlobalStyle/global.ts +61 -0
- package/dist/templates/GlobalStyle/index.ts +10 -0
- package/dist/templates/Loading/__tests__/Loading.test.tsx +23 -0
- package/dist/templates/Loading/index.tsx +21 -0
- package/dist/templates/Loading.test.tsx +23 -0
- package/dist/templates/Locale.tsx +89 -0
- package/dist/templates/MainContentWrap.tsx +68 -0
- package/dist/templates/ManualSlave/ManualSlavePage.module.less +25 -0
- package/dist/templates/ManualSlave/ManualSlavePage.tsx +45 -0
- package/dist/templates/ManualSlave/index.ts +1 -0
- package/dist/templates/ManualSlavePage.module.less +25 -0
- package/dist/templates/ManualSlavePage.tsx +45 -0
- package/dist/templates/Meta.tsx +75 -0
- package/dist/templates/RequireAuth/RequireAuth.tsx +76 -0
- package/dist/templates/RequireAuth/index.ts +1 -0
- package/dist/templates/RequireAuth.tsx +76 -0
- package/dist/templates/RoutesConventionsRspackPlugin.js +100 -0
- package/dist/templates/ScaleRow.tsx +74 -0
- package/dist/templates/ThemeContext.tsx +132 -0
- package/dist/templates/ThemeProvider/GlobalStyle/antdOverride.ts +89 -0
- package/dist/templates/ThemeProvider/GlobalStyle/global.ts +61 -0
- package/dist/templates/ThemeProvider/GlobalStyle/index.ts +10 -0
- package/dist/templates/ThemeProvider/Meta.tsx +75 -0
- package/dist/templates/ThemeProvider/ThemeProvider.tsx +109 -0
- package/dist/templates/ThemeProvider/index.md +69 -0
- package/dist/templates/ThemeProvider/index.ts +3 -0
- package/dist/templates/ThemeProvider/type.ts +28 -0
- package/dist/templates/ThemeProvider.tsx +109 -0
- package/dist/templates/__mocks__/fileMock.js +1 -0
- package/dist/templates/__mocks__/styleMock.ts +1 -0
- package/dist/templates/__tests__/Loading.test.tsx +23 -0
- package/dist/templates/__tests__/example.test.ts +7 -0
- package/dist/templates/actions.ts +23 -0
- package/dist/templates/algorithms/darkAlgorithm.ts +47 -0
- package/dist/templates/algorithms/lightAlgorithm.ts +44 -0
- package/dist/templates/antdOverride.ts +89 -0
- package/dist/templates/antdTheme.ts +62 -0
- package/dist/templates/api.ts +5 -0
- package/dist/templates/app/.browserslistrc +5 -0
- package/dist/templates/app/.gitignore.tpl +30 -0
- package/dist/templates/app/.npmrc.tpl +2 -0
- package/dist/templates/app/.nvmrc +1 -0
- package/dist/templates/app/.vscode/settings.json +88 -0
- package/dist/templates/app/config/env/.env.development +5 -0
- package/dist/templates/app/config/env/.env.production +2 -0
- package/dist/templates/app/config/env/.env.public.tpl +31 -0
- package/dist/templates/app/config/jwt/index.ts +31 -0
- package/dist/templates/app/config/public/404.png +0 -0
- package/dist/templates/app/config/public/favicon.ico +0 -0
- package/dist/templates/app/config/public/images/banner_market_modal.webp +0 -0
- package/dist/templates/app/config/public/images/chatmode_chat_dark.webp +0 -0
- package/dist/templates/app/config/public/images/chatmode_chat_light.webp +0 -0
- package/dist/templates/app/config/public/images/chatmode_docs_dark.webp +0 -0
- package/dist/templates/app/config/public/images/chatmode_docs_light.webp +0 -0
- package/dist/templates/app/config/public/images/empty_topic_dark.webp +0 -0
- package/dist/templates/app/config/public/images/empty_topic_light.webp +0 -0
- package/dist/templates/app/config/public/images/screenshot_background.webp +0 -0
- package/dist/templates/app/config/public/images/theme_auto.webp +0 -0
- package/dist/templates/app/config/public/images/theme_dark.webp +0 -0
- package/dist/templates/app/config/public/images/theme_light.webp +0 -0
- package/dist/templates/app/config/public/index.html +29 -0
- package/dist/templates/app/config/request/index.ts +174 -0
- package/dist/templates/app/config/router/index.tsx +26 -0
- package/dist/templates/app/config/rspack/paths.js +12 -0
- package/dist/templates/app/config/rspack/plugins/RoutesConventionsRspackPlugin.js +100 -0
- package/dist/templates/app/config/rspack/rspack.config.mjs +186 -0
- package/dist/templates/app/config/rspack/rspack.dev.mjs +219 -0
- package/dist/templates/app/config/rspack/rspack.prod.mjs +254 -0
- package/dist/templates/app/config/sentry/sentry.config.ts +188 -0
- package/dist/templates/app/locales/en-US/common.json +74 -0
- package/dist/templates/app/locales/en-US/generate.json +71 -0
- package/dist/templates/app/locales/en-US/nav.json +10 -0
- package/dist/templates/app/locales/en-US/overview.json +6 -0
- package/dist/templates/app/locales/en-US/retopology.json +4 -0
- package/dist/templates/app/locales/en-US/rigging.json +21 -0
- package/dist/templates/app/locales/en-US/segmentation.json +4 -0
- package/dist/templates/app/locales/en-US/stylization.json +11 -0
- package/dist/templates/app/locales/en-US/texture.json +4 -0
- package/dist/templates/app/locales/en-US/threeModel.json +9 -0
- package/dist/templates/app/locales/en-US/toolbox.json +11 -0
- package/dist/templates/app/locales/zh-CN/common.json +74 -0
- package/dist/templates/app/locales/zh-CN/generate.json +71 -0
- package/dist/templates/app/locales/zh-CN/nav.json +10 -0
- package/dist/templates/app/locales/zh-CN/overview.json +6 -0
- package/dist/templates/app/locales/zh-CN/retopology.json +4 -0
- package/dist/templates/app/locales/zh-CN/rigging.json +21 -0
- package/dist/templates/app/locales/zh-CN/segmentation.json +4 -0
- package/dist/templates/app/locales/zh-CN/stylization.json +11 -0
- package/dist/templates/app/locales/zh-CN/texture.json +4 -0
- package/dist/templates/app/locales/zh-CN/threeModel.json +9 -0
- package/dist/templates/app/locales/zh-CN/toolbox.json +11 -0
- package/dist/templates/app/package.json.tpl +145 -0
- package/dist/templates/app/postcss.config.js +6 -0
- package/dist/templates/app/react-app-env.d.ts +14 -0
- package/dist/templates/app/scripts/convert-locales-to-json.js +47 -0
- package/dist/templates/app/src/__mocks__/fileMock.js +1 -0
- package/dist/templates/app/src/__mocks__/styleMock.ts +1 -0
- package/dist/templates/app/src/color/ColorScales/ScaleRow.tsx +74 -0
- package/dist/templates/app/src/color/ColorScales/index.md +168 -0
- package/dist/templates/app/src/color/ColorScales/index.tsx +70 -0
- package/dist/templates/app/src/color/ColorScales/style.ts +42 -0
- package/dist/templates/app/src/color/colors/blue.ts +66 -0
- package/dist/templates/app/src/color/colors/cyan.ts +66 -0
- package/dist/templates/app/src/color/colors/geekblue.ts +66 -0
- package/dist/templates/app/src/color/colors/gold.ts +66 -0
- package/dist/templates/app/src/color/colors/gray.ts +66 -0
- package/dist/templates/app/src/color/colors/green.ts +66 -0
- package/dist/templates/app/src/color/colors/index.ts +66 -0
- package/dist/templates/app/src/color/colors/lime.ts +66 -0
- package/dist/templates/app/src/color/colors/magenta.ts +66 -0
- package/dist/templates/app/src/color/colors/orange.ts +66 -0
- package/dist/templates/app/src/color/colors/primary.ts +66 -0
- package/dist/templates/app/src/color/colors/purple.ts +66 -0
- package/dist/templates/app/src/color/colors/red.ts +66 -0
- package/dist/templates/app/src/color/colors/volcano.ts +66 -0
- package/dist/templates/app/src/color/colors/yellow.ts +66 -0
- package/dist/templates/app/src/color/index.ts +4 -0
- package/dist/templates/app/src/color/neutrals/index.ts +30 -0
- package/dist/templates/app/src/color/neutrals/mauve.ts +66 -0
- package/dist/templates/app/src/color/neutrals/olive.ts +66 -0
- package/dist/templates/app/src/color/neutrals/sage.ts +66 -0
- package/dist/templates/app/src/color/neutrals/sand.ts +66 -0
- package/dist/templates/app/src/color/neutrals/slate.ts +66 -0
- package/dist/templates/app/src/color/types.ts +21 -0
- package/dist/templates/app/src/components/ConfigProvider/index.md +63 -0
- package/dist/templates/app/src/components/ConfigProvider/index.tsx +42 -0
- package/dist/templates/app/src/components/ErrorBoundary/index.tsx +506 -0
- package/dist/templates/app/src/components/FontLoader/index.md +12 -0
- package/dist/templates/app/src/components/FontLoader/index.tsx +41 -0
- package/dist/templates/app/src/components/Loading/__tests__/Loading.test.tsx +23 -0
- package/dist/templates/app/src/components/Loading/index.tsx +21 -0
- package/dist/templates/app/src/components/ManualSlave/ManualSlavePage.module.less +25 -0
- package/dist/templates/app/src/components/ManualSlave/ManualSlavePage.tsx +45 -0
- package/dist/templates/app/src/components/ManualSlave/index.ts +1 -0
- package/dist/templates/app/src/components/RequireAuth/RequireAuth.tsx +76 -0
- package/dist/templates/app/src/components/RequireAuth/index.ts +1 -0
- package/dist/templates/app/src/components/ThemeProvider/GlobalStyle/antdOverride.ts +89 -0
- package/dist/templates/app/src/components/ThemeProvider/GlobalStyle/global.ts +61 -0
- package/dist/templates/app/src/components/ThemeProvider/GlobalStyle/index.ts +10 -0
- package/dist/templates/app/src/components/ThemeProvider/Meta.tsx +75 -0
- package/dist/templates/app/src/components/ThemeProvider/ThemeProvider.tsx +109 -0
- package/dist/templates/app/src/components/ThemeProvider/index.md +69 -0
- package/dist/templates/app/src/components/ThemeProvider/index.ts +3 -0
- package/dist/templates/app/src/components/ThemeProvider/type.ts +28 -0
- package/dist/templates/app/src/const/constants.ts +0 -0
- package/dist/templates/app/src/const/locale.ts +9 -0
- package/dist/templates/app/src/const/system.ts +1 -0
- package/dist/templates/app/src/const/theme.ts +5 -0
- package/dist/templates/app/src/const/url.ts +1 -0
- package/dist/templates/app/src/hooks/useRouteTitle.tsx +36 -0
- package/dist/templates/app/src/hooks/useSentry.ts +92 -0
- package/dist/templates/app/src/index.css +2 -0
- package/dist/templates/app/src/index.tsx +56 -0
- package/dist/templates/app/src/layout/BaseLayout.tsx +15 -0
- package/dist/templates/app/src/layout/ContentFormWrapper.tsx +11 -0
- package/dist/templates/app/src/layout/ContentWrapper.module.less +137 -0
- package/dist/templates/app/src/layout/ContentWrapper.tsx +13 -0
- package/dist/templates/app/src/layout/Locale.tsx +89 -0
- package/dist/templates/app/src/layout/MainContentWrap.tsx +68 -0
- package/dist/templates/app/src/layout/ThemeContext.tsx +132 -0
- package/dist/templates/app/src/loading.tsx +52 -0
- package/dist/templates/app/src/locales/create.ts +56 -0
- package/dist/templates/app/src/locales/default/chat.ts +455 -0
- package/dist/templates/app/src/locales/default/index.ts +7 -0
- package/dist/templates/app/src/locales/resources.ts +104 -0
- package/dist/templates/app/src/pages/404/index.tsx +5 -0
- package/dist/templates/app/src/pages/404/page.tsx +27 -0
- package/dist/templates/app/src/pages/404.tsx +5 -0
- package/dist/templates/app/src/pages/base/index.tsx +32 -0
- package/dist/templates/app/src/pages/base/layout.tsx +6 -0
- package/dist/templates/app/src/pages/base/page.tsx +25 -0
- package/dist/templates/app/src/pages/index.css +282 -0
- package/dist/templates/app/src/pages/index.tsx +5 -0
- package/dist/templates/app/src/routes.tsx +18 -0
- package/dist/templates/app/src/setupTests.ts +39 -0
- package/dist/templates/app/src/styles/antdOverride.ts +24 -0
- package/dist/templates/app/src/styles/customTheme.ts +70 -0
- package/dist/templates/app/src/styles/global.ts +53 -0
- package/dist/templates/app/src/styles/highlighter.ts +34 -0
- package/dist/templates/app/src/styles/index.ts +23 -0
- package/dist/templates/app/src/styles/mermaid.ts +7 -0
- package/dist/templates/app/src/styles/text.ts +10 -0
- package/dist/templates/app/src/styles/theme/algorithms/darkAlgorithm.ts +47 -0
- package/dist/templates/app/src/styles/theme/algorithms/lightAlgorithm.ts +44 -0
- package/dist/templates/app/src/styles/theme/antdTheme.ts +62 -0
- package/dist/templates/app/src/styles/theme/customStylish.ts +189 -0
- package/dist/templates/app/src/styles/theme/customToken.ts +93 -0
- package/dist/templates/app/src/styles/theme/generateColorPalette.ts +59 -0
- package/dist/templates/app/src/styles/theme/token/base.ts +16 -0
- package/dist/templates/app/src/styles/theme/token/dark.ts +60 -0
- package/dist/templates/app/src/styles/theme/token/light.ts +60 -0
- package/dist/templates/app/src/test-utils.tsx +18 -0
- package/dist/templates/app/src/types/customStylish.ts +20 -0
- package/dist/templates/app/src/types/customToken.ts +70 -0
- package/dist/templates/app/src/types/index.ts +21 -0
- package/dist/templates/app/src/types/routes.ts +70 -0
- package/dist/templates/app/src/utils/__tests__/example.test.ts +7 -0
- package/dist/templates/app/src/utils/convert.ts +40 -0
- package/dist/templates/app/src/utils/cookie.ts +25 -0
- package/dist/templates/app/src/utils/copyToClipboard.ts +13 -0
- package/dist/templates/app/src/utils/difference.ts +26 -0
- package/dist/templates/app/src/utils/env.ts +3 -0
- package/dist/templates/app/src/utils/format.ts +21 -0
- package/dist/templates/app/src/utils/genCdnUrl.ts +30 -0
- package/dist/templates/app/src/utils/getMicroApp.ts +39 -0
- package/dist/templates/app/src/utils/index.ts +1 -0
- package/dist/templates/app/src/utils/locale.ts +46 -0
- package/dist/templates/app/src/utils/sentry.ts +187 -0
- package/dist/templates/app/src/utils/sentryDecorators.ts +34 -0
- package/dist/templates/app/src/utils/updateVersion.ts +186 -0
- package/dist/templates/app/store/auth/index.tsx +82 -0
- package/dist/templates/app/store/auth/indexApi.tsx +11 -0
- package/dist/templates/app/store/global/index.tsx +133 -0
- package/dist/templates/app/store/global/indexApi.tsx +19 -0
- package/dist/templates/app/store/global/types.ts +62 -0
- package/dist/templates/app/store/middleware/createDevtools.ts +23 -0
- package/dist/templates/app/store/middleware/createHyperStorage/index.ts +127 -0
- package/dist/templates/app/store/middleware/createHyperStorage/indexedDB.ts +31 -0
- package/dist/templates/app/store/middleware/createHyperStorage/keyMapper.ts +57 -0
- package/dist/templates/app/store/middleware/createHyperStorage/localStorage.ts +23 -0
- package/dist/templates/app/store/middleware/createHyperStorage/type.ts +27 -0
- package/dist/templates/app/store/middleware/createHyperStorage/urlStorage.ts +85 -0
- package/dist/templates/app/store/theme/index.ts +25 -0
- package/dist/templates/app/store/types.ts +83 -0
- package/dist/templates/app/store/user/index.tsx +1 -0
- package/dist/templates/app/store/user/indexApi.tsx +5 -0
- package/dist/templates/app/store/user/initialState.ts +15 -0
- package/dist/templates/app/store/user/slices/profile/actions.ts +20 -0
- package/dist/templates/app/store/user/slices/profile/api.ts +5 -0
- package/dist/templates/app/store/user/slices/profile/initialState.ts +14 -0
- package/dist/templates/app/store/user/slices/settings/actions.ts +23 -0
- package/dist/templates/app/store/user/slices/settings/initialState.ts +32 -0
- package/dist/templates/app/store/user/store.ts +39 -0
- package/dist/templates/app/tailwind.config.js +13 -0
- package/dist/templates/app/tsconfig.json +27 -0
- package/dist/templates/app//347/277/273/350/257/221.md +9 -0
- package/dist/templates/auth/index.tsx +82 -0
- package/dist/templates/auth/indexApi.tsx +11 -0
- package/dist/templates/banner_market_modal.webp +0 -0
- package/dist/templates/base/index.tsx +32 -0
- package/dist/templates/base/layout.tsx +6 -0
- package/dist/templates/base/page.tsx +25 -0
- package/dist/templates/base.ts +16 -0
- package/dist/templates/blue.ts +66 -0
- package/dist/templates/chat.ts +455 -0
- package/dist/templates/chatmode_chat_dark.webp +0 -0
- package/dist/templates/chatmode_chat_light.webp +0 -0
- package/dist/templates/chatmode_docs_dark.webp +0 -0
- package/dist/templates/chatmode_docs_light.webp +0 -0
- package/dist/templates/color/ColorScales/ScaleRow.tsx +74 -0
- package/dist/templates/color/ColorScales/index.md +168 -0
- package/dist/templates/color/ColorScales/index.tsx +70 -0
- package/dist/templates/color/ColorScales/style.ts +42 -0
- package/dist/templates/color/colors/blue.ts +66 -0
- package/dist/templates/color/colors/cyan.ts +66 -0
- package/dist/templates/color/colors/geekblue.ts +66 -0
- package/dist/templates/color/colors/gold.ts +66 -0
- package/dist/templates/color/colors/gray.ts +66 -0
- package/dist/templates/color/colors/green.ts +66 -0
- package/dist/templates/color/colors/index.ts +66 -0
- package/dist/templates/color/colors/lime.ts +66 -0
- package/dist/templates/color/colors/magenta.ts +66 -0
- package/dist/templates/color/colors/orange.ts +66 -0
- package/dist/templates/color/colors/primary.ts +66 -0
- package/dist/templates/color/colors/purple.ts +66 -0
- package/dist/templates/color/colors/red.ts +66 -0
- package/dist/templates/color/colors/volcano.ts +66 -0
- package/dist/templates/color/colors/yellow.ts +66 -0
- package/dist/templates/color/index.ts +4 -0
- package/dist/templates/color/neutrals/index.ts +30 -0
- package/dist/templates/color/neutrals/mauve.ts +66 -0
- package/dist/templates/color/neutrals/olive.ts +66 -0
- package/dist/templates/color/neutrals/sage.ts +66 -0
- package/dist/templates/color/neutrals/sand.ts +66 -0
- package/dist/templates/color/neutrals/slate.ts +66 -0
- package/dist/templates/color/types.ts +21 -0
- package/dist/templates/colors/blue.ts +66 -0
- package/dist/templates/colors/cyan.ts +66 -0
- package/dist/templates/colors/geekblue.ts +66 -0
- package/dist/templates/colors/gold.ts +66 -0
- package/dist/templates/colors/gray.ts +66 -0
- package/dist/templates/colors/green.ts +66 -0
- package/dist/templates/colors/index.ts +66 -0
- package/dist/templates/colors/lime.ts +66 -0
- package/dist/templates/colors/magenta.ts +66 -0
- package/dist/templates/colors/orange.ts +66 -0
- package/dist/templates/colors/primary.ts +66 -0
- package/dist/templates/colors/purple.ts +66 -0
- package/dist/templates/colors/red.ts +66 -0
- package/dist/templates/colors/volcano.ts +66 -0
- package/dist/templates/colors/yellow.ts +66 -0
- package/dist/templates/common.json +74 -0
- package/dist/templates/components/ConfigProvider/index.md +63 -0
- package/dist/templates/components/ConfigProvider/index.tsx +42 -0
- package/dist/templates/components/ErrorBoundary/index.tsx +506 -0
- package/dist/templates/components/FontLoader/index.md +12 -0
- package/dist/templates/components/FontLoader/index.tsx +41 -0
- package/dist/templates/components/Loading/__tests__/Loading.test.tsx +23 -0
- package/dist/templates/components/Loading/index.tsx +21 -0
- package/dist/templates/components/ManualSlave/ManualSlavePage.module.less +25 -0
- package/dist/templates/components/ManualSlave/ManualSlavePage.tsx +45 -0
- package/dist/templates/components/ManualSlave/index.ts +1 -0
- package/dist/templates/components/RequireAuth/RequireAuth.tsx +76 -0
- package/dist/templates/components/RequireAuth/index.ts +1 -0
- package/dist/templates/components/ThemeProvider/GlobalStyle/antdOverride.ts +89 -0
- package/dist/templates/components/ThemeProvider/GlobalStyle/global.ts +61 -0
- package/dist/templates/components/ThemeProvider/GlobalStyle/index.ts +10 -0
- package/dist/templates/components/ThemeProvider/Meta.tsx +75 -0
- package/dist/templates/components/ThemeProvider/ThemeProvider.tsx +109 -0
- package/dist/templates/components/ThemeProvider/index.md +69 -0
- package/dist/templates/components/ThemeProvider/index.ts +3 -0
- package/dist/templates/components/ThemeProvider/type.ts +28 -0
- package/dist/templates/config/env/.env.development +5 -0
- package/dist/templates/config/env/.env.production +2 -0
- package/dist/templates/config/env/.env.public.tpl +31 -0
- package/dist/templates/config/jwt/index.ts +31 -0
- package/dist/templates/config/public/404.png +0 -0
- package/dist/templates/config/public/favicon.ico +0 -0
- package/dist/templates/config/public/images/banner_market_modal.webp +0 -0
- package/dist/templates/config/public/images/chatmode_chat_dark.webp +0 -0
- package/dist/templates/config/public/images/chatmode_chat_light.webp +0 -0
- package/dist/templates/config/public/images/chatmode_docs_dark.webp +0 -0
- package/dist/templates/config/public/images/chatmode_docs_light.webp +0 -0
- package/dist/templates/config/public/images/empty_topic_dark.webp +0 -0
- package/dist/templates/config/public/images/empty_topic_light.webp +0 -0
- package/dist/templates/config/public/images/screenshot_background.webp +0 -0
- package/dist/templates/config/public/images/theme_auto.webp +0 -0
- package/dist/templates/config/public/images/theme_dark.webp +0 -0
- package/dist/templates/config/public/images/theme_light.webp +0 -0
- package/dist/templates/config/public/index.html +29 -0
- package/dist/templates/config/request/index.ts +174 -0
- package/dist/templates/config/router/index.tsx +26 -0
- package/dist/templates/config/rspack/paths.js +12 -0
- package/dist/templates/config/rspack/plugins/RoutesConventionsRspackPlugin.js +100 -0
- package/dist/templates/config/rspack/rspack.config.mjs +186 -0
- package/dist/templates/config/rspack/rspack.dev.mjs +219 -0
- package/dist/templates/config/rspack/rspack.prod.mjs +254 -0
- package/dist/templates/config/sentry/sentry.config.ts +188 -0
- package/dist/templates/const/constants.ts +0 -0
- package/dist/templates/const/locale.ts +9 -0
- package/dist/templates/const/system.ts +1 -0
- package/dist/templates/const/theme.ts +5 -0
- package/dist/templates/const/url.ts +1 -0
- package/dist/templates/constants.ts +0 -0
- package/dist/templates/convert-locales-to-json.js +47 -0
- package/dist/templates/convert.ts +40 -0
- package/dist/templates/cookie.ts +25 -0
- package/dist/templates/copyToClipboard.ts +13 -0
- package/dist/templates/create.ts +56 -0
- package/dist/templates/createDevtools.ts +23 -0
- package/dist/templates/createHyperStorage/index.ts +127 -0
- package/dist/templates/createHyperStorage/indexedDB.ts +31 -0
- package/dist/templates/createHyperStorage/keyMapper.ts +57 -0
- package/dist/templates/createHyperStorage/localStorage.ts +23 -0
- package/dist/templates/createHyperStorage/type.ts +27 -0
- package/dist/templates/createHyperStorage/urlStorage.ts +85 -0
- package/dist/templates/customStylish.ts +189 -0
- package/dist/templates/customTheme.ts +70 -0
- package/dist/templates/customToken.ts +93 -0
- package/dist/templates/cyan.ts +66 -0
- package/dist/templates/dark.ts +60 -0
- package/dist/templates/darkAlgorithm.ts +47 -0
- package/dist/templates/default/chat.ts +455 -0
- package/dist/templates/default/index.ts +7 -0
- package/dist/templates/difference.ts +26 -0
- package/dist/templates/empty_topic_dark.webp +0 -0
- package/dist/templates/empty_topic_light.webp +0 -0
- package/dist/templates/en-US/common.json +74 -0
- package/dist/templates/en-US/generate.json +71 -0
- package/dist/templates/en-US/nav.json +10 -0
- package/dist/templates/en-US/overview.json +6 -0
- package/dist/templates/en-US/retopology.json +4 -0
- package/dist/templates/en-US/rigging.json +21 -0
- package/dist/templates/en-US/segmentation.json +4 -0
- package/dist/templates/en-US/stylization.json +11 -0
- package/dist/templates/en-US/texture.json +4 -0
- package/dist/templates/en-US/threeModel.json +9 -0
- package/dist/templates/en-US/toolbox.json +11 -0
- package/dist/templates/env/.env.development +5 -0
- package/dist/templates/env/.env.production +2 -0
- package/dist/templates/env/.env.public.tpl +31 -0
- package/dist/templates/env.ts +3 -0
- package/dist/templates/example.test.ts +7 -0
- package/dist/templates/favicon.ico +0 -0
- package/dist/templates/fileMock.js +1 -0
- package/dist/templates/format.ts +21 -0
- package/dist/templates/geekblue.ts +66 -0
- package/dist/templates/genCdnUrl.ts +30 -0
- package/dist/templates/generate.json +71 -0
- package/dist/templates/generateColorPalette.ts +59 -0
- package/dist/templates/getMicroApp.ts +39 -0
- package/dist/templates/global/index.tsx +133 -0
- package/dist/templates/global/indexApi.tsx +19 -0
- package/dist/templates/global/types.ts +62 -0
- package/dist/templates/global.ts +61 -0
- package/dist/templates/gold.ts +66 -0
- package/dist/templates/gray.ts +66 -0
- package/dist/templates/green.ts +66 -0
- package/dist/templates/highlighter.ts +34 -0
- package/dist/templates/hooks/useRouteTitle.tsx +36 -0
- package/dist/templates/hooks/useSentry.ts +92 -0
- package/dist/templates/images/banner_market_modal.webp +0 -0
- package/dist/templates/images/chatmode_chat_dark.webp +0 -0
- package/dist/templates/images/chatmode_chat_light.webp +0 -0
- package/dist/templates/images/chatmode_docs_dark.webp +0 -0
- package/dist/templates/images/chatmode_docs_light.webp +0 -0
- package/dist/templates/images/empty_topic_dark.webp +0 -0
- package/dist/templates/images/empty_topic_light.webp +0 -0
- package/dist/templates/images/screenshot_background.webp +0 -0
- package/dist/templates/images/theme_auto.webp +0 -0
- package/dist/templates/images/theme_dark.webp +0 -0
- package/dist/templates/images/theme_light.webp +0 -0
- package/dist/templates/index.css +282 -0
- package/dist/templates/index.html +29 -0
- package/dist/templates/index.md +69 -0
- package/dist/templates/index.ts +10 -0
- package/dist/templates/index.tsx +32 -0
- package/dist/templates/indexApi.tsx +5 -0
- package/dist/templates/indexedDB.ts +31 -0
- package/dist/templates/initialState.ts +32 -0
- package/dist/templates/jwt/index.ts +31 -0
- package/dist/templates/keyMapper.ts +57 -0
- package/dist/templates/layout/BaseLayout.tsx +15 -0
- package/dist/templates/layout/ContentFormWrapper.tsx +11 -0
- package/dist/templates/layout/ContentWrapper.module.less +137 -0
- package/dist/templates/layout/ContentWrapper.tsx +13 -0
- package/dist/templates/layout/Locale.tsx +89 -0
- package/dist/templates/layout/MainContentWrap.tsx +68 -0
- package/dist/templates/layout/ThemeContext.tsx +132 -0
- package/dist/templates/layout.tsx +6 -0
- package/dist/templates/light.ts +60 -0
- package/dist/templates/lightAlgorithm.ts +44 -0
- package/dist/templates/lime.ts +66 -0
- package/dist/templates/loading.tsx +52 -0
- package/dist/templates/localStorage.ts +23 -0
- package/dist/templates/locale.ts +46 -0
- package/dist/templates/locales/create.ts +56 -0
- package/dist/templates/locales/default/chat.ts +455 -0
- package/dist/templates/locales/default/index.ts +7 -0
- package/dist/templates/locales/en-US/common.json +74 -0
- package/dist/templates/locales/en-US/generate.json +71 -0
- package/dist/templates/locales/en-US/nav.json +10 -0
- package/dist/templates/locales/en-US/overview.json +6 -0
- package/dist/templates/locales/en-US/retopology.json +4 -0
- package/dist/templates/locales/en-US/rigging.json +21 -0
- package/dist/templates/locales/en-US/segmentation.json +4 -0
- package/dist/templates/locales/en-US/stylization.json +11 -0
- package/dist/templates/locales/en-US/texture.json +4 -0
- package/dist/templates/locales/en-US/threeModel.json +9 -0
- package/dist/templates/locales/en-US/toolbox.json +11 -0
- package/dist/templates/locales/resources.ts +104 -0
- package/dist/templates/locales/zh-CN/common.json +74 -0
- package/dist/templates/locales/zh-CN/generate.json +71 -0
- package/dist/templates/locales/zh-CN/nav.json +10 -0
- package/dist/templates/locales/zh-CN/overview.json +6 -0
- package/dist/templates/locales/zh-CN/retopology.json +4 -0
- package/dist/templates/locales/zh-CN/rigging.json +21 -0
- package/dist/templates/locales/zh-CN/segmentation.json +4 -0
- package/dist/templates/locales/zh-CN/stylization.json +11 -0
- package/dist/templates/locales/zh-CN/texture.json +4 -0
- package/dist/templates/locales/zh-CN/threeModel.json +9 -0
- package/dist/templates/locales/zh-CN/toolbox.json +11 -0
- package/dist/templates/magenta.ts +66 -0
- package/dist/templates/mauve.ts +66 -0
- package/dist/templates/mermaid.ts +7 -0
- package/dist/templates/middleware/createDevtools.ts +23 -0
- package/dist/templates/middleware/createHyperStorage/index.ts +127 -0
- package/dist/templates/middleware/createHyperStorage/indexedDB.ts +31 -0
- package/dist/templates/middleware/createHyperStorage/keyMapper.ts +57 -0
- package/dist/templates/middleware/createHyperStorage/localStorage.ts +23 -0
- package/dist/templates/middleware/createHyperStorage/type.ts +27 -0
- package/dist/templates/middleware/createHyperStorage/urlStorage.ts +85 -0
- package/dist/templates/nav.json +10 -0
- package/dist/templates/neutrals/index.ts +30 -0
- package/dist/templates/neutrals/mauve.ts +66 -0
- package/dist/templates/neutrals/olive.ts +66 -0
- package/dist/templates/neutrals/sage.ts +66 -0
- package/dist/templates/neutrals/sand.ts +66 -0
- package/dist/templates/neutrals/slate.ts +66 -0
- package/dist/templates/olive.ts +66 -0
- package/dist/templates/orange.ts +66 -0
- package/dist/templates/overview.json +6 -0
- package/dist/templates/package.json.tpl +145 -0
- package/dist/templates/page.tsx +25 -0
- package/dist/templates/pages/404/index.tsx +5 -0
- package/dist/templates/pages/404/page.tsx +27 -0
- package/dist/templates/pages/404.tsx +5 -0
- package/dist/templates/pages/base/index.tsx +32 -0
- package/dist/templates/pages/base/layout.tsx +6 -0
- package/dist/templates/pages/base/page.tsx +25 -0
- package/dist/templates/pages/index.css +282 -0
- package/dist/templates/pages/index.tsx +5 -0
- package/dist/templates/paths.js +12 -0
- package/dist/templates/plugins/RoutesConventionsRspackPlugin.js +100 -0
- package/dist/templates/postcss.config.js +6 -0
- package/dist/templates/primary.ts +66 -0
- package/dist/templates/profile/actions.ts +20 -0
- package/dist/templates/profile/api.ts +5 -0
- package/dist/templates/profile/initialState.ts +14 -0
- package/dist/templates/public/404.png +0 -0
- package/dist/templates/public/favicon.ico +0 -0
- package/dist/templates/public/images/banner_market_modal.webp +0 -0
- package/dist/templates/public/images/chatmode_chat_dark.webp +0 -0
- package/dist/templates/public/images/chatmode_chat_light.webp +0 -0
- package/dist/templates/public/images/chatmode_docs_dark.webp +0 -0
- package/dist/templates/public/images/chatmode_docs_light.webp +0 -0
- package/dist/templates/public/images/empty_topic_dark.webp +0 -0
- package/dist/templates/public/images/empty_topic_light.webp +0 -0
- package/dist/templates/public/images/screenshot_background.webp +0 -0
- package/dist/templates/public/images/theme_auto.webp +0 -0
- package/dist/templates/public/images/theme_dark.webp +0 -0
- package/dist/templates/public/images/theme_light.webp +0 -0
- package/dist/templates/public/index.html +29 -0
- package/dist/templates/purple.ts +66 -0
- package/dist/templates/react-app-env.d.ts +14 -0
- package/dist/templates/red.ts +66 -0
- package/dist/templates/request/index.ts +174 -0
- package/dist/templates/resources.ts +104 -0
- package/dist/templates/retopology.json +4 -0
- package/dist/templates/rigging.json +21 -0
- package/dist/templates/router/index.tsx +26 -0
- package/dist/templates/routes.ts +70 -0
- package/dist/templates/routes.tsx +18 -0
- package/dist/templates/rspack/paths.js +12 -0
- package/dist/templates/rspack/plugins/RoutesConventionsRspackPlugin.js +100 -0
- package/dist/templates/rspack/rspack.config.mjs +186 -0
- package/dist/templates/rspack/rspack.dev.mjs +219 -0
- package/dist/templates/rspack/rspack.prod.mjs +254 -0
- package/dist/templates/rspack.config.mjs +186 -0
- package/dist/templates/rspack.dev.mjs +219 -0
- package/dist/templates/rspack.prod.mjs +254 -0
- package/dist/templates/sage.ts +66 -0
- package/dist/templates/sand.ts +66 -0
- package/dist/templates/screenshot_background.webp +0 -0
- package/dist/templates/scripts/convert-locales-to-json.js +47 -0
- package/dist/templates/segmentation.json +4 -0
- package/dist/templates/sentry/sentry.config.ts +188 -0
- package/dist/templates/sentry.config.ts +188 -0
- package/dist/templates/sentry.ts +187 -0
- package/dist/templates/sentryDecorators.ts +34 -0
- package/dist/templates/settings/actions.ts +23 -0
- package/dist/templates/settings/initialState.ts +32 -0
- package/dist/templates/setupTests.ts +39 -0
- package/dist/templates/slate.ts +66 -0
- package/dist/templates/slices/profile/actions.ts +20 -0
- package/dist/templates/slices/profile/api.ts +5 -0
- package/dist/templates/slices/profile/initialState.ts +14 -0
- package/dist/templates/slices/settings/actions.ts +23 -0
- package/dist/templates/slices/settings/initialState.ts +32 -0
- package/dist/templates/src/__mocks__/fileMock.js +1 -0
- package/dist/templates/src/__mocks__/styleMock.ts +1 -0
- package/dist/templates/src/color/ColorScales/ScaleRow.tsx +74 -0
- package/dist/templates/src/color/ColorScales/index.md +168 -0
- package/dist/templates/src/color/ColorScales/index.tsx +70 -0
- package/dist/templates/src/color/ColorScales/style.ts +42 -0
- package/dist/templates/src/color/colors/blue.ts +66 -0
- package/dist/templates/src/color/colors/cyan.ts +66 -0
- package/dist/templates/src/color/colors/geekblue.ts +66 -0
- package/dist/templates/src/color/colors/gold.ts +66 -0
- package/dist/templates/src/color/colors/gray.ts +66 -0
- package/dist/templates/src/color/colors/green.ts +66 -0
- package/dist/templates/src/color/colors/index.ts +66 -0
- package/dist/templates/src/color/colors/lime.ts +66 -0
- package/dist/templates/src/color/colors/magenta.ts +66 -0
- package/dist/templates/src/color/colors/orange.ts +66 -0
- package/dist/templates/src/color/colors/primary.ts +66 -0
- package/dist/templates/src/color/colors/purple.ts +66 -0
- package/dist/templates/src/color/colors/red.ts +66 -0
- package/dist/templates/src/color/colors/volcano.ts +66 -0
- package/dist/templates/src/color/colors/yellow.ts +66 -0
- package/dist/templates/src/color/index.ts +4 -0
- package/dist/templates/src/color/neutrals/index.ts +30 -0
- package/dist/templates/src/color/neutrals/mauve.ts +66 -0
- package/dist/templates/src/color/neutrals/olive.ts +66 -0
- package/dist/templates/src/color/neutrals/sage.ts +66 -0
- package/dist/templates/src/color/neutrals/sand.ts +66 -0
- package/dist/templates/src/color/neutrals/slate.ts +66 -0
- package/dist/templates/src/color/types.ts +21 -0
- package/dist/templates/src/components/ConfigProvider/index.md +63 -0
- package/dist/templates/src/components/ConfigProvider/index.tsx +42 -0
- package/dist/templates/src/components/ErrorBoundary/index.tsx +506 -0
- package/dist/templates/src/components/FontLoader/index.md +12 -0
- package/dist/templates/src/components/FontLoader/index.tsx +41 -0
- package/dist/templates/src/components/Loading/__tests__/Loading.test.tsx +23 -0
- package/dist/templates/src/components/Loading/index.tsx +21 -0
- package/dist/templates/src/components/ManualSlave/ManualSlavePage.module.less +25 -0
- package/dist/templates/src/components/ManualSlave/ManualSlavePage.tsx +45 -0
- package/dist/templates/src/components/ManualSlave/index.ts +1 -0
- package/dist/templates/src/components/RequireAuth/RequireAuth.tsx +76 -0
- package/dist/templates/src/components/RequireAuth/index.ts +1 -0
- package/dist/templates/src/components/ThemeProvider/GlobalStyle/antdOverride.ts +89 -0
- package/dist/templates/src/components/ThemeProvider/GlobalStyle/global.ts +61 -0
- package/dist/templates/src/components/ThemeProvider/GlobalStyle/index.ts +10 -0
- package/dist/templates/src/components/ThemeProvider/Meta.tsx +75 -0
- package/dist/templates/src/components/ThemeProvider/ThemeProvider.tsx +109 -0
- package/dist/templates/src/components/ThemeProvider/index.md +69 -0
- package/dist/templates/src/components/ThemeProvider/index.ts +3 -0
- package/dist/templates/src/components/ThemeProvider/type.ts +28 -0
- package/dist/templates/src/const/constants.ts +0 -0
- package/dist/templates/src/const/locale.ts +9 -0
- package/dist/templates/src/const/system.ts +1 -0
- package/dist/templates/src/const/theme.ts +5 -0
- package/dist/templates/src/const/url.ts +1 -0
- package/dist/templates/src/hooks/useRouteTitle.tsx +36 -0
- package/dist/templates/src/hooks/useSentry.ts +92 -0
- package/dist/templates/src/index.css +2 -0
- package/dist/templates/src/index.tsx +56 -0
- package/dist/templates/src/layout/BaseLayout.tsx +15 -0
- package/dist/templates/src/layout/ContentFormWrapper.tsx +11 -0
- package/dist/templates/src/layout/ContentWrapper.module.less +137 -0
- package/dist/templates/src/layout/ContentWrapper.tsx +13 -0
- package/dist/templates/src/layout/Locale.tsx +89 -0
- package/dist/templates/src/layout/MainContentWrap.tsx +68 -0
- package/dist/templates/src/layout/ThemeContext.tsx +132 -0
- package/dist/templates/src/loading.tsx +52 -0
- package/dist/templates/src/locales/create.ts +56 -0
- package/dist/templates/src/locales/default/chat.ts +455 -0
- package/dist/templates/src/locales/default/index.ts +7 -0
- package/dist/templates/src/locales/resources.ts +104 -0
- package/dist/templates/src/pages/404/index.tsx +5 -0
- package/dist/templates/src/pages/404/page.tsx +27 -0
- package/dist/templates/src/pages/404.tsx +5 -0
- package/dist/templates/src/pages/base/index.tsx +32 -0
- package/dist/templates/src/pages/base/layout.tsx +6 -0
- package/dist/templates/src/pages/base/page.tsx +25 -0
- package/dist/templates/src/pages/index.css +282 -0
- package/dist/templates/src/pages/index.tsx +5 -0
- package/dist/templates/src/routes.tsx +18 -0
- package/dist/templates/src/setupTests.ts +39 -0
- package/dist/templates/src/styles/antdOverride.ts +24 -0
- package/dist/templates/src/styles/customTheme.ts +70 -0
- package/dist/templates/src/styles/global.ts +53 -0
- package/dist/templates/src/styles/highlighter.ts +34 -0
- package/dist/templates/src/styles/index.ts +23 -0
- package/dist/templates/src/styles/mermaid.ts +7 -0
- package/dist/templates/src/styles/text.ts +10 -0
- package/dist/templates/src/styles/theme/algorithms/darkAlgorithm.ts +47 -0
- package/dist/templates/src/styles/theme/algorithms/lightAlgorithm.ts +44 -0
- package/dist/templates/src/styles/theme/antdTheme.ts +62 -0
- package/dist/templates/src/styles/theme/customStylish.ts +189 -0
- package/dist/templates/src/styles/theme/customToken.ts +93 -0
- package/dist/templates/src/styles/theme/generateColorPalette.ts +59 -0
- package/dist/templates/src/styles/theme/token/base.ts +16 -0
- package/dist/templates/src/styles/theme/token/dark.ts +60 -0
- package/dist/templates/src/styles/theme/token/light.ts +60 -0
- package/dist/templates/src/test-utils.tsx +18 -0
- package/dist/templates/src/types/customStylish.ts +20 -0
- package/dist/templates/src/types/customToken.ts +70 -0
- package/dist/templates/src/types/index.ts +21 -0
- package/dist/templates/src/types/routes.ts +70 -0
- package/dist/templates/src/utils/__tests__/example.test.ts +7 -0
- package/dist/templates/src/utils/convert.ts +40 -0
- package/dist/templates/src/utils/cookie.ts +25 -0
- package/dist/templates/src/utils/copyToClipboard.ts +13 -0
- package/dist/templates/src/utils/difference.ts +26 -0
- package/dist/templates/src/utils/env.ts +3 -0
- package/dist/templates/src/utils/format.ts +21 -0
- package/dist/templates/src/utils/genCdnUrl.ts +30 -0
- package/dist/templates/src/utils/getMicroApp.ts +39 -0
- package/dist/templates/src/utils/index.ts +1 -0
- package/dist/templates/src/utils/locale.ts +46 -0
- package/dist/templates/src/utils/sentry.ts +187 -0
- package/dist/templates/src/utils/sentryDecorators.ts +34 -0
- package/dist/templates/src/utils/updateVersion.ts +186 -0
- package/dist/templates/store/auth/index.tsx +82 -0
- package/dist/templates/store/auth/indexApi.tsx +11 -0
- package/dist/templates/store/global/index.tsx +133 -0
- package/dist/templates/store/global/indexApi.tsx +19 -0
- package/dist/templates/store/global/types.ts +62 -0
- package/dist/templates/store/middleware/createDevtools.ts +23 -0
- package/dist/templates/store/middleware/createHyperStorage/index.ts +127 -0
- package/dist/templates/store/middleware/createHyperStorage/indexedDB.ts +31 -0
- package/dist/templates/store/middleware/createHyperStorage/keyMapper.ts +57 -0
- package/dist/templates/store/middleware/createHyperStorage/localStorage.ts +23 -0
- package/dist/templates/store/middleware/createHyperStorage/type.ts +27 -0
- package/dist/templates/store/middleware/createHyperStorage/urlStorage.ts +85 -0
- package/dist/templates/store/theme/index.ts +25 -0
- package/dist/templates/store/types.ts +83 -0
- package/dist/templates/store/user/index.tsx +1 -0
- package/dist/templates/store/user/indexApi.tsx +5 -0
- package/dist/templates/store/user/initialState.ts +15 -0
- package/dist/templates/store/user/slices/profile/actions.ts +20 -0
- package/dist/templates/store/user/slices/profile/api.ts +5 -0
- package/dist/templates/store/user/slices/profile/initialState.ts +14 -0
- package/dist/templates/store/user/slices/settings/actions.ts +23 -0
- package/dist/templates/store/user/slices/settings/initialState.ts +32 -0
- package/dist/templates/store/user/store.ts +39 -0
- package/dist/templates/store.ts +39 -0
- package/dist/templates/style.ts +42 -0
- package/dist/templates/styleMock.ts +1 -0
- package/dist/templates/styles/antdOverride.ts +24 -0
- package/dist/templates/styles/customTheme.ts +70 -0
- package/dist/templates/styles/global.ts +53 -0
- package/dist/templates/styles/highlighter.ts +34 -0
- package/dist/templates/styles/index.ts +23 -0
- package/dist/templates/styles/mermaid.ts +7 -0
- package/dist/templates/styles/text.ts +10 -0
- package/dist/templates/styles/theme/algorithms/darkAlgorithm.ts +47 -0
- package/dist/templates/styles/theme/algorithms/lightAlgorithm.ts +44 -0
- package/dist/templates/styles/theme/antdTheme.ts +62 -0
- package/dist/templates/styles/theme/customStylish.ts +189 -0
- package/dist/templates/styles/theme/customToken.ts +93 -0
- package/dist/templates/styles/theme/generateColorPalette.ts +59 -0
- package/dist/templates/styles/theme/token/base.ts +16 -0
- package/dist/templates/styles/theme/token/dark.ts +60 -0
- package/dist/templates/styles/theme/token/light.ts +60 -0
- package/dist/templates/stylization.json +11 -0
- package/dist/templates/system.ts +1 -0
- package/dist/templates/tailwind.config.js +13 -0
- package/dist/templates/test-utils.tsx +18 -0
- package/dist/templates/text.ts +10 -0
- package/dist/templates/texture.json +4 -0
- package/dist/templates/theme/algorithms/darkAlgorithm.ts +47 -0
- package/dist/templates/theme/algorithms/lightAlgorithm.ts +44 -0
- package/dist/templates/theme/antdTheme.ts +62 -0
- package/dist/templates/theme/customStylish.ts +189 -0
- package/dist/templates/theme/customToken.ts +93 -0
- package/dist/templates/theme/generateColorPalette.ts +59 -0
- package/dist/templates/theme/index.ts +25 -0
- package/dist/templates/theme/token/base.ts +16 -0
- package/dist/templates/theme/token/dark.ts +60 -0
- package/dist/templates/theme/token/light.ts +60 -0
- package/dist/templates/theme.ts +5 -0
- package/dist/templates/theme_auto.webp +0 -0
- package/dist/templates/theme_dark.webp +0 -0
- package/dist/templates/theme_light.webp +0 -0
- package/dist/templates/threeModel.json +9 -0
- package/dist/templates/token/base.ts +16 -0
- package/dist/templates/token/dark.ts +60 -0
- package/dist/templates/token/light.ts +60 -0
- package/dist/templates/toolbox.json +11 -0
- package/dist/templates/tsconfig.json +27 -0
- package/dist/templates/type.ts +28 -0
- package/dist/templates/types/customStylish.ts +20 -0
- package/dist/templates/types/customToken.ts +70 -0
- package/dist/templates/types/index.ts +21 -0
- package/dist/templates/types/routes.ts +70 -0
- package/dist/templates/types.ts +21 -0
- package/dist/templates/updateVersion.ts +186 -0
- package/dist/templates/url.ts +1 -0
- package/dist/templates/urlStorage.ts +85 -0
- package/dist/templates/useRouteTitle.tsx +36 -0
- package/dist/templates/useSentry.ts +92 -0
- package/dist/templates/user/index.tsx +1 -0
- package/dist/templates/user/indexApi.tsx +5 -0
- package/dist/templates/user/initialState.ts +15 -0
- package/dist/templates/user/slices/profile/actions.ts +20 -0
- package/dist/templates/user/slices/profile/api.ts +5 -0
- package/dist/templates/user/slices/profile/initialState.ts +14 -0
- package/dist/templates/user/slices/settings/actions.ts +23 -0
- package/dist/templates/user/slices/settings/initialState.ts +32 -0
- package/dist/templates/user/store.ts +39 -0
- package/dist/templates/utils/__tests__/example.test.ts +7 -0
- package/dist/templates/utils/convert.ts +40 -0
- package/dist/templates/utils/cookie.ts +25 -0
- package/dist/templates/utils/copyToClipboard.ts +13 -0
- package/dist/templates/utils/difference.ts +26 -0
- package/dist/templates/utils/env.ts +3 -0
- package/dist/templates/utils/format.ts +21 -0
- package/dist/templates/utils/genCdnUrl.ts +30 -0
- package/dist/templates/utils/getMicroApp.ts +39 -0
- package/dist/templates/utils/index.ts +1 -0
- package/dist/templates/utils/locale.ts +46 -0
- package/dist/templates/utils/sentry.ts +187 -0
- package/dist/templates/utils/sentryDecorators.ts +34 -0
- package/dist/templates/utils/updateVersion.ts +186 -0
- package/dist/templates/volcano.ts +66 -0
- package/dist/templates/yellow.ts +66 -0
- package/dist/templates/zh-CN/common.json +74 -0
- package/dist/templates/zh-CN/generate.json +71 -0
- package/dist/templates/zh-CN/nav.json +10 -0
- package/dist/templates/zh-CN/overview.json +6 -0
- package/dist/templates/zh-CN/retopology.json +4 -0
- package/dist/templates/zh-CN/rigging.json +21 -0
- package/dist/templates/zh-CN/segmentation.json +4 -0
- package/dist/templates/zh-CN/stylization.json +11 -0
- package/dist/templates/zh-CN/texture.json +4 -0
- package/dist/templates/zh-CN/threeModel.json +9 -0
- package/dist/templates/zh-CN/toolbox.json +11 -0
- package/dist/templates//347/277/273/350/257/221.md +9 -0
- package/package.json +29 -21
- package/README.md +0 -180
- package/dist/api.js +0 -44
- package/dist/templates.js +0 -87
package/dist/cli.js
CHANGED
|
@@ -1,644 +1,25 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
'use strict';
|
|
3
2
|
|
|
4
|
-
var
|
|
5
|
-
var require$$1 = require('inquirer');
|
|
6
|
-
var require$$2 = require('path');
|
|
7
|
-
var require$$3 = require('ora');
|
|
8
|
-
var require$$4 = require('fs-extra');
|
|
9
|
-
var require$$5 = require('child_process');
|
|
10
|
-
var require$$7 = require('chalk');
|
|
11
|
-
var require$$8 = require('boxen');
|
|
12
|
-
var require$$9 = require('figlet');
|
|
13
|
-
require('https');
|
|
3
|
+
var utils = require('@umijs/utils');
|
|
14
4
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var templates$1 = {
|
|
20
|
-
microFrontend: {
|
|
21
|
-
webpack: {
|
|
22
|
-
main: [
|
|
23
|
-
{
|
|
24
|
-
value: "https://ywgit.gz4399.com/ywkf/webpack-mainApplicate_demo.git",
|
|
25
|
-
name: "webpack-mainApplicate_demo",
|
|
26
|
-
description: "基于 Webpack 的微前端主应用模板",
|
|
27
|
-
features: ["qiankun", "react", "antd", "路由管理"],
|
|
28
|
-
recommended: true,
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
sub: [
|
|
32
|
-
{
|
|
33
|
-
value: "https://ywgit.gz4399.com/ywkf/webpack-subApplicate_demo.git",
|
|
34
|
-
name: "webpack-subApplicate_demo",
|
|
35
|
-
description: "标准的微前端子应用模板",
|
|
36
|
-
features: ["react", "antd", "独立运行"],
|
|
37
|
-
recommended: true,
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
vite: {
|
|
42
|
-
main: [
|
|
43
|
-
{
|
|
44
|
-
value: "https://ywgit.gz4399.com/ywkf/vite-mainApplicate_demo.git",
|
|
45
|
-
name: "vite-mainApplicate_demo",
|
|
46
|
-
description: "基于 Vite 的微前端主应用模板",
|
|
47
|
-
features: ["qiankun", "react", "antd", "路由管理"],
|
|
48
|
-
recommended: true,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
sub: [
|
|
52
|
-
{
|
|
53
|
-
value: "https://ywgit.gz4399.com/ywkf/vite-subApplicate_demo.git",
|
|
54
|
-
name: "vite-subApplicate_demo",
|
|
55
|
-
description: "标准的微前端子应用模板",
|
|
56
|
-
features: ["react", "antd", "独立运行"],
|
|
57
|
-
recommended: true,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
rspack: {
|
|
62
|
-
main: [
|
|
63
|
-
{
|
|
64
|
-
value: "https://ywgit.gz4399.com/ywkf/rspack-subApplicate_demo.git",
|
|
65
|
-
name: "rspack-subApplicate_demo",
|
|
66
|
-
description: "基于 Rspack 的微前端子应用模板",
|
|
67
|
-
features: ["react", "antd", "独立运行"],
|
|
68
|
-
recommended: true,
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
sub: [
|
|
72
|
-
{
|
|
73
|
-
value: "https://ywgit.gz4399.com/ywkf/rspack-subApplicate_demo.git",
|
|
74
|
-
name: "rspack-subApplicate_demo",
|
|
75
|
-
description: "基于 Rspack 的微前端子应用模板",
|
|
76
|
-
features: ["react", "antd", "独立运行"],
|
|
77
|
-
recommended: true,
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
standalone: {
|
|
83
|
-
nextjs: [
|
|
84
|
-
{
|
|
85
|
-
value: "https://ywgit.gz4399.com/ywkf/next-dome.git",
|
|
86
|
-
name: "next-demo",
|
|
87
|
-
description: "基于 Next.js 的全栈应用模板",
|
|
88
|
-
features: ["react", "antd", "next", "路由管理"],
|
|
89
|
-
recommended: true,
|
|
90
|
-
},
|
|
91
|
-
],
|
|
5
|
+
const args = utils.yParser(process.argv.slice(2), {
|
|
6
|
+
alias: {
|
|
7
|
+
version: ["v"],
|
|
8
|
+
help: ["h"]
|
|
92
9
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const pkgInfo = {
|
|
108
|
-
version: "0.0.21",
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// 美化输出函数
|
|
112
|
-
function printBanner() {
|
|
113
|
-
console.log(
|
|
114
|
-
chalk.cyan(
|
|
115
|
-
figlet.textSync("YWKF CLI", {
|
|
116
|
-
font: "Standard",
|
|
117
|
-
horizontalLayout: "default",
|
|
118
|
-
verticalLayout: "default",
|
|
119
|
-
})
|
|
120
|
-
)
|
|
121
|
-
);
|
|
122
|
-
console.log(chalk.gray(`版本: ${pkgInfo.version}\n`));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function printSuccess(message) {
|
|
126
|
-
console.log(chalk.green("✅ " + message));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function printError(message) {
|
|
130
|
-
console.log(chalk.red("❌ " + message));
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function printInfo(message) {
|
|
134
|
-
console.log(chalk.blue("ℹ️ " + message));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function printWarning(message) {
|
|
138
|
-
console.log(chalk.yellow("⚠️ " + message));
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function printFinalInstructions(projectName, architectureType, appDirection) {
|
|
142
|
-
console.log();
|
|
143
|
-
console.log(
|
|
144
|
-
boxen(
|
|
145
|
-
[
|
|
146
|
-
chalk.green.bold("🎉 项目创建成功!"),
|
|
147
|
-
"",
|
|
148
|
-
chalk.yellow("📂 项目路径:") + chalk.cyan(projectName),
|
|
149
|
-
"",
|
|
150
|
-
chalk.yellow("🚀 下一步:"),
|
|
151
|
-
chalk.white(` cd ${projectName}`),
|
|
152
|
-
chalk.white(" nvm use "),
|
|
153
|
-
chalk.white(" pnpm install "),
|
|
154
|
-
chalk.white(" pnpm dev # 启动开发服务器"),
|
|
155
|
-
"",
|
|
156
|
-
chalk.gray("💡 提示:"),
|
|
157
|
-
chalk.gray(" - 查看 README.md 了解更多信息"),
|
|
158
|
-
chalk.gray(" - 检查 package.json 中的可用脚本"),
|
|
159
|
-
chalk.gray(" - 访问内部文档了解最佳实践"),
|
|
160
|
-
].join("\n"),
|
|
161
|
-
{
|
|
162
|
-
padding: 1,
|
|
163
|
-
margin: 1,
|
|
164
|
-
borderStyle: "round",
|
|
165
|
-
borderColor: "green",
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
// 根据项目类型提供特定建议
|
|
171
|
-
if (architectureType === "microFrontend") {
|
|
172
|
-
console.log(chalk.blue("🔗 微前端相关:"));
|
|
173
|
-
if (appDirection === "main") {
|
|
174
|
-
console.log(chalk.gray(" - 配置子应用注册信息"));
|
|
175
|
-
console.log(chalk.gray(" - 设置路由规则"));
|
|
176
|
-
} else {
|
|
177
|
-
console.log(chalk.gray(" - 确认子应用配置正确"));
|
|
178
|
-
console.log(chalk.gray(" - 测试独立运行"));
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function cloneRepository(repoUrl, destination) {
|
|
184
|
-
return new Promise((resolve, reject) => {
|
|
185
|
-
// 确保URL格式正确,移除可能的末尾斜杠
|
|
186
|
-
const cleanUrl = repoUrl.replace(/\/$/, "");
|
|
187
|
-
const command = `git clone ${cleanUrl} ${destination}`;
|
|
188
|
-
|
|
189
|
-
// 设置子进程选项
|
|
190
|
-
const options = {
|
|
191
|
-
cwd: process.cwd(),
|
|
192
|
-
env: process.env,
|
|
193
|
-
stdio: "pipe",
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
exec(command, options, (error, stdout, stderr) => {
|
|
197
|
-
if (error) {
|
|
198
|
-
console.error(`命令执行失败: ${command}`);
|
|
199
|
-
console.error(`错误代码: ${error.code}`);
|
|
200
|
-
console.error(`错误信息: ${error.message}`);
|
|
201
|
-
console.error(`stderr: ${stderr}`);
|
|
202
|
-
reject(`Error cloning repository: ${stderr || error.message}`);
|
|
203
|
-
} else {
|
|
204
|
-
resolve(`Repository cloned successfully: ${stdout}`);
|
|
205
|
-
}
|
|
206
|
-
});
|
|
10
|
+
boolean: ["version"]
|
|
11
|
+
});
|
|
12
|
+
if (args.version && !args._[0]) {
|
|
13
|
+
args._[0] = "version";
|
|
14
|
+
const local = utils.isLocalDev() ? utils.chalk.cyan("@local") : "";
|
|
15
|
+
const { name, version } = require("../package.json");
|
|
16
|
+
console.log(`${name}@${version}${local}`);
|
|
17
|
+
} else {
|
|
18
|
+
require("./")({
|
|
19
|
+
cwd: process.cwd(),
|
|
20
|
+
args
|
|
21
|
+
}).catch((err) => {
|
|
22
|
+
console.error(`Create failed, ${err.message}`);
|
|
23
|
+
console.error(err);
|
|
207
24
|
});
|
|
208
25
|
}
|
|
209
|
-
|
|
210
|
-
// 新添加:更新环境模板文件
|
|
211
|
-
async function updateEnvTemplate(filePath, config) {
|
|
212
|
-
try {
|
|
213
|
-
// 读取模板文件内容
|
|
214
|
-
let templateContent = await fs.readFile(filePath, "utf8");
|
|
215
|
-
|
|
216
|
-
// 替换模板变量
|
|
217
|
-
const replacements = {
|
|
218
|
-
"{{APP_CNAME}}": `${config.appCname}`,
|
|
219
|
-
"{{APP_NAME}}": `${config.appName}`,
|
|
220
|
-
"{{SENTRY_ENABLED}}": `${config.sentryEnabled ? "true" : "false"}`,
|
|
221
|
-
"{{SENTRY_DSN}}": `${config.sentryDsn}`,
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
// 执行替换
|
|
225
|
-
for (const [placeholder, value] of Object.entries(replacements)) {
|
|
226
|
-
templateContent = templateContent.replace(
|
|
227
|
-
new RegExp(placeholder, "g"),
|
|
228
|
-
value
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// 写回文件
|
|
233
|
-
await fs.writeFile(filePath, templateContent, "utf8");
|
|
234
|
-
} catch (error) {
|
|
235
|
-
throw new Error(`更新模板文件失败: ${error.message}`);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// 配置 webpack 子应用的环境变量(填充模板)
|
|
240
|
-
async function configureWebpackSubApp(projectPath, projectName) {
|
|
241
|
-
printInfo("正在配置 Webpack 子应用环境变量...");
|
|
242
|
-
|
|
243
|
-
const envFilePath = path.join(projectPath, "config", "env", ".env.public");
|
|
244
|
-
|
|
245
|
-
// 检查模板文件是否存在
|
|
246
|
-
if (!fs.existsSync(envFilePath)) {
|
|
247
|
-
printWarning("未找到 .env.public 模板文件,跳过配置");
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// 询问用户配置选项
|
|
252
|
-
const { configureEnv } = await inquirer.prompt({
|
|
253
|
-
type: "confirm",
|
|
254
|
-
name: "configureEnv",
|
|
255
|
-
message: chalk.cyan("🔧 是否要自定义应用配置?"),
|
|
256
|
-
default: true,
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
if (!configureEnv) {
|
|
260
|
-
// 如果不配置,使用默认值填充模板
|
|
261
|
-
const defaultConfig = {
|
|
262
|
-
appCname: projectName.toLowerCase().replace(/[^a-z0-9-]/g, "-"),
|
|
263
|
-
appName: projectName
|
|
264
|
-
.toLowerCase()
|
|
265
|
-
.replace(/[^a-z0-9-]/g, "-")
|
|
266
|
-
.split("-")
|
|
267
|
-
.map((word, index) =>
|
|
268
|
-
index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1)
|
|
269
|
-
)
|
|
270
|
-
.join(""),
|
|
271
|
-
outputPath: "dist",
|
|
272
|
-
publicPath: "/",
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
await updateEnvTemplate(envFilePath, defaultConfig);
|
|
276
|
-
printInfo("已使用默认配置填充模板");
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// 获取用户输入的配置
|
|
281
|
-
const config = await inquirer.prompt([
|
|
282
|
-
{
|
|
283
|
-
type: "input",
|
|
284
|
-
name: "appName",
|
|
285
|
-
message: chalk.cyan("📝 请输入应用代码名称(APP_NAME):"),
|
|
286
|
-
default: projectName.toLowerCase().replace(/[^a-z0-9-_]/g, "-"),
|
|
287
|
-
validate: (input) => {
|
|
288
|
-
if (!input.trim()) {
|
|
289
|
-
return "应用代码名称不能为空!";
|
|
290
|
-
}
|
|
291
|
-
if (!/^[a-z0-9-_]+$/.test(input)) {
|
|
292
|
-
return "应用代码名称只能包含小写字母、数字、横线和下划线!";
|
|
293
|
-
}
|
|
294
|
-
return true;
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
type: "input",
|
|
299
|
-
name: "appCname",
|
|
300
|
-
message: chalk.cyan("📝 请输入应用名称 (APP_CNAME):"),
|
|
301
|
-
default: projectName.toLowerCase().replace(/[^a-z0-9-_]/g, "-"),
|
|
302
|
-
validate: (input) => {
|
|
303
|
-
if (!input.trim()) {
|
|
304
|
-
return "应用名称不能为空!";
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// 支持中文、英文、数字、横线、下划线,必须以字母或中文开头
|
|
308
|
-
if (
|
|
309
|
-
!/^[\u4e00-\u9fff\u3400-\u4dbfa-zA-Z][\u4e00-\u9fff\u3400-\u4dbfa-zA-Z0-9_-]*$/.test(
|
|
310
|
-
input
|
|
311
|
-
)
|
|
312
|
-
) {
|
|
313
|
-
return "应用名称必须以中文或字母开头,可包含中文、字母、数字、横线和下划线!";
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
return true;
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
type: "confirm",
|
|
321
|
-
name: "sentryEnabled",
|
|
322
|
-
message: chalk.cyan("📝 是否开启 Sentry?"),
|
|
323
|
-
default: true,
|
|
324
|
-
},
|
|
325
|
-
// 如果开启 sentry 则需要输入 sentry 的 dsn
|
|
326
|
-
{
|
|
327
|
-
type: "input",
|
|
328
|
-
name: "sentryDsn",
|
|
329
|
-
message: chalk.cyan("📝 请输入 Sentry 的 DSN:"),
|
|
330
|
-
default: "https://207b65a59562963635abde2cfce82651@sentry.gz4399.com/28",
|
|
331
|
-
when: (answers) => answers.sentryEnabled,
|
|
332
|
-
},
|
|
333
|
-
]);
|
|
334
|
-
|
|
335
|
-
try {
|
|
336
|
-
// 更新模板文件
|
|
337
|
-
await updateEnvTemplate(envFilePath, config);
|
|
338
|
-
printSuccess(`已更新环境配置文件:${chalk.bold(".env.public")}`);
|
|
339
|
-
|
|
340
|
-
// 显示配置信息
|
|
341
|
-
console.log();
|
|
342
|
-
printInfo("应用配置信息:");
|
|
343
|
-
console.log(chalk.gray(` 应用代码名称: ${chalk.white(config.appCname)}`));
|
|
344
|
-
console.log(chalk.gray(` 应用名称: ${chalk.white(config.appName)}`));
|
|
345
|
-
console.log();
|
|
346
|
-
} catch (error) {
|
|
347
|
-
printError(`更新环境配置文件失败:${error.message}`);
|
|
348
|
-
throw error;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// 支持无参数创建(在当前目录)
|
|
353
|
-
program
|
|
354
|
-
.command("create [project-name]") // 使project-name可选
|
|
355
|
-
.description("创建新项目")
|
|
356
|
-
.option("-t, --template <template>", "指定模版")
|
|
357
|
-
.action(async (projectName, options) => {
|
|
358
|
-
// 如果没有提供项目名,询问用户
|
|
359
|
-
if (!projectName) {
|
|
360
|
-
const { name } = await inquirer.prompt({
|
|
361
|
-
type: "input",
|
|
362
|
-
name: "name",
|
|
363
|
-
message: chalk.cyan("📝 请输入项目名称:"),
|
|
364
|
-
default: "my-project",
|
|
365
|
-
validate: (input) => {
|
|
366
|
-
if (!input.trim()) {
|
|
367
|
-
return "项目名称不能为空!";
|
|
368
|
-
}
|
|
369
|
-
return true;
|
|
370
|
-
},
|
|
371
|
-
});
|
|
372
|
-
projectName = name;
|
|
373
|
-
}
|
|
374
|
-
printInfo(`项目名称:${chalk.bold(projectName)}`);
|
|
375
|
-
|
|
376
|
-
const { architectureType } = await inquirer.prompt({
|
|
377
|
-
type: "list",
|
|
378
|
-
name: "architectureType",
|
|
379
|
-
message: chalk.cyan("🏗️ 请选择架构类型:"),
|
|
380
|
-
choices: [
|
|
381
|
-
{
|
|
382
|
-
name: `${chalk.blue("🧩 微前端架构")} - 支持主应用和子应用`,
|
|
383
|
-
value: "microFrontend",
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
name: `${chalk.green("📱 独立应用")} - 单体应用架构`,
|
|
387
|
-
value: "standalone",
|
|
388
|
-
},
|
|
389
|
-
],
|
|
390
|
-
});
|
|
391
|
-
printInfo(
|
|
392
|
-
`架构类型:${chalk.bold(
|
|
393
|
-
architectureType === "microFrontend" ? "微前端架构" : "独立应用"
|
|
394
|
-
)}`
|
|
395
|
-
);
|
|
396
|
-
|
|
397
|
-
let projectTemplate, toolType, appDirection;
|
|
398
|
-
|
|
399
|
-
if (architectureType === "microFrontend") {
|
|
400
|
-
// 微前端架构流程
|
|
401
|
-
// 3. 选择工具类型
|
|
402
|
-
const { toolType: toolTypeResult } = await inquirer.prompt({
|
|
403
|
-
type: "list",
|
|
404
|
-
name: "toolType",
|
|
405
|
-
message: chalk.cyan("🔧 请选择工具类型:"),
|
|
406
|
-
default: "rspack",
|
|
407
|
-
choices: [
|
|
408
|
-
{
|
|
409
|
-
name: `${chalk.blue("📦 Webpack")} - 成熟稳定的打包工具`,
|
|
410
|
-
value: "webpack",
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
name: `${chalk.green("⚡ Vite")} - 快速的构建工具`,
|
|
414
|
-
value: "vite",
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
name: `${chalk.yellow("⚛️ Rspack")} - 快速的打包工具`,
|
|
418
|
-
value: "rspack",
|
|
419
|
-
},
|
|
420
|
-
],
|
|
421
|
-
});
|
|
422
|
-
toolType = toolTypeResult;
|
|
423
|
-
printInfo(`工具类型:${chalk.bold(toolType)}`);
|
|
424
|
-
|
|
425
|
-
// 4. 选择应用方向
|
|
426
|
-
const { appDirection: appDirectionResult } = await inquirer.prompt({
|
|
427
|
-
type: "list",
|
|
428
|
-
name: "appDirection",
|
|
429
|
-
message: chalk.cyan("🎯 请选择应用方向:"),
|
|
430
|
-
choices: [
|
|
431
|
-
{
|
|
432
|
-
name: `${chalk.magenta("🏠 主应用")} - 微前端主应用`,
|
|
433
|
-
value: "main",
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
name: `${chalk.yellow("🧩 子应用")} - 微前端子应用`,
|
|
437
|
-
value: "sub",
|
|
438
|
-
},
|
|
439
|
-
],
|
|
440
|
-
});
|
|
441
|
-
appDirection = appDirectionResult;
|
|
442
|
-
|
|
443
|
-
printInfo(
|
|
444
|
-
`应用方向:${chalk.bold(appDirection === "main" ? "主应用" : "子应用")}`
|
|
445
|
-
);
|
|
446
|
-
|
|
447
|
-
// 5. 选择模版
|
|
448
|
-
if (options.template) {
|
|
449
|
-
const foundTemplate = templates.microFrontend[toolType][
|
|
450
|
-
appDirection
|
|
451
|
-
].find((template) => template.name === options.template);
|
|
452
|
-
if (foundTemplate) {
|
|
453
|
-
projectTemplate = foundTemplate.value;
|
|
454
|
-
printSuccess(`使用指定模版:${chalk.bold(options.template)}`);
|
|
455
|
-
} else {
|
|
456
|
-
printWarning(`未找到指定模版 "${options.template}",请重新选择`);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
if (!projectTemplate) {
|
|
461
|
-
const availableTemplates =
|
|
462
|
-
templates.microFrontend[toolType][appDirection];
|
|
463
|
-
|
|
464
|
-
// 如果只有一个模版,直接使用它
|
|
465
|
-
if (availableTemplates.length === 1) {
|
|
466
|
-
projectTemplate = availableTemplates[0].value;
|
|
467
|
-
} else {
|
|
468
|
-
// 多个模版时让用户选择
|
|
469
|
-
const { template } = await inquirer.prompt({
|
|
470
|
-
type: "list",
|
|
471
|
-
name: "template",
|
|
472
|
-
message: chalk.cyan("📋 请选择模版:"),
|
|
473
|
-
choices: availableTemplates.map((t) => ({
|
|
474
|
-
name: [
|
|
475
|
-
`${t.recommended ? chalk.green("⭐") : " "} ${chalk.white(
|
|
476
|
-
t.name
|
|
477
|
-
)}`,
|
|
478
|
-
` ${chalk.gray(t.description)}`,
|
|
479
|
-
` ${chalk.blue(`特性: ${t.features.join(", ")}`)}`,
|
|
480
|
-
].join("\n"),
|
|
481
|
-
value: t.value,
|
|
482
|
-
short: t.name,
|
|
483
|
-
})),
|
|
484
|
-
pageSize: 10,
|
|
485
|
-
});
|
|
486
|
-
projectTemplate = template;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
} else {
|
|
490
|
-
// 独立应用架构流程
|
|
491
|
-
// 3. 选择框架类型
|
|
492
|
-
const { frameworkType } = await inquirer.prompt({
|
|
493
|
-
type: "list",
|
|
494
|
-
name: "frameworkType",
|
|
495
|
-
message: chalk.cyan("⚛️ 请选择框架类型:"),
|
|
496
|
-
default: "nextjs",
|
|
497
|
-
choices: [
|
|
498
|
-
{
|
|
499
|
-
name: `${chalk.black("▲")} ${chalk.white(
|
|
500
|
-
"Next.js"
|
|
501
|
-
)} - React 全栈框架`,
|
|
502
|
-
value: "nextjs",
|
|
503
|
-
},
|
|
504
|
-
// 可以在这里添加更多独立应用框架
|
|
505
|
-
],
|
|
506
|
-
});
|
|
507
|
-
printInfo(`框架类型:${chalk.bold(frameworkType)}`);
|
|
508
|
-
|
|
509
|
-
// 4. 选择模版
|
|
510
|
-
if (options.template) {
|
|
511
|
-
const foundTemplate = templates.standalone[frameworkType].find(
|
|
512
|
-
(template) => template.name === options.template
|
|
513
|
-
);
|
|
514
|
-
if (foundTemplate) {
|
|
515
|
-
projectTemplate = foundTemplate.value;
|
|
516
|
-
printSuccess(`使用指定模版:${chalk.bold(options.template)}`);
|
|
517
|
-
} else {
|
|
518
|
-
printWarning(`未找到指定模版 "${options.template}",请重新选择`);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
if (!projectTemplate) {
|
|
523
|
-
const availableTemplates = templates.standalone[frameworkType];
|
|
524
|
-
|
|
525
|
-
// 如果只有一个模版,直接使用它
|
|
526
|
-
if (availableTemplates.length === 1) {
|
|
527
|
-
projectTemplate = availableTemplates[0].value;
|
|
528
|
-
printInfo(`使用模版:${chalk.bold(availableTemplates[0].name)}`);
|
|
529
|
-
} else {
|
|
530
|
-
// 多个模版时让用户选择
|
|
531
|
-
const { template } = await inquirer.prompt({
|
|
532
|
-
type: "list",
|
|
533
|
-
name: "template",
|
|
534
|
-
message: chalk.cyan("📋 请选择模版:"),
|
|
535
|
-
choices: availableTemplates.map((t) => ({
|
|
536
|
-
name: `${chalk.white(t.name)}`,
|
|
537
|
-
value: t.value,
|
|
538
|
-
})),
|
|
539
|
-
});
|
|
540
|
-
projectTemplate = template;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
console.log(); // 空行
|
|
546
|
-
|
|
547
|
-
// 获取目标文件夹路径
|
|
548
|
-
const dest = path.join(process.cwd(), projectName);
|
|
549
|
-
// 判断文件夹是否存在,存在就交互询问用户是否覆盖
|
|
550
|
-
if (fs.existsSync(dest)) {
|
|
551
|
-
printWarning(`目录 "${projectName}" 已存在!`);
|
|
552
|
-
const { force } = await inquirer.prompt({
|
|
553
|
-
type: "confirm",
|
|
554
|
-
name: "force",
|
|
555
|
-
message: chalk.yellow("⚠️ 是否覆盖现有目录?"),
|
|
556
|
-
default: false,
|
|
557
|
-
});
|
|
558
|
-
if (force) {
|
|
559
|
-
fs.removeSync(dest);
|
|
560
|
-
printSuccess("已删除现有目录");
|
|
561
|
-
} else {
|
|
562
|
-
printInfo("操作已取消");
|
|
563
|
-
process.exit(1);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
// 开始loading
|
|
568
|
-
const loading = ora({
|
|
569
|
-
text: "正在下载模版...",
|
|
570
|
-
spinner: "bouncingBar",
|
|
571
|
-
});
|
|
572
|
-
loading.start();
|
|
573
|
-
|
|
574
|
-
// 6. 开始下载模版
|
|
575
|
-
try {
|
|
576
|
-
const result = await cloneRepository(projectTemplate, dest);
|
|
577
|
-
loading.succeed();
|
|
578
|
-
printSuccess("模版下载成功!");
|
|
579
|
-
|
|
580
|
-
// 删除.git文件夹
|
|
581
|
-
const gitDir = path.join(dest, ".git");
|
|
582
|
-
if (fs.existsSync(gitDir)) {
|
|
583
|
-
fs.removeSync(gitDir);
|
|
584
|
-
printSuccess("已清理 .git 文件夹");
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
// 新添加:如果是 webpack 子应用,进行环境配置
|
|
588
|
-
if (
|
|
589
|
-
architectureType === "microFrontend" &&
|
|
590
|
-
toolType === "webpack" &&
|
|
591
|
-
appDirection === "sub"
|
|
592
|
-
) {
|
|
593
|
-
console.log(); // 空行
|
|
594
|
-
await configureWebpackSubApp(dest, projectName);
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
console.log(); // 空行
|
|
598
|
-
printFinalInstructions(projectName, architectureType, appDirection);
|
|
599
|
-
} catch (error) {
|
|
600
|
-
loading.fail();
|
|
601
|
-
printError("模版下载失败:" + error);
|
|
602
|
-
process.exit(1);
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
|
|
606
|
-
// 在环境配置前添加说明
|
|
607
|
-
console.log();
|
|
608
|
-
console.log(
|
|
609
|
-
boxen(
|
|
610
|
-
[
|
|
611
|
-
chalk.blue.bold("🔧 环境配置"),
|
|
612
|
-
"",
|
|
613
|
-
chalk.gray("接下来将配置应用的基本信息:"),
|
|
614
|
-
chalk.gray("• 应用名称 - 用于标识和显示"),
|
|
615
|
-
chalk.gray("• 构建配置 - 输出路径和公共路径"),
|
|
616
|
-
chalk.gray("• 监控配置 - Sentry 错误监控(可选)"),
|
|
617
|
-
"",
|
|
618
|
-
chalk.yellow("💡 提示:所有配置后续都可以在代码中修改"),
|
|
619
|
-
].join("\n"),
|
|
620
|
-
{
|
|
621
|
-
padding: 1,
|
|
622
|
-
borderStyle: "round",
|
|
623
|
-
borderColor: "blue",
|
|
624
|
-
}
|
|
625
|
-
)
|
|
626
|
-
);
|
|
627
|
-
|
|
628
|
-
// 定义当前版本
|
|
629
|
-
program.version(`v${pkgInfo.version}`);
|
|
630
|
-
program.on("--help", () => {
|
|
631
|
-
printBanner();
|
|
632
|
-
console.log(chalk.gray("使用示例:"));
|
|
633
|
-
console.log(chalk.white(" @4399ywkf/cli create my-project"));
|
|
634
|
-
console.log(
|
|
635
|
-
chalk.white(
|
|
636
|
-
" @4399ywkf/cli create my-project -t webpack-mainApplicate_demo"
|
|
637
|
-
)
|
|
638
|
-
);
|
|
639
|
-
console.log();
|
|
640
|
-
});
|
|
641
|
-
|
|
642
|
-
program.parse(process.argv);
|
|
643
|
-
|
|
644
|
-
module.exports = cli;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import UnFindPng from '@config/public/404.png';
|
|
2
|
+
import { Button, Empty } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useNavigate } from 'react-router';
|
|
5
|
+
|
|
6
|
+
export const UnPageFind = () => {
|
|
7
|
+
const navigate = useNavigate();
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div className='p-4 w-full h-full relative flex justify-center items-center'>
|
|
11
|
+
<Empty
|
|
12
|
+
image={UnFindPng}
|
|
13
|
+
description={
|
|
14
|
+
<div className='flex flex-col gap-2 justify-center items-center'>
|
|
15
|
+
<h2>抱歉,页面无法访问…</h2>
|
|
16
|
+
<span>404,网址错误或已失效。请检查网址。</span>
|
|
17
|
+
<Button size={'large'} type={'primary'} className='w-24' onClick={() => navigate('/')}>
|
|
18
|
+
返回首页
|
|
19
|
+
</Button>
|
|
20
|
+
</div>
|
|
21
|
+
}
|
|
22
|
+
></Empty>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default UnPageFind;
|
|
Binary file
|