neo-cmp-cli 1.1.16 → 1.1.18

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
@@ -24,9 +24,9 @@ yarn global add neo-cmp-cli
24
24
  # 或
25
25
  npm i -g neo-cmp-cli
26
26
  ```
27
- 2) 创建项目(默认 React+TS,可用 -t 指定模板,--name 指定项目名)
27
+ 2) 创建项目(默认 React+TS,可用 -t 指定模板,-n 指定项目名)
28
28
  ```bash
29
- neo init -t=react&ts
29
+ neo init -t=react-ts
30
30
  ```
31
31
  3) 安装依赖并运行
32
32
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -60,15 +60,24 @@ import { isPlainObject } from 'lodash';
60
60
  const CustomCmpCommonModules = ${customCmpCommonModulesCode};
61
61
  const CustomCmpRemotes = ${JSON.stringify(CustomCmpRemotes)};
62
62
 
63
+ // 用于添加共享的依赖模块
63
64
  // 用于添加共享的依赖模块
64
65
  const addNeoCommonModules = (modules) => {
65
66
  if (!window.__NeoCommonModules) {
66
- window.__NeoCommonModules = {};
67
+ window.__NeoCommonModules = {}
67
68
  }
68
69
  if (isPlainObject(modules)) {
69
- window.__NeoCommonModules = Object.assign(window.__NeoCommonModules, modules)
70
+ const moduleIds = Object.keys(modules);
71
+ moduleIds.forEach((moduleId) => {
72
+ const curModule = modules[moduleId];
73
+ if (window.__NeoCommonModules[moduleId]) {
74
+ window.__NeoCommonModules[moduleId] = Object.assign(window.__NeoCommonModules[moduleId], curModule);
75
+ } else {
76
+ window.__NeoCommonModules[moduleId] = curModule;
77
+ }
78
+ });
70
79
  }
71
- };
80
+ }
72
81
 
73
82
  // 用于添加自定义组件的远程组件(关联使用)
74
83
  const addNeoRemotes = (remotes) => {
@@ -38,14 +38,7 @@ const getExternalsByNeoCommonModules = (cmpNeoExternals) => {
38
38
  };
39
39
 
40
40
  // 用于添加共享的依赖模块
41
- const addNeoCommonModules = (modules) => {
42
- if (!window.__NeoCommonModules) {
43
- window.__NeoCommonModules = {}
44
- }
45
- if (_.isPlainObject(modules)) {
46
- window.__NeoCommonModules = Object.assign(window.__NeoCommonModules, modules);
47
- }
48
- }
41
+ addNeoCommonModules
49
42
 
50
43
  // 用于添加自定义组件的远程组件
51
44
  const addNeoRemotes = (remotes) => {
@@ -42,8 +42,8 @@ module.exports = {
42
42
  neoCommonModule: {
43
43
  // neoExports: ['echarts'], // 自定义组件 共享出来的模块,支持数组和对象形式
44
44
  // neoExports: {}, // 对象写法
45
- // neoExternals: ['neo-register', 'chart-widget'], // 自定义组件 需要剔除的模块,仅支持数组写法
46
- // remotes: ['chart-widget'], // 远程组件,表示当前自定义组件会用到远程组件的导出模块,需要和 neoExternals 配合使用
45
+ neoExternals: ['chart-widget'], // 自定义组件 需要剔除的模块,仅支持数组写法
46
+ remotes: ['chart-widget'], // 远程组件,表示当前自定义组件会用到远程组件的导出模块,需要和 neoExternals 配合使用
47
47
  },
48
48
  preview: {
49
49
  // 用于开启本地预览模式的相关配置信息
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-custom-cmp-template",
3
- "version": "1.1.0",
3
+ "version": "1.1.5",
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.1.16",
50
+ "neo-cmp-cli": "^1.1.18",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -1,9 +1,7 @@
1
1
  import * as React from 'react';
2
- import { Avatar } from 'antd';
3
- import { UserOutlined } from '@ant-design/icons';
4
2
  import './style.scss'; // 组件内容样式
5
3
  // @ts-ignore
6
- // import ChartWidget from 'chart-widget'; // 另一个自定义组件导出的模块
4
+ import ChartWidget from 'chart-widget'; // 另一个自定义组件导出的模块
7
5
 
8
6
  interface InfoCardProps {
9
7
  title: string;
@@ -45,7 +43,6 @@ export default class InfoCard extends React.PureComponent<InfoCardProps> {
45
43
  {title ||
46
44
  '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。'}
47
45
  {systemInfo.tenantName ? `【${systemInfo.tenantName}】` : ''}
48
- <Avatar size={64} icon={<UserOutlined />} />
49
46
  </div>
50
47
  <div className="item-imgbox">
51
48
  {userInfo && userInfo.icon && (
@@ -68,7 +65,6 @@ export default class InfoCard extends React.PureComponent<InfoCardProps> {
68
65
  </div>
69
66
  )}
70
67
  </div>
71
- {/*
72
68
  <ChartWidget
73
69
  chartType="line"
74
70
  title="销售趋势"
@@ -85,7 +81,6 @@ export default class InfoCard extends React.PureComponent<InfoCardProps> {
85
81
  ],
86
82
  }}
87
83
  />
88
- */}
89
84
  </div>
90
85
  );
91
86
  }
@@ -39,7 +39,6 @@ module.exports = {
39
39
  // babelPlugins: [],
40
40
  },
41
41
  // 用于添加 Neo 共享依赖模块的配置信息
42
- /*
43
42
  neoCommonModule: {
44
43
  // neoExports: [], // 自定义组件 共享出来的模块,支持数组和对象形式
45
44
  neoExports: {
@@ -48,7 +47,6 @@ module.exports = {
48
47
  },
49
48
  // neoExternals: [], // 自定义组件 需要剔除的模块,仅支持数组写法
50
49
  },
51
- */
52
50
  preview: {
53
51
  // 用于开启本地预览模式的相关配置信息
54
52
  /*
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echarts-custom-cmp-template",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
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.1.16",
50
+ "neo-cmp-cli": "^1.1.18",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5",
@@ -48,7 +48,7 @@
48
48
  "@types/react": "^16.9.11",
49
49
  "@types/react-dom": "^16.9.15",
50
50
  "@types/axios": "^0.14.0",
51
- "neo-cmp-cli": "^1.1.16",
51
+ "neo-cmp-cli": "^1.1.18",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5"
@@ -44,7 +44,7 @@
44
44
  "devDependencies": {
45
45
  "@commitlint/cli": "^8.3.5",
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
- "neo-cmp-cli": "^1.1.16",
47
+ "neo-cmp-cli": "^1.1.18",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "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.1.16",
49
+ "neo-cmp-cli": "^1.1.18",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.5"
@@ -44,7 +44,7 @@
44
44
  "devDependencies": {
45
45
  "@commitlint/cli": "^8.3.5",
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
- "neo-cmp-cli": "^1.1.16",
47
+ "neo-cmp-cli": "^1.1.18",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5",