taro-ci 2.0.2-alpha.0 → 2.0.2-alpha.3
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 +22 -2
- package/dist/taro-ci.js +2 -2
- package/dist/types/index.d.ts +6 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/install.d.ts +5 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# taro-ci
|
|
2
2
|
|
|
3
|
-
基于[微信:miniprogram-ci](https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html)、[支付宝:
|
|
3
|
+
基于[微信:miniprogram-ci](https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html)、[支付宝:minidev](https://opendocs.alipay.com/mini/02q29z?pathHash=be1e11ff)开发,使用 swan-toolkit 支持百度小程序自动上传,用于同时打包 weapp、alipay、swan、weapp.third 多版本发布管理;第一个横线后半部分会作为环境变量注入到 Taro 框架小程序中【process.env.MODE_ENV=third】;执行 taro build 时置入的环境变量还包括 process.env.ROOT_PATH=当前文件包输出路径,例:dist/weapp.dev;process.env.PLATFORM_ENV=weapp|alipay|swan;
|
|
4
4
|
|
|
5
5
|
扩展编译平台使用 [taro-plugin-build](https://www.npmjs.com/package/taro-plugin-build),并在 taro-ci.config 中配置 useTaroPluginBuildBy="",插件编译时自动注册对应的编译平台,可实现多版本公用框架并针对特殊版本处理,具体可参考:[Taro 跨平台开发](https://taro-docs.jd.com/taro/docs/2.x/envs)
|
|
6
6
|
|
|
@@ -50,12 +50,18 @@ module.exports = {
|
|
|
50
50
|
insertImport: { // 为了兼容taro3.x 需要注入一些引用,别名位置可以是default或者alias.default,表示引入default
|
|
51
51
|
'导入路径':(['导出名', '文件类型PAGE|COMPONENT|ENTRY|void', '导出别名.default']|'导出名')[],
|
|
52
52
|
},
|
|
53
|
+
defaultMode: '', // 默认mode
|
|
54
|
+
taroVersion: '', // @tarojs/cli版本
|
|
53
55
|
info: {
|
|
54
56
|
weapp: {
|
|
55
57
|
patch404: true, // app.json缺少的文件,自动用src/404.jsx补充;
|
|
56
58
|
version: "1.1.0",
|
|
57
59
|
description: "对应版本的针对性描述",
|
|
58
60
|
appId: "wx.................",
|
|
61
|
+
audit: {
|
|
62
|
+
versionScreenshot: ['','',''], // 必填,可以配置截图,以支持自动提审 2-5张
|
|
63
|
+
...({}) // 其他提审配置,参考:https://opendocs.alipay.com/mini/0a3ehy?pathHash=1ec799a9
|
|
64
|
+
},
|
|
59
65
|
subs:{
|
|
60
66
|
'pages-0': {
|
|
61
67
|
/**
|
|
@@ -74,7 +80,7 @@ module.exports = {
|
|
|
74
80
|
},
|
|
75
81
|
}
|
|
76
82
|
},
|
|
77
|
-
"weapp
|
|
83
|
+
"weapp.third": {
|
|
78
84
|
appId: "wx.................",
|
|
79
85
|
label: "普通", // 特殊版本的标签
|
|
80
86
|
tag: "N", // 特殊版本的标签体现在版本号上 N1.2.0
|
|
@@ -84,6 +90,20 @@ module.exports = {
|
|
|
84
90
|
appId: "支付宝的APPID",
|
|
85
91
|
},
|
|
86
92
|
},
|
|
93
|
+
asyncComponents: {
|
|
94
|
+
// 异步分包组件
|
|
95
|
+
'async-components': {
|
|
96
|
+
root: '',
|
|
97
|
+
placeholder: 'view',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
dynamicDependencies: {
|
|
101
|
+
// 动态依赖,taro-ci编译时会检查并安装
|
|
102
|
+
weapp: {},
|
|
103
|
+
alipay: {},
|
|
104
|
+
swan: {},
|
|
105
|
+
tt: {},
|
|
106
|
+
},
|
|
87
107
|
branchMap: {test:{type:'',robot:1}} | (branch) => ({type:'',robot:1}), // 分支对应信息,可为对象或者方法
|
|
88
108
|
minSwanVersion: "", // 最低基础库版本
|
|
89
109
|
useTaroPluginBuildBy: "normal", // type|mode|normal 自定义编译模式:mode - 按照MODE_ENV对应编译,type - 按照传入的全指令编译
|
package/dist/taro-ci.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* taro-ci v2.0.
|
|
2
|
+
* taro-ci v2.0.2-alpha.2
|
|
3
3
|
* (c) 2021-2025 yym
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var e=require("chalk"),r=require("ora"),n=require("path"),t=require("fs-extra"),i=require("minimist"),o=require("dayjs"),s=require("execa"),a=require("miniprogram-ci"),u=require("minidev"),c=require("semver"),l=require("tt-ide-cli"),f=require("dingtalk-robot-sender"),d=require("chokidar"),p=require("lodash");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h,m=v(e),g=v(r),b=v(n),y=v(t),w=v(i),E=v(o),P=v(s),C=v(a),j=v(c),S=v(l),x=v(f),I=v(d),D=function(){return D=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},D.apply(this,arguments)};function A(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)r.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}function O(e,r,n,t){return new(n||(n=Promise))((function(i,o){function s(e){try{u(t.next(e))}catch(e){o(e)}}function a(e){try{u(t.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n((function(r){r(e.value)})).then(s,a)}u((t=t.apply(e,r||[])).next())}))}function k(e,r){var n,t,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,t&&(i=2&o[0]?t.return:o[0]?t.throw||((i=t.return)&&i.call(t),0):t.next)&&!(i=i.call(t,o[1])).done)return i;switch(t=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,t=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=r.call(e,s)}catch(e){o=[6,e],t=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function T(){for(var e=0,r=0,n=arguments.length;r<n;r++)e+=arguments[r].length;var t=Array(e),i=0;for(r=0;r<n;r++)for(var o=arguments[r],s=0,a=o.length;s<a;s++,i++)t[i]=o[s];return t}!function(e){e.WEAPP="weapp",e.ALIPAY="alipay",e.SWAN="swan",e.QUICKAPP="quickapp",e.H5="h5",e.RN="rn",e.TT="tt"}(h||(h={}));var R,M=h.WEAPP+"|"+h.ALIPAY+"|"+h.QUICKAPP+"|"+h.SWAN+"|"+h.H5+"|"+h.RN+"|"+h.TT,N="("+M+")([.|-]{1})?(.+)?";function q(){}!function(e){e.WEAPP="project.config.json",e.ALIPAY="mini.project.json",e.SWAN="project.swan.json",e.QUICKAPP="project.quickapp.json",e.TT="project.config.json"}(R||(R={}));var U=function(){var e=process.env,r=e.SOURCE_ROOT_PATH,n=e.INIT_CWD,t=b.default.resolve(n,"src");return{npmDir:n+"/node_modules",sourceDir:t,destinationDir:b.default.resolve(n,r),sourceRoot:r,appEntryPath:t+"/app.jsx",appEntryConfigPath:t+"/app.config.js"}};function F(){var e=U().npmDir;return require(e+"/@tarojs/helper")}function V(){var e=process.env.INIT_CWD,r=F(),n=require(e+"/"+r.PROJECT_CONFIG),t=("function"==typeof n?n(he):n).alias;if(t){var i=U(),o=i.sourceDir,s=i.destinationDir;return Object.keys(t).forEach((function(e){var r=t[e];t[e]=b.default.resolve(o,r.replace(s,o))})),t}return t}var L=[".js",".jsx",".ts",".tsx"],_=[".scss",".less"],W=[".png",".jpg",".jpeg",".gif"];function Y(e){return _.includes(e)}function B(e){return W.includes(e)}function G(e){return function(e){return L.includes(e)}(e)||Y(e)||B(e)}T(L,_);var H=/^[0-9]{8}$/;function K(e,r,n,t){void 0===t&&(t=!1);var i=new RegExp("^"+r);return(t?e.includes(r):i.test(e))?t?m.default.hex(n)(e):e.replace(i,m.default.hex(n)(r)):""}function $(e,r){var n=this;this.text="项目["+r+"]"+{build:"构建",upload:"上传"}[e],this.start=function(){n.spinner=g.default().start(m.default.yellow(n.text+"中... \n"))},this.fail=function(e){n.spinner||(n.spinner=g.default()),n.spinner.fail(m.default.red(n.text+"失败:"+e+" \n"))},this.succeed=function(){n.spinner||(n.spinner=g.default()),n.spinner.succeed(m.default.green(n.text+"成功! \n"))},this.stop=function(){n.spinner&&n.spinner.stop()}}function Q(e){var r=e.toString().replace(/\n$/g,"");return r?(r=K(r,"Tips:","#f5faa4",!0)||K(r,"生成","#b278ff")||K(r,"编译","#00ee76")||K(r,"编译成功","#00ee76",!0)||K(r,"监听文件","#6c6f7d",!0)||K(r,"创建","#00aad1")||K(r,"修改","#e3eb00")||K(r,"Listening","#00aad1",!0)||K(r,"Compiled","#00ee76",!0)||r,console.log(r),r):""}var J={1:{label:"体验",key:"Beta"},2:{label:"候选",key:"Rc"},3:{label:"正式",key:""}};function X(e,r,n,t,i){return new Promise((function(o){var s=e.split(/\s/g),a=s[0],u=s.slice(1),c=P.default(a,u,{env:D(D({},process.env),i)}),l=new $("build",t);r||n?(c.stdout.on("data",Q),c.stderr.on("data",(function(e){if(Q(e),r){var n=e.toString().trim();(n.includes("编译成功")||n.includes("successfully"))&&o({code:0})}}))):(c.stdout.on("data",(function(){})),c.stderr.on("data",(function(){})),l.start()),c.on("exit",(function(){r||(o({code:0}),l.succeed())})),c.on("error",(function(e){console.error(e),l.fail(e)}))}))}var z=null;function Z(e){void 0===e&&(e="taro-ci");var r=z;if(!r){try{r=require(b.default.resolve("./"+e+".private.config.js"))}catch(n){r=require(b.default.resolve("./"+e+".config.js"))}var n="function"==typeof r?r(he):r;return n.minSwanVersion||(n.minSwanVersion="3.310.35"),z=n,n}return r}var ee=null;function re(e){void 0===e&&(e="taro-ci");var r=ee;if(!r){var n=Z(e);try{if(process.env.PLATFORM_ENV){var t=me(b.default.resolve("./"+e+".release"),".json"),i=t?require(t):null;if(i&&i.length>0){var o=i[0].split("-"),s=o.splice(0,1)[0],a=o.splice(-1,1)[0],u=o.join("-");H.test(a)||(a&&(o.push(a),u=o.join("-")),a=E.default().format("YYYYMMDD")),n=D(D({},n),{ts:a,version:s,description:u})}ee=n}}catch(e){}return n}return r}var ne=null;function te(e){if(ne)return ne;var r=w.default(process.argv.slice(2),{boolean:["watch","debug","upload","multi"]}),n=r.ci,t=void 0===n?"":n,i=r.dd,o=void 0===i?"":i,s=r.privacy,a=void 0===s?"":s,u=r.tt,c=void 0===u?"":u,l=r.watch,f=r.debug,d=r.upload,p=r.branch,v=r.multi,h=r.message,m=A(r,["ci","dd","privacy","tt","watch","debug","upload","branch","multi","message"]),g=t.split(","),b=g[0],y=g[1],E=g[2],P=c.split(","),C=P[0],j=P[1],S=o.split(","),x=S[0],I=S[1],O=a.split(","),k=O[0],T=O[1],R=(""+(h||"")).replace(/\n/g,""),N=function(e){if(!e)return{};var r=new RegExp("\\[(("+M+")((\\.[a-zA-Z,]+)+)?,?)\\]"),n=(e.match(r)||[])[1];return n?{type:n.split(",")}:{}}(R),q=N.type,U=N.robot,F=void 0===U?1:U,V=function(e,r){return r&&e?"function"==typeof r?r(e):r[e]:{}}(p,e),L=V.type,_=void 0===L?q:L,W=V.robot,Y=void 0===W?F:W;return ne=D({ci:t?{toolId:b,privateKey:y,token:E}:void 0,dd:o?{accessToken:x,secret:I}:void 0,privacy:a?{accessToken:k,secret:T}:void 0,tt:c?{email:C,password:j}:void 0,watch:l,debug:f,isWatch:Boolean(l),isDebug:Boolean(f),isUpload:Boolean(d),isCi:Boolean(Y),isMulti:Boolean(v),branch:p,robot:Y,type:_,message:R},m)}function ie(){return process.env.PLATFORM_ENV}function oe(){var e=ie();return b.default.resolve("./",R[e.toLocaleUpperCase()]||R.WEAPP)}function se(){return O(this,void 0,void 0,(function(){var e,r;return k(this,(function(n){return e=oe(),r=y.default.readFileSync(e),[2,JSON.parse(r.toString())]}))}))}var ae={miniprogram:"miniProgram",plugin:"miniProgramPlugin",game:"miniGame",gamePlugin:"miniGamePlugin"};function ue(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s;return k(this,(function(a){if(r=te(),n=r.isWatch,t=r.isDebug,"swan"!==process.env.PLATFORM_ENV&&(n||t))return[2,e];try{i=b.default.resolve("./ext.json"),(o=require(i)).extEnable=!1,"swan"===process.env.PLATFORM_ENV&&(s=re().info,o.extAppid=s[e].appId),y.default.writeFileSync(i,JSON.stringify(o,null,4))}catch(e){console.log("ext-extEnable",e)}return[2,e]}))}))}function ce(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d;return k(this,(function(p){switch(p.label){case 0:return r=re().info,n=te(),t=n.isWatch,i=n.isDebug,o=n.isUpload,s=n.isMulti,a=r[e]||{},u=a.appId,c=a.template,l="dist/"+function(e,r,n,t){return e+"."+(r?"dev":"build")+(n?".debug":"")+(t?".multi":"")}(e,t,i,s),process.env.ROOT_PATH=l,process.env.PROJECT_ENV=s?"MULTI":"MINI",process.env.FIX_ENV===h.QUICKAPP||o?[2,e]:(f=oe(),[4,se()]);case 1:return d=p.sent(),"swan"===process.env.PLATFORM_ENV?d.smartProgramRoot=l:d.miniprogramRoot=l,d.projectArchitecture=s?"multiPlatform":"miniprogram",d.appid=u,y.default.writeFileSync(f,JSON.stringify(d,null,4)),1!==c&&"swan"!==process.env.PLATFORM_ENV?[3,3]:[4,ue(e)];case 2:p.sent(),p.label=3;case 3:return[2,e]}}))}))}function le(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.filter((function(e){return!!e})).join("-")}function fe(e){return e?e.trim():void 0}function de(e){var r=re(),n=r.version,t=r.description,i=r.info,o=r.minSwanVersion,s=te(r.branchMap),a=s.robot,u=s.message,c=i[e]||{},l=c.version,f=void 0===l?n:l,d=c.description,p=void 0===d?t:d,v=c.tag,h=void 0===v?"":v,m=c.label,g=void 0===m?"":m,b=c.robot,y=void 0===b?1:b,w=function(e){if(!e)return{};var r=e.replace(/\n/g,""),n=(r.match(/v:(.+)d:/)||[])[1],t=(r.match(/d:(.+)See merge request/)||[])[1];return{version:fe(n),description:fe(t)}}(u),P=w.version,C=void 0===P?f:P,j=w.description,S=void 0===j?p:j,x=J[a+""],I=x.label,D=x.key,A=le(I,g);return{minSwanVersion:o,robot:a+2*(y-1),versionPure:C,version:le(D,h+C),description:"【"+A+"版-"+E.default().format("YYYYMMDDHHmmss")+"】:"+u+"【"+S+"】",label:A,versionKey:D}}function pe(e){return"[object Object]"===Object.prototype.toString.call(e)}function ve(e){return Array.isArray(e)}function he(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.reduce((function(e,r){return Object.keys(r).reduce((function(e,n){var t=r[n];return pe(t)?e[n]=he(e[n]?e[n]:{},t):ve(t)?e[n]=t.map((function(r,t){if(pe(r)){var i=e[n]?e[n]:[];return he(i[t]?i[t]:{},r)}return r})):e[n]=t,e}),e)}),e)}function me(e,r){var n=e.replace(/\/$/,""),t="";if(!r){for(var i=0,o=L.length;i<o;i++){if(t=me(n,L[i]))return t}return t}var s=process.env.PLATFORM_ENV,a=process.env.MODE_ENV,u=[s];a&&u.unshift(s+"."+a,a);var c=/\/(index)?$/;for(i=0,o=u.length;i<o;i++){var l=u[i];if(y.default.existsSync(t=n+"."+l+r))return t;if(y.default.existsSync(t=""+n.replace(c,"")+b.default.sep+"index."+l+r))return t;if(c.test(n)&&y.default.existsSync(t=""+n.replace(c,"."+l+"/index")+r))return t}return y.default.existsSync(t=""+n+r)||y.default.existsSync(t=""+n+b.default.sep+"index"+r)?t:""}function ge(e,r){Object.keys(e).forEach((function(n){r[n]?(e[r[n]]=e[n],"object"==typeof e[n]&&ge(e[r[n]],r),delete e[n]):!1===r[n]?delete e[n]:"object"==typeof e[n]&&ge(e[n],r)}))}var be=function(e){return/^pages((\-\d{1,2})?)$/.test(e)};function ye(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d,p,v,h;return k(this,(function(g){switch(g.label){case 0:return r=te(),n=r.isWatch,t=r.isDebug,i=r.isUpload,o=re(),s=o.useTaroPluginBuildBy,a=o.info,u=o.version,c=(a[e]||{}).version,l=void 0===c?u:c,process.env.APP_VERSION=l,f=process.env,d=f.MODE_ENV,p=f.PLATFORM_ENV,v=f.FIX_ENV,i?[2,e]:(h="taro build --type "+("type"===s?e:"mode"===s&&d?d:p),n&&(h+=" --watch"),console.log(m.default.grey("编译平台:"),m.default.red(v||p),m.default.grey("版本模式:"),m.default.red(d||"默认")),[4,X(h,n,t,e)]);case 1:return g.sent(),[2,e]}}))}))}function we(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d,p,v,h;return k(this,(function(m){switch(m.label){case 0:return[4,re()];case 1:return r=m.sent().info,n=(void 0===r?{}:r)[e].appId,t=de(e),i=t.version,o=t.description,s=t.robot,[4,se()];case 2:if(a=m.sent(),u=a.setting,c=void 0===u?{}:u,l=a.compileType,f=void 0===l?"miniprogram":l,d=null,p=null,!n)return d=new Error("缺少appId,无法上传到微信平台"),[2,{item:e,error:d,errorCode:3}];v=new C.default.Project({appid:n,type:ae[f]||"miniProgram",projectPath:b.default.resolve("./"),privateKeyPath:b.default.resolve("./","private."+n+".key"),ignores:["node_modules/**/*"]}),m.label=3;case 3:return m.trys.push([3,5,,6]),[4,C.default.upload({robot:s,project:v,version:i,desc:o,setting:c,onProgressUpdate:function(){}})];case 4:return p=m.sent(),[3,6];case 5:return h=m.sent(),d=h,[3,6];case 6:return[2,{item:e,error:d,result:p}]}}))}))}function Ee(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,c,l,f,d,p,v,h,m,g,y,w,E,P,C,S,x,I,A,O,T,R,M,N;return k(this,(function(k){switch(k.label){case 0:return r=te().ci,[4,re()];case 1:if(n=k.sent(),t=n.info,i=void 0===t?{}:t,o=n.ci,s=i[e],a=s.appId,c=s.audit,l=D(D({},o),r),f=l.toolId,d=l.privateKey,p=de(e),v=p.versionPure,h=p.description,m=p.versionKey,g=null,y=null,!a||!f)return g=new Error("缺少"+(a?"toolId":"appId")+",无法上传到支付宝平台"),[2,{item:e,error:g,errorCode:3}];k.label=2;case 2:return k.trys.push([2,17,,18]),[4,u.minidev.config.useRuntime({"alipay.authentication.privateKey":d,"alipay.authentication.toolId":f})];case 3:return k.sent(),E={appId:a,clientType:w="alipay",project:b.default.resolve("./"),versionDescription:h},[4,u.minidev.app.getUploadedVersionList({appId:a,clientType:w})];case 4:if(P=k.sent(),C=P.filter((function(e){return"INIT"===e.versionStatus&&(""+e.versionDescription).includes("体验版-")})),!(C.length>=1))return[3,9];S=C.slice(-1)[0].appVersion,x={appId:a,clientType:w,version:S},k.label=5;case 5:return k.trys.push([5,8,,9]),[4,u.minidev.app.cancelExperience(x)];case 6:return k.sent(),[4,u.minidev.app.deleteVersion(x)];case 7:return k.sent(),[3,9];case 8:return I=k.sent(),g=I,[3,9];case 9:return(A=require(b.default.resolve("./mini.project.json")))&&(E.project=b.default.join(E.project,A.miniprogramRoot)),v&&"-1"!==v?[4,u.minidev.app.getUploadedVersion({clientType:w,appId:a})]:[3,11];case 10:O=k.sent(),j.default.gt(v,O)||(v=j.default.inc(O,"patch")),E.version=v,k.label=11;case 11:return[4,u.minidev.upload(E,{onLog:q,onTaskCreated:q,onVersionCreated:q})];case 12:return y=k.sent(),T=!0,m||!c?[3,14]:(R=c.versionScreenshot)&&R.length>=2?[4,u.minidev.audit(D(D({},c),{appId:a,clientType:w,version:E.version,versionDescription:E.versionDescription}))]:[3,14];case 13:k.sent(),T=!1,k.label=14;case 14:return T?[4,u.minidev.app.setExperience({appId:a,clientType:w,version:E.version})]:[3,16];case 15:M=k.sent().qrCodeUrl,y.qrCodeUrl=M,k.label=16;case 16:return[3,18];case 17:return N=k.sent(),g=N,[3,18];case 18:return[2,{item:e,result:y,error:g}]}}))}))}function Pe(e){return void 0===e&&(e=!0),"上传失败"+(e?",缺少swan-toolkit包":"")}function Ce(e,r){return void 0===r&&(r=!1),new Promise((function(n){var t=e.token,i=e.version,o=e.desc,s=("swan upload -p ./ --token "+t+" --min-swan-version "+e.minSwanVersion+" --release-version "+i+" -d "+o.replace(/\s/,"")).split(/\s/g),a=s[0],u=s.slice(1),c=P.default(a,u,{shell:!0}),l="";c.stderr.on("data",(function(e){l=""+e})),c.on("close",(function(t){var i;0===t?n({}):127===t?(i="swan-toolkit",new Promise((function(e){console.log(m.default.red("缺少指令:"),m.default.gray(i)),P.default("npm",["install",i,"-g"],{shell:!0}).on("close",(function(r){0===r?console.log(m.default.green("指令安装成功")):console.log(m.default.red("指令安装失败")),e(r)}))}))).then((function(){r?n({error:Pe()}):Ce(e,!0).then(n).catch(n)})).catch((function(){n({error:Pe()})})):n({error:l||Pe(!1)})}))}))}function je(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l;return k(this,(function(f){switch(f.label){case 0:return r=te().ci,[4,re()];case 1:if(n=f.sent().ci,t=de(e),i=t.versionPure,o=t.description,s=t.minSwanVersion,a=D(D({},n),r).token,c=null,!(u=void 0===a?"":a))return c=new Error("缺少token,无法上传到百度平台"),[2,{item:e,error:c,errorCode:3}];try{y.default.writeFileSync(b.default.resolve("./ext.json"),"")}catch(e){}return[4,Ce({token:u,version:i,desc:o,minSwanVersion:s})];case 2:return l=f.sent(),c=l.error,[2,{item:e,result:l,error:c}]}}))}))}function Se(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l;return k(this,(function(f){switch(f.label){case 0:return r=te().tt,[4,re()];case 1:return n=f.sent().tt,t=D(D({},n),r),i=t.email,o=t.password,s=de(e),a=s.versionPure,u=s.description,c=null,i&&o?[4,S.default.loginByEmail({email:i,password:o})]:(c=new Error("缺少"+(i?"password":"email")+",无法上传到抖音平台"),[2,{item:e,error:c,errorCode:3}]);case 2:return f.sent(),[4,S.default.upload({project:{path:b.default.resolve("./")},qrcode:{format:null,output:"",options:{small:!1}},version:a,changeLog:u,copyToClipboard:!1,needUploadSourcemap:!0}).catch((function(e){return c=e}))];case 3:return l=f.sent(),[4,S.default.logout()];case 4:return f.sent(),[2,{item:e,error:c,result:l}]}}))}))}function xe(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d;return k(this,(function(p){switch(p.label){case 0:if(r=te(),n=r.isCi,t=r.isWatch,i=r.isDebug,process.env.FIX_ENV)throw new Error("暂不支持快应用上传");if(t||!n)throw new Error(e+",未传入robot或者开发模式无法上传");if(i)throw new Error(e+",DEBUG模式无法上传");o=ie(),s={item:e},(a=new $("upload",e)).start(),p.label=1;case 1:switch(p.trys.push([1,12,,13]),o){case h.WEAPP:return[3,2];case h.ALIPAY:return[3,4];case h.SWAN:return[3,6];case h.TT:return[3,8]}return[3,10];case 2:return[4,we(e)];case 3:return s=p.sent(),[3,11];case 4:return[4,Ee(e)];case 5:return s=p.sent(),[3,11];case 6:return[4,je(e)];case 7:return s=p.sent(),[3,11];case 8:return[4,Se(e)];case 9:return s=p.sent(),[3,11];case 10:throw u=h.WEAPP+"、"+h.ALIPAY+"、"+h.SWAN+"、"+h.TT,c=new Error("不支持上传该平台,目前支持:"+u),a.fail(c),s={item:e,error:c,errorCode:1},c;case 11:return l=s.error,f=s.errorCode,l?(a.fail(l.message||l),f||(s.errorCode=2)):a.succeed(),[3,13];case 12:return d=p.sent(),a.fail(d.message||d),s={item:e,error:d},[3,13];case 13:return[2,s]}}))}))}function Ie(){this.text="",this.title="",this.items=[],this.setTitle=function(e){return this.title=e,this},this.add=function(e){return Array.isArray(e)?this.items.concat(e):this.items.push(e),this.text=this.items.join("\n"),this}}function De(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d,p,v,g,b,y,w,E,P,C,j,S,I,A,O,T,R,M;return k(this,(function(k){return r=e.result,n=e.error,t=e.item,i=e.errorCode,o=re(),s=te(o.branchMap),a=s.dd,u=s.privacy,c=o.dd,l=void 0===c?a:c,f=o.privacy,d=void 0===f?u:f,p=o.name,v=o.git,g=void 0===v?"":v,b=de(t),y=b.version,w=b.description,E=b.label,P=ie(),j=(C=r||{}).version,S=void 0===j?y:j,I=C.experienceQrCodeUrl,A=C.qrCodeUrl,O=void 0===A?I:A,T=("["+t+"]"+p).toUpperCase()+":"+E,R=(new Ie).setTitle(T).add("["+T+"]("+g+")\n"),n?(M=P===h.H5?"**上传结果:打包成功,自行部署发布**":'**上传结果:上传失败** \n<font color="red">('+n.message+")</font>",R.add(M)):R.add("**上传结果:上传成功**"),R.add("1. version:"+S).add("2. description:"+w),O&&R.add("\n"),d&&new x.default(D({baseUrl:"https://oapi.dingtalk.com/robot/send"},d)).markdown(R.title,R.text),l&&new x.default(D({baseUrl:"https://oapi.dingtalk.com/robot/send"},l)).markdown(R.title,R.text).then((function(){console.log(m.default.green("已发送钉钉通知!")),n&&P!==h.H5&&1!==i&&process.exit(1)})),[2]}))}))}var Ae={current:{patchFilesMap:{},usingComponentsCopiedFilesMap:{},patchImportAbsoluteMap:{}}};function Oe(e){return b.default.extname(e)}function ke(e,r){return void 0===r&&(r=!1),b.default.basename(e,r?void 0:Oe(e))}function Te(e){var r=Oe(e);return G(r)?[e.replace(r,""),r]:[e]}var Re=function(e){var r=Te(e),n=r[0],t=r[1],i=re(),o=i.modes,s=void 0===o?[]:o,a=i.modesExclude;if((void 0===a?[]:a).some((function(r){return e.includes(r)})))return e;var u="(\\.("+M+"))?",c="(\\.("+s.sort((function(e){return e.includes(".")?-1:1})).join("|")+"))?",l=new RegExp(u+c,"g");return n.replace(l,"")+t};function Me(e,r){var n=U(),t=n.sourceDir,i=n.destinationDir;return e.replace(t,i+(r&&be(r)?"/"+r:""))}function Ne(e){return function(e){try{return y.default.statSync(e).isDirectory()}catch(e){return!1}}(e)?e:b.default.dirname(e)}function qe(e,r){var n=Ne(e),t=b.default.relative(n,r);return t.startsWith(".")||(t="./"+t),t}function Ue(e,r){return O(this,void 0,void 0,(function(){return k(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,y.default.copy(e,r,{overwrite:!0})];case 1:case 2:return n.sent(),[3,3];case 3:return[2]}}))}))}function Fe(e,r){var n=V(),t=F();return t.isAliasPath(e,n)?function(e){for(var r in n)if(e.startsWith(r+"/"))return b.default.join(n[r],"./"+e.slice(r.length));return""}(e):t.isNpmPkg(e)?require.resolve(b.default.resolve(U().npmDir,e)):b.default.resolve(r?Ne(r):U().sourceDir,e)}function Ve(e){return!!e.walkAtRules}function Le(e,r){var n=r||{},t=n.CSSImportDeclaration,i=n.CSSDeclarations,o=n.CSSRules;t&&e.walkAtRules((function(e){"import"===e.name&&t(e)})),i&&e.walkDecls(i),o&&e.walkRules(o)}function _e(e){return{code:e.toString()}}function We(e,r){return O(this,void 0,void 0,(function(){var n,t,i,o,s,a;return k(this,(function(u){switch(u.label){case 0:return n=e.ast,t=e.source,i=U().npmDir,o=require(i+"/postcss-url"),s=require(i+"/postcss"),a=o({url:"copy",useHash:!1}),n.source.input.file=t,[4,s([a]).process(n,{from:t,to:r})];case 1:return u.sent(),[2]}}))}))}function Ye(){var e=U().npmDir;return require(e+"/@babel/types")}function Be(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=U().npmDir;return require(n+"/@babel/traverse").default.apply(void 0,e)}function Ge(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=U().npmDir;return require(n+"/@babel/generator").default.apply(void 0,e)}function He(e,r){if(r){var n=function(e){var r=U().npmDir,n=require(r+"/postcss"),t=require(r+"/postcss-scss"),i=e.replace(/\/\/\s.*$/gm,"");return n.parse(i,{syntax:t})}(e);return n}var t=U().npmDir;return require(t+"/@babel/parser").parse(e,{sourceType:"module",plugins:["jsx","tsx","typescript","classProperties","dynamicImport","decorators-legacy"]})}function Ke(e){var r=Ye();if(Array.isArray(e))return r.arrayExpression(e.map((function(e){return Ke(e)})));if("object"==typeof e&&null!==e){var n=Object.keys(e).map((function(n){var t=r.isValidIdentifier(n)?r.identifier(n):r.stringLiteral(n);return r.objectProperty(t,Ke(e[n]))}));return r.objectExpression(n)}if("string"==typeof e)return r.stringLiteral(e);if("number"==typeof e)return r.numericLiteral(e);if("boolean"==typeof e)return r.booleanLiteral(e);throw new Error("Unsupported type: "+typeof e)}function $e(e,r){var n=Ye();return r&&n.isIdentifier(e.superClass,{name:"Component"})||n.isMemberExpression(e.superClass)&&"Taro"===e.superClass.object.name&&"Component"===e.superClass.property.name}function Qe(e){var r=Ge(e).code;return new Function("return "+r)()}function Je(e){return["ENTRY","PAGE"].includes(e)}function Xe(e){return Je(e)||function(e){return"COMPONENT"===e}(e)}function ze(e,r){return O(this,void 0,void 0,(function(){var n,t;return k(this,(function(i){switch(i.label){case 0:return r?("alipay"===process.env.PLATFORM_ENV&&(n={navigationStyle:"transparentTitle"},"custom"===r.navigationStyle&&(r.navigationBarTitleTextAlipay=r.navigationBarTitleText,r.navigationBarTitleText="",r.navigationStyle="always",r.titlePenetrate="YES"),ge(r,n)),t=Ge(Ye().valueToNode(r),{}),[4,y.default.writeFileSync(e.replace(ke(e,!0),ke(e)+".config.js"),"const config = "+t.code+";\nexport default config;")]):[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}function Ze(e,r){var n,t=Ye(),i=U().sourceDir,o=function(){},s=function(e){var r="",n=Ye();return Be(e,{ExportDefaultDeclaration:function(e){var t=e.node.declaration;n.isIdentifier(t)?r=t.name:(n.isClassDeclaration(t)||n.isFunctionDeclaration(t))&&(r=t.id?t.id.name:null)}}),r}(e);return Be(e,{ClassDeclaration:function(e){var a=$e(e.node,!0);e.node.id.name===s&&a&&(e.node.body.body=e.node.body.body.filter((function(e){if(t.isClassProperty(e)&&"config"===e.key.name){if(t.isObjectExpression(e.value))n=Qe(e.value),o=function(r){e.value=Ke(D(D({},n),r))};else if(t.isCallExpression(e.value)&&t.isMemberExpression(e.value.callee)){var s=e.value.callee;if("preval"===s.object.name&&"require"===s.property.name){var a=e.value.arguments[0].value,u=b.default.resolve(i,a);try{c=u,void 0===(l=!0)&&(l=!1),l&&delete require.cache[require.resolve(c)],n=require(c)}catch(e){}}}return!r}var c,l;return!0})))},AssignmentExpression:function(e){t.isMemberExpression(e.node.left)&&e.node.left.object.name===s&&"config"===e.node.left.property.name&&(n=Qe(e.node.right),r&&e.remove(),o=function(r){e.node.right=Ke(D(D({},n),r))})}}),[n,o]}var er={react:["Fragment","Component","useEffect","useLayoutEffect","useState","useContext","useRef","useCallback","useMemo","useImperativeHandle","useReducer","createRef","createContext"],"react-redux":["Provider","connect","useSelector","useDispatch","useStore"]};function rr(e,r,n){var t,i,o,s=Xe(r),a=!1;if(s){var u=Ye(),c=re().insertImport,l=(t=D(D({},c),er),i={},o=function(e,r){i[e]=i[e]||[],i[e].push(r)},Object.keys(t).forEach((function(e){var r=t[e];ve(r)?r.forEach((function(r){var n=ve(r)?r:[r],t=n[0],i=n.slice(1);o(t,T([e],i))})):o(r,[e])})),i),f={},d=new Set,p={};!function(e){var r=Ye(),n=!1,t=!1;Be(e,{ImportDeclaration:function(e){e.node.specifiers.forEach((function(e){r.isImportSpecifier(e)&&"Component"===e.imported.name&&(t=!0)}))}}),Be(e,{ClassDeclaration:function(e){var t=e.node.superClass,i=$e(e.node,!0);t&&i&&(n=!0,e.node.superClass=r.identifier("Component"))}}),n&&!t&&Be(e,{ImportDeclaration:function(e){"@tarojs/taro"===e.node.source.value&&e.node.specifiers.push(r.importSpecifier(r.identifier("Component"),r.identifier("Component")))}})}(e),Be(e,{ImportDeclaration:function(e){var t=[];e.node.specifiers.forEach((function(e){var i=e.imported?e.imported.name:e.local.name,o=l[i];if(o){var s=o.find((function(e){var n=e[1];return n&&n.split(/\||,/).includes(r)}))||o.find((function(e){return!e[1]}))||[],c=s[0],d=s[2],v=s[3];if(!c)return;if(n){var h=Ae.current.patchImportAbsoluteMap[c];if(!h){var m=Te(Fe(c,v)),g=m[0],b=m[1];Ae.current.patchImportAbsoluteMap[c]=h=me(g,b)}if(n===h)return}var y=(""+(d||"")).split("."),w=y[0],E=void 0===w?"":w,P=y[1],C="default"===(void 0===P?E:P);"default"===E&&(E=""),f[c]||(f[c]=[]),f[c].push(C?u.importDefaultSpecifier(u.identifier(E||i),u.identifier(i)):E?u.importSpecifier(u.identifier(E),u.identifier(i)):e),E&&(p[e.local.name]=E),t.push(e),a=!0}})),t.length&&t.length===e.node.specifiers.length?d.add(e):t.forEach((function(r){e.node.specifiers=e.node.specifiers.filter((function(e){return e!==r}))}))}}),d.forEach((function(e){return e.remove()})),Be(e,{Identifier:function(e){var r=e.node.name,n=p[r];n&&(e.scope.hasBinding(r)?e.scope.rename(r,n):e.node.name=n)}}),Object.keys(f).forEach((function(r){var n=e.program.body.find((function(e){return u.isImportDeclaration(e)&&e.source.value===r}));if(n)f[r].forEach((function(e){n.specifiers.some((function(r){return r.local.name===e.local.name}))||n.specifiers.push(e)}));else{var t=u.importDeclaration(f[r],u.stringLiteral(r));e.program.body.unshift(t)}}))}return{isUpdateImport:a}}function nr(e,r,n){return O(this,void 0,void 0,(function(){var t,i,o,s;return k(this,(function(a){return Ve(e)?(t=function(e){var r=!1;return Le(e,{CSSDeclarations:function(e){var n=e.value.replace(/(\$\w[\w-]*)\s*\/\s*(\d+(\.\d+)?)/g,(function(e,n,t){var i=(1/parseFloat(t)).toFixed(5);return r=!0,n+" * "+i}));e.value=n}}),{isUpdateCss:r}}(e).isUpdateCss,[2,[,t]]):(i=function(e,r){var n=Xe(r),t=!1;if(n){var i=Ye(),o=!1;Be(e,{ImportDeclaration:function(e){if("@tarojs/taro"===e.node.source.value){var r=e.node.specifiers;o=r.some((function(e){return i.isImportSpecifier(e)&&"Component"===e.imported.name}))}}}),Be(e,{ClassDeclaration:function(e){var r=e.node,n=r.superClass,s=r.body;if(n&&$e(r,o)){var a=s.body.find((function(e){return i.isClassMethod(e)&&"constructor"===e.kind}));if(a)a.body.body.some((function(e){return i.isExpressionStatement(e)&&i.isCallExpression(e.expression)&&i.isSuper(e.expression.callee)}))||(a.body.body.unshift(i.expressionStatement(i.callExpression(i.super(),[i.spreadElement(i.identifier("arguments"))]))),t=!0);else{var u=i.classMethod("constructor",i.identifier("constructor"),[],i.blockStatement([i.expressionStatement(i.callExpression(i.super(),[i.spreadElement(i.identifier("arguments"))]))]));s.body.unshift(u),t=!0}}}})}return{isUpdateConstructor:t}}(e,r).isUpdateConstructor,o=function(e,r){return{config:(Je(r)?Ze(e,!0):[])[0]}}(e,r).config,s=rr(e,r,n).isUpdateImport,[2,[o,i||s]])}))}))}function tr(e,r){return O(this,void 0,void 0,(function(){var n,t,i,o,s=this;return k(this,(function(a){return n=e.ast,t=e.create,i=e.code,o=function(){},function(e,r){Ve(e)?Le(e,r({types:{isPostcss:!0,checkIsCssAst:Ve},generate:_e})):Be(e,r({types:Ye(),generate:Ge}))}(n,(function(e){var a=e.generate,u=e.types,c=function(e,n,t){return r({value:e,SetImportValue:function(e){"cssImport"===t?n.params="'"+e+"'":"import"===t?n.node.source.value=e:"require"===t&&(n.node.arguments[0].value=e)}})};o=function(e,r){return void 0===r&&(r=n),O(s,void 0,void 0,(function(){var n;return k(this,(function(t){try{n=a(r,{}),y.default.ensureDirSync(b.default.dirname(e)),y.default.writeFileSync(e,n.code)}catch(r){console.log("parseImport-update-error-filePath:",e),console.log("parseImport-update-error-info:",r)}return[2]}))}))};var l={ImportDeclaration:function(e){c(e.node.source.value,e,"import")},CallExpression:function(e){u.isIdentifier(e.node.callee,{name:"require"})&&c(e.node.arguments[0].value,e,"require")}};return u.isPostcss&&(l={CSSImportDeclaration:function(e){c(e.params.replace(/^('|")/,"").replace(/('|")$/,""),e,"cssImport")}}),D(D({},l),"function"==typeof t?t({ast:n,generate:a,types:u,code:i}):{})})),[2,o]}))}))}function ir(e,r){return O(this,void 0,void 0,(function(){var n,t,i,o,s,a,u,c,l,f,d,p,v;return k(this,(function(h){switch(h.label){case 0:if(n=[],t=Oe(e),i=null,a=Y(t),u=!a&&B(t),c=r||(a?"STYLE":u?"IMAGE":"COMPONENT"),l=re().compileExclude,l&&l.some((function(r){return"function"==typeof r?r(e):e.includes(r)}))||u)return[3,6];h.label=1;case 1:return h.trys.push([1,5,,6]),[4,y.default.readFileSync(e)];case 2:return f=h.sent(),d=f.toString(),[4,nr(i=He(d,a),c,e)];case 3:return v=h.sent(),o=v[0],s=v[1],[4,tr({ast:i,code:d},(function(e){var r=e.value;n.push(r)}))];case 4:return h.sent(),[3,6];case 5:return p=h.sent(),console.log("\n【runParse-error】",e,p.message,"\n"),[3,6];case 6:return[2,{source:e,dependencies:n,ast:i,type:c,config:o,isUpdate:s}]}}))}))}var or=function(e,r){return be(e)?e+"-"+r:e};function sr(){return O(this,void 0,void 0,(function(){var e,r,n,t,i;return k(this,(function(o){switch(o.label){case 0:return[4,ir(U().appEntryPath,"ENTRY")];case 1:return e=o.sent(),r=e.config,n=r.subPackages,t=A(r,["subPackages"]),i=t,n&&(i.subPackages=function(e){return e.map((function(e,r){var n=e.root,t=e.pages;e.preloadRule,e.network;var i=A(e,["root","pages","preloadRule","network"]);return D(D({},i),{root:or(n,r),pages:be(n)?t.map((function(e){return b.default.join(n,"/",e)})):t})}))}(n),i.preloadRule=function(e){var r={};return e.forEach((function(e,n){var t=e.preloadRule,i=e.root,o=e.network,s=void 0===o?"all":o;t&&(r[t]=r[t]||{packages:[],network:s},r[t].packages.push(or(i,n)))})),r}(n),e.config=i),[2,e]}}))}))}function ar(e){var r=U().sourceDir,n=b.default.resolve(r,e);return[me(n),n]}function ur(e,r){return void 0===r&&(r=""),O(this,void 0,void 0,(function(){var n,t,i,o;return k(this,(function(s){switch(s.label){case 0:n={},t=function(t,i){var o,s,a,u,c,l,f,d,p,v;return k(this,(function(i){switch(i.label){case 0:return o=e[t],r&&!be(r)&&(o=b.default.join(r,"/",o)),s=ar(o),a=s[0],u=s[1],c="",l="",f="",a||(v=ar("./404"),a=v[0],l=v[1],a&&(d=Oe(a),c=u+d,f=l+d,process.nextTick((function(){var e=Ae.current.patchFilesMap,r=e[f]||[];r.push(c),e[f]=r})))),a?(c=c||Re(a),[4,ir(a,"PAGE")]):[3,2];case 1:p=i.sent(),n[c]=D({root:r},p),i.label=2;case 2:return[2]}}))},i=0,o=e.length,s.label=1;case 1:return i<o?[5,t(i,o)]:[3,4];case 2:s.sent(),s.label=3;case 3:return i++,[3,1];case 4:return[2,n]}}))}))}function cr(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o=this;return k(this,(function(s){switch(s.label){case 0:r={},n=function(n,t){return k(this,(function(t){switch(t.label){case 0:return[4,O(o,void 0,void 0,(function(){var t,i,o;return k(this,(function(s){switch(s.label){case 0:return t=e[n],i=t.root,[4,ur(t.pages,i)];case 1:return o=s.sent(),r=D(D({},r),o),[2]}}))}))];case 1:return t.sent(),[2]}}))},t=0,i=e.length,s.label=1;case 1:return t<i?[5,n(t,i)]:[3,4];case 2:s.sent(),s.label=3;case 3:return t++,[3,1];case 4:return[2,r]}}))}))}function lr(e,r){return O(this,void 0,void 0,(function(){var n,t;return k(this,(function(i){return n=(r||{}).parents,(t=void 0===n?new Set:n).add(e),[2,t]}))}))}function fr(e,r){return O(this,void 0,void 0,(function(){var n,t,i,o,s=this;return k(this,(function(a){if((n=Object.values(D({},e))).length>0)for(t=function(e,t){O(s,void 0,void 0,(function(){var t,i;return k(this,(function(o){switch(o.label){case 0:return t=n[e],(i=r[t])?[4,dr("",i,r)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},i=0,o=n.length;i<o;i++)t(i);return[2]}))}))}function dr(e,r,n){return O(this,void 0,void 0,(function(){var t,i,o;return k(this,(function(s){switch(s.label){case 0:return t=r.root,i=r.parents,o=r.dependenciesResolveMap,t&&t!==e?(r.root="",r.copied=!1,i.forEach((function(e){var r=n[e];r&&(r.copied=!1)})),[4,fr(o,n)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}}))}))}function pr(e,r,n){return O(this,void 0,void 0,(function(){var t,i;return k(this,(function(o){return(t=(n[e]||{}).dependenciesResolveMap)&&(i=Object.values(r),Object.values(t).filter((function(e){return!i.includes(e)})).forEach((function(r){var t=n[r];if(t){var i=t.parents;i.delete(e);var o=function(e,r){for(var n="",t=Array.from(e),i=0,o=t.length;i<o;i++){var s=r[t[i]];if(s){var a=s.root;if(!a||n&&a!==n)return"";n=a}}return n}(i,n);o!==t.root&&(t.root=o,t.copied=!1)}}))),[2]}))}))}function vr(e,r){return void 0===r&&(r=e),O(this,void 0,void 0,(function(){var n,t,i,o,s;return k(this,(function(a){switch(a.label){case 0:n={},t=Object.keys(e),i=function(i,o){var s,a,u,c,l,f,d,p,v,h,m,g,b,y;return k(this,(function(o){switch(o.label){case 0:s=t[i],a=e[s],u=a.dependencies,c=void 0===u?[]:u,l=a.root,f=void 0===l?"":l,d=a.ast,p=a.config,v=!1,h=function(e,r){var n=V(),t=F();return e.filter((function(e){return t.isAliasPath(e,n)||!t.isNpmPkg(e)})).map((function(e){return[Fe(e,r),e]}))}(c,s),m={},g=function(e,t){var i,o,a,u,c,l,d,p,g,b,y;return k(this,(function(t){switch(t.label){case 0:return i=h[e],o=i[0],a=i[1],u=Te(o),c=u[0],l=u[1],(d=me(c,l))?(p=Re(d),v||(v=d!==p),m[a]=p,g=r[p]||n[p],[4,lr(s,g)]):[3,6];case 1:return b=t.sent(),g?(g.parents=b,[4,dr(f,g,D(D({},r),n))]):[3,3];case 2:return t.sent(),[3,6];case 3:return[4,ir(d)];case 4:return y=t.sent(),[4,Promise.resolve().then((function(){n[p]=D({root:f,source:d,parents:b},y)}))];case 5:t.sent(),t.label=6;case 6:return[2]}}))},b=0,y=h.length,o.label=1;case 1:return b<y?[5,g(b,y)]:[3,4];case 2:o.sent(),o.label=3;case 3:return b++,[3,1];case 4:return[4,pr(s,m,r)];case 5:return o.sent(),r[s]=D(D({},r[s]),{config:p,ast:d,dependencies:c,dependenciesResolveMap:m,dependenciesFilePathChange:v}),[2]}}))},o=0,s=t.length,a.label=1;case 1:return o<s?[5,i(o,s)]:[3,4];case 2:a.sent(),a.label=3;case 3:return o++,[3,1];case 4:return Object.keys(n).length>0?[4,vr(n,D(D({},r),n))]:[3,6];case 5:return[2,a.sent()];case 6:return[2,r]}}))}))}function hr(e,r){return O(this,void 0,void 0,(function(){var n,t;return k(this,(function(i){return(n=(e||{}).list)&&(t=U().sourceDir,n.forEach((function(e){var n=e.selectedIconPath;[e.iconPath,n].filter((function(e){return!!e})).forEach((function(e){var n=b.default.join(t,e);r[n]={source:n,type:"IMAGE"}}))}))),[2]}))}))}function mr(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o;return k(this,(function(s){switch(s.label){case 0:return r={},e&&e.custom?(n=U().sourceDir,(t=me(n+"/custom-tab-bar"))?(i=Re(t),[4,ir(t)]):[3,2]):[3,2];case 1:o=s.sent(),r[i]=D({source:t},o),s.label=2;case 2:return[2,r]}}))}))}function gr(){return O(this,void 0,void 0,(function(){var e,r,n,t,i,o,s,a,u,c;return k(this,(function(l){switch(l.label){case 0:return[4,sr()];case 1:return e=l.sent(),r=e.config,n=r.pages,t=r.subPackages,i=r.tabBar,[4,ur(n)];case 2:return o=l.sent(),s=null,t?[4,cr(t)]:[3,4];case 3:s=l.sent(),l.label=4;case 4:return[4,mr(i)];case 5:return a=l.sent(),[4,vr(D(D(D(((c={})[e.source]=e,c),o),s),a))];case 6:return u=l.sent(),[4,hr(i,u)];case 7:return l.sent(),Ae.current.allDependenciesMap=u,[2,u]}}))}))}function br(e,r){var n=e.source,t=e.files,i=e.parseRes;return O(this,void 0,void 0,(function(){return k(this,(function(e){return[2,t.reduce((function(e,t){var o,s=r[t];return s.source=n,s.copied=!1,D(D({},e),((o={})[t]=D(D({},s),i),o))}),{})]}))}))}function yr(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d,v,h,m,g;return k(this,(function(b){switch(b.label){case 0:return r=Ae.current,n=r.patchFilesMap,t=r.allDependenciesMap,i=Re(e),o=n[i],s=o&&o.length>0,a=t[i],u=!!a,s||u?(c=Te(e),l=c[0],f=c[1],(d=me(l,f))!==e?[3,6]:(v=s?"PAGE":a.type,[4,ir(d,v)])):[3,6];case 1:return h=b.sent(),s?[4,br({source:d,files:o,parseRes:h},t)]:[3,3];case 2:return m=b.sent(),[3,4];case 3:a.source=d,a.copied=!1,h.config&&a.configCreated&&(a.configCreated=p.isEqual(h.config,a.config)),(g={})[i]=D(D({},a),h),m=g,b.label=4;case 4:return Object.keys(m).forEach((function(e){t[e]=D(D({},t[e]),m[e])})),[4,vr(m,t)];case 5:return[2,b.sent()];case 6:return[2]}}))}))}function wr(e,r,n,t){e&&e.forEach((function(e){var i=t[e],o=i.type,s=i.parents,a=i.root,u=void 0===a?"":a;Xe(o)&&(Je(o)?Object.keys(r).forEach((function(t){var i=r[t],o=n[i];if(o||(o=n[i]={root:u,target:{}}),o.root!==u&&(o.root=""),""===o.root)o.target[t]=[];else{var s=o.target[t];s||(s=o.target[t]=[]),s.push(e)}})):wr(s,r,n,t))}))}function Er(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a;return k(this,(function(u){switch(u.label){case 0:if(!e)return[3,4];r={},Object.keys(e).forEach((function(n){var t=e[n],i=t||{},o=i.ast,s=i.type,a=i.parents,u=void 0===a?[n]:a,c=i.copied;if(Xe(s)&&!c){var l=Ze(o,!1),f=l[0],d=l[1];Je(s)&&(f=t.config,d=function(e){t.config=D(D({},t.config),e)});var p=(f||{}).usingComponents;if(p){var v=function(e,r){var n={},t={};return Object.keys(r).forEach((function(i){var o=r[i],s=b.default.resolve(Ne(e),o),a=Ne(s);y.default.pathExistsSync(a)?n[i]=s:t[i]=o})),[n,t]}(n,p),h=v[0],m=v[1];m&&(t.isUpdate=!0,d({usingComponents:m})),wr(u,h,r,e)}}})),n=Object.keys(r),t=U().appEntryPath,i=Ae.current.usingComponentsCopiedFilesMap,o=function(o,s){var a,u,c,l,f,d;return k(this,(function(s){switch(s.label){case 0:return a=n[o],u=Ne(a),l=(c=r[a]).root,f=c.target,d=Me(u,l),i[d]?[3,2]:[4,Ue(u,d)];case 1:s.sent(),i[d]=!0,s.label=2;case 2:return Object.keys(f).forEach((function(r){var n=f[r];(l?n:[t]).forEach((function(n){var t,i,o=e[n];o.isUpdate=!0,o.config=D(D({},o.config),{usingComponents:D(D({},null===(i=o.config)||void 0===i?void 0:i.usingComponents),(t={},t[r]=qe(n,a),t))})}))})),[2]}}))},s=0,a=n.length,u.label=1;case 1:return s<a?[5,o(s,a)]:[3,4];case 2:u.sent(),u.label=3;case 3:return s++,[3,1];case 4:return[2]}}))}))}function Pr(e,r,n){return O(this,void 0,void 0,(function(){var t,i,o;return k(this,(function(s){switch(s.label){case 0:return t=r.ast,i=r.root,o=r.dependenciesFilePathChange,[4,tr({ast:t},(function(t){var s=t.value,a=t.SetImportValue,u=r.dependenciesResolveMap[s];if(u){var c=(n[u]||{}).root;if(o||c||i)a(qe(Me(e,i),Me(u,c)))}}))];case 1:return[4,s.sent()(e)];case 2:return s.sent(),[2]}}))}))}function Cr(e,r){return O(this,void 0,void 0,(function(){var n,t,i,o,s,a,u,c,l,f,d;return k(this,(function(p){switch(p.label){case 0:return(n=r[e]).copied?[3,8]:(t=n.root,i=n.source,o=n.ast,s=n.dependenciesFilePathChange,a=n.config,u=n.type,c=n.isUpdate,l=n.configCreated,f=Me(e,t),n.copied=!0,d=Je(u)&&a,o&&(t||s||d||c)?[4,Pr(f,n,r)]:[3,4]);case 1:return p.sent(),!d||l?[3,3]:(n.configCreated=!0,[4,ze(f,a)]);case 2:p.sent(),p.label=3;case 3:return[3,6];case 4:return[4,Ue(i,f)];case 5:p.sent(),p.label=6;case 6:return o&&"STYLE"===u?[4,We(n,f)]:[3,8];case 7:p.sent(),p.label=8;case 8:return[2]}}))}))}function jr(e){return O(this,void 0,void 0,(function(){var r,n,t;return k(this,(function(i){if(e)for(r=Object.keys(e),n=0,t=r.length;n<t;n++)Cr(r[n],e);return[2]}))}))}function Sr(e){O(this,void 0,void 0,(function(){var r;return k(this,(function(n){switch(n.label){case 0:return"ENTRY"!==(Ae.current.allDependenciesMap[e]||{}).type?[3,2]:[4,gr()];case 1:return r=n.sent(),[3,4];case 2:return[4,yr(e)];case 3:r=n.sent(),n.label=4;case 4:return[4,Er(r)];case 5:return n.sent(),[4,jr(r)];case 6:return n.sent(),[2]}}))}))}function xr(e){return O(this,void 0,void 0,(function(){var r;return k(this,(function(n){return"function"==typeof e&&(r=U().sourceDir,e().forEach((function(e){var n=ve(e)?e:[e],t=n[0],i=n[1],o=void 0===i?"":i,s=b.default.resolve(r,t);Ue(s,Me(s,o))}))),[2]}))}))}function Ir(e){return O(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f;return k(this,(function(d){switch(d.label){case 0:if(r=U(),n=r.destinationDir,!(t=r.sourceRoot))return[3,8];o=(i=e||{}).isWatch,s=i.copy,p="正在复制文件到"+t,v=g.default().start(m.default.yellow(p)),u=(a={succeed:function(e){return v.succeed(m.default.green(e))},fail:function(e){return v.fail(m.default.red(e))}}).succeed,c=a.fail,d.label=1;case 1:return d.trys.push([1,7,,8]),[4,y.default.emptyDir(n)];case 2:return d.sent(),[4,xr(s)];case 3:return d.sent(),[4,gr()];case 4:return[4,Er(l=d.sent())];case 5:return d.sent(),[4,jr(l)];case 6:return d.sent(),o&&function(){O(this,void 0,void 0,(function(){var e,r;return k(this,(function(n){return e=U().sourceDir,(r=I.default.watch(e,{persistent:!0,ignoreInitial:!0})).on("change",Sr),r.on("add",Sr),[2]}))}))}(),u("复制成功"),[3,8];case 7:return f=d.sent(),c("Error copying files:"+f.message),[3,8];case 8:return[2]}var p,v}))}))}function Dr(e,r,n){return O(this,void 0,void 0,(function(){var t,i,o,s,a,u,c,l;return k(this,(function(f){switch(f.label){case 0:return f.trys.push([0,6,,7]),t=function(e){var r=new RegExp(N),n=e.match(r)||[],t=n[1],i=n[3],o=void 0===i?"":i,s="";return t===h.QUICKAPP&&(s=t,t=h.WEAPP),[t,o,s]}(e),i=t[0],o=t[1],s=t[2],process.env.PLATFORM_ENV=i,process.env.MODE_ENV=o,process.env.FIX_ENV=s,[4,Ir({isWatch:r,copy:n.copy})];case 1:return f.sent(),a=De,u=xe,c=ye,[4,ce(e)];case 2:return[4,c.apply(void 0,[f.sent()])];case 3:return[4,u.apply(void 0,[f.sent()])];case 4:return[4,a.apply(void 0,[f.sent()])];case 5:return f.sent(),[3,7];case 6:return l=f.sent(),g.default().fail(m.default.gray(l.message)),[3,7];case 7:return[2]}}))}))}!function(){O(this,void 0,void 0,(function(){var e,r,n,t,i,o,s,a,u,c,l,f;return k(this,(function(d){switch(d.label){case 0:return[4,Z()];case 1:if(e=d.sent(),r=te(e.branchMap),n=r.type,t=void 0===n?e.type:n,i=r.isDebug,o=r.robot,s=r.isWatch,a=e.sourceRoot,u=void 0===a?".taro-ci-src":a,process.env.DEBUG_ENV=i||1===o?"OPEN":"CLOSE",process.env.SOURCE_ROOT_PATH=u,!(c=t?Array.isArray(t)?t:[t]:null))return[2];l=0,f=c,d.label=2;case 2:return l<f.length?[4,Dr(f[l],s,e)]:[3,5];case 3:d.sent(),d.label=4;case 4:return l++,[3,2];case 5:return[2]}}))}))}();
|
|
6
|
+
"use strict";var e=require("chalk"),r=require("ora"),n=require("path"),t=require("fs-extra"),i=require("minimist"),o=require("dayjs"),s=require("execa"),a=require("semver"),u=require("dingtalk-robot-sender"),c=require("chokidar"),l=require("lodash"),f=require("child_process");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p,v=d(e),h=d(r),m=d(n),g=d(t),y=d(i),b=d(o),w=d(s),E=d(a),P=d(u),j=d(c),C=function(){return C=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},C.apply(this,arguments)};function S(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)r.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}function x(e,r,n,t){return new(n||(n=Promise))((function(i,o){function s(e){try{u(t.next(e))}catch(e){o(e)}}function a(e){try{u(t.throw(e))}catch(e){o(e)}}function u(e){var r;e.done?i(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}u((t=t.apply(e,r||[])).next())}))}function D(e,r){var n,t,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,t&&(i=2&o[0]?t.return:o[0]?t.throw||((i=t.return)&&i.call(t),0):t.next)&&!(i=i.call(t,o[1])).done)return i;switch(t=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,t=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=r.call(e,s)}catch(e){o=[6,e],t=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function I(){for(var e=0,r=0,n=arguments.length;r<n;r++)e+=arguments[r].length;var t=Array(e),i=0;for(r=0;r<n;r++)for(var o=arguments[r],s=0,a=o.length;s<a;s++,i++)t[i]=o[s];return t}!function(e){e.WEAPP="weapp",e.ALIPAY="alipay",e.SWAN="swan",e.QUICKAPP="quickapp",e.H5="h5",e.RN="rn",e.TT="tt"}(p||(p={}));var O,k=p.WEAPP+"|"+p.ALIPAY+"|"+p.QUICKAPP+"|"+p.SWAN+"|"+p.H5+"|"+p.RN+"|"+p.TT,A="("+k+")([.|-]{1})?(.+)?";function T(){}!function(e){e.WEAPP="project.config.json",e.ALIPAY="mini.project.json",e.SWAN="project.swan.json",e.QUICKAPP="project.quickapp.json",e.TT="project.config.json"}(O||(O={}));var R=function(){var e=process.env,r=e.SOURCE_ROOT_PATH,n=e.INIT_CWD,t=m.default.resolve(n,"src");return{rootPath:n,npmDir:n+"/node_modules",sourceDir:t,destinationDir:m.default.resolve(n,r),sourceRoot:r,appEntryPath:t+"/app.jsx",appEntryConfigPath:t+"/app.config.js"}};function M(){var e=R().npmDir;return require(e+"/@tarojs/helper")}function q(){var e=process.env.INIT_CWD,r=M(),n=require(e+"/"+r.PROJECT_CONFIG),t=("function"==typeof n?n(fe):n).alias;if(t){var i=R(),o=i.sourceDir,s=i.destinationDir;return Object.keys(t).forEach((function(e){var r=t[e];t[e]=m.default.resolve(o,r.replace(s,o))})),t}return t}var N=[".js",".jsx",".ts",".tsx"],F=[".scss",".less"],V=[".png",".jpg",".jpeg",".gif"];function U(e){return F.includes(e)}function _(e){return V.includes(e)}function L(e){return function(e){return N.includes(e)}(e)||U(e)||_(e)}I(N,F);var W=/^[0-9]{8}$/;function Y(e,r,n,t){void 0===t&&(t=!1);var i=new RegExp("^"+r);return(t?e.includes(r):i.test(e))?t?v.default.hex(n)(e):e.replace(i,v.default.hex(n)(r)):""}function B(e,r){var n=this;this.text="项目["+r+"]"+{build:"构建",upload:"上传"}[e],this.start=function(){n.spinner=h.default().start(v.default.yellow(n.text+"中... \n"))},this.fail=function(e){n.spinner||(n.spinner=h.default()),n.spinner.fail(v.default.red(n.text+"失败:"+e+" \n"))},this.succeed=function(){n.spinner||(n.spinner=h.default()),n.spinner.succeed(v.default.green(n.text+"成功! \n"))},this.stop=function(){n.spinner&&n.spinner.stop()}}function G(e){var r=e.toString().replace(/\n$/g,"");return r?(r=Y(r,"Tips:","#f5faa4",!0)||Y(r,"生成","#b278ff")||Y(r,"编译","#00ee76")||Y(r,"编译成功","#00ee76",!0)||Y(r,"监听文件","#6c6f7d",!0)||Y(r,"创建","#00aad1")||Y(r,"修改","#e3eb00")||Y(r,"Listening","#00aad1",!0)||Y(r,"Compiled","#00ee76",!0)||r,console.log(r),r):""}var H={1:{label:"体验",key:"Beta"},2:{label:"候选",key:"Rc"},3:{label:"正式",key:""}};function K(e,r,n,t,i){return new Promise((function(o){var s=e.split(/\s/g),a=s[0],u=s.slice(1),c=w.default(a,u,{env:C(C({},process.env),i)}),l=new B("build",t);r||n?(c.stdout.on("data",G),c.stderr.on("data",(function(e){if(G(e),r){var n=e.toString().trim();(n.includes("编译成功")||n.includes("successfully"))&&o({code:0})}}))):(c.stdout.on("data",(function(){})),c.stderr.on("data",(function(){})),l.start()),c.on("exit",(function(){r||(o({code:0}),l.succeed())})),c.on("error",(function(e){console.error(e),l.fail(e)}))}))}var $=null;function J(e){void 0===e&&(e="taro-ci");var r=$;if(!r){try{r=require(m.default.resolve("./"+e+".private.config.js"))}catch(n){r=require(m.default.resolve("./"+e+".config.js"))}var n="function"==typeof r?r(fe):r;return n.minSwanVersion||(n.minSwanVersion="3.310.35"),$=n,n}return r}var Q=null;function X(e){void 0===e&&(e="taro-ci");var r=Q;if(!r){var n=J(e);try{if(process.env.PLATFORM_ENV){var t=de(m.default.resolve("./"+e+".release"),".json"),i=t?require(t):null;if(i&&i.length>0){var o=i[0].split("-"),s=o.splice(0,1)[0],a=o.splice(-1,1)[0],u=o.join("-");W.test(a)||(a&&(o.push(a),u=o.join("-")),a=b.default().format("YYYYMMDD")),n=C(C({},n),{ts:a,version:s,description:u})}Q=n}}catch(e){}return n}return r}var z=null;function Z(e){if(z)return z;var r=y.default(process.argv.slice(2),{boolean:["watch","debug","upload","multi"]}),n=r.ci,t=void 0===n?"":n,i=r.dd,o=void 0===i?"":i,s=r.privacy,a=void 0===s?"":s,u=r.tt,c=void 0===u?"":u,l=r.watch,f=r.debug,d=r.upload,p=r.branch,v=r.multi,h=r.message,m=S(r,["ci","dd","privacy","tt","watch","debug","upload","branch","multi","message"]),g=t.split(","),b=g[0],w=g[1],E=g[2],P=c.split(","),j=P[0],x=P[1],D=o.split(","),I=D[0],O=D[1],A=a.split(","),T=A[0],R=A[1],M=(""+(h||"")).replace(/\n/g,""),q=function(e){if(!e)return{};var r=new RegExp("\\[(("+k+")((\\.[a-zA-Z,]+)+)?,?)\\]"),n=(e.match(r)||[])[1];return n?{type:n.split(",")}:{}}(M),N=q.type,F=q.robot,V=void 0===F?1:F,U=function(e,r){return r&&e?"function"==typeof r?r(e):r[e]:{}}(p,e),_=U.type,L=void 0===_?N:_,W=U.robot,Y=void 0===W?V:W;return z=C({ci:t?{toolId:b,privateKey:w,token:E}:void 0,dd:o?{accessToken:I,secret:O}:void 0,privacy:a?{accessToken:T,secret:R}:void 0,tt:c?{email:j,password:x}:void 0,watch:l,debug:f,isWatch:Boolean(l),isDebug:Boolean(f),isUpload:Boolean(d),isCi:Boolean(Y),isMulti:Boolean(v),branch:p,robot:Y,type:L,message:M},m)}function ee(){return process.env.PLATFORM_ENV}function re(){var e=ee();return m.default.resolve("./",O[e.toLocaleUpperCase()]||O.WEAPP)}function ne(){return x(this,void 0,void 0,(function(){var e,r;return D(this,(function(n){return e=re(),r=g.default.readFileSync(e),[2,JSON.parse(r.toString())]}))}))}var te={miniprogram:"miniProgram",plugin:"miniProgramPlugin",game:"miniGame",gamePlugin:"miniGamePlugin"};function ie(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s;return D(this,(function(a){if(r=Z(),n=r.isWatch,t=r.isDebug,"swan"!==process.env.PLATFORM_ENV&&(n||t))return[2,e];try{i=m.default.resolve("./ext.json"),(o=require(i)).extEnable=!1,"swan"===process.env.PLATFORM_ENV&&(s=X().info,o.extAppid=s[e].appId),g.default.writeFileSync(i,JSON.stringify(o,null,4))}catch(e){console.log("ext-extEnable",e)}return[2,e]}))}))}function oe(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d;return D(this,(function(v){switch(v.label){case 0:return r=X().info,n=Z(),t=n.isWatch,i=n.isDebug,o=n.isUpload,s=n.isMulti,a=r[e]||{},u=a.appId,c=a.template,l="dist/"+function(e,r,n,t){return e+"."+(r?"dev":"build")+(n?".debug":"")+(t?".multi":"")}(e,t,i,s),process.env.ROOT_PATH=l,process.env.PROJECT_ENV=s?"MULTI":"MINI",process.env.FIX_ENV===p.QUICKAPP||o?[2,e]:(f=re(),[4,ne()]);case 1:return d=v.sent(),"swan"===process.env.PLATFORM_ENV?d.smartProgramRoot=l:d.miniprogramRoot=l,d.projectArchitecture=s?"multiPlatform":"miniprogram",d.appid=u,g.default.writeFileSync(f,JSON.stringify(d,null,4)),1!==c&&"swan"!==process.env.PLATFORM_ENV?[3,3]:[4,ie(e)];case 2:v.sent(),v.label=3;case 3:return[2,e]}}))}))}function se(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.filter((function(e){return!!e})).join("-")}function ae(e){return e?e.trim():void 0}function ue(e){var r=X(),n=r.version,t=r.info,i=r.minSwanVersion,o=Z(r.branchMap),s=o.robot,a=o.message,u=t[e]||{},c=u.version,l=void 0===c?n:c,f=u.tag,d=void 0===f?"":f,p=u.label,v=void 0===p?"":p,h=u.robot,m=void 0===h?1:h,g=function(e){if(!e)return{};var r=e.replace(/\n/g,"").replace("Merge branch ",""),n=(r.match(/v:(.+)d:/)||[])[1],t=(r.match(/d:(.+)See merge request/)||[])[1]||r.replace(/See merge request .+/,"");return{version:ae(n),description:ae(t)}}(a),y=g.version,w=void 0===y?l:y,E=g.description,P=H[s+""],j=P.label,C=P.key,S=se(j,v);return{minSwanVersion:i,robot:s+2*(m-1),versionPure:w,version:se(C,d+w),description:"【"+S+"版-"+b.default().format("YYYYMMDDHHmmss")+"】:"+E,label:S,versionKey:C}}function ce(e){return"[object Object]"===Object.prototype.toString.call(e)}function le(e){return Array.isArray(e)}function fe(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.reduce((function(e,r){return Object.keys(r).reduce((function(e,n){var t=r[n];return ce(t)?e[n]=fe(e[n]?e[n]:{},t):le(t)?e[n]=t.map((function(r,t){if(ce(r)){var i=e[n]?e[n]:[];return fe(i[t]?i[t]:{},r)}return r})):e[n]=t,e}),e)}),e)}function de(e,r){var n=e.replace(/\/$/,""),t="";if(!r){for(var i=0,o=N.length;i<o;i++){if(t=de(n,N[i]))return t}return t}var s=process.env.PLATFORM_ENV,a=process.env.MODE_ENV,u=[s];a&&u.unshift(s+"."+a,a);var c=/\/(index)?$/;for(i=0,o=u.length;i<o;i++){var l=u[i];if(g.default.existsSync(t=n+"."+l+r))return t;if(g.default.existsSync(t=""+n.replace(c,"")+m.default.sep+"index."+l+r))return t;if(c.test(n)&&g.default.existsSync(t=""+n.replace(c,"."+l+"/index")+r))return t}return g.default.existsSync(t=""+n+r)||g.default.existsSync(t=""+n+m.default.sep+"index"+r)?t:""}function pe(e,r){Object.keys(e).forEach((function(n){r[n]?(e[r[n]]=e[n],"object"==typeof e[n]&&pe(e[r[n]],r),delete e[n]):!1===r[n]?delete e[n]:"object"==typeof e[n]&&pe(e[n],r)}))}var ve=function(e){return/^pages((\-\d{1,2})?)$/.test(e)};function he(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d,p,h,m;return D(this,(function(g){switch(g.label){case 0:return r=Z(),n=r.isWatch,t=r.isDebug,i=r.isUpload,o=X(),s=o.useTaroPluginBuildBy,a=o.info,u=o.version,c=(a[e]||{}).version,l=void 0===c?u:c,process.env.APP_VERSION=l,f=process.env,d=f.MODE_ENV,p=f.PLATFORM_ENV,h=f.FIX_ENV,i?[2,e]:(m="taro build --type "+("type"===s?e:"mode"===s&&d?d:p),n&&(m+=" --watch"),console.log(v.default.grey("编译平台:"),v.default.red(h||p),v.default.grey("版本模式:"),v.default.red(d||"默认")),[4,K(m,n,t,e)]);case 1:return g.sent(),[2,e]}}))}))}function me(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d,p,v,h,g;return D(this,(function(y){switch(y.label){case 0:return r=require("miniprogram-ci"),[4,X()];case 1:return n=y.sent().info,t=(void 0===n?{}:n)[e].appId,i=ue(e),o=i.version,s=i.description,a=i.robot,[4,ne()];case 2:if(u=y.sent(),c=u.setting,l=void 0===c?{}:c,f=u.compileType,d=void 0===f?"miniprogram":f,p=null,v=null,!t)return p=new Error("缺少appId,无法上传到微信平台"),[2,{item:e,error:p,errorCode:3}];h=new r.Project({appid:t,type:te[d]||"miniProgram",projectPath:m.default.resolve("./"),privateKeyPath:m.default.resolve("./","private."+t+".key"),ignores:["node_modules/**/*"]}),y.label=3;case 3:return y.trys.push([3,5,,6]),[4,r.upload({robot:a,project:h,version:o,desc:s,setting:l,onProgressUpdate:function(){}})];case 4:return v=y.sent(),[3,6];case 5:return g=y.sent(),p=g,[3,6];case 6:return[2,{item:e,error:p,result:v}]}}))}))}function ge(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d,p,v,h,g,y,b,w,P,j,S,x,I,O,k,A,R,M,q,N;return D(this,(function(D){switch(D.label){case 0:return r=require("minidev").minidev,n=Z().ci,[4,X()];case 1:if(t=D.sent(),i=t.info,o=void 0===i?{}:i,s=t.ci,a=o[e],u=a.appId,c=a.audit,l=C(C({},s),n),f=l.toolId,d=l.privateKey,p=ue(e),v=p.versionPure,h=p.description,g=p.versionKey,y=null,b=null,!u||!f)return y=new Error("缺少"+(u?"toolId":"appId")+",无法上传到支付宝平台"),[2,{item:e,error:y,errorCode:3}];D.label=2;case 2:return D.trys.push([2,17,,18]),[4,r.config.useRuntime({"alipay.authentication.privateKey":d,"alipay.authentication.toolId":f})];case 3:return D.sent(),P={appId:u,clientType:w="alipay",project:m.default.resolve("./"),versionDescription:h},[4,r.app.getUploadedVersionList({appId:u,clientType:w})];case 4:if(j=D.sent(),S=j.filter(function(e){return function(r){return!!e&&("INIT"===r.versionStatus&&(""+r.versionDescription).includes({"":"正式版-",Beta:"体验版-",Rc:"候选版-"}[e]))}}(g)),!(S.length>=1))return[3,9];x=S.slice(-1)[0].appVersion,I={appId:u,clientType:w,version:x},D.label=5;case 5:return D.trys.push([5,8,,9]),[4,r.app.cancelExperience(I)];case 6:return D.sent(),[4,r.app.deleteVersion(I)];case 7:return D.sent(),[3,9];case 8:return O=D.sent(),y=O,[3,9];case 9:return(k=require(m.default.resolve("./mini.project.json")))&&(P.project=m.default.join(P.project,k.miniprogramRoot)),v&&"-1"!==v?[4,r.app.getUploadedVersion({clientType:w,appId:u})]:[3,11];case 10:A=D.sent(),E.default.gt(v,A)||(v=E.default.inc(A,"patch")),P.version=v,D.label=11;case 11:return[4,r.upload(P,{onLog:T,onTaskCreated:T,onVersionCreated:T})];case 12:return b=D.sent(),R=!0,g||!c?[3,14]:(M=c.versionScreenshot)&&M.length>=2?[4,r.audit(C(C({},c),{appId:u,clientType:w,version:P.version,versionDescription:P.versionDescription}))]:[3,14];case 13:D.sent(),R=!1,D.label=14;case 14:return R?[4,r.app.setExperience({appId:u,clientType:w,version:P.version})]:[3,16];case 15:q=D.sent().qrCodeUrl,b.qrCodeUrl=q,D.label=16;case 16:return[3,18];case 17:return N=D.sent(),y=N,[3,18];case 18:return[2,{item:e,result:b,error:y}]}}))}))}function ye(e){return void 0===e&&(e=!0),"上传失败"+(e?",缺少swan-toolkit包":"")}function be(e,r){return void 0===r&&(r=!1),new Promise((function(n){var t=e.token,i=e.version,o=e.desc,s=("swan upload -p ./ --token "+t+" --min-swan-version "+e.minSwanVersion+" --release-version "+i+" -d "+o.replace(/\s/,"")).split(/\s/g),a=s[0],u=s.slice(1),c=w.default(a,u,{shell:!0}),l="";c.stderr.on("data",(function(e){l=""+e})),c.on("close",(function(t){var i;0===t?n({}):127===t?(i="swan-toolkit",new Promise((function(e){console.log(v.default.red("缺少指令:"),v.default.gray(i)),w.default("npm",["install",i,"-g"],{shell:!0}).on("close",(function(r){0===r?console.log(v.default.green("指令安装成功")):console.log(v.default.red("指令安装失败")),e(r)}))}))).then((function(){r?n({error:ye()}):be(e,!0).then(n).catch(n)})).catch((function(){n({error:ye()})})):n({error:l||ye(!1)})}))}))}function we(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l;return D(this,(function(f){switch(f.label){case 0:return r=Z().ci,[4,X()];case 1:if(n=f.sent().ci,t=ue(e),i=t.versionPure,o=t.description,s=t.minSwanVersion,a=C(C({},n),r).token,c=null,!(u=void 0===a?"":a))return c=new Error("缺少token,无法上传到百度平台"),[2,{item:e,error:c,errorCode:3}];try{g.default.writeFileSync(m.default.resolve("./ext.json"),"")}catch(e){}return[4,be({token:u,version:i,desc:o,minSwanVersion:s})];case 2:return l=f.sent(),c=l.error,[2,{item:e,result:l,error:c}]}}))}))}function Ee(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f;return D(this,(function(d){switch(d.label){case 0:return r=require("tt-ide-cli"),n=Z().tt,[4,X()];case 1:return t=d.sent().tt,i=C(C({},t),n),o=i.email,s=i.password,a=ue(e),u=a.versionPure,c=a.description,l=null,o&&s?[4,r.loginByEmail({email:o,password:s})]:(l=new Error("缺少"+(o?"password":"email")+",无法上传到抖音平台"),[2,{item:e,error:l,errorCode:3}]);case 2:return d.sent(),[4,r.upload({project:{path:m.default.resolve("./")},qrcode:{format:null,output:"",options:{small:!1}},version:u,changeLog:c,copyToClipboard:!1,needUploadSourcemap:!0}).catch((function(e){return l=e}))];case 3:return f=d.sent(),[4,r.logout()];case 4:return d.sent(),[2,{item:e,error:l,result:f}]}}))}))}function Pe(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d;return D(this,(function(v){switch(v.label){case 0:if(r=Z(),n=r.isCi,t=r.isWatch,i=r.isDebug,process.env.FIX_ENV)throw new Error("暂不支持快应用上传");if(t||!n)throw new Error(e+",未传入robot或者开发模式无法上传");if(i)throw new Error(e+",DEBUG模式无法上传");o=ee(),s={item:e},(a=new B("upload",e)).start(),v.label=1;case 1:switch(v.trys.push([1,12,,13]),o){case p.WEAPP:return[3,2];case p.ALIPAY:return[3,4];case p.SWAN:return[3,6];case p.TT:return[3,8]}return[3,10];case 2:return[4,me(e)];case 3:return s=v.sent(),[3,11];case 4:return[4,ge(e)];case 5:return s=v.sent(),[3,11];case 6:return[4,we(e)];case 7:return s=v.sent(),[3,11];case 8:return[4,Ee(e)];case 9:return s=v.sent(),[3,11];case 10:throw u=p.WEAPP+"、"+p.ALIPAY+"、"+p.SWAN+"、"+p.TT,c=new Error("不支持上传该平台,目前支持:"+u),a.fail(c),s={item:e,error:c,errorCode:1},c;case 11:return l=s.error,f=s.errorCode,l?(a.fail(l.message||l),f||(s.errorCode=2)):a.succeed(),[3,13];case 12:return d=v.sent(),a.fail(d.message||d),s={item:e,error:d},[3,13];case 13:return[2,s]}}))}))}function je(){this.text="",this.title="",this.items=[],this.setTitle=function(e){return this.title=e,this},this.add=function(e){return Array.isArray(e)?this.items.concat(e):this.items.push(e),this.text=this.items.join("\n"),this}}function Ce(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f,d,h,m,g,y,b,w,E,j,S,x,I,O,k,A,T,R,M;return D(this,(function(D){return r=e.result,n=e.error,t=e.item,i=e.errorCode,o=X(),s=Z(o.branchMap),a=s.dd,u=s.privacy,c=o.dd,l=void 0===c?a:c,f=o.privacy,d=void 0===f?u:f,h=o.name,m=o.git,g=void 0===m?"":m,y=ue(t),b=y.version,w=y.description,E=y.label,j=ee(),x=(S=r||{}).version,I=void 0===x?b:x,O=S.experienceQrCodeUrl,k=S.qrCodeUrl,A=void 0===k?O:k,T=("["+t+"]"+h).toUpperCase()+":"+E,R=(new je).setTitle(T).add("["+T+"]("+g+")\n"),n?(M=j===p.H5?"**上传结果:打包成功,自行部署发布**":'**上传结果:上传失败** \n<font color="red">('+n.message+")</font>",R.add(M)):R.add("**上传结果:上传成功**"),R.add("1. version:"+I).add("2. description:"+w),A&&R.add("\n"),d&&new P.default(C({baseUrl:"https://oapi.dingtalk.com/robot/send"},d)).markdown(R.title,R.text),l&&new P.default(C({baseUrl:"https://oapi.dingtalk.com/robot/send"},l)).markdown(R.title,R.text).then((function(){console.log(v.default.green("已发送钉钉通知!")),n&&j!==p.H5&&1!==i&&process.exit(1)})),[2]}))}))}var Se={current:{patchFilesMap:{},usingComponentsCopiedFilesMap:{},patchImportAbsoluteMap:{}}};function xe(e){return m.default.extname(e)}function De(e,r){return void 0===r&&(r=!1),m.default.basename(e,r?void 0:xe(e))}function Ie(e){var r=xe(e);return L(r)?[e.replace(r,""),r]:[e]}var Oe=function(e){var r=Ie(e),n=r[0],t=r[1],i=X(),o=i.modes,s=void 0===o?[]:o,a=i.modesExclude;if((void 0===a?[]:a).some((function(r){return e.includes(r)})))return e;var u="(\\.("+k+"))?",c=s.length>0?"(\\.("+s.sort((function(e){return e.includes(".")?-1:1})).join("|")+"))?":"",l=new RegExp(u+c,"g");return n.replace(l,"")+t};function ke(e,r){var n=R(),t=n.sourceDir,i=n.destinationDir;return e.replace(t,i+(r&&ve(r)?"/"+r:""))}function Ae(e){return function(e){try{return g.default.statSync(e).isDirectory()}catch(e){return!1}}(e)?e:m.default.dirname(e)}function Te(e,r){var n=Ae(e),t=m.default.relative(n,r);return t.startsWith(".")||(t="./"+t),t}function Re(e,r){return x(this,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,g.default.copy(e,r,{overwrite:!0})];case 1:case 2:return n.sent(),[3,3];case 3:return[2]}}))}))}function Me(e,r){var n=q(),t=M();return t.isAliasPath(e,n)?function(e){for(var r in n)if(e.startsWith(r+"/"))return m.default.join(n[r],"./"+e.slice(r.length));return""}(e):t.isNpmPkg(e)?require.resolve(m.default.resolve(R().npmDir,e)):m.default.resolve(r?Ae(r):R().sourceDir,e)}function qe(e){return!!e.walkAtRules}function Ne(e,r){var n=r||{},t=n.CSSImportDeclaration,i=n.CSSDeclarations,o=n.CSSRules;t&&e.walkAtRules((function(e){"import"===e.name&&t(e)})),i&&e.walkDecls(i),o&&e.walkRules(o)}function Fe(e){return{code:e.toString()}}function Ve(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,s,a;return D(this,(function(u){switch(u.label){case 0:return n=e.ast,t=e.source,i=R().npmDir,o=require(i+"/postcss-url"),s=require(i+"/postcss"),a=o({url:"copy",useHash:!1}),n.source.input.file=t,[4,s([a]).process(n,{from:t,to:r})];case 1:return u.sent(),[2]}}))}))}function Ue(){var e=R().npmDir;return require(e+"/@babel/types")}function _e(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=R().npmDir;return require(n+"/@babel/traverse").default.apply(void 0,e)}function Le(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=R().npmDir;return require(n+"/@babel/generator").default.apply(void 0,e)}function We(e,r){if(r){var n=function(e){var r=R().npmDir,n=require(r+"/postcss"),t=require(r+"/postcss-scss"),i=e.replace(/\/\/\s.*$/gm,"");return n.parse(i,{syntax:t})}(e);return n}var t=R().npmDir;return require(t+"/@babel/parser").parse(e,{sourceType:"module",plugins:["jsx","tsx","typescript","classProperties","dynamicImport","decorators-legacy"]})}function Ye(e){var r=Ue();if(Array.isArray(e))return r.arrayExpression(e.map((function(e){return Ye(e)})));if("object"==typeof e&&null!==e){var n=Object.keys(e).map((function(n){var t=r.isValidIdentifier(n)?r.identifier(n):r.stringLiteral(n);return r.objectProperty(t,Ye(e[n]))}));return r.objectExpression(n)}if("string"==typeof e)return r.stringLiteral(e);if("number"==typeof e)return r.numericLiteral(e);if("boolean"==typeof e)return r.booleanLiteral(e);throw new Error("Unsupported type: "+typeof e)}function Be(e,r){var n=Ue();return r&&n.isIdentifier(e.superClass,{name:"Component"})||n.isMemberExpression(e.superClass)&&"Taro"===e.superClass.object.name&&"Component"===e.superClass.property.name}function Ge(e){var r=Le(e).code;return new Function("return "+r)()}function He(e){return["ENTRY","PAGE"].includes(e)}function Ke(e){return He(e)||function(e){return"COMPONENT"===e}(e)}function $e(e,r){return x(this,void 0,void 0,(function(){var n,t;return D(this,(function(i){switch(i.label){case 0:return r?("alipay"===process.env.PLATFORM_ENV&&(n={navigationStyle:"transparentTitle"},"custom"===r.navigationStyle&&(r.navigationBarTitleTextAlipay=r.navigationBarTitleText,r.navigationBarTitleText="",r.navigationStyle="always",r.titlePenetrate="YES"),pe(r,n)),t=Le(Ue().valueToNode(r),{}),[4,g.default.writeFileSync(e.replace(De(e,!0),De(e)+".config.js"),"const config = "+t.code+";\nexport default config;")]):[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}function Je(e,r){var n,t=Ue(),i=R().sourceDir,o=function(){},s=function(e){var r="",n=Ue();return _e(e,{ExportDefaultDeclaration:function(e){var t=e.node.declaration;n.isIdentifier(t)?r=t.name:(n.isClassDeclaration(t)||n.isFunctionDeclaration(t))&&(r=t.id?t.id.name:null)}}),r}(e);return _e(e,{ClassDeclaration:function(e){var a=Be(e.node,!0);e.node.id.name===s&&a&&(e.node.body.body=e.node.body.body.filter((function(e){if(t.isClassProperty(e)&&"config"===e.key.name){if(t.isObjectExpression(e.value))n=Ge(e.value),o=function(r){e.value=Ye(C(C({},n),r))};else if(t.isCallExpression(e.value)&&t.isMemberExpression(e.value.callee)){var s=e.value.callee;if("preval"===s.object.name&&"require"===s.property.name){var a=e.value.arguments[0].value,u=m.default.resolve(i,a);try{c=u,void 0===(l=!0)&&(l=!1),l&&delete require.cache[require.resolve(c)],n=require(c)}catch(e){}}}return!r}var c,l;return!0})))},AssignmentExpression:function(e){t.isMemberExpression(e.node.left)&&e.node.left.object.name===s&&"config"===e.node.left.property.name&&(n=Ge(e.node.right),r&&e.remove(),o=function(r){e.node.right=Ye(C(C({},n),r))})}}),[n,o]}var Qe={react:["Fragment","Component","useEffect","useLayoutEffect","useState","useContext","useRef","useCallback","useMemo","useImperativeHandle","useReducer","createRef","createContext"],"react-redux":["Provider","connect","useSelector","useDispatch","useStore"]};function Xe(e,r,n){var t,i,o,s=Ke(r),a=!1;if(s){var u=Ue(),c=X().insertImport,l=(t=C(C({},c),Qe),i={},o=function(e,r){i[e]=i[e]||[],i[e].push(r)},Object.keys(t).forEach((function(e){var r=t[e];le(r)?r.forEach((function(r){var n=le(r)?r:[r],t=n[0],i=n.slice(1);o(t,I([e],i))})):o(r,[e])})),i),f={},d=new Set,p={};!function(e){var r=Ue(),n=!1,t=!1;_e(e,{ImportDeclaration:function(e){e.node.specifiers.forEach((function(e){r.isImportSpecifier(e)&&"Component"===e.imported.name&&(t=!0)}))}}),_e(e,{ClassDeclaration:function(e){var t=e.node.superClass,i=Be(e.node,!0);t&&i&&(n=!0,e.node.superClass=r.identifier("Component"))}}),n&&!t&&_e(e,{ImportDeclaration:function(e){"@tarojs/taro"===e.node.source.value&&e.node.specifiers.push(r.importSpecifier(r.identifier("Component"),r.identifier("Component")))}})}(e),_e(e,{ImportDeclaration:function(e){var t=[];e.node.specifiers.forEach((function(e){var i=e.imported?e.imported.name:e.local.name,o=l[i];if(o){var s=o.find((function(e){var n=e[1];return n&&n.split(/\||,/).includes(r)}))||o.find((function(e){return!e[1]}))||[],c=s[0],d=s[2],v=s[3];if(!c)return;if(n){var h=Se.current.patchImportAbsoluteMap[c];if(!h){var m=Ie(Me(c,v)),g=m[0],y=m[1];Se.current.patchImportAbsoluteMap[c]=h=de(g,y)}if(n===h)return}var b=(""+(d||"")).split("."),w=b[0],E=void 0===w?"":w,P=b[1],j="default"===(void 0===P?E:P);"default"===E&&(E=""),f[c]||(f[c]=[]),f[c].push(j?u.importDefaultSpecifier(u.identifier(E||i),u.identifier(i)):E?u.importSpecifier(u.identifier(E),u.identifier(i)):e),E&&(p[e.local.name]=E),t.push(e),a=!0}})),t.length&&t.length===e.node.specifiers.length?d.add(e):t.forEach((function(r){e.node.specifiers=e.node.specifiers.filter((function(e){return e!==r}))}))}}),d.forEach((function(e){return e.remove()})),_e(e,{Identifier:function(e){var r=e.node.name,n=p[r];n&&(e.scope.hasBinding(r)?e.scope.rename(r,n):e.node.name=n)}}),Object.keys(f).forEach((function(r){var n=e.program.body.find((function(e){return u.isImportDeclaration(e)&&e.source.value===r}));if(n)f[r].forEach((function(e){n.specifiers.some((function(r){return r.local.name===e.local.name}))||n.specifiers.push(e)}));else{var t=u.importDeclaration(f[r],u.stringLiteral(r));e.program.body.unshift(t)}}))}return{isUpdateImport:a}}function ze(e,r,n){return x(this,void 0,void 0,(function(){var t,i,o,s;return D(this,(function(a){return qe(e)?(t=function(e){var r=!1;return Ne(e,{CSSDeclarations:function(e){var n=e.value.replace(/(\$\w[\w-]*)\s*\/\s*(\d+(\.\d+)?)/g,(function(e,n,t){var i=(1/parseFloat(t)).toFixed(5);return r=!0,n+" * "+i}));e.value=n}}),{isUpdateCss:r}}(e).isUpdateCss,[2,[,t]]):(i=function(e,r){var n=Ke(r),t=!1;if(n){var i=Ue(),o=!1;_e(e,{ImportDeclaration:function(e){if("@tarojs/taro"===e.node.source.value){var r=e.node.specifiers;o=r.some((function(e){return i.isImportSpecifier(e)&&"Component"===e.imported.name}))}}}),_e(e,{ClassDeclaration:function(e){var r=e.node,n=r.superClass,s=r.body;if(n&&Be(r,o)){var a=s.body.find((function(e){return i.isClassMethod(e)&&"constructor"===e.kind}));if(a)a.body.body.some((function(e){return i.isExpressionStatement(e)&&i.isCallExpression(e.expression)&&i.isSuper(e.expression.callee)}))||(a.body.body.unshift(i.expressionStatement(i.callExpression(i.super(),[i.spreadElement(i.identifier("arguments"))]))),t=!0);else{var u=i.classMethod("constructor",i.identifier("constructor"),[],i.blockStatement([i.expressionStatement(i.callExpression(i.super(),[i.spreadElement(i.identifier("arguments"))]))]));s.body.unshift(u),t=!0}}}})}return{isUpdateConstructor:t}}(e,r).isUpdateConstructor,o=function(e,r){return{config:(He(r)?Je(e,!0):[])[0]}}(e,r).config,s=Xe(e,r,n).isUpdateImport,[2,[o,i||s]])}))}))}function Ze(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,s=this;return D(this,(function(a){return n=e.ast,t=e.create,i=e.code,o=function(){},function(e,r){qe(e)?Ne(e,r({types:{isPostcss:!0,checkIsCssAst:qe},generate:Fe})):_e(e,r({types:Ue(),generate:Le}))}(n,(function(e){var a=e.generate,u=e.types,c=function(e,n,t){return r({value:e,SetImportValue:function(e){"cssImport"===t?n.params="'"+e+"'":"import"===t?n.node.source.value=e:"require"===t&&(n.node.arguments[0].value=e)}})};o=function(e,r){return void 0===r&&(r=n),x(s,void 0,void 0,(function(){var n;return D(this,(function(t){try{n=a(r,{}),g.default.ensureDirSync(m.default.dirname(e)),g.default.writeFileSync(e,n.code)}catch(r){console.log("parseImport-update-error-filePath:",e),console.log("parseImport-update-error-info:",r)}return[2]}))}))};var l={ImportDeclaration:function(e){c(e.node.source.value,e,"import")},CallExpression:function(e){u.isIdentifier(e.node.callee,{name:"require"})&&c(e.node.arguments[0].value,e,"require")}};return u.isPostcss&&(l={CSSImportDeclaration:function(e){c(e.params.replace(/^('|")/,"").replace(/('|")$/,""),e,"cssImport")}}),C(C({},l),"function"==typeof t?t({ast:n,generate:a,types:u,code:i}):{})})),[2,o]}))}))}function er(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,s,a,u,c,l,f,d,p,v;return D(this,(function(h){switch(h.label){case 0:if(n=[],t=xe(e),i=null,a=U(t),u=!a&&_(t),c=r||(a?"STYLE":u?"IMAGE":"COMPONENT"),l=X().compileExclude,l&&l.some((function(r){return"function"==typeof r?r(e):e.includes(r)}))||u)return[3,6];h.label=1;case 1:return h.trys.push([1,5,,6]),[4,g.default.readFileSync(e)];case 2:return f=h.sent(),d=f.toString(),[4,ze(i=We(d,a),c,e)];case 3:return v=h.sent(),o=v[0],s=v[1],[4,Ze({ast:i,code:d},(function(e){var r=e.value;n.push(r)}))];case 4:return h.sent(),[3,6];case 5:return p=h.sent(),console.log("\n【runParse-error】",e,p.message,"\n"),[3,6];case 6:return[2,{source:e,dependencies:n,ast:i,type:c,config:o,isUpdate:s}]}}))}))}var rr=function(e,r){return ve(e)?e+"-"+r:e};function nr(){return x(this,void 0,void 0,(function(){var e,r,n,t,i;return D(this,(function(o){switch(o.label){case 0:return[4,er(R().appEntryPath,"ENTRY")];case 1:return e=o.sent(),r=e.config,n=r.subPackages,t=S(r,["subPackages"]),i=t,n&&(i.subPackages=function(e){return e.map((function(e,r){var n=e.root,t=e.pages;e.preloadRule,e.network;var i=S(e,["root","pages","preloadRule","network"]);return C(C({},i),{root:rr(n,r),pages:ve(n)?t.map((function(e){return m.default.join(n,"/",e)})):t})}))}(n),i.preloadRule=function(e){var r={};return e.forEach((function(e,n){var t=e.preloadRule,i=e.root,o=e.network,s=void 0===o?"all":o;t&&(r[t]=r[t]||{packages:[],network:s},r[t].packages.push(rr(i,n)))})),r}(n),e.config=i),[2,e]}}))}))}function tr(e){var r=R().sourceDir,n=m.default.resolve(r,e);return[de(n),n]}function ir(e,r){return void 0===r&&(r=""),x(this,void 0,void 0,(function(){var n,t,i,o;return D(this,(function(s){switch(s.label){case 0:n={},t=function(t,i){var o,s,a,u,c,l,f,d,p,v;return D(this,(function(i){switch(i.label){case 0:return o=e[t],r&&!ve(r)&&(o=m.default.join(r,"/",o)),s=tr(o),a=s[0],u=s[1],c="",l="",f="",a||(v=tr("./404"),a=v[0],l=v[1],a&&(d=xe(a),c=u+d,f=l+d,process.nextTick((function(){var e=Se.current.patchFilesMap,r=e[f]||[];r.push(c),e[f]=r})))),a?(c=c||Oe(a),[4,er(a,"PAGE")]):[3,2];case 1:p=i.sent(),n[c]=C({root:r},p),i.label=2;case 2:return[2]}}))},i=0,o=e.length,s.label=1;case 1:return i<o?[5,t(i,o)]:[3,4];case 2:s.sent(),s.label=3;case 3:return i++,[3,1];case 4:return[2,n]}}))}))}function or(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o=this;return D(this,(function(s){switch(s.label){case 0:r={},n=function(n,t){return D(this,(function(t){switch(t.label){case 0:return[4,x(o,void 0,void 0,(function(){var t,i,o;return D(this,(function(s){switch(s.label){case 0:return t=e[n],i=t.root,[4,ir(t.pages,i)];case 1:return o=s.sent(),r=C(C({},r),o),[2]}}))}))];case 1:return t.sent(),[2]}}))},t=0,i=e.length,s.label=1;case 1:return t<i?[5,n(t,i)]:[3,4];case 2:s.sent(),s.label=3;case 3:return t++,[3,1];case 4:return[2,r]}}))}))}function sr(e,r){return x(this,void 0,void 0,(function(){var n,t;return D(this,(function(i){return n=(r||{}).parents,(t=void 0===n?new Set:n).add(e),[2,t]}))}))}function ar(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,s=this;return D(this,(function(a){if((n=Object.values(C({},e))).length>0)for(t=function(e,t){x(s,void 0,void 0,(function(){var t,i;return D(this,(function(o){switch(o.label){case 0:return t=n[e],(i=r[t])?[4,ur("",i,r)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},i=0,o=n.length;i<o;i++)t(i);return[2]}))}))}function ur(e,r,n){return x(this,void 0,void 0,(function(){var t,i,o;return D(this,(function(s){switch(s.label){case 0:return t=r.root,i=r.parents,o=r.dependenciesResolveMap,t&&t!==e?(r.root="",r.copied=!1,i.forEach((function(e){var r=n[e];r&&(r.copied=!1)})),[4,ar(o,n)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}}))}))}function cr(e,r,n){return x(this,void 0,void 0,(function(){var t,i;return D(this,(function(o){return(t=(n[e]||{}).dependenciesResolveMap)&&(i=Object.values(r),Object.values(t).filter((function(e){return!i.includes(e)})).forEach((function(r){var t=n[r];if(t){var i=t.parents;i.delete(e);var o=function(e,r){for(var n="",t=Array.from(e),i=0,o=t.length;i<o;i++){var s=r[t[i]];if(s){var a=s.root;if(!a||n&&a!==n)return"";n=a}}return n}(i,n);o!==t.root&&(t.root=o,t.copied=!1)}}))),[2]}))}))}function lr(e,r){return void 0===r&&(r=e),x(this,void 0,void 0,(function(){var n,t,i,o,s;return D(this,(function(a){switch(a.label){case 0:n={},t=Object.keys(e),i=function(i,o){var s,a,u,c,l,f,d,p,v,h,m,g,y,b;return D(this,(function(o){switch(o.label){case 0:s=t[i],a=e[s],u=a.dependencies,c=void 0===u?[]:u,l=a.root,f=void 0===l?"":l,d=a.ast,p=a.config,v=!1,h=function(e,r){var n=q(),t=M();return e.filter((function(e){return t.isAliasPath(e,n)||!t.isNpmPkg(e)})).map((function(e){return[Me(e,r),e]}))}(c,s),m={},g=function(e,t){var i,o,a,u,c,l,d,p,g,y,b;return D(this,(function(t){switch(t.label){case 0:return i=h[e],o=i[0],a=i[1],u=Ie(o),c=u[0],l=u[1],(d=de(c,l))?(p=Oe(d),v||(v=d!==p),m[a]=p,g=r[p]||n[p],[4,sr(s,g)]):[3,6];case 1:return y=t.sent(),g?(g.parents=y,[4,ur(f,g,C(C({},r),n))]):[3,3];case 2:return t.sent(),[3,6];case 3:return[4,er(d)];case 4:return b=t.sent(),[4,Promise.resolve().then((function(){n[p]=C({root:f,source:d,parents:y},b)}))];case 5:t.sent(),t.label=6;case 6:return[2]}}))},y=0,b=h.length,o.label=1;case 1:return y<b?[5,g(y,b)]:[3,4];case 2:o.sent(),o.label=3;case 3:return y++,[3,1];case 4:return[4,cr(s,m,r)];case 5:return o.sent(),r[s]=C(C({},r[s]),{config:p,ast:d,dependencies:c,dependenciesResolveMap:m,dependenciesFilePathChange:v}),[2]}}))},o=0,s=t.length,a.label=1;case 1:return o<s?[5,i(o,s)]:[3,4];case 2:a.sent(),a.label=3;case 3:return o++,[3,1];case 4:return Object.keys(n).length>0?[4,lr(n,C(C({},r),n))]:[3,6];case 5:return[2,a.sent()];case 6:return[2,r]}}))}))}function fr(e,r){return x(this,void 0,void 0,(function(){var n,t;return D(this,(function(i){return(n=(e||{}).list)&&(t=R().sourceDir,n.forEach((function(e){var n=e.selectedIconPath;[e.iconPath,n].filter((function(e){return!!e})).forEach((function(e){var n=m.default.join(t,e);r[n]={source:n,type:"IMAGE"}}))}))),[2]}))}))}function dr(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o;return D(this,(function(s){switch(s.label){case 0:return r={},e&&e.custom?(n=R().sourceDir,(t=de(n+"/custom-tab-bar"))?(i=Oe(t),[4,er(t)]):[3,2]):[3,2];case 1:o=s.sent(),r[i]=C({source:t},o),s.label=2;case 2:return[2,r]}}))}))}function pr(){return x(this,void 0,void 0,(function(){var e,r,n,t,i,o,s,a,u,c;return D(this,(function(l){switch(l.label){case 0:return[4,nr()];case 1:return e=l.sent(),r=e.config,n=r.pages,t=r.subPackages,i=r.tabBar,[4,ir(n)];case 2:return o=l.sent(),s=null,t?[4,or(t)]:[3,4];case 3:s=l.sent(),l.label=4;case 4:return[4,dr(i)];case 5:return a=l.sent(),[4,lr(C(C(C(((c={})[e.source]=e,c),o),s),a))];case 6:return u=l.sent(),[4,fr(i,u)];case 7:return l.sent(),Se.current.allDependenciesMap=u,[2,u]}}))}))}function vr(e,r){var n=e.source,t=e.files,i=e.parseRes;return x(this,void 0,void 0,(function(){return D(this,(function(e){return[2,t.reduce((function(e,t){var o,s=r[t];return s.source=n,s.copied=!1,C(C({},e),((o={})[t]=C(C({},s),i),o))}),{})]}))}))}function hr(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,f,d,p,v,h,m,g;return D(this,(function(y){switch(y.label){case 0:return r=Se.current,n=r.patchFilesMap,t=r.allDependenciesMap,i=Oe(e),o=n[i],s=o&&o.length>0,a=t[i],u=!!a,s||u?(c=Ie(e),f=c[0],d=c[1],(p=de(f,d))!==e?[3,6]:(v=s?"PAGE":a.type,[4,er(p,v)])):[3,6];case 1:return h=y.sent(),s?[4,vr({source:p,files:o,parseRes:h},t)]:[3,3];case 2:return m=y.sent(),[3,4];case 3:a.source=p,a.copied=!1,h.config&&a.configCreated&&(a.configCreated=l.isEqual(h.config,a.config)),(g={})[i]=C(C({},a),h),m=g,y.label=4;case 4:return Object.keys(m).forEach((function(e){t[e]=C(C({},t[e]),m[e])})),[4,lr(m,t)];case 5:return[2,y.sent()];case 6:return[2]}}))}))}function mr(e,r,n,t){e&&e.forEach((function(e){var i=t[e],o=i.type,s=i.parents,a=i.root,u=void 0===a?"":a;Ke(o)&&(He(o)?Object.keys(r).forEach((function(t){var i=r[t],o=n[i];if(o||(o=n[i]={root:u,target:{}}),o.root!==u&&(o.root=""),""===o.root)o.target[t]=[];else{var s=o.target[t];s||(s=o.target[t]=[]),s.push(e)}})):mr(s,r,n,t))}))}function gr(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a;return D(this,(function(u){switch(u.label){case 0:if(!e)return[3,4];r={},Object.keys(e).forEach((function(n){var t=e[n],i=t||{},o=i.ast,s=i.type,a=i.parents,u=void 0===a?[n]:a,c=i.copied;if(Ke(s)&&!c){var l=Je(o,!1),f=l[0],d=l[1];He(s)&&(f=t.config,d=function(e){t.config=C(C({},t.config),e)});var p=(f||{}).usingComponents;if(p){var v=function(e,r){var n={},t={};return Object.keys(r).forEach((function(i){var o=r[i],s=m.default.resolve(Ae(e),o),a=Ae(s);g.default.pathExistsSync(a)?n[i]=s:t[i]=o})),[n,t]}(n,p),h=v[0],y=v[1];y&&(t.isUpdate=!0,d({usingComponents:y})),mr(u,h,r,e)}}})),n=Object.keys(r),t=R().appEntryPath,i=Se.current.usingComponentsCopiedFilesMap,o=function(o,s){var a,u,c,l,f,d;return D(this,(function(s){switch(s.label){case 0:return a=n[o],u=Ae(a),l=(c=r[a]).root,f=c.target,d=ke(u,l),i[d]?[3,2]:[4,Re(u,d)];case 1:s.sent(),i[d]=!0,s.label=2;case 2:return Object.keys(f).forEach((function(r){var n=f[r];(l?n:[t]).forEach((function(n){var t,i,o=e[n];o.isUpdate=!0,o.config=C(C({},o.config),{usingComponents:C(C({},null===(i=o.config)||void 0===i?void 0:i.usingComponents),(t={},t[r]=Te(n,a),t))})}))})),[2]}}))},s=0,a=n.length,u.label=1;case 1:return s<a?[5,o(s,a)]:[3,4];case 2:u.sent(),u.label=3;case 3:return s++,[3,1];case 4:return[2]}}))}))}function yr(e,r,n){return x(this,void 0,void 0,(function(){var t,i,o;return D(this,(function(s){switch(s.label){case 0:return t=r.ast,i=r.root,o=r.dependenciesFilePathChange,[4,Ze({ast:t},(function(t){var s=t.value,a=t.SetImportValue,u=r.dependenciesResolveMap[s];if(u){var c=(n[u]||{}).root;if(o||c||i)a(Te(ke(e,i),ke(u,c)))}}))];case 1:return[4,s.sent()(e)];case 2:return s.sent(),[2]}}))}))}function br(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,s,a,u,c,l,f,d;return D(this,(function(p){switch(p.label){case 0:return(n=r[e]).copied?[3,8]:(t=n.root,i=n.source,o=n.ast,s=n.dependenciesFilePathChange,a=n.config,u=n.type,c=n.isUpdate,l=n.configCreated,f=ke(e,t),n.copied=!0,d=He(u)&&a,o&&(t||s||d||c)?[4,yr(f,n,r)]:[3,4]);case 1:return p.sent(),!d||l?[3,3]:(n.configCreated=!0,[4,$e(f,a)]);case 2:p.sent(),p.label=3;case 3:return[3,6];case 4:return[4,Re(i,f)];case 5:p.sent(),p.label=6;case 6:return o&&"STYLE"===u?[4,Ve(n,f)]:[3,8];case 7:p.sent(),p.label=8;case 8:return[2]}}))}))}function wr(e){return x(this,void 0,void 0,(function(){var r,n,t;return D(this,(function(i){if(e)for(r=Object.keys(e),n=0,t=r.length;n<t;n++)br(r[n],e);return[2]}))}))}function Er(e){x(this,void 0,void 0,(function(){var r;return D(this,(function(n){switch(n.label){case 0:return"ENTRY"!==(Se.current.allDependenciesMap[e]||{}).type?[3,2]:[4,pr()];case 1:return r=n.sent(),[3,4];case 2:return[4,hr(e)];case 3:r=n.sent(),n.label=4;case 4:return[4,gr(r)];case 5:return n.sent(),[4,wr(r)];case 6:return n.sent(),[2]}}))}))}function Pr(e){return x(this,void 0,void 0,(function(){var r;return D(this,(function(n){return"function"==typeof e&&(r=R().sourceDir,e().forEach((function(e){var n=le(e)?e:[e],t=n[0],i=n[1],o=void 0===i?"":i,s=m.default.resolve(r,t);Re(s,ke(s,o))}))),[2]}))}))}function jr(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u,c,l,f;return D(this,(function(d){switch(d.label){case 0:if(r=R(),n=r.destinationDir,!(t=r.sourceRoot))return[3,8];o=(i=e||{}).isWatch,s=i.copy,p="正在复制文件到"+t,m=h.default().start(v.default.yellow(p)),u=(a={succeed:function(e){return m.succeed(v.default.green(e))},fail:function(e){return m.fail(v.default.red(e))}}).succeed,c=a.fail,d.label=1;case 1:return d.trys.push([1,7,,8]),[4,g.default.emptyDir(n)];case 2:return d.sent(),[4,Pr(s)];case 3:return d.sent(),[4,pr()];case 4:return[4,gr(l=d.sent())];case 5:return d.sent(),[4,wr(l)];case 6:return d.sent(),o&&function(){x(this,void 0,void 0,(function(){var e,r;return D(this,(function(n){return e=R().sourceDir,(r=j.default.watch(e,{persistent:!0,ignoreInitial:!0})).on("change",Er),r.on("add",Er),[2]}))}))}(),u("复制成功"),[3,8];case 7:return f=d.sent(),c("Error copying files:"+f.message),[3,8];case 8:return[2]}var p,m}))}))}function Cr(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,u;return D(this,(function(c){switch(c.label){case 0:r=[],n=Object.keys(e),t=0,i=n.length,c.label=1;case 1:return t<i?(o=n[t],s=e[o],[4,(l=o,new Promise((function(e){var r=R().npmDir;try{require.resolve(m.default.join(r,l)),console.log('Dependency "'+l+'" is already installed.'),e(!0)}catch(r){console.log('Dependency "'+l+'" is not installed.'),e(!1)}})))]):[3,4];case 2:c.sent()||r.push(o+(s?"@"+s.replace("^",""):"")),c.label=3;case 3:return t++,[3,1];case 4:if(r.length>0){a=r.join(" ");try{u="npm install "+a+" --no-save",f.execSync(u,{stdio:"inherit"}),console.log('Dependency "'+a+'" installed successfully.')}catch(e){console.error('Failed to install dependency "'+a+'":',e)}}return[2]}var l}))}))}function Sr(){return x(this,void 0,void 0,(function(){var e,r,n,t,i,o,s,a,u,c;return D(this,(function(l){switch(l.label){case 0:return e=process.env,r=e.PLATFORM_ENV,n=e.MODE_ENV,t=X(),i=t.dynamicDependencies,o=void 0===i?{}:i,s=t.taroVersion,a=void 0===s?"2.2.22":s,u=function(){var e=R().rootPath,r=m.default.join(e,"package.json");if(g.default.existsSync(r)){var n=JSON.parse(g.default.readFileSync(r,"utf-8"));return n.dependencies["@tarojs/taro"]||n.devDependencies["@tarojs/taro"]}return""}()||a,c=C(C(C({},{weapp:{"miniprogram-ci":"1.0.45"},alipay:{minidev:"2.2.1"},swan:{"swan-toolkit":"3.7.5"},tt:{"tt-ide-cli":"0.1.15"},quickapp:{"@tarojs/components-qa":u}}[r]),o[r]),o[r+"."+n]),E.default.gt(u,"3.0.0")||(c["@tarojs/taro-"+r]=u),[4,Cr(c)];case 1:return l.sent(),[2]}}))}))}function xr(e,r,n){return x(this,void 0,void 0,(function(){var t,i,o,s,a,u,c,l;return D(this,(function(f){switch(f.label){case 0:return f.trys.push([0,7,,8]),t=function(e,r){void 0===r&&(r="");var n=new RegExp(A),t=e.match(n)||[],i=t[1],o=t[3],s=void 0===o?r:o,a="";return i===p.QUICKAPP&&(a=i,i=p.WEAPP),[i,s,a]}(e,n.defaultMode),i=t[0],o=t[1],s=t[2],process.env.PLATFORM_ENV=i,process.env.MODE_ENV=o,process.env.FIX_ENV=s,[4,Sr()];case 1:return f.sent(),[4,jr({isWatch:r,copy:n.copy})];case 2:return f.sent(),a=Ce,u=Pe,c=he,[4,oe(e)];case 3:return[4,c.apply(void 0,[f.sent()])];case 4:return[4,u.apply(void 0,[f.sent()])];case 5:return[4,a.apply(void 0,[f.sent()])];case 6:return f.sent(),[3,8];case 7:return l=f.sent(),h.default().fail(v.default.gray(l.message)),[3,8];case 8:return[2]}}))}))}!function(){x(this,void 0,void 0,(function(){var e,r,n,t,i,o,s,a,u,c,l,f;return D(this,(function(d){switch(d.label){case 0:return[4,J()];case 1:if(e=d.sent(),r=Z(e.branchMap),n=r.type,t=void 0===n?e.type:n,i=r.isDebug,o=r.robot,s=r.isWatch,a=e.sourceRoot,u=void 0===a?".taro-ci-src":a,process.env.DEBUG_ENV=i||1===o?"OPEN":"CLOSE",process.env.SOURCE_ROOT_PATH=u,!(c=t?Array.isArray(t)?t:[t]:null))return[2];l=0,f=c,d.label=2;case 2:return l<f.length?[4,xr(f[l],s,e)]:[3,5];case 3:d.sent(),d.label=4;case 4:return l++,[3,2];case 5:return[2]}}))}))}();
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
|
|
3
3
|
*/
|
|
4
4
|
import minimist from "minimist";
|
|
5
|
+
import { IUploadOptions } from 'minidev';
|
|
6
|
+
import { ProjectType } from "miniprogram-ci/dist/@types/types";
|
|
7
|
+
export { IUploadOptions, ProjectType };
|
|
5
8
|
export declare type CommandPromiseRes = {
|
|
6
9
|
code: number;
|
|
7
10
|
err?: string;
|
|
@@ -75,6 +78,7 @@ export declare type ConfigOptions = {
|
|
|
75
78
|
version?: string;
|
|
76
79
|
description?: string;
|
|
77
80
|
type: CiType;
|
|
81
|
+
defaultMode?: string;
|
|
78
82
|
info: {
|
|
79
83
|
[propertys: string]: InfoOptions;
|
|
80
84
|
};
|
|
@@ -88,6 +92,8 @@ export declare type ConfigOptions = {
|
|
|
88
92
|
tt?: Tt;
|
|
89
93
|
privacy?: Dd;
|
|
90
94
|
branchMap?: BranchMap;
|
|
95
|
+
dynamicDependencies?: Record<string, Record<string, string>>;
|
|
96
|
+
taroVersion?: string;
|
|
91
97
|
sourceRoot?: string;
|
|
92
98
|
modes?: string[];
|
|
93
99
|
modesExclude?: string[];
|
|
@@ -150,4 +156,3 @@ export declare enum TaroConfig {
|
|
|
150
156
|
"TT" = "project.config.json"
|
|
151
157
|
}
|
|
152
158
|
export declare type Platform = "weapp" | "alipay" | "swan" | "quickapp" | "h5" | "rn" | "tt";
|
|
153
|
-
export {};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
|
|
3
3
|
*/
|
|
4
|
-
import { CommandPromiseRes, EnvCustom, ConfigOptions, PkgMap, ConfigInfoResponse, ArgsResponse, ProjectConfig, Platform, ProgressType, BranchMap } from "types";
|
|
5
|
-
import { ProjectType } from "miniprogram-ci/dist/@types/types";
|
|
4
|
+
import { CommandPromiseRes, EnvCustom, ConfigOptions, PkgMap, ConfigInfoResponse, ArgsResponse, ProjectConfig, Platform, ProgressType, BranchMap, ProjectType } from "types";
|
|
6
5
|
export declare function noop(): void;
|
|
7
6
|
export declare const getDir: () => {
|
|
7
|
+
rootPath: string;
|
|
8
8
|
npmDir: string;
|
|
9
9
|
sourceDir: string;
|
|
10
10
|
destinationDir: string;
|
|
@@ -93,7 +93,7 @@ export declare function getAndFormatConfigInfo(item: string): ConfigInfoResponse
|
|
|
93
93
|
* @param item
|
|
94
94
|
* @returns
|
|
95
95
|
*/
|
|
96
|
-
export declare function formateCommand(item: string): [Platform, string, string];
|
|
96
|
+
export declare function formateCommand(item: string, defaultMode?: string): [Platform, string, string];
|
|
97
97
|
export declare function isObject(obj: any): boolean;
|
|
98
98
|
export declare function isArray(arr: any): boolean;
|
|
99
99
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taro-ci",
|
|
3
|
-
"version": "2.0.2-alpha.
|
|
3
|
+
"version": "2.0.2-alpha.3",
|
|
4
4
|
"main": "dist/taro-ci.js",
|
|
5
5
|
"types": "dist/types/index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -50,11 +50,8 @@
|
|
|
50
50
|
"fs-extra": "^5.0.0",
|
|
51
51
|
"lodash": "^4.17.15",
|
|
52
52
|
"minimist": "^1.2.5",
|
|
53
|
-
"miniprogram-ci": "^1.0.45",
|
|
54
|
-
"minidev": "^2.2.1",
|
|
55
53
|
"ora": "^5.4.0",
|
|
56
|
-
"semver": "^7.3.5"
|
|
57
|
-
"tt-ide-cli": "^0.1.15"
|
|
54
|
+
"semver": "^7.3.5"
|
|
58
55
|
},
|
|
59
56
|
"devDependencies": {
|
|
60
57
|
"@rollup/plugin-alias": "^3.1.1",
|
|
@@ -76,6 +73,8 @@
|
|
|
76
73
|
"execa": "^4.1.0",
|
|
77
74
|
"husky": "^4.2.5",
|
|
78
75
|
"lint-staged": "^10.5.1",
|
|
76
|
+
"minidev": "^2.2.1",
|
|
77
|
+
"miniprogram-ci": "^1.0.45",
|
|
79
78
|
"prettier": "^2.2.0",
|
|
80
79
|
"rimraf": "^3.0.2",
|
|
81
80
|
"rollup": "^2.19.0",
|
|
@@ -83,6 +82,7 @@
|
|
|
83
82
|
"rollup-plugin-sourcemaps": "^0.6.2",
|
|
84
83
|
"rollup-plugin-terser": "^7.0.2",
|
|
85
84
|
"rollup-plugin-typescript2": "^0.27.1",
|
|
85
|
+
"tt-ide-cli": "^0.1.15",
|
|
86
86
|
"typescript": "^3.9.6"
|
|
87
87
|
}
|
|
88
88
|
}
|