neo-cmp-cli 1.8.25 → 1.8.26

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.8.25";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.26";const o={version:e};exports.default=o,exports.version=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("node:fs"),t=require("node:path"),s=require("lodash"),o=require("akfun"),r=require("../pathUtils.js"),i=require("ora"),a=require("../../neo/neoService.js"),n=require("../common.js"),c=require("../projectUtils/createCmpProjectZip.js");var l,p;exports.__require=function(){if(p)return l;p=1;const u=e,g=t,d=s,{getConfigObj:m}=o,{catchCurPackageJson:w}=r.__require(),h=i,b=a.__require(),{getFramework:f,errorLog:y,successLog:C}=n.__require(),$=c.__require(),q=m(w()),T=(e=[])=>e.map(e=>({label:e.label,description:e.description,propSchema:JSON.stringify(e)}));return l=async(e,t)=>{const s=h("正在发布组件...").start();try{let o,r=new b(e);await r.ensureValidToken(),s.start("[1/4] 打包源码文件(含单个自定义组件源码)...");try{o=$(t,process.cwd(),e.assetsRoot),o?C(`[1/4] 源码文件打包完成: ${g.basename(o)}。`,s):y("[1/4] 源码文件打包失败,未返回 zip 文件路径。",s)}catch(e){y("[1/4] 源码文件打包失败。",s)}s.start("[2/4] 获取自定义组件构建产物...");const i=await r.getCmpAssets(t);let a;s.start("[3/4] 构建组件数据...");try{a=await(async(e,t)=>{if(!t||!t.cmpType)return y("自定义组件信息或组件名称不能为空"),null;const{cmpType:s}=t;if(!e||!u.existsSync(e))return y(`未找到自定义组件目录: ${e}`),null;const o=d.camelCase(s),r=g.join(e,`${o}Model.js`),i=globalThis.window;globalThis.window||(globalThis.window={console:console,neoRequire:()=>{},postMessage:()=>{}});try{u.existsSync(r)?require(r):(y(`未找到自定义组件模型文件,请检查以下路径是否存在:${r}`),process.exit(1)),globalThis.window&&globalThis.window.NEOEditorCustomModels||(y(`模型文件未导出有效模型方法(CatchCustomCmpModelClass),模型文件地址: ${r} `),process.exit(1));const e=globalThis.window.NEOEditorCustomModels[s];e||(y(`未找到自定义组件模型类(${s}),模型文件地址: ${r} `),process.exit(1));const o=new e;o||(y(`未找到自定义组件模型信息(${s}),模型文件地址: ${r} `),process.exit(1));const i={...t,version:q.version||"1.0.0",framework:q.framework?f(q.framework):0,label:o.label||s,description:o.description||"",componentCategory:(o.tags||["自定义组件"]).join(","),targetPage:o.targetPage||["customPage"],targetObject:o.targetObject||["all"],targetApplication:o.targetApplication||["all"],targetDevice:o.targetDevice||"all",iconUrl:o.iconUrl||o.iconUrl,defaultProps:JSON.stringify(o.defaultComProps||{}),previewProps:JSON.stringify(o.previewComProps||{}),props:T(o.propsSchema||[]),events:o.events||[],functions:o.functions||o.actions||[],exposedToDesigner:void 0===o.exposedToDesigner||o.exposedToDesigner,namespace:o.namespace||"neo-cmp-cli",enableDuplicate:void 0===o.enableDuplicate||o.enableDuplicate};return console.log(`自定义组件模型信息(${s}):`,d.omit(i,["assetFile","modelAssetFile","cssAssetFile","codeLibFile"])),i}catch(e){return y(`自定义组件模型文件解析失败 (${r||"未知路径"}): ${e.message}`),y(e.stack),null}finally{void 0===i?delete globalThis.window:globalThis.window=i}})(e.assetsRoot,i),a?C("[3/4] 组件数据构建完成。",s):y(`[3/4] 未获取到自定义组件模型信息(${t})。`,s)}catch(e){y(`[3/4] 组件数据构建失败: ${e.message}`,s)}s.start("[4/4] 保存组件信息到 NeoCRM 平台...");try{await r.updateCustomComponent(a),C("[4/4] 组件信息保存成功",s)}catch(e){y("[4/4] 组件信息保存失败",s)}const{tenant_id:n,instance_uri:c}=r.tokenCache||{};console.log(`\n✅ 自定义组件发布成功!\n(当前租户 ID: ${n},所在租户的 API 域名: ${c}。)`)}catch(e){try{s&&s.isSpinning&&y(`❌ 自定义组件发布失败: ${e.message}`,s)}catch{y(`\n❌ 自定义组件发布失败: ${e.message}`)}throw e}},l};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("node:fs"),t=require("node:path"),o=require("lodash"),s=require("akfun"),r=require("../pathUtils.js"),i=require("ora"),a=require("../../neo/neoService.js"),n=require("../common.js"),c=require("../projectUtils/createCmpProjectZip.js");var l,p;exports.__require=function(){if(p)return l;p=1;const u=e,g=t,d=o,{getConfigObj:m}=s,{catchCurPackageJson:w}=r.__require(),h=i,b=a.__require(),{getFramework:y,errorLog:f,successLog:C}=n.__require(),$=c.__require(),q=m(w()),T=(e=[])=>e.map(e=>({label:e.label,description:e.description,propSchema:JSON.stringify(e)})),v=(e=[],t)=>e&&0!==e.length?e.map(e=>({...e,componentType:t})):[];return l=async(e,t)=>{const o=h("正在发布组件...").start();try{let s,r=new b(e);await r.ensureValidToken(),o.start("[1/4] 打包源码文件(含单个自定义组件源码)...");try{s=$(t,process.cwd(),e.assetsRoot),s?C(`[1/4] 源码文件打包完成: ${g.basename(s)}。`,o):f("[1/4] 源码文件打包失败,未返回 zip 文件路径。",o)}catch(e){f("[1/4] 源码文件打包失败。",o)}o.start("[2/4] 获取自定义组件构建产物...");const i=await r.getCmpAssets(t);let a;o.start("[3/4] 构建组件数据...");try{a=await(async(e,t)=>{if(!t||!t.cmpType)return f("自定义组件信息或组件名称不能为空"),null;const{cmpType:o}=t;if(!e||!u.existsSync(e))return f(`未找到自定义组件目录: ${e}`),null;const s=d.camelCase(o),r=g.join(e,`${s}Model.js`),i=globalThis.window;globalThis.window||(globalThis.window={console:console,neoRequire:()=>{},postMessage:()=>{}});try{u.existsSync(r)?require(r):(f(`未找到自定义组件模型文件,请检查以下路径是否存在:${r}`),process.exit(1)),globalThis.window&&globalThis.window.NEOEditorCustomModels||(f(`模型文件未导出有效模型方法(CatchCustomCmpModelClass),模型文件地址: ${r} `),process.exit(1));const e=globalThis.window.NEOEditorCustomModels[o];e||(f(`未找到自定义组件模型类(${o}),模型文件地址: ${r} `),process.exit(1));const s=new e;s||(f(`未找到自定义组件模型信息(${o}),模型文件地址: ${r} `),process.exit(1));const i={...t,version:q.version||"1.0.0",framework:q.framework?y(q.framework):0,label:s.label||o,description:s.description||"",componentCategory:(s.tags||["自定义组件"]).join(","),targetPage:s.targetPage||["customPage"],targetObject:s.targetObject||["all"],targetApplication:s.targetApplication||["all"],targetDevice:s.targetDevice||"all",iconUrl:s.iconUrl||s.iconUrl,defaultProps:JSON.stringify(s.defaultComProps||{}),previewProps:JSON.stringify(s.previewComProps||{}),props:T(s.propsSchema||[]),events:v(s.events||[],o),functions:s.functions||s.actions||[],exposedToDesigner:void 0===s.exposedToDesigner||s.exposedToDesigner,namespace:s.namespace||"neo-cmp-cli",enableDuplicate:void 0===s.enableDuplicate||s.enableDuplicate};return console.log(`自定义组件模型信息(${o}):`,d.omit(i,["assetFile","modelAssetFile","cssAssetFile","codeLibFile"])),i}catch(e){return f(`自定义组件模型文件解析失败 (${r||"未知路径"}): ${e.message}`),f(e.stack),null}finally{void 0===i?delete globalThis.window:globalThis.window=i}})(e.assetsRoot,i),a?C("[3/4] 组件数据构建完成。",o):f(`[3/4] 未获取到自定义组件模型信息(${t})。`,o)}catch(e){f(`[3/4] 组件数据构建失败: ${e.message}`,o)}o.start("[4/4] 保存组件信息到 NeoCRM 平台...");try{await r.updateCustomComponent(a),C("[4/4] 组件信息保存成功",o)}catch(e){f("[4/4] 组件信息保存失败",o)}const{tenant_id:n,instance_uri:c}=r.tokenCache||{};console.log(`\n✅ 自定义组件发布成功!\n(当前租户 ID: ${n},所在租户的 API 域名: ${c}。)`)}catch(e){try{o&&o.isSpinning&&f(`❌ 自定义组件发布失败: ${e.message}`,o)}catch{f(`\n❌ 自定义组件发布失败: ${e.message}`)}throw e}},l};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.8.25",
3
+ "version": "1.8.26",
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.25",
51
+ "neo-cmp-cli": "^1.8.26",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5"
@@ -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.25",
51
+ "neo-cmp-cli": "^1.8.26",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5",
@@ -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.25",
49
+ "neo-cmp-cli": "^1.8.26",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.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.25",
57
+ "neo-cmp-cli": "^1.8.26",
58
58
  "husky": "^4.2.5",
59
59
  "lint-staged": "^10.2.9",
60
60
  "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.25",
48
+ "neo-cmp-cli": "^1.8.26",
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.25",
50
+ "neo-cmp-cli": "^1.8.26",
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.25",
48
+ "neo-cmp-cli": "^1.8.26",
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.15", "1.8.17", "1.8.18", "1.8.19", "1.8.20", "1.8.21"];
4
+ const versionsToDeprecate = ["1.8.20", "1.8.21", "1.8.22", "1.8.23", "1.8.24", "1.8.25"];
5
5
 
6
6
  const packageName = 'neo-cmp-cli';
7
7
  const deprecateMessage = '此版本为开发中版本(存在 bug),请升级到最新版本。';