miniprogram-ci 2.0.10 → 2.1.0
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/CHANGELOG.md +5 -0
- package/README.md +5 -0
- package/dist/@types/ci/build-apk.d.ts +54 -0
- package/dist/@types/ci/build-ipa.d.ts +46 -0
- package/dist/@types/ci/getcompiler.d.ts +3 -0
- package/dist/@types/ci/index.d.ts +4 -0
- package/dist/@types/ci/miniapp/androidCloudBuild.d.ts +36 -0
- package/dist/@types/ci/miniapp/archive.d.ts +27 -0
- package/dist/@types/ci/miniapp/checkBuildArgument.d.ts +21 -0
- package/dist/@types/ci/miniapp/iosCloudBuild.d.ts +36 -0
- package/dist/@types/ci/miniapp/iosLocalBuild.d.ts +13 -0
- package/dist/@types/ci/miniapp/iosTheme.d.ts +4 -0
- package/dist/@types/ci/miniapp/miniappPlugin.d.ts +33 -0
- package/dist/@types/ci/miniapp/sdkManager.d.ts +5 -0
- package/dist/@types/ci/miniapp/upload.d.ts +25 -0
- package/dist/@types/ci/miniappattr.d.ts +1 -0
- package/dist/@types/ci/upload.d.ts +1 -2
- package/dist/@types/ci/utils/ciRequest.d.ts +7 -0
- package/dist/@types/ci/utils/progressupdate.d.ts +2 -0
- package/dist/@types/ci/utils/tools.d.ts +4 -0
- package/dist/@types/ci/utils/unpack.d.ts +3 -0
- package/dist/@types/ci/utils/wxvpkg/unpack/config.d.ts +40 -0
- package/dist/@types/ci/utils/wxvpkg/unpack/version0.d.ts +15 -0
- package/dist/@types/ci/utils/wxvpkg/unpack/version10.d.ts +18 -0
- package/dist/@types/ci/utils/wxvpkg/utils.d.ts +3 -0
- package/dist/@types/common/code-analyse/index.d.ts +1 -0
- package/dist/@types/config/config.d.ts +1 -1
- package/dist/@types/config/url.config.d.ts +8 -0
- package/dist/@types/index.d.ts +3 -0
- package/dist/@types/modules/corecompiler/baseCompiler.d.ts +5 -0
- package/dist/@types/modules/corecompiler/originalCompiler.d.ts +1 -0
- package/dist/@types/modules/corecompiler/processHandler.d.ts +2 -21
- package/dist/@types/modules/corecompiler/summerCompiler.d.ts +4 -1
- package/dist/@types/modules/fullcompiler/app/app.d.ts +82 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/originalcontactbase64.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/originallaunchbase64.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.d.ts +3 -0
- package/dist/@types/modules/index.d.ts +1 -2
- package/dist/@types/modules/precompiler/conditioncompile/index.d.ts +3 -2
- package/dist/@types/modules/precompiler/index.d.ts +3 -2
- package/dist/@types/project/ciProject.d.ts +3 -0
- package/dist/@types/types/ci.d.ts +6 -1
- package/dist/@types/types/core.d.ts +1 -1
- package/dist/@types/types/devtools.d.ts +10 -3
- package/dist/@types/types/miniapp/index.d.ts +88 -0
- package/dist/@types/types/summer.d.ts +1 -0
- package/dist/@types/utils/locales/locales.d.ts +1 -0
- package/dist/@types/utils/locales/zh.d.ts +1 -0
- package/dist/@types/utils/messageHub.d.ts +2 -2
- package/dist/@types/utils/miniAppI18N.d.ts +15 -0
- package/dist/@types/utils/miniapp-builder.d.ts +7 -2
- package/dist/@types/utils/miniappJson.d.ts +2 -0
- package/dist/@types/utils/progressRecorder.d.ts +3 -1
- package/dist/@types/utils/report.d.ts +3 -1
- package/dist/@types/utils/request.d.ts +2 -0
- package/dist/@types/utils/subprocess/processManager.d.ts +4 -1
- package/dist/@types/utils/taskstatus.d.ts +3 -3
- package/dist/@types/utils/tools.d.ts +1 -0
- package/dist/ci/android-miniapp-toolkit/dist/index.js +1 -0
- package/dist/ci/android-miniapp-toolkit/lib/apkcert.jar +0 -0
- package/dist/ci/android-miniapp-toolkit/lib/apksigner.jar +0 -0
- package/dist/ci/android-miniapp-toolkit/lib/libwinpthread-1.dll +0 -0
- package/dist/ci/android-miniapp-toolkit/lib/zipalign +0 -0
- package/dist/ci/android-miniapp-toolkit/lib/zipalign.exe +0 -0
- package/dist/ci/build-apk.js +1 -0
- package/dist/ci/build-ipa.js +1 -0
- package/dist/ci/getCompiledResult.js +1 -1
- package/dist/ci/getcompiler.js +1 -1
- package/dist/ci/index.js +1 -1
- package/dist/ci/miniapp/androidCloudBuild.js +1 -0
- package/dist/ci/miniapp/archive.js +1 -0
- package/dist/ci/miniapp/checkBuildArgument.js +1 -0
- package/dist/ci/miniapp/iosCloudBuild.js +1 -0
- package/dist/ci/miniapp/iosLocalBuild.js +1 -0
- package/dist/ci/miniapp/iosTheme.js +1 -0
- package/dist/ci/miniapp/miniappPlugin.js +1 -0
- package/dist/ci/miniapp/sdkManager.js +1 -0
- package/dist/ci/miniapp/upload.js +1 -0
- package/dist/ci/miniappattr.js +1 -0
- package/dist/ci/upload.js +1 -1
- package/dist/ci/utils/ciRequest.js +1 -0
- package/dist/ci/utils/progressupdate.js +1 -0
- package/dist/ci/utils/tools.js +1 -1
- package/dist/ci/utils/unpack.js +1 -0
- package/dist/ci/utils/wxvpkg/unpack/config.js +1 -0
- package/dist/ci/utils/wxvpkg/unpack/version0.js +1 -0
- package/dist/ci/utils/wxvpkg/unpack/version10.js +1 -0
- package/dist/ci/utils/wxvpkg/utils.js +1 -0
- package/dist/common/code-analyse/index.js +1 -1
- package/dist/config/config.js +1 -1
- package/dist/config/url.config.js +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/corecompiler/baseCompiler.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/minifywxml.js +1 -1
- package/dist/modules/corecompiler/processHandler.js +1 -1
- package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -1
- package/dist/modules/corecompiler/summer/module.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/javascript.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/swc.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/wxss.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/terser.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/typescript.js +1 -1
- package/dist/modules/corecompiler/summer/worker.js +1 -1
- package/dist/modules/corecompiler/summerCompiler.js +1 -1
- package/dist/modules/fullcompiler/app/app.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/originalcontactbase64.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/originallaunchbase64.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.js +1 -0
- package/dist/modules/index.js +1 -1
- package/dist/modules/nativecompiler/index.js +1 -1
- package/dist/modules/nativecompiler/ios/buildCloud.js +1 -1
- package/dist/modules/nativecompiler/ios/index.js +1 -1
- package/dist/modules/precompiler/conditioncompile/index.js +1 -1
- package/dist/modules/precompiler/index.js +1 -1
- package/dist/project/advance/precompileProject.js +1 -1
- package/dist/project/ciProject.js +1 -1
- package/dist/utils/codesign.js +1 -1
- package/dist/utils/cp.js +1 -1
- package/dist/utils/locales/en.js +1 -1
- package/dist/utils/locales/zh.js +1 -1
- package/dist/utils/miniAppI18N.js +1 -0
- package/dist/utils/miniapp-builder.js +1 -1
- package/dist/utils/miniappJson.js +1 -1
- package/dist/utils/progressRecorder.js +1 -1
- package/dist/utils/report.js +1 -1
- package/dist/utils/request.js +1 -1
- package/dist/utils/subprocess/processManager.js +1 -1
- package/dist/utils/taskstatus.js +1 -1
- package/dist/utils/tools.js +1 -1
- package/dist/utils/zip.js +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateSubPkgAppInfoJson=exports.packAllPackagesToWxapkg=exports.IMiniappConnectType=exports.IMiniappPkgType=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),pack_1=tslib_1.__importDefault(require("../../../utils/wxapkg/pack")),tools_1=require("../../../utils/tools"),updatecontactandlaunch_1=require("./contactandlaunch/updatecontactandlaunch"),env_1=require("../../../utils/env");var IMiniappPkgType,IMiniappConnectType;async function packAllPackagesToWxapkg(e,t,a){const n=[],p=t.subpackages||t.subPackages,i=[];if(p){const o="__APP__",s=`${a}/${(0,tools_1.generateMD5)(o)}.wxapkg`,l=path_1.default.join(e,s),u=path_1.default.join(e,"app"),r=await(0,pack_1.default)(".",l,u,p.map(e=>path_1.default.join(".",e.root,"/**/*")));i.push(r),n.push({name:o,filePath:s,pkgType:4,md5:(0,tools_1.generateMD5)(r),size:r.byteLength,independent:!1,page_count:t.pages.length,alias:[],wxacode_lib_info_list:[],without_lib_md5:"",separated_plugin_list:[],md5_list:[],widget_list:[]});for(const t of p){const p=processSubpkgRootPath(t.root),o=`${a}/${(0,tools_1.generateMD5)(p)}.wxapkg`,s=path_1.default.join(e,o),l=await(0,pack_1.default)(t.root,s,u,[]);i.push(l),n.push({name:p,filePath:o,pkgType:4,md5:(0,tools_1.generateMD5)(l),size:l.byteLength,independent:!1,page_count:t.pages.length,alias:[],wxacode_lib_info_list:[],without_lib_md5:"",separated_plugin_list:[],md5_list:[],widget_list:[]})}}else{const p="__APP__",i=`${a}/${(0,tools_1.generateMD5)(p)}.wxapkg`,o=path_1.default.join(e,i),s=path_1.default.join(e,"app"),l=await(0,pack_1.default)(".",o,s);n.push({name:p,filePath:i,pkgType:0,md5:(0,tools_1.generateMD5)(l),size:l.byteLength,independent:!1,page_count:t.pages.length,alias:[],wxacode_lib_info_list:[],without_lib_md5:"",separated_plugin_list:[],md5_list:[],widget_list:[]})}const o=Buffer.concat(i);return{wholePkgMd5:(0,tools_1.generateMD5)(o),moduleListConfig:n}}async function generateSubPkgAppInfoJson(e){const{miniModuleId:t,nickName:a,pageOrientation:n,subpkgs:p,buildVersion:i,contact:o,cpfWxaAttrSyncResponse:s,miniappPkgType:l}=e,u=i||1,r=await(0,updatecontactandlaunch_1.updateLaunchBase64)();return{miniModuleId:t,nickname:a,device_orientation:n||"portrait",appVersion:u,pkgInfos:p.map(e=>{var a,n;return{miniModuleId:t,moduleName:e.name,pkgType:e.type,pkgMd5:e.md5,appVersion:u,versionType:e.versionType===IMiniappPkgType.Release?0:1,assetPath:e.file,signVersion:null!==(a=e.signVersion)&&void 0!==a?a:0,signFilePath:null!==(n=e.signFile)&&void 0!==n?n:e.file+".sign"}}),contactBase64:o,launchBase64:r,cpfWxaAttrSyncResponse:s,version:2,miniappPkgType:l,devtoolsPlatform:env_1.isWin?"Windows":"Mac"}}function processSubpkgRootPath(e){return e.startsWith("/")||(e="/"+e),e.endsWith("/")||(e+="/"),e}!function(e){e.Release="Release",e.Debug="Debug",e.HotReload="HotReload"}(IMiniappPkgType=exports.IMiniappPkgType||(exports.IMiniappPkgType={})),function(e){e.USB="USB",e.LAN="LAN"}(IMiniappConnectType=exports.IMiniappConnectType||(exports.IMiniappConnectType={})),exports.packAllPackagesToWxapkg=packAllPackagesToWxapkg,exports.generateSubPkgAppInfoJson=generateSubPkgAppInfoJson;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const originalContactBase64="CgYIABICCgASFwiEAhCFroDAARjX44GVBiDX44GVBihXGmIKCVNpZ25hdHVyZRJV5bCP56iL5bqP5a6Y5pa556S65L6LRGVtb++8jOWwseW9k+WJjeW3suaUr+aMgeeahOaOpeWPo+iDveWKm+WPiue7hOS7tui/m+ihjOWxleekuuOAghoQCgpWZXJpZnlGbGFnEgIyNBpjCgpWZXJpZnlJbmZvElXlsI/nqIvluo/lrpjmlrnnpLrkvotEZW1v77yM5bCx5b2T5YmN5bey5pSv5oyB55qE5o6l5Y+j6IO95Yqb5Y+K57uE5Lu26L+b6KGM5bGV56S644CCGhsKCE5pY2tOYW1lEg/lsI/nqIvluo/npLrkvosaHwoIVXNlck5hbWUSE2doX2Q0M2Y2OTNjYTMxZkBhcHAaCQoFQWxpYXMSABqlAQoMQnJhbmRJY29uVVJMEpQBa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mVJbWFnZVRvUGhvdG9zQWxidW3kv53lrZjlm77niYfliLDns7vnu5/nm7jlhoznmoTog73lipsifSx7InNjb3BlIjoianNhcGlfcmVjb3JkIiwic3ViX2Rlc2MiOiLmvJTnpLpsaXZlLXB1c2hlcue7hOS7tuebuOWFs+iDveWKmyJ9LHsic2NvcGUiOiJ3ZWJhcGlfYmx1ZXRvb3RoIiwic3ViX2Rlc2MiOiLmvJTnpLrok53niZnjgIFpQmVhY29u55u45YWz6IO95YqbIn1dLCJ3eGFfb3Blbl91cmxfZG9tYWluX2xpc3QiOltdfSITZ2hfZDQzZjY5M2NhMzFmQGFwcA==";exports.default=originalContactBase64;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const launchRespBase64="CgYIABICCgASBAgBGAEakhsKgwkBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBAEBAQEBBAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBBAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQQBAQEBAQEBAQEBBAEBAQEBAQEBAQEBAQABAQAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAAAAAQABAQEBAQEBAQAAAQEAAQEBAQEAAQEBAQABAQEAAAEAAQABAQEBAAABAQAAAQEBAQEBAQE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CI6MCwiZXhwdF9ncm91cF9pZCI6MH0seyJwYXJhbV9uYW1lIjoiZXhwdF8xNjQ4MTkzMzgxIiwicGFyYW1fdmFsdWUiOiIwIiwiZXhwdF9pZCI6MCwiZXhwdF9ncm91cF9pZCI6MH0seyJwYXJhbV9uYW1lIjoiZXhwdF8xNjI4MDgzOTI1NTQ5IiwicGFyYW1fdmFsdWUiOiIwIiwiZXhwdF9pZCI6MCwiZXhwdF9ncm91cF9pZCI6MH0seyJwYXJhbV9uYW1lIjoiZXhwdF9hcmdzXzIiLCJwYXJhbV92YWx1ZSI6IjEiLCJleHB0X2lkIjo0ODMsImV4cHRfZ3JvdXBfaWQiOjQ4NX0seyJwYXJhbV9uYW1lIjoiZXhwdF9hcmdzXzMiLCJwYXJhbV92YWx1ZSI6IjIiLCJleHB0X2lkIjoxNTksImV4cHRfZ3JvdXBfaWQiOjE2Mn1dfX1ggJqeAWocb0ZrQmp3U1ZHWmk2VTkwMDZldFNoMDNmaVBWRQ==";exports.default=launchRespBase64;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.updateContactBase64ForSubPkgs=void 0;const tslib_1=require("tslib"),originalcontactbase64_1=tslib_1.__importDefault(require("./originalcontactbase64")),protobuf=require("protobufjs");async function updateContactBase64ForSubPkgs(e){const{appid:t,version:a,nickName:n,brandIconURL:i,fullPkg:o,modList:r}=e,s=originalcontactbase64_1.default,p=Buffer.from(s,"base64"),{root:d}=protobuf.parse("\n package attrresponse;\n \n message WxaAttrSyncResponse\n {\n optional BaseResponse BaseResponse = 1;\n optional bytes LastAttrVersion = 2;\n repeated WxaAttrSyncResp_KeyValue UpdateInfoList = 3;\n optional string WxaUserName = 4;\n optional bytes RespBuffer = 5; \n }\n \n message BaseResponse {\n required int32 Ret = 1;\n required SKBuiltinString_t ErrMsg = 2;\n }\n \n message WxaAttrSyncResp_KeyValue\n {\n optional string Key = 1;\n optional string Value = 2;\n }\n \n message SKBuiltinString_t {\n optional string String = 1;\n }\n ",{keepCase:!0}),l=t,c=d.lookupType("attrresponse.WxaAttrSyncResponse"),u=c.decode(p);u.WxaUserName=l,modifyUpdateInfoListItem(u,"Signature",""),modifyUpdateInfoListItem(u,"VerifyInfo",""),modifyUpdateInfoListItem(u,"NickName",n),modifyUpdateInfoListItem(u,"QuanPin",""),modifyUpdateInfoListItem(u,"PYInitial",""),modifyUpdateInfoListItem(u,"UserName",l),modifyUpdateInfoListItem(u,"Alias",""),modifyUpdateInfoListItem(u,"BrandIconURL",i),modifyUpdateInfoListItem(u,"BigHeadImgUrl",i),modifyUpdateInfoListItem(u,"SmallHeadImgUrl",i),modifyUpdateInfoListItem(u,"WxaAppInfo",{Appid:t,Network:{},PluginInfo:{plugin_list:[]},TcbCdnDomain:{},CanPreFetchData:0}),modifyUpdateInfoListItem(u,"WxaAppVersionInfo",{AppVersion:a,UsePreloadRule:!0,module_list:r||[],widget_list:o?[o]:[],UseModule:!!(r&&r.length>0),EntranceModule:"__APP__",Last_Version_Categories:[],client_js_ext_info:{}}),modifyUpdateInfoListItem(u,"WxaAppDynamic",{NewCategories:[],NewSetting:{MaxLocalstorageSize:10,MaxCodeSize:2,MaxWebviewDepth:5,MaxBackgroundLifespan:300,MaxRequestConcurrent:10,MaxUploadConcurrent:10,MaxDownloadConcurrent:10,MaxFileStorageSize:200,ExpiresAtList:432e3,BackgroundNetworkInterruptedTimeout:300,CanKeepAliveByAudioPlay:1,LifeSpanBeforeSuspend:5,LifeSpanAfterSuspend:1800,MaxWebsocketConnect:5,ExpendedMaxWebviewDepth:10,ActualWebviewDepth:5,WebsocketSkipPortCheck:1,MaxSubpackageSubCodeSize:2,MaxSubpackageFullCodeSize:20,MaxWorkerConcurrent:1,ScanCodeEnableZZM:0,MaxPluginSdkReadmeSize:2,CanPreFetchData:0,CanPeriodFetchData:0,PeriodFetchData:12,TLSSkipHostnameCheck:0,NavigateMiniprogramLimit:999999,OpendataMaxLocalstorageSize:10,OpendataMaxFileStorageSize:10,MaxTempFileStorageSize:2048,OpenWxaIap:1,GuaranteeFlag:1,CanShowLoadingAdvert:0,MaxSubPackageLimit:100,PeriodFetchDataDay:7,OpenWxaWaitUpdateMaxMicSec:13e3,OpenWxaWaitUpdateMaxMicSecForWeakNet:13e3,MinTempFileStorageSize:2048,Uint32MaxLocalstorageSizeInMB:10,Uint32OpendataMaxLocalstorageSizeInMB:10,Uint32MaxFileStorageSizeInMB:200,Uint32OpendataMaxFileStorageSizeInMB:10,Uint32MaxTempFileStorageSizeInMB:4096,Uint32MinTempFileStorageSizeInMB:2048,OpenProductFlag:0,UsePackageConfirmSubDescScopeList:[],PreCgiCallByteBeforeLaunch:"",CanShowGameLoadingAdvert:0}});return c.encode(u).finish().toString("base64")}function modifyUpdateInfoListItem(e,t,a){const n=e.UpdateInfoList.find(e=>e.Key===t);if(n)if("object"==typeof a){const e=JSON.parse(n.Value);for(const t in a)e[t]=a[t];n.Value=JSON.stringify(e)}else n.Value=a}exports.updateContactBase64ForSubPkgs=updateContactBase64ForSubPkgs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.updateContactBase64=exports.updateLaunchBase64=void 0;const tslib_1=require("tslib"),originalcontactbase64_1=tslib_1.__importDefault(require("./originalcontactbase64")),originallaunchbase64_1=tslib_1.__importDefault(require("./originallaunchbase64")),protobuf=require("protobufjs");async function updateLaunchBase64(){const{root:e}=protobuf.parse("\n package launchresponse;\n\n message LaunchWxaAppResponse\n {\n required BaseResponse BaseResponse = 1;\n\n optional LaunchAction Launch = 2;\n optional CheckJsApiInfo CheckJsApi = 3;\n optional PublicLibUpdateInfo PublicLibUpdate = 5;\n optional ActionSheetInfo ActionSheet = 6;\n optional WxaOperationInfo Operation = 7;\n optional string appid = 8;\n optional string username = 9;\n optional string opConfig = 10; // 透传给基础库\n optional WxaRuntimeInfo runtime_info = 11;// 小程序sdk专用\n }\n\n message WxaRuntimeInfo\n {\n optional uint32 block_reason = 1;// 拦截原因,返回给宿主app\n optional bool can_show_start_wording = 2; // 控制小程序sdk是否展示启动wording\n }\n\n message WxaOperationInfo\n {\n optional string JsonInfo = 1; //运营的权限位都放到这个json里,透传给客户端\n }\n\n message PublicLibUpdateInfo\n {\n optional bool need_update = 1;\n optional string url = 2;\n optional string md5 = 3;\n optional uint32 version = 4;\n optional uint32 force_update = 5;\n optional string patch_url = 6;\n optional bool rely_update = 7;\n }\n\n message ActionSheetInfo\n {\n optional bool OpenComment = 1;\n optional bool ShouldPopEvaluate = 2; //关闭小程序时是否可以弹评价\n optional uint32 PopEvaluateLeastStayTime= 3; //弹评价最小停留时间\n optional bytes control_bytes = 5; //控制字段,control_bytes[0]菜单显示和封禁,0:显示 1:不显示 2:封禁\n }\n\n message BaseResponse {\n required int32 Ret = 1;\n required SKBuiltinString_t ErrMsg = 2;\n }\n\n message LaunchAction\n {\n optional uint32 ActionCode = 1;\n optional string OpenUrl = 2;\n optional bool NeedHistoryList = 3;\n optional string AlertMsg = 4;\n optional string AlertTitle = 5;\n }\n\n message SKBuiltinString_t {\n optional string String = 1;\n }\n\n message CheckJsApiInfo\n {\n optional bytes jsapi_control_bytes = 1;\n repeated bytes state_jsapi_bytes = 2;\n }\n ",{keepCase:!0}),n=originallaunchbase64_1.default,t=Buffer.from(n,"base64"),a=e.lookupType("launchresponse.LaunchWxaAppResponse"),o=a.decode(t);return a.encode(o).finish().toString("base64")}async function updateContactBase64(e){const{appid:n,version:t,nickName:a,brandIconURL:o,fullPkg:i}=e,s=originalcontactbase64_1.default,r=Buffer.from(s,"base64"),{root:p}=protobuf.parse("\n package attrresponse;\n\n message WxaAttrSyncResponse\n {\n optional BaseResponse BaseResponse = 1;\n optional bytes LastAttrVersion = 2;\n repeated WxaAttrSyncResp_KeyValue UpdateInfoList = 3;\n optional string WxaUserName = 4;\n optional bytes RespBuffer = 5; \n }\n\n message BaseResponse {\n required int32 Ret = 1;\n required SKBuiltinString_t ErrMsg = 2;\n }\n\n message WxaAttrSyncResp_KeyValue\n {\n optional string Key = 1;\n optional string Value = 2;\n }\n\n message SKBuiltinString_t {\n optional string String = 1;\n }\n ",{keepCase:!0}),l=n,d=p.lookupType("attrresponse.WxaAttrSyncResponse"),u=d.decode(r);u.WxaUserName=l,modifyUpdateInfoListItem(u,"Signature",""),modifyUpdateInfoListItem(u,"VerifyInfo",""),modifyUpdateInfoListItem(u,"NickName",a),modifyUpdateInfoListItem(u,"QuanPin",""),modifyUpdateInfoListItem(u,"PYInitial",""),modifyUpdateInfoListItem(u,"UserName",l),modifyUpdateInfoListItem(u,"Alias",""),modifyUpdateInfoListItem(u,"BrandIconURL",o),modifyUpdateInfoListItem(u,"BigHeadImgUrl",o),modifyUpdateInfoListItem(u,"SmallHeadImgUrl",o),modifyUpdateInfoListItem(u,"WxaAppInfo",{Appid:n,Network:{},PluginInfo:{plugin_list:[]},TcbCdnDomain:{},CanPreFetchData:0}),modifyUpdateInfoListItem(u,"WxaAppVersionInfo",{AppVersion:t,UsePreloadRule:!1,module_list:[],widget_list:[i],UseModule:!1,EntranceModule:"__FULL__",Last_Version_Categories:[],client_js_ext_info:{}}),modifyUpdateInfoListItem(u,"WxaAppDynamic",{NewCategories:[],NewSetting:{MaxLocalstorageSize:10,MaxCodeSize:2,MaxWebviewDepth:5,MaxBackgroundLifespan:300,MaxRequestConcurrent:10,MaxUploadConcurrent:10,MaxDownloadConcurrent:10,MaxFileStorageSize:200,ExpiresAtList:432e3,BackgroundNetworkInterruptedTimeout:300,CanKeepAliveByAudioPlay:1,LifeSpanBeforeSuspend:5,LifeSpanAfterSuspend:1800,MaxWebsocketConnect:5,ExpendedMaxWebviewDepth:10,ActualWebviewDepth:5,WebsocketSkipPortCheck:1,MaxSubpackageSubCodeSize:2,MaxSubpackageFullCodeSize:20,MaxWorkerConcurrent:1,ScanCodeEnableZZM:0,MaxPluginSdkReadmeSize:2,CanPreFetchData:0,CanPeriodFetchData:0,PeriodFetchData:12,TLSSkipHostnameCheck:0,NavigateMiniprogramLimit:999999,OpendataMaxLocalstorageSize:10,OpendataMaxFileStorageSize:10,MaxTempFileStorageSize:2048,OpenWxaIap:1,GuaranteeFlag:1,CanShowLoadingAdvert:0,MaxSubPackageLimit:100,PeriodFetchDataDay:7,OpenWxaWaitUpdateMaxMicSec:13e3,OpenWxaWaitUpdateMaxMicSecForWeakNet:13e3,MinTempFileStorageSize:2048,Uint32MaxLocalstorageSizeInMB:10,Uint32OpendataMaxLocalstorageSizeInMB:10,Uint32MaxFileStorageSizeInMB:200,Uint32OpendataMaxFileStorageSizeInMB:10,Uint32MaxTempFileStorageSizeInMB:4096,Uint32MinTempFileStorageSizeInMB:2048,OpenProductFlag:0,UsePackageConfirmSubDescScopeList:[],PreCgiCallByteBeforeLaunch:"",CanShowGameLoadingAdvert:0}});return d.encode(u).finish().toString("base64")}function modifyUpdateInfoListItem(e,n,t){const a=e.UpdateInfoList.find(e=>e.Key===n);if(a)if("object"==typeof t){const e=JSON.parse(a.Value);for(const n in t)e[n]=t[n];a.Value=JSON.stringify(e)}else a.Value=t}exports.updateLaunchBase64=updateLaunchBase64,exports.updateContactBase64=updateContactBase64;
|
package/dist/modules/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Builder=void 0;const tslib_1=require("tslib"),nodePath=tslib_1.__importStar(require("path")),index_1=require("./precompiler/index"),nativecompiler_1=require("./nativecompiler"),createSummer_1=require("./createSummer"),singletontask_1=require("../utils/singletontask"),code_analyse_1=require("../common/code-analyse"),tools_1=require("../utils/tools");class CodeDataFileHelper{constructor(e){var t;this.project=e,this._listeners=[],this.onFileChange=()=>{this._listeners.forEach(e=>{e()})},null===(t=e.event)||void 0===t||t.on("fileChange",this.onFileChange)}destroy(){var e;null===(e=this.project.event)||void 0===e||e.off("fileChange",this.onFileChange)}get prefix(){return"miniProgram"===this.project.type?this.project.miniprogramRoot:"miniProgramPlugin"===this.project.type?this.project.pluginRoot:""}stat(e){const t=this.project.stat(this.prefix,e),i=!!(null==t?void 0:t.isFile),r=!!(null==t?void 0:t.isDirectory);if(!i&&!r)return;return{isFile:i,isDirectory:r,size:null==t?void 0:t.size,mtime:(null==t?void 0:t.mtimeMs)||0}}mtime(e){const t=this.stat(e);return t?t.mtime:0}exist(e){return this.project.exists(this.prefix,e)}existDir(e){if(this.exist(e)){const t=this.stat(e);return!!(null==t?void 0:t.isDirectory)}return!1}existFile(e){if(this.exist(e)){const t=this.stat(e);return!!(null==t?void 0:t.isFile)}return!1}getFileList(e="",t=""){const i=this.project.getFileList(this.prefix,t);return this.excludeRoot(i,this.prefix)}excludeRoot(e=[],t=""){return t?e.map(e=>nodePath.posix.relative(t,e)):e}async getString(e){return this.project.getFile(this.prefix,e).toString()}async getLocalFileString(e){return this.project.getFile(this.prefix,e).toString("utf-8")}async getJSON(e){const t=await this.getString(e);try{return JSON.parse(t)}catch(e){return null}}async readdir(e){const{files:t,dirs:i}=this.project.getFilesAndDirs();e.endsWith("/")||(e+="/");const r=t.filter(t=>t.startsWith(e));return i.filter(t=>t.startsWith(e)).concat(r).filter(t=>t.slice(e.length).indexOf("/")<0).map(t=>t.slice(e.length))}watchFileChange(e){this._listeners.push(e)}}class Builder{constructor(e,t){this._getPreCompileProject=async()=>{const{targetPlatform:e,targetPlatformDefines:t}=this._options,i=await this.getPreCompiler(),r=await i.getPreCompileProject({targetPlatform:e,targetPlatformDefines:t,runEnv:"main process"});return await r.ready(),r},this._getSummerCompiler=async()=>{if(!this._summerCompiler){const{summerCompilerClass:e,projectInfo:t,cachePath:i="",devtoolMessagehub:r}=this._options,s=await this.getPreCompileProject(),o=await this.getAnalyzer();e?(this._summerCompiler=new e(s,i,t,r,o,this._options.filterFactory),await this._summerCompiler.ready()):this._summerCompiler=await(0,createSummer_1.getSummerCompiler)(s,o)}return this._summerCompiler},this.originProject=e,this._options=t}async getCompiler(){return this.getSummerCompiler()}async getAnalyzer(){if(this._analyzer)return this._analyzer;const e=await this.getPreCompileProject();return this._analyzer=new code_analyse_1.Analyzer({root:nodePath.join(e.projectPath,e.miniprogramRoot),type:"miniprogram",fileHelper:new CodeDataFileHelper(e),compilerPlugins:(0,tools_1.getCompilerPlugins)(e)}),this._analyzer}async getPreCompileProject(){return this._precompileProject||(this._getPrecompileProjectTask||(this._getPrecompileProjectTask=new singletontask_1.SingletonTask(this._getPreCompileProject)),this._precompileProject=await this._getPrecompileProjectTask.getResult(!0)),this._precompileProject}async getPreCompiler(){if(!this._preCompiler){const{devtoolMessagehub:e}=this._options;this._preCompiler=new index_1.PreCompiler(this.originProject,e)}return this._preCompiler}async getSummerCompiler(){var e;return this._getSummerCompilerTask||(this._getSummerCompilerTask=new singletontask_1.SingletonTask(this._getSummerCompiler)),null===(e=this._getSummerCompilerTask)||void 0===e?void 0:e.getResult(!0)}async ready(){return this._checkReadyTask||(this._checkReadyTask=new singletontask_1.SingletonTask(this.init.bind(this,this._options))),await this._checkReadyTask.getResult()}async init(){}async getNativeCompiler(){return this._nativeCompiler||await this.initNativeCompiler(this._options),this._nativeCompiler}async initNativeCompiler(e){if("multiPlatform"!==this.originProject.projectArchitecture)return;const{miniappDirPath:t,devtoolsVersion:i,devtoolMessagehub:r}=e,s=await this.getPreCompileProject();this._nativeCompiler=new nativecompiler_1.NativeCompiler({project:s,devtoolMessagehub:r,devtoolsVersion:i,miniappDirPath:t}),await this._nativeCompiler.ready()}getPreCompileOptions(){var e,t;return{targetPlatform:null===(e=this._precompileProject)||void 0===e?void 0:e.targetPlatform,targetPlatformDefines:null===(t=this._precompileProject)||void 0===t?void 0:t.targetPlatformDefines}}async changePreCompileOptions(e){const t=await this.getPreCompileProject();(null==t?void 0:t.targetPlatform)!==e.targetPlatform&&(t.updateConditionCompileOptions(e),await new Promise(e=>setTimeout(e,500)))}async setLocale(e){(await this.getSummerCompiler()).setLocale(e)}destroy(){var e,t,i,r,s;(null===(e=this._summerCompiler)||void 0===e?void 0:e.isSummer)&&this._summerCompiler.destroy(),null===(t=this._analyzer)||void 0===t||t.destroy(),this._analyzer=void 0,null===(i=this._nativeCompiler)||void 0===i||i.destroy(),null===(s=null===(r=this.originProject)||void 0===r?void 0:r.destroy)||void 0===s||s.call(r)}}exports.Builder=Builder;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Builder=void 0;const tslib_1=require("tslib"),nodePath=tslib_1.__importStar(require("path")),index_1=require("./precompiler/index"),nativecompiler_1=require("./nativecompiler"),createSummer_1=require("./createSummer"),singletontask_1=require("../utils/singletontask"),code_analyse_1=require("../common/code-analyse"),tools_1=require("../utils/tools");class CodeDataFileHelper{constructor(e){var t;this.project=e,this._listeners=[],this.onFileChange=()=>{this._listeners.forEach(e=>{e()})},null===(t=e.event)||void 0===t||t.on("fileChange",this.onFileChange)}destroy(){var e;null===(e=this.project.event)||void 0===e||e.off("fileChange",this.onFileChange)}get prefix(){return"miniProgram"===this.project.type?this.project.miniprogramRoot:"miniProgramPlugin"===this.project.type?this.project.pluginRoot:""}stat(e){const t=this.project.stat(this.prefix,e),i=!!(null==t?void 0:t.isFile),r=!!(null==t?void 0:t.isDirectory);if(!i&&!r)return;return{isFile:i,isDirectory:r,size:null==t?void 0:t.size,mtime:(null==t?void 0:t.mtimeMs)||0}}mtime(e){const t=this.stat(e);return t?t.mtime:0}exist(e){return this.project.exists(this.prefix,e)}existDir(e){if(this.exist(e)){const t=this.stat(e);return!!(null==t?void 0:t.isDirectory)}return!1}existFile(e){if(this.exist(e)){const t=this.stat(e);return!!(null==t?void 0:t.isFile)}return!1}getFileList(e="",t=""){const i=this.project.getFileList(this.prefix,t);return this.excludeRoot(i,this.prefix)}excludeRoot(e=[],t=""){return t?e.map(e=>nodePath.posix.relative(t,e)):e}async getString(e){return this.project.getFile(this.prefix,e).toString()}async getLocalFileString(e){return this.project.getFile(this.prefix,e).toString("utf-8")}async getJSON(e){const t=await this.getString(e);try{return JSON.parse(t)}catch(e){return null}}async readdir(e){const{files:t,dirs:i}=this.project.getFilesAndDirs();e.endsWith("/")||(e+="/");const r=t.filter(t=>t.startsWith(e));return i.filter(t=>t.startsWith(e)).concat(r).filter(t=>t.slice(e.length).indexOf("/")<0).map(t=>t.slice(e.length))}watchFileChange(e){this._listeners.push(e)}}class Builder{constructor(e,t){this._getPreCompileProject=async()=>{const{targetPlatform:e,targetPlatformDefines:t}=this._options,i=await this.getPreCompiler(),r=await i.getPreCompileProject({targetPlatform:e,targetPlatformDefines:t,runEnv:"main process"});return await r.ready(),r},this._getSummerCompiler=async()=>{if(!this._summerCompiler){const{summerCompilerClass:e,projectInfo:t,cachePath:i="",devtoolMessagehub:r}=this._options,s=await this.getPreCompileProject(),o=await this.getAnalyzer();e?(this._summerCompiler=new e(s,i,t,r,o,this._options.filterFactory),await this._summerCompiler.ready()):this._summerCompiler=await(0,createSummer_1.getSummerCompiler)(s,o)}return this._summerCompiler},this.originProject=e,this._options=t}async getCompiler(){return this.getSummerCompiler()}async getAnalyzer(){if(this._analyzer)return this._analyzer;const e=await this.getPreCompileProject();return this._analyzer=new code_analyse_1.Analyzer({root:nodePath.join(e.projectPath,e.miniprogramRoot),type:"miniprogram",fileHelper:new CodeDataFileHelper(e),compilerPlugins:(0,tools_1.getCompilerPlugins)(e)}),this._analyzer}async getPreCompileProject(){return this._precompileProject||(this._getPrecompileProjectTask||(this._getPrecompileProjectTask=new singletontask_1.SingletonTask(this._getPreCompileProject)),this._precompileProject=await this._getPrecompileProjectTask.getResult(!0)),this._precompileProject}async getPreCompiler(){if(!this._preCompiler){const{devtoolMessagehub:e,consoleDisplay:t}=this._options;this._preCompiler=new index_1.PreCompiler(this.originProject,e,t)}return this._preCompiler}async getSummerCompiler(){var e;return this._getSummerCompilerTask||(this._getSummerCompilerTask=new singletontask_1.SingletonTask(this._getSummerCompiler)),null===(e=this._getSummerCompilerTask)||void 0===e?void 0:e.getResult(!0)}async ready(){return this._checkReadyTask||(this._checkReadyTask=new singletontask_1.SingletonTask(this.init.bind(this,this._options))),await this._checkReadyTask.getResult()}async init(){}async getNativeCompiler(){return this._nativeCompiler||await this.initNativeCompiler(this._options),this._nativeCompiler}async initNativeCompiler(e){if("multiPlatform"!==this.originProject.projectArchitecture)return;const{miniappDirPath:t,devtoolsVersion:i,devtoolMessagehub:r}=e,s=await this.getPreCompileProject();this._nativeCompiler=new nativecompiler_1.NativeCompiler({project:s,devtoolMessagehub:r,devtoolsVersion:i,miniappDirPath:t}),await this._nativeCompiler.ready()}getPreCompileOptions(){var e,t;return{targetPlatform:null===(e=this._precompileProject)||void 0===e?void 0:e.targetPlatform,targetPlatformDefines:null===(t=this._precompileProject)||void 0===t?void 0:t.targetPlatformDefines}}async changePreCompileOptions(e){const t=await this.getPreCompileProject();(null==t?void 0:t.targetPlatform)!==e.targetPlatform&&(t.updateConditionCompileOptions(e),await new Promise(e=>setTimeout(e,500)))}async setLocale(e){(await this.getSummerCompiler()).setLocale(e)}destroy(){var e,t,i,r,s;(null===(e=this._summerCompiler)||void 0===e?void 0:e.isSummer)&&this._summerCompiler.destroy(),null===(t=this._analyzer)||void 0===t||t.destroy(),this._analyzer=void 0,null===(i=this._nativeCompiler)||void 0===i||i.destroy(),null===(s=null===(r=this.originProject)||void 0===r?void 0:r.destroy)||void 0===s||s.call(r)}}exports.Builder=Builder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NativeCompiler=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),define_1=require("../../config/define"),processManager_1=require("../../utils/subprocess/processManager"),messageHub_1=require("../../utils/messageHub"),singletontask_1=require("../../utils/singletontask");class NativeCompiler{constructor(s){this.initedPromise=null,this.onProgressUpdate=(s,e,i)=>{
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NativeCompiler=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),define_1=require("../../config/define"),processManager_1=require("../../utils/subprocess/processManager"),messageHub_1=require("../../utils/messageHub"),singletontask_1=require("../../utils/singletontask");class NativeCompiler{constructor(s){this.initedPromise=null,this.onProgressUpdate=(s,e,i)=>{this.messageHub.showBuildLog(""+s,e,i)},this.messageHub=new messageHub_1.MessageHub(s.devtoolMessagehub),this.project=s.project,this.miniappDirPath=s.miniappDirPath,this.devtoolsVersion=s.devtoolsVersion}async ready(){return this._checkReadyTask||(this._checkReadyTask=new singletontask_1.SingletonTask(this.init.bind(this))),await this._checkReadyTask.getResult()}async init(){return this.initedPromise||(this.initedPromise=(async()=>{await this.createSubProcessManager()})()),this.initedPromise}async createSubProcessManager(){const s=path_1.default.posix.join(__dirname,"./nativeEntryProcess.js");this.subProcessManager=new processManager_1.SubProcessProxy(this.project,s,{miniappDirPath:this.miniappDirPath,devtoolsVersion:this.devtoolsVersion},{},8892)}async runAndroid(s){const e=define_1.PLATFORM["mini-android"];return await this.subProcessManager.runTask("runNative",{targetPlatform:e,opts:s,fullEnv:global.fullEnv},this.onProgressUpdate)}async runIOS(s){const e=define_1.PLATFORM["mini-ios"];return await this.subProcessManager.runTask("runNative",{targetPlatform:e,opts:s,fullEnv:global.fullEnv},this.onProgressUpdate)}async buildAndroidAPK(s){const e=define_1.PLATFORM["mini-android"];return await this.subProcessManager.runTask("buildNative",{targetPlatform:e,opts:s,fullEnv:global.fullEnv},this.onProgressUpdate)}async buildIOSIPA(s){const e=define_1.PLATFORM["mini-ios"];return await this.subProcessManager.runTask("buildNative",{targetPlatform:e,opts:s,fullEnv:global.fullEnv},this.onProgressUpdate)}async codesignIpa(s){const e=define_1.PLATFORM["mini-ios"];return await this.subProcessManager.runTask("codesignIOSApp",{targetPlatform:e,opts:s,fullEnv:global.fullEnv},this.onProgressUpdate)}async buildAndroidPlugin(s){const e=define_1.PLATFORM["mini-android"];return await this.subProcessManager.runTask("buildNativePlugin",{targetPlatform:e,opts:s,fullEnv:global.fullEnv},this.onProgressUpdate)}async buildIOSPlugin(s){const e=define_1.PLATFORM["mini-ios"];return await this.subProcessManager.runTask("buildNativePlugin",{targetPlatform:e,opts:s,fullEnv:global.fullEnv},this.onProgressUpdate)}async packIOSCloudBuildMaterial(s){const e=define_1.PLATFORM["mini-ios"];return await this.subProcessManager.runTask("packIOSCloudBuildMaterial",{targetPlatform:e,opts:s,fullEnv:global.fullEnv},this.onProgressUpdate)}async initUSBConnectionProcess(){const s=define_1.PLATFORM["mini-ios"];return await this.subProcessManager.runTask("initUSBConnectionProcess",{targetPlatform:s,fullEnv:global.fullEnv},this.onProgressUpdate)}destroy(){this.subProcessManager.destroy()}}exports.NativeCompiler=NativeCompiler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.remoteBuildProjectMaterialAbsoluteCacheDir=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),path_1=tslib_1.__importDefault(require("path")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),glob_1=tslib_1.__importDefault(require("glob")),env_1=require("../../../utils/env"),miniapp_builder_1=require("../../../utils/miniapp-builder"),codesign_1=require("../../../utils/codesign"),miniappJson_1=require("../../../utils/miniappJson"),lodash_1=require("lodash"),tools_1=require("../../../utils/tools"),uuidv4=require("uuid/v4"),sizeOf=require("image-size"),plist=require("simple-plist"),errorIOSSdkVersions=["1.0.19"],APPEX_PROFILES_MAPS_FILE="__appexProfilesCacheDir__/profilesMap.json",APPEX_PROFILES_MAPS_FOR_SHELL_FILE="__appexProfilesCacheDir__/profilesMapForShell.txt",defaultIconDirPath=path_1.default.join(__dirname,"../../../static/images/"),getDepReg=e=>new RegExp(`s.subspec '${e}'.*\n(?:.*\n)*?(?:.*sp.vendored_frameworks = \\[\n)((?:.*'.*?'.*\n)*?)(?:.*\\]\n)`,"m"),allowTheme=["Light","LightSpecial","Dark","DarkSpecial","Default"];exports.remoteBuildProjectMaterialAbsoluteCacheDir="__absoluteFile";const iconInfoMap={appStore1024:{size:[1024,1024],scale:1,idiom:"ios-marketing",required:!0},appStore1024Other:{size:[1024,1024],scale:1,idiom:"ios-marketing-other"},mainIcon120:{size:[60,60],scale:2,idiom:"iphone",required:!0},mainIcon180:{size:[60,60],scale:3,idiom:"iphone"},spotlightIcon80:{size:[40,40],scale:2,idiom:"iphone"},spotlightIcon120:{size:[40,40],scale:3,idiom:"iphone"},settingsIcon58:{size:[29,29],scale:2,idiom:"iphone"},settingsIcon87:{size:[29,29],scale:3,idiom:"iphone"},notificationIcon40:{size:[20,20],scale:2,idiom:"iphone"},notificationIcon60:{size:[20,20],scale:3,idiom:"iphone"},ipadMainIcon152:{size:[76,76],scale:2,idiom:"ipad"},ipadMainIcon167:{size:[83.5,83.5],scale:2,idiom:"ipad"},ipadSpotlightIcon40:{size:[40,40],scale:1,idiom:"ipad"},ipadSpotlightIcon80:{size:[40,40],scale:2,idiom:"ipad"},ipadSettingsIcon29:{size:[29,29],scale:1,idiom:"ipad"},ipadSpotlightIcon58:{size:[29,29],scale:2,idiom:"ipad"},ipadNotificationIcon20:{size:[20,20],scale:1,idiom:"ipad"},ipadNotificationIcon40:{size:[20,20],scale:2,idiom:"ipad"}};class buildCloudManager{generateTempDemoIpaPath(e){const i=path_1.default.join(e,"../.."),t=path_1.default.basename(i),n=path_1.default.dirname(i),a=path_1.default.join(n,t+"-operateDir");fs_extra_1.default.existsSync(a)&&fs_extra_1.default.removeSync(a),fs_extra_1.default.ensureDirSync(a);const s=path_1.default.join(a,"Payload/demo.app");return fs_extra_1.default.copySync(e,s),s}generateInfoPlistCFBundleURLTypesItem(e){const i={};return e.CFBundleURLName&&(i.CFBundleURLName=e.CFBundleURLName),e.CFBundleURLSchemes&&(i.CFBundleURLSchemes=[e.CFBundleURLSchemes]),e.CFBundleTypeRole&&(i.CFBundleTypeRole=e.CFBundleTypeRole),i}updatePrivacyBackgroundImage(e,i,t,n,a){t.message("doing","updatePrivacyBackgroundImage "+n);if(fs_extra_1.default.readdirSync(i).forEach(e=>{"privacy_"+n===path_1.default.basename(e,path_1.default.extname(e))&&fs_extra_1.default.removeSync(path_1.default.join(i,e))}),!a)return;path_1.default.isAbsolute(a)||(a=path_1.default.join(e,a)),a=this.getMaterialFilePath(e,a);const s=path_1.default.extname(a),o=path_1.default.join(i,`privacy_${n}${s}`);try{fs_extra_1.default.copyFileSync(a,o)}catch(e){throw t.message("fail",`copy privacy image failed: ${n}, ${a} to ${o}`),e}}async updateIOSInfoPlistInfo(e,i,t,n,a,s){var o,l,r,d,p,u,c,f,_,h;a.progress("update app base info...");const{mobileapp_info:m={}}=i,g=m.mobileapp_id,y=path_1.default.join(t,"Info.plist"),I={},S=(e,i)=>{var t,n;if((null==i?void 0:i.startsWith("%"))&&(null==i?void 0:i.endsWith("%"))){const o=i.slice(1,-1);I[e]=o;const l=(null===(n=null===(t=null==s?void 0:s.base)||void 0===t?void 0:t.ios)||void 0===n?void 0:n[o])||"";return l||a.message("fail",`未在国际化配置 base.json 中找到字段 ${o},请检查`),l}return i};S("UISplashScreenImageName",null===(o=null==n?void 0:n.splashscreen)||void 0===o?void 0:o.customImage),S("UILaunchStoryboardName",null===(l=null==n?void 0:n.splashscreen)||void 0===l?void 0:l.customImage);const x=plist.readFileSync(y);if(x.CFBundleName=S("CFBundleName",n.name),x.CFBundleDisplayName=S("CFBundleDisplayName",n.name),x.CFBundleShortVersionString=n.version,"number"==typeof n.versionCode?x.CFBundleVersion=parseInt(n.versionCode.toString(),10).toString():x.CFBundleVersion=(parseInt(x.CFBundleVersion,10)+1).toString(),x.CFBundleIdentifier=this.getBundleIdentifier(m),Array.isArray(null==n?void 0:n.openMimeTypes)&&this.validateCFBundleDocumentTypes(n.openMimeTypes,a)&&(x.CFBundleDocumentTypes=n.openMimeTypes,a.message("doing","openMimeTypes 应用成功")),Array.isArray(x.CFBundleURLTypes)||(x.CFBundleURLTypes=[]),(null===(d=null===(r=x.CFBundleURLTypes)||void 0===r?void 0:r[0])||void 0===d?void 0:d.CFBundleURLSchemes)&&(x.CFBundleURLTypes[0].CFBundleURLSchemes=[g]),x.CFBundleURLTypes[0]&&(x.CFBundleURLTypes=[x.CFBundleURLTypes[0]]),Object.keys(miniappJson_1.iosPrivacyDescObj).forEach(e=>{var i,t;(null===(i=null==n?void 0:n.privateDescriptions)||void 0===i?void 0:i[e])?x[e]=S(e,null===(t=n.privateDescriptions)||void 0===t?void 0:t[e]):delete x[e]}),!0===(null===(p=null==n?void 0:n.infoPlist)||void 0===p?void 0:p.DisableAppUsesNonExemptEncryption)?x.ITSAppUsesNonExemptEncryption=!1:delete x.ITSAppUsesNonExemptEncryption,x.UIBackgroundModes=[],!0===(null===(u=null==n?void 0:n.infoPlist)||void 0===u?void 0:u.AudioInBackgroundMode)&&x.UIBackgroundModes.push("audio"),!0===(null===(c=null==n?void 0:n.infoPlist)||void 0===c?void 0:c.LocationInBackgroundMode)&&x.UIBackgroundModes.push("location"),!0===(null===(f=null==n?void 0:n.infoPlist)||void 0===f?void 0:f.requiresFullScreen)?x.UIRequiresFullScreen=!0:delete x.UIRequiresFullScreen,"object"==typeof(null===(_=null==n?void 0:n.infoPlist)||void 0===_?void 0:_.CFBundleURLTypes)){const e=this.generateInfoPlistCFBundleURLTypesItem(n.infoPlist.CFBundleURLTypes);x.CFBundleURLTypes.push(e);const{additionalCFBundleURLTypes:i}=n.infoPlist.CFBundleURLTypes;Array.isArray(i)&&i.forEach(e=>{if("object"==typeof e){const i=this.generateInfoPlistCFBundleURLTypesItem(e);x.CFBundleURLTypes.push(i)}})}if(!0===n.enableIpad&&((0,miniappJson_1.iOSAppJsonIsUsingIPadResizable)(e)?(x["UISupportedInterfaceOrientations~ipad"]=["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpsideDown","UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLandscapeRight"],a.progress("ipad is support Landscape")):(x["UISupportedInterfaceOrientations~ipad"]=["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpsideDown"],a.progress("ipad is not support Landscape"))),null===(h=n.infoPlist)||void 0===h?void 0:h.LSApplicationQueriesSchemes){const e=n.infoPlist.LSApplicationQueriesSchemes.split(",");e.length&&x.LSApplicationQueriesSchemes.push(...e.filter(e=>e))}return plist.writeFileSync(y,x),await this.writeI18NInfoFile(t,s,I),x.CFBundleVersion}getBundleIdentifier(e){return e.ios_flag&&e.bundle_id||e.debug_ios_bundle_id}validateCFBundleDocumentTypes(e,i){const t=["Owner","Default"," Alternate","None"],n=["Editor","Viewer"," Shell","None"],a=new Set;for(const s of e){if(a.has(s.CFBundleTypeName))return i.message("fail","openMimeTypes 应用失败,存在重复定义的 CFBundleTypeName: "+s.CFBundleTypeName),!1;if(a.add(s.CFBundleTypeName),!t.includes(s.LSHandlerRank))return i.message("fail","openMimeTypes 应用失败,存在不合法的 LSHandlerRank: "+s.LSHandlerRank),!1;if(!n.includes(s.CFBundleTypeRole))return i.message("fail","openMimeTypes 应用失败,存在不合法的 CFBundleTypeRole: "+s.CFBundleTypeRole),!1;if(!Array.isArray(s.LSItemContentTypes))return i.message("fail","openMimeTypes 应用失败,LSItemContentTypes 类型不合法"),!1}return!0}useGDT(e){return(0,miniappJson_1.iOSMiniAppJsonIsUsingGDT)(e)}async updateIOSAppConfigPlistInfo(e,i,t,n,a,s,o,l="Dark",r){var d,p,u,c;o.progress("update app module info...");const{module_info:f={},cpa_info:_={},cpa_package_info:h={enable_remove_watermark:!1}}=i;if(!_.sdk_key||!_.sdk_key_secret)throw new Error("sdkKey and sdkSecret not found");const m=path_1.default.join(t,"MiniApp.bundle"),g=path_1.default.join(m,"AppConfig.plist"),y=plist.readFileSync(g);h.enable_remove_watermark?y.enableRemoveWatermark=!0:y.splashscreenTheme=l,y.miniModuleId=f.module_id,y.sdkKey=_.sdk_key,y.sdkSecret=_.sdk_key_secret;const{privacy:I={}}=n;y.privacy||(y.privacy={}),y.privacy.enable=!!I.enable;const S=path_1.default.posix.join(m,"configs/privacy.json"),{contentViewImage:x,cancelButtonImage:v,confirmButtonImage:b,template:F}=I;if(I.enable){let i=F||"";if(fs_extra_1.default.ensureDirSync(path_1.default.posix.join(m,"configs")),i.startsWith("%")&&i.endsWith("%")){const t=F.slice(1,-1);i=(null===(p=null===(d=null==r?void 0:r.base)||void 0===d?void 0:d.ios)||void 0===p?void 0:p[t])||"",i||o.message("fail",`未在国际化配置 base.json 中找到字段 ${t},请检查`),Object.keys(r).forEach(i=>{var n,a;if("base"===i)return;let s=null===(a=null===(n=r[i])||void 0===n?void 0:n.ios)||void 0===a?void 0:a[t];if(s){s=this.getMaterialFilePath(e,s);const t=`configs/privacy-${i}.json`,n=path_1.default.posix.join(m,t);fs_extra_1.default.existsSync(s)?fs_extra_1.default.copyFileSync(s,n):o.message("fail",`未找到隐私协议在国际化配置 ${i}.json 中配置的文件 ${s},请检查`)}})}i?(i=this.getMaterialFilePath(e,i),fs_extra_1.default.existsSync(i)?(fs_extra_1.default.copyFileSync(i,S),y.privacy.template="configs/privacy.json"):(o.message("fail",`未找到隐私协议中配置的文件 ${i},请检查`),y.privacy.template="configs/defaultPrivacy.json")):y.privacy.template="configs/defaultPrivacy.json",!0===I.enableNativePlugin&&"string"==typeof I.nativePluginId&&I.nativePluginId.length>2&&(y.privacy.plugin={pluginId:I.nativePluginId,enable:!0})}else y.privacy.template="",fs_extra_1.default.removeSync(S);this.updatePrivacyBackgroundImage(e,t,o,"contentViewImage",x),this.updatePrivacyBackgroundImage(e,t,o,"confirmButtonImage",b),this.updatePrivacyBackgroundImage(e,t,o,"cancelButtonImage",v);const{appMenuEnable:P=!0}=n;y.appMenuEnable=P;const{enableVConsole:B="undefined"}=n;y.enableVConsole=B;const{tpush:j}=n;let C=!1;if("object"==typeof j){const e=path_1.default.posix.join(t,"PlugIns/TPNSService.appex"),i=path_1.default.posix.join(e,"AppConfig.plist");if(this.useTpush(n)){y.TPNSAccessID=j.accessID,y.TPNSAccessKey=j.accessKey,j.clusterDomainName?y.clusterDomainName=j.clusterDomainName:delete y.clusterDomainName;const t=s?"x86_64":"arm64",n=path_1.default.join(a,`appex/${t}/TPNSService.appex`);if(!fs_extra_1.default.existsSync(n))throw new Error("can not found extendsdk: "+n);try{fs_extra_1.default.copySync(n,e),plist.writeFileSync(i,y),C=!0}catch(e){throw new Error("copy TPNSService.appex to app failed: "+e)}}}if(!C)try{const e=path_1.default.posix.join(t,"PlugIns");fs_extra_1.default.existsSync(e)?(fs_extra_1.default.removeSync(e),o.progress("removed PlugIns folder...")):o.progress("no PlugIns folder...")}catch(e){throw new Error("remove TPNSService.appex from app failed: "+e)}if(null===(u=n.useExtendedSdk)||void 0===u?void 0:u.WeAppLBS){if(!n.qmapAPIKey)throw new Error("You need to provide the Tencent Location Service API Key when using LBS SDK.");y.qmapAPIKey=n.qmapAPIKey}const{gdt:w}=n,L=this.useGDT(n);if(y.GDTAd=L?{appid:w.appid,enable:!0,SplashAd:{placementId:w.splashAd_placementId,fetchDelay:w.splashAd_fetchDelay||3,defaultEnable:null===(c=w.splashAd_defaultEnable)||void 0===c||c}}:{appid:"",enable:!1,SplashAd:{placementId:"",fetchDelay:3}},n["mini-plugin"]&&Array.isArray(n["mini-plugin"].ios)){const e=n["mini-plugin"].ios.filter(e=>!!(e.open&&e.pluginId&&e.loadWhenStart)).map(e=>e.pluginId);y.plugins={loadWhenStart:e}}const{enableDebugLog:D=!1}=n;y.enableDebugLog=D;const{debugLogSizeLimit:$=10}=n;isNaN(Number($))?o.message("fail",`ios debugLogSizeLimit ${$} is NaN`):y.debugLogSizeLimit=Number($);const{enableOpenUrlNavigate:A=!1}=n;y.enableOpenUrlNavigate=A,plist.writeFileSync(g,y)}async updateIOSAppexInfoPlistInfo(e,i,t,n,a){if(this.useTpush(t)){a.progress("update appex for notification base info...");const{mobileapp_info:s={}}=e,o=path_1.default.join(i,"PlugIns/TPNSService.appex"),l=path_1.default.join(o,"Info.plist"),r=plist.readFileSync(l);r.CFBundleShortVersionString=t.version,a.progress("update appex for CFBundleVersion: "+n),r.CFBundleVersion=n;const d=s.ios_flag&&s.bundle_id||s.debug_ios_bundle_id;r.CFBundleIdentifier=t.tpush.serviceBundleId||d+".service",a.progress("update appex bundle identifier for infoPlist : "+r.CFBundleIdentifier),plist.writeFileSync(l,r)}else a.progress("not using tpush...")}updateBundleIcons(e,i,t,n,a){const s=[],o=[],l=[];for(const r in t){if(!t[r])continue;const d=this.getMaterialFilePath(e,t[r]);if(!d)return void a.message("fail","getMatrialFailed: "+t[r]);const p=iconInfoMap[r];try{const e=sizeOf(d),i=p.size[0]*p.scale,n=p.size[1]*p.scale;if(e.width!==i||e.height!==n){a.progress(`check ${r} size failed, require [${i}, ${n}] but [${e.width}, ${e.height}] ingore ${t[r]} `);continue}}catch(e){a.progress(`get ${r} info failed, ingore ${t[r]}(e: ${e.message})`);continue}const u=path_1.default.extname(d),c=1===p.scale?"":`@${p.scale}x`,f=`${p.size[0]}x${p.size[1]}`,_=r.startsWith("ipad"),h="appStore1024"===r||"appStore1024Other"===r,m="appStore1024Other"===r?n+"Other":n,g=path_1.default.join(i,`${m}${f}${c}${_?"~ipad":""}${u}`),y={from:d,to:g,filename:path_1.default.basename(g),size:f,scale:p.scale+"x",idiom:p.idiom,key:r};s.push(y),h||(_?l.includes(`${m}${f}`)||l.push(`${m}${f}${c}`):o.includes(`${m}${f}`)||o.push(`${m}${f}${c}`))}return{iphoneBundleIconFiles:o,ipadBundleIconFiles:l,addFiles:s}}async updateIOSIcons(e,i,t,n,a,s){s.progress("update app icons...");const{icons:o={}}=n,l=a&&!env_1.isWin&&!!t;s.progress("genAssetCar: "+l);const r=glob_1.default.sync("AppIcon*.+(png|jpg|jpeg|webp)",{nodir:!0,cwd:i}).map(e=>path_1.default.join(i,e)),d="AppIcon-"+uuidv4().slice(0,8),p=this.updateBundleIcons(e,i,o,d,s);if(!p)throw new Error("updateBundleIcons failed");const{iphoneBundleIconFiles:u=[],ipadBundleIconFiles:c=[],addFiles:f=[]}=p,_={};for(const e in iconInfoMap){if(!iconInfoMap[e].required||o[e])continue;const i=iconInfoMap[e].size[0]*iconInfoMap[e].scale,t=iconInfoMap[e].size[1]*iconInfoMap[e].scale;if(_[e]=path_1.default.join(defaultIconDirPath,`donut-icon${i}x${t}.png`),s.progress(`using default app icons when ${e} is not config...`),!fs_extra_1.default.existsSync(_[e]))throw new Error(`required ${e} but not default or set`)}const h=this.updateBundleIcons(e,i,_,d,s);if(!h)throw new Error("updateBundleIcons WithDefaultIcon failed");const{iphoneBundleIconFiles:m,ipadBundleIconFiles:g,addFiles:y}=h;if(u.push(...m),c.push(...g),f.push(...y),!u.length&&!c.length)return;r.forEach(e=>{fs_extra_1.default.existsSync(e)&&fs_extra_1.default.removeSync(e)});const I=path_1.default.join(t,"__assetCarOperateDir/assetsCar/"),S=path_1.default.join(I,`Assets.xcassets/${d}.appiconset/`);l&&(fs_extra_1.default.ensureDirSync(S),fs_extra_1.default.emptyDirSync(S));const x=[];let v=!1;if(f.forEach(e=>{fs_extra_1.default.existsSync(e.to)&&fs_extra_1.default.removeSync(e.to),fs_extra_1.default.copyFileSync(e.from,e.to),l&&(fs_extra_1.default.copySync(e.from,path_1.default.join(S,e.filename)),console.log("看看啊",path_1.default.join(S,e.filename)),"ios-marketing-other"===e.idiom&&(v=!0),x.push({filename:e.filename,size:e.size,scale:e.scale,idiom:e.idiom}))}),l&&fs_extra_1.default.writeJsonSync(path_1.default.join(S,"Contents.json"),{images:x,info:{author:"xcode",version:1}},{spaces:"\t"}),l){const e=path_1.default.join(__dirname,"../../../static/scripts/assetsCar/"),t=path_1.default.join(I,"createAssetsCar");fs_extra_1.default.copySync(e,I);try{await(0,codesign_1.checkXcodeEnv)(s),child_process.execSync(`"${t}" ${d}`,{env:(0,env_1.getProcessEnv)()})}catch(e){s.progress("createAssetsCar failed "+(e.message||""))}const n=path_1.default.join(I,"build/Assets.car"),a=path_1.default.join(i,"Assets.car");fs_extra_1.default.copyFileSync(n,a)}else{const e=path_1.default.join(i,"Assets.car");fs_extra_1.default.removeSync(e)}const b=path_1.default.join(i,"Info.plist"),F=plist.readFileSync(b);if(!F.CFBundleIcons){const e={CFBundlePrimaryIcon:{}};F.CFBundleIcons=e}v&&(F.CFBundleIcons.CFBundleAlternateIcons={OtherAppStoreIcon:{CFBundleIconFiles:[d+"Other"],CFBundleIconName:"OtherAppStoreIcon"}}),F.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconName=d,F.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles=u,F["CFBundleIcons~ipad"]||(F["CFBundleIcons~ipad"]={CFBundlePrimaryIcon:{}}),F["CFBundleIcons~ipad"].CFBundlePrimaryIcon.CFBundleIconName=d,F["CFBundleIcons~ipad"].CFBundlePrimaryIcon.CFBundleIconFiles=c,F.NSAppTransportSecurity={NSAllowsArbitraryLoads:!0},plist.writeFileSync(b,F)}replaceLaunchScreenImage(e,i,t,n,a,s){const o=path_1.default.join(e,"01J-lp-oVM-view-Ze5-6b-2t3.nib");let l=fs_extra_1.default.readFileSync(o).toString("hex");if(!i.endsWith(".png"))return void n.message("fail","IOS 启动页图片配置格式错误,必须为 PNG 格式, 错误配置:"+i);const r=this.getMaterialFilePath(a,i),d=t+".png",p="LaunchScreen-"+uuidv4().slice(0,12),u=p+".png",c=path_1.default.join(s,u);fs_extra_1.default.copyFileSync(r,c);const f=Buffer.from(d,"utf-8").toString("hex"),_=Buffer.from(u,"utf-8").toString("hex");return-1!==l.indexOf(f)?(l=l.replace(f,_),console.log("replace storyboard customImage success")):console.log("replace storyboard customImage fail"),fs_extra_1.default.writeFileSync(o,Buffer.from(l,"hex")),p}async updateSplashScreen(e,i,t,n,a="Dark",s){var o,l,r;let d;n.progress("update splashscreen image..."),allowTheme.includes(a)&&(d=path_1.default.join(i,`/Base.lproj/LaunchScreen${a}.storyboardc`)),d&&fs_extra_1.default.existsSync(d)&&fs_extra_1.default.copySync(d,path_1.default.join(i,"/Base.lproj/LaunchScreen.storyboardc")),allowTheme.forEach(e=>{const t=path_1.default.join(i,`/Base.lproj/LaunchScreen${e}.storyboardc`);fs_extra_1.default.existsSync(t)&&fs_extra_1.default.removeSync(t)});let p=null===(o=null==t?void 0:t.splashscreen)||void 0===o?void 0:o.customImage;if(!p)return;const u=path_1.default.join(i,"Info.plist"),c=plist.readFileSync(u),f=c.UISplashScreenImageName;if(glob_1.default.sync("LaunchScreen-*.+(png|jpg|jpeg|webp)",{nodir:!0,cwd:i}).forEach(e=>{const t=path_1.default.join(i,e);fs_extra_1.default.removeSync(t)}),p.startsWith("%")&&(null==p?void 0:p.endsWith("%"))){const t=p.slice(1,-1),a=(null===(r=null===(l=null==s?void 0:s.base)||void 0===l?void 0:l.ios)||void 0===r?void 0:r[t])||"";if(!a)return void n.message("fail",`未在国际化配置 base.json 中找到字段 ${t},请检查,启动页国际化配置失败`);p=a,Object.keys(s).forEach(a=>{var o,l;if("base"===a)return;const r=null===(l=null===(o=s[a])||void 0===o?void 0:o.ios)||void 0===l?void 0:l[t];if(r){const t=path_1.default.join(i,`/${a}.lproj/LaunchScreen_${a}.storyboardc`);fs_extra_1.default.ensureDirSync(path_1.default.join(t,"..")),fs_extra_1.default.copySync(path_1.default.join(i,"/Base.lproj/LaunchScreen.storyboardc"),t);const s=this.replaceLaunchScreenImage(t,this.getMaterialFilePath(e,r),f,n,e,i);n.progress(`update ${a} splashscreen image...`);const o=fs_extra_1.default.readFileSync(path_1.default.join(i,a+".lproj/InfoPlist.strings"),"utf8");let l="";l=s?o.replace("__UISplashScreenImageName__",`UISplashScreenImageName = "${s}";\n`).replace("__UILaunchStoryboardName__",`UILaunchStoryboardName = "LaunchScreen_${a}";\n`):o.replace("__UISplashScreenImageName__","").replace("__UILaunchStoryboardName__",""),fs_extra_1.default.writeFileSync(path_1.default.join(i,a+".lproj/InfoPlist.strings"),l),n.progress(`update ${a} splashscreen image success`)}})}n.progress("update base splashscreen image...");const _=this.replaceLaunchScreenImage(path_1.default.join(i,"/Base.lproj/LaunchScreen.storyboardc"),this.getMaterialFilePath(e,p),f,n,e,i);n.progress("update base splashscreen image success"),_&&(c.UISplashScreenImageName=_,c.UILaunchStoryboardName="LaunchScreen",plist.writeFileSync(u,c))}genUseExtendedSdk(e,i){const t=Object.assign({},e.useExtendedSdk||{});for(const i in e)if("object"==typeof e[i])for(const n in e[i])if(n.startsWith("useExtendedLib_WeApp")&&!0===e[i][n]){t[n.slice("useExtendedLib_".length)]=!0}return!t.WeAppLBS||t.WeAppOpenFuns||t.WeAppOpenFuns_HasPay||(t.WeAppOpenFuns=!0),"RemoteDebug"===(null==i?void 0:i.debugType)&&(t.WeAppUSB=!0),t}async updateExtendedSdk(e,i,t,n,a,s,o){const l=path_1.default.join(i,"Frameworks");fs_extra_1.default.ensureDirSync(l),o.progress("update extendsdk...");const r=path_1.default.join(t,"WeAppSDK.podspec"),d=fs_extra_1.default.readFileSync(r,"utf-8"),p=this.genUseExtendedSdk(a,s);o.progress("useExtendedSdks: "+JSON.stringify(p));const{mobileapp_info:u={}}=e,c=this.getBundleIdentifier(u);if(p.WeAppOpenFuns&&p.WeAppOpenFuns_HasPay)throw new Error("OpenFuncs SDK 只可勾选使用一个,请按需勾选使用");const f={};for(const e in p){if(!p[e])continue;const i=getDepReg(e),a=d.match(i);if(!(null==a?void 0:a[1]))throw new Error(`拓展模块 ${e} 不存在或已被移除,请检查 project.miniapp.json -> 对应平台 -> useExtendedSdk 删除配置 ${e},版本配置差异请参考更新日志或 https://dev.weixin.qq.com/docs/framework/dev/sdk/difflog.html`);const s=[];if(a[1].split("\n").forEach(e=>{const i=e.match(/.*'(.*?)',/);if(null==i?void 0:i[1]){const e=i[1].split("/").pop(),a=path_1.default.join(t,"Libs",n,e);if(!fs_extra_1.default.existsSync(a))throw new Error(`拓展模块 ${e} 不存在或已被移除,请检查 project.miniapp.json -> 对应平台 -> useExtendedSdk 删除配置 ${e},版本配置差异请参考更新日志或 https://dev.weixin.qq.com/docs/framework/dev/sdk/difflog.html`);const o=path_1.default.join(l,e);fs_extra_1.default.copySync(a,o),s.push(path_1.default.basename(e));const r=path_1.default.join(o,"info.plist");if(!fs_extra_1.default.existsSync(r))throw new Error("can not found extendsdk info.plist: "+e);this.changeExtendSDKInfoplistBundleId(r,c,e)}}),s.length){f[s.shift()]=s}}const _=path_1.default.join(i,"DyFrameworks.plist");fs_extra_1.default.existsSync(_)&&fs_extra_1.default.removeSync(_),plist.writeFileSync(_,f)}async updatePrivacyInfo(e,i,t){var n;const a=null===(n=null==i?void 0:i.privacy)||void 0===n?void 0:n.privacyInfo;a&&(a.endsWith("PrivacyInfo.xcprivacy")?fs_extra_1.default.existsSync(a)?(fs_extra_1.default.copySync(a,path_1.default.join(e,"/PrivacyInfo.xcprivacy")),t.progress("隐私清单文件替换成功")):t.message("fail","隐私清单文件替换失败,文件不存在,将使用默认文件"):t.message("fail","隐私清单文件替换失败,文件名必须为 PrivacyInfo.xcprivacy,将使用默认文件"))}async updatePlugin(e,i,t,n,a,s,o,l){if(!i.length)return;const r=path_1.default.join(e,"Frameworks"),d=path_1.default.join(e,"PlugIns");fs_extra_1.default.ensureDirSync(r),l.progress("update plugin...");const p=this.prepareAppexProfileConfig(i,n,t,a,s,o,n.version,l);if(!p)throw new Error("依赖的多端插件需要配置对应的profile");const u={};if(n["mini-plugin"]&&Array.isArray(n["mini-plugin"].ios)){n["mini-plugin"].ios.forEach(e=>{e.open&&e.pluginId&&"string"==typeof e.resourcePath&&e.resourcePath.length>0&&(u[e.pluginId]=e.resourcePath)})}i.forEach(i=>{const{pluginId:n}=i,a=i.dir,s=n+".framework",o=path_1.default.join(r,s);if(-1!==a.indexOf("local-miniapp-plugin")){const e=fs_extra_1.default.statSync(a),{mtime:i}=e;l.progress(`${n}.framework 正在使用本地版本,修改时间为 ${i}`)}fs_extra_1.default.existsSync(o)&&fs_extra_1.default.removeSync(o);const c=path_1.default.join(a,s);if(fs_extra_1.default.existsSync(c)){fs_extra_1.default.copySync(c,o),this.copyResourcesToMainBundle(c,e),this.copyUserResourcePathIntoPlugins(n,t,u[n],path_1.default.join(o,"MiniPlugin.bundle"),l);fs_extra_1.default.readdirSync(a).forEach(i=>{if(i.endsWith(".appex")){const s=path_1.default.parse(i).name,o=p[s],r=path_1.default.join(d,i);if(!o||!0!==o.enable)return;l.progress(`${n} 插件使用 appex 中 : ${i}`),fs_extra_1.default.existsSync(r)&&fs_extra_1.default.removeSync(r),fs_extra_1.default.ensureDirSync(r);const c=path_1.default.join(a,i);fs_extra_1.default.copySync(c,r),(null==o?void 0:o.profilePath)&&fs_extra_1.default.copySync(o.profilePath,path_1.default.join(r,"embedded.mobileprovision")),this.copyResourcesToMainBundle(c,e),this.copyUserResourcePathIntoPlugins(n,t,u[n],path_1.default.join(r,"MiniPlugin.bundle"),l)}else if(i.endsWith("framework")&&i!==s){const e=path_1.default.join(r,i),t=path_1.default.join(a,i);fs_extra_1.default.existsSync(e)&&fs_extra_1.default.removeSync(e),fs_extra_1.default.copySync(t,e)}})}else fs_extra_1.default.copySync(a,o),this.copyResourcesToMainBundle(a,e),this.copyUserResourcePathIntoPlugins(n,t,u[n],path_1.default.join(o,"MiniPlugin.bundle"),l)})}copyUserResourcePathIntoPlugins(e,i,t,n,a){const s=n;if(t){const n=path_1.default.basename(t),o=this.getMaterialFilePath(i,t);if(o){a.progress(`${e}.framework 正在拷贝配置的资源:${t}`);const i=fs_extra_1.default.lstatSync(o);fs_extra_1.default.ensureDirSync(s),i.isDirectory()?fs_extra_1.default.copySync(o,s):i.isFile()&&fs_extra_1.default.copyFileSync(o,path_1.default.join(s,n))}}}copyResourcesToMainBundle(e,i){const t=path_1.default.join(e,"MiniPlugin.bundle"),n=path_1.default.join(t,"PluginConfig.plist");if(fs_extra_1.default.existsSync(n)){const e=plist.readFileSync(n).CopyResourcesToMainBundle;(null==e?void 0:e.length)&&e.forEach(e=>{const n=path_1.default.join(t,e);fs_extra_1.default.existsSync(n)&&fs_extra_1.default.copySync(n,path_1.default.join(i,e))})}}prepareAppexProfileConfig(e,i,t,n,a,s,o,l){if(!n)return void l.message("doing","miniappCacheDirPath is missing");let r=!1;const d={};if(i["mini-plugin"]&&Array.isArray(i["mini-plugin"].ios)){i["mini-plugin"].ios.forEach(e=>{if(e.open&&e.pluginId&&"object"==typeof e.appexProfiles)for(const i in e.appexProfiles){l.message("doing",`检查插件 ${e.pluginId} ${i} appex 配置中 ...`);const n=e.appexProfiles[i];if(!0===n.enable){const s=`${e.pluginId}_${i}`;d[s]={enable:!0};let o=n.profilePath;if(a&&(o=n.distributeProfilePath),n.bundleID&&o){const a=path_1.default.join(t,o);fs_extra_1.default.existsSync(a)?(d[s].bundleID=n.bundleID,d[s].profilePath=path_1.default.join(t,o)):(r=!0,l.message("fail",`${e.pluginId} 中 ${i} 的 profilePath 无法找到对应的文件:${a}(需要在小程序项目路径下,填入相对于项目根目录的路径)`))}else r=!0,l.message("fail",`${e.pluginId}中${i} 是 无效的appexProfiles配置。需要配置 bundleID,profilePath,distributeProfilePath。profile 文件需要放置在小程序项目内,然后配置相对于小程序项目根目录的相对路径。分发证书构建的情况下, 一定需要配置distributeProfilePath。查看文档了解详情。`)}}})}if(e.forEach(e=>{fs_extra_1.default.readdirSync(e.dir).forEach(i=>{if(i.endsWith(".appex")){const t=path_1.default.parse(i).name,n=d[t];if(n&&!0===n.enable)if(n.bundleID&&n.profilePath){if(n.bundleID&&n.profilePath){const t=path_1.default.join(e.dir,i,"info.plist"),a=n.bundleID;this.changeInfoplistBundleId(t,a),this.changeInfoplistBundleVersion(t,s,o),l.message("doing",`${e.pluginId} ${i} ${a} ${t} 处理 appex bundle ID 中`)}}else r=!0,l.message("fail",`${e.pluginId} 的 多端插件包含了${t.slice(e.pluginId.length+1)} 的 appex。开发者需要在project.miniapp.json 中 mini-plugin 配置下对应合理的 profile 文件。查看文档了解详情。`)}})}),r)return!1;if(!(0,lodash_1.isEmpty)(d)){const e=path_1.default.join(n,APPEX_PROFILES_MAPS_FILE);fs_extra_1.default.existsSync(e)&&fs_extra_1.default.removeSync(e),fs_extra_1.default.ensureFileSync(e);const i={};for(const e in d)i[e]={bundleID:d[e].bundleID,profilePath:d[e].profilePath};fs_extra_1.default.writeFileSync(e,JSON.stringify(i));const t=path_1.default.join(n,APPEX_PROFILES_MAPS_FOR_SHELL_FILE);fs_extra_1.default.existsSync(t)&&fs_extra_1.default.removeSync(t),fs_extra_1.default.ensureFileSync(t);const a=Object.keys(d).map(e=>{const i=d[e];return`pluginAppexName:${e};_;_;bundleID:${i.bundleID};_;_;profile:${i.profilePath}\n\n`}).join("");fs_extra_1.default.writeFileSync(t,a)}return d}changeExtendSDKInfoplistBundleId(e,i,t){const n=`${i}.${path_1.default.parse(t).name.replace(/_/g,"")}`;return this.changeInfoplistBundleId(e,n)}changeInfoplistBundleId(e,i){const t=plist.readFileSync(e);return t.CFBundleIdentifier=i,plist.writeFileSync(e,t),t.CFBundleIdentifier}changeInfoplistBundleVersion(e,i,t){const n=plist.readFileSync(e);return n.CFBundleVersion=i,n.CFBundleShortVersionString=t,plist.writeFileSync(e,n),n.CFBundleIdentifier}async getEntitlements(e,i,t,n){const{mobileapp_info:a={}}=e;let s=a.ios_universal_link||a.debug_ios_universal_link;return(s.startsWith("https://")||s.startsWith("http://"))&&(s=s.replace(/^http(s)?:\/\//g,"applinks:")),{"com.apple.developer.associated-domains":s}}useTpush(e){return(0,miniappJson_1.iOSMiniAppJsonIsUsingTpush)(e)}async buildCloud(e,i){const{projectPath:t,demoIpaPath:n,sdkPath:a,arch:s="arm64",bindingInfo:o,certificateInfo:l,output:r,miniappCacheDirPath:d,pluginDirList:p,inLandun:u,theme:c,i18nInfo:f,debugInfo:_}=e,h=this.generateTempDemoIpaPath(n),{selfCertificate:m={}}=l,g=(null==m?void 0:m.isPublish)||!1,y=(0,miniappJson_1.tryGetIOSMiniappJson)(t),I=this.useTpush(y);if((0,lodash_1.isEmpty)(y))throw new Error("获取project.miniapp.json失败");if(errorIOSSdkVersions.includes(y.sdkVersion))throw new Error("当前 mini-ios.sdkVersion 存在缺陷,请参考更新日志进行修改");let S=o;if(l.signType===miniapp_builder_1.miniappSinTypes.appleId.type){const{mobileapp_info:e={}}=S;S=Object.assign(Object.assign({},S),{mobileapp_info:Object.assign(Object.assign({},e),{bundle_id:miniapp_builder_1.DEFAULT_BUNDLE_ID,debug_ios_bundle_id:miniapp_builder_1.DEFAULT_BUNDLE_ID})})}const x=await this.updateIOSInfoPlistInfo(t,S,h,y,i,f);await this.updateIOSAppConfigPlistInfo(t,S,h,y,a,!1,i,c,f),await this.updateIOSAppexInfoPlistInfo(S,h,y,x,i),await this.updateIOSIcons(t,h,d,y,g,i),await this.updateSplashScreen(t,h,y,i,c,f),await this.updateExtendedSdk(S,h,a,s,y,_,i),await this.updatePlugin(h,p,t,y,d,g,x,i),await this.updatePrivacyInfo(h,y,i);const v=await this.getEntitlements(S,h,y,i),{mobileapp_info:b={}}=S;let F;F=l.signType===miniapp_builder_1.miniappSinTypes.appleId.type?miniapp_builder_1.DEFAULT_BUNDLE_ID:b.ios_flag&&b.bundle_id||b.debug_ios_bundle_id;const P={bundleId:F,output:r,entitlements:v};if(y.buildCloud&&(y.buildCloud.certificate&&"string"==typeof y.buildCloud.certificate&&(P.certificate=y.buildCloud.certificate),y.buildCloud.profile&&"string"==typeof y.buildCloud.profile&&(P.profile=path_1.default.join(t,y.buildCloud.profile)),I&&y.buildCloud.tpnsProfile&&"string"==typeof y.buildCloud.tpnsProfile&&(P.tpnsProfile=path_1.default.join(t,y.buildCloud.tpnsProfile))),m.isPublish){const e=await(0,codesign_1.codesignAndExport)(t,h,d||"",P,i,I,!0===u);if(!0!==e.success)throw new Error("Build ipa failed:"+(e.errMsg||"codesignAndExport failed"))}return{projectPath:t,demoIpaPath:h,opts:P,iosMiniappJson:y,isPublish:g}}async writeI18NInfoFile(e,i,t){Object.keys(i).forEach(n=>{if("base"===n)return;let a="";Object.keys(t).forEach(e=>{var s,o,l,r;"UISplashScreenImageName"!==e?"UILaunchStoryboardName"!==e?(null===(o=null===(s=i[n])||void 0===s?void 0:s.ios)||void 0===o?void 0:o[t[e]])&&(a+=`${e} = "${null===(r=null===(l=i[n])||void 0===l?void 0:l.ios)||void 0===r?void 0:r[t[e]]}";\n`):a+="__UILaunchStoryboardName__\n":a+="__UISplashScreenImageName__\n"}),a&&(fs_extra_1.default.ensureDirSync(path_1.default.join(e,n+".lproj")),fs_extra_1.default.writeFileSync(path_1.default.join(e,n+".lproj/InfoPlist.strings"),a))})}getMaterialFilePath(e,i){if(!i)return"";let t=i;if(path_1.default.isAbsolute(i)||(t=path_1.default.join(e,i)),fs_extra_1.default.existsSync(t))return t;const n=(0,tools_1.generateMD5)(i),a=path_1.default.basename(i),s=path_1.default.join(e,exports.remoteBuildProjectMaterialAbsoluteCacheDir,`${n}_${a}`);return fs_extra_1.default.existsSync(s)?s:""}}exports.default=new buildCloudManager;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.remoteBuildProjectMaterialAbsoluteCacheDir=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),path_1=tslib_1.__importDefault(require("path")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),glob_1=tslib_1.__importDefault(require("glob")),env_1=require("../../../utils/env"),miniapp_builder_1=require("../../../utils/miniapp-builder"),codesign_1=require("../../../utils/codesign"),miniappJson_1=require("../../../utils/miniappJson"),lodash_1=require("lodash"),tools_1=require("../../../utils/tools"),uuidv4=require("uuid/v4"),sizeOf=require("image-size"),plist=require("simple-plist"),errorIOSSdkVersions=["1.0.19"],APPEX_PROFILES_MAPS_FILE="__appexProfilesCacheDir__/profilesMap.json",APPEX_PROFILES_MAPS_FOR_SHELL_FILE="__appexProfilesCacheDir__/profilesMapForShell.txt",defaultIconDirPath=path_1.default.join(__dirname,"../../../static/images/"),getDepReg=e=>new RegExp(`s.subspec '${e}'.*\n(?:.*\n)*?(?:.*sp.vendored_frameworks = \\[\n)((?:.*'.*?'.*\n)*?)(?:.*\\]\n)`,"m"),allowTheme=["Light","LightSpecial","Dark","DarkSpecial","Default"];exports.remoteBuildProjectMaterialAbsoluteCacheDir="__absoluteFile";const iconInfoMap={appStore1024:{size:[1024,1024],scale:1,idiom:"ios-marketing",required:!0},appStore1024Other:{size:[1024,1024],scale:1,idiom:"ios-marketing-other"},mainIcon120:{size:[60,60],scale:2,idiom:"iphone",required:!0},mainIcon180:{size:[60,60],scale:3,idiom:"iphone"},spotlightIcon80:{size:[40,40],scale:2,idiom:"iphone"},spotlightIcon120:{size:[40,40],scale:3,idiom:"iphone"},settingsIcon58:{size:[29,29],scale:2,idiom:"iphone"},settingsIcon87:{size:[29,29],scale:3,idiom:"iphone"},notificationIcon40:{size:[20,20],scale:2,idiom:"iphone"},notificationIcon60:{size:[20,20],scale:3,idiom:"iphone"},ipadMainIcon152:{size:[76,76],scale:2,idiom:"ipad"},ipadMainIcon167:{size:[83.5,83.5],scale:2,idiom:"ipad"},ipadSpotlightIcon40:{size:[40,40],scale:1,idiom:"ipad"},ipadSpotlightIcon80:{size:[40,40],scale:2,idiom:"ipad"},ipadSettingsIcon29:{size:[29,29],scale:1,idiom:"ipad"},ipadSpotlightIcon58:{size:[29,29],scale:2,idiom:"ipad"},ipadNotificationIcon20:{size:[20,20],scale:1,idiom:"ipad"},ipadNotificationIcon40:{size:[20,20],scale:2,idiom:"ipad"}};class buildCloudManager{generateTempDemoIpaPath(e){const i=path_1.default.join(e,"../.."),t=path_1.default.basename(i),n=path_1.default.dirname(i),a=path_1.default.join(n,t+"-operateDir");fs_extra_1.default.existsSync(a)&&fs_extra_1.default.removeSync(a),fs_extra_1.default.ensureDirSync(a);const s=path_1.default.join(a,"Payload/demo.app");return fs_extra_1.default.copySync(e,s),s}generateInfoPlistCFBundleURLTypesItem(e){const i={};return e.CFBundleURLName&&(i.CFBundleURLName=e.CFBundleURLName),e.CFBundleURLSchemes&&(i.CFBundleURLSchemes=[e.CFBundleURLSchemes]),e.CFBundleTypeRole&&(i.CFBundleTypeRole=e.CFBundleTypeRole),i}updatePrivacyBackgroundImage(e,i,t,n,a){t.message("doing","updatePrivacyBackgroundImage "+n);if(fs_extra_1.default.readdirSync(i).forEach(e=>{"privacy_"+n===path_1.default.basename(e,path_1.default.extname(e))&&fs_extra_1.default.removeSync(path_1.default.join(i,e))}),!a)return;path_1.default.isAbsolute(a)||(a=path_1.default.join(e,a)),a=this.getMaterialFilePath(e,a);const s=path_1.default.extname(a),o=path_1.default.join(i,`privacy_${n}${s}`);try{fs_extra_1.default.copyFileSync(a,o)}catch(e){throw t.message("error",`copy privacy image failed: ${n}, ${a} to ${o}`),e}}async updateIOSInfoPlistInfo(e,i,t,n,a,s){var o,r,l,p,d,u,c,f,_,h;a.progress("update app base info...");const{mobileapp_info:m={}}=i,g=m.mobileapp_id,y=path_1.default.join(t,"Info.plist"),I={},S=(e,i)=>{var t,n;if((null==i?void 0:i.startsWith("%"))&&(null==i?void 0:i.endsWith("%"))){const o=i.slice(1,-1);I[e]=o;const r=(null===(n=null===(t=null==s?void 0:s.base)||void 0===t?void 0:t.ios)||void 0===n?void 0:n[o])||"";return r||a.message("error",`未在国际化配置 base.json 中找到字段 ${o},请检查`),r}return i};S("UISplashScreenImageName",null===(o=null==n?void 0:n.splashscreen)||void 0===o?void 0:o.customImage),S("UILaunchStoryboardName",null===(r=null==n?void 0:n.splashscreen)||void 0===r?void 0:r.customImage);const x=plist.readFileSync(y);if(x.CFBundleName=S("CFBundleName",n.name),x.CFBundleDisplayName=S("CFBundleDisplayName",n.name),x.CFBundleShortVersionString=n.version,"number"==typeof n.versionCode?x.CFBundleVersion=parseInt(n.versionCode.toString(),10).toString():x.CFBundleVersion=(parseInt(x.CFBundleVersion,10)+1).toString(),x.CFBundleIdentifier=this.getBundleIdentifier(m),Array.isArray(null==n?void 0:n.openMimeTypes)&&this.validateCFBundleDocumentTypes(n.openMimeTypes,a)&&(x.CFBundleDocumentTypes=n.openMimeTypes,a.message("doing","openMimeTypes 应用成功")),Array.isArray(x.CFBundleURLTypes)||(x.CFBundleURLTypes=[]),(null===(p=null===(l=x.CFBundleURLTypes)||void 0===l?void 0:l[0])||void 0===p?void 0:p.CFBundleURLSchemes)&&(x.CFBundleURLTypes[0].CFBundleURLSchemes=[g]),x.CFBundleURLTypes[0]&&(x.CFBundleURLTypes=[x.CFBundleURLTypes[0]]),Object.keys(miniappJson_1.iosPrivacyDescObj).forEach(e=>{var i,t;(null===(i=null==n?void 0:n.privateDescriptions)||void 0===i?void 0:i[e])?x[e]=S(e,null===(t=n.privateDescriptions)||void 0===t?void 0:t[e]):delete x[e]}),!0===(null===(d=null==n?void 0:n.infoPlist)||void 0===d?void 0:d.DisableAppUsesNonExemptEncryption)?x.ITSAppUsesNonExemptEncryption=!1:delete x.ITSAppUsesNonExemptEncryption,x.UIBackgroundModes=[],!0===(null===(u=null==n?void 0:n.infoPlist)||void 0===u?void 0:u.AudioInBackgroundMode)&&x.UIBackgroundModes.push("audio"),!0===(null===(c=null==n?void 0:n.infoPlist)||void 0===c?void 0:c.LocationInBackgroundMode)&&x.UIBackgroundModes.push("location"),!0===(null===(f=null==n?void 0:n.infoPlist)||void 0===f?void 0:f.requiresFullScreen)?x.UIRequiresFullScreen=!0:delete x.UIRequiresFullScreen,"object"==typeof(null===(_=null==n?void 0:n.infoPlist)||void 0===_?void 0:_.CFBundleURLTypes)){const e=this.generateInfoPlistCFBundleURLTypesItem(n.infoPlist.CFBundleURLTypes);x.CFBundleURLTypes.push(e);const{additionalCFBundleURLTypes:i}=n.infoPlist.CFBundleURLTypes;Array.isArray(i)&&i.forEach(e=>{if("object"==typeof e){const i=this.generateInfoPlistCFBundleURLTypesItem(e);x.CFBundleURLTypes.push(i)}})}if(!0===n.enableIpad&&((0,miniappJson_1.iOSAppJsonIsUsingIPadResizable)(e)?(x["UISupportedInterfaceOrientations~ipad"]=["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpsideDown","UIInterfaceOrientationLandscapeLeft","UIInterfaceOrientationLandscapeRight"],a.progress("ipad is support Landscape")):(x["UISupportedInterfaceOrientations~ipad"]=["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpsideDown"],a.progress("ipad is not support Landscape"))),null===(h=n.infoPlist)||void 0===h?void 0:h.LSApplicationQueriesSchemes){const e=n.infoPlist.LSApplicationQueriesSchemes.split(",");e.length&&x.LSApplicationQueriesSchemes.push(...e.filter(e=>e))}return plist.writeFileSync(y,x),await this.writeI18NInfoFile(t,s,I),x.CFBundleVersion}getBundleIdentifier(e){return e.ios_flag&&e.bundle_id||e.debug_ios_bundle_id}validateCFBundleDocumentTypes(e,i){const t=["Owner","Default"," Alternate","None"],n=["Editor","Viewer"," Shell","None"],a=new Set;for(const s of e){if(a.has(s.CFBundleTypeName))return i.message("error","openMimeTypes 应用失败,存在重复定义的 CFBundleTypeName: "+s.CFBundleTypeName),!1;if(a.add(s.CFBundleTypeName),!t.includes(s.LSHandlerRank))return i.message("error","openMimeTypes 应用失败,存在不合法的 LSHandlerRank: "+s.LSHandlerRank),!1;if(!n.includes(s.CFBundleTypeRole))return i.message("error","openMimeTypes 应用失败,存在不合法的 CFBundleTypeRole: "+s.CFBundleTypeRole),!1;if(!Array.isArray(s.LSItemContentTypes))return i.message("error","openMimeTypes 应用失败,LSItemContentTypes 类型不合法"),!1}return!0}useGDT(e){return(0,miniappJson_1.iOSMiniAppJsonIsUsingGDT)(e)}async updateIOSAppConfigPlistInfo(e,i,t,n,a,s,o,r="Dark",l){var p,d,u,c;o.progress("update app module info...");const{module_info:f={},cpa_info:_={},cpa_package_info:h={enable_remove_watermark:!1}}=i;if(!_.sdk_key||!_.sdk_key_secret)throw new Error("sdkKey and sdkSecret not found");const m=path_1.default.join(t,"MiniApp.bundle"),g=path_1.default.join(m,"AppConfig.plist"),y=plist.readFileSync(g);h.enable_remove_watermark?y.enableRemoveWatermark=!0:y.splashscreenTheme=r,y.miniModuleId=f.module_id,y.sdkKey=_.sdk_key,y.sdkSecret=_.sdk_key_secret;const{privacy:I={}}=n;y.privacy||(y.privacy={}),y.privacy.enable=!!I.enable;const S=path_1.default.posix.join(m,"configs/privacy.json"),{contentViewImage:x,cancelButtonImage:v,confirmButtonImage:b,template:F}=I;if(I.enable){let i=F||"";if(fs_extra_1.default.ensureDirSync(path_1.default.posix.join(m,"configs")),i.startsWith("%")&&i.endsWith("%")){const t=F.slice(1,-1);i=(null===(d=null===(p=null==l?void 0:l.base)||void 0===p?void 0:p.ios)||void 0===d?void 0:d[t])||"",i||o.message("error",`未在国际化配置 base.json 中找到字段 ${t},请检查`),Object.keys(l).forEach(i=>{var n,a;if("base"===i)return;let s=null===(a=null===(n=l[i])||void 0===n?void 0:n.ios)||void 0===a?void 0:a[t];if(s){s=this.getMaterialFilePath(e,s);const t=`configs/privacy-${i}.json`,n=path_1.default.posix.join(m,t);fs_extra_1.default.existsSync(s)?fs_extra_1.default.copyFileSync(s,n):o.message("error",`未找到隐私协议在国际化配置 ${i}.json 中配置的文件 ${s},请检查`)}})}i?(i=this.getMaterialFilePath(e,i),fs_extra_1.default.existsSync(i)?(fs_extra_1.default.copyFileSync(i,S),y.privacy.template="configs/privacy.json"):(o.message("error",`未找到隐私协议中配置的文件 ${i},请检查`),y.privacy.template="configs/defaultPrivacy.json")):y.privacy.template="configs/defaultPrivacy.json",!0===I.enableNativePlugin&&"string"==typeof I.nativePluginId&&I.nativePluginId.length>2&&(y.privacy.plugin={pluginId:I.nativePluginId,enable:!0})}else y.privacy.template="",fs_extra_1.default.removeSync(S);this.updatePrivacyBackgroundImage(e,t,o,"contentViewImage",x),this.updatePrivacyBackgroundImage(e,t,o,"confirmButtonImage",b),this.updatePrivacyBackgroundImage(e,t,o,"cancelButtonImage",v);const{appMenuEnable:P=!0}=n;y.appMenuEnable=P;const{enableVConsole:B="undefined"}=n;y.enableVConsole=B;const{tpush:j}=n;let C=!1;if("object"==typeof j){const e=path_1.default.posix.join(t,"PlugIns/TPNSService.appex"),i=path_1.default.posix.join(e,"AppConfig.plist");if(this.useTpush(n)){y.TPNSAccessID=j.accessID,y.TPNSAccessKey=j.accessKey,j.clusterDomainName?y.clusterDomainName=j.clusterDomainName:delete y.clusterDomainName;const t=s?"x86_64":"arm64",n=path_1.default.join(a,`appex/${t}/TPNSService.appex`);if(!fs_extra_1.default.existsSync(n))throw new Error("can not found extendsdk: "+n);try{fs_extra_1.default.copySync(n,e),plist.writeFileSync(i,y),C=!0}catch(e){throw new Error("copy TPNSService.appex to app failed: "+e)}}}if(!C)try{const e=path_1.default.posix.join(t,"PlugIns");fs_extra_1.default.existsSync(e)?(fs_extra_1.default.removeSync(e),o.progress("removed PlugIns folder...")):o.progress("no PlugIns folder...")}catch(e){throw new Error("remove TPNSService.appex from app failed: "+e)}if(null===(u=n.useExtendedSdk)||void 0===u?void 0:u.WeAppLBS){if(!n.qmapAPIKey)throw new Error("You need to provide the Tencent Location Service API Key when using LBS SDK.");y.qmapAPIKey=n.qmapAPIKey}const{gdt:w}=n,L=this.useGDT(n);if(y.GDTAd=L?{appid:w.appid,enable:!0,SplashAd:{placementId:w.splashAd_placementId,fetchDelay:w.splashAd_fetchDelay||3,defaultEnable:null===(c=w.splashAd_defaultEnable)||void 0===c||c}}:{appid:"",enable:!1,SplashAd:{placementId:"",fetchDelay:3}},n["mini-plugin"]&&Array.isArray(n["mini-plugin"].ios)){const e=n["mini-plugin"].ios.filter(e=>!!(e.open&&e.pluginId&&e.loadWhenStart)).map(e=>e.pluginId);y.plugins={loadWhenStart:e}}const{enableDebugLog:A=!1}=n;y.enableDebugLog=A;const{debugLogSizeLimit:D=10}=n;isNaN(Number(D))?o.message("error",`ios debugLogSizeLimit ${D} is NaN`):y.debugLogSizeLimit=Number(D);const{enableOpenUrlNavigate:$=!1}=n;y.enableOpenUrlNavigate=$,plist.writeFileSync(g,y)}async updateIOSAppexInfoPlistInfo(e,i,t,n,a){if(this.useTpush(t)){a.progress("update appex for notification base info...");const{mobileapp_info:s={}}=e,o=path_1.default.join(i,"PlugIns/TPNSService.appex"),r=path_1.default.join(o,"Info.plist"),l=plist.readFileSync(r);l.CFBundleShortVersionString=t.version,a.progress("update appex for CFBundleVersion: "+n),l.CFBundleVersion=n;const p=s.ios_flag&&s.bundle_id||s.debug_ios_bundle_id;l.CFBundleIdentifier=t.tpush.serviceBundleId||p+".service",a.progress("update appex bundle identifier for infoPlist : "+l.CFBundleIdentifier),plist.writeFileSync(r,l)}else a.progress("not using tpush...")}updateBundleIcons(e,i,t,n,a){const s=[],o=[],r=[];for(const l in t){if(!t[l])continue;const p=this.getMaterialFilePath(e,t[l]);if(!p)return void a.message("error","getMatrialFailed: "+t[l]);const d=iconInfoMap[l];try{const e=sizeOf(p),i=d.size[0]*d.scale,n=d.size[1]*d.scale;if(e.width!==i||e.height!==n){a.progress(`check ${l} size failed, require [${i}, ${n}] but [${e.width}, ${e.height}] ingore ${t[l]} `);continue}}catch(e){a.progress(`get ${l} info failed, ingore ${t[l]}(e: ${e.message})`);continue}const u=path_1.default.extname(p),c=1===d.scale?"":`@${d.scale}x`,f=`${d.size[0]}x${d.size[1]}`,_=l.startsWith("ipad"),h="appStore1024"===l||"appStore1024Other"===l,m="appStore1024Other"===l?n+"Other":n,g=path_1.default.join(i,`${m}${f}${c}${_?"~ipad":""}${u}`),y={from:p,to:g,filename:path_1.default.basename(g),size:f,scale:d.scale+"x",idiom:d.idiom,key:l};s.push(y),h||(_?r.includes(`${m}${f}`)||r.push(`${m}${f}${c}`):o.includes(`${m}${f}`)||o.push(`${m}${f}${c}`))}return{iphoneBundleIconFiles:o,ipadBundleIconFiles:r,addFiles:s}}async updateIOSIcons(e,i,t,n,a,s){s.progress("update app icons...");const{icons:o={}}=n,r=a&&!env_1.isWin&&!!t;s.progress("genAssetCar: "+r);const l=glob_1.default.sync("AppIcon*.+(png|jpg|jpeg|webp)",{nodir:!0,cwd:i}).map(e=>path_1.default.join(i,e)),p="AppIcon-"+uuidv4().slice(0,8),d=this.updateBundleIcons(e,i,o,p,s);if(!d)throw new Error("updateBundleIcons failed");const{iphoneBundleIconFiles:u=[],ipadBundleIconFiles:c=[],addFiles:f=[]}=d,_={};for(const e in iconInfoMap){if(!iconInfoMap[e].required||o[e])continue;const i=iconInfoMap[e].size[0]*iconInfoMap[e].scale,t=iconInfoMap[e].size[1]*iconInfoMap[e].scale;if(_[e]=path_1.default.join(defaultIconDirPath,`donut-icon${i}x${t}.png`),s.progress(`using default app icons when ${e} is not config...`),!fs_extra_1.default.existsSync(_[e]))throw new Error(`required ${e} but not default or set`)}const h=this.updateBundleIcons(e,i,_,p,s);if(!h)throw new Error("updateBundleIcons WithDefaultIcon failed");const{iphoneBundleIconFiles:m,ipadBundleIconFiles:g,addFiles:y}=h;if(u.push(...m),c.push(...g),f.push(...y),!u.length&&!c.length)return;l.forEach(e=>{fs_extra_1.default.existsSync(e)&&fs_extra_1.default.removeSync(e)});const I=path_1.default.join(t,"__assetCarOperateDir/assetsCar/"),S=path_1.default.join(I,`Assets.xcassets/${p}.appiconset/`);r&&(fs_extra_1.default.ensureDirSync(S),fs_extra_1.default.emptyDirSync(S));const x=[];let v=!1;if(f.forEach(e=>{fs_extra_1.default.existsSync(e.to)&&fs_extra_1.default.removeSync(e.to),fs_extra_1.default.copyFileSync(e.from,e.to),r&&(fs_extra_1.default.copySync(e.from,path_1.default.join(S,e.filename)),"ios-marketing-other"===e.idiom&&(v=!0),x.push({filename:e.filename,size:e.size,scale:e.scale,idiom:e.idiom}))}),r&&fs_extra_1.default.writeJsonSync(path_1.default.join(S,"Contents.json"),{images:x,info:{author:"xcode",version:1}},{spaces:"\t"}),r){const e=path_1.default.join(__dirname,"../../../static/scripts/assetsCar/"),t=path_1.default.join(I,"createAssetsCar");fs_extra_1.default.copySync(e,I);try{await(0,codesign_1.checkXcodeEnv)(s),child_process.execSync(`"${t}" ${p}`,{env:(0,env_1.getProcessEnv)()})}catch(e){s.progress("createAssetsCar failed "+(e.message||""))}const n=path_1.default.join(I,"build/Assets.car"),a=path_1.default.join(i,"Assets.car");fs_extra_1.default.copyFileSync(n,a)}else{const e=path_1.default.join(i,"Assets.car");fs_extra_1.default.removeSync(e)}const b=path_1.default.join(i,"Info.plist"),F=plist.readFileSync(b);if(!F.CFBundleIcons){const e={CFBundlePrimaryIcon:{}};F.CFBundleIcons=e}v&&(F.CFBundleIcons.CFBundleAlternateIcons={OtherAppStoreIcon:{CFBundleIconFiles:[p+"Other"],CFBundleIconName:"OtherAppStoreIcon"}}),F.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconName=p,F.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles=u,F["CFBundleIcons~ipad"]||(F["CFBundleIcons~ipad"]={CFBundlePrimaryIcon:{}}),F["CFBundleIcons~ipad"].CFBundlePrimaryIcon.CFBundleIconName=p,F["CFBundleIcons~ipad"].CFBundlePrimaryIcon.CFBundleIconFiles=c,F.NSAppTransportSecurity={NSAllowsArbitraryLoads:!0},plist.writeFileSync(b,F)}replaceLaunchScreenImage(e,i,t,n,a,s){const o=path_1.default.join(e,"01J-lp-oVM-view-Ze5-6b-2t3.nib");let r=fs_extra_1.default.readFileSync(o).toString("hex");if(!i.endsWith(".png"))return void n.message("error","IOS 启动页图片配置格式错误,必须为 PNG 格式, 错误配置:"+i);const l=this.getMaterialFilePath(a,i),p=t+".png",d="LaunchScreen-"+uuidv4().slice(0,12),u=d+".png",c=path_1.default.join(s,u);fs_extra_1.default.copyFileSync(l,c);const f=Buffer.from(p,"utf-8").toString("hex"),_=Buffer.from(u,"utf-8").toString("hex");return-1!==r.indexOf(f)?(r=r.replace(f,_),console.log("replace storyboard customImage success")):console.log("replace storyboard customImage fail"),fs_extra_1.default.writeFileSync(o,Buffer.from(r,"hex")),d}async updateSplashScreen(e,i,t,n,a="Dark",s){var o,r,l;let p;n.progress("update splashscreen image..."),allowTheme.includes(a)&&(p=path_1.default.join(i,`/Base.lproj/LaunchScreen${a}.storyboardc`)),p&&fs_extra_1.default.existsSync(p)&&fs_extra_1.default.copySync(p,path_1.default.join(i,"/Base.lproj/LaunchScreen.storyboardc")),allowTheme.forEach(e=>{const t=path_1.default.join(i,`/Base.lproj/LaunchScreen${e}.storyboardc`);fs_extra_1.default.existsSync(t)&&fs_extra_1.default.removeSync(t)});let d=null===(o=null==t?void 0:t.splashscreen)||void 0===o?void 0:o.customImage;if(!d)return;const u=path_1.default.join(i,"Info.plist"),c=plist.readFileSync(u),f=c.UISplashScreenImageName;if(glob_1.default.sync("LaunchScreen-*.+(png|jpg|jpeg|webp)",{nodir:!0,cwd:i}).forEach(e=>{const t=path_1.default.join(i,e);fs_extra_1.default.removeSync(t)}),d.startsWith("%")&&(null==d?void 0:d.endsWith("%"))){const t=d.slice(1,-1),a=(null===(l=null===(r=null==s?void 0:s.base)||void 0===r?void 0:r.ios)||void 0===l?void 0:l[t])||"";if(!a)return void n.message("error",`未在国际化配置 base.json 中找到字段 ${t},请检查,启动页国际化配置失败`);d=a,Object.keys(s).forEach(a=>{var o,r;if("base"===a)return;const l=null===(r=null===(o=s[a])||void 0===o?void 0:o.ios)||void 0===r?void 0:r[t];if(l){const t=path_1.default.join(i,`/${a}.lproj/LaunchScreen_${a}.storyboardc`);fs_extra_1.default.ensureDirSync(path_1.default.join(t,"..")),fs_extra_1.default.copySync(path_1.default.join(i,"/Base.lproj/LaunchScreen.storyboardc"),t);const s=this.replaceLaunchScreenImage(t,this.getMaterialFilePath(e,l),f,n,e,i);n.progress(`update ${a} splashscreen image...`);const o=fs_extra_1.default.readFileSync(path_1.default.join(i,a+".lproj/InfoPlist.strings"),"utf8");let r="";r=s?o.replace("__UISplashScreenImageName__",`UISplashScreenImageName = "${s}";\n`).replace("__UILaunchStoryboardName__",`UILaunchStoryboardName = "LaunchScreen_${a}";\n`):o.replace("__UISplashScreenImageName__","").replace("__UILaunchStoryboardName__",""),fs_extra_1.default.writeFileSync(path_1.default.join(i,a+".lproj/InfoPlist.strings"),r),n.progress(`update ${a} splashscreen image success`)}})}n.progress("update base splashscreen image...");const _=this.replaceLaunchScreenImage(path_1.default.join(i,"/Base.lproj/LaunchScreen.storyboardc"),this.getMaterialFilePath(e,d),f,n,e,i);n.progress("update base splashscreen image success"),_&&(c.UISplashScreenImageName=_,c.UILaunchStoryboardName="LaunchScreen",plist.writeFileSync(u,c))}genUseExtendedSdk(e,i){const t=Object.assign({},e.useExtendedSdk||{});for(const i in e)if("object"==typeof e[i])for(const n in e[i])if(n.startsWith("useExtendedLib_WeApp")&&!0===e[i][n]){t[n.slice("useExtendedLib_".length)]=!0}return!t.WeAppLBS||t.WeAppOpenFuns||t.WeAppOpenFuns_HasPay||(t.WeAppOpenFuns=!0),"RemoteDebug"===(null==i?void 0:i.debugType)&&(t.WeAppUSB=!0),t}async updateExtendedSdk(e,i,t,n,a,s,o){const r=path_1.default.join(i,"Frameworks");fs_extra_1.default.ensureDirSync(r),o.progress("update extendsdk...");const l=path_1.default.join(t,"WeAppSDK.podspec"),p=fs_extra_1.default.readFileSync(l,"utf-8"),d=this.genUseExtendedSdk(a,s);o.progress("useExtendedSdks: "+JSON.stringify(d));const{mobileapp_info:u={}}=e,c=this.getBundleIdentifier(u);if(d.WeAppOpenFuns&&d.WeAppOpenFuns_HasPay)throw new Error("OpenFuncs SDK 只可勾选使用一个,请按需勾选使用");const f={};for(const e in d){if(!d[e])continue;const i=getDepReg(e),a=p.match(i);if(!(null==a?void 0:a[1])){if("WeAppUSB"===e)continue;throw new Error(`拓展模块 ${e} 不存在或已被移除,请检查 project.miniapp.json -> 对应平台 -> useExtendedSdk 删除配置 ${e},版本配置差异请参考更新日志或 https://dev.weixin.qq.com/docs/framework/dev/sdk/difflog.html`)}const s=[];if(a[1].split("\n").forEach(e=>{const i=e.match(/.*'(.*?)',/);if(null==i?void 0:i[1]){const e=i[1].split("/").pop(),a=path_1.default.join(t,"Libs",n,e);if(!fs_extra_1.default.existsSync(a)){if("WeAppUSB.framework"===e)return;throw new Error(`拓展模块 ${e} 不存在或已被移除,请检查 project.miniapp.json -> 对应平台 -> useExtendedSdk 删除配置 ${e},版本配置差异请参考更新日志或 https://dev.weixin.qq.com/docs/framework/dev/sdk/difflog.html`)}const o=path_1.default.join(r,e);fs_extra_1.default.copySync(a,o),s.push(path_1.default.basename(e));const l=path_1.default.join(o,"info.plist");if(!fs_extra_1.default.existsSync(l))throw new Error("can not found extendsdk info.plist: "+e);this.changeExtendSDKInfoplistBundleId(l,c,e)}}),s.length){f[s.shift()]=s}}const _=path_1.default.join(i,"DyFrameworks.plist");fs_extra_1.default.existsSync(_)&&fs_extra_1.default.removeSync(_),plist.writeFileSync(_,f)}async updatePrivacyInfo(e,i,t){var n;const a=null===(n=null==i?void 0:i.privacy)||void 0===n?void 0:n.privacyInfo;a&&(a.endsWith("PrivacyInfo.xcprivacy")?fs_extra_1.default.existsSync(a)?(fs_extra_1.default.copySync(a,path_1.default.join(e,"/PrivacyInfo.xcprivacy")),t.progress("隐私清单文件替换成功")):t.message("error","隐私清单文件替换失败,文件不存在,将使用默认文件"):t.message("error","隐私清单文件替换失败,文件名必须为 PrivacyInfo.xcprivacy,将使用默认文件"))}async updatePlugin(e,i,t,n,a,s,o,r){if(!i.length)return;const l=path_1.default.join(e,"Frameworks"),p=path_1.default.join(e,"PlugIns");fs_extra_1.default.ensureDirSync(l),r.progress("update plugin...");const d=this.prepareAppexProfileConfig(i,n,t,a,s,o,n.version,r);if(!d)throw new Error("依赖的多端插件需要配置对应的profile");const u={};if(n["mini-plugin"]&&Array.isArray(n["mini-plugin"].ios)){n["mini-plugin"].ios.forEach(e=>{e.open&&e.pluginId&&"string"==typeof e.resourcePath&&e.resourcePath.length>0&&(u[e.pluginId]=e.resourcePath)})}i.forEach(i=>{const{pluginId:n}=i,a=i.dir,s=n+".framework",o=path_1.default.join(l,s);if(-1!==a.indexOf("local-miniapp-plugin")){const e=fs_extra_1.default.statSync(a),{mtime:i}=e;r.progress(`${n}.framework 正在使用本地版本,修改时间为 ${i}`)}fs_extra_1.default.existsSync(o)&&fs_extra_1.default.removeSync(o);const c=path_1.default.join(a,s);if(fs_extra_1.default.existsSync(c)){fs_extra_1.default.copySync(c,o),this.copyResourcesToMainBundle(c,e),this.copyUserResourcePathIntoPlugins(n,t,u[n],path_1.default.join(o,"MiniPlugin.bundle"),r);fs_extra_1.default.readdirSync(a).forEach(i=>{if(i.endsWith(".appex")){const s=path_1.default.parse(i).name,o=d[s],l=path_1.default.join(p,i);if(!o||!0!==o.enable)return;r.progress(`${n} 插件使用 appex 中 : ${i}`),fs_extra_1.default.existsSync(l)&&fs_extra_1.default.removeSync(l),fs_extra_1.default.ensureDirSync(l);const c=path_1.default.join(a,i);fs_extra_1.default.copySync(c,l),(null==o?void 0:o.profilePath)&&fs_extra_1.default.copySync(o.profilePath,path_1.default.join(l,"embedded.mobileprovision")),this.copyResourcesToMainBundle(c,e),this.copyUserResourcePathIntoPlugins(n,t,u[n],path_1.default.join(l,"MiniPlugin.bundle"),r)}else if(i.endsWith("framework")&&i!==s){const e=path_1.default.join(l,i),t=path_1.default.join(a,i);fs_extra_1.default.existsSync(e)&&fs_extra_1.default.removeSync(e),fs_extra_1.default.copySync(t,e)}})}else fs_extra_1.default.copySync(a,o),this.copyResourcesToMainBundle(a,e),this.copyUserResourcePathIntoPlugins(n,t,u[n],path_1.default.join(o,"MiniPlugin.bundle"),r)})}copyUserResourcePathIntoPlugins(e,i,t,n,a){const s=n;if(t){const n=path_1.default.basename(t),o=this.getMaterialFilePath(i,t);if(o){a.progress(`${e}.framework 正在拷贝配置的资源:${t}`);const i=fs_extra_1.default.lstatSync(o);fs_extra_1.default.ensureDirSync(s),i.isDirectory()?fs_extra_1.default.copySync(o,s):i.isFile()&&fs_extra_1.default.copyFileSync(o,path_1.default.join(s,n))}}}copyResourcesToMainBundle(e,i){const t=path_1.default.join(e,"MiniPlugin.bundle"),n=path_1.default.join(t,"PluginConfig.plist");if(fs_extra_1.default.existsSync(n)){const e=plist.readFileSync(n).CopyResourcesToMainBundle;(null==e?void 0:e.length)&&e.forEach(e=>{const n=path_1.default.join(t,e);fs_extra_1.default.existsSync(n)&&fs_extra_1.default.copySync(n,path_1.default.join(i,e))})}}prepareAppexProfileConfig(e,i,t,n,a,s,o,r){if(!n)return void r.message("doing","miniappCacheDirPath is missing");let l=!1;const p={};if(i["mini-plugin"]&&Array.isArray(i["mini-plugin"].ios)){i["mini-plugin"].ios.forEach(e=>{if(e.open&&e.pluginId&&"object"==typeof e.appexProfiles)for(const i in e.appexProfiles){r.message("doing",`检查插件 ${e.pluginId} ${i} appex 配置中 ...`);const n=e.appexProfiles[i];if(!0===n.enable){const s=`${e.pluginId}_${i}`;p[s]={enable:!0};let o=n.profilePath;if(a&&(o=n.distributeProfilePath),n.bundleID&&o){const a=path_1.default.join(t,o);fs_extra_1.default.existsSync(a)?(p[s].bundleID=n.bundleID,p[s].profilePath=path_1.default.join(t,o)):(l=!0,r.message("error",`${e.pluginId} 中 ${i} 的 profilePath 无法找到对应的文件:${a}(需要在小程序项目路径下,填入相对于项目根目录的路径)`))}else l=!0,r.message("error",`${e.pluginId}中${i} 是 无效的appexProfiles配置。需要配置 bundleID,profilePath,distributeProfilePath。profile 文件需要放置在小程序项目内,然后配置相对于小程序项目根目录的相对路径。分发证书构建的情况下, 一定需要配置distributeProfilePath。查看文档了解详情。`)}}})}if(e.forEach(e=>{fs_extra_1.default.readdirSync(e.dir).forEach(i=>{if(i.endsWith(".appex")){const t=path_1.default.parse(i).name,n=p[t];if(n&&!0===n.enable)if(n.bundleID&&n.profilePath){if(n.bundleID&&n.profilePath){const t=path_1.default.join(e.dir,i,"info.plist"),a=n.bundleID;this.changeInfoplistBundleId(t,a),this.changeInfoplistBundleVersion(t,s,o),r.message("doing",`${e.pluginId} ${i} ${a} ${t} 处理 appex bundle ID 中`)}}else l=!0,r.message("error",`${e.pluginId} 的 多端插件包含了${t.slice(e.pluginId.length+1)} 的 appex。开发者需要在project.miniapp.json 中 mini-plugin 配置下对应合理的 profile 文件。查看文档了解详情。`)}})}),l)return!1;if(!(0,lodash_1.isEmpty)(p)){const e=path_1.default.join(n,APPEX_PROFILES_MAPS_FILE);fs_extra_1.default.existsSync(e)&&fs_extra_1.default.removeSync(e),fs_extra_1.default.ensureFileSync(e);const i={};for(const e in p)i[e]={bundleID:p[e].bundleID,profilePath:p[e].profilePath};fs_extra_1.default.writeFileSync(e,JSON.stringify(i));const t=path_1.default.join(n,APPEX_PROFILES_MAPS_FOR_SHELL_FILE);fs_extra_1.default.existsSync(t)&&fs_extra_1.default.removeSync(t),fs_extra_1.default.ensureFileSync(t);const a=Object.keys(p).map(e=>{const i=p[e];return`pluginAppexName:${e};_;_;bundleID:${i.bundleID};_;_;profile:${i.profilePath}\n\n`}).join("");fs_extra_1.default.writeFileSync(t,a)}return p}changeExtendSDKInfoplistBundleId(e,i,t){const n=`${i}.${path_1.default.parse(t).name.replace(/_/g,"")}`;return this.changeInfoplistBundleId(e,n)}changeInfoplistBundleId(e,i){const t=plist.readFileSync(e);return t.CFBundleIdentifier=i,plist.writeFileSync(e,t),t.CFBundleIdentifier}changeInfoplistBundleVersion(e,i,t){const n=plist.readFileSync(e);return n.CFBundleVersion=i,n.CFBundleShortVersionString=t,plist.writeFileSync(e,n),n.CFBundleIdentifier}async getEntitlements(e,i,t,n){const{mobileapp_info:a={}}=e;let s=a.ios_universal_link||a.debug_ios_universal_link;return(s.startsWith("https://")||s.startsWith("http://"))&&(s=s.replace(/^http(s)?:\/\//g,"applinks:")),{"com.apple.developer.associated-domains":s}}useTpush(e){return(0,miniappJson_1.iOSMiniAppJsonIsUsingTpush)(e)}async buildCloud(e,i){const{projectPath:t,demoIpaPath:n,sdkPath:a,arch:s="arm64",bindingInfo:o,certificateInfo:r,output:l,miniappCacheDirPath:p,pluginDirList:d,inLandun:u,theme:c,i18nInfo:f,debugInfo:_,CILocalBuild:h}=e,m=this.generateTempDemoIpaPath(n),{selfCertificate:g={}}=r,y=(null==g?void 0:g.isPublish)||!1,I=(0,miniappJson_1.tryGetIOSMiniappJson)(t),S=this.useTpush(I);if((0,lodash_1.isEmpty)(I))throw new Error("获取project.miniapp.json失败");if(errorIOSSdkVersions.includes(I.sdkVersion))throw new Error("当前 mini-ios.sdkVersion 存在缺陷,请参考更新日志进行修改");let x=o;if(r.signType===miniapp_builder_1.miniappSinTypes.appleId.type){const{mobileapp_info:e={}}=x;x=Object.assign(Object.assign({},x),{mobileapp_info:Object.assign(Object.assign({},e),{bundle_id:miniapp_builder_1.DEFAULT_BUNDLE_ID,debug_ios_bundle_id:miniapp_builder_1.DEFAULT_BUNDLE_ID})})}const v=await this.updateIOSInfoPlistInfo(t,x,m,I,i,f);await this.updateIOSAppConfigPlistInfo(t,x,m,I,a,!1,i,c,f),await this.updateIOSAppexInfoPlistInfo(x,m,I,v,i),await this.updateIOSIcons(t,m,p,I,y,i),await this.updateSplashScreen(t,m,I,i,c,f),await this.updateExtendedSdk(x,m,a,s,I,_,i),await this.updatePlugin(m,d,t,I,p,y,v,i),await this.updatePrivacyInfo(m,I,i);const b=await this.getEntitlements(x,m,I,i),{mobileapp_info:F={}}=x;let P;P=r.signType===miniapp_builder_1.miniappSinTypes.appleId.type?miniapp_builder_1.DEFAULT_BUNDLE_ID:F.ios_flag&&F.bundle_id||F.debug_ios_bundle_id;const B={bundleId:P,output:l,entitlements:b};if(I.buildCloud&&(I.buildCloud.certificate&&"string"==typeof I.buildCloud.certificate&&(B.certificate=I.buildCloud.certificate),I.buildCloud.profile&&"string"==typeof I.buildCloud.profile&&(B.profile=path_1.default.join(t,I.buildCloud.profile)),S&&I.buildCloud.tpnsProfile&&"string"==typeof I.buildCloud.tpnsProfile&&(B.tpnsProfile=path_1.default.join(t,I.buildCloud.tpnsProfile))),h&&(B.profile=g.profilePath,B.certificate=g.certificateName),g.isPublish||h){const e=await(0,codesign_1.codesignAndExport)(t,m,p||"",B,i,S,!0===u);if(!0!==e.success)throw new Error("Build ipa failed:"+(e.errMsg||"codesignAndExport failed"))}return{projectPath:t,demoIpaPath:m,opts:B,iosMiniappJson:I,isPublish:y}}async writeI18NInfoFile(e,i,t){Object.keys(i).forEach(n=>{if("base"===n)return;let a="";Object.keys(t).forEach(e=>{var s,o,r,l;"UISplashScreenImageName"!==e?"UILaunchStoryboardName"!==e?(null===(o=null===(s=i[n])||void 0===s?void 0:s.ios)||void 0===o?void 0:o[t[e]])&&(a+=`${e} = "${null===(l=null===(r=i[n])||void 0===r?void 0:r.ios)||void 0===l?void 0:l[t[e]]}";\n`):a+="__UILaunchStoryboardName__\n":a+="__UISplashScreenImageName__\n"}),a&&(fs_extra_1.default.ensureDirSync(path_1.default.join(e,n+".lproj")),fs_extra_1.default.writeFileSync(path_1.default.join(e,n+".lproj/InfoPlist.strings"),a))})}getMaterialFilePath(e,i){if(!i)return"";let t=i;if(path_1.default.isAbsolute(i)||(t=path_1.default.join(e,i)),fs_extra_1.default.existsSync(t))return t;const n=(0,tools_1.generateMD5)(i),a=path_1.default.basename(i),s=path_1.default.join(e,exports.remoteBuildProjectMaterialAbsoluteCacheDir,`${n}_${a}`);return fs_extra_1.default.existsSync(s)?s:""}}exports.default=new buildCloudManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IOSUtils=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),path_1=tslib_1.__importDefault(require("path")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),env_1=require("../../../utils/env"),deviceUtils=tslib_1.__importStar(require("./device")),projectConfigUtils=tslib_1.__importStar(require("./projectconfig")),cp_1=require("../../../utils/cp"),miniapp_builder_1=require("../../../utils/miniapp-builder"),usbProcess_1=require("../../../utils/usbProcess"),miniappJson_1=require("../../../utils/miniappJson"),singletontask_1=require("../../../utils/singletontask"),buildCloud_1=tslib_1.__importStar(require("./buildCloud")),tools_1=require("../../../utils/tools"),codesign_1=require("../../../utils/codesign"),ProjectMiniappJsonSplashScreenThemeKey="__splashscreenTheme",_iconInfoMap={appStore1024:{size:[1024,1024],scale:1,idiom:"ios-marketing",required:!0},mainIcon120:{size:[60,60],scale:2,idiom:"iphone",required:!0},mainIcon180:{size:[60,60],scale:3,idiom:"iphone"},spotlightIcon80:{size:[40,40],scale:2,idiom:"iphone"},spotlightIcon120:{size:[40,40],scale:3,idiom:"iphone"},settingsIcon58:{size:[29,29],scale:2,idiom:"iphone"},settingsIcon87:{size:[29,29],scale:3,idiom:"iphone"},notificationIcon40:{size:[20,20],scale:2,idiom:"iphone"},notificationIcon60:{size:[20,20],scale:3,idiom:"iphone"},ipadMainIcon152:{size:[76,76],scale:2,idiom:"ipad"},ipadMainIcon167:{size:[83.5,83.5],scale:2,idiom:"ipad"},ipadSpotlightIcon40:{size:[40,40],scale:1,idiom:"ipad"},ipadSpotlightIcon80:{size:[40,40],scale:2,idiom:"ipad"},ipadSettingsIcon29:{size:[29,29],scale:1,idiom:"ipad"},ipadSpotlightIcon58:{size:[29,29],scale:2,idiom:"ipad"},ipadNotificationIcon20:{size:[20,20],scale:1,idiom:"ipad"},ipadNotificationIcon40:{size:[20,20],scale:2,idiom:"ipad"}},_allowTheme=["Light","LightSpecial","Dark","DarkSpecial","Default"],_getDepReg=e=>new RegExp(`s.subspec '${e}'.*\n(?:.*\n)*?(?:.*sp.vendored_frameworks = \\[\n)((?:.*'.*?'.*\n)*?)(?:.*\\]\n)`,"m"),buildIOSPluginTask={};class IOSUtils{constructor(e,i={},t,n){this.root=e,this.userConfig=i,this.miniappDirPath=t,this.devtoolsVersion=n}getProjectConfig(){const e=projectConfigUtils.getProjectConfig(this.root,this.userConfig);if(!e)throw new Error("iOS project folder not found. Are you sure this is a miniapp project?");return e}getBundleId(e){return child_process.execFileSync("/usr/libexec/PlistBuddy",["-c","Print:CFBundleIdentifier",path_1.default.join(e,"Info.plist")],{encoding:"utf8",env:(0,env_1.getProcessEnv)()}).trim()}tryInstallPod(e,i){const t=this.getProjectConfig(),{sourceDir:n}=t,o={cwd:n,env:(0,env_1.getProcessEnv)()};i.progress("export LANG=en_US.UTF-8 && pod install"),child_process.execSync("export LANG=en_US.UTF-8 && pod install",o)}async runLocal(e,i){const t=this.getProjectConfig(),{sourceDir:n}=t;process.chdir(n),this.tryInstallPod(e,i);const o=path_1.default.basename(t.name,path_1.default.extname(t.name)),s=e.scheme||o;if(i.progress(`Found Xcode ${t.isWorkspace?"workspace":"project"} "${t.name}"`),e.device||e.udid){if(e.udid||e.device){const n=await deviceUtils.getDevices({recorder:i}),o=n.find(i=>i.udid===e.udid||i.name===e.device);if(!o)throw new Error(`Could not find a device with udid(${e.udid}) or device(${e.device}). ${deviceUtils.printFoundDevices(n)}`);if("simulator"===o.type)return void await this.runOnSimulatorLocal(t,s,e,i);await this.runOnDeviceLocal(t,s,o,i)}}else await this.runOnSimulatorLocal(t,s,e,i)}async runCloud(e,i){try{const{deviceType:t,udid:n,projectPath:o,demoIpaPath:s,sdkPath:a,bindingInfo:r,certificateInfo:c,arch:l="arm64",pluginDirList:d,miniappCacheDirPath:p,theme:u,i18nInfo:h,debugInfo:f}=e,_=buildCloud_1.default.generateTempDemoIpaPath(s),m="simulator"===t,g=(0,miniappJson_1.tryGetIOSMiniappJson)(o);let b=r;if(c.signType===miniapp_builder_1.miniappSinTypes.appleId.type){const{mobileapp_info:e={}}=b;b=Object.assign(Object.assign({},b),{mobileapp_info:Object.assign(Object.assign({},e),{bundle_id:miniapp_builder_1.DEFAULT_BUNDLE_ID,debug_ios_bundle_id:miniapp_builder_1.DEFAULT_BUNDLE_ID})})}const v=await buildCloud_1.default.updateIOSInfoPlistInfo(o,b,_,g,i,h);await buildCloud_1.default.updateIOSAppConfigPlistInfo(o,b,_,g,a,m,i,u,h),await buildCloud_1.default.updateIOSAppexInfoPlistInfo(b,_,g,v,i),await buildCloud_1.default.updateIOSIcons(o,_,"",g,!1,i),await buildCloud_1.default.updateSplashScreen(o,_,g,i,u,h),await buildCloud_1.default.updateExtendedSdk(b,_,a,l,g,f,i),await buildCloud_1.default.updatePlugin(_,d,o,g,p,!1,v,i);const y=await buildCloud_1.default.getEntitlements(b,_,g,i);if("device"===t){const{mobileapp_info:e={}}=b,t=e.ios_flag&&e.bundle_id||e.debug_ios_bundle_id;await(0,miniapp_builder_1.signAndInstallOrExport)(o,_,p,c,{bundleId:t,install:!0,deviceId:n,entitlements:y},{recorder:i,miniappDirPath:this.miniappDirPath,devtoolsVersion:this.devtoolsVersion})}else await this.runOnSimulatorCloud(_,{udid:n},i)}catch(e){throw new Error("Run the app failed:"+e.message)}}async buildLocal(e,i){const t=this.getProjectConfig();process.chdir(t.sourceDir);const n=path_1.default.basename(t.name,path_1.default.extname(t.name)),o=e.scheme||n;this.tryInstallPod(e,i),i.progress("start build ipa...");const s=await this.buildProjectArchive(t,{output:e.output,scheme:o},i),a=await this.exportArchive(t,s,e,i);return console.log("Successfully build ipa: "+a),a}async buildCloud(e,i){try{const{projectPath:t,certificateInfo:n,miniappCacheDirPath:o}=e,s=await buildCloud_1.default.buildCloud(e,i),{demoIpaPath:a,opts:r}=s,c={recorder:i,miniappDirPath:this.miniappDirPath,devtoolsVersion:this.devtoolsVersion};s.isPublish||await(0,miniapp_builder_1.signAndInstallOrExport)(t,a,o,n,r,c)}catch(e){throw new Error("Build ipa failed:"+e.message)}}async genProjectMaterialMap(e,i,t,n){var o,s;const a=buildCloud_1.remoteBuildProjectMaterialAbsoluteCacheDir,r=path_1.default.join(i,a),c=(0,miniappJson_1.tryGetIOSMiniappJson)(e);function l(e,i){fs_extra_1.default.ensureDirSync(path_1.default.dirname(i)),fs_extra_1.default.copyFileSync(e,i)}function d(t,n,o=!0){if(!n){if(o)return"";throw new Error(`file cant be empty for cloud build, key: ${t} , fileName: ${n}`)}if(path_1.default.isAbsolute(n)){const e=path_1.default.basename(n);if(!fs_extra_1.default.existsSync(n)){if(o)return"";throw new Error(`file cant be empty for cloud build, key: ${t} , fileName: ${n}`)}const i=(0,tools_1.generateMD5)(n);return l(n,path_1.default.join(r,`${i}_${e}`)),path_1.default.join(a,e)}const s=path_1.default.join(e,n),c=path_1.default.join(i,n);if(!fs_extra_1.default.existsSync(s)){if(o)return"";throw new Error(`file cant be empty for cloud build, key: ${t} , fileName: ${n}`)}return l(s,c),n}fs_extra_1.default.ensureDirSync(r);const{privacy:p={},icons:u={},splashscreen:h={},buildCloud:f={}}=c,_=d("project.miniapp.json","project.miniapp.json",!1),m=d("project.config.json","project.config.json",!1),g=(0,miniappJson_1.getMiniprogramRoot)(e),b=d("app.json",path_1.default.join(g,"app.json"),!1),{template:v,contentViewImage:y,cancelButtonImage:S,confirmButtonImage:P}=p,w=d("privacy template",v),I=d("privacy contentViewImage",y),x=d("privacy cancelButtonImage",S),j=d("privacy confirmButtonImage",P),E=[];for(const e in u)if(u[e]){const i=d("icons."+e,u[e],!1);i&&E.push(i)}const O=d("splashscreen.customImage",h.customImage),{p12:D,profile:C,tpnsProfile:A}=f,$=d("p12 Path",D,!1),T=d("profile Path",C,!1);let k=void 0;!0===(null===(o=null==c?void 0:c.tpush)||void 0===o?void 0:o.useExtendedLib_WeAppTPNS)&&(k=d("tpns profile Path",A,!0!==(null===(s=null==c?void 0:c.tpush)||void 0===s?void 0:s.useExtendedLib_WeAppTPNS)));const B="miniapp/ios/i18nInfo.json",U=path_1.default.join(e,B),F=d("i18n",B,!0);if(fs_extra_1.default.existsSync(U)){const i=function(e,i){function t(i,t,n){if(t[n]&&"object"==typeof t[n][i])for(const o in t[n][i])if("object"==typeof t[n][i]){const s=t[n][i][o];if("string"==typeof s&&s.length>0){fs_extra_1.default.existsSync(path_1.default.isAbsolute(s)?s:path_1.default.join(e,s))&&d(`i18nFiles.${n}.${o}`,s,!0)}}}try{const n=fs_extra_1.default.readJSONSync(path_1.default.join(e,i));for(const e in n)t("ios",n,e),t("android",n,e)}catch(e){return e.message}}(e,B);if(i)throw n.message("fail",i),new Error("copyi18NFiles error "+i)}const M=path_1.default.join(i,"project.miniapp.json");try{const e=fs_extra_1.default.readJsonSync(M);let{theme:i}=t;t.theme||(i="Dark"),e.__splashscreenTheme=i,fs_extra_1.default.writeJSONSync(M,e)}catch(e){throw new Error(`ReadWriteJsonFailed projectMiniappJsonCacheFilePath: ${M},error ${e.message}`)}const L=c["mini-plugin"];return L&&Array.isArray(L.ios)&&L.ios.forEach(e=>{!0===e.open&&e.resourcePath&&d(`mini-plugin ios ${e.pluginId}:${e.resourcePath}`,e.resourcePath)}),{projectMiniappJson:_,projectConfigJson:m,appJson:b,privacyJson:w,privacyContentViewImage:I,privacyCancelButtonImage:x,privacyConfirmButtonImage:j,icons:E,splashScreen:O,p12:$,profile:T,tpnsProfile:k,i18nJson:F}}async codesignIOSApp(e,i){const{projectPath:t,demoIpaPath:n,opts:o}=e,s=await(0,codesign_1.codesignAndExport)(t,n,e.miniappCacheDir||"",o,i,e.isUsingTpush,!1,!0);if(!0!==s.success)throw new Error("Build ipa failed:"+(s.errMsg||"codesignAndExport failed"))}async packIOSCloudBuildMaterial(e,i){i.progress("start uploadProjectAllMaterial");const{projectPath:t,matrialDistPath:n,theme:o}=e;await this.genProjectMaterialMap(t,n,e,i);i.progress("packIOSCloudBuildMaterial done")}async initUSBConnectionProcess(e,i){await(0,usbProcess_1.startUSBManagerProcess)(e,i)&&i.progress("Init USB Process Successfully")}launchSimulator(e,i){let t;try{t=JSON.parse(child_process.execFileSync("xcrun",["simctl","list","--json","devices"],{encoding:"utf8",env:(0,env_1.getProcessEnv)()}))}catch(e){throw new Error("Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues."+e.message)}const n=["iPhone 13","iPhone 12","iPhone 11"].reduce((e,i)=>e||deviceUtils.findMatchingSimulator(t,{device:i}),deviceUtils.findMatchingSimulator(t,e));if(!n)throw new Error("No simulator available with "+(e.device?`name "${e.device}"`:`udid "${e.udid}"`));const o=child_process.execFileSync("xcode-select",["-p"],{encoding:"utf8",env:(0,env_1.getProcessEnv)()}).trim();if(child_process.execFileSync("open",[o+"/Applications/Simulator.app","--args","-CurrentDeviceUDID",n.udid],{env:(0,env_1.getProcessEnv)()}),!n.booted){const e=deviceUtils.formattedDeviceName(n);i.progress("Launching "+e),child_process.spawnSync("xcrun",["simctl","boot",n.udid],{env:(0,env_1.getProcessEnv)()})}return n}async runOnSimulatorCloud(e,i,t){const{udid:n}=i,o=this.launchSimulator({udid:n},t);await this.installAppOnSimulator(o,e,t),await this.launchAppOnSimulator(o,e,t)}async runOnSimulatorLocal(e,i,t,n){const o=this.launchSimulator(t,n),{appPath:s}=await this.buildProjectApp(e,{udid:o.udid,scheme:i},n);await this.installAppOnSimulator(o,s,n),await this.launchAppOnSimulator(o,s,n)}async runOnDeviceLocal(e,i,t,n){const{appPath:o}=await this.buildProjectApp(e,{udid:t.udid,scheme:i},n);if("catalyst"===t.type){child_process.spawn(`${o}/${i}`,[],{detached:!0,stdio:"ignore",env:(0,env_1.getProcessEnv)()}).unref()}else{const e=["--bundle",o,"--id",t.udid,"--justlaunch"];n.progress("Installing and launching your app on "+t.name);const i=path_1.default.join(__dirname,"../../../vendor/ios-deploy/ios-deploy");await(0,cp_1.spawnSync)(i,e,{},n)}return n.progress("Install successfully the app to the device.")}buildProjectApp(e,i,t){return new Promise((n,o)=>{const{scheme:s,udid:a}=i,r=[e.isWorkspace?"-workspace":"-project",e.name,"-scheme",s];let c;a&&r.push("-destination","id="+a),t.progress(`Building (using "xcodebuild ${r.join(" ")}")`),this.xcbeautifyAvailable()?c=child_process.spawn("xcbeautify",[],{stdio:["pipe",process.stdout,process.stderr],env:(0,env_1.getProcessEnv)()}):this.xcprettyAvailable()&&(c=child_process.spawn("xcpretty",[],{stdio:["pipe",process.stdout,process.stderr],env:(0,env_1.getProcessEnv)()}));const l=child_process.spawn("xcodebuild",r,{env:(0,env_1.getProcessEnv)()});let d="",p="";l.stdout.on("data",e=>{const i=e.toString();t.progress(i),d+=i,c&&c.stdin.write(e)}),l.stderr.on("data",e=>{const i=e.toString();p+=i,t.progress(i)}),l.on("close",i=>{if(c&&c.stdin.end(),0!==i)return void o(new Error(` Failed to build iOS project.\n We ran "xcodebuild" command but it exited with error code ${i}. To debug build\n logs further, consider building your app with Xcode.app, by opening\n ${e.name}.\n ${c?void 0:`${d}\n${p}`}\n `));let a;try{a=this.getBuildInfo(e,d,s)}catch(e){o(e)}t.progress("Successfully built the app"),n(a)})})}async installAppOnSimulator(e,i,t){const n=["simctl","install",e.udid,i];await(0,cp_1.spawnSync)("xcrun",n,{},t)}async launchAppOnSimulator(e,i,t){const n=this.getBundleId(i),o=["simctl","launch",e.udid,n];await(0,cp_1.spawnSync)("xcrun",o,{},t),t.progress("Successfully launched the app on the simulator")}async buildProjectArchive(e,i,t){const{output:n,scheme:o,udid:s}=i,a=path_1.default.join(n,"./app"),{sourceDir:r}=e;fs_extra_1.default.ensureDirSync(path_1.default.dirname(a));const c=["archive",e.isWorkspace?"-workspace":"-project",e.name,"-scheme",o,"-archivePath",a];s&&c.push("-destination","id="+s);try{if(await(0,cp_1.spawnSync)("xcodebuild",c,{cwd:r},t),!fs_extra_1.default.existsSync(a+".xcarchive"))throw new Error(`Failed to build iOS project.\n ${a+".xcarchive"} does not found\n `);return t.progress(`Successfully archive the app: ${a}.xcarchive`),a+".xcarchive"}catch(i){throw new Error(`Failed to build iOS project. To debug build\n logs further, consider building your app with Xcode.app, by opening\n ${e.name}.\n `)}}async exportArchive(e,i,t,n){const o=path_1.default.join(t.output,"ipa");fs_extra_1.default.ensureDirSync(o),fs_extra_1.default.emptyDirSync(o);const{exportOptionPlistPath:s}=t;if(!s)throw new Error("build ios ipa require exportOptionPlistPath in project.miniapp.json");let a="";a=path_1.default.isAbsolute(s)?s:path_1.default.join(t.projectPath,s);const r=["-exportArchive","-archivePath",i,"-exportOptionsPlist",a,"-exportPath",o];try{await(0,cp_1.spawnSync)("xcodebuild",r,{cwd:e.sourceDir},n)}catch(i){throw new Error(`To debug build\n logs further, consider building your app with Xcode.app, by opening\n ${e.name}.\n `)}return fs_extra_1.default.removeSync(i),o}getTargetPaths(e){const i=JSON.parse(e);for(const e in i){if("app"===i[e].buildSettings.WRAPPER_EXTENSION)return{targetBuildDir:i[e].buildSettings.TARGET_BUILD_DIR,executableFolderPath:i[e].buildSettings.EXECUTABLE_FOLDER_PATH}}return{}}getBuildInfo(e,i,t){const n=this.getPlatformName(i),o=[e.isWorkspace?"-workspace":"-project",e.name,"-scheme",t,"-sdk",n,"-showBuildSettings","-json"].join(" "),s=child_process.execSync("xcodebuild "+o,{encoding:"utf8",cwd:e.sourceDir,env:(0,env_1.getProcessEnv)()}),a=this.getBuildProductDir(i),{executableFolderPath:r}=this.getTargetPaths(s);if(!r)throw new Error("Failed to get the app name.");return{sdk:n,appPath:`${a}/${r}`}}getPlatformName(e){const i=/export PLATFORM_NAME\\?="?(\w+)"?$/m.exec(e);if(!i)throw new Error("Couldn't find PLATFORM_NAME in xcodebuild output.");return i[1]}getBuildProductDir(e){const i=/export BUILT_PRODUCTS_DIR\\?="?(.+)"?$/m.exec(e);if(!i)throw new Error("Couldn't find BUILT_PRODUCTS_DIR in xcodebuild output.");return i[1]}xcbeautifyAvailable(){try{child_process.execSync("xcbeautify --version",{stdio:[0,"pipe","ignore"],env:(0,env_1.getProcessEnv)()})}catch(e){return!1}return!0}xcprettyAvailable(){try{child_process.execSync("xcpretty --version",{stdio:[0,"pipe","ignore"],env:(0,env_1.getProcessEnv)()})}catch(e){return!1}return!0}async buildPlugin(e,i){const{pluginId:t,projectPath:n,buildShellPath:o}=e;i.progress("start build native plugin...");try{const e=[n,t];fs_extra_1.default.chmodSync(o,"777"),buildIOSPluginTask[t]?(i.message("fail","存在未结束的插件构建任务,需等待构建结束..."),await buildIOSPluginTask[t].getResult(!0)):(buildIOSPluginTask[t]=new singletontask_1.SingletonTask(cp_1.spawnSyncExecShell.bind(null,o,e,{},i)),await buildIOSPluginTask[t].getResult(!0),buildIOSPluginTask[t]=void 0)}catch(e){throw buildIOSPluginTask[t]=void 0,new Error("build plugin failed: "+e)}}async writeI18NInfoFile(e,i,t){Object.keys(i).forEach(n=>{if("base"===n)return;let o="";Object.keys(t).forEach(e=>{var s,a,r,c;(null===(a=null===(s=i[n])||void 0===s?void 0:s.ios)||void 0===a?void 0:a[t[e]])&&(o+=`${e} = "${null===(c=null===(r=i[n])||void 0===r?void 0:r.ios)||void 0===c?void 0:c[t[e]]}";\n`)}),o&&(fs_extra_1.default.ensureDirSync(path_1.default.join(e,n+".lproj")),fs_extra_1.default.writeFileSync(path_1.default.join(e,n+".lproj/InfoPlist.strings"),o))})}}exports.IOSUtils=IOSUtils;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IOSUtils=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),path_1=tslib_1.__importDefault(require("path")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),env_1=require("../../../utils/env"),deviceUtils=tslib_1.__importStar(require("./device")),projectConfigUtils=tslib_1.__importStar(require("./projectconfig")),cp_1=require("../../../utils/cp"),miniapp_builder_1=require("../../../utils/miniapp-builder"),usbProcess_1=require("../../../utils/usbProcess"),miniappJson_1=require("../../../utils/miniappJson"),singletontask_1=require("../../../utils/singletontask"),buildCloud_1=tslib_1.__importStar(require("./buildCloud")),tools_1=require("../../../utils/tools"),codesign_1=require("../../../utils/codesign"),ProjectMiniappJsonSplashScreenThemeKey="__splashscreenTheme",_iconInfoMap={appStore1024:{size:[1024,1024],scale:1,idiom:"ios-marketing",required:!0},mainIcon120:{size:[60,60],scale:2,idiom:"iphone",required:!0},mainIcon180:{size:[60,60],scale:3,idiom:"iphone"},spotlightIcon80:{size:[40,40],scale:2,idiom:"iphone"},spotlightIcon120:{size:[40,40],scale:3,idiom:"iphone"},settingsIcon58:{size:[29,29],scale:2,idiom:"iphone"},settingsIcon87:{size:[29,29],scale:3,idiom:"iphone"},notificationIcon40:{size:[20,20],scale:2,idiom:"iphone"},notificationIcon60:{size:[20,20],scale:3,idiom:"iphone"},ipadMainIcon152:{size:[76,76],scale:2,idiom:"ipad"},ipadMainIcon167:{size:[83.5,83.5],scale:2,idiom:"ipad"},ipadSpotlightIcon40:{size:[40,40],scale:1,idiom:"ipad"},ipadSpotlightIcon80:{size:[40,40],scale:2,idiom:"ipad"},ipadSettingsIcon29:{size:[29,29],scale:1,idiom:"ipad"},ipadSpotlightIcon58:{size:[29,29],scale:2,idiom:"ipad"},ipadNotificationIcon20:{size:[20,20],scale:1,idiom:"ipad"},ipadNotificationIcon40:{size:[20,20],scale:2,idiom:"ipad"}},_allowTheme=["Light","LightSpecial","Dark","DarkSpecial","Default"],_getDepReg=e=>new RegExp(`s.subspec '${e}'.*\n(?:.*\n)*?(?:.*sp.vendored_frameworks = \\[\n)((?:.*'.*?'.*\n)*?)(?:.*\\]\n)`,"m"),buildIOSPluginTask={};class IOSUtils{constructor(e,i={},t,o){this.root=e,this.userConfig=i,this.miniappDirPath=t,this.devtoolsVersion=o}getProjectConfig(){const e=projectConfigUtils.getProjectConfig(this.root,this.userConfig);if(!e)throw new Error("iOS project folder not found. Are you sure this is a miniapp project?");return e}getBundleId(e){return child_process.execFileSync("/usr/libexec/PlistBuddy",["-c","Print:CFBundleIdentifier",path_1.default.join(e,"Info.plist")],{encoding:"utf8",env:(0,env_1.getProcessEnv)()}).trim()}tryInstallPod(e,i){const t=this.getProjectConfig(),{sourceDir:o}=t,n={cwd:o,env:(0,env_1.getProcessEnv)()};i.progress("export LANG=en_US.UTF-8 && pod install"),child_process.execSync("export LANG=en_US.UTF-8 && pod install",n)}async runLocal(e,i){const t=this.getProjectConfig(),{sourceDir:o}=t;process.chdir(o),this.tryInstallPod(e,i);const n=path_1.default.basename(t.name,path_1.default.extname(t.name)),s=e.scheme||n;if(i.progress(`Found Xcode ${t.isWorkspace?"workspace":"project"} "${t.name}"`),e.device||e.udid){if(e.udid||e.device){const o=await deviceUtils.getDevices({recorder:i}),n=o.find(i=>i.udid===e.udid||i.name===e.device);if(!n)throw new Error(`Could not find a device with udid(${e.udid}) or device(${e.device}). ${deviceUtils.printFoundDevices(o)}`);if("simulator"===n.type)return void await this.runOnSimulatorLocal(t,s,e,i);await this.runOnDeviceLocal(t,s,n,i)}}else await this.runOnSimulatorLocal(t,s,e,i)}async runCloud(e,i){try{const{deviceType:t,udid:o,projectPath:n,demoIpaPath:s,sdkPath:r,bindingInfo:a,certificateInfo:c,arch:l="arm64",pluginDirList:d,miniappCacheDirPath:u,theme:p,i18nInfo:h,debugInfo:f}=e,_=buildCloud_1.default.generateTempDemoIpaPath(s),m="simulator"===t,g=(0,miniappJson_1.tryGetIOSMiniappJson)(n);let b=a;if(c.signType===miniapp_builder_1.miniappSinTypes.appleId.type){const{mobileapp_info:e={}}=b;b=Object.assign(Object.assign({},b),{mobileapp_info:Object.assign(Object.assign({},e),{bundle_id:miniapp_builder_1.DEFAULT_BUNDLE_ID,debug_ios_bundle_id:miniapp_builder_1.DEFAULT_BUNDLE_ID})})}const v=await buildCloud_1.default.updateIOSInfoPlistInfo(n,b,_,g,i,h);await buildCloud_1.default.updateIOSAppConfigPlistInfo(n,b,_,g,r,m,i,p,h),await buildCloud_1.default.updateIOSAppexInfoPlistInfo(b,_,g,v,i),await buildCloud_1.default.updateIOSIcons(n,_,"",g,!1,i),await buildCloud_1.default.updateSplashScreen(n,_,g,i,p,h),await buildCloud_1.default.updateExtendedSdk(b,_,r,l,g,f,i),await buildCloud_1.default.updatePlugin(_,d,n,g,u,!1,v,i);const y=await buildCloud_1.default.getEntitlements(b,_,g,i);if("device"===t){const{mobileapp_info:e={}}=b,t=e.ios_flag&&e.bundle_id||e.debug_ios_bundle_id;await(0,miniapp_builder_1.signAndInstallOrExport)(n,_,u,c,{bundleId:t,install:!0,deviceId:o,entitlements:y},{recorder:i,miniappDirPath:this.miniappDirPath,devtoolsVersion:this.devtoolsVersion})}else await this.runOnSimulatorCloud(_,{udid:o},i)}catch(e){throw new Error(e.message)}}async buildLocal(e,i){const t=this.getProjectConfig();process.chdir(t.sourceDir);const o=path_1.default.basename(t.name,path_1.default.extname(t.name)),n=e.scheme||o;this.tryInstallPod(e,i),i.progress("start build ipa...");const s=await this.buildProjectArchive(t,{output:e.output,scheme:n},i),r=await this.exportArchive(t,s,e,i);return console.log("Successfully build ipa: "+r),r}async buildCloud(e,i){try{const{projectPath:t,certificateInfo:o,miniappCacheDirPath:n}=e,s=await buildCloud_1.default.buildCloud(e,i),{demoIpaPath:r,opts:a}=s,c={recorder:i,miniappDirPath:this.miniappDirPath,devtoolsVersion:this.devtoolsVersion};s.isPublish||e.CILocalBuild||await(0,miniapp_builder_1.signAndInstallOrExport)(t,r,n,o,a,c)}catch(e){throw new Error(e.message)}}async genProjectMaterialMap(e,i,t,o){var n,s;const r=buildCloud_1.remoteBuildProjectMaterialAbsoluteCacheDir,a=path_1.default.join(i,r),c=(0,miniappJson_1.tryGetIOSMiniappJson)(e);function l(e,i){fs_extra_1.default.ensureDirSync(path_1.default.dirname(i)),fs_extra_1.default.copyFileSync(e,i)}function d(t,o,n=!0){if(!o){if(n)return"";throw new Error(`file cant be empty for cloud build, key: ${t} , fileName: ${o}`)}if(path_1.default.isAbsolute(o)){const e=path_1.default.basename(o);if(!fs_extra_1.default.existsSync(o)){if(n)return"";throw new Error(`file cant be empty for cloud build, key: ${t} , fileName: ${o}`)}const i=(0,tools_1.generateMD5)(o);return l(o,path_1.default.join(a,`${i}_${e}`)),path_1.default.join(r,e)}const s=path_1.default.join(e,o),c=path_1.default.join(i,o);if(!fs_extra_1.default.existsSync(s)){if(n)return"";throw new Error(`file cant be empty for cloud build, key: ${t} , fileName: ${o}`)}return l(s,c),o}fs_extra_1.default.ensureDirSync(a);const{privacy:u={},icons:p={},splashscreen:h={},buildCloud:f={}}=c,_=d("project.miniapp.json","project.miniapp.json",!1),m=d("project.config.json","project.config.json",!1),g=(0,miniappJson_1.getMiniprogramRoot)(e),b=d("app.json",path_1.default.join(g,"app.json"),!1),{template:v,contentViewImage:y,cancelButtonImage:S,confirmButtonImage:P}=u,w=d("privacy template",v),I=d("privacy contentViewImage",y),x=d("privacy cancelButtonImage",S),j=d("privacy confirmButtonImage",P),E=[];for(const e in p)if(p[e]){const i=d("icons."+e,p[e],!1);i&&E.push(i)}const O=d("splashscreen.customImage",h.customImage),{p12:D,profile:C,tpnsProfile:A}=f,$=d("p12 Path",D,!1),T=d("profile Path",C,!1);let k=void 0;!0===(null===(n=null==c?void 0:c.tpush)||void 0===n?void 0:n.useExtendedLib_WeAppTPNS)&&(k=d("tpns profile Path",A,!0!==(null===(s=null==c?void 0:c.tpush)||void 0===s?void 0:s.useExtendedLib_WeAppTPNS)));const B="miniapp/ios/i18nInfo.json",U=path_1.default.join(e,B),F=d("i18n",B,!0);if(fs_extra_1.default.existsSync(U)){const i=function(e,i){function t(i,t,o){if(t[o]&&"object"==typeof t[o][i])for(const n in t[o][i])if("object"==typeof t[o][i]){const s=t[o][i][n];if("string"==typeof s&&s.length>0){fs_extra_1.default.existsSync(path_1.default.isAbsolute(s)?s:path_1.default.join(e,s))&&d(`i18nFiles.${o}.${n}`,s,!0)}}}try{const o=fs_extra_1.default.readJSONSync(path_1.default.join(e,i));for(const e in o)t("ios",o,e),t("android",o,e)}catch(e){return e.message}}(e,B);if(i)throw o.message("error",i),new Error("copyi18NFiles error "+i)}const L=path_1.default.join(i,"project.miniapp.json");try{const e=fs_extra_1.default.readJsonSync(L);let{theme:i}=t;t.theme||(i="Dark"),e.__splashscreenTheme=i,fs_extra_1.default.writeJSONSync(L,e)}catch(e){throw new Error(`ReadWriteJsonFailed projectMiniappJsonCacheFilePath: ${L},error ${e.message}`)}const M=c["mini-plugin"];return M&&Array.isArray(M.ios)&&M.ios.forEach(e=>{!0===e.open&&e.resourcePath&&d(`mini-plugin ios ${e.pluginId}:${e.resourcePath}`,e.resourcePath)}),{projectMiniappJson:_,projectConfigJson:m,appJson:b,privacyJson:w,privacyContentViewImage:I,privacyCancelButtonImage:x,privacyConfirmButtonImage:j,icons:E,splashScreen:O,p12:$,profile:T,tpnsProfile:k,i18nJson:F}}async codesignIOSApp(e,i){const{projectPath:t,demoIpaPath:o,opts:n}=e,s=await(0,codesign_1.codesignAndExport)(t,o,e.miniappCacheDir||"",n,i,e.isUsingTpush,!1,!0);if(!0!==s.success)throw new Error("Build ipa failed:"+(s.errMsg||"codesignAndExport failed"))}async packIOSCloudBuildMaterial(e,i){i.progress("start uploadProjectAllMaterial");const{projectPath:t,matrialDistPath:o,theme:n}=e;await this.genProjectMaterialMap(t,o,e,i);i.progress("packIOSCloudBuildMaterial done")}async initUSBConnectionProcess(e,i){await(0,usbProcess_1.startUSBManagerProcess)(e,i)&&i.progress("Init USB Process Successfully")}launchSimulator(e,i){let t;try{t=JSON.parse(child_process.execFileSync("xcrun",["simctl","list","--json","devices"],{encoding:"utf8",env:(0,env_1.getProcessEnv)()}))}catch(e){throw new Error("Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues."+e.message)}const o=["iPhone 13","iPhone 12","iPhone 11"].reduce((e,i)=>e||deviceUtils.findMatchingSimulator(t,{device:i}),deviceUtils.findMatchingSimulator(t,e));if(!o)throw new Error("No simulator available with "+(e.device?`name "${e.device}"`:`udid "${e.udid}"`));const n=child_process.execFileSync("xcode-select",["-p"],{encoding:"utf8",env:(0,env_1.getProcessEnv)()}).trim();if(child_process.execFileSync("open",[n+"/Applications/Simulator.app","--args","-CurrentDeviceUDID",o.udid],{env:(0,env_1.getProcessEnv)()}),!o.booted){const e=deviceUtils.formattedDeviceName(o);i.progress("Launching "+e),child_process.spawnSync("xcrun",["simctl","boot",o.udid],{env:(0,env_1.getProcessEnv)()})}return o}async runOnSimulatorCloud(e,i,t){const{udid:o}=i,n=this.launchSimulator({udid:o},t);await this.installAppOnSimulator(n,e,t),await this.launchAppOnSimulator(n,e,t)}async runOnSimulatorLocal(e,i,t,o){const n=this.launchSimulator(t,o),{appPath:s}=await this.buildProjectApp(e,{udid:n.udid,scheme:i},o);await this.installAppOnSimulator(n,s,o),await this.launchAppOnSimulator(n,s,o)}async runOnDeviceLocal(e,i,t,o){const{appPath:n}=await this.buildProjectApp(e,{udid:t.udid,scheme:i},o);if("catalyst"===t.type){child_process.spawn(`${n}/${i}`,[],{detached:!0,stdio:"ignore",env:(0,env_1.getProcessEnv)()}).unref()}else{const e=["--bundle",n,"--id",t.udid,"--justlaunch"];o.progress("Installing and launching your app on "+t.name);const i=path_1.default.join(__dirname,"../../../vendor/ios-deploy/ios-deploy");await(0,cp_1.spawnSync)(i,e,{},o)}return o.progress("Install successfully the app to the device.")}buildProjectApp(e,i,t){return new Promise((o,n)=>{const{scheme:s,udid:r}=i,a=[e.isWorkspace?"-workspace":"-project",e.name,"-scheme",s];let c;r&&a.push("-destination","id="+r),t.progress(`Building (using "xcodebuild ${a.join(" ")}")`),this.xcbeautifyAvailable()?c=child_process.spawn("xcbeautify",[],{stdio:["pipe",process.stdout,process.stderr],env:(0,env_1.getProcessEnv)()}):this.xcprettyAvailable()&&(c=child_process.spawn("xcpretty",[],{stdio:["pipe",process.stdout,process.stderr],env:(0,env_1.getProcessEnv)()}));const l=child_process.spawn("xcodebuild",a,{env:(0,env_1.getProcessEnv)()});let d="",u="";l.stdout.on("data",e=>{const i=e.toString();t.progress(i),d+=i,c&&c.stdin.write(e)}),l.stderr.on("data",e=>{const i=e.toString();u+=i,t.progress(i)}),l.on("close",i=>{if(c&&c.stdin.end(),0!==i)return void n(new Error(` Failed to build iOS project.\n We ran "xcodebuild" command but it exited with error code ${i}. To debug build\n logs further, consider building your app with Xcode.app, by opening\n ${e.name}.\n ${c?void 0:`${d}\n${u}`}\n `));let r;try{r=this.getBuildInfo(e,d,s)}catch(e){n(e)}t.progress("Successfully built the app"),o(r)})})}async installAppOnSimulator(e,i,t){const o=["simctl","install",e.udid,i];await(0,cp_1.spawnSync)("xcrun",o,{},t)}async launchAppOnSimulator(e,i,t){const o=this.getBundleId(i),n=["simctl","launch",e.udid,o];await(0,cp_1.spawnSync)("xcrun",n,{},t),t.progress("Successfully launched the app on the simulator")}async buildProjectArchive(e,i,t){const{output:o,scheme:n,udid:s}=i,r=path_1.default.join(o,"./app"),{sourceDir:a}=e;fs_extra_1.default.ensureDirSync(path_1.default.dirname(r));const c=["archive",e.isWorkspace?"-workspace":"-project",e.name,"-scheme",n,"-archivePath",r];s&&c.push("-destination","id="+s);try{if(await(0,cp_1.spawnSync)("xcodebuild",c,{cwd:a},t),!fs_extra_1.default.existsSync(r+".xcarchive"))throw new Error(`Failed to build iOS project.\n ${r+".xcarchive"} does not found\n `);return t.progress(`Successfully archive the app: ${r}.xcarchive`),r+".xcarchive"}catch(i){throw new Error(`Failed to build iOS project. To debug build\n logs further, consider building your app with Xcode.app, by opening\n ${e.name}.\n `)}}async exportArchive(e,i,t,o){const n=path_1.default.join(t.output,"ipa");fs_extra_1.default.ensureDirSync(n),fs_extra_1.default.emptyDirSync(n);const{exportOptionPlistPath:s}=t;if(!s)throw new Error("build ios ipa require exportOptionPlistPath in project.miniapp.json");let r="";r=path_1.default.isAbsolute(s)?s:path_1.default.join(t.projectPath,s);const a=["-exportArchive","-archivePath",i,"-exportOptionsPlist",r,"-exportPath",n];try{await(0,cp_1.spawnSync)("xcodebuild",a,{cwd:e.sourceDir},o)}catch(i){throw new Error(`To debug build\n logs further, consider building your app with Xcode.app, by opening\n ${e.name}.\n `)}return fs_extra_1.default.removeSync(i),n}getTargetPaths(e){const i=JSON.parse(e);for(const e in i){if("app"===i[e].buildSettings.WRAPPER_EXTENSION)return{targetBuildDir:i[e].buildSettings.TARGET_BUILD_DIR,executableFolderPath:i[e].buildSettings.EXECUTABLE_FOLDER_PATH}}return{}}getBuildInfo(e,i,t){const o=this.getPlatformName(i),n=[e.isWorkspace?"-workspace":"-project",e.name,"-scheme",t,"-sdk",o,"-showBuildSettings","-json"].join(" "),s=child_process.execSync("xcodebuild "+n,{encoding:"utf8",cwd:e.sourceDir,env:(0,env_1.getProcessEnv)()}),r=this.getBuildProductDir(i),{executableFolderPath:a}=this.getTargetPaths(s);if(!a)throw new Error("Failed to get the app name.");return{sdk:o,appPath:`${r}/${a}`}}getPlatformName(e){const i=/export PLATFORM_NAME\\?="?(\w+)"?$/m.exec(e);if(!i)throw new Error("Couldn't find PLATFORM_NAME in xcodebuild output.");return i[1]}getBuildProductDir(e){const i=/export BUILT_PRODUCTS_DIR\\?="?(.+)"?$/m.exec(e);if(!i)throw new Error("Couldn't find BUILT_PRODUCTS_DIR in xcodebuild output.");return i[1]}xcbeautifyAvailable(){try{child_process.execSync("xcbeautify --version",{stdio:[0,"pipe","ignore"],env:(0,env_1.getProcessEnv)()})}catch(e){return!1}return!0}xcprettyAvailable(){try{child_process.execSync("xcpretty --version",{stdio:[0,"pipe","ignore"],env:(0,env_1.getProcessEnv)()})}catch(e){return!1}return!0}async buildPlugin(e,i){const{pluginId:t,projectPath:o,buildShellPath:n}=e;i.progress("start build native plugin...");try{const e=[o,t];fs_extra_1.default.chmodSync(n,"777"),buildIOSPluginTask[t]?(i.message("error","存在未结束的插件构建任务,需等待构建结束..."),await buildIOSPluginTask[t].getResult(!0)):(buildIOSPluginTask[t]=new singletontask_1.SingletonTask(cp_1.spawnSyncExecShell.bind(null,n,e,{},i)),await buildIOSPluginTask[t].getResult(!0),buildIOSPluginTask[t]=void 0)}catch(e){throw buildIOSPluginTask[t]=void 0,new Error("build plugin failed: "+e)}}async writeI18NInfoFile(e,i,t){Object.keys(i).forEach(o=>{if("base"===o)return;let n="";Object.keys(t).forEach(e=>{var s,r,a,c;(null===(r=null===(s=i[o])||void 0===s?void 0:s.ios)||void 0===r?void 0:r[t[e]])&&(n+=`${e} = "${null===(c=null===(a=i[o])||void 0===a?void 0:a.ios)||void 0===c?void 0:c[t[e]]}";\n`)}),n&&(fs_extra_1.default.ensureDirSync(path_1.default.join(e,o+".lproj")),fs_extra_1.default.writeFileSync(path_1.default.join(e,o+".lproj/InfoPlist.strings"),n))})}}exports.IOSUtils=IOSUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConditionCompiler=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),fs_1=tslib_1.__importDefault(require("fs")),define_1=require("../../../config/define"),plant_1=require("./compiler/plant"),json_1=require("./compiler/json"),macro_1=require("./compiler/macro"),minimatch_1=tslib_1.__importDefault(require("minimatch")),tools_1=require("../../../utils/tools"),defaultCompileSetting={targetPlatform:define_1.PLATFORM["mini-weixin"],targetPlatformDefines:{}};class ConditionCompiler{constructor(t,e){this.extToCompiler={},this.project=t,this.devtoolMessagehub=e}getCompiler(t,e){const{targetPlatform:o,targetPlatformDefines:i={}}=e;if(!Object.values(define_1.PLATFORM).includes(o))throw new Error(`platform ${o} is not supported`);if(!this.extToCompiler[t]){let e=null;const r={targetPlatform:o,targetPlatformDefines:i,type:t};e=[".wxml",".wxss",".less",".scss",".wxs",".ts",".js"].includes(t)?new macro_1.MacroConditionCompiler(r):".json"===t?new json_1.JSONConditionCompiler(r):new plant_1.PlantConditionCompiler(r),this.extToCompiler[t]=e}return this.extToCompiler[t].targetPlatform=e.targetPlatform,this.extToCompiler[t].targetPlatformDefines=e.targetPlatformDefines||{},this.extToCompiler[t]}shouldCompile(t){return!this.project.miniprogramRoot||this.project.miniprogramRoot&&t.startsWith(this.project.miniprogramRoot)||"project.config.json"===t||"project.private.config.json"===t}compileFile(t,e=defaultCompileSetting){var o;try{const o=path_1.default.join(this.project.projectPath,t);if(!fs_1.default.existsSync(o))throw Error("no such file or direactory: "+o);const i=path_1.default.extname(o),r=this.getCompiler(i,e).compile(o,this.project.getFile("",t));return Buffer.isBuffer(r)?r:Buffer.from(r)}catch(t){throw null===(o=this.devtoolMessagehub)||void 0===o||o.showBuildLog("compileFile","error",t.message),t}}compileProject(t=defaultCompileSetting){var e;if(!Object.values(define_1.PLATFORM).includes(t.targetPlatform))throw new Error(`platform ${t.targetPlatform} is not supported`);try{const e={},{targetPlatform:o,targetPlatformDefines:i={}}=t,r=this.project.getFileList();for(const t of r){if(!this.shouldCompile(t))continue;const r=this.compileFile(t,{targetPlatform:o,targetPlatformDefines:i});e[t]=r}}catch(t){throw null===(e=this.devtoolMessagehub)||void 0===e||e.showBuildLog("compileProject","error",t.message),t}return{}}filterResourceByPlatfrom(t=defaultCompileSetting){const{targetPlatform:e=define_1.PLATFORM["mini-weixin"]}=t;let o=this.project.getFileList();const i=(0,tools_1.getAppJson)(this.project,e).static||[];for(const t of i){const{pattern:i="",platforms:r=[]}=t,s=path_1.default.join(this.project.miniprogramRoot||"",i);if(!r.includes(e)){const t=o.filter(t=>(0,minimatch_1.default)(t,s));o=o.filter(e=>!t.includes(e)&&e!==s&&!(0,tools_1.normalizePath)(e).startsWith((0,tools_1.normalizePath)(s)))}}return o}}exports.ConditionCompiler=ConditionCompiler;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConditionCompiler=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),fs_1=tslib_1.__importDefault(require("fs")),define_1=require("../../../config/define"),plant_1=require("./compiler/plant"),json_1=require("./compiler/json"),macro_1=require("./compiler/macro"),minimatch_1=tslib_1.__importDefault(require("minimatch")),tools_1=require("../../../utils/tools"),defaultCompileSetting={targetPlatform:define_1.PLATFORM["mini-weixin"],targetPlatformDefines:{}};class ConditionCompiler{constructor(t,e,o){this.extToCompiler={},this.project=t,this.devtoolMessagehub=e,this.consoleDisplay=o}getCompiler(t,e){const{targetPlatform:o,targetPlatformDefines:i={}}=e;if(!Object.values(define_1.PLATFORM).includes(o))throw new Error(`platform ${o} is not supported`);if(!this.extToCompiler[t]){let e=null;const r={targetPlatform:o,targetPlatformDefines:i,type:t};e=[".wxml",".wxss",".less",".scss",".wxs",".ts",".js"].includes(t)?new macro_1.MacroConditionCompiler(r):".json"===t?new json_1.JSONConditionCompiler(r):new plant_1.PlantConditionCompiler(r),this.extToCompiler[t]=e}return this.extToCompiler[t].targetPlatform=e.targetPlatform,this.extToCompiler[t].targetPlatformDefines=e.targetPlatformDefines||{},this.extToCompiler[t]}shouldCompile(t){return!this.project.miniprogramRoot||this.project.miniprogramRoot&&t.startsWith(this.project.miniprogramRoot)||"project.config.json"===t||"project.private.config.json"===t}compileFile(t,e=defaultCompileSetting){var o,i;try{const o=path_1.default.join(this.project.projectPath,t);if(!fs_1.default.existsSync(o))throw Error("no such file or direactory: "+o);const i=path_1.default.extname(o),r=this.getCompiler(i,e).compile(o,this.project.getFile("",t));return Buffer.isBuffer(r)?r:Buffer.from(r)}catch(t){throw null===(o=this.devtoolMessagehub)||void 0===o||o.showBuildLog("compileFile","error",t.message),null===(i=this.consoleDisplay)||void 0===i||i.display({command:"DISPLAY_ERROR",data:{error:{message:t.message}}}),t}}compileProject(t=defaultCompileSetting){var e;if(!Object.values(define_1.PLATFORM).includes(t.targetPlatform))throw new Error(`platform ${t.targetPlatform} is not supported`);try{const e={},{targetPlatform:o,targetPlatformDefines:i={}}=t,r=this.project.getFileList();for(const t of r){if(!this.shouldCompile(t))continue;const r=this.compileFile(t,{targetPlatform:o,targetPlatformDefines:i});e[t]=r}}catch(t){throw null===(e=this.devtoolMessagehub)||void 0===e||e.showBuildLog("compileProject","error",t.message),t}return{}}filterResourceByPlatfrom(t=defaultCompileSetting){const{targetPlatform:e=define_1.PLATFORM["mini-weixin"]}=t;let o=this.project.getFileList();const i=(0,tools_1.getAppJson)(this.project,e).static||[];for(const t of i){const{pattern:i="",platforms:r=[]}=t,s=path_1.default.join(this.project.miniprogramRoot||"",i);if(!r.includes(e)){const t=o.filter(t=>(0,minimatch_1.default)(t,s));o=o.filter(e=>!t.includes(e)&&e!==s&&!(0,tools_1.normalizePath)(e).startsWith((0,tools_1.normalizePath)(s)))}}return o}}exports.ConditionCompiler=ConditionCompiler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConditionCompiler=exports.PreCompiler=void 0;const precompileProject_1=require("../../project/advance/precompileProject"),define_1=require("../../config/define"),conditioncompile_1=require("./conditioncompile"),defaultCompileSetting={targetPlatform:define_1.PLATFORM["mini-weixin"],targetPlatformDefines:{}};class PreCompiler{constructor(e,o){this.project=e,this.devtoolMessagehub=o}async getPreCompileProject(e=defaultCompileSetting){const{targetPlatform:o=define_1.PLATFORM["mini-weixin"],targetPlatformDefines:i={},runEnv:t}=e,r=new conditioncompile_1.ConditionCompiler(this.project,this.devtoolMessagehub),n=new precompileProject_1.PreCompileProject(this.project,r,{targetPlatform:o,targetPlatformDefines:i,runEnv:t});return await n.ready(),n}}exports.PreCompiler=PreCompiler;var conditioncompile_2=require("./conditioncompile");Object.defineProperty(exports,"ConditionCompiler",{enumerable:!0,get:function(){return conditioncompile_2.ConditionCompiler}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConditionCompiler=exports.PreCompiler=void 0;const precompileProject_1=require("../../project/advance/precompileProject"),define_1=require("../../config/define"),conditioncompile_1=require("./conditioncompile"),defaultCompileSetting={targetPlatform:define_1.PLATFORM["mini-weixin"],targetPlatformDefines:{}};class PreCompiler{constructor(e,o,i){this.project=e,this.devtoolMessagehub=o,this.consoleDisplay=i}async getPreCompileProject(e=defaultCompileSetting){const{targetPlatform:o=define_1.PLATFORM["mini-weixin"],targetPlatformDefines:i={},runEnv:t}=e,r=new conditioncompile_1.ConditionCompiler(this.project,this.devtoolMessagehub,this.consoleDisplay),n=new precompileProject_1.PreCompileProject(this.project,r,{targetPlatform:o,targetPlatformDefines:i,runEnv:t});return await n.ready(),n}}exports.PreCompiler=PreCompiler;var conditioncompile_2=require("./conditioncompile");Object.defineProperty(exports,"ConditionCompiler",{enumerable:!0,get:function(){return conditioncompile_2.ConditionCompiler}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PreCompileProject=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),stream_1=require("stream"),baseProject_1=require("../baseProject"),tools_1=require("../../utils/tools"),define_1=require("../../config/define");class PreCompileProject extends baseProject_1.BaseProject{constructor(t,e,i){var r,s,o;if(super(),this.event=new stream_1.EventEmitter,this.targetPlatform=define_1.PLATFORM["mini-weixin"],this.targetPlatformDefines={},this._fileBufferCache={},this.onFileChange=async(t,e)=>{if(e=(0,tools_1.normalizePath)(e).replace(/\/$/,"").replace(/^\//,""),"add"===t&&(this.cacheDirName(this._dirSet,path_1.default.posix.dirname(e)),this._fileSet.add(e)
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PreCompileProject=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),stream_1=require("stream"),baseProject_1=require("../baseProject"),tools_1=require("../../utils/tools"),define_1=require("../../config/define");class PreCompileProject extends baseProject_1.BaseProject{constructor(t,e,i){var r,s,o;if(super(),this.event=new stream_1.EventEmitter,this.targetPlatform=define_1.PLATFORM["mini-weixin"],this.targetPlatformDefines={},this._fileBufferCache={},this.onFileChange=async(t,e)=>{if(e=(0,tools_1.normalizePath)(e).replace(/\/$/,"").replace(/^\//,""),"add"===t&&(this.cacheDirName(this._dirSet,path_1.default.posix.dirname(e)),this._fileSet.add(e)),"addDir"===t&&this.cacheDirName(this._dirSet,e),"unlink"===t&&(this.deleteDirOrFileOfSet(this._dirSet,this._fileSet,e),this._fileBufferCache[e]&&delete this._fileBufferCache[e]),"unlinkDir"===t&&this.deleteDirOrFileOfSet(this._dirSet,this._fileSet,e),"change"===t&&delete this._fileBufferCache[e],this.event.emit("fileChange",t,e),"change"===t&&e===path_1.default.posix.join(this.project.miniprogramRoot||"","app.json")){const t=Array.from(this._fileSet);this.updateFileAndDirs(),this.notifyRefreshFileOrDirs(t)}},this.project=t,this._projectPath=(0,tools_1.normalizePath)(t.projectPath),this._projectArchitecture=t.projectArchitecture,this._miniprogramRoot=t.miniprogramRoot||"",this._pluginRoot=t.pluginRoot,this._appid=t.appid,this._type=t.type?t.type:"miniProgram",this._privateKey=t.privateKey,this.ignores=t.ignores||[],null===(r=this.project.event)||void 0===r||r.on("fileChange",(t,e)=>{this.onFileChange(t,e)}),null===(s=this.project.event)||void 0===s||s.on("optionsChange",t=>{this.updateOptions(t)}),this.runEnv=i.runEnv,null===(o=this.project)||void 0===o?void 0:o.setting)this.setting=this.project.setting;else{const t=this.getProjectConfig();(null==t?void 0:t.setting)&&(this.setting=t.setting)}this.conditionCompiler=e,this.updateConditionCompileOptions({targetPlatform:i.targetPlatform||define_1.PLATFORM["mini-weixin"],targetPlatformDefines:i.targetPlatformDefines}),this.packOptions=t.packOptions||{ignore:[],include:[]}}async ready(){await this.wait(this.init.bind(this))}async init(){this.updateFileAndDirs()}shouldConditionalCompile(){var t;return!!(null===(t=this.project.setting)||void 0===t?void 0:t.condition)}updateOptions(t){this._appid=t.appid,this._attr=t.attr,this._type=this.getProjectType(t.attr,t.compileType),this._miniprogramRoot=t.miniprogramRoot,this._pluginRoot=t.pluginRoot,this._projectArchitecture=t.projectArchitecture,this.packOptions=t.packOptions||{ignore:[],include:[]}}updateConditionCompileOptions(t){const e=this.targetPlatform;if(this.targetPlatform=t.targetPlatform||define_1.PLATFORM["mini-weixin"],this.targetPlatformDefines=t.targetPlatformDefines||{},this.targetPlatform!==e){this._fileBufferCache={};const t=Array.from(this._fileSet);this.updateFileAndDirs(),this.notifyRefreshFileOrDirs(t),this.event.emit("precompileOptionsChange",{targetPlatform:this.targetPlatform,targetPlatformDefines:this.targetPlatformDefines})}}updateFileAndDirs(){var t,e;if(null===(t=this._fileSet)||void 0===t||t.clear(),null===(e=this._dirSet)||void 0===e||e.clear(),this.shouldConditionalCompile()){const t=this.conditionCompiler.filterResourceByPlatfrom({targetPlatform:this.targetPlatform});for(const e of t){const t=e.replace(/\\/g,path_1.default.posix.sep);this._fileSet.add(t),this.cacheDirName(this._dirSet,t)}}else{const{files:t,dirs:e}=this.project.getFilesAndDirs();this._fileSet=new Set(t),this._dirSet=new Set(e)}}get srcPath(){return this.project.srcPath||""}async attr(){return await this.project.attr()}async serialize(){const t=await super.serialize();return Object.assign(Object.assign({},t),{targetPlatform:this.targetPlatform,targetPlatformDefines:this.targetPlatformDefines})}getSrcFile(t="",e){return this.project.getFile(t,e)}getFile(t="",e){var i;const r=this.getTargetPath(t,e);if(!this._fileBufferCache[r]){if("condition"!==(null===(i=this._fileBufferCache[r])||void 0===i?void 0:i.type)&&this.shouldConditionalCompile())try{const t=this.conditionCompiler.compileFile(r,{targetPlatform:this.targetPlatform,targetPlatformDefines:this.targetPlatformDefines});return this._fileBufferCache[r]={content:t,type:"condition"},this._fileBufferCache[r].content}catch(t){}this._fileBufferCache[r]={content:this.project.getFile(t,e),type:"raw"}}return this._fileBufferCache[r].content}notifyRefreshFileOrDirs(t){const e=Array.from(this._fileSet);e.length!==t.length&&(e.forEach(e=>{t.includes(e)||this.event.emit("fileChange","add",e)}),t.forEach(t=>{e.includes(t)||this.event.emit("fileChange","unlink",t)}))}clearCache(){var t,e;this._fileBufferCache={},null===(e=(t=this.project).clearCache)||void 0===e||e.call(t)}}exports.PreCompileProject=PreCompileProject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CIProject=exports.getProjectAttr=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),fs_1=tslib_1.__importDefault(require("fs")),glob_1=tslib_1.__importDefault(require("glob")),config_1=require("../config/config"),locales_1=tslib_1.__importDefault(require("../utils/locales/locales")),error_1=require("../utils/error"),request_1=require("../utils/request"),types_1=require("../types"),tools_1=require("../utils/tools"),baseProject_1=require("./baseProject"),projectattr_1=require("../ci/projectattr");var projectattr_2=require("../ci/projectattr");Object.defineProperty(exports,"getProjectAttr",{enumerable:!0,get:function(){return projectattr_2.getProjectAttr}});class CIProject extends baseProject_1.BaseProject{constructor(t){super();const{type:e,projectPath:r,ignores:i,privateKey:o="",privateKeyPath:s=""}=t;let a=t.appid;if(!r)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format("projectPath"),config_1.PARAM_ERROR);this._projectPath=path_1.default.isAbsolute(r)?(0,tools_1.normalizePath)(r):(0,tools_1.normalizePath)(path_1.default.join(process.cwd(),r));const p=this.getProjectConfig();if(!a){if(!p.appid)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format("appid"),config_1.PARAM_ERROR);a=p.appid}if(o)this._privateKey=o;else{if(!s)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format("privateKeyPath"),config_1.PARAM_ERROR);try{this._privateKey=fs_1.default.readFileSync(s).toString("utf8")}catch(t){throw new error_1.CodeError(t.toString(),config_1.PARAM_ERROR)}}this._projectArchitecture=p.projectArchitecture||"miniProgram",this._miniprogramRoot=p.miniprogramRoot||"",this._pluginRoot=p.pluginRoot||"",this._appid=a,this._type=e||types_1.EProjectType.miniProgram,this.ignores=i||[],this.setting=p.setting||{},this._project=t,this.init()}get project(){return this._project}async init(){(0,request_1.initGlobalProxy)(),this.updateFileAndDirs()}updateFileAndDirs(){const t=glob_1.default.sync("**",{nodir:!1,ignore:[...(0,config_1.getDefaultIgnores)(this),...this.ignores],nosort:!0,strict:!1,silent:!0,cwd:this.projectPath,absolute:!1,mark:!0,dot:!0});for(const e of t){const t=e.replace(/\\/g,path_1.default.posix.sep),r=fs_1.default.statSync(path_1.default.posix.join(this.projectPath,e));r.isDirectory()&&this.cacheDirName(this._dirSet,t.replace(/\/$/,"")),r.isFile()&&(this._fileSet.add(t),this.cacheDirName(this._dirSet,path_1.default.posix.dirname(t)))}}async attr(){return"function"==typeof this._project.attr?await this._project.attr():(this._attr||(this._attr=await(0,projectattr_1.getProjectAttr)(this._privateKey,this._appid)),this._attr)}async getExtAppid(){if(this._extAppid)return this._extAppid;if(null!==this._extAppid)try{const t=await this.getProjectConfig(),{miniprogramRoot:e=""}=t,r=this.getFile(e,"ext.json"),i=JSON.parse(r.toString("utf-8"));return i.extEnable&&i.extAppid?this._extAppid=i.extAppid:this._extAppid=null,this._extAppid}catch(t){this._extAppid=null}}}exports.CIProject=CIProject;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CIProject=exports.getProjectAttr=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),fs_1=tslib_1.__importDefault(require("fs")),glob_1=tslib_1.__importDefault(require("glob")),config_1=require("../config/config"),locales_1=tslib_1.__importDefault(require("../utils/locales/locales")),error_1=require("../utils/error"),request_1=require("../utils/request"),types_1=require("../types"),tools_1=require("../utils/tools"),baseProject_1=require("./baseProject"),projectattr_1=require("../ci/projectattr"),miniappattr_1=require("../ci/miniappattr");var projectattr_2=require("../ci/projectattr");Object.defineProperty(exports,"getProjectAttr",{enumerable:!0,get:function(){return projectattr_2.getProjectAttr}});class CIProject extends baseProject_1.BaseProject{constructor(t){super();const{type:e,projectPath:r,ignores:i,privateKey:o="",privateKeyPath:s=""}=t;let a=t.appid;if(!r)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format("projectPath"),config_1.PARAM_ERROR);this._projectPath=path_1.default.isAbsolute(r)?(0,tools_1.normalizePath)(r):(0,tools_1.normalizePath)(path_1.default.join(process.cwd(),r));const p=this.getProjectConfig();if(!a){if(!p.appid)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format("appid"),config_1.PARAM_ERROR);a=p.appid}if(o)this._privateKey=o;else{if(!s)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format("privateKeyPath"),config_1.PARAM_ERROR);try{this._privateKey=fs_1.default.readFileSync(s).toString("utf8")}catch(t){throw new error_1.CodeError(t.toString(),config_1.PARAM_ERROR)}}this._projectArchitecture=p.projectArchitecture||"miniProgram",this._miniprogramRoot=p.miniprogramRoot||"",this._pluginRoot=p.pluginRoot||"",this._appid=a,this._type=e||types_1.EProjectType.miniProgram,this.ignores=i||[],this.setting=p.setting||{},this._project=t,this.init()}get project(){return this._project}async init(){(0,request_1.initGlobalProxy)(),this.updateFileAndDirs()}updateFileAndDirs(){const t=glob_1.default.sync("**",{nodir:!1,ignore:[...(0,config_1.getDefaultIgnores)(this),...this.ignores],nosort:!0,strict:!1,silent:!0,cwd:this.projectPath,absolute:!1,mark:!0,dot:!0});for(const e of t){const t=e.replace(/\\/g,path_1.default.posix.sep),r=fs_1.default.statSync(path_1.default.posix.join(this.projectPath,e));r.isDirectory()&&this.cacheDirName(this._dirSet,t.replace(/\/$/,"")),r.isFile()&&(this._fileSet.add(t),this.cacheDirName(this._dirSet,path_1.default.posix.dirname(t)))}}async attr(){return"function"==typeof this._project.attr?await this._project.attr():(this._attr||(this._attr=await(0,projectattr_1.getProjectAttr)(this._privateKey,this._appid)),this._attr)}async getExtAppid(){if(this._extAppid)return this._extAppid;if(null!==this._extAppid)try{const t=await this.getProjectConfig(),{miniprogramRoot:e=""}=t,r=this.getFile(e,"ext.json"),i=JSON.parse(r.toString("utf-8"));return i.extEnable&&i.extAppid?this._extAppid=i.extAppid:this._extAppid=null,this._extAppid}catch(t){this._extAppid=null}}isMiniappProject(){return"multiPlatform"===this._projectArchitecture}async miniappAttr(){return this.isMiniappProject()?this._miniappAttr?Promise.resolve(this._miniappAttr):(this._miniappAttr=await(0,miniappattr_1.getMiniappAttr)(this._privateKey,this._appid),this._miniappAttr):Promise.resolve({})}}exports.CIProject=CIProject;
|
package/dist/utils/codesign.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkXcodeEnv=exports.codesignAndExport=void 0;const generateIpa_1=require("./generateIpa"),singletontask_1=require("./singletontask"),cp_1=require("./cp"),env_1=require("./env"),path=require("path"),signAndInstallTask={};async function codesignAndExport(e,n,t,i,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkXcodeEnv=exports.codesignAndExport=void 0;const generateIpa_1=require("./generateIpa"),singletontask_1=require("./singletontask"),cp_1=require("./cp"),env_1=require("./env"),path=require("path"),signAndInstallTask={};async function codesignAndExport(e,n,t,s,i,r,a,c){var o;const{output:p}=s,d=path.join(__dirname,"../static/scripts/resignIpa"),l=await(0,generateIpa_1.generateIpa)(n,i),g=(null===(o=s.entitlements)||void 0===o?void 0:o["com.apple.developer.associated-domains"])||"";try{await checkXcodeEnv(i);const e=[l,p,s.outputAppWithName?s.outputAppWithName:"false",r?"true":"",g,t];let n=!1;if(s.certificate?(e.push(s.certificate),s.profile?(e.push(s.profile),n=!0,s.tpnsProfile&&(e.push(s.tpnsProfile),i.message("doing","certificate: find tpns profile"))):i.message("error","certificate: cant find profile")):!0===c?n=!0:i.message("error","certificate: cant find certificate"),!n)throw i.message("error","codesignAndExport missing needed info"),new Error("Failed! codesignAndExport missing needed info");return signAndInstallTask[l]||(signAndInstallTask[l]=new singletontask_1.SingletonTask(cp_1.spawnSyncExecShell.bind(null,d,e,{},i))),await signAndInstallTask[l].getResult(!0),{success:!0}}catch(e){return{success:!1,errMsg:e.message}}finally{delete signAndInstallTask[l]}}async function checkXcodeEnv(e){if(env_1.isWin)throw new Error("windows下不能使用分发证书签名。需启用远程构建");const n=path.join(__dirname,"../static/scripts/checkXcodeEnv");await(0,cp_1.spawnSyncExecShell)(n,[],{},e)}exports.codesignAndExport=codesignAndExport,exports.checkXcodeEnv=checkXcodeEnv;
|
package/dist/utils/cp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.spawnSyncExecShell=exports.spawnSync=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),env_1=require("./env");function spawnSync(e,n,o,s){return new Promise((c,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.spawnSyncExecShell=exports.spawnSync=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),env_1=require("./env");function spawnSync(e,n,o,s){return new Promise((c,r)=>{null==s||s.progress(`Run command: ${e} ${n.join(" ")}...`);const t=child_process.spawn(e,n,Object.assign({env:(0,env_1.getProcessEnv)()},o));t.stdout.on("data",e=>{null==s||s.progress(e.toString("utf-8"))}),t.stderr.on("data",e=>{null==s||s.progress(e.toString("utf-8"))}),t.on("close",o=>{0!==o?(null==s||s.message("doing",`Failed to exec command: ${e} ${n.join(" ")}`),r(`Failed to exec command: ${e} ${n.join(" ")}`)):(null==s||s.message("success",`Successful to exec command: ${e} ${n.join(" ")}`),c({}))}),t.on("error",o=>{null==s||s.message("doing",`Failed to exec command: ${e} ${n.join(" ")} becasue ${o}`),r(`Failed to exec command: ${e} ${n.join(" ")}`)})})}function spawnSyncExecShell(e,n,o,s){return new Promise((c,r)=>{null==s||s.progress(`Run command: ${e} ${n.join(" ")}...`);const t=child_process.spawn(e,n,Object.assign({env:(0,env_1.getProcessEnv)()},o));t.stdout.on("data",e=>{null==s||s.progress(e.toString("utf-8"))}),t.stderr.on("data",e=>{null==s||s.message("error",e.toString("utf-8"))}),t.on("close",o=>{0!==o?r(`Failed to exec command: ${e} ${n.join(" ")}`):(null==s||s.progress(`Successful to exec command: ${e} ${n.join(" ")}`),c({}))}),t.on("error",o=>{r(`Failed to exec command: ${e} ${n.join(" ")} becasue ${o}`)})})}exports.spawnSync=spawnSync,exports.spawnSyncExecShell=spawnSyncExecShell;
|
package/dist/utils/locales/en.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fomatable_string_1=require("./fomatable_string"),config={GENERATE_LOCAL_SIGNATURE_FAIL:"generate local signature fail. Usually this happens the content or encoding of private key file is incorrect. Detail: %s",PARAM_ERROR:'function: "%s" lack of parameter: "%s"',SHOULD_NOT_BE_EMPTY:"%s should not be empty",JSON_CONTENT_SHOULD_BE:"%s field needs to be %s",SHOULD_MATCH:"%s should match %s",SHOULD_EQUAL:"%s should equal to %s",SHOULD_AT_LEAST_ONE_ITEM:"%s should have at least on item",OR:"Or",CORRESPONDING_FILE_NOT_FOUND:'%s could not find the corresponding file: "%s"',JSON_SHOULD_NOT_CONTAIN:"%s should not contain %s",JSON_SHOULD_NOT_START_WITH:"%s should not begin with '%s'",NOT_FOUND:"%s not found",COMPONENT_NOT_FOUND:"%s, component not found in the path: %s",NOT_FOUND_IN_ROOT_DIR:"%s is not found in the project root directory",MINIPROGRAM_APP_JSON_NOT_FOUND:'In the directory %s specified by "miniprogramRoot" in project.config.json, %s is not found in that directory.If you don\'t know what "miniprogramRoot" means for, just leave it as empty string.',PLUGIN_JSON_NOT_FOUND:"In the miniprogram local development plug-in directory %s specified by pluginRoot in project.config.json, %s is not found",PLUGIN_PATH_SAME_WITH_MINIPROGRAM:"The plugin directory %s specified by pluginRoot in project.config.json is the same as the miniprogram directory %s, please modify it to a different directory",CONTENT_EXIST:"%s already exists",FILE_NOT_FOUND:'"%s" file not found, or the file read failed',JSON_PARSE_ERROR:"%s File parsing error",ENTRANCE_NOT_FOUND:"No pages : %s defined in the entry page \napp.json is found",JSON_PAGE_FILE_NOT_EXISTS:'%s %s "%s" could not find the corresponding %s file',SHOULD_NOT_IN:"%s Should not exist in %s",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS_TITLE:"app.json or custom compilation condition error",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS:"The startup page %s specified in the custom compilation is not defined in app.json",JSON_ENTRY_PAGE_PATH_NOT_FOUND:"No entry page defined in %s is found in %s",JSON_TABBAR_AT_LEAST:'["tabBar"]["list"] must contain at least %s items',JSON_TABBAR_AT_MOST:'["tabBar"]["list"] cannot contain more than %s items',JSON_TABBAR_PATH_EMPTY:'["tabBar"]["list"][%s]["pagePath"] cannot be empty',JSON_TABBAR_PATH_SAME_WITH_OTHER:'["tabBar"]["list"][%s]["pagePath"] is same with ["tabBar"]["list"][%s]["pagePath"]',JSON_TABBAR_ICON_MAX_SIZE:'The size of ["tabBar"]["list"][%s]["%s"] exceeds %skb',JSON_TABBAR_ICON_EXT:'["tabBar"]["list"][%s]["%s"] Wrong file format, only %s format is supported',EXT_SHOULD_BE_ERROR:'extension name of %s should be "%s"',JSON_CONTENT_SHOULD_NOT_BE:"%s cannot be %s",JSON_RESOLVE_ALIAS_ILLEGAL:'Invalid %s or %s in resolveAlias field, contains consecutive "//"',JSON_RESOLVE_ALIAS_INCLUDE_STAR:'The key "%s" or value "%s" in resolveAlias field should end with "/*"',JSON_RESOLVE_ALIAS_SHOULD_NOT_START_WITH:'The value "%s" in resolveAlias field should not start with "./"',APP_JSON_SKYLINE_WINDOW_TIPS:'Due to the "custom" navigationStyle of the Skyline page, the configuration of "navigationStyle", "navigationBarTextStyle", "navigationBarTitleText", and "navigationBarBackgroundColor" in app.json will not take effect.',APP_JSON_SHOULD_SET_LAZYCODELOADING:'You need to add "lazyCodeLoading": "requiredComponents" in app.json, since the value of "renderer" in %s is "skyline"',APP_JSON_SHOULD_SET_RENDEREROPTIONS:'You need to configure the "skyline" sub-option in the "rendererOptions" option in app.json, since the value of "renderer" in %s is "skyline"',JSON_SHOULD_SET_RENDEREROPTIONS:'You need to add "rendererOptions" field in %, as the "renderer" field is set to skyline。More detail: https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80',JSON_SHOULD_SET_RENDEREROPTIONS_SKYLINE:'You need to add "skyline" configuration in the rendererOptions field of the %, as the "renderer" field is set to skyline。More detail: https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80',JSON_SHOULD_SET_COMPONENTFRAMEWORK_SKYLINE:'You need to set the value of the "componentFramework" field to "glass-easel" in the %, as the "renderer" field is set to skyline。More detail: https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html',PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE:'According to the configuration of the page or app.json, the value of "renderer" in %s page is "skyline", the "disableScroll" configuration for the page should be set to true',PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM:'According to the configuration of the page or app.json, the value of "renderer" in %s page is "skyline", the "navigationStyle" configuration for the page should be set to "custom"',JSON_CONTENT_EXISTED:"%s already exists",JSON_CONTENT_NOT_FOUND:"%s does not exist",LACK_OF_FILE:"File %s is missing",JSON_PAGES_REPEAT:"%s is repeated in %s",JSON_CONTENT_REPEAT:"%s could not be declared both in %s",EXT_JSON_INVALID:'%s is not a 3rdMiniProgramAppid, ext.json cannot take effect;Read the documentation: "%s"',GAME_EXT_JSON_INVALID:"%s is not a 3rdMiniGameAppid, ext.json cannot take effect;",EXT_APPID_SHOULD_NOT_BE_EMPTY:"extAppid should not be empty",FILE_NOT_UTF8:"%s file is not in UTF-8 encoding",INVALID:"invalid %s",DIRECTORY:"Directory",EXCEED_LIMIT:"%s exceed limit %s",PLEASE_CHOOSE_PLUGIN_MODE:"If you are developing a plugin, choose the plugin mode",TRIPLE_NUMBER_DOT:"digit.digit.digit, each segment of digit is no more than 3 digits",PAGE_PATH:"Page Path",PLUGINS_SAME_ALIAS:"%s and %s have same alias",SAME_ITEM:'%s and %s have same "%s"',ALREADY_EXISTS:"already exists",SAME_KEY_PAGE_PUBLICCOMPONENTS:'There can not be the same key: %s in ["pages"] and ["publicComponents"]',GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH:"Dev plugin: %s shall never specify a local path",GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT:'MD5 hash of the plugin library file "%s": "%s" not matching the value "%s" given by its signature.json, thus the compiling process has been interrupted.\nThis indicates you might have changed the content of the file.\nRestore the original content of this file may help solve the issue and remove this warning.\n\nTo learn more, you may refer to the documentation.\n',FILE:"FILE",PROCESSING:"processing: %s",DONE:"done: %s",UPLOAD:"upload",SUCCESS:"success",PROJECT_TYPE_ERROR:"project.type is %s, but appid(%s) is %s",MINI_PROGRAM:"MiniProgram",MINI_GAME:"MiniGame",NOT_ALLOWED_REQUIRE_VAR:"Require variable is not allowed",NOT_ALLOWED_REQUIRE_ASSIGN:"Assigning the require function to other variables is not allowed",NOT_FOUND_NPM_ENTRY:"Npm package entry file not found",NOT_FOUND_NODE_MODULES:"NPM packages not found. Please confirm npm packages which need to build are belong to `miniprogramRoot` directory. Or you may edit project.config.json's `packNpmManually` and `packNpmRelationList`",JSON_ENTRANCE_DECLARE_PATH_ERR:'["entranceDeclare"]["locationMessage"]["path"] "%s" should belong to pages or pages in sub packages',JSON_ENTRANCE_DECLARE_PATH_EMPTY:'["entranceDeclare"]["locationMessage"]["path"] should not be empty',JSON_REQUIRED_PRIVATE_INFOS_MUTUALLY_EXCLUSIVE:"requiredPrivateInfos %s is is mutually exclusive with %s.",COULD_NOT_USE_CODE_PROTECT:"Code protect is not available",SUMMER_COMPILING_MODULE:"Compiling %s",SUMMER_COMPILE_JSON:"Compile jSON files",SUMMER_OPTIMIZE_CODE:"Optimize code",SUMMER_PACK_FILES:"Pack resource file",SUMMER_COMPRESS_PACK:"Compress code package",SUMMER_SEAL_PACK:"Seal code package",SUMMER_APPEND_BABEL_HELPERS:"Append babel helper files",SUMMER_COMPILE_PAGE_JSON:"Compile json files of %s pages",SUMMER_COMPILE_PLUGIN_PAGE_JSON:"Compiling json files of %s plugin pages",SUMMER_COMPILE:"Compile %s",SUMMER_COMPILE_MINIPROGRAM:"Compile miniprogram",SUMMER_COMPILE_MINIGAME:"Compile minigame",SUMMER_COMPILE_PLUGIN:"Compile plugin",FILE_EXT_FORMAT_ERROR:"%s Wrong file format, only %s format is supported",THEME_JSON_VALUE_SHOULD_BE:"%s as the value of %s , should be %s",JSON_VARIABLE_VALUE_NOT_FOUND:"could not find the value of %s in %s",THEME_JSON_SHOULD_EXIST:"%s use variable: %s,you need to use %s to specify the path of theme.json",PARSEERR_ENTRANCE_PAGE_ERROR:"The entrance page cannot be found\nPages defined in app.json : %s",PARSEERR_ENTRANCE_FILE_ERROR:"Failed to find or read the entrance file %s. Please recompile after checking",COMPILE_WXML_ERROR_CONSOLE:"compile .wxml error. The error message is as above, and you can view more details in the console.",COMPILE_WXSS_ERROR_CONSOLE:"Compile .wxss error. The error message is as above, and you can view more details in the console.",RELATED_NODE_MODULES_NOT_FOUND:"The related node_modules of %s is not found, please run `npm install` at %s",PACKAGE_JSON_PATH_IN_VALID:'packageJsonPath should ends with `package.json`, "%s" is invalid.',ACCOUNT_CARD_PACKAPGE_IN_VALID:'The independent subpackage defined with the value ["AccountCardPackage"]["root"] as the path was not found. Please check the ["subPackages"] configuration.',UNUSE_FILE_LIST:"Ignored by code analyzer: %s",PACK_OPTIONS_IGNORE_LIST:"Ignored by project.config.json packOptions.ignore setting: %s",PARTIAL_COMPILE_IGNORE_LIST:"Ignore by partial compile condition: %s",UNKNOWN_REASON_INGORE_LIST:"Ingore by %s: %s",LARGEFILE_WARNING:"%s exceed the max file size: %sKB,ignored by compile process"},formatConfig={};for(const[e,o]of Object.entries(config))formatConfig[e]=new fomatable_string_1.FormatableString(o);exports.default=formatConfig;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fomatable_string_1=require("./fomatable_string"),config={GENERATE_LOCAL_SIGNATURE_FAIL:"generate local signature fail. Usually this happens the content or encoding of private key file is incorrect. Detail: %s",PARAM_ERROR:'function: "%s" lack of parameter: "%s"',SHOULD_NOT_BE_EMPTY:"%s should not be empty",JSON_CONTENT_SHOULD_BE:"%s field needs to be %s",SHOULD_MATCH:"%s should match %s",SHOULD_EQUAL:"%s should equal to %s",SHOULD_AT_LEAST_ONE_ITEM:"%s should have at least on item",OR:"Or",CORRESPONDING_FILE_NOT_FOUND:'%s could not find the corresponding file: "%s"',JSON_SHOULD_NOT_CONTAIN:"%s should not contain %s",JSON_SHOULD_NOT_START_WITH:"%s should not begin with '%s'",NOT_FOUND:"%s not found",COMPONENT_NOT_FOUND:"%s, component not found in the path: %s",NOT_FOUND_IN_ROOT_DIR:"%s is not found in the project root directory",MINIPROGRAM_APP_JSON_NOT_FOUND:'In the directory %s specified by "miniprogramRoot" in project.config.json, %s is not found in that directory.If you don\'t know what "miniprogramRoot" means for, just leave it as empty string.',PLUGIN_JSON_NOT_FOUND:"In the miniprogram local development plug-in directory %s specified by pluginRoot in project.config.json, %s is not found",PLUGIN_PATH_SAME_WITH_MINIPROGRAM:"The plugin directory %s specified by pluginRoot in project.config.json is the same as the miniprogram directory %s, please modify it to a different directory",CONTENT_EXIST:"%s already exists",FILE_NOT_FOUND:'"%s" file not found, or the file read failed',JSON_PARSE_ERROR:"%s File parsing error",ENTRANCE_NOT_FOUND:"No pages : %s defined in the entry page \napp.json is found",JSON_PAGE_FILE_NOT_EXISTS:'%s %s "%s" could not find the corresponding %s file',SHOULD_NOT_IN:"%s Should not exist in %s",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS_TITLE:"app.json or custom compilation condition error",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS:"The startup page %s specified in the custom compilation is not defined in app.json",JSON_ENTRY_PAGE_PATH_NOT_FOUND:"No entry page defined in %s is found in %s",JSON_TABBAR_AT_LEAST:'["tabBar"]["list"] must contain at least %s items',JSON_TABBAR_AT_MOST:'["tabBar"]["list"] cannot contain more than %s items',JSON_TABBAR_PATH_EMPTY:'["tabBar"]["list"][%s]["pagePath"] cannot be empty',JSON_TABBAR_PATH_SAME_WITH_OTHER:'["tabBar"]["list"][%s]["pagePath"] is same with ["tabBar"]["list"][%s]["pagePath"]',JSON_TABBAR_ICON_MAX_SIZE:'The size of ["tabBar"]["list"][%s]["%s"] exceeds %skb',JSON_TABBAR_ICON_EXT:'["tabBar"]["list"][%s]["%s"] Wrong file format, only %s format is supported',EXT_SHOULD_BE_ERROR:'extension name of %s should be "%s"',JSON_CONTENT_SHOULD_NOT_BE:"%s cannot be %s",JSON_RESOLVE_ALIAS_ILLEGAL:'Invalid %s or %s in resolveAlias field, contains consecutive "//"',JSON_RESOLVE_ALIAS_INCLUDE_STAR:'The key "%s" or value "%s" in resolveAlias field should end with "/*"',JSON_RESOLVE_ALIAS_SHOULD_NOT_START_WITH:'The value "%s" in resolveAlias field should not start with "./"',APP_JSON_SKYLINE_WINDOW_TIPS:'Due to the "custom" navigationStyle of the Skyline page, the configuration of "navigationStyle", "navigationBarTextStyle", "navigationBarTitleText", and "navigationBarBackgroundColor" in app.json will not take effect.',APP_JSON_SHOULD_SET_LAZYCODELOADING:'You need to add "lazyCodeLoading": "requiredComponents" in app.json, since the value of "renderer" in %s is "skyline"',APP_JSON_SHOULD_SET_RENDEREROPTIONS:'You need to configure the "skyline" sub-option in the "rendererOptions" option in app.json, since the value of "renderer" in %s is "skyline"',JSON_SHOULD_SET_RENDEREROPTIONS:'You need to add "rendererOptions" field in %, as the "renderer" field is set to skyline。More detail: https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80',JSON_SHOULD_SET_RENDEREROPTIONS_SKYLINE:'You need to add "skyline" configuration in the rendererOptions field of the %, as the "renderer" field is set to skyline。More detail: https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80',JSON_SHOULD_SET_COMPONENTFRAMEWORK_SKYLINE:'You need to set the value of the "componentFramework" field to "glass-easel" in the %, as the "renderer" field is set to skyline。More detail: https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html',PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE:'According to the configuration of the page or app.json, the value of "renderer" in %s page is "skyline", the "disableScroll" configuration for the page should be set to true',PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM:'According to the configuration of the page or app.json, the value of "renderer" in %s page is "skyline", the "navigationStyle" configuration for the page should be set to "custom"',JSON_CONTENT_EXISTED:"%s already exists",JSON_CONTENT_NOT_FOUND:"%s does not exist",LACK_OF_FILE:"File %s is missing",JSON_PAGES_REPEAT:"%s is repeated in %s",JSON_CONTENT_REPEAT:"%s could not be declared both in %s",EXT_JSON_INVALID:'%s is not a 3rdMiniProgramAppid, ext.json cannot take effect;Read the documentation: "%s"',GAME_EXT_JSON_INVALID:"%s is not a 3rdMiniGameAppid, ext.json cannot take effect;",EXT_APPID_SHOULD_NOT_BE_EMPTY:"extAppid should not be empty",FILE_NOT_UTF8:"%s file is not in UTF-8 encoding",INVALID:"invalid %s",DIRECTORY:"Directory",EXCEED_LIMIT:"%s exceed limit %s",PLEASE_CHOOSE_PLUGIN_MODE:"If you are developing a plugin, choose the plugin mode",TRIPLE_NUMBER_DOT:"digit.digit.digit, each segment of digit is no more than 3 digits",PAGE_PATH:"Page Path",PLUGINS_SAME_ALIAS:"%s and %s have same alias",SAME_ITEM:'%s and %s have same "%s"',ALREADY_EXISTS:"already exists",SAME_KEY_PAGE_PUBLICCOMPONENTS:'There can not be the same key: %s in ["pages"] and ["publicComponents"]',GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH:"Dev plugin: %s shall never specify a local path",GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT:'MD5 hash of the plugin library file "%s": "%s" not matching the value "%s" given by its signature.json, thus the compiling process has been interrupted.\nThis indicates you might have changed the content of the file.\nRestore the original content of this file may help solve the issue and remove this warning.\n\nTo learn more, you may refer to the documentation.\n',FILE:"FILE",PROCESSING:"processing: %s",DONE:"done: %s",UPLOAD:"upload",SUCCESS:"success",PROJECT_TYPE_ERROR:"project.type is %s, but appid(%s) is %s",MINI_PROGRAM:"MiniProgram",MINI_GAME:"MiniGame",NOT_ALLOWED_REQUIRE_VAR:"Require variable is not allowed",NOT_ALLOWED_REQUIRE_ASSIGN:"Assigning the require function to other variables is not allowed",NOT_FOUND_NPM_ENTRY:"Npm package entry file not found",NOT_FOUND_NODE_MODULES:"NPM packages not found. Please confirm npm packages which need to build are belong to `miniprogramRoot` directory. Or you may edit project.config.json's `packNpmManually` and `packNpmRelationList`",JSON_ENTRANCE_DECLARE_PATH_ERR:'["entranceDeclare"]["locationMessage"]["path"] "%s" should belong to pages or pages in sub packages',JSON_ENTRANCE_DECLARE_PATH_EMPTY:'["entranceDeclare"]["locationMessage"]["path"] should not be empty',JSON_REQUIRED_PRIVATE_INFOS_MUTUALLY_EXCLUSIVE:"requiredPrivateInfos %s is is mutually exclusive with %s.",COULD_NOT_USE_CODE_PROTECT:"Code protect is not available",SUMMER_COMPILING_MODULE:"Compiling %s",SUMMER_COMPILE_JSON:"Compile jSON files",SUMMER_OPTIMIZE_CODE:"Optimize code",SUMMER_PACK_FILES:"Pack resource file",SUMMER_PACK_FILES_FINISH:"Pack resource file finish",SUMMER_COMPRESS_PACK:"Compress code package",SUMMER_SEAL_PACK:"Seal code package",SUMMER_APPEND_BABEL_HELPERS:"Append babel helper files",SUMMER_COMPILE_PAGE_JSON:"Compile json files of %s pages",SUMMER_COMPILE_PLUGIN_PAGE_JSON:"Compiling json files of %s plugin pages",SUMMER_COMPILE:"Compile %s",SUMMER_COMPILE_MINIPROGRAM:"Compile miniprogram",SUMMER_COMPILE_MINIGAME:"Compile minigame",SUMMER_COMPILE_PLUGIN:"Compile plugin",FILE_EXT_FORMAT_ERROR:"%s Wrong file format, only %s format is supported",THEME_JSON_VALUE_SHOULD_BE:"%s as the value of %s , should be %s",JSON_VARIABLE_VALUE_NOT_FOUND:"could not find the value of %s in %s",THEME_JSON_SHOULD_EXIST:"%s use variable: %s,you need to use %s to specify the path of theme.json",PARSEERR_ENTRANCE_PAGE_ERROR:"The entrance page cannot be found\nPages defined in app.json : %s",PARSEERR_ENTRANCE_FILE_ERROR:"Failed to find or read the entrance file %s. Please recompile after checking",COMPILE_WXML_ERROR_CONSOLE:"compile .wxml error. The error message is as above, and you can view more details in the console.",COMPILE_WXSS_ERROR_CONSOLE:"Compile .wxss error. The error message is as above, and you can view more details in the console.",RELATED_NODE_MODULES_NOT_FOUND:"The related node_modules of %s is not found, please run `npm install` at %s",PACKAGE_JSON_PATH_IN_VALID:'packageJsonPath should ends with `package.json`, "%s" is invalid.',ACCOUNT_CARD_PACKAPGE_IN_VALID:'The independent subpackage defined with the value ["AccountCardPackage"]["root"] as the path was not found. Please check the ["subPackages"] configuration.',UNUSE_FILE_LIST:"Ignored by code analyzer: %s",PACK_OPTIONS_IGNORE_LIST:"Ignored by project.config.json packOptions.ignore setting: %s",PARTIAL_COMPILE_IGNORE_LIST:"Ignore by partial compile condition: %s",UNKNOWN_REASON_INGORE_LIST:"Ingore by %s: %s",LARGEFILE_WARNING:"%s exceed the max file size: %sKB,ignored by compile process"},formatConfig={};for(const[e,o]of Object.entries(config))formatConfig[e]=new fomatable_string_1.FormatableString(o);exports.default=formatConfig;
|