miniprogram-ci 2.1.30 → 2.1.32
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 +6 -0
- package/README.md +6 -0
- package/dist/@types/ci/checkCodeQuality.d.ts +1 -1
- package/dist/@types/ci/code-analyse.d.ts +1 -1
- package/dist/@types/ci/cos-upload.d.ts +0 -1
- package/dist/@types/ci/getCompiledResult.d.ts +0 -1
- package/dist/@types/ci/utils/filterUnusedFile.d.ts +0 -1
- package/dist/@types/ci/utils/pack.d.ts +0 -1
- package/dist/@types/ci/utils/packfile.d.ts +0 -1
- package/dist/@types/ci/utils/tools.d.ts +1 -1
- package/dist/@types/ci/utils/wxvpkg/unpack/version0.d.ts +0 -1
- package/dist/@types/ci/utils/wxvpkg/unpack/version10.d.ts +0 -1
- package/dist/@types/config/compiletype.config.d.ts +4 -4
- package/dist/@types/config/config.d.ts +1 -1
- package/dist/@types/config/dir.config.d.ts +17 -0
- package/dist/@types/config/url.config.d.ts +42 -42
- package/dist/@types/index.d.ts +4 -2
- package/dist/@types/modules/corecompiler/baseCompiler.d.ts +3 -4
- package/dist/@types/modules/corecompiler/original/compile/common.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/compile/gamePlugin.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/compile/handler/mpjson.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/compile/miniprogram.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/compile/miniprogramPlugin.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/js/index.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/protect/uglifyfilenames.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/webWorker/webWorkerManager.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/workerThread/task/compilejs.d.ts +1 -2
- package/dist/@types/modules/corecompiler/original/workerThread/task/compilewxss.d.ts +0 -1
- package/dist/@types/modules/corecompiler/original/workerThread/task/minifywxml.d.ts +0 -1
- package/dist/@types/modules/corecompiler/summer/graph/appconf.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summer/graph/gameconf.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summer/plugins/less.d.ts +0 -1
- package/dist/@types/modules/corecompiler/summer/resolver.d.ts +1 -1
- package/dist/@types/modules/corecompiler/summerCompiler.d.ts +2 -3
- package/dist/@types/modules/nativecompiler/ios/buildCloud.d.ts +2 -2
- package/dist/@types/modules/nativecompiler/processHandler.d.ts +5 -0
- package/dist/@types/modules/precompiler/conditioncompile/compiler/base.d.ts +0 -1
- package/dist/@types/modules/precompiler/conditioncompile/compiler/json.d.ts +0 -1
- package/dist/@types/modules/precompiler/conditioncompile/compiler/macro.d.ts +0 -1
- package/dist/@types/modules/precompiler/conditioncompile/compiler/plant.d.ts +0 -1
- package/dist/@types/modules/precompiler/conditioncompile/index.d.ts +0 -1
- package/dist/@types/project/advance/precompileProject.d.ts +0 -1
- package/dist/@types/project/advance/reactiveProject.d.ts +1 -2
- package/dist/@types/project/baseProject.d.ts +3 -3
- package/dist/@types/project/ciProjectWithMockBuffer.d.ts +0 -1
- package/dist/@types/services/accountcard/accountcard.d.ts +18 -0
- package/dist/@types/services/accountcard/accountcardService.d.ts +0 -0
- package/dist/@types/services/app/common/appDirService.d.ts +10 -0
- package/dist/@types/services/app/common/appDirService.devtools.d.ts +7 -0
- package/dist/@types/services/app/electron/appDirService.d.ts +3 -0
- package/dist/@types/services/app/node/appDirService.d.ts +6 -0
- package/dist/@types/services/app/nw/appDirService.d.ts +3 -0
- package/dist/@types/services/builder/common/builder.d.ts +22 -0
- package/dist/@types/services/builder/nw/builder.d.ts +15 -0
- package/dist/@types/services/builder/webide/builder.d.ts +4 -0
- package/dist/@types/services/common/extensions.d.ts +8 -0
- package/dist/@types/services/common/getservice.d.ts +24 -0
- package/dist/@types/services/common/librarybase.d.ts +2063 -0
- package/dist/@types/services/common/vsbase.d.ts +3 -0
- package/dist/@types/services/compilewxml/common/compilewxmlService.d.ts +41 -0
- package/dist/@types/services/compilewxml/electron/compilewxmlService.d.ts +5 -0
- package/dist/@types/services/compilewxml/node/compileUtils.d.ts +3 -0
- package/dist/@types/services/compilewxml/node/compileglasseasel.d.ts +0 -0
- package/dist/@types/services/compilewxml/nw/compilewxmlService.d.ts +5 -0
- package/dist/@types/services/compilewxml/webide/compilewxmlService.d.ts +5 -0
- package/dist/@types/services/compilewxml/webide/pageFrameWasm/wcc/runWcc.d.ts +3 -0
- package/dist/@types/services/compilewxss/common/compilewxssService.d.ts +15 -0
- package/dist/@types/services/compilewxss/electron/compilewxssService.d.ts +4 -0
- package/dist/@types/services/compilewxss/node/compileUtils.d.ts +2 -0
- package/dist/@types/services/compilewxss/nw/compilewxssService.d.ts +4 -0
- package/dist/@types/services/compilewxss/webide/compilewxssService.d.ts +4 -0
- package/dist/@types/services/compilewxss/webide/pageFrameWasm/wcsc/runWcsc.d.ts +3 -0
- package/dist/@types/services/consoledisplay/common/consoledisplay.d.ts +5 -0
- package/dist/@types/services/consoledisplay/nw/consoledisplay.d.ts +6 -0
- package/dist/@types/services/fileUtilsManager/common/fileUtilsManager.d.ts +5 -0
- package/dist/@types/services/fileUtilsManager/nw/fileUtilsManager.d.ts +6 -0
- package/dist/@types/services/fs/common/fileService.d.ts +28 -0
- package/dist/@types/services/genTempFile/common/genTempFile.devtools.d.ts +4 -0
- package/dist/@types/services/genTempFile/common/genTempFile.node.d.ts +4 -0
- package/dist/@types/services/genTempFile/common/genTempFileService.d.ts +4 -0
- package/dist/@types/services/genTempFile/electron/genTempFileService.d.ts +3 -0
- package/dist/@types/services/genTempFile/node/genTempFileService.d.ts +3 -0
- package/dist/@types/services/genTempFile/nw/genTempFileService.d.ts +3 -0
- package/dist/@types/services/global/common/global.d.ts +10 -0
- package/dist/@types/services/global/nw/global.d.ts +12 -0
- package/dist/@types/services/initializeCheck/common/initializeCheck.d.ts +21 -0
- package/dist/@types/services/initializeCheck/nw/initializeCheck.d.ts +4 -0
- package/dist/@types/services/initializeCheck/webide/initializeCheck.d.ts +0 -0
- package/dist/@types/services/locales/common/locales.d.ts +7 -0
- package/dist/@types/services/locales/nw/locales.d.ts +9 -0
- package/dist/@types/services/log/common/logService.d.ts +9 -0
- package/dist/@types/services/miniappjson/common/miniappjson.d.ts +5 -0
- package/dist/@types/services/miniappjson/electron/miniappjson.d.ts +6 -0
- package/dist/@types/services/miniappjson/nw/miniappjson.d.ts +6 -0
- package/dist/@types/services/miniappjson/webide/miniappjson.d.ts +4 -0
- package/dist/@types/services/nativeModule/common/nativeModule.d.ts +9 -0
- package/dist/@types/services/nativeModule/common/nativeModule.impl.d.ts +12 -0
- package/dist/@types/services/nativeModule/electron/nativeModule.d.ts +3 -0
- package/dist/@types/services/nativeModule/nw/nativeModule.d.ts +3 -0
- package/dist/@types/services/partialcompile/common/parialcompile.impl.d.ts +0 -0
- package/dist/@types/services/partialcompile/common/partialcompile.d.ts +0 -0
- package/dist/@types/services/partialcompile/nw/partialcompile.d.ts +0 -0
- package/dist/@types/services/partialcompile/webide/partialcompile.d.ts +0 -0
- package/dist/@types/services/performance/common/performance.d.ts +9 -0
- package/dist/@types/services/performance/nw/performance.d.ts +9 -0
- package/dist/@types/services/performance/webide/performance.d.ts +7 -0
- package/dist/@types/services/project/common/cloudProjectService.d.ts +0 -0
- package/dist/@types/services/project/common/createProjectService.d.ts +0 -0
- package/dist/@types/services/project/common/project.helper.d.ts +0 -0
- package/dist/@types/services/project/common/projectConfigService.d.ts +0 -0
- package/dist/@types/services/project/common/projectFileService.d.ts +0 -0
- package/dist/@types/services/project/common/projectconfigjsonutils.d.ts +0 -0
- package/dist/@types/services/project/electron-backend/projectManagerService.d.ts +0 -0
- package/dist/@types/services/project/node/createProjectService.d.ts +0 -0
- package/dist/@types/services/project/node/projectConfigService.d.ts +0 -0
- package/dist/@types/services/project/node/projectManagerService.d.ts +0 -0
- package/dist/@types/services/project/web/projectManagerService.d.ts +0 -0
- package/dist/@types/services/project/webide/projectConfigService.d.ts +0 -0
- package/dist/@types/services/project/webide/projectFileService.d.ts +0 -0
- package/dist/@types/services/project/webide/projectManagerService.d.ts +0 -0
- package/dist/@types/services/projectManager/common/buildServerProjectManager.d.ts +5 -0
- package/dist/@types/services/projectManager/common/projectManager.d.ts +7 -0
- package/dist/@types/services/projectManager/nw/projectManager.d.ts +9 -0
- package/dist/@types/services/root/common/createService.d.ts +12 -0
- package/dist/@types/services/root/electron/root.d.ts +11 -0
- package/dist/@types/services/root/electron/rootService.d.ts +2 -0
- package/dist/@types/services/root/node/root.d.ts +11 -0
- package/dist/@types/services/root/node/rootService.d.ts +0 -0
- package/dist/@types/services/root/nw/root.d.ts +11 -0
- package/dist/@types/services/root/nw/rootService.d.ts +0 -0
- package/dist/@types/services/staticConfig/common/staticConfigService.d.ts +5 -0
- package/dist/@types/services/staticConfig/nw/staticConfigService.d.ts +6 -0
- package/dist/@types/services/store/common/storeService.d.ts +17 -0
- package/dist/@types/services/uniapp/common/uniapp.d.ts +5 -0
- package/dist/@types/services/uniapp/nw/uniapp.d.ts +9 -0
- package/dist/@types/services/uniapp/webide/uniapp.d.ts +4 -0
- package/dist/@types/services/vendor/common/utils.d.ts +0 -0
- package/dist/@types/services/vendor/common/vendorService.d.ts +0 -0
- package/dist/@types/services/vendor/node/vendorService.d.ts +0 -0
- package/dist/@types/services/vendor/webide/vendorService.d.ts +0 -0
- package/dist/@types/types/ci.d.ts +1 -2
- package/dist/@types/types/core.d.ts +1 -2
- package/dist/@types/types/devtools.d.ts +0 -1
- package/dist/@types/types/summer.d.ts +0 -1
- package/dist/@types/utils/babel_plugin_worklet.d.ts +10 -1
- package/dist/@types/utils/common.d.ts +3 -1
- package/dist/@types/utils/cosUpload.d.ts +0 -1
- package/dist/@types/utils/fsagent.d.ts +0 -1
- package/dist/@types/utils/locales/locales.d.ts +2 -114
- package/dist/@types/utils/locales/zh.d.ts +114 -113
- package/dist/@types/utils/miniappJson.d.ts +1 -1
- package/dist/@types/utils/node/common.d.ts +1 -0
- package/dist/@types/utils/packOptionsHelper.d.ts +1 -1
- package/dist/@types/utils/signature.d.ts +0 -1
- package/dist/@types/utils/singletontask.d.ts +1 -0
- package/dist/@types/utils/subprocess/processManager.d.ts +1 -0
- package/dist/@types/utils/taskqueue.d.ts +0 -1
- package/dist/@types/utils/taskstatus.d.ts +1 -1
- package/dist/@types/utils/tools.d.ts +3 -4
- package/dist/@types/utils/web/common.d.ts +1 -0
- package/dist/@types/utils/wxapkg/pack.d.ts +0 -1
- package/dist/@types/utils/wxvpkgreader/wxvpkg/reader/version0.d.ts +0 -1
- package/dist/@types/utils/wxvpkgreader/wxvpkg/reader/version10.d.ts +0 -1
- package/dist/@types/utils/wxvpkgreader/wxvpkg/unpack/version0.d.ts +0 -1
- package/dist/@types/utils/wxvpkgreader/wxvpkg/unpack/version10.d.ts +0 -1
- package/dist/@types/utils/wxvpkgreader/wxvpkgreader.d.ts +0 -1
- package/dist/ci/android-miniapp-toolkit/dist/index.js +1 -1
- package/dist/ci/build-apk.js +1 -1
- package/dist/ci/build-ipa.js +1 -1
- package/dist/ci/checkCodeQuality.js +1 -1
- package/dist/ci/cloud/cloudapi.js +1 -1
- package/dist/ci/cloud/createTimeTrigger.js +1 -1
- package/dist/ci/cloud/uploadContainer.js +1 -1
- package/dist/ci/cloud/uploadFile.js +1 -1
- package/dist/ci/cloud/uploadFunction.js +1 -1
- package/dist/ci/cloud/utils.js +1 -1
- package/dist/ci/code-analyse.js +1 -1
- package/dist/ci/cos-upload.js +1 -1
- package/dist/ci/gamepkg/apkplug.js +1 -1
- package/dist/ci/gamepkg/index.js +1 -1
- package/dist/ci/getCompiledResult.js +1 -1
- package/dist/ci/getDevSourceMap.js +1 -1
- package/dist/ci/getLatestVersion.js +1 -1
- package/dist/ci/getcompiler.js +1 -1
- package/dist/ci/index.js +1 -1
- package/dist/ci/jsserver.js +1 -1
- package/dist/ci/miniapp/archive.js +1 -1
- package/dist/ci/miniapp/checkBuildArgument.js +1 -1
- package/dist/ci/miniapp/miniappPlugin.js +1 -1
- package/dist/ci/miniapp/sdkManager.js +1 -1
- package/dist/ci/miniapp/upload.js +1 -1
- package/dist/ci/miniapp-cloud-upload.js +1 -1
- package/dist/ci/miniappattr.js +1 -1
- package/dist/ci/preview.js +1 -1
- package/dist/ci/projectattr.js +1 -1
- package/dist/ci/upload.js +1 -1
- package/dist/ci/utils/ciRequest.js +1 -1
- package/dist/ci/utils/filterUnusedFile.js +1 -1
- package/dist/ci/utils/pack.js +1 -1
- package/dist/ci/utils/terminalQrcode.js +1 -1
- package/dist/ci/utils/tools.js +1 -1
- package/dist/ci/utils/wxvpkg/unpack/version0.js +1 -1
- package/dist/ci/utils/wxvpkg/unpack/version10.js +1 -1
- package/dist/config/config.js +1 -1
- package/dist/config/dir.config.js +1 -0
- package/dist/index.js +1 -1
- package/dist/modules/corecompiler/baseCompiler.js +1 -1
- package/dist/modules/corecompiler/original/analyse/partial.js +1 -1
- package/dist/modules/corecompiler/original/compile/common.js +1 -1
- package/dist/modules/corecompiler/original/compile/game.js +1 -1
- package/dist/modules/corecompiler/original/compile/gamePlugin.js +1 -1
- package/dist/modules/corecompiler/original/compile/handler/js.js +1 -1
- package/dist/modules/corecompiler/original/compile/handler/mpjson.js +1 -1
- package/dist/modules/corecompiler/original/compile/handler/wxml.js +1 -1
- package/dist/modules/corecompiler/original/compile/handler/wxss.js +1 -1
- package/dist/modules/corecompiler/original/compile/index.js +1 -1
- package/dist/modules/corecompiler/original/compile/miniprogram.js +1 -1
- package/dist/modules/corecompiler/original/compile/miniprogramPlugin.js +1 -1
- package/dist/modules/corecompiler/original/index.js +1 -1
- package/dist/modules/corecompiler/original/js/index.js +1 -1
- package/dist/modules/corecompiler/original/json/app/appJSON.js +1 -1
- package/dist/modules/corecompiler/original/json/app/checkAppFields.js +1 -1
- package/dist/modules/corecompiler/original/json/common.js +1 -1
- package/dist/modules/corecompiler/original/json/page/checkPageJSON.js +1 -1
- package/dist/modules/corecompiler/original/json/page/getPageJSON.js +1 -1
- package/dist/modules/corecompiler/original/json/plugin/plugin.js +1 -1
- package/dist/modules/corecompiler/original/json/plugin/pluginPage.js +1 -1
- package/dist/modules/corecompiler/original/json/reactiveCache.js +1 -1
- package/dist/modules/corecompiler/original/json/signaturejson.js +1 -1
- package/dist/modules/corecompiler/original/json/theme.js +1 -1
- package/dist/modules/corecompiler/original/npm/filterdeps.js +1 -1
- package/dist/modules/corecompiler/original/npm/packnpm.js +1 -1
- package/dist/modules/corecompiler/original/protect/uglifyfilenames.js +1 -1
- package/dist/modules/corecompiler/original/validate/schemaValidate.js +1 -1
- package/dist/modules/corecompiler/original/webWorker/configs.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/config.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/getWorkerPoolSize.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/index.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/call_func.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/func.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/minifywxml.js +1 -1
- package/dist/modules/corecompiler/processHandler.js +1 -1
- package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -1
- package/dist/modules/corecompiler/summer/graph/util.js +1 -1
- package/dist/modules/corecompiler/summer/index.js +1 -1
- package/dist/modules/corecompiler/summer/initPlugin.js +1 -1
- package/dist/modules/corecompiler/summer/pluginDriver.js +1 -1
- package/dist/modules/corecompiler/summer/pluginconfig.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/filetask/script.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/script_task/babel_script_task.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/script_task/load_script_task.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/script_task/minify_script_task.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/script_task/swc_task.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/utils/ensureArray.js +1 -1
- package/dist/modules/corecompiler/summer/utils/inputsourcemap.js +1 -1
- package/dist/modules/corecompiler/summer/worker.js +1 -1
- package/dist/modules/fullcompiler/app/app.js +1 -1
- package/dist/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.js +1 -1
- package/dist/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.js +1 -1
- package/dist/modules/nativecompiler/android/adb.js +1 -1
- package/dist/modules/nativecompiler/android/device.js +1 -1
- package/dist/modules/nativecompiler/ios/device.js +1 -1
- package/dist/modules/nativecompiler/ios/projectconfig.js +1 -1
- package/dist/modules/nativecompiler/nativeEntryProcess.js +1 -1
- package/dist/modules/nativecompiler/processHandler.js +1 -0
- package/dist/project/advance/precompileProject.js +1 -1
- package/dist/project/advance/reactiveProject.js +1 -1
- package/dist/project/baseProject.js +1 -1
- package/dist/services/accountcard/accountcard.js +1 -0
- package/dist/services/accountcard/accountcardService.js +1 -0
- package/dist/services/app/common/appDirService.devtools.js +1 -0
- package/dist/services/app/common/appDirService.js +1 -0
- package/dist/services/app/electron/appDirService.js +1 -0
- package/dist/services/app/node/appDirService.js +1 -0
- package/dist/services/app/nw/appDirService.js +1 -0
- package/dist/services/builder/common/builder.js +1 -0
- package/dist/services/builder/nw/builder.js +1 -0
- package/dist/services/builder/webide/builder.js +1 -0
- package/dist/services/common/extensions.js +1 -0
- package/dist/services/common/getservice.js +1 -0
- package/dist/services/common/librarybase.js +1 -0
- package/dist/services/common/vsbase.js +1 -0
- package/dist/services/compilewxml/common/compilewxmlService.js +1 -0
- package/dist/services/compilewxml/electron/compilewxmlService.js +1 -0
- package/dist/services/compilewxml/node/compileUtils.js +1 -0
- package/dist/services/compilewxml/node/compileglasseasel.js +1 -0
- package/dist/services/compilewxml/nw/compilewxmlService.js +1 -0
- package/dist/services/compilewxml/webide/compilewxmlService.js +1 -0
- package/dist/services/compilewxml/webide/pageFrameWasm/wcc/runWcc.js +1 -0
- package/dist/services/compilewxss/common/compilewxssService.js +1 -0
- package/dist/services/compilewxss/electron/compilewxssService.js +1 -0
- package/dist/services/compilewxss/node/compileUtils.js +1 -0
- package/dist/services/compilewxss/nw/compilewxssService.js +1 -0
- package/dist/services/compilewxss/webide/compilewxssService.js +1 -0
- package/dist/services/compilewxss/webide/pageFrameWasm/wcsc/runWcsc.js +1 -0
- package/dist/services/consoledisplay/common/consoledisplay.js +1 -0
- package/dist/services/consoledisplay/nw/consoledisplay.js +1 -0
- package/dist/services/fileUtilsManager/common/fileUtilsManager.js +1 -0
- package/dist/services/fileUtilsManager/nw/fileUtilsManager.js +1 -0
- package/dist/services/fs/common/fileService.js +1 -0
- package/dist/services/genTempFile/common/genTempFile.devtools.js +1 -0
- package/dist/services/genTempFile/common/genTempFile.node.js +1 -0
- package/dist/services/genTempFile/common/genTempFileService.js +1 -0
- package/dist/services/genTempFile/electron/genTempFileService.js +1 -0
- package/dist/services/genTempFile/node/genTempFileService.js +1 -0
- package/dist/services/genTempFile/nw/genTempFileService.js +1 -0
- package/dist/services/global/common/global.js +1 -0
- package/dist/services/global/nw/global.js +1 -0
- package/dist/services/initializeCheck/common/initializeCheck.js +1 -0
- package/dist/services/initializeCheck/nw/initializeCheck.js +1 -0
- package/dist/services/initializeCheck/webide/initializeCheck.js +1 -0
- package/dist/services/locales/common/locales.js +1 -0
- package/dist/services/locales/nw/locales.js +1 -0
- package/dist/services/log/common/logService.js +1 -0
- package/dist/services/miniappjson/common/miniappjson.js +1 -0
- package/dist/services/miniappjson/electron/miniappjson.js +1 -0
- package/dist/services/miniappjson/nw/miniappjson.js +1 -0
- package/dist/services/miniappjson/webide/miniappjson.js +1 -0
- package/dist/services/nativeModule/common/nativeModule.impl.js +1 -0
- package/dist/services/nativeModule/common/nativeModule.js +1 -0
- package/dist/services/nativeModule/electron/nativeModule.js +1 -0
- package/dist/services/nativeModule/nw/nativeModule.js +1 -0
- package/dist/services/partialcompile/common/parialcompile.impl.js +1 -0
- package/dist/services/partialcompile/common/partialcompile.js +1 -0
- package/dist/services/partialcompile/nw/partialcompile.js +1 -0
- package/dist/services/partialcompile/webide/partialcompile.js +1 -0
- package/dist/services/performance/common/performance.js +1 -0
- package/dist/services/performance/nw/performance.js +1 -0
- package/dist/services/performance/webide/performance.js +1 -0
- package/dist/services/project/common/cloudProjectService.js +1 -0
- package/dist/services/project/common/createProjectService.js +1 -0
- package/dist/services/project/common/project.helper.js +1 -0
- package/dist/services/project/common/projectConfigService.js +1 -0
- package/dist/services/project/common/projectFileService.js +1 -0
- package/dist/services/project/common/projectconfigjsonutils.js +1 -0
- package/dist/services/project/electron-backend/projectManagerService.js +1 -0
- package/dist/services/project/node/createProjectService.js +1 -0
- package/dist/services/project/node/projectConfigService.js +1 -0
- package/dist/services/project/node/projectManagerService.js +1 -0
- package/dist/services/project/web/projectManagerService.js +1 -0
- package/dist/services/project/webide/projectConfigService.js +1 -0
- package/dist/services/project/webide/projectFileService.js +1 -0
- package/dist/services/project/webide/projectManagerService.js +1 -0
- package/dist/services/projectManager/common/buildServerProjectManager.js +1 -0
- package/dist/services/projectManager/common/projectManager.js +1 -0
- package/dist/services/projectManager/nw/projectManager.js +1 -0
- package/dist/services/root/common/createService.js +1 -0
- package/dist/services/root/electron/root.js +1 -0
- package/dist/services/root/electron/rootService.js +1 -0
- package/dist/services/root/node/root.js +1 -0
- package/dist/services/root/node/rootService.js +1 -0
- package/dist/services/root/nw/root.js +1 -0
- package/dist/services/root/nw/rootService.js +1 -0
- package/dist/services/staticConfig/common/staticConfigService.js +1 -0
- package/dist/services/staticConfig/nw/staticConfigService.js +1 -0
- package/dist/services/store/common/storeService.js +1 -0
- package/dist/services/uniapp/common/uniapp.js +1 -0
- package/dist/services/uniapp/nw/uniapp.js +1 -0
- package/dist/services/uniapp/webide/uniapp.js +1 -0
- package/dist/services/vendor/common/utils.js +1 -0
- package/dist/services/vendor/common/vendorService.js +1 -0
- package/dist/services/vendor/node/vendorService.js +1 -0
- package/dist/services/vendor/webide/vendorService.js +1 -0
- package/dist/types/ci.js +1 -1
- package/dist/utils/asyncTask/index.js +1 -1
- package/dist/utils/babel_helper.js +1 -1
- package/dist/utils/babel_plugin_worklet.js +1 -1
- package/dist/utils/cache.js +1 -1
- package/dist/utils/codesign.js +1 -1
- package/dist/utils/common.js +1 -1
- package/dist/utils/cosUpload.js +1 -1
- package/dist/utils/cp.js +1 -1
- package/dist/utils/customError.js +1 -1
- package/dist/utils/debug.js +1 -1
- package/dist/utils/download.js +1 -1
- package/dist/utils/env.js +1 -1
- package/dist/utils/fs.js +1 -1
- package/dist/utils/genTempFile.js +1 -1
- package/dist/utils/generateIpa.js +1 -1
- package/dist/utils/glob.js +1 -1
- package/dist/utils/helper_util.js +1 -1
- package/dist/utils/jsonParse.js +1 -1
- package/dist/utils/miniapp-builder.js +1 -1
- package/dist/utils/miniappJson.js +1 -1
- package/dist/utils/node/common.js +1 -0
- package/dist/utils/officialDonutPlugin.js +1 -1
- package/dist/utils/packOptionsHelper.js +1 -1
- package/dist/utils/progressRecorder.js +1 -1
- package/dist/utils/report.js +1 -1
- package/dist/utils/request.js +1 -1
- package/dist/utils/sign.js +1 -1
- package/dist/utils/signature.js +1 -1
- package/dist/utils/singletontask.js +1 -1
- package/dist/utils/subprocess/entryProcess.js +1 -1
- package/dist/utils/subprocess/processManager.js +1 -1
- package/dist/utils/subprocess/processService.js +1 -1
- package/dist/utils/subprocess/stringifyPostMsg.js +1 -1
- package/dist/utils/swc_helper.js +1 -1
- package/dist/utils/tools.js +1 -1
- package/dist/utils/usbProcess.js +1 -1
- package/dist/utils/web/common.js +1 -0
- package/dist/utils/white_ext_list.js +1 -1
- package/dist/utils/wxapkg/pack.js +1 -1
- package/dist/utils/wxvpkgreader/wxvpkg/unpack/version0.js +1 -1
- package/dist/utils/wxvpkgreader/wxvpkg/unpack/version10.js +1 -1
- package/dist/utils/zip.js +1 -1
- package/dist/vendor/vslibrary/bundled/base.bundled.js +2 -0
- package/package.json +5 -54
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.autoCompleteIOSPrivacyDesc=exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.autoCompleteIOSPrivacyDesc=exports.iosPrivacyDescObj=exports.PLATFORM=exports.miniAppPlatformMap=void 0,exports.identityServiceConfigToMiniAppJSON=identityServiceConfigToMiniAppJSON,exports.getRawMiniappJson=getRawMiniappJson,exports.getMiniappJson=getMiniappJson,exports.tryGetOhosMiniappJson=tryGetOhosMiniappJson,exports.tryGetAndroidMiniappJson=tryGetAndroidMiniappJson,exports.tryGetIOSMiniappJson=tryGetIOSMiniappJson,exports.tryGetPluginMiniappJson=tryGetPluginMiniappJson,exports.isMiniAppProjectWithProjectPath=isMiniAppProjectWithProjectPath,exports.isNewMiniAppProjectWithProjectPath=isNewMiniAppProjectWithProjectPath,exports.writeMiniAppJsonWithProjectPath=writeMiniAppJsonWithProjectPath,exports.iOSMiniAppJsonIsUsingTpush=iOSMiniAppJsonIsUsingTpush,exports.iOSMiniAppJsonIsUsingGDT=iOSMiniAppJsonIsUsingGDT,exports.iOSAppJsonIsUsingIPadResizable=iOSAppJsonIsUsingIPadResizable,exports.getRawAppJSON=getRawAppJSON,exports.getMiniprogramRoot=getMiniprogramRoot,exports.getTargetMiniprogramArg=getTargetMiniprogramArg,exports.isAndroidNeedClientJsExtInfo=isAndroidNeedClientJsExtInfo;const tools_1=require("./tools"),officialDonutPlugin_1=require("./officialDonutPlugin"),tools_2=require("../utils/tools"),each=require("licia/each"),safeSet=require("licia/safeSet"),path=require("path"),fse=require("fs-extra"),_=require("lodash");var PLATFORM;function identityServiceConfigToMiniAppJSON(i,o={}){return o.identityServiceConfig=Object.assign(Object.assign({},o.identityServiceConfig),{authorizeMiniprogramType:1,miniprogramLoginPath:i}),o}function getRawMiniappJson(i){var o,e,t,n,s,r,p,a,c;i=(0,tools_1.unifyPath)(i);const g=path.posix.join(i,"project.miniapp.json");if(!fse.existsSync(g))return{};let u={};try{u=fse.readJsonSync(g)}catch(i){console.error(i)}return u.miniVersion&&"v1"!==u.miniVersion||((null===(o=u[PLATFORM.ANDROID])||void 0===o?void 0:o.projectPath)&&!path.isAbsolute(null===(e=u[PLATFORM.ANDROID])||void 0===e?void 0:e.projectPath)&&(u[PLATFORM.ANDROID].projectPath=path.posix.join(i,null===(t=u[PLATFORM.ANDROID])||void 0===t?void 0:t.projectPath)),(null===(n=u[PLATFORM.IOS])||void 0===n?void 0:n.projectPath)&&!path.isAbsolute(null===(s=u[PLATFORM.IOS])||void 0===s?void 0:s.projectPath)&&(u[PLATFORM.IOS].projectPath=path.posix.join(i,null===(r=u[PLATFORM.IOS])||void 0===r?void 0:r.projectPath))),(null===(p=u[PLATFORM.ANDROID])||void 0===p?void 0:p.projectPath)&&!path.isAbsolute(null===(a=u[PLATFORM.ANDROID])||void 0===a?void 0:a.projectPath)&&(u[PLATFORM.ANDROID].projectPath=path.posix.join(i,null===(c=u[PLATFORM.ANDROID])||void 0===c?void 0:c.projectPath)),u}function getMiniappJson(i,o="mini-weixin"){const e=Object.values(exports.miniAppPlatformMap),t=getRawMiniappJson(i),n=_.omit(t,e);return _.merge(n,t[o]||("mini-weixin"===o?t["mini-wechat"]:{}))}function tryGetOhosMiniappJson(i){let o;try{o=getMiniappJson(i,PLATFORM.OHOS);const e=tryGetPluginMiniappJson(i);o&&(o["mini-plugin"]=e)}catch(i){}return o||{}}function tryGetAndroidMiniappJson(i){let o;try{o=getMiniappJson(i,PLATFORM.ANDROID);const e=tryGetPluginMiniappJson(i);o&&(o["mini-plugin"]=e)}catch(i){}return o||{}}function tryGetIOSMiniappJson(i){let o;try{o=getMiniappJson(i,PLATFORM.IOS);const e=tryGetPluginMiniappJson(i);o&&(o["mini-plugin"]=e)}catch(i){}return o}function tryGetPluginMiniappJson(i){let o={};try{const e=getMiniappJson(i,PLATFORM.PLUGIN),t=getRawMiniappJson(i);o=(0,officialDonutPlugin_1.preprocessDonutPluginConfig)(e,t)}catch(i){}return o}function isMiniAppProjectWithProjectPath(i){const o=path.posix.join(i,"project.miniapp.json");return"multiPlatform"===fse.readJsonSync(o).projectArchitecture}function isNewMiniAppProjectWithProjectPath(i){const o=getRawMiniappJson(i);return isMiniAppProjectWithProjectPath(i)&&"v2"===o.miniVersion}function writeMiniAppJsonWithProjectPath(i,o){const e=path.posix.join(i,"project.miniapp.json");let t={};try{t=fse.readJsonSync(e)}catch(i){return}each(o,(i,o)=>{safeSet(t,o,i)}),fse.writeJSONSync(e,t,{spaces:2})}function iOSMiniAppJsonIsUsingTpush(i){const o=i.tpush&&!0===i.tpush.useExtendedLib_WeAppTPNS&&"number"==typeof i.tpush.accessID&&"string"==typeof i.tpush.accessKey&&"string"==typeof i.tpush.serviceBundleId;if(o&&(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 o}function iOSMiniAppJsonIsUsingGDT(i){const o=i.gdt&&!0===i.gdt.useExtendedLib_WeAppGDT&&"string"==typeof i.gdt.appid&&"string"==typeof i.gdt.splashAd_placementId;if(o&&(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 o}function iOSAppJsonIsUsingIPadResizable(i){return!0===getRawAppJSON(i).resizable}function getRawAppJSON(i){let o,e;const t=getMiniprogramRoot(i);o=t?path.posix.join(i,t,"app.json"):path.posix.join(i,"app.json");try{e=fse.readJsonSync(o)}catch(i){throw console.error(i),i}return e}function getMiniprogramRoot(i){const o=(0,tools_1.normalizePath)(path.posix.join(i,"project.config.json"));let e;try{e=fse.readJsonSync(o)}catch(i){throw console.error(i),i}return e.miniprogramRoot?e.miniprogramRoot:""}function getTargetMiniprogramArg(i,o){const e=(0,tools_1.normalizePath)(path.posix.join(i,"project.config.json"));let t;try{t=fse.readJsonSync(e)}catch(i){throw console.error(i),i}return t[o]||""}function isAndroidNeedClientJsExtInfo(i){const o=tryGetAndroidMiniappJson(i).sdkVersion;return(0,tools_2.compareSemVer)(o,"1.3.25")>0?1:0}exports.miniAppPlatformMap={"mini-android":"mini-android","mini-ios":"mini-ios","mini-weixin":"mini-weixin","mini-ohos":"mini-ohos"},function(i){i.ANDROID="mini-android",i.IOS="mini-ios",i.PLUGIN="mini-plugin",i.OHOS="mini-ohos"}(PLATFORM||(exports.PLATFORM=PLATFORM={})),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 - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可"};const autoCompleteIOSPrivacyDesc=i=>{const o=getRawMiniappJson(i);return!(!o["mini-ios"]||!o["mini-ios"].enableAutoCompletePrivacyDesc&&void 0!==o["mini-ios"].enableAutoCompletePrivacyDesc)&&(o["mini-ios"].privateDescriptions||(o["mini-ios"].privateDescriptions={}),Object.keys(exports.iosPrivacyDescObj).forEach(i=>{!o["mini-ios"].privateDescriptions[i]&&exports.iosPrivacyDescObj[i]&&(o["mini-ios"].privateDescriptions[i]=exports.iosPrivacyDescObj[i])}),writeMiniAppJsonWithProjectPath(i,o),!0)};exports.autoCompleteIOSPrivacyDesc=autoCompleteIOSPrivacyDesc;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shouldUseConfigFile=shouldUseConfigFile;const child_process=require("child_process");let curArgMaxValue=0;function getMacArgMaxValue(){if(curArgMaxValue)return curArgMaxValue;try{curArgMaxValue=Number(child_process.execSync("getconf ARG_MAX").toString())}catch(e){console.error("getMacArgMaxValue error",e)}return curArgMaxValue}function shouldUseConfigFile(e){if("darwin"!==process.platform){if(e.length>128)return!0;for(const r of e)if(r.length>1e4)return!0}if("darwin"===process.platform){let r=0;for(const o of e)r+=o.length;if(getMacArgMaxValue()<r)return!0}return!1}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function preprocessDonutPluginConfig(i,o){var e,s,n,r,u,l;if(null===(n=null===(s=null===(e=o["mini-ios"])||void 0===e?void 0:e.officialPlugins)||void 0===s?void 0:s.imPush)||void 0===n?void 0:n.enable){const e=null===(r=i.ios)||void 0===r?void 0:r.find(i=>i.pluginId===exports.IMPushPluginId);if(e)return e.open=!1,{ios:i.ios,android:i.android};const s={open:!1,pluginId:exports.IMPushPluginId,pluginVersion:"",isFromLocal:!1,loadWhenStart:!0,resourcePath:"",appexProfiles:{NSE:{enable:!1,bundleID:"",profilePath:"",distributeProfilePath:""}}},n=null===(l=null===(u=o["mini-ios"])||void 0===u?void 0:u.officialPlugins)||void 0===l?void 0:l.imPush;s.open=!0,s.pluginVersion=n.version||"",s.appexProfiles.NSE.enable=n.enableNSE,s.appexProfiles.NSE.bundleID=n.NSEBundleID,s.appexProfiles.NSE.profilePath=n.NSEProfilePath,s.appexProfiles.NSE.distributeProfilePath=n.NSEDistributetProfilePath,s.resourcePath=n.resourcePath||"";const p=exports.IMPushPluginId+".json";s.resourceObjects={[p]:`{\n "TIMPushAppGroupID": "${n.TIMPushAppGroupId||""}",\n "businessID":"${n.businessID||""}" \n}`},i.ios||(i.ios=[]),i.ios.push(s)}return{ios:i.ios,android:i.android}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";function preprocessDonutPluginConfig(i,o){var e,s,n,r,u,l;if(null===(n=null===(s=null===(e=o["mini-ios"])||void 0===e?void 0:e.officialPlugins)||void 0===s?void 0:s.imPush)||void 0===n?void 0:n.enable){const e=null===(r=i.ios)||void 0===r?void 0:r.find(i=>i.pluginId===exports.IMPushPluginId);if(e)return e.open=!1,{ios:i.ios,android:i.android};const s={open:!1,pluginId:exports.IMPushPluginId,pluginVersion:"",isFromLocal:!1,loadWhenStart:!0,resourcePath:"",appexProfiles:{NSE:{enable:!1,bundleID:"",profilePath:"",distributeProfilePath:""}}},n=null===(l=null===(u=o["mini-ios"])||void 0===u?void 0:u.officialPlugins)||void 0===l?void 0:l.imPush;s.open=!0,s.pluginVersion=n.version||"",s.appexProfiles.NSE.enable=n.enableNSE,s.appexProfiles.NSE.bundleID=n.NSEBundleID,s.appexProfiles.NSE.profilePath=n.NSEProfilePath,s.appexProfiles.NSE.distributeProfilePath=n.NSEDistributetProfilePath,s.resourcePath=n.resourcePath||"";const p=exports.IMPushPluginId+".json";s.resourceObjects={[p]:`{\n "TIMPushAppGroupID": "${n.TIMPushAppGroupId||""}",\n "businessID":"${n.businessID||""}" \n}`},i.ios||(i.ios=[]),i.ios.push(s)}return{ios:i.ios,android:i.android}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.IMPushPluginId=void 0,exports.preprocessDonutPluginConfig=preprocessDonutPluginConfig,exports.IMPushPluginId="wx369499c8a9c4c19e";
|
|
@@ -1 +1 @@
|
|
|
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.projectRoot="",this.extOpts={include:[],ignore:[]}}setExtOpts(e={}){this.extOpts.include=e.include||[],this.extOpts.ignore=e.ignore||[]}updateState(e){var s,i;this.packOptionIgnores=(null===(s=e.packOptions)||void 0===s?void 0:s.ignore)||[],this.packOptionIncludes=(null===(i=e.packOptions)||void 0===i?void 0:i.include)||[],this.projectRoot=e.miniprogramRoot||"",this.ignoreUploadUnusedFiles=!1,this.ignoreDevUnusedFiles=!1,e.type===config_1.COMPILE_TYPE.miniProgram&&(this.ignoreUploadUnusedFiles=Boolean(e.setting.ignoreUploadUnusedFiles),this.ignoreDevUnusedFiles=Boolean(e.setting.ignoreDevUnusedFiles)),(0,tools_1.isPluginType)(e)&&(this.projectRoot=e.pluginRoot||"")}isUnuserFilesEnable(e=!1){return e?!1!==this.ignoreUploadUnusedFiles:!0===this.ignoreDevUnusedFiles||!1!==this.ignoreDevUnusedFiles}filter(e,s=!1){return e.filter(e=>this.isNotIgnored(e,s))}isIgnored(e,s=!1){return this.isIgnoredByRules(e)||this.isIgnoreByUnusedFiles(e,s)}isNotIgnored(e,s=!1){return!this.isIgnored(e,s)}isIgnoredByRules(e,s={}){return!this.isFileIncluded(e,s.include)&&this.isFileIgnored(e,s.ignore)}relativePath(e){return path.posix.relative(this.projectRoot,e)}isFileIgnored(e,s){return s||(s=[...this.packOptionIgnores,...this.extOpts.ignore]),filerules_1.default.isFileIgnored(e,s)}isFileIncluded(e,s){return s||(s=[...this.packOptionIncludes,...this.extOpts.include]),filerules_1.default.isFileIncluded(e,s)}isIgnoreByUnusedFiles(e,s=!1){return!!this.isUnuserFilesEnable(s)&&(!this.isFileIncluded(e)&&this.unusedFiles.has((0,tools_1.sourcePathToTargetPath)(e)))}getUnusedFiles(){return this.unusedFiles}isScssOnlyImportedByFile(e){const s=path.extname(e.path);if("Wxss"===e.type&&[".scss",".sass",".less"].includes(s)&&e.parentDeps){let s=!0;return e.parentDeps.forEach(e=>{"file"!==e.from&&(s=!1)}),s}return!1}clearUnusedFiles(){this.unusedFiles.clear()}async initUnusedFiles(e,s,i=!1){if(!(this.unusedFiles.size>0)&&(this.updateState(e),this.isUnuserFilesEnable(i)&&s))try{await s.analyse();const i=s.fileHelper.getFileList("").filter(e=>(0,tools_1.isCodeFile)(path.posix.extname(e))),t=new Set;s.graph.modules.forEach(e=>{const s=i.find(s=>s===e.path);if(s){if(this.isScssOnlyImportedByFile(e))return;t.add((0,tools_1.sourcePathToTargetPath)(s))}});const n=new Set;i.forEach(s=>{const i=(0,tools_1.sourcePathToTargetPath)(s);t.has(i)||n.add(path.posix.join(e.miniprogramRoot,i))}),this.unusedFiles=n}catch(e){console.error("initUnusedFiles error",e)}}}exports.default=new PackOptionsHelper;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PackOptionsHelper=void 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.projectRoot="",this.extOpts={include:[],ignore:[]}}setExtOpts(e={}){this.extOpts.include=e.include||[],this.extOpts.ignore=e.ignore||[]}updateState(e){var s,i;this.packOptionIgnores=(null===(s=e.packOptions)||void 0===s?void 0:s.ignore)||[],this.packOptionIncludes=(null===(i=e.packOptions)||void 0===i?void 0:i.include)||[],this.projectRoot=e.miniprogramRoot||"",this.ignoreUploadUnusedFiles=!1,this.ignoreDevUnusedFiles=!1,e.type===config_1.COMPILE_TYPE.miniProgram&&(this.ignoreUploadUnusedFiles=Boolean(e.setting.ignoreUploadUnusedFiles),this.ignoreDevUnusedFiles=Boolean(e.setting.ignoreDevUnusedFiles)),(0,tools_1.isPluginType)(e)&&(this.projectRoot=e.pluginRoot||"")}isUnuserFilesEnable(e=!1){return e?!1!==this.ignoreUploadUnusedFiles:!0===this.ignoreDevUnusedFiles||!1!==this.ignoreDevUnusedFiles}filter(e,s=!1){return e.filter(e=>this.isNotIgnored(e,s))}isIgnored(e,s=!1){return this.isIgnoredByRules(e)||this.isIgnoreByUnusedFiles(e,s)}isNotIgnored(e,s=!1){return!this.isIgnored(e,s)}isIgnoredByRules(e,s={}){return!this.isFileIncluded(e,s.include)&&this.isFileIgnored(e,s.ignore)}relativePath(e){return path.posix.relative(this.projectRoot,e)}isFileIgnored(e,s){return s||(s=[...this.packOptionIgnores,...this.extOpts.ignore]),filerules_1.default.isFileIgnored(e,s)}isFileIncluded(e,s){return s||(s=[...this.packOptionIncludes,...this.extOpts.include]),filerules_1.default.isFileIncluded(e,s)}isIgnoreByUnusedFiles(e,s=!1){return!!this.isUnuserFilesEnable(s)&&(!this.isFileIncluded(e)&&this.unusedFiles.has((0,tools_1.sourcePathToTargetPath)(e)))}getUnusedFiles(){return this.unusedFiles}isScssOnlyImportedByFile(e){const s=path.extname(e.path);if("Wxss"===e.type&&[".scss",".sass",".less"].includes(s)&&e.parentDeps){let s=!0;return e.parentDeps.forEach(e=>{"file"!==e.from&&(s=!1)}),s}return!1}clearUnusedFiles(){this.unusedFiles.clear()}async initUnusedFiles(e,s,i=!1){if(!(this.unusedFiles.size>0)&&(this.updateState(e),this.isUnuserFilesEnable(i)&&s))try{await s.analyse();const i=s.fileHelper.getFileList("").filter(e=>(0,tools_1.isCodeFile)(path.posix.extname(e))),t=new Set;s.graph.modules.forEach(e=>{const s=i.find(s=>s===e.path);if(s){if(this.isScssOnlyImportedByFile(e))return;t.add((0,tools_1.sourcePathToTargetPath)(s))}});const n=new Set;i.forEach(s=>{const i=(0,tools_1.sourcePathToTargetPath)(s);t.has(i)||n.add(path.posix.join(e.miniprogramRoot,i))}),this.unusedFiles=n}catch(e){console.error("initUnusedFiles error",e)}}}exports.PackOptionsHelper=PackOptionsHelper,exports.default=new PackOptionsHelper;
|
|
@@ -1 +1 @@
|
|
|
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.IOSBuildMessageCache=exports.TransformTipsURL=exports.silentRecorder=exports.Recorder=
|
|
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.IOSBuildMessageCache=exports.TransformTipsURL=exports.silentRecorder=exports.Recorder=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)=>{if(e)t||this.sendProgress(s,"error",e.message);else if(!t){let e=(null==r?void 0:r.message)||"";!e&&(null==r?void 0:r.targetPath)&&(e=null==r?void 0:r.targetPath),this.sendProgress(s,"success",e)}};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(()=>{}),exports.TransformTipsURL="https://web-v2-1g8g0y2x3197301a-1304825656.tcloudbaseapp.com/important_miniapp/MiniAppBuildTips.json?sign=0f07b014a760d699cf2c8a9bb84845bf&t=1724920547",exports.IOSBuildMessageCache={};
|
package/dist/utils/report.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reportAction=reportAction,exports.wrapReport=wrapReport;const config_1=require("../config/config"),request_1=require("./request"),os=require("os");async function reportMMData(e){(0,request_1.request)({url:"https://servicewechat.com/wxa-dev-logic/clientreportv2",body:JSON.stringify({report_info_list:[e]}),method:"post"})}const compileTypeMap={miniProgram:1,miniProgramPlugin:2,miniGame:3,miniGamePlugin:4},actionMap={preview:1,upload:2,npm:3,cloud:4,getDevSourceMap:5,buildApk:6,buildIpa:7,miniappCloudUpload:8};function parseVersionToInt(e){const t=e.split(".");return parseInt(t[0]+t[1]+t[2],10)}function getMinifyXStatus(e,t){return"boolean"==typeof t?t?1:0:e?1:0}function reportAction(e,t,o,i,r,n={}){const p=r.appid,s=r.type,a=parseVersionToInt(config_1.CI_VERSION),c="win32"===process.platform?1:"darwin"===process.platform?2:3,l=os.cpus().length,u=Math.floor(os.totalmem()/1024/1024),f=actionMap[e];o=o.replace(/,/g,";").slice(0,512);reportMMData({log_id:22365,version:0,user_log_list:`0,${p},${a},${c},${l},${u},${compileTypeMap[s]},${f},${t},${o},${i},0,${n.es6?1:0},${n.es7?1:0},${getMinifyXStatus(n.minify,n.minifyJS)},${getMinifyXStatus(n.minify,n.minifyWXML)},${getMinifyXStatus(n.minify,n.minifyWXSS)},${n.codeProtect?1:0},${n.autoPrefixWXSS?1:0}`})}function wrapReport(e,t){return async function(o){const i=o.project;let r={};"upload"!==e&&"preview"!==e||(r=o.setting||{});let n=null;const p=Date.now();try{return await t.apply(null,arguments)}catch(e){throw n=e,e}finally{try{const t=Date.now()-p,o=n?n.code?n.code:-1:0,s=n&&n.message?n.message:"";reportAction(e,o,s,t,i,r)}catch(e){console.info(e)}}}}
|
package/dist/utils/request.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.request=request,exports.setCiProxy=setCiProxy,exports.getCiProxy=getCiProxy,exports.initGlobalProxy=initGlobalProxy,exports.simpleRequest=simpleRequest;const tslib_1=require("tslib"),log=tslib_1.__importStar(require("./log")),interruptibletask_1=require("./interruptibletask"),req=require("request"),getGlobalProxySettings=require("get-proxy");class RequestTask extends interruptibletask_1.InterruptibleTask{constructor(e){super(e),this._alreadyRefresh=!1,this._promise.catch(e=>{log.error(`${this._opt.url} ${e}`)})}static async formateQuery(e){const t=Object.assign({},e),{needRandom:r}=t;delete t.needRandom;const s=(t.url||"").split("?"),o=s[0],i=[];return-1!==r&&i.push("_r="+Math.random()),s[1]&&i.push(s[1]),t.url=`${o}?${i.join("&")}`,t}abort(){this._aborted||(this._aborted=!0,this._realRequest&&"function"==typeof this._realRequest.abort&&this._realRequest.abort())}async request(){if("undefined"!=typeof WEBIDE_WEBPECK_DEFINE_PLUGIN)return Promise.reject("not implement request for web yet");if(this._aborted)throw interruptibletask_1.AbortEvent;const e=await RequestTask.formateQuery(this._opt);return RequestTask.requestProxy&&(e.proxy=RequestTask.requestProxy),new Promise((t,r)=>{this._realRequest=req(e,(e,s,o)=>{e?r(e):t({resp:s,body:o})}),this._realRequest.on("abort",()=>{r(interruptibletask_1.AbortEvent)})})}async run(e){return this._opt=Object.assign({},e),await this.request()}}function request(e){return new RequestTask(e)}function setCiProxy(e){RequestTask.requestProxy=e,log.info("miniprogram-ci is using proxy: "+e)}function getCiProxy(){return RequestTask.requestProxy}function initGlobalProxy(){const e=getCiProxy(),t=`${process.env.no_proxy||""},${process.env.NO_PROXY||""}`.split(",").map(e=>e.trim());if(!e&&!t.includes("servicewechat.com")){const e=getGlobalProxySettings();e&&setCiProxy(e)}}function simpleRequest(e,t){if("undefined"!=typeof WEBIDE_WEBPECK_DEFINE_PLUGIN)return Promise.reject("not implement request for web yet");const r=getCiProxy();e.proxy=r,e.forever=!0;return req(e,(e,r,s)=>{"function"==typeof t&&t(e,r,s)})}RequestTask.requestProxy="";
|
package/dist/utils/sign.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getRandomString=getRandomString,exports.getSignature=getSignature;const tslib_1=require("tslib"),crypto_1=tslib_1.__importDefault(require("crypto")),config_1=require("../config/config"),url_config_1=require("../config/url.config"),request_1=require("./request"),error_1=require("./error"),locales_1=tslib_1.__importDefault(require("./locales/locales")),jsonParse_1=require("./jsonParse");async function getRandomString(r){try{const{body:e}=await(0,request_1.request)({url:url_config_1.GET_RAND_STRING,method:"post",body:JSON.stringify({appid:r,clientRand:Math.floor(1e8*Math.random())}),headers:{"content-type":"application/json"}}),t=(0,jsonParse_1.jsonRespParse)(e,url_config_1.GET_RAND_STRING);if(0===t.errCode)return t.data.randomString;throw new Error(`errCode: ${t.errCode}; errMsg: ${t.errMsg}`)}catch(r){throw new error_1.CodeError(r.toString(),config_1.GET_SIGNATURE_RAND_STRING_ERR)}}async function getSignature(r,e){const t={appid:e,rand_str:await getRandomString(e)};try{return crypto_1.default.privateEncrypt({key:r,padding:crypto_1.default.constants.RSA_PKCS1_PADDING},Buffer.from(JSON.stringify(t))).toString("base64")}catch(r){throw new error_1.CodeError(locales_1.default.config.GENERATE_LOCAL_SIGNATURE_FAIL.format(r.toString()),config_1.GENERATE_LOCAL_SIGNATURE_ERR)}}
|
package/dist/utils/signature.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateMd5=generateMd5,exports.checkBufferSignature=checkBufferSignature,exports.checkSignature=checkSignature,exports.checkFileMd5Signature=checkFileMd5Signature,exports.aesEncrypt=aesEncrypt,exports.aesDecrypt=aesDecrypt;const fs=require("fs"),crypto=require("crypto"),PUBLIKEY="-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCZm2cFP/uF81V5KH/B9dn/g7WA\nCM3yu0P7n9sm/O6c58HTYI0+xugCfwMuoX7hyU4jkWbZ/BYK7IgWhmVfiRtgomJe\nwuZlxfGUpmrr1PA2KbYVpPW0V6e/2uZu1Ev3xU7PkHKYf4AKgPO8w98hvKlUJRbk\nH4AYMxX6eL9j9qCBGQIDAQAB\n-----END PUBLIC KEY-----";function generateMd5(e){const r=crypto.createHash("md5");r.update(e);return r.digest("hex")}function checkBufferSignature(e,r,t){if(!r)return!1;return checkSignature(generateMd5(e),r,t)}function checkSignature(e,r,t){if(!r)return!1;const n=Buffer.from(r,"base64"),c=crypto.createVerify("RSA-SHA1");return c.update(e),!!c.verify(t||PUBLIKEY,n)}function checkFileMd5Signature(e,r,t){return checkBufferSignature(fs.readFileSync(e),r,t)}function aesEncrypt(e){const{data:r,key:t,iv:n,algorithm:c}=e,u=crypto.createCipheriv(c||"aes-128-cbc",t,n);let a=u.update(r,"utf8","binary");return a+=u.final("binary"),a=Buffer.from(a,"binary").toString("base64"),a}function aesDecrypt(e){const{key:r,iv:t,algorithm:n}=e,c=Buffer.from(e.data,"base64").toString("binary"),u=crypto.createDecipheriv(n||"aes-128-cbc",r,t);let a=u.update(c,"binary","utf8");return a+=u.final("utf8"),a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var SingletonTaskStatus;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SingletonTask=exports.SingletonTaskStatus=void 0,function(t){t[t.WAITING=0]="WAITING",t[t.PENDING=1]="PENDING",t[t.RESOLVED=2]="RESOLVED",t[t.REJECTED=3]="REJECTED"}(SingletonTaskStatus
|
|
1
|
+
"use strict";var SingletonTaskStatus;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SingletonTask=exports.SingletonTaskStatus=void 0,function(t){t[t.WAITING=0]="WAITING",t[t.PENDING=1]="PENDING",t[t.RESOLVED=2]="RESOLVED",t[t.REJECTED=3]="REJECTED"}(SingletonTaskStatus||(exports.SingletonTaskStatus=SingletonTaskStatus={}));class SingletonTask{constructor(t,s="",e=6e4){this.executor=t,this.key=s,this.timeout=e,this.status=SingletonTaskStatus.WAITING,this.queue=[]}async _run(){this.status=SingletonTaskStatus.PENDING,this.timer=setTimeout(()=>{this._reject("timeout")},this.timeout);try{const t=await this.executor();return this._resolve(t),t}catch(t){throw this._reject(t),t}}_emit(){const{queue:t}=this;this.queue=[];for(const s of t)this.status===SingletonTaskStatus.REJECTED?s.reject(this.rejectedReason):s.resolve(this.result)}get rejected(){return this.status===SingletonTaskStatus.REJECTED}_resolve(t){this.status=SingletonTaskStatus.RESOLVED,this.result=t,clearTimeout(this.timer),this._emit()}_reject(t){this.status=SingletonTaskStatus.REJECTED,this.rejectedReason=t,clearTimeout(this.timer),this._emit()}async getResult(t=!1,s=!1){if(this.status===SingletonTaskStatus.WAITING||this.status===SingletonTaskStatus.REJECTED&&t||this.status===SingletonTaskStatus.RESOLVED&&s)return this._run();if(this.status===SingletonTaskStatus.PENDING)return new Promise((t,s)=>{this.queue.push({resolve:t,reject:s})});if(this.status===SingletonTaskStatus.REJECTED)throw this.rejectedReason;return this.result}getResultCache(){return this.result}}exports.SingletonTask=SingletonTask;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.runSubProcess=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.runSubProcess=runSubProcess;const getProcess_1=require("./getProcess");let exitTimer,inited=!1;function setExitTimer(e=6e4){-1!==e&&(clearTimeout(exitTimer),exitTimer=setTimeout(()=>{(0,getProcess_1.getProcess)().exit(0)},e))}function processOnMessageFactory(e){return async s=>{if("object"!=typeof s)return void console.error("child process unrecognized message "+s);const{initHandler:t,messageHandler:r}=e;if("init"===s.type){if(inited)return void console.error("native compiler has been inited");try{await t(s),inited=!0,(0,getProcess_1.getProcess)().send({type:"ready"})}catch(e){(0,getProcess_1.getProcess)().send({type:"noReady",error:{code:e.code||-1,message:e.message,stack:e.stack,path:e.path||""}}),(0,getProcess_1.getProcess)().exit(-1e3)}}else inited||console.error("compiler not inited yet"),await r(s);setExitTimer(e.timeout)}}function runSubProcess(e){(0,getProcess_1.getProcess)().on("message",processOnMessageFactory(e)),(0,getProcess_1.getProcess)().on("disconnect",()=>{try{(0,getProcess_1.getProcess)().exit(0)}catch(e){(0,getProcess_1.getProcess)().kill((0,getProcess_1.getProcess)().pid,"SIGTERM")}}),(0,getProcess_1.getProcess)().on("uncaughtException",e=>{console.log(e)})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubProcessProxy=void 0;const processService_1=require("./processService"),customError_1=require("../customError"),singletontask_1=require("../singletontask"),debug_1=require("../debug"),progressRecorder_1=require("../../utils/progressRecorder");class SubProcessProxy{constructor(s,e,r,t,o=8891,i){this.project=s,this.entryPath=e,this.passData=r,this.initOptions=t,this.inspectPort=o,this.progressUpdate=i,this.taskMap=new Map,this.taskId=0,this.init=async()=>{this.process=await this.forkProcess()},this.onMessage=s=>{var e,r;if(this._cpPromise&&("ready"===s.type&&(clearTimeout(this._cpPromise.timer),null===(e=this._cpPromise)||void 0===e||e.resolve()),"noReady"===s.type&&this._cpPromise.reject(new Error(s.error.message))),"progress"===s.type){const e=this.taskMap.get(s.taskId);(null==e?void 0:e.progressUpdate)&&e.progressUpdate(s.id,s.status,s.message)}if("log"===s.type&&(null===(r=this.progressUpdate)||void 0===r||r.call(this,s.id||"",s.status,s.text)),"response"===s.type){const{id:e,data:r,error:t}=s;t?this.onResponse(e,void 0,t):this.onResponse(e,r,void 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(){console.warn(`[summer-compiler] forkProcess [${(0,progressRecorder_1.getPrintTime)()}]`);const s=await this.project.serialize();console.warn(`[summer-compiler] forkProcess serialize [${(0,progressRecorder_1.getPrintTime)()}]`);const e={type:"init",data:{passData:this.passData,projectInfo:s,options:this.initOptions}},r=await(0,debug_1.shouldRunInMainProcess)();if(r){const s=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubProcessProxy=void 0;const tslib_1=require("tslib"),processService_1=require("./processService"),path_1=tslib_1.__importDefault(require("path")),customError_1=require("../customError"),singletontask_1=require("../singletontask"),debug_1=require("../debug"),progressRecorder_1=require("../../utils/progressRecorder"),IN_PROCESS_HANDLER_MODULE_MAP={summerEntryProcess:"../../modules/corecompiler/processHandler",summerentryprocess:"../../modules/corecompiler/processHandler",nativeEntryProcess:"../../modules/nativecompiler/processHandler"};class SubProcessProxy{constructor(s,e,r,t,o=8891,i){this.project=s,this.entryPath=e,this.passData=r,this.initOptions=t,this.inspectPort=o,this.progressUpdate=i,this.taskMap=new Map,this.taskId=0,this.init=async()=>{this.process=await this.forkProcess()},this.onMessage=s=>{var e,r;if(this._cpPromise&&("ready"===s.type&&(clearTimeout(this._cpPromise.timer),null===(e=this._cpPromise)||void 0===e||e.resolve()),"noReady"===s.type&&this._cpPromise.reject(new Error(s.error.message))),"progress"===s.type){const e=this.taskMap.get(s.taskId);(null==e?void 0:e.progressUpdate)&&e.progressUpdate(s.id,s.status,s.message)}if("log"===s.type&&(null===(r=this.progressUpdate)||void 0===r||r.call(this,s.id||"",s.status,s.text)),"response"===s.type){const{id:e,data:r,error:t}=s;t?this.onResponse(e,void 0,t):this.onResponse(e,r,void 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}getInProcessHandler(){const s=path_1.default.parse(this.entryPath).name,e=IN_PROCESS_HANDLER_MODULE_MAP[s];if(!e)throw new Error("unsupported in-process entry handler: "+this.entryPath);return require(e)}async forkProcess(){console.warn(`[summer-compiler] forkProcess [${(0,progressRecorder_1.getPrintTime)()}]`);const s=await this.project.serialize();console.warn(`[summer-compiler] forkProcess serialize [${(0,progressRecorder_1.getPrintTime)()}]`);const e={type:"init",data:{passData:this.passData,projectInfo:s,options:this.initOptions}},r=await(0,debug_1.shouldRunInMainProcess)();if(r){const s=this.getInProcessHandler();return await s.initHandler(e),s.onMessage(this.onMessage),{send:e=>{r&&s.messageHandler(e)},kill:e=>(s.destroy(),!0)}}console.warn(`[summer-compiler] forkProcess start [${(0,progressRecorder_1.getPrintTime)()}]`);const t=await(0,processService_1.forkProcess)(this,this.entryPath,this.project.projectPath,e,this.inspectPort);return console.warn(`[summer-compiler] forkProcess done [${(0,progressRecorder_1.getPrintTime)()}]`),t}onResponse(s,e,r){const t=this.taskMap.get(s);this.taskMap.delete(s),t?r?(r=new customError_1.CustomError(r),t.reject(r)):t.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,r){return new Promise((t,o)=>{const i={name:s,data:e,resolve:t,reject:o,progressUpdate:r};this.taskId+=1,this.taskMap.set(this.taskId,i);this.sendProcessMessage({type:"request",id:this.taskId,name:s,data:e}).catch(s=>{o(s)})})}}exports.SubProcessProxy=SubProcessProxy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.forkProcess=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.forkProcess=forkProcess;const tslib_1=require("tslib"),child_process_1=require("child_process"),debug_1=require("../debug"),path_1=tslib_1.__importDefault(require("path")),env_1=require("../env"),PROCESS_READY_TIMEOUT=2e4;async function forkProcess(e,s,o,r,t=8891){const c=s,i={stdio:["pipe","pipe","pipe","ipc"],cwd:o,env:Object.assign(Object.assign({},process.env),{cpprocessEnv:"childprocess",nativeProcess:"1",timeout:global.TEST_COMPILER_PROCESS_TIMEOUT})};if(await(0,debug_1.shouldInspectCompiler)()&&(i.execArgv=["--inspect="+t],(0,env_1.isElectron)()&&i.execArgv.push("--expose-gc"),i.env.__MINIPROGRAM_CI_TEST__="true"),i.env.isDevtools=env_1.isDevtools,env_1.isDevtools){let e=path_1.default.join(path_1.default.dirname(process.execPath),"node");"darwin"!==process.platform&&(e+=".exe"),i.execPath=e}return new Promise((s,o)=>{const t=(0,child_process_1.fork)(c,["--expose-gc"],i),n=setTimeout(()=>{e.destroy(),o(new Error("fork process timeout"))},2e4);return e._cpPromise={timer:n,resolve:()=>{s(t)},reject:o},t.stdout.setEncoding("utf8"),t.stdout.on("data",e=>{console.log("child process stdout: "+e)}),t.stderr.on("data",e=>{console.error("child process stderr: "+e)}),t.on("exit",(s,r)=>{e.process=void 0,e._checkReadyTask=void 0,env_1.isDevtools&&console.error(`child process exit: code(${s}), signal(${r})`),0!==s&&o(new Error(`native child process exit: code(${s}), signal(${r})`))}),t.on("message",e.onMessage),t.unref(),e.taskId+=1,t.send(r),t})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function stringifyPostMsg(t){let s=t;if("object"==typeof t)try{s={type:"__stringify__",data:JSON.stringify(t)}}catch(t){}return s}function parsePostMsg(t){let s=t;if("__stringify__"===(null==t?void 0:t.type)&&t.data)try{s=JSON.parse(t.data)}catch(t){}return s}Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";function stringifyPostMsg(t){let s=t;if("object"==typeof t)try{s={type:"__stringify__",data:JSON.stringify(t)}}catch(t){}return s}function parsePostMsg(t){let s=t;if("__stringify__"===(null==t?void 0:t.type)&&t.data)try{s=JSON.parse(t.data)}catch(t){}return s}Object.defineProperty(exports,"__esModule",{value:!0}),exports.stringifyPostMsg=stringifyPostMsg,exports.parsePostMsg=parsePostMsg;
|
package/dist/utils/swc_helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidSWCHelperFunc=isValidSWCHelperFunc,exports.getHelperDeps=getHelperDeps,exports.getSWCOutputPath=getSWCOutputPath,exports.getHelperContent=getHelperContent,exports.replaceSWCHelpers=replaceSWCHelpers,exports.collectSWCHelpers=collectSWCHelpers,exports.isIgnore=isIgnore;const tslib_1=require("tslib"),path=tslib_1.__importStar(require("path")),fs=tslib_1.__importStar(require("fs-extra")),tools_1=require("./tools"),swc_config_1=require("./swc_config");function isValidSWCHelperFunc(e){return swc_config_1.DepMap.hasOwnProperty(e)}function getHelperDeps(e,r){const t=Array.from(e),n=new Set(e);for(;t.length;){const e=t.shift()||"",s=e.substr(0,e.indexOf(r)+r.length),o=e.replace(s+"/","");o in swc_config_1.DepMap&&swc_config_1.DepMap[o].forEach(e=>{const r=`${s}/${e}`;n.has(r)||(t.push(r),n.add(r))})}return Array.from(n)}function getSWCOutputPath(e){var r;let t=(null===(r=null==e?void 0:e.swcSetting)||void 0===r?void 0:r.outputPath)||"";return t?(t=(0,tools_1.normalizePath)(t),t.replace(/(^[./\\])|(\/$)/g,""),t):"@swc/runtime"}function getHelperContent(e,r){const t=e.substr(0,e.indexOf(r)+r.length),n=e.replace(t,"swc_runtime"),s=(0,tools_1.normalizePath)(path.join(__dirname,"../vendor/",n+".js"));return fs.readFile(s,"utf8")}const SWCHelperRequireReg=/require\("(@swc\/helpers\/_\/([^"]+))"\)/gi;function replaceSWCHelpers(e,r,t){const n=new Set,s=r.split("/").map((e,r)=>0===r?"":"../").join("");return{transformCode:e.replace(SWCHelperRequireReg,(e,r,o)=>{const p=r.replace("@swc/helpers/_",t);return swc_config_1.DepMap.hasOwnProperty(o)?(n.add(p),`require("${s+p}")`):e}),helpers:Array.from(n)}}function collectSWCHelpers(e){const r=new Set;return e.replace(SWCHelperRequireReg,(e,t,n)=>(r.add(n),e)),r}function isIgnore(e,r){const t=e||[],n=r.split(path.sep).join("/");for(const e of t){if(r===e)return!0;if(!/^[./\\]+/.test(e)&&/.+\/\*$/.test(e)&&-1!==n.indexOf(e.substr(0,e.length-1)))return!0}return!1}
|
package/dist/utils/tools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compareSemVer=exports.isMiniProgramCodeFile=exports.isCodeFile=exports.getSupportCodeFileExtSet=exports.getCompilerPlugins=exports.sourcePathToTargetPath=exports.checkIsUseCompilerPlugins=exports.isMiniappPlatform=exports.isPluginType=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.generateFileMD5=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"),env_1=require("./env"),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 n=o.slice(o.lastIndexOf("/")+1);let i=!1;for(const e of s){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(o,"/").startsWith(trailing(leading(t,"/"),"/"));else if("file"===e.type)i=leading(o,"/")===leading(t,"/");else if("glob"===e.type)try{i=(0,minimatch_1.default)(o,t)||(0,minimatch_1.default)(leading(o,"/"),t)}catch(e){i=!1}else if("regexp"===e.type)try{i=new RegExp(t,"igm").test(o)||new RegExp(t,"igm").test(leading(o,"/"))}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){}}}async function generateFileMD5(e){return new Promise((t,r)=>{const s=crypto_1.default.createHash("md5"),o=fs_1.default.createReadStream(e);o.on("data",e=>{s.update(e)}),o.on("end",()=>{const e=s.digest("hex");t(e)}),o.on("error",e=>{r(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.generateFileMD5=generateFileMD5,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(),n=e.getMinutes(),i=e.getSeconds();return`${[t,r,s].map(exports.formatNumber).join("/")} ${[o,n,i].map(exports.formatNumber).join(":")}`};function devtoolsInfo(...e){env_1.isDevtools&&console.info(...e)}function devtoolsLog(...e){env_1.isDevtools&&console.log(...e)}function devtoolsError(...e){env_1.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.formatTime=formatTime,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)=>{const r=/^(\d+\.\d+\.\d+)(-.*)?$/,s=e=>{const t=e.match(r);return t?t[1]:""};let o=s(e),n=s(t);if(""===o||""===n)return-2;o=o.split("."),n=n.split(".");const i=Math.max(o.length,n.length);for(;o.length<i;)o.push("0");for(;n.length<i;)n.push("0");for(let e=0;e<i;e++){const t=parseInt(o[e],10),r=parseInt(n[e],10);if(t>r)return 1;if(t<r)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}function isPluginType(e){return e.type===types_1.EProjectType.miniGamePlugin||e.type===types_1.EProjectType.miniProgramPlugin}function isMiniappPlatform(e){return!!e&&("mini-android"===e||"mini-ios"===e)}exports.pathRelative=pathRelative,exports.isLeftSubPathOfRight=isLeftSubPathOfRight,exports.isGameApp=isGameApp,exports.isPluginType=isPluginType,exports.isMiniappPlatform=isMiniappPlatform;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)}function compareSemVer(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;const r=/\d+/g,s=e.match(r),o=t.match(r);if(!s)return 1;if(!o)return-1;const n=s.map(e=>parseInt(e,10)),i=o.map(e=>parseInt(e,10)),a=s.length>o.length?o.length:s.length;for(let e=0;e<a;e++){if(n[e]<i[e])return-1;if(n[e]>i[e])return 1}return n.length===i.length?0:n.length<i.length?-1:1}exports.sourcePathToTargetPath=sourcePathToTargetPath,exports.getCompilerPlugins=getCompilerPlugins,exports.getSupportCodeFileExtSet=getSupportCodeFileExtSet,exports.isCodeFile=isCodeFile,exports.isMiniProgramCodeFile=isMiniProgramCodeFile,exports.compareSemVer=compareSemVer;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sourcePathToTargetPath=exports.checkIsUseCompilerPlugins=exports.pathRelative=exports.compareVersion=exports.unifyPath=exports.getWorkersPath=exports.formatTime=exports.formatNumber=exports.isFileIncluded=exports.isFileIgnored=exports.isHexColor=exports.formatJSONParseErr=exports.bufferToUtf8String=void 0,exports.normalizePath=normalizePath,exports.joinPath=joinPath,exports.escapeScript=escapeScript,exports.wrapCodeByEval=wrapCodeByEval,exports.getType=getType,exports.rmSync=rmSync,exports.mkdirSync=mkdirSync,exports.escapeQuot=escapeQuot,exports.trailing=trailing,exports.leading=leading,exports.formatSourceMap=formatSourceMap,exports.generateFileMD5=generateFileMD5,exports.generateMD5=generateMD5,exports.devtoolsInfo=devtoolsInfo,exports.devtoolsLog=devtoolsLog,exports.devtoolsError=devtoolsError,exports.checkIsInSubPackage=checkIsInSubPackage,exports.checkIsIndependentSubpackage=checkIsIndependentSubpackage,exports.getTerm=getTerm,exports.getAppJson=getAppJson,exports.getPluginJson=getPluginJson,exports.isLeftSubPathOfRight=isLeftSubPathOfRight,exports.isGameApp=isGameApp,exports.isPluginType=isPluginType,exports.isMiniappPlatform=isMiniappPlatform,exports.getCompilerPlugins=getCompilerPlugins,exports.getSupportCodeFileExtSet=getSupportCodeFileExtSet,exports.isCodeFile=isCodeFile,exports.isMiniProgramCodeFile=isMiniProgramCodeFile,exports.compareSemVer=compareSemVer;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"),env_1=require("./env"),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("]","")}const bufferToUtf8String=e=>{const t=e.toString();if(0===Buffer.compare(Buffer.from(t,"utf8"),e))return t};function getErrLine(e,t,r,n){r=r>0?r:1;return`${n}\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 n=`Expecting ${r.expected}, got ${r.token}`,s=getErrLine(t,r.line,r.loc.first_column,n);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,n=t.length;r<n;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;const FFSPRGRulesFactory=function(e){let t=null,r=Object.create(null);return function(e,n){if(n.length<1)return!1;if(t===n){if(void 0!==r[e])return r[e]}else t=n,r=Object.create(null);const s=e.replace(/\\/g,"/").toLowerCase();if(!s)return!1;const i=s.slice(s.lastIndexOf("/")+1);let o=!1;for(const e of n){if(!e)continue;const t=e.value.toLowerCase();if("prefix"===e.type)o=i.startsWith(t);else if("suffix"===e.type)o=i.endsWith(t);else if("folder"===e.type)o=leading(s,"/").startsWith(trailing(leading(t,"/"),"/"));else if("file"===e.type)o=leading(s,"/")===leading(t,"/");else if("glob"===e.type)try{o=(0,minimatch_1.default)(s,t)||(0,minimatch_1.default)(leading(s,"/"),t)}catch(e){o=!1}else if("regexp"===e.type)try{o=new RegExp(t,"igm").test(s)||new RegExp(t,"igm").test(leading(s,"/"))}catch(e){o=!1}if(o)break}return r[e]=o,o}};function formatSourceMap(e){if(e){if("string"===getType(e))return e;try{return JSON.stringify(e)}catch(e){}}}async function generateFileMD5(e){return new Promise((t,r)=>{const n=crypto_1.default.createHash("md5"),s=fs_1.default.createReadStream(e);s.on("data",e=>{n.update(e)}),s.on("end",()=>{const e=n.digest("hex");t(e)}),s.on("error",e=>{r(e)})})}function generateMD5(e){const t=crypto_1.default.createHash("md5");return t.update(e),t.digest("hex")}exports.isFileIgnored=FFSPRGRulesFactory(),exports.isFileIncluded=FFSPRGRulesFactory();const formatNumber=e=>e>9?""+e:"0"+e;exports.formatNumber=formatNumber;const formatTime=e=>{const t=e.getFullYear(),r=e.getMonth()+1,n=e.getDate(),s=e.getHours(),i=e.getMinutes(),o=e.getSeconds();return`${[t,r,n].map(exports.formatNumber).join("/")} ${[s,i,o].map(exports.formatNumber).join(":")}`};function devtoolsInfo(...e){env_1.isDevtools&&console.info(...e)}function devtoolsLog(...e){env_1.isDevtools&&console.log(...e)}function devtoolsError(...e){env_1.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 n=e[r];if(n.provider===t)return{alias:r,provider:n.provider,version:n.version}}}}function checkPluginByAliasOrProvider(e,t){let r;if(e.subPackages)for(const n of e.subPackages)if(r=getPluginByAliasOrProvider(n.plugins,t),r)return Object.assign(Object.assign({},r),{config:n});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:\/\/([^/]*)\/(.*)/),n=null==r?void 0:r[1];if(!n)return;const s=checkPluginByAliasOrProvider(e,n);return null==s?void 0:s.config}if(e.subPackages)for(let n=0,s=e.subPackages.length;n<s;n++){const s=e.subPackages[n];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),n=fs_extra_1.default.readJsonSync(e),s=lodash_1.default.omit(n,r);return lodash_1.default.merge(s,n[t]||("mini-weixin"===t?n["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.formatTime=formatTime;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)=>{const r=/^(\d+\.\d+\.\d+)(-.*)?$/,n=e=>{const t=e.match(r);return t?t[1]:""};let s=n(e),i=n(t);if(""===s||""===i)return-2;s=s.split("."),i=i.split(".");const o=Math.max(s.length,i.length);for(;s.length<o;)s.push("0");for(;i.length<o;)i.push("0");for(let e=0;e<o;e++){const t=parseInt(s[e],10),r=parseInt(i[e],10);if(t>r)return 1;if(t<r)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),n=_isLeftSubPathOfRight(e,t);return r!==n&&console.error(new Error(`${e} ${t} difference check sub path here! new result: ${n}`)),n}function isGameApp(e){return e.type===types_1.EProjectType.miniGame||e.type===types_1.EProjectType.miniGamePlugin}function isPluginType(e){return e.type===types_1.EProjectType.miniGamePlugin||e.type===types_1.EProjectType.miniProgramPlugin}function isMiniappPlatform(e){return!!e&&("mini-android"===e||"mini-ios"===e)}exports.pathRelative=pathRelative;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)}function compareSemVer(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;const r=/\d+/g,n=e.match(r),s=t.match(r);if(!n)return 1;if(!s)return-1;const i=n.map(e=>parseInt(e,10)),o=s.map(e=>parseInt(e,10)),a=n.length>s.length?s.length:n.length;for(let e=0;e<a;e++){if(i[e]<o[e])return-1;if(i[e]>o[e])return 1}return i.length===o.length?0:i.length<o.length?-1:1}exports.sourcePathToTargetPath=sourcePathToTargetPath;
|
package/dist/utils/usbProcess.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.startUSBManagerProcess=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.startUSBManagerProcess=startUSBManagerProcess;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})`)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function splitQuoteFromWASM(t,e=0){if(t.indexOf(`__SINGLE_${e}_QUOTE__`)>-1){const o={},r=t.split(`__SINGLE_${e}_QUOTE__`).filter(t=>!!t);for(let t=0;t<=r.length-1;t+=2)r[t]&&r[t+1]&&(o[r[t]]=splitQuoteFromWASM(r[t+1],e+1));return o}return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.splitQuoteFromWASM=splitQuoteFromWASM;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GameWhiteList=exports.MiniProgramWhiteList=void 0,exports.getWhiteExtList=getWhiteExtList;const tslib_1=require("tslib"),url_config_1=require("../config/url.config"),request_1=require("./request"),log=tslib_1.__importStar(require("./log")),jsonParse_1=require("./jsonParse");let cacheResult;async function getWhiteExtList(){if(cacheResult)return cacheResult;try{const{body:t}=await(0,request_1.request)({url:url_config_1.GET_WHITE_EXT_LIST,method:"get"}),e=(0,jsonParse_1.jsonRespParse)(t,url_config_1.GET_WHITE_EXT_LIST);if(0===e.errCode&&e.data)return cacheResult={GameWhiteList:new Set(e.data.game||exports.GameWhiteList),MiniProgramWhiteList:new Set(e.data.miniProgram||exports.MiniProgramWhiteList)},cacheResult}catch(t){log.error("get white ext list fail "+t)}return{GameWhiteList:new Set(exports.GameWhiteList),MiniProgramWhiteList:new Set(exports.MiniProgramWhiteList)}}exports.MiniProgramWhiteList=[".wxml",".wxss",".wxs",".png",".jpg",".jpeg",".gif",".svg",".js",".json",".cer",".mp3",".aac",".m4a",".mp4",".wav",".ogg",".silk",".wasm",".br",".cur",".ico",".skel",".crt",".cert"],exports.GameWhiteList=[".png",".jpg",".jpeg",".gif",".svg",".js",".json",".cer",".obj",".dae",".fbx",".mtl",".stl",".3ds",".mp3",".pvr",".wav",".plist",".ttf",".fnt",".gz",".ccz",".m4a",".mp4",".bmp",".atlas",".swf",".ani",".part",".proto",".bin",".sk",".mipmaps",".txt",".zip",".ogg",".silk",".dbbin",".dbmv",".etc",".lmat",".lm",".ls",".lh",".lani",".lav",".lsani",".ltc",".csv",".scene",".prefab",".lml",".lmani",".ktx",".dds",".xml",".aac",".pkm",".skel",".cur",".ico",".wasm",".br",".gltf",".glb",".astc",".dat",".tt"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.packCore=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.packCore=packCore,exports.default=pack;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),glob_1=tslib_1.__importDefault(require("glob")),rtrim_1=tslib_1.__importDefault(require("licia/rtrim")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),tools_1=require("../tools"),B_PROTOCOL=0,B_PROTOCOL_VERSION=1,B_FILEINFO_LEN=2,B_FILEDATA_LEN=3,B_PROTOCOL_END=4;function packCore(t){const e=[Buffer.alloc(1),Buffer.alloc(4),Buffer.alloc(4),Buffer.alloc(4),Buffer.alloc(1)];e[0].writeUIntLE(190,0,1),e[1].writeInt32BE(0,0),e[4].writeUIntLE(237,0,1);const r=t.length,l=[],a=[];t.forEach(({path:t,data:e})=>{l.push(Buffer.from(t)),a.push(e)});let o=18+12*r+Buffer.concat(l).length;const f=l.map((t,e)=>{const r=Buffer.alloc(4);r.writeInt32BE(t.length,0);const l=a[e].length,f=Buffer.alloc(4);f.writeInt32BE(o,0),o+=l;const n=Buffer.alloc(4);return n.writeInt32BE(l,0),Buffer.concat([r,t,f,n])}),n=Buffer.alloc(4);n.writeInt32BE(r,0),f.unshift(n);const c=Buffer.concat(f),i=Buffer.concat(a);e[2].writeInt32BE(c.length,0),e[3].writeInt32BE(i.length,0);const u=Buffer.concat(e);return Buffer.concat([u,c,i])}async function pack(t,e,r,l){const a=packCore(await readFiles(t,r,l));return fs_extra_1.default.ensureFileSync(e),fs_extra_1.default.writeFileSync(e,a),a}function readFiles(t,e,r){return t=(0,tools_1.normalizePath)(t),t=(0,rtrim_1.default)(t," /"),new Promise((l,a)=>{const o=[];(0,glob_1.default)(path_1.default.join(t,"**/*"),{nodir:!0,ignore:r,cwd:e},async(r,f)=>{if(r)return a(r);for(let r=0,l=f.length;r<l;r++){const l=f[r];o[r]={path:l.replace(t,""),data:fs_1.default.readFileSync(path_1.default.join(e,l))}}l(o)})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFileInfoLength=getFileInfoLength,exports.getFileContentLength=getFileContentLength,exports.getFileCount=getFileCount,exports.getFileInfo=getFileInfo,exports.default=unpack;const fs=require("fs"),path=require("path"),mkdir=require("mkdir-p"),INFO_LENGTH_BEGIN=5,INFO_LENGTH_END=9,FILE_LENGTH_BEGIN=9,FILE_LENGTH_END=13,FILE_COUNT_BEGIN=14,FILE_COUNT_END=18,FILF_INFO_BEGIN=18;function getFileInfoLength(e){return e.slice(5,9).readInt32BE(0)}function getFileContentLength(e){return e.slice(9,13).readInt32BE(0)}function getFileCount(e){return e.slice(14,18).readInt32BE(0)}function getFileInfo(e){const t=getFileCount(e),n=[];let o=18;for(let r=0;r<t;r++){const t=e.slice(o,o+4).readInt32BE(0);o+=4;const r=e.slice(o,o+t).toString();o+=t;const i=e.slice(o,o+4).readInt32BE(0);o+=4;const c=e.slice(o,o+4).readInt32BE(0);o+=4,n.push({name:r,offset:i,length:c})}return n}function unpack(e,t){try{const n=getFileInfo(e),o={};for(const r of n){const{name:n,offset:i,length:c}=r;if(o[n]=e.slice(i,i+c),t){const e=path.join(t,n);mkdir.sync(path.dirname(e)),fs.writeFileSync(e,o[n])}}return o}catch(e){throw new Error("unpack wxvpkg catch error "+e)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFileInfoLength=getFileInfoLength,exports.getFileIndexLength=getFileIndexLength,exports.getFileContentLength=getFileContentLength,exports.getFileCount=getFileCount,exports.getFileInfo=getFileInfo,exports.default=unpack;const fs=require("fs"),path=require("path"),mkdir=require("mkdir-p"),INFO_LENGTH_BEGIN=5,INFO_LENGTH_END=9,INDEX_LENGTH_BEGIN=9,INDEX_LENGTH_END=13,FILE_LENGTH_BEGIN=13,FILE_LENGTH_END=17,FILE_COUNT_BEGIN=18,FILE_COUNT_END=22,FILF_INFO_BEGIN=22;function getFileInfoLength(e){return e.slice(5,9).readInt32BE(0)}function getFileIndexLength(e){return e.slice(9,13).readInt32BE(0)}function getFileContentLength(e){return e.slice(13,17).readInt32BE(0)}function getFileCount(e){return e.slice(18,22).readInt32BE(0)}function getFileInfo(e){const t=getFileCount(e),n=[];let o=22;for(let r=0;r<t;r++){const t=e.slice(o,o+4).readInt32BE(0);o+=4;const r=e.slice(o,o+t).toString();o+=t;const i=e.slice(o,o+1).readIntBE(0,1,!1);o+=1;const c=e.slice(o,o+2).readIntBE(0,2,!1);o+=2;const s=e.slice(o,o+4).readInt32BE(0);o+=4;const l=e.slice(o,o+4).readInt32BE(0);o+=4,n.push({name:r,encType:i,mode:c,offset:s,length:l})}return n}function unpack(e,t){try{const n=getFileInfo(e),o={},r=18+getFileInfoLength(e)+getFileIndexLength(e);for(const i of n){const{name:n,offset:c,length:s,mode:l}=i;if(o[n]=e.slice(c+r,c+r+s),t){const e=path.join(t,n);mkdir.sync(path.dirname(e)),fs.writeFileSync(e,o[n],{mode:l.toString(8)})}}return o}catch(e){throw new Error("unpack wxvpkg catch error "+e)}}
|
package/dist/utils/zip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unzip=unzip,exports.genZip=genZip,exports.archiveZip=archiveZip;const AdmZip=require("adm-zip"),fse=require("fs-extra"),archiver=require("archiver");async function unzip(e,r){return new Promise((i,t)=>{try{setTimeout(()=>{const n=new AdmZip(e),c=n.getEntries();for(const e of c){const r=e.entryName;/^\.\.(\\|\/)+/.test(r)&&t("illegal access"),/(\\|\/)+\.\.(\\|\/)+/.test(r)&&t("illegal access"),/(\\|\/)+\.\.$/.test(r)&&t("illegal access")}n.extractAllTo(r,!0),i({})},200)}catch(e){console.warn("@@@@@ [unzip] Fail. Error:",e),t(e)}})}function genZip(e,r){const i=new AdmZip;i.addLocalFolder(e),fse.writeFileSync(r,i.toBuffer())}function archiveZip(e,r){return new Promise((i,t)=>{const n=fse.createWriteStream(r),c=archiver("zip",{zlib:{level:9}});c.on("error",e=>{t(e)}),c.on("end",()=>{i({})}),c.pipe(n),c.directory(e,!1),c.finalize()})}
|