neo-cmp-cli 1.9.22 → 1.9.25
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/env.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/utils/cmpTypeValidator.js +1 -1
- package/dist/utils/cmpUtils/createCmpByTemplate.js +1 -1
- package/package.json +1 -1
- package/template/neo-custom-cmp-template/src/components/entityCardList__c/index.tsx +2 -0
- package/template/neo-custom-cmp-template/src/components/entityForm__c/index.tsx +2 -0
- package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +2 -0
- package/test/deprecate-versions.js +1 -1
package/dist/neo/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash");var t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash");var t,e;exports.__require=function(){if(e)return t;e=1;const a=o,s={neoBaseURL:"https://crm.xiaoshouyi.com",loginURL:"https://login.xiaoshouyi.com/auc/oauth2/auth",tokenURL:"https://login.xiaoshouyi.com/auc/oauth2/token"},n={neoBaseURL:"https://crm-gray.xiaoshouyi.com",loginURL:"https://login.xiaoshouyi.com/auc/oauth2/auth",tokenURL:"https://login.xiaoshouyi.com/auc/oauth2/token"},u={neoBaseURL:"https://crm-sandbox.xiaoshouyi.com",loginURL:"https://login-sandbox.xiaoshouyi.com/auc/oauth2/auth",tokenURL:"https://login-sandbox.xiaoshouyi.com/auc/oauth2/token"},i={neoBaseURL:"https://crm-cd.xiaoshouyi.com",loginURL:"https://login-cd.xiaoshouyi.com/auc/oauth2/auth",tokenURL:"https://login-cd.xiaoshouyi.com/auc/oauth2/token"},c={neoBaseURL:"https://crm-cd.xiaoshouyi.com",loginURL:"https://login-cd.xiaoshouyi.com/auc/oauth2/auth",tokenURL:"https://login-cd.xiaoshouyi.com/auc/oauth2/token",delete:"/rest/metadata/v3.0/ui/customComponents",saveAPI:"/rest/metadata/v3.0/ui/customComponents/actions/saveOrUpdateComponent",queryAll:"/rest/metadata/v3.0/ui/components/filter?custom=true",getCodeLibAPI:o=>`/rest/metadata/v3.0/ui/customComponents/${o}/codeLib`,uploadAPI:"/rest/metadata/v3.0/ui/customComponents/actions/upload",query:"/rest/metadata/v3.0/ui/customComponents/actions/queryCustomComponents"};return t={DefaultNeoCrmAPI:c,getNeoCrmAPI:(o="cd",t={})=>{let e=a.cloneDeep(c),h=i;switch(o){case"production":h=s;break;case"gray":h=n;break;case"sandbox":h=u;break;case"cd":default:h=i;break;case"custom":h={...t,neoBaseURL:t.neoBaseURL,loginURL:t.loginURL||t.loginAPI,tokenURL:t.tokenURL||t.tokenAPI}}return{...e,...h}}}};
|
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.23";const o={version:e};exports.default=o,exports.version=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e,r;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.__require=function(){if(r)return e;function t(e){const r=[];return e&&0!==e.trim().length?(e.length<2&&r.push(`组件API名称长度必须至少2个字符,当前长度: ${e.length}`),/^[a-z]/.test(e)||r.push("组件API名称必须以小写字母开头(驼峰命名规范)"),/^[a-z][a-zA-Z0-9_]*$/.test(e)||r.push("组件API名称只能包含字母、数字和下划线(_),且必须以小写字母开头"),e.startsWith("_")&&r.push("组件API名称不能以下划线开头"),e.endsWith("__c")||r.push("组件API名称必须以 __c 结尾"),{isValid:0===r.length,errors:r}):(r.push("组件API名称不能为空"),{isValid:!1,errors:r})}return r=1,e={validateApiName:t,isValidApiName:function(e){return t(e).isValid},getApiNameErrors:function(e){return t(e).errors},ensureApiNameSuffix:function(e){return e&&0!==e.trim().length?e.endsWith("__c")?e:e+"__c":e},removeApiNameSuffix:function(e){return e&&0!==e.trim().length?e.replace("__c",""):e}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("fs-extra"),r=require("node:path"),o=require("lodash"),s=require("../neoParams.js"),c=require("../replaceInFilesByMap.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("fs-extra"),r=require("node:path"),o=require("lodash"),s=require("../neoParams.js"),c=require("../replaceInFilesByMap.js"),i=require("./hasCmpTypeByDir.js"),t=require("../projectUtils/hasNeoProject.js"),n=require("../cmpTypeValidator.js"),m=require("../common.js");var p,a;exports.__require=function(){if(a)return p;a=1;const u=e,l=r,d=o,{consoleTag:_}=s.__require(),q=c.__require(),f=i.__require(),x=t.__require(),{validateApiName:g,ensureApiNameSuffix:j,removeApiNameSuffix:y}=n.__require(),{errorLog:N}=m.__require(),$={widgetInfo:{cmpName:"CustomCmp",modelName:"CmpModel",cmpClassName:"custom-cmp-container",cmpType:"xx-custom-cmp",cmpLabel:"xx组件"},dir:l.resolve(__dirname,"../../../template/empty-cmp")};return p=function(e,r="./src/components"){const o=$.dir;let s=e||"neoCustomCmp__c";s=j(s);const{isValid:c,errors:i}=g(s);c||(N(i.join("\n")),process.exit(1));const t=l.resolve(process.cwd(),r,s);x()||(console.error(`${_}当前(${process.cwd()})还不是自定义组件项目,请先创建一个自定义组件项目(neo init / neo create project)。`),process.exit(1)),f(s)&&(console.error(`${_}创建自定义组件失败,当前项目已经存在${s}自定义组件。`),process.exit(1)),u.copy(o,t).then(()=>{const e=d.camelCase(y(s)),r=s;q(t,{[$.widgetInfo.modelName]:`${e}Model`,[$.widgetInfo.cmpName]:e,[$.widgetInfo.cmpClassName]:`${r}-container`,[$.widgetInfo.cmpType]:r,[$.widgetInfo.cmpLabel]:r}),console.log(`${_}已创建自定义组件(${s})!`)}).catch(e=>console.error(`${_}自定义组件创建失败(${s}):`,e))}};
|
package/package.json
CHANGED
|
@@ -55,11 +55,13 @@ export default class EntityCardList extends BaseCmp<
|
|
|
55
55
|
componentDidMount() {
|
|
56
56
|
this.loadObjectData();
|
|
57
57
|
|
|
58
|
+
/*
|
|
58
59
|
// 监听一个广播事件
|
|
59
60
|
NeoEvent.listen('reloadData', (eventData: any) => {
|
|
60
61
|
console.log('EntityCardList 监听到了一个广播事件 reloadData: ', eventData);
|
|
61
62
|
this.loadObjectData();
|
|
62
63
|
});
|
|
64
|
+
*/
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
componentDidUpdate(prevProps: Readonly<EntityCardListProps>) {
|
|
@@ -237,9 +237,11 @@ export default class EntityForm extends React.PureComponent<
|
|
|
237
237
|
onSubmit() {
|
|
238
238
|
console.log('触发了表单提交事件:', this.props);
|
|
239
239
|
|
|
240
|
+
/*
|
|
240
241
|
// 触发一个广播事件
|
|
241
242
|
console.log('触发了一个广播事件 reloadData。');
|
|
242
243
|
NeoEvent.broadcast('reloadData', this.props);
|
|
244
|
+
*/
|
|
243
245
|
}
|
|
244
246
|
|
|
245
247
|
/**
|
|
@@ -180,11 +180,13 @@ export default class EntityTable extends BaseCmp<
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
/*
|
|
183
184
|
// 监听一个广播事件
|
|
184
185
|
NeoEvent.listen('reloadData', (eventData: any) => {
|
|
185
186
|
console.log('EntityTable 监听到了一个广播事件 reloadData: ', eventData);
|
|
186
187
|
this.loadData();
|
|
187
188
|
});
|
|
189
|
+
*/
|
|
188
190
|
}
|
|
189
191
|
|
|
190
192
|
/**
|
|
@@ -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.12", "1.9.13", "1.9.15", "1.9.16", "1.9.17", "1.9.18", "1.9.19", "1.9.20", "1.9.21", "1.9.22"];
|
|
5
5
|
|
|
6
6
|
const packageName = 'neo-cmp-cli';
|
|
7
7
|
const deprecateMessage = '此版本为开发中版本(存在 bug),请升级到最新版本。';
|