neo-cmp-cli 1.9.9 → 1.9.10
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/dist/neo/pushCmp.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -1
- package/template/antd-custom-cmp-template/package.json +1 -1
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/empty-custom-cmp-template/package.json +1 -1
- package/template/neo-custom-cmp-template/package.json +1 -1
- package/template/pageHtml/auth-error.html +25 -16
- package/template/pageHtml/auth-failed.html +25 -16
- package/template/pageHtml/auth-success.html +25 -17
- package/template/pageHtml/token-error.html +29 -18
- package/template/react-custom-cmp-template/package.json +1 -1
- package/template/react-ts-custom-cmp-template/package.json +1 -1
- package/template/vue2-custom-cmp-template/package.json +1 -1
- package/test/deprecate-versions.js +1 -1
package/dist/neo/pushCmp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("node:fs"),t=require("node:path"),s=require("lodash"),r=require("akfun"),o=require("ora"),a=require("./neoService.js"),i=require("../utils/common.js"),n=require("../utils/pathUtils.js"),c=require("../utils/projectUtils/createCmpProjectZip.js"),l=require("../utils/projectUtils/updatePublishLog.js");var p,u;exports.__require=function(){if(u)return p;u=1;const g=e,m=t,d=s,{getConfigObj:w}=r,y=o,h=a.__require(),{getFramework:f,errorLog:b,successLog:v}=i.__require(),{catchCurPackageJson:T}=n.__require(),C=c.__require(),q=l.__require(),P=w(T()),$=(e=[])=>e.map(e=>({label:e.label,description:e.description,propSchema:JSON.stringify(e)})),j=(e=[],t)=>e&&0!==e.length?e.map(e=>({...e,componentType:t,eventCategory:e.eventCategory||2,pageType:e.pageType||1,targetDevice:e.targetDevice||1,eventParams:e.eventParams||[]})):[],_=(e=[],t)=>e&&0!==e.length?e.map(e=>({...e,componentType:t,funcScope:e.funcScope||
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("node:fs"),t=require("node:path"),s=require("lodash"),r=require("akfun"),o=require("ora"),a=require("./neoService.js"),i=require("../utils/common.js"),n=require("../utils/pathUtils.js"),c=require("../utils/projectUtils/createCmpProjectZip.js"),l=require("../utils/projectUtils/updatePublishLog.js");var p,u;exports.__require=function(){if(u)return p;u=1;const g=e,m=t,d=s,{getConfigObj:w}=r,y=o,h=a.__require(),{getFramework:f,errorLog:b,successLog:v}=i.__require(),{catchCurPackageJson:T}=n.__require(),C=c.__require(),q=l.__require(),P=w(T()),$=(e=[])=>e.map(e=>({label:e.label,description:e.description,propSchema:JSON.stringify(e)})),j=(e=[],t)=>e&&0!==e.length?e.map(e=>({...e,componentType:t,eventCategory:e.eventCategory||2,pageType:e.pageType||1,targetDevice:e.targetDevice||1,eventParams:e.eventParams||[]})):[],_=(e=[],t)=>e&&0!==e.length?e.map(e=>({...e,componentType:t,funcScope:e.funcScope||1,pageType:e.pageType||1,targetDevice:e.targetDevice||1,custom:!0,funcInParams:e.funcInParams||[],funcOutParams:e.funcOutParams||[]})):[];return p=async(e,t)=>{const s=y("正在发布组件...").start();try{let r,o=new h(e);await o.ensureValidToken(),s.start("[1/4] 打包源码文件(含单个自定义组件源码)...");try{r=C(t,process.cwd(),e.assetsRoot),r?v(`[1/4] 源码文件打包完成: ${m.basename(r)}。`,s):b("[1/4] 源码文件打包失败,未返回 zip 文件路径。",s)}catch(e){b("[1/4] 源码文件打包失败。",s)}s.start("[2/4] 获取自定义组件构建产物...");const a=await o.getCmpAssets(t);let i;s.start("[3/4] 构建组件数据...");try{i=await(async(e,t)=>{if(!t||!t.cmpType)return b("自定义组件信息或组件名称不能为空"),null;const{cmpType:s}=t;if(!e||!g.existsSync(e))return b(`未找到自定义组件目录: ${e}`),null;const r=d.camelCase(s),o=m.join(e,`${r}Model.js`),a=globalThis.window;globalThis.window||(globalThis.window={console:console,neoRequire:()=>{},postMessage:()=>{}});try{g.existsSync(o)?require(o):(b(`未找到自定义组件模型文件,请检查以下路径是否存在:${o}`),process.exit(1)),globalThis.window&&globalThis.window.NEOEditorCustomModels||(b(`模型文件未导出有效模型方法(CatchCustomCmpModelClass),模型文件地址: ${o} `),process.exit(1));const e=globalThis.window.NEOEditorCustomModels[s];e||(b(`未找到自定义组件模型类(${s}),模型文件地址: ${o} `),process.exit(1));const r=new e;return r||(b(`未找到自定义组件模型信息(${s}),模型文件地址: ${o} `),process.exit(1)),{...t,version:P.version||"1.0.0",framework:P.framework?f(P.framework):0,label:r.label||s,description:r.description||"",componentCategory:(r.tags||["自定义组件"]).join(","),targetPage:r.targetPage||["customPage"],targetObject:r.targetObject||["all"],targetApplication:r.targetApplication||["all"],targetDevice:r.targetDevice||"all",iconUrl:r.iconUrl||r.iconUrl,defaultProps:JSON.stringify(r.defaultComProps||{}),previewProps:JSON.stringify(r.previewComProps||{}),props:$(r.propsSchema||[]),events:j(r.events||[],s),functions:_(r.functions||r.actions||[],s),exposedToDesigner:void 0===r.exposedToDesigner||r.exposedToDesigner,namespace:r.namespace||"neo-cmp-cli",enableDuplicate:void 0===r.enableDuplicate||r.enableDuplicate}}catch(e){return b(`自定义组件模型文件解析失败 (${o||"未知路径"}): ${e.message||e.msg}`),b(e.stack),null}finally{void 0===a?delete globalThis.window:globalThis.window=a}})(e.assetsRoot,a),i?v("[3/4] 组件数据构建完成。",s):b(`[3/4] 未获取到自定义组件模型信息(${t})。`,s)}catch(e){b(`[3/4] 组件数据构建失败: ${e.message||e.msg}`,s)}s.start("[4/4] 保存组件信息到 NeoCRM 平台..."),q(d.omit(i,["assetFile","modelAssetFile","cssAssetFile","codeLibFile"]));try{await o.updateCustomComponent(i),v("[4/4] 组件信息保存成功",s)}catch(e){b("[4/4] 组件信息保存失败",s)}const{tenant_id:n,instance_uri:c}=o.tokenCache||{};console.log(`\n✅ 自定义组件发布成功!\n(当前租户 ID: ${n||"未返回"},所在租户的 API 域名: ${c||"未返回"}。)`)}catch(e){try{s&&s.isSpinning&&b(`❌ 自定义组件发布失败: ${e.message||e.msg}`,s)}catch{b(`\n❌ 自定义组件发布失败: ${e.message||e.msg}`)}throw e}},p};
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.9.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.9.10";const o={version:e};exports.default=o,exports.version=e;
|
package/package.json
CHANGED
|
@@ -5,33 +5,42 @@
|
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<style>
|
|
7
7
|
.container {
|
|
8
|
-
margin: 0 auto;
|
|
9
|
-
padding-top:
|
|
8
|
+
margin: 120px auto 0 auto;
|
|
9
|
+
padding-top: 0;
|
|
10
10
|
text-align: center;
|
|
11
|
+
font-family: "PingFang SC";
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 400;
|
|
11
14
|
}
|
|
12
|
-
.
|
|
13
|
-
|
|
15
|
+
.result-content {
|
|
16
|
+
margin: 24px auto 32px auto;
|
|
14
17
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
.result-content .title {
|
|
19
|
+
font-size: 18px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 28px;
|
|
22
|
+
color: #222;
|
|
23
|
+
}
|
|
24
|
+
.result-content .error-title {
|
|
25
|
+
color: red;
|
|
18
26
|
}
|
|
19
|
-
.
|
|
20
|
-
font-size:
|
|
21
|
-
|
|
27
|
+
.result-content .detail {
|
|
28
|
+
font-size: 13px;
|
|
29
|
+
color: #454545;
|
|
22
30
|
}
|
|
23
|
-
.info
|
|
24
|
-
font-size:
|
|
31
|
+
.tenant-info {
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
line-height: 20px;
|
|
25
34
|
color: #666;
|
|
26
35
|
}
|
|
27
36
|
</style>
|
|
28
37
|
</head>
|
|
29
38
|
<body>
|
|
30
39
|
<div class="container">
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
<img src="https://custom-widgets.bj.bcebos.com/neocrmlogin.png" alt="NeoCRM" />
|
|
41
|
+
<div class="result-content">
|
|
42
|
+
<div class="title error-title">授权失败</div>
|
|
43
|
+
<div class="detail">错误信息: {{ERROR}}</div>
|
|
35
44
|
</div>
|
|
36
45
|
</div>
|
|
37
46
|
</body>
|
|
@@ -5,33 +5,42 @@
|
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<style>
|
|
7
7
|
.container {
|
|
8
|
-
margin: 0 auto;
|
|
9
|
-
padding-top:
|
|
8
|
+
margin: 120px auto 0 auto;
|
|
9
|
+
padding-top: 0;
|
|
10
10
|
text-align: center;
|
|
11
|
+
font-family: "PingFang SC";
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 400;
|
|
11
14
|
}
|
|
12
|
-
.
|
|
13
|
-
|
|
15
|
+
.result-content {
|
|
16
|
+
margin: 24px auto 32px auto;
|
|
14
17
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
.result-content .title {
|
|
19
|
+
font-size: 18px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 28px;
|
|
22
|
+
color: #222;
|
|
23
|
+
}
|
|
24
|
+
.result-content .error-title {
|
|
25
|
+
color: red;
|
|
18
26
|
}
|
|
19
|
-
.
|
|
20
|
-
font-size:
|
|
21
|
-
|
|
27
|
+
.result-content .detail {
|
|
28
|
+
font-size: 13px;
|
|
29
|
+
color: #454545;
|
|
22
30
|
}
|
|
23
|
-
.info
|
|
24
|
-
font-size:
|
|
31
|
+
.tenant-info {
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
line-height: 20px;
|
|
25
34
|
color: #666;
|
|
26
35
|
}
|
|
27
36
|
</style>
|
|
28
37
|
</head>
|
|
29
38
|
<body>
|
|
30
39
|
<div class="container">
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
<img src="https://custom-widgets.bj.bcebos.com/neocrmlogin.png" alt="NeoCRM" />
|
|
41
|
+
<div class="result-content">
|
|
42
|
+
<div class="title error-title">授权失败</div>
|
|
43
|
+
<div class="detail">未获取到授权码。</div>
|
|
35
44
|
</div>
|
|
36
45
|
</div>
|
|
37
46
|
</body>
|
|
@@ -5,34 +5,42 @@
|
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<style>
|
|
7
7
|
.container {
|
|
8
|
-
margin: 0 auto;
|
|
9
|
-
padding-top:
|
|
8
|
+
margin: 120px auto 0 auto;
|
|
9
|
+
padding-top: 0;
|
|
10
10
|
text-align: center;
|
|
11
|
+
font-family: "PingFang SC";
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 400;
|
|
11
14
|
}
|
|
12
|
-
.
|
|
13
|
-
|
|
15
|
+
.result-content {
|
|
16
|
+
margin: 24px auto 32px auto;
|
|
14
17
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
.result-content .title {
|
|
19
|
+
font-size: 18px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 28px;
|
|
22
|
+
color: #222;
|
|
18
23
|
}
|
|
19
|
-
.
|
|
20
|
-
font-size:
|
|
21
|
-
|
|
24
|
+
.result-content .detail {
|
|
25
|
+
font-size: 13px;
|
|
26
|
+
color: #454545;
|
|
22
27
|
}
|
|
23
|
-
.
|
|
24
|
-
font-size:
|
|
28
|
+
.tenant-info {
|
|
29
|
+
font-size: 13px;
|
|
30
|
+
line-height: 20px;
|
|
25
31
|
color: #666;
|
|
26
32
|
}
|
|
27
33
|
</style>
|
|
28
34
|
</head>
|
|
29
35
|
<body>
|
|
30
36
|
<div class="container">
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
<div class="
|
|
35
|
-
|
|
37
|
+
<img src="https://custom-widgets.bj.bcebos.com/neocrmlogin.png" alt="NeoCRM" />
|
|
38
|
+
<div class="result-content">
|
|
39
|
+
<div class="title">授权成功!</div>
|
|
40
|
+
<div class="detail">您已成功授权开发账户,请关闭此页面。</div>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="tenant-info">
|
|
43
|
+
租户 ID: {{TENANT_ID}},所在租户的 API 域名: {{INSTANCE_URI}}。
|
|
36
44
|
</div>
|
|
37
45
|
</div>
|
|
38
46
|
</body>
|
|
@@ -1,38 +1,49 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
|
-
<title
|
|
4
|
+
<title>授权失败</title>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<style>
|
|
7
7
|
.container {
|
|
8
|
-
margin: 0 auto;
|
|
9
|
-
padding-top:
|
|
8
|
+
margin: 120px auto 0 auto;
|
|
9
|
+
padding-top: 0;
|
|
10
10
|
text-align: center;
|
|
11
|
+
font-family: "PingFang SC";
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 400;
|
|
11
14
|
}
|
|
12
|
-
.
|
|
13
|
-
|
|
15
|
+
.result-content {
|
|
16
|
+
margin: 24px auto 32px auto;
|
|
14
17
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
.result-content .title {
|
|
19
|
+
font-size: 18px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 28px;
|
|
22
|
+
color: #222;
|
|
18
23
|
}
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
font-weight: bold;
|
|
24
|
+
.result-content .error-title {
|
|
25
|
+
color: red;
|
|
22
26
|
}
|
|
23
|
-
.
|
|
24
|
-
font-size:
|
|
27
|
+
.result-content .detail {
|
|
28
|
+
font-size: 13px;
|
|
29
|
+
color: #454545;
|
|
30
|
+
}
|
|
31
|
+
.tenant-info {
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
line-height: 20px;
|
|
25
34
|
color: #666;
|
|
26
35
|
}
|
|
27
36
|
</style>
|
|
28
37
|
</head>
|
|
29
38
|
<body>
|
|
30
39
|
<div class="container">
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
<img src="https://custom-widgets.bj.bcebos.com/neocrmlogin.png" alt="NeoCRM" />
|
|
41
|
+
<div class="result-content">
|
|
42
|
+
<div class="title error-title">授权失败</div>
|
|
43
|
+
<div class="detail">未获取到用户 token 信息,请重试。</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="tenant-info">
|
|
46
|
+
错误信息: {{ERROR}}。
|
|
36
47
|
</div>
|
|
37
48
|
</div>
|
|
38
49
|
</body>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { execSync } = require('child_process');
|
|
2
2
|
|
|
3
3
|
// 所有需要废弃的版本
|
|
4
|
-
const versionsToDeprecate = ["1.9.
|
|
4
|
+
const versionsToDeprecate = ["1.9.9"];
|
|
5
5
|
|
|
6
6
|
const packageName = 'neo-cmp-cli';
|
|
7
7
|
const deprecateMessage = '此版本为开发中版本(存在 bug),请升级到最新版本。';
|