taro-ci 2.0.2-alpha.7 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/files/parse.d.ts +7 -0
- package/dist/taro-ci.js +2 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/files/index.d.ts +1 -0
- package/dist/utils/files/parse.d.ts +1 -0
- package/dist/utils/files/patch/config.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -12,6 +12,13 @@ export declare function collectTabBarImage(tabBar: ConfigType['tabBar'], allDepe
|
|
|
12
12
|
* @description 解析自定义tabBar
|
|
13
13
|
*/
|
|
14
14
|
export declare function parseCustomTabBar(tabBar: ConfigType['tabBar']): Promise<{}>;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @description 是否为入口关联文件
|
|
18
|
+
* @param filePath
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkIsEntryRelatedFile(filePath: string): boolean;
|
|
15
22
|
/**
|
|
16
23
|
*
|
|
17
24
|
* @description 收集依赖关系
|
package/dist/taro-ci.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* taro-ci v2.0.2-alpha.
|
|
2
|
+
* taro-ci v2.0.2-alpha.10
|
|
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"),a=require("execa"),s=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(a),E=d(s),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 a(e){try{u(t.next(e))}catch(e){o(e)}}function s(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(a,s)}u((t=t.apply(e,r||[])).next())}))}function D(e,r){var n,t,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,t=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=r.call(e,a)}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,s])}}}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],a=0,s=o.length;a<s;a++,i++)t[i]=o[a];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 k,A=p.WEAPP+"|"+p.ALIPAY+"|"+p.QUICKAPP+"|"+p.SWAN+"|"+p.H5+"|"+p.RN+"|"+p.TT,O="("+A+")([.|-]{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"}(k||(k={}));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,a=i.destinationDir;return Object.keys(t).forEach((function(e){var r=t[e];t[e]=m.default.resolve(o,r.replace(a,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 a=e.split(/\s/g),s=a[0],u=a.slice(1),c=w.default(s,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("-"),a=o.splice(0,1)[0],s=o.splice(-1,1)[0],u=o.join("-");W.test(s)||(s&&(o.push(s),u=o.join("-")),s=b.default().format("YYYYMMDD")),n=C(C({},n),{ts:s,version:a,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,a=r.privacy,s=void 0===a?"":a,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],k=D[1],O=s.split(","),T=O[0],R=O[1],M=(""+(h||"")).replace(/\n/g,""),q=function(e){if(!e)return{};var r=new RegExp("\\[(("+A+")((\\.[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:k}:void 0,privacy:s?{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("./",k[e.toLocaleUpperCase()]||k.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,a;return D(this,(function(s){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&&(a=X().info,o.extAppid=a[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,a,s,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,a=n.isMulti,s=r[e]||{},u=s.appId,c=s.template,l="dist/"+function(e,r,n,t){return e+"."+(r?"dev":"build")+(n?".debug":"")+(t?".multi":"")}(e,t,i,a),process.env.ROOT_PATH=l,process.env.PROJECT_ENV=a?"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=a?"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 ae(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.filter((function(e){return!!e})).join("-")}function se(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),a=o.robot,s=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:se(n),description:se(t)}}(s),y=g.version,w=void 0===y?l:y,E=g.description,P=H[a+""],j=P.label,C=P.key,S=ae(j,v);return{minSwanVersion:i,robot:a+2*(m-1),versionPure:w,version:ae(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 a=process.env.PLATFORM_ENV,s=process.env.MODE_ENV,u=[a];s&&u.unshift(a+"."+s,s);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,a,s,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(),a=o.useTaroPluginBuildBy,s=o.info,u=o.version,c=(s[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"===a?e:"mode"===a&&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,a,s,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,a=i.description,s=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:s,project:h,version:o,desc:a,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,a,s,u,c,l,f,d,p,v,h,g,y,b,w,P,j,S,x,I,k,A,O,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,a=t.ci,s=o[e],u=s.appId,c=s.audit,l=C(C({},a),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 k=D.sent(),y=k,[3,9];case 9:return(A=require(m.default.resolve("./mini.project.json")))&&(P.project=m.default.join(P.project,A.miniprogramRoot)),v&&"-1"!==v?[4,r.app.getUploadedVersion({clientType:w,appId:u})]:[3,11];case 10:O=D.sent(),E.default.gt(v,O)||(v=E.default.inc(O,"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,a=("swan upload -p ./ --token "+t+" --min-swan-version "+e.minSwanVersion+" --release-version "+i+" -d "+o.replace(/\s/,"")).split(/\s/g),s=a[0],u=a.slice(1),c=w.default(s,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,a,s,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,a=t.minSwanVersion,s=C(C({},n),r).token,c=null,!(u=void 0===s?"":s))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:a})];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,a,s,u,c,l,f,d,p,v;return D(this,(function(h){switch(h.label){case 0:return r=require("tt-ide-cli"),n=Z().tt,[4,X()];case 1:return t=h.sent(),i=t.tt,o=t.info,a=(void 0===o?{}:o)[e].appId,s=C(C({},i),n),u=s.email,c=s.password,l=ue(e),f=l.versionPure,d=l.description,p=null,u?c?[4,r.loginByEmail({email:u,password:c})]:[3,3]:(p=new Error("缺少"+(u?"password":"email")+",无法上传到抖音平台"),[2,{item:e,error:p,errorCode:3}]);case 2:return h.sent(),[3,4];case 3:r.setAppConfig({appid:a,config:{token:u}}),h.label=4;case 4:return[4,r.upload({project:{path:m.default.resolve("./")},qrcode:{format:null,output:"",options:{small:!1}},version:f,changeLog:d,copyToClipboard:!1,needUploadSourcemap:!0}).catch((function(e){return p=e}))];case 5:return v=h.sent(),[4,r.logout()];case 6:return h.sent(),[2,{item:e,error:p,result:v}]}}))}))}function Pe(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,a,s,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(),a={item:e},(s=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 a=v.sent(),[3,11];case 4:return[4,ge(e)];case 5:return a=v.sent(),[3,11];case 6:return[4,we(e)];case 7:return a=v.sent(),[3,11];case 8:return[4,Ee(e)];case 9:return a=v.sent(),[3,11];case 10:throw u=p.WEAPP+"、"+p.ALIPAY+"、"+p.SWAN+"、"+p.TT,c=new Error("不支持上传该平台,目前支持:"+u),s.fail(c),a={item:e,error:c,errorCode:1},c;case 11:return l=a.error,f=a.errorCode,l?(s.fail(l.message||l),f||(a.errorCode=2)):s.succeed(),[3,13];case 12:return d=v.sent(),s.fail(d.message||d),a={item:e,error:d},[3,13];case 13:return[2,a]}}))}))}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,a,s,u,c,l,f,d,h,m,g,y,b,w,E,j,S,x,I,k,A,O,T,R,M;return D(this,(function(D){return r=e.result,n=e.error,t=e.item,i=e.errorCode,o=X(),a=Z(o.branchMap),s=a.dd,u=a.privacy,c=o.dd,l=void 0===c?s: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,k=S.experienceQrCodeUrl,A=S.qrCodeUrl,O=void 0===A?k:A,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),O&&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 ke=function(e){var r=Ie(e),n=r[0],t=r[1],i=X(),o=i.modes,a=void 0===o?[]:o,s=i.modesExclude;if((void 0===s?[]:s).some((function(r){return e.includes(r)})))return e;var u="(\\.("+A+"))?",c=a.length>0?"(\\.("+a.sort((function(e){return e.includes(".")?-1:1})).join("|")+"))?":"",l=new RegExp(u+c,"g");return n.replace(l,"")+t};function Ae(e,r){var n=R(),t=n.sourceDir,i=n.destinationDir;return e.replace(t,i+(r&&ve(r)?"/"+r:""))}function Oe(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=Oe(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?Oe(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,a,s;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"),a=require(i+"/postcss"),s=o({url:"copy",useHash:!1}),n.source.input.file=t,[4,a([s]).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(){},a=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 s=Be(e.node,!0);e.node.id.name===a&&s&&(e.node.body.body=e.node.body.body.filter((function(e){if(t.isClassProperty(e)&&"config"===e.key.name){if(t.isCallExpression(e.value)&&t.isMemberExpression(e.value.callee)){var a=e.value.callee;if("preval"===a.object.name&&"require"===a.property.name){var s=e.value.arguments[0].value,u=m.default.resolve(i,s);try{c=u,void 0===(l=!0)&&(l=!1),l&&delete require.cache[require.resolve(c)],n=require(c)}catch(e){}}}else try{n=Ge(e.value),o=function(r){e.value=Ye(C(C({},n),r))}}catch(e){}return!r}var c,l;return!0})))},AssignmentExpression:function(e){t.isMemberExpression(e.node.left)&&e.node.left.object.name===a&&"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,a=Ke(r),s=!1;if(a){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 a=o.find((function(e){var n=e[1];return n&&n.split(/\||,/).includes(r)}))||o.find((function(e){return!e[1]}))||[],c=a[0],d=a[2],v=a[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),s=!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:s}}function ze(e,r,n){return x(this,void 0,void 0,(function(){var t,i,o,a;return D(this,(function(s){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,a=r.body;if(n&&Be(r,o)){var s=a.body.find((function(e){return i.isClassMethod(e)&&"constructor"===e.kind}));if(s)s.body.body.some((function(e){return i.isExpressionStatement(e)&&i.isCallExpression(e.expression)&&i.isSuper(e.expression.callee)}))||(s.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"))]))]));a.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,a=Xe(e,r,n).isUpdateImport,[2,[o,i||a]])}))}))}function Ze(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,a=this;return D(this,(function(s){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 s=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(a,void 0,void 0,(function(){var n;return D(this,(function(t){try{n=s(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:s,types:u,code:i}):{})})),[2,o]}))}))}function er(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,a,s,u,c,l,f,d,p,v;return D(this,(function(h){switch(h.label){case 0:if(n=[],t=xe(e),i=null,s=U(t),u=!s&&_(t),c=r||(s?"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,s),c,e)];case 3:return v=h.sent(),o=v[0],a=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:a}]}}))}))}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})})).filter((function(e){var r=e.root,n=e.pages;return r&&n&&n.length>0}))}(n),i.preloadRule=function(e){var r={};return e.forEach((function(e,n){var t=e.preloadRule,i=e.root,o=e.network,a=void 0===o?"all":o,s=e.pages;t&&0!==(void 0===s?[]:s).length&&(r[t]=r[t]||{packages:[],network:a},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(a){switch(a.label){case 0:n={},t=function(t,i){var o,a,s,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)),a=tr(o),s=a[0],u=a[1],c="",l="",f="",s||(v=tr("./404"),s=v[0],l=v[1],s&&(d=xe(s),c=u+d,f=l+d,process.nextTick((function(){var e=Se.current.patchFilesMap,r=e[f]||[];r.push(c),e[f]=r})))),s?(c=c||ke(s),[4,er(s,"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,a.label=1;case 1:return i<o?[5,t(i,o)]:[3,4];case 2:a.sent(),a.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(a){switch(a.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(a){switch(a.label){case 0:return t=e[n],i=t.root,[4,ir(t.pages,i)];case 1:return o=a.sent(),r=C(C({},r),o),[2]}}))}))];case 1:return t.sent(),[2]}}))},t=0,i=e.length,a.label=1;case 1:return t<i?[5,n(t,i)]:[3,4];case 2:a.sent(),a.label=3;case 3:return t++,[3,1];case 4:return[2,r]}}))}))}function ar(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 sr(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,a=this;return D(this,(function(s){if((n=Object.values(C({},e))).length>0)for(t=function(e,t){x(a,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(a){switch(a.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,sr(o,n)]):[3,2];case 1:a.sent(),a.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 a=r[t[i]];if(a){var s=a.root;if(!s||n&&s!==n)return"";n=s}}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,a;return D(this,(function(s){switch(s.label){case 0:n={},t=Object.keys(e),i=function(i,o){var a,s,u,c,l,f,d,p,v,h,m,g,y,b;return D(this,(function(o){switch(o.label){case 0:a=t[i],s=e[a],u=s.dependencies,c=void 0===u?[]:u,l=s.root,f=void 0===l?"":l,d=s.ast,p=s.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,a),m={},g=function(e,t){var i,o,s,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],s=i[1],u=Ie(o),c=u[0],l=u[1],(d=de(c,l))?(p=ke(d),v||(v=d!==p),m[s]=p,g=r[p]||n[p],[4,ar(a,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(a,m,r)];case 5:return o.sent(),r[a]=C(C({},r[a]),{config:p,ast:d,dependencies:c,dependenciesResolveMap:m,dependenciesFilePathChange:v}),[2]}}))},o=0,a=t.length,s.label=1;case 1:return o<a?[5,i(o,a)]:[3,4];case 2:s.sent(),s.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,s.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(a){switch(a.label){case 0:return r={},e&&e.custom?(n=R().sourceDir,(t=de(n+"/custom-tab-bar"))?(i=ke(t),[4,er(t)]):[3,2]):[3,2];case 1:o=a.sent(),r[i]=C({source:t},o),a.label=2;case 2:return[2,r]}}))}))}function pr(){return x(this,void 0,void 0,(function(){var e,r,n,t,i,o,a,s,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(),a=null,t?[4,or(t)]:[3,4];case 3:a=l.sent(),l.label=4;case 4:return[4,dr(i)];case 5:return s=l.sent(),[4,lr(C(C(C(((c={})[e.source]=e,c),o),a),s))];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,a=r[t];return a.source=n,a.copied=!1,C(C({},e),((o={})[t]=C(C({},a),i),o))}),{})]}))}))}function hr(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,a,s,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=ke(e),o=n[i],a=o&&o.length>0,s=t[i],u=!!s,a||u?(c=Ie(e),f=c[0],d=c[1],(p=de(f,d))!==e?[3,6]:(v=a?"PAGE":s.type,[4,er(p,v)])):[3,6];case 1:return h=y.sent(),a?[4,vr({source:p,files:o,parseRes:h},t)]:[3,3];case 2:return m=y.sent(),[3,4];case 3:s.source=p,s.copied=!1,h.config&&s.configCreated&&(s.configCreated=l.isEqual(h.config,s.config)),(g={})[i]=C(C({},s),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,a=i.parents,s=i.root,u=void 0===s?"":s;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 a=o.target[t];a||(a=o.target[t]=[]),a.push(e)}})):mr(a,r,n,t))}))}function gr(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,a,s;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,a=i.type,s=i.parents,u=void 0===s?[n]:s,c=i.copied;if(Ke(a)&&!c){var l=Je(o,!1),f=l[0],d=l[1];He(a)&&(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],a=m.default.resolve(Oe(e),o),s=Oe(a);g.default.pathExistsSync(s)?n[i]=a: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,a){var s,u,c,l,f,d;return D(this,(function(a){switch(a.label){case 0:return s=n[o],u=Oe(s),l=(c=r[s]).root,f=c.target,d=Ae(u,l),i[d]?[3,2]:[4,Re(u,d)];case 1:a.sent(),i[d]=!0,a.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,s),t))})}))})),[2]}}))},a=0,s=n.length,u.label=1;case 1:return a<s?[5,o(a,s)]:[3,4];case 2:u.sent(),u.label=3;case 3:return a++,[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(a){switch(a.label){case 0:return t=r.ast,i=r.root,o=r.dependenciesFilePathChange,[4,Ze({ast:t},(function(t){var a=t.value,s=t.SetImportValue,u=r.dependenciesResolveMap[a];if(u){var c=(n[u]||{}).root;if(o||c||i)s(Te(Ae(e,i),Ae(u,c)))}}))];case 1:return[4,a.sent()(e)];case 2:return a.sent(),[2]}}))}))}function br(e,r){return x(this,void 0,void 0,(function(){var n,t,i,o,a,s,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,a=n.dependenciesFilePathChange,s=n.config,u=n.type,c=n.isUpdate,l=n.configCreated,f=Ae(e,t),n.copied=!0,d=He(u)&&s,o&&(t||a||d||c)?[4,yr(f,n,r)]:[3,4]);case 1:return p.sent(),!d||l?[3,3]:(n.configCreated=!0,[4,$e(f,s)]);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,a=m.default.resolve(r,t);Re(a,Ae(a,o))}))),[2]}))}))}function jr(e){return x(this,void 0,void 0,(function(){var r,n,t,i,o,a,s,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,a=i.copy,p="正在复制文件到"+t,m=h.default().start(v.default.yellow(p)),u=(s={succeed:function(e){return m.succeed(v.default.green(e))},fail:function(e){return m.fail(v.default.red(e))}}).succeed,c=s.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(a)];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,a,s,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],a=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+(a?"@"+a.replace("^",""):"")),c.label=3;case 3:return t++,[3,1];case 4:if(r.length>0){s=r.join(" ");try{u="npm install "+s+" --no-save",f.execSync(u,{stdio:"inherit"}),console.log('Dependency "'+s+'" installed successfully.')}catch(e){console.error('Failed to install dependency "'+s+'":',e)}}return[2]}var l}))}))}function Sr(){return x(this,void 0,void 0,(function(){var e,r,n,t,i,o,a,s,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,a=t.taroVersion,s=void 0===a?"2.2.22":a,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""}()||s,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,a,s,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(O),t=e.match(n)||[],i=t[1],o=t[3],a=void 0===o?r:o,s="";return i===p.QUICKAPP&&(s=i,i=p.WEAPP),[i,a,s]}(e,n.defaultMode),i=t[0],o=t[1],a=t[2],process.env.PLATFORM_ENV=i,process.env.MODE_ENV=o,process.env.FIX_ENV=a,[4,Sr()];case 1:return f.sent(),[4,jr({isWatch:r,copy:n.copy})];case 2:return f.sent(),s=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,s.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,a,s,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,a=r.isWatch,s=e.sourceRoot,u=void 0===s?".taro-ci-src":s,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],a,e)]:[3,5];case 3:d.sent(),d.label=4;case 4:return l++,[3,2];case 5:return[2]}}))}))}();
|
|
6
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var r,n=e(require("chalk")),t=e(require("ora")),i=e(require("path")),o=e(require("fs-extra")),s=e(require("minimist")),a=e(require("dayjs")),c=e(require("execa")),u=e(require("semver")),l=e(require("dingtalk-robot-sender")),f=e(require("chokidar")),p=require("lodash"),d=require("child_process"),v=function(){return v=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},v.apply(this,arguments)};function h(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 m(e,r,n,t){return new(n||(n=Promise))((function(i,o){function s(e){try{c(t.next(e))}catch(e){o(e)}}function a(e){try{c(t.throw(e))}catch(e){o(e)}}function c(e){var r;e.done?i(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}c((t=t.apply(e,r||[])).next())}))}function g(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 y(){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"}(r||(r={}));var b,w=r.WEAPP+"|"+r.ALIPAY+"|"+r.QUICKAPP+"|"+r.SWAN+"|"+r.H5+"|"+r.RN+"|"+r.TT,E="("+w+")([.|-]{1})?(.+)?";function P(){}!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"}(b||(b={}));var j=function(){var e=process.env,r=e.SOURCE_ROOT_PATH,n=e.INIT_CWD,t=i.resolve(n,"src");return{rootPath:n,npmDir:n+"/node_modules",sourceDir:t,destinationDir:i.resolve(n,r),sourceRoot:r,appEntryPath:t+"/app.jsx",appEntryConfigPath:t+"/app.config.js",needCopy:r&&"src"!==r}};function C(){var e=j().npmDir;return require(e+"/@tarojs/helper")}function S(){var e=process.env.INIT_CWD,r=C(),n=require(e+"/"+r.PROJECT_CONFIG),t=("function"==typeof n?n(re):n).alias;if(t){var o=j(),s=o.sourceDir,a=o.destinationDir;return Object.keys(t).forEach((function(e){var r=t[e];t[e]=i.resolve(s,r.replace(a,s))})),t}return t}var x=[".js",".jsx",".ts",".tsx"],D=[".scss",".less"],I=[".png",".jpg",".jpeg",".gif"];y(x,D);function k(e){return D.includes(e)}function A(e){return I.includes(e)}function O(e){return function(e){return x.includes(e)}(e)||k(e)||A(e)}var T=/^[0-9]{8}$/;function R(e,r,t,i){void 0===i&&(i=!1);var o=new RegExp("^"+r);return(i?e.includes(r):o.test(e))?i?n.hex(t)(e):e.replace(o,n.hex(t)(r)):""}function M(e,r){var i=this;this.text="项目["+r+"]"+{build:"构建",upload:"上传"}[e],this.start=function(){i.spinner=t().start(n.yellow(i.text+"中... \n"))},this.fail=function(e){i.spinner||(i.spinner=t()),i.spinner.fail(n.red(i.text+"失败:"+e+" \n"))},this.succeed=function(){i.spinner||(i.spinner=t()),i.spinner.succeed(n.green(i.text+"成功! \n"))},this.stop=function(){i.spinner&&i.spinner.stop()}}function q(e){var r=e.toString().replace(/\n$/g,"");return r?(r=R(r,"Tips:","#f5faa4",!0)||R(r,"生成","#b278ff")||R(r,"编译","#00ee76")||R(r,"编译成功","#00ee76",!0)||R(r,"监听文件","#6c6f7d",!0)||R(r,"创建","#00aad1")||R(r,"修改","#e3eb00")||R(r,"Listening","#00aad1",!0)||R(r,"Compiled","#00ee76",!0)||r,console.log(r),r):""}var N={1:{label:"体验",key:"Beta"},2:{label:"候选",key:"Rc"},3:{label:"正式",key:""}};function F(e,r,n,t,i){return new Promise((function(o){var s=e.split(/\s/g),a=s[0],u=s.slice(1),l=c(a,u,{env:v(v({},process.env),i)}),f=new M("build",t);r||n?(l.stdout.on("data",q),l.stderr.on("data",(function(e){if(q(e),r){var n=e.toString().trim();(n.includes("编译成功")||n.includes("successfully"))&&o({code:0})}}))):(l.stdout.on("data",(function(){})),l.stderr.on("data",(function(){})),f.start()),l.on("exit",(function(){r||(o({code:0}),f.succeed())})),l.on("error",(function(e){console.error(e),f.fail(e)}))}))}var V=null;function U(e){void 0===e&&(e="taro-ci");var r=V;if(!r){try{r=require(i.resolve("./"+e+".private.config.js"))}catch(n){r=require(i.resolve("./"+e+".config.js"))}var n="function"==typeof r?r(re):r;return n.minSwanVersion||(n.minSwanVersion="3.310.35"),V=n,n}return r}var _=null;function L(e){void 0===e&&(e="taro-ci");var r=_;if(!r){var n=U(e);try{if(process.env.PLATFORM_ENV){var t=ne(i.resolve("./"+e+".release"),".json"),o=t?require(t):null;if(o&&o.length>0){var s=o[0].split("-"),c=s.splice(0,1)[0],u=s.splice(-1,1)[0],l=s.join("-");T.test(u)||(u&&(s.push(u),l=s.join("-")),u=a().format("YYYYMMDD")),n=v(v({},n),{ts:u,version:c,description:l})}_=n}}catch(e){}return n}return r}var W=null;function Y(e){if(W)return W;var r=s(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,a=r.privacy,c=void 0===a?"":a,u=r.tt,l=void 0===u?"":u,f=r.watch,p=r.debug,d=r.upload,m=r.branch,g=r.multi,y=r.message,b=h(r,["ci","dd","privacy","tt","watch","debug","upload","branch","multi","message"]),E=t.split(","),P=E[0],j=E[1],C=E[2],S=l.split(","),x=S[0],D=S[1],I=o.split(","),k=I[0],A=I[1],O=c.split(","),T=O[0],R=O[1],M=(""+(y||"")).replace(/\n/g,""),q=function(e){if(!e)return{};var r=new RegExp("\\[(("+w+")((\\.[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]:{}}(m,e),_=U.type,L=void 0===_?N:_,Y=U.robot,B=void 0===Y?V:Y;return W=v({ci:t?{toolId:P,privateKey:j,token:C}:void 0,dd:o?{accessToken:k,secret:A}:void 0,privacy:c?{accessToken:T,secret:R}:void 0,tt:l?{email:x,password:D}:void 0,watch:f,debug:p,isWatch:Boolean(f),isDebug:Boolean(p),isUpload:Boolean(d),isCi:Boolean(B),isMulti:Boolean(g),branch:m,robot:B,type:L,message:M},b)}function B(){return process.env.PLATFORM_ENV}function G(){var e=B();return i.resolve("./",b[e.toLocaleUpperCase()]||b.WEAPP)}function H(){return m(this,void 0,void 0,(function(){var e,r;return g(this,(function(n){return e=G(),r=o.readFileSync(e),[2,JSON.parse(r.toString())]}))}))}var K={miniprogram:"miniProgram",plugin:"miniProgramPlugin",game:"miniGame",gamePlugin:"miniGamePlugin"};function $(e){return m(this,void 0,void 0,(function(){var r,n,t,s,a,c;return g(this,(function(u){if(r=Y(),n=r.isWatch,t=r.isDebug,"swan"!==process.env.PLATFORM_ENV&&(n||t))return[2,e];try{s=i.resolve("./ext.json"),(a=require(s)).extEnable=!1,"swan"===process.env.PLATFORM_ENV&&(c=L().info,a.extAppid=c[e].appId),o.writeFileSync(s,JSON.stringify(a,null,4))}catch(e){console.log("ext-extEnable",e)}return[2,e]}))}))}function J(e){return m(this,void 0,void 0,(function(){var n,t,i,s,a,c,u,l,f,p,d,v,h;return g(this,(function(m){switch(m.label){case 0:return n=L().info,t=Y(),i=t.isWatch,s=t.isDebug,a=t.isUpload,c=t.isMulti,u=n[e]||{},l=u.appId,f=u.template,p=u.projectName,d="dist/"+function(e,r,n,t){return e+"."+(r?"dev":"build")+(n?".debug":"")+(t?".multi":"")}(e,i,s,c),process.env.ROOT_PATH=d,process.env.PROJECT_ENV=c?"MULTI":"MINI",process.env.FIX_ENV===r.QUICKAPP||a?[2,e]:(v=G(),[4,H()]);case 1:return h=m.sent(),"swan"===process.env.PLATFORM_ENV?h.smartProgramRoot=d:h.miniprogramRoot=d,h.projectArchitecture=c?"multiPlatform":"miniprogram",h.appid=l,h.projectname=p||e,o.writeFileSync(v,JSON.stringify(h,null,4)),1!==f&&"swan"!==process.env.PLATFORM_ENV?[3,3]:[4,$(e)];case 2:m.sent(),m.label=3;case 3:return[2,e]}}))}))}function Q(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.filter((function(e){return!!e})).join("-")}function X(e){return e?e.trim():void 0}function z(e){var r=L(),n=r.version,t=r.info,i=r.minSwanVersion,o=Y(r.branchMap),s=o.robot,c=o.message,u=t[e]||{},l=u.version,f=void 0===l?n:l,p=u.tag,d=void 0===p?"":p,v=u.label,h=void 0===v?"":v,m=u.robot,g=void 0===m?1:m,y=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:X(n),description:X(t)}}(c),b=y.version,w=void 0===b?f:b,E=y.description,P=N[s+""],j=P.label,C=P.key,S=Q(j,h);return{minSwanVersion:i,robot:s+2*(g-1),versionPure:w,version:Q(C,d+w),description:"【"+S+"版-"+a().format("YYYYMMDDHHmmss")+"】:"+E,label:S,versionKey:C}}function Z(e){return"[object Object]"===Object.prototype.toString.call(e)}function ee(e){return Array.isArray(e)}function re(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 Z(t)?e[n]=re(e[n]?e[n]:{},t):ee(t)?e[n]=t.map((function(r,t){if(Z(r)){var i=e[n]?e[n]:[];return re(i[t]?i[t]:{},r)}return r})):e[n]=t,e}),e)}),e)}function ne(e,r){var n=e.replace(/\/$/,""),t="";if(!r){for(var s=0,a=x.length;s<a;s++){if(t=ne(n,x[s]))return t}return t}var c=process.env.PLATFORM_ENV,u=process.env.MODE_ENV,l=[c];u&&l.unshift(c+"."+u,u);var f=/\/(index)?$/;for(s=0,a=l.length;s<a;s++){var p=l[s];if(o.existsSync(t=n+"."+p+r))return t;if(o.existsSync(t=""+n.replace(f,"")+i.sep+"index."+p+r))return t;if(f.test(n)&&o.existsSync(t=""+n.replace(f,"."+p+"/index")+r))return t}return o.existsSync(t=""+n+r)||o.existsSync(t=""+n+i.sep+"index"+r)?t:""}function te(e,r){Object.keys(e).forEach((function(n){r[n]?(e[r[n]]=e[n],"object"==typeof e[n]&&te(e[r[n]],r),delete e[n]):!1===r[n]?delete e[n]:"object"==typeof e[n]&&te(e[n],r)}))}var ie=function(e){return/^pages((\-\d{1,2})?)$/.test(e)};function oe(e){return m(this,void 0,void 0,(function(){var r,t,i,o,s,a,c,u,l,f,p,d,v,h,m;return g(this,(function(g){switch(g.label){case 0:return r=Y(),t=r.isWatch,i=r.isDebug,o=r.isUpload,s=L(),a=s.useTaroPluginBuildBy,c=s.info,u=s.version,l=(c[e]||{}).version,f=void 0===l?u:l,process.env.APP_VERSION=f,p=process.env,d=p.MODE_ENV,v=p.PLATFORM_ENV,h=p.FIX_ENV,o?[2,e]:(m="taro build --type "+("type"===a?e:"mode"===a&&d?d:v),t&&(m+=" --watch"),console.log(n.grey("编译平台:"),n.red(h||v),n.grey("版本模式:"),n.red(d||"默认")),[4,F(m,t,i,e)]);case 1:return g.sent(),[2,e]}}))}))}function se(e){return m(this,void 0,void 0,(function(){var r,n,t,o,s,a,c,u,l,f,p,d,v,h,m,y;return g(this,(function(g){switch(g.label){case 0:return r=require("miniprogram-ci"),[4,L()];case 1:return n=g.sent().info,t=(void 0===n?{}:n)[e].appId,o=z(e),s=o.version,a=o.description,c=o.robot,[4,H()];case 2:if(u=g.sent(),l=u.setting,f=void 0===l?{}:l,p=u.compileType,d=void 0===p?"miniprogram":p,v=null,h=null,!t)return v=new Error("缺少appId,无法上传到微信平台"),[2,{item:e,error:v,errorCode:3}];m=new r.Project({appid:t,type:K[d]||"miniProgram",projectPath:i.resolve("./"),privateKeyPath:i.resolve("./","private."+t+".key"),ignores:["node_modules/**/*"]}),g.label=3;case 3:return g.trys.push([3,5,,6]),[4,r.upload({robot:c,project:m,version:s,desc:a,setting:f,onProgressUpdate:function(){}})];case 4:return h=g.sent(),[3,6];case 5:return y=g.sent(),v=y,[3,6];case 6:return[2,{item:e,error:v,result:h}]}}))}))}function ae(e){return m(this,void 0,void 0,(function(){var r,n,t,o,s,a,c,l,f,p,d,h,m,y,b,w,E,j,C,S,x,D,I,k,A,O,T,R,M,q,N;return g(this,(function(g){switch(g.label){case 0:return r=require("minidev").minidev,n=Y().ci,[4,L()];case 1:if(t=g.sent(),o=t.info,s=void 0===o?{}:o,a=t.ci,c=s[e],l=c.appId,f=c.audit,p=v(v({},a),n),d=p.toolId,h=p.privateKey,m=z(e),y=m.versionPure,b=m.description,w=m.versionKey,E=null,j=null,!l||!d)return E=new Error("缺少"+(l?"toolId":"appId")+",无法上传到支付宝平台"),[2,{item:e,error:E,errorCode:3}];g.label=2;case 2:return g.trys.push([2,17,,18]),[4,r.config.useRuntime({"alipay.authentication.privateKey":h,"alipay.authentication.toolId":d})];case 3:return g.sent(),S={appId:l,clientType:C="alipay",project:i.resolve("./"),versionDescription:b},[4,r.app.getUploadedVersionList({appId:l,clientType:C})];case 4:if(x=g.sent(),D=x.filter(function(e){return function(r){return!!e&&("INIT"===r.versionStatus&&(""+r.versionDescription).includes({"":"正式版-",Beta:"体验版-",Rc:"候选版-"}[e]))}}(w)),!(D.length>=1))return[3,9];I=D.slice(-1)[0].appVersion,k={appId:l,clientType:C,version:I},g.label=5;case 5:return g.trys.push([5,8,,9]),[4,r.app.cancelExperience(k)];case 6:return g.sent(),[4,r.app.deleteVersion(k)];case 7:return g.sent(),[3,9];case 8:return A=g.sent(),E=A,[3,9];case 9:return(O=require(i.resolve("./mini.project.json")))&&(S.project=i.join(S.project,O.miniprogramRoot)),y&&"-1"!==y?[4,r.app.getUploadedVersion({clientType:C,appId:l})]:[3,11];case 10:T=g.sent(),u.gt(y,T)||(y=u.inc(T,"patch")),S.version=y,g.label=11;case 11:return[4,r.upload(S,{onLog:P,onTaskCreated:P,onVersionCreated:P})];case 12:return j=g.sent(),R=!0,w||!f?[3,14]:(M=f.versionScreenshot)&&M.length>=2?[4,r.audit(v(v({},f),{appId:l,clientType:C,version:S.version,versionDescription:S.versionDescription}))]:[3,14];case 13:g.sent(),R=!1,g.label=14;case 14:return R?[4,r.app.setExperience({appId:l,clientType:C,version:S.version})]:[3,16];case 15:q=g.sent().qrCodeUrl,j.qrCodeUrl=q,g.label=16;case 16:return[3,18];case 17:return N=g.sent(),E=N,[3,18];case 18:return[2,{item:e,result:j,error:E}]}}))}))}function ce(e){return void 0===e&&(e=!0),"上传失败"+(e?",缺少swan-toolkit包":"")}function ue(e,r){return void 0===r&&(r=!1),new Promise((function(t){var i=e.token,o=e.version,s=e.desc,a=("swan upload -p ./ --token "+i+" --min-swan-version "+e.minSwanVersion+" --release-version "+o+" -d "+s.replace(/\s/,"")).split(/\s/g),u=a[0],l=a.slice(1),f=c(u,l,{shell:!0}),p="";f.stderr.on("data",(function(e){p=""+e})),f.on("close",(function(i){var o;0===i?t({}):127===i?(o="swan-toolkit",new Promise((function(e){console.log(n.red("缺少指令:"),n.gray(o)),c("npm",["install",o,"-g"],{shell:!0}).on("close",(function(r){0===r?console.log(n.green("指令安装成功")):console.log(n.red("指令安装失败")),e(r)}))}))).then((function(){r?t({error:ce()}):ue(e,!0).then(t).catch(t)})).catch((function(){t({error:ce()})})):t({error:p||ce(!1)})}))}))}function le(e){return m(this,void 0,void 0,(function(){var r,n,t,s,a,c,u,l,f,p;return g(this,(function(d){switch(d.label){case 0:return r=Y().ci,[4,L()];case 1:if(n=d.sent().ci,t=z(e),s=t.versionPure,a=t.description,c=t.minSwanVersion,u=v(v({},n),r).token,f=null,!(l=void 0===u?"":u))return f=new Error("缺少token,无法上传到百度平台"),[2,{item:e,error:f,errorCode:3}];try{o.writeFileSync(i.resolve("./ext.json"),"")}catch(e){}return[4,ue({token:l,version:s,desc:a,minSwanVersion:c})];case 2:return p=d.sent(),f=p.error,[2,{item:e,result:p,error:f}]}}))}))}function fe(e){return m(this,void 0,void 0,(function(){var r,n,t,o,s,a,c,u,l,f,p,d,h,m;return g(this,(function(g){switch(g.label){case 0:return r=require("tt-ide-cli"),n=Y().tt,[4,L()];case 1:return t=g.sent(),o=t.tt,s=t.info,a=(void 0===s?{}:s)[e].appId,c=v(v({},o),n),u=c.email,l=c.password,f=z(e),p=f.versionPure,d=f.description,h=null,u?l?[4,r.loginByEmail({email:u,password:l})]:[3,3]:(h=new Error("缺少"+(u?"password":"email")+",无法上传到抖音平台"),[2,{item:e,error:h,errorCode:3}]);case 2:return g.sent(),[3,4];case 3:r.setAppConfig({appid:a,config:{token:u}}),g.label=4;case 4:return[4,r.upload({project:{path:i.resolve("./")},qrcode:{format:null,output:"",options:{small:!1}},version:p,changeLog:d,copyToClipboard:!1,needUploadSourcemap:!0}).catch((function(e){return h=e}))];case 5:return m=g.sent(),[4,r.logout()];case 6:return g.sent(),[2,{item:e,error:h,result:m}]}}))}))}function pe(e){return m(this,void 0,void 0,(function(){var n,t,i,o,s,a,c,u,l,f,p,d;return g(this,(function(v){switch(v.label){case 0:if(n=Y(),t=n.isCi,i=n.isWatch,o=n.isDebug,process.env.FIX_ENV)throw new Error("暂不支持快应用上传");if(i||!t)throw new Error(e+",未传入robot或者开发模式无法上传");if(o)throw new Error(e+",DEBUG模式无法上传");s=B(),a={item:e},(c=new M("upload",e)).start(),v.label=1;case 1:switch(v.trys.push([1,12,,13]),s){case r.WEAPP:return[3,2];case r.ALIPAY:return[3,4];case r.SWAN:return[3,6];case r.TT:return[3,8]}return[3,10];case 2:return[4,se(e)];case 3:return a=v.sent(),[3,11];case 4:return[4,ae(e)];case 5:return a=v.sent(),[3,11];case 6:return[4,le(e)];case 7:return a=v.sent(),[3,11];case 8:return[4,fe(e)];case 9:return a=v.sent(),[3,11];case 10:throw u=r.WEAPP+"、"+r.ALIPAY+"、"+r.SWAN+"、"+r.TT,l=new Error("不支持上传该平台,目前支持:"+u),c.fail(l),a={item:e,error:l,errorCode:1},l;case 11:return f=a.error,p=a.errorCode,f?(c.fail(f.message||f),p||(a.errorCode=2)):c.succeed(),[3,13];case 12:return d=v.sent(),c.fail(d.message||d),a={item:e,error:d},[3,13];case 13:return[2,a]}}))}))}function de(){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 ve(e){return m(this,void 0,void 0,(function(){var t,i,o,s,a,c,u,f,p,d,h,m,y,b,w,E,P,j,C,S,x,D,I,k,A,O,T,R,M;return g(this,(function(g){return t=e.result,i=e.error,o=e.item,s=e.errorCode,a=L(),c=Y(a.branchMap),u=c.dd,f=c.privacy,p=a.dd,d=void 0===p?u:p,h=a.privacy,m=void 0===h?f:h,y=a.name,b=a.git,w=void 0===b?"":b,E=z(o),P=E.version,j=E.description,C=E.label,S=B(),D=(x=t||{}).version,I=void 0===D?P:D,k=x.experienceQrCodeUrl,A=x.qrCodeUrl,O=void 0===A?k:A,T=("["+o+"]"+y).toUpperCase()+":"+C,R=(new de).setTitle(T).add("["+T+"]("+w+")\n"),i?(M=S===r.H5?"**上传结果:打包成功,自行部署发布**":'**上传结果:上传失败** \n<font color="red">('+i.message+")</font>",R.add(M)):R.add("**上传结果:上传成功**"),R.add("1. version:"+I).add("2. description:"+j),O&&R.add("\n"),m&&new l(v({baseUrl:"https://oapi.dingtalk.com/robot/send"},m)).markdown(R.title,R.text),d&&new l(v({baseUrl:"https://oapi.dingtalk.com/robot/send"},d)).markdown(R.title,R.text).then((function(){console.log(n.green("已发送钉钉通知!")),i&&S!==r.H5&&1!==s&&process.exit(1)})),[2]}))}))}var he={current:{patchFilesMap:{},usingComponentsCopiedFilesMap:{},patchImportAbsoluteMap:{},appEntryRelatedFilesMap:{}}};function me(e){return i.extname(e)}function ge(e,r){return void 0===r&&(r=!1),i.basename(e,r?void 0:me(e))}function ye(e){var r=me(e);return O(r)?[e.replace(r,""),r]:[e]}var be=function(e){var r=ye(e),n=r[0],t=r[1],i=L(),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 c="(\\.("+w+"))?",u=s.length>0?"(\\.("+s.sort((function(e){return e.includes(".")?-1:1})).join("|")+"))?":"",l=new RegExp(c+u,"g");return n.replace(l,"")+t};function we(e,r){var n=j(),t=n.sourceDir,i=n.destinationDir;return e.replace(t,i+(r&&ie(r)?"/"+r:""))}function Ee(e){return function(e){try{return o.statSync(e).isDirectory()}catch(e){return!1}}(e)?e:i.dirname(e)}function Pe(e,r){var n=Ee(e),t=i.relative(n,r);return t.startsWith(".")||(t="./"+t),t}function je(e,r){return m(this,void 0,void 0,(function(){return g(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,o.copy(e,r,{overwrite:!0})];case 1:return n.sent(),[3,3];case 2:return n.sent(),[3,3];case 3:return[2]}}))}))}function Ce(e,r){var n=S(),t=C();return t.isAliasPath(e,n)?function(e){for(var r in n)if(e.startsWith(r+"/"))return i.join(n[r],"./"+e.slice(r.length));return""}(e):t.isNpmPkg(e)?require.resolve(i.resolve(j().npmDir,e)):i.resolve(r?Ee(r):j().sourceDir,e)}function Se(e){return!!e.walkAtRules}function xe(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 De(e){return{code:e.toString()}}function Ie(e,r){return m(this,void 0,void 0,(function(){var n,t,i,o,s,a;return g(this,(function(c){switch(c.label){case 0:return n=e.ast,t=e.source,i=j().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 c.sent(),[2]}}))}))}function ke(){var e=j().npmDir;return require(e+"/@babel/types")}function Ae(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=j().npmDir;return require(n+"/@babel/traverse").default.apply(void 0,e)}function Oe(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=j().npmDir;return require(n+"/@babel/generator").default.apply(void 0,e)}function Te(e,r){if(r){var n=function(e){var r=j().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=j().npmDir;return require(t+"/@babel/parser").parse(e,{sourceType:"module",plugins:["jsx","tsx","typescript","classProperties","dynamicImport","decorators-legacy"]})}function Re(e){var r=ke();if(Array.isArray(e))return r.arrayExpression(e.map((function(e){return Re(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,Re(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 Me(e,r){var n=ke();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=Oe(e).code;return new Function("return "+r)()}function Ne(e){return["ENTRY","PAGE"].includes(e)}function Fe(e){return Ne(e)||function(e){return"COMPONENT"===e}(e)}function Ve(e,r){return m(this,void 0,void 0,(function(){var n,t;return g(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"),te(r,n)),t=Oe(ke().valueToNode(r),{}),[4,o.writeFileSync(e.replace(ge(e,!0),ge(e)+".config.js"),"const config = "+t.code+";\nexport default config;")]):[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}function Ue(e,r){var n,t=ke(),o=j().sourceDir,s=function(){},a="",c=function(e){var r="",n=ke();return Ae(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 Ae(e,{ClassDeclaration:function(e){var u=Me(e.node,!0);e.node.id.name===c&&u&&(e.node.body.body=e.node.body.body.filter((function(e){if(t.isClassProperty(e)&&"config"===e.key.name){if(t.isCallExpression(e.value)&&t.isMemberExpression(e.value.callee)){var c=e.value.callee;if("preval"===c.object.name&&"require"===c.property.name){var u=e.value.arguments[0].value,l=i.resolve(o,u);try{f=l,void 0===(p=!0)&&(p=!1),p&&delete require.cache[require.resolve(f)],n=require(f),a=l}catch(e){}}}else try{n=qe(e.value),s=function(r){e.value=Re(v(v({},n),r))}}catch(e){}return!r}var f,p;return!0})))},AssignmentExpression:function(e){t.isMemberExpression(e.node.left)&&e.node.left.object.name===c&&"config"===e.node.left.property.name&&(n=qe(e.node.right),r&&e.remove(),s=function(r){e.node.right=Re(v(v({},n),r))})}}),[n,s,a]}var _e={react:["Fragment","Component","useEffect","useLayoutEffect","useState","useContext","useRef","useCallback","useMemo","useImperativeHandle","useReducer","createRef","createContext"],"react-redux":["Provider","connect","useSelector","useDispatch","useStore"]};function Le(e,r,n){var t,i,o,s=Fe(r),a=!1;if(s){var c=ke(),u=L().insertImport,l=(t=v(v({},u),_e),i={},o=function(e,r){i[e]=i[e]||[],i[e].push(r)},Object.keys(t).forEach((function(e){var r=t[e];ee(r)?r.forEach((function(r){var n=ee(r)?r:[r],t=n[0],i=n.slice(1);o(t,y([e],i))})):o(r,[e])})),i),f={},p=new Set,d={};!function(e){var r=ke(),n=!1,t=!1;Ae(e,{ImportDeclaration:function(e){e.node.specifiers.forEach((function(e){r.isImportSpecifier(e)&&"Component"===e.imported.name&&(t=!0)}))}}),Ae(e,{ClassDeclaration:function(e){var t=e.node.superClass,i=Me(e.node,!0);t&&i&&(n=!0,e.node.superClass=r.identifier("Component"))}}),n&&!t&&Ae(e,{ImportDeclaration:function(e){"@tarojs/taro"===e.node.source.value&&e.node.specifiers.push(r.importSpecifier(r.identifier("Component"),r.identifier("Component")))}})}(e),Ae(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]}))||[],u=s[0],p=s[2],v=s[3];if(!u)return;if(n){var h=he.current.patchImportAbsoluteMap[u];if(!h){var m=ye(Ce(u,v)),g=m[0],y=m[1];he.current.patchImportAbsoluteMap[u]=h=ne(g,y)}if(n===h)return}var b=(""+(p||"")).split("."),w=b[0],E=void 0===w?"":w,P=b[1],j="default"===(void 0===P?E:P);"default"===E&&(E=""),f[u]||(f[u]=[]),f[u].push(j?c.importDefaultSpecifier(c.identifier(E||i),c.identifier(i)):E?c.importSpecifier(c.identifier(E),c.identifier(i)):e),E&&(d[e.local.name]=E),t.push(e),a=!0}})),t.length&&t.length===e.node.specifiers.length?p.add(e):t.forEach((function(r){e.node.specifiers=e.node.specifiers.filter((function(e){return e!==r}))}))}}),p.forEach((function(e){return e.remove()})),Ae(e,{Identifier:function(e){var r=e.node.name,n=d[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 c.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=c.importDeclaration(f[r],c.stringLiteral(r));e.program.body.unshift(t)}}))}return{isUpdateImport:a}}function We(e,r,n){return m(this,void 0,void 0,(function(){var t,i,o,s,a,c;return g(this,(function(u){return Se(e)?(t=function(e){var r=!1;return xe(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=Fe(r),t=!1;if(n){var i=ke(),o=!1;Ae(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}))}}}),Ae(e,{ClassDeclaration:function(e){var r=e.node,n=r.superClass,s=r.body;if(n&&Me(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 c=i.classMethod("constructor",i.identifier("constructor"),[],i.blockStatement([i.expressionStatement(i.callExpression(i.super(),[i.spreadElement(i.identifier("arguments"))]))]));s.body.unshift(c),t=!0}}}})}return{isUpdateConstructor:t}}(e,r).isUpdateConstructor,o=function(e,r){var n=Ne(r)?Ue(e,!0):[];return{config:n[0],configRequirePath:n[2]}}(e,r),s=o.config,a=o.configRequirePath,c=Le(e,r,n).isUpdateImport,[2,[s,i||c,a]])}))}))}function Ye(e,r){return m(this,void 0,void 0,(function(){var n,t,s,a,c=this;return g(this,(function(u){return n=e.ast,t=e.create,s=e.code,a=function(){},function(e,r){Se(e)?xe(e,r({types:{isPostcss:!0,checkIsCssAst:Se},generate:De})):Ae(e,r({types:ke(),generate:Oe}))}(n,(function(e){var u=e.generate,l=e.types,f=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)}})};a=function(e,r){return void 0===r&&(r=n),m(c,void 0,void 0,(function(){var n;return g(this,(function(t){try{n=u(r,{}),o.ensureDirSync(i.dirname(e)),o.writeFileSync(e,n.code)}catch(r){console.log("parseImport-update-error-filePath:",e),console.log("parseImport-update-error-info:",r)}return[2]}))}))};var p={ImportDeclaration:function(e){f(e.node.source.value,e,"import")},CallExpression:function(e){l.isIdentifier(e.node.callee,{name:"require"})&&f(e.node.arguments[0].value,e,"require")}};return l.isPostcss&&(p={CSSImportDeclaration:function(e){f(e.params.replace(/^('|")/,"").replace(/('|")$/,""),e,"cssImport")}}),v(v({},p),"function"==typeof t?t({ast:n,generate:u,types:l,code:s}):{})})),[2,a]}))}))}function Be(e,r){return m(this,void 0,void 0,(function(){var n,t,i,s,a,c,u,l,f,p,d,v,h,m;return g(this,(function(g){switch(g.label){case 0:if(n=[],t=me(e),i=null,u=k(t),l=!u&&A(t),f=r||(u?"STYLE":l?"IMAGE":"COMPONENT"),p=L().compileExclude,p&&p.some((function(r){return"function"==typeof r?r(e):e.includes(r)}))||l)return[3,6];g.label=1;case 1:return g.trys.push([1,5,,6]),[4,o.readFileSync(e)];case 2:return d=g.sent(),v=d.toString(),[4,We(i=Te(v,u),f,e)];case 3:return m=g.sent(),s=m[0],c=m[1],a=m[2],[4,Ye({ast:i,code:v},(function(e){var r=e.value;n.push(r)}))];case 4:return g.sent(),[3,6];case 5:return h=g.sent(),console.log("\n【runParse-error】",e,h.message,"\n"),[3,6];case 6:return[2,{source:e,dependencies:n,ast:i,type:f,config:s,configRequirePath:a,isUpdate:c}]}}))}))}var Ge=function(e,r){return ie(e)?e+"-"+r:e};function He(){return m(this,void 0,void 0,(function(){var e,r,n,t,o;return g(this,(function(s){switch(s.label){case 0:return[4,Be(j().appEntryPath,"ENTRY")];case 1:return e=s.sent(),r=e.config,n=r.subPackages,t=h(r,["subPackages"]),o=t,n&&(o.subPackages=function(e){return e.map((function(e,r){var n=e.root,t=e.pages,o=(e.preloadRule,e.network,h(e,["root","pages","preloadRule","network"]));return v(v({},o),{root:Ge(n,r),pages:ie(n)?t.map((function(e){return i.join(n,"/",e)})):t})})).filter((function(e){var r=e.root,n=e.pages;return r&&n&&n.length>0}))}(n),o.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,a=e.pages;t&&0!==(void 0===a?[]:a).length&&(r[t]=r[t]||{packages:[],network:s},r[t].packages.push(Ge(i,n)))})),r}(n),e.config=o),[2,e]}}))}))}function Ke(e){var r=j().sourceDir,n=i.resolve(r,e);return[ne(n),n]}function $e(e,r){return void 0===r&&(r=""),m(this,void 0,void 0,(function(){var n,t,o,s;return g(this,(function(a){switch(a.label){case 0:n={},t=function(t,o){var s,a,c,u,l,f,p,d,h,m;return g(this,(function(o){switch(o.label){case 0:return s=e[t],r&&!ie(r)&&(s=i.join(r,"/",s)),a=Ke(s),c=a[0],u=a[1],l="",f="",p="",c||(m=Ke("./404"),c=m[0],f=m[1],c&&(d=me(c),l=u+d,p=f+d,process.nextTick((function(){var e=he.current.patchFilesMap,r=e[p]||[];r.push(l),e[p]=r})))),c?(l=l||be(c),[4,Be(c,"PAGE")]):[3,2];case 1:h=o.sent(),n[l]=v({root:r},h),o.label=2;case 2:return[2]}}))},o=0,s=e.length,a.label=1;case 1:return o<s?[5,t(o,s)]:[3,4];case 2:a.sent(),a.label=3;case 3:return o++,[3,1];case 4:return[2,n]}}))}))}function Je(e){return m(this,void 0,void 0,(function(){var r,n,t,i,o=this;return g(this,(function(s){switch(s.label){case 0:r={},n=function(n,t){return g(this,(function(t){switch(t.label){case 0:return[4,m(o,void 0,void 0,(function(){var t,i,o;return g(this,(function(s){switch(s.label){case 0:return t=e[n],i=t.root,[4,$e(t.pages,i)];case 1:return o=s.sent(),r=v(v({},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 Qe(e,r){return m(this,void 0,void 0,(function(){var n,t;return g(this,(function(i){return n=(r||{}).parents,(t=void 0===n?new Set:n).add(e),[2,t]}))}))}function Xe(e,r){return m(this,void 0,void 0,(function(){var n,t,i,o,s=this;return g(this,(function(a){if((n=Object.values(v({},e))).length>0)for(t=function(e,t){m(s,void 0,void 0,(function(){var t,i;return g(this,(function(o){switch(o.label){case 0:return t=n[e],(i=r[t])?[4,ze("",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 ze(e,r,n){return m(this,void 0,void 0,(function(){var t,i,o;return g(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,Xe(o,n)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}}))}))}function Ze(e,r,n){return m(this,void 0,void 0,(function(){var t,i;return g(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 er(e,r){return void 0===r&&(r=e),m(this,void 0,void 0,(function(){var n,t,i,o,s;return g(this,(function(a){switch(a.label){case 0:n={},t=Object.keys(e),i=function(i,o){var s,a,c,u,l,f,p,d,h,m,y,b,w,E;return g(this,(function(o){switch(o.label){case 0:s=t[i],a=e[s],c=a.dependencies,u=void 0===c?[]:c,l=a.root,f=void 0===l?"":l,p=a.ast,d=a.config,h=!1,m=function(e,r){var n=S(),t=C();return e.filter((function(e){return t.isAliasPath(e,n)||!t.isNpmPkg(e)})).map((function(e){return[Ce(e,r),e]}))}(u,s),y={},b=function(e,t){var i,o,a,c,u,l,p,d,b,w,E;return g(this,(function(t){switch(t.label){case 0:return i=m[e],o=i[0],a=i[1],c=ye(o),u=c[0],l=c[1],(p=ne(u,l))?(d=be(p),h||(h=p!==d),y[a]=d,b=r[d]||n[d],[4,Qe(s,b)]):[3,6];case 1:return w=t.sent(),b?(b.parents=w,[4,ze(f,b,v(v({},r),n))]):[3,3];case 2:return t.sent(),[3,6];case 3:return[4,Be(p)];case 4:return E=t.sent(),[4,Promise.resolve().then((function(){n[d]=v({root:f,source:p,parents:w},E)}))];case 5:t.sent(),t.label=6;case 6:return[2]}}))},w=0,E=m.length,o.label=1;case 1:return w<E?[5,b(w,E)]:[3,4];case 2:o.sent(),o.label=3;case 3:return w++,[3,1];case 4:return[4,Ze(s,y,r)];case 5:return o.sent(),r[s]=v(v({},r[s]),{config:d,ast:p,dependencies:u,dependenciesResolveMap:y,dependenciesFilePathChange:h}),he.current.allDependenciesMap=v(v({},he.current.allDependenciesMap),r),[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,er(n,v(v({},r),n))]:[3,6];case 5:return[2,a.sent()];case 6:return[2,r]}}))}))}function rr(e,r){return m(this,void 0,void 0,(function(){var n,t;return g(this,(function(o){return(n=(e||{}).list)&&(t=j().sourceDir,n.forEach((function(e){var n=e.selectedIconPath;[e.iconPath,n].filter((function(e){return!!e})).forEach((function(e){var n=i.join(t,e);r[n]={source:n,type:"IMAGE"}}))}))),[2]}))}))}function nr(e){return m(this,void 0,void 0,(function(){var r,n,t,i,o;return g(this,(function(s){switch(s.label){case 0:return r={},e&&e.custom?(n=j().sourceDir,(t=ne(n+"/custom-tab-bar"))?(i=be(t),[4,Be(t)]):[3,2]):[3,2];case 1:o=s.sent(),r[i]=v({source:t},o),s.label=2;case 2:return[2,r]}}))}))}function tr(e){return Object.keys(he.current.appEntryRelatedFilesMap).some((function(r){return n=r,!!(t=e).startsWith(n)||i.dirname(i.resolve(n))===i.dirname(i.resolve(t));var n,t}))}function ir(){return m(this,void 0,void 0,(function(){var e,r,n,t,i,o,s,a,c,u,l;return g(this,(function(f){switch(f.label){case 0:return[4,He()];case 1:return e=f.sent(),r=e.config,n=r.pages,t=r.subPackages,i=r.tabBar,(o=e.configRequirePath)&&(he.current.appEntryRelatedFilesMap[o]=!0),[4,$e(n)];case 2:return s=f.sent(),a=null,t?[4,Je(t)]:[3,4];case 3:a=f.sent(),f.label=4;case 4:return[4,nr(i)];case 5:return c=f.sent(),[4,er(v(v(v(((l={})[e.source]=e,l),s),a),c))];case 6:return u=f.sent(),[4,rr(i,u)];case 7:return f.sent(),[2,u]}}))}))}function or(e,r){var n=e.source,t=e.files,i=e.parseRes;return m(this,void 0,void 0,(function(){return g(this,(function(e){return[2,t.reduce((function(e,t){var o,s=r[t];return s.source=n,s.copied=!1,v(v({},e),((o={})[t]=v(v({},s),i),o))}),{})]}))}))}function sr(e){return m(this,void 0,void 0,(function(){var r,n,t,i,o,s,a,c,u,l,f,d,h,m,y,b,w;return g(this,(function(g){switch(g.label){case 0:return r=he.current,n=r.patchFilesMap,t=r.allDependenciesMap,i=be(e),o=n[i],s=o&&o.length>0,a=t[i],c=!!a,s||c?(u=ye(e),l=u[0],f=u[1],(d=ne(l,f))!==e?[3,9]:"ENTRY"!==(h=s?"PAGE":a.type)?[3,2]:[4,He()]):[3,9];case 1:return y=g.sent(),[3,4];case 2:return[4,Be(d,h)];case 3:y=g.sent(),g.label=4;case 4:return m=y,s?[4,or({source:d,files:o,parseRes:m},t)]:[3,6];case 5:return b=g.sent(),[3,7];case 6:a.source=d,a.copied=!1,m.config&&a.configCreated&&(a.configCreated=p.isEqual(m.config,a.config)),(w={})[i]=v(v({},a),m),b=w,g.label=7;case 7:return Object.keys(b).forEach((function(e){t[e]=v(v({},t[e]),b[e])})),[4,er(b,t)];case 8:return[2,g.sent()];case 9:return[2]}}))}))}function ar(e,r,n,t){e&&e.forEach((function(e){var i=t[e],o=i.type,s=i.parents,a=i.root,c=void 0===a?"":a;Fe(o)&&(Ne(o)?Object.keys(r).forEach((function(t){var i=r[t],o=n[i];if(o||(o=n[i]={root:c,target:{}}),o.root!==c&&(o.root=""),""===o.root)o.target[t]=[];else{var s=o.target[t];s||(s=o.target[t]=[]),s.push(e)}})):ar(s,r,n,t))}))}function cr(e){return m(this,void 0,void 0,(function(){var r,n,t,s,a,c,u;return g(this,(function(l){switch(l.label){case 0:if(!e)return[3,4];r={},Object.keys(e).forEach((function(n){var t=e[n],s=t||{},a=s.ast,c=s.type,u=s.parents,l=void 0===u?[n]:u,f=s.copied;if(Fe(c)&&!f){var p=Ue(a,!1),d=p[0],h=p[1];Ne(c)&&(d=t.config,h=function(e){t.config=v(v({},t.config),e)});var m=(d||{}).usingComponents;if(m){var g=function(e,r){var n={},t={};return Object.keys(r).forEach((function(s){var a=r[s],c=i.resolve(Ee(e),a),u=Ee(c);o.pathExistsSync(u)?n[s]=c:t[s]=a})),[n,t]}(n,m),y=g[0],b=g[1];b&&(t.isUpdate=!0,h({usingComponents:b})),ar(l,y,r,e)}}})),n=Object.keys(r),t=j().appEntryPath,s=he.current.usingComponentsCopiedFilesMap,a=function(i,o){var a,c,u,l,f,p;return g(this,(function(o){switch(o.label){case 0:return a=n[i],c=Ee(a),l=(u=r[a]).root,f=u.target,p=we(c,l),s[p]?[3,2]:[4,je(c,p)];case 1:o.sent(),s[p]=!0,o.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=v(v({},o.config),{usingComponents:v(v({},null===(i=o.config)||void 0===i?void 0:i.usingComponents),(t={},t[r]=Pe(n,a),t))})}))})),[2]}}))},c=0,u=n.length,l.label=1;case 1:return c<u?[5,a(c,u)]:[3,4];case 2:l.sent(),l.label=3;case 3:return c++,[3,1];case 4:return[2]}}))}))}function ur(e,r,n){return m(this,void 0,void 0,(function(){var t,i,o;return g(this,(function(s){switch(s.label){case 0:return t=r.ast,i=r.root,o=r.dependenciesFilePathChange,[4,Ye({ast:t},(function(t){var s=t.value,a=t.SetImportValue,c=r.dependenciesResolveMap[s];if(c){var u=(n[c]||{}).root;if(o||u||i)a(Pe(we(e,i),we(c,u)))}}))];case 1:return[4,s.sent()(e)];case 2:return s.sent(),[2]}}))}))}function lr(e,r){return m(this,void 0,void 0,(function(){var n,t,i,o,s,a,c,u,l,f,p;return g(this,(function(d){switch(d.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,c=n.type,u=n.isUpdate,l=n.configCreated,f=we(e,t),n.copied=!0,p=Ne(c)&&a,o&&(t||s||p||u)?[4,ur(f,n,r)]:[3,4]);case 1:return d.sent(),!p||l?[3,3]:(n.configCreated=!0,[4,Ve(f,a)]);case 2:d.sent(),d.label=3;case 3:return[3,6];case 4:return[4,je(i,f)];case 5:d.sent(),d.label=6;case 6:return o&&"STYLE"===c?[4,Ie(n,f)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[2]}}))}))}function fr(e){return m(this,void 0,void 0,(function(){var r,n,t;return g(this,(function(i){if(e)for(r=Object.keys(e),n=0,t=r.length;n<t;n++)lr(r[n],e);return[2]}))}))}function pr(e,r){m(this,void 0,void 0,(function(){var r,n;return g(this,(function(t){switch(t.label){case 0:return r=he.current.allDependenciesMap,[4,sr("ENTRY"===(r[e]||{}).type||tr(e)?j().appEntryPath:e)];case 1:return[4,cr(n=t.sent())];case 2:return t.sent(),[4,fr(n)];case 3:return t.sent(),[2]}}))}))}function dr(e){return m(this,void 0,void 0,(function(){var r;return g(this,(function(n){return"function"==typeof e&&(r=j().sourceDir,e().forEach((function(e){var n=ee(e)?e:[e],t=n[0],o=n[1],s=void 0===o?"":o,a=i.resolve(r,t);je(a,we(a,s))}))),[2]}))}))}function vr(e){return m(this,void 0,void 0,(function(){var r,i,s,a,c,u,l,p,d,v,h;return g(this,(function(y){switch(y.label){case 0:if(r=j(),i=r.destinationDir,s=r.sourceRoot,!r.needCopy)return[3,8];c=(a=e||{}).isWatch,u=a.copy,b="正在复制文件到"+s,w=t().start(n.yellow(b)),p=(l={succeed:function(e){return w.succeed(n.green(e))},fail:function(e){return w.fail(n.red(e))}}).succeed,d=l.fail,y.label=1;case 1:return y.trys.push([1,7,,8]),[4,o.emptyDir(i)];case 2:return y.sent(),[4,dr(u)];case 3:return y.sent(),[4,ir()];case 4:return[4,cr(v=y.sent())];case 5:return y.sent(),[4,fr(v)];case 6:return y.sent(),c&&function(){m(this,void 0,void 0,(function(){var e,r;return g(this,(function(n){return e=j().sourceDir,(r=f.watch(e,{persistent:!0,ignoreInitial:!0})).on("change",pr),r.on("add",pr),[2]}))}))}(),p("复制成功"),[3,8];case 7:return h=y.sent(),d("Error copying files:"+h.message),[3,8];case 8:return[2]}var b,w}))}))}function hr(e){return m(this,void 0,void 0,(function(){var r,n,t,o,s,a,c,u;return g(this,(function(l){switch(l.label){case 0:r=[],n=Object.keys(e),t=0,o=n.length,l.label=1;case 1:return t<o?(s=n[t],a=e[s],[4,(f=s,new Promise((function(e){var r=j().npmDir;try{require.resolve(i.join(r,f)),console.log('Dependency "'+f+'" is already installed.'),e(!0)}catch(r){console.log('Dependency "'+f+'" is not installed.'),e(!1)}})))]):[3,4];case 2:l.sent()||r.push(s+(a?"@"+a.replace("^",""):"")),l.label=3;case 3:return t++,[3,1];case 4:if(r.length>0){c=r.join(" ");try{u="npm install "+c+" --no-save",d.execSync(u,{stdio:"inherit"}),console.log('Dependency "'+c+'" installed successfully.')}catch(e){console.error('Failed to install dependency "'+c+'":',e)}}return[2]}var f}))}))}function mr(){return m(this,void 0,void 0,(function(){var e,r,n,t,s,a,c,l,f,p;return g(this,(function(d){switch(d.label){case 0:return e=process.env,r=e.PLATFORM_ENV,n=e.MODE_ENV,t=L(),s=t.dynamicDependencies,a=void 0===s?{}:s,c=t.taroVersion,l=void 0===c?"2.2.22":c,f=function(){var e=j().rootPath,r=i.join(e,"package.json");if(o.existsSync(r)){var n=JSON.parse(o.readFileSync(r,"utf-8"));return n.dependencies["@tarojs/taro"]||n.devDependencies["@tarojs/taro"]}return""}()||l,p=v(v(v({},{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":f}}[r]),a[r]),a[r+"."+n]),u.gt(f,"3.0.0")||(p["@tarojs/taro-"+r]=f),[4,hr(p)];case 1:return d.sent(),[2]}}))}))}function gr(e,i,o){return m(this,void 0,void 0,(function(){var s,a,c,u,l,f,p,d;return g(this,(function(v){switch(v.label){case 0:return v.trys.push([0,7,,8]),s=function(e,n){void 0===n&&(n="");var t=new RegExp(E),i=e.match(t)||[],o=i[1],s=i[3],a=void 0===s?n:s,c="";return o===r.QUICKAPP&&(c=o,o=r.WEAPP),[o,a,c]}(e,o.defaultMode),a=s[0],c=s[1],u=s[2],process.env.PLATFORM_ENV=a,process.env.MODE_ENV=c,process.env.FIX_ENV=u,[4,mr()];case 1:return v.sent(),[4,vr({isWatch:i,copy:o.copy})];case 2:return v.sent(),l=ve,f=pe,p=oe,[4,J(e)];case 3:return[4,p.apply(void 0,[v.sent()])];case 4:return[4,f.apply(void 0,[v.sent()])];case 5:return[4,l.apply(void 0,[v.sent()])];case 6:return v.sent(),[3,8];case 7:return d=v.sent(),t().fail(n.gray(d.message)),[3,8];case 8:return[2]}}))}))}!function(){m(this,void 0,void 0,(function(){var e,r,n,t,i,o,s,a,c,u,l,f;return g(this,(function(p){switch(p.label){case 0:return[4,U()];case 1:if(e=p.sent(),r=Y(e.branchMap),n=r.type,t=void 0===n?e.type:n,i=r.isDebug,o=r.robot,s=r.isWatch,a=e.sourceRoot,c=void 0===a?".taro-ci-src":a,process.env.DEBUG_ENV=i||1===o?"OPEN":"CLOSE",process.env.SOURCE_ROOT_PATH=c,!(u=t?Array.isArray(t)?t:[t]:null))return[2];l=0,f=u,p.label=2;case 2:return l<f.length?[4,gr(f[l],s,e)]:[3,5];case 3:p.sent(),p.label=4;case 4:return l++,[3,2];case 5:return[2]}}))}))}();
|
package/dist/types/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare type InfoOptions = {
|
|
|
59
59
|
audit?: {
|
|
60
60
|
versionScreenshot: string[];
|
|
61
61
|
};
|
|
62
|
+
projectName?: string;
|
|
62
63
|
};
|
|
63
64
|
declare type CiType = string | string[];
|
|
64
65
|
interface BranchMapItem {
|
|
@@ -124,6 +125,7 @@ export declare type CompileType = "miniprogram" | "plugin" | "game" | "gamePlugi
|
|
|
124
125
|
export declare type ProjectConfig = {
|
|
125
126
|
miniprogramRoot: string;
|
|
126
127
|
smartProgramRoot?: string;
|
|
128
|
+
projectname?: string;
|
|
127
129
|
appid: string;
|
|
128
130
|
setting: {
|
|
129
131
|
[propertys: string]: any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DependenciesMapType } from "./parse";
|
|
2
2
|
interface FileRefCurrent {
|
|
3
|
+
appEntryRelatedFilesMap?: Record<string, boolean>;
|
|
3
4
|
allDependenciesMap?: DependenciesMapType;
|
|
4
5
|
patchFilesMap: Record<string, string[]>;
|
|
5
6
|
usingComponentsCopiedFilesMap: Record<string, boolean>;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const getDir: () => {
|
|
|
11
11
|
sourceRoot: string;
|
|
12
12
|
appEntryPath: string;
|
|
13
13
|
appEntryConfigPath: string;
|
|
14
|
+
needCopy: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare function getHelper(): any;
|
|
16
17
|
/**
|
|
@@ -126,3 +127,4 @@ export declare function installCommand(name: any): Promise<unknown>;
|
|
|
126
127
|
*/
|
|
127
128
|
export declare function recursiveReplaceObjectKeys(obj: any, keyMap: any): void;
|
|
128
129
|
export declare const checkIsDynamicRoot: (root: string) => boolean;
|
|
130
|
+
export declare function isInSameFolder(pathA: any, pathB: any): boolean;
|