miniprogram-ci 2.0.10 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +5 -0
- package/dist/@types/ci/build-apk.d.ts +54 -0
- package/dist/@types/ci/build-ipa.d.ts +46 -0
- package/dist/@types/ci/getcompiler.d.ts +3 -0
- package/dist/@types/ci/index.d.ts +4 -0
- package/dist/@types/ci/miniapp/androidCloudBuild.d.ts +36 -0
- package/dist/@types/ci/miniapp/archive.d.ts +27 -0
- package/dist/@types/ci/miniapp/checkBuildArgument.d.ts +21 -0
- package/dist/@types/ci/miniapp/iosCloudBuild.d.ts +36 -0
- package/dist/@types/ci/miniapp/iosLocalBuild.d.ts +13 -0
- package/dist/@types/ci/miniapp/iosTheme.d.ts +4 -0
- package/dist/@types/ci/miniapp/miniappPlugin.d.ts +33 -0
- package/dist/@types/ci/miniapp/sdkManager.d.ts +5 -0
- package/dist/@types/ci/miniapp/upload.d.ts +25 -0
- package/dist/@types/ci/miniappattr.d.ts +1 -0
- package/dist/@types/ci/upload.d.ts +1 -2
- package/dist/@types/ci/utils/ciRequest.d.ts +7 -0
- package/dist/@types/ci/utils/progressupdate.d.ts +2 -0
- package/dist/@types/ci/utils/tools.d.ts +4 -0
- package/dist/@types/ci/utils/unpack.d.ts +3 -0
- package/dist/@types/ci/utils/wxvpkg/unpack/config.d.ts +40 -0
- package/dist/@types/ci/utils/wxvpkg/unpack/version0.d.ts +15 -0
- package/dist/@types/ci/utils/wxvpkg/unpack/version10.d.ts +18 -0
- package/dist/@types/ci/utils/wxvpkg/utils.d.ts +3 -0
- package/dist/@types/common/code-analyse/index.d.ts +1 -0
- package/dist/@types/config/config.d.ts +1 -1
- package/dist/@types/config/url.config.d.ts +8 -0
- package/dist/@types/index.d.ts +3 -0
- package/dist/@types/modules/corecompiler/baseCompiler.d.ts +5 -0
- package/dist/@types/modules/corecompiler/originalCompiler.d.ts +1 -0
- package/dist/@types/modules/corecompiler/processHandler.d.ts +2 -21
- package/dist/@types/modules/corecompiler/summerCompiler.d.ts +4 -1
- package/dist/@types/modules/fullcompiler/app/app.d.ts +82 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/originalcontactbase64.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/originallaunchbase64.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.d.ts +2 -0
- package/dist/@types/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.d.ts +3 -0
- package/dist/@types/modules/index.d.ts +1 -2
- package/dist/@types/modules/precompiler/conditioncompile/index.d.ts +3 -2
- package/dist/@types/modules/precompiler/index.d.ts +3 -2
- package/dist/@types/project/ciProject.d.ts +3 -0
- package/dist/@types/types/ci.d.ts +6 -1
- package/dist/@types/types/core.d.ts +1 -1
- package/dist/@types/types/devtools.d.ts +10 -3
- package/dist/@types/types/miniapp/index.d.ts +88 -0
- package/dist/@types/types/summer.d.ts +1 -0
- package/dist/@types/utils/locales/locales.d.ts +1 -0
- package/dist/@types/utils/locales/zh.d.ts +1 -0
- package/dist/@types/utils/messageHub.d.ts +2 -2
- package/dist/@types/utils/miniAppI18N.d.ts +15 -0
- package/dist/@types/utils/miniapp-builder.d.ts +7 -2
- package/dist/@types/utils/miniappJson.d.ts +2 -0
- package/dist/@types/utils/progressRecorder.d.ts +3 -1
- package/dist/@types/utils/report.d.ts +3 -1
- package/dist/@types/utils/request.d.ts +2 -0
- package/dist/@types/utils/subprocess/processManager.d.ts +4 -1
- package/dist/@types/utils/taskstatus.d.ts +3 -3
- package/dist/@types/utils/tools.d.ts +1 -0
- package/dist/ci/android-miniapp-toolkit/dist/index.js +1 -0
- package/dist/ci/android-miniapp-toolkit/lib/apkcert.jar +0 -0
- package/dist/ci/android-miniapp-toolkit/lib/apksigner.jar +0 -0
- package/dist/ci/android-miniapp-toolkit/lib/libwinpthread-1.dll +0 -0
- package/dist/ci/android-miniapp-toolkit/lib/zipalign +0 -0
- package/dist/ci/android-miniapp-toolkit/lib/zipalign.exe +0 -0
- package/dist/ci/build-apk.js +1 -0
- package/dist/ci/build-ipa.js +1 -0
- package/dist/ci/getCompiledResult.js +1 -1
- package/dist/ci/getcompiler.js +1 -1
- package/dist/ci/index.js +1 -1
- package/dist/ci/miniapp/androidCloudBuild.js +1 -0
- package/dist/ci/miniapp/archive.js +1 -0
- package/dist/ci/miniapp/checkBuildArgument.js +1 -0
- package/dist/ci/miniapp/iosCloudBuild.js +1 -0
- package/dist/ci/miniapp/iosLocalBuild.js +1 -0
- package/dist/ci/miniapp/iosTheme.js +1 -0
- package/dist/ci/miniapp/miniappPlugin.js +1 -0
- package/dist/ci/miniapp/sdkManager.js +1 -0
- package/dist/ci/miniapp/upload.js +1 -0
- package/dist/ci/miniappattr.js +1 -0
- package/dist/ci/upload.js +1 -1
- package/dist/ci/utils/ciRequest.js +1 -0
- package/dist/ci/utils/progressupdate.js +1 -0
- package/dist/ci/utils/tools.js +1 -1
- package/dist/ci/utils/unpack.js +1 -0
- package/dist/ci/utils/wxvpkg/unpack/config.js +1 -0
- package/dist/ci/utils/wxvpkg/unpack/version0.js +1 -0
- package/dist/ci/utils/wxvpkg/unpack/version10.js +1 -0
- package/dist/ci/utils/wxvpkg/utils.js +1 -0
- package/dist/common/code-analyse/index.js +1 -1
- package/dist/config/config.js +1 -1
- package/dist/config/url.config.js +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/corecompiler/baseCompiler.js +1 -1
- package/dist/modules/corecompiler/original/workerThread/task/minifywxml.js +1 -1
- package/dist/modules/corecompiler/processHandler.js +1 -1
- package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -1
- package/dist/modules/corecompiler/summer/module.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/javascript.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/swc.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/base/wxss.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/terser.js +1 -1
- package/dist/modules/corecompiler/summer/plugins/typescript.js +1 -1
- package/dist/modules/corecompiler/summer/worker.js +1 -1
- package/dist/modules/corecompiler/summerCompiler.js +1 -1
- package/dist/modules/fullcompiler/app/app.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/originalcontactbase64.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/originallaunchbase64.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.js +1 -0
- package/dist/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.js +1 -0
- package/dist/modules/index.js +1 -1
- package/dist/modules/nativecompiler/index.js +1 -1
- package/dist/modules/nativecompiler/ios/buildCloud.js +1 -1
- package/dist/modules/nativecompiler/ios/index.js +1 -1
- package/dist/modules/precompiler/conditioncompile/index.js +1 -1
- package/dist/modules/precompiler/index.js +1 -1
- package/dist/project/advance/precompileProject.js +1 -1
- package/dist/project/ciProject.js +1 -1
- package/dist/utils/codesign.js +1 -1
- package/dist/utils/cp.js +1 -1
- package/dist/utils/locales/en.js +1 -1
- package/dist/utils/locales/zh.js +1 -1
- package/dist/utils/miniAppI18N.js +1 -0
- package/dist/utils/miniapp-builder.js +1 -1
- package/dist/utils/miniappJson.js +1 -1
- package/dist/utils/progressRecorder.js +1 -1
- package/dist/utils/report.js +1 -1
- package/dist/utils/request.js +1 -1
- package/dist/utils/subprocess/processManager.js +1 -1
- package/dist/utils/taskstatus.js +1 -1
- package/dist/utils/tools.js +1 -1
- package/dist/utils/zip.js +1 -1
- package/package.json +5 -4
package/dist/utils/locales/zh.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fomatable_string_1=require("./fomatable_string"),config={GENERATE_LOCAL_SIGNATURE_FAIL:"生成本地签名失败。通常是key文件编码或者内容有误。错误详情: %s",PARAM_ERROR:'方法:"%s" 缺少参数:"%s"',SHOULD_NOT_BE_EMPTY:"%s 不能为空",JSON_CONTENT_SHOULD_BE:"%s 字段需为 %s",SHOULD_AT_LEAST_ONE_ITEM:"%s 需至少存在一项",SHOULD_MATCH:"%s 需与 %s 匹配",SHOULD_EQUAL:"%s 需等于 %s",EXT_SHOULD_BE_ERROR:'%s 的拓展名需为 "%s"',OR:"或",CORRESPONDING_FILE_NOT_FOUND:"未找到 %s 对应的 %s 文件",JSON_SHOULD_NOT_START_WITH:"%s 不应该以 '%s' 开头",JSON_SHOULD_NOT_CONTAIN:"%s 不应该包含 %s",NOT_FOUND:"%s 未找到",COMPONENT_NOT_FOUND:"%s,在 %s 路径下未找到组件",NOT_FOUND_IN_ROOT_DIR:"在项目根目录未找到 %s ",MINIPROGRAM_APP_JSON_NOT_FOUND:"根据 project.config.json 中 miniprogramRoot 指定的小程序目录 %s,在该目录下未找到 %s。\n如果你不理解 miniprogramRoot 字段的含义,请在 project.config.json 中将 miniprogramRoot 设为空字符串。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",PLUGIN_JSON_NOT_FOUND:"根据 project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,%s 未找到",PLUGIN_PATH_SAME_WITH_MINIPROGRAM:"project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,与小程序目录 %s 相同,请修改为不同目录",FILE_NOT_FOUND:"未找到 %s 文件,或者文件读取失败",JSON_PARSE_ERROR:"%s 文件解析错误",ENTRANCE_NOT_FOUND:"未找到入口页面\napp.json 中定义的 pages : %s",JSON_PAGE_FILE_NOT_EXISTS:'未找到 %s 中的定义的 %s "%s" 对应的 %s 文件',SHOULD_NOT_IN:"%s 不应该在 %s 中",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS_TITLE:"app.json 或自定义编译条件错误",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS:"app.json 中未定义自定义编译中指定的启动页面 %s",JSON_ENTRY_PAGE_PATH_NOT_FOUND:"未在 %s 中找到 %s 定义的入口页面",JSON_TABBAR_AT_LEAST:'["tabBar"]["list"] 需至少包含 %s 项',JSON_TABBAR_AT_MOST:'["tabBar"]["list"] 不能超过 %s 项',JSON_TABBAR_PATH_EMPTY:'["tabBar"]["list"][%s]["pagePath"] 不能为空',JSON_TABBAR_PATH_SAME_WITH_OTHER:'["tabBar"]["list"][%s]["pagePath"] 和 ["tabBar"]["list"][%s]["pagePath"] 相同',JSON_TABBAR_ICON_MAX_SIZE:'["tabBar"]["list"][%s]["%s"] 大小超过 %skb',JSON_TABBAR_ICON_EXT:'["tabBar"]["list"][%s]["%s"] 文件格式错误,仅支持 %s 格式',JSON_CONTENT_SHOULD_NOT_BE:"%s 不能为 %s",JSON_RESOLVE_ALIAS_ILLEGAL:'resolveAlias 配置中 %s 或 %s 不合法,包含连续的 "//"',JSON_RESOLVE_ALIAS_INCLUDE_STAR:'resolveAlias 配置中 %s 或 %s 需要用 "/*" 结尾',JSON_RESOLVE_ALIAS_SHOULD_NOT_START_WITH:'resolveAlias 配置中 %s 不能以 "./" 开头',JSON_REQUIRED_PRIVATE_INFOS_MUTUALLY_EXCLUSIVE:"requiredPrivateInfos %s 与 %s 互斥",APP_JSON_SKYLINE_WINDOW_TIPS:"由于 skyline 页面的 navigationStyle 是 custom,app.json 中的 window 配置 navigationStyle、navigationBarTextStyle、navigationBarTitleText、navigationBarBackgroundColor 是不生效的",APP_JSON_SHOULD_SET_LAZYCODELOADING:'%s 中 "renderer" 设置为 "skyline",需在 app.json 添加 "lazyCodeLoading": "requiredComponents"',APP_JSON_SHOULD_SET_RENDEREROPTIONS:'%s 中 "renderer" 设置为 "skyline",需在 app.json 设置 "rendererOptions" 选项中 "skyline" 子选项的内容',JSON_SHOULD_SET_RENDEREROPTIONS:'%s 中 "renderer" 设置为 "skyline",需要同时设置 rendererOptions 选项以及 skyline 配置。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80',JSON_SHOULD_SET_RENDEREROPTIONS_SKYLINE:'%s 中 "renderer" 设置为 "skyline",需要同时设置 rendererOptions 字段中 skyline 配置。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80',JSON_SHOULD_SET_COMPONENTFRAMEWORK_SKYLINE:'%s 中 "renderer" 设置为 "skyline",需要同时设置 componentFramework 字段为 "glass-easel" 。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html',PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",页面配置 "disableScroll" 需设置为 true',PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",页面配置 "navigationStyle" 需设置为 "custom"',CONTENT_EXIST:"%s 已经存在",JSON_CONTENT_EXISTED:"%s 已经存在",JSON_CONTENT_NOT_FOUND:"%s 不存在",LACK_OF_FILE:"缺少文件 %s",JSON_PAGES_REPEAT:"%s 在 %s 中重复",JSON_CONTENT_REPEAT:"%s 不能同时在 %s 中声明",EXT_JSON_INVALID:'%s 不是 3rdMiniProgramAppid, ext.json 无法生效;查看文档: "%s"',GAME_EXT_JSON_INVALID:'%s 不是 3rdMiniGameAppid, ext.json 无法生效;"%s"',EXT_APPID_SHOULD_NOT_BE_EMPTY:"extAppid 不能为空",FILE_NOT_UTF8:"%s 文件不是 UTF-8 格式",INVALID:"无效的 %s",DIRECTORY:"目录",EXCEED_LIMIT:"%s 超过限制 %s",PLEASE_CHOOSE_PLUGIN_MODE:"如果正在开发插件,请选择插件模式",TRIPLE_NUMBER_DOT:"数字.数字.数字,每段数字不超过 3 位",PAGE_PATH:"页面路径",PLUGINS_SAME_ALIAS:"%s 和 %s 的别名相同",SAME_ITEM:'%s 和 %s 的 "%s" 相同',ALREADY_EXISTS:"已存在",SAME_KEY_PAGE_PUBLICCOMPONENTS:'["pages"] 与 ["publicComponents"] 不能存在相同的 key: %s',GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH:"开发版插件 %s 不能使用 %s 指定本地路径",GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT:'插件文件 "%s" 的 MD5: "%s" 与其 signature.json 所给定的值: "%s" 不匹配, 因此编译过程已经中断。\n这表示此文件的内容可能已经被修改。\n恢复此文件的原始内容可能可以解决此问题并移除此警告。\n\n要了解更多,可以参考文档。\n',FILE:"文件",PROCESSING:"处理中: %s",DONE:"完成: %s",UPLOAD:"上传",SUCCESS:"成功",PROJECT_TYPE_ERROR:"project.type 是 %s, 但 appid(%s) 是 %s",MINI_PROGRAM:"小程序",MINI_GAME:"小游戏",NOT_ALLOWED_REQUIRE_VAR:"不允许require变量",NOT_ALLOWED_REQUIRE_ASSIGN:"不允许将require函数赋值给其他变量",NOT_FOUND_NPM_ENTRY:"未找到npm包入口文件",NOT_FOUND_NODE_MODULES:"没有找到可以构建的 NPM 包,请确认需要参与构建的 npm 都在 `miniprogramRoot` 目录内,或配置 project.config.json 的 packNpmManually 和 packNpmRelationList 进行构建",JSON_ENTRANCE_DECLARE_PATH_ERR:'["entranceDeclare"]["locationMessage"]["path"] "%s" 需在 pages 数组或分包 pages 数组中',JSON_ENTRANCE_DECLARE_PATH_EMPTY:'["entranceDeclare"]["locationMessage"]["path"] 不能为空',COULD_NOT_USE_CODE_PROTECT:"无法使用代码保护功能",SUMMER_COMPILING_MODULE:"编译 %s",SUMMER_COMPILE_JSON:"编译 JSON 文件",SUMMER_OPTIMIZE_CODE:"优化代码",SUMMER_PACK_FILES:"打包资源文件",SUMMER_COMPRESS_PACK:"压缩代码包",SUMMER_SEAL_PACK:"封装代码包",SUMMER_APPEND_BABEL_HELPERS:"追加 %s helper 文件",SUMMER_COMPILE_PAGE_JSON:"编译 %s 个页面json文件",SUMMER_COMPILE_PLUGIN_PAGE_JSON:"编译插件 %s 个页面json文件",SUMMER_COMPILE:"编译 %s",SUMMER_COMPILE_MINIPROGRAM:"编译打包小程序",SUMMER_COMPILE_MINIGAME:"编译打包小游戏",SUMMER_COMPILE_PLUGIN:"编译打包插件",FILE_EXT_FORMAT_ERROR:"%s 文件格式错误,仅支持 %s 格式",THEME_JSON_VALUE_SHOULD_BE:"%s 作为 %s 的值,需要为 %s",JSON_VARIABLE_VALUE_NOT_FOUND:"%s 定义的变量未在 %s 中找到对应的值",THEME_JSON_SHOULD_EXIST:"%s 使用了变量 %s,需要使用 %s 来指定 theme.json 的路径",PARSEERR_ENTRANCE_PAGE_ERROR:"未找到入口页面\napp.json 中定义的 pages : %s",PARSEERR_ENTRANCE_FILE_ERROR:"未找到入口 %s 文件,或者文件读取失败,请检查后重新编译。",COMPILE_WXML_ERROR_CONSOLE:"编译 .wxml 文件错误,错误信息如上,可在控制台查看更详细信息",COMPILE_WXSS_ERROR_CONSOLE:"编译 .wxss 文件错误,错误信息如上,可在控制台查看更详细信息",RELATED_NODE_MODULES_NOT_FOUND:"%s 对应的 node_modules 不存在,请在 %s 执行 `npm install`",PACKAGE_JSON_PATH_IN_VALID:'packageJsonPath 需以 `package.json` 结尾, "%s" 是不合法的',ACCOUNT_CARD_PACKAPGE_IN_VALID:'没有找到以 ["AccountCardPackage"]["root"] 的值作为路径定义的独立分包,请检查 ["subPackages"] 配置并进行修改。',UNUSE_FILE_LIST:"无依赖文件列表:%s",PACK_OPTIONS_IGNORE_LIST:"被 project.config.json packOptions.ignore 忽略的文件列表:%s",PARTIAL_COMPILE_IGNORE_LIST:"被局部编译所忽略的文件列表:%s",UNKNOWN_REASON_INGORE_LIST:"被 %s 忽略的文件列表: %s",LARGEFILE_WARNING:"%s 文件超过最大大小: %sKB,编译进程不处理"},formatConfig={};for(const[_,E]of Object.entries(config))formatConfig[_]=new fomatable_string_1.FormatableString(E);exports.default=formatConfig;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fomatable_string_1=require("./fomatable_string"),config={GENERATE_LOCAL_SIGNATURE_FAIL:"生成本地签名失败。通常是key文件编码或者内容有误。错误详情: %s",PARAM_ERROR:'方法:"%s" 缺少参数:"%s"',SHOULD_NOT_BE_EMPTY:"%s 不能为空",JSON_CONTENT_SHOULD_BE:"%s 字段需为 %s",SHOULD_AT_LEAST_ONE_ITEM:"%s 需至少存在一项",SHOULD_MATCH:"%s 需与 %s 匹配",SHOULD_EQUAL:"%s 需等于 %s",EXT_SHOULD_BE_ERROR:'%s 的拓展名需为 "%s"',OR:"或",CORRESPONDING_FILE_NOT_FOUND:"未找到 %s 对应的 %s 文件",JSON_SHOULD_NOT_START_WITH:"%s 不应该以 '%s' 开头",JSON_SHOULD_NOT_CONTAIN:"%s 不应该包含 %s",NOT_FOUND:"%s 未找到",COMPONENT_NOT_FOUND:"%s,在 %s 路径下未找到组件",NOT_FOUND_IN_ROOT_DIR:"在项目根目录未找到 %s ",MINIPROGRAM_APP_JSON_NOT_FOUND:"根据 project.config.json 中 miniprogramRoot 指定的小程序目录 %s,在该目录下未找到 %s。\n如果你不理解 miniprogramRoot 字段的含义,请在 project.config.json 中将 miniprogramRoot 设为空字符串。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",PLUGIN_JSON_NOT_FOUND:"根据 project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,%s 未找到",PLUGIN_PATH_SAME_WITH_MINIPROGRAM:"project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,与小程序目录 %s 相同,请修改为不同目录",FILE_NOT_FOUND:"未找到 %s 文件,或者文件读取失败",JSON_PARSE_ERROR:"%s 文件解析错误",ENTRANCE_NOT_FOUND:"未找到入口页面\napp.json 中定义的 pages : %s",JSON_PAGE_FILE_NOT_EXISTS:'未找到 %s 中的定义的 %s "%s" 对应的 %s 文件',SHOULD_NOT_IN:"%s 不应该在 %s 中",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS_TITLE:"app.json 或自定义编译条件错误",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS:"app.json 中未定义自定义编译中指定的启动页面 %s",JSON_ENTRY_PAGE_PATH_NOT_FOUND:"未在 %s 中找到 %s 定义的入口页面",JSON_TABBAR_AT_LEAST:'["tabBar"]["list"] 需至少包含 %s 项',JSON_TABBAR_AT_MOST:'["tabBar"]["list"] 不能超过 %s 项',JSON_TABBAR_PATH_EMPTY:'["tabBar"]["list"][%s]["pagePath"] 不能为空',JSON_TABBAR_PATH_SAME_WITH_OTHER:'["tabBar"]["list"][%s]["pagePath"] 和 ["tabBar"]["list"][%s]["pagePath"] 相同',JSON_TABBAR_ICON_MAX_SIZE:'["tabBar"]["list"][%s]["%s"] 大小超过 %skb',JSON_TABBAR_ICON_EXT:'["tabBar"]["list"][%s]["%s"] 文件格式错误,仅支持 %s 格式',JSON_CONTENT_SHOULD_NOT_BE:"%s 不能为 %s",JSON_RESOLVE_ALIAS_ILLEGAL:'resolveAlias 配置中 %s 或 %s 不合法,包含连续的 "//"',JSON_RESOLVE_ALIAS_INCLUDE_STAR:'resolveAlias 配置中 %s 或 %s 需要用 "/*" 结尾',JSON_RESOLVE_ALIAS_SHOULD_NOT_START_WITH:'resolveAlias 配置中 %s 不能以 "./" 开头',JSON_REQUIRED_PRIVATE_INFOS_MUTUALLY_EXCLUSIVE:"requiredPrivateInfos %s 与 %s 互斥",APP_JSON_SKYLINE_WINDOW_TIPS:"由于 skyline 页面的 navigationStyle 是 custom,app.json 中的 window 配置 navigationStyle、navigationBarTextStyle、navigationBarTitleText、navigationBarBackgroundColor 是不生效的",APP_JSON_SHOULD_SET_LAZYCODELOADING:'%s 中 "renderer" 设置为 "skyline",需在 app.json 添加 "lazyCodeLoading": "requiredComponents"',APP_JSON_SHOULD_SET_RENDEREROPTIONS:'%s 中 "renderer" 设置为 "skyline",需在 app.json 设置 "rendererOptions" 选项中 "skyline" 子选项的内容',JSON_SHOULD_SET_RENDEREROPTIONS:'%s 中 "renderer" 设置为 "skyline",需要同时设置 rendererOptions 选项以及 skyline 配置。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80',JSON_SHOULD_SET_RENDEREROPTIONS_SKYLINE:'%s 中 "renderer" 设置为 "skyline",需要同时设置 rendererOptions 字段中 skyline 配置。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80',JSON_SHOULD_SET_COMPONENTFRAMEWORK_SKYLINE:'%s 中 "renderer" 设置为 "skyline",需要同时设置 componentFramework 字段为 "glass-easel" 。\n详见文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html',PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",页面配置 "disableScroll" 需设置为 true',PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",页面配置 "navigationStyle" 需设置为 "custom"',CONTENT_EXIST:"%s 已经存在",JSON_CONTENT_EXISTED:"%s 已经存在",JSON_CONTENT_NOT_FOUND:"%s 不存在",LACK_OF_FILE:"缺少文件 %s",JSON_PAGES_REPEAT:"%s 在 %s 中重复",JSON_CONTENT_REPEAT:"%s 不能同时在 %s 中声明",EXT_JSON_INVALID:'%s 不是 3rdMiniProgramAppid, ext.json 无法生效;查看文档: "%s"',GAME_EXT_JSON_INVALID:'%s 不是 3rdMiniGameAppid, ext.json 无法生效;"%s"',EXT_APPID_SHOULD_NOT_BE_EMPTY:"extAppid 不能为空",FILE_NOT_UTF8:"%s 文件不是 UTF-8 格式",INVALID:"无效的 %s",DIRECTORY:"目录",EXCEED_LIMIT:"%s 超过限制 %s",PLEASE_CHOOSE_PLUGIN_MODE:"如果正在开发插件,请选择插件模式",TRIPLE_NUMBER_DOT:"数字.数字.数字,每段数字不超过 3 位",PAGE_PATH:"页面路径",PLUGINS_SAME_ALIAS:"%s 和 %s 的别名相同",SAME_ITEM:'%s 和 %s 的 "%s" 相同',ALREADY_EXISTS:"已存在",SAME_KEY_PAGE_PUBLICCOMPONENTS:'["pages"] 与 ["publicComponents"] 不能存在相同的 key: %s',GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH:"开发版插件 %s 不能使用 %s 指定本地路径",GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT:'插件文件 "%s" 的 MD5: "%s" 与其 signature.json 所给定的值: "%s" 不匹配, 因此编译过程已经中断。\n这表示此文件的内容可能已经被修改。\n恢复此文件的原始内容可能可以解决此问题并移除此警告。\n\n要了解更多,可以参考文档。\n',FILE:"文件",PROCESSING:"处理中: %s",DONE:"完成: %s",UPLOAD:"上传",SUCCESS:"成功",PROJECT_TYPE_ERROR:"project.type 是 %s, 但 appid(%s) 是 %s",MINI_PROGRAM:"小程序",MINI_GAME:"小游戏",NOT_ALLOWED_REQUIRE_VAR:"不允许require变量",NOT_ALLOWED_REQUIRE_ASSIGN:"不允许将require函数赋值给其他变量",NOT_FOUND_NPM_ENTRY:"未找到npm包入口文件",NOT_FOUND_NODE_MODULES:"没有找到可以构建的 NPM 包,请确认需要参与构建的 npm 都在 `miniprogramRoot` 目录内,或配置 project.config.json 的 packNpmManually 和 packNpmRelationList 进行构建",JSON_ENTRANCE_DECLARE_PATH_ERR:'["entranceDeclare"]["locationMessage"]["path"] "%s" 需在 pages 数组或分包 pages 数组中',JSON_ENTRANCE_DECLARE_PATH_EMPTY:'["entranceDeclare"]["locationMessage"]["path"] 不能为空',COULD_NOT_USE_CODE_PROTECT:"无法使用代码保护功能",SUMMER_COMPILING_MODULE:"编译 %s",SUMMER_COMPILE_JSON:"编译 JSON 文件",SUMMER_OPTIMIZE_CODE:"优化代码",SUMMER_PACK_FILES:"打包资源文件",SUMMER_PACK_FILES_FINISH:"打包资源文件完成",SUMMER_COMPRESS_PACK:"压缩代码包",SUMMER_SEAL_PACK:"封装代码包",SUMMER_APPEND_BABEL_HELPERS:"追加 %s helper 文件",SUMMER_COMPILE_PAGE_JSON:"编译 %s 个页面json文件",SUMMER_COMPILE_PLUGIN_PAGE_JSON:"编译插件 %s 个页面json文件",SUMMER_COMPILE:"编译 %s",SUMMER_COMPILE_MINIPROGRAM:"编译打包小程序",SUMMER_COMPILE_MINIGAME:"编译打包小游戏",SUMMER_COMPILE_PLUGIN:"编译打包插件",FILE_EXT_FORMAT_ERROR:"%s 文件格式错误,仅支持 %s 格式",THEME_JSON_VALUE_SHOULD_BE:"%s 作为 %s 的值,需要为 %s",JSON_VARIABLE_VALUE_NOT_FOUND:"%s 定义的变量未在 %s 中找到对应的值",THEME_JSON_SHOULD_EXIST:"%s 使用了变量 %s,需要使用 %s 来指定 theme.json 的路径",PARSEERR_ENTRANCE_PAGE_ERROR:"未找到入口页面\napp.json 中定义的 pages : %s",PARSEERR_ENTRANCE_FILE_ERROR:"未找到入口 %s 文件,或者文件读取失败,请检查后重新编译。",COMPILE_WXML_ERROR_CONSOLE:"编译 .wxml 文件错误,错误信息如上,可在控制台查看更详细信息",COMPILE_WXSS_ERROR_CONSOLE:"编译 .wxss 文件错误,错误信息如上,可在控制台查看更详细信息",RELATED_NODE_MODULES_NOT_FOUND:"%s 对应的 node_modules 不存在,请在 %s 执行 `npm install`",PACKAGE_JSON_PATH_IN_VALID:'packageJsonPath 需以 `package.json` 结尾, "%s" 是不合法的',ACCOUNT_CARD_PACKAPGE_IN_VALID:'没有找到以 ["AccountCardPackage"]["root"] 的值作为路径定义的独立分包,请检查 ["subPackages"] 配置并进行修改。',UNUSE_FILE_LIST:"无依赖文件列表:%s",PACK_OPTIONS_IGNORE_LIST:"被 project.config.json packOptions.ignore 忽略的文件列表:%s",PARTIAL_COMPILE_IGNORE_LIST:"被局部编译所忽略的文件列表:%s",UNKNOWN_REASON_INGORE_LIST:"被 %s 忽略的文件列表: %s",LARGEFILE_WARNING:"%s 文件超过最大大小: %sKB,编译进程不处理"},formatConfig={};for(const[_,E]of Object.entries(config))formatConfig[_]=new fomatable_string_1.FormatableString(E);exports.default=formatConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const miniappJson_1=require("./miniappJson"),path=require("path"),fse=require("fs-extra"),androidI18NInfoRelativePath="miniapp/android/i18nInfo.json",iOSCloudI18NInfoRelativePath="miniapp/ios/i18nInfo.json",androidRelativePath="miniapp/android",iOSRelativePath="miniapp/ios";class MiniAppI18N{constructor(){this.i18nInfo={},this.ensureObject=i=>"[object Object]"===Object.prototype.toString.call(i)?i:{},this.createI18NInfo=i=>{const e=(0,miniappJson_1.getMiniappJson)(i).i18nFilePath;if(!e)return this.i18nInfo={},this.writeI18NInfoToAndroidFileSystem(i),void this.writeI18NInfoToiOSFileSystem(i);const n=path.resolve(i,e);fse.ensureDirSync(n);const t=fse.readdirSync(n,{withFileTypes:!0}).filter(i=>!i.isDirectory()&&i.name.endsWith(".json")),o={};t.forEach(i=>{const e=i.name.replace(".json",""),t=fse.readJsonSync(path.join(n,i.name));o[e]={ios:Object.assign(Object.assign({},this.ensureObject(null==t?void 0:t.common)),this.ensureObject(null==t?void 0:t.ios)),android:Object.assign(Object.assign({},this.ensureObject(null==t?void 0:t.common)),this.ensureObject(null==t?void 0:t.android))}}),this.i18nInfo=o,this.writeI18NInfoToAndroidFileSystem(i),this.writeI18NInfoToiOSFileSystem(i)},this.writeI18NInfoToAndroidFileSystem=i=>{i&&(fse.ensureDirSync(path.join(i,"miniapp/android")),fse.writeJSONSync(path.join(i,androidI18NInfoRelativePath),this.i18nInfo))},this.writeI18NInfoToiOSFileSystem=i=>{i&&(fse.ensureDirSync(path.join(i,"miniapp/ios")),fse.writeJSONSync(path.join(i,"miniapp/ios/i18nInfo.json"),this.i18nInfo))}}}exports.default=new MiniAppI18N;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.signAndInstallOrExport=exports.doCertificateSignAndInstallOrExport=exports.doAppleIdSignAndInstallOrExport=exports.clearCache=exports.getIOSDevices=exports.getMiniAppBuilderFromRemoteCore=exports.miniappSinTypes=exports.DEFAULT_BUNDLE_ID=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),singletontask_1=require("./singletontask"),zip_1=require("./zip"),cp_1=require("./cp"),tools_1=require("./tools"),progressRecorder_1=require("./progressRecorder"),download_1=require("./download"),glob_1=tslib_1.__importDefault(require("glob")),miniappJson_1=require("./miniappJson"),generateIpa_1=require("./generateIpa"),path=require("path"),os=require("os"),fse=require("fs-extra"),querystring=require("querystring");exports.DEFAULT_BUNDLE_ID="com.tencent.devtoolssaaademo.db";const isMac="darwin"===process.platform,remoteUrlRoot="http://dldir1.qq.com/WechatWebDev/donut/miniapp-builder/";exports.miniappSinTypes={appleId:{type:"appleId"},certificate:{type:"certificate"}};const majorVersion="1",signAndInstallTask={};async function getMiniAppBuilderVersion(e="cli"){try{"dev"!==e&&"cli"!==e&&(e="release-1");const i=`${remoteUrlRoot}versionMap/${e}.json`,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.signAndInstallOrExport=exports.doCertificateSignAndInstallOrExport=exports.doAppleIdSignAndInstallOrExport=exports.clearCache=exports.getIOSDevices=exports.getMiniAppBuilderFromRemoteCore=exports.miniappSinTypes=exports.DEFAULT_BUNDLE_ID=void 0;const tslib_1=require("tslib"),child_process=tslib_1.__importStar(require("child_process")),lodash_1=tslib_1.__importDefault(require("lodash")),singletontask_1=require("./singletontask"),zip_1=require("./zip"),cp_1=require("./cp"),tools_1=require("./tools"),progressRecorder_1=require("./progressRecorder"),download_1=require("./download"),request_1=require("./request"),glob_1=tslib_1.__importDefault(require("glob")),miniappJson_1=require("./miniappJson"),generateIpa_1=require("./generateIpa"),path=require("path"),os=require("os"),fse=require("fs-extra"),querystring=require("querystring");exports.DEFAULT_BUNDLE_ID="com.tencent.devtoolssaaademo.db";const isMac="darwin"===process.platform,remoteUrlRoot="http://dldir1.qq.com/WechatWebDev/donut/miniapp-builder/";exports.miniappSinTypes={appleId:{type:"appleId"},certificate:{type:"certificate"}};const majorVersion="1",signAndInstallTask={};async function getMiniAppBuilderVersion(e="cli"){try{"dev"!==e&&"cli"!==e&&(e="release-1");const i=`${remoteUrlRoot}versionMap/${e}.json`,n=path.join(os.tmpdir(),"miniapp-builder-version.json");fse.existsSync(n)&&fse.removeSync(n),await(0,download_1.downloadLargeFile)(i,n);const t=fse.readJSONSync(n);return isMac?t.mac:t.win}catch(e){throw new Error("getMiniAppBuilderVersion fail: "+e.message)}}async function downloadMiniAppBuilder(e,i,n){const t=`${remoteUrlRoot}${isMac?"mac":"win"}/miniapp-builder-${e}.zip`,r=path.join(os.tmpdir(),"miniapp-builder.zip");fse.existsSync(r)&&fse.removeSync(r),null==n||n.progress("Downloading the miniapp-builder..."),await(0,download_1.downloadLargeFile)(t,r),await(0,zip_1.unzip)(r,i)}async function getMiniAppBuilderFromRemoteCore(e,i,n){const{miniappDirPath:t=path.join(__dirname,"../vendor"),devtoolsVersion:r="cli",recorder:s}=e,o=await getMiniAppBuilderVersion(r);let a="";const p=path.join(t,"miniapp-builder");if(a="win32"===process.platform?(0,tools_1.unifyPath)(path.join(p,o,i)):(0,tools_1.unifyPath)(path.join(p,o,n)),!fse.existsSync(a)){fse.ensureDirSync(p),fse.emptyDirSync(p);const e=path.dirname(a);fse.ensureDirSync(e),await downloadMiniAppBuilder(o,e,s);glob_1.default.sync("*",{nodir:!0,cwd:e}).forEach(i=>{fse.chmodSync(path.join(e,i),"777")})}return{builderPath:a,exe:path.basename(a),cwd:path.dirname(a)}}async function getMiniAppBuilder(e){return await getMiniAppBuilderFromRemoteCore(e,"MiniappBuilder.exe","MiniAppBuilder")}async function getIOSDevices(e){const{builderPath:i}=await getMiniAppBuilder(e),n=child_process.execSync(`"${i}" --action getDevices`,{}).toString().split("\n"),t=[];return n.forEach(e=>{if(e.trim()){const i=e.split("|");t.push({type:"device",name:(i[1]||"").trim(),version:(i[2]||"").trim(),udid:(i[3]||"").trim()})}}),t}async function clearCache(e){const{builderPath:i}=await getMiniAppBuilder(e),n=(0,miniappJson_1.getTargetMiniprogramArg)(e.projectPath,"appid");child_process.execSync(`"${i}" --appid ${n} --action clear --type ${e.type}`,{})}async function doAppleIdSignAndInstallOrExport(e,i,n){const{newRecorder:t,uniqueId:r}=genIOSFilterRecorder(n,i.recorder),{exe:s,cwd:o,builderPath:a}=await getMiniAppBuilder(i),p=(0,tools_1.unifyPath)(e.ipaPath),l=["--appid",(0,miniappJson_1.getTargetMiniprogramArg)(e.projectPath,"appid"),"--action","sign","--ipa",p,"--type","appleId"];if(e.appleId&&l.push("-ai",e.appleId),e.password&&l.push("-p",e.password),e.entitlements&&l.push("--entitlements",querystring.stringify(e.entitlements)),e.install&&(isMac?l.push("--install"):l.push("--install","true")),e.deviceId&&l.push("--deviceId",e.deviceId),e.output&&l.push("--output",e.output),e.bundleId){const i=e.bundleId===exports.DEFAULT_BUNDLE_ID?"auto":e.bundleId;l.push("--bundleId",i)}try{return signAndInstallTask[p]||(signAndInstallTask[p]=isMac?new singletontask_1.SingletonTask(cp_1.spawnSync.bind(null,a,l,{},t)):new singletontask_1.SingletonTask(cp_1.spawnSync.bind(null,s,l,{cwd:o},t))),await signAndInstallTask[p].getResult(!0),{success:!0}}catch(e){return{success:!1,uniqueId:r}}finally{delete signAndInstallTask[p]}}async function doCertificateSignAndInstallOrExport(e,i,n){const{newRecorder:t,uniqueId:r}=genIOSFilterRecorder(n,i.recorder),{exe:s,cwd:o,builderPath:a}=await getMiniAppBuilder(i),p=(0,miniappJson_1.tryGetIOSMiniappJson)(e.projectPath),l=(0,miniappJson_1.iOSMiniAppJsonIsUsingTpush)(p),d=e.miniappCacheDirPath||"",c=(0,tools_1.unifyPath)(e.ipaPath),u=["--appid",(0,miniappJson_1.getTargetMiniprogramArg)(e.projectPath,"appid"),"--action","sign","--miniappCacheDir",d,"--ipa",c,"--type","certificate"];e.entitlements&&u.push("--entitlements",querystring.stringify(e.entitlements)),e.install&&(isMac?u.push("--install"):u.push("--install","true")),l&&(isMac?u.push("--extensionProfilePath"):u.push("--extension","true")),e.deviceId&&u.push("--deviceId",e.deviceId),e.output&&u.push("--output",e.output);try{return signAndInstallTask[c]||(signAndInstallTask[c]=isMac?new singletontask_1.SingletonTask(cp_1.spawnSync.bind(null,a,u,{},t)):new singletontask_1.SingletonTask(cp_1.spawnSync.bind(null,s,u,{cwd:o},t))),await signAndInstallTask[c].getResult(!0),{success:!0}}catch(e){return{success:!1,uniqueId:r}}finally{delete signAndInstallTask[c]}}async function signAndInstallOrExport(e,i,n,t,r,s){var o;const{recorder:a}=s,{install:p,deviceId:l,output:d,entitlements:c,bundleId:u}=r,g=await(0,generateIpa_1.generateIpa)(i,a),{body:h}=await(0,request_1.request)({url:progressRecorder_1.TransformTipsURL,method:"get",headers:{"content-type":"application/json"}}),I=JSON.parse(h).ios;try{null==a||a.progress("signing the app...");const{signType:i}=t;let r=null;if(r=i===exports.miniappSinTypes.appleId.type?await doAppleIdSignAndInstallOrExport({bundleId:u,projectPath:e,ipaPath:g,entitlements:c,install:p,output:d,deviceId:l},s,I):await doCertificateSignAndInstallOrExport({projectPath:e,ipaPath:g,miniappCacheDirPath:n,entitlements:c,install:p,output:d,deviceId:l},s,I),!r.success){let e="";throw r.uniqueId&&(null===(o=null===progressRecorder_1.IOSBuildMessageCache||void 0===progressRecorder_1.IOSBuildMessageCache?void 0:progressRecorder_1.IOSBuildMessageCache[r.uniqueId])||void 0===o?void 0:o.length)?(progressRecorder_1.IOSBuildMessageCache[r.uniqueId].forEach(e=>{null==a||a.message("error",e)}),e="IPA 构建失败,错误详细日志如上"):e="IPA 构建失败,请前往社区反馈[url:https://developers.weixin.qq.com/community/minihome/mixflow/2889188691586351105]",new Error(e)}}finally{fse.existsSync(g)&&fse.removeSync(g)}}function genUniqueId(){const e=lodash_1.default.uniqueId();return progressRecorder_1.IOSBuildMessageCache[e]?genUniqueId():e}function genIOSFilterRecorder(e,i){if(i){const n=genUniqueId();progressRecorder_1.IOSBuildMessageCache[n]=[];const t=new progressRecorder_1.Recorder((t,r,s)=>{const o=Object.keys(e).find(e=>s.includes(e));o&&progressRecorder_1.IOSBuildMessageCache[n].push(`[${e[o].code}] ${e[o].msg} 原信息:${s}`),i.message(r,s)});return t.run("!inner",()=>{}),{newRecorder:t,uniqueId:n}}return{newRecorder:void 0,uniqueId:void 0}}exports.getMiniAppBuilderFromRemoteCore=getMiniAppBuilderFromRemoteCore,exports.getIOSDevices=getIOSDevices,exports.clearCache=clearCache,exports.doAppleIdSignAndInstallOrExport=doAppleIdSignAndInstallOrExport,exports.doCertificateSignAndInstallOrExport=doCertificateSignAndInstallOrExport,exports.signAndInstallOrExport=signAndInstallOrExport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.iosPrivacyDescObj=exports.getTargetMiniprogramArg=exports.getMiniprogramRoot=exports.getRawAppJSON=exports.iOSAppJsonIsUsingIPadResizable=exports.iOSMiniAppJsonIsUsingGDT=exports.iOSMiniAppJsonIsUsingTpush=exports.writeMiniAppJson=exports.isNewMiniAppProject=exports.isMiniAppProject=exports.tryGetPluginMiniappJson=exports.tryGetIOSMiniappJson=exports.tryGetAndroidMiniappJson=exports.getMiniappJson=exports.getRawMiniappJson=exports.identityServiceConfigToMiniAppJSON=exports.PLATFORM=exports.miniAppPlatformMap=void 0;const tools_1=require("./tools"),each=require("licia/each"),safeSet=require("licia/safeSet"),path=require("path"),fse=require("fs-extra"),_=require("lodash");var PLATFORM;function identityServiceConfigToMiniAppJSON(i,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.autoCompleteIOSPrivacyDesc=exports.isAndroidNeedClientJsExtInfo=exports.iosPrivacyDescObj=exports.getTargetMiniprogramArg=exports.getMiniprogramRoot=exports.getRawAppJSON=exports.iOSAppJsonIsUsingIPadResizable=exports.iOSMiniAppJsonIsUsingGDT=exports.iOSMiniAppJsonIsUsingTpush=exports.writeMiniAppJson=exports.isNewMiniAppProject=exports.isMiniAppProject=exports.tryGetPluginMiniappJson=exports.tryGetIOSMiniappJson=exports.tryGetAndroidMiniappJson=exports.getMiniappJson=exports.getRawMiniappJson=exports.identityServiceConfigToMiniAppJSON=exports.PLATFORM=exports.miniAppPlatformMap=void 0;const tools_1=require("./tools"),tools_2=require("../utils/tools"),each=require("licia/each"),safeSet=require("licia/safeSet"),path=require("path"),fse=require("fs-extra"),_=require("lodash");var PLATFORM;function identityServiceConfigToMiniAppJSON(i,e={}){return e.identityServiceConfig={authorizeMiniprogramType:1,miniprogramLoginPath:i},e}function getRawMiniappJson(i){var e,o,n,t,s,p;i=(0,tools_1.unifyPath)(i);const r=path.posix.join(i,"project.miniapp.json");if(!fse.existsSync(r))return{};let a={};try{a=fse.readJsonSync(r)}catch(i){console.error(i)}return a.miniVersion&&"v1"!==a.miniVersion||((null===(e=a["mini-android"])||void 0===e?void 0:e.projectPath)&&!path.isAbsolute(null===(o=a["mini-android"])||void 0===o?void 0:o.projectPath)&&(a["mini-android"].projectPath=path.posix.join(i,null===(n=a["mini-android"])||void 0===n?void 0:n.projectPath)),(null===(t=a["mini-ios"])||void 0===t?void 0:t.projectPath)&&!path.isAbsolute(null===(s=a["mini-ios"])||void 0===s?void 0:s.projectPath)&&(a["mini-ios"].projectPath=path.posix.join(i,null===(p=a["mini-ios"])||void 0===p?void 0:p.projectPath))),a}function getMiniappJson(i,e="mini-weixin"){const o=Object.values(exports.miniAppPlatformMap),n=getRawMiniappJson(i),t=_.omit(n,o);return _.merge(t,n[e]||("mini-weixin"===e?n["mini-wechat"]:{}))}function tryGetAndroidMiniappJson(i){let e={};try{e=getMiniappJson(i,PLATFORM.ANDROID)}catch(i){}return e}function tryGetIOSMiniappJson(i){let e={};try{e=getMiniappJson(i,PLATFORM.IOS)}catch(i){}return e}function tryGetPluginMiniappJson(i){let e={};try{e=getMiniappJson(i,PLATFORM.PLUGIN)}catch(i){}return e}function isMiniAppProject(i){const e=path.posix.join(i,"project.miniapp.json");return"multiPlatform"===fse.readJsonSync(e).projectArchitecture}function isNewMiniAppProject(i){const e=getRawMiniappJson(i);return isMiniAppProject(i)&&"v2"===e.miniVersion}function writeMiniAppJson(i,e){const o=path.posix.join(i,"project.miniapp.json");let n={};try{n=fse.readJsonSync(o)}catch(i){return}each(e,(i,e)=>{safeSet(n,e,i)}),fse.writeJSONSync(o,n,{spaces:2})}function iOSMiniAppJsonIsUsingTpush(i){const e=i.tpush&&!0===i.tpush.useExtendedLib_WeAppTPNS&&"number"==typeof i.tpush.accessID&&"string"==typeof i.tpush.accessKey&&"string"==typeof i.tpush.serviceBundleId;if(e&&(0,tools_1.compareVersion)(i.sdkVersion,"1.0.7")<=0)throw new Error(`can not use TPNS(消息推送) extendsdk in sdk version ${i.sdkVersion}, TPNS is supported in 1.0.8.`);return e}function iOSMiniAppJsonIsUsingGDT(i){const e=i.gdt&&!0===i.gdt.useExtendedLib_WeAppGDT&&"string"==typeof i.gdt.appid&&"string"==typeof i.gdt.splashAd_placementId;if(e&&(0,tools_1.compareVersion)(i.sdkVersion,"1.0.19")<=0)throw new Error(`can not use GDT(广告) extendsdk in sdk version ${i.sdkVersion}, GDT is supported in 1.0.20.`);return e}function iOSAppJsonIsUsingIPadResizable(i){return!0===getRawAppJSON(i).resizable}function getRawAppJSON(i){let e,o;const n=getMiniprogramRoot(i);e=n?path.posix.join(i,n,"app.json"):path.posix.join(i,"app.json");try{o=fse.readJsonSync(e)}catch(i){throw console.error(i),i}return o}function getMiniprogramRoot(i){const e=(0,tools_1.normalizePath)(path.posix.join(i,"project.config.json"));let o;try{o=fse.readJsonSync(e)}catch(i){throw console.error(i),i}return o.miniprogramRoot?o.miniprogramRoot:""}function getTargetMiniprogramArg(i,e){const o=(0,tools_1.normalizePath)(path.posix.join(i,"project.config.json"));let n;try{n=fse.readJsonSync(o)}catch(i){throw console.error(i),i}return n[e]||""}function isAndroidNeedClientJsExtInfo(i){const e=tryGetAndroidMiniappJson(i).sdkVersion;return(0,tools_2.compareSemVer)(e,"1.3.25")>0?1:0}exports.miniAppPlatformMap={"mini-android":"mini-android","mini-ios":"mini-ios","mini-weixin":"mini-weixin"},function(i){i.ANDROID="mini-android",i.IOS="mini-ios",i.PLUGIN="mini-plugin"}(PLATFORM=exports.PLATFORM||(exports.PLATFORM={})),exports.identityServiceConfigToMiniAppJSON=identityServiceConfigToMiniAppJSON,exports.getRawMiniappJson=getRawMiniappJson,exports.getMiniappJson=getMiniappJson,exports.tryGetAndroidMiniappJson=tryGetAndroidMiniappJson,exports.tryGetIOSMiniappJson=tryGetIOSMiniappJson,exports.tryGetPluginMiniappJson=tryGetPluginMiniappJson,exports.isMiniAppProject=isMiniAppProject,exports.isNewMiniAppProject=isNewMiniAppProject,exports.writeMiniAppJson=writeMiniAppJson,exports.iOSMiniAppJsonIsUsingTpush=iOSMiniAppJsonIsUsingTpush,exports.iOSMiniAppJsonIsUsingGDT=iOSMiniAppJsonIsUsingGDT,exports.iOSAppJsonIsUsingIPadResizable=iOSAppJsonIsUsingIPadResizable,exports.getRawAppJSON=getRawAppJSON,exports.getMiniprogramRoot=getMiniprogramRoot,exports.getTargetMiniprogramArg=getTargetMiniprogramArg,exports.iosPrivacyDescObj={NSPhotoLibraryUsageDescription:"当前应用程序需要访问用户的相册,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSCameraUsageDescription:"当前应用程序需要访问用户的相机,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSMicrophoneUsageDescription:"当前应用程序需要访问用户的麦克风,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSLocationWhenInUseUsageDescription:"当前应用程序需要在使用时访问用户的位置,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSLocationAlwaysUsageDescription:"当前应用程序需要始终访问用户的位置,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSLocationAlwaysAndWhenInUseUsageDescription:"当前应用程序需要始终和在使用时访问用户的位置,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSContactsUsageDescription:"当前应用程序需要访问用户的联系人,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSCalendarsUsageDescription:"当前应用程序需要访问用户的日历,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSRemindersUsageDescription:"当前应用程序需要访问用户的提醒事项,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSHealthShareUsageDescription:"",NSHealthUpdateUsageDescription:"",NSBluetoothPeripheralUsageDescription:"当前应用程序需要访问用户的蓝牙,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSBluetoothAlwaysUsageDescription:"当前应用程序需要始终访问用户的蓝牙,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSMotionUsageDescription:"",NSHomeKitUsageDescription:"",NSSiriUsageDescription:"",NSSpeechRecognitionUsageDescription:"当前应用程序需要使用语音识别,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSVideoSubscriberAccountUsageDescription:"",NSAppleMusicUsageDescription:"",NSFaceIDUsageDescription:"",NSNFCReaderUsageDescription:"",NSUserTrackingUsageDescription:"",NSLocalNetworkUsageDescription:"当前应用程序需要访问本地网络,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NSSystemAdministrationUsageDescription:"当前应用程序需要进行系统管理操作,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可」",NFCReaderUsageDescription:"",NSHealthClinicalHealthRecordsShareUsageDescription:"",NSPhotoLibraryAddUsageDescription:"应用程序在请求访问照片库,如需修改描述请前往「project.miniapp.json - 隐私信息访问许可描述」修改,并且关闭「自动使用默认描述补全默认隐私信息访问许可"},exports.isAndroidNeedClientJsExtInfo=isAndroidNeedClientJsExtInfo;const autoCompleteIOSPrivacyDesc=i=>{const e=getRawMiniappJson(i);return!(!e["mini-ios"]||!e["mini-ios"].enableAutoCompletePrivacyDesc&&void 0!==e["mini-ios"].enableAutoCompletePrivacyDesc)&&(e["mini-ios"].privateDescriptions||(e["mini-ios"].privateDescriptions={}),Object.keys(exports.iosPrivacyDescObj).forEach(i=>{!e["mini-ios"].privateDescriptions[i]&&exports.iosPrivacyDescObj[i]&&(e["mini-ios"].privateDescriptions[i]=exports.iosPrivacyDescObj[i])}),writeMiniAppJson(i,e),!0)};exports.autoCompleteIOSPrivacyDesc=autoCompleteIOSPrivacyDesc;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function pad(e,s=2){return e>10**s?String(e):`${new Array(s).join("0")}${e}`.slice(-s)}function getPrintTime(){const e=new Date;return`${String(e.getFullYear())}-${pad(e.getMonth()+1)}-${pad(e.getDate())} ${pad(e.getHours())}:${pad(e.getMinutes())}:${pad(e.getSeconds())}.${pad(e.getMilliseconds(),3)}`}Object.defineProperty(exports,"__esModule",{value:!0}),exports.silentRecorder=exports.Recorder=exports.getPrintTime=void 0,exports.getPrintTime=getPrintTime;let taskId=5e7;function genTaskId(){return taskId++}class Recorder{message(e,s){const t=genTaskId();this.sendProgress(t,e,s)}constructor(e){this.sendProgress=e}start(e){const s=genTaskId(),t=e.startsWith("!");t||this.sendProgress(s,"doing",e);const r=(e,r)=>{e?t||this.sendProgress(s,"
|
|
1
|
+
"use strict";function pad(e,s=2){return e>10**s?String(e):`${new Array(s).join("0")}${e}`.slice(-s)}function getPrintTime(){const e=new Date;return`${String(e.getFullYear())}-${pad(e.getMonth()+1)}-${pad(e.getDate())} ${pad(e.getHours())}:${pad(e.getMinutes())}:${pad(e.getSeconds())}.${pad(e.getMilliseconds(),3)}`}Object.defineProperty(exports,"__esModule",{value:!0}),exports.IOSBuildMessageCache=exports.TransformTipsURL=exports.silentRecorder=exports.Recorder=exports.getPrintTime=void 0,exports.getPrintTime=getPrintTime;let taskId=5e7;function genTaskId(){return taskId++}class Recorder{message(e,s){const t=genTaskId();this.sendProgress(t,e,s)}constructor(e){this.sendProgress=e}start(e){const s=genTaskId(),t=e.startsWith("!");t||this.sendProgress(s,"doing",e);const r=(e,r)=>{e?t||this.sendProgress(s,"error",e.message):t||this.sendProgress(s,"success",null==r?void 0:r.message)};return r.id=s,this.progress=e=>{this.sendProgress(s,"doing",e)},this.message=(e,t)=>{this.sendProgress(s,e,t)},r}async run(e,s){const t=this.start(e);let r=null,n=null;try{return n=await s(),n}catch(e){throw r=e,e}finally{t(r,n)}}}exports.Recorder=Recorder,exports.silentRecorder=new Recorder(()=>{}),exports.TransformTipsURL="https://web-v2-1g8g0y2x3197301a-1304825656.tcloudbaseapp.com/important_miniapp/MiniAppBuildTips.json?sign=0f07b014a760d699cf2c8a9bb84845bf&t=1724920547",exports.IOSBuildMessageCache={};
|
package/dist/utils/report.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wrapReport=void 0;const config_1=require("../config/config"),request_1=require("./request"),os=require("os");async function reportMMData(e){(0,request_1.request)({url:"https://servicewechat.com/wxa-dev-logic/clientreportv2",body:JSON.stringify({report_info_list:[e]}),method:"post"})}const compileTypeMap={miniProgram:1,miniProgramPlugin:2,miniGame:3,miniGamePlugin:4},actionMap={preview:1,upload:2,npm:3,cloud:4,getDevSourceMap:5};function parseVersionToInt(e){const t=e.split(".");return parseInt(t[0]+t[1]+t[2],10)}function getMinifyXStatus(e,t){return"boolean"==typeof t?t?1:0:e?1:0}function reportAction(e,t,o,i,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wrapReport=exports.reportAction=void 0;const config_1=require("../config/config"),request_1=require("./request"),os=require("os");async function reportMMData(e){(0,request_1.request)({url:"https://servicewechat.com/wxa-dev-logic/clientreportv2",body:JSON.stringify({report_info_list:[e]}),method:"post"})}const compileTypeMap={miniProgram:1,miniProgramPlugin:2,miniGame:3,miniGamePlugin:4},actionMap={preview:1,upload:2,npm:3,cloud:4,getDevSourceMap:5,buildApk:6,buildIpa:7};function parseVersionToInt(e){const t=e.split(".");return parseInt(t[0]+t[1]+t[2],10)}function getMinifyXStatus(e,t){return"boolean"==typeof t?t?1:0:e?1:0}function reportAction(e,t,o,r,i,n={}){const p=i.appid,s=i.type,a=parseVersionToInt(config_1.CI_VERSION),c="win32"===process.platform?1:"darwin"===process.platform?2:3,u=os.cpus().length,l=Math.floor(os.totalmem()/1024/1024),f=actionMap[e];o=o.replace(/,/g,";").slice(0,512);reportMMData({log_id:22365,version:0,user_log_list:`0,${p},${a},${c},${u},${l},${compileTypeMap[s]},${f},${t},${o},${r},0,${n.es6?1:0},${n.es7?1:0},${getMinifyXStatus(n.minify,n.minifyJS)},${getMinifyXStatus(n.minify,n.minifyWXML)},${getMinifyXStatus(n.minify,n.minifyWXSS)},${n.codeProtect?1:0},${n.autoPrefixWXSS?1:0}`})}function wrapReport(e,t){return async function(o){const r=o.project;let i={};"upload"!==e&&"preview"!==e||(i=o.setting||{});let n=null;const p=Date.now();try{return await t.apply(null,arguments)}catch(e){throw n=e,e}finally{try{const t=Date.now()-p,o=n?n.code?n.code:-1:0,s=n&&n.message?n.message:"";reportAction(e,o,s,t,r,i)}catch(e){console.info(e)}}}}exports.reportAction=reportAction,exports.wrapReport=wrapReport;
|
package/dist/utils/request.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initGlobalProxy=exports.getCiProxy=exports.setCiProxy=exports.request=void 0;const tslib_1=require("tslib"),log=tslib_1.__importStar(require("./log")),interruptibletask_1=require("./interruptibletask"),req=require("request"),getGlobalProxySettings=require("get-proxy");class RequestTask extends interruptibletask_1.InterruptibleTask{constructor(e){super(e),this._alreadyRefresh=!1,this._promise.catch(e=>{log.error(`${this._opt.url} ${e}`)})}static async formateQuery(e){const t=Object.assign({},e),{needRandom:r}=t;delete t.needRandom;const s=(t.url||"").split("?"),o=s[0],i=[];return-1!==r&&i.push("_r="+Math.random()),s[1]&&i.push(s[1]),t.url=`${o}?${i.join("&")}`,t}abort(){this._aborted||(this._aborted=!0,this._realRequest&&"function"==typeof this._realRequest.abort&&this._realRequest.abort())}async request(){if(this._aborted)throw interruptibletask_1.AbortEvent;const e=await RequestTask.formateQuery(this._opt);return RequestTask.requestProxy&&(e.proxy=RequestTask.requestProxy),new Promise((t,r)=>{this._realRequest=req(e,(e,s,o)=>{e?r(e):t({resp:s,body:o})}),this._realRequest.on("abort",()=>{r(interruptibletask_1.AbortEvent)})})}async run(e){return this._opt=Object.assign({},e),await this.request()}}function request(e){return new RequestTask(e)}function setCiProxy(e){RequestTask.requestProxy=e,log.info("miniprogram-ci is using proxy: "+e)}function getCiProxy(){return RequestTask.requestProxy}function initGlobalProxy(){const e=getCiProxy(),t=`${process.env.no_proxy||""},${process.env.NO_PROXY||""}`.split(",").map(e=>e.trim());if(!e&&!t.includes("servicewechat.com")){const e=getGlobalProxySettings();e&&setCiProxy(e)}}RequestTask.requestProxy="",exports.request=request,exports.setCiProxy=setCiProxy,exports.getCiProxy=getCiProxy,exports.initGlobalProxy=initGlobalProxy;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.simpleRequest=exports.initGlobalProxy=exports.getCiProxy=exports.setCiProxy=exports.request=void 0;const tslib_1=require("tslib"),log=tslib_1.__importStar(require("./log")),interruptibletask_1=require("./interruptibletask"),req=require("request"),getGlobalProxySettings=require("get-proxy");class RequestTask extends interruptibletask_1.InterruptibleTask{constructor(e){super(e),this._alreadyRefresh=!1,this._promise.catch(e=>{log.error(`${this._opt.url} ${e}`)})}static async formateQuery(e){const t=Object.assign({},e),{needRandom:r}=t;delete t.needRandom;const s=(t.url||"").split("?"),o=s[0],i=[];return-1!==r&&i.push("_r="+Math.random()),s[1]&&i.push(s[1]),t.url=`${o}?${i.join("&")}`,t}abort(){this._aborted||(this._aborted=!0,this._realRequest&&"function"==typeof this._realRequest.abort&&this._realRequest.abort())}async request(){if(this._aborted)throw interruptibletask_1.AbortEvent;const e=await RequestTask.formateQuery(this._opt);return RequestTask.requestProxy&&(e.proxy=RequestTask.requestProxy),new Promise((t,r)=>{this._realRequest=req(e,(e,s,o)=>{e?r(e):t({resp:s,body:o})}),this._realRequest.on("abort",()=>{r(interruptibletask_1.AbortEvent)})})}async run(e){return this._opt=Object.assign({},e),await this.request()}}function request(e){return new RequestTask(e)}function setCiProxy(e){RequestTask.requestProxy=e,log.info("miniprogram-ci is using proxy: "+e)}function getCiProxy(){return RequestTask.requestProxy}function initGlobalProxy(){const e=getCiProxy(),t=`${process.env.no_proxy||""},${process.env.NO_PROXY||""}`.split(",").map(e=>e.trim());if(!e&&!t.includes("servicewechat.com")){const e=getGlobalProxySettings();e&&setCiProxy(e)}}function simpleRequest(e,t){const r=getCiProxy();e.proxy=r,e.forever=!0;return req(e,(e,r,s)=>{"function"==typeof t&&t(e,r,s)})}RequestTask.requestProxy="",exports.request=request,exports.setCiProxy=setCiProxy,exports.getCiProxy=getCiProxy,exports.initGlobalProxy=initGlobalProxy,exports.simpleRequest=simpleRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubProcessProxy=void 0;const tslib_1=require("tslib"),child_process_1=require("child_process"),path_1=tslib_1.__importDefault(require("path")),customError_1=require("../customError"),singletontask_1=require("../singletontask"),debug_1=require("../debug");function performanceMark(s,e){}const PROCESS_READY_TIMEOUT=2e4;class SubProcessProxy{constructor(s,e,t,r,o=8891){this.project=s,this.entryPath=e,this.passData=t,this.initOptions=r,this.inspectPort=o,this.taskMap=new Map,this.taskId=0,this.init=async()=>{performanceMark("process init"),this.process=await this.forkProcess(),performanceMark("process init",!0)}}async ready(){var s;return this._checkReadyTask||(this._checkReadyTask=new singletontask_1.SingletonTask(this.init)),await(null===(s=this._checkReadyTask)||void 0===s?void 0:s.getResult(!0))}async sendProcessMessage(s){await this.ready(),this.process.send(s)}destroy(){var s;null===(s=this.process)||void 0===s||s.kill("SIGTERM"),this.process=void 0,this._checkReadyTask=void 0}async forkProcess(){const s=await this.project.serialize(),e={type:"init",data:{passData:this.passData,projectInfo:s,options:this.initOptions}};if((0,debug_1.shouldRunInMainProcess)()){const s=require("../../modules/corecompiler/processHandler");return await s.initHandler(e),{send:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubProcessProxy=void 0;const tslib_1=require("tslib"),child_process_1=require("child_process"),path_1=tslib_1.__importDefault(require("path")),customError_1=require("../customError"),singletontask_1=require("../singletontask"),debug_1=require("../debug");function performanceMark(s,e){}const PROCESS_READY_TIMEOUT=2e4;class SubProcessProxy{constructor(s,e,t,r,o=8891,i){this.project=s,this.entryPath=e,this.passData=t,this.initOptions=r,this.inspectPort=o,this.progressUpdate=i,this.taskMap=new Map,this.taskId=0,this.init=async()=>{performanceMark("process init"),this.process=await this.forkProcess(),performanceMark("process init",!0)},this.onMessage=s=>{var e,t;if(this._cpPromise&&("ready"===s.type&&(clearTimeout(this._cpPromise.timer),performanceMark("process ready"),null===(e=this._cpPromise)||void 0===e||e.resolve()),"noReady"===s.type&&(performanceMark("process not ready"),this._cpPromise.reject(new Error(s.error.message)))),"progress"===s.type){const e=this.taskMap.get(s.taskId);(null==e?void 0:e.progressUpdate)&&e.progressUpdate(s.id,s.status,s.message)}if("log"===s.type&&(null===(t=this.progressUpdate)||void 0===t||t.call(this,s.id||"",s.status,s.text)),"response"===s.type){const{id:e,data:t,error:r}=s;r?this.onResponse(e,void 0,r):this.onResponse(e,t,void 0)}}}async ready(){var s;return this._checkReadyTask||(this._checkReadyTask=new singletontask_1.SingletonTask(this.init)),await(null===(s=this._checkReadyTask)||void 0===s?void 0:s.getResult(!0))}async sendProcessMessage(s){await this.ready(),this.process.send(s)}destroy(){var s;null===(s=this.process)||void 0===s||s.kill("SIGTERM"),this.process=void 0,this._checkReadyTask=void 0}async forkProcess(){const s=await this.project.serialize(),e={type:"init",data:{passData:this.passData,projectInfo:s,options:this.initOptions}};if((0,debug_1.shouldRunInMainProcess)()){const s=require("../../modules/corecompiler/processHandler");return await s.initHandler(e),s.onMessage(this.onMessage),{send:e=>{(0,debug_1.shouldRunInMainProcess)()&&s.messageHandler(e)},kill:e=>(s.destroy(),!0)}}const t=this.entryPath,r={stdio:["pipe","pipe","pipe","ipc"],cwd:this.project.projectPath,env:Object.assign(Object.assign({},process.env),{cpprocessEnv:"childprocess",nativeProcess:"1",timeout:global.TEST_COMPILER_PROCESS_TIMEOUT})};(0,debug_1.shouldInspectCompiler)()&&(r.execArgv=["--inspect-brk="+this.inspectPort]);const o=process.__nwjs&&"wechatwebdevtools"===nw.App.manifest.appname;if(r.env.isDevtools=o,o){let s=path_1.default.join(path_1.default.dirname(process.execPath),"node");"darwin"!==process.platform&&(s+=".exe"),r.execPath=s}return performanceMark("fork process"),new Promise((s,i)=>{const a=(0,child_process_1.fork)(t,["--expose-gc"],r),n=setTimeout(()=>{this.destroy(),i(new Error("fork process timeout"))},2e4);return this._cpPromise={timer:n,resolve:()=>{s(a)},reject:i},a.stdout.setEncoding("utf8"),a.stdout.on("data",s=>{console.log("child process stdout: "+s)}),a.stderr.on("data",s=>{console.error("child process stderr: "+s)}),a.on("exit",(s,e)=>{this.process=void 0,this._checkReadyTask=void 0,o&&console.error(`child process exit: code(${s}), signal(${e})`),0!==s&&i(new Error(`native child process exit: code(${s}), signal(${e})`))}),a.on("message",this.onMessage),a.unref(),this.taskId+=1,a.send(e),a})}onResponse(s,e,t){const r=this.taskMap.get(s);this.taskMap.delete(s),r?t?(t=new customError_1.CustomError(t),r.reject(t)):r.resolve(e):console.error(`child process task: ${s} not found`)}async sendEvent(s,e){this.sendProcessMessage({type:"event",name:s,data:e})}async runTask(s,e,t){return new Promise((r,o)=>{const i={name:s,data:e,resolve:r,reject:o,progressUpdate:t};this.taskId+=1,this.taskMap.set(this.taskId,i),this.sendProcessMessage({type:"request",id:this.taskId,name:s,data:e})})}}exports.SubProcessProxy=SubProcessProxy;
|
package/dist/utils/taskstatus.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TaskStatus=void 0;const tslib_1=require("tslib"),locales_1=tslib_1.__importDefault(require("./locales/locales"));class TaskStatus{constructor(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TaskStatus=void 0;const tslib_1=require("tslib"),locales_1=tslib_1.__importDefault(require("./locales/locales"));class TaskStatus{constructor(s){this._status="doing",this._msg="",this._id=`${Math.random()}${Date.now()}`,this._msg=s}get id(){return this._id}get status(){return this._status}get message(){return this._msg}done(){this._status="success"}toString(){return"doing"===this._status?locales_1.default.config.PROCESSING.format(this._msg):"success"===this._status?locales_1.default.config.DONE.format(this._msg):this._msg}}exports.TaskStatus=TaskStatus;
|
package/dist/utils/tools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isMiniProgramCodeFile=exports.isCodeFile=exports.getSupportCodeFileExtSet=exports.getCompilerPlugins=exports.sourcePathToTargetPath=exports.checkIsUseCompilerPlugins=exports.isGameApp=exports.isLeftSubPathOfRight=exports.pathRelative=exports.compareVersion=exports.unifyPath=exports.getWorkersPath=exports.getPluginJson=exports.getAppJson=exports.getTerm=exports.checkIsIndependentSubpackage=exports.checkIsInSubPackage=exports.devtoolsError=exports.devtoolsLog=exports.devtoolsInfo=exports.formatTime=exports.formatNumber=exports.generateMD5=exports.formatSourceMap=exports.isFileIncluded=exports.isFileIgnored=exports.leading=exports.trailing=exports.escapeQuot=exports.mkdirSync=exports.rmSync=exports.isHexColor=exports.formatJSONParseErr=exports.bufferToUtf8String=exports.getType=exports.wrapCodeByEval=exports.escapeScript=exports.joinPath=exports.normalizePath=void 0;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),crypto_1=tslib_1.__importDefault(require("crypto")),babel_code_frame_1=tslib_1.__importDefault(require("babel-code-frame")),minimatch_1=tslib_1.__importDefault(require("minimatch")),startWith_1=tslib_1.__importDefault(require("licia/startWith")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),lodash_1=tslib_1.__importDefault(require("lodash")),define_1=require("../config/define"),types_1=require("../types"),jsonlint=require("./jsonlint");function normalizePath(e=""){const t=path_1.default.posix.normalize(e.replace(/\\/g,"/"));return!e.startsWith("//")&&!e.startsWith("\\\\")||t.startsWith("//")?t:"/"+t}function joinPath(e="",t=""){const r=path_1.default.posix.join(e,t);return!e.startsWith("//")&&!e.startsWith("\\\\")||r.startsWith("//")?r:"/"+r}function escapeScript(e){return e?e.replace(/<script/g,"<script").replace(/<\/script/g,"</script"):e}function wrapCodeByEval(e){return`;(window.eval || __global.__hackEval)('${e}')`}function getType(e){return Object.prototype.toString.call(e).toLowerCase().split(" ")[1].replace("]","")}exports.normalizePath=normalizePath,exports.joinPath=joinPath,exports.escapeScript=escapeScript,exports.wrapCodeByEval=wrapCodeByEval,exports.getType=getType;const bufferToUtf8String=e=>{const t=e.toString();if(0===Buffer.compare(Buffer.from(t,"utf8"),e))return t};function getErrLine(e,t,r,s){r=r>0?r:1;return`${s}\n${(0,babel_code_frame_1.default)(e,t,r)}`}exports.bufferToUtf8String=bufferToUtf8String;const formatJSONParseErr=e=>{const t=e.data||"";try{jsonlint.parser.parse(t)}catch(r){try{const s=`Expecting ${r.expected}, got ${r.token}`,o=getErrLine(t,r.line,r.loc.first_column,s);return`${e.filePath}\n${o}`}catch(e){}}return`${e.filePath}\n${e.error}`};exports.formatJSONParseErr=formatJSONParseErr;const isHexColor=e=>/^#[a-f\d]{3}$/i.test(e)||/^#[a-f\d]{4}$/i.test(e)||/^#[a-f\d]{6}$/i.test(e)||/^#[a-f\d]{8}$/i.test(e);function rmSync(e){try{if(e=path_1.default.resolve(e),!fs_1.default.existsSync(e))return;if(fs_1.default.lstatSync(e).isDirectory()){const t=fs_1.default.readdirSync(e);if(t.length>0)for(let r=0,s=t.length;r<s;r++)rmSync(path_1.default.posix.join(e,t[r]));fs_1.default.rmdirSync(e)}else fs_1.default.unlinkSync(e)}catch(e){}}function mkdirSync(e){if(e=path_1.default.resolve(e),fs_1.default.existsSync(e)){if(fs_1.default.lstatSync(e).isDirectory())return;fs_1.default.unlinkSync(e)}mkdirSync(path_1.default.dirname(e)),fs_1.default.mkdirSync(e)}function escapeQuot(e,t="`"){return e?"`"===t?e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$"):'"'===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/"/g,'\\"'):"'"===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/'/g,"\\'"):e:e}function trailing(e,t,r=!1){return r?e.endsWith(t)?e.slice(0,e.length-1):e:e.endsWith(t)?e:e+t}function leading(e,t,r=!1){return r?e.startsWith(t)?e.slice(1):e:e.startsWith(t)?e:t+e}exports.isHexColor=isHexColor,exports.rmSync=rmSync,exports.mkdirSync=mkdirSync,exports.escapeQuot=escapeQuot,exports.trailing=trailing,exports.leading=leading;const FFSPRGRulesFactory=function(e){let t=null,r=Object.create(null);return function(e,s){if(s.length<1)return!1;if(t===s){if(void 0!==r[e])return r[e]}else t=s,r=Object.create(null);const o=e.replace(/\\/g,"/").toLowerCase();if(!o)return!1;const i=o.slice(o.lastIndexOf("/")+1);let n=!1;for(const e of s){if(!e)continue;const t=e.value.toLowerCase();if("prefix"===e.type)n=i.startsWith(t);else if("suffix"===e.type)n=i.endsWith(t);else if("folder"===e.type)n=leading(o,"/").startsWith(trailing(leading(t,"/"),"/"));else if("file"===e.type)n=leading(o,"/")===leading(t,"/");else if("glob"===e.type)try{n=(0,minimatch_1.default)(o,t)||(0,minimatch_1.default)(leading(o,"/"),t)}catch(e){n=!1}else if("regexp"===e.type)try{n=new RegExp(t,"igm").test(o)||new RegExp(t,"igm").test(leading(o,"/"))}catch(e){n=!1}if(n)break}return r[e]=n,n}};function formatSourceMap(e){if(e){if("string"===getType(e))return e;try{return JSON.stringify(e)}catch(e){}}}function generateMD5(e){const t=crypto_1.default.createHash("md5");return t.update(e),t.digest("hex")}exports.isFileIgnored=FFSPRGRulesFactory(),exports.isFileIncluded=FFSPRGRulesFactory(),exports.formatSourceMap=formatSourceMap,exports.generateMD5=generateMD5;const formatNumber=e=>e>9?""+e:"0"+e;exports.formatNumber=formatNumber;const formatTime=e=>{const t=e.getFullYear(),r=e.getMonth()+1,s=e.getDate(),o=e.getHours(),i=e.getMinutes(),n=e.getSeconds();return`${[t,r,s].map(exports.formatNumber).join("/")} ${[o,i,n].map(exports.formatNumber).join(":")}`};exports.formatTime=formatTime;const isDevtools=process.__nwjs&&window.nw&&"wechatwebdevtools"===nw.App.manifest.appname;function devtoolsInfo(...e){isDevtools&&console.info(...e)}function devtoolsLog(...e){isDevtools&&console.log(...e)}function devtoolsError(...e){isDevtools&&console.error(...e)}function getPluginByAliasOrProvider(e,t){if(e){const r=e[t];if(r)return{alias:t,provider:r.provider,version:r.version};for(const r in e){const s=e[r];if(s.provider===t)return{alias:r,provider:s.provider,version:s.version}}}}function checkPluginByAliasOrProvider(e,t){let r;if(e.subPackages)for(const s of e.subPackages)if(r=getPluginByAliasOrProvider(s.plugins,t),r)return Object.assign(Object.assign({},r),{config:s});if(r=getPluginByAliasOrProvider(e.plugins,t),r)return r}function checkIsInSubPackage(e,t=""){let r;if((0,startWith_1.default)(t,"plugin://")){const r=t.match(/^plugin:\/\/([^/]*)\/(.*)/),s=null==r?void 0:r[1];if(!s)return;const o=checkPluginByAliasOrProvider(e,s);return null==o?void 0:o.config}if(e.subPackages)for(let s=0,o=e.subPackages.length;s<o;s++){const o=e.subPackages[s];if(t.startsWith(o.root)){r=o;break}}return r}function checkIsIndependentSubpackage(e,t){const r=checkIsInSubPackage(e,t);if(r&&!0===r.independent)return r}function getTerm(){if(!!!(null===window||void 0===window?void 0:window.nw))return require("terminal-kit").terminal}function getTargetPlatformJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=Object.values(define_1.PLATFORM),s=fs_extra_1.default.readJsonSync(e),o=lodash_1.default.omit(s,r);return lodash_1.default.merge(o,s[t]||("mini-weixin"===t?s["mini-wechat"]:{}))}function getAppJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=path_1.default.join(e.projectPath,e.miniprogramRoot||"","app.json");if(!fs_extra_1.default.existsSync(r))throw Error("no found app.json");return getTargetPlatformJson(r,t)}function getPluginJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=path_1.default.join(e.projectPath,e.pluginRoot||"","plugin.json");if(!fs_extra_1.default.existsSync(r))throw Error("no found plugin.json");return getTargetPlatformJson(r,t)}exports.devtoolsInfo=devtoolsInfo,exports.devtoolsLog=devtoolsLog,exports.devtoolsError=devtoolsError,exports.checkIsInSubPackage=checkIsInSubPackage,exports.checkIsIndependentSubpackage=checkIsIndependentSubpackage,exports.getTerm=getTerm,exports.getAppJson=getAppJson,exports.getPluginJson=getPluginJson;const getWorkersPath=e=>"string"==typeof e?e:e.path;exports.getWorkersPath=getWorkersPath;const unifyPath=e=>e.replace(/\\/g,"/");exports.unifyPath=unifyPath;const compareVersion=(e,t)=>{e=e.split("."),t=t.split(".");const r=Math.max(e.length,t.length);for(;e.length<r;)e.push("0");for(;t.length<r;)t.push("0");for(let s=0;s<r;s++){const r=parseInt(e[s],10),o=parseInt(t[s],10);if(r>o)return 1;if(r<o)return-1}return 0};exports.compareVersion=compareVersion;const pathRelative=(e,t)=>(e=path_1.default.posix.normalize(e.replace(/\\/g,"/")),t=path_1.default.posix.normalize(t.replace(/\\/g,"/")),path_1.default.posix.relative(e,t));function _isLeftSubPathOfRight(e,t){if(!t)return!0;if(t=normalizePath(t),e=normalizePath(e),!t.endsWith("/")){if(e===t)return!0;t+="/"}return!!e.startsWith(t)}function isLeftSubPathOfRight(e,t){void 0===e&&(console.error(new Error("The child string is undefined here, please check!!")),e="");const r=e.startsWith(t),s=_isLeftSubPathOfRight(e,t);return r!==s&&console.error(new Error(`${e} ${t} difference check sub path here! new result: ${s}`)),s}function isGameApp(e){return e.type===types_1.EProjectType.miniGame||e.type===types_1.EProjectType.miniGamePlugin}exports.pathRelative=pathRelative,exports.isLeftSubPathOfRight=isLeftSubPathOfRight,exports.isGameApp=isGameApp;const checkIsUseCompilerPlugins=()=>!0;exports.checkIsUseCompilerPlugins=checkIsUseCompilerPlugins;const sourceExt2TargetExtConf={".ts":".js",".less":".wxss",".sass":".wxss",".scss":".wxss"},sourcePathToTargetPath=e=>{const t=path_1.default.extname(e);return sourceExt2TargetExtConf[t]?e.substr(0,e.length-t.length)+sourceExt2TargetExtConf[t]:e};function getCompilerPlugins(e){const t=new Set;function r(e){"typescript"!==e&&"less"!==e&&"sass"!==e||t.add(e)}return e.setting.useCompilerPlugins&&e.setting.useCompilerPlugins.forEach(e=>{"string"==typeof e?r(e):Array.isArray(e)&&"string"==typeof e[0]&&void 0!==e[1]&&r(e[0])}),Array.from(t.values())}function getSupportCodeFileExtSet(e){const t=getCompilerPlugins(e),r=new Set([".js",".json",".wxss",".wxs",".wxml"]);return t.includes("typescript")&&r.add(".ts"),t.includes("less")&&r.add(".less"),t.includes("sass")&&(r.add(".sass"),r.add(".scss")),r}function isCodeFile(e){return/\.(json|wxml|wxss|js|wxs|ts|less|sass|scss)/.test(e)}function isMiniProgramCodeFile(e){return/\.(json|wxml|wxss|js|wxs)/.test(e)}exports.sourcePathToTargetPath=sourcePathToTargetPath,exports.getCompilerPlugins=getCompilerPlugins,exports.getSupportCodeFileExtSet=getSupportCodeFileExtSet,exports.isCodeFile=isCodeFile,exports.isMiniProgramCodeFile=isMiniProgramCodeFile;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compareSemVer=exports.isMiniProgramCodeFile=exports.isCodeFile=exports.getSupportCodeFileExtSet=exports.getCompilerPlugins=exports.sourcePathToTargetPath=exports.checkIsUseCompilerPlugins=exports.isGameApp=exports.isLeftSubPathOfRight=exports.pathRelative=exports.compareVersion=exports.unifyPath=exports.getWorkersPath=exports.getPluginJson=exports.getAppJson=exports.getTerm=exports.checkIsIndependentSubpackage=exports.checkIsInSubPackage=exports.devtoolsError=exports.devtoolsLog=exports.devtoolsInfo=exports.formatTime=exports.formatNumber=exports.generateMD5=exports.formatSourceMap=exports.isFileIncluded=exports.isFileIgnored=exports.leading=exports.trailing=exports.escapeQuot=exports.mkdirSync=exports.rmSync=exports.isHexColor=exports.formatJSONParseErr=exports.bufferToUtf8String=exports.getType=exports.wrapCodeByEval=exports.escapeScript=exports.joinPath=exports.normalizePath=void 0;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),crypto_1=tslib_1.__importDefault(require("crypto")),babel_code_frame_1=tslib_1.__importDefault(require("babel-code-frame")),minimatch_1=tslib_1.__importDefault(require("minimatch")),startWith_1=tslib_1.__importDefault(require("licia/startWith")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),lodash_1=tslib_1.__importDefault(require("lodash")),define_1=require("../config/define"),types_1=require("../types"),jsonlint=require("./jsonlint");function normalizePath(e=""){const t=path_1.default.posix.normalize(e.replace(/\\/g,"/"));return!e.startsWith("//")&&!e.startsWith("\\\\")||t.startsWith("//")?t:"/"+t}function joinPath(e="",t=""){const r=path_1.default.posix.join(e,t);return!e.startsWith("//")&&!e.startsWith("\\\\")||r.startsWith("//")?r:"/"+r}function escapeScript(e){return e?e.replace(/<script/g,"<script").replace(/<\/script/g,"</script"):e}function wrapCodeByEval(e){return`;(window.eval || __global.__hackEval)('${e}')`}function getType(e){return Object.prototype.toString.call(e).toLowerCase().split(" ")[1].replace("]","")}exports.normalizePath=normalizePath,exports.joinPath=joinPath,exports.escapeScript=escapeScript,exports.wrapCodeByEval=wrapCodeByEval,exports.getType=getType;const bufferToUtf8String=e=>{const t=e.toString();if(0===Buffer.compare(Buffer.from(t,"utf8"),e))return t};function getErrLine(e,t,r,s){r=r>0?r:1;return`${s}\n${(0,babel_code_frame_1.default)(e,t,r)}`}exports.bufferToUtf8String=bufferToUtf8String;const formatJSONParseErr=e=>{const t=e.data||"";try{jsonlint.parser.parse(t)}catch(r){try{const s=`Expecting ${r.expected}, got ${r.token}`,o=getErrLine(t,r.line,r.loc.first_column,s);return`${e.filePath}\n${o}`}catch(e){}}return`${e.filePath}\n${e.error}`};exports.formatJSONParseErr=formatJSONParseErr;const isHexColor=e=>/^#[a-f\d]{3}$/i.test(e)||/^#[a-f\d]{4}$/i.test(e)||/^#[a-f\d]{6}$/i.test(e)||/^#[a-f\d]{8}$/i.test(e);function rmSync(e){try{if(e=path_1.default.resolve(e),!fs_1.default.existsSync(e))return;if(fs_1.default.lstatSync(e).isDirectory()){const t=fs_1.default.readdirSync(e);if(t.length>0)for(let r=0,s=t.length;r<s;r++)rmSync(path_1.default.posix.join(e,t[r]));fs_1.default.rmdirSync(e)}else fs_1.default.unlinkSync(e)}catch(e){}}function mkdirSync(e){if(e=path_1.default.resolve(e),fs_1.default.existsSync(e)){if(fs_1.default.lstatSync(e).isDirectory())return;fs_1.default.unlinkSync(e)}mkdirSync(path_1.default.dirname(e)),fs_1.default.mkdirSync(e)}function escapeQuot(e,t="`"){return e?"`"===t?e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$"):'"'===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/"/g,'\\"'):"'"===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/'/g,"\\'"):e:e}function trailing(e,t,r=!1){return r?e.endsWith(t)?e.slice(0,e.length-1):e:e.endsWith(t)?e:e+t}function leading(e,t,r=!1){return r?e.startsWith(t)?e.slice(1):e:e.startsWith(t)?e:t+e}exports.isHexColor=isHexColor,exports.rmSync=rmSync,exports.mkdirSync=mkdirSync,exports.escapeQuot=escapeQuot,exports.trailing=trailing,exports.leading=leading;const FFSPRGRulesFactory=function(e){let t=null,r=Object.create(null);return function(e,s){if(s.length<1)return!1;if(t===s){if(void 0!==r[e])return r[e]}else t=s,r=Object.create(null);const o=e.replace(/\\/g,"/").toLowerCase();if(!o)return!1;const n=o.slice(o.lastIndexOf("/")+1);let i=!1;for(const e of s){if(!e)continue;const t=e.value.toLowerCase();if("prefix"===e.type)i=n.startsWith(t);else if("suffix"===e.type)i=n.endsWith(t);else if("folder"===e.type)i=leading(o,"/").startsWith(trailing(leading(t,"/"),"/"));else if("file"===e.type)i=leading(o,"/")===leading(t,"/");else if("glob"===e.type)try{i=(0,minimatch_1.default)(o,t)||(0,minimatch_1.default)(leading(o,"/"),t)}catch(e){i=!1}else if("regexp"===e.type)try{i=new RegExp(t,"igm").test(o)||new RegExp(t,"igm").test(leading(o,"/"))}catch(e){i=!1}if(i)break}return r[e]=i,i}};function formatSourceMap(e){if(e){if("string"===getType(e))return e;try{return JSON.stringify(e)}catch(e){}}}function generateMD5(e){const t=crypto_1.default.createHash("md5");return t.update(e),t.digest("hex")}exports.isFileIgnored=FFSPRGRulesFactory(),exports.isFileIncluded=FFSPRGRulesFactory(),exports.formatSourceMap=formatSourceMap,exports.generateMD5=generateMD5;const formatNumber=e=>e>9?""+e:"0"+e;exports.formatNumber=formatNumber;const formatTime=e=>{const t=e.getFullYear(),r=e.getMonth()+1,s=e.getDate(),o=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return`${[t,r,s].map(exports.formatNumber).join("/")} ${[o,n,i].map(exports.formatNumber).join(":")}`};exports.formatTime=formatTime;const isDevtools=process.__nwjs&&window.nw&&"wechatwebdevtools"===nw.App.manifest.appname;function devtoolsInfo(...e){isDevtools&&console.info(...e)}function devtoolsLog(...e){isDevtools&&console.log(...e)}function devtoolsError(...e){isDevtools&&console.error(...e)}function getPluginByAliasOrProvider(e,t){if(e){const r=e[t];if(r)return{alias:t,provider:r.provider,version:r.version};for(const r in e){const s=e[r];if(s.provider===t)return{alias:r,provider:s.provider,version:s.version}}}}function checkPluginByAliasOrProvider(e,t){let r;if(e.subPackages)for(const s of e.subPackages)if(r=getPluginByAliasOrProvider(s.plugins,t),r)return Object.assign(Object.assign({},r),{config:s});if(r=getPluginByAliasOrProvider(e.plugins,t),r)return r}function checkIsInSubPackage(e,t=""){let r;if((0,startWith_1.default)(t,"plugin://")){const r=t.match(/^plugin:\/\/([^/]*)\/(.*)/),s=null==r?void 0:r[1];if(!s)return;const o=checkPluginByAliasOrProvider(e,s);return null==o?void 0:o.config}if(e.subPackages)for(let s=0,o=e.subPackages.length;s<o;s++){const o=e.subPackages[s];if(t.startsWith(o.root)){r=o;break}}return r}function checkIsIndependentSubpackage(e,t){const r=checkIsInSubPackage(e,t);if(r&&!0===r.independent)return r}function getTerm(){if(!!!(null===window||void 0===window?void 0:window.nw))return require("terminal-kit").terminal}function getTargetPlatformJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=Object.values(define_1.PLATFORM),s=fs_extra_1.default.readJsonSync(e),o=lodash_1.default.omit(s,r);return lodash_1.default.merge(o,s[t]||("mini-weixin"===t?s["mini-wechat"]:{}))}function getAppJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=path_1.default.join(e.projectPath,e.miniprogramRoot||"","app.json");if(!fs_extra_1.default.existsSync(r))throw Error("no found app.json");return getTargetPlatformJson(r,t)}function getPluginJson(e,t=define_1.PLATFORM["mini-weixin"]){const r=path_1.default.join(e.projectPath,e.pluginRoot||"","plugin.json");if(!fs_extra_1.default.existsSync(r))throw Error("no found plugin.json");return getTargetPlatformJson(r,t)}exports.devtoolsInfo=devtoolsInfo,exports.devtoolsLog=devtoolsLog,exports.devtoolsError=devtoolsError,exports.checkIsInSubPackage=checkIsInSubPackage,exports.checkIsIndependentSubpackage=checkIsIndependentSubpackage,exports.getTerm=getTerm,exports.getAppJson=getAppJson,exports.getPluginJson=getPluginJson;const getWorkersPath=e=>"string"==typeof e?e:e.path;exports.getWorkersPath=getWorkersPath;const unifyPath=e=>e.replace(/\\/g,"/");exports.unifyPath=unifyPath;const compareVersion=(e,t)=>{e=e.split("."),t=t.split(".");const r=Math.max(e.length,t.length);for(;e.length<r;)e.push("0");for(;t.length<r;)t.push("0");for(let s=0;s<r;s++){const r=parseInt(e[s],10),o=parseInt(t[s],10);if(r>o)return 1;if(r<o)return-1}return 0};exports.compareVersion=compareVersion;const pathRelative=(e,t)=>(e=path_1.default.posix.normalize(e.replace(/\\/g,"/")),t=path_1.default.posix.normalize(t.replace(/\\/g,"/")),path_1.default.posix.relative(e,t));function _isLeftSubPathOfRight(e,t){if(!t)return!0;if(t=normalizePath(t),e=normalizePath(e),!t.endsWith("/")){if(e===t)return!0;t+="/"}return!!e.startsWith(t)}function isLeftSubPathOfRight(e,t){void 0===e&&(console.error(new Error("The child string is undefined here, please check!!")),e="");const r=e.startsWith(t),s=_isLeftSubPathOfRight(e,t);return r!==s&&console.error(new Error(`${e} ${t} difference check sub path here! new result: ${s}`)),s}function isGameApp(e){return e.type===types_1.EProjectType.miniGame||e.type===types_1.EProjectType.miniGamePlugin}exports.pathRelative=pathRelative,exports.isLeftSubPathOfRight=isLeftSubPathOfRight,exports.isGameApp=isGameApp;const checkIsUseCompilerPlugins=()=>!0;exports.checkIsUseCompilerPlugins=checkIsUseCompilerPlugins;const sourceExt2TargetExtConf={".ts":".js",".less":".wxss",".sass":".wxss",".scss":".wxss"},sourcePathToTargetPath=e=>{const t=path_1.default.extname(e);return sourceExt2TargetExtConf[t]?e.substr(0,e.length-t.length)+sourceExt2TargetExtConf[t]:e};function getCompilerPlugins(e){const t=new Set;function r(e){"typescript"!==e&&"less"!==e&&"sass"!==e||t.add(e)}return e.setting.useCompilerPlugins&&e.setting.useCompilerPlugins.forEach(e=>{"string"==typeof e?r(e):Array.isArray(e)&&"string"==typeof e[0]&&void 0!==e[1]&&r(e[0])}),Array.from(t.values())}function getSupportCodeFileExtSet(e){const t=getCompilerPlugins(e),r=new Set([".js",".json",".wxss",".wxs",".wxml"]);return t.includes("typescript")&&r.add(".ts"),t.includes("less")&&r.add(".less"),t.includes("sass")&&(r.add(".sass"),r.add(".scss")),r}function isCodeFile(e){return/\.(json|wxml|wxss|js|wxs|ts|less|sass|scss)/.test(e)}function isMiniProgramCodeFile(e){return/\.(json|wxml|wxss|js|wxs)/.test(e)}function compareSemVer(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;const r=/\d+/g,s=e.match(r),o=t.match(r);if(!s)return 1;if(!o)return-1;const n=s.map(e=>parseInt(e,10)),i=o.map(e=>parseInt(e,10)),a=s.length>o.length?o.length:s.length;for(let e=0;e<a;e++){if(n[e]<i[e])return-1;if(n[e]>i[e])return 1}return n.length===i.length?0:n.length<i.length?-1:1}exports.sourcePathToTargetPath=sourcePathToTargetPath,exports.getCompilerPlugins=getCompilerPlugins,exports.getSupportCodeFileExtSet=getSupportCodeFileExtSet,exports.isCodeFile=isCodeFile,exports.isMiniProgramCodeFile=isMiniProgramCodeFile,exports.compareSemVer=compareSemVer;
|
package/dist/utils/zip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.archiveZip=exports.genZip=exports.unzip=void 0;const AdmZip=require("adm-zip"),fse=require("fs-extra"),archiver=require("archiver");async function unzip(e,r){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.archiveZip=exports.genZip=exports.unzip=void 0;const AdmZip=require("adm-zip"),fse=require("fs-extra"),archiver=require("archiver");async function unzip(e,r){return new Promise((i,t)=>{try{setTimeout(()=>{const n=new AdmZip(e),o=n.getEntries();for(const e of o){const r=e.entryName;/^\.\.(\\|\/)+/.test(r)&&t("illegal access"),/(\\|\/)+\.\.(\\|\/)+/.test(r)&&t("illegal access"),/(\\|\/)+\.\.$/.test(r)&&t("illegal access")}n.extractAllTo(r,!0),i({})},200)}catch(e){console.warn("@@@@@ [unzip] Fail. Error:",e),t(e)}})}function genZip(e,r){const i=new AdmZip;i.addLocalFolder(e),fse.writeFileSync(r,i.toBuffer())}function archiveZip(e,r){return new Promise((i,t)=>{const n=fse.createWriteStream(r),o=archiver("zip",{zlib:{level:9}});o.on("error",e=>{t(e)}),o.on("end",()=>{i({})}),o.pipe(n),o.directory(e,!1),o.finalize()})}exports.unzip=unzip,exports.genZip=genZip,exports.archiveZip=archiveZip;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miniprogram-ci",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Module that build miniprogram project for web or app extracted from WeChatDevtools.",
|
|
5
5
|
"homepage": "https://developers.weixin.qq.com/community/homepage",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"devcloud": "rm -rf dist && gulp copy && tsc -p './tsconfigForCloudBuild.json' -w",
|
|
13
13
|
"beta": "npm run init && rm -rf dist && tsc && gulp copy && node ./task/afterbuild.js && npm run test",
|
|
14
14
|
"build": "npm run eslint -- --fix && npm run bb",
|
|
15
|
+
"prebuild-ci": "cd src/ci/android-miniapp-toolkit && npm run build",
|
|
15
16
|
"build-ci": "rm -rf dist && rm -rf ci-src && npm run build && gulp copy-src-to-ci-src && gulp condition-compile-for-ci && rm -rf dist && gulp removeForCi && npm run ci-tsc && gulp build-ci",
|
|
16
17
|
"ci-tsc": "tsc -p './tsconfig_ci.json'",
|
|
17
18
|
"bb": "npm run init && gulp inc-version && tsc && gulp build && node ./task/afterbuild.js ",
|
|
@@ -93,9 +94,9 @@
|
|
|
93
94
|
"typescript-json-schema": "^0.41.0"
|
|
94
95
|
},
|
|
95
96
|
"dependencies": {
|
|
96
|
-
"@babel/core": "7.21.4",
|
|
97
97
|
"@babel/code-frame": "7.22.10",
|
|
98
98
|
"@babel/compat-data": "7.22.9",
|
|
99
|
+
"@babel/core": "7.21.4",
|
|
99
100
|
"@babel/eslint-parser": "7.22.10",
|
|
100
101
|
"@babel/generator": "7.21.4",
|
|
101
102
|
"@babel/helper-annotate-as-pure": "7.22.5",
|
|
@@ -218,7 +219,7 @@
|
|
|
218
219
|
"@swc/core": "1.4.14",
|
|
219
220
|
"@vue/reactivity": "3.0.5",
|
|
220
221
|
"acorn": "^6.1.1",
|
|
221
|
-
"adm-zip": "
|
|
222
|
+
"adm-zip": "0.5.10",
|
|
222
223
|
"archiver": "^5.3.1",
|
|
223
224
|
"autoprefixer": "^10.4.0",
|
|
224
225
|
"babel-code-frame": "6.26.0",
|
|
@@ -238,7 +239,7 @@
|
|
|
238
239
|
"glob": "7.1.2",
|
|
239
240
|
"html-minifier": "4.0.0",
|
|
240
241
|
"image-size": "^1.0.2",
|
|
241
|
-
"jimp": "
|
|
242
|
+
"jimp": "0.16.1",
|
|
242
243
|
"js-base64": "^3.7.2",
|
|
243
244
|
"jsonschema": "^1.2.5",
|
|
244
245
|
"jszip": "^3.4.0",
|