neo-cmp-cli 1.2.1 → 1.2.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/package.json +1 -1
- package/src/cmpUtils/createCommonModulesCode.js +13 -4
- package/src/module/main.js +1 -1
- package/src/neo/neoRequire.js +11 -2
- package/src/template/antd-custom-cmp-template/package.json +2 -2
- package/src/template/antd-custom-cmp-template/src/components/info-card/index.tsx +3 -3
- package/src/template/echarts-custom-cmp-template/package.json +2 -2
- package/src/template/neo-custom-cmp-template/package.json +1 -1
- package/src/template/react-custom-cmp-template/package.json +1 -1
- package/src/template/react-ts-custom-cmp-template/package.json +1 -1
- package/src/template/vue2-custom-cmp-template/package.json +1 -1
- /package/src/{utils → neo}/webpack.mf.js +0 -0
package/package.json
CHANGED
|
@@ -66,16 +66,25 @@ const addNeoCommonModules = (modules) => {
|
|
|
66
66
|
window.__NeoCommonModules = {}
|
|
67
67
|
}
|
|
68
68
|
if (isPlainObject(modules)) {
|
|
69
|
-
const moduleIds = Object.keys(modules)
|
|
69
|
+
const moduleIds = Object.keys(modules)
|
|
70
70
|
moduleIds.forEach((moduleId) => {
|
|
71
71
|
const curModule = modules[moduleId];
|
|
72
72
|
const curCommonModule = window.__NeoCommonModules[moduleId];
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
|
|
74
|
+
if (curCommonModule && Object.keys(curCommonModule).length < 3) {
|
|
75
|
+
window.__NeoCommonModules[moduleId] = Object.assign(window.__NeoCommonModules[moduleId], curModule);
|
|
76
|
+
|
|
77
|
+
// 处理模块中的特殊属性
|
|
78
|
+
if (curModule.__esModule !== undefined) {
|
|
79
|
+
window.__NeoCommonModules[moduleId].__esModule = curModule.__esModule;
|
|
80
|
+
}
|
|
81
|
+
if (curModule.default !== undefined) {
|
|
82
|
+
window.__NeoCommonModules[moduleId].default = curModule.default;
|
|
83
|
+
}
|
|
75
84
|
} else {
|
|
76
85
|
window.__NeoCommonModules[moduleId] = curModule
|
|
77
86
|
}
|
|
78
|
-
})
|
|
87
|
+
})
|
|
79
88
|
}
|
|
80
89
|
}
|
|
81
90
|
|
package/src/module/main.js
CHANGED
|
@@ -13,7 +13,7 @@ const getEntriesWithAutoRegister = require('../cmpUtils/getEntriesWithAutoRegist
|
|
|
13
13
|
const previewCmp = require('./previewCmp');
|
|
14
14
|
const AddNeoRequirePlugin = require('../plugins/AddNeoRequirePlugin');
|
|
15
15
|
const { getExternalsByNeoCommonModules } = require('../neo/neoRequire');
|
|
16
|
-
// const { MFPlugins } = require('../
|
|
16
|
+
// const { MFPlugins } = require('../neo/webpack.mf');
|
|
17
17
|
const createCommonModulesCode = require('../cmpUtils/createCommonModulesCode');
|
|
18
18
|
|
|
19
19
|
const getValue = (originValue, defaultValue) => {
|
package/src/neo/neoRequire.js
CHANGED
|
@@ -47,8 +47,17 @@ const addNeoCommonModules = (modules) => {
|
|
|
47
47
|
moduleIds.forEach((moduleId) => {
|
|
48
48
|
const curModule = modules[moduleId];
|
|
49
49
|
const curCommonModule = window.__NeoCommonModules[moduleId];
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
|
|
51
|
+
if (curCommonModule && Object.keys(curCommonModule).length < 3) {
|
|
52
|
+
window.__NeoCommonModules[moduleId] = Object.assign(window.__NeoCommonModules[moduleId], curModule);
|
|
53
|
+
|
|
54
|
+
// 处理模块中的特殊属性
|
|
55
|
+
if (curModule.__esModule !== undefined) {
|
|
56
|
+
window.__NeoCommonModules[moduleId].__esModule = curModule.__esModule;
|
|
57
|
+
}
|
|
58
|
+
if (curModule.default !== undefined) {
|
|
59
|
+
window.__NeoCommonModules[moduleId].default = curModule.default;
|
|
60
|
+
}
|
|
52
61
|
} else {
|
|
53
62
|
window.__NeoCommonModules[moduleId] = curModule
|
|
54
63
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-custom-cmp-template",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "neo自定义组件模板(react&ts技术栈)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"自定义组件模板",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@commitlint/config-conventional": "^9.1.1",
|
|
48
48
|
"@types/react": "^16.9.11",
|
|
49
49
|
"@types/react-dom": "^16.9.15",
|
|
50
|
-
"neo-cmp-cli": "^1.2.
|
|
50
|
+
"neo-cmp-cli": "^1.2.2",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import './style.scss'; // 组件内容样式
|
|
3
3
|
// @ts-ignore
|
|
4
|
-
import ChartWidget from 'chart-widget'; // 另一个自定义组件导出的模块
|
|
4
|
+
// import ChartWidget from 'chart-widget'; // 另一个自定义组件导出的模块
|
|
5
5
|
|
|
6
6
|
interface InfoCardProps {
|
|
7
7
|
title: string;
|
|
@@ -65,7 +65,7 @@ export default class InfoCard extends React.PureComponent<InfoCardProps> {
|
|
|
65
65
|
</div>
|
|
66
66
|
)}
|
|
67
67
|
</div>
|
|
68
|
-
<ChartWidget
|
|
68
|
+
{/* <ChartWidget
|
|
69
69
|
chartType="line"
|
|
70
70
|
title="销售趋势"
|
|
71
71
|
subtitle="2025年数据"
|
|
@@ -80,7 +80,7 @@ export default class InfoCard extends React.PureComponent<InfoCardProps> {
|
|
|
80
80
|
},
|
|
81
81
|
],
|
|
82
82
|
}}
|
|
83
|
-
/>
|
|
83
|
+
/> */}
|
|
84
84
|
</div>
|
|
85
85
|
);
|
|
86
86
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echarts-custom-cmp-template",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"description": "neo自定义组件模板(react&ts技术栈)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"自定义组件模板",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@commitlint/config-conventional": "^9.1.1",
|
|
48
48
|
"@types/react": "^16.9.11",
|
|
49
49
|
"@types/react-dom": "^16.9.15",
|
|
50
|
-
"neo-cmp-cli": "^1.2.
|
|
50
|
+
"neo-cmp-cli": "^1.2.2",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5",
|
|
File without changes
|