@jiangood/open-admin 1.0.1 → 1.1.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/config/common-plugin.js +94 -0
- package/config/config.js +58 -0
- package/config/utils.js +73 -0
- package/package.json +8 -11
- package/src/.umi-production/appData.json +2365 -0
- package/src/.umi-production/core/EmptyRoute.tsx +9 -0
- package/src/.umi-production/core/defineApp.ts +16 -0
- package/src/.umi-production/core/helmet.ts +10 -0
- package/src/.umi-production/core/helmetContext.ts +4 -0
- package/src/.umi-production/core/history.ts +72 -0
- package/src/.umi-production/core/historyIntelli.ts +132 -0
- package/src/.umi-production/core/plugin.ts +40 -0
- package/src/.umi-production/core/pluginConfig.ts +324 -0
- package/src/.umi-production/core/pluginConfigJoi.d.ts +7 -0
- package/src/.umi-production/core/polyfill.ts +220 -0
- package/src/.umi-production/core/route.tsx +54 -0
- package/src/.umi-production/core/routeProps.js +5 -0
- package/src/.umi-production/core/routeProps.ts +6 -0
- package/src/.umi-production/core/terminal.ts +37 -0
- package/src/.umi-production/exports.ts +17 -0
- package/src/.umi-production/testBrowser.tsx +90 -0
- package/src/.umi-production/tsconfig.json +44 -0
- package/src/.umi-production/typings.d.ts +136 -0
- package/src/.umi-production/umi.ts +83 -0
- package/src/framework/components/{DownloadFileButton.jsx → DownloadFileButton/index.jsx} +1 -1
- package/src/framework/components/{LinkButton.d.ts → LinkButton/index.d.ts} +1 -1
- package/src/framework/components/{LinkButton.jsx → LinkButton/index.jsx} +1 -1
- package/src/framework/components/NamedIcon/index.d.ts +5 -0
- package/src/framework/components/{NamedIcon.tsx → NamedIcon/index.jsx} +1 -5
- package/src/framework/components/OrgTree/index.d.ts +4 -0
- package/src/framework/{field-components/system/OrgTree.tsx → components/OrgTree/index.jsx} +1 -4
- package/src/framework/components/PageLoading/index.d.ts +1 -0
- package/src/framework/components/{PageLoading.tsx → PageLoading/index.jsx} +3 -5
- package/src/framework/components/RoleTree/index.d.ts +4 -0
- package/src/framework/{field-components/system/RoleTree.tsx → components/RoleTree/index.jsx} +1 -4
- package/src/framework/components/ValueType/index.jsx +1 -1
- package/src/framework/components/ValueType/registry.jsx +2 -3
- package/src/framework/components/{view/ViewRange → ViewRange}/index.d.ts +5 -7
- package/src/framework/components/index.ts +3 -7
- package/src/framework/components/system/index.tsx +1 -1
- package/src/framework/fields/FieldBoolean/index.d.ts +9 -0
- package/src/framework/{field-components/FieldBoolean.jsx → fields/FieldBoolean/index.jsx} +6 -9
- package/src/framework/{field-components/FieldDate.d.ts → fields/FieldDate/index.d.ts} +5 -9
- package/src/framework/{field-components/FieldDate.jsx → fields/FieldDate/index.jsx} +28 -26
- package/src/framework/fields/FieldDateRange/index.d.ts +22 -0
- package/src/framework/{field-components/FieldDateRange.jsx → fields/FieldDateRange/index.jsx} +26 -27
- package/src/framework/fields/FieldDictSelect/index.d.ts +12 -0
- package/src/framework/{field-components/FieldDictSelect.jsx → fields/FieldDictSelect/index.jsx} +5 -5
- package/src/framework/fields/FieldEditor/index.d.ts +14 -0
- package/src/framework/fields/FieldEditor/index.jsx +59 -0
- package/src/framework/fields/FieldNumberRange/index.d.ts +10 -0
- package/src/framework/{field-components/FieldNumberRange.jsx → fields/FieldNumberRange/index.jsx} +20 -24
- package/src/framework/fields/FieldPercent/index.d.ts +8 -0
- package/src/framework/{field-components/FieldPercent.jsx → fields/FieldPercent/index.jsx} +9 -6
- package/src/framework/fields/FieldRemoteSelect/index.d.ts +44 -0
- package/src/framework/fields/FieldRemoteSelect/index.jsx +125 -0
- package/src/framework/fields/FieldRemoteSelectMultiple/index.d.ts +20 -0
- package/src/framework/{field-components/FieldRemoteSelectMultiple.jsx → fields/FieldRemoteSelectMultiple/index.jsx} +4 -5
- package/src/framework/fields/FieldRemoteSelectMultipleInline/index.d.ts +21 -0
- package/src/framework/{field-components/FieldRemoteSelectMultipleInline.jsx → fields/FieldRemoteSelectMultipleInline/index.jsx} +8 -6
- package/src/framework/fields/FieldRemoteTree/index.d.ts +20 -0
- package/src/framework/fields/FieldRemoteTree/index.jsx +50 -0
- package/src/framework/{field-components/FieldRemoteTreeCascader.d.ts → fields/FieldRemoteTreeCascader/index.d.ts} +10 -15
- package/src/framework/{field-components/FieldRemoteTreeCascader.jsx → fields/FieldRemoteTreeCascader/index.jsx} +11 -13
- package/src/framework/fields/FieldRemoteTreeSelect/index.d.ts +19 -0
- package/src/framework/{field-components/FieldRemoteTreeSelect.jsx → fields/FieldRemoteTreeSelect/index.jsx} +10 -20
- package/src/framework/fields/FieldRemoteTreeSelectMultiple/index.d.ts +20 -0
- package/src/framework/{field-components/FieldRemoteTreeSelectMultiple.jsx → fields/FieldRemoteTreeSelectMultiple/index.jsx} +11 -21
- package/src/framework/fields/FieldSysOrgTree/index.d.ts +9 -0
- package/src/framework/fields/FieldSysOrgTree/index.jsx +20 -0
- package/src/framework/fields/FieldSysOrgTreeSelect/index.d.ts +9 -0
- package/src/framework/{field-components/FieldSysOrgTreeSelect.jsx → fields/FieldSysOrgTreeSelect/index.jsx} +7 -8
- package/src/framework/fields/FieldTable/index.d.ts +14 -0
- package/src/framework/{field-components/FieldTable.jsx → fields/FieldTable/index.jsx} +38 -38
- package/src/framework/fields/FieldTableSelect/index.d.ts +19 -0
- package/src/framework/{field-components/FieldTableSelect.jsx → fields/FieldTableSelect/index.jsx} +13 -12
- package/src/framework/{field-components/FieldUploadFile.d.ts → fields/FieldUploadFile/index.d.ts} +12 -15
- package/src/framework/{field-components/FieldUploadFile.jsx → fields/FieldUploadFile/index.jsx} +32 -34
- package/src/framework/{field-components → fields}/index.ts +2 -1
- package/src/framework/fields/types.ts +16 -0
- package/src/framework/index.ts +2 -2
- package/src/framework/utils/index.ts +0 -1
- package/src/framework/utils/system/DictUtils.ts +1 -1
- package/src/framework/views/ViewApproveStatus/index.d.ts +3 -0
- package/src/framework/{view-components/ViewApproveStatus.tsx → views/ViewApproveStatus/index.jsx} +3 -8
- package/src/framework/views/ViewBoolean/index.d.ts +3 -0
- package/src/framework/views/ViewBoolean/index.jsx +4 -0
- package/src/framework/views/ViewBooleanEnableDisable/index.d.ts +5 -0
- package/src/framework/{components/view/ViewBooleanEnableDisable.tsx → views/ViewBooleanEnableDisable/index.jsx} +2 -7
- package/src/framework/{components/view/ViewFileButton.d.ts → views/ViewFile/index.d.ts} +3 -3
- package/src/framework/views/ViewFileButton/index.d.ts +10 -0
- package/src/framework/views/ViewFileButton/index.jsx +22 -0
- package/src/framework/views/ViewImage/index.d.ts +6 -0
- package/src/framework/views/ViewPassword/index.d.ts +5 -0
- package/src/framework/{view-components/ViewPassword.tsx → views/ViewPassword/index.jsx} +2 -3
- package/src/framework/views/ViewProcessInstanceProgress/index.d.ts +12 -0
- package/src/framework/{view-components/ViewFlowableInstanceProgress.jsx → views/ViewProcessInstanceProgress/index.jsx} +2 -2
- package/src/framework/views/ViewProcessInstanceProgressButton/index.d.ts +6 -0
- package/src/framework/{view-components/ViewFlowableInstanceProgressButton.tsx → views/ViewProcessInstanceProgressButton/index.jsx} +4 -6
- package/src/framework/views/ViewText/index.d.ts +16 -0
- package/src/framework/views/ViewText/index.jsx +42 -0
- package/src/framework/views/index.ts +12 -0
- package/src/framework/views/types.ts +26 -0
- package/src/layouts/admin/index.jsx +0 -2
- package/src/layouts/index.jsx +38 -16
- package/src/pages/404.jsx +4 -4
- package/src/pages/about.jsx +0 -2
- package/src/pages/index.jsx +4 -19
- package/src/pages/login.jsx +3 -8
- package/src/pages/system/api/ApiDoc.jsx +19 -15
- package/src/pages/system/api/index.jsx +23 -24
- package/src/pages/system/api/perm.jsx +4 -4
- package/src/pages/system/dict/Dict.jsx +0 -5
- package/src/pages/system/dict/DictItem.jsx +23 -25
- package/src/pages/system/dict/index.jsx +2 -2
- package/src/pages/system/file/index.jsx +16 -29
- package/src/pages/system/job/index.jsx +44 -44
- package/src/pages/system/log/index.jsx +3 -4
- package/src/pages/system/org/index.jsx +34 -36
- package/src/pages/system/role/index.jsx +68 -74
- package/src/pages/system/role/perm.jsx +0 -1
- package/src/pages/system/sysManual/index.jsx +27 -28
- package/src/pages/system/user/UserPerm.jsx +5 -8
- package/src/pages/system/user/index.jsx +46 -51
- package/src/pages/test/views.jsx +95 -0
- package/src/pages/ureport/index.jsx +2 -2
- package/src/pages/userCenter/ChangePassword.jsx +2 -1
- package/src/pages/userCenter/index.jsx +8 -8
- package/src/pages/userCenter/manual.jsx +3 -5
- package/src/pages/userCenter/message.jsx +14 -16
- package/config/dist/common-plugin.js +0 -149
- package/config/dist/config.js +0 -45
- package/config/dist/index.js +0 -18
- package/src/app.js +0 -1
- package/src/asserts/welcome.png +0 -0
- package/src/forms/demoForm.jsx +0 -16
- package/src/framework/components/Ellipsis.jsx +0 -39
- package/src/framework/components/Ellipsis.less +0 -8
- package/src/framework/components/view/ViewEllipsis.d.ts +0 -11
- package/src/framework/components/view/ViewEllipsis.jsx +0 -30
- package/src/framework/components/view/ViewFile.d.ts +0 -10
- package/src/framework/components/view/ViewFileButton.jsx +0 -0
- package/src/framework/components/view/ViewImage.d.ts +0 -9
- package/src/framework/components/view/ViewText.tsx +0 -16
- package/src/framework/components/view/index.ts +0 -10
- package/src/framework/field-components/FieldBoolean.d.ts +0 -13
- package/src/framework/field-components/FieldDateRange.d.ts +0 -6
- package/src/framework/field-components/FieldDictSelect.d.ts +0 -13
- package/src/framework/field-components/FieldEditor.d.ts +0 -10
- package/src/framework/field-components/FieldEditor.jsx +0 -58
- package/src/framework/field-components/FieldNumberRange.d.ts +0 -13
- package/src/framework/field-components/FieldPercent.d.ts +0 -12
- package/src/framework/field-components/FieldRemoteSelect.d.ts +0 -13
- package/src/framework/field-components/FieldRemoteSelect.jsx +0 -87
- package/src/framework/field-components/FieldRemoteSelectMultiple.d.ts +0 -13
- package/src/framework/field-components/FieldRemoteSelectMultipleInline.d.ts +0 -20
- package/src/framework/field-components/FieldRemoteTree.d.ts +0 -21
- package/src/framework/field-components/FieldRemoteTree.jsx +0 -45
- package/src/framework/field-components/FieldRemoteTreeSelect.d.ts +0 -17
- package/src/framework/field-components/FieldRemoteTreeSelectMultiple.d.ts +0 -17
- package/src/framework/field-components/FieldSysOrgTree.d.ts +0 -12
- package/src/framework/field-components/FieldSysOrgTree.jsx +0 -23
- package/src/framework/field-components/FieldSysOrgTreeSelect.d.ts +0 -12
- package/src/framework/field-components/FieldTable.d.ts +0 -17
- package/src/framework/field-components/FieldTableSelect.d.ts +0 -19
- package/src/framework/field-components/system/index.ts +0 -2
- package/src/framework/view-components/ViewBoolean.tsx +0 -6
- package/src/framework/view-components/ViewFlowableInstanceProgress.d.ts +0 -12
- package/src/framework/view-components/ViewProps.ts +0 -11
- package/src/framework/view-components/index.ts +0 -6
- package/src/pages/test.jsx +0 -200
- /package/src/framework/components/{DownloadFileButton.d.ts → DownloadFileButton/index.d.ts} +0 -0
- /package/src/framework/components/{view/ViewRange → ViewRange}/index.jsx +0 -0
- /package/src/framework/{field-components/FieldTable.less → fields/FieldTable/styles.less} +0 -0
- /package/src/framework/{components/view/ViewFile.jsx → views/ViewFile/index.jsx} +0 -0
- /package/src/framework/{components/view/ViewImage.jsx → views/ViewImage/index.jsx} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Outlet, useOutletContext } from 'umi';
|
|
6
|
+
export default function EmptyRoute() {
|
|
7
|
+
const context = useOutletContext();
|
|
8
|
+
return <Outlet context={context} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
interface IDefaultRuntimeConfig {
|
|
5
|
+
onRouteChange?: (props: { routes: any, clientRoutes: any, location: any, action: any, isFirst: boolean }) => void;
|
|
6
|
+
patchRoutes?: (props: { routes: any }) => void;
|
|
7
|
+
patchClientRoutes?: (props: { routes: any }) => void;
|
|
8
|
+
render?: (oldRender: () => void) => void;
|
|
9
|
+
rootContainer?: (lastRootContainer: JSX.Element, args?: any) => void;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export type RuntimeConfig = IDefaultRuntimeConfig
|
|
13
|
+
|
|
14
|
+
export function defineApp(config: RuntimeConfig): RuntimeConfig {
|
|
15
|
+
return config;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { HelmetProvider } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react';
|
|
6
|
+
import { context } from './helmetContext';
|
|
7
|
+
|
|
8
|
+
export const innerProvider = (container) => {
|
|
9
|
+
return React.createElement(HelmetProvider, { context }, container);
|
|
10
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import { createHashHistory, createMemoryHistory, createBrowserHistory } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react';
|
|
5
|
+
import type { UmiHistory } from './historyIntelli';
|
|
6
|
+
|
|
7
|
+
let history: UmiHistory;
|
|
8
|
+
let basename: string = '/';
|
|
9
|
+
export function createHistory(opts: any) {
|
|
10
|
+
let h;
|
|
11
|
+
if (opts.type === 'hash') {
|
|
12
|
+
h = createHashHistory();
|
|
13
|
+
} else if (opts.type === 'memory') {
|
|
14
|
+
h = createMemoryHistory(opts);
|
|
15
|
+
} else {
|
|
16
|
+
h = createBrowserHistory();
|
|
17
|
+
}
|
|
18
|
+
if (opts.basename) {
|
|
19
|
+
basename = opts.basename;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
history = {
|
|
24
|
+
...h,
|
|
25
|
+
push(to, state) {
|
|
26
|
+
h.push(patchTo(to, h), state);
|
|
27
|
+
},
|
|
28
|
+
replace(to, state) {
|
|
29
|
+
h.replace(patchTo(to, h), state);
|
|
30
|
+
},
|
|
31
|
+
get location() {
|
|
32
|
+
return h.location;
|
|
33
|
+
},
|
|
34
|
+
get action() {
|
|
35
|
+
return h.action;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return h;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function setHistory(h: UmiHistory) {
|
|
43
|
+
if (h) {
|
|
44
|
+
history = h;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Patch `to` to support basename
|
|
49
|
+
// Refs:
|
|
50
|
+
// https://github.com/remix-run/history/blob/3e9dab4/packages/history/index.ts#L484
|
|
51
|
+
// https://github.com/remix-run/history/blob/dev/docs/api-reference.md#to
|
|
52
|
+
function patchTo(to: any, h: History) {
|
|
53
|
+
if (typeof to === 'string') {
|
|
54
|
+
return `${stripLastSlash(basename)}${to}`;
|
|
55
|
+
} else if (typeof to === 'object') {
|
|
56
|
+
|
|
57
|
+
const currentPathname = h.location.pathname;
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
...to,
|
|
61
|
+
pathname: to.pathname? `${stripLastSlash(basename)}${to.pathname}` : currentPathname,
|
|
62
|
+
};
|
|
63
|
+
} else {
|
|
64
|
+
throw new Error(`Unexpected to: ${to}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function stripLastSlash(path) {
|
|
69
|
+
return path.slice(-1) === '/' ? path.slice(0, -1) : path;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { history };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import { getRoutes } from './route'
|
|
5
|
+
import type { History } from '/home/runner/work/open-admin/open-admin/web/node_modules/.pnpm/@umijs+renderer-react@4.6.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@umijs/renderer-react'
|
|
6
|
+
|
|
7
|
+
type Routes = Awaited<ReturnType<typeof getRoutes>>['routes']
|
|
8
|
+
type AllRoute = Routes[keyof Routes]
|
|
9
|
+
type IsRoot<T extends any> = 'parentId' extends keyof T ? false : true
|
|
10
|
+
|
|
11
|
+
// show `/` in not `layout / wrapper` only
|
|
12
|
+
type GetAllRouteWithoutLayout<Item extends AllRoute> = Item extends any
|
|
13
|
+
? 'isWrapper' extends keyof Item
|
|
14
|
+
? never
|
|
15
|
+
: 'isLayout' extends keyof Item
|
|
16
|
+
? never
|
|
17
|
+
: Item
|
|
18
|
+
: never
|
|
19
|
+
type AllRouteWithoutLayout = GetAllRouteWithoutLayout<AllRoute>
|
|
20
|
+
type IndexRoutePathname = '/' extends AllRouteWithoutLayout['path']
|
|
21
|
+
? '/'
|
|
22
|
+
: never
|
|
23
|
+
|
|
24
|
+
type GetChildrens<T extends any> = T extends any
|
|
25
|
+
? IsRoot<T> extends true
|
|
26
|
+
? never
|
|
27
|
+
: T
|
|
28
|
+
: never
|
|
29
|
+
type Childrens = GetChildrens<AllRoute>
|
|
30
|
+
type Root = Exclude<AllRoute, Childrens>
|
|
31
|
+
type AllIds = AllRoute['id']
|
|
32
|
+
|
|
33
|
+
type GetChildrensByParentId<
|
|
34
|
+
Id extends AllIds,
|
|
35
|
+
Item = AllRoute
|
|
36
|
+
> = Item extends any
|
|
37
|
+
? 'parentId' extends keyof Item
|
|
38
|
+
? Item['parentId'] extends Id
|
|
39
|
+
? Item
|
|
40
|
+
: never
|
|
41
|
+
: never
|
|
42
|
+
: never
|
|
43
|
+
|
|
44
|
+
type RouteObject<
|
|
45
|
+
Id extends AllIds,
|
|
46
|
+
Item = GetChildrensByParentId<Id>
|
|
47
|
+
> = IsNever<Item> extends true
|
|
48
|
+
? ''
|
|
49
|
+
: Item extends AllRoute
|
|
50
|
+
? {
|
|
51
|
+
[Key in Item['path'] as TrimSlash<Key>]: UnionMerge<
|
|
52
|
+
RouteObject<Item['id']>
|
|
53
|
+
>
|
|
54
|
+
}
|
|
55
|
+
: never
|
|
56
|
+
|
|
57
|
+
type GetRootRouteObject<Item extends Root> = Item extends Root
|
|
58
|
+
? {
|
|
59
|
+
[K in Item['path'] as TrimSlash<K>]: UnionMerge<RouteObject<Item['id']>>
|
|
60
|
+
}
|
|
61
|
+
: never
|
|
62
|
+
type MergedResult = UnionMerge<GetRootRouteObject<Root>>
|
|
63
|
+
|
|
64
|
+
// --- patch history types ---
|
|
65
|
+
|
|
66
|
+
type HistoryTo = Parameters<History['push']>['0']
|
|
67
|
+
type HistoryPath = Exclude<HistoryTo, string>
|
|
68
|
+
|
|
69
|
+
type UmiPathname = Path<MergedResult> | (string & {})
|
|
70
|
+
interface UmiPath extends HistoryPath {
|
|
71
|
+
pathname: UmiPathname
|
|
72
|
+
}
|
|
73
|
+
type UmiTo = UmiPathname | UmiPath
|
|
74
|
+
|
|
75
|
+
type UmiPush = (to: UmiTo, state?: any) => void
|
|
76
|
+
type UmiReplace = (to: UmiTo, state?: any) => void
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
export interface UmiHistory extends History {
|
|
80
|
+
push: UmiPush
|
|
81
|
+
replace: UmiReplace
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// --- type utils ---
|
|
85
|
+
type TrimLeftSlash<T extends string> = T extends `/${infer R}`
|
|
86
|
+
? TrimLeftSlash<R>
|
|
87
|
+
: T
|
|
88
|
+
type TrimRightSlash<T extends string> = T extends `${infer R}/`
|
|
89
|
+
? TrimRightSlash<R>
|
|
90
|
+
: T
|
|
91
|
+
type TrimSlash<T extends string> = TrimLeftSlash<TrimRightSlash<T>>
|
|
92
|
+
|
|
93
|
+
type IsNever<T> = [T] extends [never] ? true : false
|
|
94
|
+
type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B
|
|
95
|
+
? 1
|
|
96
|
+
: 2
|
|
97
|
+
? true
|
|
98
|
+
: false
|
|
99
|
+
|
|
100
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
|
101
|
+
k: infer I
|
|
102
|
+
) => void
|
|
103
|
+
? I
|
|
104
|
+
: never
|
|
105
|
+
type UnionMerge<U> = UnionToIntersection<U> extends infer O
|
|
106
|
+
? { [K in keyof O]: O[K] }
|
|
107
|
+
: never
|
|
108
|
+
|
|
109
|
+
type ExcludeEmptyKey<T> = IsEqual<T, ''> extends true ? never : T
|
|
110
|
+
|
|
111
|
+
type PathConcat<
|
|
112
|
+
TKey extends string,
|
|
113
|
+
TValue,
|
|
114
|
+
N = TrimSlash<TKey>
|
|
115
|
+
> = TValue extends string
|
|
116
|
+
? ExcludeEmptyKey<N>
|
|
117
|
+
:
|
|
118
|
+
| ExcludeEmptyKey<N>
|
|
119
|
+
| `${N & string}${IsNever<ExcludeEmptyKey<N>> extends true
|
|
120
|
+
? ''
|
|
121
|
+
: '/'}${UnionPath<TValue>}`
|
|
122
|
+
|
|
123
|
+
type UnionPath<T> = {
|
|
124
|
+
[K in keyof T]-?: PathConcat<K & string, T[K]>
|
|
125
|
+
}[keyof T]
|
|
126
|
+
|
|
127
|
+
type MakeSureLeftSlash<T> = T extends any
|
|
128
|
+
? `/${TrimRightSlash<T & string>}`
|
|
129
|
+
: never
|
|
130
|
+
|
|
131
|
+
// exclude `/*`, because it always at the top of the IDE tip list
|
|
132
|
+
type Path<T, K = UnionPath<T>> = Exclude<MakeSureLeftSlash<K>, '/*'> | IndexRoutePathname
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import * as Plugin_0 from '@@/core/helmet.ts';
|
|
5
|
+
import { PluginManager } from 'umi';
|
|
6
|
+
|
|
7
|
+
function __defaultExport (obj) {
|
|
8
|
+
if (obj.default) {
|
|
9
|
+
return typeof obj.default === 'function' ? obj.default() : obj.default
|
|
10
|
+
}
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
export function getPlugins() {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
apply: Plugin_0,
|
|
17
|
+
path: process.env.NODE_ENV === 'production' ? void 0 : '@@/core/helmet.ts',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getValidKeys() {
|
|
23
|
+
return ['patchRoutes','patchClientRoutes','modifyContextOpts','modifyClientRenderOpts','rootContainer','innerProvider','i18nProvider','accessProvider','dataflowProvider','outerProvider','render','onRouteChange',];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let pluginManager = null;
|
|
27
|
+
|
|
28
|
+
export function createPluginManager() {
|
|
29
|
+
pluginManager = PluginManager.create({
|
|
30
|
+
plugins: getPlugins(),
|
|
31
|
+
validKeys: getValidKeys(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
return pluginManager;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function getPluginManager() {
|
|
39
|
+
return pluginManager;
|
|
40
|
+
}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import { IConfigFromPluginsJoi } from "./pluginConfigJoi.d";
|
|
5
|
+
|
|
6
|
+
interface IConfigTypes {
|
|
7
|
+
codeSplitting: {
|
|
8
|
+
jsStrategy: "bigVendors" | "depPerChunk" | "granularChunks";
|
|
9
|
+
jsStrategyOptions?: ({
|
|
10
|
+
|
|
11
|
+
} | undefined);
|
|
12
|
+
cssStrategy?: ("mergeAll" | undefined);
|
|
13
|
+
cssStrategyOptions?: ({
|
|
14
|
+
|
|
15
|
+
} | undefined);
|
|
16
|
+
};
|
|
17
|
+
title: string;
|
|
18
|
+
styles: Array<string | {
|
|
19
|
+
src?: (string | undefined);
|
|
20
|
+
} | {
|
|
21
|
+
content?: (string | undefined);
|
|
22
|
+
} | { [x: string]: any }>;
|
|
23
|
+
scripts: Array<string | {
|
|
24
|
+
src?: (string | undefined);
|
|
25
|
+
} | {
|
|
26
|
+
content?: (string | undefined);
|
|
27
|
+
} | { [x: string]: any }>;
|
|
28
|
+
routes: Array<{
|
|
29
|
+
component?: (string | undefined);
|
|
30
|
+
layout?: (false | undefined);
|
|
31
|
+
path?: (string | undefined);
|
|
32
|
+
redirect?: (string | undefined);
|
|
33
|
+
routes?: IConfigTypes['routes'];
|
|
34
|
+
wrappers?: (Array<string> | undefined);
|
|
35
|
+
} | { [x: string]: any }>;
|
|
36
|
+
routeLoader: {
|
|
37
|
+
moduleType: "esm" | "cjs";
|
|
38
|
+
};
|
|
39
|
+
reactRouter5Compat: boolean | {
|
|
40
|
+
|
|
41
|
+
};
|
|
42
|
+
presets: Array<string>;
|
|
43
|
+
plugins: Array<string>;
|
|
44
|
+
npmClient: "pnpm" | "tnpm" | "cnpm" | "yarn" | "npm";
|
|
45
|
+
mountElementId: string;
|
|
46
|
+
metas: Array<{
|
|
47
|
+
charset?: (string | undefined);
|
|
48
|
+
content?: (string | undefined);
|
|
49
|
+
"http-equiv"?: (string | undefined);
|
|
50
|
+
name?: (string | undefined);
|
|
51
|
+
} | { [x: string]: any }>;
|
|
52
|
+
links: Array<{
|
|
53
|
+
crossorigin?: (string | undefined);
|
|
54
|
+
href?: (string | undefined);
|
|
55
|
+
hreflang?: (string | undefined);
|
|
56
|
+
media?: (string | undefined);
|
|
57
|
+
referrerpolicy?: (string | undefined);
|
|
58
|
+
rel?: (string | undefined);
|
|
59
|
+
sizes?: (any | undefined);
|
|
60
|
+
title?: (any | undefined);
|
|
61
|
+
type?: (any | undefined);
|
|
62
|
+
} | { [x: string]: any }>;
|
|
63
|
+
historyWithQuery: {
|
|
64
|
+
|
|
65
|
+
};
|
|
66
|
+
history: {
|
|
67
|
+
type: "browser" | "hash" | "memory";
|
|
68
|
+
};
|
|
69
|
+
headScripts: Array<string | {
|
|
70
|
+
src?: (string | undefined);
|
|
71
|
+
} | {
|
|
72
|
+
content?: (string | undefined);
|
|
73
|
+
} | { [x: string]: any }>;
|
|
74
|
+
esbuildMinifyIIFE: boolean;
|
|
75
|
+
conventionRoutes: {
|
|
76
|
+
base?: (string | undefined);
|
|
77
|
+
exclude?: (Array<any> | undefined);
|
|
78
|
+
};
|
|
79
|
+
conventionLayout: boolean;
|
|
80
|
+
base: string;
|
|
81
|
+
analyze: {
|
|
82
|
+
|
|
83
|
+
};
|
|
84
|
+
writeToDisk: boolean;
|
|
85
|
+
transformRuntime: { [x: string]: any };
|
|
86
|
+
theme: { [x: string]: any };
|
|
87
|
+
targets: { [x: string]: any };
|
|
88
|
+
svgr: { [x: string]: any };
|
|
89
|
+
svgo: { [x: string]: any } | boolean;
|
|
90
|
+
stylusLoader: { [x: string]: any };
|
|
91
|
+
styleLoader: { [x: string]: any };
|
|
92
|
+
srcTranspilerOptions: {
|
|
93
|
+
esbuild?: ({ [x: string]: any } | undefined);
|
|
94
|
+
swc?: ({ [x: string]: any } | undefined);
|
|
95
|
+
};
|
|
96
|
+
srcTranspiler: "babel" | "esbuild" | "swc";
|
|
97
|
+
sassLoader: { [x: string]: any };
|
|
98
|
+
runtimePublicPath: {
|
|
99
|
+
|
|
100
|
+
};
|
|
101
|
+
purgeCSS: { [x: string]: any };
|
|
102
|
+
publicPath: string;
|
|
103
|
+
proxy: { [x: string]: any } | Array<any>;
|
|
104
|
+
postcssLoader: { [x: string]: any };
|
|
105
|
+
outputPath: string;
|
|
106
|
+
normalCSSLoaderModules: { [x: string]: any };
|
|
107
|
+
mfsu: {
|
|
108
|
+
cacheDirectory?: (string | undefined);
|
|
109
|
+
chainWebpack?: (((...args: any[]) => unknown) | undefined);
|
|
110
|
+
esbuild?: (boolean | undefined);
|
|
111
|
+
exclude?: (Array<string | any> | undefined);
|
|
112
|
+
include?: (Array<string> | undefined);
|
|
113
|
+
mfName?: (string | undefined);
|
|
114
|
+
remoteAliases?: (Array<string> | undefined);
|
|
115
|
+
remoteName?: (string | undefined);
|
|
116
|
+
runtimePublicPath?: (boolean | undefined);
|
|
117
|
+
shared?: ({ [x: string]: any } | undefined);
|
|
118
|
+
strategy?: ("eager" | "normal" | undefined);
|
|
119
|
+
} | boolean;
|
|
120
|
+
mdx: {
|
|
121
|
+
loader?: (string | undefined);
|
|
122
|
+
loaderOptions?: ({ [x: string]: any } | undefined);
|
|
123
|
+
};
|
|
124
|
+
manifest: {
|
|
125
|
+
basePath?: (string | undefined);
|
|
126
|
+
fileName?: (string | undefined);
|
|
127
|
+
};
|
|
128
|
+
lessLoader: { [x: string]: any };
|
|
129
|
+
jsMinifierOptions: { [x: string]: any };
|
|
130
|
+
jsMinifier: "esbuild" | "swc" | "terser" | "uglifyJs" | "none";
|
|
131
|
+
inlineLimit: number;
|
|
132
|
+
ignoreMomentLocale: boolean;
|
|
133
|
+
https: {
|
|
134
|
+
cert?: (string | undefined);
|
|
135
|
+
hosts?: (Array<string> | undefined);
|
|
136
|
+
http2?: (boolean | undefined);
|
|
137
|
+
key?: (string | undefined);
|
|
138
|
+
};
|
|
139
|
+
hash: boolean;
|
|
140
|
+
forkTSChecker: { [x: string]: any };
|
|
141
|
+
fastRefresh: boolean;
|
|
142
|
+
extraPostCSSPlugins: Array<any>;
|
|
143
|
+
extraBabelPresets: Array<string | Array<any>>;
|
|
144
|
+
extraBabelPlugins: Array<string | Array<any>>;
|
|
145
|
+
extraBabelIncludes: Array<string | any>;
|
|
146
|
+
externals: { [x: string]: any } | string | ((...args: any[]) => unknown);
|
|
147
|
+
esm: {
|
|
148
|
+
|
|
149
|
+
};
|
|
150
|
+
devtool: "cheap-source-map" | "cheap-module-source-map" | "eval" | "eval-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | "source-map" | "hidden-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "inline-source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | boolean;
|
|
151
|
+
depTranspiler: "babel" | "esbuild" | "swc" | "none";
|
|
152
|
+
define: { [x: string]: any };
|
|
153
|
+
deadCode: {
|
|
154
|
+
context?: (string | undefined);
|
|
155
|
+
detectUnusedExport?: (boolean | undefined);
|
|
156
|
+
detectUnusedFiles?: (boolean | undefined);
|
|
157
|
+
exclude?: (Array<string> | undefined);
|
|
158
|
+
failOnHint?: (boolean | undefined);
|
|
159
|
+
patterns?: (Array<string> | undefined);
|
|
160
|
+
};
|
|
161
|
+
cssPublicPath: string;
|
|
162
|
+
cssMinifierOptions: { [x: string]: any };
|
|
163
|
+
cssMinifier: "cssnano" | "esbuild" | "parcelCSS" | "none";
|
|
164
|
+
cssLoaderModules: { [x: string]: any };
|
|
165
|
+
cssLoader: { [x: string]: any };
|
|
166
|
+
copy: Array<{
|
|
167
|
+
from: string;
|
|
168
|
+
to: string;
|
|
169
|
+
} | string>;
|
|
170
|
+
checkDepCssModules?: boolean;
|
|
171
|
+
cacheDirectoryPath: string;
|
|
172
|
+
babelLoaderCustomize: string;
|
|
173
|
+
autoprefixer: { [x: string]: any };
|
|
174
|
+
autoCSSModules: boolean;
|
|
175
|
+
alias: { [x: string]: any };
|
|
176
|
+
crossorigin: boolean | {
|
|
177
|
+
includes?: (Array<any> | undefined);
|
|
178
|
+
};
|
|
179
|
+
esmi: {
|
|
180
|
+
cdnOrigin: string;
|
|
181
|
+
shimUrl?: (string | undefined);
|
|
182
|
+
};
|
|
183
|
+
exportStatic: {
|
|
184
|
+
extraRoutePaths?: (((...args: any[]) => unknown) | Array<string> | undefined);
|
|
185
|
+
ignorePreRenderError?: (boolean | undefined);
|
|
186
|
+
};
|
|
187
|
+
favicons: Array<string>;
|
|
188
|
+
helmet: boolean;
|
|
189
|
+
icons: {
|
|
190
|
+
autoInstall?: ({
|
|
191
|
+
|
|
192
|
+
} | undefined);
|
|
193
|
+
defaultComponentConfig?: ({
|
|
194
|
+
|
|
195
|
+
} | undefined);
|
|
196
|
+
alias?: ({
|
|
197
|
+
|
|
198
|
+
} | undefined);
|
|
199
|
+
include?: (Array<string> | undefined);
|
|
200
|
+
};
|
|
201
|
+
mock: {
|
|
202
|
+
exclude?: (Array<string> | undefined);
|
|
203
|
+
include?: (Array<string> | undefined);
|
|
204
|
+
};
|
|
205
|
+
mpa: {
|
|
206
|
+
template?: (string | undefined);
|
|
207
|
+
layout?: (string | undefined);
|
|
208
|
+
getConfigFromEntryFile?: (boolean | undefined);
|
|
209
|
+
entry?: ({
|
|
210
|
+
|
|
211
|
+
} | undefined);
|
|
212
|
+
};
|
|
213
|
+
phantomDependency: {
|
|
214
|
+
exclude?: (Array<string> | undefined);
|
|
215
|
+
};
|
|
216
|
+
polyfill: {
|
|
217
|
+
imports?: (Array<string> | undefined);
|
|
218
|
+
};
|
|
219
|
+
routePrefetch: {
|
|
220
|
+
defaultPrefetch?: ("none" | "intent" | "render" | "viewport" | undefined);
|
|
221
|
+
defaultPrefetchTimeout?: (number | undefined);
|
|
222
|
+
};
|
|
223
|
+
terminal: {
|
|
224
|
+
|
|
225
|
+
};
|
|
226
|
+
tmpFiles: boolean;
|
|
227
|
+
clientLoader: {
|
|
228
|
+
|
|
229
|
+
};
|
|
230
|
+
routeProps: {
|
|
231
|
+
|
|
232
|
+
};
|
|
233
|
+
ssr: {
|
|
234
|
+
serverBuildPath?: (string | undefined);
|
|
235
|
+
serverBuildTarget?: ("express" | "worker" | undefined);
|
|
236
|
+
platform?: (string | undefined);
|
|
237
|
+
builder?: ("esbuild" | "webpack" | "mako" | undefined);
|
|
238
|
+
__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?: ({
|
|
239
|
+
pureApp?: (boolean | undefined);
|
|
240
|
+
pureHtml?: (boolean | undefined);
|
|
241
|
+
} | undefined);
|
|
242
|
+
useStream?: (boolean | undefined);
|
|
243
|
+
};
|
|
244
|
+
lowImport: {
|
|
245
|
+
libs?: (Array<any> | undefined);
|
|
246
|
+
css?: (string | undefined);
|
|
247
|
+
};
|
|
248
|
+
vite: {
|
|
249
|
+
|
|
250
|
+
};
|
|
251
|
+
apiRoute: {
|
|
252
|
+
platform?: (string | undefined);
|
|
253
|
+
};
|
|
254
|
+
monorepoRedirect: boolean | {
|
|
255
|
+
srcDir?: (Array<string> | undefined);
|
|
256
|
+
exclude?: (Array<any> | undefined);
|
|
257
|
+
peerDeps?: (boolean | undefined);
|
|
258
|
+
};
|
|
259
|
+
test: {
|
|
260
|
+
|
|
261
|
+
};
|
|
262
|
+
clickToComponent: {
|
|
263
|
+
/** 默认情况下,点击将默认编辑器为vscode, 你可以设置编辑器 vscode 或者 vscode-insiders */
|
|
264
|
+
editor?: (string | undefined);
|
|
265
|
+
};
|
|
266
|
+
legacy: {
|
|
267
|
+
buildOnly?: (boolean | undefined);
|
|
268
|
+
nodeModulesTransform?: (boolean | undefined);
|
|
269
|
+
checkOutput?: (boolean | undefined);
|
|
270
|
+
};
|
|
271
|
+
/** 设置 babel class-properties 启用 loose
|
|
272
|
+
@doc https://umijs.org/docs/api/config#classpropertiesloose */
|
|
273
|
+
classPropertiesLoose: boolean | {
|
|
274
|
+
|
|
275
|
+
};
|
|
276
|
+
ui: {
|
|
277
|
+
|
|
278
|
+
};
|
|
279
|
+
mako: {
|
|
280
|
+
plugins?: (Array<{
|
|
281
|
+
load?: (((...args: any[]) => unknown) | undefined);
|
|
282
|
+
generateEnd?: (((...args: any[]) => unknown) | undefined);
|
|
283
|
+
}> | undefined);
|
|
284
|
+
px2rem?: ({
|
|
285
|
+
root?: (number | undefined);
|
|
286
|
+
propBlackList?: (Array<string> | undefined);
|
|
287
|
+
propWhiteList?: (Array<string> | undefined);
|
|
288
|
+
selectorBlackList?: (Array<string> | undefined);
|
|
289
|
+
selectorWhiteList?: (Array<string> | undefined);
|
|
290
|
+
selectorDoubleList?: (Array<string> | undefined);
|
|
291
|
+
} | undefined);
|
|
292
|
+
experimental?: ({
|
|
293
|
+
webpackSyntaxValidate?: (Array<string> | undefined);
|
|
294
|
+
} | undefined);
|
|
295
|
+
flexBugs?: (boolean | undefined);
|
|
296
|
+
optimization?: ({
|
|
297
|
+
skipModules?: (boolean | undefined);
|
|
298
|
+
} | undefined);
|
|
299
|
+
};
|
|
300
|
+
utoopack: {
|
|
301
|
+
|
|
302
|
+
};
|
|
303
|
+
hmrGuardian: boolean;
|
|
304
|
+
forget: {
|
|
305
|
+
ReactCompilerConfig?: ({
|
|
306
|
+
|
|
307
|
+
} | undefined);
|
|
308
|
+
};
|
|
309
|
+
verifyCommit: {
|
|
310
|
+
scope?: (Array<string> | undefined);
|
|
311
|
+
allowEmoji?: (boolean | undefined);
|
|
312
|
+
};
|
|
313
|
+
run: {
|
|
314
|
+
globals?: (Array<string> | undefined);
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
type PrettifyWithCloseable<T> = {
|
|
319
|
+
[K in keyof T]: T[K] | false;
|
|
320
|
+
} & {};
|
|
321
|
+
|
|
322
|
+
export type IConfigFromPlugins = PrettifyWithCloseable<
|
|
323
|
+
IConfigFromPluginsJoi & Partial<IConfigTypes>
|
|
324
|
+
>;
|