@qlover/create-app 0.4.1 → 0.4.3
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 +54 -0
- package/configs/_common/.gitignore.template +49 -23
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/react-app/{.env → .env.template} +2 -3
- package/templates/react-app/README.md +89 -8
- package/templates/react-app/config/app.router.json +13 -13
- package/templates/react-app/config/common.ts +8 -0
- package/templates/react-app/config/feapi.mock.json +8 -0
- package/templates/react-app/config/i18n.ts +3 -1
- package/templates/react-app/config/{Identifier.Error.ts → identifier/Error.ts} +7 -0
- package/templates/react-app/config/{Identifier.I18n.ts → identifier/I18n.ts} +321 -3
- package/templates/react-app/index.html +1 -1
- package/templates/react-app/package.json +3 -1
- package/templates/react-app/public/locales/en/common.json +55 -8
- package/templates/react-app/public/locales/zh/common.json +55 -8
- package/templates/react-app/public/router-root/logo.svg +1 -0
- package/templates/react-app/src/App.tsx +6 -3
- package/templates/react-app/src/base/cases/AppConfig.ts +1 -1
- package/templates/react-app/src/base/cases/PublicAssetsPath.ts +17 -0
- package/templates/react-app/src/base/port/LoginInterface.ts +8 -0
- package/templates/react-app/src/base/port/StoreInterface.ts +58 -0
- package/templates/react-app/src/base/services/I18nService.ts +15 -9
- package/templates/react-app/src/{uikit/controllers/RouterController.ts → base/services/RouteService.ts} +12 -12
- package/templates/react-app/src/{uikit/controllers/UserController.ts → base/services/UserService.ts} +29 -13
- package/templates/react-app/src/core/bootstrap.ts +1 -1
- package/templates/react-app/src/core/registers/RegisterCommon.ts +11 -1
- package/templates/react-app/src/core/registers/RegisterControllers.ts +3 -12
- package/templates/react-app/src/pages/auth/Layout.tsx +14 -6
- package/templates/react-app/src/pages/auth/Login.tsx +50 -29
- package/templates/react-app/src/pages/auth/Register.tsx +238 -1
- package/templates/react-app/src/pages/base/About.tsx +1 -1
- package/templates/react-app/src/pages/base/ErrorIdentifier.tsx +2 -2
- package/templates/react-app/src/pages/base/Executor.tsx +4 -4
- package/templates/react-app/src/pages/base/Home.tsx +1 -1
- package/templates/react-app/src/pages/base/JSONStorage.tsx +3 -3
- package/templates/react-app/src/pages/base/Request.tsx +4 -4
- package/templates/react-app/src/pages/base/components/BaseHeader.tsx +8 -2
- package/templates/react-app/src/styles/css/page.css +3 -3
- package/templates/react-app/src/styles/css/themes/_default.css +3 -3
- package/templates/react-app/src/styles/css/themes/dark.css +3 -3
- package/templates/react-app/src/styles/css/themes/pink.css +3 -3
- package/templates/react-app/src/uikit/components/LanguageSwitcher.tsx +7 -7
- package/templates/react-app/src/uikit/components/ThemeSwitcher.tsx +3 -3
- package/templates/react-app/src/uikit/contexts/BaseRouteContext.ts +1 -1
- package/templates/react-app/src/uikit/controllers/ExecutorController.ts +6 -3
- package/templates/react-app/src/uikit/controllers/JSONStorageController.ts +6 -3
- package/templates/react-app/src/uikit/controllers/RequestController.ts +3 -4
- package/templates/react-app/src/uikit/hooks/useDocumentTitle.ts +15 -0
- package/templates/react-app/src/uikit/hooks/useStore.ts +12 -0
- package/templates/react-app/src/uikit/providers/BaseRouteProvider.tsx +7 -1
- package/templates/react-app/src/uikit/providers/ProcessProvider.tsx +7 -7
- package/templates/react-app/vite.config.ts +20 -11
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { defineConfig } from 'vitest/config';
|
|
2
2
|
import react from '@vitejs/plugin-react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
envPrefix,
|
|
5
|
+
overrideAntdThemeMode,
|
|
6
|
+
routerPrefix
|
|
7
|
+
} from './config/common';
|
|
4
8
|
import { name, version } from './package.json';
|
|
5
9
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
6
10
|
import envConfig from '@qlover/corekit-bridge/vite-env-config/index';
|
|
@@ -9,6 +13,8 @@ import i18nConfig from './config/i18n';
|
|
|
9
13
|
import tailwindcss from '@tailwindcss/vite';
|
|
10
14
|
import viteDeprecatedAntd from '@brain-toolkit/antd-theme-override/vite';
|
|
11
15
|
import vitePluginImp from 'vite-plugin-imp';
|
|
16
|
+
import { readdirSync } from 'fs';
|
|
17
|
+
import { join } from 'path';
|
|
12
18
|
|
|
13
19
|
// https://vite.dev/config/
|
|
14
20
|
export default defineConfig({
|
|
@@ -87,16 +93,18 @@ export default defineConfig({
|
|
|
87
93
|
tsconfigPaths(),
|
|
88
94
|
ts2Locales({
|
|
89
95
|
locales: i18nConfig.supportedLngs as unknown as string[],
|
|
90
|
-
options:
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
options: readdirSync(join(__dirname, './config/Identifier'))
|
|
97
|
+
.map((file) => ({
|
|
98
|
+
file,
|
|
99
|
+
name: file.replace('.ts', ''),
|
|
100
|
+
path: join('./config/Identifier', file)
|
|
101
|
+
}))
|
|
102
|
+
.map(({ path }) => ({
|
|
103
|
+
source: path,
|
|
104
|
+
// You can use namespace
|
|
105
|
+
// target: `./public/locales/{{lng}}/{{${name}}}.json`
|
|
106
|
+
target: `./public/locales/{{lng}}/common.json`
|
|
107
|
+
}))
|
|
100
108
|
}),
|
|
101
109
|
viteDeprecatedAntd({
|
|
102
110
|
mode: overrideAntdThemeMode,
|
|
@@ -104,6 +112,7 @@ export default defineConfig({
|
|
|
104
112
|
targetPath: './src/base/types/deprecated-antd.d.ts'
|
|
105
113
|
})
|
|
106
114
|
],
|
|
115
|
+
base: routerPrefix,
|
|
107
116
|
envPrefix: envPrefix,
|
|
108
117
|
publicDir: 'public',
|
|
109
118
|
server: {
|