miniprogram-ci 2.0.8 → 2.0.10
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 +4 -0
- package/README.md +4 -0
- package/dist/@types/ci/utils/tools.d.ts +1 -0
- package/dist/@types/common/code-analyse/index.d.ts +16 -1
- package/dist/@types/config/config.d.ts +8 -1
- package/dist/@types/index.d.ts +2 -1
- package/dist/@types/modules/corecompiler/baseCompiler.d.ts +6 -0
- package/dist/@types/modules/corecompiler/original/validate/schemaValidate.d.ts +1 -1
- package/dist/@types/modules/corecompiler/original/workerThread/task/minifywxml.d.ts +21 -25
- package/dist/@types/modules/corecompiler/originalCompiler.d.ts +1 -0
- package/dist/@types/modules/corecompiler/processHandler.d.ts +4 -3
- package/dist/@types/modules/corecompiler/summer/graph/appconf.d.ts +4 -0
- package/dist/@types/modules/corecompiler/summer/graph/appgraph.d.ts +6 -3
- package/dist/@types/modules/corecompiler/summer/graph/basegraph.d.ts +13 -3
- package/dist/@types/modules/corecompiler/summer/graph/gamegraph.d.ts +6 -3
- package/dist/@types/modules/corecompiler/summer/graph/gameplugingraph.d.ts +5 -4
- package/dist/@types/modules/corecompiler/summer/graph/plugingraph.d.ts +5 -4
- package/dist/@types/modules/corecompiler/summer/module.d.ts +20 -14
- package/dist/@types/modules/corecompiler/summer/plugins/base/javascript.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summer/plugins/base/swc.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summer/summer.d.ts +5 -1
- package/dist/@types/modules/corecompiler/summerCompiler.d.ts +16 -5
- package/dist/@types/modules/createSummer.d.ts +3 -2
- package/dist/@types/modules/index.d.ts +6 -0
- package/dist/@types/modules/nativecompiler/index.d.ts +1 -0
- package/dist/@types/modules/nativecompiler/ios/buildCloud.d.ts +9 -2
- package/dist/@types/modules/nativecompiler/ios/index.d.ts +2 -0
- package/dist/@types/modules/nativecompiler/nativeCompiler.d.ts +3 -0
- package/dist/@types/schema/@types/appjson.d.ts +215 -0
- package/dist/@types/schema/@types/extjson.d.ts +82 -0
- package/dist/@types/schema/@types/gamejson.d.ts +55 -0
- package/dist/@types/schema/@types/pagejson.d.ts +47 -0
- package/dist/@types/schema/@types/pluginjson.d.ts +17 -0
- package/dist/@types/schema/@types/pluginpagejson.d.ts +5 -0
- package/dist/@types/schema/@types/projectconfigjson.d.ts +194 -0
- package/dist/@types/schema/@types/projectprivateconfigjson.d.ts +114 -0
- package/dist/@types/schema/@types/sitemapjson.d.ts +10 -0
- package/dist/@types/schema/@types/themejson.d.ts +8 -0
- package/dist/@types/schema/src/index.d.ts +60 -0
- package/dist/@types/types/ci.d.ts +2 -1
- package/dist/@types/types/core.d.ts +22 -3
- package/dist/@types/types/devtools.d.ts +18 -6
- package/dist/@types/types/miniapp/index.d.ts +5 -0
- package/dist/@types/types/miniprogram-json/app.d.ts +16 -6
- package/dist/@types/types/summer.d.ts +1 -0
- package/dist/@types/utils/locales/locales.d.ts +5 -0
- package/dist/@types/utils/locales/zh.d.ts +5 -0
- package/dist/@types/utils/messageHub.d.ts +1 -1
- package/dist/@types/utils/miniapp-builder.d.ts +6 -1
- package/dist/@types/utils/packOptionsHelper.d.ts +15 -2
- package/dist/@types/utils/progressRecorder.d.ts +1 -1
- package/dist/@types/utils/tools.d.ts +5 -0
- package/dist/@types/utils/usbProcess.d.ts +3 -0
- package/dist/ci/utils/filterUnusedFile.js +1 -1
- package/dist/ci/utils/tools.js +1 -1
- package/dist/common/code-analyse/index.js +1 -1
- package/dist/config/config.js +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/corecompiler/baseCompiler.js +1 -1
- package/dist/modules/corecompiler/original/compile/common.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/compilejs.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/index.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/minifywxml.js +1 -1
- package/dist/modules/corecompiler/originalCompiler.js +1 -1
- package/dist/modules/corecompiler/processHandler.js +1 -1
- package/dist/modules/corecompiler/summer/graph/appconf.js +1 -1
- package/dist/modules/corecompiler/summer/graph/appgraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/gamegraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/gameplugingraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/plugingraph.js +1 -1
- package/dist/modules/corecompiler/summer/module.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/es6module.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/enhance.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/less.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/minifywxml.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/sass.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/plugins/worklet.js +1 -1
- package/dist/modules/corecompiler/summer/summer.js +1 -1
- package/dist/modules/corecompiler/summerCompiler.js +1 -1
- package/dist/modules/createSummer.js +1 -1
- 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/nativecompiler/nativeCompiler.js +1 -1
- package/dist/modules/nativecompiler/nativeEntryProcess.js +1 -1
- package/dist/project/advance/precompileProject.js +1 -1
- package/dist/project/baseProject.js +1 -1
- package/dist/schema/@types/appjson.js +1 -0
- package/dist/schema/@types/extjson.js +1 -0
- package/dist/schema/@types/gamejson.js +1 -0
- package/dist/schema/@types/pagejson.js +1 -0
- package/dist/schema/@types/pluginjson.js +1 -0
- package/dist/schema/@types/pluginpagejson.js +1 -0
- package/dist/schema/@types/projectconfigjson.js +1 -0
- package/dist/schema/@types/projectprivateconfigjson.js +1 -0
- package/dist/schema/@types/sitemapjson.js +1 -0
- package/dist/schema/@types/themejson.js +1 -0
- package/dist/schema/dist/app.js +1 -1
- package/dist/schema/dist/ext.js +1 -1
- package/dist/schema/dist/game.js +1 -1
- package/dist/schema/dist/page.js +1 -1
- package/dist/schema/dist/plugin.js +1 -1
- package/dist/schema/dist/pluginpage.js +1 -1
- package/dist/schema/dist/projectconfig.js +37 -1
- package/dist/schema/dist/projectprivateconfig.js +1 -1
- package/dist/schema/dist/sitemap.js +1 -1
- package/dist/schema/dist/theme.js +1 -1
- package/dist/schema/src/index.js +1 -0
- package/dist/utils/codesign.js +1 -1
- package/dist/utils/locales/en.js +1 -1
- package/dist/utils/locales/zh.js +1 -1
- package/dist/utils/miniapp-builder.js +1 -1
- package/dist/utils/miniappJson.js +1 -1
- package/dist/utils/packOptionsHelper.js +1 -1
- package/dist/utils/progressRecorder.js +1 -1
- package/dist/utils/subprocess/processManager.js +1 -1
- package/dist/utils/tools.js +1 -1
- package/dist/utils/usbProcess.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NativeCompiler=void 0;const define_1=require("../../config/define"),miniappJson_1=require("../../utils/miniappJson"),android_1=require("./android"),ios_1=require("./ios");class NativeCompiler{constructor(t){this.projectPath=t.projectInfo.projectPath,this.miniappDirPath=t.miniappDirPath,this.devtoolsVersion=t.devtoolsVersion}getHandler(t){let i=null;const e=(0,miniappJson_1.getMiniappJson)(this.projectPath,t);return t===define_1.PLATFORM["mini-android"]?i=new android_1.AndroidUtils(e.projectPath,e.project,this.miniappDirPath,this.devtoolsVersion):t===define_1.PLATFORM["mini-ios"]&&(i=new ios_1.IOSUtils(e.projectPath,e.project,this.miniappDirPath,this.devtoolsVersion)),i}validNativePlatform(t){return t===define_1.PLATFORM["mini-android"]||t===define_1.PLATFORM["mini-ios"]}async getAndroidDevices(){const t=this.getHandler(define_1.PLATFORM["mini-android"]);return await t.getDevices()}async getIOSDevices(){const t=this.getHandler(define_1.PLATFORM["mini-ios"]);return await t.getDevices()}async run(t,i){const{targetPlatform:e,opts:a}=t;if(!this.validNativePlatform(e))return;const r=(0,miniappJson_1.getMiniappJson)(this.projectPath,e),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NativeCompiler=void 0;const define_1=require("../../config/define"),miniappJson_1=require("../../utils/miniappJson"),android_1=require("./android"),ios_1=require("./ios");class NativeCompiler{constructor(t){this.projectPath=t.projectInfo.projectPath,this.miniappDirPath=t.miniappDirPath,this.devtoolsVersion=t.devtoolsVersion}getHandler(t){let i=null;const e=(0,miniappJson_1.getMiniappJson)(this.projectPath,t);return t===define_1.PLATFORM["mini-android"]?i=new android_1.AndroidUtils(e.projectPath,e.project,this.miniappDirPath,this.devtoolsVersion):t===define_1.PLATFORM["mini-ios"]&&(i=new ios_1.IOSUtils(e.projectPath,e.project,this.miniappDirPath,this.devtoolsVersion)),i}validNativePlatform(t){return t===define_1.PLATFORM["mini-android"]||t===define_1.PLATFORM["mini-ios"]}async getAndroidDevices(){const t=this.getHandler(define_1.PLATFORM["mini-android"]);return await t.getDevices()}async getIOSDevices(){const t=this.getHandler(define_1.PLATFORM["mini-ios"]);return await t.getDevices()}async run(t,i){const{targetPlatform:e,opts:a}=t;if(!this.validNativePlatform(e))return;const r=(0,miniappJson_1.getMiniappJson)(this.projectPath,e),n=this.getHandler(e);let s={};const{buildType:o="LOCAL"}=a;return"LOCAL"===o?(s=r.runArgs||{},await n.runLocal(Object.assign(Object.assign({projectPath:this.projectPath},s),a),i)):await n.runCloud(Object.assign({projectPath:this.projectPath},a),i)}async build(t,i){const{targetPlatform:e,opts:a={}}=t;if(!this.validNativePlatform(e))return;const r=this.getHandler(e),n=(0,miniappJson_1.getMiniappJson)(this.projectPath,e);let s={};const{buildType:o="LOCAL"}=a;return"LOCAL"===o?(s=n.buildArgs||{},await r.buildLocal(Object.assign(Object.assign({projectPath:this.projectPath},s),a),i)):await r.buildCloud(Object.assign({projectPath:this.projectPath},a),i)}async buildPlugin(t,i){const{targetPlatform:e,opts:a={}}=t;if(!this.validNativePlatform(e))return;const r=this.getHandler(e);return await r.buildPlugin(Object.assign({projectPath:this.projectPath},a),i)}async packIOSCloudBuildMaterial(t,i){const{targetPlatform:e,opts:a={}}=t;if(!this.validNativePlatform(e))return;const r=this.getHandler(e);return await r.packIOSCloudBuildMaterial(Object.assign({projectPath:this.projectPath},a),i)}async initUSBConnectionProcess(t,i){const{targetPlatform:e}=t;if(!this.validNativePlatform(e))return;const a=this.getHandler(e);return await a.initUSBConnectionProcess({miniappDirPath:a.miniappDirPath,devtoolsVersion:a.devtoolsVersion},i)}async codesignIOSApp(t,i){const{targetPlatform:e,opts:a={}}=t;if(!this.validNativePlatform(e))return;const r=this.getHandler(e);return await r.codesignIOSApp(Object.assign({projectPath:this.projectPath},a),i)}}exports.NativeCompiler=NativeCompiler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _a,_b;process.env&&process.env.isDevtools&&require("../../utils/hackrequire/index"),Object.defineProperty(exports,"__esModule",{value:!0}),(null===(_a=process.env)||void 0===_a?void 0:_a.isDevtools)&&require("../../utils/hackrequire/index");const entryProcess_1=require("../../utils/subprocess/entryProcess"),progressRecorder_1=require("../../utils/progressRecorder"),nativeCompiler_1=require("./nativeCompiler");let nativeCompiler;async function initHandler(e){const{projectInfo:i,passData:
|
|
1
|
+
var _a,_b;process.env&&process.env.isDevtools&&require("../../utils/hackrequire/index"),Object.defineProperty(exports,"__esModule",{value:!0}),(null===(_a=process.env)||void 0===_a?void 0:_a.isDevtools)&&require("../../utils/hackrequire/index");const entryProcess_1=require("../../utils/subprocess/entryProcess"),progressRecorder_1=require("../../utils/progressRecorder"),nativeCompiler_1=require("./nativeCompiler");let nativeCompiler;async function initHandler(e){const{projectInfo:i,passData:a}=e.data,{miniappDirPath:r,devtoolsVersion:s}=a;nativeCompiler=new nativeCompiler_1.NativeCompiler({projectInfo:i,miniappDirPath:r,devtoolsVersion:s})}async function messageHandler(e){if(e.type,"request"===e.type){const{id:i,name:a,data:r}=e,s=i,n=new progressRecorder_1.Recorder((e,i,a)=>{process.send({type:"progress",id:e,taskId:s,status:i,message:a})});r.fullEnv&&(global.fullEnv=r.fullEnv);try{let e;const t=`${a}-${s}`;if("buildNative"===a)e=await n.run(t,async()=>await nativeCompiler.build(r,n));else if("runNative"===a)e=await n.run(t,async()=>await nativeCompiler.run(r,n));else if("buildNativePlugin"===a)e=await n.run(t,async()=>await nativeCompiler.buildPlugin(r,n));else if("packIOSCloudBuildMaterial"===a)e=await n.run(t,async()=>await nativeCompiler.packIOSCloudBuildMaterial(r,n));else if("initUSBConnectionProcess"===a)e=await n.run(t,async()=>await nativeCompiler.initUSBConnectionProcess(r,n));else{if("codesignIOSApp"!==a)throw new Error("unknown command "+a);e=await n.run(t,async()=>await nativeCompiler.codesignIOSApp(r,n))}process.send({type:"response",id:i,data:e})}catch(e){process.send({type:"response",id:i,data:null,error:{code:e.code||-1,message:e.message,stack:e.stack,path:e.path||""}})}}}(0,entryProcess_1.runSubProcess)({initHandler:initHandler,messageHandler:messageHandler,timeout:(null===(_b=process.env)||void 0===_b?void 0:_b.timeout)||3e5});
|
|
@@ -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),this.shouldConditionalCompile()?this._fileBufferCache[e]=this.conditionCompiler.compileFile(e,{targetPlatform:this.targetPlatform,targetPlatformDefines:this.targetPlatformDefines}):this._fileBufferCache[e]=this.project.getFile("",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})}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}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){const i=this.getTargetPath(t,e);return this._fileBufferCache[i]||(this.shouldConditionalCompile()?this._fileBufferCache[i]=this.conditionCompiler.compileFile(i,{targetPlatform:this.targetPlatform,targetPlatformDefines:this.targetPlatformDefines}):this._fileBufferCache[i]=this.project.getFile(t,e)),this._fileBufferCache[i]}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
|
+
"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),this.shouldConditionalCompile()?this._fileBufferCache[e]=this.conditionCompiler.compileFile(e,{targetPlatform:this.targetPlatform,targetPlatformDefines:this.targetPlatformDefines}):this._fileBufferCache[e]=this.project.getFile("",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){const i=this.getTargetPath(t,e);return this._fileBufferCache[i]||(this.shouldConditionalCompile()?this._fileBufferCache[i]=this.conditionCompiler.compileFile(i,{targetPlatform:this.targetPlatform,targetPlatformDefines:this.targetPlatformDefines}):this._fileBufferCache[i]=this.project.getFile(t,e)),this._fileBufferCache[i]}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.BaseProject=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),stream_1=require("stream"),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),tools_1=require("../utils/tools"),waitable_1=tslib_1.__importDefault(require("../utils/waitable"));class BaseProject extends waitable_1.default{constructor(){super(...arguments),this._projectPath="",this._projectArchitecture="miniProgram",this._type="miniProgram",this._privateKey="",this.ignores=[],this.setting={},this._dirSet=new Set,this._fileSet=new Set,this.event=new stream_1.EventEmitter}get projectPath(){return this._projectPath}get projectArchitecture(){return this._projectArchitecture}get srcPath(){let t="";return"miniProgramPlugin"!==this._type&&"miniGamePlugin"!==this._type||(t=(0,tools_1.normalizePath)(path_1.default.join(this.projectPath,this.pluginRoot||""))),t=(0,tools_1.normalizePath)(path_1.default.join(this.projectPath,this.miniprogramRoot||"")),(this._projectPath.startsWith("//")||this._projectPath.startsWith("\\\\"))&&(t.startsWith("//")||(t="/"+t)),t}get pluginSrcPath(){return(0,tools_1.normalizePath)(path_1.default.join(this.projectPath,this.pluginRoot||""))}get type(){return this._type}set type(t){this._type=t}get appid(){return this._appid}set appid(t){this._appid=t}get privateKey(){return this._privateKey}set privateKey(t){this._privateKey=t}get miniprogramRoot(){return this._miniprogramRoot||""}set miniprogramRoot(t){this._miniprogramRoot=t}get pluginRoot(){return this._pluginRoot}set pluginRoot(t){this._pluginRoot=t}get nameMappingFromDevtools(){return this._nameMappingFromDevtools}set nameMappingFromDevtools(t){this._nameMappingFromDevtools=t}async attr(){return this._attr}async ready(){await this.wait()}getProjectType(t,e){let i="";return i=(null==t?void 0:t.gameApp)?"miniGamePlugin"===e?"miniGamePlugin":"miniGame":e,i}getProjectConfig(){let t={};const e=path_1.default.join(this.projectPath,"project.config.json");if(fs_extra_1.default.existsSync(e))try{t=fs_extra_1.default.readJsonSync(e)}catch(t){throw new Error("project.config.json not exist")}return t}async serialize(){const{files:t,dirs:e}=this.getFilesAndDirs();return{projectPath:this.projectPath,appid:this.appid,attr:await this.attr(),type:this.type,projectArchitecture:this.projectArchitecture,miniprogramRoot:this.miniprogramRoot,pluginRoot:this.pluginRoot,files:t,dirs:e,setting:this.setting}}updateFiles(){this.updateFileAndDirs(...arguments)}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.event.emit("optionsChange",t)}cacheDirName(t,e){t.has(e)||(t.add(e),this.cacheDirName(t,path_1.default.posix.dirname(e)))}deleteDirOrFileOfSet(t,e,i){if(t.has(i)){t.delete(i);const r=i+"/",s=Array.from(t);for(const e of s)e.startsWith(r)&&t.delete(e);const a=Array.from(e);for(const t of a)t.startsWith(r)&&e.delete(t)}e.has(i)&&e.delete(i)}getTargetPath(t="",e=""){return(0,tools_1.normalizePath)(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BaseProject=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),stream_1=require("stream"),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),tools_1=require("../utils/tools"),waitable_1=tslib_1.__importDefault(require("../utils/waitable"));class BaseProject extends waitable_1.default{constructor(){super(...arguments),this._projectPath="",this._projectArchitecture="miniProgram",this._type="miniProgram",this._privateKey="",this.ignores=[],this.setting={},this._dirSet=new Set,this._fileSet=new Set,this.event=new stream_1.EventEmitter}get projectPath(){return this._projectPath}get projectArchitecture(){return this._projectArchitecture}get srcPath(){let t="";return"miniProgramPlugin"!==this._type&&"miniGamePlugin"!==this._type||(t=(0,tools_1.normalizePath)(path_1.default.join(this.projectPath,this.pluginRoot||""))),t=(0,tools_1.normalizePath)(path_1.default.join(this.projectPath,this.miniprogramRoot||"")),(this._projectPath.startsWith("//")||this._projectPath.startsWith("\\\\"))&&(t.startsWith("//")||(t="/"+t)),t}get pluginSrcPath(){return(0,tools_1.normalizePath)(path_1.default.join(this.projectPath,this.pluginRoot||""))}get type(){return this._type}set type(t){this._type=t}get appid(){return this._appid}set appid(t){this._appid=t}get privateKey(){return this._privateKey}set privateKey(t){this._privateKey=t}get miniprogramRoot(){return this._miniprogramRoot||""}set miniprogramRoot(t){this._miniprogramRoot=t}get pluginRoot(){return this._pluginRoot}set pluginRoot(t){this._pluginRoot=t}get nameMappingFromDevtools(){return this._nameMappingFromDevtools}set nameMappingFromDevtools(t){this._nameMappingFromDevtools=t}async attr(){return this._attr}async ready(){await this.wait()}getProjectType(t,e){let i="";return i=(null==t?void 0:t.gameApp)?"miniGamePlugin"===e?"miniGamePlugin":"miniGame":e,i}getProjectConfig(){let t={};const e=path_1.default.join(this.projectPath,"project.config.json");if(fs_extra_1.default.existsSync(e))try{t=fs_extra_1.default.readJsonSync(e)}catch(t){throw new Error("project.config.json not exist")}return t}async serialize(){const{files:t,dirs:e}=this.getFilesAndDirs();return{projectPath:this.projectPath,appid:this.appid,attr:await this.attr(),type:this.type,projectArchitecture:this.projectArchitecture,miniprogramRoot:this.miniprogramRoot,pluginRoot:this.pluginRoot,files:t,dirs:e,setting:this.setting}}updateFiles(){this.updateFileAndDirs(...arguments)}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:[]},this.event.emit("optionsChange",t)}cacheDirName(t,e){t.has(e)||(t.add(e),this.cacheDirName(t,path_1.default.posix.dirname(e)))}deleteDirOrFileOfSet(t,e,i){if(t.has(i)){t.delete(i);const r=i+"/",s=Array.from(t);for(const e of s)e.startsWith(r)&&t.delete(e);const a=Array.from(e);for(const t of a)t.startsWith(r)&&e.delete(t)}e.has(i)&&e.delete(i)}getTargetPath(t="",e=""){return(0,tools_1.normalizePath)((0,tools_1.joinPath)(t,e)).replace(/\/$/,"").replace(/^\//,"")}getFilesAndDirs(){return{files:Array.from(this._fileSet),dirs:Array.from(this._dirSet)}}exists(t="",e=""){const i=this.getTargetPath(t,e);if(!i.startsWith(t))return!1;if(this._fileSet.has(i)||this._dirSet.has(i))return!0;const r=(0,tools_1.normalizePath)((0,tools_1.joinPath)(this.projectPath,i));return fs_extra_1.default.existsSync(r)}stat(t="",e=""){if(!this.exists(t,e))return;const i=this.getTargetPath(t,e),r=path_1.default.join(this.projectPath,i);let s={};try{s=fs_extra_1.default.statSync(r)}catch(t){fs_extra_1.default.existsSync(r)||this.deleteDirOrFileOfSet(this._dirSet,this._fileSet,i)}if(this._fileSet.has(i)){return{isFile:!0,isDirectory:!1,size:this.getFileSize(t,e),mtimeMs:s.mtimeMs||""}}return this._dirSet.has(i)?{isFile:!1,isDirectory:!0,size:0,mtimeMs:s.mtimeMs}:void 0}getAllFileInfo(t=""){const e=this.getFileList(t),i={};return e.forEach(t=>{i[t]=this.stat("",t)||{}}),i}getFileList(t="",e=""){return Array.from(this._fileSet).filter(i=>(!e||path_1.default.posix.extname(i)===e)&&!(t&&!i.startsWith(t)))}getSrcFile(t,e){t=t||"";const i=this.getTargetPath(t,e),r=(0,tools_1.normalizePath)((0,tools_1.joinPath)(this.projectPath,i));return fs_extra_1.default.readFileSync(r,null)}getFile(t,e){return this.getSrcFile(t,e)}getJson(t="",e=""){const i=this.getFile(t,e).toString("utf-8");try{return JSON.parse(i)}catch(i){throw new Error("JSON parse failed: "+this.getTargetPath(t,e))}}getFileSize(t="",e=""){const i=this.getFile(t,e);return i?i.byteLength:0}getExtAppid(){throw new Error("Method not implemented.")}async onFileChange(t,e){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),"unlinkDir"===t&&this.deleteDirOrFileOfSet(this._dirSet,this._fileSet,e),"change"===t&&this._fileSet.has(e),this.event.emit("fileChange",t,e)}clearCache(){}}exports.BaseProject=BaseProject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
package/dist/schema/dist/app.js
CHANGED
package/dist/schema/dist/ext.js
CHANGED
package/dist/schema/dist/game.js
CHANGED
package/dist/schema/dist/page.js
CHANGED
|
@@ -288,6 +288,42 @@ module.exports = {
|
|
|
288
288
|
},
|
|
289
289
|
"showES6CompileOption": {
|
|
290
290
|
"type": "boolean"
|
|
291
|
+
},
|
|
292
|
+
"minifyWXMLSetting": {
|
|
293
|
+
"type": "object",
|
|
294
|
+
"additionalProperties": {
|
|
295
|
+
"type": "object",
|
|
296
|
+
"properties": {
|
|
297
|
+
"collapseWhitespace": {
|
|
298
|
+
"type": "boolean"
|
|
299
|
+
},
|
|
300
|
+
"conservativeCollapse": {
|
|
301
|
+
"type": "boolean"
|
|
302
|
+
},
|
|
303
|
+
"preserveLineBreaks": {
|
|
304
|
+
"type": "boolean"
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"properties": {
|
|
309
|
+
"global": {
|
|
310
|
+
"type": "object",
|
|
311
|
+
"properties": {
|
|
312
|
+
"collapseWhitespace": {
|
|
313
|
+
"type": "boolean"
|
|
314
|
+
},
|
|
315
|
+
"conservativeCollapse": {
|
|
316
|
+
"type": "boolean"
|
|
317
|
+
},
|
|
318
|
+
"preserveLineBreaks": {
|
|
319
|
+
"type": "boolean"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"required": [
|
|
325
|
+
"global"
|
|
326
|
+
]
|
|
291
327
|
}
|
|
292
328
|
}
|
|
293
329
|
},
|
|
@@ -654,5 +690,5 @@ module.exports = {
|
|
|
654
690
|
}
|
|
655
691
|
},
|
|
656
692
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
657
|
-
"$version":
|
|
693
|
+
"$version": 1723702681882
|
|
658
694
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.config=exports.NEW_CHECK_JSON_WAY=void 0,exports.NEW_CHECK_JSON_WAY=!0;const app=require("./app.js"),ext=require("./ext.js"),game=require("./game.js"),page=require("./page.js"),plugin=require("./plugin.js"),pluginpage=require("./pluginpage.js"),projectconfig=require("./projectconfig.js"),projectprivateconfig=require("./projectprivateconfig.js"),sitemap=require("./sitemap.js"),theme=require("./theme.js");exports.config={app:app,ext:ext,game:game,page:page,plugin:plugin,pluginpage:pluginpage,projectconfig:projectconfig,projectprivateconfig:projectprivateconfig,sitemap:sitemap,theme:theme};
|
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,s,a,c,r){var o;const{output:p}=i,d=path.join(__dirname,"../static/scripts/resignIpa"),l=await(0,generateIpa_1.generateIpa)(n,s),g=(null===(o=i.entitlements)||void 0===o?void 0:o["com.apple.developer.associated-domains"])||"";try{await checkXcodeEnv(s);const e=[l,p,i.outputAppWithName?i.outputAppWithName:"false",a?"true":"",g,t];let n=!1;if(i.certificate?(e.push(i.certificate),i.profile?(e.push(i.profile),n=!0,i.tpnsProfile?(e.push(i.tpnsProfile),s.message("doing","certificate: find tpns profile")):s.message("doing","certificate: cant find tpns profile")):s.message("fail","certificate: cant find profile")):!0===r?n=!0:s.message("fail","certificate: cant find certificate"),!n)throw s.message("fail","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,{},s))),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
|
|
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,s,a,c,r){var o;const{output:p}=i,d=path.join(__dirname,"../static/scripts/resignIpa"),l=await(0,generateIpa_1.generateIpa)(n,s),g=(null===(o=i.entitlements)||void 0===o?void 0:o["com.apple.developer.associated-domains"])||"";try{await checkXcodeEnv(s);const e=[l,p,i.outputAppWithName?i.outputAppWithName:"false",a?"true":"",g,t];let n=!1;if(i.certificate?(e.push(i.certificate),i.profile?(e.push(i.profile),n=!0,i.tpnsProfile?(e.push(i.tpnsProfile),s.message("doing","certificate: find tpns profile")):s.message("doing","certificate: cant find tpns profile")):s.message("fail","certificate: cant find profile")):!0===r?n=!0:s.message("fail","certificate: cant find certificate"),!n)throw s.message("fail","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,{},s))),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/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.'},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_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;
|
package/dist/utils/locales/zh.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:"生成本地签名失败。通常是key文件编码或者内容有误。错误详情: %s",PARAM_ERROR:'方法:"%s" 缺少参数:"%s"',SHOULD_NOT_BE_EMPTY:"%s 不能为空",JSON_CONTENT_SHOULD_BE:"%s 字段需为 %s",SHOULD_AT_LEAST_ONE_ITEM:"%s 需至少存在一项",SHOULD_MATCH:"%s 需与 %s 匹配",SHOULD_EQUAL:"%s 需等于 %s",EXT_SHOULD_BE_ERROR:'%s 的拓展名需为 "%s"',OR:"或",CORRESPONDING_FILE_NOT_FOUND:"未找到 %s 对应的 %s 文件",JSON_SHOULD_NOT_START_WITH:"%s 不应该以 '%s' 开头",JSON_SHOULD_NOT_CONTAIN:"%s 不应该包含 %s",NOT_FOUND:"%s 未找到",COMPONENT_NOT_FOUND:"%s,在 %s 路径下未找到组件",NOT_FOUND_IN_ROOT_DIR:"在项目根目录未找到 %s ",MINIPROGRAM_APP_JSON_NOT_FOUND:"根据 project.config.json 中 miniprogramRoot 指定的小程序目录 %s,在该目录下未找到 %s。\n如果你不理解 miniprogramRoot 字段的含义,请在 project.config.json 中将 miniprogramRoot 设为空字符串。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",PLUGIN_JSON_NOT_FOUND:"根据 project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,%s 未找到",PLUGIN_PATH_SAME_WITH_MINIPROGRAM:"project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,与小程序目录 %s 相同,请修改为不同目录",FILE_NOT_FOUND:"未找到 %s 文件,或者文件读取失败",JSON_PARSE_ERROR:"%s 文件解析错误",ENTRANCE_NOT_FOUND:"未找到入口页面\napp.json 中定义的 pages : %s",JSON_PAGE_FILE_NOT_EXISTS:'未找到 %s 中的定义的 %s "%s" 对应的 %s 文件',SHOULD_NOT_IN:"%s 不应该在 %s 中",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS_TITLE:"app.json 或自定义编译条件错误",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS:"app.json 中未定义自定义编译中指定的启动页面 %s",JSON_ENTRY_PAGE_PATH_NOT_FOUND:"未在 %s 中找到 %s 定义的入口页面",JSON_TABBAR_AT_LEAST:'["tabBar"]["list"] 需至少包含 %s 项',JSON_TABBAR_AT_MOST:'["tabBar"]["list"] 不能超过 %s 项',JSON_TABBAR_PATH_EMPTY:'["tabBar"]["list"][%s]["pagePath"] 不能为空',JSON_TABBAR_PATH_SAME_WITH_OTHER:'["tabBar"]["list"][%s]["pagePath"] 和 ["tabBar"]["list"][%s]["pagePath"] 相同',JSON_TABBAR_ICON_MAX_SIZE:'["tabBar"]["list"][%s]["%s"] 大小超过 %skb',JSON_TABBAR_ICON_EXT:'["tabBar"]["list"][%s]["%s"] 文件格式错误,仅支持 %s 格式',JSON_CONTENT_SHOULD_NOT_BE:"%s 不能为 %s",JSON_RESOLVE_ALIAS_ILLEGAL:'resolveAlias 配置中 %s 或 %s 不合法,包含连续的 "//"',JSON_RESOLVE_ALIAS_INCLUDE_STAR:'resolveAlias 配置中 %s 或 %s 需要用 "/*" 结尾',JSON_RESOLVE_ALIAS_SHOULD_NOT_START_WITH:'resolveAlias 配置中 %s 不能以 "./" 开头',JSON_REQUIRED_PRIVATE_INFOS_MUTUALLY_EXCLUSIVE:"requiredPrivateInfos %s 与 %s 互斥",APP_JSON_SKYLINE_WINDOW_TIPS:"由于 skyline 页面的 navigationStyle 是 custom,app.json 中的 window 配置 navigationStyle、navigationBarTextStyle、navigationBarTitleText、navigationBarBackgroundColor 是不生效的",APP_JSON_SHOULD_SET_LAZYCODELOADING:'%s 中 "renderer" 设置为 "skyline",需在 app.json 添加 "lazyCodeLoading": "requiredComponents"',APP_JSON_SHOULD_SET_RENDEREROPTIONS:'%s 中 "renderer" 设置为 "skyline",需在 app.json 设置 "rendererOptions" 选项中 "skyline" 子选项的内容',JSON_SHOULD_SET_RENDEREROPTIONS:'%s 中 "renderer" 设置为 "skyline",需要同时设置 rendererOptions 选项以及 skyline 配置。\n详见文档: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:'%s 中 "renderer" 设置为 "skyline",需要同时设置 rendererOptions 字段中 skyline 配置。\n详见文档: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:'%s 中 "renderer" 设置为 "skyline",需要同时设置 componentFramework 字段为 "glass-easel" 。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html',PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",页面配置 "disableScroll" 需设置为 true',PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",页面配置 "navigationStyle" 需设置为 "custom"',CONTENT_EXIST:"%s 已经存在",JSON_CONTENT_EXISTED:"%s 已经存在",JSON_CONTENT_NOT_FOUND:"%s 不存在",LACK_OF_FILE:"缺少文件 %s",JSON_PAGES_REPEAT:"%s 在 %s 中重复",JSON_CONTENT_REPEAT:"%s 不能同时在 %s 中声明",EXT_JSON_INVALID:'%s 不是 3rdMiniProgramAppid, ext.json 无法生效;查看文档: "%s"',GAME_EXT_JSON_INVALID:'%s 不是 3rdMiniGameAppid, ext.json 无法生效;"%s"',EXT_APPID_SHOULD_NOT_BE_EMPTY:"extAppid 不能为空",FILE_NOT_UTF8:"%s 文件不是 UTF-8 格式",INVALID:"无效的 %s",DIRECTORY:"目录",EXCEED_LIMIT:"%s 超过限制 %s",PLEASE_CHOOSE_PLUGIN_MODE:"如果正在开发插件,请选择插件模式",TRIPLE_NUMBER_DOT:"数字.数字.数字,每段数字不超过 3 位",PAGE_PATH:"页面路径",PLUGINS_SAME_ALIAS:"%s 和 %s 的别名相同",SAME_ITEM:'%s 和 %s 的 "%s" 相同',ALREADY_EXISTS:"已存在",SAME_KEY_PAGE_PUBLICCOMPONENTS:'["pages"] 与 ["publicComponents"] 不能存在相同的 key: %s',GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH:"开发版插件 %s 不能使用 %s 指定本地路径",GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT:'插件文件 "%s" 的 MD5: "%s" 与其 signature.json 所给定的值: "%s" 不匹配, 因此编译过程已经中断。\n这表示此文件的内容可能已经被修改。\n恢复此文件的原始内容可能可以解决此问题并移除此警告。\n\n要了解更多,可以参考文档。\n',FILE:"文件",PROCESSING:"处理中: %s",DONE:"完成: %s",UPLOAD:"上传",SUCCESS:"成功",PROJECT_TYPE_ERROR:"project.type 是 %s, 但 appid(%s) 是 %s",MINI_PROGRAM:"小程序",MINI_GAME:"小游戏",NOT_ALLOWED_REQUIRE_VAR:"不允许require变量",NOT_ALLOWED_REQUIRE_ASSIGN:"不允许将require函数赋值给其他变量",NOT_FOUND_NPM_ENTRY:"未找到npm包入口文件",NOT_FOUND_NODE_MODULES:"没有找到可以构建的 NPM 包,请确认需要参与构建的 npm 都在 `miniprogramRoot` 目录内,或配置 project.config.json 的 packNpmManually 和 packNpmRelationList 进行构建",JSON_ENTRANCE_DECLARE_PATH_ERR:'["entranceDeclare"]["locationMessage"]["path"] "%s" 需在 pages 数组或分包 pages 数组中',JSON_ENTRANCE_DECLARE_PATH_EMPTY:'["entranceDeclare"]["locationMessage"]["path"] 不能为空',COULD_NOT_USE_CODE_PROTECT:"无法使用代码保护功能",SUMMER_COMPILING_MODULE:"编译 %s",SUMMER_COMPILE_JSON:"编译 JSON 文件",SUMMER_OPTIMIZE_CODE:"优化代码",SUMMER_PACK_FILES:"打包资源文件",SUMMER_COMPRESS_PACK:"压缩代码包",SUMMER_SEAL_PACK:"封装代码包",SUMMER_APPEND_BABEL_HELPERS:"追加 %s helper 文件",SUMMER_COMPILE_PAGE_JSON:"编译 %s 个页面json文件",SUMMER_COMPILE_PLUGIN_PAGE_JSON:"编译插件 %s 个页面json文件",SUMMER_COMPILE:"编译 %s",SUMMER_COMPILE_MINIPROGRAM:"编译打包小程序",SUMMER_COMPILE_MINIGAME:"编译打包小游戏",SUMMER_COMPILE_PLUGIN:"编译打包插件",FILE_EXT_FORMAT_ERROR:"%s 文件格式错误,仅支持 %s 格式",THEME_JSON_VALUE_SHOULD_BE:"%s 作为 %s 的值,需要为 %s",JSON_VARIABLE_VALUE_NOT_FOUND:"%s 定义的变量未在 %s 中找到对应的值",THEME_JSON_SHOULD_EXIST:"%s 使用了变量 %s,需要使用 %s 来指定 theme.json 的路径",PARSEERR_ENTRANCE_PAGE_ERROR:"未找到入口页面\napp.json 中定义的 pages : %s",PARSEERR_ENTRANCE_FILE_ERROR:"未找到入口 %s 文件,或者文件读取失败,请检查后重新编译。",COMPILE_WXML_ERROR_CONSOLE:"编译 .wxml 文件错误,错误信息如上,可在控制台查看更详细信息",COMPILE_WXSS_ERROR_CONSOLE:"编译 .wxss 文件错误,错误信息如上,可在控制台查看更详细信息",RELATED_NODE_MODULES_NOT_FOUND:"%s 对应的 node_modules 不存在,请在 %s 执行 `npm install`",PACKAGE_JSON_PATH_IN_VALID:'packageJsonPath 需以 `package.json` 结尾, "%s" 是不合法的',ACCOUNT_CARD_PACKAPGE_IN_VALID:'没有找到以 ["AccountCardPackage"]["root"] 的值作为路径定义的独立分包,请检查 ["subPackages"] 配置并进行修改。'},formatConfig={};for(const[_,E]of Object.entries(config))formatConfig[_]=new fomatable_string_1.FormatableString(E);exports.default=formatConfig;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fomatable_string_1=require("./fomatable_string"),config={GENERATE_LOCAL_SIGNATURE_FAIL:"生成本地签名失败。通常是key文件编码或者内容有误。错误详情: %s",PARAM_ERROR:'方法:"%s" 缺少参数:"%s"',SHOULD_NOT_BE_EMPTY:"%s 不能为空",JSON_CONTENT_SHOULD_BE:"%s 字段需为 %s",SHOULD_AT_LEAST_ONE_ITEM:"%s 需至少存在一项",SHOULD_MATCH:"%s 需与 %s 匹配",SHOULD_EQUAL:"%s 需等于 %s",EXT_SHOULD_BE_ERROR:'%s 的拓展名需为 "%s"',OR:"或",CORRESPONDING_FILE_NOT_FOUND:"未找到 %s 对应的 %s 文件",JSON_SHOULD_NOT_START_WITH:"%s 不应该以 '%s' 开头",JSON_SHOULD_NOT_CONTAIN:"%s 不应该包含 %s",NOT_FOUND:"%s 未找到",COMPONENT_NOT_FOUND:"%s,在 %s 路径下未找到组件",NOT_FOUND_IN_ROOT_DIR:"在项目根目录未找到 %s ",MINIPROGRAM_APP_JSON_NOT_FOUND:"根据 project.config.json 中 miniprogramRoot 指定的小程序目录 %s,在该目录下未找到 %s。\n如果你不理解 miniprogramRoot 字段的含义,请在 project.config.json 中将 miniprogramRoot 设为空字符串。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",PLUGIN_JSON_NOT_FOUND:"根据 project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,%s 未找到",PLUGIN_PATH_SAME_WITH_MINIPROGRAM:"project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,与小程序目录 %s 相同,请修改为不同目录",FILE_NOT_FOUND:"未找到 %s 文件,或者文件读取失败",JSON_PARSE_ERROR:"%s 文件解析错误",ENTRANCE_NOT_FOUND:"未找到入口页面\napp.json 中定义的 pages : %s",JSON_PAGE_FILE_NOT_EXISTS:'未找到 %s 中的定义的 %s "%s" 对应的 %s 文件',SHOULD_NOT_IN:"%s 不应该在 %s 中",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS_TITLE:"app.json 或自定义编译条件错误",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS:"app.json 中未定义自定义编译中指定的启动页面 %s",JSON_ENTRY_PAGE_PATH_NOT_FOUND:"未在 %s 中找到 %s 定义的入口页面",JSON_TABBAR_AT_LEAST:'["tabBar"]["list"] 需至少包含 %s 项',JSON_TABBAR_AT_MOST:'["tabBar"]["list"] 不能超过 %s 项',JSON_TABBAR_PATH_EMPTY:'["tabBar"]["list"][%s]["pagePath"] 不能为空',JSON_TABBAR_PATH_SAME_WITH_OTHER:'["tabBar"]["list"][%s]["pagePath"] 和 ["tabBar"]["list"][%s]["pagePath"] 相同',JSON_TABBAR_ICON_MAX_SIZE:'["tabBar"]["list"][%s]["%s"] 大小超过 %skb',JSON_TABBAR_ICON_EXT:'["tabBar"]["list"][%s]["%s"] 文件格式错误,仅支持 %s 格式',JSON_CONTENT_SHOULD_NOT_BE:"%s 不能为 %s",JSON_RESOLVE_ALIAS_ILLEGAL:'resolveAlias 配置中 %s 或 %s 不合法,包含连续的 "//"',JSON_RESOLVE_ALIAS_INCLUDE_STAR:'resolveAlias 配置中 %s 或 %s 需要用 "/*" 结尾',JSON_RESOLVE_ALIAS_SHOULD_NOT_START_WITH:'resolveAlias 配置中 %s 不能以 "./" 开头',JSON_REQUIRED_PRIVATE_INFOS_MUTUALLY_EXCLUSIVE:"requiredPrivateInfos %s 与 %s 互斥",APP_JSON_SKYLINE_WINDOW_TIPS:"由于 skyline 页面的 navigationStyle 是 custom,app.json 中的 window 配置 navigationStyle、navigationBarTextStyle、navigationBarTitleText、navigationBarBackgroundColor 是不生效的",APP_JSON_SHOULD_SET_LAZYCODELOADING:'%s 中 "renderer" 设置为 "skyline",需在 app.json 添加 "lazyCodeLoading": "requiredComponents"',APP_JSON_SHOULD_SET_RENDEREROPTIONS:'%s 中 "renderer" 设置为 "skyline",需在 app.json 设置 "rendererOptions" 选项中 "skyline" 子选项的内容',JSON_SHOULD_SET_RENDEREROPTIONS:'%s 中 "renderer" 设置为 "skyline",需要同时设置 rendererOptions 选项以及 skyline 配置。\n详见文档: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:'%s 中 "renderer" 设置为 "skyline",需要同时设置 rendererOptions 字段中 skyline 配置。\n详见文档: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:'%s 中 "renderer" 设置为 "skyline",需要同时设置 componentFramework 字段为 "glass-easel" 。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html',PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",页面配置 "disableScroll" 需设置为 true',PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",页面配置 "navigationStyle" 需设置为 "custom"',CONTENT_EXIST:"%s 已经存在",JSON_CONTENT_EXISTED:"%s 已经存在",JSON_CONTENT_NOT_FOUND:"%s 不存在",LACK_OF_FILE:"缺少文件 %s",JSON_PAGES_REPEAT:"%s 在 %s 中重复",JSON_CONTENT_REPEAT:"%s 不能同时在 %s 中声明",EXT_JSON_INVALID:'%s 不是 3rdMiniProgramAppid, ext.json 无法生效;查看文档: "%s"',GAME_EXT_JSON_INVALID:'%s 不是 3rdMiniGameAppid, ext.json 无法生效;"%s"',EXT_APPID_SHOULD_NOT_BE_EMPTY:"extAppid 不能为空",FILE_NOT_UTF8:"%s 文件不是 UTF-8 格式",INVALID:"无效的 %s",DIRECTORY:"目录",EXCEED_LIMIT:"%s 超过限制 %s",PLEASE_CHOOSE_PLUGIN_MODE:"如果正在开发插件,请选择插件模式",TRIPLE_NUMBER_DOT:"数字.数字.数字,每段数字不超过 3 位",PAGE_PATH:"页面路径",PLUGINS_SAME_ALIAS:"%s 和 %s 的别名相同",SAME_ITEM:'%s 和 %s 的 "%s" 相同',ALREADY_EXISTS:"已存在",SAME_KEY_PAGE_PUBLICCOMPONENTS:'["pages"] 与 ["publicComponents"] 不能存在相同的 key: %s',GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH:"开发版插件 %s 不能使用 %s 指定本地路径",GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT:'插件文件 "%s" 的 MD5: "%s" 与其 signature.json 所给定的值: "%s" 不匹配, 因此编译过程已经中断。\n这表示此文件的内容可能已经被修改。\n恢复此文件的原始内容可能可以解决此问题并移除此警告。\n\n要了解更多,可以参考文档。\n',FILE:"文件",PROCESSING:"处理中: %s",DONE:"完成: %s",UPLOAD:"上传",SUCCESS:"成功",PROJECT_TYPE_ERROR:"project.type 是 %s, 但 appid(%s) 是 %s",MINI_PROGRAM:"小程序",MINI_GAME:"小游戏",NOT_ALLOWED_REQUIRE_VAR:"不允许require变量",NOT_ALLOWED_REQUIRE_ASSIGN:"不允许将require函数赋值给其他变量",NOT_FOUND_NPM_ENTRY:"未找到npm包入口文件",NOT_FOUND_NODE_MODULES:"没有找到可以构建的 NPM 包,请确认需要参与构建的 npm 都在 `miniprogramRoot` 目录内,或配置 project.config.json 的 packNpmManually 和 packNpmRelationList 进行构建",JSON_ENTRANCE_DECLARE_PATH_ERR:'["entranceDeclare"]["locationMessage"]["path"] "%s" 需在 pages 数组或分包 pages 数组中',JSON_ENTRANCE_DECLARE_PATH_EMPTY:'["entranceDeclare"]["locationMessage"]["path"] 不能为空',COULD_NOT_USE_CODE_PROTECT:"无法使用代码保护功能",SUMMER_COMPILING_MODULE:"编译 %s",SUMMER_COMPILE_JSON:"编译 JSON 文件",SUMMER_OPTIMIZE_CODE:"优化代码",SUMMER_PACK_FILES:"打包资源文件",SUMMER_COMPRESS_PACK:"压缩代码包",SUMMER_SEAL_PACK:"封装代码包",SUMMER_APPEND_BABEL_HELPERS:"追加 %s helper 文件",SUMMER_COMPILE_PAGE_JSON:"编译 %s 个页面json文件",SUMMER_COMPILE_PLUGIN_PAGE_JSON:"编译插件 %s 个页面json文件",SUMMER_COMPILE:"编译 %s",SUMMER_COMPILE_MINIPROGRAM:"编译打包小程序",SUMMER_COMPILE_MINIGAME:"编译打包小游戏",SUMMER_COMPILE_PLUGIN:"编译打包插件",FILE_EXT_FORMAT_ERROR:"%s 文件格式错误,仅支持 %s 格式",THEME_JSON_VALUE_SHOULD_BE:"%s 作为 %s 的值,需要为 %s",JSON_VARIABLE_VALUE_NOT_FOUND:"%s 定义的变量未在 %s 中找到对应的值",THEME_JSON_SHOULD_EXIST:"%s 使用了变量 %s,需要使用 %s 来指定 theme.json 的路径",PARSEERR_ENTRANCE_PAGE_ERROR:"未找到入口页面\napp.json 中定义的 pages : %s",PARSEERR_ENTRANCE_FILE_ERROR:"未找到入口 %s 文件,或者文件读取失败,请检查后重新编译。",COMPILE_WXML_ERROR_CONSOLE:"编译 .wxml 文件错误,错误信息如上,可在控制台查看更详细信息",COMPILE_WXSS_ERROR_CONSOLE:"编译 .wxss 文件错误,错误信息如上,可在控制台查看更详细信息",RELATED_NODE_MODULES_NOT_FOUND:"%s 对应的 node_modules 不存在,请在 %s 执行 `npm install`",PACKAGE_JSON_PATH_IN_VALID:'packageJsonPath 需以 `package.json` 结尾, "%s" 是不合法的',ACCOUNT_CARD_PACKAPGE_IN_VALID:'没有找到以 ["AccountCardPackage"]["root"] 的值作为路径定义的独立分包,请检查 ["subPackages"] 配置并进行修改。',UNUSE_FILE_LIST:"无依赖文件列表:%s",PACK_OPTIONS_IGNORE_LIST:"被 project.config.json packOptions.ignore 忽略的文件列表:%s",PARTIAL_COMPILE_IGNORE_LIST:"被局部编译所忽略的文件列表:%s",UNKNOWN_REASON_INGORE_LIST:"被 %s 忽略的文件列表: %s",LARGEFILE_WARNING:"%s 文件超过最大大小: %sKB,编译进程不处理"},formatConfig={};for(const[_,E]of Object.entries(config))formatConfig[_]=new fomatable_string_1.FormatableString(E);exports.default=formatConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.signAndInstallOrExport=exports.doCertificateSignAndInstallOrExport=exports.doAppleIdSignAndInstallOrExport=exports.clearCache=exports.getIOSDevices=exports.miniappSinTypes=exports.DEFAULT_BUNDLE_ID=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),singletontask_1=require("./singletontask"),zip_1=require("./zip"),cp_1=require("./cp"),tools_1=require("./tools"),progressRecorder_1=require("./progressRecorder"),download_1=require("./download"),glob_1=tslib_1.__importDefault(require("glob")),miniappJson_1=require("./miniappJson"),generateIpa_1=require("./generateIpa"),path=require("path"),os=require("os"),fse=require("fs-extra"),querystring=require("querystring");exports.DEFAULT_BUNDLE_ID="com.tencent.devtoolssaaademo.db";const isMac="darwin"===process.platform,remoteUrlRoot="http://dldir1.qq.com/WechatWebDev/donut/miniapp-builder/";exports.miniappSinTypes={appleId:{type:"appleId"},certificate:{type:"certificate"}};const majorVersion="1",signAndInstallTask={};async function getMiniAppBuilderVersion(e="cli"){try{"dev"!==e&&"cli"!==e&&(e="release-1");const i=`${remoteUrlRoot}versionMap/${e}.json`,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.signAndInstallOrExport=exports.doCertificateSignAndInstallOrExport=exports.doAppleIdSignAndInstallOrExport=exports.clearCache=exports.getIOSDevices=exports.getMiniAppBuilderFromRemoteCore=exports.miniappSinTypes=exports.DEFAULT_BUNDLE_ID=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),singletontask_1=require("./singletontask"),zip_1=require("./zip"),cp_1=require("./cp"),tools_1=require("./tools"),progressRecorder_1=require("./progressRecorder"),download_1=require("./download"),glob_1=tslib_1.__importDefault(require("glob")),miniappJson_1=require("./miniappJson"),generateIpa_1=require("./generateIpa"),path=require("path"),os=require("os"),fse=require("fs-extra"),querystring=require("querystring");exports.DEFAULT_BUNDLE_ID="com.tencent.devtoolssaaademo.db";const isMac="darwin"===process.platform,remoteUrlRoot="http://dldir1.qq.com/WechatWebDev/donut/miniapp-builder/";exports.miniappSinTypes={appleId:{type:"appleId"},certificate:{type:"certificate"}};const majorVersion="1",signAndInstallTask={};async function getMiniAppBuilderVersion(e="cli"){try{"dev"!==e&&"cli"!==e&&(e="release-1");const i=`${remoteUrlRoot}versionMap/${e}.json`,t=path.join(os.tmpdir(),"miniapp-builder-version.json");fse.existsSync(t)&&fse.removeSync(t),await(0,download_1.downloadLargeFile)(i,t);const n=fse.readJSONSync(t);return isMac?n.mac:n.win}catch(e){throw new Error("getMiniAppBuilderVersion fail: "+e.message)}}async function downloadMiniAppBuilder(e,i,t){const n=`${remoteUrlRoot}${isMac?"mac":"win"}/miniapp-builder-${e}.zip`,r=path.join(os.tmpdir(),"miniapp-builder.zip");fse.existsSync(r)&&fse.removeSync(r),null==t||t.progress("Downloading the miniapp-builder..."),await(0,download_1.downloadLargeFile)(n,r),await(0,zip_1.unzip)(r,i)}async function getMiniAppBuilderFromRemoteCore(e,i,t){const{miniappDirPath:n=path.join(__dirname,"../vendor"),devtoolsVersion:r="cli",recorder:s}=e,a=await getMiniAppBuilderVersion(r);let p="";const o=path.join(n,"miniapp-builder");if(p="win32"===process.platform?(0,tools_1.unifyPath)(path.join(o,a,i)):(0,tools_1.unifyPath)(path.join(o,a,t)),!fse.existsSync(p)){fse.ensureDirSync(o),fse.emptyDirSync(o);const e=path.dirname(p);fse.ensureDirSync(e),await downloadMiniAppBuilder(a,e,s);glob_1.default.sync("*",{nodir:!0,cwd:e}).forEach(i=>{fse.chmodSync(path.join(e,i),"777")})}return{builderPath:p,exe:path.basename(p),cwd:path.dirname(p)}}async function getMiniAppBuilder(e){return await getMiniAppBuilderFromRemoteCore(e,"MiniappBuilder.exe","MiniAppBuilder")}async function getIOSDevices(e){const{builderPath:i}=await getMiniAppBuilder(e),t=child_process.execSync(`"${i}" --action getDevices`,{}).toString().split("\n"),n=[];return t.forEach(e=>{if(e.trim()){const i=e.split("|");n.push({type:"device",name:(i[1]||"").trim(),version:(i[2]||"").trim(),udid:(i[3]||"").trim()})}}),n}async function clearCache(e){const{builderPath:i}=await getMiniAppBuilder(e),t=(0,miniappJson_1.getTargetMiniprogramArg)(e.projectPath,"appid");child_process.execSync(`"${i}" --appid ${t} --action clear --type ${e.type}`,{})}async function doAppleIdSignAndInstallOrExport(e,i){const{recorder:t}=i,n=genInterceptRecorder(t),{exe:r,cwd:s,builderPath:a}=await getMiniAppBuilder(i),p=(0,tools_1.unifyPath)(e.ipaPath),o=["--appid",(0,miniappJson_1.getTargetMiniprogramArg)(e.projectPath,"appid"),"--action","sign","--ipa",p,"--type","appleId"];if(e.appleId&&o.push("-ai",e.appleId),e.password&&o.push("-p",e.password),e.entitlements&&o.push("--entitlements",querystring.stringify(e.entitlements)),e.install&&(isMac?o.push("--install"):o.push("--install","true")),e.deviceId&&o.push("--deviceId",e.deviceId),e.output&&o.push("--output",e.output),e.bundleId){const i=e.bundleId===exports.DEFAULT_BUNDLE_ID?"auto":e.bundleId;o.push("--bundleId",i)}try{return signAndInstallTask[p]||(signAndInstallTask[p]=isMac?new singletontask_1.SingletonTask(cp_1.spawnSync.bind(null,a,o,{},n)):new singletontask_1.SingletonTask(cp_1.spawnSync.bind(null,r,o,{cwd:s},n))),await signAndInstallTask[p].getResult(!0),{success:!0}}catch(e){return{success:!1,errMsg:e.message}}finally{delete signAndInstallTask[p]}}async function doCertificateSignAndInstallOrExport(e,i){const{recorder:t}=i,{exe:n,cwd:r,builderPath:s}=await getMiniAppBuilder(i),a=(0,miniappJson_1.tryGetIOSMiniappJson)(e.projectPath),p=(0,miniappJson_1.iOSMiniAppJsonIsUsingTpush)(a),o=e.miniappCacheDirPath||"",l=(0,tools_1.unifyPath)(e.ipaPath),d=["--appid",(0,miniappJson_1.getTargetMiniprogramArg)(e.projectPath,"appid"),"--action","sign","--miniappCacheDir",o,"--ipa",l,"--type","certificate"];e.entitlements&&d.push("--entitlements",querystring.stringify(e.entitlements)),e.install&&(isMac?d.push("--install"):d.push("--install","true")),p&&(isMac?d.push("--extensionProfilePath"):d.push("--extension","true")),e.deviceId&&d.push("--deviceId",e.deviceId),e.output&&d.push("--output",e.output);try{return signAndInstallTask[l]||(signAndInstallTask[l]=isMac?new singletontask_1.SingletonTask(cp_1.spawnSync.bind(null,s,d,{},t)):new singletontask_1.SingletonTask(cp_1.spawnSync.bind(null,n,d,{cwd:r},t))),await signAndInstallTask[l].getResult(!0),{success:!0}}catch(e){return{success:!1,errMsg:e.message}}finally{delete signAndInstallTask[l]}}async function signAndInstallOrExport(e,i,t,n,r,s){const{recorder:a}=s,{install:p,deviceId:o,output:l,entitlements:d,bundleId:c}=r,u=await(0,generateIpa_1.generateIpa)(i,a);try{null==a||a.progress("signing the app...");const{signType:i}=n;let r=null;if(r=i===exports.miniappSinTypes.appleId.type?await doAppleIdSignAndInstallOrExport({bundleId:c,projectPath:e,ipaPath:u,entitlements:d,install:p,output:l,deviceId:o},s):await doCertificateSignAndInstallOrExport({projectPath:e,ipaPath:u,miniappCacheDirPath:t,entitlements:d,install:p,output:l,deviceId:o},s),!r.success)throw new Error("Sign the app fail:"+r.errMsg)}finally{fse.existsSync(u)&&fse.removeSync(u)}}function genInterceptRecorder(e){if(e){const i=new progressRecorder_1.Recorder((i,t,n)=>{(n.indexOf('["MiniAppBuilder could not find this device."]')>-1||n.indexOf("no connected device")>-1)&&e.message("fail","无法找到手机设备,请检查手机是否正确链接电脑(can not find device)"),e.message(t,n)});return i.run("!inner",()=>{}),i}}exports.getMiniAppBuilderFromRemoteCore=getMiniAppBuilderFromRemoteCore,exports.getIOSDevices=getIOSDevices,exports.clearCache=clearCache,exports.doAppleIdSignAndInstallOrExport=doAppleIdSignAndInstallOrExport,exports.doCertificateSignAndInstallOrExport=doCertificateSignAndInstallOrExport,exports.signAndInstallOrExport=signAndInstallOrExport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.iosPrivacyDescObj=exports.getTargetMiniprogramArg=exports.getMiniprogramRoot=exports.getRawAppJSON=exports.iOSAppJsonIsUsingIPadResizable=exports.iOSMiniAppJsonIsUsingGDT=exports.iOSMiniAppJsonIsUsingTpush=exports.writeMiniAppJson=exports.isNewMiniAppProject=exports.isMiniAppProject=exports.tryGetPluginMiniappJson=exports.tryGetIOSMiniappJson=exports.tryGetAndroidMiniappJson=exports.getMiniappJson=exports.getRawMiniappJson=exports.identityServiceConfigToMiniAppJSON=exports.PLATFORM=exports.miniAppPlatformMap=void 0;const tools_1=require("./tools"),each=require("licia/each"),safeSet=require("licia/safeSet"),path=require("path"),fse=require("fs-extra"),_=require("lodash");var PLATFORM;function identityServiceConfigToMiniAppJSON(i,n={}){return n.identityServiceConfig={authorizeMiniprogramType:1,miniprogramLoginPath:i},n}function getRawMiniappJson(i){var n,o,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.iosPrivacyDescObj=exports.getTargetMiniprogramArg=exports.getMiniprogramRoot=exports.getRawAppJSON=exports.iOSAppJsonIsUsingIPadResizable=exports.iOSMiniAppJsonIsUsingGDT=exports.iOSMiniAppJsonIsUsingTpush=exports.writeMiniAppJson=exports.isNewMiniAppProject=exports.isMiniAppProject=exports.tryGetPluginMiniappJson=exports.tryGetIOSMiniappJson=exports.tryGetAndroidMiniappJson=exports.getMiniappJson=exports.getRawMiniappJson=exports.identityServiceConfigToMiniAppJSON=exports.PLATFORM=exports.miniAppPlatformMap=void 0;const tools_1=require("./tools"),each=require("licia/each"),safeSet=require("licia/safeSet"),path=require("path"),fse=require("fs-extra"),_=require("lodash");var PLATFORM;function identityServiceConfigToMiniAppJSON(i,n={}){return n.identityServiceConfig={authorizeMiniprogramType:1,miniprogramLoginPath:i},n}function getRawMiniappJson(i){var n,e,o,t,p,s;i=(0,tools_1.unifyPath)(i);const r=path.posix.join(i,"project.miniapp.json");if(!fse.existsSync(r))return{};let a={};try{a=fse.readJsonSync(r)}catch(i){console.error(i)}return a.miniVersion&&"v1"!==a.miniVersion||((null===(n=a["mini-android"])||void 0===n?void 0:n.projectPath)&&!path.isAbsolute(null===(e=a["mini-android"])||void 0===e?void 0:e.projectPath)&&(a["mini-android"].projectPath=path.posix.join(i,null===(o=a["mini-android"])||void 0===o?void 0:o.projectPath)),(null===(t=a["mini-ios"])||void 0===t?void 0:t.projectPath)&&!path.isAbsolute(null===(p=a["mini-ios"])||void 0===p?void 0:p.projectPath)&&(a["mini-ios"].projectPath=path.posix.join(i,null===(s=a["mini-ios"])||void 0===s?void 0:s.projectPath))),a}function getMiniappJson(i,n="mini-weixin"){const e=Object.values(exports.miniAppPlatformMap),o=getRawMiniappJson(i),t=_.omit(o,e);return _.merge(t,o[n]||("mini-weixin"===n?o["mini-wechat"]:{}))}function tryGetAndroidMiniappJson(i){let n={};try{n=getMiniappJson(i,PLATFORM.ANDROID)}catch(i){}return n}function tryGetIOSMiniappJson(i){let n={};try{n=getMiniappJson(i,PLATFORM.IOS)}catch(i){}return n}function tryGetPluginMiniappJson(i){let n={};try{n=getMiniappJson(i,PLATFORM.PLUGIN)}catch(i){}return n}function isMiniAppProject(i){const n=path.posix.join(i,"project.miniapp.json");return"multiPlatform"===fse.readJsonSync(n).projectArchitecture}function isNewMiniAppProject(i){const n=getRawMiniappJson(i);return isMiniAppProject(i)&&"v2"===n.miniVersion}function writeMiniAppJson(i,n){const e=path.posix.join(i,"project.miniapp.json");let o={};try{o=fse.readJsonSync(e)}catch(i){return}each(n,(i,n)=>{safeSet(o,n,i)}),fse.writeJSONSync(e,o,{spaces:2})}function iOSMiniAppJsonIsUsingTpush(i){const n=i.tpush&&!0===i.tpush.useExtendedLib_WeAppTPNS&&"number"==typeof i.tpush.accessID&&"string"==typeof i.tpush.accessKey&&"string"==typeof i.tpush.serviceBundleId;if(n&&(0,tools_1.compareVersion)(i.sdkVersion,"1.0.7")<=0)throw new Error(`can not use TPNS(消息推送) extendsdk in sdk version ${i.sdkVersion}, TPNS is supported in 1.0.8.`);return n}function iOSMiniAppJsonIsUsingGDT(i){const n=i.gdt&&!0===i.gdt.useExtendedLib_WeAppGDT&&"string"==typeof i.gdt.appid&&"string"==typeof i.gdt.splashAd_placementId;if(n&&(0,tools_1.compareVersion)(i.sdkVersion,"1.0.19")<=0)throw new Error(`can not use GDT(广告) extendsdk in sdk version ${i.sdkVersion}, GDT is supported in 1.0.20.`);return n}function iOSAppJsonIsUsingIPadResizable(i){return!0===getRawAppJSON(i).resizable}function getRawAppJSON(i){let n,e;const o=getMiniprogramRoot(i);n=o?path.posix.join(i,o,"app.json"):path.posix.join(i,"app.json");try{e=fse.readJsonSync(n)}catch(i){throw console.error(i),i}return e}function getMiniprogramRoot(i){const n=(0,tools_1.normalizePath)(path.posix.join(i,"project.config.json"));let e;try{e=fse.readJsonSync(n)}catch(i){throw console.error(i),i}return e.miniprogramRoot?e.miniprogramRoot:""}function getTargetMiniprogramArg(i,n){const e=(0,tools_1.normalizePath)(path.posix.join(i,"project.config.json"));let o;try{o=fse.readJsonSync(e)}catch(i){throw console.error(i),i}return o[n]||""}exports.miniAppPlatformMap={"mini-android":"mini-android","mini-ios":"mini-ios","mini-weixin":"mini-weixin"},function(i){i.ANDROID="mini-android",i.IOS="mini-ios",i.PLUGIN="mini-plugin"}(PLATFORM=exports.PLATFORM||(exports.PLATFORM={})),exports.identityServiceConfigToMiniAppJSON=identityServiceConfigToMiniAppJSON,exports.getRawMiniappJson=getRawMiniappJson,exports.getMiniappJson=getMiniappJson,exports.tryGetAndroidMiniappJson=tryGetAndroidMiniappJson,exports.tryGetIOSMiniappJson=tryGetIOSMiniappJson,exports.tryGetPluginMiniappJson=tryGetPluginMiniappJson,exports.isMiniAppProject=isMiniAppProject,exports.isNewMiniAppProject=isNewMiniAppProject,exports.writeMiniAppJson=writeMiniAppJson,exports.iOSMiniAppJsonIsUsingTpush=iOSMiniAppJsonIsUsingTpush,exports.iOSMiniAppJsonIsUsingGDT=iOSMiniAppJsonIsUsingGDT,exports.iOSAppJsonIsUsingIPadResizable=iOSAppJsonIsUsingIPadResizable,exports.getRawAppJSON=getRawAppJSON,exports.getMiniprogramRoot=getMiniprogramRoot,exports.getTargetMiniprogramArg=getTargetMiniprogramArg,exports.iosPrivacyDescObj={NSPhotoLibraryUsageDescription:"当前应用程序需要访问用户的相册,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSCameraUsageDescription:"当前应用程序需要访问用户的相机,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSMicrophoneUsageDescription:"当前应用程序需要访问用户的麦克风,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSLocationWhenInUseUsageDescription:"当前应用程序需要在使用时访问用户的位置,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSLocationAlwaysUsageDescription:"当前应用程序需要始终访问用户的位置,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSLocationAlwaysAndWhenInUseUsageDescription:"当前应用程序需要始终和在使用时访问用户的位置,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSContactsUsageDescription:"当前应用程序需要访问用户的联系人,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSCalendarsUsageDescription:"当前应用程序需要访问用户的日历,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSRemindersUsageDescription:"当前应用程序需要访问用户的提醒事项,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSHealthShareUsageDescription:"",NSHealthUpdateUsageDescription:"",NSBluetoothPeripheralUsageDescription:"当前应用程序需要访问用户的蓝牙,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSBluetoothAlwaysUsageDescription:"当前应用程序需要始终访问用户的蓝牙,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSMotionUsageDescription:"",NSHomeKitUsageDescription:"",NSSiriUsageDescription:"",NSSpeechRecognitionUsageDescription:"当前应用程序需要使用语音识别,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSVideoSubscriberAccountUsageDescription:"",NSAppleMusicUsageDescription:"",NSFaceIDUsageDescription:"",NSNFCReaderUsageDescription:"",NSUserTrackingUsageDescription:"",NSLocalNetworkUsageDescription:"当前应用程序需要访问本地网络,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSSystemAdministrationUsageDescription:"当前应用程序需要进行系统管理操作,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NFCReaderUsageDescription:"",NSHealthClinicalHealthRecordsShareUsageDescription:"",NSPhotoLibraryAddUsageDescription:"应用程序在请求访问照片库,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可"};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),filerules_1=tslib_1.__importDefault(require("../utils/filerules"));class PackOptionsHelper{constructor(){this.packOptionIgnores=[],this.packOptionIncludes=[]}updateState(e){var i,s;this.packOptionIgnores=(null===(i=e.packOptions)||void 0===i?void 0:i.ignore)||[],this.packOptionIncludes=(null===(s=e.packOptions)||void 0===s?void 0:s.include)||[]}isUnuserFilesEnable(){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),path=tslib_1.__importStar(require("path")),filerules_1=tslib_1.__importDefault(require("../utils/filerules")),tools_1=require("./tools"),config_1=require("../config/config");class PackOptionsHelper{constructor(){this.packOptionIgnores=[],this.packOptionIncludes=[],this.ignoreUploadUnusedFiles=!1,this.ignoreDevUnusedFiles=!1,this.unusedFiles=new Set,this.extOpts={include:[],ignore:[]}}setExtOpts(e={}){this.extOpts.include=e.include||[],this.extOpts.ignore=e.ignore||[]}updateState(e){var i,s;this.packOptionIgnores=(null===(i=e.packOptions)||void 0===i?void 0:i.ignore)||[],this.packOptionIncludes=(null===(s=e.packOptions)||void 0===s?void 0:s.include)||[],e.type!==config_1.COMPILE_TYPE.miniProgram?(this.ignoreUploadUnusedFiles=!1,this.ignoreDevUnusedFiles=!1):(this.ignoreUploadUnusedFiles=!!e.setting.ignoreUploadUnusedFiles,this.ignoreDevUnusedFiles=!!e.setting.ignoreDevUnusedFiles)}isUnuserFilesEnable(e=!1){return e?!1!==this.ignoreUploadUnusedFiles:!0===this.ignoreDevUnusedFiles||!1!==this.ignoreDevUnusedFiles}filter(e,i=!1){return e.filter(e=>this.isNotIgnored(e,i))}isIgnored(e,i=!1){return this.isIgnoredByRules(e)||this.isIgnoreByUnusedFiles(e,i)}isNotIgnored(e,i=!1){return!this.isIgnored(e,i)}isIgnoredByRules(e,i={}){return!this.isFileIncluded(e,i.include)&&this.isFileIgnored(e,i.ignore)}isFileIgnored(e,i){return i||(i=[...this.packOptionIgnores,...this.extOpts.ignore]),filerules_1.default.isFileIgnored(e,i)}isFileIncluded(e,i){return i||(i=[...this.packOptionIncludes,...this.extOpts.include]),filerules_1.default.isFileIncluded(e,i)}isIgnoreByUnusedFiles(e,i=!1){return!!this.isUnuserFilesEnable(i)&&(!this.isFileIncluded(e)&&this.unusedFiles.has((0,tools_1.sourcePathToTargetPath)(e)))}getUnusedFiles(){return this.unusedFiles}async initUnusedFiles(e,i,s=!1){if(this.updateState(e),this.isUnuserFilesEnable(s))try{await i.analyse();const s=i.fileHelper.getFileList("").filter(e=>(0,tools_1.isCodeFile)(path.posix.extname(e))),t=new Set;i.graph.modules.forEach(e=>{const i=s.find(i=>i===e.path);i&&t.add((0,tools_1.sourcePathToTargetPath)(i))});const n=new Set;s.forEach(i=>{const s=(0,tools_1.sourcePathToTargetPath)(i);t.has(s)||n.add(path.posix.join(e.miniprogramRoot,s))}),this.unusedFiles=n,console.error(this.unusedFiles)}catch(e){console.error("initUnusedFiles error",e)}}}exports.default=new PackOptionsHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function pad(e,
|
|
1
|
+
"use strict";function pad(e,s=2){return e>10**s?String(e):`${new Array(s).join("0")}${e}`.slice(-s)}function getPrintTime(){const e=new Date;return`${String(e.getFullYear())}-${pad(e.getMonth()+1)}-${pad(e.getDate())} ${pad(e.getHours())}:${pad(e.getMinutes())}:${pad(e.getSeconds())}.${pad(e.getMilliseconds(),3)}`}Object.defineProperty(exports,"__esModule",{value:!0}),exports.silentRecorder=exports.Recorder=exports.getPrintTime=void 0,exports.getPrintTime=getPrintTime;let taskId=5e7;function genTaskId(){return taskId++}class Recorder{message(e,s){const t=genTaskId();this.sendProgress(t,e,s)}constructor(e){this.sendProgress=e}start(e){const s=genTaskId(),t=e.startsWith("!");t||this.sendProgress(s,"doing",e);const r=(e,r)=>{e?t||this.sendProgress(s,"fail",e.message):t||this.sendProgress(s,"done",null==r?void 0:r.message)};return r.id=s,this.progress=e=>{this.sendProgress(s,"doing",e)},this.message=(e,t)=>{this.sendProgress(s,e,t)},r}async run(e,s){const t=this.start(e);let r=null,n=null;try{return n=await s(),n}catch(e){throw r=e,e}finally{t(r,n)}}}exports.Recorder=Recorder,exports.silentRecorder=new Recorder(()=>{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubProcessProxy=void 0;const tslib_1=require("tslib"),child_process_1=require("child_process"),path_1=tslib_1.__importDefault(require("path")),customError_1=require("../customError"),singletontask_1=require("../singletontask"),debug_1=require("../debug");function performanceMark(s,e){}const PROCESS_READY_TIMEOUT=2e4;class SubProcessProxy{constructor(s,e,t,r,o=8891){this.project=s,this.entryPath=e,this.passData=t,this.initOptions=r,this.inspectPort=o,this.taskMap=new Map,this.taskId=0,this.init=async()=>{performanceMark("process init"),this.process=await this.forkProcess(),performanceMark("process init",!0)}}async ready(){var s;return this._checkReadyTask||(this._checkReadyTask=new singletontask_1.SingletonTask(this.init)),await(null===(s=this._checkReadyTask)||void 0===s?void 0:s.getResult(!0))}async sendProcessMessage(s){await this.ready(),this.process.send(s)}destroy(){var s;null===(s=this.process)||void 0===s||s.kill("SIGTERM"),this.process=void 0,this._checkReadyTask=void 0}async forkProcess(){const s=await this.project.serialize(),e={type:"init",data:{passData:this.passData,projectInfo:s,options:this.initOptions}};if((0,debug_1.shouldRunInMainProcess)()){const s=require("../../modules/corecompiler/processHandler");return await s.initHandler(e),{send:async e=>{if((0,debug_1.shouldRunInMainProcess)()){const t=await s.messageHandler(e)
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubProcessProxy=void 0;const tslib_1=require("tslib"),child_process_1=require("child_process"),path_1=tslib_1.__importDefault(require("path")),customError_1=require("../customError"),singletontask_1=require("../singletontask"),debug_1=require("../debug");function performanceMark(s,e){}const PROCESS_READY_TIMEOUT=2e4;class SubProcessProxy{constructor(s,e,t,r,o=8891){this.project=s,this.entryPath=e,this.passData=t,this.initOptions=r,this.inspectPort=o,this.taskMap=new Map,this.taskId=0,this.init=async()=>{performanceMark("process init"),this.process=await this.forkProcess(),performanceMark("process init",!0)}}async ready(){var s;return this._checkReadyTask||(this._checkReadyTask=new singletontask_1.SingletonTask(this.init)),await(null===(s=this._checkReadyTask)||void 0===s?void 0:s.getResult(!0))}async sendProcessMessage(s){await this.ready(),this.process.send(s)}destroy(){var s;null===(s=this.process)||void 0===s||s.kill("SIGTERM"),this.process=void 0,this._checkReadyTask=void 0}async forkProcess(){const s=await this.project.serialize(),e={type:"init",data:{passData:this.passData,projectInfo:s,options:this.initOptions}};if((0,debug_1.shouldRunInMainProcess)()){const s=require("../../modules/corecompiler/processHandler");return await s.initHandler(e),{send:async e=>{if((0,debug_1.shouldRunInMainProcess)()){const t=await s.messageHandler(e,e.progressUpdate);if(t){const{id:s,data:e,error:r}=t;this.onResponse(s,e,r)}}else;},kill:e=>(s.destroy(),!0)}}const t=this.entryPath,r={stdio:["pipe","pipe","pipe","ipc"],cwd:this.project.projectPath,env:Object.assign(Object.assign({},process.env),{cpprocessEnv:"childprocess",nativeProcess:"1",timeout:global.TEST_COMPILER_PROCESS_TIMEOUT})};(0,debug_1.shouldInspectCompiler)()&&(r.execArgv=["--inspect-brk="+this.inspectPort]);const o=process.__nwjs&&"wechatwebdevtools"===nw.App.manifest.appname;if(r.env.isDevtools=o,o){let s=path_1.default.join(path_1.default.dirname(process.execPath),"node");"darwin"!==process.platform&&(s+=".exe"),r.execPath=s}return performanceMark("fork process"),new Promise((s,i)=>{const a=(0,child_process_1.fork)(t,["--expose-gc"],r),n=setTimeout(()=>{this.destroy(),i(new Error("fork process timeout"))},2e4);return a.stdout.setEncoding("utf8"),a.stdout.on("data",s=>{console.log("child process stdout: "+s)}),a.stderr.on("data",s=>{console.error("child process stderr: "+s)}),a.on("exit",(s,e)=>{this.process=void 0,this._checkReadyTask=void 0,o&&console.error(`child process exit: code(${s}), signal(${e})`),0!==s&&i(new Error(`native child process exit: code(${s}), signal(${e})`))}),a.on("message",e=>{if("ready"===e.type&&(clearTimeout(n),performanceMark("process ready"),s(a)),"noReady"===e.type&&(performanceMark("process not ready"),i(new Error(e.error.message))),"progress"===e.type){const s=this.taskMap.get(e.taskId);(null==s?void 0:s.progressUpdate)&&s.progressUpdate(e.id,e.status,e.message)}if("response"===e.type){const{id:s,data:t,error:r}=e;r?this.onResponse(s,void 0,r):this.onResponse(s,t,void 0)}}),a.unref(),this.taskId+=1,a.send(e),a})}onResponse(s,e,t){const r=this.taskMap.get(s);this.taskMap.delete(s),r?t?(t=new customError_1.CustomError(t),r.reject(t)):r.resolve(e):console.error(`child process task: ${s} not found`)}async sendEvent(s,e){this.sendProcessMessage({type:"event",name:s,data:e})}async runTask(s,e,t){return new Promise((r,o)=>{const i={name:s,data:e,resolve:r,reject:o,progressUpdate:t};this.taskId+=1,this.taskMap.set(this.taskId,i);const a=(0,debug_1.shouldRunInMainProcess)()?{type:"request",id:this.taskId,name:s,data:e,progressUpdate:t}:{type:"request",id:this.taskId,name:s,data:e};this.sendProcessMessage(a)})}}exports.SubProcessProxy=SubProcessProxy;
|
package/dist/utils/tools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sourcePathToTargetPath=exports.checkIsUseCompilerPlugins=exports.isGameApp=exports.isLeftSubPathOfRight=exports.pathRelative=exports.compareVersion=exports.unifyPath=exports.getWorkersPath=exports.getPluginJson=exports.getAppJson=exports.getTerm=exports.checkIsIndependentSubpackage=exports.checkIsInSubPackage=exports.devtoolsError=exports.devtoolsLog=exports.devtoolsInfo=exports.formatTime=exports.formatNumber=exports.generateMD5=exports.formatSourceMap=exports.isFileIncluded=exports.isFileIgnored=exports.leading=exports.trailing=exports.escapeQuot=exports.mkdirSync=exports.rmSync=exports.isHexColor=exports.formatJSONParseErr=exports.bufferToUtf8String=exports.getType=exports.wrapCodeByEval=exports.escapeScript=exports.normalizePath=void 0;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),crypto_1=tslib_1.__importDefault(require("crypto")),babel_code_frame_1=tslib_1.__importDefault(require("babel-code-frame")),minimatch_1=tslib_1.__importDefault(require("minimatch")),startWith_1=tslib_1.__importDefault(require("licia/startWith")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),lodash_1=tslib_1.__importDefault(require("lodash")),define_1=require("../config/define"),types_1=require("../types"),jsonlint=require("./jsonlint");function normalizePath(e=""){const t=path_1.default.posix.normalize(e.replace(/\\/g,"/"));return!e.startsWith("//")&&!e.startsWith("\\\\")||t.startsWith("//")?t:"/"+t}function escapeScript(e){return e?e.replace(/<script/g,"<script").replace(/<\/script/g,"</script"):e}function wrapCodeByEval(e){return`;(window.eval || __global.__hackEval)('${e}')`}function getType(e){return Object.prototype.toString.call(e).toLowerCase().split(" ")[1].replace("]","")}exports.normalizePath=normalizePath,exports.escapeScript=escapeScript,exports.wrapCodeByEval=wrapCodeByEval,exports.getType=getType;const bufferToUtf8String=e=>{const t=e.toString();if(0===Buffer.compare(Buffer.from(t,"utf8"),e))return t};function getErrLine(e,t,r,o){r=r>0?r:1;return`${o}\n${(0,babel_code_frame_1.default)(e,t,r)}`}exports.bufferToUtf8String=bufferToUtf8String;const formatJSONParseErr=e=>{const t=e.data||"";try{jsonlint.parser.parse(t)}catch(r){try{const o=`Expecting ${r.expected}, got ${r.token}`,s=getErrLine(t,r.line,r.loc.first_column,o);return`${e.filePath}\n${s}`}catch(e){}}return`${e.filePath}\n${e.error}`};exports.formatJSONParseErr=formatJSONParseErr;const isHexColor=e=>/^#[a-f\d]{3}$/i.test(e)||/^#[a-f\d]{4}$/i.test(e)||/^#[a-f\d]{6}$/i.test(e)||/^#[a-f\d]{8}$/i.test(e);function rmSync(e){try{if(e=path_1.default.resolve(e),!fs_1.default.existsSync(e))return;if(fs_1.default.lstatSync(e).isDirectory()){const t=fs_1.default.readdirSync(e);if(t.length>0)for(let r=0,o=t.length;r<o;r++)rmSync(path_1.default.posix.join(e,t[r]));fs_1.default.rmdirSync(e)}else fs_1.default.unlinkSync(e)}catch(e){}}function mkdirSync(e){if(e=path_1.default.resolve(e),fs_1.default.existsSync(e)){if(fs_1.default.lstatSync(e).isDirectory())return;fs_1.default.unlinkSync(e)}mkdirSync(path_1.default.dirname(e)),fs_1.default.mkdirSync(e)}function escapeQuot(e,t="`"){return e?"`"===t?e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$"):'"'===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/"/g,'\\"'):"'"===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/'/g,"\\'"):e:e}function trailing(e,t,r=!1){return r?e.endsWith(t)?e.slice(0,e.length-1):e:e.endsWith(t)?e:e+t}function leading(e,t,r=!1){return r?e.startsWith(t)?e.slice(1):e:e.startsWith(t)?e:t+e}exports.isHexColor=isHexColor,exports.rmSync=rmSync,exports.mkdirSync=mkdirSync,exports.escapeQuot=escapeQuot,exports.trailing=trailing,exports.leading=leading;const FFSPRGRulesFactory=function(e){let t=null,r=Object.create(null);return function(e,o){if(o.length<1)return!1;if(t===o){if(void 0!==r[e])return r[e]}else t=o,r=Object.create(null);const s=e.replace(/\\/g,"/").toLowerCase();if(!s)return!1;const n=s.slice(s.lastIndexOf("/")+1);let i=!1;for(const e of o){if(!e)continue;const t=e.value.toLowerCase();if("prefix"===e.type)i=n.startsWith(t);else if("suffix"===e.type)i=n.endsWith(t);else if("folder"===e.type)i=leading(s,"/").startsWith(trailing(leading(t,"/"),"/"));else if("file"===e.type)i=leading(s,"/")===leading(t,"/");else if("glob"===e.type)try{i=(0,minimatch_1.default)(s,t)||(0,minimatch_1.default)(leading(s,"/"),t)}catch(e){i=!1}else if("regexp"===e.type)try{i=new RegExp(t,"igm").test(s)||new RegExp(t,"igm").test(leading(s,"/"))}catch(e){i=!1}if(i)break}return r[e]=i,i}};function formatSourceMap(e){if(e){if("string"===getType(e))return e;try{return JSON.stringify(e)}catch(e){}}}function generateMD5(e){const t=crypto_1.default.createHash("md5");return t.update(e),t.digest("hex")}exports.isFileIgnored=FFSPRGRulesFactory(),exports.isFileIncluded=FFSPRGRulesFactory(),exports.formatSourceMap=formatSourceMap,exports.generateMD5=generateMD5;const formatNumber=e=>e>9?""+e:"0"+e;exports.formatNumber=formatNumber;const formatTime=e=>{const t=e.getFullYear(),r=e.getMonth()+1,o=e.getDate(),s=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return`${[t,r,o].map(exports.formatNumber).join("/")} ${[s,n,i].map(exports.formatNumber).join(":")}`};exports.formatTime=formatTime;const isDevtools=process.__nwjs&&window.nw&&"wechatwebdevtools"===nw.App.manifest.appname;function devtoolsInfo(...e){isDevtools&&console.info(...e)}function devtoolsLog(...e){isDevtools&&console.log(...e)}function devtoolsError(...e){isDevtools&&console.error(...e)}function getPluginByAliasOrProvider(e,t){if(e){const r=e[t];if(r)return{alias:t,provider:r.provider,version:r.version};for(const r in e){const o=e[r];if(o.provider===t)return{alias:r,provider:o.provider,version:o.version}}}}function checkPluginByAliasOrProvider(e,t){let r;if(e.subPackages)for(const o of e.subPackages)if(r=getPluginByAliasOrProvider(o.plugins,t),r)return Object.assign(Object.assign({},r),{config:o});if(r=getPluginByAliasOrProvider(e.plugins,t),r)return r}function checkIsInSubPackage(e,t=""){let r;if((0,startWith_1.default)(t,"plugin://")){const r=t.match(/^plugin:\/\/([^/]*)\/(.*)/),o=null==r?void 0:r[1];if(!o)return;const s=checkPluginByAliasOrProvider(e,o);return null==s?void 0:s.config}if(e.subPackages)for(let o=0,s=e.subPackages.length;o<s;o++){const s=e.subPackages[o];if(t.startsWith(s.root)){r=s;break}}return r}function checkIsIndependentSubpackage(e,t){const r=checkIsInSubPackage(e,t);if(r&&!0===r.independent)return r}function getTerm(){if(!!!(null===window||void 0===window?void 0:window.nw))return require("terminal-kit").terminal}function getTargetPlatformJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=Object.values(define_1.PLATFORM),o=fs_extra_1.default.readJsonSync(e),s=lodash_1.default.omit(o,r);return lodash_1.default.merge(s,o[t]||("mini-weixin"===t?o["mini-wechat"]:{}))}function getAppJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=path_1.default.join(e.projectPath,e.miniprogramRoot||"","app.json");if(!fs_extra_1.default.existsSync(r))throw Error("no found app.json");return getTargetPlatformJson(r,t)}function getPluginJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=path_1.default.join(e.projectPath,e.pluginRoot||"","plugin.json");if(!fs_extra_1.default.existsSync(r))throw Error("no found plugin.json");return getTargetPlatformJson(r,t)}exports.devtoolsInfo=devtoolsInfo,exports.devtoolsLog=devtoolsLog,exports.devtoolsError=devtoolsError,exports.checkIsInSubPackage=checkIsInSubPackage,exports.checkIsIndependentSubpackage=checkIsIndependentSubpackage,exports.getTerm=getTerm,exports.getAppJson=getAppJson,exports.getPluginJson=getPluginJson;const getWorkersPath=e=>"string"==typeof e?e:e.path;exports.getWorkersPath=getWorkersPath;const unifyPath=e=>e.replace(/\\/g,"/");exports.unifyPath=unifyPath;const compareVersion=(e,t)=>{e=e.split("."),t=t.split(".");const r=Math.max(e.length,t.length);for(;e.length<r;)e.push("0");for(;t.length<r;)t.push("0");for(let o=0;o<r;o++){const r=parseInt(e[o],10),s=parseInt(t[o],10);if(r>s)return 1;if(r<s)return-1}return 0};exports.compareVersion=compareVersion;const pathRelative=(e,t)=>(e=path_1.default.posix.normalize(e.replace(/\\/g,"/")),t=path_1.default.posix.normalize(t.replace(/\\/g,"/")),path_1.default.posix.relative(e,t));function _isLeftSubPathOfRight(e,t){if(!t)return!0;if(t=normalizePath(t),e=normalizePath(e),!t.endsWith("/")){if(e===t)return!0;t+="/"}return!!e.startsWith(t)}function isLeftSubPathOfRight(e,t){void 0===e&&(console.error(new Error("The child string is undefined here, please check!!")),e="");const r=e.startsWith(t),o=_isLeftSubPathOfRight(e,t);return r!==o&&console.error(new Error(`${e} ${t} difference check sub path here! new result: ${o}`)),o}function isGameApp(e){return e.type===types_1.EProjectType.miniGame||e.type===types_1.EProjectType.miniGamePlugin}exports.pathRelative=pathRelative,exports.isLeftSubPathOfRight=isLeftSubPathOfRight,exports.isGameApp=isGameApp;const checkIsUseCompilerPlugins=()=>!0;exports.checkIsUseCompilerPlugins=checkIsUseCompilerPlugins;const sourceExt2TargetExtConf={".ts":".js",".less":".wxss",".sass":".wxss",".scss":".wxss"},sourcePathToTargetPath=e=>{const t=path_1.default.extname(e);return sourceExt2TargetExtConf[t]?e.substr(0,e.length-t.length)+sourceExt2TargetExtConf[t]:e};exports.sourcePathToTargetPath=sourcePathToTargetPath;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isMiniProgramCodeFile=exports.isCodeFile=exports.getSupportCodeFileExtSet=exports.getCompilerPlugins=exports.sourcePathToTargetPath=exports.checkIsUseCompilerPlugins=exports.isGameApp=exports.isLeftSubPathOfRight=exports.pathRelative=exports.compareVersion=exports.unifyPath=exports.getWorkersPath=exports.getPluginJson=exports.getAppJson=exports.getTerm=exports.checkIsIndependentSubpackage=exports.checkIsInSubPackage=exports.devtoolsError=exports.devtoolsLog=exports.devtoolsInfo=exports.formatTime=exports.formatNumber=exports.generateMD5=exports.formatSourceMap=exports.isFileIncluded=exports.isFileIgnored=exports.leading=exports.trailing=exports.escapeQuot=exports.mkdirSync=exports.rmSync=exports.isHexColor=exports.formatJSONParseErr=exports.bufferToUtf8String=exports.getType=exports.wrapCodeByEval=exports.escapeScript=exports.joinPath=exports.normalizePath=void 0;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),crypto_1=tslib_1.__importDefault(require("crypto")),babel_code_frame_1=tslib_1.__importDefault(require("babel-code-frame")),minimatch_1=tslib_1.__importDefault(require("minimatch")),startWith_1=tslib_1.__importDefault(require("licia/startWith")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),lodash_1=tslib_1.__importDefault(require("lodash")),define_1=require("../config/define"),types_1=require("../types"),jsonlint=require("./jsonlint");function normalizePath(e=""){const t=path_1.default.posix.normalize(e.replace(/\\/g,"/"));return!e.startsWith("//")&&!e.startsWith("\\\\")||t.startsWith("//")?t:"/"+t}function joinPath(e="",t=""){const r=path_1.default.posix.join(e,t);return!e.startsWith("//")&&!e.startsWith("\\\\")||r.startsWith("//")?r:"/"+r}function escapeScript(e){return e?e.replace(/<script/g,"<script").replace(/<\/script/g,"</script"):e}function wrapCodeByEval(e){return`;(window.eval || __global.__hackEval)('${e}')`}function getType(e){return Object.prototype.toString.call(e).toLowerCase().split(" ")[1].replace("]","")}exports.normalizePath=normalizePath,exports.joinPath=joinPath,exports.escapeScript=escapeScript,exports.wrapCodeByEval=wrapCodeByEval,exports.getType=getType;const bufferToUtf8String=e=>{const t=e.toString();if(0===Buffer.compare(Buffer.from(t,"utf8"),e))return t};function getErrLine(e,t,r,s){r=r>0?r:1;return`${s}\n${(0,babel_code_frame_1.default)(e,t,r)}`}exports.bufferToUtf8String=bufferToUtf8String;const formatJSONParseErr=e=>{const t=e.data||"";try{jsonlint.parser.parse(t)}catch(r){try{const s=`Expecting ${r.expected}, got ${r.token}`,o=getErrLine(t,r.line,r.loc.first_column,s);return`${e.filePath}\n${o}`}catch(e){}}return`${e.filePath}\n${e.error}`};exports.formatJSONParseErr=formatJSONParseErr;const isHexColor=e=>/^#[a-f\d]{3}$/i.test(e)||/^#[a-f\d]{4}$/i.test(e)||/^#[a-f\d]{6}$/i.test(e)||/^#[a-f\d]{8}$/i.test(e);function rmSync(e){try{if(e=path_1.default.resolve(e),!fs_1.default.existsSync(e))return;if(fs_1.default.lstatSync(e).isDirectory()){const t=fs_1.default.readdirSync(e);if(t.length>0)for(let r=0,s=t.length;r<s;r++)rmSync(path_1.default.posix.join(e,t[r]));fs_1.default.rmdirSync(e)}else fs_1.default.unlinkSync(e)}catch(e){}}function mkdirSync(e){if(e=path_1.default.resolve(e),fs_1.default.existsSync(e)){if(fs_1.default.lstatSync(e).isDirectory())return;fs_1.default.unlinkSync(e)}mkdirSync(path_1.default.dirname(e)),fs_1.default.mkdirSync(e)}function escapeQuot(e,t="`"){return e?"`"===t?e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$"):'"'===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/"/g,'\\"'):"'"===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/'/g,"\\'"):e:e}function trailing(e,t,r=!1){return r?e.endsWith(t)?e.slice(0,e.length-1):e:e.endsWith(t)?e:e+t}function leading(e,t,r=!1){return r?e.startsWith(t)?e.slice(1):e:e.startsWith(t)?e:t+e}exports.isHexColor=isHexColor,exports.rmSync=rmSync,exports.mkdirSync=mkdirSync,exports.escapeQuot=escapeQuot,exports.trailing=trailing,exports.leading=leading;const FFSPRGRulesFactory=function(e){let t=null,r=Object.create(null);return function(e,s){if(s.length<1)return!1;if(t===s){if(void 0!==r[e])return r[e]}else t=s,r=Object.create(null);const o=e.replace(/\\/g,"/").toLowerCase();if(!o)return!1;const i=o.slice(o.lastIndexOf("/")+1);let n=!1;for(const e of s){if(!e)continue;const t=e.value.toLowerCase();if("prefix"===e.type)n=i.startsWith(t);else if("suffix"===e.type)n=i.endsWith(t);else if("folder"===e.type)n=leading(o,"/").startsWith(trailing(leading(t,"/"),"/"));else if("file"===e.type)n=leading(o,"/")===leading(t,"/");else if("glob"===e.type)try{n=(0,minimatch_1.default)(o,t)||(0,minimatch_1.default)(leading(o,"/"),t)}catch(e){n=!1}else if("regexp"===e.type)try{n=new RegExp(t,"igm").test(o)||new RegExp(t,"igm").test(leading(o,"/"))}catch(e){n=!1}if(n)break}return r[e]=n,n}};function formatSourceMap(e){if(e){if("string"===getType(e))return e;try{return JSON.stringify(e)}catch(e){}}}function generateMD5(e){const t=crypto_1.default.createHash("md5");return t.update(e),t.digest("hex")}exports.isFileIgnored=FFSPRGRulesFactory(),exports.isFileIncluded=FFSPRGRulesFactory(),exports.formatSourceMap=formatSourceMap,exports.generateMD5=generateMD5;const formatNumber=e=>e>9?""+e:"0"+e;exports.formatNumber=formatNumber;const formatTime=e=>{const t=e.getFullYear(),r=e.getMonth()+1,s=e.getDate(),o=e.getHours(),i=e.getMinutes(),n=e.getSeconds();return`${[t,r,s].map(exports.formatNumber).join("/")} ${[o,i,n].map(exports.formatNumber).join(":")}`};exports.formatTime=formatTime;const isDevtools=process.__nwjs&&window.nw&&"wechatwebdevtools"===nw.App.manifest.appname;function devtoolsInfo(...e){isDevtools&&console.info(...e)}function devtoolsLog(...e){isDevtools&&console.log(...e)}function devtoolsError(...e){isDevtools&&console.error(...e)}function getPluginByAliasOrProvider(e,t){if(e){const r=e[t];if(r)return{alias:t,provider:r.provider,version:r.version};for(const r in e){const s=e[r];if(s.provider===t)return{alias:r,provider:s.provider,version:s.version}}}}function checkPluginByAliasOrProvider(e,t){let r;if(e.subPackages)for(const s of e.subPackages)if(r=getPluginByAliasOrProvider(s.plugins,t),r)return Object.assign(Object.assign({},r),{config:s});if(r=getPluginByAliasOrProvider(e.plugins,t),r)return r}function checkIsInSubPackage(e,t=""){let r;if((0,startWith_1.default)(t,"plugin://")){const r=t.match(/^plugin:\/\/([^/]*)\/(.*)/),s=null==r?void 0:r[1];if(!s)return;const o=checkPluginByAliasOrProvider(e,s);return null==o?void 0:o.config}if(e.subPackages)for(let s=0,o=e.subPackages.length;s<o;s++){const o=e.subPackages[s];if(t.startsWith(o.root)){r=o;break}}return r}function checkIsIndependentSubpackage(e,t){const r=checkIsInSubPackage(e,t);if(r&&!0===r.independent)return r}function getTerm(){if(!!!(null===window||void 0===window?void 0:window.nw))return require("terminal-kit").terminal}function getTargetPlatformJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=Object.values(define_1.PLATFORM),s=fs_extra_1.default.readJsonSync(e),o=lodash_1.default.omit(s,r);return lodash_1.default.merge(o,s[t]||("mini-weixin"===t?s["mini-wechat"]:{}))}function getAppJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=path_1.default.join(e.projectPath,e.miniprogramRoot||"","app.json");if(!fs_extra_1.default.existsSync(r))throw Error("no found app.json");return getTargetPlatformJson(r,t)}function getPluginJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=path_1.default.join(e.projectPath,e.pluginRoot||"","plugin.json");if(!fs_extra_1.default.existsSync(r))throw Error("no found plugin.json");return getTargetPlatformJson(r,t)}exports.devtoolsInfo=devtoolsInfo,exports.devtoolsLog=devtoolsLog,exports.devtoolsError=devtoolsError,exports.checkIsInSubPackage=checkIsInSubPackage,exports.checkIsIndependentSubpackage=checkIsIndependentSubpackage,exports.getTerm=getTerm,exports.getAppJson=getAppJson,exports.getPluginJson=getPluginJson;const getWorkersPath=e=>"string"==typeof e?e:e.path;exports.getWorkersPath=getWorkersPath;const unifyPath=e=>e.replace(/\\/g,"/");exports.unifyPath=unifyPath;const compareVersion=(e,t)=>{e=e.split("."),t=t.split(".");const r=Math.max(e.length,t.length);for(;e.length<r;)e.push("0");for(;t.length<r;)t.push("0");for(let s=0;s<r;s++){const r=parseInt(e[s],10),o=parseInt(t[s],10);if(r>o)return 1;if(r<o)return-1}return 0};exports.compareVersion=compareVersion;const pathRelative=(e,t)=>(e=path_1.default.posix.normalize(e.replace(/\\/g,"/")),t=path_1.default.posix.normalize(t.replace(/\\/g,"/")),path_1.default.posix.relative(e,t));function _isLeftSubPathOfRight(e,t){if(!t)return!0;if(t=normalizePath(t),e=normalizePath(e),!t.endsWith("/")){if(e===t)return!0;t+="/"}return!!e.startsWith(t)}function isLeftSubPathOfRight(e,t){void 0===e&&(console.error(new Error("The child string is undefined here, please check!!")),e="");const r=e.startsWith(t),s=_isLeftSubPathOfRight(e,t);return r!==s&&console.error(new Error(`${e} ${t} difference check sub path here! new result: ${s}`)),s}function isGameApp(e){return e.type===types_1.EProjectType.miniGame||e.type===types_1.EProjectType.miniGamePlugin}exports.pathRelative=pathRelative,exports.isLeftSubPathOfRight=isLeftSubPathOfRight,exports.isGameApp=isGameApp;const checkIsUseCompilerPlugins=()=>!0;exports.checkIsUseCompilerPlugins=checkIsUseCompilerPlugins;const sourceExt2TargetExtConf={".ts":".js",".less":".wxss",".sass":".wxss",".scss":".wxss"},sourcePathToTargetPath=e=>{const t=path_1.default.extname(e);return sourceExt2TargetExtConf[t]?e.substr(0,e.length-t.length)+sourceExt2TargetExtConf[t]:e};function getCompilerPlugins(e){const t=new Set;function r(e){"typescript"!==e&&"less"!==e&&"sass"!==e||t.add(e)}return e.setting.useCompilerPlugins&&e.setting.useCompilerPlugins.forEach(e=>{"string"==typeof e?r(e):Array.isArray(e)&&"string"==typeof e[0]&&void 0!==e[1]&&r(e[0])}),Array.from(t.values())}function getSupportCodeFileExtSet(e){const t=getCompilerPlugins(e),r=new Set([".js",".json",".wxss",".wxs",".wxml"]);return t.includes("typescript")&&r.add(".ts"),t.includes("less")&&r.add(".less"),t.includes("sass")&&(r.add(".sass"),r.add(".scss")),r}function isCodeFile(e){return/\.(json|wxml|wxss|js|wxs|ts|less|sass|scss)/.test(e)}function isMiniProgramCodeFile(e){return/\.(json|wxml|wxss|js|wxs)/.test(e)}exports.sourcePathToTargetPath=sourcePathToTargetPath,exports.getCompilerPlugins=getCompilerPlugins,exports.getSupportCodeFileExtSet=getSupportCodeFileExtSet,exports.isCodeFile=isCodeFile,exports.isMiniProgramCodeFile=isMiniProgramCodeFile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.startUSBManagerProcess=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),miniapp_builder_1=require("./miniapp-builder"),fse=require("fs-extra");class USBProcess{constructor(e,s){this.isAlive=!1,this.child=null,this.child=child_process.exec(`"${e}"`,{},(e,r,i)=>{if(e)throw s.progress("USBProcess exec error: "+e),this.isAlive=!1,new Error("exec USBProcess failed");s.progress("USBProcess stdout: "+r),s.progress("USBProcess stderr: "+i)}),this.isAlive=!0}kill(){var e;null===(e=this.child)||void 0===e||e.kill()}}let USBProcessShareInstance=null;async function startUSBManagerProcess(e,s){const{builderPath:r}=await(0,miniapp_builder_1.getMiniAppBuilderFromRemoteCore)(e,"PTWin.exe","PTMac");if(!fse.existsSync(r))throw new Error("exec USBProcess failed (cant find target path)");try{return USBProcessShareInstance&&USBProcessShareInstance.isAlive?s.progress("USBProcessShareInstance is isAlive"):(s.progress("new USBProcess"),USBProcessShareInstance=new USBProcess(r,s)),!0}catch(e){throw new Error(`exec USBProcess failed (execSync failed! ${r})`)}}exports.startUSBManagerProcess=startUSBManagerProcess;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miniprogram-ci",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "Module that build miniprogram project for web or app extracted from WeChatDevtools.",
|
|
5
5
|
"homepage": "https://developers.weixin.qq.com/community/homepage",
|
|
6
6
|
"main": "dist/index.js",
|