neo-cmp-cli 1.1.5 → 1.1.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -41,7 +41,7 @@
41
41
  "url": "https://github.com/wibetter/neo-cmp-cli/issues"
42
42
  },
43
43
  "dependencies": {
44
- "akfun": "^5.1.10",
44
+ "akfun": "^5.1.12",
45
45
  "chalk": "^4.0.0",
46
46
  "deepmerge": "^4.2.2",
47
47
  "figlet": "^1.2.0",
@@ -51,7 +51,8 @@
51
51
  "webpack-sources": "^3.2.3",
52
52
  "yargs": "^12.0.2",
53
53
  "lodash": "^4.17.21",
54
- "external-remotes-plugin": "^1.0.0"
54
+ "external-remotes-plugin": "^1.0.0",
55
+ "babel-plugin-import": "^1.13.8"
55
56
  },
56
57
  "devDependencies": {
57
58
  "@commitlint/cli": "^8.3.5",
@@ -29,10 +29,13 @@ const defaultNEOConfig = {
29
29
  createDeclaration: false, // 打包时是否创建ts声明文件
30
30
  ignoreNodeModules: false, // 打包时是否忽略 node_modules
31
31
  allowList: [], // ignoreNodeModules为true时生效
32
- externals: [], // 从输出的 bundle 中排除依赖
32
+ externals: {}, // 从输出的 bundle 中排除依赖
33
33
  projectDir: ['src'],
34
34
  template: resolveByDirname('../initData/defaultTemplate.html'), // 默认使用neo-widget提供的页面模板(会启动页面设计器)
35
- sassResources: []
35
+ sassResources: [],
36
+ babelPlugins: [
37
+ ['import', { libraryName: 'antd', style: 'css' }], // 配置 antd 的样式按需引入
38
+ ],
36
39
  },
37
40
  envParams: {
38
41
  // 项目系统环境变量
@@ -6,4 +6,4 @@ const defaultNEOConfig = require('./default.config');
6
6
  const curProjectConfig = getConfigObj(resolve('neo.config.js'));
7
7
 
8
8
  // 备注:数组类型则直接覆盖
9
- module.exports = deepMergeConfig(defaultNEOConfig, curProjectConfig);
9
+ module.exports = deepMergeConfig(defaultNEOConfig, curProjectConfig);
@@ -1,5 +1,6 @@
1
1
  const akfun = require('akfun');
2
2
  const path = require('path');
3
+ const _ = require('lodash');
3
4
  const neoInit = require('./neoInit');
4
5
  const neoInitByCopy = require('./neoInitByCopy');
5
6
  const inspect = require('./inspect');
@@ -109,13 +110,13 @@ module.exports = {
109
110
  curConfig.webpack.plugins = [new AddNeoRequirePlugin()];
110
111
  }
111
112
 
112
- // 添加 externals 配置
113
+ // 添加 内置 Neo 的 externals 配置
113
114
  const neoExternals = getExternalsByNeoCommonModules();
114
115
  if (
115
116
  curConfig.dev.externals &&
116
- Array.isArray(curConfig.dev.externals)
117
+ _.isPlainObject(curConfig.dev.externals)
117
118
  ) {
118
- curConfig.dev.externals.push(...neoExternals);
119
+ curConfig.dev.externals = Object.assign(curConfig.dev.externals, neoExternals);
119
120
  } else {
120
121
  curConfig.dev.externals = neoExternals;
121
122
  }
@@ -212,15 +213,15 @@ module.exports = {
212
213
  curConfig.webpack.plugins = [new AddNeoRequirePlugin()];
213
214
  }
214
215
 
215
- // 添加 externals 配置
216
+ // 添加 内置 Neo 的 externals 配置
216
217
  const neoExternals = getExternalsByNeoCommonModules();
217
218
  if (
218
- curConfig.build2lib.externals &&
219
- Array.isArray(curConfig.build2lib.externals)
219
+ curConfig.dev.externals &&
220
+ _.isPlainObject(curConfig.dev.externals)
220
221
  ) {
221
- curConfig.build2lib.externals.push(...neoExternals);
222
+ curConfig.dev.externals = Object.assign(curConfig.dev.externals, neoExternals);
222
223
  } else {
223
- curConfig.build2lib.externals = neoExternals;
224
+ curConfig.dev.externals = neoExternals;
224
225
  }
225
226
 
226
227
  akfun.build('lib', curConfig, consoleTag, () => {
@@ -17,7 +17,7 @@ const NeoCommonModules = {
17
17
  };
18
18
 
19
19
  // 根据 Neo 共享出来的依赖模块,获取 externals 配置
20
- const getExternalsByNeoCommonModulesV1 = () => {
20
+ const getExternalsByNeoCommonModules = () => {
21
21
  const neoExternals = {};
22
22
  Object.keys(NeoCommonModules).forEach(moduleName => {
23
23
  neoExternals[moduleName] = `commonjs ${moduleName}`;
@@ -25,7 +25,8 @@ const getExternalsByNeoCommonModulesV1 = () => {
25
25
  return neoExternals;
26
26
  };
27
27
 
28
- const getExternalsByNeoCommonModules = () => {
28
+ // 数组方式的 externals 失效,需要使用对象方式的 externals
29
+ const getExternalsByNeoCommonModulesV2 = () => {
29
30
  return Object.keys(NeoCommonModules).map(moduleName => `commonjs ${moduleName}`);
30
31
  };
31
32
 
@@ -37,14 +37,14 @@
37
37
  "url": "https://github.com/wibetter/react-custom-cmp-template/issues"
38
38
  },
39
39
  "dependencies": {
40
- "neo-register": "^1.0.1",
40
+ "neo-register": "^1.0.2",
41
41
  "react": "^16.9.0",
42
42
  "react-dom": "^16.9.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@commitlint/cli": "^8.3.5",
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
- "neo-cmp-cli": "^1.1.2",
47
+ "neo-cmp-cli": "^1.1.7",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5"
@@ -73,6 +73,7 @@ module.exports = {
73
73
  },
74
74
  NODE_ENV: 'development',
75
75
  port: 80, // 设置基础端口,如果被占用则自动寻找可用端口
76
+ closeHotReload: true, // 是否关闭热更新
76
77
  assetsPublicPath: '/', // 设置静态资源的引用路径(根域名+路径)
77
78
  assetsSubDirectory: '',
78
79
  hostname: 'localhost',
@@ -37,7 +37,7 @@
37
37
  "url": "https://github.com/wibetter/react-ts-custom-cmp-template/issues"
38
38
  },
39
39
  "dependencies": {
40
- "neo-register": "^1.0.1",
40
+ "neo-register": "^1.0.2",
41
41
  "antd": "4.9.4",
42
42
  "react": "^16.9.0",
43
43
  "react-dom": "^16.9.0"
@@ -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.3",
50
+ "neo-cmp-cli": "^1.1.7",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- // import { Avatar } from 'antd';
3
- // import { UserOutlined } from '@ant-design/icons';
2
+ import { Avatar } from 'antd';
3
+ import { UserOutlined } from '@ant-design/icons';
4
4
  import './style.scss'; // 组件内容样式
5
5
 
6
6
  interface InfoCardProps {
@@ -43,7 +43,7 @@ export default class InfoCard extends React.PureComponent<InfoCardProps> {
43
43
  {title ||
44
44
  '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。'}
45
45
  {systemInfo.tenantName ? `【${systemInfo.tenantName}】` : ''}
46
- {/* <Avatar size={64} icon={<UserOutlined />} /> */}
46
+ <Avatar size={64} icon={<UserOutlined />} />
47
47
  </div>
48
48
  <div className="item-imgbox">
49
49
  {userInfo && userInfo.icon && (
@@ -59,7 +59,7 @@ export default class InfoCard extends React.PureComponent<InfoCardProps> {
59
59
  {imgCount > 0 && <div className="img-count">{imgCount}</div>}
60
60
  </div>
61
61
  <div className="news-info">
62
- <div className="left media-mark">NeoCRM · 低代码平台</div>
62
+ <div className="left media-mark">NeoCRM · 低代码平台111</div>
63
63
  {commentCount && commentCount > 0 && (
64
64
  <div className="cmt-num right">
65
65
  {this.agreeDataFormat(commentCount)}评
@@ -37,14 +37,14 @@
37
37
  "url": "https://github.com/wibetter/vue2-custom-cmp-template/issues"
38
38
  },
39
39
  "dependencies": {
40
- "neo-register": "^1.0.1",
40
+ "neo-register": "^1.0.2",
41
41
  "vue": "^2.6.14",
42
42
  "element-ui": "^2.15.12"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@commitlint/cli": "^8.3.5",
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
- "neo-cmp-cli": "^1.1.2",
47
+ "neo-cmp-cli": "^1.1.7",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5",