neo-cmp-cli 1.1.19 → 1.2.1

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.19",
3
+ "version": "1.2.1",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -69,10 +69,11 @@ const addNeoCommonModules = (modules) => {
69
69
  const moduleIds = Object.keys(modules);
70
70
  moduleIds.forEach((moduleId) => {
71
71
  const curModule = modules[moduleId];
72
- if (window.__NeoCommonModules[moduleId]) {
73
- window.__NeoCommonModules[moduleId] = Object.assign(window.__NeoCommonModules[moduleId], curModule);
72
+ const curCommonModule = window.__NeoCommonModules[moduleId];
73
+ if (curCommonModule && Object.keys(curCommonModule).length < 2) {
74
+ window.__NeoCommonModules[moduleId] = Object.assign(window.__NeoCommonModules[moduleId], curModule)
74
75
  } else {
75
- window.__NeoCommonModules[moduleId] = curModule;
76
+ window.__NeoCommonModules[moduleId] = curModule
76
77
  }
77
78
  });
78
79
  }
@@ -254,9 +254,10 @@ module.exports = {
254
254
  // 所有入口文件添加 commonModulesFile
255
255
  if (commonModulesFilePath && curConfig.build2lib.entry) {
256
256
  Object.keys(curConfig.build2lib.entry).forEach((name) => {
257
- curConfig.build2lib.entry[name] = [commonModulesFilePath].concat(
258
- curConfig.build2lib.entry[name]
259
- );
257
+ // 判断不是以Model结尾的文件
258
+ if (!name.endsWith('Model')) {
259
+ curConfig.build2lib.entry[name] = [commonModulesFilePath].concat(curConfig.build2lib.entry[name]);
260
+ }
260
261
  });
261
262
  }
262
263
 
@@ -43,15 +43,16 @@ const addNeoCommonModules = (modules) => {
43
43
  window.__NeoCommonModules = {}
44
44
  }
45
45
  if (isPlainObject(modules)) {
46
- const moduleIds = Object.keys(modules);
46
+ const moduleIds = Object.keys(modules)
47
47
  moduleIds.forEach((moduleId) => {
48
48
  const curModule = modules[moduleId];
49
- if (window.__NeoCommonModules[moduleId]) {
50
- window.__NeoCommonModules[moduleId] = Object.assign(window.__NeoCommonModules[moduleId], curModule);
49
+ const curCommonModule = window.__NeoCommonModules[moduleId];
50
+ if (curCommonModule && Object.keys(curCommonModule).length < 2) {
51
+ window.__NeoCommonModules[moduleId] = Object.assign(window.__NeoCommonModules[moduleId], curModule)
51
52
  } else {
52
- window.__NeoCommonModules[moduleId] = curModule;
53
+ window.__NeoCommonModules[moduleId] = curModule
53
54
  }
54
- });
55
+ })
55
56
  }
56
57
  }
57
58
 
@@ -38,13 +38,15 @@ module.exports = {
38
38
  // plugins: [],
39
39
  // babelPlugins: [],
40
40
  },
41
- // Neo 共享依赖模块
41
+ // 用于添加 Neo 共享依赖模块和剔除模块
42
+ /*
42
43
  neoCommonModule: {
43
- // neoExports: ['echarts'], // 自定义组件 共享出来的模块,支持数组和对象形式
44
- // neoExports: {}, // 对象写法
45
- neoExternals: ['chart-widget'], // 自定义组件 需要剔除的模块,仅支持数组写法
46
- remotes: ['chart-widget'], // 远程组件,表示当前自定义组件会用到远程组件的导出模块,需要和 neoExternals 配合使用
44
+ // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ // neoExports: { 'xxModule': path.resolve('./src/components/xxModule') }, // 对象写法
46
+ neoExternals: ['chart-widget'], // 自定义组件中需要剔除的模块,仅支持数组写法
47
+ remotes: ['chart-widget'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
47
48
  },
49
+ */
48
50
  preview: {
49
51
  // 用于开启本地预览模式的相关配置信息
50
52
  /*
@@ -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.19",
50
+ "neo-cmp-cli": "^1.2.1",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -39,14 +39,17 @@ module.exports = {
39
39
  // babelPlugins: [],
40
40
  },
41
41
  // 用于添加 Neo 共享依赖模块的配置信息
42
+ ///*
42
43
  neoCommonModule: {
43
- // neoExports: [], // 自定义组件 共享出来的模块,支持数组和对象形式
44
- neoExports: {
44
+ // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ neoExports: { // 对象写法
45
46
  'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
46
47
  'neo-register': 'neo-register', // 导出 Neo 注册模块
47
48
  },
48
- // neoExternals: [], // 自定义组件 需要剔除的模块,仅支持数组写法
49
+ // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
50
+ // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
49
51
  },
52
+ //*/
50
53
  preview: {
51
54
  // 用于开启本地预览模式的相关配置信息
52
55
  /*
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echarts-custom-cmp-template",
3
- "version": "1.1.3",
3
+ "version": "1.1.6",
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.19",
50
+ "neo-cmp-cli": "^1.2.1",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5",
@@ -38,6 +38,18 @@ module.exports = {
38
38
  // plugins: [],
39
39
  // babelPlugins: [],
40
40
  },
41
+ // 用于添加 Neo 共享依赖模块的配置信息
42
+ /*
43
+ neoCommonModule: {
44
+ // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ neoExports: { // 对象写法
46
+ 'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
47
+ 'neo-register': 'neo-register', // 导出 Neo 注册模块
48
+ },
49
+ // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
50
+ // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
51
+ },
52
+ */
41
53
  preview: {
42
54
  // 用于开启本地预览模式的相关配置信息
43
55
  /*
@@ -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.19",
51
+ "neo-cmp-cli": "^1.2.1",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5"
@@ -42,6 +42,18 @@ module.exports = {
42
42
  },
43
43
  moduleRules: [],
44
44
  },
45
+ // 用于添加 Neo 共享依赖模块的配置信息
46
+ /*
47
+ neoCommonModule: {
48
+ // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
49
+ neoExports: { // 对象写法
50
+ 'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
51
+ 'neo-register': 'neo-register', // 导出 Neo 注册模块
52
+ },
53
+ // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
54
+ // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
55
+ },
56
+ */
45
57
  preview: {
46
58
  // 用于开启本地预览模式的相关配置信息
47
59
  /*
@@ -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.19",
47
+ "neo-cmp-cli": "^1.2.1",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5"
@@ -38,6 +38,18 @@ module.exports = {
38
38
  // plugins: [],
39
39
  // babelPlugins: [],
40
40
  },
41
+ // 用于添加 Neo 共享依赖模块的配置信息
42
+ /*
43
+ neoCommonModule: {
44
+ // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
+ neoExports: { // 对象写法
46
+ 'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
47
+ 'neo-register': 'neo-register', // 导出 Neo 注册模块
48
+ },
49
+ // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
50
+ // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
51
+ },
52
+ */
41
53
  preview: {
42
54
  // 用于开启本地预览模式的相关配置信息
43
55
  /*
@@ -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.19",
49
+ "neo-cmp-cli": "^1.2.1",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.5"
@@ -47,6 +47,18 @@ module.exports = {
47
47
  // moduleRules: [], // 自定义webpack loader
48
48
  // babelPlugins: [],
49
49
  },
50
+ // 用于添加 Neo 共享依赖模块的配置信息
51
+ /*
52
+ neoCommonModule: {
53
+ // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
54
+ neoExports: { // 对象写法
55
+ 'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
56
+ 'neo-register': 'neo-register', // 导出 Neo 注册模块
57
+ },
58
+ // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
59
+ // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
60
+ },
61
+ */
50
62
  preview: {
51
63
  // 用于开启本地预览模式的相关配置信息
52
64
  /*
@@ -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.19",
47
+ "neo-cmp-cli": "^1.2.1",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5",