neo-cmp-cli 1.7.3 → 1.7.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/README.md CHANGED
@@ -470,29 +470,29 @@ module.exports = {
470
470
 
471
471
  ### 11) 自定义组件之间实现模块共享
472
472
 
473
- 步骤1:在自定义组件A(cmpType:neo-custom-cmpA)/ 配置文件中定义要共享出来的模块A(xxModule_A
473
+ 步骤1:在自定义组件A(customCmpA)/ 配置文件中定义要共享出来的模块A(xxModuleA
474
474
  ```javascript
475
475
  module.exports = {
476
476
  neoCommonModule: {
477
477
  // exports: ['xxModule'], // 数组写法,用于导出当前自定义组件中的第三方依赖模块
478
- exports: { 'xxModule_A': path.resolve('./src/components/xxModule_A') }, // 对象写法,可用于导出自定义组件中的某个内容模块(需要使用绝对路径导出)
478
+ exports: { 'xxModuleA': path.resolve('./src/components/xxModuleA') }, // 对象写法,可用于导出自定义组件中的某个内容模块(需要使用绝对路径导出)
479
479
  },
480
480
  }
481
481
  ```
482
482
 
483
- 步骤2:在自定义组件B(cmpType:neo-custom-cmpB)/ 配置文件中 声明需要使用 自定义组件 A 分享出来的模块(xxModule_A)
483
+ 步骤2:在自定义组件B(customCmpB)/ 配置文件中 声明需要使用 自定义组件 A 分享出来的模块(xxModule_A)
484
484
  ```javascript
485
485
  module.exports = {
486
486
  neoCommonModule: {
487
- remoteDeps: ['neo-custom-cmpA'], // 远程依赖(自定义组件),表示当前自定义组件 B 会用到哪些自定义组件
488
- externals: ['xxModule_A'], // 自定义组件中需要剔除的外部模块(远程自定义组件中分享出来的模块),仅支持数组写法,需要和 remoteDeps 配合使用
487
+ remoteDeps: ['customCmpA'], // 远程依赖(自定义组件),表示当前自定义组件 B 会用到哪些自定义组件
488
+ externals: ['xxModuleA'], // 自定义组件中需要剔除的外部模块(远程自定义组件中分享出来的模块),仅支持数组写法,需要和 remoteDeps 配合使用
489
489
  },
490
490
  }
491
491
  ```
492
492
 
493
- 步骤3:在自定义组件B 源码中使用 自定义组件 A 分享出来的模块(xxModule_A
493
+ 步骤3:在自定义组件B 中使用 自定义组件 A 分享出来的模块(xxModuleA
494
494
  ```javascript
495
- import ChartWidget from 'chart-widget'; // 导入自定义组件 A 共享出来的模块
495
+ import xxModuleA from 'xxModuleA'; // 导入自定义组件 A 共享出来的模块
496
496
  ```
497
497
 
498
498
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -48,7 +48,7 @@
48
48
  "@commitlint/config-conventional": "^9.1.1",
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
- "neo-cmp-cli": "^1.7.3",
51
+ "neo-cmp-cli": "^1.7.5",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5"
@@ -48,7 +48,7 @@
48
48
  "@commitlint/config-conventional": "^9.1.1",
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
- "neo-cmp-cli": "^1.7.3",
51
+ "neo-cmp-cli": "^1.7.5",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5",
@@ -46,7 +46,7 @@
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
47
  "@types/react": "^16.9.11",
48
48
  "@types/react-dom": "^16.9.15",
49
- "neo-cmp-cli": "^1.7.3",
49
+ "neo-cmp-cli": "^1.7.5",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.5"
@@ -52,7 +52,7 @@
52
52
  "@types/react": "^16.9.11",
53
53
  "@types/react-dom": "^16.9.15",
54
54
  "@types/axios": "^0.14.0",
55
- "neo-cmp-cli": "^1.7.3",
55
+ "neo-cmp-cli": "^1.7.5",
56
56
  "husky": "^4.2.5",
57
57
  "lint-staged": "^10.2.9",
58
58
  "prettier": "^2.0.5"
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
- "neo-cmp-cli": "^1.7.3",
48
+ "neo-cmp-cli": "^1.7.5",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5"
@@ -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.7.3",
50
+ "neo-cmp-cli": "^1.7.5",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
- "neo-cmp-cli": "^1.7.3",
48
+ "neo-cmp-cli": "^1.7.5",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5",
@@ -113,6 +113,12 @@ function formatConfigObject(obj, indent = 0, fileDir = '') {
113
113
  * @param {*} cmpZipUrl 自定义组件源码文件地址(zip包地址)
114
114
  * @param {*} cmpName 自定义组件名称
115
115
  * @param {*} componentBaseDir 自定义组件目录
116
+ *
117
+ * 拉取线上自定义组件源码 规则:
118
+ * 1、对于 组件源码中 src/components 中的所有文件 copy 至 当前项目 src/components,非覆盖式(copy 前判断是否存在);
119
+ * 2、对于 组件源码中的 配置文件(neo.config.js)内容 和 当前项目配置 进行 非覆盖式 merge 处理;
120
+ * 3、对于 组件源码中的 tsconfig.json 文件内容 和 当前项目 tsconfig  进行 非覆盖式 merge 处理;
121
+ * 4、对于 组件源码中的 package.json 文件内容 和 当前项目 package.json  进行 非覆盖式 merge 处理,并识别新增 依赖,提示用户 重新安装依赖
116
122
  */
117
123
  module.exports = async function (cmpZipUrl, cmpName, componentBaseDir = './src/components') {
118
124
  const finalCmpName = cmpName;