neo-cmp-cli 1.8.6 → 1.8.8

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