neo-cmp-cli 1.8.19 → 1.8.21

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/README.md CHANGED
@@ -21,7 +21,6 @@ neo-cmp-cli 是 Neo 自定义组件开发工具,基于 [AKFun](https://github.
21
21
  - **多构建场景**: 本地预览(含热更新/代理)、外链调试、库构建(UMD/ESM)、部署&发布
22
22
  - **灵活可配**: 支持构建入口、别名、代理、SASS 注入、ESLint/StyleLint、Babel/Loader/Plugin 扩展等配置
23
23
  - **样式与规范**: 内置 Autoprefixer、Sass、PostCSS、ESLint、StyleLint
24
- - **发布至 CDN**: 内置发布到对象存储(OSS)的能力,支持自定义对象存储配置
25
24
  - **发布至 NeoCRM 平台**: 支持一键发布到 NeoCRM 平台的能力,需自行补充授权配置
26
25
 
27
26
  ## 📦 内置模板
@@ -115,7 +114,6 @@ neo push cmp
115
114
  | `neo logout` | 登出 NeoCRM 平台 | - |
116
115
  | `neo preview` | 本地预览自定义组件内容,默认支持热更新与接口代理 | `--name` 指定组件名称 |
117
116
  | `neo linkDebug` | 外链调试模式,在平台端页面设计器中调试自定义组件 | `--name` 指定组件名称 |
118
- | `neo publish2oss` | 构建并上传到对象存储 | `--name` 指定组件名称 |
119
117
  | `neo push cmp` | 构建并发布到 NeoCRM 平台 | `--name` 指定组件名称 |
120
118
  | `neo pull cmp` | 拉取线上自定义组件(NeoCRM 平台)至当前项目 | `--name` 指定组件名称 |
121
119
  | `neo delete cmp` | 删除线上自定义组件(NeoCRM 平台) | `--name` 指定组件名称 |
@@ -521,51 +519,6 @@ neo delete cmp -n xxCmp
521
519
  - ⚠️ **影响范围**:删除组件后,所有使用该组件的页面和表单将受到影响,请确保没有正在使用的场景
522
520
  - 💡 **建议先备份**:删除前建议先使用 `neo pull cmp` 拉取组件源码到本地进行备份
523
521
 
524
- ### 10. 发布自定义组件至 CDN
525
-
526
- 执行 `neo publish2oss` 即可构建对应自定义组件,并自动将构建后资源上传到对象存储(OSS)中。
527
-
528
- > **提示**:请优先使用 `neo push cmp` 发布到 NeoCRM 平台。
529
-
530
- #### 发布前请确保
531
-
532
- - ✅ **package.json 的 name 唯一**
533
- - ✅ **version 不重复**
534
- - ✅ 可按需配置对象存储参数(支持自定义),默认使用内置对象存储配置
535
-
536
- #### 支持自定义对象存储配置
537
-
538
- ```javascript
539
- module.exports = {
540
- publish2oss: {
541
- // 用于构建并发布至 OSS 的相关配置
542
- //【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
543
- // NODE_ENV: 'production',
544
- // cssExtract: false, // 不额外提取css文件
545
- ossType: 'ali', // oss类型:ali、baidu
546
- ossConfig: {
547
- endpoint: 'https://oss-cn-beijing.aliyuncs.com',
548
- AccessKeyId: 'xxx',
549
- AccessKeySecret: 'xx',
550
- bucket: 'neo-cmp-xx-bucket' // 存储桶名称
551
- },
552
- assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
553
- },
554
- }
555
- ```
556
-
557
- #### 支持发布指定自定义组件
558
-
559
- ```bash
560
- neo publish2oss --name=xxCmp
561
- ```
562
-
563
- #### 特别说明
564
-
565
- 此发布方式只是将自定义组件构建产物发布到 CDN 上,如要使用自定义组件还需要手动添加到指定租户上(NeoCRM 管理端 / 自定义组件管理页)。
566
-
567
- ---
568
-
569
522
  ## ⚙️ 配置说明
570
523
 
571
524
  neo-cmp-cli 默认提供完整配置;如需自定义,使用 `neo config init` 生成 `neo.config.js` 并按需修改。
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("akfun"),t=require("node:path");var s,o;exports.__require=function(){if(o)return s;o=1;const{resolve:a}=e,i=t,n={settings:{enableESLint:!1,enableESLintFix:!1,enableStyleLint:!1,enableStyleLintFix:!1},webpack:{resolve:{extensions:[".js",".jsx",".ts",".tsx",".vue",".min.js",".json"],alias:{"@":a("src")}},createDeclaration:!1,ignoreNodeModules:!1,allowList:[],externals:{},projectDir:["src"],template:(r="../../template/initData/defaultTemplate.html",i.resolve(__dirname,r)),sassResources:[],babelPlugins:[["import",{libraryName:"antd",style:"css"}]]},envParams:{common:{"#version#":"20221229.1"},local:{"#dataApiBase#":"http://localhost:1024","#assetsPublicPath#":"http://localhost:1024","#routeBasePath#":"/"},online:{"#dataApiBase#":"/","#assetsPublicPath#":"","#routeBasePath#":"/"}},dev:{NODE_ENV:"development",port:80,autoOpenBrowser:!0,assetsPublicPath:"/",assetsSubDirectory:"",hostname:"localhost",proxyTable:{},cssSourceMap:!0},build:{NODE_ENV:"production",assetsRoot:a("dist"),assetsPublicPath:"/",assetsSubDirectory:"",productionSourceMap:!1,productionGzip:!1,productionGzipExtensions:["js","css","json"],bundleAnalyzerReport:!1},build2lib:{NODE_ENV:"production",libraryName:"",assetsRoot:a("dist"),assetsPublicPath:"/",assetsSubDirectory:"",productionSourceMap:!1,productionGzip:!1,productionGzipExtensions:["js","css","json"],bundleAnalyzerReport:!1},linkDebug:{NODE_ENV:"development",closeHtmlWebpackPlugin:!0,autoOpenBrowser:!1,cssExtract:!1,consoleInfo:"当前自定义组件可用外链地址"},publish2oss:{output:{filename:"[name].js",library:{type:"var",export:"default"},globalObject:"this"},cssExtract:!1,ossType:"ali",ossConfig:{endpoint:"https://oss-cn-beijing.aliyuncs.com",AccessKeyId:"LTAI5tS47y9L4fAPLXNoEzxS",AccessKeySecret:"8qz2GxxJJe44K5NRmLAAzIVJnbcYAU",bucket:"neo-widgets"},assetsRoot:a("dist")},neoConfig:{authType:"oauth2",neoBaseURL:"https://crm-cd.xiaoshouyi.com",loginURL:"https://login-cd.xiaoshouyi.com/auc/oauth2/auth",tokenAPI:"https://login-cd.xiaoshouyi.com/auc/oauth2/token"},pushCmp:{output:{filename:"[name].js",library:{type:"var",export:"default"},globalObject:"this"},cssExtract:!1,assetsRoot:a("dist")}};var r;return s=n};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("akfun"),t=require("node:path");var s,o;exports.__require=function(){if(o)return s;o=1;const{resolve:a}=e,i=t,n={settings:{enableESLint:!1,enableESLintFix:!1,enableStyleLint:!1,enableStyleLintFix:!1},webpack:{resolve:{extensions:[".js",".jsx",".ts",".tsx",".vue",".min.js",".json"],alias:{"@":a("src")}},createDeclaration:!1,ignoreNodeModules:!1,allowList:[],externals:{},projectDir:["src"],template:(r="../../template/initData/defaultTemplate.html",i.resolve(__dirname,r)),sassResources:[],babelPlugins:[["import",{libraryName:"antd",style:"css"}]]},envParams:{common:{"#version#":"20221229.1"},local:{"#dataApiBase#":"http://localhost:1024","#assetsPublicPath#":"http://localhost:1024","#routeBasePath#":"/"},online:{"#dataApiBase#":"/","#assetsPublicPath#":"","#routeBasePath#":"/"}},dev:{NODE_ENV:"development",port:80,autoOpenBrowser:!0,assetsPublicPath:"/",assetsSubDirectory:"",hostname:"localhost",proxyTable:{},cssSourceMap:!0},build:{NODE_ENV:"production",assetsRoot:a("dist"),assetsPublicPath:"/",assetsSubDirectory:"",productionSourceMap:!1,productionGzip:!1,productionGzipExtensions:["js","css","json"],bundleAnalyzerReport:!1},build2lib:{NODE_ENV:"production",libraryName:"",assetsRoot:a("dist"),assetsPublicPath:"/",assetsSubDirectory:"",productionSourceMap:!1,productionGzip:!1,productionGzipExtensions:["js","css","json"],bundleAnalyzerReport:!1},linkDebug:{NODE_ENV:"development",closeHtmlWebpackPlugin:!0,autoOpenBrowser:!1,cssExtract:!1,consoleInfo:"当前自定义组件可用外链地址"},publish2oss:{output:{filename:"[name].js",library:{type:"var",export:"default"},globalObject:"this"},cssExtract:!1,ossType:"ali",ossConfig:{endpoint:"https://oss-cn-beijing.aliyuncs.com",AccessKeyId:"xx",AccessKeySecret:"xx",bucket:"neo-widgets"},assetsRoot:a("dist")},neoConfig:{authType:"oauth2",neoBaseURL:"https://crm-cd.xiaoshouyi.com",loginURL:"https://login-cd.xiaoshouyi.com/auc/oauth2/auth",tokenAPI:"https://login-cd.xiaoshouyi.com/auc/oauth2/token"},pushCmp:{output:{filename:"[name].js",library:{type:"var",export:"default"},globalObject:"this"},cssExtract:!1,assetsRoot:a("dist")}};var r;return s=n};
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.8.18";const o={version:e};exports.default=o,exports.version=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.8.21";const o={version:e};exports.default=o,exports.version=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.8.19",
3
+ "version": "1.8.21",
4
4
  "description": "Neo 自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -48,7 +48,7 @@
48
48
  "@commitlint/config-conventional": "^9.1.1",
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
- "neo-cmp-cli": "^1.8.18",
51
+ "neo-cmp-cli": "^1.8.20",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5"
@@ -16,6 +16,7 @@ interface ContactFormState {
16
16
  entityType?: number;
17
17
  phone__c: string;
18
18
  };
19
+ title: string;
19
20
  entityTypeList: any[];
20
21
  loading: boolean;
21
22
  }
@@ -48,7 +48,7 @@
48
48
  "@commitlint/config-conventional": "^9.1.1",
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
- "neo-cmp-cli": "^1.8.18",
51
+ "neo-cmp-cli": "^1.8.20",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5",
@@ -6,7 +6,11 @@ interface CustomCmpProps {
6
6
  data?: any;
7
7
  }
8
8
 
9
- export default class CustomCmp extends React.PureComponent<CustomCmpProps> {
9
+ interface CustomCmpStates {
10
+ [key: string]: any;
11
+ }
12
+
13
+ export default class CustomCmp extends React.PureComponent<CustomCmpProps, CustomCmpStates> {
10
14
  constructor(props: CustomCmpProps) {
11
15
  super(props);
12
16
  }
@@ -31,17 +31,23 @@ export class CmpModel {
31
31
  */
32
32
  targetPage: string[] = ['customPage'];
33
33
 
34
+ /**
35
+ * 用于设置组件支持的终端类型
36
+ *
37
+ * 当前 NeoCRM 平台存在的终端类型:
38
+ * all: 所有终端
39
+ * web: 网页端
40
+ * mobile: 移动端
41
+ */
42
+ // targetDevice: string = 'all';
43
+
44
+
34
45
  // 组件图标,用于设置在编辑器左侧组件面板中展示的图标
35
46
  iconUrl: string = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
36
47
 
37
48
  // 初次插入页面的默认属性数据
38
49
  defaultComProps = {
39
- title:
40
- '营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。',
41
- label: '信息卡片',
42
- backgroundImage: 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg',
43
- imgCount: 3,
44
- commentCount: 2025,
50
+ title: 'Hello, NeoCRM!'
45
51
  };
46
52
 
47
53
  /**
@@ -52,8 +58,7 @@ export class CmpModel {
52
58
  type: 'textarea',
53
59
  name: 'title',
54
60
  label: '组件内容',
55
- value:
56
- 'Hello, NeoCRM!',
61
+ value: 'Hello, NeoCRM!',
57
62
  },
58
63
  ];
59
64
  }
@@ -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.8.18",
49
+ "neo-cmp-cli": "^1.8.20",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.5"
@@ -101,7 +101,7 @@ module.exports = {
101
101
  },
102
102
  // 授权码授权模式下的 NeoCRM 平台配置
103
103
  neoConfig: {
104
- authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
104
+ // authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
105
105
  neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
106
106
  // 当 authType 为 oauth2 时,loginURL 配置项必填
107
107
  loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
@@ -46,7 +46,7 @@
46
46
  "axios": "^0.27.2",
47
47
  "antd": "^4.9.4",
48
48
  "lodash": "^4.17.21",
49
- "neo-open-api": "^1.1.6"
49
+ "neo-open-api": "^1.1.9"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@commitlint/cli": "^8.3.5",
@@ -54,7 +54,7 @@
54
54
  "@types/react": "^16.9.11",
55
55
  "@types/react-dom": "^16.9.15",
56
56
  "@types/axios": "^0.14.0",
57
- "neo-cmp-cli": "^1.8.18",
57
+ "neo-cmp-cli": "^1.8.20",
58
58
  "husky": "^4.2.5",
59
59
  "lint-staged": "^10.2.9",
60
60
  "prettier": "^2.0.5"
@@ -36,7 +36,7 @@ export class EntityTableModel {
36
36
  * customPage: 6 自定义页面
37
37
  * bizPage: 7 业务页面
38
38
  */
39
- // targetPage: string[] = ['customPage'];
39
+ targetPage: string[] = ['all'];
40
40
 
41
41
  /** 初次插入页面的默认属性数据 */
42
42
  defaultComProps = {
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
- "neo-cmp-cli": "^1.8.18",
48
+ "neo-cmp-cli": "^1.8.20",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5"
@@ -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.8.18",
50
+ "neo-cmp-cli": "^1.8.20",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
- "neo-cmp-cli": "^1.8.18",
48
+ "neo-cmp-cli": "^1.8.20",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5",
@@ -1,7 +1,7 @@
1
1
  const { execSync } = require('child_process');
2
2
 
3
3
  // 所有需要废弃的版本
4
- const versionsToDeprecate = ["1.8.10", "1.8.11", "1.8.12", "1.8.13", "1.8.15", "1.8.16", "1.8.17", "1.8.18"];
4
+ const versionsToDeprecate = ["1.8.15", "1.8.17", "1.8.18"];
5
5
 
6
6
  const packageName = 'neo-cmp-cli';
7
7
  const deprecateMessage = '此版本为开发中版本(存在 bug),请升级到最新版本。';