neo-cmp-cli 1.9.23 → 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.
@@ -1 +1 @@
1
- "use strict";var t,e;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.__require=function(){if(e)return t;function r(t){const e=[];return t&&0!==t.trim().length?(t.length<2&&e.push(`组件API名称长度必须至少2个字符,当前长度: ${t.length}`),/^[a-z]/.test(t)||e.push("组件API名称必须以小写字母开头(驼峰命名规范)"),/^[a-z][a-zA-Z0-9_]*$/.test(t)||e.push("组件API名称只能包含字母、数字和下划线(_),且必须以小写字母开头"),t.startsWith("_")&&e.push("组件API名称不能以下划线开头"),t.endsWith("__c")||e.push("组件API名称必须以 __c 结尾"),{isValid:0===e.length,errors:e}):(e.push("组件API名称不能为空"),{isValid:!1,errors:e})}return e=1,t={validateApiName:r,isValidApiName:function(t){return r(t).isValid},getApiNameErrors:function(t){return r(t).errors},ensureApiNameSuffix:function(t){return t&&0!==t.trim().length?t.endsWith("__c")?t:t+"__c":t}}};
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"),t=require("./hasCmpTypeByDir.js"),i=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 l=e,u=r,d=o,{consoleTag:_}=s.__require(),q=c.__require(),f=t.__require(),g=i.__require(),{validateApiName:j,ensureApiNameSuffix:x}=n.__require(),{errorLog:y}=m.__require(),$={widgetInfo:{cmpName:"CustomCmp",modelName:"CmpModel",cmpClassName:"custom-cmp-container",cmpType:"xx-custom-cmp",cmpLabel:"xx组件"},dir:u.resolve(__dirname,"../../../template/empty-cmp")};return p=function(e,r="./src/components"){const o=$.dir;let s=e||"neoCustomCmp__c";s=x(s);const{isValid:c,errors:t}=j(s);c||(y(t.join("\n")),process.exit(1));const i=u.resolve(process.cwd(),r,s);g()||(console.error(`${_}当前(${process.cwd()})还不是自定义组件项目,请先创建一个自定义组件项目(neo init / neo create project)。`),process.exit(1)),f(s)&&(console.error(`${_}创建自定义组件失败,当前项目已经存在${s}自定义组件。`),process.exit(1)),l.copy(o,i).then(()=>{const e=d.camelCase(s),r=s;q(i,{[$.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))}};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.9.23",
3
+ "version": "1.9.25",
4
4
  "description": "Neo 自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -1,7 +1,7 @@
1
1
  const { execSync } = require('child_process');
2
2
 
3
3
  // 所有需要废弃的版本
4
- const versionsToDeprecate = ["1.9.11", "1.9.12", "1.9.13", "1.9.15", "1.9.16"];
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),请升级到最新版本。';