@qlover/create-app 0.7.14 → 0.8.0
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/CHANGELOG.md +27 -0
- package/dist/configs/_common/.gitignore.template +6 -0
- package/dist/configs/_common/.prettierignore +17 -5
- package/dist/configs/_common/.vscode/settings.json +6 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/next-app/.env.template +1 -1
- package/dist/templates/next-app/README.en.md +130 -0
- package/dist/templates/next-app/README.md +114 -20
- package/dist/templates/next-app/config/Identifier/api.ts +5 -5
- package/dist/templates/next-app/config/Identifier/common/admint.table.ts +69 -0
- package/dist/templates/next-app/config/Identifier/common/common.ts +76 -0
- package/dist/templates/next-app/config/Identifier/common/index.ts +3 -0
- package/dist/templates/next-app/config/Identifier/{validator.ts → common/validators.ts} +5 -5
- package/dist/templates/next-app/config/Identifier/index.ts +2 -12
- package/dist/templates/next-app/config/Identifier/pages/index.ts +6 -0
- package/dist/templates/next-app/config/Identifier/pages/page.admin.home.ts +27 -0
- package/dist/templates/next-app/config/Identifier/pages/page.admin.locales.ts +266 -0
- package/dist/templates/next-app/config/Identifier/pages/page.admin.user.ts +293 -0
- package/dist/templates/{react-app/config/Identifier → next-app/config/Identifier/pages}/page.home.ts +15 -22
- package/dist/templates/next-app/config/Identifier/{page.login.ts → pages/page.login.ts} +28 -34
- package/dist/templates/next-app/config/Identifier/{page.register.ts → pages/page.register.ts} +30 -29
- package/dist/templates/next-app/config/adminNavs.ts +19 -0
- package/dist/templates/next-app/config/common.ts +22 -13
- package/dist/templates/next-app/config/i18n/HomeI18n.ts +5 -5
- package/dist/templates/next-app/config/i18n/admin18n.ts +61 -19
- package/dist/templates/next-app/config/i18n/i18nConfig.ts +2 -0
- package/dist/templates/next-app/config/i18n/i18nKeyScheam.ts +36 -0
- package/dist/templates/next-app/config/i18n/loginI18n.ts +22 -22
- package/dist/templates/next-app/config/i18n/register18n.ts +23 -24
- package/dist/templates/next-app/docs/en/api.md +387 -0
- package/dist/templates/next-app/docs/en/component.md +544 -0
- package/dist/templates/next-app/docs/en/database.md +496 -0
- package/dist/templates/next-app/docs/en/development-guide.md +727 -0
- package/dist/templates/next-app/docs/en/env.md +563 -0
- package/dist/templates/next-app/docs/en/i18n.md +287 -0
- package/dist/templates/next-app/docs/en/index.md +165 -0
- package/dist/templates/next-app/docs/en/page.md +457 -0
- package/dist/templates/next-app/docs/en/project-structure.md +176 -0
- package/dist/templates/next-app/docs/en/router.md +427 -0
- package/dist/templates/next-app/docs/en/theme.md +532 -0
- package/dist/templates/next-app/docs/en/validator.md +478 -0
- package/dist/templates/next-app/docs/zh/api.md +387 -0
- package/dist/templates/next-app/docs/zh/component.md +544 -0
- package/dist/templates/next-app/docs/zh/database.md +496 -0
- package/dist/templates/next-app/docs/zh/development-guide.md +727 -0
- package/dist/templates/next-app/docs/zh/env.md +563 -0
- package/dist/templates/next-app/docs/zh/i18n.md +287 -0
- package/dist/templates/next-app/docs/zh/index.md +165 -0
- package/dist/templates/next-app/docs/zh/page.md +457 -0
- package/dist/templates/next-app/docs/zh/project-structure.md +176 -0
- package/dist/templates/next-app/docs/zh/router.md +427 -0
- package/dist/templates/next-app/docs/zh/theme.md +532 -0
- package/dist/templates/next-app/docs/zh/validator.md +476 -0
- package/dist/templates/next-app/make/generateLocales.ts +19 -12
- package/dist/templates/next-app/migrations/schema/LocalesSchema.ts +15 -0
- package/dist/templates/next-app/migrations/sql/1694244000000.sql +11 -0
- package/dist/templates/next-app/package.json +7 -3
- package/dist/templates/next-app/public/locales/en.json +172 -207
- package/dist/templates/next-app/public/locales/zh.json +172 -207
- package/dist/templates/next-app/src/app/[locale]/admin/locales/page.tsx +153 -0
- package/dist/templates/next-app/src/app/[locale]/admin/users/page.tsx +48 -50
- package/dist/templates/next-app/src/app/[locale]/login/LoginForm.tsx +2 -2
- package/dist/templates/next-app/src/app/api/admin/locales/create/route.ts +34 -0
- package/dist/templates/next-app/src/app/api/admin/locales/import/route.ts +40 -0
- package/dist/templates/next-app/src/app/api/admin/locales/route.ts +42 -0
- package/dist/templates/next-app/src/app/api/admin/locales/update/route.ts +32 -0
- package/dist/templates/next-app/src/app/api/locales/json/route.ts +44 -0
- package/dist/templates/next-app/src/base/cases/AdminPageManager.ts +1 -13
- package/dist/templates/next-app/src/base/cases/Datetime.ts +18 -0
- package/dist/templates/next-app/src/base/cases/DialogErrorPlugin.ts +12 -6
- package/dist/templates/next-app/src/base/cases/ResourceState.ts +17 -0
- package/dist/templates/next-app/src/base/cases/TranslateI18nInterface.ts +25 -0
- package/dist/templates/next-app/src/base/cases/ZodColumnBuilder.ts +200 -0
- package/dist/templates/next-app/src/base/port/ZodBuilderInterface.ts +8 -0
- package/dist/templates/next-app/src/base/services/AdminLocalesService.ts +20 -0
- package/dist/templates/next-app/src/base/services/AdminPageEvent.ts +26 -0
- package/dist/templates/next-app/src/base/services/AdminPageScheduler.ts +42 -0
- package/dist/templates/next-app/src/base/services/ResourceService.ts +122 -0
- package/dist/templates/next-app/src/base/services/adminApi/AdminLocalesApi.ts +104 -0
- package/dist/templates/next-app/src/base/services/adminApi/AdminUserApi.ts +38 -5
- package/dist/templates/next-app/src/base/services/appApi/AppApiPlugin.ts +1 -1
- package/dist/templates/next-app/src/i18n/request.ts +30 -1
- package/dist/templates/next-app/src/server/PageParams.ts +2 -10
- package/dist/templates/next-app/src/server/port/DBBridgeInterface.ts +5 -0
- package/dist/templates/next-app/src/server/port/DBTableInterface.ts +2 -0
- package/dist/templates/next-app/src/server/port/LocalesRepositoryInterface.ts +43 -0
- package/dist/templates/next-app/src/server/repositorys/LocalesRepository.ts +197 -0
- package/dist/templates/next-app/src/server/services/ApiLocaleService.ts +122 -0
- package/dist/templates/next-app/src/server/sqlBridges/SupabaseBridge.ts +60 -11
- package/dist/templates/next-app/src/server/validators/ExtendedExecutorError.ts +6 -0
- package/dist/templates/next-app/src/server/validators/LocalesValidator.ts +131 -0
- package/dist/templates/next-app/src/server/validators/LoginValidator.ts +2 -5
- package/dist/templates/next-app/src/server/validators/PaginationValidator.ts +32 -16
- package/dist/templates/next-app/src/styles/css/antd-themes/pagination/_default.css +2 -1
- package/dist/templates/next-app/src/styles/css/antd-themes/pagination/dark.css +28 -29
- package/dist/templates/next-app/src/styles/css/antd-themes/pagination/pink.css +2 -1
- package/dist/templates/next-app/src/uikit/components/AdminLayout.tsx +17 -3
- package/dist/templates/next-app/src/uikit/components/BaseHeader.tsx +5 -4
- package/dist/templates/next-app/src/uikit/components/BaseLayout.tsx +5 -4
- package/dist/templates/next-app/src/uikit/components/BootstrapsProvider.tsx +3 -2
- package/dist/templates/next-app/src/uikit/components/ComboProvider.tsx +1 -1
- package/dist/templates/next-app/src/uikit/components/EditableCell.tsx +118 -0
- package/dist/templates/next-app/src/uikit/components/LogoutButton.tsx +5 -6
- package/dist/templates/next-app/src/uikit/components/ThemeSwitcher.tsx +1 -1
- package/dist/templates/next-app/src/uikit/components/With.tsx +2 -2
- package/dist/templates/next-app/src/uikit/components/localesImportButton/LocalesImportButton.tsx +62 -0
- package/dist/templates/next-app/src/uikit/components/localesImportButton/LocalesImportEvent.ts +28 -0
- package/dist/templates/next-app/src/uikit/components/localesImportButton/import.module.css +6 -0
- package/dist/templates/next-app/src/uikit/hook/useI18nInterface.ts +8 -14
- package/dist/templates/next-app/src/uikit/hook/useWarnTranslations.ts +25 -0
- package/dist/templates/react-app/.prettierignore +17 -0
- package/dist/templates/react-app/README.en.md +71 -54
- package/dist/templates/react-app/README.md +35 -18
- package/dist/templates/react-app/__tests__/__mocks__/BootstrapTest.ts +14 -0
- package/dist/templates/react-app/__tests__/__mocks__/MockAppConfit.ts +1 -1
- package/dist/templates/react-app/__tests__/__mocks__/MockDialogHandler.ts +2 -2
- package/dist/templates/react-app/__tests__/__mocks__/MockLogger.ts +1 -1
- package/dist/templates/react-app/__tests__/__mocks__/components/TestApp.tsx +45 -0
- package/dist/templates/react-app/__tests__/__mocks__/components/TestBootstrapsProvider.tsx +34 -0
- package/dist/templates/react-app/__tests__/__mocks__/components/TestRouter.tsx +46 -0
- package/dist/templates/react-app/__tests__/__mocks__/components/index.ts +12 -0
- package/dist/templates/react-app/__tests__/__mocks__/createMockGlobals.ts +1 -2
- package/dist/templates/react-app/__tests__/__mocks__/testIOC/TestIOC.ts +51 -0
- package/dist/templates/react-app/__tests__/__mocks__/testIOC/TestIOCRegister.ts +69 -0
- package/dist/templates/react-app/__tests__/setup/index.ts +1 -51
- package/dist/templates/react-app/__tests__/setup/setupGlobal.ts +51 -0
- package/dist/templates/react-app/__tests__/src/App.structure.test.tsx +115 -0
- package/dist/templates/react-app/__tests__/src/base/cases/AppConfig.test.ts +2 -2
- package/dist/templates/react-app/__tests__/src/base/cases/AppError.test.ts +1 -1
- package/dist/templates/react-app/__tests__/src/base/cases/DialogHandler.test.ts +3 -5
- package/dist/templates/react-app/__tests__/src/base/cases/I18nKeyErrorPlugin.test.ts +13 -2
- package/dist/templates/react-app/__tests__/src/base/cases/InversifyContainer.test.ts +1 -1
- package/dist/templates/react-app/__tests__/src/base/cases/PublicAssetsPath.test.ts +1 -1
- package/dist/templates/react-app/__tests__/src/base/cases/RequestLogger.test.ts +5 -5
- package/dist/templates/react-app/__tests__/src/base/cases/RequestStatusCatcher.test.ts +1 -2
- package/dist/templates/react-app/__tests__/src/base/cases/RouterLoader.test.ts +25 -15
- package/dist/templates/react-app/__tests__/src/base/services/I18nService.test.ts +29 -15
- package/dist/templates/react-app/__tests__/src/core/IOC.test.ts +19 -9
- package/dist/templates/react-app/__tests__/src/core/bootstraps/BootstrapClient.test.ts +153 -0
- package/dist/templates/react-app/__tests__/src/core/bootstraps/BootstrapsApp.test.ts +9 -7
- package/dist/templates/react-app/__tests__/src/main.integration.test.tsx +4 -5
- package/dist/templates/react-app/__tests__/src/main.test.tsx +4 -4
- package/dist/templates/react-app/__tests__/src/uikit/components/BaseHeader.test.tsx +68 -59
- package/dist/templates/react-app/config/IOCIdentifier.ts +8 -8
- package/dist/templates/react-app/config/Identifier/{common.error.ts → common/common.error.ts} +5 -5
- package/dist/templates/react-app/config/Identifier/{common.ts → common/common.ts} +9 -9
- package/dist/templates/react-app/config/Identifier/common/index.ts +2 -0
- package/dist/templates/react-app/config/Identifier/index.ts +1 -9
- package/dist/templates/react-app/config/Identifier/pages/index.ts +8 -0
- package/dist/templates/react-app/config/Identifier/{page.about.ts → pages/page.about.ts} +34 -26
- package/dist/templates/react-app/config/Identifier/{page.executor.ts → pages/page.executor.ts} +47 -39
- package/dist/templates/{next-app/config/Identifier → react-app/config/Identifier/pages}/page.home.ts +24 -23
- package/dist/templates/react-app/config/Identifier/pages/page.identifiter.ts +102 -0
- package/dist/templates/react-app/config/Identifier/{page.jsonStorage.ts → pages/page.jsonStorage.ts} +18 -11
- package/dist/templates/react-app/config/Identifier/{page.login.ts → pages/page.login.ts} +37 -27
- package/dist/templates/react-app/config/Identifier/{page.register.ts → pages/page.register.ts} +37 -25
- package/dist/templates/react-app/config/Identifier/{page.request.ts → pages/page.request.ts} +34 -44
- package/dist/templates/react-app/config/app.router.ts +66 -69
- package/dist/templates/react-app/config/i18n/PageI18nInterface.ts +51 -0
- package/dist/templates/react-app/config/i18n/aboutI18n.ts +42 -0
- package/dist/templates/react-app/config/i18n/executorI18n.ts +51 -0
- package/dist/templates/react-app/config/i18n/homeI18n.ts +24 -0
- package/dist/templates/react-app/config/i18n/i18nConfig.ts +30 -0
- package/dist/templates/react-app/config/i18n/identifiter18n.ts +30 -0
- package/dist/templates/react-app/config/i18n/jsonStorage18n.ts +27 -0
- package/dist/templates/react-app/config/i18n/login18n.ts +42 -0
- package/dist/templates/react-app/config/i18n/notFoundI18n.ts +34 -0
- package/dist/templates/react-app/config/i18n/register18n.ts +40 -0
- package/dist/templates/react-app/config/i18n/request18n.ts +41 -0
- package/dist/templates/react-app/config/theme.ts +14 -4
- package/dist/templates/react-app/docs/en/bootstrap.md +1670 -341
- package/dist/templates/react-app/docs/en/development-guide.md +1021 -345
- package/dist/templates/react-app/docs/en/env.md +1132 -278
- package/dist/templates/react-app/docs/en/i18n.md +858 -147
- package/dist/templates/react-app/docs/en/index.md +733 -104
- package/dist/templates/react-app/docs/en/ioc.md +1228 -287
- package/dist/templates/react-app/docs/en/playwright/e2e-tests.md +321 -0
- package/dist/templates/react-app/docs/en/playwright/index.md +19 -0
- package/dist/templates/react-app/docs/en/playwright/installation-summary.md +332 -0
- package/dist/templates/react-app/docs/en/playwright/overview.md +222 -0
- package/dist/templates/react-app/docs/en/playwright/quickstart.md +325 -0
- package/dist/templates/react-app/docs/en/playwright/reorganization-notes.md +340 -0
- package/dist/templates/react-app/docs/en/playwright/setup-complete.md +290 -0
- package/dist/templates/react-app/docs/en/playwright/testing-guide.md +565 -0
- package/dist/templates/react-app/docs/en/store.md +1194 -184
- package/dist/templates/react-app/docs/en/why-no-globals.md +797 -0
- package/dist/templates/react-app/docs/zh/bootstrap.md +1670 -341
- package/dist/templates/react-app/docs/zh/development-guide.md +1021 -345
- package/dist/templates/react-app/docs/zh/env.md +1132 -275
- package/dist/templates/react-app/docs/zh/i18n.md +858 -147
- package/dist/templates/react-app/docs/zh/index.md +717 -104
- package/dist/templates/react-app/docs/zh/ioc.md +1229 -287
- package/dist/templates/react-app/docs/zh/playwright/e2e-tests.md +321 -0
- package/dist/templates/react-app/docs/zh/playwright/index.md +19 -0
- package/dist/templates/react-app/docs/zh/playwright/installation-summary.md +332 -0
- package/dist/templates/react-app/docs/zh/playwright/overview.md +222 -0
- package/dist/templates/react-app/docs/zh/playwright/quickstart.md +325 -0
- package/dist/templates/react-app/docs/zh/playwright/reorganization-notes.md +340 -0
- package/dist/templates/react-app/docs/zh/playwright/setup-complete.md +290 -0
- package/dist/templates/react-app/docs/zh/playwright/testing-guide.md +565 -0
- package/dist/templates/react-app/docs/zh/store.md +1192 -184
- package/dist/templates/react-app/docs/zh/why-no-globals.md +797 -0
- package/dist/templates/react-app/e2e/App.spec.ts +319 -0
- package/dist/templates/react-app/e2e/fixtures/base.fixture.ts +40 -0
- package/dist/templates/react-app/e2e/main.spec.ts +20 -0
- package/dist/templates/react-app/e2e/utils/test-helpers.ts +19 -0
- package/dist/templates/react-app/eslint.config.mjs +247 -0
- package/dist/templates/react-app/makes/eslint-utils.mjs +195 -0
- package/dist/templates/react-app/makes/generateTs2LocalesOptions.ts +26 -0
- package/dist/templates/react-app/package.json +31 -3
- package/dist/templates/react-app/playwright.config.ts +79 -0
- package/dist/templates/react-app/public/locales/en/common.json +190 -179
- package/dist/templates/react-app/public/locales/zh/common.json +190 -179
- package/dist/templates/react-app/src/App.tsx +15 -42
- package/dist/templates/react-app/src/base/apis/AiApi.ts +5 -5
- package/dist/templates/react-app/src/base/apis/feApi/FeApi.ts +1 -1
- package/dist/templates/react-app/src/base/apis/feApi/FeApiAdapter.ts +1 -1
- package/dist/templates/react-app/src/base/apis/feApi/FeApiBootstarp.ts +8 -8
- package/dist/templates/react-app/src/base/apis/feApi/FeApiType.ts +1 -1
- package/dist/templates/react-app/src/base/apis/userApi/UserApi.ts +6 -6
- package/dist/templates/react-app/src/base/apis/userApi/UserApiAdapter.ts +1 -1
- package/dist/templates/react-app/src/base/apis/userApi/UserApiBootstarp.ts +12 -14
- package/dist/templates/react-app/src/base/apis/userApi/UserApiType.ts +1 -1
- package/dist/templates/react-app/src/base/cases/DialogHandler.ts +5 -2
- package/dist/templates/react-app/src/base/cases/I18nKeyErrorPlugin.ts +3 -3
- package/dist/templates/react-app/src/base/cases/InversifyContainer.ts +3 -3
- package/dist/templates/react-app/src/base/cases/RequestLanguages.ts +2 -2
- package/dist/templates/react-app/src/base/cases/RequestLogger.ts +4 -4
- package/dist/templates/react-app/src/base/cases/RequestStatusCatcher.ts +1 -1
- package/dist/templates/react-app/src/base/cases/ResourceState.ts +23 -0
- package/dist/templates/react-app/src/base/cases/RouterLoader.ts +4 -4
- package/dist/templates/react-app/src/base/cases/TranslateI18nInterface.ts +26 -0
- package/dist/templates/react-app/src/base/port/ExecutorPageBridgeInterface.ts +2 -3
- package/dist/templates/react-app/src/base/port/I18nServiceInterface.ts +1 -1
- package/dist/templates/react-app/src/base/port/IOCInterface.ts +36 -0
- package/dist/templates/react-app/src/base/port/JSONStoragePageBridgeInterface.ts +2 -1
- package/dist/templates/react-app/src/base/port/ProcesserExecutorInterface.ts +1 -1
- package/dist/templates/react-app/src/base/port/RequestPageBridgeInterface.ts +2 -2
- package/dist/templates/react-app/src/base/port/RouteServiceInterface.ts +9 -5
- package/dist/templates/react-app/src/base/port/UserServiceInterface.ts +1 -1
- package/dist/templates/react-app/src/base/services/I18nService.ts +29 -29
- package/dist/templates/react-app/src/base/services/IdentifierService.ts +143 -0
- package/dist/templates/react-app/src/base/services/ProcesserExecutor.ts +3 -3
- package/dist/templates/react-app/src/base/services/RouteService.ts +27 -8
- package/dist/templates/react-app/src/base/services/UserService.ts +8 -8
- package/dist/templates/react-app/src/base/types/Page.ts +14 -2
- package/dist/templates/react-app/src/base/types/global.d.ts +1 -1
- package/dist/templates/react-app/src/core/IOC.ts +5 -46
- package/dist/templates/react-app/src/core/bootstraps/{BootstrapApp.ts → BootstrapClient.ts} +44 -17
- package/dist/templates/react-app/src/core/bootstraps/BootstrapsRegistry.ts +14 -7
- package/dist/templates/react-app/src/core/bootstraps/IocIdentifierTest.ts +1 -1
- package/dist/templates/react-app/src/core/bootstraps/PrintBootstrap.ts +1 -1
- package/dist/templates/react-app/src/core/clientIoc/ClientIOC.ts +40 -0
- package/dist/templates/react-app/src/core/{IocRegisterImpl.ts → clientIoc/ClientIOCRegister.ts} +35 -24
- package/dist/templates/react-app/src/core/globals.ts +9 -9
- package/dist/templates/react-app/src/main.tsx +4 -4
- package/dist/templates/react-app/src/pages/404.tsx +6 -3
- package/dist/templates/react-app/src/pages/500.tsx +5 -2
- package/dist/templates/react-app/src/pages/NoRouteFound.tsx +5 -0
- package/dist/templates/react-app/src/pages/auth/Layout.tsx +9 -6
- package/dist/templates/react-app/src/pages/auth/LoginPage.tsx +46 -56
- package/dist/templates/react-app/src/pages/auth/RegisterPage.tsx +46 -58
- package/dist/templates/react-app/src/pages/base/AboutPage.tsx +35 -40
- package/dist/templates/react-app/src/pages/base/ExecutorPage.tsx +51 -51
- package/dist/templates/react-app/src/pages/base/HomePage.tsx +14 -15
- package/dist/templates/react-app/src/pages/base/IdentifierPage.tsx +70 -11
- package/dist/templates/react-app/src/pages/base/JSONStoragePage.tsx +24 -25
- package/dist/templates/react-app/src/pages/base/Layout.tsx +2 -2
- package/dist/templates/react-app/src/pages/base/RedirectPathname.tsx +3 -2
- package/dist/templates/react-app/src/pages/base/RequestPage.tsx +41 -59
- package/dist/templates/react-app/src/styles/css/antd-themes/{_default.css → _common/_default.css} +85 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/{dark.css → _common/dark.css} +99 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/_common/index.css +3 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/{pink.css → _common/pink.css} +86 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/index.css +4 -3
- package/dist/templates/react-app/src/styles/css/antd-themes/menu/_default.css +108 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/menu/dark.css +67 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/menu/index.css +3 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/menu/pink.css +67 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/pagination/_default.css +34 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/pagination/dark.css +31 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/pagination/index.css +3 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/pagination/pink.css +36 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/table/_default.css +44 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/table/dark.css +43 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/table/index.css +3 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/table/pink.css +43 -0
- package/dist/templates/react-app/src/styles/css/page.css +4 -3
- package/dist/templates/react-app/src/styles/css/themes/_default.css +1 -0
- package/dist/templates/react-app/src/styles/css/themes/dark.css +1 -0
- package/dist/templates/react-app/src/styles/css/themes/pink.css +1 -0
- package/dist/templates/react-app/src/styles/css/zIndex.css +1 -1
- package/dist/templates/react-app/src/uikit/bridges/ExecutorPageBridge.ts +3 -3
- package/dist/templates/react-app/src/uikit/bridges/JSONStoragePageBridge.ts +2 -2
- package/dist/templates/react-app/src/uikit/bridges/NavigateBridge.ts +1 -1
- package/dist/templates/react-app/src/uikit/bridges/RequestPageBridge.ts +3 -3
- package/dist/templates/react-app/src/uikit/components/AppRouterProvider.tsx +35 -0
- package/dist/templates/react-app/src/uikit/components/BaseHeader.tsx +15 -11
- package/dist/templates/react-app/src/uikit/components/BaseRouteProvider.tsx +14 -11
- package/dist/templates/react-app/src/uikit/components/BaseRouteSeo.tsx +18 -0
- package/dist/templates/react-app/src/uikit/components/BootstrapsProvider.tsx +13 -0
- package/dist/templates/react-app/src/uikit/components/ClientSeo.tsx +62 -0
- package/dist/templates/react-app/src/uikit/components/ComboProvider.tsx +38 -0
- package/dist/templates/react-app/src/uikit/components/LanguageSwitcher.tsx +48 -27
- package/dist/templates/react-app/src/uikit/components/Loading.tsx +4 -2
- package/dist/templates/react-app/src/uikit/components/LocaleLink.tsx +4 -5
- package/dist/templates/react-app/src/uikit/components/LogoutButton.tsx +34 -11
- package/dist/templates/react-app/src/uikit/components/ProcessExecutorProvider.tsx +9 -5
- package/dist/templates/react-app/src/uikit/components/RouterRenderComponent.tsx +6 -3
- package/dist/templates/react-app/src/uikit/components/ThemeSwitcher.tsx +97 -40
- package/dist/templates/react-app/src/uikit/components/UserAuthProvider.tsx +5 -5
- package/dist/templates/react-app/src/uikit/components/With.tsx +17 -0
- package/dist/templates/react-app/src/uikit/contexts/BaseRouteContext.ts +17 -11
- package/dist/templates/react-app/src/uikit/contexts/IOCContext.ts +13 -0
- package/dist/templates/react-app/src/uikit/hooks/useAppTranslation.ts +26 -0
- package/dist/templates/react-app/src/uikit/hooks/useI18nGuard.ts +8 -11
- package/dist/templates/react-app/src/uikit/hooks/useI18nInterface.ts +25 -0
- package/dist/templates/react-app/src/uikit/hooks/useIOC.ts +35 -0
- package/dist/templates/react-app/src/uikit/hooks/useNavigateBridge.ts +3 -3
- package/dist/templates/react-app/src/uikit/hooks/useStrictEffect.ts +0 -1
- package/dist/templates/react-app/tsconfig.e2e.json +21 -0
- package/dist/templates/react-app/tsconfig.json +8 -1
- package/dist/templates/react-app/tsconfig.node.json +1 -1
- package/dist/templates/react-app/tsconfig.test.json +3 -1
- package/dist/templates/react-app/vite.config.ts +50 -34
- package/package.json +2 -1
- package/dist/configs/react-app/eslint.config.js +0 -94
- package/dist/templates/next-app/config/Identifier/common.error.ts +0 -41
- package/dist/templates/next-app/config/Identifier/common.ts +0 -69
- package/dist/templates/next-app/config/Identifier/page.about.ts +0 -181
- package/dist/templates/next-app/config/Identifier/page.admin.ts +0 -48
- package/dist/templates/next-app/config/Identifier/page.executor.ts +0 -272
- package/dist/templates/next-app/config/Identifier/page.identifiter.ts +0 -39
- package/dist/templates/next-app/config/Identifier/page.jsonStorage.ts +0 -72
- package/dist/templates/next-app/config/Identifier/page.request.ts +0 -182
- package/dist/templates/next-app/docs/env.md +0 -94
- package/dist/templates/next-app/src/base/cases/ChatAction.ts +0 -21
- package/dist/templates/next-app/src/base/cases/FocusBarAction.ts +0 -36
- package/dist/templates/next-app/src/base/cases/RequestState.ts +0 -20
- package/dist/templates/next-app/src/base/port/AdminPageInterface.ts +0 -85
- package/dist/templates/next-app/src/base/port/AsyncStateInterface.ts +0 -7
- package/dist/templates/next-app/src/base/services/AdminUserService.ts +0 -45
- package/dist/templates/next-app/src/uikit/components/ChatRoot.tsx +0 -17
- package/dist/templates/next-app/src/uikit/components/chat/ChatActionInterface.ts +0 -30
- package/dist/templates/next-app/src/uikit/components/chat/ChatFocusBar.tsx +0 -65
- package/dist/templates/next-app/src/uikit/components/chat/ChatMessages.tsx +0 -59
- package/dist/templates/next-app/src/uikit/components/chat/ChatWrap.tsx +0 -28
- package/dist/templates/next-app/src/uikit/components/chat/FocusBarActionInterface.ts +0 -19
- package/dist/templates/next-app/src/uikit/hook/useMountedClient.ts +0 -17
- package/dist/templates/next-app/src/uikit/hook/useStore.ts +0 -15
- package/dist/templates/react-app/__tests__/__mocks__/I18nService.ts +0 -13
- package/dist/templates/react-app/__tests__/src/App.test.tsx +0 -139
- package/dist/templates/react-app/config/Identifier/page.identifiter.ts +0 -39
- package/dist/templates/react-app/config/i18n.ts +0 -15
- package/dist/templates/react-app/docs/en/project-structure.md +0 -434
- package/dist/templates/react-app/docs/zh/project-structure.md +0 -434
- package/dist/templates/react-app/src/base/cases/RequestState.ts +0 -20
- package/dist/templates/react-app/src/base/port/AsyncStateInterface.ts +0 -7
- package/dist/templates/react-app/src/uikit/hooks/useDocumentTitle.ts +0 -15
- package/dist/templates/react-app/src/uikit/hooks/useStore.ts +0 -15
|
@@ -1,181 +1,192 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"login
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"
|
|
2
|
+
"common:no.user.token": "本地未找到 user token",
|
|
3
|
+
"common:global.no.window": "全局未找到 window",
|
|
4
|
+
"common:within.page.provider": "必须在 PageProvider 中使用",
|
|
5
|
+
"common:response.no.token": "响应内容没有 token 值",
|
|
6
|
+
"common:not.found.component": "未找到组件",
|
|
7
|
+
"common:theme.default": "默认主题",
|
|
8
|
+
"common:theme.dark": "暗色主题",
|
|
9
|
+
"common:theme.pink": "粉色主题",
|
|
10
|
+
"common:logout.dialog.title": "登出",
|
|
11
|
+
"common:logout.dialog.content": "确定要登出吗?",
|
|
12
|
+
"common:404.title": "404 页面未找到",
|
|
13
|
+
"common:404.description": "404 页面描述",
|
|
14
|
+
"common:500.title": "500 页面错误",
|
|
15
|
+
"common:500.description": "500 页面描述",
|
|
16
|
+
"page_about:title": "关于我们",
|
|
17
|
+
"page_about:description": "了解更多关于我们的项目和团队信息",
|
|
18
|
+
"page_about:keywords": "关于我们, 项目, 团队",
|
|
19
|
+
"page_about:message.test": "这是一条测试消息",
|
|
20
|
+
"page_about:notification.title": "通知标题",
|
|
21
|
+
"page_about:notification.description": "这是一条测试通知",
|
|
22
|
+
"page_about:button.message": "显示 Message",
|
|
23
|
+
"page_about:button.message2": "静态消息",
|
|
24
|
+
"page_about:button.notification": "显示 Notification",
|
|
25
|
+
"page_about:button.notification2": "静态通知",
|
|
26
|
+
"page_about:tooltip.text": "这是一个提示文本",
|
|
27
|
+
"page_about:button.tooltip": "悬停显示 Tooltip",
|
|
28
|
+
"page_about:modal.title": "模态框示例",
|
|
29
|
+
"page_about:modal.content": "这是一个模态框的内容",
|
|
30
|
+
"page_about:button.modal": "显示 Modal",
|
|
31
|
+
"page_about:drawer.title": "抽屉示例",
|
|
32
|
+
"page_about:drawer.content": "这是一个抽屉的内容",
|
|
33
|
+
"page_about:button.drawer": "显示 Drawer",
|
|
34
|
+
"page_about:popover.content": "这是一个气泡卡片",
|
|
35
|
+
"page_about:popover.title": "Popover 标题",
|
|
36
|
+
"page_about:button.popover": "显示 Popover",
|
|
37
|
+
"page_about:popconfirm.title": "确认提示",
|
|
38
|
+
"page_about:popconfirm.description": "您确定要执行此操作吗?",
|
|
39
|
+
"page_about:button.popconfirm": "显示 Popconfirm",
|
|
40
|
+
"page_about:alert.message": "这是一个警告提示",
|
|
41
|
+
"page_about:ok.text": "确定",
|
|
42
|
+
"page_about:cancel.text": "取消",
|
|
43
|
+
"page_executor:title": "执行器示例",
|
|
44
|
+
"page_executor:description": "一个强大的任务执行器,支持多种任务类型和状态管理",
|
|
45
|
+
"page_executor:keywords": "任务执行器, 任务类型, 任务状态",
|
|
46
|
+
"page_executor:main_title": "执行器",
|
|
47
|
+
"page_executor:test_plugin.title": "测试插件",
|
|
48
|
+
"page_executor:task.status.pending": "等待中",
|
|
49
|
+
"page_executor:task.status.running": "运行中",
|
|
50
|
+
"page_executor:task.status.completed": "已完成",
|
|
51
|
+
"page_executor:task.status.failed": "失败",
|
|
52
|
+
"page_executor:task.type.data_sync": "数据同步",
|
|
53
|
+
"page_executor:task.type.report": "报告生成",
|
|
54
|
+
"page_executor:task.type.maintenance": "系统维护",
|
|
55
|
+
"page_executor:task.type.backup": "数据备份",
|
|
56
|
+
"page_executor:task.duration.unit": "分钟",
|
|
57
|
+
"page_executor:task.start": "开始",
|
|
58
|
+
"page_executor:task.stop": "停止",
|
|
59
|
+
"page_executor:task.success": "任务 %{name} 执行成功",
|
|
60
|
+
"page_executor:task.failure": "任务 %{name} 执行失败",
|
|
61
|
+
"page_executor:plugin.test.success": "插件测试成功",
|
|
62
|
+
"page_executor:plugin.test.failure": "插件测试失败",
|
|
63
|
+
"page_executor:custom_task.url_required": "请输入URL",
|
|
64
|
+
"page_executor:custom_task.name": "自定义任务 %{method} %{url}",
|
|
65
|
+
"page_executor:create_task.title": "创建自定义任务",
|
|
66
|
+
"page_executor:create_button": "创建",
|
|
67
|
+
"page_executor:enter_url": "输入URL",
|
|
68
|
+
"page_executor:task_list.title": "任务列表",
|
|
69
|
+
"page_executor:task_stats.total": "总任务数",
|
|
70
|
+
"page_executor:task_stats.running": "运行中",
|
|
71
|
+
"page_executor:task_stats.completed": "已完成",
|
|
72
|
+
"page_executor:task_stats.failed": "失败",
|
|
73
|
+
"page_executor:task_history.title": "执行历史",
|
|
74
|
+
"page_executor:help.title": "需要帮助?",
|
|
75
|
+
"page_executor:help.description": "遇到问题?查看我们的任务执行指南或联系支持团队",
|
|
76
|
+
"page_executor:view_guide": "查看指南",
|
|
77
|
+
"page_executor:contact_support": "联系支持",
|
|
78
|
+
"page_executor:request.timeout": "请求超时时间",
|
|
79
|
+
"page_executor:error_identifier.title": "错误标识符",
|
|
80
|
+
"page_home:title": "首页",
|
|
81
|
+
"page_home:description": "一个现代前端实用库集合,提供各种实用工具和组件",
|
|
82
|
+
"page_home:keywords": "现代前端实用库, 实用工具, 组件",
|
|
83
|
+
"page_home:welcome": "欢迎来到主页",
|
|
84
|
+
"page_home:description2": "一个现代前端实用库集合,提供各种实用工具和组件",
|
|
85
|
+
"page_home:get_started": "准备开始使用?",
|
|
86
|
+
"page_home:get_started__description": "加入我们,探索实用工具的力量",
|
|
87
|
+
"page_home:get_started__button": "立即开始",
|
|
88
|
+
"page_home:explore": "探索",
|
|
89
|
+
"page_home:identifier.description": "错误标识符的使用和示例",
|
|
90
|
+
"page_identifier:title": "错误标识符",
|
|
91
|
+
"page_identifier:description": "标识符描述",
|
|
92
|
+
"page_identifier:keywords": "标识符, 错误标识符",
|
|
93
|
+
"page_identifier:source_description": "来自 '@config/Identifier/error' 的标识符",
|
|
94
|
+
"page_identifier:help.title": "需要帮助?",
|
|
95
|
+
"page_identifier:help.description": "如果您在使用错误标识符时遇到问题,请联系我们的支持团队",
|
|
96
|
+
"page_identifier:contact_support": "联系支持",
|
|
97
|
+
"page_identifier:table.title": "标识符表格标题",
|
|
98
|
+
"page_identifier:table.index": "标识符表格索引",
|
|
99
|
+
"page_identifier:table.description": "标识符表格描述",
|
|
100
|
+
"page_identifier:table.id": "标识符表格id",
|
|
101
|
+
"page_identifier:table.key": "标识符表格key",
|
|
102
|
+
"page_identifier:table.locale_value": "标识符表格locale value",
|
|
103
|
+
"page_identifier:table.label": "标识符表格label",
|
|
104
|
+
"page_jsonstorage:title": "JSONStorage 页面",
|
|
105
|
+
"page_jsonstorage:description": "使用 JSONStorage 进行数据存储和管理",
|
|
106
|
+
"page_jsonstorage:keywords": "JSONStorage, JSONStorage 页面",
|
|
107
|
+
"page_jsonstorage:main_title": "JSONStorage 演示",
|
|
108
|
+
"page_jsonstorage:permanent_title": "永久存储测试",
|
|
109
|
+
"page_jsonstorage:expire_title": "过期时间测试",
|
|
110
|
+
"page_jsonstorage:timeout_title": "请求超时时间设置",
|
|
111
|
+
"page_jsonstorage:format_title": "测试 key: ${key}, 随机值范围: ${min}~${max}",
|
|
112
|
+
"page_jsonstorage:set_random": "设置随机值",
|
|
113
|
+
"page_jsonstorage:current_value": "当前值",
|
|
114
|
+
"page_jsonstorage:set_expire": "设置随机值(带过期时间)",
|
|
115
|
+
"page_jsonstorage:ms": "毫秒",
|
|
116
|
+
"page_login:title": "登录",
|
|
117
|
+
"page_login:description": "登录页面描述",
|
|
118
|
+
"page_login:keywords": "Login, Login Page",
|
|
119
|
+
"page_login:email": "邮箱",
|
|
120
|
+
"page_login:username": "用户名",
|
|
121
|
+
"page_login:password": "密码",
|
|
122
|
+
"page_login:login": "登录",
|
|
123
|
+
"page_login:welcome": "欢迎来到未来学习",
|
|
124
|
+
"page_login:subtitle": "解锁个性化 AI 驱动的学习体验,加速您的知识旅程。",
|
|
125
|
+
"page_login:forgot_password": "忘记密码?",
|
|
126
|
+
"page_login:continue_with": "或继续使用",
|
|
127
|
+
"page_login:with_google": "使用 Google 登录",
|
|
128
|
+
"page_login:no_account": "还没有账号?",
|
|
129
|
+
"page_login:create_account": "在此创建",
|
|
130
|
+
"page_login:email_required": "请输入您的邮箱!",
|
|
131
|
+
"page_login:password_required": "请输入您的密码!",
|
|
132
|
+
"page_login:feature.ai_paths": "AI驱动的个性化学习路径",
|
|
133
|
+
"page_login:feature.smart_recommendations": "智能内容推荐",
|
|
134
|
+
"page_login:feature.progress_tracking": "实时进度追踪",
|
|
135
|
+
"page_login:email.title": "输入邮箱",
|
|
136
|
+
"page_login:password.title": "输入密码",
|
|
137
|
+
"page_login:forgot_password.title": "重置密码",
|
|
138
|
+
"page_login:button.title": "登录账号",
|
|
139
|
+
"page_login:with_google.title": "使用Google账号登录",
|
|
140
|
+
"page_login:create_account.title": "创建新账号",
|
|
141
|
+
"page_register:title": "创建账号",
|
|
142
|
+
"page_register:description": "创建账号页面描述",
|
|
143
|
+
"page_register:keywords": "Register, Register Page",
|
|
144
|
+
"page_register:subtitle": "开始您的学习之旅",
|
|
145
|
+
"page_register:username": "用户名",
|
|
146
|
+
"page_register:username_required": "请输入用户名!",
|
|
147
|
+
"page_register:email": "邮箱",
|
|
148
|
+
"page_register:email_required": "请输入邮箱!",
|
|
149
|
+
"page_register:password": "密码",
|
|
150
|
+
"page_register:password_required": "请输入密码!",
|
|
151
|
+
"page_register:confirm_password": "确认密码",
|
|
152
|
+
"page_register:confirm_password_required": "请确认密码!",
|
|
153
|
+
"page_register:password_mismatch": "两次输入的密码不匹配!",
|
|
154
|
+
"page_register:button": "注册",
|
|
155
|
+
"page_register:terms_prefix": "注册即表示您同意我们的",
|
|
156
|
+
"page_register:terms_link": "服务条款",
|
|
157
|
+
"page_register:terms_and": "和",
|
|
158
|
+
"page_register:privacy_link": "隐私政策",
|
|
159
|
+
"page_register:have_account": "已有账号?",
|
|
160
|
+
"page_register:login_link": "登录",
|
|
161
|
+
"page_register:feature.personalized": "个性化学习体验",
|
|
162
|
+
"page_register:feature.support": "专家支持和指导",
|
|
163
|
+
"page_register:feature.community": "活跃的学习社区",
|
|
164
|
+
"page_register:terms_required": "请同意服务条款和隐私政策",
|
|
165
|
+
"page_request:title": "请求示例",
|
|
166
|
+
"page_request:description": "展示各种请求示例和用法",
|
|
167
|
+
"page_request:keywords": "请求示例, 请求用法",
|
|
168
|
+
"page_request:requestTimeout": "请求超时",
|
|
169
|
+
"page_request:helloResult": "Hello 结果是",
|
|
170
|
+
"page_request:helloError": "Hello 错误是",
|
|
171
|
+
"page_request:ipInfoResult": "IpInfo 结果是",
|
|
172
|
+
"page_request:ipInfo": "IpInfo",
|
|
173
|
+
"page_request:randomUser": "随机用户",
|
|
174
|
+
"page_request:loading": "加载中...",
|
|
175
|
+
"page_request:randomUserResult": "随机用户 结果是",
|
|
176
|
+
"page_request:randomUserError": "随机用户 错误是",
|
|
177
|
+
"page_request:abortRequestResult": "中止请求 结果是",
|
|
178
|
+
"page_request:abortRequestError": "中止请求 错误是",
|
|
179
|
+
"page_request:hello.title": "AI API: Hello",
|
|
180
|
+
"page_request:hello.description": "函数式 api, 使用了 FetchURLPlugin, RequestCommonPlugin, ApiMockPlugin, RequestLogger 插件",
|
|
181
|
+
"page_request:hello.button": "Hello",
|
|
182
|
+
"page_request:ip_info.title": "FeApi: IP Information",
|
|
183
|
+
"page_request:ip_info.description": "RequestScheduler 类式 api, 使用了 FetchURLPlugin, RequestCommonPlugin, RequestLogger, ApiPickDataPlugin 插件, 其中 ApiPickDataPlugin 插件可以将返回类型统一扁平到 data 字段",
|
|
184
|
+
"page_request:random_user.title": "UserApi: Random User",
|
|
185
|
+
"page_request:random_user.description": "RequestTransaction 类式 api, 使用了 FetchURLPlugin, RequestCommonPlugin, ApiMockPlugin, FetchAbortPlugin, RequestLogger, ApiCatchPlugin 插件, 其中 FetchAbortPlugin 可以中止请求, ApiCatchPlugin 可以将捕获的错误统一到 apiCatchResult 字段",
|
|
186
|
+
"page_request:api_catch.title": "UserApi: Api Catch Result",
|
|
187
|
+
"page_request:abort.title": "UserApi: Abort Request",
|
|
188
|
+
"page_request:trigger_abort": "触发中止请求",
|
|
189
|
+
"page_request:stop_abort": "停止中止请求",
|
|
190
|
+
"page_request:trigger_api_catch": "触发 API 捕获结果",
|
|
191
|
+
"page_request:stop_api_catch": "停止 API 捕获结果"
|
|
181
192
|
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import '@/styles/css/index.css';
|
|
2
|
-
import {
|
|
3
|
-
import { lazy
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { routerPrefix } from '@config/common';
|
|
9
|
-
import { useStore } from './uikit/hooks/useStore';
|
|
10
|
-
import { IOCIdentifier } from '@config/IOCIdentifier';
|
|
11
|
-
import { logger } from './core/globals';
|
|
2
|
+
import { themeConfig } from '@config/theme';
|
|
3
|
+
import { lazy } from 'react';
|
|
4
|
+
import { AppRouterProvider } from './uikit/components/AppRouterProvider';
|
|
5
|
+
import { BootstrapsProvider } from './uikit/components/BootstrapsProvider';
|
|
6
|
+
import { ComboProvider } from './uikit/components/ComboProvider';
|
|
7
|
+
import type { ComponentValue } from './base/cases/RouterLoader';
|
|
12
8
|
|
|
13
|
-
function getAllPages() {
|
|
9
|
+
const allPages = (function getAllPages() {
|
|
10
|
+
// !!! important, map to all pages in pages directory
|
|
14
11
|
const modules = import.meta.glob('./pages/**/*.tsx');
|
|
15
12
|
return Object.keys(modules).reduce((acc, path) => {
|
|
13
|
+
// !!! important, convert path to component name
|
|
16
14
|
const componentName = path.replace(/^\.\/pages\/(.*)\.tsx$/, '$1');
|
|
17
15
|
acc[componentName] = () =>
|
|
18
16
|
lazy(
|
|
@@ -22,40 +20,15 @@ function getAllPages() {
|
|
|
22
20
|
);
|
|
23
21
|
return acc;
|
|
24
22
|
}, {} as ComponentValue);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const routerLoader = new RouterLoader({
|
|
28
|
-
componentMaps: getAllPages(),
|
|
29
|
-
render: RouterRenderComponent,
|
|
30
|
-
logger: logger
|
|
31
|
-
});
|
|
23
|
+
})();
|
|
32
24
|
|
|
33
25
|
function App() {
|
|
34
|
-
const routes = useStore(
|
|
35
|
-
IOC(IOCIdentifier.RouteServiceInterface),
|
|
36
|
-
(state) => state.routes
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
const routerBase = useMemo(() => {
|
|
40
|
-
const routeList = routes.map((route) => routerLoader.toRoute(route));
|
|
41
|
-
const router = createBrowserRouter(routeList, {
|
|
42
|
-
basename: routerPrefix
|
|
43
|
-
});
|
|
44
|
-
return router;
|
|
45
|
-
}, [routes]);
|
|
46
|
-
|
|
47
26
|
return (
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
prefix: 'fe'
|
|
54
|
-
}
|
|
55
|
-
}}
|
|
56
|
-
>
|
|
57
|
-
<RouterProvider router={routerBase} />
|
|
58
|
-
</AntdThemeProvider>
|
|
27
|
+
<BootstrapsProvider data-testid="App">
|
|
28
|
+
<ComboProvider themeConfig={themeConfig}>
|
|
29
|
+
<AppRouterProvider pages={allPages} />
|
|
30
|
+
</ComboProvider>
|
|
31
|
+
</BootstrapsProvider>
|
|
59
32
|
);
|
|
60
33
|
}
|
|
61
34
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { IOCIdentifier } from '@config/IOCIdentifier';
|
|
2
|
+
import {
|
|
3
|
+
type BootstrapExecutorPlugin,
|
|
4
|
+
RequestCommonPlugin
|
|
5
|
+
} from '@qlover/corekit-bridge';
|
|
1
6
|
import {
|
|
2
7
|
FetchURLPlugin,
|
|
3
8
|
RequestAdapterFetch,
|
|
4
9
|
RequestScheduler
|
|
5
10
|
} from '@qlover/fe-corekit';
|
|
6
|
-
import {
|
|
7
|
-
type BootstrapExecutorPlugin,
|
|
8
|
-
RequestCommonPlugin
|
|
9
|
-
} from '@qlover/corekit-bridge';
|
|
10
11
|
import { RequestLogger } from '../cases/RequestLogger';
|
|
11
|
-
import { IOCIdentifier } from '@config/IOCIdentifier';
|
|
12
12
|
import type { AppConfig } from '../cases/AppConfig';
|
|
13
13
|
|
|
14
14
|
const apiApiAdapter = new RequestAdapterFetch({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RequestAdapterFetch, RequestScheduler } from '@qlover/fe-corekit';
|
|
2
|
-
import { FeApiGetIpInfo } from './FeApiType';
|
|
3
2
|
import { inject, injectable } from 'inversify';
|
|
4
3
|
import { FeApiAdapter } from './FeApiAdapter';
|
|
5
4
|
import { FeApiConfig } from './FeApiBootstarp';
|
|
5
|
+
import { FeApiGetIpInfo } from './FeApiType';
|
|
6
6
|
|
|
7
7
|
@injectable()
|
|
8
8
|
export class FeApi extends RequestScheduler<FeApiConfig> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AppConfig } from '@/base/cases/AppConfig';
|
|
2
1
|
import { IOCIdentifier } from '@config/IOCIdentifier';
|
|
3
2
|
import { RequestAdapterFetch } from '@qlover/fe-corekit';
|
|
4
3
|
import { inject, injectable } from 'inversify';
|
|
4
|
+
import type { AppConfig } from '@/base/cases/AppConfig';
|
|
5
5
|
|
|
6
6
|
@injectable()
|
|
7
7
|
export class FeApiAdapter extends RequestAdapterFetch {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
RequestAdapterConfig,
|
|
3
|
-
RequestAdapterResponse,
|
|
4
|
-
RequestTransactionInterface
|
|
5
|
-
} from '@qlover/fe-corekit';
|
|
6
|
-
import { FetchURLPlugin } from '@qlover/fe-corekit';
|
|
1
|
+
import { IOCIdentifier } from '@config/IOCIdentifier';
|
|
7
2
|
import {
|
|
8
3
|
type BootstrapContext,
|
|
9
4
|
type BootstrapExecutorPlugin,
|
|
10
5
|
type ApiMockPluginConfig,
|
|
11
6
|
ApiPickDataPlugin
|
|
12
7
|
} from '@qlover/corekit-bridge';
|
|
13
|
-
import {
|
|
14
|
-
import { IOCIdentifier } from '@config/IOCIdentifier';
|
|
8
|
+
import { FetchURLPlugin } from '@qlover/fe-corekit';
|
|
15
9
|
import { RequestLogger } from '@/base/cases/RequestLogger';
|
|
10
|
+
import { FeApi } from './FeApi';
|
|
11
|
+
import type {
|
|
12
|
+
RequestAdapterConfig,
|
|
13
|
+
RequestAdapterResponse,
|
|
14
|
+
RequestTransactionInterface
|
|
15
|
+
} from '@qlover/fe-corekit';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* FeApiConfig
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { RES_NO_TOKEN } from '@config/Identifier';
|
|
1
2
|
import {
|
|
2
3
|
FetchAbortPlugin,
|
|
3
4
|
RequestAdapterFetch,
|
|
4
5
|
RequestTransaction
|
|
5
6
|
} from '@qlover/fe-corekit';
|
|
7
|
+
import { inject, injectable } from 'inversify';
|
|
8
|
+
import { AppError } from '@/base/cases/AppError';
|
|
9
|
+
import { RegisterFormData } from '@/base/services/UserService';
|
|
10
|
+
import { UserApiAdapter } from './UserApiAdapter';
|
|
11
|
+
import { UserApiConfig } from './UserApiBootstarp';
|
|
6
12
|
import {
|
|
7
13
|
GetIpInfoTransaction,
|
|
8
14
|
UserApiGetUserInfoTransaction,
|
|
@@ -10,17 +16,11 @@ import {
|
|
|
10
16
|
UserApiTestApiCatchResultTransaction,
|
|
11
17
|
UserInfo
|
|
12
18
|
} from './UserApiType';
|
|
13
|
-
import { inject, injectable } from 'inversify';
|
|
14
|
-
import { UserApiAdapter } from './UserApiAdapter';
|
|
15
|
-
import { UserApiConfig } from './UserApiBootstarp';
|
|
16
19
|
import type {
|
|
17
20
|
LoginResponseData,
|
|
18
21
|
UserAuthApiInterface,
|
|
19
22
|
UserAuthStoreInterface
|
|
20
23
|
} from '@qlover/corekit-bridge';
|
|
21
|
-
import { RegisterFormData } from '@/base/services/UserService';
|
|
22
|
-
import { RES_NO_TOKEN } from '@config/Identifier';
|
|
23
|
-
import { AppError } from '@/base/cases/AppError';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* UserApi
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AppConfig } from '@/base/cases/AppConfig';
|
|
2
1
|
import { IOCIdentifier } from '@config/IOCIdentifier';
|
|
3
2
|
import { RequestAdapterFetch } from '@qlover/fe-corekit';
|
|
4
3
|
import { inject, injectable } from 'inversify';
|
|
4
|
+
import type { AppConfig } from '@/base/cases/AppConfig';
|
|
5
5
|
|
|
6
6
|
@injectable()
|
|
7
7
|
export class UserApiAdapter extends RequestAdapterFetch {
|