miniprogram-ci 2.1.34 → 2.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +4 -0
- package/dist/@types/common/code-analyse/index.d.ts +2 -0
- package/dist/@types/config/config.d.ts +1 -1
- package/dist/@types/modules/corecompiler/original/workerThread/config.d.ts +4 -3
- package/dist/@types/modules/corecompiler/summer/plugins/script_task/babel_script_task.d.ts +1 -0
- package/dist/@types/modules/corecompiler/summerCompiler.d.ts +1 -0
- package/dist/@types/modules/nativecompiler/ios/buildCloud.d.ts +2 -0
- package/dist/@types/schema/@types/appjson.d.ts +3 -0
- package/dist/@types/types/miniprogram-json/app.d.ts +8 -0
- package/dist/@types/utils/asar.d.ts +1 -0
- package/dist/@types/utils/customError.d.ts +1 -1
- package/dist/@types/utils/packOptionsHelper.d.ts +1 -1
- package/dist/common/code-analyse/index.js +1 -1
- package/dist/config/config.js +1 -1
- package/dist/modules/corecompiler/original/protect/fileFlatter.js +1 -1
- package/dist/modules/corecompiler/original/protect/uglifyfilenames.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/config.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/worker.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/workerManager.js +1 -1
- package/dist/modules/corecompiler/summer/graph/appconf.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/filetask/script.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/script_task/babel_script_task.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/script_task/swc_task.js +1 -1
- package/dist/modules/corecompiler/summer/worker.js +1 -1
- package/dist/modules/corecompiler/summerCompiler.js +1 -1
- package/dist/modules/nativecompiler/ios/buildCloud.js +1 -1
- package/dist/schema/dist/app.js +18 -0
- package/dist/services/common/getservice.js +1 -1
- package/dist/services/multiTaskManager/electron/multiTaskManager.js +1 -1
- package/dist/utils/asar.js +1 -0
- package/dist/utils/codesign.js +1 -1
- package/dist/utils/customError.js +1 -1
- package/dist/utils/packOptionsHelper.js +1 -1
- package/dist/utils/swc_config.js +1 -1
- package/dist/vendor/swc_runtime/_apply_decorated_descriptor.js +1 -1
- package/dist/vendor/swc_runtime/_apply_decs_2203_r.js +1 -1
- package/dist/vendor/swc_runtime/_array_like_to_array.js +1 -1
- package/dist/vendor/swc_runtime/_array_with_holes.js +1 -1
- package/dist/vendor/swc_runtime/_array_without_holes.js +1 -1
- package/dist/vendor/swc_runtime/_assert_this_initialized.js +1 -1
- package/dist/vendor/swc_runtime/_async_generator.js +1 -1
- package/dist/vendor/swc_runtime/_async_generator_delegate.js +1 -1
- package/dist/vendor/swc_runtime/_async_iterator.js +1 -1
- package/dist/vendor/swc_runtime/_async_to_generator.js +1 -1
- package/dist/vendor/swc_runtime/_await_async_generator.js +1 -1
- package/dist/vendor/swc_runtime/_await_value.js +1 -1
- package/dist/vendor/swc_runtime/_call_super.js +1 -0
- package/dist/vendor/swc_runtime/_check_private_redeclaration.js +1 -1
- package/dist/vendor/swc_runtime/_class_apply_descriptor_destructure.js +1 -1
- package/dist/vendor/swc_runtime/_class_apply_descriptor_get.js +1 -1
- package/dist/vendor/swc_runtime/_class_apply_descriptor_set.js +1 -1
- package/dist/vendor/swc_runtime/_class_apply_descriptor_update.js +1 -1
- package/dist/vendor/swc_runtime/_class_call_check.js +1 -1
- package/dist/vendor/swc_runtime/_class_check_private_static_access.js +1 -1
- package/dist/vendor/swc_runtime/_class_check_private_static_field_descriptor.js +1 -1
- package/dist/vendor/swc_runtime/_class_extract_field_descriptor.js +1 -1
- package/dist/vendor/swc_runtime/_class_name_tdz_error.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_field_destructure.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_field_get.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_field_init.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_field_loose_base.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_field_loose_key.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_field_set.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_field_update.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_method_get.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_method_init.js +1 -1
- package/dist/vendor/swc_runtime/_class_private_method_set.js +1 -1
- package/dist/vendor/swc_runtime/_class_static_private_field_destructure.js +1 -1
- package/dist/vendor/swc_runtime/_class_static_private_field_spec_get.js +1 -1
- package/dist/vendor/swc_runtime/_class_static_private_field_spec_set.js +1 -1
- package/dist/vendor/swc_runtime/_class_static_private_field_update.js +1 -1
- package/dist/vendor/swc_runtime/_class_static_private_method_get.js +1 -1
- package/dist/vendor/swc_runtime/_construct.js +1 -1
- package/dist/vendor/swc_runtime/_create_class.js +1 -1
- package/dist/vendor/swc_runtime/_create_for_of_iterator_helper_loose.js +1 -1
- package/dist/vendor/swc_runtime/_create_super.js +1 -1
- package/dist/vendor/swc_runtime/_decorate.js +1 -1
- package/dist/vendor/swc_runtime/_defaults.js +1 -1
- package/dist/vendor/swc_runtime/_define_enumerable_properties.js +1 -1
- package/dist/vendor/swc_runtime/_define_property.js +1 -1
- package/dist/vendor/swc_runtime/_dispose.js +1 -1
- package/dist/vendor/swc_runtime/_export_star.js +1 -1
- package/dist/vendor/swc_runtime/_extends.js +1 -1
- package/dist/vendor/swc_runtime/_get.js +1 -1
- package/dist/vendor/swc_runtime/_get_prototype_of.js +1 -1
- package/dist/vendor/swc_runtime/_identity.js +1 -1
- package/dist/vendor/swc_runtime/_inherits.js +1 -1
- package/dist/vendor/swc_runtime/_inherits_loose.js +1 -1
- package/dist/vendor/swc_runtime/_initializer_define_property.js +1 -1
- package/dist/vendor/swc_runtime/_initializer_warning_helper.js +1 -1
- package/dist/vendor/swc_runtime/_instanceof.js +1 -1
- package/dist/vendor/swc_runtime/_interop_require_default.js +1 -1
- package/dist/vendor/swc_runtime/_interop_require_wildcard.js +1 -1
- package/dist/vendor/swc_runtime/_is_native_function.js +1 -1
- package/dist/vendor/swc_runtime/_is_native_reflect_construct.js +1 -1
- package/dist/vendor/swc_runtime/_iterable_to_array.js +1 -1
- package/dist/vendor/swc_runtime/_iterable_to_array_limit.js +1 -1
- package/dist/vendor/swc_runtime/_iterable_to_array_limit_loose.js +1 -1
- package/dist/vendor/swc_runtime/_jsx.js +1 -1
- package/dist/vendor/swc_runtime/_new_arrow_check.js +1 -1
- package/dist/vendor/swc_runtime/_non_iterable_rest.js +1 -1
- package/dist/vendor/swc_runtime/_non_iterable_spread.js +1 -1
- package/dist/vendor/swc_runtime/_object_destructuring_empty.js +1 -1
- package/dist/vendor/swc_runtime/_object_spread.js +1 -1
- package/dist/vendor/swc_runtime/_object_spread_props.js +1 -1
- package/dist/vendor/swc_runtime/_object_without_properties.js +1 -1
- package/dist/vendor/swc_runtime/_object_without_properties_loose.js +1 -1
- package/dist/vendor/swc_runtime/_overload_yield.js +1 -0
- package/dist/vendor/swc_runtime/_possible_constructor_return.js +1 -1
- package/dist/vendor/swc_runtime/_read_only_error.js +1 -1
- package/dist/vendor/swc_runtime/_set.js +1 -1
- package/dist/vendor/swc_runtime/_set_prototype_of.js +1 -1
- package/dist/vendor/swc_runtime/_skip_first_generator_next.js +1 -1
- package/dist/vendor/swc_runtime/_sliced_to_array.js +1 -1
- package/dist/vendor/swc_runtime/_sliced_to_array_loose.js +1 -1
- package/dist/vendor/swc_runtime/_super_prop_base.js +1 -1
- package/dist/vendor/swc_runtime/_tagged_template_literal.js +1 -1
- package/dist/vendor/swc_runtime/_tagged_template_literal_loose.js +1 -1
- package/dist/vendor/swc_runtime/_throw.js +1 -1
- package/dist/vendor/swc_runtime/_to_array.js +1 -1
- package/dist/vendor/swc_runtime/_to_consumable_array.js +1 -1
- package/dist/vendor/swc_runtime/_to_primitive.js +1 -1
- package/dist/vendor/swc_runtime/_to_property_key.js +1 -1
- package/dist/vendor/swc_runtime/_ts_add_disposable_resource.js +1 -0
- package/dist/vendor/swc_runtime/_ts_decorate.js +1 -1
- package/dist/vendor/swc_runtime/_ts_dispose_resources.js +1 -0
- package/dist/vendor/swc_runtime/_ts_generator.js +1 -1
- package/dist/vendor/swc_runtime/_ts_metadata.js +1 -1
- package/dist/vendor/swc_runtime/_ts_param.js +1 -1
- package/dist/vendor/swc_runtime/_ts_values.js +1 -1
- package/dist/vendor/swc_runtime/_type_of.js +1 -1
- package/dist/vendor/swc_runtime/_unsupported_iterable_to_array.js +1 -1
- package/dist/vendor/swc_runtime/_update.js +1 -1
- package/dist/vendor/swc_runtime/_using.js +1 -1
- package/dist/vendor/swc_runtime/_using_ctx.js +1 -0
- package/dist/vendor/swc_runtime/_wrap_async_generator.js +1 -1
- package/dist/vendor/swc_runtime/_wrap_native_super.js +1 -1
- package/dist/vendor/swc_runtime/_write_only_error.js +1 -1
- package/dist/vendor/swc_runtime/index.js +1 -1
- package/package.json +3 -3
- package/dist/@types/build-server/constant.d.ts +0 -42
- package/dist/@types/build-server/ctxManager.d.ts +0 -2
- package/dist/@types/build-server/fileCacheManager.d.ts +0 -43
- package/dist/@types/build-server/fileTaskDriver.d.ts +0 -36
- package/dist/@types/build-server/subProcess.d.ts +0 -1
- package/dist/@types/build-server/subTaskManager.d.ts +0 -8
- package/dist/@types/build-server/taskDriver.d.ts +0 -68
- package/dist/@types/build-server/taskFactory.d.ts +0 -22
- package/dist/@types/build-server/tasks/appserviceCompile/index.d.ts +0 -1
- package/dist/@types/build-server/tasks/appserviceCompile/utils/appdevserver/getAppService.d.ts +0 -5
- package/dist/@types/build-server/tasks/appserviceCompile/utils/appservice/getjsfile.d.ts +0 -19
- package/dist/@types/build-server/tasks/appserviceCompile/utils/appservice/getmainpkgsortedjsfiles.d.ts +0 -10
- package/dist/@types/build-server/tasks/appserviceCompile/utils/appservice/getwxappcode.d.ts +0 -23
- package/dist/@types/build-server/tasks/baseFileCompiler/OTService.d.ts +0 -7
- package/dist/@types/build-server/tasks/baseFileCompiler/enhance.d.ts +0 -29
- package/dist/@types/build-server/tasks/baseFileCompiler/es6module.d.ts +0 -44
- package/dist/@types/build-server/tasks/baseFileCompiler/index.d.ts +0 -3
- package/dist/@types/build-server/tasks/baseFileCompiler/javascript.d.ts +0 -36
- package/dist/@types/build-server/tasks/baseFileCompiler/less.d.ts +0 -43
- package/dist/@types/build-server/tasks/baseFileCompiler/minifywxml.d.ts +0 -10
- package/dist/@types/build-server/tasks/baseFileCompiler/readFile.d.ts +0 -2
- package/dist/@types/build-server/tasks/baseFileCompiler/sass.d.ts +0 -50
- package/dist/@types/build-server/tasks/baseFileCompiler/terser.d.ts +0 -20
- package/dist/@types/build-server/tasks/baseFileCompiler/typescript.d.ts +0 -25
- package/dist/@types/build-server/tasks/baseFileCompiler/worklet.d.ts +0 -13
- package/dist/@types/build-server/tasks/baseFileCompiler/wxss.d.ts +0 -33
- package/dist/@types/build-server/tasks/common/apperrcode.config.d.ts +0 -92
- package/dist/@types/build-server/tasks/common/compiletype.config.d.ts +0 -17
- package/dist/@types/build-server/tasks/common/constants.config.d.ts +0 -549
- package/dist/@types/build-server/tasks/common/simulatortype.config.d.ts +0 -15
- package/dist/@types/build-server/tasks/common/utils/appdevserver/getwxappcode.d.ts +0 -3
- package/dist/@types/build-server/tasks/common/utils/babel/babelhelpers.d.ts +0 -11
- package/dist/@types/build-server/tasks/common/utils/builder/builder.d.ts +0 -35
- package/dist/@types/build-server/tasks/common/utils/builder/filter.d.ts +0 -1
- package/dist/@types/build-server/tasks/common/utils/builder/index.d.ts +0 -10
- package/dist/@types/build-server/tasks/common/utils/cache/compile.d.ts +0 -72
- package/dist/@types/build-server/tasks/common/utils/cache/config.d.ts +0 -16
- package/dist/@types/build-server/tasks/common/utils/cache/filecompile.d.ts +0 -16
- package/dist/@types/build-server/tasks/common/utils/cache/jspersistcache.d.ts +0 -11
- package/dist/@types/build-server/tasks/common/utils/cache/manager.d.ts +0 -18
- package/dist/@types/build-server/tasks/common/utils/cache/persistcache.d.ts +0 -17
- package/dist/@types/build-server/tasks/common/utils/cache/reporter.d.ts +0 -9
- package/dist/@types/build-server/tasks/common/utils/colorutils.d.ts +0 -4
- package/dist/@types/build-server/tasks/common/utils/common/bindActionTools.d.ts +0 -8
- package/dist/@types/build-server/tasks/common/utils/common/schema.helper.d.ts +0 -0
- package/dist/@types/build-server/tasks/common/utils/common/tools.d.ts +0 -17
- package/dist/@types/build-server/tasks/common/utils/common/waitable.d.ts +0 -14
- package/dist/@types/build-server/tasks/common/utils/filerules.d.ts +0 -13
- package/dist/@types/build-server/tasks/common/utils/fsutils.d.ts +0 -7
- package/dist/@types/build-server/tasks/common/utils/handleError.d.ts +0 -0
- package/dist/@types/build-server/tasks/common/utils/helper/vendorValidate.d.ts +0 -0
- package/dist/@types/build-server/tasks/common/utils/interfacebuilder/registry/index.d.ts +0 -22
- package/dist/@types/build-server/tasks/common/utils/partialcompile.d.ts +0 -0
- package/dist/@types/build-server/tasks/common/utils/project/appconfig.d.ts +0 -5
- package/dist/@types/build-server/tasks/common/utils/project/appjson.d.ts +0 -2
- package/dist/@types/build-server/tasks/common/utils/project/customcomponent.d.ts +0 -20
- package/dist/@types/build-server/tasks/common/utils/project/generatecode.utils.d.ts +0 -5
- package/dist/@types/build-server/tasks/common/utils/project/getcompiledjs.d.ts +0 -30
- package/dist/@types/build-server/tasks/common/utils/project/helper/index.d.ts +0 -21
- package/dist/@types/build-server/tasks/common/utils/project/helper/projectconfigjsonutils.d.ts +0 -142
- package/dist/@types/build-server/tasks/common/utils/project/helper/reserveddirectories.d.ts +0 -3
- package/dist/@types/build-server/tasks/common/utils/project/helper/theme.d.ts +0 -39
- package/dist/@types/build-server/tasks/common/utils/project/online/appconfig.d.ts +0 -0
- package/dist/@types/build-server/tasks/common/utils/project/pagejson.d.ts +0 -2
- package/dist/@types/build-server/tasks/common/utils/project/projectconfigjson.d.ts +0 -8
- package/dist/@types/build-server/tasks/common/utils/project/wxappcodejson.d.ts +0 -2
- package/dist/@types/build-server/tasks/common/utils/subpackageUtils.d.ts +0 -0
- package/dist/@types/build-server/tasks/common/utils/tracing/Trace.d.ts +0 -50
- package/dist/@types/build-server/tasks/common/utils/tracing/aegis.d.ts +0 -3
- package/dist/@types/build-server/tasks/common/utils/tracing/index.d.ts +0 -34
- package/dist/@types/build-server/tasks/common/utils/tracing/readiness.d.ts +0 -11
- package/dist/@types/build-server/tasks/common/utils/tracing/report.d.ts +0 -14
- package/dist/@types/build-server/tasks/common/utils/trans/transwxmltojs.d.ts +0 -28
- package/dist/@types/build-server/tasks/common/utils/transformsourcemap.d.ts +0 -1
- package/dist/@types/build-server/tasks/common/utils/web/glasseaselUtils.d.ts +0 -1
- package/dist/@types/build-server/tasks/common/utils/web/md5.d.ts +0 -2
- package/dist/@types/build-server/tasks/common/utils/web/processPath.d.ts +0 -9
- package/dist/@types/build-server/tasks/common/weapp.config.d.ts +0 -108
- package/dist/@types/build-server/tasks/pageInitSourceCompile/index.d.ts +0 -2
- package/dist/@types/build-server/tasks/pageframeCompile/index.d.ts +0 -1
- package/dist/@types/build-server/tasks/pageframeCompile/utils/appdevserver/getwxappcode.d.ts +0 -8
- package/dist/@types/build-server/tasks/pageframeCompile/utils/trans/transwxsstojs.d.ts +0 -26
- package/dist/@types/build-server/testAppConfig.d.ts +0 -1
- package/dist/@types/build-server/testAppservice.d.ts +0 -1
- package/dist/@types/build-server/testInitSourceCompile.d.ts +0 -1
- package/dist/@types/build-server/testPageframe.d.ts +0 -1
- package/dist/@types/build-server/testSubProcess.d.ts +0 -1
- package/dist/@types/build-server/utils/fileTask.d.ts +0 -5
- package/dist/@types/build-server/utils/getFileOrCache.d.ts +0 -24
- package/dist/@types/build-server/utils/process.d.ts +0 -0
- package/dist/@types/build-server/utils/request.d.ts +0 -47
- package/dist/@types/bussinessMonitor/monitor.d.ts +0 -1
- package/dist/@types/modules/corecompiler/summer/pipeManager/index.d.ts +0 -6
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipeCPProject.d.ts +0 -17
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipeContext.d.ts +0 -10
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipeManager.d.ts +0 -12
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipeWorker.d.ts +0 -2
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/appservicePipe/index.d.ts +0 -3
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/compileWxmlToGlassEaselPipe.d.ts +0 -3
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/compileWxssPipe.d.ts +0 -3
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/index.d.ts +0 -2
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/pageInitSourcePipe/index.d.ts +0 -4
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/pageframePipe/index.d.ts +0 -3
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appdevserver/getAppService.d.ts +0 -6
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appdevserver/getwxappcode.d.ts +0 -9
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getjsfile.d.ts +0 -12
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getmainpkgsortedjsfiles.d.ts +0 -11
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getwxappcode.d.ts +0 -8
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/common/apperrcode.config.d.ts +0 -92
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/common/tools.d.ts +0 -1
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/appconfig.d.ts +0 -6
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/appjson.d.ts +0 -3
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/customcomponent.d.ts +0 -21
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/helper/theme.d.ts +0 -40
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/pagejson.d.ts +0 -3
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/wxappcodejson.d.ts +0 -3
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/trans/transwxmltojs.d.ts +0 -19
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/trans/transwxsstojs.d.ts +0 -15
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/web/processPath.d.ts +0 -9
- package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/wccPipe.d.ts +0 -3
- package/dist/@types/modules/corecompiler/summer/pipeManager/types.d.ts +0 -100
- package/dist/@types/modules/fullcompiler/appservice/appservice.config.d.ts +0 -4
- package/dist/@types/modules/fullcompiler/appservice/generatecode.utils.d.ts +0 -12
- package/dist/@types/modules/fullcompiler/appservice/getappservice.d.ts +0 -9
- package/dist/@types/modules/fullcompiler/appservice/getcompiledjs.d.ts +0 -32
- package/dist/@types/modules/fullcompiler/appservice/getjsfile.d.ts +0 -18
- package/dist/@types/modules/fullcompiler/appservice/getmainpkgsortedjsfiles.d.ts +0 -12
- package/dist/@types/modules/fullcompiler/appservice/getsubpackage.d.ts +0 -7
- package/dist/@types/modules/fullcompiler/appservice/getsubpkgsortedjsfiles.d.ts +0 -10
- package/dist/@types/modules/fullcompiler/appservice/getwxappcode.d.ts +0 -13
- package/dist/@types/modules/fullcompiler/config/apperrcode.config.d.ts +0 -48
- package/dist/@types/modules/fullcompiler/filerules.d.ts +0 -5
- package/dist/@types/modules/fullcompiler/getallrawfiles.d.ts +0 -11
- package/dist/@types/modules/fullcompiler/getallwmltohtmlmap.d.ts +0 -11
- package/dist/@types/modules/fullcompiler/index.d.ts +0 -31
- package/dist/@types/modules/fullcompiler/pageframe/getsubpackage.d.ts +0 -10
- package/dist/@types/modules/fullcompiler/pageframe/getwxappcode.d.ts +0 -13
- package/dist/@types/modules/fullcompiler/pageframe/index.d.ts +0 -10
- package/dist/@types/modules/fullcompiler/trans/transwxmltojs.d.ts +0 -11
- package/dist/@types/modules/fullcompiler/trans/transwxsstojs.d.ts +0 -21
- package/dist/@types/modules/fullcompiler/trans/wxml/compilewxml.d.ts +0 -18
- package/dist/@types/modules/fullcompiler/trans/wxss/compilewxss.d.ts +0 -11
- package/dist/@types/modules/fullcompiler/utils/appconfig/appconfig.d.ts +0 -12
- package/dist/@types/modules/fullcompiler/utils/appconfig/appjson.d.ts +0 -3
- package/dist/@types/modules/fullcompiler/utils/appconfig/checkcustomcomponent.d.ts +0 -14
- package/dist/@types/modules/fullcompiler/utils/appconfig/pagejson.d.ts +0 -3
- package/dist/@types/modules/fullcompiler/utils/appconfig/wxappcodejson.d.ts +0 -3
- package/dist/@types/modules/fullcompiler/utils/filewriter/index.d.ts +0 -14
- package/dist/@types/modules/fullcompiler/utils/handleerror/errorconfig.d.ts +0 -9
- package/dist/@types/modules/fullcompiler/utils/handleerror/handleerror.d.ts +0 -3
- package/dist/@types/modules/fullcompiler/utils/handleerror/parseerr.d.ts +0 -42
- package/dist/@types/modules/fullcompiler/utils/index.d.ts +0 -4
- package/dist/@types/modules/fullcompiler/utils/taskmanager.d.ts +0 -23
- package/dist/@types/modules/fullcompiler/utils/theme/index.d.ts +0 -40
- package/dist/@types/modules/fullcompiler/utils/tools.d.ts +0 -15
- package/dist/@types/modules/fullcompiler/utils/transformsourcemap.d.ts +0 -1
- package/dist/@types/project/serverProject.d.ts +0 -38
- package/dist/@types/services/app/server/appDirService.d.ts +0 -6
- package/dist/@types/services/builder/server/builder.d.ts +0 -4
- package/dist/@types/services/compileCacheManager/common/compileCacheManager.d.ts +0 -23
- package/dist/@types/services/compileCacheManager/nw/compileCacheManager.d.ts +0 -16
- package/dist/@types/services/compileCacheManager/server/compileCacheManager.d.ts +0 -26
- package/dist/@types/services/compilewxml/server/compilewxmlService.d.ts +0 -5
- package/dist/@types/services/compilewxml/server/wccWorker.d.ts +0 -1
- package/dist/@types/services/compilewxss/server/compilewxssService.d.ts +0 -4
- package/dist/@types/services/compilewxss/server/wcscWorker.d.ts +0 -1
- package/dist/@types/services/consoledisplay/server/consoledisplay.d.ts +0 -4
- package/dist/@types/services/fileUtilsManager/server/fileUtilsManager.d.ts +0 -4
- package/dist/@types/services/fs/server/fileService.d.ts +0 -27
- package/dist/@types/services/genTempFile/server/genTempFileService.d.ts +0 -3
- package/dist/@types/services/global/server/global.d.ts +0 -6
- package/dist/@types/services/initializeCheck/server/initializeCheck.d.ts +0 -4
- package/dist/@types/services/locales/server/const.d.ts +0 -5
- package/dist/@types/services/locales/server/locales.d.ts +0 -5
- package/dist/@types/services/log/server/logService.d.ts +0 -9
- package/dist/@types/services/miniappjson/server/miniappjson.d.ts +0 -4
- package/dist/@types/services/multiTaskManager/server/multiTaskManager.d.ts +0 -5
- package/dist/@types/services/multiTaskManager/server/pm2TaskWorker.d.ts +0 -1
- package/dist/@types/services/multiTaskManager/server/pm2WorkerManager.d.ts +0 -18
- package/dist/@types/services/nativeModule/server/nativeModule.d.ts +0 -3
- package/dist/@types/services/performance/server/performance.d.ts +0 -7
- package/dist/@types/services/pluginFileReader/server/pluginFileReader.d.ts +0 -18
- package/dist/@types/services/projectManager/server/buildServerProjectManager.d.ts +0 -11
- package/dist/@types/services/projectManager/server/projectManager.d.ts +0 -7
- package/dist/@types/services/root/server/root.d.ts +0 -11
- package/dist/@types/services/root/server/rootService.d.ts +0 -2
- package/dist/@types/services/staticConfig/server/staticConfigService.d.ts +0 -4
- package/dist/@types/services/store/server/storeService.d.ts +0 -11
- package/dist/@types/services/uniapp/server/uniapp.d.ts +0 -4
- package/dist/build-server/constant.js +0 -1
- package/dist/build-server/ctxManager.js +0 -1
- package/dist/build-server/fileCacheManager.js +0 -1
- package/dist/build-server/fileTaskDriver.js +0 -1
- package/dist/build-server/subProcess.js +0 -1
- package/dist/build-server/subTaskManager.js +0 -1
- package/dist/build-server/taskDriver.js +0 -1
- package/dist/build-server/taskFactory.js +0 -1
- package/dist/build-server/tasks/appserviceCompile/index.js +0 -1
- package/dist/build-server/tasks/appserviceCompile/utils/appdevserver/getAppService.js +0 -1
- package/dist/build-server/tasks/appserviceCompile/utils/appservice/getjsfile.js +0 -1
- package/dist/build-server/tasks/appserviceCompile/utils/appservice/getmainpkgsortedjsfiles.js +0 -1
- package/dist/build-server/tasks/appserviceCompile/utils/appservice/getwxappcode.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/OTService.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/enhance.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/es6module.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/index.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/javascript.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/less.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/minifywxml.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/readFile.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/sass.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/terser.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/typescript.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/worklet.js +0 -1
- package/dist/build-server/tasks/baseFileCompiler/wxss.js +0 -1
- package/dist/build-server/tasks/common/apperrcode.config.js +0 -1
- package/dist/build-server/tasks/common/compiletype.config.js +0 -1
- package/dist/build-server/tasks/common/constants.config.js +0 -1
- package/dist/build-server/tasks/common/simulatortype.config.js +0 -1
- package/dist/build-server/tasks/common/utils/appdevserver/getwxappcode.js +0 -1
- package/dist/build-server/tasks/common/utils/babel/babelhelpers.js +0 -1
- package/dist/build-server/tasks/common/utils/builder/builder.js +0 -1
- package/dist/build-server/tasks/common/utils/builder/filter.js +0 -1
- package/dist/build-server/tasks/common/utils/builder/index.js +0 -1
- package/dist/build-server/tasks/common/utils/cache/compile.js +0 -1
- package/dist/build-server/tasks/common/utils/cache/config.js +0 -1
- package/dist/build-server/tasks/common/utils/cache/filecompile.js +0 -1
- package/dist/build-server/tasks/common/utils/cache/jspersistcache.js +0 -1
- package/dist/build-server/tasks/common/utils/cache/manager.js +0 -1
- package/dist/build-server/tasks/common/utils/cache/persistcache.js +0 -1
- package/dist/build-server/tasks/common/utils/cache/reporter.js +0 -1
- package/dist/build-server/tasks/common/utils/colorutils.js +0 -1
- package/dist/build-server/tasks/common/utils/common/bindActionTools.js +0 -1
- package/dist/build-server/tasks/common/utils/common/schema.helper.js +0 -1
- package/dist/build-server/tasks/common/utils/common/tools.js +0 -1
- package/dist/build-server/tasks/common/utils/common/waitable.js +0 -1
- package/dist/build-server/tasks/common/utils/filerules.js +0 -1
- package/dist/build-server/tasks/common/utils/fsutils.js +0 -1
- package/dist/build-server/tasks/common/utils/handleError.js +0 -1
- package/dist/build-server/tasks/common/utils/helper/vendorValidate.js +0 -1
- package/dist/build-server/tasks/common/utils/interfacebuilder/registry/index.js +0 -1
- package/dist/build-server/tasks/common/utils/partialcompile.js +0 -1
- package/dist/build-server/tasks/common/utils/project/appconfig.js +0 -1
- package/dist/build-server/tasks/common/utils/project/appjson.js +0 -1
- package/dist/build-server/tasks/common/utils/project/customcomponent.js +0 -1
- package/dist/build-server/tasks/common/utils/project/generatecode.utils.js +0 -1
- package/dist/build-server/tasks/common/utils/project/getcompiledjs.js +0 -1
- package/dist/build-server/tasks/common/utils/project/helper/index.js +0 -1
- package/dist/build-server/tasks/common/utils/project/helper/projectconfigjsonutils.js +0 -1
- package/dist/build-server/tasks/common/utils/project/helper/reserveddirectories.js +0 -1
- package/dist/build-server/tasks/common/utils/project/helper/theme.js +0 -1
- package/dist/build-server/tasks/common/utils/project/online/appconfig.js +0 -1
- package/dist/build-server/tasks/common/utils/project/pagejson.js +0 -1
- package/dist/build-server/tasks/common/utils/project/projectconfigjson.js +0 -1
- package/dist/build-server/tasks/common/utils/project/wxappcodejson.js +0 -1
- package/dist/build-server/tasks/common/utils/subpackageUtils.js +0 -1
- package/dist/build-server/tasks/common/utils/tracing/Trace.js +0 -1
- package/dist/build-server/tasks/common/utils/tracing/aegis.js +0 -1
- package/dist/build-server/tasks/common/utils/tracing/index.js +0 -1
- package/dist/build-server/tasks/common/utils/tracing/readiness.js +0 -1
- package/dist/build-server/tasks/common/utils/tracing/report.js +0 -1
- package/dist/build-server/tasks/common/utils/trans/transwxmltojs.js +0 -1
- package/dist/build-server/tasks/common/utils/transformsourcemap.js +0 -1
- package/dist/build-server/tasks/common/utils/web/glasseaselUtils.js +0 -1
- package/dist/build-server/tasks/common/utils/web/md5.js +0 -1
- package/dist/build-server/tasks/common/utils/web/processPath.js +0 -1
- package/dist/build-server/tasks/common/weapp.config.js +0 -1
- package/dist/build-server/tasks/pageInitSourceCompile/index.js +0 -1
- package/dist/build-server/tasks/pageframeCompile/index.js +0 -1
- package/dist/build-server/tasks/pageframeCompile/utils/appdevserver/getwxappcode.js +0 -1
- package/dist/build-server/tasks/pageframeCompile/utils/trans/transwxsstojs.js +0 -1
- package/dist/build-server/testAppConfig.js +0 -1
- package/dist/build-server/testAppservice.js +0 -1
- package/dist/build-server/testInitSourceCompile.js +0 -1
- package/dist/build-server/testPageframe.js +0 -1
- package/dist/build-server/testSubProcess.js +0 -1
- package/dist/build-server/utils/fileTask.js +0 -1
- package/dist/build-server/utils/getFileOrCache.js +0 -1
- package/dist/build-server/utils/process.js +0 -1
- package/dist/build-server/utils/request.js +0 -1
- package/dist/bussinessMonitor/monitor.js +0 -1
- package/dist/manifest.json +0 -4
- package/dist/modules/corecompiler/summer/pipeManager/index.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipeCPProject.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipeContext.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipeManager.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipeWorker.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/appservicePipe/index.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/compileWxmlToGlassEaselPipe.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/compileWxssPipe.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/index.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/pageInitSourcePipe/index.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/pageframePipe/index.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appdevserver/getAppService.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appdevserver/getwxappcode.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getjsfile.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getmainpkgsortedjsfiles.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getwxappcode.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/common/apperrcode.config.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/common/tools.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/appconfig.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/appjson.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/customcomponent.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/helper/theme.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/pagejson.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/wxappcodejson.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/trans/transwxmltojs.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/trans/transwxsstojs.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/web/processPath.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/pipes/wccPipe.js +0 -1
- package/dist/modules/corecompiler/summer/pipeManager/types.js +0 -1
- package/dist/modules/fullcompiler/appservice/appservice.config.js +0 -1
- package/dist/modules/fullcompiler/appservice/generatecode.utils.js +0 -1
- package/dist/modules/fullcompiler/appservice/getappservice.js +0 -1
- package/dist/modules/fullcompiler/appservice/getcompiledjs.js +0 -1
- package/dist/modules/fullcompiler/appservice/getjsfile.js +0 -1
- package/dist/modules/fullcompiler/appservice/getmainpkgsortedjsfiles.js +0 -1
- package/dist/modules/fullcompiler/appservice/getsubpackage.js +0 -1
- package/dist/modules/fullcompiler/appservice/getsubpkgsortedjsfiles.js +0 -1
- package/dist/modules/fullcompiler/appservice/getwxappcode.js +0 -1
- package/dist/modules/fullcompiler/config/apperrcode.config.js +0 -1
- package/dist/modules/fullcompiler/filerules.js +0 -1
- package/dist/modules/fullcompiler/getallrawfiles.js +0 -1
- package/dist/modules/fullcompiler/getallwmltohtmlmap.js +0 -1
- package/dist/modules/fullcompiler/index.js +0 -1
- package/dist/modules/fullcompiler/pageframe/getsubpackage.js +0 -1
- package/dist/modules/fullcompiler/pageframe/getwxappcode.js +0 -1
- package/dist/modules/fullcompiler/pageframe/index.js +0 -1
- package/dist/modules/fullcompiler/trans/transwxmltojs.js +0 -1
- package/dist/modules/fullcompiler/trans/transwxsstojs.js +0 -1
- package/dist/modules/fullcompiler/trans/wxml/compilewxml.js +0 -1
- package/dist/modules/fullcompiler/trans/wxss/compilewxss.js +0 -1
- package/dist/modules/fullcompiler/utils/appconfig/appconfig.js +0 -1
- package/dist/modules/fullcompiler/utils/appconfig/appjson.js +0 -1
- package/dist/modules/fullcompiler/utils/appconfig/checkcustomcomponent.js +0 -1
- package/dist/modules/fullcompiler/utils/appconfig/pagejson.js +0 -1
- package/dist/modules/fullcompiler/utils/appconfig/wxappcodejson.js +0 -1
- package/dist/modules/fullcompiler/utils/filewriter/index.js +0 -1
- package/dist/modules/fullcompiler/utils/handleerror/errorconfig.js +0 -1
- package/dist/modules/fullcompiler/utils/handleerror/handleerror.js +0 -1
- package/dist/modules/fullcompiler/utils/handleerror/parseerr.js +0 -1
- package/dist/modules/fullcompiler/utils/index.js +0 -1
- package/dist/modules/fullcompiler/utils/taskmanager.js +0 -1
- package/dist/modules/fullcompiler/utils/theme/index.js +0 -1
- package/dist/modules/fullcompiler/utils/tools.js +0 -1
- package/dist/modules/fullcompiler/utils/transformsourcemap.js +0 -1
- package/dist/project/serverProject.js +0 -1
- package/dist/services/app/server/appDirService.js +0 -1
- package/dist/services/builder/server/builder.js +0 -1
- package/dist/services/compileCacheManager/common/compileCacheManager.js +0 -1
- package/dist/services/compileCacheManager/nw/compileCacheManager.js +0 -1
- package/dist/services/compileCacheManager/server/compileCacheManager.js +0 -1
- package/dist/services/compilewxml/server/compilewxmlService.js +0 -1
- package/dist/services/compilewxml/server/wccWorker.js +0 -1
- package/dist/services/compilewxss/server/compilewxssService.js +0 -1
- package/dist/services/compilewxss/server/wcscWorker.js +0 -1
- package/dist/services/consoledisplay/server/consoledisplay.js +0 -1
- package/dist/services/fileUtilsManager/server/fileUtilsManager.js +0 -1
- package/dist/services/fs/server/fileService.js +0 -1
- package/dist/services/genTempFile/server/genTempFileService.js +0 -1
- package/dist/services/global/server/global.js +0 -1
- package/dist/services/initializeCheck/server/initializeCheck.js +0 -1
- package/dist/services/locales/server/const.js +0 -1
- package/dist/services/locales/server/locales.js +0 -1
- package/dist/services/log/server/logService.js +0 -1
- package/dist/services/miniappjson/server/miniappjson.js +0 -1
- package/dist/services/multiTaskManager/server/multiTaskManager.js +0 -1
- package/dist/services/multiTaskManager/server/pm2TaskWorker.js +0 -1
- package/dist/services/multiTaskManager/server/pm2WorkerManager.js +0 -1
- package/dist/services/nativeModule/server/nativeModule.js +0 -1
- package/dist/services/performance/server/performance.js +0 -1
- package/dist/services/pluginFileReader/server/pluginFileReader.js +0 -1
- package/dist/services/projectManager/server/buildServerProjectManager.js +0 -1
- package/dist/services/projectManager/server/projectManager.js +0 -1
- package/dist/services/root/server/root.js +0 -1
- package/dist/services/root/server/rootService.js +0 -1
- package/dist/services/staticConfig/server/staticConfigService.js +0 -1
- package/dist/services/store/server/storeService.js +0 -1
- package/dist/services/uniapp/server/uniapp.js +0 -1
package/dist/config/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var COMPILE_TYPE,AstType,EFilterCode;function getDefaultIgnores(e){const _=["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"];return"multiPlatform"===e.projectArchitecture&&_.push(`${exports.multiPlatformRoot}/**/*`),_}Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAX_CODE_LENGTH=exports.EFilterCode=exports.AstType=exports.compileTypeConfig=exports.FullPkg=exports.MainPkg=exports.multiPlatformRoot=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.getDefaultIgnores=getDefaultIgnores,exports.CI_VERSION="2.1.
|
|
1
|
+
"use strict";var COMPILE_TYPE,AstType,EFilterCode;function getDefaultIgnores(e){const _=["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"];return"multiPlatform"===e.projectArchitecture&&_.push(`${exports.multiPlatformRoot}/**/*`),_}Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAX_CODE_LENGTH=exports.EFilterCode=exports.AstType=exports.compileTypeConfig=exports.FullPkg=exports.MainPkg=exports.multiPlatformRoot=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.getDefaultIgnores=getDefaultIgnores,exports.CI_VERSION="2.1.36",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(e){e.miniProgram="miniProgram",e.miniProgramPlugin="miniProgramPlugin",e.miniGame="miniGame",e.miniGamePlugin="miniGamePlugin"}(COMPILE_TYPE||(exports.COMPILE_TYPE=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"]}},exports.multiPlatformRoot="miniapp",exports.MainPkg="__APP__",exports.FullPkg="__FULL__",exports.compileTypeConfig={weapp:"weapp",game:"game",plugin:"plugin",gamePlugin:"gamePlugin"},function(e){e.Babel="babel",e.Acorn="acorn"}(AstType||(exports.AstType=AstType={})),function(e){e[e.Include=0]="Include",e[e.PackOptionsIgnore=1]="PackOptionsIgnore",e[e.AnalyseNoUse=2]="AnalyseNoUse",e[e.PartialCompileNoUse=3]="PartialCompileNoUse"}(EFilterCode||(exports.EFilterCode=EFilterCode={})),exports.MAX_CODE_LENGTH=2048e3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"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 i;try{i=new sourcemap.SourceMapConsumer(n||""),e=i.sourceContentFor(t)||e}catch(e){}const o=[];for(const n of r){let t={line:n.line,column:n.column>0?n.column:0};try{i&&(t=i.originalPositionFor({line:n.line,column:n.column}))}catch(e){}const r=(0,babel_code_frame_1.default)(e,t.line,t.column);o.push(`${n.reason}\n${r}`)}return o.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],i=n[e+1];if(i){const n=[];let o=0;for(const e in i){const t=i[e];n.push(r.substr(o,t.column-o+1)),n.push(t.toString),o=t.column+t.fromString.length+1}n.push(r.substr(o)),t[e]=n.join("")}}return t.join("\n")}function translateSourceMap(e,n,t){const r=new sourcemap.SourceMapConsumer(e),i=new sourcemap.SourceMapGenerator({file:n});let o;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(o&&o.line===e.generatedLine?n.generated.column+=o.offset:o=void 0,t[e.generatedLine]){const n=t[e.generatedLine][e.generatedColumn];n&&(o&&o.line===n.line?o.offset+=n.offset:o={line:n.line,offset:n.offset})}i.addMapping(n)})),i.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,i=n;for(;i;)if(i=dirname(i),r=e.endsWith(".js")?path_1.default.posix.join(i,"miniprogram_npm",e):path_1.default.posix.join(i,"miniprogram_npm",e,"index.js"),t.includes(r))return r;return!1}const tryTranslateSingleFile=e=>{var n,t;const r=new TranslateResult,{filePath:i,nameMapping:o,code:a,rootPath:l,miniProgramJSFiles:s}=e;let u=path_1.default.posix.dirname(path_1.default.posix.relative(l,i));"."===u&&(u="");const
|
|
1
|
+
"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 i;try{i=new sourcemap.SourceMapConsumer(n||""),e=i.sourceContentFor(t)||e}catch(e){}const o=[];for(const n of r){let t={line:n.line,column:n.column>0?n.column:0};try{i&&(t=i.originalPositionFor({line:n.line,column:n.column}))}catch(e){}const r=(0,babel_code_frame_1.default)(e,t.line,t.column);o.push(`${n.reason}\n${r}`)}return o.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],i=n[e+1];if(i){const n=[];let o=0;for(const e in i){const t=i[e];n.push(r.substr(o,t.column-o+1)),n.push(t.toString),o=t.column+t.fromString.length+1}n.push(r.substr(o)),t[e]=n.join("")}}return t.join("\n")}function translateSourceMap(e,n,t){const r=new sourcemap.SourceMapConsumer(e),i=new sourcemap.SourceMapGenerator({file:n});let o;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(o&&o.line===e.generatedLine?n.generated.column+=o.offset:o=void 0,t[e.generatedLine]){const n=t[e.generatedLine][e.generatedColumn];n&&(o&&o.line===n.line?o.offset+=n.offset:o={line:n.line,offset:n.offset})}i.addMapping(n)})),i.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,i=n;for(;i;)if(i=dirname(i),r=e.endsWith(".js")?path_1.default.posix.join(i,"miniprogram_npm",e):path_1.default.posix.join(i,"miniprogram_npm",e,"index.js"),t.includes(r))return r;return!1}const tryTranslateSingleFile=e=>{var n,t;const r=new TranslateResult,{filePath:i,nameMapping:o,code:a,rootPath:l,miniProgramJSFiles:s}=e;let u=path_1.default.posix.dirname(path_1.default.posix.relative(l,i));"."===u&&(u="");const p=[];let c;try{c=parser.parse(a)}catch(o){return p.push({line:(null===(n=o.loc)||void 0===n?void 0:n.line)||1,column:(null===(t=o.loc)||void 0===t?void 0:t.column)||1,reason:o.message}),r.translated=!1,r.errMsg=`in ${path_1.default.posix.join(l,i)}\n${getErrorCodeFrame(a,e.sourceMap,e.sourceFileName,p)}`,r}const d={};if((0,traverse_1.default)(c,{AssignmentExpression(e){const n=e.node.loc.start;"Identifier"===e.node.left.type&&"require"===e.node.left.name&&p.push({line:n.line,column:n.column,reason:"assigning other name with 'require'"}),"Identifier"===e.node.right.type&&"require"===e.node.right.name&&p.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&&p.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&&p.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&&p.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||p.push({line:t.line,column:t.column,reason:"'require' requires one and only one static string literal"})),"MemberExpression"===n.node.callee.type&&"Identifier"===n.node.callee.object.type&&"require"===n.node.callee.object.name&&"Identifier"===n.node.callee.property.type&&"async"===n.node.callee.property.name&&(1===n.node.arguments.length&&"StringLiteral"===n.node.arguments[0].type||p.push({line:t.line,column:t.column,reason:"'require.async' requires one and only one static string literal"})),"MemberExpression"===n.node.callee.type&&"Identifier"===n.node.callee.object.type&&"require"===n.node.callee.object.name&&"Identifier"===n.node.callee.property.type&&"async"===n.node.callee.property.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,p=e.resolveAlias(a);let c;c=p?path_1.default.posix.join(l,p):path_1.default.posix.normalize(path_1.default.posix.join(u,a)),c.endsWith(".js")||(c+=".js"),c.startsWith("/")&&(c=c.replace(/^\//,""));let m=o[c];if(m)m=o[i]?path_1.default.posix.relative(path_1.default.posix.dirname(o[i]),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([i,a,"replace",[c,m]]);else{if(o[i]){const e=getNpmRequirePath(a,i,s);e&&(c=e),m=path_1.default.posix.relative(path_1.default.posix.dirname(o[i]),c),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([i,a,"replace",[c,m]])}r.debugs.push([i,a,"ignored"])}}if("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,p=e.resolveAlias(a);let c;c=p?path_1.default.posix.join(l,p):path_1.default.posix.normalize(path_1.default.posix.join(u,a)),c.endsWith(".js")||(c+=".js"),c.startsWith("/")&&(c=c.replace(/^\//,""));let m=o[c];if(m)m=o[i]?path_1.default.posix.relative(path_1.default.posix.dirname(o[i]),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([i,a,"replace",[c,m]]);else{if(o[i]){const e=getNpmRequirePath(a,i,s);e&&(c=e),m=path_1.default.posix.relative(path_1.default.posix.dirname(o[i]),c),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([i,a,"replace",[c,m]])}r.debugs.push([i,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;if("MemberExpression"===e.parent.type&&"Identifier"===e.parent.property.type&&"async"===e.parent.property.name)return;"CallExpression"!==e.parent.type&&p.push({line:n.line,column:n.column,reason:`require is not being used properly in '${e.parent.type}'`})}}}),p.length>0)return r.translated=!1,r.errMsg=`in ${i}\n${getErrorCodeFrame(a,e.sourceMap,e.sourceFileName,p)}`,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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getGameNameMapping=exports.getNameMapping=void 0,exports.uglifyFileNames=uglifyFileNames;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),config_1=require("../../../../config/config"),error_1=require("../../../../utils/error"),tools_1=require("../../../../utils/tools"),game_1=tslib_1.__importDefault(require("../json/game")),app_1=require("../json/app"),url_config_1=require("../../../../config/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/config")),common_1=require("../../../../utils/common"),fileFlatter_1=require("./fileFlatter");function checkPrefix(e,t){for(const a of t)if(e.startsWith(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
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getGameNameMapping=exports.getNameMapping=void 0,exports.uglifyFileNames=uglifyFileNames;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),config_1=require("../../../../config/config"),error_1=require("../../../../utils/error"),tools_1=require("../../../../utils/tools"),game_1=tslib_1.__importDefault(require("../json/game")),app_1=require("../json/app"),url_config_1=require("../../../../config/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/config")),common_1=require("../../../../utils/common"),fileFlatter_1=require("./fileFlatter");function checkPrefix(e,t){for(const a of t)if(e.startsWith(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 o={};if("miniProgram"===e.type){const r=(0,app_1.getAppJSON)(e);o=await getMiniProgramNameMapping(e,t,r,a)}if("miniGame"===e.type){const t=(0,game_1.default)(e);o=await(0,exports.getGameNameMapping)(e,t,a)}return o}catch(e){throw new error_1.CodeError(e.toString(),config_1.CODE_PROTECT_TRANSLATE_FILENAME)}};exports.getNameMapping=getNameMapping;const getMiniProgramNameMapping=async(e,t,a,o)=>{var r,i,s;const n=[{type:"file",value:"app.js"},{type:"regex",value:/\/miniprogram_npm\/|^miniprogram_npm\//},{type:"folder",value:"functional-pages/"}],p=e.getFileList(t,".wxml").map((e=>path_1.default.posix.relative(t,e)));for(const e of p)n.push({type:"file",value:`${e.replace(/\.wxml$/,".js")}`});let l=[];return a.subPackages&&(l=a.subPackages.map((e=>e.root))),(null===(r=null==a?void 0:a.widgets)||void 0===r?void 0:r.length)>0&&a.widgets.forEach((e=>{n.push({type:"folder",value:e.path.endsWith("/")?e.path:`${e.path}/`})})),a.workers&&n.push({type:"folder",value:(0,tools_1.getWorkersPath)(a.workers)}),a.openDataContext&&(n.push({type:"file",value:path_1.default.posix.join(a.openDataContext,"index.js")}),l.push(a.openDataContext)),Array.isArray(null===(i=a.agent)||void 0===i?void 0:i.skills)&&(null===(s=a.agent)||void 0===s||s.skills.forEach((e=>{"string"==typeof e.path&&(n.push({type:"file",value:path_1.default.posix.join(e.path,"index.js")}),l.push(e.path))}))),await _getNameMapping(e,o,n,l)},getGameNameMapping=async(e,t,a)=>{const o=[{type:"file",value:"game.js"},{type:"regex",value:/\/miniprogram_npm\/|^miniprogram_npm\//}],r=[];if(t.subPackages&&t.subPackages.forEach((e=>{const t=e.root.replace(/^\//,"");t.endsWith(".js")?(o.push({type:"file",value:t}),r.push(path_1.default.posix.dirname(t))):(o.push({type:"file",value:path_1.default.posix.join(t,"./game.js")}),r.push(t))})),t.openDataContext&&(o.push({type:"file",value:path_1.default.posix.join(t.openDataContext,"index.js")}),r.push(t.openDataContext)),t.workers&&o.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(/^\//,"");o.push({type:"folder",value:e})}}return await _getNameMapping(e,a,o,r)};async function _getNameMapping(e,t,a,o=[]){const r={},i=[];for(const e of t){let t=!1;for(const o of a)if("file"===o.type&&o.value===e||"folder"===o.type&&e.startsWith(o.value)||"regex"===o.type&&o.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,o);r[e.origin]=(0,tools_1.normalizePath)(path_1.default.posix.join(t,`${e.translated}.js`))})),r;throw new Error(`errCode: ${p.errCode} errMsg: ${p.errMsg}`)}function genResolveAlias(e){if(e){const t=[];return Object.keys(e).forEach((a=>{let o=a;a.endsWith("*")&&(o=o.slice(0,-1));let r=e[a];e[a].endsWith("*")&&(r=r.slice(0,-1)),t.push({key:o,value:r})})),e=>{let a={key:"",value:""},o=!1;if(t.forEach((t=>{e.startsWith(t.key)&&a.key.length<t.key.length&&(a=t,o=!0)})),!o)return;let r=e.replace(a.key,a.value);return r.startsWith("/")&&(r=r.slice(1)),r}}return e=>{}}async function uglifyFileNames(e,t,a){let o={miniprogramRoot:""};try{o=JSON.parse(t["project.config.json"].toString())}catch(e){}let r=(0,tools_1.normalizePath)(o.miniprogramRoot);"."===r&&(r=""),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(r,"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 o=e,p=t[e].toString(),l=t[`${e}.map`]||"";s[o]=(0,fileFlatter_1.tryTranslateSingleFile)({rootPath:r,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 o=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(r,e);a[n]&&(o=(0,tools_1.normalizePath)(path_1.default.posix.join(r,a[n])),delete u[t],delete u[`${t}.map`]),u[o]=i.translatedContent,i.translatedSourceMap&&(u[`${o}.map`]=i.translatedSourceMap)}return u}exports.getGameNameMapping=getGameNameMapping;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ETaskStatus,EWorkerStatus,EChildProcessStatus;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SUICIDE_TIME=exports.EChildProcessStatus=exports.EWorkerStatus=exports.COMMAND=exports.TASK_NAME=exports.ETaskStatus=void 0,function(
|
|
1
|
+
"use strict";var ETaskStatus,EWorkerStatus,EChildProcessStatus;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SUICIDE_TIME=exports.EChildProcessStatus=exports.EWorkerStatus=exports.COMMAND=exports.TASK_NAME=exports.ETaskStatus=void 0,function(t){t[t.waiting=0]="waiting",t[t.progress=1]="progress",t[t.done=2]="done"}(ETaskStatus||(exports.ETaskStatus=ETaskStatus={})),exports.TASK_NAME={COMPILE_JS:"COMPILE_JS",COMPILE_WXSS:"COMPILE_WXSS",MINIFY_WXML:"MINIFY_WXML",SUMMER_HOOK:"SUMMER_HOOK",PIPE_TASK:"PIPE_TASK"},exports.COMMAND={INIT_START:"INIT_START",INIT_READY:"INIT_READY",RUN_TASK:"RUN_TASK",TASK_DONE:"TASK_DONE",CALL_FUNC:"CALL_FUNC",CALL_FUNC_RESULT:"CALL_FUNC_RESULT",CHILD_PROCESS_READY:"CHILD_PROCESS_READY",SEND_LOG:"SEND_LOG"},function(t){t[t.initiating=0]="initiating",t[t.free=1]="free",t[t.busy=2]="busy",t[t.dying=3]="dying"}(EWorkerStatus||(exports.EWorkerStatus=EWorkerStatus={})),function(t){t[t.free=0]="free",t[t.busy=1]="busy",t[t.fullload=2]="fullload",t[t.dying=3]="dying"}(EChildProcessStatus||(exports.EChildProcessStatus=EChildProcessStatus={})),exports.SUICIDE_TIME={devtools:864e5,"miniprogram-ci":1e4,webide:864e5};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
process.env&&process.env.isDevtools&&require("../../../../utils/hackrequire/index"),Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib");require("../../../../utils/processBootstrap").installProcessBootstrap({baseDir:__dirname,hackRequirePath:"../../../../utils/hackrequire/index",moduleFallbackPath:"../../../../../../../unpack/module-fallback"});const worker_threads_1=require("worker_threads"),logger_1=require("../utils/logger"),index_1=tslib_1.__importDefault(require("./task/index")),config_1=require("./config"),getservice_1=require("../../../../services/common/getservice");worker_threads_1.isMainThread?module.exports=index_1.default:worker_threads_1.parentPort.on("message",(e=>{const{command:r,data:t}=e;if(r===config_1.COMMAND.INIT_START){const e=(0,getservice_1.getServicesEnv)();return(0,getservice_1.initServices)(e,t),void worker_threads_1.parentPort.postMessage({command:config_1.COMMAND.INIT_READY})}r===config_1.COMMAND.RUN_TASK&&(logger_1.logger.info("worker process task start",r,t.data.filePath),(0,index_1.default)(t.taskName,t.data).then((e=>{logger_1.logger.info("worker process task end",r,t.data.filePath),worker_threads_1.parentPort.postMessage({command:config_1.COMMAND.TASK_DONE,data:e})})).catch((e=>{worker_threads_1.parentPort.postMessage({command:config_1.COMMAND.TASK_DONE,data:{error:e.toString()}})})))}));
|
|
1
|
+
process.env&&process.env.isDevtools&&require("../../../../utils/hackrequire/index"),Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib");require("../../../../utils/processBootstrap").installProcessBootstrap({baseDir:__dirname,hackRequirePath:"../../../../utils/hackrequire/index",moduleFallbackPath:"../../../../../../../unpack/module-fallback"});const worker_threads_1=require("worker_threads"),logger_1=require("../utils/logger"),index_1=tslib_1.__importDefault(require("./task/index")),config_1=require("./config"),getservice_1=require("../../../../services/common/getservice"),customError_1=require("../../../../utils/customError");worker_threads_1.isMainThread?module.exports=index_1.default:worker_threads_1.parentPort.on("message",(e=>{const{command:r,data:t}=e;if(r===config_1.COMMAND.INIT_START){const e=(0,getservice_1.getServicesEnv)();return(0,getservice_1.initServices)(e,t),void worker_threads_1.parentPort.postMessage({command:config_1.COMMAND.INIT_READY})}r===config_1.COMMAND.RUN_TASK&&(logger_1.logger.info("worker process task start",r,t.data.filePath),(0,index_1.default)(t.taskName,t.data).then((e=>{logger_1.logger.info("worker process task end",r,t.data.filePath),worker_threads_1.parentPort.postMessage({command:config_1.COMMAND.TASK_DONE,data:e})})).catch((e=>{worker_threads_1.parentPort.postMessage({command:config_1.COMMAND.TASK_DONE,data:{error:e instanceof customError_1.CustomError?e.toJSON():e.toString()}})})))}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getWorkerManager=exports.AbortEvent=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),events_1=tslib_1.__importDefault(require("events")),log=tslib_1.__importStar(require("../../../../utils/log")),logger_1=require("../utils/logger"),env_1=require("../utils/env"),child_process_1=require("child_process"),call_func_1=require("./task/call_func"),config_1=require("./config"),getWorkerPoolSize_1=tslib_1.__importDefault(require("./getWorkerPoolSize")),debug_1=require("../../../../utils/debug"),async_1=require("../../summer/utils/async"),getservice_1=tslib_1.__importDefault(require("../../../../services/common/getservice")),appDirService_1=require("../../../../services/app/common/appDirService"),nativeModule_1=require("../../../../services/nativeModule/common/nativeModule"),cpus=(0,getWorkerPoolSize_1.default)(),WORKER_PATH=path_1.default.posix.join(__dirname,"./worker.js"),FORK_PATH=path_1.default.posix.join(__dirname,"./fork.js"),MAX_TASK_TRY_TIME=2;let envIsDevtools=!1;function getCurrentScriptPath(){const e=path_1.default.posix.relative(process.cwd(),__filename);return process.cwd()===__dirname?`.${path_1.default.posix.resolve}${e}`:e}const supportWebWorkerThread="undefined"!=typeof WEBIDE_WEBPECK_DEFINE_PLUGIN;let Worker,supportWorkerThread=!1;try{Worker=require("worker_threads").Worker,supportWorkerThread=!0}catch(e){supportWorkerThread=!1}let
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getWorkerManager=exports.AbortEvent=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),events_1=tslib_1.__importDefault(require("events")),log=tslib_1.__importStar(require("../../../../utils/log")),logger_1=require("../utils/logger"),env_1=require("../utils/env"),child_process_1=require("child_process"),call_func_1=require("./task/call_func"),config_1=require("./config"),getWorkerPoolSize_1=tslib_1.__importDefault(require("./getWorkerPoolSize")),debug_1=require("../../../../utils/debug"),async_1=require("../../summer/utils/async"),getservice_1=tslib_1.__importDefault(require("../../../../services/common/getservice")),appDirService_1=require("../../../../services/app/common/appDirService"),nativeModule_1=require("../../../../services/nativeModule/common/nativeModule"),cpus=(0,getWorkerPoolSize_1.default)(),WORKER_PATH=path_1.default.posix.join(__dirname,"./worker.js"),FORK_PATH=path_1.default.posix.join(__dirname,"./fork.js"),MAX_TASK_TRY_TIME=2;let envIsDevtools=!1;function getCurrentScriptPath(){const e=path_1.default.posix.relative(process.cwd(),__filename);return process.cwd()===__dirname?`.${path_1.default.posix.resolve}${e}`:e}const supportWebWorkerThread="undefined"!=typeof WEBIDE_WEBPECK_DEFINE_PLUGIN;let Worker,supportWorkerThread=!1;try{Worker=require("worker_threads").Worker,supportWorkerThread=!0}catch(e){supportWorkerThread=!1}let _workerInspectPort=9320;function resolveTaskLabel(e,t){return e===config_1.TASK_NAME.SUMMER_HOOK&&(null==t?void 0:t.method)?`${e}:${t.plugin}:${t.method}`:e===config_1.TASK_NAME.PIPE_TASK&&(null==t?void 0:t.pipeName)?`${e}:${t.pipeName}`:e}exports.AbortEvent="WorkerTaskAborted";let workerManagerInstance,WorkerInstanceThreadIdIdx=0;class WorkerInstance extends events_1.default{constructor(){super(),this.status=config_1.EWorkerStatus.initiating,this.threadId=-1,this._suicideTime=config_1.SUICIDE_TIME["miniprogram-ci"],this._postMessage=()=>{},this._initBarrier=null,this._taskStartTime=0,this.threadId=WorkerInstanceThreadIdIdx++}async init(){envIsDevtools&&(this._suicideTime=config_1.SUICIDE_TIME.devtools);const e={NODE_PATH:process.env.NODE_PATH||path_1.default.posix.join(__filename,"../../../../../../../../node_modules"),ELECTRON_MODULE_FALLBACK_DIRS:process.env.ELECTRON_MODULE_FALLBACK_DIRS||"",ELECTRON_ACTIVE_APP_PATH:process.env.ELECTRON_ACTIVE_APP_PATH||"",ELECTRON_BASE_APP_PATH:process.env.ELECTRON_BASE_APP_PATH||"",isDevtools:String(envIsDevtools)};if(supportWebWorkerThread);else if(supportWorkerThread){const t=await(0,debug_1.shouldInspectWorker)()?["--inspect="+_workerInspectPort++]:[];this._instance=new Worker(WORKER_PATH,{env:Object.assign(Object.assign({},e),{cpprocessEnv:"workerthread"}),stdout:!0,execArgv:t}),this._postMessage=this._instance.postMessage.bind(this._instance)}else{const t=await(0,debug_1.shouldInspectWorker)()?["--inspect="+_workerInspectPort++]:[];this._instance=(0,child_process_1.fork)(FORK_PATH,[""],{env:Object.assign(Object.assign({},e),{cpprocessEnv:"workerprocess"}),execArgv:t}),this._postMessage=this._instance.send.bind(this._instance)}const t=e=>{var t;const{command:s,data:r}=e;s===config_1.COMMAND.INIT_READY&&(null===(t=this._initBarrier)||void 0===t||t.open(),console.log("worker init_ready")),s===config_1.COMMAND.TASK_DONE&&this.onTaskDone(r),s===config_1.COMMAND.SEND_LOG&&logger_1.logger.send(r.level,r.args),s===config_1.COMMAND.CALL_FUNC&&call_func_1.call.apply(null,[r.funcName,...r.args]).then((e=>{this._postMessage({command:config_1.COMMAND.CALL_FUNC_RESULT,data:{id:r.id,result:e}})})).catch((e=>{this._postMessage({command:config_1.COMMAND.CALL_FUNC_RESULT,data:{id:r.id,error:e.toString()}})}))},s=e=>{0!==e&&1!==e&&log.error(`worker thread: ${this.threadId}, status: ${this.status}, exit with code: ${e}`),this.emit("exit",{code:e,status:this.status,task:this._task,threadId:this.threadId})};supportWebWorkerThread?(this._instance.onMsg(t),this._instance.onError(s)):(this._instance.on("message",t),this._instance.on("exit",s)),await this._initWorkerServices()}on(e,t){return super.on(e,t)}async _initWorkerServices(){let e={};try{const t=await(0,getservice_1.default)(appDirService_1.IAppDirService).get("WeappCompileCache"),s=await(0,getservice_1.default)(nativeModule_1.INativeModuleService);e={NativeModule:{WXMLParsePath:await s.getWXMLParsePath(),WXSSParsePath:await s.getWXSSParsePath(),GlassEaselLazyModulePath:await s.getGlassEaselTemplateCompilerPath()},AppDirService:{WeappCompileCache:t}}}catch(e){console.error("init start getservice(IAppDirService) getservice(INativeModuleService) failed",e)}console.log("COMMAND.INIT_START"),this._postMessage({command:config_1.COMMAND.INIT_START,data:e}),this._initBarrier=new async_1.Barrier,await this._initBarrier.wait()}onTaskDone(e){var t,s,r,i;const o=Date.now()-this._taskStartTime,a=resolveTaskLabel(null!==(s=null===(t=this._task)||void 0===t?void 0:t.name)&&void 0!==s?s:"",null===(r=this._task)||void 0===r?void 0:r.data);this.status=config_1.EWorkerStatus.free,(null===(i=this._task)||void 0===i?void 0:i.resolve)&&(this._task.onStatusUpdate(config_1.ETaskStatus.done),this._task.resolve(e)),this._task=void 0,this.emit("taskDone",this.threadId,a,o),env_1.summerProcess&&env_1.nativeProcess||this.setUpSuicideTimer()}setUpSuicideTimer(){this._suicideTimer=setTimeout((()=>{clearTimeout(this._suicideTimer),this.status===config_1.EWorkerStatus.free?(this.status=config_1.EWorkerStatus.dying,supportWebWorkerThread?this._instance.kill():supportWorkerThread?this._instance.terminate():this._instance.kill("SIGTERM")):this._suicideTimer||this.setUpSuicideTimer()}),this._suicideTime)}runTask(e){clearTimeout(this._suicideTimer),this.status=config_1.EWorkerStatus.busy,this._task=e,this._taskStartTime=Date.now(),this._task.onStatusUpdate(config_1.ETaskStatus.progress),this._postMessage({command:config_1.COMMAND.RUN_TASK,data:{taskName:e.name,data:e.data}})}}class WorkerManager{constructor(e,t=!1){this._taskQueue=[],this._workerPool={},this._max_pool_size=4,this._taskRecords=[],this.onWorkerExit=async e=>{const{code:t,status:s,task:r,threadId:i}=e;delete this._workerPool[i],s===config_1.EWorkerStatus.busy&&(r.retryTimes+=1,r.retryTimes<=2?(log.error(`worker thread: ${i} exit with code: ${t} when it is busy, retry ${r.retryTimes} times`),this._taskQueue.push(r)):r.reject(`worker thread exit with code: ${t} when it is busy`)),await this._run()},this._actualWorkerPoolSize=1,this._doneThreadSet=new Set,this.onTaskDone=async(e,t,s)=>{null!=t&&null!=s&&this._taskRecords.push({workerId:e,taskName:t,duration:s}),this._doneThreadSet.add(e),this._actualWorkerPoolSize=Math.min(howManyWorker(this._doneThreadSet.size),this._max_pool_size),await this._run()},this._max_pool_size=e>8?8:e,envIsDevtools=t}runTask(e,t,s=(()=>{})){return new Promise(((r,i)=>{const o={name:e,data:t,resolve:r,reject:i,retryTimes:0,onStatusUpdate:s};s(config_1.ETaskStatus.waiting),this._taskQueue.push(o),this._run()}))}getTaskRecords(){return this._taskRecords}clearTaskRecords(){this._taskRecords=[]}abort(e){const t=[],s=[];this._taskQueue.forEach((r=>{r.name!==e?s.push(r):t.push(r)})),t.forEach((e=>{e.reject(exports.AbortEvent)})),this._taskQueue=s}async _run(){let e=this._taskQueue[0];for(;e;){const t=this.getFreeWorker();if(!t)return;this._taskQueue.shift(),t.runTask(e),e=this._taskQueue[0]}}getFreeWorker(){for(const e in this._workerPool){const t=this._workerPool[e];if(t.status===config_1.EWorkerStatus.free)return t}return this.allocWorker(),null}async allocWorker(){if(this.workerCount()<this._max_pool_size){const e=new WorkerInstance;return this._workerPool[e.threadId]=e,await e.init(),e.status=config_1.EWorkerStatus.free,e.on("taskDone",this.onTaskDone),e.on("exit",this.onWorkerExit),this._run(),e}return null}workerCount(){return Object.keys(this._workerPool).length}}function howManyWorker(e){switch(e){case 1:return 4;case 2:return 6;default:return 8}}const getWorkerManager=function(e=!1){return workerManagerInstance||(workerManagerInstance=new WorkerManager(cpus,e)),workerManagerInstance};exports.getWorkerManager=getWorkerManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppConf=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),baseconf_1=require("./baseconf"),original_1=require("../../original"),common_1=require("../../original/json/common"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),getPageJSON_1=require("../../original/json/page/getPageJSON"),util_1=require("./util"),taskmanager_1=tslib_1.__importDefault(require("../../../../utils/taskmanager"));class AppConf extends baseconf_1.MiniProgramBaseConf{constructor(){super(...arguments),this.packages=new Map,this.pages=new Map,this.comps=new Map,this.onFileChange=(t,o)=>{}}destroy(){}async getConf(t){return await this.build(t),{app:this.app,ext:this.ext,packages:Object.fromEntries(this.packages.entries()),pages:Object.fromEntries(this.pages.entries()),comps:Object.fromEntries(this.comps.entries()),sitemap:this.sitemap,theme:this.theme}}async buildPagesAndCompsForUpload(t,o=!1){const a={},
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AppConf=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),baseconf_1=require("./baseconf"),original_1=require("../../original"),common_1=require("../../original/json/common"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),getPageJSON_1=require("../../original/json/page/getPageJSON"),util_1=require("./util"),taskmanager_1=tslib_1.__importDefault(require("../../../../utils/taskmanager"));class AppConf extends baseconf_1.MiniProgramBaseConf{constructor(){super(...arguments),this.packages=new Map,this.pages=new Map,this.comps=new Map,this.onFileChange=(t,o)=>{}}destroy(){}async getConf(t){return await this.build(t),{app:this.app,ext:this.ext,packages:Object.fromEntries(this.packages.entries()),pages:Object.fromEntries(this.pages.entries()),comps:Object.fromEntries(this.comps.entries()),sitemap:this.sitemap,theme:this.theme}}async buildPagesAndCompsForUpload(t,o=!1){const a={},s={};return await Promise.all(Array.from(this.pages.keys()).map((async t=>{const s=await(o?getPageJSON_1.getPageJSONWithDisableSpreading:original_1.getPageJSON)(this.proxyProject,{miniprogramRoot:this.root,pagePath:t});a[`${t}.json`]=JSON.stringify(s)}))),await Promise.all(Array.from(this.comps.keys()).map((async t=>{const a=await(o?getPageJSON_1.getPageJSONWithDisableSpreading:original_1.getPageJSON)(this.proxyProject,{miniprogramRoot:this.root,pagePath:t});s[`${t}.json`]=JSON.stringify(a)}))),{pageResults:a,componentResults:s}}async buildPagesAndCompsWithFileListForUpload(t,o,a=!1){const s={},e={},i=new taskmanager_1.default;for(const t of Array.from(this.pages.keys()))if(o.includes(`${t}.json`)){const o=async t=>{const o=await(a?getPageJSON_1.getPageJSONWithDisableSpreading:original_1.getPageJSON)(this.proxyProject,{miniprogramRoot:this.root,pagePath:t});s[`${t}.json`]=JSON.stringify(o)};i.addTask(o,t)}for(const t of Array.from(this.comps.keys()))if(o.includes(`${t}.json`)){const o=async t=>{const o=await(a?getPageJSON_1.getPageJSONWithDisableSpreading:original_1.getPageJSON)(this.proxyProject,{miniprogramRoot:this.root,pagePath:t});e[`${t}.json`]=JSON.stringify(o)};i.addTask(o,t)}return await i.runAllAsync(),{pageResults:s,componentResults:e}}async resetState(){this.app=void 0,this.ext=void 0,this.packages.clear(),this.pages.clear(),this.comps.clear(),this.sitemap=void 0,this.theme=void 0}async load(t){var o;const a=await t.run(locales_1.default.config.SUMMER_COMPILE.format("app.json"),(()=>(0,original_1.getAppJSON)(this.proxyProject)));this.app=a;const s=await t.run(locales_1.default.config.SUMMER_COMPILE.format("ext.json"),(()=>(0,original_1.getExtJSON)(this.proxyProject)));this.ext=s;const{project:e}=this.proxyProject,i=new Set;for(const t of a.pages)i.add(t);for(const t of e.injectedPages)i.add((0,util_1.resolvePath)("app.json",t));const n=a.subPackages||[];for(const t of n){const o=t.root;this.packages.set(o,t);for(const a of t.pages)i.add(path_1.default.posix.join(o,a))}if(await t.run(locales_1.default.config.SUMMER_COMPILE_PAGE_JSON.format(i.size),(async()=>{var t;for(const[t]of i.entries())(0,util_1.isPluginPath)(t)||await this.loadPage(t);for(const t of Object.values(a.usingComponents||{}))if(!t.startsWith("plugin://")&&!(0,util_1.isPluginPath)(t)){const o=(0,util_1.resolvePath)("app.json",t);await this.loadComp(o,t,"app.json")}if(null===(t=a.tabBar)||void 0===t?void 0:t.custom){const t=(0,util_1.resolvePath)("app.json","custom-tab-bar/index");this.proxyProject.stat(this.root,`${t}.json`)&&await this.loadComp(t,"custom-tab-bar/index","app.json")}if(a.appBar){const t=(0,util_1.resolvePath)("app.json","app-bar/index");this.proxyProject.stat(this.root,`${t}.json`)&&await this.loadComp(t,"app-bar/index","app.json")}if(a.plugins)for(const t of Object.values(a.plugins))t.genericsImplementation&&Object.values(t.genericsImplementation).forEach((t=>{Object.values(t).map((async t=>{const o=(0,util_1.resolvePath)("app.json",t);return await this.loadComp(o,t,"app.json")}))}))})),a.themeLocation&&await t.run(locales_1.default.config.SUMMER_COMPILE.format(a.themeLocation),(()=>this.loadTheme(a.themeLocation))),a.accountCardPackage&&await t.run(locales_1.default.config.SUMMER_COMPILE.format(a.themeLocation),(async()=>{for(const t of a.accountCardPackage.cardList){const o=path_1.default.posix.join(a.accountCardPackage.root,t.componentPath);await this.loadComp(o,o,"app.json")}})),null===(o=a.agent)||void 0===o?void 0:o.skills){const t=new Set(a.agent.skills.map((t=>t.path)).filter((t=>!!t)));for(const o of n){const a=o.root.replace(/\/$/,"");if(!Array.from(t).some((t=>t===a||t.startsWith(`${a}/`))))continue;const s=`${a}/`,n=e.getFileList(this.root,".json");for(const t of n){const o=t.replace(new RegExp(`^${this.root}/?`),"");if(!o.startsWith(s))continue;const a=o.replace(/\.json$/,"");if(!i.has(a)&&(!this.comps.has(a)&&this.proxyProject.stat(this.root,o)))try{const t=e.getFile(this.root,o),s=JSON.parse(t.toString());if(!0!==s.component&&void 0===s.usingComponents)continue;await this.loadComp(a,a,"app.json")}catch(t){}}}}}async loadPage(t){const o=await(0,original_1.getPageJSON)(this.proxyProject,{miniprogramRoot:this.root,pagePath:t});this.pages.set(t,o);const a=async o=>{if((0,util_1.isPluginPath)(o))return;const a=(0,util_1.resolvePath)(t,o);await this.loadComp(a,o,t)};if(o.usingComponents)for(const t of Object.values(o.usingComponents))await a(t);if(o.componentGenerics)for(const t of Object.values(o.componentGenerics)){const o=t.default;o&&await a(o)}}async loadComp(t,o,a){if(await this.isExtendedLibComp(t,a))return;if(this.comps.has(t))return;if(!this.proxyProject.stat(this.root,`${t}.json`))throw new Error(`[summer-compiler] Couldn't found the '${o}.json' file relative to '${a}'`);const s=await(0,original_1.getPageJSON)(this.proxyProject,{miniprogramRoot:this.root,pagePath:t});this.comps.set(t,s);const e=async o=>{if((0,util_1.isPluginPath)(o))return;const a=(0,util_1.resolvePath)(t,o);await this.loadComp(a,o,t)};if(s.usingComponents)for(const t of Object.values(s.usingComponents))await e(t);if(s.componentGenerics)for(const t of Object.values(s.componentGenerics)){const o=t.default;o&&await e(o)}}async loadTheme(t){const o=await(0,original_1.checkThemeJSON)(this.proxyProject,{themeLocation:t});this.theme=o}async isExtendedLibComp(t,o){if(t.startsWith("miniprogram_npm/")){const a=(0,common_1.getUseExtendLib)(this.proxyProject,o);if(a.length>0){const o=a.map((t=>`miniprogram_npm/${t}`));for(const a of o)if(t.startsWith(a))return!0}}return!1}}exports.AppConf=AppConf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAX_CODE_LENGTH=void 0,exports.getSWCRoot=getSWCRoot,exports.default=default_1;const pluginconfig_1=require("../../pluginconfig"),tools_1=require("../../../../../utils/tools"),swc_helper_1=require("../../../../../utils/swc_helper"),swc_task_1=require("../script_task/swc_task"),load_script_task_1=require("../script_task/load_script_task"),babel_script_task_1=require("../script_task/babel_script_task"),minify_script_task_1=require("../script_task/minify_script_task");var config_1=require("../../../../../config/config");function getSWCRoot(e,t){const s=(0,swc_helper_1.getSWCOutputPath)(e.setting);return""===t?s:(0,tools_1.normalizePath)(`${t}/${s}`)}function shouldMinify(e,t){return"dev"!==e&&!!t}function useCompilerPlugin(e,t){if(!e.setting.useCompilerPlugins)return!1;for(const s of e.setting.useCompilerPlugins){if("string"==typeof s&&s===t)return!0;if(Array.isArray(s)&&"string"==typeof s[0]&&void 0!==s[1]&&s[0]===t)return!0}return!1}function default_1(e,t){const s="script",r=e.setting.enhance||e.setting.es6,i=useCompilerPlugin(e,"typescript"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAX_CODE_LENGTH=void 0,exports.getSWCRoot=getSWCRoot,exports.default=default_1;const pluginconfig_1=require("../../pluginconfig"),tools_1=require("../../../../../utils/tools"),swc_helper_1=require("../../../../../utils/swc_helper"),swc_task_1=require("../script_task/swc_task"),load_script_task_1=require("../script_task/load_script_task"),babel_script_task_1=require("../script_task/babel_script_task"),minify_script_task_1=require("../script_task/minify_script_task");var config_1=require("../../../../../config/config");function getSWCRoot(e,t){const s=(0,swc_helper_1.getSWCOutputPath)(e.setting);return""===t?s:(0,tools_1.normalizePath)(`${t}/${s}`)}function shouldMinify(e,t){return"dev"!==e&&!!t}function useCompilerPlugin(e,t){if(!e.setting.useCompilerPlugins)return!1;for(const s of e.setting.useCompilerPlugins){if("string"==typeof s&&s===t)return!0;if(Array.isArray(s)&&"string"==typeof s[0]&&void 0!==s[1]&&s[0]===t)return!0}return!1}function default_1(e,t){const s="script",r=e.setting.enhance||e.setting.es6,o=e.setting.compileWorklet,i=useCompilerPlugin(e,"typescript"),c=(0,pluginconfig_1.couldUseSWCMode)(e.setting);return{name:s,resolveExt:i?{js:"ts"}:{},workerMethods:{async doSwcTask(e,t,s){const r=await(0,swc_task_1.swcCompileTask)(e,t,s);return{code:r.code,map:r.map,helpers:r.helpers,resultType:s.resultType}},async doBabelTask(e,t,s){const r=await(0,babel_script_task_1.bableCompile)(e,t,{typescript:s.typescript,enhance:s.enhance,babelRoot:s.babelRoot,disableUseStrict:s.disableUseStrict,compileWorklet:s.compileWorklet});if(shouldMinify(s.resultType,s.minify)){const t=await(0,minify_script_task_1.doCompress)(e,{code:r.code,map:r.map});return{code:t.code,map:t.map,helpers:r.helpers,resultType:s.resultType}}return{code:r.code,map:r.map,helpers:r.helpers,resultType:s.resultType}}},async load(t,r){if(t.endsWith(".js"))return await(0,load_script_task_1.loadScriptFile)(e,t,r,s)},async compile(n,a,p,l){var u;if(!n.endsWith(".js"))return;const{independentRoot:_,isBabelIgnore:d,resultType:g}=l,f=p.source.largeFile;if(d||f)return{targetPath:n,source:p.source,target:{code:p.source.sourceCode,map:p.source.inputMap,helpers:[],resultType:g},process:p.process};const m=Date.now(),y=shouldMinify(g,e.setting.minified);if(c){const o={swcRoot:getSWCRoot(e,_),minify:y,resultType:g,rc:null===(u=e.setting.swcSetting)||void 0===u?void 0:u.rc,disableUseStrict:t.disableUseStrict,target:r?"es5":"es2022"},i=await this.runWorkerMethod("doSwcTask",a,p.source,o);return{targetPath:n,source:p.source,target:i,process:[...p.process,{cost:Date.now()-m,pluginName:s,action:"compile",options:o}]}}const b={babelRoot:(0,babel_script_task_1.getBabelRoot)(_),disableUseStrict:t.disableUseStrict,resultType:g,minify:y,enhance:r,typescript:i,compileWorklet:o},h=await this.runWorkerMethod("doBabelTask",a,p.source,b);return{targetPath:n,source:p.source,target:h,process:[...p.process,{cost:Date.now()-m,pluginName:s,action:"compile",options:b}]}}}}Object.defineProperty(exports,"MAX_CODE_LENGTH",{enumerable:!0,get:function(){return config_1.MAX_CODE_LENGTH}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getBabelRoot=getBabelRoot,exports.babelTransformJS=babelTransformJS,exports.transformES6ModuleAndGenCode=transformES6ModuleAndGenCode,exports.babelTransformTS=babelTransformTS,exports.bableCompile=bableCompile;const config_1=require("../../../../../config/config"),babel_helper_1=require("../../../../../utils/babel_helper"),tools_1=require("../../../../../utils/tools"),customError_1=require("../../../../../utils/customError"),_transformRuntimeCustom=()=>require("../../../../../utils/babel_transform_plugin"),_pluginTransformRuntime=()=>require("@babel/plugin-transform-runtime"),_pluginTransformWorklet=()=>require("../../../../../utils/babel_plugin_worklet"),_pluginTransformModulesCommonjs=()=>require("@babel/plugin-transform-modules-commonjs"),babel7=()=>require("@babel/core"),_presetEnv=()=>require("@babel/preset-env"),_pluginTransformTypescript=()=>require("@babel/plugin-transform-typescript"),pluginReplaceTsExportAssignment=e=>{const r=e.template("\n module.exports = ASSIGNMENT;\n ");return{name:"replace-ts-export-assignment",visitor:{TSExportAssignment(e){e.replaceWith(r({ASSIGNMENT:e.node.expression}))}}}},pluginReplaceTsImportEqualsDeclaration=e=>{const r=e.template("\n const ID = require(SOURCE);\n ");return{name:"replace-ts-import-equals-declaration",visitor:{TSImportEqualsDeclaration(e){e.replaceWith(r({ID:e.node.id,SOURCE:e.node.moduleReference.expression}))}}}};function getEnhancePluginsList(e){const r=[[_transformRuntimeCustom()],[_pluginTransformRuntime(),{corejs:!1,helpers:!0,regenerator:!0,version:"7.21.0"}]].concat((0,babel_helper_1.getCustomPlugins)([]));return e.supportWorklet&&r.push([_pluginTransformWorklet()]),r}function getCommonPresets(){return[[_presetEnv(),{targets:{chrome:53,ios:8},modules:!1,include:["@babel/plugin-transform-computed-properties"]}]]}function getTSTransformPluginsList(){return[[pluginReplaceTsImportEqualsDeclaration,{}],[pluginReplaceTsExportAssignment,{}],[_pluginTransformTypescript(),{}]]}function getES6ModulePluginsList(e){return[[_pluginTransformModulesCommonjs(),{allowTopLevelThis:e,importInterop:e=>e.startsWith("@babel/runtime/helpers/")?"node":"babel"}]]}function getBabelRoot(e){const r="@babel/runtime";return""===e?r:(0,tools_1.normalizePath)(`${e}/${r}`)}async function babelTransformJS(e,r){const o=babel7(),s=e.sourceCode.includes('"worklet"')||e.sourceCode.includes("'worklet'");let t;try{const n={babelrc:!1,sourceFileName:r,configFile:!1,presets:getCommonPresets(),plugins:getEnhancePluginsList({supportWorklet:s}),inputSourceMap:!1,code:!1,ast:!0,cloneInputAst:!1};if(e.astInfo){if(e.astInfo.type!==config_1.AstType.Babel)throw new Error("ast type is not babel");t=await o.transformFromAstAsync(e.astInfo.ast,e.sourceCode,n)}else{if(null===e.sourceCode)throw new Error("source.sourceCode is null");t=await babel7().transformAsync(e.sourceCode,n)}}catch(e){console.error(e,e.stack);const o=`file: ${r}\n ${e.message}`,s=new Error(o);throw s.code=config_1.BABEL_TRANS_JS_ERR,s}return{sourceCode:e.sourceCode,inputMap:e.inputMap,astInfo:{ast:t.ast,type:config_1.AstType.Babel}}}async function transformES6ModuleAndGenCode(e,r,o){const s=o.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r.sourceCode||"");let t;try{const o={babelrc:!1,sourceFileName:e,configFile:!1,plugins:getES6ModulePluginsList(s),filename:e,sourceMaps:!0,inputSourceMap:r.inputMap,code:!0,cloneInputAst:!0},n=babel7();if(!r.astInfo)throw new Error("source.astInfo is not exist");if(r.astInfo.type!==config_1.AstType.Babel)throw new Error("ast type is not babel");t=await n.transformFromAstAsync(r.astInfo.ast,r.sourceCode,o)}catch(r){throw r.code=config_1.BABEL_TRANS_JS_ERR,r.message=`file: ${e}\n ${r.message}`,r.path=e,r}if(!t)throw new Error("no trans result for callPostEnhance");let n=t.code;const l=t.map;s&&(n=n.replace(/^"use strict";/,""));const a=(0,babel_helper_1.collectBabelHelpers)(r.sourceCode),i=(0,babel_helper_1.replaceBabelHelpers)(n,a,e,o.babelRoot);return{code:i.transformCode,map:l,helpers:i.helpers}}async function babelTransformTS(e,r){let o;console.log("[backend] summer-typescript workerMethod");try{o=await babel7().transformAsync(e.sourceCode,{babelrc:!1,plugins:getTSTransformPluginsList(),sourceFileName:r,sourceMaps:!1,ast:!0,configFile:!1,code:!1})}catch(e){throw(0,customError_1.makeCustomError)(e,customError_1.CustomErrors.SUMMER_PLUGIN_CODE_ERR,r)}return{sourceCode:e.sourceCode,inputMap:e.inputMap,astInfo:{ast:o.ast,type:config_1.AstType.Babel}}}async function bableCompile(e,r,o){const s=babel7(),t=r.sourceCode.includes('"worklet"')||r.sourceCode.includes("'worklet'"),n=o.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r.sourceCode||""),l=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getBabelRoot=getBabelRoot,exports.babelTransformJS=babelTransformJS,exports.transformES6ModuleAndGenCode=transformES6ModuleAndGenCode,exports.babelTransformTS=babelTransformTS,exports.bableCompile=bableCompile;const config_1=require("../../../../../config/config"),babel_helper_1=require("../../../../../utils/babel_helper"),tools_1=require("../../../../../utils/tools"),customError_1=require("../../../../../utils/customError"),_transformRuntimeCustom=()=>require("../../../../../utils/babel_transform_plugin"),_pluginTransformRuntime=()=>require("@babel/plugin-transform-runtime"),_pluginTransformWorklet=()=>require("../../../../../utils/babel_plugin_worklet"),_pluginTransformModulesCommonjs=()=>require("@babel/plugin-transform-modules-commonjs"),babel7=()=>require("@babel/core"),_presetEnv=()=>require("@babel/preset-env"),_pluginTransformTypescript=()=>require("@babel/plugin-transform-typescript"),pluginReplaceTsExportAssignment=e=>{const r=e.template("\n module.exports = ASSIGNMENT;\n ");return{name:"replace-ts-export-assignment",visitor:{TSExportAssignment(e){e.replaceWith(r({ASSIGNMENT:e.node.expression}))}}}},pluginReplaceTsImportEqualsDeclaration=e=>{const r=e.template("\n const ID = require(SOURCE);\n ");return{name:"replace-ts-import-equals-declaration",visitor:{TSImportEqualsDeclaration(e){e.replaceWith(r({ID:e.node.id,SOURCE:e.node.moduleReference.expression}))}}}};function getEnhancePluginsList(e){const r=[[_transformRuntimeCustom()],[_pluginTransformRuntime(),{corejs:!1,helpers:!0,regenerator:!0,version:"7.21.0"}]].concat((0,babel_helper_1.getCustomPlugins)([]));return e.supportWorklet&&r.push([_pluginTransformWorklet()]),r}function getCommonPresets(){return[[_presetEnv(),{targets:{chrome:53,ios:8},modules:!1,include:["@babel/plugin-transform-computed-properties"]}]]}function getTSTransformPluginsList(){return[[pluginReplaceTsImportEqualsDeclaration,{}],[pluginReplaceTsExportAssignment,{}],[_pluginTransformTypescript(),{}]]}function getES6ModulePluginsList(e){return[[_pluginTransformModulesCommonjs(),{allowTopLevelThis:e,importInterop:e=>e.startsWith("@babel/runtime/helpers/")?"node":"babel"}]]}function getBabelRoot(e){const r="@babel/runtime";return""===e?r:(0,tools_1.normalizePath)(`${e}/${r}`)}async function babelTransformJS(e,r){const o=babel7(),s=e.sourceCode.includes('"worklet"')||e.sourceCode.includes("'worklet'");let t;try{const n={babelrc:!1,sourceFileName:r,configFile:!1,presets:getCommonPresets(),plugins:getEnhancePluginsList({supportWorklet:s}),inputSourceMap:!1,code:!1,ast:!0,cloneInputAst:!1};if(e.astInfo){if(e.astInfo.type!==config_1.AstType.Babel)throw new Error("ast type is not babel");t=await o.transformFromAstAsync(e.astInfo.ast,e.sourceCode,n)}else{if(null===e.sourceCode)throw new Error("source.sourceCode is null");t=await babel7().transformAsync(e.sourceCode,n)}}catch(e){console.error(e,e.stack);const o=`file: ${r}\n ${e.message}`,s=new Error(o);throw s.code=config_1.BABEL_TRANS_JS_ERR,s}return{sourceCode:e.sourceCode,inputMap:e.inputMap,astInfo:{ast:t.ast,type:config_1.AstType.Babel}}}async function transformES6ModuleAndGenCode(e,r,o){const s=o.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r.sourceCode||"");let t;try{const o={babelrc:!1,sourceFileName:e,configFile:!1,plugins:getES6ModulePluginsList(s),filename:e,sourceMaps:!0,inputSourceMap:r.inputMap,code:!0,cloneInputAst:!0},n=babel7();if(!r.astInfo)throw new Error("source.astInfo is not exist");if(r.astInfo.type!==config_1.AstType.Babel)throw new Error("ast type is not babel");t=await n.transformFromAstAsync(r.astInfo.ast,r.sourceCode,o)}catch(r){throw r.code=config_1.BABEL_TRANS_JS_ERR,r.message=`file: ${e}\n ${r.message}`,r.path=e,r}if(!t)throw new Error("no trans result for callPostEnhance");let n=t.code;const l=t.map;s&&(n=n.replace(/^"use strict";/,""));const a=(0,babel_helper_1.collectBabelHelpers)(r.sourceCode),i=(0,babel_helper_1.replaceBabelHelpers)(n,a,e,o.babelRoot);return{code:i.transformCode,map:l,helpers:i.helpers}}async function babelTransformTS(e,r){let o;console.log("[backend] summer-typescript workerMethod");try{o=await babel7().transformAsync(e.sourceCode,{babelrc:!1,plugins:getTSTransformPluginsList(),sourceFileName:r,sourceMaps:!1,ast:!0,configFile:!1,code:!1})}catch(e){throw(0,customError_1.makeCustomError)(e,customError_1.CustomErrors.SUMMER_PLUGIN_CODE_ERR,r)}return{sourceCode:e.sourceCode,inputMap:e.inputMap,astInfo:{ast:o.ast,type:config_1.AstType.Babel}}}async function bableCompile(e,r,o){const s=babel7(),t=o.compileWorklet&&(r.sourceCode.includes('"worklet"')||r.sourceCode.includes("'worklet'")),n=o.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r.sourceCode||""),l=e.endsWith(".ts")&&o.typescript,a=[];l&&a.push(...getTSTransformPluginsList()),t&&a.push([_pluginTransformWorklet()]),o.enhance&&a.push(...getEnhancePluginsList({})),a.push(...getES6ModulePluginsList(n));const i={babelrc:!1,sourceFileName:e,filename:e,configFile:!1,presets:o.enhance?getCommonPresets():[],plugins:a,inputSourceMap:r.inputMap,sourceMaps:!0,code:!0,ast:!1,cloneInputAst:!1};let c;if(!(l||o.enhance||t))return{code:r.sourceCode,map:r.inputMap,helpers:[]};try{c=await s.transformAsync(r.sourceCode,i)}catch(r){console.error(r,r.stack);const o=`file: ${e}\n ${r.message}`,s=new Error(o);throw s.code=config_1.BABEL_TRANS_JS_ERR,s}if(!c||!c.code)throw new Error("no trans result for bableCompile");let u=c.code;const p=c.map;n&&(u=u.replace(/^"use strict";/,""));const m=(0,babel_helper_1.collectBabelHelpers)(r.sourceCode),b=(0,babel_helper_1.replaceBabelHelpers)(u,m,e,o.babelRoot);return{code:b.transformCode,map:p,helpers:b.helpers}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.swcCompileTask=swcCompileTask;const swc_helper_1=require("../../../../../utils/swc_helper"),swc=()=>require("@swc/core");async function swcCompileTask(e,s,r){var o,t;const i=r.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(s.sourceCode||""),{swcRoot:c}=r,p=await swc().transform(s.sourceCode,{jsc:{parser:Object.assign(Object.assign({},null===(o=r.rc)||void 0===o?void 0:o.parser),{syntax:e.endsWith("ts")?"typescript":"ecmascript"}),target:r.target,externalHelpers:!0,loose:!1,minify:{compress:{drop_console:!1,drop_debugger:!1},toplevel:!0}},module:Object.assign({type:"commonjs",strictMode:!i,noInterop:!
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.swcCompileTask=swcCompileTask;const swc_helper_1=require("../../../../../utils/swc_helper"),swc=()=>require("@swc/core");async function swcCompileTask(e,s,r){var o,t;const i=r.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(s.sourceCode||""),{swcRoot:c}=r,p=await swc().transform(s.sourceCode,{jsc:{parser:Object.assign(Object.assign({},null===(o=r.rc)||void 0===o?void 0:o.parser),{syntax:e.endsWith("ts")?"typescript":"ecmascript"}),target:r.target,externalHelpers:!0,loose:!1,minify:{compress:{drop_console:!1,drop_debugger:!1},toplevel:!0}},module:Object.assign({type:"commonjs",strictMode:!i,noInterop:!1,allowTopLevelThis:i},null===(t=r.rc)||void 0===t?void 0:t.module),inputSourceMap:s.inputMap?JSON.stringify(s.inputMap):void 0,sourceMaps:!0,filename:e,minify:"dev"!==r.resultType&&r.minify}),a=(0,swc_helper_1.replaceSWCHelpers)(p.code,e,c);return{code:a.transformCode,map:p.map?JSON.parse(p.map):void 0,helpers:a.helpers}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.runSummerPluginHook=runSummerPluginHook;const customError_1=require("../../../utils/customError"),summerCPProject_1=require("../../../project/summerCPProject"),index_1=require("../../precompiler/index"),initPlugin_1=require("./initPlugin");class PluginContainer{constructor(){this.initedPlugins=new Map}getPluginInstance(r,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.runSummerPluginHook=runSummerPluginHook;const customError_1=require("../../../utils/customError"),summerCPProject_1=require("../../../project/summerCPProject"),index_1=require("../../precompiler/index"),initPlugin_1=require("./initPlugin");class PluginContainer{constructor(){this.initedPlugins=new Map}getPluginInstance(e,r,t){let n=this.initedPlugins.get(e);return n||(n=(0,initPlugin_1.initPlugin)(e,r,t),this.initedPlugins.set(e,n)),n}clear(){this.initedPlugins.clear()}}const pluginContainer=new PluginContainer;async function runSummerPluginHook(e){var r;if("clear"===e.command)return pluginContainer.clear(),{};const{plugin:t,projectInfo:n,pluginOption:i,method:o,args:u}=e,s=new summerCPProject_1.SummerCPProject(n);await s.ready();const{targetPlatform:a,targetPlatformDefines:c}=n,l=new index_1.PreCompiler(s,void 0,void 0),g=await l.getPreCompileProject({targetPlatform:a,targetPlatformDefines:c,runEnv:"worker cp"}),m=pluginContainer.getPluginInstance(t,g,i);if("runMethod"===e.command){const e=null===(r=m.workerMethods)||void 0===r?void 0:r[o];if(!e||"function"!=typeof e)throw new Error(`the ${e} is not a workerMethod of plugin(${t})`);try{return{result:await e(...u)}}catch(e){return{error:e instanceof customError_1.CustomError?e.toJSON():{message:e.message,code:e.code,stack:e.stack==e.message?"":e.stack}}}}return{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SummerCompiler=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=tslib_1.__importDefault(require("lodash")),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),request_1=require("../../utils/request"),common_1=require("./original/compile/common"),tools_1=require("../../utils/tools"),white_ext_list_1=require("../../utils/white_ext_list"),config_1=require("../../config/config"),processManager_1=require("../../utils/subprocess/processManager"),messageHub_1=require("../../utils/messageHub"),singletontask_1=require("../../utils/singletontask"),uglifyfilenames_1=require("./original/protect/uglifyfilenames"),baseCompiler_1=require("./baseCompiler"),packOptionsHelper_1=tslib_1.__importDefault(require("../../utils/packOptionsHelper")),getservice_1=tslib_1.__importDefault(require("../../services/common/getservice")),appDirService_1=require("../../services/app/common/appDirService"),nativeModule_1=require("../../services/nativeModule/common/nativeModule"),miniProgram=config_1.COMPILE_TYPE.miniProgram,miniGame=config_1.COMPILE_TYPE.miniGame,miniProgramPlugin=config_1.COMPILE_TYPE.miniProgramPlugin,miniGamePlugin=config_1.COMPILE_TYPE.miniGamePlugin;function performanceMark(e,t){}class SummerCompiler extends baseCompiler_1.BaseCoreCompiler{constructor(e,t,i,s,a,o,r){super(e),this.project=e,this.cachePath=t,this.projectInfo=i,this.devtoolMessagehub=s,this.analyzer=a,this._filterFactory=o,this.onInitFinished=r,this.isSummer=!0,this.promiseCache=new Map,this._taskCache=new Map,this._status=void 0,this._eventAdded=!1,this._locale="",this._initServiceForkId=0,this.devCodeCacheByPath=new Map,this.onFileChange=(e,t)=>{if("change"!==e||t.endsWith(".json"))for(const e of this.promiseCache.keys())e.startsWith("getConf-")&&this.promiseCache.delete(e);if("change"!==e){for(const e of this.promiseCache.keys())e.startsWith("getPackageFiles-")&&this.promiseCache.delete(e);for(const e of this._taskCache.keys())e.startsWith("getPackageFiles-")&&this._taskCache.delete(e)}this.invalidCodeCache(t),this.subProcessManager.sendEvent("fileChange",{type:e,targetPath:t}),packOptionsHelper_1.default.clearUnusedFiles()},this.onPreCompileOptionsChange=async e=>{await this.clearCache(),this.subProcessManager.sendEvent("precompileOptionsChange",e)},this.onProgressUpdate=(e,t,i)=>{var s;this.messageHub.showBuildLog(`${e}`,t,i),null===(s=this.progressUpdateFromCompileOptions)||void 0===s||s.call(this,{id:e.toString(),message:i,status:t})},this._getPackageFiles=async(e,t,i="dev")=>{performanceMark("request get getPackageFiles");const s=await this.safeRunTask("getPackageFiles",{graphId:e,root:t},this.onProgressUpdate);performanceMark("request get getPackageFiles",!0);const a=this.isPluginType(e)?this.project.pluginRoot:this.project.miniprogramRoot,o=await this.filterFactory(i),r={},n=s.filter((t=>{const i=path_1.default.posix.join(a,t.source),s=o(e,i);return s!==config_1.EFilterCode.Include&&(r[s]||(r[s]=[]),r[s].push(i)),s===config_1.EFilterCode.Include})),c={[config_1.EFilterCode.AnalyseNoUse]:locales_1.default.config.UNUSE_FILE_LIST,[config_1.EFilterCode.PackOptionsIgnore]:locales_1.default.config.PACK_OPTIONS_IGNORE_LIST,[config_1.EFilterCode.PartialCompileNoUse]:locales_1.default.config.PARTIAL_COMPILE_IGNORE_LIST};for(const e in r)c[e]?this.onProgressUpdate(e,"warn",c[e].format(r[e].join(","))):this.onProgressUpdate(e,"warn",locales_1.default.config.UNKNOWN_REASON_INGORE_LIST.format(e,r[e].join(",")));return n},performanceMark("create summer compiler"),this.messageHub=new messageHub_1.MessageHub(s),this.ready(),global.dumpWorkerTaskStats=this.dumpWorkerTaskStats.bind(this),global.clearWorkerTaskStats=this.clearWorkerTaskStats.bind(this)}get status(){return this._status}async init(){performanceMark("init summer compiler");const e=path_1.default.posix.join(__dirname,"./summerEntryProcess.js"),t="undefined"!=typeof WEBIDE_WEBPECK_DEFINE_PLUGIN?"./summerentryprocess.js":e;this.subProcessManager=new processManager_1.SubProcessProxy(this.project,t,{cachePath:this.cachePath},this.projectInfo,8891,this.onProgressUpdate),this.addProjectListener();this.ensureInitService().then((()=>{var e;null===(e=this.onInitFinished)||void 0===e||e.call(this)}),(e=>{var t;null===(t=this.onInitFinished)||void 0===t||t.call(this,e)})),performanceMark("init summer compiler",!0)}async initServiceAndLoadStatus(){const e={};try{const t=await(0,getservice_1.default)(appDirService_1.IAppDirService).get("WeappCompileCache"),i=await(0,getservice_1.default)(nativeModule_1.INativeModuleService);e.NativeModule={WXMLParsePath:await i.getWXMLParsePath(),WXSSParsePath:await i.getWXSSParsePath(),GlassEaselLazyModulePath:await i.getGlassEaselTemplateCompilerPath()},e.AppDirService={WeappCompileCache:t}}catch(e){console.log("initServiceAndLoadStatus hasno WeappCompileCache / INativeModuleService in ci is normal")}this._status=await this.subProcessManager.runTask("initServiceAndloadStatus",{})}async ensureInitService(){await this.subProcessManager.ready(),this.subProcessManager.forkId!==this._initServiceForkId&&(await this.initServiceAndLoadStatus(),this._initServiceForkId=this.subProcessManager.forkId)}async safeRunTask(e,t,i){return await this.ensureInitService(),this.subProcessManager.runTask(e,t,i)}async loadStatus(){this._status=await this.safeRunTask("loadStatus")}destroy(){var e;null===(e=this.subProcessManager)||void 0===e||e.destroy(),this.removeProjectListener(),this._checkReadyTask=void 0}async clearCache(){await this.safeRunTask("clearCache"),this.promiseCache.clear(),this.devCodeCacheByPath.clear(),this._taskCache.clear()}async dumpWorkerTaskStats(){const e=await this.safeRunTask("getWorkerTaskStats"),t=new Map;for(const i of e){const e=`${i.workerId}_${i.taskName}`;let s=t.get(e);s||(s={workerId:i.workerId,taskName:i.taskName,count:0,total:0},t.set(e,s)),s.count++,s.total+=i.duration}const i=[...t.values()].sort(((e,t)=>String(e.workerId).localeCompare(String(t.workerId)))).map((e=>({Worker:e.workerId,Task:e.taskName,Count:e.count,"Total(ms)":e.total,"Avg(ms)":Math.round(e.total/e.count)})));console.table(i)}async clearWorkerTaskStats(){await this.safeRunTask("clearWorkerTaskStats")}getProjectInfo(){return this.projectInfo}updateOptions(e){lodash_1.default.isEqual(e,this.projectInfo)||this.updateOptionsWithoutJudge(e)}updateOptionsWithoutJudge(e){var t;this.projectInfo=e,this.promiseCache.clear(),this.devCodeCacheByPath.clear(),null===(t=this.subProcessManager)||void 0===t||t.sendEvent("updateOptions",e),this.loadStatus(),this.project.updateOptions(e)}updateOptionsWhenAttrNotChanged(e){var t;lodash_1.default.isEqual(Object.assign(Object.assign({},e),{attr:void 0}),Object.assign(Object.assign({},this.projectInfo),{attr:void 0}))||(this.projectInfo=e,this.promiseCache.clear(),this.devCodeCacheByPath.clear(),null===(t=this.subProcessManager)||void 0===t||t.sendEvent("updateOptions",e),this.loadStatus(),this.project.updateOptions(e))}addProjectListener(){var e,t;this._eventAdded&&this.removeProjectListener(),null===(e=this.project.event)||void 0===e||e.on("fileChange",this.onFileChange),null===(t=this.project.event)||void 0===t||t.on("precompileOptionsChange",this.onPreCompileOptionsChange),this._eventAdded=!0}removeProjectListener(){var e,t;null===(e=this.project.event)||void 0===e||e.off("fileChange",this.onFileChange),null===(t=this.project.event)||void 0===t||t.off("precompileOptionsChange",this.onPreCompileOptionsChange),this._eventAdded=!1}invalidCodeCache(e){const t=this.devCodeCacheByPath.get((0,tools_1.sourcePathToTargetPath)(e));t&&(t.isValid=!1)}async getConf(e){const t=`getConf-${e}`;if(this.promiseCache.has(t))return this.promiseCache.get(t);performanceMark("request get conf");const i={graphId:e},s=this.safeRunTask("getConf",i,this.onProgressUpdate);return this.promiseCache.set(t,s),performanceMark("request get conf",!0),s}async waitSubProcessReady(){await this.subProcessManager.ready()}async getPackageFiles(e,t,i="dev",s=!0){const a=`getPackageFiles-${e}-${t}-${i}`;if(this._taskCache.has(a)&&s){const e=this._taskCache.get(a);return null==e?void 0:e.getResult(!0)}const o=new singletontask_1.SingletonTask(this._getPackageFiles.bind(this,e,t,i),a);return this._taskCache.set(a,o),null==o?void 0:o.getResult(!0)}isMiniappPlatformInclude(e){const t=path_1.default.posix.join(this.project.miniprogramRoot,"app.miniapp.json");return(0,tools_1.isMiniappPlatform)(this.project.targetPlatform)&&t===e}async filterUnusedFiles(e,t,i){const s=e?"miniGame":"miniProgram";return(await this.filterFactory(i))(s,t)}async filterFactory(e){packOptionsHelper_1.default.updateState(this.project),this.onProgressUpdate("initUnusedFiles","doing","analyzing codes..."),await packOptionsHelper_1.default.initUnusedFiles(this.project,this.analyzer,"prod"===e),0!==packOptionsHelper_1.default.getUnusedFiles().size&&this.onProgressUpdate("initUnusedFiles","doing",`ignoring files: ${Array.from(packOptionsHelper_1.default.getUnusedFiles()).join(",")}`),this.onProgressUpdate("initUnusedFiles","success","analyzing codes success");const t=this._filterFactory?await this._filterFactory(e):()=>0;return(i,s)=>{const a=packOptionsHelper_1.default.relativePath(s);return this.isMiniappPlatformInclude(s)||packOptionsHelper_1.default.isFileIncluded(a)?config_1.EFilterCode.Include:packOptionsHelper_1.default.isIgnoredByRules(a)?config_1.EFilterCode.PackOptionsIgnore:i===miniProgram&&packOptionsHelper_1.default.isIgnoreByUnusedFiles(s,"prod"===e)?config_1.EFilterCode.AnalyseNoUse:t(i,s)}}async getCodeByFileList(e,t){const i={},s={},a=this.isPluginType(e)?this.project.pluginRoot:this.project.miniprogramRoot,o=[];for(const e of t){const t=this.devCodeCacheByPath.get(path_1.default.posix.join(a,e)),r=null==t?void 0:t.codeFile;let n=!1;t&&t.isValid&&r&&!("error"in r)||(n=!0,o.push(e)),r&&!("error"in r)&&(n&&(i[e]=r.md5),s[e]=r)}if(o.length>0){const t=await this.safeRunTask("getDevCodeByFileList",{graphId:e,fileList:o,cacheMd5:i},this.onProgressUpdate);for(const e in t){const i=t[e],o=path_1.default.posix.join(a,e);"error"in i||""!==i.md5?this.devCodeCacheByPath.set(o,{isValid:!0,codeFile:i}):this.devCodeCacheByPath.delete(o),s[e]=i}}return s}async getExtJSON(){return(await this.getConf(miniProgram)).ext}async getAppJSON(){return(await this.getConf(miniProgram)).app}async getGameJSON(){return(await this.getConf(miniGame)).app}async getSiteMapJSON(){return(await this.getConf(miniProgram)).sitemap}async getPageJSON(e){const t=await this.getConf(miniProgram),i=t.pages[e]||t.comps[e];if(!i)throw new Error(`summer-compiler 收集json配置有遗漏, ${e}`);return i}async getAllPageAndComponent(){const e=await this.getConf(miniProgram),t=(await this.getPackageFiles(miniProgram,config_1.FullPkg)).map((e=>e.path)).filter((e=>e.endsWith(".json")));return Object.keys(e.pages).concat(Object.keys(e.comps)).filter((e=>t.includes(`${e}.json`)))}async getAllSortedJSFiles(){var e,t,i,s;const a=this.isGameType(this.project.type),o=a?miniGame:miniProgram,r=await this.getConf(o),n=Object.keys(null!==(e=r.pages)&&void 0!==e?e:{}),c=Object.keys(null!==(t=r.comps)&&void 0!==t?t:{}),l=await this.getPackageFiles(o,config_1.FullPkg),p=null!==(i=null==l?void 0:l.map((e=>e.path)).filter((e=>e.endsWith(".js"))))&&void 0!==i?i:[],h=null!==(s=null==n?void 0:n.filter((e=>!c.includes(e))).map((e=>`${e}.js`)).filter((e=>p.includes(e))))&&void 0!==s?s:[],g=c.map((e=>`${e}.js`)).filter((e=>p.includes(e))),u=p.filter((e=>e.endsWith(".js")&&e!==(a?"game.js":"app.js")&&!h.includes(e)&&!g.includes(e)));return{jsPagesFiles:h,components:g,otherJsFiles:u}}async getAllWxmlAndWxsFiles(){const e=(await this.getPackageFiles(miniProgram,config_1.FullPkg)).map((e=>e.path)),t=e.filter((e=>e.endsWith(".wxml"))),i=e.filter((e=>e.endsWith(".wxs"))),s=await this.getCodeByFileList(miniProgram,t.concat(i));return{wxmlFiles:t,wxsFiles:i,content:t.concat(i).reduce(((e,t)=>{const i=s[t];if("error"in i)throw i.error;return e[t]=i.code,e[`./${t}`]=i.code,e}),{})}}async getPackageWxmlAndWxsFiles(e){let t=(await this.getPackageFiles(miniProgram,e)).map((e=>e.path));if(e!==config_1.MainPkg&&e!==config_1.FullPkg){const e=(await this.getPackageFiles(miniProgram,config_1.MainPkg)).map((e=>e.path));t=t.concat(e)}const i=t.filter((e=>e.endsWith(".wxml"))),s=t.filter((e=>e.endsWith(".wxs"))),a=await this.getCodeByFileList(miniProgram,i.concat(s));return{wxmlFiles:i,wxsFiles:s,content:i.concat(s).reduce(((e,t)=>{const i=a[t];if(!i)throw`lack of ${t} code`;if("error"in i)throw i.error;return e[t]=i.code,e[`./${t}`]=i.code,e}),{})}}async getPackageWxssFileList(e){let t=(await this.getPackageFiles(miniProgram,e)).map((e=>e.path));if(e!==config_1.MainPkg&&e!==config_1.FullPkg){const e=(await this.getPackageFiles(miniProgram,config_1.MainPkg)).map((e=>e.path));t=t.concat(e)}return t.filter((e=>e.endsWith(".wxss")))}async getPackageWxssFiles(e){const t=await this.getPackageWxssFileList(e),i=await this.getCodeByFileList(miniProgram,t);return{wxssFiles:t,content:t.reduce(((e,t)=>{const s=i[t];if(!s)throw`lack of ${t} code`;if("error"in s)throw s.error;return e[t]=s.code,e[`./${t}`]=s.code,e}),{})}}getWxssMap(e,t){t=(0,tools_1.normalizePath)(t),e===miniProgram?t=path_1.default.posix.join(this.project.miniprogramRoot,t):e===miniProgramPlugin&&(t=path_1.default.posix.join(this.project.pluginRoot,t));const i=this.devCodeCacheByPath.get(t),s=null==i?void 0:i.codeFile;if(s&&!("error"in s))return s.map}async getMainPkgSortedJSFiles(){const e=await this.getConf(miniProgram),t=(await this.getPackageFiles(miniProgram,config_1.MainPkg)).map((e=>e.path)).filter((e=>e.endsWith(".js"))),i=[],s=[],a=[],o=[],r=[];let n=!1;const c={},l=t=>Object.keys(e.packages).find((e=>t.startsWith(e)))||config_1.MainPkg;e.app.functionalPages&&t.forEach((e=>{if(e.startsWith("functional-pages/")){const t=e.replace(/\.js$/,"");if(c[t])return;c[t]=!0,r.push(encodeURI(t))}})),e.app.workers&&t.forEach((t=>{if(t.startsWith((0,tools_1.getWorkersPath)(e.app.workers))){const e=t.replace(/\.js$/,"");if(c[e])return;c[e]=!0,o.push(e)}}));Object.keys(e.comps).filter((e=>l(e)===config_1.MainPkg)).forEach((t=>{if((t.startsWith("miniprogram_npm/weui-miniprogram")||t.startsWith("weui-miniprogram"))&&e.app.useExtendedLib&&e.app.useExtendedLib.weui)return;if(c[t])return;c[t]=!0;const i=encodeURI(t);a.push(`${i}`)}));Object.keys(e.pages).filter((e=>l(e)===config_1.MainPkg)).forEach((e=>{if(c[e])return;c[e]=!0;const t=encodeURI(e);i.push(`${t}`)})),t.forEach((e=>{const t=e.replace(/\.js$/,"");c[t]||(c[t]=!0,"app.js"!==e?s.push(`${encodeURI(t)}`):n=!0)}));const p=[...s,...a,...i];return n&&p.push("app"),{hasAppJS:n,allFiles:p,pageFiles:i,componentFiles:a,workerFiles:o,functionalPageFiles:r,otherFiles:s}}async getSubPkgSortedJSFiles(e){const t=await this.getConf(miniProgram),i=(await this.getPackageFiles(miniProgram,e)).map((e=>e.path)).filter((e=>e.endsWith(".js"))),s=[],a=[],o=[],r={},n=e=>Object.keys(t.packages).find((t=>e.startsWith(t)))||config_1.MainPkg;Object.keys(t.comps).filter((t=>n(t)===e)).forEach((e=>{if((e.startsWith("miniprogram_npm/weui-miniprogram")||e.startsWith("weui-miniprogram"))&&t.app.useExtendedLib&&t.app.useExtendedLib.weui)return;if(r[e])return;r[e]=!0;const i=encodeURI(e);o.push(`${i}`)}));Object.keys(t.pages).filter((t=>n(t)===e)).forEach((e=>{if(r[e])return;r[e]=!0;const t=encodeURI(e);s.push(`${t}`)}));let c=t.packages[e].entry||"";c&&(c=path_1.default.posix.join(e,c),c=c.replace(/\.js$/,"")),i.forEach((e=>{const t=e.replace(/\.js$/,"");r[t]||(r[t]=!0,t!==c&&a.push(`${encodeURI(t)}`))}));const l=i.map((e=>`${encodeURI(e.replace(/\.js$/,""))}`));return{entryJS:c,allFiles:l,pageFiles:s,componentFiles:o,otherFiles:a}}async compileJSList(e){const t=this.project.type;let i=config_1.COMPILE_TYPE.miniProgram;i=e.root===this.project.miniprogramRoot?this.isGameType(t)?config_1.COMPILE_TYPE.miniGame:config_1.COMPILE_TYPE.miniProgram:this.isGameType(t)?config_1.COMPILE_TYPE.miniGamePlugin:miniProgramPlugin;const s=await this.getCodeByFileList(i,e.fileList),a=[];for(const e in s){const t=s[e];if("error"in t)throw t.error;a.push(Object.assign({filePath:e,code:t.code,map:t.map,mtime:t.mtime},t.jsTag))}return a}async compileJS(e){const t=this.project.type;let i;if(e.root===this.project.miniprogramRoot){i=(await this.getCodeByFileList(this.isGameType(t)?config_1.COMPILE_TYPE.miniGame:config_1.COMPILE_TYPE.miniProgram,[e.filePath]))[e.filePath]}else{i=(await this.getCodeByFileList(this.isGameType(t)?config_1.COMPILE_TYPE.miniGamePlugin:miniProgramPlugin,[e.filePath]))[e.filePath]}if(!i){const t=new Error(`summer-compiler miss ${e.root} js file, ${e.filePath}`);throw t.code="ENOENT",t}if("error"in i)throw i.error;return Object.assign({filePath:e.filePath,code:i.code,map:i.map,mtime:i.mtime},i.jsTag)}async compile(e){Date.now();this.progressUpdateFromCompileOptions=e.onProgressUpdate;const t=(await this.getPackageFiles(this.isGameType(this.project.type)?miniGame:miniProgram,config_1.FullPkg,e.resultType,e.useCache)).map((e=>e.path)),i=await this.safeRunTask("compileNewLogic",Object.assign(Object.assign({},e),{fileList:t,analyzer:void 0}),this.onProgressUpdate),s=i.app,a=Object.keys(s).filter((e=>e.endsWith(".json"))),o=await this.compileOther(this.isGameType(this.project.type)?miniGame:miniProgram,e.resultType||"prod",a);let r={};if(this.isPluginType(this.project.type)){const t=i.plugin,a=Object.keys(t).filter((e=>e.endsWith(".json"))),n=await this.compileOther(this.isGameType(this.project.type)?miniGamePlugin:miniProgramPlugin,e.resultType||"prod",a);Object.keys(o).forEach((e=>{r[path_1.default.posix.join("miniprogram",e)]=o[e]})),Object.keys(n).forEach((e=>{r[path_1.default.posix.join("plugin",e)]=n[e]})),Object.keys(s).forEach((e=>{r[path_1.default.posix.join("miniprogram",e)]=s[e]})),Object.keys(t).forEach((e=>{r[path_1.default.posix.join("plugin",e)]=t[e]})),r["project.config.json"]=JSON.stringify({miniprogramRoot:"miniprogram",pluginRoot:"plugin",__compileDebugInfo__:{useSummer:!0}})}else r=Object.assign(Object.assign({},o),s),r["project.config.json"]=JSON.stringify({miniprogramRoot:"",__compileDebugInfo__:{useSummer:!0}});this.onProgressUpdate(111,"success",locales_1.default.config.SUMMER_PACK_FILES_FINISH.format());for(const e of Object.keys(r))"object"==typeof r[e]&&"Buffer"===r[e].type&&(r[e]=Buffer.from(r[e].data));return r}async compileOther(e,t,i){const s=(0,tools_1.getSupportCodeFileExtSet)(this.project);s.delete(".json");const a=await(0,white_ext_list_1.getWhiteExtList)();let o=a.MiniProgramWhiteList;this.isGameType(this.project.type)&&(o=a.GameWhiteList);const r=this.isPluginType(e)?this.project.pluginRoot:this.project.miniprogramRoot,n=await this.filterFactory(t),c=this.project.getFileList(r,"").filter((t=>{const a=path_1.default.posix.extname(t),c=path_1.default.posix.relative(r,t);return!(!o.has(a)||s.has(a)||i.includes(c))&&n(e,t)===config_1.EFilterCode.Include})),l=await(0,common_1.compileOther)(this.project,c,{onProgressUpdate:()=>{}}),p={};for(const e in l){p[path_1.default.posix.relative(r,e)]=l[e]}return p}async compile2(e){const t=await this.safeRunTask("compile",e,((t,i,s)=>{var a;null===(a=e.onProgressUpdate)||void 0===a||a.call(e,{id:t.toString(),status:i,message:s})}));for(const e of Object.keys(t))"object"==typeof t[e]&&"Buffer"===t[e].type&&(t[e]=Buffer.from(t[e].data));return t}async getPluginJSON(e=""){return(await this.getConf(this.isGameType(this.project.type)?miniGamePlugin:miniProgramPlugin)).plugin}async getPluginPageJSON(e){const t=await this.getConf(miniProgramPlugin),i=t.pages[e]||t.comps[e];if(!i)throw new Error(`summer-compiler 收集plugin json配置有遗漏, ${e}`);return i}async getPluginComponents(){const e=await this.getConf(miniProgramPlugin),t=new Set(Object.keys(e.pages).concat(Object.keys(e.comps)));return Array.from(t)}async getPluginJSFiles(){const e=this.isGameType(this.project.type)?miniGamePlugin:miniProgramPlugin,t=(await this.getPackageFiles(e,config_1.FullPkg)).map((e=>e.path)).filter((e=>e.endsWith(".js"))),i=await this.getCodeByFileList(e,t);return{jsFiles:t,content:t.reduce(((e,t)=>{const s=i[t];if(!s)throw`lack of ${t} code`;if("error"in s)throw s.error;return e[t]=s.code,e[`./${t}`]=s.code,e}),{})}}async getPluginWxssFiles(){const e=(await this.getPackageFiles(miniProgramPlugin,config_1.FullPkg)).map((e=>e.path)).filter((e=>e.endsWith(".wxss"))),t=await this.getCodeByFileList(miniProgramPlugin,e);return{wxssFiles:e,content:e.reduce(((e,i)=>{const s=t[i];if(!s)throw`lack of ${i} code`;if("error"in s)throw s.error;return e[i]=s.code,e[`./${i}`]=s.code,e}),{})}}async getPluginWxmlAndWxsFiles(){const e=(await this.getPackageFiles(miniProgramPlugin,config_1.FullPkg)).map((e=>e.path)),t=e.filter((e=>e.endsWith(".wxml"))),i=e.filter((e=>e.endsWith(".wxs"))),s=await this.getCodeByFileList(miniProgramPlugin,t.concat(i));return{wxmlFiles:t,wxsFiles:i,content:t.concat(i).reduce(((e,t)=>{const i=s[t];if(!i)throw`lack of ${t} code`;if("error"in i)throw i.error;return e[t]=i.code,e[`./${t}`]=i.code,e}),{})}}async checkThemeJSON(e){return(await this.getConf(miniProgram)).theme}setProxy(e){(0,request_1.setCiProxy)(e)}setLocale(e){this._locale!==e&&(this._locale=e,this.safeRunTask("setLocale",e))}async uglifyFileNames(e,t,i){return await(0,uglifyfilenames_1.uglifyFileNames)(e,t,i)}async getMPFileInfo(){return this.safeRunTask("getLocalFileList",miniProgram)}async getPluginFileInfo(){return this.safeRunTask("getLocalFileList",miniProgramPlugin)}async getCompAndPagesOfConf(){const e=await this.getConf(miniProgram);return{pages:e.pages,comps:e.comps}}async getFiltedFileListReason(e){const t=this.project.getFileList(this.project.miniprogramRoot),i=[],s=await this.filterFactory(e),a=this.isGameType(this.project.type)?miniGame:miniProgram;for(const e of t){const t=s(a,e);t!==config_1.EFilterCode.Include&&i.push({file:e,code:t})}if(this.isPluginType(this.project.type)){const e=this.project.getFileList(this.project.pluginRoot),t=this.isGameType(this.project.type)?miniGamePlugin:miniProgramPlugin;for(const a of e){const e=s(t,a);e!==config_1.EFilterCode.Include&&i.push({file:a,code:e})}}return i}}exports.SummerCompiler=SummerCompiler;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SummerCompiler=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=tslib_1.__importDefault(require("lodash")),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),request_1=require("../../utils/request"),common_1=require("./original/compile/common"),tools_1=require("../../utils/tools"),white_ext_list_1=require("../../utils/white_ext_list"),config_1=require("../../config/config"),processManager_1=require("../../utils/subprocess/processManager"),messageHub_1=require("../../utils/messageHub"),singletontask_1=require("../../utils/singletontask"),uglifyfilenames_1=require("./original/protect/uglifyfilenames"),baseCompiler_1=require("./baseCompiler"),packOptionsHelper_1=tslib_1.__importDefault(require("../../utils/packOptionsHelper")),getservice_1=tslib_1.__importDefault(require("../../services/common/getservice")),appDirService_1=require("../../services/app/common/appDirService"),nativeModule_1=require("../../services/nativeModule/common/nativeModule"),miniProgram=config_1.COMPILE_TYPE.miniProgram,miniGame=config_1.COMPILE_TYPE.miniGame,miniProgramPlugin=config_1.COMPILE_TYPE.miniProgramPlugin,miniGamePlugin=config_1.COMPILE_TYPE.miniGamePlugin;function performanceMark(e,t){}class SummerCompiler extends baseCompiler_1.BaseCoreCompiler{constructor(e,t,i,s,a,o,r){super(e),this.project=e,this.cachePath=t,this.projectInfo=i,this.devtoolMessagehub=s,this.analyzer=a,this._filterFactory=o,this.onInitFinished=r,this.isSummer=!0,this.promiseCache=new Map,this._taskCache=new Map,this._status=void 0,this._eventAdded=!1,this._locale="",this._initServiceForkId=0,this.devCodeCacheByPath=new Map,this._initServiceAndLoadStatusPromise=null,this.onFileChange=(e,t)=>{if("change"!==e||t.endsWith(".json"))for(const e of this.promiseCache.keys())e.startsWith("getConf-")&&this.promiseCache.delete(e);if("change"!==e){for(const e of this.promiseCache.keys())e.startsWith("getPackageFiles-")&&this.promiseCache.delete(e);for(const e of this._taskCache.keys())e.startsWith("getPackageFiles-")&&this._taskCache.delete(e)}this.invalidCodeCache(t),this.subProcessManager.sendEvent("fileChange",{type:e,targetPath:t}),packOptionsHelper_1.default.clearUnusedFiles()},this.onPreCompileOptionsChange=async e=>{await this.clearCache(),this.subProcessManager.sendEvent("precompileOptionsChange",e)},this.onProgressUpdate=(e,t,i)=>{var s;this.messageHub.showBuildLog(`${e}`,t,i),null===(s=this.progressUpdateFromCompileOptions)||void 0===s||s.call(this,{id:e.toString(),message:i,status:t})},this._getPackageFiles=async(e,t,i="dev")=>{performanceMark("request get getPackageFiles");const s=await this.safeRunTask("getPackageFiles",{graphId:e,root:t},this.onProgressUpdate);performanceMark("request get getPackageFiles",!0);const a=this.isPluginType(e)?this.project.pluginRoot:this.project.miniprogramRoot,o=await this.filterFactory(i),r={},n=s.filter((t=>{const i=path_1.default.posix.join(a,t.source),s=o(e,i);return s!==config_1.EFilterCode.Include&&(r[s]||(r[s]=[]),r[s].push(i)),s===config_1.EFilterCode.Include})),c={[config_1.EFilterCode.AnalyseNoUse]:locales_1.default.config.UNUSE_FILE_LIST,[config_1.EFilterCode.PackOptionsIgnore]:locales_1.default.config.PACK_OPTIONS_IGNORE_LIST,[config_1.EFilterCode.PartialCompileNoUse]:locales_1.default.config.PARTIAL_COMPILE_IGNORE_LIST};for(const e in r)c[e]?this.onProgressUpdate(e,"warn",c[e].format(r[e].join(","))):this.onProgressUpdate(e,"warn",locales_1.default.config.UNKNOWN_REASON_INGORE_LIST.format(e,r[e].join(",")));return n},performanceMark("create summer compiler"),this.messageHub=new messageHub_1.MessageHub(s),this.ready(),global.dumpWorkerTaskStats=this.dumpWorkerTaskStats.bind(this),global.clearWorkerTaskStats=this.clearWorkerTaskStats.bind(this)}get status(){return this._status}async init(){performanceMark("init summer compiler");const e=path_1.default.posix.join(__dirname,"./summerEntryProcess.js"),t="undefined"!=typeof WEBIDE_WEBPECK_DEFINE_PLUGIN?"./summerentryprocess.js":e;this.subProcessManager=new processManager_1.SubProcessProxy(this.project,t,{cachePath:this.cachePath},this.projectInfo,8891,this.onProgressUpdate),this.addProjectListener();this.ensureInitService().then((()=>{var e;null===(e=this.onInitFinished)||void 0===e||e.call(this)}),(e=>{var t;null===(t=this.onInitFinished)||void 0===t||t.call(this,e)})),performanceMark("init summer compiler",!0)}async initServiceAndLoadStatus(){null===this._initServiceAndLoadStatusPromise?this._initServiceAndLoadStatusPromise=new Promise((async e=>{const t={};try{const e=await(0,getservice_1.default)(appDirService_1.IAppDirService).get("WeappCompileCache"),i=await(0,getservice_1.default)(nativeModule_1.INativeModuleService);t.NativeModule={WXMLParsePath:await i.getWXMLParsePath(),WXSSParsePath:await i.getWXSSParsePath(),GlassEaselLazyModulePath:await i.getGlassEaselTemplateCompilerPath()},t.AppDirService={WeappCompileCache:e}}catch(e){console.log("initServiceAndLoadStatus hasno WeappCompileCache / INativeModuleService in ci is normal")}this._status=await this.subProcessManager.runTask("initServiceAndloadStatus",t),e()})):await this._initServiceAndLoadStatusPromise}async ensureInitService(){await this.subProcessManager.ready(),this.subProcessManager.forkId!==this._initServiceForkId&&(this._initServiceAndLoadStatusPromise=null,await this.initServiceAndLoadStatus(),this._initServiceForkId=this.subProcessManager.forkId)}async safeRunTask(e,t,i){return await this.ensureInitService(),this.subProcessManager.runTask(e,t,i)}async loadStatus(){this._status=await this.safeRunTask("loadStatus")}destroy(){var e;null===(e=this.subProcessManager)||void 0===e||e.destroy(),this.removeProjectListener(),this._checkReadyTask=void 0}async clearCache(){await this.safeRunTask("clearCache"),this.promiseCache.clear(),this.devCodeCacheByPath.clear(),this._taskCache.clear()}async dumpWorkerTaskStats(){const e=await this.safeRunTask("getWorkerTaskStats"),t=new Map;for(const i of e){const e=`${i.workerId}_${i.taskName}`;let s=t.get(e);s||(s={workerId:i.workerId,taskName:i.taskName,count:0,total:0},t.set(e,s)),s.count++,s.total+=i.duration}const i=[...t.values()].sort(((e,t)=>String(e.workerId).localeCompare(String(t.workerId)))).map((e=>({Worker:e.workerId,Task:e.taskName,Count:e.count,"Total(ms)":e.total,"Avg(ms)":Math.round(e.total/e.count)})));console.table(i)}async clearWorkerTaskStats(){await this.safeRunTask("clearWorkerTaskStats")}getProjectInfo(){return this.projectInfo}updateOptions(e){lodash_1.default.isEqual(e,this.projectInfo)||this.updateOptionsWithoutJudge(e)}updateOptionsWithoutJudge(e){var t;this.projectInfo=e,this.promiseCache.clear(),this.devCodeCacheByPath.clear(),null===(t=this.subProcessManager)||void 0===t||t.sendEvent("updateOptions",e),this.loadStatus(),this.project.updateOptions(e)}updateOptionsWhenAttrNotChanged(e){var t;lodash_1.default.isEqual(Object.assign(Object.assign({},e),{attr:void 0}),Object.assign(Object.assign({},this.projectInfo),{attr:void 0}))||(this.projectInfo=e,this.promiseCache.clear(),this.devCodeCacheByPath.clear(),null===(t=this.subProcessManager)||void 0===t||t.sendEvent("updateOptions",e),this.loadStatus(),this.project.updateOptions(e))}addProjectListener(){var e,t;this._eventAdded&&this.removeProjectListener(),null===(e=this.project.event)||void 0===e||e.on("fileChange",this.onFileChange),null===(t=this.project.event)||void 0===t||t.on("precompileOptionsChange",this.onPreCompileOptionsChange),this._eventAdded=!0}removeProjectListener(){var e,t;null===(e=this.project.event)||void 0===e||e.off("fileChange",this.onFileChange),null===(t=this.project.event)||void 0===t||t.off("precompileOptionsChange",this.onPreCompileOptionsChange),this._eventAdded=!1}invalidCodeCache(e){const t=this.devCodeCacheByPath.get((0,tools_1.sourcePathToTargetPath)(e));t&&(t.isValid=!1)}async getConf(e){const t=`getConf-${e}`;if(this.promiseCache.has(t))return this.promiseCache.get(t);performanceMark("request get conf");const i={graphId:e},s=this.safeRunTask("getConf",i,this.onProgressUpdate);return this.promiseCache.set(t,s),performanceMark("request get conf",!0),s}async waitSubProcessReady(){await this.subProcessManager.ready()}async getPackageFiles(e,t,i="dev",s=!0){const a=`getPackageFiles-${e}-${t}-${i}`;if(this._taskCache.has(a)&&s){const e=this._taskCache.get(a);return null==e?void 0:e.getResult(!0)}const o=new singletontask_1.SingletonTask(this._getPackageFiles.bind(this,e,t,i),a);return this._taskCache.set(a,o),null==o?void 0:o.getResult(!0)}isMiniappPlatformInclude(e){const t=path_1.default.posix.join(this.project.miniprogramRoot,"app.miniapp.json");return(0,tools_1.isMiniappPlatform)(this.project.targetPlatform)&&t===e}async filterUnusedFiles(e,t,i){const s=e?"miniGame":"miniProgram";return(await this.filterFactory(i))(s,t)}async filterFactory(e){packOptionsHelper_1.default.updateState(this.project),await packOptionsHelper_1.default.initUnusedFiles(this.project,this.analyzer,"prod"===e,this.onProgressUpdate);const t=this._filterFactory?await this._filterFactory(e):()=>0;return(i,s)=>{const a=packOptionsHelper_1.default.relativePath(s);return this.isMiniappPlatformInclude(s)||packOptionsHelper_1.default.isFileIncluded(a)?config_1.EFilterCode.Include:packOptionsHelper_1.default.isIgnoredByRules(a)?config_1.EFilterCode.PackOptionsIgnore:i===miniProgram&&packOptionsHelper_1.default.isIgnoreByUnusedFiles(s,"prod"===e)?config_1.EFilterCode.AnalyseNoUse:t(i,s)}}async getCodeByFileList(e,t){const i={},s={},a=this.isPluginType(e)?this.project.pluginRoot:this.project.miniprogramRoot,o=[];for(const e of t){const t=this.devCodeCacheByPath.get(path_1.default.posix.join(a,e)),r=null==t?void 0:t.codeFile;let n=!1;t&&t.isValid&&r&&!("error"in r)||(n=!0,o.push(e)),r&&!("error"in r)&&(n&&(i[e]=r.md5),s[e]=r)}if(o.length>0){const t=await this.safeRunTask("getDevCodeByFileList",{graphId:e,fileList:o,cacheMd5:i},this.onProgressUpdate);for(const e in t){const i=t[e],o=path_1.default.posix.join(a,e);"error"in i||""!==i.md5?this.devCodeCacheByPath.set(o,{isValid:!0,codeFile:i}):this.devCodeCacheByPath.delete(o),s[e]=i}}return s}async getExtJSON(){return(await this.getConf(miniProgram)).ext}async getAppJSON(){return(await this.getConf(miniProgram)).app}async getGameJSON(){return(await this.getConf(miniGame)).app}async getSiteMapJSON(){return(await this.getConf(miniProgram)).sitemap}async getPageJSON(e){const t=await this.getConf(miniProgram),i=t.pages[e]||t.comps[e];if(!i)throw new Error(`summer-compiler 收集json配置有遗漏, ${e}`);return i}async getAllPageAndComponent(){const e=await this.getConf(miniProgram),t=(await this.getPackageFiles(miniProgram,config_1.FullPkg)).map((e=>e.path)).filter((e=>e.endsWith(".json")));return Object.keys(e.pages).concat(Object.keys(e.comps)).filter((e=>t.includes(`${e}.json`)))}async getAllSortedJSFiles(){var e,t,i,s;const a=this.isGameType(this.project.type),o=a?miniGame:miniProgram,r=await this.getConf(o),n=Object.keys(null!==(e=r.pages)&&void 0!==e?e:{}),c=Object.keys(null!==(t=r.comps)&&void 0!==t?t:{}),l=await this.getPackageFiles(o,config_1.FullPkg),p=null!==(i=null==l?void 0:l.map((e=>e.path)).filter((e=>e.endsWith(".js"))))&&void 0!==i?i:[],h=null!==(s=null==n?void 0:n.filter((e=>!c.includes(e))).map((e=>`${e}.js`)).filter((e=>p.includes(e))))&&void 0!==s?s:[],g=c.map((e=>`${e}.js`)).filter((e=>p.includes(e))),m=p.filter((e=>e.endsWith(".js")&&e!==(a?"game.js":"app.js")&&!h.includes(e)&&!g.includes(e)));return{jsPagesFiles:h,components:g,otherJsFiles:m}}async getAllWxmlAndWxsFiles(){const e=(await this.getPackageFiles(miniProgram,config_1.FullPkg)).map((e=>e.path)),t=e.filter((e=>e.endsWith(".wxml"))),i=e.filter((e=>e.endsWith(".wxs"))),s=await this.getCodeByFileList(miniProgram,t.concat(i));return{wxmlFiles:t,wxsFiles:i,content:t.concat(i).reduce(((e,t)=>{const i=s[t];if("error"in i)throw i.error;return e[t]=i.code,e[`./${t}`]=i.code,e}),{})}}async getPackageWxmlAndWxsFiles(e){let t=(await this.getPackageFiles(miniProgram,e)).map((e=>e.path));if(e!==config_1.MainPkg&&e!==config_1.FullPkg){const e=(await this.getPackageFiles(miniProgram,config_1.MainPkg)).map((e=>e.path));t=t.concat(e)}const i=t.filter((e=>e.endsWith(".wxml"))),s=t.filter((e=>e.endsWith(".wxs"))),a=await this.getCodeByFileList(miniProgram,i.concat(s));return{wxmlFiles:i,wxsFiles:s,content:i.concat(s).reduce(((e,t)=>{const i=a[t];if(!i)throw`lack of ${t} code`;if("error"in i)throw i.error;return e[t]=i.code,e[`./${t}`]=i.code,e}),{})}}async getPackageWxssFileList(e){let t=(await this.getPackageFiles(miniProgram,e)).map((e=>e.path));if(e!==config_1.MainPkg&&e!==config_1.FullPkg){const e=(await this.getPackageFiles(miniProgram,config_1.MainPkg)).map((e=>e.path));t=t.concat(e)}return t.filter((e=>e.endsWith(".wxss")))}async getPackageWxssFiles(e){const t=await this.getPackageWxssFileList(e),i=await this.getCodeByFileList(miniProgram,t);return{wxssFiles:t,content:t.reduce(((e,t)=>{const s=i[t];if(!s)throw`lack of ${t} code`;if("error"in s)throw s.error;return e[t]=s.code,e[`./${t}`]=s.code,e}),{})}}getWxssMap(e,t){t=(0,tools_1.normalizePath)(t),e===miniProgram?t=path_1.default.posix.join(this.project.miniprogramRoot,t):e===miniProgramPlugin&&(t=path_1.default.posix.join(this.project.pluginRoot,t));const i=this.devCodeCacheByPath.get(t),s=null==i?void 0:i.codeFile;if(s&&!("error"in s))return s.map}async getMainPkgSortedJSFiles(){const e=await this.getConf(miniProgram),t=(await this.getPackageFiles(miniProgram,config_1.MainPkg)).map((e=>e.path)).filter((e=>e.endsWith(".js"))),i=[],s=[],a=[],o=[],r=[];let n=!1;const c={},l=t=>Object.keys(e.packages).find((e=>t.startsWith(e)))||config_1.MainPkg;e.app.functionalPages&&t.forEach((e=>{if(e.startsWith("functional-pages/")){const t=e.replace(/\.js$/,"");if(c[t])return;c[t]=!0,r.push(encodeURI(t))}})),e.app.workers&&t.forEach((t=>{if(t.startsWith((0,tools_1.getWorkersPath)(e.app.workers))){const e=t.replace(/\.js$/,"");if(c[e])return;c[e]=!0,o.push(e)}}));Object.keys(e.comps).filter((e=>l(e)===config_1.MainPkg)).forEach((t=>{if((t.startsWith("miniprogram_npm/weui-miniprogram")||t.startsWith("weui-miniprogram"))&&e.app.useExtendedLib&&e.app.useExtendedLib.weui)return;if(c[t])return;c[t]=!0;const i=encodeURI(t);a.push(`${i}`)}));Object.keys(e.pages).filter((e=>l(e)===config_1.MainPkg)).forEach((e=>{if(c[e])return;c[e]=!0;const t=encodeURI(e);i.push(`${t}`)})),t.forEach((e=>{const t=e.replace(/\.js$/,"");c[t]||(c[t]=!0,"app.js"!==e?s.push(`${encodeURI(t)}`):n=!0)}));const p=[...s,...a,...i];return n&&p.push("app"),{hasAppJS:n,allFiles:p,pageFiles:i,componentFiles:a,workerFiles:o,functionalPageFiles:r,otherFiles:s}}async getSubPkgSortedJSFiles(e){const t=await this.getConf(miniProgram),i=(await this.getPackageFiles(miniProgram,e)).map((e=>e.path)).filter((e=>e.endsWith(".js"))),s=[],a=[],o=[],r={},n=e=>Object.keys(t.packages).find((t=>e.startsWith(t)))||config_1.MainPkg;Object.keys(t.comps).filter((t=>n(t)===e)).forEach((e=>{if((e.startsWith("miniprogram_npm/weui-miniprogram")||e.startsWith("weui-miniprogram"))&&t.app.useExtendedLib&&t.app.useExtendedLib.weui)return;if(r[e])return;r[e]=!0;const i=encodeURI(e);o.push(`${i}`)}));Object.keys(t.pages).filter((t=>n(t)===e)).forEach((e=>{if(r[e])return;r[e]=!0;const t=encodeURI(e);s.push(`${t}`)}));let c=t.packages[e].entry||"";c&&(c=path_1.default.posix.join(e,c),c=c.replace(/\.js$/,"")),i.forEach((e=>{const t=e.replace(/\.js$/,"");r[t]||(r[t]=!0,t!==c&&a.push(`${encodeURI(t)}`))}));const l=i.map((e=>`${encodeURI(e.replace(/\.js$/,""))}`));return{entryJS:c,allFiles:l,pageFiles:s,componentFiles:o,otherFiles:a}}async compileJSList(e){const t=this.project.type;let i=config_1.COMPILE_TYPE.miniProgram;i=e.root===this.project.miniprogramRoot?this.isGameType(t)?config_1.COMPILE_TYPE.miniGame:config_1.COMPILE_TYPE.miniProgram:this.isGameType(t)?config_1.COMPILE_TYPE.miniGamePlugin:miniProgramPlugin;const s=await this.getCodeByFileList(i,e.fileList),a=[];for(const e in s){const t=s[e];if("error"in t)throw t.error;a.push(Object.assign({filePath:e,code:t.code,map:t.map,mtime:t.mtime},t.jsTag))}return a}async compileJS(e){const t=this.project.type;let i;if(e.root===this.project.miniprogramRoot){i=(await this.getCodeByFileList(this.isGameType(t)?config_1.COMPILE_TYPE.miniGame:config_1.COMPILE_TYPE.miniProgram,[e.filePath]))[e.filePath]}else{i=(await this.getCodeByFileList(this.isGameType(t)?config_1.COMPILE_TYPE.miniGamePlugin:miniProgramPlugin,[e.filePath]))[e.filePath]}if(!i){const t=new Error(`summer-compiler miss ${e.root} js file, ${e.filePath}`);throw t.code="ENOENT",t}if("error"in i)throw i.error;return Object.assign({filePath:e.filePath,code:i.code,map:i.map,mtime:i.mtime},i.jsTag)}async compile(e){Date.now();this.progressUpdateFromCompileOptions=e.onProgressUpdate;const t=(await this.getPackageFiles(this.isGameType(this.project.type)?miniGame:miniProgram,config_1.FullPkg,e.resultType,e.useCache)).map((e=>e.path)),i=await this.safeRunTask("compileNewLogic",Object.assign(Object.assign({},e),{fileList:t,analyzer:void 0}),this.onProgressUpdate),s=i.app,a=Object.keys(s).filter((e=>e.endsWith(".json"))),o=await this.compileOther(this.isGameType(this.project.type)?miniGame:miniProgram,e.resultType||"prod",a);let r={};if(this.isPluginType(this.project.type)){const t=i.plugin,a=Object.keys(t).filter((e=>e.endsWith(".json"))),n=await this.compileOther(this.isGameType(this.project.type)?miniGamePlugin:miniProgramPlugin,e.resultType||"prod",a);Object.keys(o).forEach((e=>{r[path_1.default.posix.join("miniprogram",e)]=o[e]})),Object.keys(n).forEach((e=>{r[path_1.default.posix.join("plugin",e)]=n[e]})),Object.keys(s).forEach((e=>{r[path_1.default.posix.join("miniprogram",e)]=s[e]})),Object.keys(t).forEach((e=>{r[path_1.default.posix.join("plugin",e)]=t[e]})),r["project.config.json"]=JSON.stringify({miniprogramRoot:"miniprogram",pluginRoot:"plugin",__compileDebugInfo__:{useSummer:!0}})}else r=Object.assign(Object.assign({},o),s),r["project.config.json"]=JSON.stringify({miniprogramRoot:"",__compileDebugInfo__:{useSummer:!0}});this.onProgressUpdate(111,"success",locales_1.default.config.SUMMER_PACK_FILES_FINISH.format());for(const e of Object.keys(r))"object"==typeof r[e]&&"Buffer"===r[e].type&&(r[e]=Buffer.from(r[e].data));return r}async compileOther(e,t,i){const s=(0,tools_1.getSupportCodeFileExtSet)(this.project);s.delete(".json");const a=await(0,white_ext_list_1.getWhiteExtList)();let o=a.MiniProgramWhiteList;this.isGameType(this.project.type)&&(o=a.GameWhiteList);const r=this.isPluginType(e)?this.project.pluginRoot:this.project.miniprogramRoot,n=await this.filterFactory(t),c=this.project.getFileList(r,"").filter((t=>{const a=path_1.default.posix.extname(t),c=path_1.default.posix.relative(r,t);return!(!o.has(a)||s.has(a)||i.includes(c))&&n(e,t)===config_1.EFilterCode.Include})),l=await(0,common_1.compileOther)(this.project,c,{onProgressUpdate:()=>{}}),p={};for(const e in l){p[path_1.default.posix.relative(r,e)]=l[e]}return p}async compile2(e){const t=await this.safeRunTask("compile",e,((t,i,s)=>{var a;null===(a=e.onProgressUpdate)||void 0===a||a.call(e,{id:t.toString(),status:i,message:s})}));for(const e of Object.keys(t))"object"==typeof t[e]&&"Buffer"===t[e].type&&(t[e]=Buffer.from(t[e].data));return t}async getPluginJSON(e=""){return(await this.getConf(this.isGameType(this.project.type)?miniGamePlugin:miniProgramPlugin)).plugin}async getPluginPageJSON(e){const t=await this.getConf(miniProgramPlugin),i=t.pages[e]||t.comps[e];if(!i)throw new Error(`summer-compiler 收集plugin json配置有遗漏, ${e}`);return i}async getPluginComponents(){const e=await this.getConf(miniProgramPlugin),t=new Set(Object.keys(e.pages).concat(Object.keys(e.comps)));return Array.from(t)}async getPluginJSFiles(){const e=this.isGameType(this.project.type)?miniGamePlugin:miniProgramPlugin,t=(await this.getPackageFiles(e,config_1.FullPkg)).map((e=>e.path)).filter((e=>e.endsWith(".js"))),i=await this.getCodeByFileList(e,t);return{jsFiles:t,content:t.reduce(((e,t)=>{const s=i[t];if(!s)throw`lack of ${t} code`;if("error"in s)throw s.error;return e[t]=s.code,e[`./${t}`]=s.code,e}),{})}}async getPluginWxssFiles(){const e=(await this.getPackageFiles(miniProgramPlugin,config_1.FullPkg)).map((e=>e.path)).filter((e=>e.endsWith(".wxss"))),t=await this.getCodeByFileList(miniProgramPlugin,e);return{wxssFiles:e,content:e.reduce(((e,i)=>{const s=t[i];if(!s)throw`lack of ${i} code`;if("error"in s)throw s.error;return e[i]=s.code,e[`./${i}`]=s.code,e}),{})}}async getPluginWxmlAndWxsFiles(){const e=(await this.getPackageFiles(miniProgramPlugin,config_1.FullPkg)).map((e=>e.path)),t=e.filter((e=>e.endsWith(".wxml"))),i=e.filter((e=>e.endsWith(".wxs"))),s=await this.getCodeByFileList(miniProgramPlugin,t.concat(i));return{wxmlFiles:t,wxsFiles:i,content:t.concat(i).reduce(((e,t)=>{const i=s[t];if(!i)throw`lack of ${t} code`;if("error"in i)throw i.error;return e[t]=i.code,e[`./${t}`]=i.code,e}),{})}}async checkThemeJSON(e){return(await this.getConf(miniProgram)).theme}setProxy(e){(0,request_1.setCiProxy)(e)}setLocale(e){this._locale!==e&&(this._locale=e,this.safeRunTask("setLocale",e))}async uglifyFileNames(e,t,i){return await(0,uglifyfilenames_1.uglifyFileNames)(e,t,i)}async getMPFileInfo(){return this.safeRunTask("getLocalFileList",miniProgram)}async getPluginFileInfo(){return this.safeRunTask("getLocalFileList",miniProgramPlugin)}async getCompAndPagesOfConf(){const e=await this.getConf(miniProgram);return{pages:e.pages,comps:e.comps}}async getFiltedFileListReason(e){const t=this.project.getFileList(this.project.miniprogramRoot),i=[],s=await this.filterFactory(e),a=this.isGameType(this.project.type)?miniGame:miniProgram;for(const e of t){const t=s(a,e);t!==config_1.EFilterCode.Include&&i.push({file:e,code:t})}if(this.isPluginType(this.project.type)){const e=this.project.getFileList(this.project.pluginRoot),t=this.isGameType(this.project.type)?miniGamePlugin:miniProgramPlugin;for(const a of e){const e=s(t,a);e!==config_1.EFilterCode.Include&&i.push({file:a,code:e})}}return i}}exports.SummerCompiler=SummerCompiler;
|