neo-cmp-cli 1.5.1 → 1.5.2

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 (68) hide show
  1. package/README.md +52 -15
  2. package/package.json +1 -1
  3. package/src/cmpUtils/createCmpByTemplate.js +52 -0
  4. package/src/cmpUtils/createCommonModulesCode.js +15 -15
  5. package/src/cmpUtils/{getCmpModelRegister.js → getCmpModelRegisterCode.js} +2 -2
  6. package/src/cmpUtils/{getCmpPreview.js → getCmpPreviewCode.js} +2 -2
  7. package/src/cmpUtils/{getCmpRegister.js → getCmpRegisterCode.js} +2 -2
  8. package/src/cmpUtils/getCmpTypeByDir.js +41 -0
  9. package/src/cmpUtils/hasCmpTypeByDir.js +11 -0
  10. package/src/{module → cmpUtils}/previewCmp.js +2 -2
  11. package/src/cmpUtils/{publishCmp.js → pushCmp.js} +54 -42
  12. package/src/config/default.config.js +14 -2
  13. package/src/module/index.js +144 -21
  14. package/src/module/main.js +17 -13
  15. package/src/module/neoInit.js +3 -0
  16. package/src/module/neoInitByCopy.js +3 -0
  17. package/src/neo/NeoUMDContent.js +29 -0
  18. package/src/neo/neoRequire.js +7 -7
  19. package/src/neo/neoService.js +174 -72
  20. package/src/neo/wrapperContent.js +2 -1
  21. package/src/oss/publish2oss.js +1 -1
  22. package/src/plugins/AddNeoRequirePlugin.js +5 -2
  23. package/src/projectUtils/createCmpProjectByTemplate.js +49 -0
  24. package/src/{cmpUtils → projectUtils}/getEntriesWithAutoRegister.js +4 -4
  25. package/src/template/antd-custom-cmp-template/README.md +2 -2
  26. package/src/template/antd-custom-cmp-template/neo.config.js +22 -14
  27. package/src/template/antd-custom-cmp-template/package.json +3 -3
  28. package/src/template/develop/neo-custom-cmp-template/neo.config.js +1 -1
  29. package/src/template/echarts-custom-cmp-template/README.md +2 -2
  30. package/src/template/echarts-custom-cmp-template/neo.config.js +19 -13
  31. package/src/template/echarts-custom-cmp-template/package.json +3 -3
  32. package/src/template/empty-cmp/index.tsx +51 -0
  33. package/src/template/empty-cmp/model.ts +77 -0
  34. package/src/template/empty-cmp/style.scss +72 -0
  35. package/src/template/empty-custom-cmp-template/.prettierrc.js +12 -0
  36. package/src/template/empty-custom-cmp-template/README.md +45 -0
  37. package/src/template/empty-custom-cmp-template/commitlint.config.js +59 -0
  38. package/src/template/empty-custom-cmp-template/neo.config.js +126 -0
  39. package/src/template/empty-custom-cmp-template/package.json +57 -0
  40. package/src/template/empty-custom-cmp-template/public/css/base.css +283 -0
  41. package/src/template/empty-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
  42. package/src/template/empty-custom-cmp-template/public/template.html +13 -0
  43. package/src/template/empty-custom-cmp-template/src/assets/css/common.scss +127 -0
  44. package/src/template/empty-custom-cmp-template/src/assets/css/mixin.scss +47 -0
  45. package/src/template/empty-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
  46. package/src/template/empty-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
  47. package/src/template/empty-custom-cmp-template/src/assets/img/favicon.png +0 -0
  48. package/src/template/empty-custom-cmp-template/src/assets/img/map.svg +1 -0
  49. package/src/template/empty-custom-cmp-template/src/components/README.md +3 -0
  50. package/src/template/empty-custom-cmp-template/tsconfig.json +68 -0
  51. package/src/template/neo-custom-cmp-template/README.md +2 -2
  52. package/src/template/neo-custom-cmp-template/neo.config.js +6 -26
  53. package/src/template/neo-custom-cmp-template/package.json +3 -4
  54. package/src/template/react-custom-cmp-template/README.md +2 -2
  55. package/src/template/react-custom-cmp-template/neo.config.js +20 -15
  56. package/src/template/react-custom-cmp-template/package.json +3 -3
  57. package/src/template/react-ts-custom-cmp-template/README.md +2 -2
  58. package/src/template/react-ts-custom-cmp-template/neo.config.js +19 -14
  59. package/src/template/react-ts-custom-cmp-template/package.json +3 -3
  60. package/src/template/vue2-custom-cmp-template/README.md +2 -2
  61. package/src/template/vue2-custom-cmp-template/neo.config.js +20 -15
  62. package/src/template/vue2-custom-cmp-template/package.json +3 -3
  63. package/src/utils/autoEntryRootDir.js +75 -0
  64. package/src/utils/replaceInFilesByMap.js +54 -0
  65. package/test/demo.js +2 -2
  66. package/src/template/neo-custom-cmp-template/auth.config.js +0 -12
  67. /package/src/{cmpUtils → projectUtils}/getEntries.js +0 -0
  68. /package/src/{cmpUtils → projectUtils}/updatePublishLog.js +0 -0
@@ -0,0 +1,13 @@
1
+ <html lang="en">
2
+ <head>
3
+ <meta charset="UTF-8">
4
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
5
+ <meta name="format-detection" content="telephone=no"/>
6
+ <meta name="viewport" content="initial-scale=1.0,user-scalable=no,width=device-width,viewport-fit=cover">
7
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
8
+ <title>自定义组件预览页</title>
9
+ </head>
10
+ <body>
11
+ <div id="root"></div>
12
+ </body>
13
+ </html>
@@ -0,0 +1,127 @@
1
+ /* 公共的自定义函数 */
2
+
3
+ @function px2vw($px, $screen-width: 750) {
4
+ @return ($px / $screen-width) * 100vw;
5
+ }
6
+
7
+ @function px2rem($px, $remRate: 100) {
8
+ @return ($px / $remRate) + rem;
9
+ }
10
+
11
+ @function px2vmin($px, $screen-width: 750) {
12
+ @return ($px / $screen-width) * 100vmin;
13
+ }
14
+
15
+ @mixin fillBox {
16
+ width: 100%;
17
+ height: 100%;
18
+ }
19
+
20
+ /* 头部细线 */
21
+ @mixin borderTop {
22
+ content: '';
23
+ position: absolute;
24
+ left: 0;
25
+ right: 0;
26
+ top: 0;
27
+ width: 100%;
28
+ height: 1px;
29
+ background: #ddd;
30
+ transform: scaleY(0.5);
31
+ }
32
+
33
+ /* 底部细线 */
34
+ @mixin borderBtm {
35
+ content: '';
36
+ position: absolute;
37
+ left: 0;
38
+ right: 0;
39
+ bottom: 0;
40
+ width: 100%;
41
+ height: 1px;
42
+ background: #ddd;
43
+ transform: scaleY(0.5);
44
+ }
45
+
46
+ /* 统一的内边距 */
47
+ @mixin unifiedPadding($value: 40) {
48
+ padding: 0 px2rem($value) 0 px2rem($value);
49
+ }
50
+
51
+ /* 统一的左内边距 */
52
+ @mixin unifiedLeftPadding($value: 40) {
53
+ padding-left: px2rem($value);
54
+ }
55
+
56
+ /* 统一的右内边距 */
57
+ @mixin unifiedRightPadding($value: 40) {
58
+ padding-right: px2rem($value);
59
+ }
60
+
61
+ /* 统一的底部边框样式 */
62
+ @mixin unifiedBottomBorder {
63
+ border-bottom: 1px solid #ddd;
64
+ }
65
+
66
+ /* 统一的上边框样式 */
67
+ @mixin unifiedTopBorder {
68
+ border-top: 1px solid #ddd;
69
+ }
70
+
71
+ /* 统一的Item高度 */
72
+ @mixin unifiedItemHeight {
73
+ line-height: px2rem(120);
74
+ height: px2rem(120);
75
+ }
76
+
77
+ /* 设置行高样式 */
78
+ @mixin setItemHeight($value: 120) {
79
+ line-height: px2rem($value);
80
+ height: px2rem($value);
81
+ }
82
+
83
+ /* 统一的Item样式 */
84
+ @mixin unifiedItemStyle {
85
+ font-family: PingFangSC-Regular;
86
+ font-size: px2rem(28);
87
+ color: #828282;
88
+ letter-spacing: 0;
89
+ }
90
+
91
+ /* 统一的弹性盒子样式 */
92
+ @mixin unifiedFlexBoxStyle {
93
+ display: flex;
94
+ flex-wrap: nowrap;
95
+ justify-content: center;
96
+ align-items: center;
97
+ }
98
+
99
+ /* 统一的Title样式 */
100
+ @mixin unifiedTitleStyle {
101
+ font-family: PingFangSC-Regular;
102
+ font-size: px2rem(40);
103
+ color: #1e1e1e;
104
+ }
105
+
106
+ /* 统一的内容样式 */
107
+ @mixin unifiedContentStyle {
108
+ font-family: PingFangSC-Regular;
109
+ font-size: px2rem(28);
110
+ color: #1e1e1e;
111
+ letter-spacing: 0;
112
+ text-align: right;
113
+ line-height: px2rem(28);
114
+ }
115
+
116
+ /* 底部导航盒子样式 */
117
+ @mixin fixedBottomBox {
118
+ position: fixed;
119
+ left: 0;
120
+ bottom: 0;
121
+ width: 100%;
122
+ }
123
+
124
+ // 常用的变量
125
+ $background-color: #fafafa;
126
+ $border-color: #f7f7f7;
127
+ $page-padding-top: px2rem(20);
@@ -0,0 +1,47 @@
1
+ // 通用mixin
2
+ $borderColor: #ddd;
3
+
4
+ // type 为top 或者 bottom
5
+ @mixin borderTopOrBtm($type) {
6
+ &::after {
7
+ content: '';
8
+ position: absolute;
9
+ left: 0;
10
+ right: 0;
11
+ #{$type}: 0;
12
+ width: 100%;
13
+ height: 1px;
14
+ background: $borderColor;
15
+ transform: scaleY(0.5);
16
+ }
17
+ }
18
+
19
+ // type为 right 或者 left
20
+ @mixin borderRtOrLt($type) {
21
+ &::after {
22
+ content: '';
23
+ position: absolute;
24
+ top: 0;
25
+ bottom: 0;
26
+ #{$type}: 0;
27
+ height: 100%;
28
+ width: 1px;
29
+ background: $borderColor;
30
+ transform: scaleX(0.5);
31
+ }
32
+ }
33
+
34
+ //超出1行显示...
35
+ @mixin ellipsis1 {
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap;
39
+ }
40
+
41
+ // 超出多行显示...
42
+ @mixin ellipsis($num) {
43
+ overflow: hidden;
44
+ display: -webkit-box;
45
+ -webkit-line-clamp: $num;
46
+ -webkit-box-orient: vertical;
47
+ }
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756957113315" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5395" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M288 768v115.2c0 25.6 19.2 44.8 44.8 44.8h556.8c25.6 0 44.8-19.2 44.8-44.8v-198.4s0-6.4-6.4-6.4h-83.2c-38.4 0-70.4-32-70.4-70.4 0-38.4 32-70.4 70.4-70.4h83.2s6.4 0 6.4-6.4V332.8c0-25.6-19.2-44.8-44.8-44.8H768C768 198.4 697.6 128 608 128S448 198.4 448 288H332.8c-25.6 0-44.8 19.2-44.8 44.8V448C198.4 448 128 518.4 128 608S198.4 768 288 768z m0-249.6h70.4V358.4h160V288c0-51.2 38.4-89.6 89.6-89.6 51.2 0 89.6 38.4 89.6 89.6v70.4h160v108.8h-19.2c-76.8 0-140.8 64-140.8 140.8 0 76.8 64 140.8 140.8 140.8h19.2v108.8H358.4v-160H288c-51.2 0-89.6-38.4-89.6-89.6 0-51.2 38.4-89.6 89.6-89.6z" p-id="5396" fill="#0764f5"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1760670196857" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4651" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M485.888 626.496 512 663.488l26.112-36.992c1.088-1.472 107.392-151.68 140.864-189.184C715.776 396.224 736 343.168 736 288 736 164.544 635.52 64 512 64s-224 100.48-224 224c0 55.232 20.224 108.288 57.088 149.376C378.624 474.816 484.8 625.024 485.888 626.496zM512 128c88.256 0 160 71.808 160 160 0 39.424-14.464 77.312-40.768 106.688C606.016 422.912 546.624 504.64 512 552.896 477.44 504.64 418.048 422.912 392.768 394.688 366.528 365.376 352 327.488 352 288 352 199.808 423.744 128 512 128zM512 384c52.928 0 96-43.072 96-96S564.928 192 512 192 416 235.072 416 288 459.072 384 512 384zM512 256c17.6 0 32 14.336 32 32S529.6 320 512 320 480 305.664 480 288 494.4 256 512 256zM960 129.024l0 703.168L680 960 384 832l-320 127.36L64 258.176l168.256-67.904C227.264 211.456 224 233.28 224 256c0 2.176 0.512 4.224 0.576 6.4L128 301.376l0 563.648 192-76.416L320 476.032c18.048 23.36 41.472 55.104 64 86.144l0 200.96 1.024-0.384 24.384 10.56L640 872.96 640 562.304c22.976-31.616 46.208-63.168 64-86.144l0 402.56 192-87.68L896 228.608l-97.536 44.544C798.784 267.392 800 261.76 800 256c0-17.664-2.176-34.752-5.184-51.584L960 129.024z" p-id="4652" fill="#0764f5"></path></svg>
@@ -0,0 +1,3 @@
1
+ ### 目录说明
2
+ 此目录用于存放自定义组件对应的源码,每个子目录存放一个自定义组件,
3
+ 存放在此的自定义组件在发布时会自动注册成 NeoCRM 平台可用的自定义组件。
@@ -0,0 +1,68 @@
1
+ {
2
+ "compilerOptions": {
3
+ "experimentalDecorators": true,
4
+ /* Basic Options */
5
+ "target": "esnext",
6
+ /* 指定编译之后的版本: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
7
+ "module": "esnext" /* 指定要使用的模板标准: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
8
+ // "lib": [], /* Specify library files to be included in the compilation. */
9
+ "allowJs": false /* 指定是否允许编译JS文件,默认false,即不编译JS文件. */,
10
+ // "checkJs": true, /* 指定是否检查和报告JS文件中的错误,默认false */
11
+ "jsx": "react" /* 指定jsx代码用于的开发环境:'preserve','react-native', or 'react'. */,
12
+ "declaration": false /* 指定是否在编译的时候生成相的d.ts声明文件 */,
13
+ // "declarationMap": true, /* 指定编译时是否生成.map文件 */
14
+ // "sourceMap": true, /* 指定编译时是否生成.map文件 */
15
+ // "outFile": "./", /* 指定输出文件合并为一个文件 */
16
+ // "outDir": "dist", /* 指定输出文件夹,值为一个文件夹路径字符串,输出的文件都将放置在这个文件夹*/
17
+ // "rootDir": "src", /* 指定编译文件的根目录,编译器会在根目录查找入口文件 */
18
+ // "composite": true, /* 是否编译构建引用项目 */
19
+ // "removeComments": true, /* 指定是否将编译后的文件注释删掉,设为true的话即删除注释,默认为false */
20
+ "noEmit": false /* 不生成编译文件 */,
21
+ "importHelpers": true /* 指定是否引入tslib里的复制工具函数,默认为false */,
22
+ // "downlevelIteration": true, /* 当target为"ES5"或"ES3"时,为"for-of" "spread"和"destructuring"中的迭代器提供完全支持 */
23
+ "isolatedModules": false /* 指定是否将每个文件作为单独的模块,默认为true */,
24
+
25
+ /* Strict Type-Checking Options */
26
+ "strict": false /* 指定是否启动所有类型检查 */,
27
+ "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
28
+ "strictNullChecks": true /* Enable strict null checks. */,
29
+ // "strictFunctionTypes": true, /* Enable strict checking of function types. */
30
+ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
31
+ "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */,
32
+ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
33
+
34
+ /* Additional Checks */
35
+ "noUnusedLocals": false /* Report errors on unused locals. */,
36
+ // "noUnusedParameters": true, /* Report errors on unused parameters. */
37
+ "noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
38
+ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
39
+
40
+ /* Module Resolution Options */
41
+ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
42
+ "baseUrl": "./" /* Base directory to resolve non-absolute module names. */,
43
+ "paths": {
44
+ "@": ["./src"]
45
+ } /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
46
+ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
47
+ /* 指定声明文件或文件夹的路径列表,如果指定了此项,则只有在这里列出的声明文件才会被加载 */
48
+ "typeRoots": ["./@types", "./node_modules/@types"],
49
+ // "types": [], /* 指定需要包含的模块,只有在这里列出的模块的声明文件才会被加载 */
50
+ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
51
+ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
52
+ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
53
+
54
+ /* Source Map Options */
55
+ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
56
+ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
57
+ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
58
+ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
59
+
60
+ /* Experimental Options */
61
+ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
62
+ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
63
+ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
64
+ // "suppressImplicitAnyIndexErrors": true /* Suppress --noImplicitAny errors for indexing objects lacking index signatures. See issue #1232 for more details. */
65
+ },
66
+ "include": ["src", "test"],
67
+ "exclude": ["node_modules"]
68
+ }
@@ -38,10 +38,10 @@ $ npm run preview
38
38
  $ npm run linkDebug
39
39
  ```
40
40
 
41
- 4. **发布到对象存储服务中**
41
+ 4. **发布到 NeoCRM 平台**
42
42
  > 需要确保 package.json 中的 name 值唯一,version 值不重复。
43
43
  ```bash
44
- $ npm run publish2oss
44
+ $ npm run pushCmp
45
45
  ```
46
46
 
47
47
  ### 前端工程配置项说明(neo-cmp-cli)
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  const path = require('path');
3
+ const fs = require('fs');
3
4
 
4
5
  // 统一路径解析
5
6
  function resolve(dir) {
@@ -50,11 +51,10 @@ module.exports = {
50
51
  neoCommonModule: {
51
52
  // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
52
53
  neoExports: { // 对象写法
53
- 'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
54
- 'neo-register': 'neo-register', // 导出 Neo 注册模块
54
+ 'xx-module': path.resolve('./src/components/xx-module'), // 导出 xx组件 或 xx模块
55
55
  },
56
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
56
57
  // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
57
- // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
58
58
  },
59
59
  */
60
60
  preview: {
@@ -105,32 +105,12 @@ module.exports = {
105
105
  }
106
106
  */
107
107
  },
108
- publish2oss: {
109
- // 用于构建并发布至 OSS 的相关配置
110
- /*
111
- 【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
112
- NODE_ENV: 'production',
113
- entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
114
- InfoCardModel: './src/components/entity-form/model.ts',
115
- infoCard: './src/components/entity-form/register.ts'
116
- },
117
- cssExtract: false, // 不额外提取css文件
118
- ossType: 'ali', // oss类型:ali、baidu
119
- ossConfig: {
120
- endpoint: 'https://oss-cn-beijing.aliyuncs.com',
121
- AccessKeyId: 'xxx',
122
- AccessKeySecret: 'xx',
123
- bucket: 'neo-widgets' // 存储桶名称
124
- },
125
- assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
126
- */
127
- },
128
- publishCmp: {
108
+ pushCmp: {
129
109
  // 用于构建并发布至 NeoCRM 的相关配置
130
110
  neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
131
- tokenAPI: 'https://login.crm-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.crm.xiaoshouyi.com/auc/oauth2/token)
111
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
132
112
  // NeoCRM 授权配置
133
- authorization: {
113
+ authConfig: {
134
114
  client_id: authConfig.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
135
115
  client_secret: authConfig.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
136
116
  username: authConfig.username || 'xx', // 用户在销售易系统中的用户名
@@ -10,10 +10,9 @@
10
10
  "author": "wibetter",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
- "preview": "neo preview --cmpType=contact-form",
14
- "preview2": "neo preview --cmpType=contact-card-list",
13
+ "preview": "neo preview",
15
14
  "linkDebug": "neo linkDebug",
16
- "publish2oss": "neo publish2oss",
15
+ "pushCmp": "neo pushCmp",
17
16
  "format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
18
17
  },
19
18
  "files": [
@@ -52,7 +51,7 @@
52
51
  "@types/react": "^16.9.11",
53
52
  "@types/react-dom": "^16.9.15",
54
53
  "@types/axios": "^0.14.0",
55
- "neo-cmp-cli": "^1.3.8",
54
+ "neo-cmp-cli": "^1.5.0-beta.5",
56
55
  "husky": "^4.2.5",
57
56
  "lint-staged": "^10.2.9",
58
57
  "prettier": "^2.0.5"
@@ -37,10 +37,10 @@ $ npm run preview
37
37
  $ npm run linkDebug
38
38
  ```
39
39
 
40
- 4. **发布到对象存储服务中**
40
+ 4. **发布到 NeoCRM 平台**
41
41
  > 需要确保 package.json 中的 name 值唯一,version 值不重复。
42
42
  ```bash
43
- $ npm run publish2oss
43
+ $ npm run pushCmp
44
44
  ```
45
45
 
46
46
  ### 配置项说明(neo-cmp-cli)
@@ -47,11 +47,10 @@ module.exports = {
47
47
  neoCommonModule: {
48
48
  // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
49
49
  neoExports: { // 对象写法
50
- 'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
51
- 'neo-register': 'neo-register', // 导出 Neo 注册模块
50
+ 'xx-module': path.resolve('./src/components/xx-module'), // 导出 xx组件 或 xx模块
52
51
  },
52
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
53
53
  // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
54
- // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
55
54
  },
56
55
  */
57
56
  preview: {
@@ -97,23 +96,29 @@ module.exports = {
97
96
  }
98
97
  */
99
98
  },
100
- publish2oss: {
101
- // 用于构建并发布至 OSS 的相关配置
99
+ pushCmp: {
100
+ // 用于构建并发布至 NeoCRM 的相关配置
101
+ neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
102
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
103
+ // NeoCRM 授权配置
104
+ authConfig: {
105
+ client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
106
+ client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
107
+ username: 'xx', // 用户在销售易系统中的用户名
108
+ /**
109
+ * password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
110
+ * 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
111
+ */
112
+ password: 'xx xx' // 用户账户密码 + 8 位安全令牌
113
+ },
102
114
  /*
103
115
  【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
104
116
  NODE_ENV: 'production',
105
- entry: { // entry 未配置时,cli 会根据 src/components 目录下的文件自动生成对应的 entry
106
- InfoCardModel: './src/components/info-card/model.ts',
107
- infoCard: './src/components/info-card/register.ts'
117
+ entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
118
+ InfoCardModel: './src/components/entity-form/model.ts',
119
+ infoCard: './src/components/entity-form/register.ts'
108
120
  },
109
121
  cssExtract: false, // 不额外提取css文件
110
- ossType: 'ali', // oss类型:ali、baidu
111
- ossConfig: {
112
- endpoint: 'https://oss-cn-beijing.aliyuncs.com',
113
- AccessKeyId: 'xxx',
114
- AccessKeySecret: 'xx',
115
- bucket: 'neo-widgets' // 存储桶名称
116
- },
117
122
  assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
118
123
  */
119
124
  },
@@ -10,9 +10,9 @@
10
10
  "author": "wibetter",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
- "preview": "neo preview --cmpType=info-card",
13
+ "preview": "neo preview",
14
14
  "linkDebug": "neo linkDebug",
15
- "publish2oss": "neo publish2oss",
15
+ "pushCmp": "neo pushCmp",
16
16
  "format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
17
17
  },
18
18
  "files": [
@@ -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.3.8",
47
+ "neo-cmp-cli": "^1.5.2",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5"
@@ -37,10 +37,10 @@ $ npm run preview
37
37
  $ npm run linkDebug
38
38
  ```
39
39
 
40
- 4. **发布到对象存储服务中**
40
+ 4. **发布到 NeoCRM 平台**
41
41
  > 需要确保 package.json 中的 name 值唯一,version 值不重复。
42
42
  ```bash
43
- $ npm run publish2oss
43
+ $ npm run pushCmp
44
44
  ```
45
45
 
46
46
  ### 配置项说明(neo-cmp-cli)
@@ -43,11 +43,10 @@ module.exports = {
43
43
  neoCommonModule: {
44
44
  // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
45
45
  neoExports: { // 对象写法
46
- 'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
47
- 'neo-register': 'neo-register', // 导出 Neo 注册模块
46
+ 'xx-module': path.resolve('./src/components/xx-module'), // 导出 xx组件 或 xx模块
48
47
  },
48
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
49
49
  // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
50
- // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
51
50
  },
52
51
  */
53
52
  preview: {
@@ -98,23 +97,29 @@ module.exports = {
98
97
  }
99
98
  */
100
99
  },
101
- publish2oss: {
102
- // 用于构建并发布至 OSS 的相关配置
100
+ pushCmp: {
101
+ // 用于构建并发布至 NeoCRM 的相关配置
102
+ neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
103
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
104
+ // NeoCRM 授权配置
105
+ authConfig: {
106
+ client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
107
+ client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
108
+ username: 'xx', // 用户在销售易系统中的用户名
109
+ /**
110
+ * password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
111
+ * 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
112
+ */
113
+ password: 'xx xx' // 用户账户密码 + 8 位安全令牌
114
+ },
103
115
  /*
104
116
  【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
105
117
  NODE_ENV: 'production',
106
118
  entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
107
- listWidgetModel: './src/components/list-widget/model.ts',
108
- listWidget: './src/components/list-widget/register.ts'
119
+ InfoCardModel: './src/components/entity-form/model.ts',
120
+ infoCard: './src/components/entity-form/register.ts'
109
121
  },
110
122
  cssExtract: false, // 不额外提取css文件
111
- ossType: 'ali', // oss类型:ali、baidu
112
- ossConfig: {
113
- endpoint: 'https://oss-cn-beijing.aliyuncs.com',
114
- AccessKeyId: 'xxx',
115
- AccessKeySecret: 'xx',
116
- bucket: 'neo-widgets' // 存储桶名称
117
- },
118
123
  assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
119
124
  */
120
125
  },
@@ -10,9 +10,9 @@
10
10
  "author": "wibetter",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
- "preview": "neo preview --cmpType=info-card",
13
+ "preview": "neo preview",
14
14
  "linkDebug": "neo linkDebug",
15
- "publish2oss": "neo publish2oss",
15
+ "pushCmp": "neo pushCmp",
16
16
  "format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
17
17
  },
18
18
  "files": [
@@ -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.3.8",
49
+ "neo-cmp-cli": "^1.5.2",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.5"
@@ -37,10 +37,10 @@ $ npm run preview
37
37
  $ npm run linkDebug
38
38
  ```
39
39
 
40
- 4. **发布到对象存储服务中**
40
+ 4. **发布到 NeoCRM 平台**
41
41
  > 需要确保 package.json 中的 name 值唯一,version 值不重复。
42
42
  ```bash
43
- $ npm run publish2oss
43
+ $ npm run pushCmp
44
44
  ```
45
45
 
46
46
  ### 配置项说明(neo-cmp-cli)
@@ -52,11 +52,10 @@ module.exports = {
52
52
  neoCommonModule: {
53
53
  // neoExports: ['xxModule'], // 自定义组件 共享出来的模块,支持数组和对象形式
54
54
  neoExports: { // 对象写法
55
- 'chart-widget': path.resolve('./src/components/chart-widget'), // 导出图表自定义组件
56
- 'neo-register': 'neo-register', // 导出 Neo 注册模块
55
+ 'xx-module': path.resolve('./src/components/xx-module'), // 导出 xx组件 或 xx模块
57
56
  },
57
+ // remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 neoExternals 配合使用
58
58
  // neoExternals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
59
- // remotes: ['xxModule'], // 远程组件,表示当前自定义组件会用到的远程组件,需要和 neoExternals 配合使用
60
59
  },
61
60
  */
62
61
  preview: {
@@ -106,23 +105,29 @@ module.exports = {
106
105
  cssSourceMap: true
107
106
  */
108
107
  },
109
- publish2oss: {
110
- // 用于构建并发布至 OSS 的相关配置
108
+ pushCmp: {
109
+ // 用于构建并发布至 NeoCRM 的相关配置
110
+ neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
111
+ tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
112
+ // NeoCRM 授权配置
113
+ authConfig: {
114
+ client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
115
+ client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
116
+ username: 'xx', // 用户在销售易系统中的用户名
117
+ /**
118
+ * password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
119
+ * 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
120
+ */
121
+ password: 'xx xx' // 用户账户密码 + 8 位安全令牌
122
+ },
111
123
  /*
112
124
  【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
113
125
  NODE_ENV: 'production',
114
- entry: { // entry 会根据 src/components 目录下的文件自动生成
115
- InfoCardModel: './src/components/vue-info-card/model.ts',
116
- infoCard: './src/components/vue-info-card/register.ts'
126
+ entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
127
+ InfoCardModel: './src/components/entity-form/model.ts',
128
+ infoCard: './src/components/entity-form/register.ts'
117
129
  },
118
130
  cssExtract: false, // 不额外提取css文件
119
- ossType: 'ali', // oss类型:ali、baidu
120
- ossConfig: {
121
- endpoint: 'https://oss-cn-beijing.aliyuncs.com',
122
- AccessKeyId: 'xxx',
123
- AccessKeySecret: 'xx',
124
- bucket: 'neo-widgets' // 存储桶名称
125
- },
126
131
  assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
127
132
  */
128
133
  },
@@ -10,9 +10,9 @@
10
10
  "author": "wibetter",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
- "preview": "neo preview --cmpType=info-card",
13
+ "preview": "neo preview",
14
14
  "linkDebug": "neo linkDebug",
15
- "publish2oss": "neo publish2oss",
15
+ "pushCmp": "neo pushCmp",
16
16
  "format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
17
17
  },
18
18
  "files": [
@@ -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.3.8",
47
+ "neo-cmp-cli": "^1.5.2",
48
48
  "husky": "^4.2.5",
49
49
  "lint-staged": "^10.2.9",
50
50
  "prettier": "^2.0.5",