neo-cmp-cli 1.8.6-beta.2 → 1.8.6-beta.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.
Files changed (154) hide show
  1. package/dist/_virtual/AddNeoRequirePlugin.js +8 -0
  2. package/dist/_virtual/OverloadYield.js +5 -0
  3. package/dist/_virtual/_commonjsHelpers.js +40 -0
  4. package/dist/_virtual/array-set.js +5 -0
  5. package/dist/_virtual/base64-vlq.js +5 -0
  6. package/dist/_virtual/base64.js +5 -0
  7. package/dist/_virtual/binary-search.js +5 -0
  8. package/dist/_virtual/createCmpByZip.js +8 -0
  9. package/dist/_virtual/deleteCmp.js +8 -0
  10. package/dist/_virtual/index.js +9 -0
  11. package/dist/_virtual/mapping-list.js +5 -0
  12. package/dist/_virtual/neoLogin.js +8 -0
  13. package/dist/_virtual/neoService.js +8 -0
  14. package/dist/_virtual/openProject.js +8 -0
  15. package/dist/_virtual/publish2oss.js +8 -0
  16. package/dist/_virtual/pullCmp.js +8 -0
  17. package/dist/_virtual/pushCmp.js +8 -0
  18. package/dist/_virtual/quick-sort.js +5 -0
  19. package/dist/_virtual/regenerator.js +5 -0
  20. package/dist/_virtual/regeneratorAsync.js +5 -0
  21. package/dist/_virtual/regeneratorAsyncGen.js +5 -0
  22. package/dist/_virtual/regeneratorAsyncIterator.js +5 -0
  23. package/dist/_virtual/regeneratorDefine.js +5 -0
  24. package/dist/_virtual/regeneratorKeys.js +5 -0
  25. package/dist/_virtual/regeneratorRuntime.js +5 -0
  26. package/dist/_virtual/regeneratorValues.js +5 -0
  27. package/dist/_virtual/source-map-consumer.js +5 -0
  28. package/dist/_virtual/source-map-generator.js +5 -0
  29. package/dist/_virtual/source-map-support.js +5 -0
  30. package/dist/_virtual/source-map.js +5 -0
  31. package/dist/_virtual/source-node.js +5 -0
  32. package/dist/_virtual/typeof.js +5 -0
  33. package/dist/_virtual/typescript.js +5 -0
  34. package/dist/_virtual/util.js +5 -0
  35. package/dist/config/auth.config.js +50 -0
  36. package/dist/config/default.config.js +225 -0
  37. package/dist/config/index.js +27 -0
  38. package/dist/main.js +9 -0
  39. package/dist/main2.js +261 -0
  40. package/dist/module/inspect.js +64 -0
  41. package/dist/module/neoInit.js +69 -0
  42. package/dist/module/neoInitByCopy.js +81 -0
  43. package/dist/neo/neoLogin.js +663 -0
  44. package/dist/neo/neoRequire.js +118 -0
  45. package/dist/neo/neoService.js +1246 -0
  46. package/dist/node_modules/@babel/runtime/helpers/OverloadYield.js +19 -0
  47. package/dist/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +29 -0
  48. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
  49. package/dist/node_modules/@babel/runtime/helpers/regenerator.js +105 -0
  50. package/dist/node_modules/@babel/runtime/helpers/regeneratorAsync.js +24 -0
  51. package/dist/node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js +23 -0
  52. package/dist/node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js +50 -0
  53. package/dist/node_modules/@babel/runtime/helpers/regeneratorDefine.js +37 -0
  54. package/dist/node_modules/@babel/runtime/helpers/regeneratorKeys.js +25 -0
  55. package/dist/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +98 -0
  56. package/dist/node_modules/@babel/runtime/helpers/regeneratorValues.js +35 -0
  57. package/dist/node_modules/@babel/runtime/helpers/typeof.js +25 -0
  58. package/dist/node_modules/@babel/runtime/regenerator/index.js +29 -0
  59. package/dist/node_modules/buffer-from/index.js +57 -0
  60. package/dist/node_modules/source-map/lib/array-set.js +134 -0
  61. package/dist/node_modules/source-map/lib/base64-vlq.js +144 -0
  62. package/dist/node_modules/source-map/lib/base64.js +81 -0
  63. package/dist/node_modules/source-map/lib/binary-search.js +122 -0
  64. package/dist/node_modules/source-map/lib/mapping-list.js +94 -0
  65. package/dist/node_modules/source-map/lib/quick-sort.js +126 -0
  66. package/dist/node_modules/source-map/lib/source-map-consumer.js +1018 -0
  67. package/dist/node_modules/source-map/lib/source-map-generator.js +385 -0
  68. package/dist/node_modules/source-map/lib/source-node.js +400 -0
  69. package/dist/node_modules/source-map/lib/util.js +449 -0
  70. package/dist/node_modules/source-map/source-map.js +25 -0
  71. package/dist/node_modules/source-map-support/source-map-support.js +610 -0
  72. package/dist/node_modules/typescript/lib/typescript.js +22376 -0
  73. package/dist/oss/publish2oss.js +378 -0
  74. package/dist/plugins/AddNeoRequirePlugin.js +178 -0
  75. package/dist/utils/autoEntryRootDir.js +98 -0
  76. package/dist/utils/cmpUtils/createCmpByTemplate.js +73 -0
  77. package/dist/utils/cmpUtils/createCmpByZip.js +530 -0
  78. package/dist/utils/cmpUtils/createCommonModulesCode.js +84 -0
  79. package/dist/utils/cmpUtils/deleteCmp.js +98 -0
  80. package/dist/utils/cmpUtils/getCmpModelRegisterCode.js +38 -0
  81. package/dist/utils/cmpUtils/getCmpPreviewCode.js +37 -0
  82. package/dist/utils/cmpUtils/getCmpRegisterCode.js +38 -0
  83. package/dist/utils/cmpUtils/getCmpTypeByDir.js +58 -0
  84. package/dist/utils/cmpUtils/hasCmpTypeByDir.js +25 -0
  85. package/dist/utils/cmpUtils/previewCmp.js +74 -0
  86. package/dist/utils/cmpUtils/pullCmp.js +144 -0
  87. package/dist/utils/cmpUtils/pushCmp.js +290 -0
  88. package/dist/utils/common.js +121 -0
  89. package/dist/utils/configureNeoBuild.js +153 -0
  90. package/dist/utils/generateEntries.js +73 -0
  91. package/dist/utils/neoConfigInit.js +25 -0
  92. package/dist/utils/neoParams.js +23 -0
  93. package/dist/utils/pathUtils.js +48 -0
  94. package/dist/utils/projectNameValidator.js +89 -0
  95. package/dist/utils/projectUtils/createCmpProjectByTemplate.js +74 -0
  96. package/dist/utils/projectUtils/createCmpProjectZip.js +135 -0
  97. package/dist/utils/projectUtils/getEntries.js +99 -0
  98. package/dist/utils/projectUtils/getEntriesWithAutoRegister.js +127 -0
  99. package/dist/utils/projectUtils/hasNeoProject.js +31 -0
  100. package/dist/utils/projectUtils/openProject.js +168 -0
  101. package/dist/utils/projectUtils/updatePublishLog.js +45 -0
  102. package/dist/utils/replaceInFilesByMap.js +70 -0
  103. package/dist/utils/replaceInPackage.js +151 -0
  104. package/dist/utils/resetPackageVersion.js +134 -0
  105. package/package.json +2 -2
  106. package/src/config/auth.config.js +0 -27
  107. package/src/config/default.config.js +0 -176
  108. package/src/config/index.js +0 -9
  109. package/src/initData/defaultTemplate.html +0 -13
  110. package/src/initData/neo.config.js +0 -138
  111. package/src/module/inspect.js +0 -41
  112. package/src/module/neoInit.js +0 -55
  113. package/src/module/neoInitByCopy.js +0 -61
  114. package/src/neo/NeoUMDContent.js +0 -30
  115. package/src/neo/neoLogin.js +0 -565
  116. package/src/neo/neoRequire.js +0 -125
  117. package/src/neo/neoService.js +0 -874
  118. package/src/neo/webpack.mf.js +0 -60
  119. package/src/neo/wrapperContent.js +0 -16
  120. package/src/oss/publish2oss.js +0 -348
  121. package/src/plugins/AddNeoRequirePlugin-v1.js +0 -47
  122. package/src/plugins/AddNeoRequirePlugin.js +0 -179
  123. package/src/plugins/README.md +0 -109
  124. package/src/utils/autoEntryRootDir.js +0 -85
  125. package/src/utils/cmpUtils/createCmpByTemplate.js +0 -60
  126. package/src/utils/cmpUtils/createCmpByZip.js +0 -408
  127. package/src/utils/cmpUtils/createCommonModulesCode.js +0 -121
  128. package/src/utils/cmpUtils/deleteCmp.js +0 -63
  129. package/src/utils/cmpUtils/getCmpModelRegisterCode.js +0 -31
  130. package/src/utils/cmpUtils/getCmpPreviewCode.js +0 -43
  131. package/src/utils/cmpUtils/getCmpRegisterCode.js +0 -31
  132. package/src/utils/cmpUtils/getCmpTypeByDir.js +0 -41
  133. package/src/utils/cmpUtils/hasCmpTypeByDir.js +0 -11
  134. package/src/utils/cmpUtils/previewCmp.js +0 -55
  135. package/src/utils/cmpUtils/pullCmp.js +0 -104
  136. package/src/utils/cmpUtils/pushCmp.js +0 -230
  137. package/src/utils/common.js +0 -107
  138. package/src/utils/configureNeoBuild.js +0 -109
  139. package/src/utils/generateEntries.js +0 -63
  140. package/src/utils/neoConfigInit.js +0 -13
  141. package/src/utils/neoParams.js +0 -12
  142. package/src/utils/pathUtils.js +0 -23
  143. package/src/utils/projectNameValidator.js +0 -76
  144. package/src/utils/projectUtils/createCmpProjectByTemplate.js +0 -59
  145. package/src/utils/projectUtils/createCmpProjectZip.js +0 -120
  146. package/src/utils/projectUtils/getEntries.js +0 -80
  147. package/src/utils/projectUtils/getEntriesWithAutoRegister.js +0 -108
  148. package/src/utils/projectUtils/hasNeoProject.js +0 -17
  149. package/src/utils/projectUtils/openProject.js +0 -94
  150. package/src/utils/projectUtils/updatePublishLog.js +0 -30
  151. package/src/utils/replaceInFiles.js +0 -47
  152. package/src/utils/replaceInFilesByMap.js +0 -54
  153. package/src/utils/replaceInPackage.js +0 -134
  154. package/src/utils/resetPackageVersion.js +0 -115
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var AddNeoRequirePlugin = require('../plugins/AddNeoRequirePlugin.js');
5
+
6
+ var require$$1 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(AddNeoRequirePlugin);
7
+
8
+ module.exports = require$$1;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var OverloadYield = {exports: {}};
4
+
5
+ exports.__module = OverloadYield;
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
+
5
+ function getDefaultExportFromCjs (x) {
6
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
+ }
8
+
9
+ function getAugmentedNamespace(n) {
10
+ if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
11
+ var f = n.default;
12
+ if (typeof f == "function") {
13
+ var a = function a () {
14
+ var isInstance = false;
15
+ try {
16
+ isInstance = this instanceof a;
17
+ } catch {}
18
+ if (isInstance) {
19
+ return Reflect.construct(f, arguments, this.constructor);
20
+ }
21
+ return f.apply(this, arguments);
22
+ };
23
+ a.prototype = f.prototype;
24
+ } else a = {};
25
+ Object.defineProperty(a, '__esModule', {value: true});
26
+ Object.keys(n).forEach(function (k) {
27
+ var d = Object.getOwnPropertyDescriptor(n, k);
28
+ Object.defineProperty(a, k, d.get ? d : {
29
+ enumerable: true,
30
+ get: function () {
31
+ return n[k];
32
+ }
33
+ });
34
+ });
35
+ return a;
36
+ }
37
+
38
+ exports.commonjsGlobal = commonjsGlobal;
39
+ exports.getAugmentedNamespace = getAugmentedNamespace;
40
+ exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var arraySet = {};
4
+
5
+ exports.__exports = arraySet;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var base64Vlq = {};
4
+
5
+ exports.__exports = base64Vlq;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var base64 = {};
4
+
5
+ exports.__exports = base64;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var binarySearch = {};
4
+
5
+ exports.__exports = binarySearch;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var createCmpByZip = require('../utils/cmpUtils/createCmpByZip.js');
5
+
6
+ var require$$7 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(createCmpByZip);
7
+
8
+ module.exports = require$$7;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var deleteCmp = require('../utils/cmpUtils/deleteCmp.js');
5
+
6
+ var require$$15 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(deleteCmp);
7
+
8
+ module.exports = require$$15;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var index = require('../node_modules/@babel/runtime/regenerator/index.js');
5
+
6
+ var regeneratorExports = index.__require();
7
+ var _regeneratorRuntime = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(regeneratorExports);
8
+
9
+ module.exports = _regeneratorRuntime;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var mappingList = {};
4
+
5
+ exports.__exports = mappingList;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var neoLogin = require('../neo/neoLogin.js');
5
+
6
+ var require$$22 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(neoLogin);
7
+
8
+ module.exports = require$$22;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var neoService = require('../neo/neoService.js');
5
+
6
+ var require$$21 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(neoService);
7
+
8
+ module.exports = require$$21;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var openProject = require('../utils/projectUtils/openProject.js');
5
+
6
+ var require$$16 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(openProject);
7
+
8
+ module.exports = require$$16;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var publish2oss = require('../oss/publish2oss.js');
5
+
6
+ var require$$8 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(publish2oss);
7
+
8
+ module.exports = require$$8;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var pullCmp = require('../utils/cmpUtils/pullCmp.js');
5
+
6
+ var require$$14 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(pullCmp);
7
+
8
+ module.exports = require$$14;
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_commonjsHelpers.js');
4
+ var pushCmp = require('../utils/cmpUtils/pushCmp.js');
5
+
6
+ var require$$9 = /*@__PURE__*/_commonjsHelpers.getAugmentedNamespace(pushCmp);
7
+
8
+ module.exports = require$$9;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var quickSort = {};
4
+
5
+ exports.__exports = quickSort;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var regenerator = {exports: {}};
4
+
5
+ exports.__module = regenerator;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var regeneratorAsync = {exports: {}};
4
+
5
+ exports.__module = regeneratorAsync;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var regeneratorAsyncGen = {exports: {}};
4
+
5
+ exports.__module = regeneratorAsyncGen;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var regeneratorAsyncIterator = {exports: {}};
4
+
5
+ exports.__module = regeneratorAsyncIterator;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var regeneratorDefine = {exports: {}};
4
+
5
+ exports.__module = regeneratorDefine;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var regeneratorKeys = {exports: {}};
4
+
5
+ exports.__module = regeneratorKeys;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var regeneratorRuntime = {exports: {}};
4
+
5
+ exports.__module = regeneratorRuntime;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var regeneratorValues = {exports: {}};
4
+
5
+ exports.__module = regeneratorValues;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var sourceMapConsumer = {};
4
+
5
+ exports.__exports = sourceMapConsumer;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var sourceMapGenerator = {};
4
+
5
+ exports.__exports = sourceMapGenerator;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var sourceMapSupport = {exports: {}};
4
+
5
+ exports.__module = sourceMapSupport;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var sourceMap = {};
4
+
5
+ exports.__exports = sourceMap;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var sourceNode = {};
4
+
5
+ exports.__exports = sourceNode;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var _typeof = {exports: {}};
4
+
5
+ exports.__module = _typeof;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var typescript = {exports: {}};
4
+
5
+ exports.__module = typescript;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var util = {};
4
+
5
+ exports.__exports = util;
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index.js');
4
+
5
+ var auth_config;
6
+ var hasRequiredAuth_config;
7
+
8
+ function requireAuth_config () {
9
+ if (hasRequiredAuth_config) return auth_config;
10
+ hasRequiredAuth_config = 1;
11
+ var curConfig = index.__require(); // 获取当前项目根目录下的配置文件
12
+
13
+ var neoConfig = curConfig.neoConfig || {};
14
+ // const authConfig = neoConfig.auth || {};
15
+
16
+ // NeoCRM 跨 Pod 授权配置
17
+ auth_config = {
18
+ loginURL: neoConfig.loginURL || 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth',
19
+ // 登录 URL,从创建连接器的客户端信息中获取(Login_Url)
20
+ tokenAPI: neoConfig.tokenAPI || 'https://login-cd.xiaoshouyi.com/auc/oauth2/token',
21
+ // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
22
+ redirectUri: neoConfig.redirectUri || 'http://localhost:1028',
23
+ // 固定端口号,用于接收授权码
24
+ // 重定向 URI,动态生成
25
+ getRedirectURI: function getRedirectURI(port) {
26
+ return "http://localhost:" + port;
27
+ },
28
+ // 获取 授权码 相关配置
29
+ response_type: 'code',
30
+ // 认证类型;此参数值必须为 code
31
+ // client_id: authConfig.client_id || '04c8b45c4dbe36426a660bf70d3fe3e7', // 客户端 ID,跨 Pod 级链接器【内置】
32
+ client_id: '04c8b45c4dbe36426a660bf70d3fe3e7',
33
+ // 客户端 ID,跨 Pod 级链接器【内置】
34
+ scope: 'all',
35
+ // 固定值:all
36
+ oauthType: 'standard',
37
+ // 固定值:standard
38
+ access_type: 'offline',
39
+ // 此参数值为 online 时,不产生 refresh_token ;此参数值为 offline 时,返回refresh_token
40
+
41
+ // 获取 令牌 相关配置
42
+ // client_secret: authConfig.client_secret || '370817d1336a3737f95c671eea39a23b', // 客户端秘钥,跨 Pod 级链接器【内置】
43
+ client_secret: '370817d1336a3737f95c671eea39a23b',
44
+ // 客户端秘钥,跨 Pod 级链接器【内置】
45
+ grant_type: 'authorization_code' // 授权类型;此参数值必须为 authorization_code
46
+ };
47
+ return auth_config;
48
+ }
49
+
50
+ exports.__require = requireAuth_config;
@@ -0,0 +1,225 @@
1
+ 'use strict';
2
+
3
+ var require$$0 = require('akfun');
4
+ var require$$1 = require('node:path');
5
+
6
+ var default_config;
7
+ var hasRequiredDefault_config;
8
+
9
+ function requireDefault_config () {
10
+ if (hasRequiredDefault_config) return default_config;
11
+ hasRequiredDefault_config = 1;
12
+
13
+ // 统一路径解析:
14
+ var _require = require$$0,
15
+ resolve = _require.resolve;
16
+ var path = require$$1; // 以命令执行目录为根目录
17
+
18
+ // 当前neo的路径解析(用于获取neo-cmp-cli本身的文件地址)
19
+ function resolveByDirname(dir) {
20
+ return path.resolve(__dirname, dir);
21
+ }
22
+
23
+ /**
24
+ * 脚手架赋予当前项目的默认配置
25
+ */
26
+ var defaultNEOConfig = {
27
+ settings: {
28
+ enableESLint: false,
29
+ // 是否开启ESLint,默认开启ESLint检测代码格式
30
+ enableESLintFix: false,
31
+ // 是否ESLint自动修正代码格式
32
+ enableStyleLint: false,
33
+ // 是否开启StyleLint,默认开启ESLint检测代码格式
34
+ enableStyleLintFix: false // 是否需要StyleLint自动修正代码格式
35
+ },
36
+ webpack: {
37
+ resolve: {
38
+ // webpack的resolve配置
39
+ extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue', '.min.js', '.json'],
40
+ // 用于配置webpack在尝试过程中用到的后缀列表
41
+ alias: {
42
+ '@': resolve('src')
43
+ }
44
+ },
45
+ createDeclaration: false,
46
+ // 打包时是否创建ts声明文件
47
+ ignoreNodeModules: false,
48
+ // 打包时是否忽略 node_modules
49
+ allowList: [],
50
+ // ignoreNodeModules为true时生效
51
+ externals: {},
52
+ // 从输出的 bundle 中排除依赖
53
+ projectDir: ['src'],
54
+ template: resolveByDirname('../initData/defaultTemplate.html'),
55
+ // 默认使用neo-widget提供的页面模板(会启动页面设计器)
56
+ sassResources: [],
57
+ babelPlugins: [['import', {
58
+ libraryName: 'antd',
59
+ style: 'css'
60
+ }] // 配置 antd 的样式按需引入
61
+ ]
62
+ },
63
+ envParams: {
64
+ // 项目系统环境变量
65
+ common: {
66
+ // 通用参数
67
+ '#version#': '20221229.1'
68
+ },
69
+ local: {
70
+ // 本地开发环境
71
+ '#dataApiBase#': 'http://localhost:1024',
72
+ // 数据接口根地址
73
+ '#assetsPublicPath#': 'http://localhost:1024',
74
+ // 静态资源根地址
75
+ '#routeBasePath#': '/' // 路由根地址
76
+ },
77
+ online: {
78
+ // 线上正式环境配置参数
79
+ '#dataApiBase#': '/',
80
+ // 数据接口根地址 "//xxx.cn/"格式
81
+ '#assetsPublicPath#': '',
82
+ // 静态资源根地址 "//xxx.cn/_spa/projectName"格式
83
+ '#routeBasePath#': '/' // 路由根地址 "/_spa/projectName/"格式
84
+ }
85
+ },
86
+ dev: {
87
+ // 用于开启本地调试模式的相关配置信息
88
+ NODE_ENV: 'development',
89
+ port: 80,
90
+ // 设置基础端口,如果被占用则自动寻找可用端口
91
+ autoOpenBrowser: true,
92
+ assetsPublicPath: '/',
93
+ // 设置静态资源的引用路径(根域名+路径)
94
+ assetsSubDirectory: '',
95
+ hostname: 'localhost',
96
+ proxyTable: {},
97
+ /** CSS Sourcemaps off by default because relative paths are "buggy"
98
+ * with this option, according to the CSS-Loader README
99
+ * (https://github.com/webpack/css-loader#sourcemaps)
100
+ * In our experience, they generally work as expected,
101
+ * just be aware of this issue when enabling this option.
102
+ */
103
+ cssSourceMap: true
104
+ },
105
+ build: {
106
+ // 用于构建生产环境代码的相关配置信息
107
+ NODE_ENV: 'production',
108
+ // production 模式,会启动UglifyJsPlugin服务
109
+ assetsRoot: resolve('dist'),
110
+ // 编译完成的文件存放路径
111
+ assetsPublicPath: '/',
112
+ // 设置静态资源的引用路径(根域名+路径)
113
+ assetsSubDirectory: '',
114
+ // 资源引用二级路径
115
+ productionSourceMap: false,
116
+ // closeHtmlWebpackPlugin: true, // 可用于控制不生成html文件
117
+ // Gzip off by default as many popular public hosts such as
118
+ // Surge or Netlify already gzip all public assets for you.
119
+ // Before setting to `true`, make sure to:
120
+ // npm install --save-dev compression-webpack-plugin
121
+ productionGzip: false,
122
+ productionGzipExtensions: ['js', 'css', 'json'],
123
+ // Run the build command with an extra argument to
124
+ // View the bundle analyzer report after build finishes:
125
+ // `npm run build --report`
126
+ // Set to `true` or `false` to always turn it on or off
127
+ bundleAnalyzerReport: false
128
+ },
129
+ build2lib: {
130
+ // 用于构建第三方功能包的配置文件
131
+ NODE_ENV: 'production',
132
+ libraryName: '',
133
+ // 构建第三方功能包时最后导出的引用变量名
134
+ assetsRoot: resolve('dist'),
135
+ // 编译完成的文件存放路径
136
+ assetsPublicPath: '/',
137
+ // 设置静态资源的引用路径(根域名+路径)
138
+ assetsSubDirectory: '',
139
+ // 资源引用二级路径
140
+ productionSourceMap: false,
141
+ productionGzip: false,
142
+ productionGzipExtensions: ['js', 'css', 'json'],
143
+ bundleAnalyzerReport: false
144
+ },
145
+ linkDebug: {
146
+ // 用于开启本地调试模式的相关配置信息
147
+ NODE_ENV: 'development',
148
+ closeHtmlWebpackPlugin: true,
149
+ autoOpenBrowser: false,
150
+ cssExtract: false,
151
+ consoleInfo: '当前自定义组件可用外链地址'
152
+ },
153
+ publish2oss: {
154
+ output: {
155
+ filename: '[name].js',
156
+ library: {
157
+ type: 'var',
158
+ // webpack 5 中生成 IIFE 格式的 type 配置
159
+ export: 'default'
160
+ },
161
+ globalObject: 'this' // 定义全局变量,兼容node和浏览器运行,避免出现"window is not defined"的情况
162
+ },
163
+ cssExtract: false,
164
+ // 不额外提取css文件
165
+ ossType: 'ali',
166
+ // oss类型:ali、baidu
167
+ ossConfig: {
168
+ endpoint: 'https://oss-cn-beijing.aliyuncs.com',
169
+ // 个人阿里云子账户(neo-cmp-cli),有流量限制,请勿滥用
170
+ AccessKeyId: 'LTAI5tS47y9L4fAPLXNoEzxS',
171
+ AccessKeySecret: '8qz2GxxJJe44K5NRmLAAzIVJnbcYAU',
172
+ bucket: 'neo-widgets' // 存储桶名称
173
+ },
174
+ assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
175
+ },
176
+ // 授权码授权模式下的 NeoCRM 平台配置
177
+ neoConfig: {
178
+ authType: 'oauth2',
179
+ // 授权类型,可选值:oauth2(默认)、password
180
+ neoBaseURL: 'https://crm-cd.xiaoshouyi.com',
181
+ // 平台根地址(默认:https://crm.xiaoshouyi.com)
182
+ // 当 authType 为 oauth2 时,loginURL 配置项必填
183
+ loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth',
184
+ // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
185
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token' // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
186
+ },
187
+ /*
188
+ // 密码授权模式下的 NeoCRM 平台配置
189
+ neoConfig: {
190
+ authType: 'password', // 授权类型,可选值:oauth2(默认)、password
191
+ neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
192
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
193
+ // 当 authType 为 password 时,auth 配置项必填
194
+ auth: {
195
+ client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
196
+ client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
197
+ username: auth.username || 'xx', // 用户在销售易系统中的用户名
198
+ // password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
199
+ // 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
200
+ password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
201
+ },
202
+ },
203
+ */
204
+ pushCmp: {
205
+ output: {
206
+ filename: '[name].js',
207
+ library: {
208
+ type: 'var',
209
+ // webpack 5 中生成 IIFE 格式的 type 配置
210
+ export: 'default'
211
+ },
212
+ globalObject: 'this' // 定义全局变量,兼容node和浏览器运行,避免出现"window is not defined"的情况
213
+ },
214
+ cssExtract: false,
215
+ // 不额外提取css文件
216
+ assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
217
+ }
218
+ };
219
+
220
+ // 备注:数组类型则直接覆盖
221
+ default_config = defaultNEOConfig;
222
+ return default_config;
223
+ }
224
+
225
+ exports.__require = requireDefault_config;
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var require$$0 = require('akfun');
4
+ var default_config = require('./default.config.js');
5
+
6
+ var config;
7
+ var hasRequiredConfig;
8
+
9
+ function requireConfig () {
10
+ if (hasRequiredConfig) return config;
11
+ hasRequiredConfig = 1;
12
+ // 统一路径解析:
13
+ var _require = require$$0,
14
+ resolve = _require.resolve,
15
+ getConfigObj = _require.getConfigObj,
16
+ deepMergeConfig = _require.deepMergeConfig;
17
+ var defaultNEOConfig = default_config.__require();
18
+
19
+ // 从项目根目录获取当前项目的配置文件
20
+ var curProjectConfig = getConfigObj(resolve('neo.config.js'));
21
+
22
+ // 备注:数组类型则直接覆盖
23
+ config = deepMergeConfig(defaultNEOConfig, curProjectConfig);
24
+ return config;
25
+ }
26
+
27
+ exports.__require = requireConfig;
package/dist/main.js ADDED
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var _commonjsHelpers = require('./_virtual/_commonjsHelpers.js');
4
+ var main$1 = require('./main2.js');
5
+
6
+ var mainExports = main$1.__require();
7
+ var main = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(mainExports);
8
+
9
+ module.exports = main;