miniprogram-ci 1.9.27 → 2.0.1
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 -169
- package/README.md +12 -7
- package/bin/.DS_Store +0 -0
- package/bin/miniprogram-ci.js +1 -1
- package/dist/@types/ci/checkCodeQuality.d.ts +2 -2
- package/dist/@types/ci/cloud/cloudapi.d.ts +7 -0
- package/dist/@types/ci/cloud/createTimeTrigger.d.ts +13 -0
- package/dist/@types/ci/cloud/uploadContainer.d.ts +71 -0
- package/dist/@types/ci/cloud/uploadFile.d.ts +9 -0
- package/dist/@types/ci/cloud/uploadFunction.d.ts +13 -0
- package/dist/@types/ci/cloud/utils.d.ts +17 -0
- package/dist/@types/ci/code-analyse.d.ts +1 -1
- package/dist/@types/ci/getcompiler.d.ts +5 -0
- package/dist/@types/ci/index.d.ts +39 -0
- package/dist/@types/ci/project.d.ts +1 -47
- package/dist/@types/ci/utils/codeDenpendencyQualityChecker.d.ts +1 -1
- package/dist/@types/ci/utils/tools.d.ts +5 -0
- package/dist/@types/cli/cmdForDonutH5.d.ts +22 -0
- package/dist/@types/common/cloud-api/src/apis/tcb/tcb.apis.d.ts +180 -0
- package/dist/@types/common/cloud-api/src/transaction/contracts/account.contracts.d.ts +2 -0
- package/dist/@types/common/cloud-api/src/transaction/contracts/contracts.d.ts +9 -0
- package/dist/@types/common/cloud-api/src/transaction/contracts/lowcode.contracts.d.ts +3 -0
- package/dist/@types/common/cloud-api/src/transaction/contracts/tcb.contracts.d.ts +183 -0
- package/dist/@types/common/cloud-api/src/transaction/validations/account.validations.d.ts +2 -0
- package/dist/@types/common/cloud-api/src/transaction/validations/common.validations.d.ts +118 -0
- package/dist/@types/common/cloud-api/src/transaction/validations/lowcode.validations.d.ts +3 -0
- package/dist/@types/common/cloud-api/src/transaction/validations/tcb.validations.d.ts +188 -0
- package/dist/@types/common/cloud-api/src/transaction/validations/validations.d.ts +8 -0
- package/dist/@types/common/code-analyse/index.d.ts +371 -0
- package/dist/@types/config/compiletype.config.d.ts +17 -0
- package/dist/@types/config/config.d.ts +93 -0
- package/dist/@types/config/define.d.ts +5 -0
- package/dist/@types/config/url.config.d.ts +25 -0
- package/dist/@types/index.d.ts +27 -38
- package/dist/@types/modules/corecompiler/baseCompiler.d.ts +132 -0
- package/dist/@types/modules/corecompiler/original/analyse/partial.d.ts +25 -0
- package/dist/@types/modules/corecompiler/original/compile/common.d.ts +17 -0
- package/dist/@types/modules/corecompiler/original/compile/game.d.ts +5 -0
- package/dist/@types/modules/corecompiler/original/compile/gamePlugin.d.ts +8 -0
- package/dist/@types/modules/corecompiler/original/compile/handler/js.d.ts +15 -0
- package/dist/@types/modules/corecompiler/original/compile/handler/mpjson.d.ts +10 -0
- package/dist/@types/modules/corecompiler/original/compile/handler/wxml.d.ts +9 -0
- package/dist/@types/modules/corecompiler/original/compile/handler/wxss.d.ts +10 -0
- package/dist/@types/modules/corecompiler/original/compile/index.d.ts +5 -0
- package/dist/@types/modules/corecompiler/original/compile/miniprogram.d.ts +5 -0
- package/dist/@types/modules/corecompiler/original/compile/miniprogramPlugin.d.ts +8 -0
- package/dist/@types/modules/corecompiler/original/index.d.ts +51 -0
- package/dist/@types/modules/corecompiler/original/js/index.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/js/minifyjs.d.ts +16 -0
- package/dist/@types/modules/corecompiler/original/js/minifyjsAfterWrap.d.ts +12 -0
- package/dist/@types/modules/corecompiler/original/json/app/appJSON.d.ts +6 -0
- package/dist/@types/modules/corecompiler/original/json/app/checkAppFields.d.ts +43 -0
- package/dist/@types/modules/corecompiler/original/json/app/extJSON.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/json/app/index.d.ts +4 -0
- package/dist/@types/modules/corecompiler/original/json/common.d.ts +19 -0
- package/dist/@types/modules/corecompiler/original/json/game.d.ts +4 -0
- package/dist/@types/modules/corecompiler/original/json/page/checkPageJSON.d.ts +6 -0
- package/dist/@types/modules/corecompiler/original/json/page/getPageJSON.d.ts +14 -0
- package/dist/@types/modules/corecompiler/original/json/plugin/plugin.d.ts +12 -0
- package/dist/@types/modules/corecompiler/original/json/plugin/pluginPage.d.ts +9 -0
- package/dist/@types/modules/corecompiler/original/json/projectconfig.d.ts +2 -0
- package/dist/@types/modules/corecompiler/original/json/reactiveCache.d.ts +24 -0
- package/dist/@types/modules/corecompiler/original/json/signaturejson.d.ts +21 -0
- package/dist/@types/modules/corecompiler/original/json/sitemap.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/json/theme.d.ts +18 -0
- package/dist/@types/modules/corecompiler/original/npm/packnpm.d.ts +13 -0
- package/dist/@types/modules/corecompiler/original/protect/uglifyfilenames.d.ts +9 -0
- package/dist/@types/modules/corecompiler/original/utils/env.d.ts +7 -0
- package/dist/@types/modules/corecompiler/original/validate/appjson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/extjson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/gamejson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/gamepluginjson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/pagejson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/pluginjson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/pluginpagejson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/projectconfig.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/schemaValidate.d.ts +8 -0
- package/dist/@types/modules/corecompiler/original/validate/signaturejson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/validate/sitemapjson.d.ts +3 -0
- package/dist/@types/modules/corecompiler/original/workerThread/childprocessManager.d.ts +16 -0
- package/dist/@types/modules/corecompiler/original/workerThread/index.d.ts +4 -0
- package/dist/@types/modules/corecompiler/original/workerThread/task/compilejs.d.ts +43 -0
- package/dist/@types/modules/corecompiler/original/workerThread/task/compilewxss.d.ts +21 -0
- package/dist/@types/modules/corecompiler/original/workerThread/task/index.d.ts +2 -0
- package/dist/@types/modules/corecompiler/original/workerThread/task/minifywxml.d.ts +46 -0
- package/dist/@types/modules/corecompiler/original/workerThread/workerManager.d.ts +19 -0
- package/dist/@types/modules/corecompiler/originalCompiler.d.ts +106 -0
- package/dist/@types/modules/corecompiler/summer/graph/appconf.d.ts +36 -0
- package/dist/@types/modules/corecompiler/summer/graph/appgraph.d.ts +24 -0
- package/dist/@types/modules/corecompiler/summer/graph/baseconf.d.ts +16 -0
- package/dist/@types/modules/corecompiler/summer/graph/basegraph.d.ts +88 -0
- package/dist/@types/modules/corecompiler/summer/graph/gameconf.d.ts +20 -0
- package/dist/@types/modules/corecompiler/summer/graph/gamegraph.d.ts +24 -0
- package/dist/@types/modules/corecompiler/summer/graph/gamepluginconf.d.ts +11 -0
- package/dist/@types/modules/corecompiler/summer/graph/gameplugingraph.d.ts +23 -0
- package/dist/@types/modules/corecompiler/summer/graph/pluginconf.d.ts +21 -0
- package/dist/@types/modules/corecompiler/summer/graph/plugingraph.d.ts +23 -0
- package/dist/@types/modules/corecompiler/summer/graph/util.d.ts +2 -0
- package/dist/@types/modules/corecompiler/summer/index.d.ts +3 -0
- package/dist/@types/modules/corecompiler/summer/initPlugin.d.ts +2 -0
- package/dist/@types/modules/corecompiler/summer/module.d.ts +44 -0
- package/dist/@types/modules/corecompiler/summer/persistCache.d.ts +13 -0
- package/dist/@types/modules/corecompiler/summer/pluginDriver.d.ts +45 -0
- package/dist/@types/modules/corecompiler/summer/pluginconfig.d.ts +4 -0
- package/dist/@types/modules/corecompiler/summer/plugins/base/es6module.d.ts +21 -0
- package/dist/@types/modules/corecompiler/summer/plugins/base/javascript.d.ts +3 -0
- package/dist/@types/modules/corecompiler/summer/plugins/base/swc.d.ts +6 -0
- package/dist/@types/modules/corecompiler/summer/plugins/base/wxss.d.ts +6 -0
- package/dist/@types/modules/corecompiler/summer/plugins/enhance.d.ts +4 -0
- package/dist/@types/modules/corecompiler/summer/plugins/less.d.ts +5 -0
- package/dist/@types/modules/corecompiler/summer/plugins/minifywxml.d.ts +5 -0
- package/dist/@types/modules/corecompiler/summer/plugins/sass.d.ts +3 -0
- package/dist/@types/modules/corecompiler/summer/plugins/terser.d.ts +2 -0
- package/dist/@types/modules/corecompiler/summer/plugins/typescript.d.ts +2 -0
- package/dist/@types/modules/corecompiler/summer/plugins/worklet.d.ts +4 -0
- package/dist/@types/modules/corecompiler/summer/resolver.d.ts +29 -0
- package/dist/@types/modules/corecompiler/summer/summer.d.ts +40 -0
- package/dist/@types/modules/corecompiler/summer/utils/ensureArray.d.ts +1 -0
- package/dist/@types/modules/corecompiler/summer/utils/inputsourcemap.d.ts +2 -0
- package/dist/@types/modules/corecompiler/summer/worker.d.ts +16 -0
- package/dist/@types/modules/corecompiler/summerCompiler.d.ts +121 -0
- package/dist/@types/modules/createSummer.d.ts +18 -0
- package/dist/@types/modules/fullcompiler/app/app.d.ts +74 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/originalcontactbase64.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/originallaunchbase64.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.d.ts +3 -0
- package/dist/@types/modules/fullcompiler/appservice/appservice.config.d.ts +4 -0
- package/dist/@types/modules/fullcompiler/appservice/generatecode.utils.d.ts +12 -0
- package/dist/@types/modules/fullcompiler/appservice/getappservice.d.ts +9 -0
- package/dist/@types/modules/fullcompiler/appservice/getcompiledjs.d.ts +32 -0
- package/dist/@types/modules/fullcompiler/appservice/getjsfile.d.ts +18 -0
- package/dist/@types/modules/fullcompiler/appservice/getmainpkgsortedjsfiles.d.ts +12 -0
- package/dist/@types/modules/fullcompiler/appservice/getsubpackage.d.ts +7 -0
- package/dist/@types/modules/fullcompiler/appservice/getsubpkgsortedjsfiles.d.ts +10 -0
- package/dist/@types/modules/fullcompiler/appservice/getwxappcode.d.ts +13 -0
- package/dist/@types/modules/fullcompiler/config/apperrcode.config.d.ts +48 -0
- package/dist/@types/modules/fullcompiler/filerules.d.ts +5 -0
- package/dist/@types/modules/fullcompiler/getallrawfiles.d.ts +11 -0
- package/dist/@types/modules/fullcompiler/getallwmltohtmlmap.d.ts +11 -0
- package/dist/@types/modules/fullcompiler/index.d.ts +28 -0
- package/dist/@types/modules/fullcompiler/pageframe/getsubpackage.d.ts +10 -0
- package/dist/@types/modules/fullcompiler/pageframe/getwxappcode.d.ts +13 -0
- package/dist/@types/modules/fullcompiler/pageframe/index.d.ts +10 -0
- package/dist/@types/modules/fullcompiler/trans/transwxmltojs.d.ts +11 -0
- package/dist/@types/modules/fullcompiler/trans/transwxsstojs.d.ts +21 -0
- package/dist/@types/modules/fullcompiler/trans/wcc/index.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/trans/wxml/compilewxml.d.ts +18 -0
- package/dist/@types/modules/fullcompiler/trans/wxss/compilewxss.d.ts +11 -0
- package/dist/@types/modules/fullcompiler/utils/appconfig/appconfig.d.ts +12 -0
- package/dist/@types/modules/fullcompiler/utils/appconfig/appjson.d.ts +3 -0
- package/dist/@types/modules/fullcompiler/utils/appconfig/checkcustomcomponent.d.ts +14 -0
- package/dist/@types/modules/fullcompiler/utils/appconfig/pagejson.d.ts +3 -0
- package/dist/@types/modules/fullcompiler/utils/appconfig/wxappcodejson.d.ts +3 -0
- package/dist/@types/modules/fullcompiler/utils/filewriter/index.d.ts +14 -0
- package/dist/@types/modules/fullcompiler/utils/handleerror/errorconfig.d.ts +9 -0
- package/dist/@types/modules/fullcompiler/utils/handleerror/handleError.d.ts +3 -0
- package/dist/@types/modules/fullcompiler/utils/handleerror/parseerr.d.ts +41 -0
- package/dist/@types/modules/fullcompiler/utils/index.d.ts +4 -0
- package/dist/@types/modules/fullcompiler/utils/taskmanager.d.ts +23 -0
- package/dist/@types/modules/fullcompiler/utils/theme/index.d.ts +40 -0
- package/dist/@types/modules/fullcompiler/utils/tools.d.ts +15 -0
- package/dist/@types/modules/fullcompiler/utils/transformsourcemap.d.ts +1 -0
- package/dist/@types/modules/index.d.ts +52 -0
- package/dist/@types/modules/nativecompiler/android/adb.d.ts +7 -0
- package/dist/@types/modules/nativecompiler/android/device.d.ts +15 -0
- package/dist/@types/modules/nativecompiler/android/index.d.ts +17 -0
- package/dist/@types/modules/nativecompiler/android/projectconfig.d.ts +11 -0
- package/dist/@types/modules/nativecompiler/index.d.ts +32 -0
- package/dist/@types/modules/nativecompiler/ios/buildCloud.d.ts +56 -0
- package/dist/@types/modules/nativecompiler/ios/device.d.ts +24 -0
- package/dist/@types/modules/nativecompiler/ios/index.d.ts +52 -0
- package/dist/@types/modules/nativecompiler/ios/projectconfig.d.ts +3 -0
- package/dist/@types/modules/nativecompiler/nativeCompiler.d.ts +40 -0
- package/dist/@types/modules/nativecompiler/nativeEntryProcess.d.ts +1 -0
- package/dist/@types/modules/precompiler/conditioncompile/compiler/base.d.ts +27 -0
- package/dist/@types/modules/precompiler/conditioncompile/compiler/json.d.ts +10 -0
- package/dist/@types/modules/precompiler/conditioncompile/compiler/macro.d.ts +44 -0
- package/dist/@types/modules/precompiler/conditioncompile/compiler/plant.d.ts +10 -0
- package/dist/@types/modules/precompiler/conditioncompile/define.d.ts +18 -0
- package/dist/@types/modules/precompiler/conditioncompile/index.d.ts +24 -0
- package/dist/@types/modules/precompiler/index.d.ts +10 -0
- package/dist/@types/project/advance/precompileProject.d.ts +35 -0
- package/dist/@types/project/advance/reactiveProject.d.ts +39 -0
- package/dist/@types/project/baseProject.d.ts +74 -0
- package/dist/@types/project/ciProject.d.ts +25 -0
- package/dist/@types/project/ciProjectWithMockBuffer.d.ts +11 -0
- package/dist/@types/project/devtoolsProject.d.ts +11 -0
- package/dist/@types/project/summerCPProject.d.ts +14 -0
- package/dist/@types/project/webProject.d.ts +10 -0
- package/dist/@types/types/ci.d.ts +182 -0
- package/dist/@types/types/core.d.ts +129 -0
- package/dist/@types/types/devtools.d.ts +220 -0
- package/dist/@types/types/index.d.ts +5 -169
- package/dist/@types/types/miniapp/index.d.ts +246 -0
- package/dist/@types/types/miniprogram-json/app.d.ts +26 -11
- package/dist/@types/types/miniprogram-json/index.d.ts +1 -0
- package/dist/@types/types/miniprogram-json/page.d.ts +5 -1
- package/dist/@types/types/miniprogram-json/plugin.d.ts +6 -1
- package/dist/@types/types/miniprogram-json/projectconfig.d.ts +6 -9
- package/dist/@types/types/summer.d.ts +161 -0
- package/dist/@types/utils/babel_helper.d.ts +7 -4
- package/dist/@types/utils/babel_plugin_worklet.d.ts +0 -1
- package/dist/@types/utils/codesign.d.ts +19 -0
- package/dist/@types/utils/common.d.ts +2 -4
- package/dist/@types/utils/cp.d.ts +3 -0
- package/dist/@types/utils/customError.d.ts +22 -0
- package/dist/@types/utils/download.d.ts +1 -0
- package/dist/@types/utils/env.d.ts +2 -0
- package/dist/@types/utils/expression.d.ts +61 -0
- package/dist/@types/utils/filerules.d.ts +0 -0
- package/dist/@types/utils/fs.d.ts +3 -3
- package/dist/@types/utils/fsagent.d.ts +9 -9
- package/dist/@types/utils/generateIpa.d.ts +2 -0
- package/dist/@types/utils/helper_util.d.ts +11 -0
- package/dist/@types/utils/interruptibletask.d.ts +4 -4
- package/dist/@types/utils/jsonlint.d.ts +2 -2
- package/dist/@types/utils/locales/locales.d.ts +18 -0
- package/dist/@types/utils/locales/zh.d.ts +18 -0
- package/dist/@types/utils/log.d.ts +13 -19
- package/dist/@types/utils/messageHub.d.ts +17 -0
- package/dist/@types/utils/miniapp-builder.d.ts +68 -0
- package/dist/@types/utils/miniappJson.d.ts +151 -0
- package/dist/@types/utils/packOptionsHelper.d.ts +17 -0
- package/dist/@types/utils/progressRecorder.d.ts +14 -0
- package/dist/@types/utils/request.d.ts +4 -4
- package/dist/@types/utils/signature.d.ts +13 -0
- package/dist/@types/utils/singletontask.d.ts +29 -0
- package/dist/@types/utils/subprocess/entryProcess.d.ts +7 -0
- package/dist/@types/utils/subprocess/processManager.d.ts +25 -0
- package/dist/@types/utils/swc_config.d.ts +3 -0
- package/dist/@types/utils/swc_helper.d.ts +11 -0
- package/dist/@types/utils/taskmanager.d.ts +22 -0
- package/dist/@types/utils/taskqueue.d.ts +0 -0
- package/dist/@types/utils/taskstatus.d.ts +2 -2
- package/dist/@types/utils/tools.d.ts +16 -1
- package/dist/@types/utils/waitable.d.ts +12 -0
- package/dist/@types/utils/wxapkg/pack.d.ts +7 -0
- package/dist/@types/utils/zip.d.ts +3 -0
- package/dist/ci/checkCodeQuality.js +1 -3
- package/dist/ci/cloud/cloudapi.js +1 -0
- package/dist/ci/cloud/createTimeTrigger.js +1 -0
- package/dist/ci/cloud/uploadContainer.js +1 -0
- package/dist/ci/cloud/uploadFile.js +1 -0
- package/dist/ci/cloud/uploadFunction.js +1 -0
- package/dist/ci/cloud/utils.js +1 -0
- package/dist/ci/code-analyse.js +1 -3
- package/dist/ci/cos-upload.js +1 -3
- package/dist/ci/getCompiledResult.js +1 -3
- package/dist/ci/getDevSourceMap.js +1 -3
- package/dist/ci/getLatestVersion.js +1 -3
- package/dist/ci/getcompiler.js +1 -0
- package/dist/ci/index.js +1 -0
- package/dist/ci/jsserver.js +1 -3
- package/dist/ci/preview.js +1 -3
- package/dist/ci/project.js +1 -3
- package/dist/ci/projectattr.js +1 -3
- package/dist/ci/upload.js +1 -3
- package/dist/ci/utils/codeDenpendencyQualityChecker.js +1 -3
- package/dist/ci/utils/filterUnusedFile.js +1 -3
- package/dist/ci/utils/pack.js +1 -3
- package/dist/ci/utils/packfile.js +1 -3
- package/dist/ci/utils/qualitycheckoption.js +1 -3
- package/dist/ci/utils/terminalQrcode.js +1 -3
- package/dist/ci/utils/tools.js +1 -0
- package/dist/cli/index.js +1 -0
- package/dist/common/cloud-api/index.js +279 -0
- package/dist/common/cloud-api/src/apis/apis.js +1 -0
- package/dist/common/cloud-api/src/apis/cdn/cdn.apis.js +1 -0
- package/dist/common/cloud-api/src/apis/cdn/index.js +1 -0
- package/dist/common/cloud-api/src/apis/flexdb/flexdb.apis.js +1 -0
- package/dist/common/cloud-api/src/apis/flexdb/index.js +1 -0
- package/dist/common/cloud-api/src/apis/scf/index.js +1 -0
- package/dist/common/cloud-api/src/apis/scf/scf.apis.js +1 -0
- package/dist/common/cloud-api/src/apis/ssl/index.js +1 -0
- package/dist/common/cloud-api/src/apis/ssl/ssl.apis.js +1 -0
- package/dist/common/cloud-api/src/apis/tcb/general.apis.js +1 -0
- package/dist/common/cloud-api/src/apis/tcb/index.js +1 -0
- package/dist/common/cloud-api/src/apis/tcb/tcb.apis.js +1 -0
- package/dist/common/cloud-api/src/index.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/account.contracts.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/cdn.contracts.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/contracts.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/factory.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/flexdb.contracts.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/lowcode.contracts.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/scf.contracts.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/ssl.contracts.js +1 -0
- package/dist/common/cloud-api/src/transaction/contracts/tcb.contracts.js +1 -0
- package/dist/common/cloud-api/src/transaction/transactor.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/account.validations.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/cdn.validations.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/common.validations.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/flexdb.validations.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/lowcode.validations.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/scf.validations.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/ssl.validations.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/tcb.validations.js +1 -0
- package/dist/common/cloud-api/src/transaction/validations/validations.js +1 -0
- package/dist/common/cloud-api/src/utils/common.js +1 -0
- package/dist/common/cloud-api/src/utils/validator.js +1 -0
- package/dist/common/code-analyse/index.js +2 -0
- package/dist/config/compiletype.config.js +1 -0
- package/dist/config/config.js +1 -0
- package/dist/config/define.js +1 -0
- package/dist/config/url.config.js +1 -0
- package/dist/index.js +1 -3
- package/dist/manifest.json +2 -2
- package/dist/modules/corecompiler/baseCompiler.js +1 -0
- package/dist/modules/corecompiler/original/analyse/partial.js +1 -0
- package/dist/modules/corecompiler/original/compile/common.js +1 -0
- package/dist/modules/corecompiler/original/compile/game.js +1 -0
- package/dist/modules/corecompiler/original/compile/gamePlugin.js +1 -0
- package/dist/modules/corecompiler/original/compile/handler/js.js +1 -0
- package/dist/modules/corecompiler/original/compile/handler/mpjson.js +1 -0
- package/dist/modules/corecompiler/original/compile/handler/wxml.js +1 -0
- package/dist/modules/corecompiler/original/compile/handler/wxss.js +1 -0
- package/dist/modules/corecompiler/original/compile/index.js +1 -0
- package/dist/modules/corecompiler/original/compile/miniprogram.js +1 -0
- package/dist/modules/corecompiler/original/compile/miniprogramPlugin.js +1 -0
- package/dist/modules/corecompiler/original/index.js +1 -0
- package/dist/modules/corecompiler/original/js/enhance.js +1 -0
- package/dist/modules/corecompiler/original/js/es6Transform.js +1 -0
- package/dist/modules/corecompiler/original/js/index.js +1 -0
- package/dist/modules/corecompiler/original/js/minifyjs.js +1 -0
- package/dist/modules/corecompiler/original/js/minifyjsAfterWrap.js +1 -0
- package/dist/modules/corecompiler/original/js/workletCompile.js +1 -0
- package/dist/modules/corecompiler/original/json/app/appJSON.js +1 -0
- package/dist/modules/corecompiler/original/json/app/checkAppFields.js +1 -0
- package/dist/modules/corecompiler/original/json/app/extJSON.js +1 -0
- package/dist/modules/corecompiler/original/json/app/index.js +1 -0
- package/dist/modules/corecompiler/original/json/common.js +1 -0
- package/dist/modules/corecompiler/original/json/game.js +1 -0
- package/dist/modules/corecompiler/original/json/page/checkPageJSON.js +1 -0
- package/dist/modules/corecompiler/original/json/page/getPageJSON.js +1 -0
- package/dist/modules/corecompiler/original/json/plugin/plugin.js +1 -0
- package/dist/modules/corecompiler/original/json/plugin/pluginPage.js +1 -0
- package/dist/modules/corecompiler/original/json/projectconfig.js +1 -0
- package/dist/modules/corecompiler/original/json/reactiveCache.js +1 -0
- package/dist/modules/corecompiler/original/json/signaturejson.js +1 -0
- package/dist/modules/corecompiler/original/json/sitemap.js +1 -0
- package/dist/modules/corecompiler/original/json/theme.js +1 -0
- package/dist/modules/corecompiler/original/npm/filterdeps.js +1 -0
- package/dist/modules/corecompiler/original/npm/packnpm.js +1 -0
- package/dist/modules/corecompiler/original/protect/fileFlatter.js +1 -0
- package/dist/modules/corecompiler/original/protect/uglifyfilenames.js +1 -0
- package/dist/modules/corecompiler/original/utils/env.js +1 -0
- package/dist/modules/corecompiler/original/utils/logger.js +1 -0
- package/dist/modules/corecompiler/original/validate/appjson.js +1 -0
- package/dist/modules/corecompiler/original/validate/extjson.js +1 -0
- package/dist/modules/corecompiler/original/validate/gamejson.js +1 -0
- package/dist/modules/corecompiler/original/validate/gamepluginjson.js +1 -0
- package/dist/modules/corecompiler/original/validate/pagejson.js +1 -0
- package/dist/modules/corecompiler/original/validate/pluginjson.js +1 -0
- package/dist/modules/corecompiler/original/validate/pluginpagejson.js +1 -0
- package/dist/modules/corecompiler/original/validate/projectconfig.js +1 -0
- package/dist/modules/corecompiler/original/validate/schemaValidate.js +1 -0
- package/dist/modules/corecompiler/original/validate/signaturejson.js +1 -0
- package/dist/modules/corecompiler/original/validate/sitemapjson.js +1 -0
- package/dist/modules/corecompiler/original/validate/validate.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/childprocess.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/childprocessManager.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/fork.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/index.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/task/compilejs.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/task/compilewxss.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/task/minifywxml.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/worker.js +1 -0
- package/dist/modules/corecompiler/original/workerThread/workerManager.js +1 -0
- package/dist/modules/corecompiler/originalCompiler.js +1 -0
- package/dist/modules/corecompiler/summer/graph/appconf.js +1 -0
- package/dist/modules/corecompiler/summer/graph/appgraph.js +1 -0
- package/dist/modules/corecompiler/summer/graph/baseconf.js +1 -0
- package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -0
- package/dist/modules/corecompiler/summer/graph/gameconf.js +1 -0
- package/dist/modules/corecompiler/summer/graph/gamegraph.js +1 -0
- package/dist/modules/corecompiler/summer/graph/gamepluginconf.js +1 -0
- package/dist/modules/corecompiler/summer/graph/gameplugingraph.js +1 -0
- package/dist/modules/corecompiler/summer/graph/pluginconf.js +1 -0
- package/dist/modules/corecompiler/summer/graph/plugingraph.js +1 -0
- package/dist/modules/corecompiler/summer/graph/util.js +1 -0
- package/dist/modules/corecompiler/summer/index.js +1 -0
- package/dist/modules/corecompiler/summer/initPlugin.js +1 -0
- package/dist/modules/corecompiler/summer/module.js +1 -0
- package/dist/modules/corecompiler/summer/persistCache.js +1 -0
- package/dist/modules/corecompiler/summer/pluginDriver.js +1 -0
- package/dist/modules/corecompiler/summer/pluginconfig.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/base/es6module.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/base/javascript.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/base/swc.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/base/wxss.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/enhance.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/index.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/less.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/minifywxml.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/sass.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/terser.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/typescript.js +1 -0
- package/dist/modules/corecompiler/summer/plugins/worklet.js +1 -0
- package/dist/modules/corecompiler/summer/resolver.js +1 -0
- package/dist/modules/corecompiler/summer/summer.js +1 -0
- package/dist/modules/corecompiler/summer/utils/async.js +1 -0
- package/dist/modules/corecompiler/summer/utils/ensureArray.js +1 -0
- package/dist/modules/corecompiler/summer/utils/inputsourcemap.js +1 -0
- package/dist/modules/corecompiler/summer/worker.js +1 -0
- package/dist/modules/corecompiler/summerCompiler.js +1 -0
- package/dist/modules/corecompiler/summerEntryProcess.js +1 -0
- package/dist/modules/createSummer.js +1 -0
- package/dist/modules/fullcompiler/app/app.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/originalcontactbase64.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/originallaunchbase64.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.js +1 -0
- package/dist/modules/fullcompiler/appservice/appservice.config.js +1 -0
- package/dist/modules/fullcompiler/appservice/generatecode.utils.js +1 -0
- package/dist/modules/fullcompiler/appservice/getappservice.js +1 -0
- package/dist/modules/fullcompiler/appservice/getcompiledjs.js +1 -0
- package/dist/modules/fullcompiler/appservice/getjsfile.js +1 -0
- package/dist/modules/fullcompiler/appservice/getmainpkgsortedjsfiles.js +1 -0
- package/dist/modules/fullcompiler/appservice/getsubpackage.js +1 -0
- package/dist/modules/fullcompiler/appservice/getsubpkgsortedjsfiles.js +1 -0
- package/dist/modules/fullcompiler/appservice/getwxappcode.js +1 -0
- package/dist/modules/fullcompiler/config/apperrcode.config.js +1 -0
- package/dist/modules/fullcompiler/filerules.js +1 -0
- package/dist/modules/fullcompiler/getallrawfiles.js +1 -0
- package/dist/modules/fullcompiler/getallwmltohtmlmap.js +1 -0
- package/dist/modules/fullcompiler/index.js +1 -0
- package/dist/modules/fullcompiler/pageframe/getsubpackage.js +1 -0
- package/dist/modules/fullcompiler/pageframe/getwxappcode.js +1 -0
- package/dist/modules/fullcompiler/pageframe/index.js +1 -0
- package/dist/modules/fullcompiler/trans/transwxmltojs.js +1 -0
- package/dist/modules/fullcompiler/trans/transwxsstojs.js +1 -0
- package/dist/modules/fullcompiler/trans/wcc/build/darwin_arm64/wcc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/darwin_arm64/wcsc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/darwin_x64/wcc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/darwin_x64/wcsc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_arm64_release/wcc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_arm64_release/wcsc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_x64_release/wcc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_x64_release/wcsc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/win32_ia32/wcc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/win32_ia32/wcsc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/win32_x64/wcc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/build/win32_x64/wcsc.node +0 -0
- package/dist/modules/fullcompiler/trans/wcc/index.js +1 -0
- package/dist/modules/fullcompiler/trans/wcc/lib/addonVersion.js +19 -0
- package/dist/modules/fullcompiler/trans/wcc/lib/index.js +4 -0
- package/dist/modules/fullcompiler/trans/wcc/lib/util.js +1134 -0
- package/dist/modules/fullcompiler/trans/wcc/lib/wcc.js +94 -0
- package/dist/modules/fullcompiler/trans/wcc/lib/wcsc.js +93 -0
- package/dist/modules/fullcompiler/trans/wxml/compilewxml.js +1 -0
- package/dist/modules/fullcompiler/trans/wxss/compilewxss.js +1 -0
- package/dist/modules/fullcompiler/utils/appconfig/appconfig.js +1 -0
- package/dist/modules/fullcompiler/utils/appconfig/appjson.js +1 -0
- package/dist/modules/fullcompiler/utils/appconfig/checkcustomcomponent.js +1 -0
- package/dist/modules/fullcompiler/utils/appconfig/pagejson.js +1 -0
- package/dist/modules/fullcompiler/utils/appconfig/wxappcodejson.js +1 -0
- package/dist/modules/fullcompiler/utils/filewriter/index.js +1 -0
- package/dist/modules/fullcompiler/utils/handleerror/errorconfig.js +1 -0
- package/dist/modules/fullcompiler/utils/handleerror/handleError.js +1 -0
- package/dist/modules/fullcompiler/utils/handleerror/parseerr.js +1 -0
- package/dist/modules/fullcompiler/utils/index.js +1 -0
- package/dist/modules/fullcompiler/utils/taskmanager.js +1 -0
- package/dist/modules/fullcompiler/utils/theme/index.js +1 -0
- package/dist/modules/fullcompiler/utils/tools.js +1 -0
- package/dist/modules/fullcompiler/utils/transformsourcemap.js +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/modules/nativecompiler/android/adb.js +1 -0
- package/dist/modules/nativecompiler/android/device.js +1 -0
- package/dist/modules/nativecompiler/android/index.js +1 -0
- package/dist/modules/nativecompiler/android/projectconfig.js +1 -0
- package/dist/modules/nativecompiler/index.js +1 -0
- package/dist/modules/nativecompiler/ios/buildCloud.js +1 -0
- package/dist/modules/nativecompiler/ios/device.js +1 -0
- package/dist/modules/nativecompiler/ios/index.js +1 -0
- package/dist/modules/nativecompiler/ios/projectconfig.js +1 -0
- package/dist/modules/nativecompiler/nativeCompiler.js +1 -0
- package/dist/modules/nativecompiler/nativeEntryProcess.js +1 -0
- package/dist/modules/precompiler/conditioncompile/compiler/base.js +1 -0
- package/dist/modules/precompiler/conditioncompile/compiler/json.js +1 -0
- package/dist/modules/precompiler/conditioncompile/compiler/macro.js +1 -0
- package/dist/modules/precompiler/conditioncompile/compiler/plant.js +1 -0
- package/dist/modules/precompiler/conditioncompile/define.js +1 -0
- package/dist/modules/precompiler/conditioncompile/index.js +1 -0
- package/dist/modules/precompiler/index.js +1 -0
- package/dist/project/advance/precompileProject.js +1 -0
- package/dist/project/advance/reactiveProject.js +1 -0
- package/dist/project/baseProject.js +1 -0
- package/dist/project/ciProject.js +1 -0
- package/dist/project/ciProjectWithMockBuffer.js +1 -0
- package/dist/project/devtoolsProject.js +1 -0
- package/dist/project/summerCPProject.js +1 -0
- package/dist/project/webProject.js +1 -0
- package/dist/schema/dist/app.js +2221 -0
- package/dist/schema/dist/ext.js +1088 -0
- package/dist/schema/dist/game.js +211 -0
- package/dist/schema/dist/page.js +516 -0
- package/dist/schema/dist/plugin.js +53 -0
- package/dist/schema/dist/pluginpage.js +14 -0
- package/dist/schema/dist/projectconfig.js +655 -0
- package/dist/schema/dist/projectprivateconfig.js +371 -0
- package/dist/schema/dist/sitemap.js +53 -0
- package/dist/schema/dist/theme.js +20 -0
- package/dist/static/images/donut-icon1024x1024.png +0 -0
- package/dist/static/images/donut-icon120x120.png +0 -0
- package/dist/static/images/donut-icon152x152.png +0 -0
- package/dist/static/images/donut-icon167x167.png +0 -0
- package/dist/static/scripts/assetsCar/Assets.xcassets/AppIcon.appiconset/Contents.json +119 -0
- package/dist/static/scripts/assetsCar/Assets.xcassets/Contents.json +6 -0
- package/dist/static/scripts/assetsCar/Assets.xcassets/disconnect.imageset/Contents.json +21 -0
- package/dist/static/scripts/assetsCar/Assets.xcassets/disconnect.imageset/disconnect.png +0 -0
- package/dist/static/scripts/assetsCar/createAssetsCar +9 -0
- package/dist/static/scripts/checkXcodeEnv +18 -0
- package/dist/static/scripts/resignIpa +269 -0
- package/dist/types/ci.js +1 -0
- package/dist/types/core.js +1 -0
- package/dist/types/devtools.js +1 -0
- package/dist/types/index.js +1 -3
- package/dist/types/miniapp/index.js +1 -0
- package/dist/types/miniprogram-json/app.js +1 -3
- package/dist/types/miniprogram-json/base.js +1 -3
- package/dist/types/miniprogram-json/ext.js +1 -3
- package/dist/types/miniprogram-json/game.js +1 -3
- package/dist/types/miniprogram-json/index.js +1 -3
- package/dist/types/miniprogram-json/page.js +1 -3
- package/dist/types/miniprogram-json/plugin.js +1 -3
- package/dist/types/miniprogram-json/projectconfig.js +1 -3
- package/dist/types/miniprogram-json/sitemap.js +1 -3
- package/dist/types/miniprogram-json/theme.js +1 -3
- package/dist/types/summer.js +1 -0
- package/dist/utils/babel_helper.js +1 -3
- package/dist/utils/babel_plugin_worklet.js +1 -3
- package/dist/utils/babel_transform_plugin.js +1 -3
- package/dist/utils/cache.js +1 -3
- package/dist/utils/codesign.js +1 -0
- package/dist/utils/common.js +1 -3
- package/dist/utils/cp.js +1 -0
- package/dist/utils/customError.js +1 -0
- package/dist/utils/download.js +1 -0
- package/dist/utils/env.js +1 -0
- package/dist/utils/error.js +1 -3
- package/dist/utils/expression.js +1 -0
- package/dist/utils/filerules.js +1 -0
- package/dist/utils/fs.js +1 -3
- package/dist/utils/fsagent.js +1 -3
- package/dist/utils/generateIpa.js +1 -0
- package/dist/utils/glob.js +1 -3
- package/dist/utils/hackrequire/fs.js +1 -1
- package/dist/utils/hackrequire/module.js +1 -1
- package/dist/utils/helper_util.js +1 -0
- package/dist/utils/interruptibletask.js +1 -3
- package/dist/utils/jsonParse.js +1 -3
- package/dist/utils/jsonlint.js +1 -3
- package/dist/utils/locales/en.js +1 -3
- package/dist/utils/locales/fomatable_string.js +1 -3
- package/dist/utils/locales/locales.js +1 -3
- package/dist/utils/locales/zh.js +1 -3
- package/dist/utils/log.js +1 -3
- package/dist/utils/messageHub.js +1 -0
- package/dist/utils/miniapp-builder.js +1 -0
- package/dist/utils/miniappJson.js +1 -0
- package/dist/utils/packOptionsHelper.js +1 -0
- package/dist/utils/progressRecorder.js +1 -0
- package/dist/utils/report.js +1 -3
- package/dist/utils/request.js +1 -3
- package/dist/utils/sign.js +1 -3
- package/dist/utils/signature.js +1 -0
- package/dist/utils/singletontask.js +1 -0
- package/dist/utils/subprocess/entryProcess.js +1 -0
- package/dist/utils/subprocess/processManager.js +1 -0
- package/dist/utils/swc_config.js +1 -0
- package/dist/utils/swc_helper.js +1 -0
- package/dist/utils/taskmanager.js +1 -0
- package/dist/utils/taskqueue.js +1 -0
- package/dist/utils/taskstatus.js +1 -3
- package/dist/utils/tools.js +1 -3
- package/dist/utils/waitable.js +1 -0
- package/dist/utils/white_ext_list.js +1 -3
- package/dist/utils/wxapkg/pack.js +1 -0
- package/dist/utils/wxvpkgreader/wxvpkg/unpack/version0.js +1 -1
- package/dist/utils/wxvpkgreader/wxvpkg/unpack/version10.js +1 -1
- package/dist/utils/wxvpkgreader/wxvpkgreader.js +1 -1
- package/dist/utils/zip.js +1 -0
- package/dist/vendor/ios-deploy/ios-deploy +0 -0
- package/dist/vendor/swc_runtime/_apply_decorated_descriptor.js +1 -0
- package/dist/vendor/swc_runtime/_apply_decs_2203_r.js +1 -0
- package/dist/vendor/swc_runtime/_array_like_to_array.js +1 -0
- package/dist/vendor/swc_runtime/_array_with_holes.js +1 -0
- package/dist/vendor/swc_runtime/_array_without_holes.js +1 -0
- package/dist/vendor/swc_runtime/_assert_this_initialized.js +1 -0
- package/dist/vendor/swc_runtime/_async_generator.js +1 -0
- package/dist/vendor/swc_runtime/_async_generator_delegate.js +1 -0
- package/dist/vendor/swc_runtime/_async_iterator.js +1 -0
- package/dist/vendor/swc_runtime/_async_to_generator.js +1 -0
- package/dist/vendor/swc_runtime/_await_async_generator.js +1 -0
- package/dist/vendor/swc_runtime/_await_value.js +1 -0
- package/dist/vendor/swc_runtime/_check_private_redeclaration.js +1 -0
- package/dist/vendor/swc_runtime/_class_apply_descriptor_destructure.js +1 -0
- package/dist/vendor/swc_runtime/_class_apply_descriptor_get.js +1 -0
- package/dist/vendor/swc_runtime/_class_apply_descriptor_set.js +1 -0
- package/dist/vendor/swc_runtime/_class_apply_descriptor_update.js +1 -0
- package/dist/vendor/swc_runtime/_class_call_check.js +1 -0
- package/dist/vendor/swc_runtime/_class_check_private_static_access.js +1 -0
- package/dist/vendor/swc_runtime/_class_check_private_static_field_descriptor.js +1 -0
- package/dist/vendor/swc_runtime/_class_extract_field_descriptor.js +1 -0
- package/dist/vendor/swc_runtime/_class_name_tdz_error.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_field_destructure.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_field_get.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_field_init.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_field_loose_base.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_field_loose_key.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_field_set.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_field_update.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_method_get.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_method_init.js +1 -0
- package/dist/vendor/swc_runtime/_class_private_method_set.js +1 -0
- package/dist/vendor/swc_runtime/_class_static_private_field_destructure.js +1 -0
- package/dist/vendor/swc_runtime/_class_static_private_field_spec_get.js +1 -0
- package/dist/vendor/swc_runtime/_class_static_private_field_spec_set.js +1 -0
- package/dist/vendor/swc_runtime/_class_static_private_field_update.js +1 -0
- package/dist/vendor/swc_runtime/_class_static_private_method_get.js +1 -0
- package/dist/vendor/swc_runtime/_construct.js +1 -0
- package/dist/vendor/swc_runtime/_create_class.js +1 -0
- package/dist/vendor/swc_runtime/_create_for_of_iterator_helper_loose.js +1 -0
- package/dist/vendor/swc_runtime/_create_super.js +1 -0
- package/dist/vendor/swc_runtime/_decorate.js +1 -0
- package/dist/vendor/swc_runtime/_defaults.js +1 -0
- package/dist/vendor/swc_runtime/_define_enumerable_properties.js +1 -0
- package/dist/vendor/swc_runtime/_define_property.js +1 -0
- package/dist/vendor/swc_runtime/_dispose.js +1 -0
- package/dist/vendor/swc_runtime/_export_star.js +1 -0
- package/dist/vendor/swc_runtime/_extends.js +1 -0
- package/dist/vendor/swc_runtime/_get.js +1 -0
- package/dist/vendor/swc_runtime/_get_prototype_of.js +1 -0
- package/dist/vendor/swc_runtime/_identity.js +1 -0
- package/dist/vendor/swc_runtime/_inherits.js +1 -0
- package/dist/vendor/swc_runtime/_inherits_loose.js +1 -0
- package/dist/vendor/swc_runtime/_initializer_define_property.js +1 -0
- package/dist/vendor/swc_runtime/_initializer_warning_helper.js +1 -0
- package/dist/vendor/swc_runtime/_instanceof.js +1 -0
- package/dist/vendor/swc_runtime/_interop_require_default.js +1 -0
- package/dist/vendor/swc_runtime/_interop_require_wildcard.js +1 -0
- package/dist/vendor/swc_runtime/_is_native_function.js +1 -0
- package/dist/vendor/swc_runtime/_is_native_reflect_construct.js +1 -0
- package/dist/vendor/swc_runtime/_iterable_to_array.js +1 -0
- package/dist/vendor/swc_runtime/_iterable_to_array_limit.js +1 -0
- package/dist/vendor/swc_runtime/_iterable_to_array_limit_loose.js +1 -0
- package/dist/vendor/swc_runtime/_jsx.js +1 -0
- package/dist/vendor/swc_runtime/_new_arrow_check.js +1 -0
- package/dist/vendor/swc_runtime/_non_iterable_rest.js +1 -0
- package/dist/vendor/swc_runtime/_non_iterable_spread.js +1 -0
- package/dist/vendor/swc_runtime/_object_destructuring_empty.js +1 -0
- package/dist/vendor/swc_runtime/_object_spread.js +1 -0
- package/dist/vendor/swc_runtime/_object_spread_props.js +1 -0
- package/dist/vendor/swc_runtime/_object_without_properties.js +1 -0
- package/dist/vendor/swc_runtime/_object_without_properties_loose.js +1 -0
- package/dist/vendor/swc_runtime/_possible_constructor_return.js +1 -0
- package/dist/vendor/swc_runtime/_read_only_error.js +1 -0
- package/dist/vendor/swc_runtime/_set.js +1 -0
- package/dist/vendor/swc_runtime/_set_prototype_of.js +1 -0
- package/dist/vendor/swc_runtime/_skip_first_generator_next.js +1 -0
- package/dist/vendor/swc_runtime/_sliced_to_array.js +1 -0
- package/dist/vendor/swc_runtime/_sliced_to_array_loose.js +1 -0
- package/dist/vendor/swc_runtime/_super_prop_base.js +1 -0
- package/dist/vendor/swc_runtime/_tagged_template_literal.js +1 -0
- package/dist/vendor/swc_runtime/_tagged_template_literal_loose.js +1 -0
- package/dist/vendor/swc_runtime/_throw.js +1 -0
- package/dist/vendor/swc_runtime/_to_array.js +1 -0
- package/dist/vendor/swc_runtime/_to_consumable_array.js +1 -0
- package/dist/vendor/swc_runtime/_to_primitive.js +1 -0
- package/dist/vendor/swc_runtime/_to_property_key.js +1 -0
- package/dist/vendor/swc_runtime/_ts_decorate.js +1 -0
- package/dist/vendor/swc_runtime/_ts_generator.js +1 -0
- package/dist/vendor/swc_runtime/_ts_metadata.js +1 -0
- package/dist/vendor/swc_runtime/_ts_param.js +1 -0
- package/dist/vendor/swc_runtime/_ts_values.js +1 -0
- package/dist/vendor/swc_runtime/_type_of.js +1 -0
- package/dist/vendor/swc_runtime/_unsupported_iterable_to_array.js +1 -0
- package/dist/vendor/swc_runtime/_update.js +1 -0
- package/dist/vendor/swc_runtime/_using.js +1 -0
- package/dist/vendor/swc_runtime/_wrap_async_generator.js +1 -0
- package/dist/vendor/swc_runtime/_wrap_native_super.js +1 -0
- package/dist/vendor/swc_runtime/_write_only_error.js +1 -0
- package/dist/vendor/swc_runtime/index.js +1 -0
- package/package.json +45 -10
- package/dist/@types/cloud/cloudapi.d.ts +0 -7
- package/dist/@types/cloud/createTimeTrigger.d.ts +0 -13
- package/dist/@types/cloud/uploadContainer.d.ts +0 -71
- package/dist/@types/cloud/uploadFile.d.ts +0 -9
- package/dist/@types/cloud/uploadFunction.d.ts +0 -13
- package/dist/@types/cloud/utils.d.ts +0 -17
- package/dist/@types/config.d.ts +0 -78
- package/dist/@types/core/analyse/partial.d.ts +0 -25
- package/dist/@types/core/compile/common.d.ts +0 -17
- package/dist/@types/core/compile/game.d.ts +0 -5
- package/dist/@types/core/compile/game_plugin.d.ts +0 -8
- package/dist/@types/core/compile/handler/js.d.ts +0 -15
- package/dist/@types/core/compile/handler/mpjson.d.ts +0 -10
- package/dist/@types/core/compile/handler/wxml.d.ts +0 -9
- package/dist/@types/core/compile/handler/wxss.d.ts +0 -10
- package/dist/@types/core/compile/index.d.ts +0 -5
- package/dist/@types/core/compile/mini_program.d.ts +0 -5
- package/dist/@types/core/compile/mini_program_plugin.d.ts +0 -8
- package/dist/@types/core/js/index.d.ts +0 -3
- package/dist/@types/core/js/minifyjs.d.ts +0 -16
- package/dist/@types/core/js/minifyjs_after_wrap.d.ts +0 -12
- package/dist/@types/core/json/app/checkAppFields.d.ts +0 -42
- package/dist/@types/core/json/app/getAppJSON.d.ts +0 -10
- package/dist/@types/core/json/app/getExtJSON.d.ts +0 -5
- package/dist/@types/core/json/app/index.d.ts +0 -5
- package/dist/@types/core/json/common.d.ts +0 -20
- package/dist/@types/core/json/game.d.ts +0 -6
- package/dist/@types/core/json/page/checkPageJSON.d.ts +0 -6
- package/dist/@types/core/json/page/getPageJSON.d.ts +0 -10
- package/dist/@types/core/json/plugin/plugin.d.ts +0 -14
- package/dist/@types/core/json/plugin/plugin_page.d.ts +0 -9
- package/dist/@types/core/json/projectWithMockBuffer.d.ts +0 -14
- package/dist/@types/core/json/projectconfig.d.ts +0 -3
- package/dist/@types/core/json/reactiveCache.d.ts +0 -63
- package/dist/@types/core/json/signaturejson.d.ts +0 -21
- package/dist/@types/core/json/sitemap.d.ts +0 -5
- package/dist/@types/core/json/theme.d.ts +0 -20
- package/dist/@types/core/npm/packnpm.d.ts +0 -17
- package/dist/@types/core/protect/uglifyfilenames.d.ts +0 -9
- package/dist/@types/core/utils/env.d.ts +0 -6
- package/dist/@types/core/validate/appjson.d.ts +0 -3
- package/dist/@types/core/validate/extjson.d.ts +0 -3
- package/dist/@types/core/validate/gamejson.d.ts +0 -3
- package/dist/@types/core/validate/gamepluginjson.d.ts +0 -3
- package/dist/@types/core/validate/pagejson.d.ts +0 -3
- package/dist/@types/core/validate/pluginjson.d.ts +0 -3
- package/dist/@types/core/validate/pluginpagejson.d.ts +0 -3
- package/dist/@types/core/validate/projectconfig.d.ts +0 -3
- package/dist/@types/core/validate/schemaValidate.d.ts +0 -7
- package/dist/@types/core/validate/signaturejson.d.ts +0 -3
- package/dist/@types/core/validate/sitemapjson.d.ts +0 -3
- package/dist/@types/core/worker_thread/childprocess_manager.d.ts +0 -16
- package/dist/@types/core/worker_thread/index.d.ts +0 -4
- package/dist/@types/core/worker_thread/task/compilejs.d.ts +0 -43
- package/dist/@types/core/worker_thread/task/compilewxss.d.ts +0 -21
- package/dist/@types/core/worker_thread/task/index.d.ts +0 -28
- package/dist/@types/core/worker_thread/task/minifywxml.d.ts +0 -46
- package/dist/@types/core/worker_thread/worker_manager.d.ts +0 -19
- package/dist/@types/core.d.ts +0 -26
- package/dist/@types/summer/ci.d.ts +0 -3
- package/dist/@types/summer/devtool.d.ts +0 -254
- package/dist/@types/summer/error.d.ts +0 -22
- package/dist/@types/summer/graph/appconf.d.ts +0 -25
- package/dist/@types/summer/graph/appgraph.d.ts +0 -25
- package/dist/@types/summer/graph/basegraph.d.ts +0 -64
- package/dist/@types/summer/graph/pluginconf.d.ts +0 -19
- package/dist/@types/summer/graph/plugingraph.d.ts +0 -22
- package/dist/@types/summer/index.d.ts +0 -1
- package/dist/@types/summer/initPlugin.d.ts +0 -2
- package/dist/@types/summer/module.d.ts +0 -42
- package/dist/@types/summer/persist_cache.d.ts +0 -12
- package/dist/@types/summer/plugin_driver.d.ts +0 -45
- package/dist/@types/summer/plugins/base/es6module.d.ts +0 -18
- package/dist/@types/summer/plugins/base/javascript.d.ts +0 -3
- package/dist/@types/summer/plugins/base/wxss.d.ts +0 -6
- package/dist/@types/summer/plugins/enhance.d.ts +0 -4
- package/dist/@types/summer/plugins/less.d.ts +0 -5
- package/dist/@types/summer/plugins/minifywxml.d.ts +0 -5
- package/dist/@types/summer/plugins/sass.d.ts +0 -3
- package/dist/@types/summer/plugins/terser.d.ts +0 -2
- package/dist/@types/summer/plugins/typescript.d.ts +0 -2
- package/dist/@types/summer/plugins/worklet.d.ts +0 -4
- package/dist/@types/summer/project.d.ts +0 -47
- package/dist/@types/summer/recorder.d.ts +0 -12
- package/dist/@types/summer/resolver.d.ts +0 -28
- package/dist/@types/summer/summer.d.ts +0 -32
- package/dist/@types/summer/types.d.ts +0 -164
- package/dist/@types/summer/utils/ensureArray.d.ts +0 -1
- package/dist/@types/summer/worker.d.ts +0 -16
- package/dist/@types/utils/url_config.d.ts +0 -19
- package/dist/@types/vendor/cloud-api/src/apis/tcb/tcb.apis.d.ts +0 -162
- package/dist/@types/vendor/cloud-api/src/transaction/contracts/contracts.d.ts +0 -7
- package/dist/@types/vendor/cloud-api/src/transaction/contracts/tcb.contracts.d.ts +0 -165
- package/dist/@types/vendor/cloud-api/src/transaction/validations/common.validations.d.ts +0 -106
- package/dist/@types/vendor/cloud-api/src/transaction/validations/tcb.validations.d.ts +0 -170
- package/dist/@types/vendor/cloud-api/src/transaction/validations/validations.d.ts +0 -6
- package/dist/@types/vendor/code-analyse/index.d.ts +0 -374
- package/dist/cli.js +0 -3
- package/dist/cloud/cloudapi.js +0 -3
- package/dist/cloud/createTimeTrigger.js +0 -3
- package/dist/cloud/uploadContainer.js +0 -3
- package/dist/cloud/uploadFile.js +0 -3
- package/dist/cloud/uploadFunction.js +0 -3
- package/dist/cloud/utils.js +0 -3
- package/dist/config.js +0 -3
- package/dist/core/analyse/partial.js +0 -3
- package/dist/core/compile/common.js +0 -3
- package/dist/core/compile/game.js +0 -3
- package/dist/core/compile/game_plugin.js +0 -3
- package/dist/core/compile/handler/js.js +0 -3
- package/dist/core/compile/handler/mpjson.js +0 -3
- package/dist/core/compile/handler/wxml.js +0 -3
- package/dist/core/compile/handler/wxss.js +0 -3
- package/dist/core/compile/index.js +0 -3
- package/dist/core/compile/mini_program.js +0 -3
- package/dist/core/compile/mini_program_plugin.js +0 -3
- package/dist/core/js/enhance.js +0 -1
- package/dist/core/js/es6_transform.js +0 -1
- package/dist/core/js/index.js +0 -1
- package/dist/core/js/minifyjs.js +0 -1
- package/dist/core/js/minifyjs_after_wrap.js +0 -1
- package/dist/core/js/workletCompile.js +0 -1
- package/dist/core/json/app/checkAppFields.js +0 -3
- package/dist/core/json/app/getAppJSON.js +0 -3
- package/dist/core/json/app/getExtJSON.js +0 -3
- package/dist/core/json/app/index.js +0 -3
- package/dist/core/json/common.js +0 -3
- package/dist/core/json/game.js +0 -3
- package/dist/core/json/page/checkPageJSON.js +0 -3
- package/dist/core/json/page/getPageJSON.js +0 -3
- package/dist/core/json/plugin/plugin.js +0 -3
- package/dist/core/json/plugin/plugin_page.js +0 -3
- package/dist/core/json/projectWithMockBuffer.js +0 -3
- package/dist/core/json/projectconfig.js +0 -3
- package/dist/core/json/reactiveCache.js +0 -3
- package/dist/core/json/signaturejson.js +0 -3
- package/dist/core/json/sitemap.js +0 -3
- package/dist/core/json/theme.js +0 -3
- package/dist/core/npm/filterdeps.js +0 -3
- package/dist/core/npm/packnpm.js +0 -3
- package/dist/core/protect/file_flatter.js +0 -3
- package/dist/core/protect/uglifyfilenames.js +0 -3
- package/dist/core/utils/env.js +0 -3
- package/dist/core/utils/logger.js +0 -3
- package/dist/core/validate/appjson.js +0 -1
- package/dist/core/validate/extjson.js +0 -1
- package/dist/core/validate/gamejson.js +0 -1
- package/dist/core/validate/gamepluginjson.js +0 -1
- package/dist/core/validate/pagejson.js +0 -1
- package/dist/core/validate/pluginjson.js +0 -1
- package/dist/core/validate/pluginpagejson.js +0 -1
- package/dist/core/validate/projectconfig.js +0 -1
- package/dist/core/validate/schemaValidate.js +0 -1
- package/dist/core/validate/signaturejson.js +0 -1
- package/dist/core/validate/sitemapjson.js +0 -1
- package/dist/core/validate/validate.js +0 -1
- package/dist/core/worker_thread/childprocess.js +0 -1
- package/dist/core/worker_thread/childprocess_manager.js +0 -1
- package/dist/core/worker_thread/fork.js +0 -1
- package/dist/core/worker_thread/index.js +0 -1
- package/dist/core/worker_thread/task/compilejs.js +0 -1
- package/dist/core/worker_thread/task/compilewxss.js +0 -1
- package/dist/core/worker_thread/task/minifywxml.js +0 -1
- package/dist/core/worker_thread/worker.js +0 -1
- package/dist/core/worker_thread/worker_manager.js +0 -1
- package/dist/core.js +0 -3
- package/dist/summer/ci.js +0 -3
- package/dist/summer/devtool.js +0 -3
- package/dist/summer/entry_process.js +0 -1
- package/dist/summer/error.js +0 -3
- package/dist/summer/graph/appconf.js +0 -3
- package/dist/summer/graph/appgraph.js +0 -3
- package/dist/summer/graph/basegraph.js +0 -3
- package/dist/summer/graph/pluginconf.js +0 -3
- package/dist/summer/graph/plugingraph.js +0 -3
- package/dist/summer/index.js +0 -3
- package/dist/summer/initPlugin.js +0 -3
- package/dist/summer/module.js +0 -3
- package/dist/summer/persist_cache.js +0 -3
- package/dist/summer/plugin_driver.js +0 -3
- package/dist/summer/plugins/base/es6module.js +0 -1
- package/dist/summer/plugins/base/javascript.js +0 -1
- package/dist/summer/plugins/base/wxss.js +0 -1
- package/dist/summer/plugins/enhance.js +0 -1
- package/dist/summer/plugins/index.js +0 -1
- package/dist/summer/plugins/less.js +0 -1
- package/dist/summer/plugins/minifywxml.js +0 -1
- package/dist/summer/plugins/sass.js +0 -1
- package/dist/summer/plugins/terser.js +0 -1
- package/dist/summer/plugins/typescript.js +0 -1
- package/dist/summer/plugins/worklet.js +0 -1
- package/dist/summer/project.js +0 -3
- package/dist/summer/recorder.js +0 -3
- package/dist/summer/resolver.js +0 -3
- package/dist/summer/summer.js +0 -3
- package/dist/summer/types.js +0 -3
- package/dist/summer/utils/async.js +0 -3
- package/dist/summer/utils/ensureArray.js +0 -3
- package/dist/summer/worker.js +0 -3
- package/dist/utils/url_config.js +0 -3
- package/dist/vendor/cloud-api/index.js +0 -2
- package/dist/vendor/cloud-api/src/apis/apis.js +0 -3
- package/dist/vendor/cloud-api/src/apis/cdn/cdn.apis.js +0 -3
- package/dist/vendor/cloud-api/src/apis/cdn/index.js +0 -3
- package/dist/vendor/cloud-api/src/apis/flexdb/flexdb.apis.js +0 -3
- package/dist/vendor/cloud-api/src/apis/flexdb/index.js +0 -3
- package/dist/vendor/cloud-api/src/apis/scf/index.js +0 -3
- package/dist/vendor/cloud-api/src/apis/scf/scf.apis.js +0 -3
- package/dist/vendor/cloud-api/src/apis/ssl/index.js +0 -3
- package/dist/vendor/cloud-api/src/apis/ssl/ssl.apis.js +0 -3
- package/dist/vendor/cloud-api/src/apis/tcb/general.apis.js +0 -3
- package/dist/vendor/cloud-api/src/apis/tcb/index.js +0 -3
- package/dist/vendor/cloud-api/src/apis/tcb/tcb.apis.js +0 -3
- package/dist/vendor/cloud-api/src/index.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/contracts/cdn.contracts.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/contracts/contracts.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/contracts/factory.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/contracts/flexdb.contracts.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/contracts/scf.contracts.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/contracts/ssl.contracts.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/contracts/tcb.contracts.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/transactor.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/validations/cdn.validations.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/validations/common.validations.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/validations/flexdb.validations.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/validations/scf.validations.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/validations/ssl.validations.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/validations/tcb.validations.js +0 -3
- package/dist/vendor/cloud-api/src/transaction/validations/validations.js +0 -3
- package/dist/vendor/cloud-api/src/utils/common.js +0 -3
- package/dist/vendor/cloud-api/src/utils/validator.js +0 -3
- package/dist/vendor/code-analyse/index.js +0 -2
- package/dist/vendor/schema/dist/app.js +0 -618
- package/dist/vendor/schema/dist/ext.js +0 -862
- package/dist/vendor/schema/dist/game.js +0 -211
- package/dist/vendor/schema/dist/page.js +0 -313
- package/dist/vendor/schema/dist/plugin.js +0 -41
- package/dist/vendor/schema/dist/pluginpage.js +0 -14
- package/dist/vendor/schema/dist/projectconfig.js +0 -474
- package/dist/vendor/schema/dist/projectprivateconfig.js +0 -358
- package/dist/vendor/schema/dist/sitemap.js +0 -53
- package/dist/vendor/schema/dist/theme.js +0 -20
- /package/dist/@types/{cli.d.ts → cli/index.d.ts} +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/apis.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/cdn/cdn.apis.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/cdn/index.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/flexdb/flexdb.apis.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/flexdb/index.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/scf/index.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/scf/scf.apis.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/ssl/index.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/ssl/ssl.apis.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/tcb/general.apis.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/apis/tcb/index.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/index.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/cdn.contracts.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/factory.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/flexdb.contracts.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/scf.contracts.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/ssl.contracts.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/transactor.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/validations/cdn.validations.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/validations/flexdb.validations.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/validations/scf.validations.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/transaction/validations/ssl.validations.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/utils/common.d.ts +0 -0
- /package/dist/@types/{vendor → common}/cloud-api/src/utils/validator.d.ts +0 -0
- /package/dist/@types/{core → modules/corecompiler/original}/js/enhance.d.ts +0 -0
- /package/dist/@types/{core/js/es6_transform.d.ts → modules/corecompiler/original/js/es6Transform.d.ts} +0 -0
- /package/dist/@types/{core → modules/corecompiler/original}/js/generateMap.d.ts +0 -0
- /package/dist/@types/{core → modules/corecompiler/original}/js/workletCompile.d.ts +0 -0
- /package/dist/@types/{core → modules/corecompiler/original}/npm/filterdeps.d.ts +0 -0
- /package/dist/@types/{core/protect/file_flatter.d.ts → modules/corecompiler/original/protect/fileFlatter.d.ts} +0 -0
- /package/dist/@types/{core → modules/corecompiler/original}/utils/logger.d.ts +0 -0
- /package/dist/@types/{core → modules/corecompiler/original}/validate/validate.d.ts +0 -0
- /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/childprocess.d.ts +0 -0
- /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/config.d.ts +0 -0
- /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/fork.d.ts +0 -0
- /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/task/call_func.d.ts +0 -0
- /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/task/func.d.ts +0 -0
- /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/worker.d.ts +0 -0
- /package/dist/@types/{summer → modules/corecompiler/summer}/plugins/index.d.ts +0 -0
- /package/dist/@types/{summer → modules/corecompiler/summer}/utils/async.d.ts +0 -0
- /package/dist/@types/{summer/entry_process.d.ts → modules/corecompiler/summerEntryProcess.d.ts} +0 -0
- /package/dist/{schema → @types/schema}/dist/index.d.ts +0 -0
- /package/dist/{core → modules/corecompiler/original}/js/generateMap.js +0 -0
- /package/dist/{core/worker_thread → modules/corecompiler/original/workerThread}/config.js +0 -0
- /package/dist/{core/worker_thread → modules/corecompiler/original/workerThread}/task/call_func.js +0 -0
- /package/dist/{core/worker_thread → modules/corecompiler/original/workerThread}/task/func.js +0 -0
- /package/dist/{core/worker_thread → modules/corecompiler/original/workerThread}/task/index.js +0 -0
- /package/dist/{vendor/schema → schema}/dist/index.js +0 -0
package/dist/cloud/utils.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initEnvironmentByProject=exports.zipToBuffer=exports.zipFile=void 0;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),jszip_1=tslib_1.__importDefault(require("jszip")),minimatch_1=tslib_1.__importDefault(require("minimatch")),cloudapi_1=require("./cloudapi"),log_1=tslib_1.__importDefault(require("../utils/log")),cloudAPI=tslib_1.__importStar(require("../vendor/cloud-api")),minimatchWithList=(e,t)=>{if(!t)return!1;for(const i of t)if(i.startsWith("!")&&!(0,minimatch_1.default)(e,i))return!1;for(const i of t)if(!i.startsWith("!")&&(0,minimatch_1.default)(e,i))return!0;return!1},zipFile=(e,{ignore:t,name:i,zip:n=new jszip_1.default,includeRoot:r=!1}={})=>{if(!fs_1.default.existsSync(e))return n;const o=fs_1.default.lstatSync(e),s=i||path_1.default.basename(e);if(o.isSymbolicLink())n.file(s,fs_1.default.readlinkSync(e),{unixPermissions:parseInt("120"+parseInt((o.mode&parseInt("777",8)).toString(8),10),8)});else if(o.isDirectory()){r&&n.folder(s);const i=fs_1.default.readdirSync(e);for(let o=0,a=i.length;o<a;o++){const a=i[o],l=r?path_1.default.posix.join(s,a):a;t&&minimatchWithList(l,t)||(0,exports.zipFile)(path_1.default.join(e,a),{zip:n,ignore:t,name:l,includeRoot:!0})}}else n.file(s,fs_1.default.readFileSync(e),{binary:!0,unixPermissions:o.mode});return n};exports.zipFile=zipFile;const zipToBuffer=(e,t)=>e.generateAsync({type:"nodebuffer",platform:"darwin"===process.platform?"UNIX":"DOS",compression:"DEFLATE",compressionOptions:{level:9}},t);async function initEnvironmentByProject(e,t){const i=await e.getExtAppid();(0,cloudapi_1.initCloudAPI)(i||e.appid),log_1.default.info("[cloud] loading env info");const n={request:(0,cloudapi_1.boundTransactRequest)(e),transactType:cloudAPI.TransactType.IDE};cloudAPI.setRequest((0,cloudapi_1.boundTransactRequest)(e)),cloudAPI.setTransactType(cloudAPI.TransactType.IDE);const[r,o]=await Promise.all([cloudAPI.tcbGetEnvironments({},n),cloudAPI.tcbDescribeWxCloudBaseRunEnvs({})]),s=[...r.envList,...o.envList].find(e=>e.envId===t);if(!s)throw new Error("env not found");return{currentEnv:s,cloudAPI:cloudAPI}}exports.zipToBuffer=zipToBuffer,exports.initEnvironmentByProject=initEnvironmentByProject;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
package/dist/config.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";var COMPILE_TYPE;Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendedLibMap=exports.jsonVariablePropertyWhiteList=exports.DefaultProjectAttr=exports.TABBAR_ICON_WHITE_LIST=exports.COMPILE_TYPE=exports.APP_TYPE=exports.MINI_GAME_WORKERS_PACKAGE_ROOT=exports.MINI_GAME_MAIN_PACKAGE_ROOT=exports.MINI_PROGRAM_MAIN_PACKAGE_ROOT=exports.PROJECT_TYPE_ERROR=exports.GET_LATEST_VERSION_CGI_ERR=exports.UPLOAD_JS_SERVER_CGI_ERR=exports.CODE_PROTECT_TRANSLATE_FILENAME=exports.UPLOAD_CGI_ERR=exports.GENERATE_LOCAL_SIGNATURE_ERR=exports.GET_SIGNATURE_RAND_STRING_ERR=exports.APP_JSON_NOT_FOUND=exports.JSON_CONTENT_ERR=exports.FILE_NOT_UTF8=exports.JSON_PARSE_ERR=exports.FILE_NOT_FOUND=exports.PLUGIN_JSON_PARSE_ERR=exports.PLUGIN_JSON_CONTENT_ERR=exports.PLUGIN_JSON_FILE_NOT_FOUND=exports.GAME_PLUGIN_LIB_MD5_NOT_MATCH=exports.SUMMER_PLUGIN_CODE_ERR=exports.SUMMER_PLUGIN_ERR=exports.MINIFY_WXML_ERR=exports.POST_WXSS_ERR=exports.FILE_FLAT_ERR=exports.JS_ES6_ERR=exports.BABILI_JS_ERR=exports.UGLIFY_JS_ERR=exports.BABEL_TRANS_JS_ERR=exports.JS_NOT_FOUND=exports.WXML_NOT_FOUND=exports.PARAM_ERROR=exports.CI_VERSION=void 0,exports.CI_VERSION="1.9.27",exports.PARAM_ERROR=1e4,exports.WXML_NOT_FOUND=10007,exports.JS_NOT_FOUND=10008,exports.BABEL_TRANS_JS_ERR=10032,exports.UGLIFY_JS_ERR=10033,exports.BABILI_JS_ERR=10034,exports.JS_ES6_ERR=10035,exports.FILE_FLAT_ERR=10036,exports.POST_WXSS_ERR=10037,exports.MINIFY_WXML_ERR=10038,exports.SUMMER_PLUGIN_ERR=10045,exports.SUMMER_PLUGIN_CODE_ERR=10046,exports.GAME_PLUGIN_LIB_MD5_NOT_MATCH=10081,exports.PLUGIN_JSON_FILE_NOT_FOUND=10091,exports.PLUGIN_JSON_CONTENT_ERR=10092,exports.PLUGIN_JSON_PARSE_ERR=10093,exports.FILE_NOT_FOUND=10005,exports.JSON_PARSE_ERR=10006,exports.FILE_NOT_UTF8=10031,exports.JSON_CONTENT_ERR=10009,exports.APP_JSON_NOT_FOUND=2e4,exports.GET_SIGNATURE_RAND_STRING_ERR=20001,exports.GENERATE_LOCAL_SIGNATURE_ERR=20002,exports.UPLOAD_CGI_ERR=20003,exports.CODE_PROTECT_TRANSLATE_FILENAME=20004,exports.UPLOAD_JS_SERVER_CGI_ERR=20005,exports.GET_LATEST_VERSION_CGI_ERR=20006,exports.PROJECT_TYPE_ERROR=3e4,exports.MINI_PROGRAM_MAIN_PACKAGE_ROOT="__APP__",exports.MINI_GAME_MAIN_PACKAGE_ROOT="__GAME__",exports.MINI_GAME_WORKERS_PACKAGE_ROOT="workers.js",exports.APP_TYPE={NORMAL:0,PLUGIN:1,SHOP:2,MINISHOP:3,GAME:4,CARD:5,NATIVE:7},function(_){_.miniProgram="miniProgram",_.miniProgramPlugin="miniProgramPlugin",_.miniGame="miniGame",_.miniGamePlugin="miniGamePlugin"}(COMPILE_TYPE=exports.COMPILE_TYPE||(exports.COMPILE_TYPE={})),exports.TABBAR_ICON_WHITE_LIST=[".png",".jpg",".jpeg"],exports.DefaultProjectAttr={platform:!1,appType:0,isSandbox:!1,released:!1,setting:{MaxCodeSize:2,MaxSubpackageSubCodeSize:2,MaxSubpackageFullCodeSize:12,NavigateMiniprogramLimit:10,MaxSubPackageLimit:100,MinTabbarCount:2,MaxTabbarCount:5,MaxCustomTabbarCount:10,MaxTabbarIconSize:40}},exports.jsonVariablePropertyWhiteList={windowPropertWhiteList:["navigationBarBackgroundColor","navigationBarTextStyle","backgroundColor","backgroundTextStyle","backgroundColorTop","backgroundColorBottom","backgroundColorContent"],tabBarPropertyWhiteList:["color","selectedColor","backgroundColor","borderStyle"],tabbarListItemPropertyWhiteList:["iconPath","selectedIconPath"]},exports.extendedLibMap={kbone:{packages:["miniprogram-element","miniprogram-render"]},weui:{packages:["weui-miniprogram"]}};
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";function findAllDescendant(e,t){let n;n=Array.isArray(e)?e:[e];const s=n.slice(0),o=[],a=[];for(;s.length>0;){const e=s.pop();o.push(e),e.childModules.forEach(e=>{s.indexOf(e)<0&&o.indexOf(e)<0&&(s.push(e),e.type===t&&a.push(e))})}return a}function findModsByType(e,t){var n;return(null===(n=null==e?void 0:e.graph)||void 0===n?void 0:n.modules.filter(e=>e.type===t))||[]}function findModByTypeAndPath(e,t,n){var s;return null===(s=e.graph)||void 0===s?void 0:s.modules.find(e=>e.type===t&&e.path===n)}function findPageMods(e,t){return(findModsByType(e,"Page")||[]).filter(e=>t.includes(e.path.replace(/\.json$/,"")))}function findGlobalCompMods(e){const t=findModByTypeAndPath(e,"MainPackage","app.json");return(null==t?void 0:t.childModules.filter(e=>"Component"===e.type))||[]}function getAllSubpackagePath(e){return findModsByType(e,"SubPackage").map(e=>e.path)}function innerGetSortedJSFiles(e,t){const n=new Set,s=new Set,o=new Set,a=[];for(const t of e){const e=t.findChild("Js");e&&(t.config?o.add(e.path):s.add(e.path),n.add(e.path),a.push(e))}const i=findAllDescendant(e.concat(t),"Component");for(const e of i.concat(t)){const t=e.findChild("Js");t&&(o.add(t.path),n.add(t.path),a.push(t))}const l=findAllDescendant(a,"Js");for(const e of l){const t=e.path;n.add(t)}return{allFiles:Array.from(n),pageFiles:Array.from(s),componentFiles:Array.from(o)}}function groupBySubpackage(e,t){const n=[],s={};for(const o of e){const e=t.find(e=>o.startsWith(e));e?(s[e]||(s[e]=[]),s[e].push(o)):n.push(o)}return{main:n,subs:s}}function partialGetSubPkgSortedJSFiles(e,t,n){const s=findPageMods(e,t);let{allFiles:o,pageFiles:a,componentFiles:i}=innerGetSortedJSFiles(s,[]);const l=getAllSubpackagePath(e);return{allFiles:groupBySubpackage(o,l).subs[n]||[],pageFiles:groupBySubpackage(a,l).subs[n]||[],componentFiles:groupBySubpackage(i,l).subs[n]||[]}}function partialGetMainPkgSortedJSFiles(e,t){const n=findPageMods(e,t),s=findGlobalCompMods(e);let{allFiles:o,pageFiles:a,componentFiles:i}=innerGetSortedJSFiles(n,s),l=!1;const p=findModByTypeAndPath(e,"Js","app.js");if(p){l=!0,o.push(p.path);const e=findAllDescendant([p],"Js");for(const t of e){const e=t.path;o.indexOf(e)<0&&o.push(e)}}const r=getAllSubpackagePath(e);return{hasAppJS:l,allFiles:groupBySubpackage(o,r).main,pageFiles:groupBySubpackage(a,r).main,componentFiles:groupBySubpackage(i,r).main}}function partialWholePkgGetSortedJSFiles(e,t){const n=findPageMods(e,t),s=findGlobalCompMods(e);let{allFiles:o,pageFiles:a,componentFiles:i}=innerGetSortedJSFiles(n,s),l=!1;const p=findModByTypeAndPath(e,"Js","app.js");if(p){l=!0,o.push(p.path);const e=findAllDescendant([p],"Js");for(const t of e){const e=t.path;o.indexOf(e)<0&&o.push(e)}}return{hasAppJS:l,allFiles:o,pageFiles:a,componentFiles:i}}function innerGetResourceFiles(e,t){let n=[];for(const s of e){const e=findAllDescendant(s,t);n=n.concat(e.map(e=>e.path))}return n}function partialGetWxmlAndWxsFiles(e,t,n){const s=findPageMods(e,t),o=findGlobalCompMods(e),a=innerGetResourceFiles(s.concat(o),"Wxml"),i=innerGetResourceFiles(s.concat(o),"Wxs"),l=getAllSubpackagePath(e),p=groupBySubpackage(a,l),r=groupBySubpackage(i,l);return{wxmlFiles:n?p.main.concat(p.subs[n]||[]):p.main,wxsFiles:n?r.main.concat(r.subs[n]||[]):r.main}}function partialGetWxssFiles(e,t,n){const s=findPageMods(e,t),o=findGlobalCompMods(e),a=innerGetResourceFiles(s.concat(o),"Wxss"),i=findModByTypeAndPath(e,"Wxss","app.wxss");if(i&&!a.includes(i.path)){a.push(i.path);const e=findAllDescendant(i,"Wxss");for(const t of e)a.includes(t.path)||a.push(t.path)}const l=groupBySubpackage(a,getAllSubpackagePath(e));return n?l.main.concat(l.subs[n]||[]):l.main}function partialGetCodeFiles(e,t){const n=new Set,s=findModByTypeAndPath(e,"MainPackage","app.json");n.add("app.json");const o=new Set;function a(e){switch(o.add(e),e.type){case"Page":case"Component":case"Wxml":case"Wxss":case"Wxs":case"Js":case"Config":n.add(e.path)}for(const t of e.childModules)o.has(t)||a(t)}for(const e of null==s?void 0:s.childModules)if("Page"===e.type)t.includes(e.path.replace(/\.json$/,""))&&a(e);else if("SubPackage"===e.type)for(const n of e.childModules)t.includes(n.path.replace(/\.json$/,""))&&a(n);else a(e);return console.log("[partial-compile] compile",n),Array.from(n)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.partialGetCodeFiles=exports.partialGetWxssFiles=exports.partialGetWxmlAndWxsFiles=exports.partialWholePkgGetSortedJSFiles=exports.partialGetMainPkgSortedJSFiles=exports.partialGetSubPkgSortedJSFiles=exports.findAllDescendant=void 0,exports.findAllDescendant=findAllDescendant,exports.partialGetSubPkgSortedJSFiles=partialGetSubPkgSortedJSFiles,exports.partialGetMainPkgSortedJSFiles=partialGetMainPkgSortedJSFiles,exports.partialWholePkgGetSortedJSFiles=partialWholePkgGetSortedJSFiles,exports.partialGetWxmlAndWxsFiles=partialGetWxmlAndWxsFiles,exports.partialGetWxssFiles=partialGetWxssFiles,exports.partialGetCodeFiles=partialGetCodeFiles;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getUploadProjectConfig=exports.compileWXMLFiles=exports.compileWXSSFiles=exports.compileJSFiles=exports.compileOther=exports.isNotIgnoredByProjectConfig=exports.getBabelRoot=void 0;const tslib_1=require("tslib"),babel_helper_1=require("../../utils/babel_helper"),js_1=require("./handler/js"),wxss_1=require("./handler/wxss"),wxml_1=require("./handler/wxml"),tools_1=require("../../utils/tools"),taskstatus_1=require("../../utils/taskstatus"),index_1=require("../worker_thread/index"),path_1=tslib_1.__importDefault(require("path")),projectconfig_1=require("../json/projectconfig"),game_1=tslib_1.__importDefault(require("../json/game")),signaturejson_1=require("../json/signaturejson"),config_1=require("../../config");async function getBabelRoot(o){var e,t;const i=await(0,projectconfig_1.getProjectConfigJSON)(o);let s=null===(t=null===(e=null==i?void 0:i.setting)||void 0===e?void 0:e.babelSetting)||void 0===t?void 0:t.outputPath;return s?(s=(0,tools_1.normalizePath)(s),s.replace(/(^[./\\])|(\/$)/g,""),s):"@babel/runtime"}function isNotIgnoredByProjectConfig(o,e,t){var i,s;const n=path_1.default.posix.relative(e,t),a=(null===(i=o.packOptions)||void 0===i?void 0:i.include)||[];if((0,tools_1.isFileIncluded)(n,a))return!0;const l=(null===(s=o.packOptions)||void 0===s?void 0:s.ignore)||[];return!(0,tools_1.isFileIgnored)(path_1.default.posix.relative(e,t),l)}async function copyFile(o,e){return{filePath:e,code:await o.getFile("",e)}}async function compileOther(o,e,t){const{onProgressUpdate:i=(()=>{})}=t,s=new taskstatus_1.TaskStatus("compiling other files");i(s);const n=[];for(const t of e)n.push(copyFile(o,t));const a=await Promise.all(n),l={};for(const o of a){const{code:e,filePath:t}=o;e&&(l[t]=e)}return s.done(),i(s),l}async function canWeCompileJS(o,e,t){let i;for(const o of e)if((0,tools_1.normalizePath)(t).startsWith((0,tools_1.normalizePath)((0,signaturejson_1.trailing)(o.fullPath,"/")))){i=o;break}if(i){return i.signature.findIndex(o=>(0,tools_1.normalizePath)(o.fullPath)===(0,tools_1.normalizePath)(t))>=0}return!0}async function compileJSFiles(o,e,t,i){const{setting:s={}}=i;let n="@babel/runtime";s.es7&&(n=await getBabelRoot(o));const a=[];if(o.type===config_1.COMPILE_TYPE.miniGame||o.type===config_1.COMPILE_TYPE.miniGamePlugin){const s=await(0,signaturejson_1.getAllPluginSignatures)(o);for(const l of e){const e=path_1.default.join(o.projectPath,t,l);await canWeCompileJS(o,s,e)&&a.push((0,js_1.compileJS)(o,l,Object.assign(Object.assign({},i),{babelRoot:n,root:t})))}}else for(const s of e)a.push((0,js_1.compileJS)(o,s,Object.assign(Object.assign({},i),{babelRoot:n,root:t})));let l=[];try{l=await Promise.all(a)}catch(o){throw(0,index_1.abortTask)(index_1.TASK_NAME.COMPILE_JS),o}const r={},c=new Set;for(const o of l){const{filePath:e,map:i,code:s,helpers:n}=o,a=(0,tools_1.formatSourceMap)(i);void 0!==s&&(r[path_1.default.posix.normalize(path_1.default.posix.join(t,e))]=s),a&&(r[path_1.default.posix.normalize(path_1.default.posix.join(t,e+".map"))]=a),n.length>0&&n.forEach(o=>{c.add(o)})}return await(0,babel_helper_1.appendBabelHelpers)(c,path_1.default.join(t),n,r),r}async function compileWXSSFiles(o,e,t,i){const s=[];for(const n of e)s.push((0,wxss_1.compileWXSS)(o,n,Object.assign(Object.assign({},i),{root:t})));let n=[];try{n=await Promise.all(s)}catch(o){throw(0,index_1.abortTask)(index_1.TASK_NAME.COMPILE_WXSS),o}const a={};for(const o of n){const{filePath:e,code:i}=o;void 0!==i&&(a[path_1.default.posix.normalize(path_1.default.posix.join(t,e))]=i)}return a}async function compileWXMLFiles(o,e,t,i){const s=[];for(const n of e)s.push((0,wxml_1.compileWXML)(o,n,Object.assign(Object.assign({},i),{root:t})));let n=[];try{n=await Promise.all(s)}catch(o){throw(0,index_1.abortTask)(index_1.TASK_NAME.MINIFY_WXML),o}const a={};for(const o of n){const{filePath:e,code:i}=o;void 0!==i&&(a[path_1.default.posix.normalize(path_1.default.posix.join(t,e))]=i)}return a}async function getUploadProjectConfig(o,e){const t={miniprogramRoot:e.miniprogramRoot,localPlugins:[]};e.pluginRoot&&(t.pluginRoot=e.pluginRoot);const i=await(0,game_1.default)(o),s=(o,e="")=>{const i=t.localPlugins||[];for(const t in o)if(o.hasOwnProperty(t)&&o[t]&&"string"==typeof o[t].path){const s=o[t],n=path_1.default.posix.normalize(path_1.default.posix.join(e,s.path.replace(/\\/g,"/")).replace(/^\/+/,""));i.push({alias:t,provider:s.provider,path:n})}t.localPlugins=i};if(i.plugins){s(i.plugins)}const n=i.subpackages||i.subPackages;if(Array.isArray(n))for(const o of n)(null==o?void 0:o.plugins)&&s(o.plugins,o.root||"");return t}exports.getBabelRoot=getBabelRoot,exports.isNotIgnoredByProjectConfig=isNotIgnoredByProjectConfig,exports.compileOther=compileOther,exports.compileJSFiles=compileJSFiles,exports.compileWXSSFiles=compileWXSSFiles,exports.compileWXMLFiles=compileWXMLFiles,exports.getUploadProjectConfig=getUploadProjectConfig;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),game_1=tslib_1.__importDefault(require("../json/game")),projectconfig_1=require("../json/projectconfig"),common_1=require("./common"),taskstatus_1=require("../../utils/taskstatus"),config_1=require("../../config"),common_2=require("../../utils/common"),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),white_ext_list_1=require("../../utils/white_ext_list"),uglifyfilenames_1=require("../protect/uglifyfilenames");async function compileGameJSON(e,t){const{onProgressUpdate:i=(()=>{})}=t,o=new taskstatus_1.TaskStatus("game.json");i(o);const a=await(0,game_1.default)(e);return o.done(),i(o),a}async function compile(e,t){var i;const o=await(0,projectconfig_1.getProjectConfigJSON)(e),a=o.miniprogramRoot||"",{GameWhiteList:s}=await(0,white_ext_list_1.getWhiteExtList)(),n=e.getFileList(a,"").filter(common_1.isNotIgnoredByProjectConfig.bind(null,o,a)).filter(e=>s.has(path_1.default.posix.extname(e))),r=await compileGameJSON(e,t);e.stat(a,"game.js")||(0,common_2.throwError)({msg:locales_1.default.config.FILE_NOT_FOUND.format(path_1.default.posix.join(a,"game.js")),filePath:path_1.default.posix.join(a,"game.js"),code:config_1.FILE_NOT_FOUND});const m=n.filter(e=>".js"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(a,e)),l=await(0,common_1.compileJSFiles)(e,m,a,t),_=n.filter(e=>e!==path_1.default.posix.join(a,"game.json")&&".js"!==path_1.default.posix.extname(e)),c=await(0,common_1.compileOther)(e,_,t),p=await(0,common_1.getUploadProjectConfig)(e,o);let f=Object.assign(Object.assign({},l),c);if(e.type===config_1.COMPILE_TYPE.miniGame){if(p.miniprogramRoot&&"."!==p.miniprogramRoot&&"./"!==p.miniprogramRoot){const t={};for(const i in f)t[path_1.default.posix.relative(e.miniprogramRoot,i)]=f[i];f=t}p.miniprogramRoot="",f["game.json"]=JSON.stringify(r)}else f[path_1.default.posix.join(p.miniprogramRoot||"","game.json")]=JSON.stringify(r);return p.__compileDebugInfo__=t.__compileDebugInfo__||{},f["project.config.json"]=JSON.stringify(p),delete f["project.private.config.json"],e.type===config_1.COMPILE_TYPE.miniGame&&(null===(i=t.setting)||void 0===i?void 0:i.codeProtect)&&(f=await(0,uglifyfilenames_1.uglifyFileNames)(e,f)),f}exports.compile=compile;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=exports.compilePlugin=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),projectconfig_1=require("../json/projectconfig"),common_1=require("./common"),plugin_1=require("../json/plugin/plugin"),game_1=require("./game"),white_ext_list_1=require("../../utils/white_ext_list");async function compilePlugin(e,i){const t=await(0,projectconfig_1.getProjectConfigJSON)(e),o=t.pluginRoot,{GameWhiteList:n}=await(0,white_ext_list_1.getWhiteExtList)(),l=e.getFileList(o,"").filter(common_1.isNotIgnoredByProjectConfig.bind(null,t,o)).filter(e=>n.has(path_1.default.posix.extname(e))),a=await(0,plugin_1.getDevPluginJSON)(e,!1),s=l.filter(e=>".js"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(o,e)),p=await(0,common_1.compileJSFiles)(e,s,o,i),c=l.filter(e=>".js"!==path_1.default.posix.extname(e)&&e!==path_1.default.posix.join(o,"plugin.json")),r=await(0,common_1.compileOther)(e,c,i);return Object.assign(Object.assign({[path_1.default.posix.join(o,"plugin.json")]:JSON.stringify(a)},p),r)}async function compile(e,i){const t=await(0,projectconfig_1.getProjectConfigJSON)(e),o=await compilePlugin(e,i),n=await(0,game_1.compile)(e,i),l=await(0,common_1.getUploadProjectConfig)(e,t);return l.__compileDebugInfo__=i.__compileDebugInfo__||{},Object.assign(Object.assign(Object.assign({},o),n),{"project.config.json":JSON.stringify(l)})}exports.compilePlugin=compilePlugin,exports.compile=compile;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileJS=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),taskstatus_1=require("../../../utils/taskstatus"),worker_thread_1=require("../../worker_thread"),common_1=require("../../../utils/common"),config_1=require("../../../config"),tools_1=require("../../../utils/tools"),app_1=require("../../json/app"),common_2=require("../../json/common"),projectconfig_1=require("../../json/projectconfig"),game_1=tslib_1.__importDefault(require("../../json/game")),core_1=require("../../../core");async function formatBabelRoot(e,t,o,r){const a=e.type;if(a===config_1.COMPILE_TYPE.miniProgram){const t=await(0,app_1.getAppJSON)(e),a=(0,common_2.checkPagePathIsInIndependentSubpackage)(t,o);a&&(r=`${a.root}/${r}`),"object"==typeof t.functionalPages&&!0===t.functionalPages.independent&&o.startsWith("functional-pages/")&&(r="functional-pages/"+r),"string"==typeof t.openDataContext&&o.startsWith(t.openDataContext)&&(r=`${t.openDataContext}/${r}`),t.workers&&o.startsWith((0,tools_1.getWorkersPath)(t.workers))&&(r=`${(0,tools_1.getWorkersPath)(t.workers)}/${r}`)}else if(a===config_1.COMPILE_TYPE.miniGame){const t=await(0,game_1.default)(e),a=(0,common_2.checkFilePathIsInIndependentSubpackage)(t,o);a&&(r=`${a}/${r}`),"string"==typeof t.openDataContext&&o.startsWith(t.openDataContext)&&(r=`${t.openDataContext}/${r}`),t.workers&&o.startsWith((0,tools_1.getWorkersPath)(t.workers))&&(r=`${(0,tools_1.getWorkersPath)(t.workers)}/${r}`)}else if(a===config_1.COMPILE_TYPE.miniProgramPlugin||a===config_1.COMPILE_TYPE.miniGamePlugin){const t=await(0,core_1.getPluginJSON)(e);"string"==typeof t.workers&&o.startsWith(t.workers)&&(r=`${t.workers}/${r}`)}return(0,tools_1.normalizePath)(""+r)}async function compileJS(e,t,o){var r,a;const{setting:s={},onProgressUpdate:i=(()=>{}),root:n="",devToolsCompileCache:c}=o,l=path_1.default.posix.join(n,t);let _=[],p=o.babelRoot||"@babel/runtime";if(s.es7){const o=await(0,projectconfig_1.getProjectConfigJSON)(e);_=(null===(a=null===(r=o.setting)||void 0===r?void 0:r.babelSetting)||void 0===a?void 0:a.ignore)||[],p=await formatBabelRoot(e,n,t,p)}const u=new taskstatus_1.TaskStatus(t),g=o.sourceCode?o.sourceCode:await e.getFile(n,t);async function m(){const o=await(0,worker_thread_1.runTask)(worker_thread_1.TASK_NAME.COMPILE_JS,{projectPath:e.projectPath,root:n,filePath:t,setting:s,code:g,babelRoot:p,babelIgnore:_},e=>{e===worker_thread_1.ETaskStatus.progress?i(u):e===worker_thread_1.ETaskStatus.done&&(u.done(),i(u))});return o.error&&(0,common_1.throwError)({msg:o.error.message,code:o.error.code,filePath:l}),o}let f={};if(c){const o=(0,tools_1.normalizePath)(path_1.default.posix.join(e.projectPath,n,t)),r=`${o}_${JSON.stringify(s)}`;f=await c.getFile(o,r),f&&!s.codeProtect||(f=await m(),c.setFile(o,f,r))}else f=await m();return Object.assign({filePath:t},f)}exports.compileJS=compileJS;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileJSON=exports.addSkylineRendererToComponents=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),app_1=require("../../json/app"),getExtJSON_1=require("../../json/app/getExtJSON"),common_1=require("../../../utils/common"),getPageJSON_1=require("../../json/page/getPageJSON"),taskstatus_1=require("../../../utils/taskstatus"),projectconfig_1=require("../../json/projectconfig"),common_2=require("../common");function addSkylineRendererToComponents(e,t){const o=new Set,n=new Set;function s(e,t){Object.values(t.usingComponents||{}).forEach(t=>{const s=t.startsWith("/")?t.substring(1)+".json":path_1.default.posix.join(path_1.default.posix.dirname(e),t+".json");o.has(s)||n.add(s)}),Object.values(t.componentGenerics||{}).forEach(t=>{if("object"==typeof t&&"string"==typeof t.default){const s=t.default.startsWith("/")?t.default.substring(1)+".json":path_1.default.posix.join(path_1.default.posix.dirname(e),t.default+".json");o.has(s)||n.add(s)}})}for(const t of Object.keys(e)){const o=JSON.parse(e[t]);"skyline"===o.renderer&&s(t,o)}for(;n.size>0;){const e=n.values().next().value;if(n.delete(e),o.add(e),t[e]&&"string"==typeof t[e]){const o=JSON.parse(t[e]);if("xr-frame"===o.renderer)continue;if("webview"===o.renderer)throw new Error(`The component (${e}) is configured with renderer: 'webview', but is used in skyline pages`);o.renderer="skyline",t[e]=JSON.stringify(o),s(e,o)}}}async function compilePageJSON(e,t,o,n){const{onProgressUpdate:s=(()=>{})}=n,a={};for(const n of t){const t=new taskstatus_1.TaskStatus(n);s(t);const i=await(0,getPageJSON_1.getPageJSON)(e,{miniprogramRoot:o,pagePath:n});a[path_1.default.posix.join(o,n+".json")]=JSON.stringify(Object.assign(Object.assign({},i),{__warning__:void 0})),t.done(),s(t)}return a}async function compileJSON(e,t){const{onProgressUpdate:o=(()=>{})}=t,n=await(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:s=""}=n;let a=new taskstatus_1.TaskStatus("app.json");o(a);const i=await(0,app_1.getAppJSON)(e);let r;a.done(),o(a);const p=await e.attr();(null==p?void 0:p.platform)&&(a=new taskstatus_1.TaskStatus("ext.json"),o(a),r=await(0,getExtJSON_1.getExtJSON)(e),a.done(),o(a));const c=(0,common_1.getAllPages)(i),l=await compilePageJSON(e,c,s,t),d=new Set(["app.json","ext.json"].concat(c.map(e=>e+".json"))),u=(0,common_1.getAllTargetTypeFilesWithOtherTypeFilesOfSameName)(e,".json",[".wxml",".js"],s).filter(common_2.isNotIgnoredByProjectConfig.bind(null,n,s)).filter(e=>{const t=path_1.default.posix.relative(s,e);return!d.has(t)}).map(e=>path_1.default.posix.relative(s,e).replace(/\.json$/,"")),g=await compilePageJSON(e,u,s,t);u.forEach(e=>d.add(e+".json")),addSkylineRendererToComponents(l,g);const f=e.getFileList(s,".json").filter(common_2.isNotIgnoredByProjectConfig.bind(null,n,s)).filter(e=>{const t=path_1.default.posix.relative(s,e);return!d.has(t)}),m=await(0,common_2.compileOther)(e,f,t),j=Object.assign(Object.assign(Object.assign({[path_1.default.posix.join(s,"app.json")]:JSON.stringify(Object.assign(Object.assign({},i),{__warning__:void 0}))},l),g),m);return r&&(j[path_1.default.posix.join(s,"ext.json")]=JSON.stringify(r)),j}exports.addSkylineRendererToComponents=addSkylineRendererToComponents,exports.compileJSON=compileJSON;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileWXML=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../../utils/tools"),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),config_1=require("../../../config"),taskstatus_1=require("../../../utils/taskstatus"),worker_thread_1=require("../../worker_thread"),common_1=require("../../../utils/common");async function compileWXML(e,r,t){const{root:o="",setting:s={},onProgressUpdate:i=(()=>{})}=t,{minify:a,minifyWXML:_}=s,l=new taskstatus_1.TaskStatus(r),c=path_1.default.posix.join(o,r),n=await e.getFile(o,r);if(!a&&!_){i(l);const e=(0,tools_1.bufferToUtf8String)(n);return void 0===e&&(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_UTF8.format(c),code:config_1.FILE_NOT_UTF8,filePath:c}),l.done(),i(l),{filePath:r,code:e.replace(/\r\n/g,"\n")}}const u=await(0,worker_thread_1.runTask)(worker_thread_1.TASK_NAME.MINIFY_WXML,{projectPath:e.projectPath,root:o,filePath:r,setting:s,code:n},e=>{e===worker_thread_1.ETaskStatus.progress?i(l):e===worker_thread_1.ETaskStatus.done&&(l.done(),i(l))});return u.error&&(0,common_1.throwError)({msg:u.error.message,code:u.error.code,filePath:c}),{filePath:r,code:u.code.replace(/\r\n/g,"\n")}}exports.compileWXML=compileWXML;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileWXSS=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../../utils/tools"),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),config_1=require("../../../config"),taskstatus_1=require("../../../utils/taskstatus"),worker_thread_1=require("../../worker_thread"),common_1=require("../../../utils/common");async function compileWXSS(e,t,o){const{root:r="",setting:i={},onProgressUpdate:s=(()=>{}),devToolsCompileCache:a}=o,{minify:l,minifyWXSS:_,autoPrefixWXSS:c}=i,n=new taskstatus_1.TaskStatus(t),u=path_1.default.posix.join(r,t),f=await e.getFile(r,t);if(!l&&!_&&!c){s(n);const e=(0,tools_1.bufferToUtf8String)(f);return void 0===e&&(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_UTF8.format(u),code:config_1.FILE_NOT_UTF8,filePath:u}),n.done(),s(n),{filePath:t,code:e}}async function d(){const o=await(0,worker_thread_1.runTask)(worker_thread_1.TASK_NAME.COMPILE_WXSS,{projectPath:e.projectPath,root:r,filePath:t,setting:i,code:f},e=>{e===worker_thread_1.ETaskStatus.progress?s(n):e===worker_thread_1.ETaskStatus.done&&(n.done(),s(n))});return o.error&&(0,common_1.throwError)({msg:o.error.message,code:o.error.code,filePath:u}),o.code}let h="";if(a){const o=(0,tools_1.normalizePath)(path_1.default.posix.join(e.projectPath,r,t)),s=`${o}_${JSON.stringify(i)}`;h=await a.getFile(o,s),h&&!i.codeProtect||(h=await d(),a.setFile(o,h,s))}else h=await d();return{filePath:t,code:h}}exports.compileWXSS=compileWXSS;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tslib_1=require("tslib"),game_1=require("./game"),mini_program_1=require("./mini_program"),mini_program_plugin_1=require("./mini_program_plugin"),game_plugin_1=require("./game_plugin"),config_1=require("../../config"),reactiveCache_1=require("../json/reactiveCache"),common_1=require("../../utils/common"),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales"));async function checkProjectTypeMatchProjectAttr(e){const i=await e.attr();!i.gameApp||e.type!==config_1.COMPILE_TYPE.miniProgramPlugin&&e.type!==config_1.COMPILE_TYPE.miniProgram||(0,common_1.throwError)({filePath:"",msg:locales_1.default.config.PROJECT_TYPE_ERROR.format(e.type,e.appid,locales_1.default.config.MINI_GAME),code:config_1.PROJECT_TYPE_ERROR}),i.gameApp||e.type!==config_1.COMPILE_TYPE.miniGame&&e.type!==config_1.COMPILE_TYPE.miniGamePlugin||(0,common_1.throwError)({filePath:"",msg:locales_1.default.config.PROJECT_TYPE_ERROR.format(e.type,e.appid,locales_1.default.config.MINI_PROGRAM),code:config_1.PROJECT_TYPE_ERROR})}async function compile(e,i){const o=(0,reactiveCache_1.tryToGetReactiveProject)(e);return await o.updateProject(),i.__compileDebugInfo__?i.__compileDebugInfo__.ciVersion=config_1.CI_VERSION:i.__compileDebugInfo__={from:"ci",useNewCompileModule:!0,devtoolsVersion:"0",compileSetting:i.setting,ciVersion:config_1.CI_VERSION},process.env.isDevtools&&(e.nameMappingFromDevtools=i.nameMapping||{}),await checkProjectTypeMatchProjectAttr(e),e.type===config_1.COMPILE_TYPE.miniGame?(0,game_1.compile)(e,i):e.type===config_1.COMPILE_TYPE.miniProgramPlugin?(0,mini_program_plugin_1.compile)(e,i):e.type===config_1.COMPILE_TYPE.miniGamePlugin?(0,game_plugin_1.compile)(e,i):(0,mini_program_1.compile)(e,i)}exports.compile=compile;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tslib_1=require("tslib"),common_1=require("./common"),mpjson_1=require("./handler/mpjson"),white_ext_list_1=require("../../utils/white_ext_list"),config_1=require("../../config"),path_1=tslib_1.__importDefault(require("path")),projectconfig_1=require("../json/projectconfig"),uglifyfilenames_1=require("../protect/uglifyfilenames"),partial_1=require("../analyse/partial"),lodash_1=tslib_1.__importDefault(require("lodash")),summer=tslib_1.__importStar(require("../../summer/ci"));async function compile(e,i){var t,o,a,l;const s=await(0,projectconfig_1.getProjectConfigJSON)(e);if(null===(t=s.setting)||void 0===t?void 0:t.useCompilerPlugins)return summer.compile(e,s,i,s.setting.useCompilerPlugins);const r=s.miniprogramRoot||"",{MiniProgramWhiteList:p}=await(0,white_ext_list_1.getWhiteExtList)();let n=e.getFileList(r,"").filter(common_1.isNotIgnoredByProjectConfig.bind(null,s,r)).filter(e=>p.has(path_1.default.posix.extname(e)));if((null===(o=i.compilePages)||void 0===o?void 0:o.length)&&i.analyzer){const e=(0,partial_1.partialGetCodeFiles)(i.analyzer,i.compilePages).map(e=>path_1.default.posix.join(r,e)),t=n.filter(e=>{const i=path_1.default.posix.extname(e);return".js"!==i&&".json"!==i&&".wxss"!==i&&".wxml"!==i});n=t.concat(e)}let c=!1,m=await(0,mpjson_1.compileJSON)(e,i);if((null===(a=i.compilePages)||void 0===a?void 0:a.length)&&i.analyzer){const e=JSON.parse(m[path_1.default.posix.join(r,"app.json")]);e.pages=e.pages.filter(e=>{var t;return null===(t=i.compilePages)||void 0===t?void 0:t.includes(e)}),0===e.pages.length&&(e.pages=["partialcompileplaceholder"],c=!0),e.subPackages&&(e.subPackages.forEach(e=>{e.pages=e.pages.filter(t=>{var o;return null===(o=i.compilePages)||void 0===o?void 0:o.includes(e.root+t)})}),e.subPackages=e.subPackages.filter(e=>e.pages.length>0)),m[path_1.default.posix.join(r,"app.json")]=JSON.stringify(e),m=lodash_1.default.pick(m,Object.keys(m).filter(e=>m[e]instanceof Buffer||n.includes(e)))}const _=n.filter(e=>".js"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(r,e)),u=await(0,common_1.compileJSFiles)(e,_,r,i),f=n.filter(e=>".wxss"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(r,e)),g=await(0,common_1.compileWXSSFiles)(e,f,r,i),d=n.filter(e=>".wxml"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(r,e)),h=await(0,common_1.compileWXMLFiles)(e,d,r,i),j=n.filter(e=>{const i=path_1.default.posix.extname(e);return".js"!==i&&".json"!==i&&".wxss"!==i&&".wxml"!==i}),x=await(0,common_1.compileOther)(e,j,i);let v=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},m),u),x),g),h);if(c&&(v[path_1.default.posix.join(r,"partialcompileplaceholder.js")]||(v[path_1.default.posix.join(r,"partialcompileplaceholder.js")]=""),v[path_1.default.posix.join(r,"partialcompileplaceholder.wxml")]||(v[path_1.default.posix.join(r,"partialcompileplaceholder.wxml")]="")),e.type===config_1.COMPILE_TYPE.miniProgram){if(s.miniprogramRoot&&"."!==s.miniprogramRoot&&"./"!==s.miniprogramRoot){const i={};for(const t in v)i[path_1.default.posix.relative(e.miniprogramRoot,t)]=v[t];v=i}v["project.config.json"]=JSON.stringify({miniprogramRoot:"",__compileDebugInfo__:i.__compileDebugInfo__||{}}),delete v["project.private.config.json"]}else v["project.config.json"]=JSON.stringify({miniprogramRoot:e.miniprogramRoot||"",__compileDebugInfo__:i.__compileDebugInfo__||{}}),delete v["project.private.config.json"];return e.type===config_1.COMPILE_TYPE.miniProgram&&(null===(l=i.setting)||void 0===l?void 0:l.codeProtect)&&(v=await(0,uglifyfilenames_1.uglifyFileNames)(e,v)),v}exports.compile=compile;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=exports.compilePlugin=void 0;const tslib_1=require("tslib"),mini_program_1=require("./mini_program"),common_1=require("./common"),plugin_1=require("../json/plugin/plugin"),plugin_page_1=require("../json/plugin/plugin_page"),white_ext_list_1=require("../../utils/white_ext_list"),path_1=tslib_1.__importDefault(require("path")),projectconfig_1=require("../json/projectconfig"),summer=tslib_1.__importStar(require("../../summer/ci"));async function compilePlugin(i,e){const t=await(0,projectconfig_1.getProjectConfigJSON)(i),{MiniProgramWhiteList:o}=await(0,white_ext_list_1.getWhiteExtList)(),n=t.pluginRoot,s=i.getFileList(n,"").filter(common_1.isNotIgnoredByProjectConfig.bind(null,t,n)).filter(i=>o.has(path_1.default.posix.extname(i))),a=await(0,plugin_1.getDevPluginJSON)(i,!1),l=s.filter(i=>".json"===path_1.default.posix.extname(i)&&i!==path_1.default.posix.join(n,"plugin.json")),p={};for(const e of l){const t=await(0,plugin_page_1.getPluginPageJSON)({project:i,root:n,filePath:e});p[e]=JSON.stringify(t)}const r=s.filter(i=>".js"===path_1.default.posix.extname(i)).map(i=>path_1.default.posix.relative(n,i)),m=await(0,common_1.compileJSFiles)(i,r,n,e),g=s.filter(i=>".wxss"===path_1.default.posix.extname(i)).map(i=>path_1.default.posix.relative(n,i)),u=await(0,common_1.compileWXSSFiles)(i,g,n,e),c=s.filter(i=>".wxml"===path_1.default.posix.extname(i)).map(i=>path_1.default.posix.relative(n,i)),_=await(0,common_1.compileWXMLFiles)(i,c,n,e),f=s.filter(i=>{const e=path_1.default.posix.extname(i);return".js"!==e&&".json"!==e&&".wxss"!==e&&".wxml"!==e}),j=await(0,common_1.compileOther)(i,f,e);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[path_1.default.posix.join(n,"plugin.json")]:JSON.stringify(a)},p),m),j),u),_)}async function compile(i,e){var t;const o=await(0,projectconfig_1.getProjectConfigJSON)(i);if(null===(t=o.setting)||void 0===t?void 0:t.useCompilerPlugins)return summer.compile(i,o,e,o.setting.useCompilerPlugins);const n=await compilePlugin(i,e),s=await(0,mini_program_1.compile)(i,e);return Object.assign(Object.assign(Object.assign({},n),s),{"project.config.json":JSON.stringify({miniprogramRoot:o.miniprogramRoot,pluginRoot:o.pluginRoot,__compileDebugInfo__:e.__compileDebugInfo__||{}})})}exports.compilePlugin=compilePlugin,exports.compile=compile;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
package/dist/core/js/enhance.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const config_1=require("../../config"),babel_helper_1=require("../../utils/babel_helper"),_transformRuntimeCustom=()=>require("../../utils/babel_transform_plugin"),_pluginTransformWorklet=()=>require("../../utils/babel_plugin_worklet"),babel7=()=>require("@babel/core"),_pluginTransformRuntime=()=>require("@babel/plugin-transform-runtime"),_pluginTransformModulesCommonjs=()=>require("@babel/plugin-transform-modules-commonjs"),_presetEnv=()=>require("@babel/preset-env");function getPluginsList(e){const r=[[require("../../utils/babel_transform_plugin")],[require("@babel/plugin-transform-runtime"),{corejs:!1,helpers:!0,regenerator:!e.hasRegenerator,version:"7.21.0"}]].concat((0,babel_helper_1.getCustomPlugins)([]));return r.push([require("@babel/plugin-transform-modules-commonjs"),{allowTopLevelThis:e.disableUseStrict,importInterop:e=>e.startsWith("@babel/runtime/helpers/")?"node":"babel"}]),e.supportWorklet&&r.push([require("../../utils/babel_plugin_worklet")]),r}const enhance=e=>{const{code:r,babelRoot:l,filePath:t,inputSourceMap:s}=e,o=r,n=/regeneratorRuntime\.mark/.test(r),i=e.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r),u=o.includes('"worklet"')||o.includes("'worklet'");let a=null;try{a=require("@babel/core").transform(r,{presets:[[require("@babel/preset-env"),{targets:{chrome:53,ios:8},include:["@babel/plugin-transform-computed-properties"]}]],babelrc:!1,plugins:getPluginsList({hasRegenerator:n,disableUseStrict:i,supportWorklet:u}),sourceFileName:t,inputSourceMap:s,sourceMaps:!0,configFile:!1})}catch(e){return{error:{message:`file: ${t}\n ${e.message}`,code:config_1.BABEL_TRANS_JS_ERR}}}let b=(null==a?void 0:a.code)||r;const p=(null==a?void 0:a.map)||s;i&&(b=b.replace(/^"use strict";/,""));const c=(0,babel_helper_1.collectBabelHelpers)(o),{transformCode:m,helpers:g}=(0,babel_helper_1.replaceBabelHelpers)(b,c,t,l);return b=m,{code:b,map:p,helpers:g||[]}};module.exports=enhance;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const config_1=require("../../config"),_babelCodeFrame=()=>require("babel-code-frame"),_babel=()=>require("babel-core"),es6Compile=e=>{const{code:r,filePath:o,inputSourceMap:c}=e;try{const e=require("babel-core").transform(r,{presets:["babel-preset-es2015","babel-preset-stage-0"].map(e=>require.resolve(e)),babelrc:!1,sourceFileName:o,filename:o,inputSourceMap:c,sourceMaps:!0});return{code:e.code,map:e.map}}catch(e){if(e.loc){return{error:{message:`file: ${o}\n ${e.message}\n ${require("babel-code-frame")(r,e.loc.line,e.loc.column>0?e.loc.column:1)}`,code:config_1.BABEL_TRANS_JS_ERR}}}return{error:{message:""+e,code:config_1.BABEL_TRANS_JS_ERR}}}};module.exports=es6Compile;
|
package/dist/core/js/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tslib_1=require("tslib"),config_1=require("../../config"),tools_1=require("../../utils/tools"),error_1=require("../../utils/error"),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales"));function compile(e,o,r){if(void 0===(0,tools_1.bufferToUtf8String)(e))throw new error_1.CodeError(locales_1.default.config.FILE_NOT_UTF8.format(o),config_1.FILE_NOT_UTF8)}exports.compile=compile;
|
package/dist/core/js/minifyjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const config_1=require("../../config"),_Terser=()=>require("terser"),_UglifyJS=()=>require("uglify-js"),_babelCodeFrame=()=>require("babel-code-frame"),minify=e=>{const{code:r,inputSourceMap:o,useTerser:i,filePath:n}=e;let c;const s=o?{includeSources:!0,content:o,filename:n}:{includeSources:!0,content:void 0,filename:n};if(c=i?require("terser").minify(r,{output:{comments:!1},toplevel:!0,compress:{drop_console:!1,drop_debugger:!1},sourceMap:s}):require("uglify-js").minify(r,{toplevel:!0,sourceMap:s}),c.error){const e=c.error;return{error:{message:`file: ${n}\n ${c.error.message}\n ${require("babel-code-frame")(r,e.line,e.col>0?e.col:1)}`,code:config_1.UGLIFY_JS_ERR}}}return c};module.exports=minify;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const tslib_1=require("tslib"),minifyjs_1=tslib_1.__importDefault(require("./minifyjs")),_sourcemap=()=>require("source-map"),transformInputSourceMapWhenWraped=e=>{const{code:n,filePath:r,inputSourceMap:o}=e;if(o){const e=new(_sourcemap().SourceMapConsumer)(o),n=new(_sourcemap().SourceMapGenerator)({file:r});return e.eachMapping(e=>{if("number"!=typeof e.originalLine||"number"!=typeof e.originalColumn)return;const r={generated:{line:e.generatedLine+1,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)}),e.sources.forEach(r=>{const o=r;n._sources.has(o)||n._sources.add(o);const s=e.sourceContentFor(r);null!==s&&n.setSourceContent(r,s)}),n.toJSON()}{const e=new(_sourcemap().SourceMapGenerator)({file:r}),o=n.split("\n").length;for(let n=0;n<o;n++)e.addMapping({generated:{line:n+2,column:0},original:{line:n+1,column:0},source:r});return e._sources.add(r),e.setSourceContent(r,n),e.toJSON()}},minifyAfterWrap=e=>{const n=transformInputSourceMapWhenWraped(Object.assign({},e)),r=(0,minifyjs_1.default)(Object.assign(Object.assign({},e),{inputSourceMap:n,code:`(function(){\n${e.code}\n})()`,useTerser:!0}));return r.error?(console.error(r.error),(0,minifyjs_1.default)(Object.assign(Object.assign({},e),{useTerser:!0}))):r};module.exports=minifyAfterWrap;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const config_1=require("../../config"),_pluginTransformWorklet=()=>require("../../utils/babel_plugin_worklet"),babel7=()=>require("@babel/core"),workletCompile=e=>{const{code:r,filePath:l,inputSourceMap:i}=e,o=e.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r);let t=null;try{t=require("@babel/core").transform(r,{babelrc:!1,plugins:[require("../../utils/babel_plugin_worklet")],sourceFileName:l,inputSourceMap:i,sourceMaps:!0,configFile:!1})}catch(e){return{error:{message:`file: ${l}\n ${e.message}`,code:config_1.BABEL_TRANS_JS_ERR}}}let s=(null==t?void 0:t.code)||r;const u=(null==t?void 0:t.map)||i;return o&&(s=s.replace(/^"use strict";/,"")),{code:s,map:u,helpers:[]}};module.exports=workletCompile;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkRequiredPrivateInfos=exports.checkResolveAlias=exports.checkRenderer=exports.checkOpenDataContext=exports.getAppJSONVariableDecalearProperty=exports.checkEntranceDeclare=exports.checkComponentPath=exports.checkMainPkgPluginIsInSubPkg=exports.checkMainPkgPageIsInSubpkg=exports.checkTabbarPage=exports.checkEntryPagePath=exports.checkPreloadRule=exports.checkFunctionalPages=exports.checkNavigateToMiniProgramAppIdList=exports.checkPlugins=exports.checkSubpackages=exports.checkSitemapLocation=exports.checkMainPkgPages=exports.checkOpenLocationPagePath=exports.checkWorkers=exports.checkTabbar=exports.checkWindow=exports.checkPageExist=void 0;const tslib_1=require("tslib"),lodash_1=tslib_1.__importDefault(require("lodash")),config_1=require("../../../config"),common_1=require("../common"),common_2=require("../../../utils/common"),tools_1=require("../../../utils/tools"),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),schemaValidate_1=require("../../validate/schemaValidate"),projectconfig_1=require("../projectconfig");function checkPageExist(o,e,t){const{miniprogramRoot:a,project:c,filePath:n}=o;c.stat(a,e+".wxml")||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(t,e+".wxml"),code:config_1.FILE_NOT_FOUND,filePath:n}),c.stat(a,e+".js")||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(t,e+".js"),code:config_1.FILE_NOT_FOUND,filePath:n})}function checkWindow(o){const{inputJSON:e,mode:t}=o;let a=""+o.filePath;e.themeLocation&&(a+=` or ${e.themeLocation}["${t}"]`);const c=[],{window:n}=e;n&&(void 0!==n.navigationBarBackgroundColor&&((0,tools_1.isHexColor)(n.navigationBarBackgroundColor)||c.push(`["window"]["navigationBarBackgroundColor"]: "${n.navigationBarBackgroundColor}" is not hexColor`)),void 0!==n.backgroundColor&&((0,tools_1.isHexColor)(n.backgroundColor)||c.push(`["window"]["backgroundColor"]: "${n.backgroundColor}" is not hexColor`)),c.length>0&&(0,common_2.throwError)({msg:c.join("\n"),filePath:a}))}function checkTabbar(o){const{project:e,miniprogramRoot:t,inputJSON:a,mode:c}=o;let n=""+o.filePath;a.themeLocation&&(n+=` or ${a.themeLocation}["${c}"]`);const{tabBar:r}=a,i=e.attrSync(),{setting:s}=i;if(!r)return;const l=[];r.list.length<s.MinTabbarCount&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_TABBAR_AT_LEAST.format(s.MinTabbarCount),filePath:n});const f=r.custom?s.MaxCustomTabbarCount:s.MaxTabbarCount;r.list.length>f&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_TABBAR_AT_MOST.format(f),filePath:n});for(let o=0;o<r.list.length;o++){const a=r.list[o],{pagePath:c}=a;if((0,common_2.checkPath)({value:c,tips:`["tabBar"]["list"][${o}]["pagePath"]`,filePath:n}),!c){l.push(locales_1.default.config.JSON_TABBAR_PATH_EMPTY.format(o));continue}c.indexOf("?")>=0&&l.push(locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format(`["tabBar"]["list"][${o}]["pagePath"]`,"?")),c.indexOf(".")>=0&&l.push(locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format(`["tabBar"]["list"][${o}]["pagePath"]`,"."));const i=r.list.slice(0,o).findIndex(o=>o.pagePath===c);i>=0&&l.push(locales_1.default.config.JSON_TABBAR_PATH_SAME_WITH_OTHER.format(o,i));const f=[];a.iconPath&&((0,common_2.checkPath)({value:a.iconPath,tips:`["tabBar"]["list"][${o}]["iconPath"]`,filePath:n,checkPathType:common_2.ECheckPathType.TAB_BAR_ICON}),f.push({name:"iconPath",path:a.iconPath})),a.selectedIconPath&&((0,common_2.checkPath)({value:a.selectedIconPath,tips:`["tabBar"]["list"][${o}]["selectedIconPath"]`,filePath:n,checkPathType:common_2.ECheckPathType.TAB_BAR_ICON}),f.push({name:"selectedIconPath",path:a.selectedIconPath})),f.forEach(a=>{const c=e.stat(t,a.path);if(!c)return void l.push(locales_1.default.config.NOT_FOUND.format(`["tabBar"]["list"][${o}]["${a.name}"]: "${a.path}"`));if(c.isDirectory)return void l.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(`["tabBar"]["list"][${o}]["${a.name}"]`,locales_1.default.config.FILE));c.size>1024*s.MaxTabbarIconSize&&l.push(locales_1.default.config.JSON_TABBAR_ICON_MAX_SIZE.format([o,a.name,s.MaxTabbarIconSize]));const n=path_1.default.posix.extname(a.path);config_1.TABBAR_ICON_WHITE_LIST.indexOf(n)<0&&l.push(locales_1.default.config.JSON_TABBAR_ICON_EXT.format([o,a.name,config_1.TABBAR_ICON_WHITE_LIST.join("、")]))})}l.length>0&&(0,common_2.throwError)({msg:l.join("\n"),filePath:n})}function checkWorkers(o){const{project:e,miniprogramRoot:t,filePath:a,inputJSON:c}=o,{workers:n}=c;if(void 0===n)return;const r='["workers"]';""===n&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(r,locales_1.default.config.DIRECTORY),filePath:a});const i=(0,tools_1.getWorkersPath)(n);(0,common_2.checkPath)({value:i,tips:r,filePath:a});const s=e.stat(t,i);s&&s.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([r,locales_1.default.config.DIRECTORY]),filePath:a}),"string"==typeof c.workers?c.workers=(0,tools_1.normalizePath)(c.workers+"/"):c.workers.path=(0,tools_1.normalizePath)(c.workers.path+"/")}function checkOpenLocationPagePath(o){const{filePath:e,inputJSON:t}=o,{openLocationPagePath:a}=t;if(void 0===a)return;const c='["openLocationPagePath"]';(0,common_2.checkPath)({value:a,tips:c,filePath:e}),checkPageExist(o,a,c)}exports.checkPageExist=checkPageExist,exports.checkWindow=checkWindow,exports.checkTabbar=checkTabbar,exports.checkWorkers=checkWorkers,exports.checkOpenLocationPagePath=checkOpenLocationPagePath;const checkMainPkgPages=o=>{const{filePath:e,inputJSON:t}=o,{pages:a}=t;if(!a)return;const c={};for(let t=0;t<a.length;t++){const n=a[t],r=`["pages"][${t}]`;(0,common_2.checkPath)({value:n,tips:r,filePath:e}),c[n]&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_PAGES_REPEAT.format(`"${n}"`,'["pages"]'),filePath:e}),c[n]=!0,checkPageExist(o,n,r)}};function checkSitemapLocation(o){const{filePath:e,inputJSON:t}=o,{sitemapLocation:a}=t;if(void 0===a)return;const{project:c,miniprogramRoot:n}=o,r='["sitemapLocation"]';(0,common_2.checkPath)({value:a,tips:r,filePath:e});const i=c.stat(n,a);i&&!i.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(r,a),filePath:e});".json"!==path_1.default.posix.extname(a)&&(0,common_2.throwError)({msg:locales_1.default.config.EXT_SHOULD_BE_ERROR.format(r,".json"),filePath:e});const s=c.getFile(n,a),l=(0,common_2.checkUTF8)(s,a),f=(0,common_1.checkJSONFormat)(l,a),h=(0,schemaValidate_1.schemaValidate)("sitemap",f);if(h.error.length){const o=h.error.map(o=>"type"===o.errorType||"enum"===o.errorType||"anyOf"===o.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([o.errorProperty,o.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([o.requireProperty])).join("\n");(0,common_2.throwError)({msg:o,filePath:a})}}function checkSubpackages(o){const{project:e,miniprogramRoot:t,filePath:a,inputJSON:c}=o;let n='["subPackages"]';c.subpackages&&(n='["subpackages"]',c.subPackages=c.subpackages,delete c.subpackages);const r=[];if(c.subPackages){const i=e.attrSync(),{setting:s}=i;c.subPackages.length>s.MaxSubPackageLimit&&(0,common_2.throwError)({msg:locales_1.default.config.EXCEED_LIMIT.format([n,s.MaxSubPackageLimit]),filePath:a});const l={},f={};for(let i=0;i<c.subPackages.length;i++){const s=c.subPackages[i],h=`${n}[${i}]`;if((0,common_2.checkPath)({value:s.root,tips:`${n}[${i}]["root"]`,filePath:a}),s.root===config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${i}]["root"]`,config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT));continue}if(s.name){if(s.name===config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${i}]["name"]`,config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT));continue}if(f[s.name]){r.push(locales_1.default.config.SAME_ITEM.format(h,f[s.name],"name"));continue}f[s.name]=h}if(s.root=(0,tools_1.normalizePath)(s.root+"/"),l[s.root]){r.push(locales_1.default.config.SAME_ITEM.format(h,l[s.root],"root"));continue}l[s.root]=h;const _=e.stat(t,s.root);if(!_){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([`${n}[${i}]["root"]`,locales_1.default.config.DIRECTORY]));continue}if(!_.isDirectory){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([`${n}[${i}]["root"]`,locales_1.default.config.DIRECTORY]));continue}const p={};for(let e=0,t=s.pages.length;e<t;e++){const t=s.pages[e];(0,common_2.checkPath)({value:t,tips:`${n}[${i}]["pages"][${e}]`,filePath:a});const c=(0,tools_1.normalizePath)(path_1.default.posix.join(s.root,t));p[c]?r.push(locales_1.default.config.JSON_PAGES_REPEAT.format([`"${t}"`,`${n}[${i}]`])):(p[c]=!0,checkPageExist(o,c,`${n}[${i}]["pages"][${e}]`))}}r.length>0&&(0,common_2.throwError)({msg:r.join("\n"),filePath:a});for(let o=0;o<c.subPackages.length;o++){const e=c.subPackages[o];let t=-1;const a="/"+e.root;c.subPackages.forEach((e,c)=>{if(c!==o&&e.root){const o="/"+e.root;0===a.indexOf(o)&&(t=c)}}),-1===t||r.push(locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format(`${n}[${t}]["root"]`,`${n}[${o}]["root"]`))}r.length>0&&(0,common_2.throwError)({msg:r.join("\n"),filePath:a})}}function checkPlugins(o){const{filePath:e,inputJSON:t,project:a}=o,c=[],n=t.plugins||{},r=(0,projectconfig_1.getProjectConfigJSON)(a);function i(o,e){var t;const{appid:n}=a,i=a.type===config_1.COMPILE_TYPE.miniProgramPlugin;if(i||"dev"!==o.version)if(i)"dev"===o.version&&o.provider!==n&&o.provider!==r.pluginAppid?c.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(e+'["provider"]',`"${null!==(t=r.pluginAppid)&&void 0!==t?t:n}"`)):o.provider===n&&"dev"!==o.version&&c.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(e+'["version"]','"dev"'));else{if("dev"===o.version||"latest"===o.version||/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/.test(o.version)||/^dev-[A-Za-z0-9]+$/.test(o.version))return!0;c.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([e+'["version"]',locales_1.default.config.TRIPLE_NUMBER_DOT]))}else c.push(`${locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(e+'["version"]',"dev")}\n${locales_1.default.config.PLEASE_CHOOSE_PLUGIN_MODE}`)}for(const o in n){i(n[o],`["plugins"]["${o}"]`)}t.subPackages&&t.subPackages.forEach((o,e)=>{if(!o.plugins)return;const t=`["subPackages"][${e}]`;for(const e in o.plugins){i(o.plugins[e],`${t}["plugins"]["${e}"]`)}}),c.length>0&&(0,common_2.throwError)({msg:c.join("\n"),filePath:e})}function checkNavigateToMiniProgramAppIdList(o){const{filePath:e,inputJSON:t,project:a}=o,c=[];if(t.navigateToMiniProgramAppIdList){const o=a.attrSync(),{appType:e=config_1.APP_TYPE.NORMAL,setting:n}=o;if(e!==config_1.APP_TYPE.NATIVE){const o=null==n?void 0:n.NavigateMiniprogramLimit;t.navigateToMiniProgramAppIdList.length>o&&c.push(locales_1.default.config.EXCEED_LIMIT.format('["navigateToMiniProgramAppIdList"]',o))}}c.length>0&&(0,common_2.throwError)({msg:c.join("\n"),filePath:e})}function checkFunctionalPages(o){const{inputJSON:e}=o;if(e.functionalPages&&"object"!==(0,tools_1.getType)(e.functionalPages)){const o='["functionalPages"] 配置需要更新,详见文档: https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages.html';e.__warning__?e.__warning__=`${e.__warning__}\n${o}`:e.__warning__=o}}function checkPreloadRule(o,e){const{inputJSON:t,filePath:a}=o,{preloadRule:c,subPackages:n}=t;if(!c||!n)return;const r=[],i={},s={},l={};e.forEach(o=>{i[o.root]=!0,l[o.path]=!0,o.name&&(s[o.name]=!0)});for(const o in c){if(!l[o]&&!o.includes("__plugin__/")){r.push(locales_1.default.config.NOT_FOUND.format(`["preloadRule"]["${o}"]: ${locales_1.default.config.PAGE_PATH}`));continue}const e=c[o];for(let t=0,a=e.packages.length;t<a;t++){let a=e.packages[t];a!==config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT&&(s[a]||(a=(0,tools_1.normalizePath)(a+"/"),i[a]||r.push(locales_1.default.config.NOT_FOUND.format(`["preloadRule"]["${o}"]["packages"][${t}]: ${a}`))))}}r.length>0&&(0,common_2.throwError)({msg:r.join("\n"),filePath:a})}function checkEntryPagePath(o,e){const{inputJSON:t,filePath:a}=o,{entryPagePath:c}=t;if(!c)return;(0,common_2.checkPath)({value:c,tips:'["entryPagePath"]',filePath:a});let n=!1;for(const o of e)if(o.path===c){n=!0;break}n||(0,common_2.throwError)({msg:locales_1.default.config.JSON_ENTRY_PAGE_PATH_NOT_FOUND.format(["pages、subPackages","entryPagePath"]),filePath:a})}function checkTabbarPage(o){const{filePath:e,inputJSON:t}=o,{tabBar:a,pages:c=[]}=t;if(!a)return;const n=[];for(let o=0;o<a.list.length;o++){const e=a.list[o],{pagePath:t}=e;c.indexOf(t)<0&&n.push(`["tabBar"][${o}]["pagePath"]: "${t}" need in ["pages"]`)}n.length>0&&(0,common_2.throwError)({msg:n.join("\n"),filePath:e})}function checkMainPkgPageIsInSubpkg(o){const{filePath:e,inputJSON:t}=o,{subPackages:a,pages:c=[]}=t;if(!a)return;const n=[];for(let o=0;o<a.length;o++){const e=a[o];for(let t=0;t<c.length;t++){const a=c[t];0===a.indexOf(e.root)&&n.push(locales_1.default.config.SHOULD_NOT_IN.format([`["pages"][${t}]: "${a}"`,`["subPackages"][${o}]`]))}}n.length>0&&(0,common_2.throwError)({msg:n.join("\n"),filePath:e})}function checkMainPkgPluginIsInSubPkg(o){const{filePath:e,inputJSON:t}=o,{plugins:a={},subPackages:c}=t,n={},r={},i=[];for(const o in a){const e=a[o],t=`["plugins"]["${o}"]`;n[e.provider]?i.push(locales_1.default.config.SAME_ITEM.format(`["plugins"]["${o}"]`,n[e.provider].tips,"provider")):n[e.provider]=r[o]={provider:e.provider,version:e.version,alias:o,tips:t}}if(c)for(let o=0;o<c.length;o++){const e=c[o];if(e.plugins)for(const t in e.plugins){const a=`["subPackages"][${o}]["plugins"]`,c=e.plugins[t];n[c.provider]?i.push(locales_1.default.config.SAME_ITEM.format(`${a}["${t}"]`,n[c.provider].tips,"provider")):r[t]?i.push(locales_1.default.config.PLUGINS_SAME_ALIAS.format(`${a}["${t}"]`,r[t].tips)):n[c.provider]=r[t]={provider:c.provider,version:c.version,alias:c,tips:a}}}i.length>0&&(0,common_2.throwError)({msg:i.join("\n"),filePath:e})}function checkComponentPath(o){const{project:e,miniprogramRoot:t,filePath:a,inputJSON:c}=o;(0,common_1.checkComponentPath)({project:e,root:t,relativePath:path_1.default.posix.relative(t,a),inputJSON:c})}function checkEntranceDeclare(o){const e=o.inputJSON;if(!e.entranceDeclare||!e.entranceDeclare.locationMessage)return;let t=e.pages||[];e.subpackages&&(t=t.concat(e.subpackages.map(o=>o.pages.map(e=>o.root+e))),t=lodash_1.default.flattenDeep(t)),e.subPackages&&(t=t.concat(e.subPackages.map(o=>o.pages.map(e=>o.root+e))),t=lodash_1.default.flattenDeep(t));const a=[],c=e.entranceDeclare.locationMessage.path;void 0===c?a.push(locales_1.default.config.JSON_ENTRANCE_DECLARE_PATH_EMPTY.format([])):t.includes(c)||a.push(locales_1.default.config.JSON_ENTRANCE_DECLARE_PATH_ERR.format([c||"undefined"])),a.length>0&&(0,common_2.throwError)({msg:a.join("\n"),filePath:o.filePath})}function getAppJSONVariableDecalearProperty(o){const{windowPropertWhiteList:e,tabBarPropertyWhiteList:t,tabbarListItemPropertyWhiteList:a}=config_1.jsonVariablePropertyWhiteList;let c=[];return"[object Object]"===Object.prototype.toString.call(o.window)&&(c=c.concat(Object.keys(o.window).filter(o=>e.includes(o)).map(e=>({property:`["window"]["${e}"]`,value:o.window[e]})).filter(o=>o.value.startsWith("@")))),"[object Object]"===Object.prototype.toString.call(o.tabBar)&&(c=c.concat(Object.keys(o.tabBar).filter(o=>t.includes(o)).map(e=>({property:`["tabBar"]["${e}"]`,value:o.tabBar[e]})).filter(o=>o.value.startsWith("@"))),Array.isArray(o.tabBar.list)&&o.tabBar.list.forEach((e,t)=>{c=c.concat(Object.keys(e).filter(o=>a.includes(o)).map(e=>({property:`["tabBar"]["list"][${t}]["${e}"]`,value:o.tabBar.list[t][e]})).filter(o=>o.value.startsWith("@")))})),c}function checkOpenDataContext(o,e){const{project:t,miniprogramRoot:a,filePath:c}=o,{openDataContext:n}=e;if(void 0===n)return;(0,common_2.checkPath)({value:n,tips:'["openDataContext"]',filePath:c});const r=t.stat(a,n);r&&r.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(['["openDataContext"]',locales_1.default.config.DIRECTORY]),filePath:c});const i=path_1.default.posix.join(n,"./index.js"),s=t.stat(a,i);s&&s.isFile||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["openDataContext"]',i),filePath:c}),e.openDataContext=(0,tools_1.normalizePath)(n+"/")}function checkRenderer(o){const{filePath:e,inputJSON:t}=o,{renderer:a,lazyCodeLoading:c}=t;"skyline"===a&&"requiredComponents"!==c&&(0,common_2.throwError)({msg:locales_1.default.config.APP_JSON_SHOULD_SET_LAZYCODELOADING.format("app.json"),filePath:e})}function checkResolveAlias(o){const{filePath:e,inputJSON:t}=o,{resolveAlias:a}=t;if(a){const o=o=>o.includes("//");for(const t in a)(o(t)||o(a[t]))&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_RESOLVE_ALIAS_ILLEGAL.format(t,a[t]),filePath:e}),a[t].startsWith("./")&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_RESOLVE_ALIAS_SHOULD_NOT_START_WITH.format(a[t]),filePath:e}),t.endsWith("/*")&&a[t].endsWith("/*")||(0,common_2.throwError)({msg:locales_1.default.config.JSON_RESOLVE_ALIAS_INCLUDE_STAR.format(t,a[t]),filePath:e})}}exports.checkMainPkgPages=checkMainPkgPages,exports.checkSitemapLocation=checkSitemapLocation,exports.checkSubpackages=checkSubpackages,exports.checkPlugins=checkPlugins,exports.checkNavigateToMiniProgramAppIdList=checkNavigateToMiniProgramAppIdList,exports.checkFunctionalPages=checkFunctionalPages,exports.checkPreloadRule=checkPreloadRule,exports.checkEntryPagePath=checkEntryPagePath,exports.checkTabbarPage=checkTabbarPage,exports.checkMainPkgPageIsInSubpkg=checkMainPkgPageIsInSubpkg,exports.checkMainPkgPluginIsInSubPkg=checkMainPkgPluginIsInSubPkg,exports.checkComponentPath=checkComponentPath,exports.checkEntranceDeclare=checkEntranceDeclare,exports.getAppJSONVariableDecalearProperty=getAppJSONVariableDecalearProperty,exports.checkOpenDataContext=checkOpenDataContext,exports.checkRenderer=checkRenderer,exports.checkResolveAlias=checkResolveAlias;const detailLocationApis={getLocation:!0,onLocationChange:!0,startLocationUpdate:!0,startLocationUpdateBackground:!0};function checkRequiredPrivateInfos(o){const{filePath:e,inputJSON:t}=o,{requiredPrivateInfos:a}=t;if(a){if(a.indexOf("getFuzzyLocation")>=0){const o=[];for(let e=0;e<a.length;e++){const t=a[e];detailLocationApis[t]&&o.push(`'${t}'`)}o.length>0&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_REQUIRED_PRIVATE_INFOS_MUTUALLY_EXCLUSIVE.format("'getFuzzyLocation'",o.join("、")),filePath:e})}}}exports.checkRequiredPrivateInfos=checkRequiredPrivateInfos;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAppJSON=exports.getRawAppJSON=exports.checkAppJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),projectconfig_1=require("../projectconfig"),common_1=require("../../../utils/common"),config_1=require("../../../config"),common_2=require("../common"),cache_1=require("../../../utils/cache"),lodash_1=require("lodash"),schemaValidate_1=require("../../validate/schemaValidate"),tools_1=require("../../../utils/tools"),theme_1=require("../theme"),reactiveCache_1=require("../reactiveCache"),checkAppFields_1=require("./checkAppFields");function transValidateResult(e){return e.error.map(e=>{if("type"===e.errorType||"enum"===e.errorType||"anyOf"===e.errorType)return locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([e.errorProperty,e.correctType]);{const c=""===e.errorProperty?e.requireProperty:`${e.errorProperty}.${e.requireProperty}`;return locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([c])}}).join("\n")}function checkAppJSON(e){const{inputJSON:c}=e;let{filePath:r}=e;const a=(0,theme_1.getThemeLocation)(e.project);if(!a){const e=(0,checkAppFields_1.getAppJSONVariableDecalearProperty)(c);e.length&&(0,common_1.throwError)({msg:'appJSON["themeLocation"] is required because:\n'+e.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}`).join("\n"),filePath:r})}let o={light:{},dark:{}};a&&(o=(0,theme_1.checkThemeJSON)(e.project,{themeLocation:a}));const t=(0,theme_1.mergeThemeJSONToAppJSON)(o,c),p=(0,checkAppFields_1.getAppJSONVariableDecalearProperty)(t.appJSONLight);p.length&&(0,common_1.throwError)({msg:p.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}, but not found at ${a}["light"]`).join("\n"),filePath:r});const i=(0,checkAppFields_1.getAppJSONVariableDecalearProperty)(t.appJSONDark);i.length&&(0,common_1.throwError)({msg:i.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}, but not found at ${a}["dark"]`).join("\n"),filePath:r});const n=(0,schemaValidate_1.schemaValidate)("app",t.appJSONLight),l=(0,schemaValidate_1.schemaValidate)("app",t.appJSONDark);if(n.warning&&(c.__warning__=locales_1.default.config.INVALID.format(n.warning)),a&&l.warning&&(c.__warning__=locales_1.default.config.INVALID.format(l.warning)),n.error.length){const e=transValidateResult(n);a&&(r+=` or ${a}["light"]`),(0,common_1.throwError)({msg:e,filePath:r})}if(a&&l.error.length){const e=transValidateResult(l);a&&(r+=` or ${a}["dark"]`),(0,common_1.throwError)({msg:e,filePath:r})}const s=Object.assign(Object.assign({},e),{mode:"light",inputJSON:t.appJSONLight}),h=Object.assign(Object.assign({},e),{mode:"dark",inputJSON:t.appJSONDark});(0,checkAppFields_1.checkMainPkgPages)(e),(0,checkAppFields_1.checkSubpackages)(e),(0,checkAppFields_1.checkTabbar)(s),a&&(0,checkAppFields_1.checkTabbar)(h),(0,checkAppFields_1.checkWorkers)(e),(0,checkAppFields_1.checkFunctionalPages)(e),(0,checkAppFields_1.checkOpenLocationPagePath)(e),(0,checkAppFields_1.checkOpenDataContext)(e,c),(0,checkAppFields_1.checkPlugins)(e),(0,checkAppFields_1.checkWindow)(s),a&&(0,checkAppFields_1.checkWindow)(h),(0,checkAppFields_1.checkComponentPath)(e);const _=(0,common_1.getAllPagesInfo)(c);return(0,checkAppFields_1.checkEntryPagePath)(e,_),(0,checkAppFields_1.checkPreloadRule)(e,_),(0,checkAppFields_1.checkTabbarPage)(e),(0,checkAppFields_1.checkMainPkgPageIsInSubpkg)(e),(0,checkAppFields_1.checkMainPkgPluginIsInSubPkg)(e),(0,checkAppFields_1.checkEntranceDeclare)(e),(0,checkAppFields_1.checkRenderer)(e),(0,checkAppFields_1.checkResolveAlias)(e),(0,checkAppFields_1.checkRequiredPrivateInfos)(e),c}exports.checkAppJSON=checkAppJSON,exports.getRawAppJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.RAW_APP_JSON,e=>{const c=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:r=""}=c,a=(0,tools_1.normalizePath)(path_1.default.posix.join(r,"app.json"));e.stat(r,"app.json")||(""===r?(0,common_1.throwError)({msg:locales_1.default.config.NOT_FOUND_IN_ROOT_DIR.format(a),code:config_1.FILE_NOT_FOUND,filePath:a}):(0,common_1.throwError)({msg:locales_1.default.config.MINIPROGRAM_APP_JSON_NOT_FOUND.format(r,"app.json"),code:config_1.FILE_NOT_FOUND,filePath:a}));const o=e.getFile(r,"app.json");return(0,common_2.checkJSONFormat)((0,common_1.checkUTF8)(o,a),a)}),exports.getAppJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.APP_JSON,e=>{const c=(0,lodash_1.cloneDeep)((0,exports.getRawAppJSON)(e)),r=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:a=""}=r;return checkAppJSON({project:e,miniprogramRoot:a,filePath:(0,tools_1.normalizePath)(path_1.default.posix.join(a,"app.json")),inputJSON:c}),c});
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getExtJSON=void 0;const tslib_1=require("tslib"),cache_1=require("../../../utils/cache"),common_1=require("../common"),common_2=require("../../../utils/common"),lodash_1=require("lodash"),tools_1=require("../../../utils/tools"),path_1=tslib_1.__importDefault(require("path")),projectconfig_1=require("../projectconfig"),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),schemaValidate_1=require("../../validate/schemaValidate"),theme_1=require("../theme"),checkAppFields_1=require("./checkAppFields"),reactiveCache_1=require("../reactiveCache");function checkExtPages(e){const{project:o,inputJSON:r,filePath:t,miniprogramRoot:c}=e,{extPages:a}=r;if(a)for(const e in a){const r=a[e];if(r){r.navigationBarBackgroundColor&&!(0,tools_1.isHexColor)(r.navigationBarBackgroundColor)&&(0,common_2.throwError)({msg:`["extPages"]["${e}"]["navigationBarBackgroundColor"]: "${r.navigationBarBackgroundColor}" is not hexColor`,filePath:t}),r.backgroundColor&&!(0,tools_1.isHexColor)(r.backgroundColor)&&(0,common_2.throwError)({msg:`["extPages"]["${e}"]["backgroundColor"]: "${r.backgroundColor}" is not hexColor`,filePath:t});try{(0,checkAppFields_1.checkComponentPath)({project:o,miniprogramRoot:c,inputJSON:r,filePath:e+".json"})}catch(o){(0,common_2.throwError)({msg:`["extPages"]["${e}"]${o.message}`,filePath:t})}}}}exports.getExtJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.EXT_JSON,e=>{const o=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:r=""}=o,t=e.attrSync(),c=(0,tools_1.normalizePath)(path_1.default.posix.join(r,"ext.json"));if(!t||!t.platform)return e.stat(r,"ext.json")?{__warning__:locales_1.default.config.EXT_JSON_INVALID.format(e.appid,"https://developers.weixin.qq.com/miniprogram/dev/devtools/ext.html")}:void 0;if(!e.stat(r,"ext.json"))return;const a=e.getFile(r,"ext.json"),i=(0,common_1.checkJSONFormat)((0,common_2.checkUTF8)(a,c),c);if(!i.extEnable)return{};const n=(0,theme_1.getThemeLocation)(e);let l={};n&&(l=(0,theme_1.checkThemeJSON)(e,{themeLocation:n}));const s=(0,theme_1.mergeThemeJSONToAppJSON)(l,i),p=(0,schemaValidate_1.schemaValidate)("ext",s.appJSONLight),_=(0,schemaValidate_1.schemaValidate)("ext",s.appJSONDark);if(p.warning&&(i.__warning__=locales_1.default.config.INVALID.format(p.warning)),_.warning&&(i.__warning__=locales_1.default.config.INVALID.format(_.warning)),p.error.length||_.error.length){const e=p.error.map(e=>"type"===e.errorType||"enum"===e.errorType||"anyOf"===e.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([e.errorProperty,e.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([e.requireProperty])),o=_.error.map(e=>"type"===e.errorType||"enum"===e.errorType||"anyOf"===e.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([e.errorProperty,e.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([e.requireProperty])),r=e.concat(o).join("\n");(0,common_2.throwError)({msg:r,filePath:c})}i.extAppid||(0,common_2.throwError)({msg:""+locales_1.default.config.EXT_APPID_SHOULD_NOT_BE_EMPTY,filePath:c});const h={filePath:c,project:e,miniprogramRoot:r,inputJSON:i},m=(0,lodash_1.cloneDeep)(h);m.inputJSON=s.appJSONLight,m.mode="light";const g=(0,lodash_1.cloneDeep)(h);return g.inputJSON=s.appJSONDark,g.mode="dark",(0,checkAppFields_1.checkMainPkgPages)(h),(0,checkAppFields_1.checkMainPkgPages)(h),(0,checkAppFields_1.checkSubpackages)(h),(0,checkAppFields_1.checkTabbar)(m),(0,checkAppFields_1.checkTabbar)(g),(0,checkAppFields_1.checkWorkers)(h),(0,checkAppFields_1.checkFunctionalPages)(h),(0,checkAppFields_1.checkOpenLocationPagePath)(h),(0,checkAppFields_1.checkPlugins)(h),(0,checkAppFields_1.checkWindow)(m),(0,checkAppFields_1.checkWindow)(g),(0,checkAppFields_1.checkComponentPath)(h),checkExtPages(h),i});
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAppJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),cache_1=require("../../../utils/cache"),lodash_1=require("lodash"),getAppJSON_1=require("./getAppJSON"),getExtJSON_1=require("./getExtJSON"),projectconfig_1=require("../projectconfig"),common_1=require("../../../utils/common"),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),theme_1=require("../theme"),reactiveCache_1=require("../reactiveCache"),tools_1=require("../../../utils/tools");function mergeExtJSON(e,t){if(t)for(const o in t)if("__warning__"!==o){if("extPages"!==o){if("plugins"===o||"supportedMaterials"===o){e[o]=t[o];continue}"object"===(0,tools_1.getType)(t[o])?"object"!==(0,tools_1.getType)(e[o])?e[o]=Object.assign({},t[o]):e[o]=Object.assign({},e[o]||{},t[o]):e[o]=t[o]}}else e.__warning__=e.__warning__?`${e.__warning__}、${t.__warning__}`:t.__warning__}exports.getAppJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.COMPILED_APP_JSON,e=>{const t=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:o=""}=t;let i=(0,getAppJSON_1.getAppJSON)(e);const r=(0,getExtJSON_1.getExtJSON)(e);if(r&&(i=(0,lodash_1.cloneDeep)(i),mergeExtJSON(i,r),r.extEnable))try{const t=(0,theme_1.getThemeLocation)(e);let r={};t&&(r=(0,theme_1.checkThemeJSON)(e,{themeLocation:t}));const _=(0,theme_1.mergeThemeJSONToAppJSON)(r,i);(0,getAppJSON_1.checkAppJSON)({project:e,miniprogramRoot:o,inputJSON:_.appJSONLight,filePath:path_1.default.posix.join(o,"app.json")}),(0,getAppJSON_1.checkAppJSON)({project:e,miniprogramRoot:o,inputJSON:_.appJSONDark,filePath:path_1.default.posix.join(o,"app.json")})}catch(e){(0,common_1.throwError)({msg:e.message,code:e.code,filePath:`app.json ${locales_1.default.config.OR} ext.json`})}return i});
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
package/dist/core/json/common.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.transValidateResult=exports.getPageJSONVariableDecalearProperty=exports.checkComponentPath=exports.getUseExtendLib=exports.checkFilePathIsInIndependentSubpackage=exports.checkPagePathIsInIndependentSubpackage=exports.checkPagePathIsInSubPackage=exports.checkJSONFormat=void 0;const tslib_1=require("tslib"),tools_1=require("../../utils/tools"),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),common_1=require("../../utils/common"),config_1=require("../../config"),lodash_1=require("lodash"),getAppJSON_1=require("./app/getAppJSON");function checkJSONFormat(e,t){let o={};e||(0,common_1.throwError)({filePath:t,msg:"Empty file is NOT a valid json file",code:config_1.JSON_PARSE_ERR});try{o=JSON.parse(e)}catch(o){const n=(0,tools_1.formatJSONParseErr)({filePath:t,data:e,error:o});(0,common_1.throwError)({filePath:t,msg:n,code:config_1.JSON_PARSE_ERR})}return o}function checkPagePathIsInSubPackage(e,t){const{subPackages:o,subpackages:n}=e;if(o||n)for(const e of o||n)if(0===t.indexOf(e.root))return e}function checkPagePathIsInIndependentSubpackage(e,t){const o=checkPagePathIsInSubPackage(e,t);if(o&&!0===o.independent)return o}function checkFilePathIsInIndependentSubpackage(e,t){const{subPackages:o}=e;if(o)for(const e of o)if(!0===e.independent){const o=e.root.replace(/^\//,"");if(0===t.indexOf(o))return o}}function checkNodeModulesFile(e,t,o,n){let a=path_1.default.posix.join(o,"index")+".json",r=e.stat(t,a);return(null==r?void 0:r.isFile)?a:(a=path_1.default.posix.join(o,n)+".json",r=e.stat(t,a),(null==r?void 0:r.isFile)?a:(a=o+".json",r=e.stat(t,a),(null==r?void 0:r.isFile)?a:""))}function resolveComponentPath(e,t,o,n){n=(0,tools_1.normalizePath)(n);let a=path_1.default.posix.join(o,n)+".json";const r=e.stat(t,a);if(null==r?void 0:r.isFile)return n;let i=o.split(path_1.default.posix.sep);for(i=i.filter(e=>!!e),a="";i.length;){if(a=checkNodeModulesFile(e,t,path_1.default.posix.join(i.join(path_1.default.posix.sep),"miniprogram_npm",n),n),a)break;i.pop()}if(!a){a=checkNodeModulesFile(e,t,path_1.default.posix.join("miniprogram_npm",n),n)}return a&&(/\.json$/.test(a)&&(a=a.substring(0,a.length-5)),a=path_1.default.posix.relative(o,a)),a}exports.checkJSONFormat=checkJSONFormat,exports.checkPagePathIsInSubPackage=checkPagePathIsInSubPackage,exports.checkPagePathIsInIndependentSubpackage=checkPagePathIsInIndependentSubpackage,exports.checkFilePathIsInIndependentSubpackage=checkFilePathIsInIndependentSubpackage;const innerCheckComponentPath=e=>{const{value:t,tips:o,project:n,root:a,relativePath:r}=e,i=path_1.default.posix.join(a,r);if(t.startsWith("plugin://")||t.startsWith("plugin-private://"))return t;const s=(0,exports.getUseExtendLib)(n,r);if(t.startsWith("/")){if(s.length){const e=s.map(e=>"/miniprogram_npm/"+e);let o=!1;for(const n of e)if(t.startsWith(n)){o=!0;break}if(o)return t}if(n.stat(a,t+".json"))return t;if(n.stat(a,t+"/index.json"))return t+"/index";(0,common_1.throwError)({msg:locales_1.default.config.NOT_FOUND.format(o),filePath:i})}if(t.startsWith(".")){if(t.startsWith("../")){const e=t.replace(/^(\.\.\/)+/,"");if(n.stat(a,path_1.default.posix.join(`/${e}.json`)))return t;if(n.stat(a,path_1.default.posix.join(`/${e}/index.json`)))return t+"/index"}if(n.stat(a,path_1.default.posix.join(path_1.default.posix.dirname(r),t+".json")))return t;if(n.stat(a,path_1.default.posix.join(path_1.default.posix.dirname(r),t+"/index.json")))return t+"/index";(0,common_1.throwError)({msg:locales_1.default.config.NOT_FOUND.format(`${o}: "${t}"`),filePath:i})}for(const e of s)if(t.startsWith(e))return"miniprogram-element"===e?`/miniprogram_npm/${e}/index`:t.replace(e,"/miniprogram_npm/"+e);const c=resolveComponentPath(n,a,path_1.default.posix.dirname(r),t);return c||(0,common_1.throwError)({msg:locales_1.default.config.NOT_FOUND.format(`${o}: "${t}"`),filePath:i}),c.startsWith(".")?c:"./"+c},getUseExtendLib=(e,t)=>{var o;const n=(0,getAppJSON_1.getRawAppJSON)(e);let a=[];if("[object Object]"===Object.prototype.toString.call(n.useExtendedLib)){const e=Object.keys(config_1.extendedLibMap),t=Object.keys(n.useExtendedLib).filter(t=>!e.includes(t));t.length&&(0,common_1.throwError)({msg:t.join(", ")+' is not allowed in ["useExtendedLib"]',filePath:"app.json"}),a=Object.keys(n.useExtendedLib||{}).filter(e=>n.useExtendedLib[e]).map(e=>config_1.extendedLibMap[e].packages),a=(0,lodash_1.flattenDeep)(a)}const r=checkPagePathIsInSubPackage(n,t);if((null==r?void 0:r.useExtendedLib)&&"[object Object]"===Object.prototype.toString.call(r.useExtendedLib)){const e=Object.keys(config_1.extendedLibMap),t=Object.keys(r.useExtendedLib).filter(t=>!e.includes(t));t.length&&(0,common_1.throwError)({msg:`${t.join(", ")} is not allowed in subPackages[${null===(o=n.subPackages)||void 0===o?void 0:o.indexOf(r)}]["useExtendedLib"]`,filePath:"app.json"});const i=Object.keys(r.useExtendedLib||{}).filter(e=>r.useExtendedLib[e]).map(e=>config_1.extendedLibMap[e].packages);a=(0,lodash_1.uniq)(a.concat((0,lodash_1.flattenDeep)(i)))}return a};exports.getUseExtendLib=getUseExtendLib;const checkComponentPath=e=>{const{project:t,root:o,relativePath:n,inputJSON:a}=e,{usingComponents:r,componentGenerics:i}=a;if(r)for(const e in r){const a=r[e]||"";r[e]=innerCheckComponentPath({tips:`["usingComponents"]["${e}"]`,value:a,project:t,root:o,relativePath:n})}if(i)for(const e in i){const a="object"==typeof i[e],r=a?i[e].default:i[e];if(!r||"string"!=typeof r)continue;const s=innerCheckComponentPath({tips:`["componentGenerics"]["${e}"]`,value:r,project:t,root:o,relativePath:n});a?i[e].default=s:i[e]=s}};function getPageJSONVariableDecalearProperty(e){const{windowPropertWhiteList:t}=config_1.jsonVariablePropertyWhiteList;let o=[];return"[object Object]"===Object.prototype.toString.call(e)&&(o=o.concat(Object.keys(e).filter(e=>t.includes(e)).map(t=>({property:`["${t}"]`,value:e[t]})).filter(e=>e.value.startsWith("@")))),o}function transValidateResult(e){return e.error.map(e=>"type"===e.errorType||"enum"===e.errorType||"anyOf"===e.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([e.errorProperty,e.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([e.requireProperty])).join("\n")}exports.checkComponentPath=checkComponentPath,exports.getPageJSONVariableDecalearProperty=getPageJSONVariableDecalearProperty,exports.transValidateResult=transValidateResult;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
package/dist/core/json/game.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),cache_1=require("../../utils/cache"),common_1=require("../../utils/common"),config_1=require("../../config"),tools_1=require("../../utils/tools"),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),projectconfig_1=require("./projectconfig"),common_2=require("./common"),schemaValidate_1=require("../validate/schemaValidate"),reactiveCache_1=require("./reactiveCache"),signatureValidate=require("../validate/signaturejson"),gamePluginJSONValidate=require("../validate/gamepluginjson");function isPluginMode(o){return o.type===config_1.COMPILE_TYPE.miniGamePlugin}function checkLocalPlugin(o,t){const{project:e,root:a,filePath:r}=o,i=t.path;let n=e.stat(a,i);n&&n.isDirectory||(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(t.tips+'["path"]',locales_1.default.config.DIRECTORY),filePath:r});const c=path_1.default.posix.join(i,"signature.json");n=e.stat(a,c);let _=(0,tools_1.normalizePath)(path_1.default.posix.join(a,c));n||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(t.tips+'["path"]',_),filePath:r,code:config_1.FILE_NOT_FOUND});let s=e.getFile(a,c),l=(0,common_1.checkUTF8)(s,_);const f=(0,common_2.checkJSONFormat)(l,_);try{signatureValidate.check(f)}catch(o){(0,common_1.throwError)({msg:"signature.json"+o.message,filePath:_})}f.provider!==t.provider&&(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format('["provider"]',`"${t.provider}"`),filePath:_});for(let o=0;o<f.signature.length;o++){const t=f.signature[o];(0,common_1.checkPath)({value:t.path,tips:`["signature"][${o}]["path"]`,filePath:_});const r=path_1.default.posix.join(i,t.path);n=e.stat(a,r),n&&n.isFile||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["signature"][${o}]["path"]`,r),filePath:_,code:config_1.FILE_NOT_FOUND});const c=e.getFile(a,r),s=(0,tools_1.generateMD5)(c);s!==t.md5&&(0,common_1.throwError)({msg:locales_1.default.config.GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT.format(path_1.default.posix.join(i,t.path),s,t.md5),code:config_1.GAME_PLUGIN_LIB_MD5_NOT_MATCH,filePath:_})}const m=path_1.default.posix.join(i,"plugin.json");n=e.stat(a,m),_=(0,tools_1.normalizePath)(path_1.default.posix.join(a,m)),n||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(t.tips+'["path"]',_),code:config_1.FILE_NOT_FOUND,filePath:r}),s=e.getFile(a,m),l=(0,common_1.checkUTF8)(s,_);const g=(0,common_2.checkJSONFormat)(l,_);try{gamePluginJSONValidate.check(g)}catch(o){(0,common_1.throwError)({msg:"plugin.json"+o.message,filePath:_})}g.main&&((0,common_1.checkPath)({value:g.main,tips:'["main"]',filePath:_}),n=e.stat(a,path_1.default.posix.join(i,g.main)),n||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["main"]',""+g.main),filePath:_,code:config_1.FILE_NOT_FOUND}))}function checkPluginPath(o,t){const{subPackages:e}=t,a=[],r=(o,t,e)=>{const{plugins:r}=o;if(r)for(const o in r){if(!r.hasOwnProperty(o))continue;const i=r[o];i&&i.path&&a.push({alias:o,version:i.version||"",provider:i.provider||"",tips:`${e}["plugins"]["${o}"]`,path:(0,tools_1.normalizePath)(path_1.default.posix.join(t,i.path))})}};if(r(t,"",""),e)for(let o=0;o<e.length;o++){const t=e[o];r(t,t.root||"",`["subPackages"][${o}]`)}if(!(a.length<=0))for(const t of a)checkLocalPlugin(o,t)}function checkPlugins(o,t){const{project:e,filePath:a}=o,r=[],i=t.plugins||{};function n(o,t){const i=e.appid,n=isPluginMode(e);if(n||"dev"!==o.version)if(n&&"dev"===o.version&&o.provider!==i)r.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(t+'["provider"]',i));else if("dev"!==o.version||"string"!=typeof o.path){if("dev"===o.version||"latest"===o.version||/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/.test(o.version)||/^dev-[A-Za-z0-9]+$/.test(o.version))return o.path&&(0,common_1.checkPath)({value:o.path,tips:t+'["path"]',filePath:a}),!0;r.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(t+'["version"]',locales_1.default.config.TRIPLE_NUMBER_DOT))}else r.push(locales_1.default.config.GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH.format(t,t+'["path"]'));else r.push(`${locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(t+'["version"]',"dev")}\n${locales_1.default.config.PLEASE_CHOOSE_PLUGIN_MODE}`)}const c={},_={};for(const o in i){if(!i.hasOwnProperty(o))continue;const t=i[o];n(t,`["plugins"]["${o}"]`)&&(c[t.provider]?r.push(locales_1.default.config.SAME_ITEM.format(`["plugins"]["${o}"]`,c[t.provider].tips,"provider")):c[t.provider]=_[o]={provider:t.provider,version:t.version,alias:o,path:t.path||"",tips:`["plugins"]["${o}"]`})}const s=t.subPackages||t.subpackages;if(Array.isArray(s))for(let o=0,t=s.length;o<t;o++){const t=s[o];if(!t.plugins)continue;const e=`["subPackages"][${o}]["plugins"]`;for(const o in t.plugins){const a=t.plugins[o],i=`${e}["${o}"]`;n(a,i)&&(c[a.provider]?r.push(locales_1.default.config.SAME_ITEM.format(i,c[a.provider].tips,"provider")):_[o]?r.push(locales_1.default.config.PLUGINS_SAME_ALIAS.format(i,_[o].tips)):c[a.provider]=_[o]={provider:a.provider,version:a.version,alias:o,path:a.path||"",tips:i})}}r.length>0&&(0,common_1.throwError)({msg:r.join("\n"),filePath:a})}function checkSubpackages(o,t){const{root:e,project:a,filePath:r}=o,i=[];let n='["subPackages"]';if(t.subpackages&&(n='["subpackages"]',t.subPackages=t.subpackages,delete t.subpackages),t.subPackages){const o=a.attrSync(),{setting:c}=o;t.subPackages.length>c.MaxSubPackageLimit&&(0,common_1.throwError)({msg:locales_1.default.config.EXCEED_LIMIT.format([n,c.MaxSubPackageLimit]),filePath:r});const _={},s={};for(let o=0,r=t.subPackages.length;o<r;o++){const r=t.subPackages[o];if(r.name){if(r.name===config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["name"]`,config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT));continue}if(r.name===config_1.MINI_GAME_MAIN_PACKAGE_ROOT){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["name"]`,config_1.MINI_GAME_MAIN_PACKAGE_ROOT));continue}_[r.name]&&i.push(locales_1.default.config.SAME_ITEM.format(`${n}[${o}]`,_[r.name],"name")),_[r.name]=`${n}[${o}]`}if(r.root===config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["root"]`,config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT));continue}if(r.root===config_1.MINI_GAME_MAIN_PACKAGE_ROOT){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["root"]`,config_1.MINI_GAME_MAIN_PACKAGE_ROOT));continue}if(r.root===config_1.MINI_GAME_WORKERS_PACKAGE_ROOT){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["root"]`,config_1.MINI_GAME_WORKERS_PACKAGE_ROOT));continue}if(r.root==="/"+config_1.MINI_GAME_WORKERS_PACKAGE_ROOT){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["root"]`,"/"+config_1.MINI_GAME_WORKERS_PACKAGE_ROOT));continue}if(r.root.startsWith(".")){i.push(locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format(`${n}[${o}]["root"]`,"."));continue}if(r.root.startsWith("__wx__")){i.push(locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format(`${n}[${o}]["root"]`,"__wx__"));continue}r.root.startsWith("/")||(r.root=(0,tools_1.normalizePath)("/"+r.root)),/\.js$/.test(r.root)?r.root=(0,tools_1.normalizePath)(r.root):r.root=(0,tools_1.normalizePath)(r.root+"/"),s[r.root]&&i.push(locales_1.default.config.SAME_ITEM.format(`${n}[${o}]`,s[r.root],"root")),s[r.root]=`${n}[${o}]`;const c=a.stat(e,r.root);if(c){if(c.isDirectory){/\/$/.test(r.root)||(r.root+="/");const t=path_1.default.posix.join(r.root,"./game.js"),c=a.stat(e,t);c&&c.isFile||i.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`${n}[${o}]["root"]`,t))}}else i.push(locales_1.default.config.JSON_CONTENT_NOT_FOUND.format(`${n}[${o}]["root"]`))}}i.length>0&&(0,common_1.throwError)({msg:i.join("\n"),filePath:r})}function checkLoadingImageUrl(o,t){const{project:e,root:a,filePath:r}=o,{loadingImageInfo:i}=t;if(!i)return;(0,common_1.checkPath)({tips:'["loadingImageInfo"]["path"]',value:i.path,filePath:r});const n=e.stat(a,i.path);n&&n.isFile||(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_NOT_FOUND.format(`["loadingImageInfo"]["path"]: "${i.path}"`),filePath:r}),i.progressBarColor&&!(0,tools_1.isHexColor)(i.progressBarColor)&&(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(`["loadingImageInfo"]["progressBarColor"]: "${i.progressBarColor}"`,"HexColor"),filePath:r})}function checkWorkers(o,t){const{project:e,root:a,filePath:r}=o,{workers:i}=t;if(void 0===i)return;const n=(0,tools_1.getWorkersPath)(i);(0,common_1.checkPath)({tips:'["workers"]',value:n,filePath:r});const c=e.stat(a,n);c&&!c.isFile||(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(['["workers"]',locales_1.default.config.DIRECTORY]),filePath:r})}function checkOpenDataContext(o,t){const{project:e,root:a,filePath:r}=o,{openDataContext:i}=t;if(void 0===i)return;(0,common_1.checkPath)({value:i,tips:'["openDataContext"]',filePath:r});const n=e.stat(a,i);n&&n.isDirectory||(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(['["openDataContext"]',locales_1.default.config.DIRECTORY]),filePath:r});const c=path_1.default.posix.join(i,"./index.js"),_=e.stat(a,c);_&&_.isFile||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["openDataContext"]',c),filePath:r}),t.openDataContext=(0,tools_1.normalizePath)(i+"/")}function checkGameJSON(o){const{project:t,root:e,filePath:a}=o;t.stat(e,"game.json")||(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_FOUND.format(path_1.default.posix.join(a)),filePath:a,code:config_1.FILE_NOT_FOUND});const r=t.getFile(e,"game.json"),i=(0,common_2.checkJSONFormat)((0,common_1.checkUTF8)(r,a),a),n=(0,schemaValidate_1.schemaValidate)("game",i);if(n.warning&&(i.__warning__=locales_1.default.config.INVALID.format(n.warning)),n.error.length){const o=n.error.map(o=>"type"===o.errorType||"enum"===o.errorType||"anyOf"===o.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([o.errorProperty,o.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([o.requireProperty])).join("\n");(0,common_1.throwError)({msg:o,filePath:a})}return checkOpenDataContext(o,i),checkPlugins(o,i),checkSubpackages(o,i),checkPluginPath(o,i),checkLoadingImageUrl(o,i),checkWorkers(o,i),i}const getGameJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.GAME_JSON,o=>{const t=(0,projectconfig_1.getProjectConfigJSON)(o).miniprogramRoot||"";return checkGameJSON({project:o,root:t,filePath:(0,tools_1.normalizePath)(path_1.default.posix.join(t,"game.json"))})});exports.default=getGameJSON;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkPageJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),common_1=require("../common"),schemaValidate_1=require("../../validate/schemaValidate"),tools_1=require("../../../utils/tools"),common_2=require("../../../utils/common"),theme_1=require("../theme"),checkHexColor=e=>{const{inputJSON:o,mode:a,pagePath:t,themeLocation:r}=e;let i=t+".json";if(o){r&&(i=`${t}.json or ${r}["${a}"]`);const{navigationBarBackgroundColor:e,backgroundColor:n}=o;void 0===e||(0,tools_1.isHexColor)(e)||(0,common_2.throwError)({msg:`["navigationBarBackgroundColor"]: "${e}" is not hexColor`,filePath:i}),void 0===n||(0,tools_1.isHexColor)(n)||(0,common_2.throwError)({msg:`["backgroundColor"]: "${n}" is not hexColor`,filePath:i})}};function checkPageJSON(e,o){const{pagePath:a,miniprogramRoot:t=""}=o;let r=(0,tools_1.normalizePath)(path_1.default.posix.join(t,a+".json"));if(!e.stat("",r))return{};const i=e.getFile("",r),n=(0,common_1.checkJSONFormat)((0,common_2.checkUTF8)(i,r),r),l=(0,theme_1.getThemeLocation)(e);if(!l){const e=(0,common_1.getPageJSONVariableDecalearProperty)(n);e.length&&(0,common_2.throwError)({msg:'["themeLocation"] is required because:\n'+e.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}`).join("\n"),filePath:r})}let c={light:{},dark:{}};l&&(c=(0,theme_1.checkThemeJSON)(e,{themeLocation:l}));const m=(0,theme_1.mergeThemeJSONToPageJSON)(c,n,r),h=(0,schemaValidate_1.schemaValidate)("page",m.pageJSONLight),s=(0,schemaValidate_1.schemaValidate)("page",m.pageJSONDark),g=(0,common_1.getPageJSONVariableDecalearProperty)(m.pageJSONLight);g.length&&(0,common_2.throwError)({msg:g.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}, but not found at ${l}["light"]`).join("\n"),filePath:r});const _=(0,common_1.getPageJSONVariableDecalearProperty)(m.pageJSONDark);if(_.length&&(0,common_2.throwError)({msg:_.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}, but not found at ${l}["dark"]`).join("\n"),filePath:r}),h.warning&&(n.__warning__=locales_1.default.config.INVALID.format(h.warning)),l&&s.warning&&(n.__warning__=locales_1.default.config.INVALID.format(s.warning)),h.error.length){const e=(0,common_1.transValidateResult)(h);l&&(r+=` or ${l}["light"]`),(0,common_2.throwError)({msg:e,filePath:r})}if(l&&s.error.length){const e=(0,common_1.transValidateResult)(s);l&&(r+=` or ${l}["dark"]`),(0,common_2.throwError)({msg:e,filePath:r})}return checkHexColor({inputJSON:m.pageJSONLight,mode:"light",themeLocation:l||"",filePath:r,pagePath:a}),checkHexColor({inputJSON:m.pageJSONDark,mode:"dark",themeLocation:l||"",filePath:r,pagePath:a}),n}exports.checkPageJSON=checkPageJSON;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPageJSON=exports.originGetPageJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=require("lodash"),getExtJSON_1=require("../app/getExtJSON"),app_1=require("../app"),tools_1=require("../../../utils/tools"),checkPageJSON_1=require("./checkPageJSON"),common_1=require("../common"),common_2=require("../../../utils/common"),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),reactiveCache_1=require("../reactiveCache"),spreadUsingComponent=e=>{const{project:t,pagePath:o,inputJSON:n}=e;if(o.includes("miniprogram_npm"))return;const i=(0,app_1.getAppJSON)(t);if((0,common_1.checkPagePathIsInIndependentSubpackage)(i,o))return;if(i.componentPlaceholder){n.componentPlaceholder=n.componentPlaceholder||{};for(const e in i.componentPlaceholder)n.componentPlaceholder[e]=n.componentPlaceholder[e]||i.componentPlaceholder[e]}const c=Object.assign({},i.usingComponents);if(0!==Object.keys(c).length){n.usingComponents||(n.usingComponents={});for(const e in c){if(n.usingComponents[e])continue;const t=c[e]||"";if(t.startsWith("/")||t.startsWith("plugin://")){n.usingComponents[e]=t;continue}const i=(0,tools_1.normalizePath)(path_1.default.posix.relative(path_1.default.posix.dirname(o),t));n.usingComponents[e]=i.startsWith(".")?i:"./"+i}}},mergeExtJSON=e=>{var t;const{project:o,inputJSON:n,pagePath:i}=e,c=(0,getExtJSON_1.getExtJSON)(o);(null===(t=null==c?void 0:c.extPages)||void 0===t?void 0:t[i])&&Object.assign(n,c.extPages[i])},checkComponentPath=e=>{const{project:t,miniprogramRoot:o,pagePath:n,inputJSON:i}=e;(0,common_1.checkComponentPath)({project:t,root:o,relativePath:n+".json",inputJSON:i})},checkComponentGenerics=e=>{const{pagePath:t,inputJSON:o}=e,n=t+".json";if(!o.componentGenerics)return;const i=[];for(const e in o.componentGenerics){const t=o.componentGenerics[e],n=(0,tools_1.getType)(t);"boolean"===n||"object"===n?"object"===n&&"string"!==(0,tools_1.getType)(t.default)&&i.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([`["componentGenerics"]["${e}"]["default"]`,"string"])):i.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([`["componentGenerics"]["${e}"]`,"boolean/object"]))}i.length>0&&(0,common_2.throwError)({msg:i.join("\n"),filePath:n})};function checkRenderer(e){const{filePath:t,inputJSON:o}=e,{renderer:n}=o,i=(0,app_1.getAppJSON)(e.project);(0,common_2.getAllPages)(i).includes(e.pagePath)&&("skyline"===n&&"requiredComponents"!==i.lazyCodeLoading&&(0,common_2.throwError)({msg:locales_1.default.config.APP_JSON_SHOULD_SET_LAZYCODELOADING.format(t),filePath:t}),("skyline"===n||"skyline"===i.renderer&&"webview"!==n)&&(o.disableScroll=!0,o.navigationStyle="custom"))}const compilePageJSON=e=>{mergeExtJSON(e),checkComponentGenerics(e),checkComponentPath(e),spreadUsingComponent(e),checkRenderer(e)};function originGetPageJSON(e,t){const{pagePath:o,miniprogramRoot:n=""}=t,i=(0,tools_1.normalizePath)(path_1.default.posix.join(n,o+".json")),c=(0,reactiveCache_1.tryToGetReactiveJSONCompiler)(e),r=(0,lodash_1.cloneDeep)(c.getPageJSON("checked",t));return compilePageJSON({project:e,miniprogramRoot:n,inputJSON:r,filePath:i,pagePath:o}),r.usingComponents||(r.usingComponents={}),r}async function getPageJSON(e,t){const o=(0,reactiveCache_1.tryToGetReactiveProject)(e);return(0,reactiveCache_1.tryToGetReactiveJSONCompiler)(o).getPageJSON("compiled",t)}exports.originGetPageJSON=originGetPageJSON,reactiveCache_1.ReactiveJSONCompiler.setOriginCheckPageJSON(checkPageJSON_1.checkPageJSON),reactiveCache_1.ReactiveJSONCompiler.setOriginGetPageJSON(originGetPageJSON),exports.getPageJSON=getPageJSON;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getGameLocalPluginJSON=exports.getDevPluginJSON=exports.checkWorkers=exports.checkComponentPath=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),projectconfig_1=require("../projectconfig"),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),common_1=require("../common"),config_1=require("../../../config"),schemaValidate_1=require("../../validate/schemaValidate"),tools_1=require("../../../utils/tools"),cache_1=require("../../../utils/cache"),common_2=require("../../../utils/common"),reactiveCache_1=require("../reactiveCache");function checkComponentPath(o,e){const{project:t,root:c,filePath:i}=o;void 0!==e.usingComponents&&(0,common_1.checkComponentPath)({project:t,root:c,relativePath:path_1.default.posix.relative(c,i),inputJSON:e})}function checkPublicComponentsAndPages(o,e){const{project:t,root:c,filePath:i}=o,{publicComponents:n,pages:r}=e,a={};if(n){const o=[];for(const r in n){const n=e.publicComponents[r];(0,common_2.checkPath)({value:n,tips:`["publicComponents"]["${r}"]`,filePath:i,code:config_1.PLUGIN_JSON_CONTENT_ERR});let l=t.stat(c,n+".wxml");l&&!l.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["publicComponents"]["${n}"]`,n+".wxml")),l=t.stat(c,n+".js"),l&&!l.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["publicComponents"]["${n}"]`,n+".js")),l=t.stat(c,n+".json"),l&&!l.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["publicComponents"]["${n}"]`,n+".json")),a[r]=!0}o.length>0&&(0,common_2.throwError)({msg:o.join("\n"),code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:i})}if(r){const o=[];for(const e in r){const n=r[e];(0,common_2.checkPath)({value:n,tips:`["pages"]["${e}"]`,filePath:i,code:config_1.PLUGIN_JSON_CONTENT_ERR});let l=t.stat(c,n+".wxml");l&&!l.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["pages"]["${n}"]`,n+".wxml")),l=t.stat(c,n+".js"),l&&!l.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["pages"]["${n}"]`,n+".js")),l=t.stat(c,n+".json"),l&&!l.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["pages"]["${n}"]`,n+".json")),a[e]&&o.push(locales_1.default.config.SAME_KEY_PAGE_PUBLICCOMPONENTS.format(`"${e}"`)),a[e]=!0}o.length>0&&(0,common_2.throwError)({msg:o.join("\n"),code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:i})}}function checkWorkers(o,e){const{project:t,root:c,filePath:i}=o,{workers:n}=e;if(void 0===n)return;const r='["workers"]';""===n&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(r,locales_1.default.config.DIRECTORY),filePath:i}),(0,common_2.checkPath)({value:n,tips:r,filePath:i});const a=t.stat(c,n);a&&a.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([r,locales_1.default.config.DIRECTORY]),filePath:i}),e.workers=(0,tools_1.normalizePath)(n+"/")}function checkMain(o,e){const{project:t,root:c,filePath:i}=o,{main:n}=e;if(void 0===n)return;""===n&&(0,common_2.throwError)({msg:locales_1.default.config.SHOULD_NOT_BE_EMPTY.format('["main"]'),code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:i}),(0,common_2.checkPath)({value:n,tips:'["main"]',filePath:i,code:config_1.PLUGIN_JSON_CONTENT_ERR});const r=t.stat(c,n);r&&!r.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["main"]',n),code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:i})}function isKindOfGamePlugin(o){return o.type===config_1.COMPILE_TYPE.miniGamePlugin}function checkPluginJSON(o){const{root:e="",project:t}=o,c=path_1.default.posix.join(e,"plugin.json");t.stat(e,"plugin.json")||(0,common_2.throwError)({msg:locales_1.default.config.PLUGIN_JSON_NOT_FOUND.format(e,"plugin.json"),code:config_1.PLUGIN_JSON_FILE_NOT_FOUND,filePath:c});const i=t.getFile(e,"plugin.json"),n=(0,common_1.checkJSONFormat)((0,common_2.checkUTF8)(i,c),c),r=(0,schemaValidate_1.schemaValidate)("plugin",n);if(r.error.length){const o=r.error.map(o=>"type"===o.errorType||"enum"===o.errorType||"anyOf"===o.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([o.errorProperty,o.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([o.requireProperty])).join("\n");(0,common_2.throwError)({msg:"pluginJSON$"+o,code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:c})}return void 0!==n.themeLocation&&(0,common_2.checkPath)({value:n.themeLocation,tips:'["themeLocation"]',filePath:c}),isKindOfGamePlugin(t)||(checkPublicComponentsAndPages(o,n),checkComponentPath(o,n)),checkMain(o,n),checkWorkers(o,n),n}exports.checkComponentPath=checkComponentPath,exports.checkWorkers=checkWorkers,exports.getDevPluginJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.PLUGIN_JSON,(o,e="")=>{const t=(0,projectconfig_1.getProjectConfigJSON)(o),{pluginRoot:c=""}=t;let i=c;o.type===config_1.COMPILE_TYPE.miniGame&&e&&(i=e),e||c||(0,common_2.throwError)({msg:locales_1.default.config.NOT_FOUND.format('["pluginRoot"]'),filePath:"project.config.json",code:config_1.JSON_CONTENT_ERR});return checkPluginJSON({project:o,filePath:path_1.default.posix.join(i,"plugin.json"),root:i})});const getGameLocalPluginJSON=async(o,e)=>{const t=await(0,projectconfig_1.getProjectConfigJSON)(o),{miniprogramRoot:c}=t;if(!e)return{};const i=(0,tools_1.normalizePath)(path_1.default.posix.join(c||"",e));return checkPluginJSON({project:(0,reactiveCache_1.tryToGetReactiveProject)(o),filePath:path_1.default.posix.join(i,"plugin.json"),root:i})};exports.getGameLocalPluginJSON=getGameLocalPluginJSON;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPluginPageJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),common_1=require("../common"),schemaValidate_1=require("../../validate/schemaValidate"),locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),common_2=require("../../../utils/common"),plugin_1=require("./plugin"),theme_1=require("../theme"),spreadUsingComponent=async(e,t)=>{const{project:a,root:o,filePath:n}=t,i=path_1.default.posix.relative(o,n);if(n.includes("miniprogram_npm/"))return;const r=await(0,plugin_1.getDevPluginJSON)(a,!0),s=Object.assign({},r.usingComponents);if(0!==Object.keys(s).length){e.usingComponents||(e.usingComponents={});for(const t in s){if(e.usingComponents[t])continue;const a=s[t]||"";if(a.startsWith("/")||a.startsWith("plugin://")){e.usingComponents[t]=a;continue}const o=path_1.default.posix.normalize(path_1.default.posix.relative(path_1.default.posix.dirname(i),a));e.usingComponents[t]=o.startsWith(".")?o:"./"+o}}};async function checkComponentPath(e,t){const{project:a,root:o,filePath:n}=t;await(0,common_1.checkComponentPath)({project:a,root:o,relativePath:path_1.default.posix.relative(o,n),inputJSON:e})}async function getPluginPageJSON(e){const{project:t}=e;let a=e.filePath;if(!t.stat("",a))return{};const o=await t.getFile("",a),n=(0,common_1.checkJSONFormat)((0,common_2.checkUTF8)(o,a),a),i=await(0,theme_1.getPluginThemeLocation)(t);if(!i){const e=(0,common_1.getPageJSONVariableDecalearProperty)(n);e.length&&(0,common_2.throwError)({msg:'pluginJSON["themeLocation"] is required because:\n'+e.map(e=>`"${e.value}" as variable was declared at ${a}:${e.property}`).join("\n"),filePath:a})}let r={light:{},dark:{}};i&&(r=await(0,theme_1.checkThemeJSON)(t,{themeLocation:i,isPlugin:!0}));const s=(0,theme_1.mergeThemeJSONToPageJSON)(r,n,a),l=(0,schemaValidate_1.schemaValidate)("page",s.pageJSONLight),c=(0,schemaValidate_1.schemaValidate)("page",s.pageJSONDark);if(l.warning&&(n.__warning__=locales_1.default.config.INVALID.format(l.warning)),i&&c.warning&&(n.__warning__=locales_1.default.config.INVALID.format(c.warning)),l.error.length){const e=(0,common_1.transValidateResult)(l);i&&(a+=` or ${i}["light"]`),(0,common_2.throwError)({msg:e,filePath:a})}if(i&&c.error.length){const e=(0,common_1.transValidateResult)(c);i&&(a+=` or ${i}["dark"]`),(0,common_2.throwError)({msg:e,filePath:a})}return await checkComponentPath(n,e),await spreadUsingComponent(n,e),n}exports.getPluginPageJSON=getPluginPageJSON;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProjectWithMockBuffer=void 0;const tslib_1=require("tslib"),project_1=require("../../ci/project"),tools_1=require("../../utils/tools"),path_1=tslib_1.__importDefault(require("path")),fs_1=tslib_1.__importDefault(require("fs"));class ProjectWithMockBuffer extends project_1.Project{constructor(){super(...arguments),this.mockBuffer={},this.__dirSet=new Set,this.__fileSet=new Set}setMockFileCache(t){Object.entries(t).forEach(([t,e])=>{this.mockBuffer[t]=Buffer.from(e)})}_getTargetPath(t,e){return(0,tools_1.normalizePath)(path_1.default.posix.join(t,e)).replace(/\/$/,"").replace(/^\//,"")}getFile(t,e){const r=this._getTargetPath(t,e),i=(0,tools_1.normalizePath)(path_1.default.posix.join(this.projectPath,r));return this.mockBuffer[r]?this.mockBuffer[r]:fs_1.default.readFileSync(i,null)}stat(t,e){const r=this._getTargetPath(t,e);if(this.mockBuffer[r])return{isFile:!0,isDirectory:!1};if(this.__fileSet.has(r)){return{isFile:!0,isDirectory:!1,size:fs_1.default.statSync(path_1.default.posix.join(this.projectPath,r)).size}}return this.__dirSet.has(r)?{isFile:!1,isDirectory:!0}:void 0}}exports.ProjectWithMockBuffer=ProjectWithMockBuffer;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getProjectConfigJSON=void 0;const tslib_1=require("tslib"),lodash_1=require("lodash"),common_1=require("../../utils/common"),common_2=require("./common"),schemaValidate_1=require("../validate/schemaValidate"),cache_1=require("../../utils/cache"),tools_1=require("../../utils/tools"),config_1=require("../../config"),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),reactiveCache_1=require("./reactiveCache"),PROJECT_CONFIG_JSON="project.config.json",rootConfig=["svr","client","qcloudRoot","miniprogramRoot","pluginRoot","cloudfunctionRoot","jsserverRoot","testRoot"];function formatPath(o=""){return o&&"/"!==o?(o=(0,tools_1.normalizePath)(o+"/")).replace(/^(\/)*/,"").replace(/\.\.\//g,"").replace(/^\.\//,""):""}const _getProjectConfigJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.PROJECT_CONFIG,o=>{if(!o.stat("",PROJECT_CONFIG_JSON))return o.type!==config_1.COMPILE_TYPE.miniGamePlugin&&o.type!==config_1.COMPILE_TYPE.miniProgramPlugin||(0,common_1.throwError)({msg:locales_1.default.config.NOT_FOUND.format("project.config.json"),code:config_1.FILE_NOT_FOUND,filePath:PROJECT_CONFIG_JSON}),{};const e=o.getFile("",PROJECT_CONFIG_JSON),r=(0,common_1.checkUTF8)(e,PROJECT_CONFIG_JSON),t=(0,common_2.checkJSONFormat)(r,PROJECT_CONFIG_JSON),i=(0,schemaValidate_1.schemaValidate)("projectconfig",t);if(i.error.length){const o=i.error.map(o=>"type"===o.errorType||"enum"===o.errorType||"anyOf"===o.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([o.errorProperty,o.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([o.requireProperty])).join("\n");(0,common_1.throwError)({msg:o,filePath:PROJECT_CONFIG_JSON})}return o.miniprogramRoot=t.miniprogramRoot||"",o.pluginRoot=t.pluginRoot||"",rootConfig.forEach(o=>{"string"==typeof t[o]?t[o]=formatPath(t[o]):t[o]=""}),o.type!==config_1.COMPILE_TYPE.miniGamePlugin&&o.type!==config_1.COMPILE_TYPE.miniProgramPlugin||t.pluginRoot||(0,common_1.throwError)({msg:locales_1.default.config.SHOULD_NOT_BE_EMPTY.format('["pluginRoot"]'),filePath:PROJECT_CONFIG_JSON}),o.type!==config_1.COMPILE_TYPE.miniGamePlugin&&o.type!==config_1.COMPILE_TYPE.miniProgramPlugin||t.pluginRoot!==t.miniprogramRoot||(0,common_1.throwError)({msg:locales_1.default.config.PLUGIN_PATH_SAME_WITH_MINIPROGRAM.format([t.pluginRoot,t.miniprogramRoot]),filePath:PROJECT_CONFIG_JSON}),t}),getProjectConfigJSON=function(o){return(0,lodash_1.cloneDeep)(_getProjectConfigJSON(o))};exports.getProjectConfigJSON=getProjectConfigJSON;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.cleanReactiveCache=exports.wrapCompileJSONFunc=exports.tryToGetReactiveJSONCompiler=exports.ReactiveJSONCompiler=exports.tryToGetReactiveProject=exports.ReactiveProject=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../utils/tools"),reactivity_1=require("@vue/reactivity"),lodash_1=require("lodash"),process_1=require("process"),config_1=require("../../config"),isDevtools=process.__nwjs&&"wechatwebdevtools"===nw.App.manifest.appname;function info(...e){}function log(...e){isDevtools&&console.log.apply(console,e)}function error(...e){isDevtools&&console.error.apply(console,e)}function isAttrEqual(e,t){return"object"==typeof e&&"object"==typeof t&&(!(!e||!t)&&(e.platform===t.platform&&e.appType===t.appType&&e.gameApp===t.gameApp&&e.isSandbox===t.isSandbox&&e.released===t.released&&(e.setting.MaxCodeSize===t.setting.MaxCodeSize&&e.setting.MaxSubpackageSubCodeSize===t.setting.MaxSubpackageSubCodeSize&&e.setting.MaxSubpackageFullCodeSize===t.setting.MaxSubpackageFullCodeSize&&e.setting.NavigateMiniprogramLimit===t.setting.NavigateMiniprogramLimit&&e.setting.MaxSubPackageLimit===t.setting.MaxSubPackageLimit&&e.setting.MinTabbarCount===t.setting.MinTabbarCount&&e.setting.MaxTabbarCount===t.setting.MaxTabbarCount&&e.setting.MaxCustomTabbarCount===t.setting.MaxCustomTabbarCount&&e.setting.MaxTabbarIconSize===t.setting.MaxTabbarIconSize)))}function makeReadonly(e){return e&&"object"==typeof e?(0,reactivity_1.readonly)(e):e}class ReactiveProject{constructor(e){if(this.fileBoxs=new Map,this.statBoxs=new Map,this.resetFileChangeListener=()=>{},this.project=e,e.onFileChange){const t=e.onFileChange;e.onFileChange=(i,o)=>{t.call(e,i,o),this.onFileChange(i,o)},this.resetFileChangeListener=()=>{e.onFileChange=t}}this.miniprogramRootBox=(0,reactivity_1.ref)(e.miniprogramRoot),this.pluginRootBox=(0,reactivity_1.ref)(e.pluginRoot),this.appidBox=(0,reactivity_1.ref)(e.appid),this.typeBox=(0,reactivity_1.ref)(e.type),this.attrBox=(0,reactivity_1.ref)(config_1.DefaultProjectAttr)}release(){this.resetFileChangeListener(),log("[reactiveCache] reactiveProject release")}async attr(){return this.attrSync()}getFileList(e,t){return this.project.getFileList(e,t)}getFilesAndDirs(){return this.project.getFilesAndDirs()}getExtAppid(){return this.project.getExtAppid()}updateFiles(){throw new Error("Method updateFiles not implemented.")}async updateProject(){this.appidBox.value!==this.project.appid&&(this.appidBox.value=this.project.appid),this.typeBox.value!==this.project.type&&(this.typeBox.value=this.project.type),this.miniprogramRootBox.value!==this.project.miniprogramRoot&&(this.miniprogramRootBox.value=this.project.miniprogramRoot),this.pluginRootBox.value!==this.project.pluginRoot&&(this.pluginRootBox.value=this.project.pluginRoot);const e=await this.project.attr();return isAttrEqual(e,this.attrBox.value)||(this.attrBox.value=e),new Promise(e=>{setTimeout(e,0)})}onFileChange(e,t){if("change"===e){const e=this.fileBoxs.get(t);if(e){const i=this.project.getFile("",t);e.value&&0===i.compare(e.value)||(e.value=i)}}else if("unlink"===e){const e=this.fileBoxs.get(t);e&&(this.fileBoxs.delete(t),e.value=void 0);const i=this.statBoxs.get(t);if(i){const e=this.project.stat("",t);(0,lodash_1.isEqual)(e,i.value)||(i.value=e)}}else if("unlinkDir"===e){const e=t+"/";let i=Array.from(this.fileBoxs.keys());for(const t of i)if(0===t.indexOf(e)){const e=this.fileBoxs.get(t);this.fileBoxs.delete(t),e.value=void 0}i=Array.from(this.statBoxs.keys());for(const t of i)if(0===t.indexOf(e)){const e=this.statBoxs.get(t);void 0!==e.value&&(this.statBoxs.delete(t),e.value=void 0)}}else if("add"===e||"addDir"===e){const e=this.statBoxs.get(t);if(e){const i=this.project.stat("",t);(0,lodash_1.isEqual)(i,e.value)||(e.value=i)}}}getFile(e,t){const i=this.getTargetPath(e,t),o=this.fileBoxs.get(i);if(o)return o.value;{const o=(0,reactivity_1.ref)(this.project.getFile(e,t));return this.fileBoxs.set(i,o),o.value}}stat(e,t){const i=this.getTargetPath(e,t),o=this.statBoxs.get(i);if(o)return o.value;{const o=(0,reactivity_1.ref)(this.project.stat(e,t));return this.statBoxs.set(i,o),o.value}}attrSync(){return this.attrBox.value}get appid(){return this.appidBox.value}get type(){return this.typeBox.value}get nameMappingFromDevtools(){return this.project.nameMappingFromDevtools}get projectPath(){return this.project.projectPath}get privateKey(){return this.project.privateKey}get miniprogramRoot(){return this.miniprogramRootBox.value}set miniprogramRoot(e){this.miniprogramRootBox.value=e,this.project.miniprogramRoot=e}get pluginRoot(){return this.pluginRootBox.value}set pluginRoot(e){this.pluginRootBox.value=e,this.project.pluginRoot=e}getTargetPath(e,t){return(0,tools_1.normalizePath)(path_1.default.posix.join(e,t)).replace(/\/$/,"").replace(/^\//,"")}}exports.ReactiveProject=ReactiveProject;const reactiveProjectMap=new Map;function tryToGetReactiveProject(e){let t=reactiveProjectMap.get(e.projectPath);return t||(t=new ReactiveProject(e),reactiveProjectMap.set(e.projectPath,t),t)}exports.tryToGetReactiveProject=tryToGetReactiveProject;let isPending=!1;const pendingRunner=new Set,resolvedPromise=Promise.resolve();function runInNextTick(e){pendingRunner.add(e),isPending||(isPending=!0,resolvedPromise.then(()=>{const e=Date.now();try{const t=Array.from(pendingRunner);pendingRunner.clear(),isPending=!1,t.forEach(e=>{e()})}finally{info(`[reactiveCache] nextTick update cost ${Date.now()-e} ms`)}}))}class ReactiveJSONCompiler{constructor(e){this.pageComputeds=new Map,this.jsonComputeds=new Map,this.project=e}release(){log("[reactiveCache] reactiveJSONCompiler release")}registerOrGet(e,t,...i){let o=this.jsonComputeds.get(e);if(!o){o=(0,reactivity_1.ref)(void 0),this.jsonComputeds.set(e,o);let a=void 0;a=(0,reactivity_1.effect)(()=>{try{info(`[reactiveCache] ${e} start to update`);const a=t.call(null,this.project,...i);(0,lodash_1.isEqual)(a,o.value)?info(`[reactiveCache] ${e} update finish, value no change`):(o.value=makeReadonly(a),info(`[reactiveCache] ${e} update finish, new value: `,o.value))}catch(t){o.value=t instanceof Error?t:new Error(t.toString()),log(`[reactiveCache] update ${e} failed: `,t)}},{scheduler(){a&&a.active&&runInNextTick(a)}})}const{value:a}=o;if(a instanceof Error)throw a;return a}static setOriginGetPageJSON(e){this.originGetPageJSON=e}static setOriginCheckPageJSON(e){this.originCheckPageJSON=e}getPageJSON(e,t){let i=this.pageComputeds.get(t.pagePath);i||(i={checked:(0,reactivity_1.ref)(void 0),compiled:(0,reactivity_1.ref)(void 0)},this.pageComputeds.set(t.pagePath,i));const o=i[e];if(void 0===o.value){let i=void 0;i=(0,reactivity_1.effect)(()=>{try{info(`[reactiveCache] start to update ${e} ${t.pagePath}`);const i="compiled"===e?ReactiveJSONCompiler.originGetPageJSON(this.project,t):ReactiveJSONCompiler.originCheckPageJSON(this.project,t);o.value=makeReadonly(i),info(`[reactiveCache] update finish ${e} ${t.pagePath}`)}catch(i){o.value=i instanceof Error?i:new Error(i.toString()),log(`[reactiveCache] update ${e} ${t.pagePath} failed: `,i)}},{scheduler(){i&&i.active&&(0,process_1.nextTick)(i)}})}const a=o.value;if(a instanceof Error)throw a;return a}}exports.ReactiveJSONCompiler=ReactiveJSONCompiler;const reactiveJSONCompilerMap=new Map;function tryToGetReactiveJSONCompiler(e){let t=reactiveJSONCompilerMap.get(e.projectPath);return t||(t=new ReactiveJSONCompiler(e),reactiveJSONCompilerMap.set(e.projectPath,t),t)}function wrapCompileJSONFunc(e,t){return function(i,...o){i instanceof ReactiveProject||(i=tryToGetReactiveProject(i));return tryToGetReactiveJSONCompiler(i).registerOrGet(e,t,...o)}}function cleanReactiveCache(){reactiveProjectMap.forEach(e=>{e.release()}),reactiveProjectMap.clear(),reactiveJSONCompilerMap.forEach(e=>{e.release()}),reactiveJSONCompilerMap.clear()}exports.tryToGetReactiveJSONCompiler=tryToGetReactiveJSONCompiler,exports.wrapCompileJSONFunc=wrapCompileJSONFunc,exports.cleanReactiveCache=cleanReactiveCache;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllPluginSignatures=exports.isPathValid=exports.getAllPluginsWithPath=exports.friendlyPathMake=exports.trailing=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),game_1=tslib_1.__importDefault(require("./game")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),tools_1=require("../../utils/tools"),log_1=tslib_1.__importDefault(require("../../utils/log")),trailing=(t,e)=>t.endsWith(e)?t:t+e;exports.trailing=trailing;const friendlyPathMake=(t,e)=>path_1.default.normalize(path_1.default.join(t,e.replace(/\\/g,"/")).replace(/^\/+/,""));async function getAllPluginsWithPath(t){const e=await(0,game_1.default)(t),i=[],a=(t,e="")=>{if(t.plugins)for(const a in t.plugins){if(!t.plugins.hasOwnProperty(a))continue;const r=t.plugins[a];r&&"string"==typeof r.path&&i.push({alias:a,version:r.version||"",provider:r.provider||"",path:r.path,friendlyPath:(0,exports.friendlyPathMake)(e,r.path)})}};a(e,"");const r=e.subPackages||e.subpackages;if(Array.isArray(r))for(const t of r)t&&"string"==typeof t.root&&a(t,t.root);return i}function isPathValid(t,e){if(e=e.replace(/\\/g,"/"),t=t.replace(/\\/g,"/"),e.includes("../")||e.endsWith("/.."))return!1;const i=(0,tools_1.normalizePath)(path_1.default.join(t,e)),a=(0,tools_1.normalizePath)(t);return!!i.startsWith(a)}async function getAllPluginSignatures(t){const e=await getAllPluginsWithPath(t),i=[];let a=t.miniprogramRoot?path_1.default.join(t.projectPath,t.miniprogramRoot):t.projectPath;a=(0,tools_1.normalizePath)(a),a=a.endsWith("/")?a:a+"/";for(const t of e)try{const e=path_1.default.join(a,t.friendlyPath);let r=await fs_extra_1.default.pathExists(e);if(!r)continue;const n=await fs_extra_1.default.stat(e);let l=e;n.isDirectory()||(l=path_1.default.dirname(e));const s=path_1.default.join(l,"signature.json");if(r=await fs_extra_1.default.pathExists(s),!r)continue;const o=await fs_extra_1.default.readFile(s,"utf8");let u=null;try{u=JSON.parse(o)}catch(t){log_1.default.error(t);continue}if(!u||!Array.isArray(u.signature))continue;const p=[];for(let t=0;t<u.signature.length;t++){const e=u.signature[t];if(!e)continue;if("string"!=typeof e.path||"string"!=typeof e.md5)continue;if(!isPathValid(l,e.path))continue;const i=path_1.default.join(l,e.path);p.push({fullPath:i,md5:e.md5})}i.push({provider:t.provider,fullPath:e,signature:p})}catch(t){log_1.default.error(t);continue}return i}exports.friendlyPathMake=friendlyPathMake,exports.getAllPluginsWithPath=getAllPluginsWithPath,exports.isPathValid=isPathValid,exports.getAllPluginSignatures=getAllPluginSignatures;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSiteMapJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../utils/tools"),projectconfig_1=require("./projectconfig"),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),common_1=require("../../utils/common"),common_2=require("./common"),schemaValidate_1=require("../validate/schemaValidate"),cache_1=require("../../utils/cache"),reactiveCache_1=require("./reactiveCache"),config_1=require("../../config"),getAppJSON_1=require("./app/getAppJSON");exports.getSiteMapJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.SITE_MAP_JSON,e=>{const o=(0,projectconfig_1.getProjectConfigJSON)(e),r=(0,getAppJSON_1.getAppJSON)(e),{sitemapLocation:t=""}=r;let i=t;if(i)i=(0,tools_1.normalizePath)(path_1.default.posix.join(o.miniprogramRoot||"",i));else{if(i=(0,tools_1.normalizePath)(path_1.default.posix.join(o.miniprogramRoot||"","sitemap.json")),!e.stat("",i))return e.type,config_1.COMPILE_TYPE.miniProgramPlugin,{desc:"",rules:[{action:"disallow",page:"*"}]}}const a=e.getFile("",i),c=(0,common_1.checkUTF8)(a,i),l=(0,common_2.checkJSONFormat)(c,i),_=(0,schemaValidate_1.schemaValidate)("sitemap",l);if(_.error.length){const e=_.error.map(e=>"type"===e.errorType||"enum"===e.errorType||"anyOf"===e.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([e.errorProperty,e.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([e.requireProperty])).join("\n");(0,common_1.throwError)({msg:e,filePath:i})}return l});
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
package/dist/core/json/theme.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeThemeJSONToPageJSON=exports.mergeThemeJSONToAppJSON=exports.checkThemeJSON=exports.getPluginThemeLocation=exports.getThemeLocation=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=tslib_1.__importStar(require("lodash")),tools_1=require("../../utils/tools"),projectconfig_1=require("./projectconfig"),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),common_1=require("../../utils/common"),common_2=require("./common"),cache_1=require("../../utils/cache"),getAppJSON_1=require("./app/getAppJSON"),schemaValidate_1=require("../validate/schemaValidate"),config_1=require("../../config"),plugin_1=require("./plugin/plugin"),reactiveCache_1=require("./reactiveCache");async function getPluginThemeLocation(e){return(await(0,plugin_1.getDevPluginJSON)(e)).themeLocation||null}function checkThemeJSON(e,o){const{isPlugin:t}=o;return t?originCheckThemeJSONForPlugin(e,o):originCheckThemeJSONForMiniProgram(e,o)}exports.getThemeLocation=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.APP_JSON_THEME_LOCATION,e=>{const o=(0,getAppJSON_1.getRawAppJSON)(e).themeLocation;return"[object Undefined]"!==Object.prototype.toString.call(o)?"string"==typeof o?((0,common_1.checkPath)({value:o,tips:'["themeLocation"]',filePath:"app.json"}),o):((0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format('appJSON["themeLocation"]',"string"),filePath:"app.json"}),null):null}),exports.getPluginThemeLocation=getPluginThemeLocation,exports.checkThemeJSON=checkThemeJSON;const originCheckThemeJSONForMiniProgram=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.THEME_JSON,originCheckThemeJSON),originCheckThemeJSONForPlugin=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.PLUGIN_THEME_JSON,originCheckThemeJSON);function originCheckThemeJSON(e,o){const{isPlugin:t}=o,r=(0,exports.getThemeLocation)(e),i=(0,projectconfig_1.getProjectConfigJSON)(e),a=t?i.pluginRoot:i.miniprogramRoot,c=(0,tools_1.normalizePath)(path_1.default.posix.join(a||"",r));e.stat("",c)||(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_FOUND.format(c),filePath:"app.json"});const n=e.getFile("",c),l=(0,common_1.checkUTF8)(n,c),s=(0,common_2.checkJSONFormat)(l,c),h=(0,schemaValidate_1.schemaValidate)("theme",s);if(h.error.length){const e=h.error.map(e=>"type"===e.errorType||"enum"===e.errorType||"anyOf"===e.errorType?locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([e.errorProperty,e.correctType]):locales_1.default.config.SHOULD_NOT_BE_EMPTY.format([e.requireProperty])).join("\n");(0,common_1.throwError)({msg:e,filePath:c})}return s}function mergeThemeJSONToAppJSON(e,o){var t,r;const{windowPropertWhiteList:i,tabBarPropertyWhiteList:a,tabbarListItemPropertyWhiteList:c}=config_1.jsonVariablePropertyWhiteList,n=/^@/,l=lodash_1.default.cloneDeep(o.window||{}),s=lodash_1.default.cloneDeep(o.window||{});Object.keys(l).forEach(o=>{const t=l[o];if(n.test(t)){i.includes(o)||(0,common_1.throwError)({msg:""+locales_1.default.config.SHOULD_NOT_IN.format([t,o]),filePath:"app.json"});const r=t.slice(1);l[o]=e.light[r]||t,s[o]=e.dark[r]||t}});const h=(0,lodash_1.cloneDeep)(o),m=(0,lodash_1.cloneDeep)(o);if(h.window=l,m.window=s,null===(r=null===(t=o.tabBar)||void 0===t?void 0:t.list)||void 0===r?void 0:r.length){const t=lodash_1.default.cloneDeep(o.tabBar||{list:[]}),r=lodash_1.default.cloneDeep(o.tabBar||{list:[]});t.list&&t.list.length>0&&Object.keys(t).forEach(o=>{if("list"!==o){const i=t[o];if(n.test(i)){a.includes(o)||(0,common_1.throwError)({msg:""+locales_1.default.config.SHOULD_NOT_IN.format([i,o]),filePath:"app.json"});const c=i.slice(1);t[o]=e.light[c]||i,r[o]=e.dark[c]||i}}else t.list.forEach((o,i)=>{Object.keys(o).forEach(a=>{const l=o[a];if(n.test(l)){c.includes(a)||(0,common_1.throwError)({msg:""+locales_1.default.config.SHOULD_NOT_IN.format([l,a]),filePath:"app.json"});const o=l.slice(1);t.list[i][a]=e.light[o]||l,r.list[i][a]=e.dark[o]||l}})})}),m.tabBar=r,h.tabBar=t}return{appJSONLight:h,appJSONDark:m}}function mergeThemeJSONToPageJSON(e,o,t){const r=config_1.jsonVariablePropertyWhiteList.windowPropertWhiteList,i=lodash_1.default.cloneDeep(o||{}),a=lodash_1.default.cloneDeep(o||{}),c=/^@/;return Object.keys(o).forEach(n=>{const l=o[n];if(c.test(l)){const o=l.slice(1);r.includes(n)||(0,common_1.throwError)({msg:""+locales_1.default.config.SHOULD_NOT_IN.format([l,n]),filePath:t}),a[n]=e.light[o]||l,i[n]=e.dark[o]||l}}),{pageJSONDark:i,pageJSONLight:a}}exports.mergeThemeJSONToAppJSON=mergeThemeJSONToAppJSON,exports.mergeThemeJSONToPageJSON=mergeThemeJSONToPageJSON;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),read_package_tree_1=tslib_1.__importDefault(require("read-package-tree"));function checkDeps(e,t){var a,r;const n=new Set(Object.keys((null===(a=e.package)||void 0===a?void 0:a.dependencies)||{})),o=[];let s=e;for(;s;){const e=s.children||[];for(const t of e){const e=(null===(r=t.package)||void 0===r?void 0:r.name)||"";n.has(e)&&(n.delete(e),o.push(t))}s=s.parent}for(const e of o)t.has(e)||(t.add(e),checkDeps(e,t))}async function getDeps(e){return new Promise((t,a)=>{(0,read_package_tree_1.default)(e,(e,r)=>{if(e)return a(e);const n=new Set;try{checkDeps(r,n)}catch(e){return a(e)}t(Array.from(n))})})}async function default_1(e,t){if(null==t?void 0:t.length){const a=t.filter(e=>!/([\\/]|\b)node_modules/.test(e)),r=[],n={};for(const t of a){(await getDeps(path_1.default.join(e,path_1.default.dirname(t)))).forEach(e=>{r.push(e)})}for(const e of r){const t=e.isLink?e.path:e.realpath;n[path_1.default.normalize(path_1.default.join(t,"./package.json"))]=e}t=t.filter(t=>{const a=path_1.default.normalize(path_1.default.join(e,t));return!!n[a]})}return t}exports.default=default_1;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
package/dist/core/npm/packnpm.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.packNpmManually=exports.packNpm=void 0;const tslib_1=require("tslib"),config_1=require("../../config"),lodash_1=tslib_1.__importDefault(require("lodash")),rimraf_1=tslib_1.__importDefault(require("rimraf")),path_1=tslib_1.__importDefault(require("path")),fs_1=tslib_1.__importDefault(require("fs")),glob_1=tslib_1.__importDefault(require("glob")),source_map_1=tslib_1.__importDefault(require("source-map")),filterdeps_1=tslib_1.__importDefault(require("./filterdeps")),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),error_1=require("../../utils/error"),log_1=tslib_1.__importDefault(require("../../utils/log")),projectconfig_1=require("../json/projectconfig"),acorn=require("acorn"),NPM_RECORD={start_time:Date.now(),pack_time:0,miniprogram_pack_num:0,other_pack_num:0,warn_not_found_num:0,warn_require_var_num:0,warn_require_rename_num:0,extra1:"",extra2:"",extra3:""},REPORT_LIST=["pack_time","miniprogram_pack_num","other_pack_num","warn_not_found_num","warn_require_var_num","warn_require_rename_num","extra1","extra2","extra3"];function wrap(e,t){return function(...a){if(a.length){const e=a.pop();"function"!=typeof e&&a.push(e)}return new Promise((r,n)=>{a.push((e,t)=>{e?n(e):r(t)}),e.apply(t||null,a)})}}const statSync=wrap(fs_1.default.stat),mkdirSync=wrap(fs_1.default.mkdir),readFileSync=wrap(fs_1.default.readFile),writeFileSync=wrap(fs_1.default.writeFile),accessSync=wrap(fs_1.default.access),renameSync=wrap(fs_1.default.rename),globSync=wrap(glob_1.default);let seed=+new Date;function getId(){return++seed}function startRecord(){NPM_RECORD.start_time=Date.now(),REPORT_LIST.forEach(e=>NPM_RECORD[e]=0===e.indexOf("extra")?"":0)}function endRecord(e){NPM_RECORD.pack_time=Date.now()-NPM_RECORD.start_time;const t={};REPORT_LIST.forEach(e=>t[e]=NPM_RECORD[e]);try{null==e||e(t)}catch(e){}}async function recursiveMkdir(e){const t=path_1.default.posix.dirname(e);try{await accessSync(t)}catch(e){await recursiveMkdir(t)}try{await accessSync(e);const t=await statSync(e);t&&!t.isDirectory()&&(await renameSync(e,e+".bak"),log_1.default.warn(e+" already exists but is not a directory, so it will be rename to a file with the suffix ending in '.bak'"),await mkdirSync(e))}catch(t){await mkdirSync(e)}}async function copyFile(e,t){const a=await readFileSync(e);await writeFile(a,t)}async function writeFile(e,t){await recursiveMkdir(path_1.default.posix.dirname(t)),await writeFileSync(t,e)}function walkNode(e,t){t(e),Object.keys(e).forEach(a=>{const r=e[a];Array.isArray(r)&&r.forEach(e=>{(null==e?void 0:e.type)&&walkNode(e,t)}),(null==r?void 0:r.type)&&walkNode(r,t)})}function parseDeps(e,t,a){const r=[];let n,o=[];try{n=acorn.parse(e,{sourceType:"module",locations:!0,allowHashBang:!0,onComment(t,a,r,n){t||"#"!==e[r]||o.push({start:r,end:n,adjustContent:""})}})}catch(e){const a=`parse js file (${t}) failed: `+e.message;throw console.error(a),e.message=a,e}return walkNode(n,n=>{const i=n.callee,s=n.arguments;if("CallExpression"===n.type&&i&&"Identifier"===i.type&&"require"===i.name&&s&&1===s.length&&("Literal"===s[0].type?r.push(s[0].value):(a.push({jsPath:t,code:e.substring(n.start,n.end),startLine:n.loc.start.line,endLine:n.loc.end.line,tips:"require variable is not allowed",msg:locales_1.default.config.NOT_ALLOWED_REQUIRE_VAR.format()}),NPM_RECORD.warn_require_var_num++)),"ExpressionStatement"===n.type&&n.expression&&"use strict"===n.expression.value&&o.push({start:n.start,end:n.end,adjustContent:""}),"ImportDeclaration"===n.type){const e=n.source,t=n.specifiers,a={start:n.start,end:n.end,adjustContent:""},i=[];e&&"Literal"===e.type&&(r.push(e.value),i.push(`var __TEMP__ = require('${e.value}');`)),t&&Array.isArray(t)&&t.forEach(e=>{if("ImportSpecifier"===e.type){const t=e.local,a=e.imported;"Identifier"===t.type&&"Identifier"===a.type&&i.push(`var ${t.name} = __TEMP__['${a.name}'];`)}else if("ImportDefaultSpecifier"===e.type){const t=e.local;"Identifier"===t.type&&i.push(`var ${t.name} = __REQUIRE_DEFAULT__(__TEMP__);`)}else if("ImportNamespaceSpecifier"===e.type){const t=e.local;"Identifier"===t.type&&i.push(`var ${t.name} = __REQUIRE_WILDCARD__(__TEMP__);`)}}),a.adjustContent=i.join(""),o.push(a)}if("ExportNamedDeclaration"===n.type){const t=n.source,a=n.specifiers,i=n.declaration;let s=!1;const p={start:n.start,end:n.end,adjustContent:""},c=['if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });'];if(t&&"Literal"===t.type&&(r.push(t.value),c.push(`var __TEMP__ = require('${t.value}');`),s=!0),i){if("VariableDeclaration"===i.type){const t=i.declarations;t&&Array.isArray(t)&&t.forEach(t=>{if("VariableDeclarator"===t.type){const a=t.id,r=t.init;a&&"Identifier"===a.type&&(p.notAddLines=!0,c.push(`var ${a.name} = exports.${a.name} = ${r?e.substring(r.start,r.end):"undefined"};`))}})}else if("FunctionDeclaration"===i.type){const t=i.id;t&&"Identifier"===t.type&&(p.notAddLines=!0,c.push(`${e.substring(i.start,i.end)};exports.${t.name} = ${t.name}`))}else if("ClassDeclaration"===i.type){const t=i.id;t&&"Identifier"===t.type&&(p.notAddLines=!0,c.push(`${e.substring(i.start,i.end)};exports.${t.name} = ${t.name}`))}}else;a&&Array.isArray(a)&&a.forEach(e=>{if("ExportSpecifier"===e.type){const t=e.local,a=e.exported;"Identifier"===t.type&&"Identifier"===a.type&&c.push(`Object.defineProperty(exports, '${a.name}', { enumerable: true, configurable: true, get: function() { return ${s?"__TEMP__.":""}${t.name}; } });`)}}),p.adjustContent=c.join(""),o.push(p)}else if("ExportAllDeclaration"===n.type){const e=n.source,t={start:n.start,end:n.end,adjustContent:""},a=['if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });'];e&&"Literal"===e.type&&(r.push(e.value),a.push(`var __TEMP__ = require('${e.value}');`)),a.push('Object.keys(__TEMP__).forEach(function(k) { if (k === "default" || k === "__esModule") return; Object.defineProperty(exports, k, { enumerable: true, configurable: true, get: function() { return __TEMP__[k]; } }); });'),t.adjustContent=a.join(""),o.push(t)}else if("ExportDefaultDeclaration"===n.type){const t=n.declaration,a={start:n.start,end:n.end,adjustContent:""},r=['if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });'];if(t)if(a.notAddLines=!0,t.id){const a=t.id;r.push(`${e.substring(t.start,t.end)};exports.default = ${a.name}`)}else r.push(`exports.default = ${e.substring(t.start,t.end)};`);a.adjustContent=r.join(""),o.push(a)}const p=n.expression;"ExpressionStatement"===n.type&&p&&"AssignmentExpression"===p.type&&"Identifier"===p.right.type&&"require"===p.right.name&&(a.push({jsPath:t,code:e.substring(n.start,n.end),startLine:n.loc.start.line,endLine:n.loc.end.line,tips:"assign require function to a variable is not allowed",msg:locales_1.default.config.NOT_ALLOWED_REQUIRE_ASSIGN.format()}),NPM_RECORD.warn_require_rename_num++);const c=n.declarations;"VariableDeclaration"===n.type&&c.length>0&&c.forEach(r=>{const o=r.init;"VariableDeclarator"===r.type&&o&&"Identifier"===o.type&&"require"===o.name&&(a.push({jsPath:t,code:e.substring(n.start,n.end),startLine:n.loc.start.line,endLine:n.loc.end.line,tips:"assign require function to a variable is not allowed",msg:locales_1.default.config.NOT_ALLOWED_REQUIRE_ASSIGN.format()}),NPM_RECORD.warn_require_rename_num++)})}),o=o.sort((e,t)=>t.start-e.start),o.forEach(t=>{const a=e.substring(t.start,t.end),r=t.notAddLines?0:a.split("\n").length;e=e.substring(0,t.start)+t.adjustContent+new Array(r).join("\n")+e.substring(t.end)}),{deps:r,parsedContent:e}}async function parseJs(e,t,a,r,n,o){if(n[t=path_1.default.posix.normalize(t)])return n[t];const i=await readFileSync(t,"utf8"),s=getId(),p=path_1.default.posix.relative(e,t);if(/\.json$/.test(t)){const e={id:s,name:p,content:"module.exports = "+i,deps:[],depsMap:{}};return n[t]=s,r.push(e),s}const{deps:c,parsedContent:_}=parseDeps(i,t,o),u={id:s,name:p,content:_,deps:c,depsMap:{}};n[t]=s,r.push(u);for(const i of c){let s,p=path_1.default.posix.join(path_1.default.posix.dirname(t),i);if(!/\.js$/.test(p)&&!/\.json$/.test(p)){const e=p+".js";try{await accessSync(e),p=e}catch(e){}}try{const e=await statSync(p);(null==e?void 0:e.isDirectory())&&(p=path_1.default.posix.join(p,"index.js"))}catch(e){}/\.js$/.test(p)||/\.json$/.test(p)||(p+=".js");try{await accessSync(p),s=await parseJs(e,p,a,r,n,o)}catch(e){}s&&(u.depsMap[i]=s)}return s}function addJsToMap(e,t,a,r){const n=t.split("\n").length;for(let o=1;o<=n;o++)e.addMapping({generated:{line:r+o,column:0},original:{line:o,column:0},source:a}),e.setSourceContent(a,t)}function findOutsideDeps(e){const t=new Set;return e.forEach(e=>{e.deps.forEach(a=>{Object.keys(e.depsMap).includes(a)||t.add(a)})}),Array.from(t)}async function packJs(e,t,a){try{const t=await statSync(e);(null==t?void 0:t.isDirectory())&&(e=path_1.default.posix.join(e,"index.js"))}catch(e){}/\.js$/.test(e)||/\.json$/.test(e)||(e+=".js");try{await accessSync(e)}catch(t){return a.push({jsPath:e,code:"",tips:"entry file is not found",msg:locales_1.default.config.NOT_FOUND_NPM_ENTRY.format()}),void NPM_RECORD.warn_not_found_num++}const r=new source_map_1.default.SourceMapGenerator({file:"index.js"}),n=[];await parseJs(path_1.default.posix.dirname(e),e,t,n,{},a);const o=findOutsideDeps(n),i=["module.exports = (function() {","var __MODS__ = {};","var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };",'var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };',"var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };","var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };"];if(n.length){const e=n.shift();i.push(`__DEFINE__(${e.id}, function(require, module, exports) {`),addJsToMap(r,e.content,e.name,i.length),i.push(e.content),i.push(`}, function(modId) {var map = ${JSON.stringify(e.depsMap)}; return __REQUIRE__(map[modId], modId); })`);for(const e of n)i.push(`__DEFINE__(${e.id}, function(require, module, exports) {`),addJsToMap(r,e.content,e.name,i.length),i.push(e.content),i.push(`}, function(modId) { var map = ${JSON.stringify(e.depsMap)}; return __REQUIRE__(map[modId], modId); })`);i.push(`return __REQUIRE__(${e.id});`)}return i.push("})()"),i.push("//miniprogram-npm-outsideDeps="+JSON.stringify(o)),i.push("//# sourceMappingURL=index.js.map"),{js:i.join("\n"),map:r.toString()}}async function checkIsMiniprogramPack(e,t){let a="miniprogram_dist";t.miniprogram&&"string"==typeof t.miniprogram&&(a=t.miniprogram);try{const t=path_1.default.posix.join(e,a);await accessSync(t);const r=await statSync(t);if(null==r?void 0:r.isDirectory())return t}catch(e){}return""}async function packNpm(e,t={}){const a=e.projectPath,r=e.type,n=await(0,projectconfig_1.getProjectConfigJSON)(e),o=n.pluginRoot||"",i=n.miniprogramRoot||"",s="miniProgramPlugin"===r||"miniGamePlugin"===r,{ignores:p,reporter:c}=t;if(!a)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format("projectPath"),config_1.PARAM_ERROR);if("miniProgramPlugin"===r&&!o)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format('project.config.json "pluginRoot"'),config_1.PARAM_ERROR);startRecord();const _=path_1.default.isAbsolute(a)?a:path_1.default.posix.join(process.cwd(),a),u=[{searchRoot:path_1.default.posix.join(_,i),paths:await globSync("**/package.json",{cwd:path_1.default.posix.join(_,i),nodir:!0,dot:!0,ignore:(p||[]).concat("**/node_modules/**")})}];s&&u.push({searchRoot:path_1.default.posix.join(_,o),paths:await globSync("**/package.json",{cwd:path_1.default.posix.join(_,o),nodir:!0,dot:!0,ignore:(p||[]).concat("**/node_modules/**")})});lodash_1.default.flattenDeep(u.map(e=>e.paths.map(t=>path_1.default.posix.join(e.searchRoot,path_1.default.dirname(t),"miniprogram_npm")))).forEach(e=>rimraf_1.default.sync(e));const l=[];for(const e of u)for(const t of e.paths){const a=path_1.default.dirname(path_1.default.posix.join(e.searchRoot,t)),r=lodash_1.default.xorWith(e.paths,[t]).map(e=>path_1.default.posix.join(path_1.default.posix.dirname(e),"/**")).filter(e=>"**"!==e);let n=await globSync("**/package.json",{cwd:a.replace(/\\/g,"/"),nodir:!0,dot:!0,ignore:(p||[]).concat(r).concat(["node_modules/@types/**"])});if(n=await(0,filterdeps_1.default)(a,n),n&&n.length)for(const e of n){const t=path_1.default.posix.join(a,e);let r=await readFileSync(t,"utf8");const n=path_1.default.dirname(t);let o=n.replace(/([\b/\\])node_modules([\b/\\])/g,(e,t,a)=>`${t}miniprogram_npm${a}`),i=path_1.default.basename(o);const s=i.split("@");s.length&&(i=s.pop()||""),o=o.replace(path_1.default.basename(o),i),r=JSON.parse(r);const p=path_1.default.posix.join(n,r.main||"index.js"),c=await checkIsMiniprogramPack(n,r);if(c){const e=await globSync("**/*",{cwd:c.replace(/\\/g,"/"),nodir:!0,dot:!0,ignore:"**/node_modules/**"});for(const t of e)await copyFile(path_1.default.posix.join(c,t),path_1.default.posix.join(o,t));NPM_RECORD.miniprogram_pack_num++}else{const e=await packJs(p,o,l);if(!e)continue;await writeFile(e.js,path_1.default.posix.join(o,"./index.js")),await writeFile(e.map,path_1.default.posix.join(o,"./index.js.map")),NPM_RECORD.other_pack_num++}}}if(endRecord(c),NPM_RECORD.miniprogram_pack_num+NPM_RECORD.other_pack_num<=0)throw new Error("__NO_NODE_MODULES__ "+locales_1.default.config.NOT_FOUND_NODE_MODULES.format());return"function"==typeof e.updateFiles&&e.updateFiles(),l}async function packNpmManually(e){let{packageJsonPath:t,miniprogramNpmDistDir:a}=e;const r=e.ignores||[],n={pack_time:0,miniprogram_pack_num:0,other_pack_num:0,warn_not_found_num:0,warn_require_var_num:0,warn_require_rename_num:0},o=[];if(!a)throw new Error("param miniprogramNpmDistDir is required");if(!t)throw new Error("param packageJsonPath is required");if(path_1.default.isAbsolute(a)||(a=path_1.default.join(process.cwd(),a)),path_1.default.isAbsolute(t)||(t=path_1.default.join(process.cwd(),t)),!fs_1.default.existsSync(t))throw new Error(`param packageJsonPath: ${t} file is not exited`);const i=path_1.default.dirname(t);let s=await globSync("**/package.json",{cwd:i.replace(/\\/g,"/"),nodir:!0,dot:!0,ignore:(r||[]).concat(["node_modules/@types/**"])});if(s=await(0,filterdeps_1.default)(i,s),!s||!s.length)return log_1.default.warn("No miniprogram_npm package was built."),{miniProgramPackNum:0,otherNpmPackNum:0,warnList:[]};s=s.filter(e=>e.startsWith("node_modules"));for(const e of s){const t=path_1.default.posix.join(i,e);let r=await readFileSync(t,"utf8");const s=path_1.default.dirname(t);let p=s.replace(/([\b/\\])node_modules([\b/\\])/g,(e,t,a)=>`${t}miniprogram_npm${a}`);p=path_1.default.posix.normalize(path_1.default.posix.join(a,"miniprogram_npm",p.split(/[/\\]miniprogram_npm[/\\]/)[1]));let c=path_1.default.basename(p);const _=c.split("@");_.length&&(c=_.pop()||""),p=p.replace(path_1.default.basename(p),c),r=JSON.parse(r);const u=path_1.default.posix.join(s,r.main||"index.js"),l=await checkIsMiniprogramPack(s,r);if(l){const e=await globSync("**/*",{cwd:l.replace(/\\/g,"/"),nodir:!0,dot:!0,ignore:"**/node_modules/**"});for(const t of e)await copyFile(path_1.default.posix.join(l,t),path_1.default.posix.join(p,t));n.miniprogram_pack_num++}else{const e=await packJs(u,p,o);if(!e)continue;await writeFile(e.js,path_1.default.posix.join(p,"./index.js")),await writeFile(e.map,path_1.default.posix.join(p,"./index.js.map")),n.other_pack_num++}}return{miniProgramPackNum:n.miniprogram_pack_num,otherNpmPackNum:n.other_pack_num,warnList:o}}exports.packNpm=packNpm,exports.packNpmManually=packNpmManually;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.tryTranslateSingleFile=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),parser=tslib_1.__importStar(require("@babel/parser")),traverse_1=tslib_1.__importDefault(require("@babel/traverse")),sourcemap=tslib_1.__importStar(require("source-map")),babel_code_frame_1=tslib_1.__importDefault(require("babel-code-frame"));class TranslateResult{constructor(){this.translated=!0,this.errMsg="",this.debugs=[],this.translatedContent="",this.fullPath="",this.translatedSourceMap=""}}function getErrorCodeFrame(e,n,t,r){let o;try{o=new sourcemap.SourceMapConsumer(n||""),e=o.sourceContentFor(t)||e}catch(e){}const i=[];for(const n of r){let t={line:n.line,column:n.column>0?n.column:0};try{o&&(t=o.originalPositionFor({line:n.line,column:n.column}))}catch(e){}const r=(0,babel_code_frame_1.default)(e,t.line,t.column);i.push(`${n.reason}\n${r}`)}return i.join("\n\n")}function translateCode(e,n){const t=e.replace(/\r\n/g,"\n").split("\n");for(let e=0;e<t.length;e++){const r=t[e],o=n[e+1];if(o){const n=[];let i=0;for(const e in o){const t=o[e];n.push(r.substr(i,t.column-i+1)),n.push(t.toString),i=t.column+t.fromString.length+1}n.push(r.substr(i)),t[e]=n.join("")}}return t.join("\n")}function translateSourceMap(e,n,t){const r=new sourcemap.SourceMapConsumer(e),o=new sourcemap.SourceMapGenerator({file:n});let i;return r.eachMapping(e=>{if("number"!=typeof e.originalLine||"number"!=typeof e.originalColumn)return;const n={generated:{line:e.generatedLine,column:e.generatedColumn},source:e.source,name:e.name,original:{line:e.originalLine,column:e.originalColumn}};if(i&&i.line===e.generatedLine?n.generated.column+=i.offset:i=void 0,t[e.generatedLine]){const n=t[e.generatedLine][e.generatedColumn];n&&(i&&i.line===n.line?i.offset+=n.offset:i={line:n.line,offset:n.offset})}o.addMapping(n)}),o.toString()}function dirname(e){const n=e.split("/");return n.pop(),n.join("/")}function getNpmRequirePath(e,n,t){if(e.startsWith(".")||e.startsWith("/"))return!1;{let r,o=n;for(;o;)if(o=dirname(o),r=e.endsWith(".js")?path_1.default.posix.join(o,"miniprogram_npm",e):path_1.default.posix.join(o,"miniprogram_npm",e,"index.js"),t.includes(r))return r;return!1}}const tryTranslateSingleFile=e=>{var n,t;const r=new TranslateResult,{filePath:o,nameMapping:i,code:a,rootPath:l,miniProgramJSFiles:s}=e;let u=path_1.default.posix.dirname(path_1.default.posix.relative(l,o));"."===u&&(u="");const c=[];let p;try{p=parser.parse(a)}catch(i){return c.push({line:(null===(n=i.loc)||void 0===n?void 0:n.line)||1,column:(null===(t=i.loc)||void 0===t?void 0:t.column)||1,reason:i.message}),r.translated=!1,r.errMsg=`in ${path_1.default.posix.join(l,o)}\n${getErrorCodeFrame(a,e.sourceMap,e.sourceFileName,c)}`,r}const d={};if((0,traverse_1.default)(p,{AssignmentExpression(e){const n=e.node.loc.start;"Identifier"===e.node.left.type&&"require"===e.node.left.name&&c.push({line:n.line,column:n.column,reason:"assigning other name with 'require'"}),"Identifier"===e.node.right.type&&"require"===e.node.right.name&&c.push({line:n.line,column:n.column,reason:"'require' should not be renamed"})},VariableDeclarator(e){const n=e.node.loc.start;e.node.id&&"Identifier"===e.node.id.type&&"require"===e.node.id.name&&c.push({line:n.line,column:n.column,reason:"(init) assigning other name with 'require'"}),e.node.init&&"Identifier"===e.node.init.type&&"require"===e.node.init.name&&c.push({line:n.line,column:n.column,reason:"(init) 'require' should not be renamed"})},CallExpression(n){const t=n.node.loc.start;for(const e of n.node.arguments)"Identifier"===e.type&&"require"===e.name&&c.push({line:t.line,column:t.column,reason:"passing 'require' as a parameter is not a good taste"});if("Identifier"===n.node.callee.type&&"require"===n.node.callee.name&&(1===n.node.arguments.length&&"StringLiteral"===n.node.arguments[0].type||c.push({line:t.line,column:t.column,reason:"'require' requires one and only one static string literal"})),"require"===n.node.callee.name&&1===n.node.arguments.length&&"StringLiteral"===n.node.arguments[0].type){const t=n.node.arguments[0].loc.start,a=n.node.arguments[0].value,c=e.resolveAlias(a);let p;p=c?path_1.default.posix.join(l,c):path_1.default.posix.normalize(path_1.default.posix.join(u,a)),/\.js$/.test(p)||(p+=".js"),/^\//.test(p)&&(p=p.replace(/^\//,""));let m=i[p];if(m)m=i[o]?path_1.default.posix.relative(path_1.default.posix.dirname(i[o]),m):path_1.default.posix.relative(u,m),d[t.line]||(d[t.line]={}),d[t.line][t.column]={line:t.line,column:t.column,fromString:a,toString:m,offset:m.length-a.length},r.debugs.push([o,a,"replace",[p,m]]);else{if(i[o]){const e=getNpmRequirePath(a,o,s);e&&(p=e),m=path_1.default.posix.relative(path_1.default.posix.dirname(i[o]),p),d[t.line]||(d[t.line]={}),d[t.line][t.column]={line:t.line,column:t.column,fromString:a,toString:m,offset:m.length-a.length},r.debugs.push([o,a,"replace",[p,m]])}r.debugs.push([o,a,"ignored"])}}},Identifier(e){const n=e.node.loc.start;if("require"===e.node.name){if("UnaryExpression"===e.parent.type&&"typeof"===e.parent.operator)return;"CallExpression"!==e.parent.type&&c.push({line:n.line,column:n.column,reason:`require is not being used properly in '${e.parent.type}'`})}}}),c.length>0)return r.translated=!1,r.errMsg=`in ${o}\n${getErrorCodeFrame(a,e.sourceMap,e.sourceFileName,c)}`,r;if(Object.keys(d).length>0){r.translatedContent=translateCode(a,d);try{r.translatedSourceMap=translateSourceMap(e.sourceMap||"",e.sourceFileName,d)}catch(e){}}else r.translatedContent=a,r.translatedSourceMap=e.sourceMap;return r};exports.tryTranslateSingleFile=tryTranslateSingleFile;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
!function(require, directRequire){
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.uglifyFileNames=exports.getGameNameMapping=exports.getNameMapping=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),config_1=require("../../config"),error_1=require("../../utils/error"),tools_1=require("../../utils/tools"),game_1=tslib_1.__importDefault(require("../json/game")),app_1=require("../json/app"),file_flatter_1=require("./file_flatter"),url_config_1=require("../../utils/url_config"),request_1=require("../../utils/request"),sign_1=require("../../utils/sign"),jsonParse_1=require("../../utils/jsonParse"),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),config=tslib_1.__importStar(require("../../config")),common_1=require("../../utils/common");function checkPrefix(e,t){for(const a of t)if(0===e.indexOf(a))return a;return""}const getNameMapping=async(e,t)=>{if(process.env.isDevtools)return e.nameMappingFromDevtools||{};{const a=e.getFileList(t,".js").map(e=>path_1.default.posix.relative(t,e));try{let r={};if("miniProgram"===e.type){const o=await(0,app_1.getAppJSON)(e);r=await getMiniProgramNameMapping(e,t,o,a)}if("miniGame"===e.type){const t=await(0,game_1.default)(e);r=await(0,exports.getGameNameMapping)(e,t,a)}return r}catch(e){throw new error_1.CodeError(e.toString(),config_1.CODE_PROTECT_TRANSLATE_FILENAME)}}};exports.getNameMapping=getNameMapping;const getMiniProgramNameMapping=async(e,t,a,r)=>{const o=[{type:"file",value:"app.js"},{type:"regex",value:/\/miniprogram_npm\/|^miniprogram_npm\//},{type:"folder",value:"functional-pages/"}],i=e.getFileList(t,".wxml").map(e=>path_1.default.posix.relative(t,e));for(const e of i)o.push({type:"file",value:""+e.replace(/\.wxml$/,".js")});let s=[];return a.subPackages&&(s=a.subPackages.map(e=>e.root)),a.widgets&&a.widgets.length>0&&a.widgets.forEach(e=>{o.push({type:"folder",value:/\/$/.test(e.path)?e.path:e.path+"/"})}),a.workers&&o.push({type:"folder",value:(0,tools_1.getWorkersPath)(a.workers)}),a.openDataContext&&(o.push({type:"file",value:path_1.default.posix.join(a.openDataContext,"index.js")}),s.push(a.openDataContext)),await _getNameMapping(e,r,o,s)},getGameNameMapping=async(e,t,a)=>{const r=[{type:"file",value:"game.js"},{type:"regex",value:/\/miniprogram_npm\/|^miniprogram_npm\//}],o=[];if(t.subPackages&&t.subPackages.forEach(e=>{const t=e.root.replace(/^\//,"");/\.js$/.test(t)?(r.push({type:"file",value:t}),o.push(path_1.default.posix.dirname(t))):(r.push({type:"file",value:path_1.default.posix.join(t,"./game.js")}),o.push(t))}),t.openDataContext&&(r.push({type:"file",value:path_1.default.posix.join(t.openDataContext,"index.js")}),o.push(t.openDataContext)),t.workers&&r.push({type:"folder",value:(0,tools_1.getWorkersPath)(t.workers)}),t.plugins)for(const e in t.plugins){const a=t.plugins[e];if(a.path){const e=a.path.replace(/^\//,"");r.push({type:"folder",value:e})}}return await _getNameMapping(e,a,r,o)};async function _getNameMapping(e,t,a,r=[]){const o={},i=[];for(const e of t){let t=!1;for(const r of a)if("file"===r.type&&r.value===e||"folder"===r.type&&0===e.indexOf(r.value)||"regex"===r.type&&r.value.test(e)){t=!0;break}t||i.push(e)}const s=await(0,sign_1.getSignature)(e.privateKey,e.appid),{body:n}=await(0,request_1.request)({url:url_config_1.TRANSLATE_FILENAME,method:"post",body:JSON.stringify({appid:e.appid,signature:s,arrPaths:i}),headers:{"content-type":"application/json"}}),p=(0,jsonParse_1.jsonRespParse)(n,url_config_1.TRANSLATE_FILENAME);if(0===p.errCode)return p.body.pairs.forEach(e=>{const t=checkPrefix(e.origin,r);o[e.origin]=(0,tools_1.normalizePath)(path_1.default.posix.join(t,e.translated+".js"))}),o;throw new Error(`errCode: ${p.errCode} errMsg: ${p.errMsg}`)}function genResolveAlias(e){if(e){const t=[];return Object.keys(e).forEach(a=>{let r=a;a.endsWith("*")&&(r=r.slice(0,-1));let o=e[a];e[a].endsWith("*")&&(o=o.slice(0,-1)),t.push({key:r,value:o})}),e=>{let a={key:"",value:""},r=!1;if(t.forEach(t=>{e.startsWith(t.key)&&a.key.length<t.key.length&&(a=t,r=!0)}),!r)return;let o=e.replace(a.key,a.value);return"/"===o[0]&&(o=o.slice(1)),o}}return e=>{}}async function uglifyFileNames(e,t,a){let r={miniprogramRoot:""};try{r=JSON.parse(t["project.config.json"].toString())}catch(e){}let o=(0,tools_1.normalizePath)(r.miniprogramRoot);"."===o&&(o=""),a=a||await(0,exports.getNameMapping)(e,e.miniprogramRoot);const i=Object.keys(t).filter(e=>e.endsWith(".js")),s={};let n,p=t[path_1.default.posix.join(o,"app.json")];p?(Buffer.isBuffer(p)&&(p=p.toString("utf-8")),p=JSON.parse(p),n=genResolveAlias(p.resolveAlias)):n=genResolveAlias(void 0);for(const e of i){if(/\/miniprogram_npm\/|^miniprogram_npm\//.test(e))continue;const r=e,p=t[e].toString(),l=t[e+".map"]||"";s[r]=(0,file_flatter_1.tryTranslateSingleFile)({rootPath:o,code:p,nameMapping:a,check:!0,sourceFileName:e,sourceMap:l,filePath:e,miniProgramJSFiles:i,resolveAlias:n})}const l=Object.keys(t),u={};for(const e of l){u[(0,tools_1.normalizePath)(e)]=t[e]}for(const e in s){const t=(0,tools_1.normalizePath)(e);let r=t;const i=s[e];if(i.errMsg){if(!process.env.isDevtools)throw new Error(`\n${locales_1.default.config.COULD_NOT_USE_CODE_PROTECT}\n${i.errMsg}`);(0,common_1.throwError)({code:config.FILE_FLAT_ERR,msg:`${locales_1.default.config.COULD_NOT_USE_CODE_PROTECT}\n${i.errMsg}`,filePath:t})}const n=path_1.default.posix.relative(o,e);a[n]&&(r=(0,tools_1.normalizePath)(path_1.default.posix.join(o,a[n])),delete u[t],delete u[t+".map"]),u[r]=i.translatedContent,i.translatedSourceMap&&(u[r+".map"]=i.translatedSourceMap)}return u}exports.getGameNameMapping=getGameNameMapping,exports.uglifyFileNames=uglifyFileNames;
|
|
3
|
-
}(require("licia/lazyImport")(require), require)
|