@4399ywkf/cli 1.0.10 → 2.0.1
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/templates/app/.gitignore.tpl +5 -26
- package/dist/templates/app/config/env/.env.development +3 -5
- package/dist/templates/app/config/env/.env.production +1 -2
- package/dist/templates/app/config/env/.env.public.tpl +2 -12
- package/dist/templates/app/package.json.tpl +10 -103
- package/dist/templates/app/public/index.html +1 -19
- package/dist/templates/app/src/index.css +1 -2
- package/dist/templates/app/src/pages/$.tsx +19 -0
- package/dist/templates/app/src/pages/dashboard/analytics/page.tsx +16 -0
- package/dist/templates/app/src/pages/dashboard/layout.tsx +29 -0
- package/dist/templates/app/src/pages/dashboard/page.tsx +31 -0
- package/dist/templates/app/src/pages/error.tsx +20 -0
- package/dist/templates/app/src/pages/layout.tsx +36 -0
- package/dist/templates/app/src/pages/loading.tsx +9 -0
- package/dist/templates/app/src/pages/page.tsx +47 -0
- package/dist/templates/app/src/pages/user/[id]/page.tsx +28 -0
- package/dist/templates/app/src/pages/user/page.tsx +42 -0
- package/dist/templates/app/tsconfig.json +24 -35
- package/dist/templates/app/ywkf.config.ts +71 -0
- package/package.json +45 -22
- package/dist/templates/404/index.tsx +0 -5
- package/dist/templates/404/page.tsx +0 -27
- package/dist/templates/404.png +0 -0
- package/dist/templates/404.tsx +0 -5
- package/dist/templates/AntdStaticMethods/index.tsx +0 -20
- package/dist/templates/AppTheme.tsx +0 -136
- package/dist/templates/BaseLayout.tsx +0 -15
- package/dist/templates/ColorScales/ScaleRow.tsx +0 -74
- package/dist/templates/ColorScales/index.md +0 -168
- package/dist/templates/ColorScales/index.tsx +0 -70
- package/dist/templates/ColorScales/style.ts +0 -42
- package/dist/templates/ConfigProvider/index.md +0 -63
- package/dist/templates/ConfigProvider/index.tsx +0 -42
- package/dist/templates/ContentFormWrapper.tsx +0 -11
- package/dist/templates/ContentWrapper.module.less +0 -137
- package/dist/templates/ContentWrapper.tsx +0 -13
- package/dist/templates/DIRECTORY_STRUCTURE.md +0 -141
- package/dist/templates/ErrorBoundary/index.tsx +0 -506
- package/dist/templates/FontLoader/index.md +0 -12
- package/dist/templates/FontLoader/index.tsx +0 -41
- package/dist/templates/GlobalProvider/AppTheme.tsx +0 -136
- package/dist/templates/GlobalProvider/Locale.tsx +0 -84
- package/dist/templates/GlobalProvider/Query.tsx +0 -12
- package/dist/templates/GlobalProvider/StyleRegistry.tsx +0 -9
- package/dist/templates/GlobalProvider/index.tsx +0 -23
- package/dist/templates/GlobalStyle/antdOverride.ts +0 -89
- package/dist/templates/GlobalStyle/global.ts +0 -61
- package/dist/templates/GlobalStyle/index.ts +0 -10
- package/dist/templates/HarmonyOS_Sans_Bold.woff2 +0 -0
- package/dist/templates/HarmonyOS_Sans_Medium.woff2 +0 -0
- package/dist/templates/HarmonyOS_Sans_Regular.woff2 +0 -0
- package/dist/templates/Loading/index.tsx +0 -21
- package/dist/templates/Locale.tsx +0 -84
- package/dist/templates/MainContentWrap.tsx +0 -64
- package/dist/templates/ManualSlave/ManualSlavePage.module.less +0 -25
- package/dist/templates/ManualSlave/ManualSlavePage.tsx +0 -45
- package/dist/templates/ManualSlave/index.ts +0 -1
- package/dist/templates/ManualSlavePage.module.less +0 -25
- package/dist/templates/ManualSlavePage.tsx +0 -45
- package/dist/templates/Meta.tsx +0 -75
- package/dist/templates/Query.tsx +0 -12
- package/dist/templates/RequireAuth/RequireAuth.tsx +0 -76
- package/dist/templates/RequireAuth/index.ts +0 -1
- package/dist/templates/RequireAuth.tsx +0 -76
- package/dist/templates/RoutesConventionsRspackPlugin.js +0 -100
- package/dist/templates/ScaleRow.tsx +0 -74
- package/dist/templates/StyleRegistry.tsx +0 -9
- package/dist/templates/ThemeContext.tsx +0 -135
- package/dist/templates/ThemeProvider/GlobalStyle/antdOverride.ts +0 -89
- package/dist/templates/ThemeProvider/GlobalStyle/global.ts +0 -61
- package/dist/templates/ThemeProvider/GlobalStyle/index.ts +0 -10
- package/dist/templates/ThemeProvider/Meta.tsx +0 -75
- package/dist/templates/ThemeProvider/ThemeProvider.tsx +0 -109
- package/dist/templates/ThemeProvider/index.md +0 -69
- package/dist/templates/ThemeProvider/index.ts +0 -3
- package/dist/templates/ThemeProvider/type.ts +0 -28
- package/dist/templates/ThemeProvider.tsx +0 -109
- package/dist/templates/actions.ts +0 -23
- package/dist/templates/algorithms/darkAlgorithm.ts +0 -47
- package/dist/templates/algorithms/lightAlgorithm.ts +0 -44
- package/dist/templates/analyzeUnusedKeys.ts +0 -506
- package/dist/templates/antdOverride.ts +0 -89
- package/dist/templates/antdTheme.ts +0 -62
- package/dist/templates/api.ts +0 -5
- package/dist/templates/app/.browserslistrc +0 -5
- package/dist/templates/app/.i18nrc.js +0 -57
- package/dist/templates/app/.nvmrc +0 -1
- package/dist/templates/app/.vscode/settings.json +0 -88
- package/dist/templates/app/config/jwt/index.ts +0 -32
- package/dist/templates/app/config/request/error-handler.ts +0 -67
- package/dist/templates/app/config/request/index.ts +0 -172
- package/dist/templates/app/config/request/interceptors.ts +0 -118
- package/dist/templates/app/config/request/token-manager.ts +0 -23
- package/dist/templates/app/config/request/types.ts +0 -63
- package/dist/templates/app/config/router/index.tsx +0 -26
- package/dist/templates/app/config/rspack/paths.js +0 -12
- package/dist/templates/app/config/rspack/plugins/RoutesConventionsRspackPlugin.js +0 -100
- package/dist/templates/app/config/rspack/rspack.config.mjs +0 -187
- package/dist/templates/app/config/rspack/rspack.dev.mjs +0 -219
- package/dist/templates/app/config/rspack/rspack.prod.mjs +0 -233
- package/dist/templates/app/docs/DIRECTORY_STRUCTURE.md +0 -141
- package/dist/templates/app/docs/glossary.md +0 -11
- package/dist/templates/app/locales/zh-CN/common.json +0 -3
- package/dist/templates/app/public/404.png +0 -0
- package/dist/templates/app/public/fonts/HarmonyOS_Sans_Bold.woff2 +0 -0
- package/dist/templates/app/public/fonts/HarmonyOS_Sans_Medium.woff2 +0 -0
- package/dist/templates/app/public/fonts/HarmonyOS_Sans_Regular.woff2 +0 -0
- package/dist/templates/app/public/images/banner_market_modal.webp +0 -0
- package/dist/templates/app/public/images/chatmode_chat_dark.webp +0 -0
- package/dist/templates/app/public/images/chatmode_chat_light.webp +0 -0
- package/dist/templates/app/public/images/chatmode_docs_dark.webp +0 -0
- package/dist/templates/app/public/images/chatmode_docs_light.webp +0 -0
- package/dist/templates/app/public/images/empty_topic_dark.webp +0 -0
- package/dist/templates/app/public/images/empty_topic_light.webp +0 -0
- package/dist/templates/app/public/images/screenshot_background.webp +0 -0
- package/dist/templates/app/public/images/theme_auto.webp +0 -0
- package/dist/templates/app/public/images/theme_dark.webp +0 -0
- package/dist/templates/app/public/images/theme_light.webp +0 -0
- package/dist/templates/app/react-app-env.d.ts +0 -19
- package/dist/templates/app/scripts/convert-locales-to-json.js +0 -47
- package/dist/templates/app/scripts/i18nWorkflow/analyzeUnusedKeys.ts +0 -506
- package/dist/templates/app/scripts/i18nWorkflow/cleanUnusedKeys.ts +0 -344
- package/dist/templates/app/scripts/i18nWorkflow/const.ts +0 -18
- package/dist/templates/app/scripts/i18nWorkflow/flattenLocaleKeys.ts +0 -139
- package/dist/templates/app/scripts/i18nWorkflow/genDefaultLocale.ts +0 -19
- package/dist/templates/app/scripts/i18nWorkflow/genDiff.ts +0 -49
- package/dist/templates/app/scripts/i18nWorkflow/i18nConfig.ts +0 -7
- package/dist/templates/app/scripts/i18nWorkflow/index.ts +0 -11
- package/dist/templates/app/scripts/i18nWorkflow/protectedPatterns.ts +0 -91
- package/dist/templates/app/scripts/i18nWorkflow/utils.ts +0 -76
- package/dist/templates/app/src/bootstrap/index.ts +0 -34
- package/dist/templates/app/src/color/ColorScales/ScaleRow.tsx +0 -74
- package/dist/templates/app/src/color/ColorScales/index.md +0 -168
- package/dist/templates/app/src/color/ColorScales/index.tsx +0 -70
- package/dist/templates/app/src/color/ColorScales/style.ts +0 -42
- package/dist/templates/app/src/color/colors/blue.ts +0 -66
- package/dist/templates/app/src/color/colors/cyan.ts +0 -66
- package/dist/templates/app/src/color/colors/geekblue.ts +0 -66
- package/dist/templates/app/src/color/colors/gold.ts +0 -66
- package/dist/templates/app/src/color/colors/gray.ts +0 -66
- package/dist/templates/app/src/color/colors/green.ts +0 -66
- package/dist/templates/app/src/color/colors/index.ts +0 -66
- package/dist/templates/app/src/color/colors/lime.ts +0 -66
- package/dist/templates/app/src/color/colors/magenta.ts +0 -66
- package/dist/templates/app/src/color/colors/orange.ts +0 -66
- package/dist/templates/app/src/color/colors/primary.ts +0 -66
- package/dist/templates/app/src/color/colors/purple.ts +0 -66
- package/dist/templates/app/src/color/colors/red.ts +0 -66
- package/dist/templates/app/src/color/colors/volcano.ts +0 -66
- package/dist/templates/app/src/color/colors/yellow.ts +0 -66
- package/dist/templates/app/src/color/index.ts +0 -4
- package/dist/templates/app/src/color/neutrals/index.ts +0 -30
- package/dist/templates/app/src/color/neutrals/mauve.ts +0 -66
- package/dist/templates/app/src/color/neutrals/olive.ts +0 -66
- package/dist/templates/app/src/color/neutrals/sage.ts +0 -66
- package/dist/templates/app/src/color/neutrals/sand.ts +0 -66
- package/dist/templates/app/src/color/neutrals/slate.ts +0 -66
- package/dist/templates/app/src/color/types.ts +0 -21
- package/dist/templates/app/src/components/AntdStaticMethods/index.tsx +0 -20
- package/dist/templates/app/src/components/ConfigProvider/index.md +0 -63
- package/dist/templates/app/src/components/ConfigProvider/index.tsx +0 -42
- package/dist/templates/app/src/components/ErrorBoundary/index.tsx +0 -506
- package/dist/templates/app/src/components/FontLoader/index.md +0 -12
- package/dist/templates/app/src/components/FontLoader/index.tsx +0 -41
- package/dist/templates/app/src/components/Loading/index.tsx +0 -21
- package/dist/templates/app/src/components/ManualSlave/ManualSlavePage.module.less +0 -25
- package/dist/templates/app/src/components/ManualSlave/ManualSlavePage.tsx +0 -45
- package/dist/templates/app/src/components/ManualSlave/index.ts +0 -1
- package/dist/templates/app/src/components/RequireAuth/RequireAuth.tsx +0 -76
- package/dist/templates/app/src/components/RequireAuth/index.ts +0 -1
- package/dist/templates/app/src/components/ThemeProvider/GlobalStyle/antdOverride.ts +0 -89
- package/dist/templates/app/src/components/ThemeProvider/GlobalStyle/global.ts +0 -61
- package/dist/templates/app/src/components/ThemeProvider/GlobalStyle/index.ts +0 -10
- package/dist/templates/app/src/components/ThemeProvider/Meta.tsx +0 -75
- package/dist/templates/app/src/components/ThemeProvider/ThemeProvider.tsx +0 -109
- package/dist/templates/app/src/components/ThemeProvider/index.md +0 -69
- package/dist/templates/app/src/components/ThemeProvider/index.ts +0 -3
- package/dist/templates/app/src/components/ThemeProvider/type.ts +0 -28
- package/dist/templates/app/src/config/env.ts +0 -84
- package/dist/templates/app/src/const/constants.ts +0 -0
- package/dist/templates/app/src/const/locale.ts +0 -9
- package/dist/templates/app/src/const/system.ts +0 -1
- package/dist/templates/app/src/const/theme.ts +0 -5
- package/dist/templates/app/src/const/url.ts +0 -1
- package/dist/templates/app/src/index.tsx +0 -15
- package/dist/templates/app/src/layout/BaseLayout.tsx +0 -15
- package/dist/templates/app/src/layout/ContentFormWrapper.tsx +0 -11
- package/dist/templates/app/src/layout/ContentWrapper.module.less +0 -137
- package/dist/templates/app/src/layout/ContentWrapper.tsx +0 -13
- package/dist/templates/app/src/layout/GlobalProvider/AppTheme.tsx +0 -136
- package/dist/templates/app/src/layout/GlobalProvider/Locale.tsx +0 -84
- package/dist/templates/app/src/layout/GlobalProvider/Query.tsx +0 -12
- package/dist/templates/app/src/layout/GlobalProvider/StyleRegistry.tsx +0 -9
- package/dist/templates/app/src/layout/GlobalProvider/index.tsx +0 -23
- package/dist/templates/app/src/layout/Locale.tsx +0 -85
- package/dist/templates/app/src/layout/MainContentWrap.tsx +0 -64
- package/dist/templates/app/src/layout/ThemeContext.tsx +0 -135
- package/dist/templates/app/src/locales/create.ts +0 -56
- package/dist/templates/app/src/locales/default/common.ts +0 -3
- package/dist/templates/app/src/locales/default/index.ts +0 -7
- package/dist/templates/app/src/locales/resources.ts +0 -104
- package/dist/templates/app/src/locales/utils.ts +0 -23
- package/dist/templates/app/src/micro/garfish.ts +0 -53
- package/dist/templates/app/src/pages/404/index.tsx +0 -5
- package/dist/templates/app/src/pages/404/page.tsx +0 -27
- package/dist/templates/app/src/pages/404.tsx +0 -5
- package/dist/templates/app/src/pages/base/index.tsx +0 -287
- package/dist/templates/app/src/pages/index.tsx +0 -5
- package/dist/templates/app/src/routes.tsx +0 -27
- package/dist/templates/app/src/styles/antdOverride.ts +0 -24
- package/dist/templates/app/src/styles/customTheme.ts +0 -70
- package/dist/templates/app/src/styles/global.ts +0 -53
- package/dist/templates/app/src/styles/highlighter.ts +0 -34
- package/dist/templates/app/src/styles/index.ts +0 -23
- package/dist/templates/app/src/styles/mermaid.ts +0 -7
- package/dist/templates/app/src/styles/text.ts +0 -10
- package/dist/templates/app/src/styles/theme/algorithms/darkAlgorithm.ts +0 -47
- package/dist/templates/app/src/styles/theme/algorithms/lightAlgorithm.ts +0 -44
- package/dist/templates/app/src/styles/theme/antdTheme.ts +0 -62
- package/dist/templates/app/src/styles/theme/customStylish.ts +0 -189
- package/dist/templates/app/src/styles/theme/customToken.ts +0 -93
- package/dist/templates/app/src/styles/theme/generateColorPalette.ts +0 -59
- package/dist/templates/app/src/styles/theme/token/base.ts +0 -16
- package/dist/templates/app/src/styles/theme/token/dark.ts +0 -60
- package/dist/templates/app/src/styles/theme/token/light.ts +0 -60
- package/dist/templates/app/src/types/customStylish.ts +0 -20
- package/dist/templates/app/src/types/customToken.ts +0 -70
- package/dist/templates/app/src/types/global.d.ts +0 -19
- package/dist/templates/app/src/types/index.ts +0 -21
- package/dist/templates/app/src/types/routes.ts +0 -70
- package/dist/templates/app/src/utils/convert.ts +0 -40
- package/dist/templates/app/src/utils/cookie.ts +0 -25
- package/dist/templates/app/src/utils/copyToClipboard.ts +0 -13
- package/dist/templates/app/src/utils/difference.ts +0 -26
- package/dist/templates/app/src/utils/genCdnUrl.ts +0 -30
- package/dist/templates/app/src/utils/index.ts +0 -3
- package/dist/templates/app/src/utils/locale.ts +0 -46
- package/dist/templates/app/store/middleware/createDevtools.ts +0 -23
- package/dist/templates/app/store/middleware/createHyperStorage/index.ts +0 -127
- package/dist/templates/app/store/middleware/createHyperStorage/indexedDB.ts +0 -31
- package/dist/templates/app/store/middleware/createHyperStorage/keyMapper.ts +0 -57
- package/dist/templates/app/store/middleware/createHyperStorage/localStorage.ts +0 -23
- package/dist/templates/app/store/middleware/createHyperStorage/type.ts +0 -27
- package/dist/templates/app/store/middleware/createHyperStorage/urlStorage.ts +0 -85
- package/dist/templates/app/store/types.ts +0 -83
- package/dist/templates/app/store/user/index.tsx +0 -1
- package/dist/templates/app/store/user/indexApi.tsx +0 -5
- package/dist/templates/app/store/user/initialState.ts +0 -15
- package/dist/templates/app/store/user/slices/profile/actions.ts +0 -20
- package/dist/templates/app/store/user/slices/profile/api.ts +0 -5
- package/dist/templates/app/store/user/slices/profile/initialState.ts +0 -14
- package/dist/templates/app/store/user/slices/settings/actions.ts +0 -23
- package/dist/templates/app/store/user/slices/settings/initialState.ts +0 -32
- package/dist/templates/app/store/user/store.ts +0 -39
- package/dist/templates/app/tailwind.config.js +0 -13
- package/dist/templates/app//347/277/273/350/257/221.md +0 -9
- package/dist/templates/banner_market_modal.webp +0 -0
- package/dist/templates/base/index.tsx +0 -287
- package/dist/templates/base.ts +0 -16
- package/dist/templates/blue.ts +0 -66
- package/dist/templates/bootstrap/index.ts +0 -34
- 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/cleanUnusedKeys.ts +0 -344
- package/dist/templates/color/ColorScales/ScaleRow.tsx +0 -74
- package/dist/templates/color/ColorScales/index.md +0 -168
- package/dist/templates/color/ColorScales/index.tsx +0 -70
- package/dist/templates/color/ColorScales/style.ts +0 -42
- package/dist/templates/color/colors/blue.ts +0 -66
- package/dist/templates/color/colors/cyan.ts +0 -66
- package/dist/templates/color/colors/geekblue.ts +0 -66
- package/dist/templates/color/colors/gold.ts +0 -66
- package/dist/templates/color/colors/gray.ts +0 -66
- package/dist/templates/color/colors/green.ts +0 -66
- package/dist/templates/color/colors/index.ts +0 -66
- package/dist/templates/color/colors/lime.ts +0 -66
- package/dist/templates/color/colors/magenta.ts +0 -66
- package/dist/templates/color/colors/orange.ts +0 -66
- package/dist/templates/color/colors/primary.ts +0 -66
- package/dist/templates/color/colors/purple.ts +0 -66
- package/dist/templates/color/colors/red.ts +0 -66
- package/dist/templates/color/colors/volcano.ts +0 -66
- package/dist/templates/color/colors/yellow.ts +0 -66
- package/dist/templates/color/index.ts +0 -4
- package/dist/templates/color/neutrals/index.ts +0 -30
- package/dist/templates/color/neutrals/mauve.ts +0 -66
- package/dist/templates/color/neutrals/olive.ts +0 -66
- package/dist/templates/color/neutrals/sage.ts +0 -66
- package/dist/templates/color/neutrals/sand.ts +0 -66
- package/dist/templates/color/neutrals/slate.ts +0 -66
- package/dist/templates/color/types.ts +0 -21
- package/dist/templates/colors/blue.ts +0 -66
- package/dist/templates/colors/cyan.ts +0 -66
- package/dist/templates/colors/geekblue.ts +0 -66
- package/dist/templates/colors/gold.ts +0 -66
- package/dist/templates/colors/gray.ts +0 -66
- package/dist/templates/colors/green.ts +0 -66
- package/dist/templates/colors/index.ts +0 -66
- package/dist/templates/colors/lime.ts +0 -66
- package/dist/templates/colors/magenta.ts +0 -66
- package/dist/templates/colors/orange.ts +0 -66
- package/dist/templates/colors/primary.ts +0 -66
- package/dist/templates/colors/purple.ts +0 -66
- package/dist/templates/colors/red.ts +0 -66
- package/dist/templates/colors/volcano.ts +0 -66
- package/dist/templates/colors/yellow.ts +0 -66
- package/dist/templates/common.json +0 -3
- package/dist/templates/common.ts +0 -3
- package/dist/templates/components/AntdStaticMethods/index.tsx +0 -20
- package/dist/templates/components/ConfigProvider/index.md +0 -63
- package/dist/templates/components/ConfigProvider/index.tsx +0 -42
- package/dist/templates/components/ErrorBoundary/index.tsx +0 -506
- package/dist/templates/components/FontLoader/index.md +0 -12
- package/dist/templates/components/FontLoader/index.tsx +0 -41
- package/dist/templates/components/Loading/index.tsx +0 -21
- package/dist/templates/components/ManualSlave/ManualSlavePage.module.less +0 -25
- package/dist/templates/components/ManualSlave/ManualSlavePage.tsx +0 -45
- package/dist/templates/components/ManualSlave/index.ts +0 -1
- package/dist/templates/components/RequireAuth/RequireAuth.tsx +0 -76
- package/dist/templates/components/RequireAuth/index.ts +0 -1
- package/dist/templates/components/ThemeProvider/GlobalStyle/antdOverride.ts +0 -89
- package/dist/templates/components/ThemeProvider/GlobalStyle/global.ts +0 -61
- package/dist/templates/components/ThemeProvider/GlobalStyle/index.ts +0 -10
- package/dist/templates/components/ThemeProvider/Meta.tsx +0 -75
- package/dist/templates/components/ThemeProvider/ThemeProvider.tsx +0 -109
- package/dist/templates/components/ThemeProvider/index.md +0 -69
- package/dist/templates/components/ThemeProvider/index.ts +0 -3
- package/dist/templates/components/ThemeProvider/type.ts +0 -28
- package/dist/templates/config/env/.env.development +0 -5
- package/dist/templates/config/env/.env.production +0 -2
- package/dist/templates/config/env/.env.public.tpl +0 -14
- package/dist/templates/config/env.ts +0 -84
- package/dist/templates/config/jwt/index.ts +0 -32
- package/dist/templates/config/request/error-handler.ts +0 -67
- package/dist/templates/config/request/index.ts +0 -172
- package/dist/templates/config/request/interceptors.ts +0 -118
- package/dist/templates/config/request/token-manager.ts +0 -23
- package/dist/templates/config/request/types.ts +0 -63
- package/dist/templates/config/router/index.tsx +0 -26
- package/dist/templates/config/rspack/paths.js +0 -12
- package/dist/templates/config/rspack/plugins/RoutesConventionsRspackPlugin.js +0 -100
- package/dist/templates/config/rspack/rspack.config.mjs +0 -187
- package/dist/templates/config/rspack/rspack.dev.mjs +0 -219
- package/dist/templates/config/rspack/rspack.prod.mjs +0 -233
- package/dist/templates/const/constants.ts +0 -0
- package/dist/templates/const/locale.ts +0 -9
- package/dist/templates/const/system.ts +0 -1
- package/dist/templates/const/theme.ts +0 -5
- package/dist/templates/const/url.ts +0 -1
- package/dist/templates/const.ts +0 -18
- package/dist/templates/constants.ts +0 -0
- package/dist/templates/convert-locales-to-json.js +0 -47
- package/dist/templates/convert.ts +0 -40
- package/dist/templates/cookie.ts +0 -25
- package/dist/templates/copyToClipboard.ts +0 -13
- package/dist/templates/create.ts +0 -56
- package/dist/templates/createDevtools.ts +0 -23
- package/dist/templates/createHyperStorage/index.ts +0 -127
- package/dist/templates/createHyperStorage/indexedDB.ts +0 -31
- package/dist/templates/createHyperStorage/keyMapper.ts +0 -57
- package/dist/templates/createHyperStorage/localStorage.ts +0 -23
- package/dist/templates/createHyperStorage/type.ts +0 -27
- package/dist/templates/createHyperStorage/urlStorage.ts +0 -85
- package/dist/templates/customStylish.ts +0 -189
- package/dist/templates/customTheme.ts +0 -70
- package/dist/templates/customToken.ts +0 -93
- package/dist/templates/cyan.ts +0 -66
- package/dist/templates/dark.ts +0 -60
- package/dist/templates/darkAlgorithm.ts +0 -47
- package/dist/templates/default/common.ts +0 -3
- package/dist/templates/default/index.ts +0 -7
- package/dist/templates/difference.ts +0 -26
- package/dist/templates/docs/DIRECTORY_STRUCTURE.md +0 -141
- package/dist/templates/docs/glossary.md +0 -11
- package/dist/templates/empty_topic_dark.webp +0 -0
- package/dist/templates/empty_topic_light.webp +0 -0
- package/dist/templates/env/.env.development +0 -5
- package/dist/templates/env/.env.production +0 -2
- package/dist/templates/env/.env.public.tpl +0 -14
- package/dist/templates/env.ts +0 -84
- package/dist/templates/error-handler.ts +0 -67
- package/dist/templates/favicon.ico +0 -0
- package/dist/templates/flattenLocaleKeys.ts +0 -139
- package/dist/templates/fonts/HarmonyOS_Sans_Bold.woff2 +0 -0
- package/dist/templates/fonts/HarmonyOS_Sans_Medium.woff2 +0 -0
- package/dist/templates/fonts/HarmonyOS_Sans_Regular.woff2 +0 -0
- package/dist/templates/garfish.ts +0 -53
- package/dist/templates/geekblue.ts +0 -66
- package/dist/templates/genCdnUrl.ts +0 -30
- package/dist/templates/genDefaultLocale.ts +0 -19
- package/dist/templates/genDiff.ts +0 -49
- package/dist/templates/generateColorPalette.ts +0 -59
- package/dist/templates/global.d.ts +0 -19
- package/dist/templates/global.ts +0 -61
- package/dist/templates/glossary.md +0 -11
- package/dist/templates/gold.ts +0 -66
- package/dist/templates/gray.ts +0 -66
- package/dist/templates/green.ts +0 -66
- package/dist/templates/highlighter.ts +0 -34
- package/dist/templates/i18nConfig.ts +0 -7
- package/dist/templates/i18nWorkflow/analyzeUnusedKeys.ts +0 -506
- package/dist/templates/i18nWorkflow/cleanUnusedKeys.ts +0 -344
- package/dist/templates/i18nWorkflow/const.ts +0 -18
- package/dist/templates/i18nWorkflow/flattenLocaleKeys.ts +0 -139
- package/dist/templates/i18nWorkflow/genDefaultLocale.ts +0 -19
- package/dist/templates/i18nWorkflow/genDiff.ts +0 -49
- package/dist/templates/i18nWorkflow/i18nConfig.ts +0 -7
- package/dist/templates/i18nWorkflow/index.ts +0 -11
- package/dist/templates/i18nWorkflow/protectedPatterns.ts +0 -91
- package/dist/templates/i18nWorkflow/utils.ts +0 -76
- 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 +0 -2
- package/dist/templates/index.html +0 -29
- package/dist/templates/index.md +0 -69
- package/dist/templates/index.ts +0 -10
- package/dist/templates/index.tsx +0 -287
- package/dist/templates/indexApi.tsx +0 -5
- package/dist/templates/indexedDB.ts +0 -31
- package/dist/templates/initialState.ts +0 -32
- package/dist/templates/interceptors.ts +0 -118
- package/dist/templates/jwt/index.ts +0 -32
- package/dist/templates/keyMapper.ts +0 -57
- package/dist/templates/layout/BaseLayout.tsx +0 -15
- package/dist/templates/layout/ContentFormWrapper.tsx +0 -11
- package/dist/templates/layout/ContentWrapper.module.less +0 -137
- package/dist/templates/layout/ContentWrapper.tsx +0 -13
- package/dist/templates/layout/GlobalProvider/AppTheme.tsx +0 -136
- package/dist/templates/layout/GlobalProvider/Locale.tsx +0 -84
- package/dist/templates/layout/GlobalProvider/Query.tsx +0 -12
- package/dist/templates/layout/GlobalProvider/StyleRegistry.tsx +0 -9
- package/dist/templates/layout/GlobalProvider/index.tsx +0 -23
- package/dist/templates/layout/Locale.tsx +0 -85
- package/dist/templates/layout/MainContentWrap.tsx +0 -64
- package/dist/templates/layout/ThemeContext.tsx +0 -135
- package/dist/templates/light.ts +0 -60
- package/dist/templates/lightAlgorithm.ts +0 -44
- package/dist/templates/lime.ts +0 -66
- package/dist/templates/localStorage.ts +0 -23
- package/dist/templates/locale.ts +0 -46
- package/dist/templates/locales/create.ts +0 -56
- package/dist/templates/locales/default/common.ts +0 -3
- package/dist/templates/locales/default/index.ts +0 -7
- package/dist/templates/locales/resources.ts +0 -104
- package/dist/templates/locales/utils.ts +0 -23
- package/dist/templates/locales/zh-CN/common.json +0 -3
- package/dist/templates/magenta.ts +0 -66
- package/dist/templates/mauve.ts +0 -66
- package/dist/templates/mermaid.ts +0 -7
- package/dist/templates/micro/garfish.ts +0 -53
- package/dist/templates/middleware/createDevtools.ts +0 -23
- package/dist/templates/middleware/createHyperStorage/index.ts +0 -127
- package/dist/templates/middleware/createHyperStorage/indexedDB.ts +0 -31
- package/dist/templates/middleware/createHyperStorage/keyMapper.ts +0 -57
- package/dist/templates/middleware/createHyperStorage/localStorage.ts +0 -23
- package/dist/templates/middleware/createHyperStorage/type.ts +0 -27
- package/dist/templates/middleware/createHyperStorage/urlStorage.ts +0 -85
- package/dist/templates/neutrals/index.ts +0 -30
- package/dist/templates/neutrals/mauve.ts +0 -66
- package/dist/templates/neutrals/olive.ts +0 -66
- package/dist/templates/neutrals/sage.ts +0 -66
- package/dist/templates/neutrals/sand.ts +0 -66
- package/dist/templates/neutrals/slate.ts +0 -66
- package/dist/templates/olive.ts +0 -66
- package/dist/templates/orange.ts +0 -66
- package/dist/templates/package.json.tpl +0 -128
- package/dist/templates/page.tsx +0 -27
- package/dist/templates/pages/404/index.tsx +0 -5
- package/dist/templates/pages/404/page.tsx +0 -27
- package/dist/templates/pages/404.tsx +0 -5
- package/dist/templates/pages/base/index.tsx +0 -287
- package/dist/templates/pages/index.tsx +0 -5
- package/dist/templates/paths.js +0 -12
- package/dist/templates/plugins/RoutesConventionsRspackPlugin.js +0 -100
- package/dist/templates/postcss.config.js +0 -6
- package/dist/templates/primary.ts +0 -66
- package/dist/templates/profile/actions.ts +0 -20
- package/dist/templates/profile/api.ts +0 -5
- package/dist/templates/profile/initialState.ts +0 -14
- package/dist/templates/protectedPatterns.ts +0 -91
- package/dist/templates/public/404.png +0 -0
- package/dist/templates/public/favicon.ico +0 -0
- package/dist/templates/public/fonts/HarmonyOS_Sans_Bold.woff2 +0 -0
- package/dist/templates/public/fonts/HarmonyOS_Sans_Medium.woff2 +0 -0
- package/dist/templates/public/fonts/HarmonyOS_Sans_Regular.woff2 +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 +0 -29
- package/dist/templates/purple.ts +0 -66
- package/dist/templates/react-app-env.d.ts +0 -19
- package/dist/templates/red.ts +0 -66
- package/dist/templates/request/error-handler.ts +0 -67
- package/dist/templates/request/index.ts +0 -172
- package/dist/templates/request/interceptors.ts +0 -118
- package/dist/templates/request/token-manager.ts +0 -23
- package/dist/templates/request/types.ts +0 -63
- package/dist/templates/resources.ts +0 -104
- package/dist/templates/router/index.tsx +0 -26
- package/dist/templates/routes.ts +0 -70
- package/dist/templates/routes.tsx +0 -27
- package/dist/templates/rspack/paths.js +0 -12
- package/dist/templates/rspack/plugins/RoutesConventionsRspackPlugin.js +0 -100
- package/dist/templates/rspack/rspack.config.mjs +0 -187
- package/dist/templates/rspack/rspack.dev.mjs +0 -219
- package/dist/templates/rspack/rspack.prod.mjs +0 -233
- package/dist/templates/rspack.config.mjs +0 -187
- package/dist/templates/rspack.dev.mjs +0 -219
- package/dist/templates/rspack.prod.mjs +0 -233
- package/dist/templates/sage.ts +0 -66
- package/dist/templates/sand.ts +0 -66
- package/dist/templates/screenshot_background.webp +0 -0
- package/dist/templates/scripts/convert-locales-to-json.js +0 -47
- package/dist/templates/scripts/i18nWorkflow/analyzeUnusedKeys.ts +0 -506
- package/dist/templates/scripts/i18nWorkflow/cleanUnusedKeys.ts +0 -344
- package/dist/templates/scripts/i18nWorkflow/const.ts +0 -18
- package/dist/templates/scripts/i18nWorkflow/flattenLocaleKeys.ts +0 -139
- package/dist/templates/scripts/i18nWorkflow/genDefaultLocale.ts +0 -19
- package/dist/templates/scripts/i18nWorkflow/genDiff.ts +0 -49
- package/dist/templates/scripts/i18nWorkflow/i18nConfig.ts +0 -7
- package/dist/templates/scripts/i18nWorkflow/index.ts +0 -11
- package/dist/templates/scripts/i18nWorkflow/protectedPatterns.ts +0 -91
- package/dist/templates/scripts/i18nWorkflow/utils.ts +0 -76
- package/dist/templates/settings/actions.ts +0 -23
- package/dist/templates/settings/initialState.ts +0 -32
- package/dist/templates/slate.ts +0 -66
- package/dist/templates/slices/profile/actions.ts +0 -20
- package/dist/templates/slices/profile/api.ts +0 -5
- package/dist/templates/slices/profile/initialState.ts +0 -14
- package/dist/templates/slices/settings/actions.ts +0 -23
- package/dist/templates/slices/settings/initialState.ts +0 -32
- package/dist/templates/src/bootstrap/index.ts +0 -34
- package/dist/templates/src/color/ColorScales/ScaleRow.tsx +0 -74
- package/dist/templates/src/color/ColorScales/index.md +0 -168
- package/dist/templates/src/color/ColorScales/index.tsx +0 -70
- package/dist/templates/src/color/ColorScales/style.ts +0 -42
- package/dist/templates/src/color/colors/blue.ts +0 -66
- package/dist/templates/src/color/colors/cyan.ts +0 -66
- package/dist/templates/src/color/colors/geekblue.ts +0 -66
- package/dist/templates/src/color/colors/gold.ts +0 -66
- package/dist/templates/src/color/colors/gray.ts +0 -66
- package/dist/templates/src/color/colors/green.ts +0 -66
- package/dist/templates/src/color/colors/index.ts +0 -66
- package/dist/templates/src/color/colors/lime.ts +0 -66
- package/dist/templates/src/color/colors/magenta.ts +0 -66
- package/dist/templates/src/color/colors/orange.ts +0 -66
- package/dist/templates/src/color/colors/primary.ts +0 -66
- package/dist/templates/src/color/colors/purple.ts +0 -66
- package/dist/templates/src/color/colors/red.ts +0 -66
- package/dist/templates/src/color/colors/volcano.ts +0 -66
- package/dist/templates/src/color/colors/yellow.ts +0 -66
- package/dist/templates/src/color/index.ts +0 -4
- package/dist/templates/src/color/neutrals/index.ts +0 -30
- package/dist/templates/src/color/neutrals/mauve.ts +0 -66
- package/dist/templates/src/color/neutrals/olive.ts +0 -66
- package/dist/templates/src/color/neutrals/sage.ts +0 -66
- package/dist/templates/src/color/neutrals/sand.ts +0 -66
- package/dist/templates/src/color/neutrals/slate.ts +0 -66
- package/dist/templates/src/color/types.ts +0 -21
- package/dist/templates/src/components/AntdStaticMethods/index.tsx +0 -20
- package/dist/templates/src/components/ConfigProvider/index.md +0 -63
- package/dist/templates/src/components/ConfigProvider/index.tsx +0 -42
- package/dist/templates/src/components/ErrorBoundary/index.tsx +0 -506
- package/dist/templates/src/components/FontLoader/index.md +0 -12
- package/dist/templates/src/components/FontLoader/index.tsx +0 -41
- package/dist/templates/src/components/Loading/index.tsx +0 -21
- package/dist/templates/src/components/ManualSlave/ManualSlavePage.module.less +0 -25
- package/dist/templates/src/components/ManualSlave/ManualSlavePage.tsx +0 -45
- package/dist/templates/src/components/ManualSlave/index.ts +0 -1
- package/dist/templates/src/components/RequireAuth/RequireAuth.tsx +0 -76
- package/dist/templates/src/components/RequireAuth/index.ts +0 -1
- package/dist/templates/src/components/ThemeProvider/GlobalStyle/antdOverride.ts +0 -89
- package/dist/templates/src/components/ThemeProvider/GlobalStyle/global.ts +0 -61
- package/dist/templates/src/components/ThemeProvider/GlobalStyle/index.ts +0 -10
- package/dist/templates/src/components/ThemeProvider/Meta.tsx +0 -75
- package/dist/templates/src/components/ThemeProvider/ThemeProvider.tsx +0 -109
- package/dist/templates/src/components/ThemeProvider/index.md +0 -69
- package/dist/templates/src/components/ThemeProvider/index.ts +0 -3
- package/dist/templates/src/components/ThemeProvider/type.ts +0 -28
- package/dist/templates/src/config/env.ts +0 -84
- package/dist/templates/src/const/constants.ts +0 -0
- package/dist/templates/src/const/locale.ts +0 -9
- package/dist/templates/src/const/system.ts +0 -1
- package/dist/templates/src/const/theme.ts +0 -5
- package/dist/templates/src/const/url.ts +0 -1
- package/dist/templates/src/index.css +0 -2
- package/dist/templates/src/index.tsx +0 -15
- package/dist/templates/src/layout/BaseLayout.tsx +0 -15
- package/dist/templates/src/layout/ContentFormWrapper.tsx +0 -11
- package/dist/templates/src/layout/ContentWrapper.module.less +0 -137
- package/dist/templates/src/layout/ContentWrapper.tsx +0 -13
- package/dist/templates/src/layout/GlobalProvider/AppTheme.tsx +0 -136
- package/dist/templates/src/layout/GlobalProvider/Locale.tsx +0 -84
- package/dist/templates/src/layout/GlobalProvider/Query.tsx +0 -12
- package/dist/templates/src/layout/GlobalProvider/StyleRegistry.tsx +0 -9
- package/dist/templates/src/layout/GlobalProvider/index.tsx +0 -23
- package/dist/templates/src/layout/Locale.tsx +0 -85
- package/dist/templates/src/layout/MainContentWrap.tsx +0 -64
- package/dist/templates/src/layout/ThemeContext.tsx +0 -135
- package/dist/templates/src/locales/create.ts +0 -56
- package/dist/templates/src/locales/default/common.ts +0 -3
- package/dist/templates/src/locales/default/index.ts +0 -7
- package/dist/templates/src/locales/resources.ts +0 -104
- package/dist/templates/src/locales/utils.ts +0 -23
- package/dist/templates/src/micro/garfish.ts +0 -53
- package/dist/templates/src/pages/404/index.tsx +0 -5
- package/dist/templates/src/pages/404/page.tsx +0 -27
- package/dist/templates/src/pages/404.tsx +0 -5
- package/dist/templates/src/pages/base/index.tsx +0 -287
- package/dist/templates/src/pages/index.tsx +0 -5
- package/dist/templates/src/routes.tsx +0 -27
- package/dist/templates/src/styles/antdOverride.ts +0 -24
- package/dist/templates/src/styles/customTheme.ts +0 -70
- package/dist/templates/src/styles/global.ts +0 -53
- package/dist/templates/src/styles/highlighter.ts +0 -34
- package/dist/templates/src/styles/index.ts +0 -23
- package/dist/templates/src/styles/mermaid.ts +0 -7
- package/dist/templates/src/styles/text.ts +0 -10
- package/dist/templates/src/styles/theme/algorithms/darkAlgorithm.ts +0 -47
- package/dist/templates/src/styles/theme/algorithms/lightAlgorithm.ts +0 -44
- package/dist/templates/src/styles/theme/antdTheme.ts +0 -62
- package/dist/templates/src/styles/theme/customStylish.ts +0 -189
- package/dist/templates/src/styles/theme/customToken.ts +0 -93
- package/dist/templates/src/styles/theme/generateColorPalette.ts +0 -59
- package/dist/templates/src/styles/theme/token/base.ts +0 -16
- package/dist/templates/src/styles/theme/token/dark.ts +0 -60
- package/dist/templates/src/styles/theme/token/light.ts +0 -60
- package/dist/templates/src/types/customStylish.ts +0 -20
- package/dist/templates/src/types/customToken.ts +0 -70
- package/dist/templates/src/types/global.d.ts +0 -19
- package/dist/templates/src/types/index.ts +0 -21
- package/dist/templates/src/types/routes.ts +0 -70
- package/dist/templates/src/utils/convert.ts +0 -40
- package/dist/templates/src/utils/cookie.ts +0 -25
- package/dist/templates/src/utils/copyToClipboard.ts +0 -13
- package/dist/templates/src/utils/difference.ts +0 -26
- package/dist/templates/src/utils/genCdnUrl.ts +0 -30
- package/dist/templates/src/utils/index.ts +0 -3
- package/dist/templates/src/utils/locale.ts +0 -46
- package/dist/templates/store/middleware/createDevtools.ts +0 -23
- package/dist/templates/store/middleware/createHyperStorage/index.ts +0 -127
- package/dist/templates/store/middleware/createHyperStorage/indexedDB.ts +0 -31
- package/dist/templates/store/middleware/createHyperStorage/keyMapper.ts +0 -57
- package/dist/templates/store/middleware/createHyperStorage/localStorage.ts +0 -23
- package/dist/templates/store/middleware/createHyperStorage/type.ts +0 -27
- package/dist/templates/store/middleware/createHyperStorage/urlStorage.ts +0 -85
- package/dist/templates/store/types.ts +0 -83
- package/dist/templates/store/user/index.tsx +0 -1
- package/dist/templates/store/user/indexApi.tsx +0 -5
- package/dist/templates/store/user/initialState.ts +0 -15
- package/dist/templates/store/user/slices/profile/actions.ts +0 -20
- package/dist/templates/store/user/slices/profile/api.ts +0 -5
- package/dist/templates/store/user/slices/profile/initialState.ts +0 -14
- package/dist/templates/store/user/slices/settings/actions.ts +0 -23
- package/dist/templates/store/user/slices/settings/initialState.ts +0 -32
- package/dist/templates/store/user/store.ts +0 -39
- package/dist/templates/store.ts +0 -39
- package/dist/templates/style.ts +0 -42
- package/dist/templates/styles/antdOverride.ts +0 -24
- package/dist/templates/styles/customTheme.ts +0 -70
- package/dist/templates/styles/global.ts +0 -53
- package/dist/templates/styles/highlighter.ts +0 -34
- package/dist/templates/styles/index.ts +0 -23
- package/dist/templates/styles/mermaid.ts +0 -7
- package/dist/templates/styles/text.ts +0 -10
- package/dist/templates/styles/theme/algorithms/darkAlgorithm.ts +0 -47
- package/dist/templates/styles/theme/algorithms/lightAlgorithm.ts +0 -44
- package/dist/templates/styles/theme/antdTheme.ts +0 -62
- package/dist/templates/styles/theme/customStylish.ts +0 -189
- package/dist/templates/styles/theme/customToken.ts +0 -93
- package/dist/templates/styles/theme/generateColorPalette.ts +0 -59
- package/dist/templates/styles/theme/token/base.ts +0 -16
- package/dist/templates/styles/theme/token/dark.ts +0 -60
- package/dist/templates/styles/theme/token/light.ts +0 -60
- package/dist/templates/system.ts +0 -1
- package/dist/templates/tailwind.config.js +0 -13
- package/dist/templates/text.ts +0 -10
- package/dist/templates/theme/algorithms/darkAlgorithm.ts +0 -47
- package/dist/templates/theme/algorithms/lightAlgorithm.ts +0 -44
- package/dist/templates/theme/antdTheme.ts +0 -62
- package/dist/templates/theme/customStylish.ts +0 -189
- package/dist/templates/theme/customToken.ts +0 -93
- package/dist/templates/theme/generateColorPalette.ts +0 -59
- package/dist/templates/theme/token/base.ts +0 -16
- package/dist/templates/theme/token/dark.ts +0 -60
- package/dist/templates/theme/token/light.ts +0 -60
- package/dist/templates/theme.ts +0 -5
- 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/token/base.ts +0 -16
- package/dist/templates/token/dark.ts +0 -60
- package/dist/templates/token/light.ts +0 -60
- package/dist/templates/token-manager.ts +0 -23
- package/dist/templates/tsconfig.json +0 -43
- package/dist/templates/type.ts +0 -27
- package/dist/templates/types/customStylish.ts +0 -20
- package/dist/templates/types/customToken.ts +0 -70
- package/dist/templates/types/global.d.ts +0 -19
- package/dist/templates/types/index.ts +0 -21
- package/dist/templates/types/routes.ts +0 -70
- package/dist/templates/types.ts +0 -21
- package/dist/templates/url.ts +0 -1
- package/dist/templates/urlStorage.ts +0 -85
- package/dist/templates/user/index.tsx +0 -1
- package/dist/templates/user/indexApi.tsx +0 -5
- package/dist/templates/user/initialState.ts +0 -15
- package/dist/templates/user/slices/profile/actions.ts +0 -20
- package/dist/templates/user/slices/profile/api.ts +0 -5
- package/dist/templates/user/slices/profile/initialState.ts +0 -14
- package/dist/templates/user/slices/settings/actions.ts +0 -23
- package/dist/templates/user/slices/settings/initialState.ts +0 -32
- package/dist/templates/user/store.ts +0 -39
- package/dist/templates/utils/convert.ts +0 -40
- package/dist/templates/utils/cookie.ts +0 -25
- package/dist/templates/utils/copyToClipboard.ts +0 -13
- package/dist/templates/utils/difference.ts +0 -26
- package/dist/templates/utils/genCdnUrl.ts +0 -30
- package/dist/templates/utils/index.ts +0 -3
- package/dist/templates/utils/locale.ts +0 -46
- package/dist/templates/utils.ts +0 -23
- package/dist/templates/volcano.ts +0 -66
- package/dist/templates/yellow.ts +0 -66
- package/dist/templates/zh-CN/common.json +0 -3
- package/dist/templates//347/277/273/350/257/221.md +0 -9
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/prefer-top-level-await */
|
|
2
|
-
import { consola } from 'consola';
|
|
3
|
-
import { colors } from 'consola/utils';
|
|
4
|
-
import { glob } from 'glob';
|
|
5
|
-
import * as fs from 'node:fs';
|
|
6
|
-
import * as path from 'node:path';
|
|
7
|
-
|
|
8
|
-
import { IGNORED_FILES, PROTECTED_KEY_PATTERNS } from './protectedPatterns';
|
|
9
|
-
|
|
10
|
-
interface I18nKey {
|
|
11
|
-
fullKey: string;
|
|
12
|
-
key: string;
|
|
13
|
-
namespace: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface UnusedKey extends I18nKey {
|
|
17
|
-
filePath: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Check if a key should be protected (considered as "used")
|
|
22
|
-
*/
|
|
23
|
-
function isProtectedKey(namespace: string, key: string): boolean {
|
|
24
|
-
// Check if namespace is in protected list
|
|
25
|
-
if (PROTECTED_KEY_PATTERNS.includes(namespace)) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Check if key matches any protected pattern
|
|
30
|
-
const fullKey = `${namespace}.${key}`;
|
|
31
|
-
return PROTECTED_KEY_PATTERNS.some((pattern) => {
|
|
32
|
-
// Exact namespace match
|
|
33
|
-
if (pattern === namespace) return true;
|
|
34
|
-
// Partial key match (e.g., "error.code" matches "error.code.NOT_FOUND")
|
|
35
|
-
if (fullKey.startsWith(pattern + '.')) return true;
|
|
36
|
-
return false;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Recursively extract all keys from a nested object
|
|
42
|
-
*/
|
|
43
|
-
function extractKeysFromObject(obj: any, namespace: string, prefix: string = ''): I18nKey[] {
|
|
44
|
-
const keys: I18nKey[] = [];
|
|
45
|
-
|
|
46
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
47
|
-
const fullKey = prefix ? `${prefix}.${key}` : key;
|
|
48
|
-
|
|
49
|
-
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
50
|
-
// Recursively extract keys from nested objects
|
|
51
|
-
keys.push(...extractKeysFromObject(value, namespace, fullKey));
|
|
52
|
-
} else {
|
|
53
|
-
// This is a leaf node (actual translation)
|
|
54
|
-
keys.push({
|
|
55
|
-
fullKey: `${namespace}:${fullKey}`,
|
|
56
|
-
key: fullKey,
|
|
57
|
-
namespace,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return keys;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Load all i18n keys from src/locales/default
|
|
67
|
-
*/
|
|
68
|
-
function loadAllI18nKeys(): I18nKey[] {
|
|
69
|
-
const defaultLocalesPath = path.join(process.cwd(), 'src/locales/default');
|
|
70
|
-
const allKeys: I18nKey[] = [];
|
|
71
|
-
|
|
72
|
-
// Get all TypeScript files except index.ts and ignored files
|
|
73
|
-
const ignoredFiles: string[] = [...IGNORED_FILES];
|
|
74
|
-
const files = fs
|
|
75
|
-
.readdirSync(defaultLocalesPath)
|
|
76
|
-
.filter((f) => f.endsWith('.ts') && f !== 'index.ts' && !ignoredFiles.includes(f));
|
|
77
|
-
|
|
78
|
-
consola.info(`Found ${files.length} namespace files (ignored: ${ignoredFiles.join(', ')})`);
|
|
79
|
-
|
|
80
|
-
for (const file of files) {
|
|
81
|
-
const namespace = path.basename(file, '.ts');
|
|
82
|
-
const filePath = path.join(defaultLocalesPath, file);
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
// Use require to load the TypeScript file (after it's compiled)
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
87
|
-
const loadedModule = require(filePath);
|
|
88
|
-
const translations = loadedModule.default || loadedModule;
|
|
89
|
-
|
|
90
|
-
const keys = extractKeysFromObject(translations, namespace);
|
|
91
|
-
allKeys.push(...keys);
|
|
92
|
-
|
|
93
|
-
consola.success(colors.cyan(namespace.padEnd(20)), colors.gray(`${keys.length} keys`));
|
|
94
|
-
} catch (error) {
|
|
95
|
-
consola.error(`Failed to load ${file}:`, error);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return allKeys;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Find all t() function calls in the codebase
|
|
104
|
-
*/
|
|
105
|
-
async function findAllTranslationCalls(): Promise<Set<string>> {
|
|
106
|
-
const usedKeys = new Set<string>();
|
|
107
|
-
|
|
108
|
-
// Patterns to search for translation calls
|
|
109
|
-
const patterns = [
|
|
110
|
-
'src/**/*.{ts,tsx,js,jsx}',
|
|
111
|
-
'apps/desktop/src/**/*.{ts,tsx,js,jsx}',
|
|
112
|
-
'packages/**/src/**/*.{ts,tsx,js,jsx}', // Include packages directory
|
|
113
|
-
'!**/*.test.{ts,tsx}',
|
|
114
|
-
'!**/*.spec.{ts,tsx}',
|
|
115
|
-
'!**/node_modules/**',
|
|
116
|
-
'!**/.next/**',
|
|
117
|
-
];
|
|
118
|
-
|
|
119
|
-
consola.start('Scanning codebase for translation calls...');
|
|
120
|
-
|
|
121
|
-
const files = await glob(patterns);
|
|
122
|
-
consola.info(`Found ${files.length} files to scan`);
|
|
123
|
-
|
|
124
|
-
// Regular expressions to match translation calls
|
|
125
|
-
// Mark dynamic patterns with special flag to handle them differently
|
|
126
|
-
const regexPatterns: Array<{
|
|
127
|
-
// Whether this pattern captures dynamic keys
|
|
128
|
-
captureNs?: boolean;
|
|
129
|
-
isDynamic?: boolean;
|
|
130
|
-
pattern: RegExp; // Whether pattern can capture namespace
|
|
131
|
-
}> = [
|
|
132
|
-
// Static patterns
|
|
133
|
-
{ pattern: /\bt[A-Z]?\w*\(\s*["'`]([^"'`]+)["'`]/g },
|
|
134
|
-
{
|
|
135
|
-
captureNs: true,
|
|
136
|
-
pattern: /\bt[A-Z]?\w*\(\s*["'`]([^"'`]+)["'`]\s*,\s*{[^}]*ns:\s*["'`]([^"'`]+)["'`]/g,
|
|
137
|
-
},
|
|
138
|
-
{ pattern: /i18n\.t\(\s*["'`]([^"'`]+)["'`]/g },
|
|
139
|
-
{ pattern: /\bt[A-Z]?\w*\([^)]*\?\s*["'`]([^"'`]+)["'`]/g },
|
|
140
|
-
{ pattern: /\bt[A-Z]?\w*\([^)]*:\s*["'`]([^"'`]+)["'`]/g },
|
|
141
|
-
{ pattern: /<Trans[^>]+i18nKey=["']([^"']+)["']/g },
|
|
142
|
-
{ pattern: /<Trans[^>]+i18nKey={["']([^"']+)["']}/g },
|
|
143
|
-
{ captureNs: true, pattern: /<Trans[^>]+i18nKey=["']([^"']+)["'][\S\s]*?ns=["']([^"']+)["']/g },
|
|
144
|
-
{
|
|
145
|
-
captureNs: true,
|
|
146
|
-
pattern: /<Trans[^>]+i18nKey={["']([^"']+)["']}[\S\s]*?ns={["']([^"']+)["']}/g,
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
// Dynamic patterns (template strings, concatenations, etc.)
|
|
150
|
-
// Pattern 1: t(`prefix.${var}.suffix`) - variable in the middle
|
|
151
|
-
{ captureNs: false, isDynamic: true, pattern: /\bt[A-Z]?\w*\(\s*`([^$`]+)\${[^}]+}([^`]*)`/g },
|
|
152
|
-
// Pattern 2: t(`${var}.suffix`) - variable at the start
|
|
153
|
-
{ captureNs: false, isDynamic: true, pattern: /\bt[A-Z]?\w*\(\s*`\${[^}]+}([^`]+)`/g },
|
|
154
|
-
// Pattern 3: t(`prefix.${var}.suffix`, { ns: 'namespace' }) - with explicit ns
|
|
155
|
-
{
|
|
156
|
-
captureNs: true,
|
|
157
|
-
isDynamic: true,
|
|
158
|
-
pattern: /\bt[A-Z]?\w*\(\s*`([^$`]*)\${[^}]+}([^`]*)`\s*,\s*{[^}]*ns:\s*["'`]([^"'`]+)["'`]/g,
|
|
159
|
-
},
|
|
160
|
-
// Pattern 4: t(`${var}.suffix`, { ns: 'namespace' }) - variable at start with ns
|
|
161
|
-
{
|
|
162
|
-
captureNs: true,
|
|
163
|
-
isDynamic: true,
|
|
164
|
-
pattern: /\bt[A-Z]?\w*\(\s*`\${[^}]+}([^`]+)`\s*,\s*{[^}]*ns:\s*["'`]([^"'`]+)["'`]/g,
|
|
165
|
-
},
|
|
166
|
-
// Pattern 5: String concatenation
|
|
167
|
-
{ isDynamic: true, pattern: /\bt[A-Z]?\w*\(\s*["'`]([^"'`]+)["'`]\s*\+/g },
|
|
168
|
-
// Pattern 6: <Trans> with dynamic keys
|
|
169
|
-
{ isDynamic: true, pattern: /<Trans[^>]+i18nKey={`([^$`]+)\${[^}]+}([^`]*)`}/g },
|
|
170
|
-
];
|
|
171
|
-
|
|
172
|
-
let totalMatches = 0;
|
|
173
|
-
|
|
174
|
-
for (const file of files) {
|
|
175
|
-
const content = fs.readFileSync(file, 'utf8');
|
|
176
|
-
|
|
177
|
-
// Extract namespace from useTranslation hook
|
|
178
|
-
const useTranslationMatch = content.match(/useTranslation\(\s*["'`]([^"'`]+)["'`]\s*\)/g);
|
|
179
|
-
const useTranslationMultiMatch = content.match(/useTranslation\(\s*\[([^\]]+)]\s*\)/g);
|
|
180
|
-
|
|
181
|
-
// Extract aliases: const { t: tAuth } = useTranslation('auth')
|
|
182
|
-
const aliasPattern =
|
|
183
|
-
/const\s*{\s*t\s*:\s*(\w+)\s*}\s*=\s*useTranslation\(\s*["'`]([^"'`]+)["'`]\s*\)/g;
|
|
184
|
-
const aliasMatches = content.matchAll(aliasPattern);
|
|
185
|
-
|
|
186
|
-
const namespacesInFile = new Set<string>();
|
|
187
|
-
const aliasToNamespace = new Map<string, string>();
|
|
188
|
-
|
|
189
|
-
// Extract namespaces from useTranslation('namespace')
|
|
190
|
-
if (useTranslationMatch) {
|
|
191
|
-
for (const match of useTranslationMatch) {
|
|
192
|
-
const ns = match.match(/["'`]([^"'`]+)["'`]/)?.[1];
|
|
193
|
-
if (ns) namespacesInFile.add(ns);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Extract namespaces from useTranslation(['ns1', 'ns2'])
|
|
198
|
-
if (useTranslationMultiMatch) {
|
|
199
|
-
for (const match of useTranslationMultiMatch) {
|
|
200
|
-
const nsArray = match.match(/\[([^\]]+)]/)?.[1];
|
|
201
|
-
if (nsArray) {
|
|
202
|
-
const namespaces = nsArray.match(/["'`]([^"'`]+)["'`]/g);
|
|
203
|
-
if (namespaces) {
|
|
204
|
-
for (const ns of namespaces) {
|
|
205
|
-
const cleanNs = ns.replaceAll(/["'`]/g, '');
|
|
206
|
-
namespacesInFile.add(cleanNs);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// Extract alias mappings (e.g., tAuth -> 'auth')
|
|
214
|
-
for (const match of aliasMatches) {
|
|
215
|
-
const alias = match[1];
|
|
216
|
-
const namespace = match[2];
|
|
217
|
-
aliasToNamespace.set(alias, namespace);
|
|
218
|
-
namespacesInFile.add(namespace);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// Find all t() calls
|
|
222
|
-
for (const { pattern: regex, captureNs, isDynamic } of regexPatterns) {
|
|
223
|
-
const matches = content.matchAll(regex);
|
|
224
|
-
|
|
225
|
-
for (const match of matches) {
|
|
226
|
-
totalMatches++;
|
|
227
|
-
const fullMatch = match[0];
|
|
228
|
-
const key = match[1];
|
|
229
|
-
let explicitNs: string | undefined;
|
|
230
|
-
|
|
231
|
-
// For patterns with captureNs, namespace is in a different position
|
|
232
|
-
if (captureNs && isDynamic) {
|
|
233
|
-
// Dynamic patterns with ns: match[1] + match[2] = key parts, match[3] = ns
|
|
234
|
-
explicitNs = match[3] || match[2]; // Try match[3] first, fall back to match[2]
|
|
235
|
-
} else if (captureNs) {
|
|
236
|
-
// Static patterns with ns: match[1] = key, match[2] = ns
|
|
237
|
-
explicitNs = match[2];
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
if (!key) continue;
|
|
241
|
-
|
|
242
|
-
// Extract function name (t, tAuth, tCommon, etc.)
|
|
243
|
-
const funcNameMatch = fullMatch.match(/\b(t[A-Z]?\w*)\(/);
|
|
244
|
-
const funcName = funcNameMatch?.[1] || 't';
|
|
245
|
-
|
|
246
|
-
// Check if it's an alias with known namespace
|
|
247
|
-
let aliasNamespace: string | undefined;
|
|
248
|
-
if (funcName !== 't' && aliasToNamespace.has(funcName)) {
|
|
249
|
-
aliasNamespace = aliasToNamespace.get(funcName);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// Handle dynamic keys differently
|
|
253
|
-
if (isDynamic) {
|
|
254
|
-
// For dynamic patterns, extract the static prefix/suffix
|
|
255
|
-
// e.g., t(`mcp.details.${var}.title`) -> "mcp.details." and ".title"
|
|
256
|
-
// e.g., t(`${var}.title`) -> ".title"
|
|
257
|
-
let prefix = '';
|
|
258
|
-
let suffix = '';
|
|
259
|
-
|
|
260
|
-
if (match[2] !== undefined) {
|
|
261
|
-
// Pattern has both prefix and suffix: match[1] = prefix, match[2] = suffix
|
|
262
|
-
prefix = match[1] || '';
|
|
263
|
-
suffix = match[2] || '';
|
|
264
|
-
} else {
|
|
265
|
-
// Pattern has only suffix (var at start): match[1] = suffix
|
|
266
|
-
suffix = match[1] || '';
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// Combine prefix and suffix for the pattern
|
|
270
|
-
const pattern = (prefix + suffix).trim();
|
|
271
|
-
if (!pattern) continue; // Skip if nothing to protect
|
|
272
|
-
|
|
273
|
-
// Determine the namespace
|
|
274
|
-
let targetNs: string | undefined;
|
|
275
|
-
if (aliasNamespace) {
|
|
276
|
-
targetNs = aliasNamespace;
|
|
277
|
-
} else if (explicitNs) {
|
|
278
|
-
targetNs = explicitNs;
|
|
279
|
-
} else if (namespacesInFile.size === 1) {
|
|
280
|
-
targetNs = [...namespacesInFile][0];
|
|
281
|
-
} else if (namespacesInFile.size > 0) {
|
|
282
|
-
// Multiple namespaces, add prefix pattern for each
|
|
283
|
-
for (const ns of namespacesInFile) {
|
|
284
|
-
usedKeys.add(`${ns}:${pattern}*`);
|
|
285
|
-
}
|
|
286
|
-
continue;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
if (targetNs) {
|
|
290
|
-
usedKeys.add(`${targetNs}:${pattern}*`);
|
|
291
|
-
}
|
|
292
|
-
continue;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// Handle static keys
|
|
296
|
-
if (explicitNs) {
|
|
297
|
-
// Has explicit namespace
|
|
298
|
-
usedKeys.add(`${explicitNs}:${key}`);
|
|
299
|
-
} else if (aliasNamespace) {
|
|
300
|
-
// Using alias (e.g., tAuth('key'))
|
|
301
|
-
usedKeys.add(`${aliasNamespace}:${key}`);
|
|
302
|
-
} else if (key.includes(':')) {
|
|
303
|
-
// Key already includes namespace (e.g., t('common:key'))
|
|
304
|
-
usedKeys.add(key);
|
|
305
|
-
} else {
|
|
306
|
-
// Use namespaces from useTranslation hook
|
|
307
|
-
if (namespacesInFile.size > 0) {
|
|
308
|
-
for (const ns of namespacesInFile) {
|
|
309
|
-
usedKeys.add(`${ns}:${key}`);
|
|
310
|
-
}
|
|
311
|
-
} else {
|
|
312
|
-
// Default to 'common' if no namespace found
|
|
313
|
-
usedKeys.add(`common:${key}`);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
consola.success(`Found ${totalMatches} translation calls`);
|
|
321
|
-
consola.info(`Extracted ${usedKeys.size} unique keys`);
|
|
322
|
-
|
|
323
|
-
return usedKeys;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Find unused i18n keys
|
|
328
|
-
*/
|
|
329
|
-
function findUnusedKeys(allKeys: I18nKey[], usedKeys: Set<string>): UnusedKey[] {
|
|
330
|
-
const unused: UnusedKey[] = [];
|
|
331
|
-
const protectedKeys: UnusedKey[] = [];
|
|
332
|
-
|
|
333
|
-
// Extract prefix patterns from usedKeys
|
|
334
|
-
// e.g., "discover:mcp.details.*" means any key starting with "mcp.details." in discover namespace
|
|
335
|
-
const prefixPatterns: Array<{ namespace: string; prefix: string }> = [];
|
|
336
|
-
for (const key of usedKeys) {
|
|
337
|
-
if (key.includes('*')) {
|
|
338
|
-
const [namespace, pattern] = key.split(':');
|
|
339
|
-
const prefix = pattern.replace(/\*$/, ''); // Remove trailing *
|
|
340
|
-
prefixPatterns.push({ namespace, prefix });
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
for (const keyInfo of allKeys) {
|
|
345
|
-
// Check if key is protected by configuration
|
|
346
|
-
if (isProtectedKey(keyInfo.namespace, keyInfo.key)) {
|
|
347
|
-
protectedKeys.push({
|
|
348
|
-
...keyInfo,
|
|
349
|
-
filePath: `src/locales/default/${keyInfo.namespace}.ts`,
|
|
350
|
-
});
|
|
351
|
-
continue;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
// Check if key matches any prefix pattern (from dynamic usage)
|
|
355
|
-
let matchesPrefix = false;
|
|
356
|
-
for (const { namespace, prefix } of prefixPatterns) {
|
|
357
|
-
if (keyInfo.namespace === namespace && keyInfo.key.startsWith(prefix)) {
|
|
358
|
-
matchesPrefix = true;
|
|
359
|
-
break;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (matchesPrefix) {
|
|
364
|
-
protectedKeys.push({
|
|
365
|
-
...keyInfo,
|
|
366
|
-
filePath: `src/locales/default/${keyInfo.namespace}.ts`,
|
|
367
|
-
});
|
|
368
|
-
continue;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Check if key is actually used
|
|
372
|
-
if (!usedKeys.has(keyInfo.fullKey)) {
|
|
373
|
-
unused.push({
|
|
374
|
-
...keyInfo,
|
|
375
|
-
filePath: `src/locales/default/${keyInfo.namespace}.ts`,
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
if (protectedKeys.length > 0) {
|
|
381
|
-
consola.info('');
|
|
382
|
-
consola.info(colors.cyan('Protected keys (considered as used):'));
|
|
383
|
-
consola.info(
|
|
384
|
-
` ${colors.green(protectedKeys.length.toString())} keys protected by patterns or dynamic usage`,
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
return unused;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Generate report
|
|
393
|
-
*/
|
|
394
|
-
function generateReport(unusedKeys: UnusedKey[], allKeysCount: number, usedKeysCount: number) {
|
|
395
|
-
consola.box('📊 Unused i18n Keys Analysis Report');
|
|
396
|
-
|
|
397
|
-
const actualUsedCount = allKeysCount - unusedKeys.length;
|
|
398
|
-
|
|
399
|
-
consola.info('');
|
|
400
|
-
consola.info(colors.cyan('Statistics:'));
|
|
401
|
-
consola.info(` Total defined keys: ${colors.yellow(allKeysCount.toString())}`);
|
|
402
|
-
consola.info(` Used keys: ${colors.green(actualUsedCount.toString())}`);
|
|
403
|
-
consola.info(` Unused keys: ${colors.red(unusedKeys.length.toString())}`);
|
|
404
|
-
consola.info(
|
|
405
|
-
` Usage rate: ${colors.cyan(((actualUsedCount / allKeysCount) * 100).toFixed(2) + '%')}`,
|
|
406
|
-
);
|
|
407
|
-
consola.info('');
|
|
408
|
-
consola.info(colors.gray('Protected patterns:'));
|
|
409
|
-
consola.info(` ${colors.gray(PROTECTED_KEY_PATTERNS.map((p) => `"${p}"`).join(', '))}`);
|
|
410
|
-
consola.info('');
|
|
411
|
-
|
|
412
|
-
if (unusedKeys.length === 0) {
|
|
413
|
-
consola.success('🎉 All i18n keys are being used!');
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
// Group by namespace
|
|
418
|
-
const byNamespace = new Map<string, UnusedKey[]>();
|
|
419
|
-
for (const key of unusedKeys) {
|
|
420
|
-
if (!byNamespace.has(key.namespace)) {
|
|
421
|
-
byNamespace.set(key.namespace, []);
|
|
422
|
-
}
|
|
423
|
-
byNamespace.get(key.namespace)!.push(key);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
consola.info(colors.yellow('Unused keys by namespace:'));
|
|
427
|
-
consola.info('');
|
|
428
|
-
|
|
429
|
-
for (const [namespace, keys] of byNamespace.entries()) {
|
|
430
|
-
consola.warn(
|
|
431
|
-
`${colors.cyan(namespace.padEnd(20))} ${colors.gray('→')} ${colors.red(keys.length + ' unused keys')}`,
|
|
432
|
-
);
|
|
433
|
-
|
|
434
|
-
// Show first 10 keys
|
|
435
|
-
const displayKeys = keys.slice(0, 10);
|
|
436
|
-
for (const key of displayKeys) {
|
|
437
|
-
consola.log(` ${colors.gray('•')} ${key.key}`);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
if (keys.length > 10) {
|
|
441
|
-
consola.log(` ${colors.gray(`... and ${keys.length - 10} more`)}`);
|
|
442
|
-
}
|
|
443
|
-
consola.info('');
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
// Save detailed report to file
|
|
447
|
-
const reportPath = path.join(process.cwd(), 'i18n-unused-keys-report.json');
|
|
448
|
-
fs.writeFileSync(
|
|
449
|
-
reportPath,
|
|
450
|
-
JSON.stringify(
|
|
451
|
-
{
|
|
452
|
-
generatedAt: new Date().toISOString(),
|
|
453
|
-
statistics: {
|
|
454
|
-
totalKeys: allKeysCount,
|
|
455
|
-
unusedKeys: unusedKeys.length,
|
|
456
|
-
usageRate: ((usedKeysCount / allKeysCount) * 100).toFixed(2) + '%',
|
|
457
|
-
usedKeys: usedKeysCount,
|
|
458
|
-
},
|
|
459
|
-
unusedKeys: unusedKeys.map((k) => ({
|
|
460
|
-
filePath: k.filePath,
|
|
461
|
-
fullKey: k.fullKey,
|
|
462
|
-
key: k.key,
|
|
463
|
-
namespace: k.namespace,
|
|
464
|
-
})),
|
|
465
|
-
unusedKeysByNamespace: Array.from(byNamespace.entries()).map(([ns, keys]) => ({
|
|
466
|
-
count: keys.length,
|
|
467
|
-
keys: keys.map((k) => k.key),
|
|
468
|
-
namespace: ns,
|
|
469
|
-
})),
|
|
470
|
-
},
|
|
471
|
-
null,
|
|
472
|
-
2,
|
|
473
|
-
),
|
|
474
|
-
);
|
|
475
|
-
|
|
476
|
-
consola.success(`Detailed report saved to: ${colors.cyan(reportPath)}`);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* Main function
|
|
481
|
-
*/
|
|
482
|
-
async function main() {
|
|
483
|
-
consola.start('Starting i18n unused keys analysis...');
|
|
484
|
-
consola.info('');
|
|
485
|
-
|
|
486
|
-
// Step 1: Load all defined keys
|
|
487
|
-
consola.box('Step 1: Loading all i18n keys');
|
|
488
|
-
const allKeys = loadAllI18nKeys();
|
|
489
|
-
consola.success(`Total keys loaded: ${allKeys.length}`);
|
|
490
|
-
consola.info('');
|
|
491
|
-
|
|
492
|
-
// Step 2: Find all translation calls
|
|
493
|
-
consola.box('Step 2: Finding translation calls in codebase');
|
|
494
|
-
const usedKeys = await findAllTranslationCalls();
|
|
495
|
-
consola.info('');
|
|
496
|
-
|
|
497
|
-
// Step 3: Find unused keys
|
|
498
|
-
consola.box('Step 3: Analyzing unused keys');
|
|
499
|
-
const unusedKeys = findUnusedKeys(allKeys, usedKeys);
|
|
500
|
-
consola.info('');
|
|
501
|
-
|
|
502
|
-
// Step 4: Generate report
|
|
503
|
-
generateReport(unusedKeys, allKeys.length, usedKeys.size);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
main();
|