antd-management-fast-config 1.0.2 → 1.0.5
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/es/configAssist.d.ts +36 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +15 -10
- package/src/configAssist.js +0 -63
- package/src/index.js +0 -1
- package/src/index.less +0 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export function checkDevelopment(): boolean;
|
|
2
|
+
export function buildConfig({ packageJson: packageImport, config }: {
|
|
3
|
+
packageJson: any;
|
|
4
|
+
config?: {} | undefined;
|
|
5
|
+
}): {
|
|
6
|
+
mfsu: {
|
|
7
|
+
shared: {
|
|
8
|
+
react: {
|
|
9
|
+
singleton: boolean;
|
|
10
|
+
requiredVersion: any;
|
|
11
|
+
};
|
|
12
|
+
'react-dom': {
|
|
13
|
+
singleton: boolean;
|
|
14
|
+
requiredVersion: any;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
hash: boolean;
|
|
19
|
+
antd: {};
|
|
20
|
+
access: {};
|
|
21
|
+
model: {};
|
|
22
|
+
initialState: {};
|
|
23
|
+
request: {};
|
|
24
|
+
history: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
locale: {
|
|
28
|
+
default: string;
|
|
29
|
+
antd: boolean;
|
|
30
|
+
baseNavigator: boolean;
|
|
31
|
+
};
|
|
32
|
+
layout: {};
|
|
33
|
+
};
|
|
34
|
+
export namespace configAssist {
|
|
35
|
+
const showInfoComplete: boolean;
|
|
36
|
+
}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./configAssist";
|
package/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return"development"===process.env.NODE_ENV}const o={showInfoComplete:!1};function t({packageJson:e,config:t={}}){const n=e.dependencies;let s={};const a={};n&&(n.react&&(a.react={singleton:!0,requiredVersion:n.react}),n["react-dom"]&&(a["react-dom"]={singleton:!0,requiredVersion:n["react-dom"]}),s.shared=a);const r={mfsu:s,hash:!0,antd:{},access:{},model:{},initialState:{},request:{},history:{type:"hash"},locale:{default:"zh-CN",antd:!0,baseNavigator:!0},layout:{},...t};return delete r.dva,o.showInfoComplete||(console.log(r),console.log("---------------------------------"),o.showInfoComplete=!0),r}export{t as buildConfig,e as checkDevelopment,o as configAssist};
|
package/package.json
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-management-fast-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
7
|
-
"main": "
|
|
7
|
+
"main": "es/index.js",
|
|
8
8
|
"directories": {
|
|
9
|
-
"
|
|
9
|
+
"es": "es"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
|
-
"
|
|
12
|
+
"es"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
+
"build:rollup": "rimraf ./es && rollup --config rollup.config.compression.js --bundleConfigAsCjs",
|
|
16
|
+
"postbuild:rollup": "npm run z:tsc:build",
|
|
17
|
+
"build:rollup:skipCompression": "rimraf ./es && rollup --config rollup.config.skipCompression.js --bundleConfigAsCjs",
|
|
18
|
+
"postbuild:rollup:skipCompression": "npm run z:tsc:build",
|
|
19
|
+
"dev:rollup": "rollup --config rollup.config.skipCompression.js --bundleConfigAsCjs --watch --watch.onBundleEnd=\"npm run z:tsc:build\"",
|
|
15
20
|
"precommit": "npm run z:lint:staged:quiet",
|
|
16
21
|
"publish:npm": "npm publish --registry https://registry.npmjs.org/",
|
|
17
22
|
"prez:documentation:generate": "npx rimraf ./docs && npm run z:documentation:lint",
|
|
@@ -57,18 +62,18 @@
|
|
|
57
62
|
"@commitlint/cz-commitlint": "^17.4.4",
|
|
58
63
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
59
64
|
"@types/jest": "^29.5.0",
|
|
60
|
-
"@types/node": "^18.15.
|
|
61
|
-
"@typescript-eslint/parser": "^5.
|
|
62
|
-
"@umijs/max": "^4.0.
|
|
65
|
+
"@types/node": "^18.15.5",
|
|
66
|
+
"@typescript-eslint/parser": "^5.56.0",
|
|
67
|
+
"@umijs/max": "^4.0.62",
|
|
63
68
|
"commitizen": "^4.3.0",
|
|
64
69
|
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
65
70
|
"cross-env": "^7.0.3",
|
|
66
71
|
"documentation": "^14.0.1",
|
|
67
|
-
"easy-soft-develop": "^2.0.
|
|
72
|
+
"easy-soft-develop": "^2.0.191",
|
|
68
73
|
"eslint": "^8.36.0",
|
|
69
74
|
"eslint-config-airbnb": "^19.0.4",
|
|
70
75
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
71
|
-
"eslint-config-prettier": "^8.
|
|
76
|
+
"eslint-config-prettier": "^8.8.0",
|
|
72
77
|
"eslint-formatter-pretty": "^5.0.0",
|
|
73
78
|
"eslint-import-resolver-typescript": "^3.5.3",
|
|
74
79
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
@@ -84,7 +89,7 @@
|
|
|
84
89
|
"husky": "^8.0.3",
|
|
85
90
|
"jest": "^29.5.0",
|
|
86
91
|
"lint-staged": "^13.2.0",
|
|
87
|
-
"prettier": "^2.8.
|
|
92
|
+
"prettier": "^2.8.6",
|
|
88
93
|
"prettier-plugin-organize-imports": "^3.2.2",
|
|
89
94
|
"prettier-plugin-packagejson": "^2.4.3",
|
|
90
95
|
"react": "^18.2.0",
|
package/src/configAssist.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export function checkDevelopment() {
|
|
2
|
-
return process.env.NODE_ENV === 'development';
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export const configAssist = {
|
|
6
|
-
showInfoComplete: false,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export function buildConfig({ packageJson: packageImport, config = {} }) {
|
|
10
|
-
const deps = packageImport.dependencies;
|
|
11
|
-
|
|
12
|
-
let mfsu = {};
|
|
13
|
-
const shared = {};
|
|
14
|
-
|
|
15
|
-
if (deps) {
|
|
16
|
-
if (deps['react']) {
|
|
17
|
-
shared.react = {
|
|
18
|
-
singleton: true,
|
|
19
|
-
requiredVersion: deps['react'],
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (deps['react-dom']) {
|
|
24
|
-
shared['react-dom'] = {
|
|
25
|
-
singleton: true,
|
|
26
|
-
requiredVersion: deps['react-dom'],
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
mfsu.shared = shared;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const mergeConfig = {
|
|
34
|
-
mfsu,
|
|
35
|
-
hash: true,
|
|
36
|
-
antd: {},
|
|
37
|
-
access: {},
|
|
38
|
-
model: {},
|
|
39
|
-
initialState: {},
|
|
40
|
-
request: {},
|
|
41
|
-
history: { type: 'hash' },
|
|
42
|
-
locale: {
|
|
43
|
-
// 默认使用 src/locales/zh-CN.ts 作为多语言文件
|
|
44
|
-
default: 'zh-CN',
|
|
45
|
-
antd: true,
|
|
46
|
-
// default true, when it is true, will use `navigator.language` overwrite default
|
|
47
|
-
baseNavigator: true,
|
|
48
|
-
},
|
|
49
|
-
layout: {},
|
|
50
|
-
...config,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
delete mergeConfig.dva;
|
|
54
|
-
|
|
55
|
-
if (!configAssist.showInfoComplete) {
|
|
56
|
-
console.log(mergeConfig);
|
|
57
|
-
console.log('---------------------------------');
|
|
58
|
-
|
|
59
|
-
configAssist.showInfoComplete = true;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return mergeConfig;
|
|
63
|
-
}
|
package/src/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './configAssist';
|
package/src/index.less
DELETED