@qlover/create-app 0.4.4 → 0.4.6
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 +95 -34
- package/dist/index.cjs +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -2418
- package/{templates → dist/templates}/node-lib/package.json +2 -2
- package/{templates → dist/templates}/react-app/README.md +6 -6
- package/{templates → dist/templates}/react-app/config/Identifier/Error.ts +8 -8
- package/dist/templates/react-app/config/Identifier/common.ts +62 -0
- package/dist/templates/react-app/config/Identifier/index.ts +10 -0
- package/dist/templates/react-app/config/Identifier/page.about.ts +181 -0
- package/dist/templates/react-app/config/Identifier/page.executor.ts +267 -0
- package/dist/templates/react-app/config/Identifier/page.home.ts +63 -0
- package/dist/templates/react-app/config/Identifier/page.identifiter.ts +39 -0
- package/dist/templates/react-app/config/Identifier/page.jsonStorage.ts +70 -0
- package/dist/templates/react-app/config/Identifier/page.login.ts +152 -0
- package/dist/templates/react-app/config/Identifier/page.register.ts +147 -0
- package/dist/templates/react-app/config/Identifier/page.request.ts +179 -0
- package/dist/templates/react-app/config/app.router.ts +163 -0
- package/dist/templates/react-app/config/theme.ts +11 -0
- package/{templates → dist/templates}/react-app/package.json +2 -2
- package/{templates → dist/templates}/react-app/public/locales/en/common.json +97 -114
- package/{templates → dist/templates}/react-app/public/locales/zh/common.json +98 -115
- package/{templates → dist/templates}/react-app/src/App.tsx +6 -5
- package/{templates → dist/templates}/react-app/src/base/cases/AppConfig.ts +3 -1
- package/dist/templates/react-app/src/base/cases/I18nKeyErrorPlugin.ts +36 -0
- package/{templates → dist/templates}/react-app/src/base/cases/RouterLoader.ts +2 -1
- package/{templates → dist/templates}/react-app/src/base/services/I18nService.ts +4 -4
- package/{templates/react-app/src/base/services/ProcesserService.ts → dist/templates/react-app/src/base/services/ProcesserExecutor.ts} +15 -5
- package/{templates → dist/templates}/react-app/src/base/services/RouteService.ts +11 -13
- package/{templates → dist/templates}/react-app/src/base/services/UserService.ts +37 -21
- package/{templates → dist/templates}/react-app/src/base/types/Page.ts +12 -2
- package/{templates → dist/templates}/react-app/src/core/bootstrap.ts +1 -1
- package/{templates → dist/templates}/react-app/src/core/bootstraps/index.ts +3 -1
- package/{templates → dist/templates}/react-app/src/core/globals.ts +2 -1
- package/{templates → dist/templates}/react-app/src/core/registers/RegisterCommon.ts +7 -7
- package/{templates → dist/templates}/react-app/src/core/registers/RegisterControllers.ts +7 -2
- package/{templates → dist/templates}/react-app/src/pages/404.tsx +4 -1
- package/{templates → dist/templates}/react-app/src/pages/500.tsx +2 -1
- package/{templates → dist/templates}/react-app/src/pages/auth/Layout.tsx +2 -2
- package/{templates/react-app/src/pages/auth/Login.tsx → dist/templates/react-app/src/pages/auth/LoginPage.tsx} +2 -2
- package/{templates/react-app/src/pages/auth/Register.tsx → dist/templates/react-app/src/pages/auth/RegisterPage.tsx} +3 -4
- package/{templates/react-app/src/pages/base/About.tsx → dist/templates/react-app/src/pages/base/AboutPage.tsx} +4 -4
- package/{templates/react-app/src/pages/base/ErrorIdentifier.tsx → dist/templates/react-app/src/pages/base/ErrorIdentifierPage.tsx} +3 -3
- package/{templates/react-app/src/pages/base/Executor.tsx → dist/templates/react-app/src/pages/base/ExecutorPage.tsx} +3 -3
- package/{templates/react-app/src/pages/base/Home.tsx → dist/templates/react-app/src/pages/base/HomePage.tsx} +15 -45
- package/{templates/react-app/src/pages/base/JSONStorage.tsx → dist/templates/react-app/src/pages/base/JSONStoragePage.tsx} +2 -2
- package/{templates → dist/templates}/react-app/src/pages/base/Layout.tsx +5 -5
- package/{templates/react-app/src/pages/base/Request.tsx → dist/templates/react-app/src/pages/base/RequestPage.tsx} +2 -2
- package/{templates/react-app/src/pages/base → dist/templates/react-app/src/uikit}/components/BaseHeader.tsx +8 -1
- package/dist/templates/react-app/src/uikit/components/LogoutButton.tsx +32 -0
- package/{templates → dist/templates}/react-app/src/uikit/components/ThemeSwitcher.tsx +5 -6
- package/{templates → dist/templates}/react-app/src/uikit/contexts/BaseRouteContext.ts +1 -1
- package/{templates → dist/templates}/react-app/src/uikit/controllers/ExecutorController.ts +2 -2
- package/{templates → dist/templates}/react-app/src/uikit/controllers/JSONStorageController.ts +2 -2
- package/{templates → dist/templates}/react-app/src/uikit/controllers/RequestController.ts +1 -1
- package/{templates/react-app/src/uikit/hooks/useLanguageGuard.ts → dist/templates/react-app/src/uikit/hooks/useI18nGuard.ts} +1 -1
- package/{templates → dist/templates}/react-app/src/uikit/hooks/useStore.ts +2 -2
- package/dist/templates/react-app/src/uikit/hooks/userRouterService.ts +12 -0
- package/{templates → dist/templates}/react-app/src/uikit/providers/BaseRouteProvider.tsx +1 -0
- package/dist/templates/react-app/src/uikit/providers/ProcessExecutorProvider.tsx +24 -0
- package/dist/templates/react-app/src/uikit/providers/UserAuthProvider.tsx +16 -0
- package/{templates → dist/templates}/react-app/vite.config.ts +2 -2
- package/package.json +4 -6
- package/templates/react-app/config/Identifier/I18n.ts +0 -1366
- package/templates/react-app/config/app.router.json +0 -159
- package/templates/react-app/config/theme.json +0 -9
- package/templates/react-app/src/base/port/LoginInterface.ts +0 -12
- package/templates/react-app/src/base/port/StoreInterface.ts +0 -58
- package/templates/react-app/src/uikit/providers/ProcessProvider.tsx +0 -45
- /package/{configs → dist/configs}/_common/.editorconfig +0 -0
- /package/{configs → dist/configs}/_common/.env.template +0 -0
- /package/{configs → dist/configs}/_common/.gitattributes +0 -0
- /package/{configs → dist/configs}/_common/.github/workflows/general-check.yml +0 -0
- /package/{configs → dist/configs}/_common/.github/workflows/release.yml +0 -0
- /package/{configs → dist/configs}/_common/.gitignore.template +0 -0
- /package/{configs → dist/configs}/_common/.husky/commit-msg +0 -0
- /package/{configs → dist/configs}/_common/.husky/pre-commit +0 -0
- /package/{configs → dist/configs}/_common/.prettierignore +0 -0
- /package/{configs → dist/configs}/_common/.prettierrc.js +0 -0
- /package/{configs → dist/configs}/_common/.vscode/extensions.json +0 -0
- /package/{configs → dist/configs}/_common/.vscode/react.code-snippets +0 -0
- /package/{configs → dist/configs}/_common/.vscode/settings.json +0 -0
- /package/{configs → dist/configs}/_common/commitlint.config.js +0 -0
- /package/{configs → dist/configs}/_common/package.json.template +0 -0
- /package/{configs → dist/configs}/node-lib/eslint.config.js +0 -0
- /package/{configs → dist/configs}/react-app/eslint.config.js +0 -0
- /package/{templates → dist/templates}/node-lib/__tests__/readJson.test.ts +0 -0
- /package/{templates → dist/templates}/node-lib/bin/test.js +0 -0
- /package/{templates → dist/templates}/node-lib/rollup.config.js +0 -0
- /package/{templates → dist/templates}/node-lib/src/index.ts +0 -0
- /package/{templates → dist/templates}/node-lib/src/readJson.ts +0 -0
- /package/{templates → dist/templates}/node-lib/tsconfig.json +0 -0
- /package/{templates → dist/templates}/pack-app/README.md +0 -0
- /package/{templates → dist/templates}/pack-app/eslint.config.js +0 -0
- /package/{templates → dist/templates}/pack-app/fe-config.json +0 -0
- /package/{templates → dist/templates}/pack-app/package.json +0 -0
- /package/{templates → dist/templates}/pack-app/pnpm-workspace.yaml +0 -0
- /package/{templates → dist/templates}/pack-app/tsconfig.json +0 -0
- /package/{templates → dist/templates}/pack-app/tsconfig.test.json +0 -0
- /package/{templates → dist/templates}/pack-app/vite.config.ts +0 -0
- /package/{templates → dist/templates}/react-app/.env.template +0 -0
- /package/{templates → dist/templates}/react-app/config/common.ts +0 -0
- /package/{templates → dist/templates}/react-app/config/feapi.mock.json +0 -0
- /package/{templates → dist/templates}/react-app/config/i18n.ts +0 -0
- /package/{templates → dist/templates}/react-app/index.html +0 -0
- /package/{templates → dist/templates}/react-app/postcss.config.js +0 -0
- /package/{templates → dist/templates}/react-app/public/logo.svg +0 -0
- /package/{templates → dist/templates}/react-app/public/router-root/logo.svg +0 -0
- /package/{templates → dist/templates}/react-app/src/assets/react.svg +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/AiApi.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/feApi/FeApi.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/feApi/FeApiAdapter.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/feApi/FeApiBootstarp.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/feApi/FeApiType.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/userApi/UserApi.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/userApi/UserApiAdapter.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/userApi/UserApiBootstarp.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/apis/userApi/UserApiType.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/cases/AppError.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/cases/DialogHandler.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/cases/PublicAssetsPath.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/cases/RequestLogger.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/cases/RequestStatusCatcher.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/port/ApiTransactionInterface.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/port/InteractionHubInterface.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/port/RequestCatcherInterface.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/port/UIDependenciesInterface.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/types/deprecated-antd.d.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/base/types/global.d.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/core/IOC.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/core/bootstraps/BootstrapApp.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/core/bootstraps/PrintBootstrap.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/core/registers/RegisterApi.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/core/registers/RegisterGlobals.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/core/registers/index.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/main.tsx +0 -0
- /package/{templates → dist/templates}/react-app/src/pages/base/RedirectPathname.tsx +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/antd-themes/_default.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/antd-themes/dark.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/antd-themes/index.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/antd-themes/no-context.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/antd-themes/pink.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/index.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/page.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/tailwind.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/themes/_default.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/themes/dark.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/themes/index.css +0 -0
- /package/{templates → dist/templates}/react-app/src/styles/css/themes/pink.css +0 -0
- /package/{templates → dist/templates}/react-app/src/uikit/components/LanguageSwitcher.tsx +0 -0
- /package/{templates → dist/templates}/react-app/src/uikit/components/Loading.tsx +0 -0
- /package/{templates → dist/templates}/react-app/src/uikit/components/LocaleLink.tsx +0 -0
- /package/{templates → dist/templates}/react-app/src/uikit/components/RouterRenderComponent.tsx +0 -0
- /package/{templates → dist/templates}/react-app/src/uikit/hooks/useDocumentTitle.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/uikit/hooks/useStrictEffect.ts +0 -0
- /package/{templates → dist/templates}/react-app/src/vite-env.d.ts +0 -0
- /package/{templates → dist/templates}/react-app/tailwind.config.js +0 -0
- /package/{templates → dist/templates}/react-app/tsconfig.app.json +0 -0
- /package/{templates → dist/templates}/react-app/tsconfig.json +0 -0
- /package/{templates → dist/templates}/react-app/tsconfig.node.json +0 -0
|
@@ -3,8 +3,13 @@ import LocaleLink from '@/uikit/components/LocaleLink';
|
|
|
3
3
|
import LanguageSwitcher from '@/uikit/components/LanguageSwitcher';
|
|
4
4
|
import { PublicAssetsPath } from '@/base/cases/PublicAssetsPath';
|
|
5
5
|
import { IOC } from '@/core/IOC';
|
|
6
|
+
import LogoutButton from './LogoutButton';
|
|
6
7
|
|
|
7
|
-
export default function BaseHeader(
|
|
8
|
+
export default function BaseHeader({
|
|
9
|
+
showLogoutButton
|
|
10
|
+
}: {
|
|
11
|
+
showLogoutButton?: boolean;
|
|
12
|
+
}) {
|
|
8
13
|
return (
|
|
9
14
|
<header className="h-14 bg-secondary border-b border-border sticky top-0 z-50">
|
|
10
15
|
<div className="flex items-center justify-between h-full px-4 mx-auto max-w-7xl">
|
|
@@ -26,6 +31,8 @@ export default function BaseHeader() {
|
|
|
26
31
|
<div className="flex items-center gap-4">
|
|
27
32
|
<LanguageSwitcher />
|
|
28
33
|
<ThemeSwitcher />
|
|
34
|
+
|
|
35
|
+
{showLogoutButton && <LogoutButton />}
|
|
29
36
|
</div>
|
|
30
37
|
</div>
|
|
31
38
|
</header>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { UserService } from '@/base/services/UserService';
|
|
2
|
+
import { IOC } from '@/core/IOC';
|
|
3
|
+
import {
|
|
4
|
+
AUTH_LOGOUT_DIALOG_CONTENT,
|
|
5
|
+
AUTH_LOGOUT_DIALOG_TITLE
|
|
6
|
+
} from '@config/Identifier/common';
|
|
7
|
+
import { Button } from 'antd';
|
|
8
|
+
import { useCallback } from 'react';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
|
|
11
|
+
export default function LogoutButton() {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
|
|
14
|
+
const tTitle = t(AUTH_LOGOUT_DIALOG_TITLE);
|
|
15
|
+
const tContent = t(AUTH_LOGOUT_DIALOG_CONTENT);
|
|
16
|
+
|
|
17
|
+
const onClick = useCallback(() => {
|
|
18
|
+
IOC('DialogHandler').confirm({
|
|
19
|
+
title: tTitle,
|
|
20
|
+
content: tContent,
|
|
21
|
+
onOk: () => {
|
|
22
|
+
IOC(UserService).logout();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}, [tTitle, tContent]);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Button danger onClick={onClick}>
|
|
29
|
+
{tTitle}
|
|
30
|
+
</Button>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IOC } from '@/core/IOC';
|
|
2
|
-
import { ThemeService
|
|
2
|
+
import { ThemeService } from '@qlover/corekit-bridge';
|
|
3
3
|
import { useStore } from '@/uikit/hooks/useStore';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Select } from 'antd';
|
|
@@ -11,8 +11,7 @@ import {
|
|
|
11
11
|
} from '@ant-design/icons';
|
|
12
12
|
import clsx from 'clsx';
|
|
13
13
|
import { useMemo } from 'react';
|
|
14
|
-
import * as i18nKeys from '@config/Identifier/
|
|
15
|
-
import { StoreInterface } from '@/base/port/StoreInterface';
|
|
14
|
+
import * as i18nKeys from '@config/Identifier/common';
|
|
16
15
|
|
|
17
16
|
const colorMap: Record<
|
|
18
17
|
string,
|
|
@@ -37,9 +36,9 @@ const colorMap: Record<
|
|
|
37
36
|
|
|
38
37
|
export default function ThemeSwitcher() {
|
|
39
38
|
const themeService = IOC(ThemeService);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
39
|
+
// FIXME:
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
const { theme } = useStore(themeService as any);
|
|
43
42
|
const themes = themeService.getSupportedThemes();
|
|
44
43
|
const { t } = useTranslation('common');
|
|
45
44
|
|
|
@@ -5,7 +5,7 @@ import { RouteMeta } from '@/base/types/Page';
|
|
|
5
5
|
import { createContext } from 'react';
|
|
6
6
|
import merge from 'lodash/merge';
|
|
7
7
|
import i18nConfig from '@config/i18n';
|
|
8
|
-
import { WITHIN_PAGE_PROVIDER } from '@config/Identifier/
|
|
8
|
+
import { WITHIN_PAGE_PROVIDER } from '@config/Identifier/error';
|
|
9
9
|
|
|
10
10
|
const { defaultNS } = i18nConfig;
|
|
11
11
|
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
import { inject, injectable } from 'inversify';
|
|
9
9
|
import {
|
|
10
10
|
StoreInterface,
|
|
11
|
-
StoreStateInterface
|
|
12
|
-
} from '
|
|
11
|
+
type StoreStateInterface
|
|
12
|
+
} from '@qlover/corekit-bridge';
|
|
13
13
|
|
|
14
14
|
class ExecutorControllerState implements StoreStateInterface {
|
|
15
15
|
helloState = {
|
package/{templates → dist/templates}/react-app/src/uikit/controllers/JSONStorageController.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSONStorage } from '@qlover/fe-corekit';
|
|
2
2
|
import {
|
|
3
3
|
StoreInterface,
|
|
4
|
-
StoreStateInterface
|
|
5
|
-
} from '
|
|
4
|
+
type StoreStateInterface
|
|
5
|
+
} from '@qlover/corekit-bridge';
|
|
6
6
|
import { random } from 'lodash';
|
|
7
7
|
|
|
8
8
|
interface JSONStoragePageState extends StoreStateInterface {
|
|
@@ -3,7 +3,7 @@ import { FeApi } from '@/base/apis/feApi/FeApi';
|
|
|
3
3
|
import { logger } from '@/core/globals';
|
|
4
4
|
import { UserApi } from '@/base/apis/userApi/UserApi';
|
|
5
5
|
import { aiHello } from '@/base/apis/AiApi';
|
|
6
|
-
import { StoreInterface } from '
|
|
6
|
+
import { StoreInterface } from '@qlover/corekit-bridge';
|
|
7
7
|
|
|
8
8
|
function createDefaultState() {
|
|
9
9
|
return {
|
|
@@ -10,7 +10,7 @@ import { useParams } from 'react-router-dom';
|
|
|
10
10
|
*
|
|
11
11
|
* TODO: if language not found, use default language
|
|
12
12
|
*/
|
|
13
|
-
export function
|
|
13
|
+
export function useI18nGuard() {
|
|
14
14
|
const { lng } = useParams<{ lng: I18nServiceLocale }>();
|
|
15
15
|
const navigate = useNavigate();
|
|
16
16
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RouteService } from '@/base/services/RouteService';
|
|
2
|
+
import { IOC } from '@/core/IOC';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { useNavigate } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
export function useRouterService() {
|
|
7
|
+
const navigate = useNavigate();
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
IOC(RouteService).setDependencies({ navigate });
|
|
11
|
+
}, [navigate]);
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UserAuthProvider } from './UserAuthProvider';
|
|
2
|
+
import { useStrictEffect } from '../hooks/useStrictEffect';
|
|
3
|
+
import { IOC } from '@/core/IOC';
|
|
4
|
+
import { ProcesserExecutor } from '@/base/services/ProcesserExecutor';
|
|
5
|
+
import { useI18nGuard } from '../hooks/useI18nGuard';
|
|
6
|
+
import { useRouterService } from '../hooks/userRouterService';
|
|
7
|
+
|
|
8
|
+
export function ProcessExecutorProvider({
|
|
9
|
+
children
|
|
10
|
+
}: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}) {
|
|
13
|
+
const processerExecutor = IOC(ProcesserExecutor);
|
|
14
|
+
|
|
15
|
+
useI18nGuard();
|
|
16
|
+
|
|
17
|
+
useRouterService();
|
|
18
|
+
|
|
19
|
+
useStrictEffect(() => {
|
|
20
|
+
processerExecutor.starup();
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
return <UserAuthProvider>{children}</UserAuthProvider>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IOC } from '@/core/IOC';
|
|
2
|
+
import { Loading } from '../components/Loading';
|
|
3
|
+
import { UserService } from '@/base/services/UserService';
|
|
4
|
+
import { useStore } from '../hooks/useStore';
|
|
5
|
+
|
|
6
|
+
export function UserAuthProvider({ children }: { children: React.ReactNode }) {
|
|
7
|
+
const userService = IOC(UserService);
|
|
8
|
+
|
|
9
|
+
useStore(userService);
|
|
10
|
+
|
|
11
|
+
if (!userService.isAuthenticated()) {
|
|
12
|
+
return <Loading fullscreen />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return children;
|
|
16
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import { defineConfig } from 'vitest/config';
|
|
2
3
|
import react from '@vitejs/plugin-react';
|
|
3
4
|
import {
|
|
@@ -111,14 +112,13 @@ export default defineConfig({
|
|
|
111
112
|
overriedCssFilePath: './src/styles/css/antd-themes/no-context.css',
|
|
112
113
|
targetPath: './src/base/types/deprecated-antd.d.ts'
|
|
113
114
|
})
|
|
114
|
-
],
|
|
115
|
+
] as any[],
|
|
115
116
|
base: routerPrefix,
|
|
116
117
|
envPrefix: envPrefix,
|
|
117
118
|
publicDir: 'public',
|
|
118
119
|
server: {
|
|
119
120
|
port: Number(process.env.VITE_SERVER_PORT || 3200)
|
|
120
121
|
},
|
|
121
|
-
mode: process.env.NODE_ENV,
|
|
122
122
|
test: {
|
|
123
123
|
environment: 'jsdom',
|
|
124
124
|
globals: true,
|
package/package.json
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qlover/create-app",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Create a new app with a single command",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"configs",
|
|
10
|
-
"templates",
|
|
11
9
|
"package.json",
|
|
12
10
|
"README.md",
|
|
13
11
|
"CHANGELOG.md"
|
|
@@ -32,14 +30,14 @@
|
|
|
32
30
|
"access": "public"
|
|
33
31
|
},
|
|
34
32
|
"devDependencies": {
|
|
35
|
-
"lodash": "^4.17.21",
|
|
36
33
|
"ignore": "^7.0.3",
|
|
34
|
+
"lodash": "^4.17.21",
|
|
35
|
+
"ora": "^8.1.1",
|
|
37
36
|
"@qlover/logger": "0.1.1"
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"ora": "^8.1.1",
|
|
41
|
-
"inquirer": "^12.3.2",
|
|
42
39
|
"commander": "^13.1.0",
|
|
40
|
+
"inquirer": "^12.3.2",
|
|
43
41
|
"@qlover/scripts-context": "0.2.1"
|
|
44
42
|
},
|
|
45
43
|
"scripts": {
|