neo-cmp-cli 1.9.17 → 1.9.18
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 +0 -14
- package/dist/config/auth.config.js +1 -1
- package/dist/config/default.config.js +1 -1
- package/dist/index2.js +1 -1
- package/dist/main2.js +1 -1
- package/dist/neo/deleteCmp.js +1 -1
- package/dist/neo/env.js +1 -0
- package/dist/neo/neoEnvManager.js +1 -0
- package/dist/neo/neoLogin.js +1 -1
- package/dist/neo/neoService.js +1 -1
- package/dist/neo/pullCmp.js +1 -1
- 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/neo.config.js +0 -25
- package/template/echarts-custom-cmp-template/neo.config.js +0 -25
- package/template/empty-custom-cmp-template/neo.config.js +0 -25
- package/template/initData/neo.config.js +0 -25
- package/template/neo-custom-cmp-template/neo.config.js +0 -25
- package/template/react-custom-cmp-template/neo.config.js +0 -25
- package/template/react-ts-custom-cmp-template/neo.config.js +0 -25
- package/template/vue2-custom-cmp-template/neo.config.js +0 -25
- package/test/demo.js +1 -1
package/README.md
CHANGED
|
@@ -160,20 +160,6 @@ OAuth2 授权码模式更加安全可靠,无需用户配置账户名和密码
|
|
|
160
160
|
|
|
161
161
|
功能:清除本地保存的 token 文件,下次使用需要重新登录。
|
|
162
162
|
|
|
163
|
-
#### 配置示例
|
|
164
|
-
|
|
165
|
-
```javascript
|
|
166
|
-
// neo.config.js
|
|
167
|
-
module.exports = {
|
|
168
|
-
neoConfig: {
|
|
169
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
170
|
-
// 登录授权 URL(用于获取 code)
|
|
171
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth',
|
|
172
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址
|
|
173
|
-
},
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
163
|
#### Token 有效期
|
|
178
164
|
|
|
179
165
|
- **access_token**:默认有效期 2 小时
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})
|
|
1
|
+
"use strict";var e,t;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.__require=function(){return t?e:(t=1,e={redirectUri:"http://localhost:1028",getRedirectURI:e=>`http://localhost:${e}`,authType:"oauth2",auth:{response_type:"code",client_id:"04c8b45c4dbe36426a660bf70d3fe3e7",scope:"all",oauthType:"standard",access_type:"offline",client_secret:"370817d1336a3737f95c671eea39a23b",grant_type:"authorization_code"}})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("akfun"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("akfun"),s=require("node:path");var t,o;exports.__require=function(){if(o)return t;o=1;const{resolve:a}=e,r=s,i={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:(n="../../template/initData/defaultTemplate.html",r.resolve(__dirname,n)),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")},pushCmp:{output:{filename:"[name].js",library:{type:"var",export:"default"},globalObject:"this"},cssExtract:!1,assetsRoot:a("dist")}};var n;return t=i};
|
package/dist/index2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./_virtual/index.js"),s=require("figlet"),o=require("yargs"),n=require("chalk"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./_virtual/index.js"),s=require("figlet"),o=require("yargs"),n=require("chalk"),a=require("inquirer"),t=require("ora"),i=require("./main2.js"),p=require("./neo/env.js"),c=require("./package.json.js");var m;exports.__require=function(){if(m)return e.__exports;m=1;const r=s,l=o,u=n,d=a,g=t,{neoInit:h,neoInitByCopy:y,inspect:b,neoConfigInit:v,validateProjectName:C,getCmpTypeByDir:f,NeoService:x,NeoLoginService:$,hasNeoProject:T,consoleTag:U,errorLog:j,successLog:_}=i.__require(),w=i.__require(),{getNeoCrmAPI:q}=p.__require(),N=c.default,M=r.textSync("neo",{font:"Lean"}),S=w.projectConfig,D=function(e){return u.green(u.bold(e))},R={"config init":"初始化配置文件",dev:"开启本地调试模式",build:"构建生产环境代码",build2lib:"构建 UMD 模块",build2esm:"构建 ESM 模块",publish2oss:"发布到 OSS",inspect:"输出配置文件",open:"打开项目"},k={...R,init:"初始化自定义组件项目",login:"登录 NeoCRM 平台",logout:"登出 NeoCRM 平台","create project":"创建自定义组件项目","create cmp":"创建自定义组件",linkDebug:"开启外链调试模式","pull cmp":"拉取线上自定义组件","delete cmp":"删除线上自定义组件",preview:"预览自定义组件","push cmp":"发布自定义组件到平台"};return l.middleware(function(e){if(e.help||e.version)return;const s=function(e){if(!e._||0===e._.length)return"";const s=e._.join(" ");if(k[s])return s;const o=e._[0];return k[o]?o:s||o}(e);if(!s)return;const o=k[s]||s;R[s]&&(console.log(u.green(M)),console.log(u.green(`当前版本:v${N.version}.\n`))),console.log(""),console.log(u.cyan(`执行命令: ${o}`)),console.log("")}).command("init [options]","根据模板创建一个自定义组件",e=>{e.reset().usage(D("Usage")+": $0 init [options]").option("type",{alias:"t",describe:"自定义组件类型(react ts 技术栈/ vue2.0 技术栈/ react 技术栈)"}).option("name",{alias:"n",describe:"自定义组件项目名称"}).alias("h","help")},e=>{if(e.type&&e.name)T()&&(j(`${U}创建自定义组件失败,当前目录(${process.cwd()})已经是一个自定义组件项目,请勿重复创建。`),process.exit(1)),"github"===e.mode?h(e.type,e.name):y(e.type,e.name);else{const s=[],o=[{name:"react&ts 自定义组件",value:"react-ts",short:"react-ts"},{name:"Neo 自定义组件(使用平台实体数据源)",value:"neo",short:"neo"},{name:"antd 自定义组件",value:"antd",short:"antd"},{name:"echarts 自定义组件",value:"echarts",short:"echarts"},{name:"vue2 自定义组件",value:"vue2",short:"vue2"}];e.type||s.push({name:"type",type:"list",message:"请选择您要创建的自定义组件类型: ",default:"react-ts",choices:o}),e.name||s.push({name:"name",type:"input",message:"请设置自定义组件项目名称(默认 neoCustomCmp):",default:"neoCustomCmp"}),d.prompt(s).then(s=>{const{isValid:o,errors:n}=C(s.name);o||(j(n.join("\n")),process.exit(1)),"github"===e.mode?h(s.type,s.name):y(s.type,s.name)})}}).command("config init","创建 neo.config.js 配置文件",e=>{e.reset().usage(D("Usage")+": $0 config init").alias("h","help")},()=>{v("neo.config.js")}).command("login","登录 NeoCRM 平台(OAuth2 授权)",e=>{e.reset().usage(D("Usage")+": $0 login").alias("h","help")},()=>{const e=[{name:"env",type:"list",message:"请选择您要登录的环境:",default:"cd",choices:[{name:"线上生产环境(crm.xiaoshouyi.com)",value:"production"},{name:"灰度环境(crm-gray.xiaoshouyi.com)",value:"gray"},{name:"沙盒环境(crm-sandbox.xiaoshouyi.com)",value:"sandbox"},{name:"开发环境(crm-cd.xiaoshouyi.com)",value:"cd"},{name:"自定义环境(在neo.config.js / neoConfig 中自行配置)",value:"custom"}]}];d.prompt(e).then(async e=>{const s=q(e.env,S.neoConfig);try{const e=new $(s);await e.login(),process.exit(0)}catch(e){j(`\n登录失败: ${e.message||e.msg}`),process.exit(1)}})}).command("logout","登出 NeoCRM 平台",e=>{e.reset().usage(D("Usage")+": $0 logout").alias("h","help")},async()=>{try{const e=new $;await e.logout(),process.exit(0)}catch(e){j(`\n登出失败: ${e.message||e.msg}`),process.exit(1)}}).command("create","创建项目或者组件",e=>e.command("project [options]","创建自定义组件项目(含工程代码)",e=>{e.reset().usage(D("Usage")+": $0 project [options]").option("name",{alias:"n",describe:"自定义组件项目名称"}).alias("h","help")},e=>{if(e.name)w.createCmpProjectByTemplate(e.name);else{const e=[{name:"name",type:"input",message:"请设置自定义组件项目名称:"}];d.prompt(e).then(e=>{const{isValid:s,errors:o}=C(e.name);s||(j(o.join("\n")),process.exit(1)),e.name?w.createCmpProjectByTemplate(e.name):(j("自定义组件项目名称不能为空。"),process.exit(1))})}}).command("cmp [options]","创建自定义组件",e=>{e.reset().usage(D("Usage")+": $0 cmp [options]").option("name",{alias:"n",describe:"自定义组件名称"}).alias("h","help")},e=>{if(e.name)w.createCmpByTemplate(e.name);else{const e=[{name:"name",type:"input",message:"请设置自定义组件名称:"}];d.prompt(e).then(e=>{e.name?w.createCmpByTemplate(e.name):(j("自定义组件名称不能为空。"),process.exit(1))})}})).command("pull cmp [options]","拉取线上自定义组件",e=>{e.reset().usage(D("Usage")+": $0 pull cmp [options]").option("name",{alias:"n",describe:"自定义组件名称"}).alias("h","help")},async e=>{if(e.name)w.pullCmp(e.name);else{const e=new x,s=g("正在拉取线上自定义组件列表...").start(),o=await e.getCustomCmpList();0===o.length&&(j("当前租户暂无任何自定义组件。"),process.exit(1)),s.stop("线上自定义组件列表拉取成功。");const n=[{name:"cmpType",type:"list",message:"请选择要拉取的自定义组件:",choices:o.map(e=>({name:`${e.label}(${e.cmpType})`,value:e.cmpType}))}];d.prompt(n).then(s=>{s.cmpType?w.pullCmp(s.cmpType,e):(j("自定义组件名称不能为空。"),process.exit(1))})}}).command("delete cmp [options]","删除线上自定义组件",e=>{e.reset().usage(D("Usage")+": $0 delete cmp [options]").option("name",{alias:"n",describe:"自定义组件名称"}).alias("h","help")},async e=>{if(e.name)w.deleteCmp(e.name);else{const e=new x,s=g("正在获取线上自定义组件列表...").start(),o=await e.getCustomCmpList();0===o.length&&(j("当前租户暂无任何自定义组件。"),process.exit(1)),s.stop("线上自定义组件列表获取成功。");const n=[{name:"cmpType",type:"list",message:"请选择要删除的自定义组件:",choices:o.map(e=>({name:`${e.label}(${e.cmpType})`,value:e.cmpType}))}];d.prompt(n).then(s=>{s.cmpType?w.deleteCmp(s.cmpType,e):(j("自定义组件名称不能为空。"),process.exit(1))})}}).command("preview [options]","预览指定自定义组件(仅预览组件本身内容)",e=>{e.reset().usage(D("Usage")+": $0 preview [options]").option("name",{alias:"n",describe:"自定义组件名称"}).alias("h","help")},e=>{if(e.name)w.previewCmp(e.name);else{const e=f();0===e.length&&(j("当前自定义组件目录中未找到自定义组件。(./src/components 目录下)"),process.exit(1));const s=[{name:"cmpType",type:"list",message:"请选择要预览的自定义组件:",choices:e.map(e=>({name:e,value:e}))}];d.prompt(s).then(e=>{e.cmpType||(j("未选择要预览的自定义组件。"),process.exit(1)),w.previewCmp(e.cmpType)})}}).command("dev","开启本地调试模式",e=>{e.reset().usage(D("Usage")+": $0 dev").alias("h","help")},()=>{w.dev()}).command("linkDebug","开启外链调试模式(在线上页面设计器端调试)",e=>{e.reset().usage(D("Usage")+": $0 linkDebug").alias("h","help")},e=>{w.linkDebug()}).command("build","构建生产环境代码",e=>{e.reset().usage(D("Usage")+": $0 build").alias("h","help")},e=>{w.build()}).command("build2lib","构建 UMD 模块",e=>{e.reset().usage(D("Usage")+": $0 build2lib").alias("h","help")},e=>{w.build2lib()}).command("publish2oss [options]","发布到oss",e=>{e.reset().usage(D("Usage")+": $0 publish2oss [options]").option("name",{alias:"n",describe:"自定义组件名称"}).alias("h","help")},e=>{if(e.name)w.publish2oss(e.name);else{const e=f();0===e.length&&(j("当前自定义组件目录中未找到自定义组件。(./src/components 目录下)"),process.exit(1));const s=[{name:"cmpType",type:"list",message:"请选择要发布的自定义组件:",choices:e.map(e=>({name:e,value:e}))}];d.prompt(s).then(e=>{e.cmpType||(j("未选择要发布的自定义组件。"),process.exit(1)),w.publish2oss(e.cmpType)})}}).command("push cmp [options]","构建并发布自定义组件到 NeoCRM 平台",e=>{e.reset().usage(D("Usage")+": $0 push cmp [options]").option("name",{alias:"n",describe:"自定义组件名称"}).alias("h","help")},e=>{if(e.name)w.pushCmp(e.name);else{const e=f();0===e.length&&(j("当前自定义组件目录中未找到自定义组件。(./src/components 目录下)"),process.exit(1));const s=[{name:"cmpType",type:"list",message:"请选择要发布的自定义组件:",choices:e.map(e=>({name:e,value:e}))}];d.prompt(s).then(e=>{e.cmpType||(j("未选择要发布的自定义组件。"),process.exit(1)),w.pushCmp(e.cmpType)})}}).command("build2esm","构建 ESM 模块",e=>{e.reset().usage(D("Usage")+": $0 build2esm").alias("h","help")},()=>{w.build2esm()}).command("inspect","输出当前配置文件",e=>{e.reset().usage(D("Usage")+": $0 inspect").option("type",{alias:"t",describe:"环境类型(本地调试环境/生产环境/library构建环境)",default:"build"}).alias("h","help")},e=>{b(e.type)}).command("open [options]","使用 Cursor 或 VSCode 打开项目",e=>{e.reset().usage(D("Usage")+": $0 open [options]").option("editor",{alias:"e",describe:"编辑器类型(cursor/vscode/auto),默认为 auto(自动检测)",default:"auto",choices:["cursor","vscode","code","auto"]}).option("name",{alias:"n",describe:"要打开的项目名称,默认为当前目录"}).alias("h","help")},e=>{w.openEditor(e.editor,e.name)}).alias("h","help").alias("v","version").strict().fail((e,s,o)=>{j(`\n运行命令时发生错误: ${e}。\n`),console.log(D("当前可用命令列表:")),console.log("");[{cmd:"init [options]",desc:"根据模板创建一个自定义组件"},{cmd:"create project [options]",desc:"创建自定义组件项目(含工程代码)"},{cmd:"create cmp [options]",desc:"创建自定义组件"},{cmd:"preview [options]",desc:"预览指定自定义组件(仅预览组件本身内容)"},{cmd:"linkDebug",desc:"开启外链调试模式(在线上页面设计器端调试)"},{cmd:"login",desc:"登录 NeoCRM 平台(OAuth2 授权)"},{cmd:"logout",desc:"登出 NeoCRM 平台"},{cmd:"pull cmp [options]",desc:"拉取线上自定义组件"},{cmd:"delete cmp [options]",desc:"删除线上自定义组件"},{cmd:"push cmp [options]",desc:"构建并发布自定义组件到 NeoCRM 平台"},{cmd:"open [options]",desc:"使用 Cursor 或 VSCode 打开项目"}].forEach(({cmd:e,desc:s})=>{console.log(` ${u.cyan(e.padEnd(25))} ${s}`)}),console.log(""),console.log(`使用 ${u.cyan("neo <command> --help")} 查看具体命令的帮助信息。`),console.log(""),process.exit(1)}).help().updateStrings({"Usage:":D("Usage:"),"Commands:":D("Commands:"),"Options:":D("Options:")}).argv,e.__exports};
|
package/dist/main2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("akfun");require("lodash");const r=require("./module/neoInit.js"),i=require("./module/neoInitByCopy.js"),s=require("./module/inspect.js"),t=require("./utils/neoConfigInit.js"),o=require("./utils/neoParams.js"),u=require("./config/index.js"),l=require("./oss/publish2oss.js"),p=require("./neo/pushCmp.js"),n=require("./neo/pullCmp.js"),c=require("./neo/deleteCmp.js"),d=require("./utils/cmpUtils/previewCmp.js"),b=require("./utils/generateEntries.js"),m=require("./utils/cmpUtils/createCmpByTemplate.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("akfun");require("lodash");const r=require("./module/neoInit.js"),i=require("./module/neoInitByCopy.js"),s=require("./module/inspect.js"),t=require("./utils/neoConfigInit.js"),o=require("./utils/neoParams.js"),u=require("./config/index.js"),l=require("./oss/publish2oss.js"),p=require("./neo/pushCmp.js"),n=require("./neo/pullCmp.js"),c=require("./neo/deleteCmp.js"),d=require("./utils/cmpUtils/previewCmp.js"),b=require("./utils/generateEntries.js"),m=require("./utils/cmpUtils/createCmpByTemplate.js"),q=require("./utils/projectUtils/createCmpProjectByTemplate.js"),a=require("./utils/projectUtils/openProject.js"),_=require("./utils/configureNeoBuild.js"),y=require("./utils/common.js"),g=require("./utils/projectNameValidator.js"),j=require("./utils/cmpUtils/getCmpTypeByDir.js"),v=require("./neo/neoService.js"),T=require("./neo/neoLogin.js"),f=require("./utils/projectUtils/hasNeoProject.js");var C,x;exports.__require=function(){if(x)return C;x=1;const h=e,E=r.__require(),N=i.__require(),w=s.__require(),B=t.__require(),{consoleTag:D}=o.__require(),P=u.__require(),k=l.__require(),I=p.__require(),L=n.__require(),M=c.__require(),U=d.__require(),O=b.__require(),S=m.__require(),R=q.__require(),A=a.__require(),{configureNeoBuild:V}=_.__require(),{errorLog:z,successLog:F}=y.__require(),{validateProjectName:G}=g.__require(),H=j.__require(),J=v.__require(),K=T.__require(),Q=f.__require();function W(e,r){const{entryType:i,cmpType:s}=r;let t=[],o={};try{const{entries:r,cmpTypes:u,defaultExports:l}=O({configEntry:e.entry,disableAutoRegister:e.disableAutoRegister,componentsDir:P.componentsDir,entryType:i,cmpType:s});r&&Object.keys(r).length>0&&(e.entry=r,t=u,console.info("已自动生成 entry 入口配置:",r)),o=l}catch(e){z(e.message||e.msg),process.exit(1)}return{cmpTypes:t,defaultExports:o}}function X(e){return Object.assign(P.build2lib,e)}return C={neoInit:E,neoInitByCopy:N,inspect:w,neoConfigInit:B,projectConfig:P,consoleTag:D,errorLog:z,successLog:F,validateProjectName:G,getCmpTypeByDir:H,NeoService:J,NeoLoginService:K,hasNeoProject:Q,createCmpProjectByTemplate:R,createCmpByTemplate:S,dev:()=>{P.dev||(z("未找到 dev 相关配置。"),process.exit(1)),h.dev(P,D)},previewCmp:e=>{e||(z("请输入要预览的组件名称。"),process.exit(1)),P.preview||(z("未找到 preview 相关配置。"),process.exit(1)),P.dev=Object.assign(P.dev,P.preview),delete P.preview,U(P,e)},linkDebug:()=>{P.linkDebug||(z("未找到 debug 相关配置。"),process.exit(1)),P.dev=Object.assign(P.dev,P.linkDebug),delete P.linkDebug,delete P.dev.ignoreNodeModules,P.webpack.ignoreNodeModules=!1;const{cmpTypes:e,defaultExports:r}=W(P.dev,{entryType:"linkDebug"});V(P.dev,{cmpTypes:e,defaultExports:r,verbose:!0,excludeModel:!1}),h.dev(P,D)},build:()=>h.build("build",P,D),build2lib:()=>{W(P.build2lib,{entryType:"widget"}),h.build("lib",P,D)},publish2oss:e=>{const r=P.publish2oss;P.build2lib=X(r);const{cmpTypes:i,defaultExports:s}=W(P.build2lib,{entryType:"widget",cmpType:e});V(P.build2lib,{cmpTypes:i,defaultExports:s,verbose:!0,excludeModel:!0}),h.build("lib",P,D,()=>{k(r.ossType,r.ossConfig,r.assetsRoot)})},pushCmp:e=>{const{pushCmp:r}=P;P.build2lib=X(r);const{cmpTypes:i,defaultExports:s}=W(P.build2lib,{entryType:"widget",cmpType:e});V(P.build2lib,{cmpTypes:i,defaultExports:s,verbose:!1,excludeModel:!0}),h.build("lib",P,D,()=>{I(r,e)})},pullCmp:(e,r)=>{L(e,r)},deleteCmp:(e,r)=>{M(e,r)},build2esm:()=>h.build2esm(P,D),openEditor:A},C};
|
package/dist/neo/deleteCmp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ora"),r=require("./neoService.js"),t=require("../utils/common.js");var o
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ora"),r=require("./neoService.js"),t=require("../utils/common.js");var s,o;exports.__require=function(){if(o)return s;o=1;const i=e,n=r.__require(),{errorLog:c,successLog:u}=t.__require();return s=async(e,r)=>{const t=i("正在删除组件...").start();try{let s=r,o=[],i=null;r?o=r.cmpList||[]:(s=new n,t.info("正在获取自定义组件列表..."),o=await s.getCustomCmpList()),0===o.length&&(c("删除失败,当前租户暂无任何自定义组件。",t),process.exit(1)),i=s.getCmpInfoByCmpType(e),i||(c(`删除失败,当前租户不存在${e}自定义组件。`,t),process.exit(1)),t.info(`正在删除${e}自定义组件...`),await s.deleteCmp(e),u(`已成功删除${e}自定义组件!\n`,t)}catch(e){c(`删除自定义组件失败: ${e.message||e.msg||e}`,t),process.exit(1)}},s};
|
package/dist/neo/env.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash");var t,a;exports.__require=function(){if(a)return t;a=1;const e=o,s={neoBaseURL:"https://crm.xiaoshouyi.com",loginAPI:"https://login.xiaoshouyi.com/auc/oauth2/auth",tokenAPI:"https://login.xiaoshouyi.com/auc/oauth2/token"},u={neoBaseURL:"https://crm-gray.xiaoshouyi.com",loginAPI:"https://login-gray.xiaoshouyi.com/auc/oauth2/auth",tokenAPI:"https://login-gray.xiaoshouyi.com/auc/oauth2/token"},n={neoBaseURL:"https://crm-sandbox.xiaoshouyi.com",loginAPI:"https://login-sandbox.xiaoshouyi.com/auc/oauth2/auth",tokenAPI:"https://login-sandbox.xiaoshouyi.com/auc/oauth2/token"},i={neoBaseURL:"https://crm-cd.xiaoshouyi.com",loginAPI:"https://login-cd.xiaoshouyi.com/auc/oauth2/auth",tokenAPI:"https://login-cd.xiaoshouyi.com/auc/oauth2/token"},c={neoBaseURL:"https://crm-cd.xiaoshouyi.com",loginAPI:"https://login-cd.xiaoshouyi.com/auc/oauth2/auth",tokenAPI:"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 a=e.cloneDeep(c),h=i;switch(o){case"production":h=s;break;case"gray":h=u;break;case"sandbox":h=n;break;case"custom":h={...t,neoBaseURL:t.neoBaseURL,loginAPI:t.loginAPI,tokenAPI:t.tokenAPI};break;default:h=i}return{...a,...h}}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("node:fs"),t=require("node:path"),n=require("../utils/common.js"),i=require("../config/index.js"),r=require("../config/auth.config.js");var s,o;exports.__require=function(){if(o)return s;o=1;const c=e,u=t,{errorLog:a}=n.__require(),g=i.__require(),f=r.__require();return s=class{static getEnvFilePath(){return u.join(process.cwd(),".neo-cli","env.json")}static ensureEnvDir(){const e=u.dirname(this.getEnvFilePath());c.existsSync(e)||c.mkdirSync(e,{recursive:!0})}static getAuthConfig(){return{...g.neoConfig,...f}}static getEnvConfig(){let e={};const t=this.getEnvFilePath();if(!c.existsSync(t))return null;try{const n=c.readFileSync(t,"utf-8");e=JSON.parse(n)}catch(e){a(`读取环境配置文件失败: ${e.message||e.msg}`)}return{...this.getAuthConfig(),...e}}static setEnvConfig(e){if(!e||"object"!=typeof e)throw new Error("环境配置必须是一个对象");this.ensureEnvDir();const t={...e,updatedAt:Date.now()},n=this.getEnvFilePath();return c.writeFileSync(n,JSON.stringify(t,null,2),"utf-8"),t}static updateEnvConfig(e){return this.setEnvConfig(e)}static clearEnvConfig(){const e=this.getEnvFilePath();c.existsSync(e)&&c.unlinkSync(e)}}};
|
package/dist/neo/neoLogin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("axios"),t=require("node:fs"),n=require("node:path"),s=require("ora"),r=require("node:http"),o=require("node:url"),i=require("open"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("axios"),t=require("node:fs"),n=require("node:path"),s=require("ora"),r=require("node:http"),o=require("node:url"),i=require("open"),a=require("node:net"),c=require("lodash"),l=require("../utils/common.js"),h=require("./neoEnvManager.js");var p,u;exports.__require=function(){if(u)return p;u=1;const d=e,g=t,y=n,m=s,k=r,_=o,T=i,w=a,f=c,{errorLog:S,successLog:x}=l.__require(),R=h.__require();return p=class{constructor(e){if(!e)return;const{loginURL:t,tokenAPI:n}=e,s=R.getAuthConfig(),{redirectUri:r,authType:o,auth:i}=s;if(!t||!n)throw new Error("auth.config.js 配置不完整,需要包含 loginURL、tokenAPI");this.loginURL=t,this.tokenAPI=n,this.redirectUri=r,this.authType=o||"oauth2",this.response_type=i.response_type||"code",this.client_id=i.client_id,this.client_secret=i.client_secret,this.scope=i.scope||"all",this.oauthType=i.oauthType||"standard",this.access_type=i.access_type||"offline",this.grant_type=i.grant_type||"authorization_code",this.tokenDir=y.join(process.cwd(),".neo-cli"),this.tokenFile=y.join(this.tokenDir,"token.json"),this.pageDir=y.join(__dirname,"../../template/pageHtml"),this.authErrorTemplate=y.join(this.pageDir,"auth-error.html"),this.authSuccessTemplate=y.join(this.pageDir,"auth-success.html"),this.tokenErrorTemplate=y.join(this.pageDir,"token-error.html"),this.authFailedTemplate=y.join(this.pageDir,"auth-failed.html");try{R.setEnvConfig(f.omit(e,["neoBaseURL","loginURL","tokenAPI"]))}catch(e){S(`保存环境配置失败: ${e.message||e.msg}`)}}ensureTokenDir(){g.existsSync(this.tokenDir)||g.mkdirSync(this.tokenDir,{recursive:!0})}saveToken(e){this.ensureTokenDir();const t={...e,savedAt:Date.now(),expiresAt:Date.now()+1e3*(e.expires_in||7200)};g.writeFileSync(this.tokenFile,JSON.stringify(t,null,2),"utf-8")}readToken(){if(!g.existsSync(this.tokenFile))return null;try{return JSON.parse(g.readFileSync(this.tokenFile,"utf-8"))}catch(e){return S(`读取 token 文件失败: ${e.message||e.msg}`),null}}isTokenExpired(e){return!e||!e.expiresAt||Date.now()>=e.expiresAt-3e5}clearToken(){g.existsSync(this.tokenFile)&&g.unlinkSync(this.tokenFile)}getRedirectURI(e){return`http://localhost:${e}`}buildAuthUrl(e){const t=new URLSearchParams({response_type:this.response_type,client_id:this.client_id,redirect_uri:e,scope:this.scope,oauthType:this.oauthType,access_type:this.access_type});return`${this.loginURL}?${t.toString()}`}async openBrowser(e){try{await T(e)}catch(t){S(`无法自动打开浏览器: ${t.message||t.msg}`),console.log(`\n请手动访问以下 URL 进行授权:\n${e}\n`)}}getHtmlTemplate(e,t={}){try{let n=g.readFileSync(e,"utf-8");return Object.keys(t).forEach(e=>{const s=`{{${e}}}`;n=n.replace(new RegExp(s,"g"),t[e])}),n}catch(e){return S(`读取 HTML 模板失败: ${e.message||e.msg}`),"<html><body><h1>页面加载失败</h1></body></html>"}}async isPortInUse(e){return new Promise(t=>{const n=w.createServer();n.once("error",e=>{"EADDRINUSE"===e.code?t(!0):t(!1)}),n.once("listening",()=>{n.once("close",()=>{t(!1)}),n.close()}),n.listen(e)})}async startCallbackServer(){let e=this.redirectUri,t=new URL(e),n=parseInt(t.port,10);await this.isPortInUse(n)&&(S(`\n警告: 端口 ${n} 已被占用,请调整 redirectUri 配置项,使其指向一个未被占用的端口。`),process.exit(1));const s=new Promise((s,r)=>{const o=k.createServer(async(n,i)=>{const a=_.parse(n.url,!0);if(a.pathname===t.pathname||"/"===a.pathname){const t=a.query.code,n=a.query.error;if(n){i.writeHead(400,{"Content-Type":"text/html; charset=utf-8"});const e=this.getHtmlTemplate(this.authErrorTemplate,{ERROR:n});return i.end(e),o.close(),void r(new Error(`授权失败: ${n}`))}if(t)try{const n=await this.getTokenByCode(t,e);this.saveToken(n);const r=n.tenant_id||"未返回",a=n.instance_uri||"未返回";i.writeHead(200,{"Content-Type":"text/html; charset=utf-8"});const c=this.getHtmlTemplate(this.authSuccessTemplate,{TENANT_ID:r,INSTANCE_URI:a});return i.end(c),o.close(),void s({code:t,tokenData:n})}catch(e){i.writeHead(500,{"Content-Type":"text/html; charset=utf-8"});const t=this.getHtmlTemplate(this.tokenErrorTemplate,{ERROR:e});return i.end(t),o.close(),void r(e)}i.writeHead(400,{"Content-Type":"text/html; charset=utf-8"});const c=this.getHtmlTemplate(this.authFailedTemplate);i.end(c),o.close(),r(new Error("未获取到授权码"))}else i.writeHead(404,{"Content-Type":"text/plain"}),i.end("Not Found")});o.on("error",e=>{"EADDRINUSE"===e.code?r(new Error(`端口 ${n} 已被占用,无法启动回调服务器`)):r(e)}),o.listen(n,()=>{console.log(`\n本地回调服务器已启动,监听端口: ${n}`),console.log(`回调地址: ${e}`)}),setTimeout(()=>{o.close(),r(new Error("授权超时,请重试"))},3e5)});return{redirectUri:e,getCodeAndTokenPromise:s}}async getTokenByCode(e,t){const n=m("正在获取 access token...").start();try{const s=new URLSearchParams;s.append("grant_type",this.grant_type),s.append("client_id",this.client_id),s.append("client_secret",this.client_secret),s.append("code",e),s.append("redirect_uri",t);const r=(await d.post(this.tokenAPI,s.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data;return r&&r.access_token||(S("获取 token 失败:响应中未包含 access_token",n),S(`响应数据: ${JSON.stringify(r)}`),process.exit(1)),x("成功获取 access token",n),r}catch(e){S("获取 token 失败",n),S(`\n获取 token 失败: ${e.message||e.msg}`),e.response&&S(`响应数据: ${JSON.stringify(e.response.data)}`),process.exit(1)}}async refreshToken(e){const t=m("正在刷新授权信息(token)...").start();try{const n=new URLSearchParams;n.append("grant_type","refresh_token"),n.append("client_id",this.client_id),n.append("client_secret",this.client_secret),n.append("refresh_token",e);const s=(await d.post(this.tokenAPI,n.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data;return s&&s.access_token?(x("刷新授权信息成功(token)。",t),s):(S("刷新授权信息失败:响应中未包含 access_token",t),S(`响应数据: ${JSON.stringify(s)}`),null)}catch(e){return S("刷新授权信息失败",t),S(`\n刷新授权信息失败: ${e.message||e.msg}`),e.response&&S(`响应数据: ${JSON.stringify(e.response.data)}`),null}}async login(){console.log("\n========== NeoCRM 登录授权 ==========\n");try{const{redirectUri:e,getCodeAndTokenPromise:t}=await this.startCallbackServer(),n=this.buildAuthUrl(e);console.log("授权 URL:",n),console.log("\n正在打开浏览器进行授权..."),await this.openBrowser(n);const{code:s,tokenData:r}=await t;return x("\n✓ 已获取授权码"),console.log("\n========== 登录成功 ==========\n"),console.log(`实例地址: ${r.instance_uri||"未返回"}`),console.log(`租户 ID: ${r.tenant_id||"未返回"}`),r}catch(e){S(`\n登录失败: ${e.message||e.msg}`),process.exit(1)}}async logout(){if(console.log("\n========== NeoCRM 登出 ==========\n"),g.existsSync(this.tokenFile))try{R.clearEnvConfig(),this.clearToken(),x("已清除授权信息,下次登录需要重新授权。"),console.log("\n登出成功!\n")}catch(e){S(`登出失败: ${e.message||e.msg}`),process.exit(1)}else console.log("当前未登录,无需登出。")}async getValidToken(){const e=this.readToken();if(e||(S("未找到授权信息,请先执行 neo login 进行登录。"),process.exit(1)),this.isTokenExpired(e)){console.log("授权信息已过期,正在尝试刷新..."),e.refresh_token||(S("自动刷新授权信息失败,请重新登录(neo login)。"),process.exit(1));const t=await this.refreshToken(e.refresh_token);return t||(S("刷新授权信息失败,请重新登录 (neo login)"),process.exit(1)),this.saveToken(t),t}return e}async getAccessToken(){return await this.getValidToken()}}};
|
package/dist/neo/neoService.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("axios"),t=require("form-data"),s=require("node:fs"),o=require("node:path"),i=require("ora"),n=require("lodash"),r=require("akfun"),a=require("./neoLogin.js"),c=require("../utils/projectUtils/updatePublishLog.js"),u=require("../utils/common.js");var h,p;exports.__require=function(){if(p)return h;p=1;const l=e,d=t,m=s,f=o,y=i,g=n,{resolve:w}=r,k=a.__require(),$=c.__require(),{getFramework:x,errorLog:A,successLog:C}=u.__require(),T="https://crm.xiaoshouyi.com",F="https://login-cd.xiaoshouyi.com/auc/oauth2/auth",L="https://login.xiaoshouyi.com/auc/oauth2/token",b="/rest/metadata/v3.0/ui/customComponents",S="/rest/metadata/v3.0/ui/customComponents/actions/saveOrUpdateComponent",P="/rest/metadata/v3.0/ui/components/filter?custom=true",U=e=>`/rest/metadata/v3.0/ui/customComponents/${e}/codeLib`,B="/rest/metadata/v3.0/ui/customComponents/actions/upload",E=["cmpType","label","componentCategory","description","framework","icon","iconUrl","orderNo","version","propsSchema","defaultProps","previewProps","events","functions","asset","modelAsset","cssAsset","codeLib"];return h=class{constructor(e={}){const{assetsRoot:t,neoBaseURL:s,tokenAPI:o,loginURL:i,auth:n,authType:r}=e||{};this.authType=r||"oauth2","password"!==this.authType||n||(A("密码授权模式时,neo.config.js / neoConfig / auth 配置不能为空"),process.exit(1)),"password"===this.authType?n.client_id&&n.client_secret&&n.username&&n.password||(A("neo.config.js / neoConfig / auth 配置不完整(password 模式),需要包含 client_id、client_secret、username、password"),process.exit(1)):"oauth2"===this.authType?i&&o||(A("neo.config.js / neoConfig 配置不完整(oauth2 模式),需要包含 loginURL、tokenAPI 配置。"),process.exit(1)):(A(`不支持的授权类型: ${this.authType},可选值:oauth2、password`),process.exit(1)),this.assetsRoot=t||w("dist"),this.neoBaseURL=s||T,this.tokenAPI=o||L,this.loginURL=i||F,this.auth=n,this.cmpList=[],this.cmpInfoMap={},this.tokenCache={token:null,expiresAt:null}}buildFullUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:`${this.neoBaseURL}${e}`}uploadAPI(){return this.buildFullUrl(B)}saveAPI(){return this.buildFullUrl(S)}isTokenExpired(){return!this.tokenCache.token||!this.tokenCache.expiresAt||Date.now()>=this.tokenCache.expiresAt}async getToken(){return this.isTokenExpired()?"oauth2"===this.authType?await this.getTokenByOAuth2():await this.getTokenByPassword():this.tokenCache.token}async getTokenByPassword(){const e=y("获取 token(密码模式)...").start();if(!this.isTokenExpired())return C("使用缓存的 token。",e),this.tokenCache.token;const t=new URLSearchParams;t.append("grant_type","password"),t.append("client_id",this.auth.client_id),t.append("client_secret",this.auth.client_secret),t.append("username",this.auth.username),t.append("password",this.auth.password);const s=this.buildFullUrl(this.tokenAPI);try{const o=await l.post(s,t.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}}),i=o.data||{},{access_token:n,expires_in:r}=i;n||(A("获取 token 失败(授权配置错误):响应中未包含 access_token,"+JSON.stringify(o.data),e),process.exit(1));const a=parseInt(r)||3600;return this.tokenCache={...i,token:n,expiresAt:Date.now()+1e3*(a-60)},e.clear(),e.stop(),n}catch(o){A("获取 token 失败",e),A(`\n获取 token 失败: ${o.message||o.msg}`),A(`\ntoken 授权地址: ${s}`),A(`\ntoken 请求参数: ${t}`),o.response&&A(`响应数据: ${JSON.stringify(o.response.data)}`),process.exit(1)}}async getTokenByOAuth2(){const e=y("获取 token(OAuth2 模式)...").start();try{const t={loginURL:this.loginURL,tokenAPI:this.tokenAPI},s=new k(t),o=await s.getAccessToken(),i=o.access_token;return this.tokenCache={...o,token:i,expiresAt:Date.now()+72e5},e.clear(),e.stop(),i}catch(t){A("获取 token 失败(OAuth2 模式)",e),A(`\n获取 token 失败: ${t.message||t.msg}`),t.response&&A(`响应数据: ${JSON.stringify(t.response.data)}`),process.exit(1)}}async refreshToken(){return this.tokenCache={token:null,expiresAt:null},await this.getToken()}async ensureValidToken(){if(!this.tokenCache.token)return await this.getToken();if(this.isTokenExpired()){const e=y("token 已过期,正在刷新...").start();try{const t=await this.refreshToken();return C("token 刷新成功。",e),t}catch(t){throw A("token 刷新失败。",e),t}}return this.tokenCache.token}async uploadFile(e,t={}){const s=await this.ensureValidToken();if(!e||"string"!=typeof e)throw new Error(`文件路径无效: ${e}`);if(!m.existsSync(e))throw new Error(`文件不存在: ${e}`);const o=m.statSync(e);if(!o.isFile())throw new Error(`路径不是文件: ${e}`);const i=t.maxSize||5242880;if(o.size>i){const e=(o.size/1024/1024).toFixed(2),t=(i/1024/1024).toFixed(2);throw new Error(`文件大小超过限制: ${e}MB > ${t}MB`)}if(0===o.size)throw new Error(`文件为空: ${e}`);const n=f.basename(e),r=(o.size/1024).toFixed(2),a=y(`正在上传文件: ${n} (${r}KB)...`).start();try{const o=new d,i=t.fieldName||"customComponentCode",r=m.createReadStream(e);o.append(i,r,n);const c=this.uploadAPI(),u=t.timeout||6e4,h={headers:{Authorization:`Bearer ${s}`,"xsy-inner-source":"bff",...o.getHeaders()},timeout:u,maxContentLength:1/0,maxBodyLength:1/0},p=await l.post(c,o,h);let f;const y=p.data;if(200!==p.status&&201!==p.status)throw new Error(`上传失败: HTTP ${p.status}`);if("string"==typeof y)f=y.trim();else{if(!y||"object"!=typeof y)throw new Error("响应数据格式不正确: "+typeof y);if(void 0!==y.code&&200!==y.code&&0!==y.code){const e=y.message||y.msg||"未知错误";throw new Error(`上传失败: ${e} (code: ${y.code})`)}f=void 0!==y.data?y.data:void 0!==y.url?y.url:void 0!==y.fileUrl?y.fileUrl:y}if(!f)throw new Error("返回的文件地址为空");let g;return"string"==typeof f?g=f:f&&"object"==typeof f&&f.url&&(g=f.url),C(`文件上传成功: ${n} -> ${g}`,a),g}catch(t){if(A(`上传文件失败: ${t.message||t.msg}, 文件路径: ${e}`,a),t.response){const e=t.response.status,s=t.response.statusText,o=t.response.data,i=t.config?.url||this.uploadAPI();if(A("\n========== 上传请求详情 =========="),A(`请求 URL: ${i}`),A(`HTTP 状态码: ${e} ${s}`),A(`响应数据: ${JSON.stringify(o)}`),A("==================================\n"),404===e)throw new Error(`上传 API 不存在 (404): ${i}\n请检查 neo.config.js 中的 neoBaseURL 配置是否正确,或者 API 路径是否存在。\n当前配置的 API 路径: ${B}`)}else t.request&&A("请求已发送但未收到响应,请检查网络连接或代理配置。");throw t}}async publish2oss(e,t=[".js",".css",".zip"]){if(!e)return void A(`自定义组件名称不能为空: ${e}`);if(!m.existsSync(this.assetsRoot))return void A(`未找到自定义组件资源目录: ${this.assetsRoot}`);const s={cmpType:e},o=m.readdirSync(this.assetsRoot).map(async o=>{const i=f.join(this.assetsRoot,o),n=m.statSync(i),r=f.parse(i);if(n.isFile()&&t.includes(r.ext)){let t=g.camelCase(e);if(o.indexOf(t)<0)return;try{const e=await this.uploadFile(i);o.indexOf("Model")>-1?s.modelAsset=e:o.endsWith(".css")?s.cssAsset=e:o.endsWith(".zip")?s.codeLib=e:s.asset=e}catch(e){A(`文件上传失败(${o}):\n`),process.exit(1)}}});return await Promise.all(o),s&&s.cmpType&&(console.info("上传至 OSS 的文件信息:\n",s),$(s)),s}async getCmpAssets(e,t=[".js",".css",".zip"]){if(!e)return void A(`自定义组件名称不能为空: ${e}`);if(!m.existsSync(this.assetsRoot))return void A(`未找到自定义组件资源目录: ${this.assetsRoot}`);const s={cmpType:e};return m.readdirSync(this.assetsRoot).forEach(o=>{const i=f.join(this.assetsRoot,o),n=m.statSync(i),r=f.parse(i);if(n.isFile()&&t.includes(r.ext)){let t=g.camelCase(e);if(o.indexOf(t)<0)return;const r=5242880;if(n.size>r){const e=(n.size/1024/1024).toFixed(2),t=(r/1024/1024).toFixed(2);throw new Error(`${o} 文件大小超过限制: ${e}MB > ${t}MB`)}const a={fileContent:m.createReadStream(i),fileName:o,fileSize:n.size};o.indexOf("Model")>-1?s.modelAssetFile=a:o.endsWith(".css")?s.cssAssetFile=a:o.endsWith(".zip")?s.codeLibFile=a:s.assetFile=a}}),s}async updateCustomComponent(e){const t=await this.ensureValidToken();if(!e)throw new Error("componentData 不能为空");const s=y("正在保存自定义组件信息...").start();try{const o=this.saveAPI(),i=new d;e.assetFile&&i.append("assetFile",e.assetFile.fileContent,e.assetFile.fileName),e.modelAssetFile&&i.append("modelAssetFile",e.modelAssetFile.fileContent,e.modelAssetFile.fileName),e.cssAssetFile&&i.append("cssAssetFile",e.cssAssetFile.fileContent,e.cssAssetFile.fileName),e.codeLibFile&&i.append("codeLibFile",e.codeLibFile.fileContent,e.codeLibFile.fileName),i.append("component",JSON.stringify(g.omit(e,["assetFile","modelAssetFile","cssAssetFile","codeLibFile"])));const n=await l.post(o,i,{headers:{Authorization:`Bearer ${t}`,"xsy-inner-source":"bff",...i.getHeaders()},timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0}),{code:r,message:a,msg:c}=n.data||{};r&&200!==r&&(A(`保存自定义组件信息失败: ${a||c||"未知错误"}`),process.exit(1)),s.clear(),s.stop()}catch(e){const t=e.message||e.msg;A(t?`保存自定义组件信息失败: ${t}`:`保存自定义组件信息失败: ${JSON.stringify(e)}`,s),process.exit(1)}}async getCustomCmpList(){const e=await this.ensureValidToken();try{let t=this.buildFullUrl(P);t+=`&fields=${E.join(",")}`;const s=await l.get(t,{headers:{Authorization:`Bearer ${e}`,"xsy-inner-source":"bff","Content-Type":"application/json"}}),{code:o,message:i,msg:n}=s.data||{};o&&200!==o&&(A(`获取自定义组件列表失败: ${i||n||"未知错误"}`),process.exit(1)),this.updateCustomCmpList(s.data.data||[])}catch(e){const t=e.message||e.msg;A(t?`获取自定义组件列表失败: ${t}`:`响应数据: ${JSON.stringify(e)}`),process.exit(1)}return this.cmpList||[]}getCodeLibByCmpType(e){return e?this.buildFullUrl(U(e)):null}async deleteCmp(e){const t=await this.ensureValidToken();e||(A("自定义组件名称不能为空。"),process.exit(1));let s=this.buildFullUrl(b);s+=`/${e}`;const o=await l.delete(s,{headers:{Authorization:`Bearer ${t}`,"xsy-inner-source":"bff","Content-Type":"application/json"}}),{code:i,message:n,msg:r}=o.data||{};return i&&200!==i&&(A(`删除自定义组件失败: ${n||r||"未知错误"}`),process.exit(1)),o.data}getCmpListByFramework(e){if(!e)return this.cmpList;const t=x(e);return this.cmpList.filter(e=>e.framework===t)}getCmpInfoByCmpType(e){return e&&this.cmpInfoMap[e]||null}updateCustomCmpList(e){e&&Array.isArray(e)&&(this.cmpList=e,e.forEach(e=>{this.cmpInfoMap[e.cmpType]=e}))}async request(e,t,s={}){const o=await this.ensureValidToken(),{data:i,headers:n={},params:r}=s,a=this.buildFullUrl(t);try{const t=await l({method:e,url:a,data:i,params:r,headers:{Authorization:`Bearer ${o}`,"xsy-inner-source":"bff",...n}});if(t.data&&t.data.code&&200!==t.data.code)throw new Error(`请求失败: ${t.data.message||t.data.msg||"未知错误"}`);return t.data}catch(s){throw A(`请求失败 [${e} ${t}]: ${s.message||s.msg}`),s.response&&A(`响应数据: ${JSON.stringify(s.response.data)}`),s}}async get(e,t={}){return await this.request("GET",e,t)}async post(e,t={}){return await this.request("POST",e,t)}async put(e,t={}){return await this.request("PUT",e,t)}async delete(e,t={}){return await this.request("DELETE",e,t)}}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("axios"),t=require("form-data"),s=require("node:fs"),o=require("node:path"),i=require("ora"),r=require("lodash"),n=require("akfun"),a=require("./neoLogin.js"),c=require("../utils/projectUtils/updatePublishLog.js"),l=require("../utils/common.js"),h=require("./neoEnvManager.js");var u,d;exports.__require=function(){if(d)return u;d=1;const p=e,m=t,f=s,y=o,w=i,g=r,{resolve:k}=n,A=a.__require(),$=c.__require(),{getFramework:C,errorLog:x,successLog:T}=l.__require(),F=h.__require(),P=["cmpType","label","componentCategory","description","framework","icon","iconUrl","orderNo","version","propsSchema","defaultProps","previewProps","events","functions","asset","modelAsset","cssAsset","codeLib"];return u=class{constructor(){const e=F.getEnvConfig(),{assetsRoot:t,auth:s,authType:o}=e||{};this.authType=o||"oauth2",this.NeoCrmAPI=e,"password"!==this.authType||s||(x("密码授权模式时,neo.config.js / neoConfig / auth 配置不能为空"),process.exit(1)),"password"===this.authType?s.client_id&&s.client_secret&&s.username&&s.password||(x("neo.config.js / neoConfig / auth 配置不完整(password 模式),需要包含 client_id、client_secret、username、password"),process.exit(1)):"oauth2"!=this.authType&&(x(`不支持的授权类型: ${this.authType},可选值:oauth2、password`),process.exit(1)),this.assetsRoot=t||k("dist"),this.auth=s,this.cmpList=[],this.cmpInfoMap={},this.tokenCache={token:null,expiresAt:null}}buildFullUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:`${this.NeoCrmAPI.neoBaseURL}${e}`}uploadAPI(){return this.buildFullUrl(this.NeoCrmAPI.uploadAPI)}saveAPI(){return this.buildFullUrl(this.NeoCrmAPI.saveAPI)}isTokenExpired(){return!this.tokenCache.token||!this.tokenCache.expiresAt||Date.now()>=this.tokenCache.expiresAt}async getToken(){return this.isTokenExpired()?"oauth2"===this.authType?await this.getTokenByOAuth2():await this.getTokenByPassword():this.tokenCache.token}async getTokenByPassword(){const e=w("获取 token(密码模式)...").start();if(!this.isTokenExpired())return T("使用缓存的 token。",e),this.tokenCache.token;const t=new URLSearchParams;t.append("grant_type","password"),t.append("client_id",this.auth.client_id),t.append("client_secret",this.auth.client_secret),t.append("username",this.auth.username),t.append("password",this.auth.password);const s=this.buildFullUrl(this.NeoCrmAPI.tokenAPI);try{const o=await p.post(s,t.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}}),i=o.data||{},{access_token:r,expires_in:n}=i;r||(x("获取 token 失败(授权配置错误):响应中未包含 access_token,"+JSON.stringify(o.data),e),process.exit(1));const a=parseInt(n)||3600;return this.tokenCache={...i,token:r,expiresAt:Date.now()+1e3*(a-60)},e.clear(),e.stop(),r}catch(o){x("获取 token 失败",e),x(`\n获取 token 失败: ${o.message||o.msg}`),x(`\ntoken 授权地址: ${s}`),x(`\ntoken 请求参数: ${t}`),o.response&&x(`响应数据: ${JSON.stringify(o.response.data)}`),process.exit(1)}}async getTokenByOAuth2(){const e=w("获取 token(OAuth2 模式)...").start();try{const t={loginURL:this.NeoCrmAPI.loginURL,tokenAPI:this.NeoCrmAPI.tokenAPI},s=new A(t),o=await s.getAccessToken(),i=o.access_token;return this.tokenCache={...o,token:i,expiresAt:Date.now()+72e5},e.clear(),e.stop(),i}catch(t){x("获取 token 失败(OAuth2 模式)",e),x(`\n获取 token 失败: ${t.message||t.msg}`),t.response&&x(`响应数据: ${JSON.stringify(t.response.data)}`),process.exit(1)}}async refreshToken(){return this.tokenCache={token:null,expiresAt:null},await this.getToken()}async ensureValidToken(){if(!this.tokenCache.token)return await this.getToken();if(this.isTokenExpired()){const e=w("token 已过期,正在刷新...").start();try{const t=await this.refreshToken();return T("token 刷新成功。",e),t}catch(t){throw x("token 刷新失败。",e),t}}return this.tokenCache.token}async uploadFile(e,t={}){const s=await this.ensureValidToken();if(!e||"string"!=typeof e)throw new Error(`文件路径无效: ${e}`);if(!f.existsSync(e))throw new Error(`文件不存在: ${e}`);const o=f.statSync(e);if(!o.isFile())throw new Error(`路径不是文件: ${e}`);const i=t.maxSize||5242880;if(o.size>i){const e=(o.size/1024/1024).toFixed(2),t=(i/1024/1024).toFixed(2);throw new Error(`文件大小超过限制: ${e}MB > ${t}MB`)}if(0===o.size)throw new Error(`文件为空: ${e}`);const r=y.basename(e),n=(o.size/1024).toFixed(2),a=w(`正在上传文件: ${r} (${n}KB)...`).start();try{const o=new m,i=t.fieldName||"customComponentCode",n=f.createReadStream(e);o.append(i,n,r);const c=this.uploadAPI(),l=t.timeout||6e4,h={headers:{Authorization:`Bearer ${s}`,"xsy-inner-source":"bff",...o.getHeaders()},timeout:l,maxContentLength:1/0,maxBodyLength:1/0},u=await p.post(c,o,h);let d;const y=u.data;if(200!==u.status&&201!==u.status)throw new Error(`上传失败: HTTP ${u.status}`);if("string"==typeof y)d=y.trim();else{if(!y||"object"!=typeof y)throw new Error("响应数据格式不正确: "+typeof y);if(void 0!==y.code&&200!==y.code&&0!==y.code){const e=y.message||y.msg||"未知错误";throw new Error(`上传失败: ${e} (code: ${y.code})`)}d=void 0!==y.data?y.data:void 0!==y.url?y.url:void 0!==y.fileUrl?y.fileUrl:y}if(!d)throw new Error("返回的文件地址为空");let w;return"string"==typeof d?w=d:d&&"object"==typeof d&&d.url&&(w=d.url),T(`文件上传成功: ${r} -> ${w}`,a),w}catch(t){if(x(`上传文件失败: ${t.message||t.msg}, 文件路径: ${e}`,a),t.response){const e=t.response.status,s=t.response.statusText,o=t.response.data,i=t.config?.url||this.uploadAPI();if(x("\n========== 上传请求详情 =========="),x(`请求 URL: ${i}`),x(`HTTP 状态码: ${e} ${s}`),x(`响应数据: ${JSON.stringify(o)}`),x("==================================\n"),404===e)throw new Error(`上传 API 不存在 (404): ${i}\n请检查 neo.config.js 中的 neoBaseURL 配置是否正确,或者 API 路径是否存在。\n当前配置的 API 路径: ${this.NeoCrmAPI.uploadAPI}`)}else t.request&&x("请求已发送但未收到响应,请检查网络连接或代理配置。");throw t}}async publish2oss(e,t=[".js",".css",".zip"]){if(!e)return void x(`自定义组件名称不能为空: ${e}`);if(!f.existsSync(this.assetsRoot))return void x(`未找到自定义组件资源目录: ${this.assetsRoot}`);const s={cmpType:e},o=f.readdirSync(this.assetsRoot).map(async o=>{const i=y.join(this.assetsRoot,o),r=f.statSync(i),n=y.parse(i);if(r.isFile()&&t.includes(n.ext)){let t=g.camelCase(e);if(o.indexOf(t)<0)return;try{const e=await this.uploadFile(i);o.indexOf("Model")>-1?s.modelAsset=e:o.endsWith(".css")?s.cssAsset=e:o.endsWith(".zip")?s.codeLib=e:s.asset=e}catch(e){x(`文件上传失败(${o}):\n`),process.exit(1)}}});return await Promise.all(o),s&&s.cmpType&&(console.info("上传至 OSS 的文件信息:\n",s),$(s)),s}async getCmpAssets(e,t=[".js",".css",".zip"]){if(!e)return void x(`自定义组件名称不能为空: ${e}`);if(!f.existsSync(this.assetsRoot))return void x(`未找到自定义组件资源目录: ${this.assetsRoot}`);const s={cmpType:e};return f.readdirSync(this.assetsRoot).forEach(o=>{const i=y.join(this.assetsRoot,o),r=f.statSync(i),n=y.parse(i);if(r.isFile()&&t.includes(n.ext)){let t=g.camelCase(e);if(o.indexOf(t)<0)return;const n=5242880;if(r.size>n){const e=(r.size/1024/1024).toFixed(2),t=(n/1024/1024).toFixed(2);throw new Error(`${o} 文件大小超过限制: ${e}MB > ${t}MB`)}const a={fileContent:f.createReadStream(i),fileName:o,fileSize:r.size};o.indexOf("Model")>-1?s.modelAssetFile=a:o.endsWith(".css")?s.cssAssetFile=a:o.endsWith(".zip")?s.codeLibFile=a:s.assetFile=a}}),s}async updateCustomComponent(e){const t=await this.ensureValidToken();if(!e)throw new Error("componentData 不能为空");const s=w("正在保存自定义组件信息...").start();try{const o=this.saveAPI(),i=new m;e.assetFile&&i.append("assetFile",e.assetFile.fileContent,e.assetFile.fileName),e.modelAssetFile&&i.append("modelAssetFile",e.modelAssetFile.fileContent,e.modelAssetFile.fileName),e.cssAssetFile&&i.append("cssAssetFile",e.cssAssetFile.fileContent,e.cssAssetFile.fileName),e.codeLibFile&&i.append("codeLibFile",e.codeLibFile.fileContent,e.codeLibFile.fileName),i.append("component",JSON.stringify(g.omit(e,["assetFile","modelAssetFile","cssAssetFile","codeLibFile"])));const r=await p.post(o,i,{headers:{Authorization:`Bearer ${t}`,"xsy-inner-source":"bff",...i.getHeaders()},timeout:12e4,maxContentLength:1/0,maxBodyLength:1/0}),{code:n,message:a,msg:c}=r.data||{};n&&200!==n&&(x(`保存自定义组件信息失败: ${a||c||"未知错误"}`),process.exit(1)),s.clear(),s.stop()}catch(e){const t=e.message||e.msg;x(t?`保存自定义组件信息失败: ${t}`:`保存自定义组件信息失败: ${JSON.stringify(e)}`,s),process.exit(1)}}async getCustomCmpList(){const e=await this.ensureValidToken();try{let t=this.buildFullUrl(this.NeoCrmAPI.queryAll);t+=`&fields=${P.join(",")}`;const s=await p.get(t,{headers:{Authorization:`Bearer ${e}`,"xsy-inner-source":"bff","Content-Type":"application/json"}}),{code:o,message:i,msg:r}=s.data||{};o&&200!==o&&(x(`获取自定义组件列表失败: ${i||r||"未知错误"}`),process.exit(1)),this.updateCustomCmpList(s.data.data||[])}catch(e){const t=e.message||e.msg;x(t?`获取自定义组件列表失败: ${t}`:`响应数据: ${JSON.stringify(e)}`),process.exit(1)}return this.cmpList||[]}getCodeLibByCmpType(e){return e?this.buildFullUrl(this.NeoCrmAPI.getCodeLibAPI(e)):null}async deleteCmp(e){const t=await this.ensureValidToken();e||(x("自定义组件名称不能为空。"),process.exit(1));let s=this.buildFullUrl(this.NeoCrmAPI.delete);s+=`/${e}`;const o=await p.delete(s,{headers:{Authorization:`Bearer ${t}`,"xsy-inner-source":"bff","Content-Type":"application/json"}}),{code:i,message:r,msg:n}=o.data||{};return i&&200!==i&&(x(`删除自定义组件失败: ${r||n||"未知错误"}`),process.exit(1)),o.data}getCmpListByFramework(e){if(!e)return this.cmpList;const t=C(e);return this.cmpList.filter(e=>e.framework===t)}getCmpInfoByCmpType(e){return e&&this.cmpInfoMap[e]||null}updateCustomCmpList(e){e&&Array.isArray(e)&&(this.cmpList=e,e.forEach(e=>{this.cmpInfoMap[e.cmpType]=e}))}async request(e,t,s={}){const o=await this.ensureValidToken(),{data:i,headers:r={},params:n}=s,a=this.buildFullUrl(t);try{const t=await p({method:e,url:a,data:i,params:n,headers:{Authorization:`Bearer ${o}`,"xsy-inner-source":"bff",...r}});if(t.data&&t.data.code&&200!==t.data.code)throw new Error(`请求失败: ${t.data.message||t.data.msg||"未知错误"}`);return t.data}catch(s){throw x(`请求失败 [${e} ${t}]: ${s.message||s.msg}`),s.response&&x(`响应数据: ${JSON.stringify(s.response.data)}`),s}}async get(e,t={}){return await this.request("GET",e,t)}async post(e,t={}){return await this.request("POST",e,t)}async put(e,t={}){return await this.request("PUT",e,t)}async delete(e,t={}){return await this.request("DELETE",e,t)}}};
|
package/dist/neo/pullCmp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("lodash");const e=require("akfun"),r=require("ora"),t=require("./neoService.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("lodash");const e=require("akfun"),r=require("ora"),t=require("./neoService.js"),s=require("../utils/common.js"),i=require("../utils/pathUtils.js"),o=require("../utils/cmpUtils/getCmpTypeByDir.js"),c=require("../utils/cmpUtils/createCmpByZip.js");var n,a;exports.__require=function(){if(a)return n;a=1;const{getConfigObj:p}=e,u=r,m=t.__require(),{getFramework:l,errorLog:g,successLog:q}=s.__require(),{catchCurPackageJson:f}=i.__require(),_=o.__require(),y=c.__require(),C=l(p(f()).framework);return n=async(e,r)=>{_().indexOf(e)>-1&&(g(`当前项目目录中已存在${e}自定义组件。(./src/components 目录下)`),process.exit(1));const t=u("正在拉取组件...").start();try{let s=r,i=[],o={},c=null;r?(i=r.cmpList||[],o=r.cmpInfoMap||{}):(s=new m,t.info("正在获取自定义组件列表..."),i=await s.getCustomCmpList(),o=s.cmpInfoMap||{}),0===i.length&&(g("拉取失败,当前租户暂无任何自定义组件。",t),process.exit(1)),c=s.getCmpInfoByCmpType(e),c||(g(`拉取失败,当前租户不存在${e}自定义组件。`,t),process.exit(1)),c.framework&&c.framework!==C&&(g(`拉取失败,${e}自定义组件与当前项目技术栈不一致。`,t),process.exit(1));const n=s.getCodeLibByCmpType(e),a=await s.ensureValidToken();await y(n,{token:a,cmpName:e,componentBaseDir:"./src/components"})||(g(`拉取失败,${e}自定义组件源码解析失败,请检查源码文件是否正确。`,t),process.exit(1)),q(`已成功拉取${e}自定义组件!\n`,t)}catch(e){throw g(`拉取自定义组件失败: ${e.message||e.msg}`,t),e}},n};
|
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"),i=require("./neoService.js"),a=require("../utils/common.js"),n=require("../utils/pathUtils.js"),c=require("../utils/projectUtils/createCmpProjectZip.js"),l=require("../utils/projectUtils/updatePublishLog.js"),p=require("../utils/cmpTypeValidator.js");var u,g;exports.__require=function(){if(g)return u;g=1;const m=e,d=t,w=s,{getConfigObj:y}=r,h=o,f=i.__require(),{getFramework:b,errorLog:v,successLog:T}=a.__require(),{catchCurPackageJson:q}=n.__require(),C=c.__require(),j=l.__require(),{validateApiName:P}=p.__require(),$=y(q()),_=(e=[])=>e.map(e=>({label:e.label,description:e.description,propSchema:JSON.stringify(e)})),D=(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||[]})):[],S=(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 u=async(e,t)=>{const s=h("正在发布组件...").start(),{isValid:r,errors:o}=P(t);r||(v(o.join("\n")),process.exit(1));try{let r,o=new f
|
|
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"),i=require("./neoService.js"),a=require("../utils/common.js"),n=require("../utils/pathUtils.js"),c=require("../utils/projectUtils/createCmpProjectZip.js"),l=require("../utils/projectUtils/updatePublishLog.js"),p=require("../utils/cmpTypeValidator.js");var u,g;exports.__require=function(){if(g)return u;g=1;const m=e,d=t,w=s,{getConfigObj:y}=r,h=o,f=i.__require(),{getFramework:b,errorLog:v,successLog:T}=a.__require(),{catchCurPackageJson:q}=n.__require(),C=c.__require(),j=l.__require(),{validateApiName:P}=p.__require(),$=y(q()),_=(e=[])=>e.map(e=>({label:e.label,description:e.description,propSchema:JSON.stringify(e)})),D=(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||[]})):[],S=(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 u=async(e,t)=>{const s=h("正在发布组件...").start(),{isValid:r,errors:o}=P(t);r||(v(o.join("\n")),process.exit(1));try{let r,o=new f;await o.ensureValidToken(),s.start("[1/4] 打包源码文件(含单个自定义组件源码)...");try{r=C(t,process.cwd(),e.assetsRoot),r?T(`[1/4] 源码文件打包完成: ${d.basename(r)}。`,s):v("[1/4] 源码文件打包失败,未返回 zip 文件路径。",s)}catch(e){v("[1/4] 源码文件打包失败。",s)}s.start("[2/4] 获取自定义组件构建产物...");const i=await o.getCmpAssets(t);let a;s.start("[3/4] 构建组件数据...");try{a=await(async(e,t)=>{if(!t||!t.cmpType)return v("自定义组件信息或组件名称不能为空"),null;const{cmpType:s}=t;if(!e||!m.existsSync(e))return v(`未找到自定义组件目录: ${e}`),null;const r=w.camelCase(s),o=d.join(e,`${r}Model.js`),i=globalThis.window;globalThis.window||(globalThis.window={console:console,neoRequire:()=>{},postMessage:()=>{}});try{m.existsSync(o)?require(o):(v(`未找到自定义组件模型文件,请检查以下路径是否存在:${o}`),process.exit(1)),globalThis.window&&globalThis.window.NEOEditorCustomModels||(v(`模型文件未导出有效模型方法(CatchCustomCmpModelClass),模型文件地址: ${o} `),process.exit(1));const e=globalThis.window.NEOEditorCustomModels[s];e||(v(`未找到自定义组件模型类(${s}),模型文件地址: ${o} `),process.exit(1));const r=new e;return r||(v(`未找到自定义组件模型信息(${s}),模型文件地址: ${o} `),process.exit(1)),{...t,version:$.version||"1.0.0",framework:$.framework?b($.framework):0,label:r.label||s,description:r.description||"",componentCategory:(r.tags||["自定义组件"]).join(","),targetPage:r.targetPage||["all"],targetObject:r.targetObject||["all"],targetApplication:r.targetApplication||["all"],targetDevice:r.targetDevice||"web",iconUrl:r.iconUrl||r.iconUrl,defaultProps:JSON.stringify(r.defaultComProps||{}),previewProps:JSON.stringify(r.previewComProps||{}),props:_(r.propsSchema||[]),events:D(r.events||[],s),functions:S(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 v(`自定义组件模型文件解析失败 (${o||"未知路径"}): ${e.message||e.msg}`),v(e.stack),null}finally{void 0===i?delete globalThis.window:globalThis.window=i}})(e.assetsRoot,i),a?T("[3/4] 组件数据构建完成。",s):v(`[3/4] 未获取到自定义组件模型信息(${t})。`,s)}catch(e){v(`[3/4] 组件数据构建失败: ${e.message||e.msg}`,s)}s.start("[4/4] 保存组件信息到 NeoCRM 平台..."),j(w.omit(a,["assetFile","modelAssetFile","cssAssetFile","codeLibFile"]));try{await o.updateCustomComponent(a),T("[4/4] 组件信息保存成功",s)}catch(e){v("[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&&v(`❌ 自定义组件发布失败: ${e.message||e.msg}`,s)}catch{v(`\n❌ 自定义组件发布失败: ${e.message||e.msg}`)}throw e}},u};
|
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.18";const o={version:e};exports.default=o,exports.version=e;
|
package/package.json
CHANGED
|
@@ -103,31 +103,6 @@ module.exports = {
|
|
|
103
103
|
}
|
|
104
104
|
*/
|
|
105
105
|
},
|
|
106
|
-
// 授权码授权模式下的 NeoCRM 平台配置
|
|
107
|
-
neoConfig: {
|
|
108
|
-
authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
|
|
109
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
110
|
-
// 当 authType 为 oauth2 时,loginURL 配置项必填
|
|
111
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
|
|
112
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
113
|
-
},
|
|
114
|
-
/*
|
|
115
|
-
// 密码授权模式下的 NeoCRM 平台配置
|
|
116
|
-
neoConfig: {
|
|
117
|
-
authType: 'password', // 授权类型,可选值:oauth2(默认)、password
|
|
118
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
119
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
120
|
-
// 当 authType 为 password 时,auth 配置项必填
|
|
121
|
-
auth: {
|
|
122
|
-
client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
123
|
-
client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
124
|
-
username: auth.username || 'xx', // 用户在销售易系统中的用户名
|
|
125
|
-
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
126
|
-
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
127
|
-
password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
*/
|
|
131
106
|
pushCmp: {
|
|
132
107
|
// 用于构建并发布至 NeoCRM 的相关配置
|
|
133
108
|
/*
|
|
@@ -99,31 +99,6 @@ module.exports = {
|
|
|
99
99
|
}
|
|
100
100
|
*/
|
|
101
101
|
},
|
|
102
|
-
// 授权码授权模式下的 NeoCRM 平台配置
|
|
103
|
-
neoConfig: {
|
|
104
|
-
authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
|
|
105
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
106
|
-
// 当 authType 为 oauth2 时,loginURL 配置项必填
|
|
107
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
|
|
108
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
109
|
-
},
|
|
110
|
-
/*
|
|
111
|
-
// 密码授权模式下的 NeoCRM 平台配置
|
|
112
|
-
neoConfig: {
|
|
113
|
-
authType: 'password', // 授权类型,可选值:oauth2(默认)、password
|
|
114
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
115
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
116
|
-
// 当 authType 为 password 时,auth 配置项必填
|
|
117
|
-
auth: {
|
|
118
|
-
client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
119
|
-
client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
120
|
-
username: auth.username || 'xx', // 用户在销售易系统中的用户名
|
|
121
|
-
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
122
|
-
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
123
|
-
password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
*/
|
|
127
102
|
pushCmp: {
|
|
128
103
|
// 用于构建并发布至 NeoCRM 的相关配置
|
|
129
104
|
/*
|
|
@@ -97,31 +97,6 @@ module.exports = {
|
|
|
97
97
|
}
|
|
98
98
|
*/
|
|
99
99
|
},
|
|
100
|
-
// 授权码授权模式下的 NeoCRM 平台配置
|
|
101
|
-
neoConfig: {
|
|
102
|
-
authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
|
|
103
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
104
|
-
// 当 authType 为 oauth2 时,loginURL 配置项必填
|
|
105
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
|
|
106
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
107
|
-
},
|
|
108
|
-
/*
|
|
109
|
-
// 密码授权模式下的 NeoCRM 平台配置
|
|
110
|
-
neoConfig: {
|
|
111
|
-
authType: 'password', // 授权类型,可选值:oauth2(默认)、password
|
|
112
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
113
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
114
|
-
// 当 authType 为 password 时,auth 配置项必填
|
|
115
|
-
auth: {
|
|
116
|
-
client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
117
|
-
client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
118
|
-
username: auth.username || 'xx', // 用户在销售易系统中的用户名
|
|
119
|
-
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
120
|
-
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
121
|
-
password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
*/
|
|
125
100
|
pushCmp: {
|
|
126
101
|
// 用于构建并发布至 NeoCRM 的相关配置
|
|
127
102
|
/*
|
|
@@ -97,31 +97,6 @@ module.exports = {
|
|
|
97
97
|
}
|
|
98
98
|
*/
|
|
99
99
|
},
|
|
100
|
-
// 授权码授权模式下的 NeoCRM 平台配置
|
|
101
|
-
neoConfig: {
|
|
102
|
-
authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
|
|
103
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
104
|
-
// 当 authType 为 oauth2 时,loginURL 配置项必填
|
|
105
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
|
|
106
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token' // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
107
|
-
},
|
|
108
|
-
/*
|
|
109
|
-
// 密码授权模式下的 NeoCRM 平台配置
|
|
110
|
-
neoConfig: {
|
|
111
|
-
authType: 'password', // 授权类型,可选值:oauth2(默认)、password
|
|
112
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
113
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
114
|
-
// 当 authType 为 password 时,auth 配置项必填
|
|
115
|
-
auth: {
|
|
116
|
-
client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
117
|
-
client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
118
|
-
username: auth.username || 'xx', // 用户在销售易系统中的用户名
|
|
119
|
-
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
120
|
-
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
121
|
-
password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
*/
|
|
125
100
|
pushCmp: {
|
|
126
101
|
// 用于构建并发布至 NeoCRM 的相关配置
|
|
127
102
|
/*
|
|
@@ -99,31 +99,6 @@ module.exports = {
|
|
|
99
99
|
}
|
|
100
100
|
*/
|
|
101
101
|
},
|
|
102
|
-
// 授权码授权模式下的 NeoCRM 平台配置
|
|
103
|
-
neoConfig: {
|
|
104
|
-
// authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
|
|
105
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
106
|
-
// 当 authType 为 oauth2 时,loginURL 配置项必填
|
|
107
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
|
|
108
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
109
|
-
},
|
|
110
|
-
/*
|
|
111
|
-
// 密码授权模式下的 NeoCRM 平台配置
|
|
112
|
-
neoConfig: {
|
|
113
|
-
authType: 'password', // 授权类型,可选值:oauth2(默认)、password
|
|
114
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
115
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
116
|
-
// 当 authType 为 password 时,auth 配置项必填
|
|
117
|
-
auth: {
|
|
118
|
-
client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
119
|
-
client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
120
|
-
username: 'xx', // 用户在销售易系统中的用户名
|
|
121
|
-
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
122
|
-
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
123
|
-
password: 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
*/
|
|
127
102
|
pushCmp: {
|
|
128
103
|
// 用于构建并发布至 NeoCRM 的相关配置
|
|
129
104
|
/*
|
|
@@ -96,31 +96,6 @@ module.exports = {
|
|
|
96
96
|
}
|
|
97
97
|
*/
|
|
98
98
|
},
|
|
99
|
-
// 授权码授权模式下的 NeoCRM 平台配置
|
|
100
|
-
neoConfig: {
|
|
101
|
-
authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
|
|
102
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
103
|
-
// 当 authType 为 oauth2 时,loginURL 配置项必填
|
|
104
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
|
|
105
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
106
|
-
},
|
|
107
|
-
/*
|
|
108
|
-
// 密码授权模式下的 NeoCRM 平台配置
|
|
109
|
-
neoConfig: {
|
|
110
|
-
authType: 'password', // 授权类型,可选值:oauth2(默认)、password
|
|
111
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
112
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
113
|
-
// 当 authType 为 password 时,auth 配置项必填
|
|
114
|
-
auth: {
|
|
115
|
-
client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
116
|
-
client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
117
|
-
username: auth.username || 'xx', // 用户在销售易系统中的用户名
|
|
118
|
-
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
119
|
-
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
120
|
-
password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
*/
|
|
124
99
|
pushCmp: {
|
|
125
100
|
// 用于构建并发布至 NeoCRM 的相关配置
|
|
126
101
|
/*
|
|
@@ -97,31 +97,6 @@ module.exports = {
|
|
|
97
97
|
}
|
|
98
98
|
*/
|
|
99
99
|
},
|
|
100
|
-
// 授权码授权模式下的 NeoCRM 平台配置
|
|
101
|
-
neoConfig: {
|
|
102
|
-
authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
|
|
103
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
104
|
-
// 当 authType 为 oauth2 时,loginURL 配置项必填
|
|
105
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
|
|
106
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
107
|
-
},
|
|
108
|
-
/*
|
|
109
|
-
// 密码授权模式下的 NeoCRM 平台配置
|
|
110
|
-
neoConfig: {
|
|
111
|
-
authType: 'password', // 授权类型,可选值:oauth2(默认)、password
|
|
112
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
113
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
114
|
-
// 当 authType 为 password 时,auth 配置项必填
|
|
115
|
-
auth: {
|
|
116
|
-
client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
117
|
-
client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
118
|
-
username: auth.username || 'xx', // 用户在销售易系统中的用户名
|
|
119
|
-
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
120
|
-
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
121
|
-
password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
*/
|
|
125
100
|
pushCmp: {
|
|
126
101
|
// 用于构建并发布至 NeoCRM 的相关配置
|
|
127
102
|
/*
|
|
@@ -105,31 +105,6 @@ module.exports = {
|
|
|
105
105
|
cssSourceMap: true
|
|
106
106
|
*/
|
|
107
107
|
},
|
|
108
|
-
// 授权码授权模式下的 NeoCRM 平台配置
|
|
109
|
-
neoConfig: {
|
|
110
|
-
authType: 'oauth2', // 授权类型,可选值:oauth2(默认)、password
|
|
111
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
112
|
-
// 当 authType 为 oauth2 时,loginURL 配置项必填
|
|
113
|
-
loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth', // 登录授权 URL(默认:https://login.xiaoshouyi.com/auc/oauth2/auth)
|
|
114
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
115
|
-
},
|
|
116
|
-
/*
|
|
117
|
-
// 密码授权模式下的 NeoCRM 平台配置
|
|
118
|
-
neoConfig: {
|
|
119
|
-
authType: 'password', // 授权类型,可选值:oauth2(默认)、password
|
|
120
|
-
neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
|
|
121
|
-
tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
122
|
-
// 当 authType 为 password 时,auth 配置项必填
|
|
123
|
-
auth: {
|
|
124
|
-
client_id: auth.client_id || 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
|
|
125
|
-
client_secret: auth.client_secret || 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
|
|
126
|
-
username: auth.username || 'xx', // 用户在销售易系统中的用户名
|
|
127
|
-
// password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
|
|
128
|
-
// 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
|
|
129
|
-
password: auth.password || 'xx xx', // 用户账户密码 + 8 位安全令牌
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
*/
|
|
133
108
|
pushCmp: {
|
|
134
109
|
// 用于构建并发布至 NeoCRM 的相关配置
|
|
135
110
|
/*
|
package/test/demo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {neoInit, neoConfigInit, inspect, debug, build2lib, build2esm, neoInitByCopy, previewCmp, createCmpByTemplate } = require('../
|
|
1
|
+
const {neoInit, neoConfigInit, inspect, debug, build2lib, build2esm, neoInitByCopy, previewCmp, createCmpByTemplate } = require('../src/main');
|
|
2
2
|
createCmpByTemplate('react_ts');
|
|
3
3
|
// neoInitByCopy('react-ts', 'test123');
|
|
4
4
|
|