miniprogram-ci 2.1.32 → 2.1.33

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.
Files changed (355) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +2 -0
  3. package/dist/@types/ci/cloud/utils.d.ts +1 -1
  4. package/dist/@types/common/code-analyse/index.d.ts +16 -1
  5. package/dist/@types/config/config.d.ts +1 -1
  6. package/dist/@types/index.d.ts +2 -0
  7. package/dist/@types/modules/corecompiler/original/compile/game.d.ts +1 -1
  8. package/dist/@types/modules/corecompiler/original/compile/index.d.ts +1 -1
  9. package/dist/@types/modules/corecompiler/original/index.d.ts +1 -1
  10. package/dist/@types/modules/corecompiler/original/workerThread/childprocessManager.d.ts +1 -1
  11. package/dist/@types/modules/corecompiler/original/workerThread/config.d.ts +3 -0
  12. package/dist/@types/modules/corecompiler/original/workerThread/task/compilejs.d.ts +3 -0
  13. package/dist/@types/modules/corecompiler/original/workerThread/task/func.d.ts +4 -0
  14. package/dist/@types/modules/corecompiler/original/workerThread/workerManager.d.ts +8 -0
  15. package/dist/@types/modules/corecompiler/originalCompiler.d.ts +1 -1
  16. package/dist/@types/modules/corecompiler/summer/pipeManager/index.d.ts +6 -0
  17. package/dist/@types/modules/corecompiler/summer/pipeManager/pipeCPProject.d.ts +17 -0
  18. package/dist/@types/modules/corecompiler/summer/pipeManager/pipeContext.d.ts +10 -0
  19. package/dist/@types/modules/corecompiler/summer/pipeManager/pipeManager.d.ts +12 -0
  20. package/dist/@types/modules/corecompiler/summer/pipeManager/pipeWorker.d.ts +2 -0
  21. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/appservicePipe/index.d.ts +3 -0
  22. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/compileWxmlToGlassEaselPipe.d.ts +3 -0
  23. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/compileWxssPipe.d.ts +3 -0
  24. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/index.d.ts +2 -0
  25. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/pageInitSourcePipe/index.d.ts +4 -0
  26. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/pageframePipe/index.d.ts +3 -0
  27. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appdevserver/getAppService.d.ts +6 -0
  28. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appdevserver/getwxappcode.d.ts +9 -0
  29. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getjsfile.d.ts +12 -0
  30. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getmainpkgsortedjsfiles.d.ts +11 -0
  31. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getwxappcode.d.ts +8 -0
  32. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/common/apperrcode.config.d.ts +92 -0
  33. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/common/tools.d.ts +1 -0
  34. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/appconfig.d.ts +6 -0
  35. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/appjson.d.ts +3 -0
  36. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/customcomponent.d.ts +21 -0
  37. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/helper/theme.d.ts +40 -0
  38. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/pagejson.d.ts +3 -0
  39. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/project/wxappcodejson.d.ts +3 -0
  40. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/trans/transwxmltojs.d.ts +19 -0
  41. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/trans/transwxsstojs.d.ts +15 -0
  42. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/utils/web/processPath.d.ts +9 -0
  43. package/dist/@types/modules/corecompiler/summer/pipeManager/pipes/wccPipe.d.ts +3 -0
  44. package/dist/@types/modules/corecompiler/summer/pipeManager/types.d.ts +100 -0
  45. package/dist/@types/modules/corecompiler/summer/plugins/script_task/minify_script_task.d.ts +1 -1
  46. package/dist/@types/modules/corecompiler/summerCompiler.d.ts +10 -0
  47. package/dist/@types/modules/index.d.ts +1 -1
  48. package/dist/@types/modules/precompiler/conditioncompile/compiler/plant.d.ts +1 -1
  49. package/dist/@types/modules/precompiler/conditioncompile/index.d.ts +1 -1
  50. package/dist/@types/project/advance/precompileProject.d.ts +1 -1
  51. package/dist/@types/project/baseProject.d.ts +1 -0
  52. package/dist/@types/services/app/ci/appDirService.d.ts +6 -0
  53. package/dist/@types/services/common/getservice.d.ts +6 -3
  54. package/dist/@types/services/compilewxml/common/compilewxmlService.d.ts +2 -2
  55. package/dist/@types/services/compilewxml/node/compileglasseasel.d.ts +14 -0
  56. package/dist/@types/services/multiTaskManager/ci/multiTaskManager.d.ts +5 -0
  57. package/dist/@types/services/multiTaskManager/common/multiTaskManager.d.ts +5 -0
  58. package/dist/@types/services/multiTaskManager/electron/multiTaskManager.d.ts +5 -0
  59. package/dist/@types/services/multiTaskManager/webide/multiTaskManager.d.ts +5 -0
  60. package/dist/@types/services/nativeModule/ci/nativeModule.d.ts +3 -0
  61. package/dist/@types/services/nativeModule/common/nativeModule.d.ts +2 -2
  62. package/dist/@types/services/nativeModule/common/nativeModule.impl.d.ts +3 -2
  63. package/dist/@types/services/pluginFileReader/ci/pluginFileReader.d.ts +3 -0
  64. package/dist/@types/services/pluginFileReader/common/pluginFileReader.base.d.ts +9 -0
  65. package/dist/@types/services/pluginFileReader/common/pluginFileReader.d.ts +12 -0
  66. package/dist/@types/services/pluginFileReader/electron/pluginFileReader.d.ts +3 -0
  67. package/dist/@types/services/pluginFileReader/webide/pluginFileReader.d.ts +9 -0
  68. package/dist/@types/services/root/ci/rootService.d.ts +2 -0
  69. package/dist/@types/services/root/webide/root.d.ts +11 -0
  70. package/dist/@types/services/root/webide/rootService.d.ts +2 -0
  71. package/dist/@types/utils/colorutils.d.ts +4 -0
  72. package/dist/@types/utils/debug.d.ts +1 -0
  73. package/dist/@types/utils/error.d.ts +1 -1
  74. package/dist/@types/utils/fsagent.d.ts +4 -3
  75. package/dist/@types/utils/processBootstrap.d.ts +7 -0
  76. package/dist/@types/utils/subprocess/processManager.d.ts +1 -0
  77. package/dist/@types/utils/wxapkg/pack.d.ts +2 -2
  78. package/dist/ci/android-miniapp-toolkit/dist/index.js +1 -1
  79. package/dist/ci/build-apk.js +1 -1
  80. package/dist/ci/build-ipa.js +1 -1
  81. package/dist/ci/checkCodeQuality.js +1 -1
  82. package/dist/ci/cloud/cloudapi.js +1 -1
  83. package/dist/ci/cloud/createTimeTrigger.js +1 -1
  84. package/dist/ci/cloud/uploadContainer.js +1 -1
  85. package/dist/ci/cloud/uploadFile.js +1 -1
  86. package/dist/ci/cloud/uploadFunction.js +1 -1
  87. package/dist/ci/cloud/utils.js +1 -1
  88. package/dist/ci/code-analyse.js +1 -1
  89. package/dist/ci/cos-upload.js +1 -1
  90. package/dist/ci/gamepkg/apkplug.js +1 -1
  91. package/dist/ci/gamepkg/index.js +1 -1
  92. package/dist/ci/getCompiledResult.js +1 -1
  93. package/dist/ci/getDevSourceMap.js +1 -1
  94. package/dist/ci/getcompiler.js +1 -1
  95. package/dist/ci/miniapp/androidCloudBuild.js +1 -1
  96. package/dist/ci/miniapp/archive.js +1 -1
  97. package/dist/ci/miniapp/iosCloudBuild.js +1 -1
  98. package/dist/ci/miniapp/miniappPlugin.js +1 -1
  99. package/dist/ci/miniapp/sdkManager.js +1 -1
  100. package/dist/ci/miniapp/upload.js +1 -1
  101. package/dist/ci/miniapp-cloud-upload.js +1 -1
  102. package/dist/ci/preview.js +1 -1
  103. package/dist/ci/upload.js +1 -1
  104. package/dist/ci/utils/codeDenpendencyQualityChecker.js +1 -1
  105. package/dist/ci/utils/filterUnusedFile.js +1 -1
  106. package/dist/ci/utils/pack.js +1 -1
  107. package/dist/ci/utils/packfile.js +1 -1
  108. package/dist/ci/utils/terminalQrcode.js +1 -1
  109. package/dist/ci/utils/tools.js +1 -1
  110. package/dist/ci/utils/unpack.js +1 -1
  111. package/dist/ci/utils/wxvpkg/unpack/version0.js +1 -1
  112. package/dist/ci/utils/wxvpkg/unpack/version10.js +1 -1
  113. package/dist/cli/index.js +1 -1
  114. package/dist/common/code-analyse/index.js +1 -1
  115. package/dist/config/config.js +1 -1
  116. package/dist/config/url.config.js +1 -1
  117. package/dist/index.js +1 -1
  118. package/dist/modules/corecompiler/baseCompiler.js +1 -1
  119. package/dist/modules/corecompiler/original/analyse/partial.js +1 -1
  120. package/dist/modules/corecompiler/original/compile/common.js +1 -1
  121. package/dist/modules/corecompiler/original/compile/game.js +1 -1
  122. package/dist/modules/corecompiler/original/compile/gamePlugin.js +1 -1
  123. package/dist/modules/corecompiler/original/compile/handler/js.js +1 -1
  124. package/dist/modules/corecompiler/original/compile/handler/mpjson.js +1 -1
  125. package/dist/modules/corecompiler/original/compile/handler/wxml.js +1 -1
  126. package/dist/modules/corecompiler/original/compile/handler/wxss.js +1 -1
  127. package/dist/modules/corecompiler/original/compile/miniprogram.js +1 -1
  128. package/dist/modules/corecompiler/original/compile/miniprogramPlugin.js +1 -1
  129. package/dist/modules/corecompiler/original/js/enhance.js +1 -1
  130. package/dist/modules/corecompiler/original/js/es6Transform.js +1 -1
  131. package/dist/modules/corecompiler/original/js/generateMap.js +1 -1
  132. package/dist/modules/corecompiler/original/js/minifyjs.js +1 -1
  133. package/dist/modules/corecompiler/original/js/minifyjsAfterWrap.js +1 -1
  134. package/dist/modules/corecompiler/original/js/workletCompile.js +1 -1
  135. package/dist/modules/corecompiler/original/json/app/appJSON.js +1 -1
  136. package/dist/modules/corecompiler/original/json/app/checkAppFields.js +1 -1
  137. package/dist/modules/corecompiler/original/json/app/extJSON.js +1 -1
  138. package/dist/modules/corecompiler/original/json/app/index.js +1 -1
  139. package/dist/modules/corecompiler/original/json/common.js +1 -1
  140. package/dist/modules/corecompiler/original/json/game.js +1 -1
  141. package/dist/modules/corecompiler/original/json/page/checkPageJSON.js +1 -1
  142. package/dist/modules/corecompiler/original/json/page/getPageJSON.js +1 -1
  143. package/dist/modules/corecompiler/original/json/plugin/plugin.js +1 -1
  144. package/dist/modules/corecompiler/original/json/plugin/pluginPage.js +1 -1
  145. package/dist/modules/corecompiler/original/json/projectconfig.js +1 -1
  146. package/dist/modules/corecompiler/original/json/reactiveCache.js +1 -1
  147. package/dist/modules/corecompiler/original/json/signaturejson.js +1 -1
  148. package/dist/modules/corecompiler/original/json/sitemap.js +1 -1
  149. package/dist/modules/corecompiler/original/json/theme.js +1 -1
  150. package/dist/modules/corecompiler/original/npm/filterdeps.js +1 -1
  151. package/dist/modules/corecompiler/original/npm/packnpm.js +1 -1
  152. package/dist/modules/corecompiler/original/protect/fileFlatter.js +1 -1
  153. package/dist/modules/corecompiler/original/protect/uglifyfilenames.js +1 -1
  154. package/dist/modules/corecompiler/original/utils/logger.js +1 -1
  155. package/dist/modules/corecompiler/original/validate/schemaValidate.js +1 -1
  156. package/dist/modules/corecompiler/original/validate/validate.js +1 -1
  157. package/dist/modules/corecompiler/original/workerThread/childprocess.js +1 -1
  158. package/dist/modules/corecompiler/original/workerThread/childprocessManager.js +1 -1
  159. package/dist/modules/corecompiler/original/workerThread/config.js +1 -1
  160. package/dist/modules/corecompiler/original/workerThread/fork.js +1 -1
  161. package/dist/modules/corecompiler/original/workerThread/index.js +1 -1
  162. package/dist/modules/corecompiler/original/workerThread/task/call_func.js +1 -1
  163. package/dist/modules/corecompiler/original/workerThread/task/compilejs.js +1 -1
  164. package/dist/modules/corecompiler/original/workerThread/task/compilewxss.js +1 -1
  165. package/dist/modules/corecompiler/original/workerThread/task/func.js +1 -1
  166. package/dist/modules/corecompiler/original/workerThread/task/index.js +1 -1
  167. package/dist/modules/corecompiler/original/workerThread/task/minifywxml.js +1 -1
  168. package/dist/modules/corecompiler/original/workerThread/worker.js +1 -1
  169. package/dist/modules/corecompiler/original/workerThread/workerManager.js +1 -1
  170. package/dist/modules/corecompiler/originalCompiler.js +1 -1
  171. package/dist/modules/corecompiler/processHandler.js +1 -1
  172. package/dist/modules/corecompiler/summer/graph/appconf.js +1 -1
  173. package/dist/modules/corecompiler/summer/graph/appgraph.js +1 -1
  174. package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -1
  175. package/dist/modules/corecompiler/summer/graph/gameconf.js +1 -1
  176. package/dist/modules/corecompiler/summer/graph/gamegraph.js +1 -1
  177. package/dist/modules/corecompiler/summer/graph/gamepluginconf.js +1 -1
  178. package/dist/modules/corecompiler/summer/graph/gameplugingraph.js +1 -1
  179. package/dist/modules/corecompiler/summer/graph/pluginconf.js +1 -1
  180. package/dist/modules/corecompiler/summer/graph/plugingraph.js +1 -1
  181. package/dist/modules/corecompiler/summer/index.js +1 -1
  182. package/dist/modules/corecompiler/summer/initPlugin.js +1 -1
  183. package/dist/modules/corecompiler/summer/module.js +1 -1
  184. package/dist/modules/corecompiler/summer/persistCache.js +1 -1
  185. package/dist/modules/corecompiler/summer/pipeManager/index.js +1 -0
  186. package/dist/modules/corecompiler/summer/pipeManager/pipeCPProject.js +1 -0
  187. package/dist/modules/corecompiler/summer/pipeManager/pipeContext.js +1 -0
  188. package/dist/modules/corecompiler/summer/pipeManager/pipeManager.js +1 -0
  189. package/dist/modules/corecompiler/summer/pipeManager/pipeWorker.js +1 -0
  190. package/dist/modules/corecompiler/summer/pipeManager/pipes/appservicePipe/index.js +1 -0
  191. package/dist/modules/corecompiler/summer/pipeManager/pipes/compileWxmlToGlassEaselPipe.js +1 -0
  192. package/dist/modules/corecompiler/summer/pipeManager/pipes/compileWxssPipe.js +1 -0
  193. package/dist/modules/corecompiler/summer/pipeManager/pipes/index.js +1 -0
  194. package/dist/modules/corecompiler/summer/pipeManager/pipes/pageInitSourcePipe/index.js +1 -0
  195. package/dist/modules/corecompiler/summer/pipeManager/pipes/pageframePipe/index.js +1 -0
  196. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appdevserver/getAppService.js +1 -0
  197. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appdevserver/getwxappcode.js +1 -0
  198. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getjsfile.js +1 -0
  199. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getmainpkgsortedjsfiles.js +1 -0
  200. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/appservice/getwxappcode.js +1 -0
  201. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/common/apperrcode.config.js +1 -0
  202. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/common/tools.js +1 -0
  203. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/appconfig.js +1 -0
  204. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/appjson.js +1 -0
  205. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/customcomponent.js +1 -0
  206. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/helper/theme.js +1 -0
  207. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/pagejson.js +1 -0
  208. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/project/wxappcodejson.js +1 -0
  209. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/trans/transwxmltojs.js +1 -0
  210. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/trans/transwxsstojs.js +1 -0
  211. package/dist/modules/corecompiler/summer/pipeManager/pipes/utils/web/processPath.js +1 -0
  212. package/dist/modules/corecompiler/summer/pipeManager/pipes/wccPipe.js +1 -0
  213. package/dist/modules/corecompiler/summer/pipeManager/types.js +1 -0
  214. package/dist/modules/corecompiler/summer/pluginDriver.js +1 -1
  215. package/dist/modules/corecompiler/summer/pluginconfig.js +1 -1
  216. package/dist/modules/corecompiler/summer/plugins/base/es6module.js +1 -1
  217. package/dist/modules/corecompiler/summer/plugins/base/javascript.js +1 -1
  218. package/dist/modules/corecompiler/summer/plugins/base/swc.js +1 -1
  219. package/dist/modules/corecompiler/summer/plugins/base/wxss.js +1 -1
  220. package/dist/modules/corecompiler/summer/plugins/enhance.js +1 -1
  221. package/dist/modules/corecompiler/summer/plugins/filetask/script.js +1 -1
  222. package/dist/modules/corecompiler/summer/plugins/less.js +1 -1
  223. package/dist/modules/corecompiler/summer/plugins/minifywxml.js +1 -1
  224. package/dist/modules/corecompiler/summer/plugins/sass.js +1 -1
  225. package/dist/modules/corecompiler/summer/plugins/script_task/babel_script_task.js +1 -1
  226. package/dist/modules/corecompiler/summer/plugins/script_task/load_script_task.js +1 -1
  227. package/dist/modules/corecompiler/summer/plugins/script_task/minify_script_task.js +1 -1
  228. package/dist/modules/corecompiler/summer/plugins/script_task/swc_task.js +1 -1
  229. package/dist/modules/corecompiler/summer/plugins/terser.js +1 -1
  230. package/dist/modules/corecompiler/summer/plugins/typescript.js +1 -1
  231. package/dist/modules/corecompiler/summer/plugins/worklet.js +1 -1
  232. package/dist/modules/corecompiler/summer/resolver.js +1 -1
  233. package/dist/modules/corecompiler/summer/summer.js +1 -1
  234. package/dist/modules/corecompiler/summer/utils/async.js +1 -1
  235. package/dist/modules/corecompiler/summer/utils/inputsourcemap.js +1 -1
  236. package/dist/modules/corecompiler/summerCompiler.js +1 -1
  237. package/dist/modules/corecompiler/summerEntryProcess.js +1 -1
  238. package/dist/modules/createSummer.js +1 -1
  239. package/dist/modules/fullcompiler/app/app.js +1 -1
  240. package/dist/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.js +1 -1
  241. package/dist/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.js +1 -1
  242. package/dist/modules/index.js +1 -1
  243. package/dist/modules/nativecompiler/android/adb.js +1 -1
  244. package/dist/modules/nativecompiler/android/device.js +1 -1
  245. package/dist/modules/nativecompiler/android/index.js +1 -1
  246. package/dist/modules/nativecompiler/android/projectconfig.js +1 -1
  247. package/dist/modules/nativecompiler/index.js +1 -1
  248. package/dist/modules/nativecompiler/ios/buildCloud.js +1 -1
  249. package/dist/modules/nativecompiler/ios/device.js +1 -1
  250. package/dist/modules/nativecompiler/ios/index.js +1 -1
  251. package/dist/modules/nativecompiler/nativeEntryProcess.js +1 -1
  252. package/dist/modules/nativecompiler/processHandler.js +1 -1
  253. package/dist/modules/precompiler/conditioncompile/compiler/json.js +1 -1
  254. package/dist/modules/precompiler/conditioncompile/compiler/macro.js +1 -1
  255. package/dist/modules/precompiler/conditioncompile/index.js +1 -1
  256. package/dist/project/advance/precompileProject.js +1 -1
  257. package/dist/project/advance/reactiveProject.js +1 -1
  258. package/dist/project/baseProject.js +1 -1
  259. package/dist/project/ciProjectWithMockBuffer.js +1 -1
  260. package/dist/project/summerCPProject.js +1 -1
  261. package/dist/services/app/ci/appDirService.js +1 -0
  262. package/dist/services/common/getservice.js +1 -1
  263. package/dist/services/common/vsbase.js +1 -1
  264. package/dist/services/compilewxml/node/compileUtils.js +1 -1
  265. package/dist/services/compilewxml/node/compileglasseasel.js +1 -1
  266. package/dist/services/compilewxml/webide/pageFrameWasm/wcc/runWcc.js +1 -1
  267. package/dist/services/compilewxss/node/compileUtils.js +1 -1
  268. package/dist/services/compilewxss/webide/pageFrameWasm/wcsc/runWcsc.js +1 -1
  269. package/dist/services/multiTaskManager/ci/multiTaskManager.js +1 -0
  270. package/dist/services/multiTaskManager/common/multiTaskManager.js +1 -0
  271. package/dist/services/multiTaskManager/electron/multiTaskManager.js +1 -0
  272. package/dist/services/multiTaskManager/webide/multiTaskManager.js +1 -0
  273. package/dist/services/nativeModule/ci/nativeModule.js +1 -0
  274. package/dist/services/nativeModule/common/nativeModule.impl.js +1 -1
  275. package/dist/services/pluginFileReader/ci/pluginFileReader.js +1 -0
  276. package/dist/services/pluginFileReader/common/pluginFileReader.base.js +1 -0
  277. package/dist/services/pluginFileReader/common/pluginFileReader.js +1 -0
  278. package/dist/services/pluginFileReader/electron/pluginFileReader.js +1 -0
  279. package/dist/services/pluginFileReader/webide/pluginFileReader.js +1 -0
  280. package/dist/services/root/{node → ci}/root.js +1 -1
  281. package/dist/services/root/ci/rootService.js +1 -0
  282. package/dist/services/root/electron/root.js +1 -1
  283. package/dist/services/root/electron/rootService.js +1 -1
  284. package/dist/services/root/nw/root.js +1 -1
  285. package/dist/services/root/webide/root.js +1 -0
  286. package/dist/services/root/webide/rootService.js +1 -0
  287. package/dist/utils/asyncTask/index.js +1 -1
  288. package/dist/utils/babel_helper.js +1 -1
  289. package/dist/utils/babel_plugin_worklet.js +1 -1
  290. package/dist/utils/colorutils.js +1 -0
  291. package/dist/utils/common.js +1 -1
  292. package/dist/utils/cosUpload.js +1 -1
  293. package/dist/utils/cp.js +1 -1
  294. package/dist/utils/customError.js +1 -1
  295. package/dist/utils/debug.js +1 -1
  296. package/dist/utils/download.js +1 -1
  297. package/dist/utils/expression.js +1 -1
  298. package/dist/utils/fsagent.js +1 -1
  299. package/dist/utils/genTempFile.js +1 -1
  300. package/dist/utils/generateIpa.js +1 -1
  301. package/dist/utils/glob.js +1 -1
  302. package/dist/utils/hackrequire/wxvpkgreader.js +1 -1
  303. package/dist/utils/helper_util.js +1 -1
  304. package/dist/utils/jsonlint.js +1 -1
  305. package/dist/utils/locales/fomatable_string.js +1 -1
  306. package/dist/utils/locales/locales.js +1 -1
  307. package/dist/utils/log.js +1 -1
  308. package/dist/utils/messageHub.js +1 -1
  309. package/dist/utils/miniAppI18N.js +1 -1
  310. package/dist/utils/miniapp-builder.js +1 -1
  311. package/dist/utils/miniappJson.js +1 -1
  312. package/dist/utils/officialDonutPlugin.js +1 -1
  313. package/dist/utils/packOptionsHelper.js +1 -1
  314. package/dist/utils/processBootstrap.js +1 -0
  315. package/dist/utils/progressRecorder.js +1 -1
  316. package/dist/utils/request.js +1 -1
  317. package/dist/utils/singletontask.js +1 -1
  318. package/dist/utils/subprocess/entryProcess.js +1 -1
  319. package/dist/utils/subprocess/processManager.js +1 -1
  320. package/dist/utils/subprocess/processService.js +1 -1
  321. package/dist/utils/swc_helper.js +1 -1
  322. package/dist/utils/taskmanager.js +1 -1
  323. package/dist/utils/tools.js +1 -1
  324. package/dist/utils/usbProcess.js +1 -1
  325. package/dist/utils/waitable.js +1 -1
  326. package/dist/utils/web/common.js +1 -1
  327. package/dist/utils/white_ext_list.js +1 -1
  328. package/dist/utils/wxapkg/pack.js +1 -1
  329. package/dist/utils/wxvpkgreader/wxvpkg/reader/version0.js +1 -1
  330. package/dist/utils/wxvpkgreader/wxvpkg/reader/version10.js +1 -1
  331. package/dist/utils/wxvpkgreader/wxvpkg/unpack/version0.js +1 -1
  332. package/dist/utils/wxvpkgreader/wxvpkg/unpack/version10.js +1 -1
  333. package/dist/utils/wxvpkgreader/wxvpkgreader.js +1 -1
  334. package/dist/utils/zip.js +1 -1
  335. package/package.json +62 -3
  336. package/dist/@types/services/root/node/rootService.d.ts +0 -0
  337. package/dist/modules/fullcompiler/trans/wcc/build/darwin_arm64/wcc.node +0 -0
  338. package/dist/modules/fullcompiler/trans/wcc/build/darwin_arm64/wcsc.node +0 -0
  339. package/dist/modules/fullcompiler/trans/wcc/build/darwin_x64/wcc.node +0 -0
  340. package/dist/modules/fullcompiler/trans/wcc/build/darwin_x64/wcsc.node +0 -0
  341. package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_arm64_release/wcc.node +0 -0
  342. package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_arm64_release/wcsc.node +0 -0
  343. package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_x64_release/wcc.node +0 -0
  344. package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_x64_release/wcsc.node +0 -0
  345. package/dist/modules/fullcompiler/trans/wcc/build/win32_ia32/wcc.node +0 -0
  346. package/dist/modules/fullcompiler/trans/wcc/build/win32_ia32/wcsc.node +0 -0
  347. package/dist/modules/fullcompiler/trans/wcc/build/win32_x64/wcc.node +0 -0
  348. package/dist/modules/fullcompiler/trans/wcc/build/win32_x64/wcsc.node +0 -0
  349. package/dist/modules/fullcompiler/trans/wcc/lib/addonVersion.js +0 -19
  350. package/dist/modules/fullcompiler/trans/wcc/lib/index.js +0 -4
  351. package/dist/modules/fullcompiler/trans/wcc/lib/util.js +0 -1134
  352. package/dist/modules/fullcompiler/trans/wcc/lib/wcc.js +0 -94
  353. package/dist/modules/fullcompiler/trans/wcc/lib/wcsc.js +0 -93
  354. package/dist/services/root/node/rootService.js +0 -1
  355. /package/dist/@types/services/root/{node → ci}/root.d.ts +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PluginConf=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),plugin_1=require("../../original/json/plugin/plugin"),pluginPage_1=require("../../original/json/plugin/pluginPage"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),util_1=require("./util"),baseconf_1=require("./baseconf");class PluginConf extends baseconf_1.MiniProgramBaseConf{constructor(){super(...arguments),this.pages=new Map,this.comps=new Map}destroy(){this.plugin=void 0}async getConf(t){return await this.build(t),{plugin:this.plugin,pages:Object.fromEntries(this.pages.entries()),comps:Object.fromEntries(this.comps.entries())}}async resetState(){this.plugin=void 0,this.pages.clear(),this.comps.clear()}async load(t){const o=await t.run(locales_1.default.config.SUMMER_COMPILE.format("plugin.json"),()=>(0,plugin_1.getDevPluginJSON)(this.proxyProject));this.plugin=o;const i=new Set;for(const t of Object.values(o.pages||{}))i.add(t);await t.run(locales_1.default.config.SUMMER_COMPILE_PLUGIN_PAGE_JSON.format(i.size),async()=>{for(const[t]of i.entries())(0,util_1.isPluginPath)(t)||await this.loadPage(t);for(const t of Object.values(o.publicComponents||{}))(0,util_1.isPluginPath)(t)||await this.loadComp(t,t,"plugin.json");for(const t of Object.values(o.usingComponents||{}))(0,util_1.isPluginPath)(t)||await this.loadComp(t,t,"plugin.json")})}async loadPage(t){const o=await(0,pluginPage_1.getPluginPageJSON)({project:this.proxyProject,root:this.root,filePath:path_1.default.posix.join(this.root,t+".json")});this.pages.set(t,o);const i=async o=>{if((0,util_1.isPluginPath)(o))return;const i=(0,util_1.resolvePath)(t,o);await this.loadComp(i,o,t)};for(const t of Object.values(o.usingComponents||{}))await i(t)}async loadComp(t,o,i){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 '${i}'`);const s=await(0,pluginPage_1.getPluginPageJSON)({project:this.proxyProject,root:this.root,filePath:path_1.default.posix.join(this.root,t+".json")});this.comps.set(t,s);const e=async o=>{if((0,util_1.isPluginPath)(o))return;const i=(0,util_1.resolvePath)(t,o);await this.loadComp(i,o,t)};for(const t of Object.values(s.usingComponents||{}))await e(t)}}exports.PluginConf=PluginConf;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PluginConf=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),plugin_1=require("../../original/json/plugin/plugin"),pluginPage_1=require("../../original/json/plugin/pluginPage"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),util_1=require("./util"),baseconf_1=require("./baseconf");class PluginConf extends baseconf_1.MiniProgramBaseConf{constructor(){super(...arguments),this.pages=new Map,this.comps=new Map}destroy(){this.plugin=void 0}async getConf(t){return await this.build(t),{plugin:this.plugin,pages:Object.fromEntries(this.pages.entries()),comps:Object.fromEntries(this.comps.entries())}}async resetState(){this.plugin=void 0,this.pages.clear(),this.comps.clear()}async load(t){const o=await t.run(locales_1.default.config.SUMMER_COMPILE.format("plugin.json"),(()=>(0,plugin_1.getDevPluginJSON)(this.proxyProject)));this.plugin=o;const i=new Set;for(const t of Object.values(o.pages||{}))i.add(t);await t.run(locales_1.default.config.SUMMER_COMPILE_PLUGIN_PAGE_JSON.format(i.size),(async()=>{for(const[t]of i.entries())(0,util_1.isPluginPath)(t)||await this.loadPage(t);for(const t of Object.values(o.publicComponents||{}))(0,util_1.isPluginPath)(t)||await this.loadComp(t,t,"plugin.json");for(const t of Object.values(o.usingComponents||{}))(0,util_1.isPluginPath)(t)||await this.loadComp(t,t,"plugin.json")}))}async loadPage(t){const o=await(0,pluginPage_1.getPluginPageJSON)({project:this.proxyProject,root:this.root,filePath:path_1.default.posix.join(this.root,`${t}.json`)});this.pages.set(t,o);const i=async o=>{if((0,util_1.isPluginPath)(o))return;const i=(0,util_1.resolvePath)(t,o);await this.loadComp(i,o,t)};for(const t of Object.values(o.usingComponents||{}))await i(t)}async loadComp(t,o,i){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 '${i}'`);const s=await(0,pluginPage_1.getPluginPageJSON)({project:this.proxyProject,root:this.root,filePath:path_1.default.posix.join(this.root,`${t}.json`)});this.comps.set(t,s);const e=async o=>{if((0,util_1.isPluginPath)(o))return;const i=(0,util_1.resolvePath)(t,o);await this.loadComp(i,o,t)};for(const t of Object.values(s.usingComponents||{}))await e(t)}}exports.PluginConf=PluginConf;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PluginGraph=void 0;const progressRecorder_1=require("../../../../utils/progressRecorder"),white_ext_list_1=require("../../../../utils/white_ext_list"),basegraph_1=require("./basegraph"),pluginconf_1=require("./pluginconf"),config_1=require("../../../../config/config");class PluginGraph extends basegraph_1.BaseGraph{constructor(e){super(e),this.pluginConf=new pluginconf_1.PluginConf(this.compiler.proxyProject,this.root)}async getWhiteListConfig(){if(!this._whiteListConfig){const e=await(0,white_ext_list_1.getWhiteExtList)();this._whiteListConfig=e.MiniProgramWhiteList}return this._whiteListConfig}destroy(){this.pluginConf.destroy(),super.destroy()}async getConf(e){if("plugin"!==this.type)throw new Error("Couldn't call getAppConf without plugin type");return this.conf=await this.pluginConf.getConf(e),this.conf}async compileSingleCode(e,t){await this.ensureConf(progressRecorder_1.silentRecorder);const i=this.resolver.resolveInfoMap.get(e);if(i)return super.doCompileSingleCode(Object.assign(Object.assign({},i),{independentRoot:this.getIndependentRoot(i.path),isBabelIgnore:this.isBabelSettingIgnore(i)}),t);throw new Error("file not found")}async getDevCode(e){let t=await this.getPackageFile(config_1.FullPkg);return t=t.filter(e=>!e.path.endsWith("json")),this.getCodeFiles(t,e)}async getProdCode(e,t){let i=await this.getPackageFile(config_1.FullPkg);return i=i.filter(e=>!e.path.endsWith("json")),this.getCodeFiles(i,e,{useCache:!1,resultType:t.resultType})}getLocalCodeFileList(){return Array.from(this.resolver.resolveInfoMap.entries()).map(([e,t])=>t.source)}onFileChangeForGraph(e,t){}async getPackageFile(e){await this.ensureConf(progressRecorder_1.silentRecorder);const t=[];for(const[e,i]of this.resolver.resolveInfoMap.entries())t.push(i);return t.map(e=>Object.assign(Object.assign({},e),{independentRoot:this.getIndependentRoot(e.path),isBabelIgnore:this.isBabelSettingIgnore(e)}))}getIndependentRoot(e){const t=this.conf.plugin;return"string"==typeof t.workers&&e.startsWith(t.workers)?t.workers:""}checkFilePackage(e){return config_1.MainPkg}async compileJSON(){const e=await this.getConf(progressRecorder_1.silentRecorder),t={};t["plugin.json"]=JSON.stringify(e.plugin);for(const i in e.pages)t[i+".json"]=JSON.stringify(e.pages[i]);for(const i in e.comps)t[i+".json"]=JSON.stringify(e.comps[i]);return{conf:e,jsons:t}}async compileJSONWithFileList(){return this.compileJSON()}}exports.PluginGraph=PluginGraph;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PluginGraph=void 0;const progressRecorder_1=require("../../../../utils/progressRecorder"),white_ext_list_1=require("../../../../utils/white_ext_list"),basegraph_1=require("./basegraph"),pluginconf_1=require("./pluginconf"),config_1=require("../../../../config/config");class PluginGraph extends basegraph_1.BaseGraph{constructor(e){super(e),this.pluginConf=new pluginconf_1.PluginConf(this.compiler.proxyProject,this.root)}async getWhiteListConfig(){if(!this._whiteListConfig){const e=await(0,white_ext_list_1.getWhiteExtList)();this._whiteListConfig=e.MiniProgramWhiteList}return this._whiteListConfig}destroy(){this.pluginConf.destroy(),super.destroy()}async getConf(e){if("plugin"!==this.type)throw new Error("Couldn't call getAppConf without plugin type");return this.conf=await this.pluginConf.getConf(e),this.conf}async compileSingleCode(e,t){await this.ensureConf(progressRecorder_1.silentRecorder);const i=this.resolver.resolveInfoMap.get(e);if(i)return super.doCompileSingleCode(Object.assign(Object.assign({},i),{independentRoot:this.getIndependentRoot(i.path),isBabelIgnore:this.isBabelSettingIgnore(i)}),t);throw new Error("file not found")}async getDevCode(e){let t=await this.getPackageFile(config_1.FullPkg);return t=t.filter((e=>!e.path.endsWith("json"))),this.getCodeFiles(t,e)}async getProdCode(e,t){let i=await this.getPackageFile(config_1.FullPkg);return i=i.filter((e=>!e.path.endsWith("json"))),this.getCodeFiles(i,e,{useCache:!1,resultType:t.resultType})}getLocalCodeFileList(){return Array.from(this.resolver.resolveInfoMap.entries()).map((([e,t])=>t.source))}onFileChangeForGraph(e,t){}async getPackageFile(e){await this.ensureConf(progressRecorder_1.silentRecorder);const t=[];for(const[e,i]of this.resolver.resolveInfoMap.entries())t.push(i);return t.map((e=>Object.assign(Object.assign({},e),{independentRoot:this.getIndependentRoot(e.path),isBabelIgnore:this.isBabelSettingIgnore(e)})))}getIndependentRoot(e){const t=this.conf.plugin;return"string"==typeof t.workers&&e.startsWith(t.workers)?t.workers:""}checkFilePackage(e){return config_1.MainPkg}async compileJSON(){const e=await this.getConf(progressRecorder_1.silentRecorder),t={};t["plugin.json"]=JSON.stringify(e.plugin);for(const i in e.pages)t[`${i}.json`]=JSON.stringify(e.pages[i]);for(const i in e.comps)t[`${i}.json`]=JSON.stringify(e.comps[i]);return{conf:e,jsons:t}}async compileJSONWithFileList(){return this.compileJSON()}}exports.PluginGraph=PluginGraph;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=compile;const common_1=require("../original/compile/common"),progressRecorder_1=require("../../../utils/progressRecorder"),summer_1=require("./summer"),pluginconfig_1=require("./pluginconfig");async function compile(e,r,i,o){const s=await e.serialize(),n=Object.assign(Object.assign({},s),{compileType:e.type,summerPlugins:(0,pluginconfig_1.getSummerPluginConfig)(e.setting)});n.files=n.files.filter(common_1.isNotIgnoredByProjectConfig.bind(null,r,e.miniprogramRoot));const t=new summer_1.SummerCompiler(e,"",n),m=new progressRecorder_1.Recorder((e,r,o)=>{var s;null===(s=i.onProgressUpdate)||void 0===s||s.call(i,{id:e.toString(),message:o,status:r})});return await t.compile(i,m)}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=compile;const common_1=require("../original/compile/common"),progressRecorder_1=require("../../../utils/progressRecorder"),summer_1=require("./summer"),pluginconfig_1=require("./pluginconfig");async function compile(e,r,i,o){const s=await e.serialize(),n=Object.assign(Object.assign({},s),{compileType:e.type,summerPlugins:(0,pluginconfig_1.getSummerPluginConfig)(e.setting)});n.files=n.files.filter(common_1.isNotIgnoredByProjectConfig.bind(null,r,e.miniprogramRoot));const t=new summer_1.SummerCompiler(e,"",n),m=new progressRecorder_1.Recorder(((e,r,o)=>{var s;null===(s=i.onProgressUpdate)||void 0===s||s.call(i,{id:e.toString(),message:o,status:r})}));return await t.compile(i,m)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initPlugin=initPlugin;const tslib_1=require("tslib"),index_1=tslib_1.__importDefault(require("./plugins/index"));function initPlugin(e,i,t){e.startsWith("summer-")&&(e=e.replace("summer-",""));const r=index_1.default.load(e);if(r)return r(i,t);throw new Error("not found plugin for "+e)}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initPlugin=initPlugin;const tslib_1=require("tslib"),index_1=tslib_1.__importDefault(require("./plugins/index"));function initPlugin(e,i,t){e.startsWith("summer-")&&(e=e.replace("summer-",""));const r=index_1.default.load(e);if(r)return r(i,t);throw new Error(`not found plugin for ${e}`)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tools_1=require("../../../utils/tools"),customError_1=require("../../../utils/customError"),basegraph_1=require("./graph/basegraph"),env_1=require("../../../utils/env");class JsTag{constructor(){this.isLargeFile=!1,this.isBabelIgnore=!1,this.helpers=[],this.resultType="dev"}setBabelIgnore(){this.isBabelIgnore=!0}setLargeFile(){this.isLargeFile=!0}addHelpers(e){for(const t of e)this.helpers.includes(t)||this.helpers.push(t)}setResultType(e="dev"){this.resultType=e}toJSON(){return{isLargeFile:this.isLargeFile,isBabelIgnore:this.isBabelIgnore,helpers:this.helpers}}}class Module{constructor(e,t,s){this.path=e,this.sourcePath=t,this.fileType=s,this._error={},this.generateResultPromise={},this.compileResultPromise={},this.depFiles=[],this.independentRoot="",this.isBabelIgnore=!1,this.generatedTS={}}transResultType(e){return this.fileType===basegraph_1.FileType.JS||this.fileType===basegraph_1.FileType.WXML?e:"common"}getGeneratedTS(e){return this.generatedTS[this.transResultType(e)]||0}setError(e,t){const s=this.transResultType(e);this._error[s]=t,this.generatedTS[s]=Date.now()}getError(e){const t=this.transResultType(e);return this._error[t]}async getJsTag(){if(this.fileType!==basegraph_1.FileType.JS)return;if(this._jsTag)return this._jsTag;const e=new JsTag;(await this.getSource()).largeFile&&e.setLargeFile();const t=await this.generateResultPromise.common;return t.target&&(e.addHelpers(t.target.helpers||[]),e.setResultType(t.target.resultType)),this.isBabelIgnore&&e.setBabelIgnore(),this._jsTag=e,e}async getJsTag2(){if(this.fileType!==basegraph_1.FileType.JS)return;if(this._jsTag)return this._jsTag;const e=new JsTag;(await this.getSource()).largeFile&&e.setLargeFile();const t=await this.compileResultPromise.common;return t.target&&(e.addHelpers(t.target.helpers||[]),e.setResultType(t.target.resultType)),this.isBabelIgnore&&e.setBabelIgnore(),this._jsTag=e,e}async getSource(){return(await this.getLoadingPromise()).source}async getMd5(){const e=await this.getSource();return(0,tools_1.generateMD5)(e.sourceCode)}setLoadingPromise(e){this.loadResult=e}async clearUselessCache(){if((0,env_1.isElectron)()&&this.path.endsWith(".js")){const e=await this.loadResult;if(e){const t=e.source;delete t.astInfo,delete t.inputMap}for(const e in this.generateResultPromise){const t=e;if(void 0!==this.generateResultPromise[t]){delete(await this.generateResultPromise[t]).source}}}}getLoadingPromise(){return this.loadResult}setGeneratingPromise(e,t){const s=this.transResultType(e);this.generateResultPromise[s]=t,this.generateResultPromise.common=t,t.then(()=>{this.generatedTS[s]=Date.now()})}getGeneratingPromise(e){const t=this.transResultType(e);return this.generateResultPromise[t]}getCompilePromise(e){const t=this.transResultType(e);return this.compileResultPromise[t]}setCompilePromise(e,t){const s=this.transResultType(e);this.compileResultPromise[s]=t,this.compileResultPromise.common=t}async getProcessInfo(e){var t;const s=this.getGeneratingPromise(e);return null===(t=await s)||void 0===t?void 0:t.process}async toCodeFile(e){const t=this.getError(e);if(t)return t instanceof customError_1.CustomError?{path:this.path,error:t.toJSON()}:{path:this.path,error:this._error};const s=this.getGeneratingPromise(e);if(void 0===s)return{path:this.path,error:"empty result"};const r=await this.getJsTag(),i=await this.getSource();try{return Object.assign({path:this.path,md5:await this.getMd5(),jsTag:null==r?void 0:r.toJSON(),mtime:i.mtime},(await s).target)}catch(e){return{path:this.path,error:e}}}async toCodeFile2(e){const t=this.getError(e);if(t)return t instanceof customError_1.CustomError?{path:this.path,error:t.toJSON()}:{path:this.path,error:this._error};const s=await this.getJsTag2(),r=await this.getSource(),i=this.getCompilePromise(e);if(void 0===i)return{path:this.path,error:"empty result"};const a=await i;try{return Object.assign({path:this.path,md5:await this.getMd5(),jsTag:null==s?void 0:s.toJSON(),mtime:r.mtime},a.target)}catch(e){return{path:this.path,error:e}}}async toGenerateResult(e){const t=this.getGeneratingPromise(e);if(void 0===t)return{path:this.path,error:"empty result"};const s=await t;return{targetPath:this.path,source:await this.getSource(),target:s.target,process:s.process||[]}}toJSON(){return{code:"",map:void 0,path:this.path,sourcePath:this.sourcePath,depFileIds:this.depFiles}}addWatchFile(e){-1===this.depFiles.indexOf(e)&&this.depFiles.push(e)}}exports.default=Module;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tools_1=require("../../../utils/tools"),customError_1=require("../../../utils/customError"),basegraph_1=require("./graph/basegraph"),env_1=require("../../../utils/env");class JsTag{constructor(){this.isLargeFile=!1,this.isBabelIgnore=!1,this.helpers=[],this.resultType="dev"}setBabelIgnore(){this.isBabelIgnore=!0}setLargeFile(){this.isLargeFile=!0}addHelpers(e){for(const t of e)this.helpers.includes(t)||this.helpers.push(t)}setResultType(e="dev"){this.resultType=e}toJSON(){return{isLargeFile:this.isLargeFile,isBabelIgnore:this.isBabelIgnore,helpers:this.helpers}}}class Module{constructor(e,t,s){this.path=e,this.sourcePath=t,this.fileType=s,this._error={},this.generateResultPromise={},this.compileResultPromise={},this.depFiles=[],this.independentRoot="",this.isBabelIgnore=!1,this.generatedTS={}}transResultType(e){return this.fileType===basegraph_1.FileType.JS||this.fileType===basegraph_1.FileType.WXML?e:"common"}getGeneratedTS(e){return this.generatedTS[this.transResultType(e)]||0}setError(e,t){const s=this.transResultType(e);this._error[s]=t,this.generatedTS[s]=Date.now()}getError(e){const t=this.transResultType(e);return this._error[t]}async getJsTag(){if(this.fileType!==basegraph_1.FileType.JS)return;if(this._jsTag)return this._jsTag;const e=new JsTag;(await this.getSource()).largeFile&&e.setLargeFile();const t=await this.generateResultPromise.common;return t.target&&(e.addHelpers(t.target.helpers||[]),e.setResultType(t.target.resultType)),this.isBabelIgnore&&e.setBabelIgnore(),this._jsTag=e,e}async getJsTag2(){if(this.fileType!==basegraph_1.FileType.JS)return;if(this._jsTag)return this._jsTag;const e=new JsTag;(await this.getSource()).largeFile&&e.setLargeFile();const t=await this.compileResultPromise.common;return t.target&&(e.addHelpers(t.target.helpers||[]),e.setResultType(t.target.resultType)),this.isBabelIgnore&&e.setBabelIgnore(),this._jsTag=e,e}async getSource(){return(await this.getLoadingPromise()).source}async getMd5(){const e=await this.getSource();return(0,tools_1.generateMD5)(e.sourceCode)}setLoadingPromise(e){this.loadResult=e}async clearUselessCache(){if((0,env_1.isElectron)()&&this.path.endsWith(".js")){const e=await this.loadResult;if(e){const t=e.source;delete t.astInfo,delete t.inputMap}for(const e in this.generateResultPromise){const t=e;if(void 0!==this.generateResultPromise[t]){delete(await this.generateResultPromise[t]).source}}}}getLoadingPromise(){return this.loadResult}setGeneratingPromise(e,t){const s=this.transResultType(e);this.generateResultPromise[s]=t,this.generateResultPromise.common=t,t.then((()=>{this.generatedTS[s]=Date.now()}))}getGeneratingPromise(e){const t=this.transResultType(e);return this.generateResultPromise[t]}getCompilePromise(e){const t=this.transResultType(e);return this.compileResultPromise[t]}setCompilePromise(e,t){const s=this.transResultType(e);this.compileResultPromise[s]=t,this.compileResultPromise.common=t}async getProcessInfo(e){var t;const s=this.getGeneratingPromise(e);return null===(t=await s)||void 0===t?void 0:t.process}async toCodeFile(e){const t=this.getError(e);if(t)return t instanceof customError_1.CustomError?{path:this.path,error:t.toJSON()}:{path:this.path,error:this._error};const s=this.getGeneratingPromise(e);if(void 0===s)return{path:this.path,error:"empty result"};const r=await this.getJsTag(),i=await this.getSource();try{return Object.assign({path:this.path,md5:await this.getMd5(),jsTag:null==r?void 0:r.toJSON(),mtime:i.mtime},(await s).target)}catch(e){return{path:this.path,error:e}}}async toCodeFile2(e){const t=this.getError(e);if(t)return t instanceof customError_1.CustomError?{path:this.path,error:t.toJSON()}:{path:this.path,error:this._error};const s=await this.getJsTag2(),r=await this.getSource(),i=this.getCompilePromise(e);if(void 0===i)return{path:this.path,error:"empty result"};const a=await i;try{return Object.assign({path:this.path,md5:await this.getMd5(),jsTag:null==s?void 0:s.toJSON(),mtime:r.mtime},a.target)}catch(e){return{path:this.path,error:e}}}async toGenerateResult(e){const t=this.getGeneratingPromise(e);if(void 0===t)return{path:this.path,error:"empty result"};const s=await t;return{targetPath:this.path,source:await this.getSource(),target:s.target,process:s.process||[]}}toJSON(){return{code:"",map:void 0,path:this.path,sourcePath:this.sourcePath,depFileIds:this.depFiles}}addWatchFile(e){-1===this.depFiles.indexOf(e)&&this.depFiles.push(e)}}exports.default=Module;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),fs=tslib_1.__importStar(require("fs-extra")),tools_1=require("../../../utils/tools"),taskmanager_1=tslib_1.__importDefault(require("../../../utils/taskmanager"));class PersistCache{constructor(e,t){this.project=e,this.cachePath=t,this._cleanTask=e=>{fs.unlink(path_1.default.join(this.cachePath,e))}}getFilePath(e){const t=(0,tools_1.generateMD5)(e);return{cacheFile:path_1.default.join(this.cachePath,t),infoFile:path_1.default.join(this.cachePath,t+".json")}}async get(e){const{cacheFile:t,infoFile:a}=this.getFilePath(e);try{const e=await fs.readFile(a,"utf8"),s=JSON.parse(e);return{data:await fs.readFile(t,{encoding:s.encoding||null}),info:s}}catch(e){}return{}}async set(e,t){var a;const{cacheFile:s,infoFile:i}=this.getFilePath(e);try{const e=(null===(a=t.info)||void 0===a?void 0:a.encoding)||null;await fs.writeFile(s,t.data,e),await fs.writeFile(i,JSON.stringify(t.info),"utf8")}catch(e){}}async remove(e){const{cacheFile:t,infoFile:a}=this.getFilePath(e);try{await fs.unlink(t),await fs.unlink(a)}catch(e){}}async clean(){const e=fs.readdirSync(this.cachePath),t=new taskmanager_1.default({poolLimit:10,breakWhenError:!1});for(const a of e)t.addTask(this._cleanTask,a);await t.runAllAsync()}}class FakePersistCache{async get(e){return{}}async set(e,t){}async remove(e){}async clean(){}}class LogicPersistCache{constructor(e,t,a){this.baseCacheKey=a,this.project=e,this.persistCache=t?new PersistCache(this.project,t):new FakePersistCache}updateBaseCacheKey(e){this.baseCacheKey!==e&&(this.persistCache.clean(),this.baseCacheKey=e)}getCacheKey(e){return`${e.independentRoot}|${e.source}`}async get(e,t,a){var s;const i=path_1.default.posix.join(e,t,a.path),c=path_1.default.posix.join(e,t,a.source),n=await this.persistCache.get(i);if((null===(s=n.info)||void 0===s?void 0:s.baseCacheKey)===this.baseCacheKey){if(n.info&&n.info.cacheKey===this.getCacheKey(a)){const e=fs.statSync(c);if(n.info.mtimeMs===e.mtimeMs)try{return JSON.parse(n.data)}catch(e){this.persistCache.remove(i)}}}else this.persistCache.remove(i)}async set(e,t,a,s){const i=path_1.default.posix.join(e,t,a.path),c=path_1.default.posix.join(e,t,a.source),n=fs.statSync(c);this.persistCache.set(i,{info:{encoding:"utf8",cacheKey:this.getCacheKey(a),baseCacheKey:this.baseCacheKey,mtimeMs:n.mtimeMs},data:JSON.stringify(s)})}async clean(){this.persistCache.clean()}}exports.default=LogicPersistCache;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),fs=tslib_1.__importStar(require("fs-extra")),tools_1=require("../../../utils/tools"),taskmanager_1=tslib_1.__importDefault(require("../../../utils/taskmanager"));class PersistCache{constructor(e,t){this.project=e,this.cachePath=t,this._cleanTask=e=>{fs.unlink(path_1.default.join(this.cachePath,e))}}getFilePath(e){const t=(0,tools_1.generateMD5)(e);return{cacheFile:path_1.default.join(this.cachePath,t),infoFile:path_1.default.join(this.cachePath,`${t}.json`)}}async get(e){const{cacheFile:t,infoFile:a}=this.getFilePath(e);try{const e=await fs.readFile(a,"utf8"),s=JSON.parse(e);return{data:await fs.readFile(t,{encoding:s.encoding||null}),info:s}}catch(e){}return{}}async set(e,t){var a;const{cacheFile:s,infoFile:i}=this.getFilePath(e);try{const e=(null===(a=t.info)||void 0===a?void 0:a.encoding)||null;await fs.writeFile(s,t.data,e),await fs.writeFile(i,JSON.stringify(t.info),"utf8")}catch(e){}}async remove(e){const{cacheFile:t,infoFile:a}=this.getFilePath(e);try{await fs.unlink(t),await fs.unlink(a)}catch(e){}}async clean(){const e=fs.readdirSync(this.cachePath),t=new taskmanager_1.default({poolLimit:10,breakWhenError:!1});for(const a of e)t.addTask(this._cleanTask,a);await t.runAllAsync()}}class FakePersistCache{async get(e){return{}}async set(e,t){}async remove(e){}async clean(){}}class LogicPersistCache{constructor(e,t,a){this.baseCacheKey=a,this.project=e,this.persistCache=t?new PersistCache(this.project,t):new FakePersistCache}updateBaseCacheKey(e){this.baseCacheKey!==e&&(this.persistCache.clean(),this.baseCacheKey=e)}getCacheKey(e){return`${e.independentRoot}|${e.source}`}async get(e,t,a){var s;const i=path_1.default.posix.join(e,t,a.path),c=path_1.default.posix.join(e,t,a.source),n=await this.persistCache.get(i);if((null===(s=n.info)||void 0===s?void 0:s.baseCacheKey)===this.baseCacheKey){if(n.info&&n.info.cacheKey===this.getCacheKey(a)){const e=fs.statSync(c);if(n.info.mtimeMs===e.mtimeMs)try{return JSON.parse(n.data)}catch(e){this.persistCache.remove(i)}}}else this.persistCache.remove(i)}async set(e,t,a,s){const i=path_1.default.posix.join(e,t,a.path),c=path_1.default.posix.join(e,t,a.source),n=fs.statSync(c);this.persistCache.set(i,{info:{encoding:"utf8",cacheKey:this.getCacheKey(a),baseCacheKey:this.baseCacheKey,mtimeMs:n.mtimeMs},data:JSON.stringify(s)})}async clean(){this.persistCache.clean()}}exports.default=LogicPersistCache;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.allPipes=exports.runPipeTask=exports.PipeContext=exports.PipeCPProject=exports.PipeManager=void 0;var pipeManager_1=require("./pipeManager");Object.defineProperty(exports,"PipeManager",{enumerable:!0,get:function(){return pipeManager_1.PipeManager}});var pipeCPProject_1=require("./pipeCPProject");Object.defineProperty(exports,"PipeCPProject",{enumerable:!0,get:function(){return pipeCPProject_1.PipeCPProject}});var pipeContext_1=require("./pipeContext");Object.defineProperty(exports,"PipeContext",{enumerable:!0,get:function(){return pipeContext_1.PipeContext}});var pipeWorker_1=require("./pipeWorker");Object.defineProperty(exports,"runPipeTask",{enumerable:!0,get:function(){return pipeWorker_1.runPipeTask}});var index_1=require("./pipes/index");Object.defineProperty(exports,"allPipes",{enumerable:!0,get:function(){return index_1.allPipes}});
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipeCPProject=void 0;const tools_1=require("../../../../utils/tools"),baseProject_1=require("../../../../project/baseProject");class PipeCPProject extends baseProject_1.BaseProject{constructor(t){super(),this._projectPath=(0,tools_1.normalizePath)(t.projectPath),this._appid=t.appid,this._attr=t.attr,this._type=this.getProjectType(t.attr,t.type),this._miniprogramRoot=t.miniprogramRoot,this._pluginRoot=t.pluginRoot,this._projectArchitecture=t.projectArchitecture,this.setting=t.setting,this.backendProjectContext=t.backendProjectContext,this.projectContext=t.projectContext}init(){}updateFileAndDirs(){}static async serializeForPipe(t){const e=await t.serialize();return{appid:e.appid,attr:e.attr,type:e.type,projectPath:e.projectPath,projectArchitecture:e.projectArchitecture,miniprogramRoot:e.miniprogramRoot,pluginRoot:e.pluginRoot,setting:e.setting}}}exports.PipeCPProject=PipeCPProject;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipeContext=void 0;const tslib_1=require("tslib"),getservice_1=tslib_1.__importDefault(require("../../../../services/common/getservice"));let requestIdCounter=0;function genRequestId(){return`pipe-req-${++requestIdCounter}-${Date.now()}`}class PipeContext{constructor(e,t){this.project=e,this.sendRequest=t}async requestPipe(e,t){const r=genRequestId(),s=await this.sendRequest({type:"pipe",requestId:r,name:e,params:t});if(s.error)throw new Error(s.error.message);return s.data}async callCompiler(e,...t){const r=genRequestId(),s=await this.sendRequest({type:"compiler",requestId:r,method:e,args:t});if(s.error)throw new Error(s.error.message);return s.data}getService(e){return(0,getservice_1.default)(e)}}exports.PipeContext=PipeContext;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipeManager=void 0;const workerThread_1=require("../../original/workerThread"),config_1=require("../../original/workerThread/config"),pipeCPProject_1=require("./pipeCPProject"),DEFAULT_PIPE_TIMEOUT=6e4;class PipeManager{constructor(e){this.compiler=e}async executePipe(e,r){return this.runPipeTask(e,r)}async handlePipeIPC(e,r){if("compiler"===e.type)return this.executeCompilerMethod(e.method,e.args,r);if("pipe"===e.type)return this.runPipeTask({pipeName:e.name,params:e.params},r);throw new Error(`unknown pipe request type: ${e.type}`)}destroy(){}async executeCompilerMethod(e,r,t){const o=this.compiler[e];if("function"!=typeof o)throw new Error(`SummerCompiler has no method "${e}"`);return o.call(this.compiler,...r,t)}async runPipeTask(e,r){const{pipeName:t,params:o,backendProjectContext:i,projectContext:p}=e,n=this.compiler.project,a=await pipeCPProject_1.PipeCPProject.serializeForPipe(n);i&&(a.backendProjectContext=i),p&&(a.projectContext=p);const s={pipeName:t,params:o,projectInfo:a||{}},c=await promiseWithTimeout((0,workerThread_1.runTask)(config_1.TASK_NAME.PIPE_TASK,s),6e4,t);if(c.error){const e=c.error;throw"string"==typeof e?new Error(e):Object.assign(new Error(e.message||"pipe task error"),e)}return c.result}}function promiseWithTimeout(e,r,t){return new Promise(((o,i)=>{const p=setTimeout((()=>{i(new Error(`pipe "${t}" timed out after ${r}ms`))}),r);e.then((e=>{clearTimeout(p),o(e)}),(e=>{clearTimeout(p),i(e)}))}))}exports.PipeManager=PipeManager;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.runPipeTask=runPipeTask;const call_func_1=require("../../original/workerThread/task/call_func"),pipeCPProject_1=require("./pipeCPProject"),pipeContext_1=require("./pipeContext"),index_1=require("./pipes/index"),pipeRegistry=new Map;for(const e of index_1.allPipes)pipeRegistry.set(e.name,e);async function runPipeTask(e){const{pipeName:r,params:t,projectInfo:s}=e,i=pipeRegistry.get(r);if(!i)return{error:{message:`pipe "${r}" is not registered in worker`}};try{const e=new pipeCPProject_1.PipeCPProject(s),r=new pipeContext_1.PipeContext(e,sendRequestToSummerProcess);return{result:await i.execute(r,t)}}catch(e){return{error:{code:e.code||-1,message:e.message||String(e),stack:e.stack||""}}}}async function sendRequestToSummerProcess(e){try{const r=await(0,call_func_1.call)("handlePipeIPC",e);return{requestId:e.requestId,data:r}}catch(r){return{requestId:e.requestId,error:{code:-1,message:"string"==typeof r?r:r.message||String(r),stack:"string"==typeof r?"":r.stack||""}}}}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.appservicePipe=void 0,exports.getAppserviceCore=getAppserviceCore;const getAppService_1=require("../utils/appdevserver/getAppService"),monitor_1=require("../../../../../../bussinessMonitor/monitor"),types_1=require("../../types"),getMainPkgSortedJSFiles=require("../utils/appservice/getmainpkgsortedjsfiles"),transwxmltojs=require("../utils/trans/transwxmltojs");async function getAppserviceCore(e){var t;const o=Date.now(),i=e.project.projectContext;(0,monitor_1.BusinessReport)("appserviceCompile","compile start",JSON.stringify({options:i}));try{const n=[];(0,getAppService_1.getInitJS)(n);const s=Date.now(),r=await getWXMLJS(e,n),p=Date.now()-s;(0,monitor_1.BusinessReport)("appserviceCompile","wxml compiled",JSON.stringify({options:i,duration:p,codeLength:null===(t=r.code)||void 0===t?void 0:t.length}));const a=Date.now(),{hasAppJS:c,pageFiles:l,componentFiles:u,functionalPageFiles:g,otherFiles:d,allFiles:v}=await getMainPkgSortedJSFiles(e),m=Date.now()-a;(0,monitor_1.BusinessReport)("appserviceCompile","js files sorted",JSON.stringify({options:i,duration:m,hasAppJS:c,pageCount:(null==l?void 0:l.length)||0,componentCount:(null==u?void 0:u.length)||0,totalCount:(null==v?void 0:v.length)||0}));const S=Date.now();await(0,getAppService_1.getJSCodeBuild)(e,n,c,l,u,g,d,v);const w=Date.now()-S;(0,monitor_1.BusinessReport)("appserviceCompile","js code built",JSON.stringify({options:i,duration:w,fileCount:(null==v?void 0:v.length)||0}));const C=Date.now();await(0,getAppService_1.getAppCode)(e,n,r,u,l);const f=Date.now()-C;(0,monitor_1.BusinessReport)("appserviceCompile","appcode generated",JSON.stringify({options:i,duration:f}));const J=n.join("\n"),_=Date.now()-o;return(0,monitor_1.BusinessReport)("appserviceCompile","compile success",JSON.stringify({options:i,totalDuration:_,scriptCount:n.length,contentLength:J.length})),J}catch(e){const t=Date.now()-o;throw(0,monitor_1.BusinessReport)("appserviceCompile","compile failed",JSON.stringify({options:i,duration:t,error:e instanceof Error?e.message:String(e)})),e}}async function getWXMLJS(e,t){const o=await transwxmltojs.transWXMLToJS(e,{app:!0,cut:!0});return t.push(o.code),o}exports.appservicePipe={name:types_1.EPipeCMD.APPSERVICE,execute:async(e,t)=>await getAppserviceCore(e)};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileWxmlToGlassEaselPipe=void 0;const compilewxmlService_1=require("../../../../../services/compilewxml/common/compilewxmlService"),types_1=require("../types");exports.compileWxmlToGlassEaselPipe={name:types_1.EPipeCMD.TRANS_WXML_TO_GLASS_EASEL,execute:async(e,l)=>await e.getService(compilewxmlService_1.ICompilewxmlService).compileWxmlToGlassEasel(l)};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileWxssPipe=void 0;const compilewxssService_1=require("../../../../../services/compilewxss/common/compilewxssService"),types_1=require("../types");exports.compileWxssPipe={name:types_1.EPipeCMD.COMPILE_WXSS,execute:async(e,s)=>await e.getService(compilewxssService_1.ICompilewxssService).compileWxss(s)};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.allPipes=void 0;const wccPipe_1=require("./wccPipe"),compileWxmlToGlassEaselPipe_1=require("./compileWxmlToGlassEaselPipe"),compileWxssPipe_1=require("./compileWxssPipe");exports.allPipes=[wccPipe_1.wccPipe,compileWxmlToGlassEaselPipe_1.compileWxmlToGlassEaselPipe,compileWxssPipe_1.compileWxssPipe];
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pageInitSourcePipe=exports.getPageInitResourceCore=exports.getPageInitResource=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),monitor_1=require("../../../../../../bussinessMonitor/monitor"),types_1=require("../../types"),funcName="$gwx",getPageInitResource=async function(e,t){const n=path_1.default.join("app",t);return(0,exports.getPageInitResourceCore)(e,n)};exports.getPageInitResource=getPageInitResource;const getPageInitResourceCore=async function(e,t){var n;const o=Date.now(),r=null===(n=e.project.projectContext)||void 0===n?void 0:n.projectId;(0,monitor_1.BusinessReport)("pageInitSourceCompile","compile start",JSON.stringify({projectId:r,filePath:t}));try{const e=t.slice(4,t.length-5),n=`\n <style> </style> <page></page>\n <script>\n var __setCssStartTime__ = Date.now();\n __wxAppCode__['${e}.wxss']();\n var __setCssEndTime__ = Date.now();\n (function() {\n var gf = ${"$gwx"}( './${e}.wxml' );\n\n if (window.__wxAppCodeReadyCallback__) {\n window.__wxAppCodeReadyCallback__(gf);\n } else {\n document.dispatchEvent(new CustomEvent( "generateFuncReady", {\n detail: {\n generateFunc: gf\n }\n }));\n }\n })();\n <\/script>`,i=Date.now()-o;return(0,monitor_1.BusinessReport)("pageInitSourceCompile","compile success",JSON.stringify({projectId:r,filePath:t,rawPath:e,duration:i,contentLength:n.length})),n}catch(e){const n=Date.now()-o;throw(0,monitor_1.BusinessReport)("pageInitSourceCompile","compile failed",JSON.stringify({projectId:r,filePath:t,duration:n,error:e instanceof Error?e.message:String(e)})),e}};exports.getPageInitResourceCore=getPageInitResourceCore,exports.pageInitSourcePipe={name:types_1.EPipeCMD.PAGE_INIT_SOURCE,async execute(e,t){const{filepath:n}=t;return await(0,exports.getPageInitResource)(e,n)}};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pageframePipe=void 0,exports.getPageframeCore=getPageframeCore;const tools_1=require("../utils/common/tools"),getwxappcode_1=require("../utils/appdevserver/getwxappcode"),monitor_1=require("../../../../../../bussinessMonitor/monitor"),types_1=require("../../types"),transwxmltojs=require("../utils/trans/transwxmltojs"),transwxsstojs=require("../utils/trans/transwxsstojs");async function getPageframeCore(e,t=!1){var o,n;const a=Date.now(),i=e.project.projectContext;(0,monitor_1.BusinessReport)("pageframeCompile","compile start",JSON.stringify({options:i,isMultiPkg:t}));try{const s=[];t||s.push('\n <!DOCTYPE html>\n <html lang="zh-CN">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />\n <meta http-equiv="Content-Security-Policy" content="script-src \'self\' \'unsafe-inline\' \'unsafe-eval\'">\n <link rel="icon" href="data:image/ico;base64,aWNv">\n <script>'),s.push("\n var __mainPageFrameReady__ = window.__mainPageFrameReady__ || function(){}; var __pageFrameStartTime__ = __pageFrameStartTime__ || Date.now(); var __webviewId__ = __webviewId__;\n var __wxAppCode__ = __wxAppCode__ || {}; var __WXML_GLOBAL__ = __WXML_GLOBAL__ || {entrys:{},defines:{},modules:{},ops:[],wxs_nf_init:undefined,total_ops:0}; var __vd_version_info__=__vd_version_info__||{};");const r=Date.now(),p=await transwxmltojs.transWXMLToJS(e,{app:!0});s.push(p.code);const _=Date.now()-r;(0,monitor_1.BusinessReport)("pageframeCompile","wxml compiled",JSON.stringify({options:i,duration:_,codeLength:null===(o=p.code)||void 0===o?void 0:o.length}));const m=Date.now(),l=await transwxsstojs.transWXSSToJS(e,{app:!0});s.push((0,tools_1.wrapCodeByEval)(l.comm));const c=Date.now()-m;(0,monitor_1.BusinessReport)("pageframeCompile","wxss compiled",JSON.stringify({options:i,duration:c,codeLength:null===(n=l.comm)||void 0===n?void 0:n.length}));const d=Date.now(),u=await(0,getwxappcode_1.getPageFrameWxAppCode)(e,{app:!0,noJson:!0});s.push(`;(window.eval || __global.__hackEval)(\`${u}\`)`);const g=Date.now()-d;(0,monitor_1.BusinessReport)("pageframeCompile","wxappcode generated",JSON.stringify({options:i,duration:g,codeLength:null==u?void 0:u.length})),s.push(";__mainPageFrameReady__() ;var __pageFrameEndTime__ = Date.now()"),t||s.push("<\/script> </head> <body> <div></div> </body> </html>");const w=Date.now()-a;return(0,monitor_1.BusinessReport)("pageframeCompile","compile success",JSON.stringify({options:i,totalDuration:w,scriptCount:s.length,totalLength:s.join("").length})),s.join("\n\n")}catch(e){const t=Date.now()-a;throw(0,monitor_1.BusinessReport)("pageframeCompile","compile failed",JSON.stringify({options:i,duration:t,error:e instanceof Error?e.message:String(e)})),e}}exports.pageframePipe={name:types_1.EPipeCMD.PAGEFRAME,async execute(e,t){const{isMultiPkg:o=!1}=t||{};return await getPageframeCore(e,o)}};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getInitJS=getInitJS,exports.getJSCodeBuild=getJSCodeBuild,exports.getBabelCodeByName=getBabelCodeByName,exports.getBabelHelperAndDepsCode=getBabelHelperAndDepsCode,exports.getAppCode=getAppCode;const tslib_1=require("tslib"),taskmanager_1=tslib_1.__importDefault(require("../../../../../../../utils/taskmanager")),tools_1=require("../../../../../../../build-server/tasks/common/utils/common/tools"),babelhelpers_1=require("../../../../../../../build-server/tasks/common/utils/babel/babelhelpers"),concat=require("licia/concat"),isEmpty=require("licia/isEmpty"),unique=require("licia/unique"),weappConfig=require("../../../../../../../build-server/tasks/common/weapp.config"),getJsFile=require("../appservice/getjsfile"),appserviceGetwxappcode=require("../appservice/getwxappcode");function getInitJS(e){e.push('\n var __wxAppData = __wxAppData || {};\n var __wxRoute = __wxRoute || "";\n var __wxRouteBegin = __wxRouteBegin || "";\n var __wxAppCode__ = __wxAppCode__ || {};\n var global = global || {};\n var __WXML_GLOBAL__=__WXML_GLOBAL__ || {};\n var __wxAppCurrentFile__=__wxAppCurrentFile__||"";\n var Component = Component || function(){};\n var definePlugin = definePlugin || function(){};\n var requirePlugin = requirePlugin || function(){};\n var Behavior = Behavior || function(){};\n var __vd_version_info__ = __vd_version_info__ || {};\n ')}async function getJSCodeBuild(e,n,r,t,o,a,i,p){const s=p.map((e=>`${e}.js`)),l=await Promise.all(s.map((n=>getJsFile(e,n,{}))));let u=[],_=[l.map((e=>(e.helpers&&(u=concat(u,e.helpers)),e.code))).join("\n")];const c=await getBabelHelperAndDepsCode(e,u);_=concat(Array.from(c.values()),_),n.push(_.join("\n")),r&&n.push("\n try {\n require(\"app.js\")\n } catch (error) {\n !error.from && console.error('app.js错误:\\n',error)\n throw error\n }")}async function getBabelCodeByName(e,n){return wrapFN(`${n}.js`,await(0,babelhelpers_1.getHelperContent)(e.project.setting,n))}async function getBabelHelperAndDepsCode(e,n){if(!isEmpty(n)){n=unique(n);const r=(0,babelhelpers_1.getHelperDeps)(e.project,new Set(n)),t=new Map;for(const n of r){const r=await getBabelCodeByName(e,n);t.set(n,r)}return t}return new Map}async function getAppCode(e,n,r,t,o){const a=new taskmanager_1.default;for(const i of t.concat(o)){const t=async function(){n.push(await appserviceGetwxappcode.getWxAppCodeOfPage(e,i,r.name))};a.addTask(t)}await a.runAllAsync()}function wrapFN(e,n){return`define("${(0,tools_1.escapeQuot)(e,'"')}", function(require, module, exports, ${weappConfig.NO_BOM_VAR.join(",")}){ ${n} \n})`}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPageFrameWxAppCode=getPageFrameWxAppCode;const customComponent=require("../project/customcomponent"),appConfigHelper=require("../project/appconfig"),transwxsstojs=require("../trans/transwxsstojs");async function getWxAppCodeWxmlOfPage(e,t){const o=[],p=encodeURI(e);return o.push(`__wxAppCode__[decodeURI("${p}") + ".wxml"]=${t}("./" + decodeURI("${p}") + ".wxml")`),o}async function getWxAppCodeWxssOfPage(e,t){const o=[],p=await transwxsstojs.transWXSSToJS(e,{page:t});if(p.page){const e=encodeURI(t);o.push(`__wxAppCode__[decodeURI("${e}") + ".wxss"]=${p.page}`)}return o}async function getPageFrameWxAppCode(e,t={}){const o=await appConfigHelper.getAppConfig(e),{app:p,page:s}=t;let n;if(!p&&(n=void 0,!n))return"";const a=await customComponent.getFileListJustInPack(e,o,n),r=[];for(let o=0,p=a.length;o<p;o++){const p=await getWxAppCodeWxmlOfPage(a[o],"$gwx");if(r.push(...p),!t.noWXSS){const t=await getWxAppCodeWxssOfPage(e,a[o]);r.push(...t)}}return r.join("\n")}
@@ -0,0 +1 @@
1
+ "use strict";const babelhelpers_1=require("../../../../../../../build-server/tasks/common/utils/babel/babelhelpers"),transformsourcemap_1=require("../../../../../../../build-server/tasks/common/utils/transformsourcemap"),generatecode_utils_1=require("../../../../../../../build-server/tasks/common/utils/project/generatecode.utils"),fileRules=require("../../../../../../../build-server/tasks/common/utils/filerules"),_=require("lodash");function transformMap2(e){if(e)try{let t="string"==typeof e?JSON.parse(e):e;return t=Object.assign(Object.assign({},t),{mappings:`;${t.mappings}`,sources:(0,transformsourcemap_1.transformSourceMapSources)(t.sources)}),t}catch(e){}return""}function wrapDefine(e,t,s){const r=transformMap2(t.map||""),i=s.hideRules||[];let o=(0,generatecode_utils_1.wrapSourceCodeInDefine)(e,`\n${t.code}`);return o=(0,generatecode_utils_1.inlineSourceMap)(o,!fileRules.isFileHidedInDevtools(e,i)&&r||"",s.sourceURL),{code:o,map:r}}async function getRuntimeJS(e,t){var s,r,i;const o=e.project,n=("miniProgram"===t.type||"game"===t.type?o.miniprogramRoot:o.pluginRoot)||"",{fileName:l}=t,a=await(0,babelhelpers_1.tryGetHelperJSFile)(o,l,t.injectHelpersSync);if(a)return{code:a,helpers:[],customTranslated:!1,isBabelIgnore:!1,needCompile:!1,isLargeFile:!1};const c=(0,babelhelpers_1.getHelperOutputPath)(o.setting),u=await e.callCompiler("compileJS",{root:n,filePath:l,babelRoot:c,setting:{enhance:null===(s=o.setting)||void 0===s?void 0:s.enhance,es6:null===(r=o.setting)||void 0===r?void 0:r.es6,minify:!1,disableUseStrict:!!o.setting.disableUseStrict,compileWorklet:!!o.setting.compileWorklet},resultType:"dev"}),p=wrapDefine(l,u,{hideRules:(null===(i=o.debugOptions)||void 0===i?void 0:i.hidedInDevtools)||[],sourceURL:t.sourceURL});return _.cloneDeep(Object.assign(Object.assign(Object.assign({},u),p),{helpers:u.helpers||[]}))}async function getJsFile(e,t,s={injectHelpers:!0}){t=decodeURI(t);const r=await getRuntimeJS(e,{type:"miniProgram",fileName:t});return{code:r.code,helpers:r.helpers,map:r.map,mtime:r.mtime}}module.exports=getJsFile;
@@ -0,0 +1 @@
1
+ "use strict";const tslib_1=require("tslib"),compile_1=tslib_1.__importDefault(require("../../../../../../../build-server/tasks/common/utils/cache/compile")),reporter_1=require("../../../../../../../build-server/tasks/common/utils/cache/reporter"),appConfigHelper=require("../project/appconfig"),getMainPkgSortedJSFiles=async e=>{let t=await compile_1.default.get("getMainPkgSortedJSFiles");if(t)return reporter_1.compileCacheReporter.hitCache("getMainPkgSortedJSFiles"),t;reporter_1.compileCacheReporter.startGenCache("getMainPkgSortedJSFiles");const i=await appConfigHelper.getAppConfig(e),r=await e.callCompiler("getMainPkgSortedJSFiles");if(i.functionalPages){const e=r.functionalPageFiles.map((e=>`__wx__/${e}`));e.unshift("__wx__/functional-page"),r.functionalPageFiles=e}return t=r,await compile_1.default.set("getMainPkgSortedJSFiles",t),reporter_1.compileCacheReporter.finishGenCache("getMainPkgSortedJSFiles"),t};module.exports=getMainPkgSortedJSFiles;
@@ -0,0 +1 @@
1
+ "use strict";const tslib_1=require("tslib"),taskmanager_1=tslib_1.__importDefault(require("../../../../../../../utils/taskmanager")),tools_1=require("../../../../../../../build-server/tasks/common/utils/common/tools"),compile_1=tslib_1.__importStar(require("../../../../../../../build-server/tasks/common/utils/cache/compile")),reporter_1=require("../../../../../../../build-server/tasks/common/utils/cache/reporter"),getWxAppCodeJSON=require("../project/wxappcodejson"),customComponent=require("../project/customcomponent");async function getWxAppCode(e,r=!0){let o=await compile_1.default.get(compile_1.CacheKey.miniProgramAppServiceWXAppCode);if(o)return reporter_1.compileCacheReporter.hitCache(compile_1.CacheKey.miniProgramAppServiceWXAppCode),o;reporter_1.compileCacheReporter.startGenCache(compile_1.CacheKey.miniProgramAppServiceWXAppCode);const t=await(await Promise.resolve().then((()=>tslib_1.__importStar(require("../project/appconfig"))))).getAppConfig(e),p=await customComponent.getFileListJustInPack(e,t),a=[],i=new taskmanager_1.default;for(const o of p)i.addTask(getWxAppCodeOfPage,e,o,"$gwx",r);return a.push(...await i.runAllAsync()),o=(0,tools_1.escapeScript)(a.join("\n")),await compile_1.default.set(compile_1.CacheKey.miniProgramAppServiceWXAppCode,o),reporter_1.compileCacheReporter.finishGenCache(compile_1.CacheKey.miniProgramAppServiceWXAppCode),o}async function getWxAppCodeOfPage(e,r,o,t=!0){let p={};try{p=await getWxAppCodeJSON(e,decodeURI(r))}catch(e){p={}}let a=`\n var decodePathName = decodeURI("${(0,tools_1.escapeQuot)(r,'"')}")\n __wxAppCode__[decodePathName + ".json"] = ${JSON.stringify(p)}\n __wxAppCode__[decodePathName + ".wxml"] = ${o}("./" + decodePathName + ".wxml")\n `;return t&&(a+="\n __wxRoute = decodePathName\n __wxRouteBegin = true\n __wxAppCurrentFile__ = decodePathName + \".js\"\n try {\n require(__wxAppCurrentFile__)\n } catch (error) {\n // 插件项目不能hack define和require,走这里,异常只能精准到页面,内部的多层依赖的报错无法精准\n !error.from && console.error('页面【' + decodePathName + ']错误:\\n',error)\n throw error\n }"),a}module.exports={getWxAppCode:getWxAppCode,getWxAppCodeOfPage:getWxAppCodeOfPage};
@@ -0,0 +1 @@
1
+ "use strict";const appErrCode={APP_JSON_READ_ERR:10001,APP_JSON_PARSE_ERR:10002,APP_JSON_PAGES_ERR:10003,APP_JSON_ENTRANCE_NOT_FOUND_ERR:1004,APP_JSON_CONTENT_ERR:10005,PAGES_JSON_PARSE_ERR:10006,APP_JSON_WXML_NOT_FOUND:10007,APP_JSON_JS_NOT_FOUND:10008,JSON_CONTENT_ERR:10009,EXT_JSON_PARSE_ERR:10011,EXT_JSON_PAGES_ERR:10012,EXT_JSON_CONTENT_ERR:10013,APPSERVICE_LOSE_WXML:10021,APPSERVICE_LOSE_JS:10022,FILE_NOT_UTF8:10031,BABEL_TRANS_JS_ERR:10032,UGLIFY_JS_ERR:10033,BABILI_JS_ERR:10034,JS_ES6_ERR:10035,FILE_FLAT_ERR:10036,POST_WXSS_ERR:10037,TRANS_WXML_JS_ERR:10040,TRANS_WXSS_JS_ERR:10041,SUMMER_PLUGIN_ERR:10045,SUMMER_PLUGIN_CODE_ERR:10046,VENDOR_MD5_NOT_MATCH:10050,VENDOR_WCC_FILE_NOT_FOUND:10051,VENDOR_WCSC_FILE_NOT_FOUND:10052,CODE_SIZE_EXCEED:10060,GET_GEO_LOCATION_ERR:10070,QCLOUD_SVR_NO_FOUND_ERR:10080,QCLOUD_SVR_POLL_TIMEOUT:10081,QCLOUD_SVR_POLL_DOING:10082,QCLOUD_SVR_UP_DIR_CHECK:10083,PLUGIN_JSON_READ_ERR:10091,PLUGIN_JSON_PARSE_ERR:10092,PLUGIN_JSON_CONTENT_ERR:10093,PLUGIN_PAGE_JSON_PARSE_ERR:10094,PLUGIN_JSON_FILE_NOT_FOUND:10095,PLUGIN_PAGE_JSON_CONTENT_ERR:10096,PLUGIN_TRANS_WXML_JS_ERR:10097,PLUGIN_TRANS_WXSS_JS_ERR:10101,PLUGIN_JS_ES6_ERR:10098,PLUGIN_ONLINE_CODE_UNPACK_ERR:10099,PAGE_JSON_PARSE_ERR:10020,SITE_MAP_JSON_CONTENT_ERROR:10100,CHECK_UPLOAD_STATUS_ERR:10200,CLEAR_SESSION_ERR:10201,GAME_CODE_LIB_MD5_ERR:10202,LOAD_QRCODE_OTHER_ERR:10203,JUMP_QCLOUD_PAGE_ERR:10204,PACK_NPM_ERR:10205,GET_PROJECT_CONFIG_ERR:10206,MINI_PROGRAM_CONSUME_TIMING:10207,MINI_GAME_CONSUME_TIMING:10208,UPLOAD_PROGRESS_FAIIL:10209,UPLOAD_PLUGIN_ERR:10210,UPLOAD_FAIILED:10211,COMPILE_CONDITION_APPID_ERR:10212,COMPILE_CONDITION_PROGRAM_ERR:10213,COMPILE_CONDITION_ERR:10214,COMPILE_CONDITION_ERR_WITH_DETAIL:10215,WIDGET_GET_SEARCH_QUERY_ERROR:10216,QCLOUD_CHOOSE_ENVIRONMENT_ERROR:10217,QCLOUD_UPLOAD_FAIL:10218,TOOLBAR_REMOTE_DEBUG_ERROR:10219,PREPROCESS_UPLOAD_ERROR:10220,DOWNLOAD_SOURCEMAP_ERROR:10221,SOURCEMAP_WRITE_ERROR:10222,CLEAN_USER_AUTH_ERROR:10223,JUMP_WXGIT_ERROR:10224,TCB_DELETE_FAILED:10225,FETCH_REMOTE_SETTING_ERROR:10226,UPLOAD_LOCAL_SETTING_ERROR:10227,UPLOAD_SOURCE_CODE_ERROR:10228,UPLOAD_EXCEED_SIZE_LIMIT:10230,PROJECT_CONFIG_JSON_ERROR:10231,TEST_CODE_RUN_ERROR:10232,AUTO_UPLOAD_ERROR:10233,CLOUD_UPLOAD_OPEN_ERROR:10234,CLOUD_BUILD_OPEN_ERROR:10201,WEBVIEW_NETWORK_ERROR:20010,APPSERVICE_NETWORK_ERROR:20011,PLUGIN_ERROR:20012,ONLINE_CODE_UNPACK_ERR:3e4,URL_SCHEME_INVALID_ERROR:31e3,URL_SCHEME_OTHER_ERROR:31001,APP_UPGRADE_ERROR:35e3,APP_ADD_AUTHO_PAGE_ERROR:35001};module.exports=appErrCode;
@@ -0,0 +1 @@
1
+ "use strict";function wrapCodeByEval(e){return`;(window.eval || __global.__hackEval)('${e}')`}Object.defineProperty(exports,"__esModule",{value:!0}),exports.wrapCodeByEval=wrapCodeByEval;
@@ -0,0 +1 @@
1
+ "use strict";const tslib_1=require("tslib"),storeService_1=require("../../../../../../../services/store/common/storeService"),getservice_1=tslib_1.__importDefault(require("../../../../../../../services/common/getservice")),tools_1=require("../../../../../../../build-server/tasks/common/utils/common/tools"),compile_1=tslib_1.__importStar(require("../../../../../../../build-server/tasks/common/utils/cache/compile")),reporter_1=require("../../../../../../../build-server/tasks/common/utils/cache/reporter"),theme_1=require("./helper/theme"),monitor_1=require("../../../../../../../bussinessMonitor/monitor"),path=require("path"),getCompiledAppJSON=require("./appjson"),getCompiledPageJSON=require("./pagejson");async function mergeThemeJSON(e){var o;const{project:i,isDarkMode:t,themeLocation:a,themeJSON:r,appConfig:n}=e,s=path.join(i.projectpath,i.miniprogramRoot||""),{windowConfigRules:c,tabbarRules:p,tabbarListItemRules:l}=(0,theme_1.checkThemeRules)(s,i);(0,theme_1.checkVariables)({isDarkMode:t,themeLocation:a,themeJSON:r,filePath:"app.json or ext.json",windowConfig:n.global.window,rules:c,keyPrefix:'["window"]',isPlugin:!1});for(const e in n.page){const o=e.replace(/\.html$/,"");(0,theme_1.checkVariables)({isDarkMode:t,themeLocation:a,themeJSON:r,filePath:`${o}.json`,windowConfig:n.page[e].window||{},rules:c,keyPrefix:"",isPlugin:!1})}if(n.tabBar){(0,theme_1.checkVariables)({isDarkMode:t,themeLocation:a,themeJSON:r,filePath:"app.json or ext.json",windowConfig:n.tabBar||{},rules:p,keyPrefix:'["tabBar"]',isPlugin:!1});for(let e=0;e<(null===(o=n.tabBar)||void 0===o?void 0:o.list.length);e++)(0,theme_1.checkVariables)({isDarkMode:t,themeLocation:a,themeJSON:r,filePath:"app.json or ext.json",windowConfig:n.tabBar.list[e],rules:l,keyPrefix:`["tabBar"]["list"][${e}]`,isPlugin:!1})}}function getAppConfigJSON(e,o){const i=e.subPackages||e.subpackages;return Object.assign(Object.assign({},e),{pages:e.pages||[],resizable:!!e.resizable,subPackages:i,debug:!!e.debug,widgets:e.widgets||[],customClose:!!e.customClose,workers:e.workers||"",cloud:!!e.cloud,global:{window:Object.assign(Object.assign({},(0,theme_1.getDefaultWindowConfig)(e.darkmode&&o)),e.window)},page:{},networkTimeout:Object.assign({request:6e4,uploadFile:6e4,connectSocket:6e4,downloadFile:6e4},e.networkTimeout),ext:e.ext||{},extAppid:e.extAppid||"",plugins:e.plugins||{},mainPlugins:Object.assign({},e.plugins),preloadRule:e.preloadRule,permission:e.permission,requiredBackgroundModes:e.requiredBackgroundModes,functionalPages:e.functionalPages,style:e.style,useExtendedLib:e.useExtendedLib||{},supportedMaterials:e.supportedMaterials||[],usingShopPlugin:e.usingShopPlugin||void 0,embeddedAppIdList:e.embeddedAppIdList,halfPage:e.halfPage,resolveAlias:e.resolveAlias,renderer:e.renderer,enablePassiveEvent:e.enablePassiveEvent,debugOptions:e.debugOptions,requiredPrivateInfos:e.requiredPrivateInfos||[],__warning__:e.__warning__||""})}async function checkAppConfig(e,o){const i=await getCompiledAppJSON(e),t=getAppConfigJSON(i,o),a=(e,o)=>{o.__warning__&&(t.__warning__&&(t.__warning__+="\n"),t.__warning__+=`${e}: ${o.__warning__}`)},r=t.pages;t.entryPagePath=i.entryPagePath?`${i.entryPagePath}.html`:`${r[0]}.html`;for(const o of r){const i=await getCompiledPageJSON(e,`${o}`)||{};a(o,i);const{singlePage:r}=i,n=tslib_1.__rest(i,["singlePage"]);t.page[`${o}.html`]={window:n||{},singlePage:r,renderer:i.renderer}}if(t.accountCardPackage)for(const e of t.accountCardPackage.cardList){const o=path.posix.join(t.accountCardPackage.root,e.componentPath);t.page[`${o}.html`]={window:{}}}t.page=Object.assign({},t.page);const n=Object.assign({},i.tabBar),s=[].concat(n.list||[]),c=[];for(const e of s){const o=Object.assign({},e);o.pagePath+=".html",c.push(o)}n.list=c,t.tabBar=n,i.darkmode&&(t.supportDarkmode=!0),t.lazyCodeLoading=i.lazyCodeLoading;t.publibSupportLazyload=false,t.isLazyLoad=!1;let p={};const{themeLocation:l}=i;return void 0!==l&&""!==l.trim().replace(/^\.\//,"")&&(p=await e.callCompiler("checkThemeJSON",{themeLocation:l})),await mergeThemeJSON({project:e.project,themeJSON:p,themeLocation:l,isDarkMode:i.darkmode&&o,appConfig:t}),t}async function checkLightAppConfig(e){var o,i;const t=(await(null===(i=(o=e.project).attr)||void 0===i?void 0:i.call(o))).platform;let a=await compile_1.default.get(compile_1.CacheKey.miniProgramAppConfig);if((null==a?void 0:a.value)&&a.platform===t)reporter_1.compileCacheReporter.hitCache(compile_1.CacheKey.miniProgramAppConfig);else{reporter_1.compileCacheReporter.startGenCache(compile_1.CacheKey.miniProgramAppConfig);const o=await checkAppConfig(e,!1);a={platform:t,value:(0,tools_1.makeDeepReadonly)(o)},await compile_1.default.set(compile_1.CacheKey.miniProgramAppConfig,a),reporter_1.compileCacheReporter.finishGenCache(compile_1.CacheKey.miniProgramAppConfig)}return a.value}async function checkDarkmodeAppConfig(e){var o,i;const t=(await(null===(i=(o=e.project).attr)||void 0===i?void 0:i.call(o))).platform;let a=await compile_1.default.get(compile_1.CacheKey.miniProgramAppConfigDarkMode);if((null==a?void 0:a.value)&&a.platform===t)reporter_1.compileCacheReporter.hitCache(compile_1.CacheKey.miniProgramAppConfigDarkMode);else{reporter_1.compileCacheReporter.startGenCache(compile_1.CacheKey.miniProgramAppConfigDarkMode);const o=await checkAppConfig(e,!0);a={platform:t,value:(0,tools_1.makeDeepReadonly)(o)},await compile_1.default.set(compile_1.CacheKey.miniProgramAppConfigDarkMode,a),reporter_1.compileCacheReporter.finishGenCache(compile_1.CacheKey.miniProgramAppConfigDarkMode)}return a.value}async function getAppConfig(e,o=!1){var i,t;const a=Date.now(),r=e.project.projectContext;(0,monitor_1.BusinessReport)("appconfig","getAppConfig start",JSON.stringify({options:r,forceDarkMode:o}));try{let n;const s=e.project.backendProjectContext;let c;n=s?s.compileOptions.deviceState.darkmode||!1:await(0,getservice_1.default)(storeService_1.IStoreService).getValue("toolbar","darkmode")||!1,c=n||o?await checkDarkmodeAppConfig(e):await checkLightAppConfig(e);const p=Date.now()-a;return(0,monitor_1.BusinessReport)("appconfig","getAppConfig success",JSON.stringify({options:r,duration:p,pageCount:(null===(i=c.pages)||void 0===i?void 0:i.length)||0,subPackageCount:(null===(t=c.subPackages||c.subpackages)||void 0===t?void 0:t.length)||0,hasDarkMode:!!n||o})),c}catch(e){const o=Date.now()-a;throw(0,monitor_1.BusinessReport)("appconfig","getAppConfig failed",JSON.stringify({options:r,duration:o,error:e instanceof Error?e.message:String(e)})),e}}module.exports={getAppConfig:getAppConfig};
@@ -0,0 +1 @@
1
+ "use strict";const tslib_1=require("tslib"),compile_1=tslib_1.__importStar(require("../../../../../../../build-server/tasks/common/utils/cache/compile")),reporter_1=require("../../../../../../../build-server/tasks/common/utils/cache/reporter"),getCompiledAppJSON=async e=>{let r=await compile_1.default.get(compile_1.CacheKey.miniProgramCompiledAppJSON);if(r)return reporter_1.compileCacheReporter.hitCache(compile_1.CacheKey.miniProgramCompiledAppJSON),r;reporter_1.compileCacheReporter.startGenCache(compile_1.CacheKey.miniProgramCompiledAppJSON);try{r=await e.callCompiler("getAppJSON")}catch(e){throw e.message=`app.json ${e.message}`,e}return await compile_1.default.set(compile_1.CacheKey.miniProgramCompiledAppJSON,r),reporter_1.compileCacheReporter.finishGenCache(compile_1.CacheKey.miniProgramCompiledAppJSON),r};module.exports=getCompiledAppJSON;
@@ -0,0 +1 @@
1
+ "use strict";const processPath_1=require("../web/processPath"),path=require("path"),friendlyPathMake=(o,t)=>path.posix.normalize(path.join(o,t).replace(/^\/+/,"")).replace(/\\/g,"/"),trailing=(o,t)=>o.endsWith(t)?o:o+t,unifyPath=o=>o.replace(/\\/g,"/"),findSubpackageForFile=(o,t)=>{let n;const e=t.subPackages||t.subpackages;if(Array.isArray(e))for(const t of e)if(t&&"string"==typeof t.root&&(0,processPath_1.isLeftSubPathOfRight)(o,trailing(t.root,"/"))){n=t;break}return n};async function getAllJSON(o){return(await o.callCompiler("getAllPageAndComponent")).map((o=>`${o}.json`))}const getCustomComponentsConfig=async(o,t)=>{const n=await getAllJSON(o),e=new Set;if(t.pages)for(const o of t.pages)e.add(o);const i=t.subPackages||t.subpackages;if(Array.isArray(i))for(const o of i)if(o&&"string"==typeof o.root&&Array.isArray(o.pages))for(const t of o.pages){const n=friendlyPathMake(o.root,String(t));e.add(n)}const s={};for(const e of n){const n=e.replace(/\.json$/,"");if("app"===(0,processPath_1.normalizePath)(n))continue;const i=await o.callCompiler("getPageJSON",n);if(i.usingComponents||i.componentGenerics||!0===i.component){const o=findSubpackageForFile(n,t);s[n]={config:o,file:e,pageJSON:i}}}for(const n of e)if(!s[n]){const e=await o.callCompiler("getPageJSON",n);s[n]={config:findSubpackageForFile(n,t),file:`${n}.json`,pageJSON:e||{}}}return s};async function getFileListJustInPack(o,t,n){const e=await getCustomComponentsConfig(o,t),i=[];for(const o in e){const t=e[o];n?t.config&&t.config.root===n.root&&i.push(o):t.config||i.push(o)}return[...i]}async function getWxssCompileConfig(o,t,n){return await getFileListJustInPack(o,t,n)}async function getWxmlCompileConfig(o,t,n){let e=[],i=0;const s=await getCustomComponentsConfig(o,t);for(const o in s){const t=s[o];if(!t)continue;if(!n&&t.config||n&&!t.config||n&&t.config&&n.root!==t.config.root)continue;const a=t.pageJSON;if(a&&(a.usingComponents||a.componentGenerics)){e.push(`./${o}.wxml`);const t=Object.assign(Object.assign({},a.usingComponents),a.componentGenerics);i++,e.push(Object.keys(t).length),e=e.concat(Object.keys(t))}}return e.unshift(i),e}async function getWxmlCompileLazyConfig(o,t,n){return(await getFileListJustInPack(o,t,n)).map((o=>`./${o}`))}module.exports={getFileListJustInPack:getFileListJustInPack,getWxssCompileConfig:getWxssCompileConfig,getWxmlCompileConfig:getWxmlCompileConfig,getWxmlCompileLazyConfig:getWxmlCompileLazyConfig,getCustomComponentsConfig:getCustomComponentsConfig,findSubpackageForFile:findSubpackageForFile};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkTabbarListItemIconPath=checkTabbarListItemIconPath,exports.checkThemeRules=checkThemeRules,exports.getDefaultWindowConfig=getDefaultWindowConfig,exports.checkVariables=checkVariables;const tslib_1=require("tslib"),locales_1=require("../../../../../../../../services/locales/common/locales"),getservice_1=tslib_1.__importDefault(require("../../../../../../../../services/common/getservice")),pluginFileReader_1=require("../../../../../../../../services/pluginFileReader/common/pluginFileReader"),path=require("path"),colorUtils=require("../../../../../../../../utils/colorutils"),appErrcodeConfig=require("../../common/apperrcode.config"),TABBAR_ICON_WHITE_LIST=[".png",".jpg",".jpeg"],localesService=(0,getservice_1.default)(locales_1.ILocalesService),locales=localesService.getLocales();function checkTabbarListItemIconPath(e,o,r){const t=[],i=(0,getservice_1.default)(pluginFileReader_1.IPluginFileReaderService).stat(r,o);if(!i)return t.push(locales.config.NOT_FOUND.format(e)),t;(r.setting||{}).MaxTabbarIconSize;i.mtimeMs;const a=path.extname(o);return TABBAR_ICON_WHITE_LIST.indexOf(a)<0&&t.push(locales.config.FILE_EXT_FORMAT_ERROR.format(e,TABBAR_ICON_WHITE_LIST.join("、"))),t}function throwError(e={msg:"",filePath:"app.json"}){const{msg:o,filePath:r}=e,t=new Error(o);throw t.code=appErrcodeConfig.JSON_CONTENT_ERR,t.path=r,t}function checkThemeRules(e,o){const r=(r,t)=>{const i=path.join(e,t),a=o?checkTabbarListItemIconPath(r,i,o):[];a.length>0&&throwError({msg:a.join("\n"),filePath:"app.json or ext.json"})};return{windowConfigRules:[{key:"navigationBarTextStyle",valids:["black","white"]},{key:"backgroundTextStyle",valids:["dark","light"]},{key:"navigationBarBackgroundColor",hexColor:!0},{key:"backgroundColor",hexColor:!0},{key:"backgroundColorTop",hexColor:!0},{key:"backgroundColorBottom",hexColor:!0}],tabbarRules:[{key:"selectedColor",hexColor:!0},{key:"color",hexColor:!0},{key:"backgroundColor",hexColor:!0},{key:"borderStyle",valids:["black","white"]}],tabbarListItemRules:[{key:"iconPath",validate:r},{key:"selectedIconPath",validate:r}]}}function getDefaultWindowConfig(e){return e?{backgroundColor:"#232323",backgroundTextStyle:"light"}:{backgroundColor:"#ffffff",backgroundTextStyle:"dark"}}function checkVariables(e){var o;const{windowConfig:r,themeLocation:t,filePath:i,isDarkMode:a,themeJSON:l,rules:c,keyPrefix:n,isPlugin:s=!1}=e,h=a?l.dark||{}:l.light||{},f=a?"dark":"light";for(const e of c)if((r[e.key]||"").startsWith("@")){const a=(null===(o=r[e.key])||void 0===o?void 0:o.slice(1))||"";if(a&&void 0===t){if(s)continue;throwError({msg:locales.config.THEME_JSON_SHOULD_EXIST.format(`${n}["${e.key}"]`,`"@${a}"`,'appJSON["themeLocation"]'),filePath:i})}const l=h[a];if(void 0===l){if(s)continue;throwError({msg:locales.config.JSON_VARIABLE_VALUE_NOT_FOUND.format(`${n}["${e.key}"]: "@${a}"`,`${t}["${f}"]`),filePath:i})}void 0!==l&&(Array.isArray(e.valids)&&e.valids.indexOf(l)<0&&throwError({msg:locales.config.THEME_JSON_VALUE_SHOULD_BE.format(`${t}["${f}"]["${a}"]`,`${i} ${n}["${e.key}"]`,`${JSON.stringify(e.valids)}`),filePath:t}),e.hexColor&&!colorUtils.isHexColor(l)&&throwError({msg:locales.config.THEME_JSON_VALUE_SHOULD_BE.format(`${t}["${f}"]["${a}"]`,`${i} ${n}["${e.key}"]`,"hexColor"),filePath:t}),e.validate&&e.validate(`${n}["${e.key}"]`,l),r[e.key]=l)}}
@@ -0,0 +1 @@
1
+ "use strict";const tslib_1=require("tslib"),registry_1=require("../../../../../../../build-server/tasks/common/utils/interfacebuilder/registry"),compile_1=tslib_1.__importStar(require("../../../../../../../build-server/tasks/common/utils/cache/compile")),reporter_1=require("../../../../../../../build-server/tasks/common/utils/cache/reporter"),path=require("path"),_=require("lodash"),getCompiledPageJSON=async(e,i)=>{const r=e.project,t=`${r.miniprogramRoot}${i}.json`,o=path.posix.join(r.projectpath,t);let a,s=await compile_1.default.get(compile_1.CacheKey.miniProgramCompiledPageJSON);if(s||(s={},await compile_1.default.set(compile_1.CacheKey.miniProgramCompiledPageJSON,s)),s[o]&&!r.isIB)return reporter_1.compileCacheReporter.hitCache(compile_1.CacheKey.miniProgramCompiledPageJSON),_.cloneDeep(s[o]);reporter_1.compileCacheReporter.startGenCache(compile_1.CacheKey.miniProgramCompiledPageJSON);try{a=await e.callCompiler("getPageJSON",i),a.usingComponents||(a.usingComponents={})}catch(e){throw e.message=`${t} ${e.message}`,e}if(r.isIB&&i.indexOf("miniprogram_npm")<0){const e=registry_1.interfaceBuilderRegistry.get(registry_1.IInterfaceBuilderRegistryType.getBussinessUsingComponents);if(e){const i=e(r,a);a=Object.assign(Object.assign({},a),{usingComponents:Object.assign(Object.assign({},a.usingComponents),i)})}}return s[o]=a,await compile_1.default.set(compile_1.CacheKey.miniProgramCompiledPageJSON,s),reporter_1.compileCacheReporter.finishGenCache(compile_1.CacheKey.miniProgramCompiledPageJSON),_.cloneDeep(s[o])};module.exports=getCompiledPageJSON;
@@ -0,0 +1 @@
1
+ "use strict";const tslib_1=require("tslib"),compile_1=tslib_1.__importStar(require("../../../../../../../build-server/tasks/common/utils/cache/compile")),reporter_1=require("../../../../../../../build-server/tasks/common/utils/cache/reporter"),_=require("lodash"),getCompiledPageJSON=require("./pagejson"),appConfigHelper=require("./appconfig");async function getWXAppCodeJSON(e,o){let i=await compile_1.default.get(compile_1.CacheKey.miniProgramWXAppCodeJSON);if(i||(i={},await compile_1.default.set(compile_1.CacheKey.miniProgramWXAppCodeJSON,i)),i[o]&&!e.project.isIB)return reporter_1.compileCacheReporter.hitCache(compile_1.CacheKey.miniProgramWXAppCodeJSON),_.cloneDeep(i[o]);reporter_1.compileCacheReporter.startGenCache(compile_1.CacheKey.miniProgramWXAppCodeJSON);const r=await appConfigHelper.getAppConfig(e),p=await getCompiledPageJSON(e,o);if(p.usingComponents&&Object.keys(p.usingComponents).length>0){const e={};for(const o in p.usingComponents){const i=p.usingComponents[o]||"";r.plugins?e[o]=i.replace(/^plugin:\/\/([^/]*)\/(.*)/,((e,o,i,p,t)=>{var n;const a=(null===(n=r.plugins)||void 0===n?void 0:n[o])||(void 0,void 0);return a?`plugin://${a.provider}/${i}`:t})):e[o]=i}p.usingComponents=e}return i[o]=p,await compile_1.default.set(compile_1.CacheKey.miniProgramWXAppCodeJSON,i),reporter_1.compileCacheReporter.finishGenCache(compile_1.CacheKey.miniProgramWXAppCodeJSON),_.cloneDeep(i[o])}module.exports=getWXAppCodeJSON;
@@ -0,0 +1 @@
1
+ "use strict";const processPath_1=require("../web/processPath"),types_1=require("../../../types"),TRANS_WXML_JS_ERR=10040,customComponent=require("../project/customcomponent"),appConfigHelper=require("../project/appconfig");async function addAccountCardCode(e){const{appConfig:t,config:o,replaceContent:n}=e;return Object.assign({},n)}async function getWxmlFilesForTrans(e,t){const{appConfig:o,config:n,lazyload:a}=t,i=await e.callCompiler("getPackageWxmlAndWxsFiles",(null==n?void 0:n.root)||"__APP__");let r=i.wxmlFiles,c=i.wxsFiles;Object.entries(i.content).forEach((([e,t])=>{e.startsWith("./")||(i.content[`./${e}`]=t)}));n&&a&&(r=r.filter((e=>(0,processPath_1.isLeftSubPathOfRight)(e,n.root))),c=c.filter((e=>(0,processPath_1.isLeftSubPathOfRight)(e,n.root))));let s=r.concat(c),l=!1;(null==c?void 0:c.length)>0&&(l=!0),s=s.map((e=>`./${e}`));let p={},f=!1;i&&(p=i.content);return{srcPath:e.project.miniprogramRoot||"",files:s,hasWxs:l,usePartialReplaceContent:f,partialEnable:false,replaceContent:p}}function formateError(e){const t=new Error(e.toString());return t.code=TRANS_WXML_JS_ERR,t.msgForConsole=(null==e?void 0:e.message)||e.toString(),t}async function wxmlToJS(e,t){try{return await _wxmlToJS(e,t)}catch(e){throw formateError(e)}}async function _wxmlToJS(e,t){const{appConfig:o,config:n,lazyload:a,cut:i}=t,{srcPath:r,files:c,hasWxs:s,usePartialReplaceContent:l,partialEnable:p,replaceContent:f}=await getWxmlFilesForTrans(e,t);if(0===c.length&&a)return{pages:{},names:{}};const g=n?`$${Buffer.from(n.root).toString("hex")}`:"$gwx",u=">_<"+Date.now()%1e4,m=(await customComponent.getWxmlCompileConfig(e,o,n)).join(u);let C="";if(a){let t=await customComponent.getWxmlCompileLazyConfig(e,o,n);if(p)if(l)t=["index"];else{const e=c.map((e=>e.replace(/^\.\//,"")));t=t.filter((t=>e.includes(`${t}.wxml`.replace(/^\.\//,""))))}C=t.join(u)}return a&&!C?{pages:{},names:{}}:await e.requestPipe(types_1.EPipeCMD.WCC,{files:c,isCut:i,lazyloadConfig:C,configSplit:u,configContent:m,hasWxs:s,genfuncName:g,cwd:r,replaceContent:f,isMiniAppProject:!1})}async function transWXMLToJS(e,t={}){const o=await appConfigHelper.getAppConfig(e),{app:n,page:a,cut:i,hotReloadFile:r}=t;let c;if(r){c=void 0;const{name:t,code:n}=await wxmlToJS(e,{appConfig:o,config:c,cut:i});return{name:t,code:n}}if(!n&&(c=null,!c))return{code:"",name:"$gwx"};const s=await wxmlToJS(e,{appConfig:o,config:c,cut:i}),{name:l,code:p}=s;return{name:l,code:p}}module.exports={transWXMLToJS:transWXMLToJS};
@@ -0,0 +1 @@
1
+ "use strict";const types_1=require("../../../types"),path=require("path"),appConfigHelper=require("../project/appconfig"),customComponent=require("../project/customcomponent");function formatError(o){const t=new Error(o.toString());return t.code=10041,t.msgForConsole=o.message,console.error(o.message),t}async function wxssToJS(o,t){try{return await _wxssToJS(o,t)}catch(o){if("CustomError"===(null==o?void 0:o.type))throw o;throw formatError(o)}}async function addAccountCardCode(o){const{appConfig:t,config:e,replaceContent:n}=o;return Object.assign({},n)}async function _wxssToJS(o,t){const{appConfig:e,config:n,lazyload:s}=t,a=await o.callCompiler("getPackageWxssFiles",(null==n?void 0:n.root)||"__APP__"),r=a.wxssFiles,c={};r.forEach((o=>{c[o]=a.content[o]||""})),Object.entries(c).forEach((([o,t])=>{o.startsWith("./")||(c[`./${o}`]=t)}));const i={};r.forEach((o=>{i[o]=!0}));const p=(null==n?void 0:n.pages.map((o=>path.posix.join(n.root,o))))||e.pages,l=[];let u=0;p.forEach((o=>{i[`${o}.wxss`]&&(u++,l.push(`./${o}.wxss`),delete i[`${o}.wxss`])}));(await customComponent.getWxssCompileConfig(o,e,n)).forEach((o=>{i[`${o}.wxss`]&&(u++,l.push(`./${o}.wxss`),delete i[`${o}.wxss`])}));for(const o in i)"app.wxss"===o&&0===u&&(u=1),l.push(`./${o}`);let f={};a&&(f=a.content),f=await addAccountCardCode({appConfig:e,config:n,replaceContent:f});const g=o.project.miniprogramRoot||"";return await o.requestPipe(types_1.EPipeCMD.COMPILE_WXSS,{pageCount:u,files:l,cwd:g,subPackage:null==n?void 0:n.root,lazyload:s,replaceContent:f})}async function transWXSSToJS(o,t={}){const e=await appConfigHelper.getAppConfig(o),{app:n,page:s,hotReloadFile:a}=t;if(a){const t=void 0,n=await wxssToJS(o,{appConfig:e,config:t});return{comm:n.comm,page:(null==n?void 0:n[`./${a}`])||""}}if(n){const t=await wxssToJS(o,{appConfig:e})||{};return{comm:(null==t?void 0:t.comm)||""}}const r=`./${s}.wxss`;{const t=await wxssToJS(o,{appConfig:e});return{comm:null==t?void 0:t.comm,page:(null==t?void 0:t[r])||""}}}module.exports={transWXSSToJS:transWXSSToJS};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.normalizePath=normalizePath,exports.isLeftSubPathOfRight=isLeftSubPathOfRight;const tslib_1=require("tslib"),path=tslib_1.__importStar(require("path"));function normalizePath(t="",e={}){let i=path.posix.normalize(t.replace(/\\/g,"/"));return(t.startsWith("//")||t.startsWith("\\\\"))&&(i.startsWith("//")||(i=`/${i}`)),e.leading?i.startsWith(e.leading)||(i=`${e.leading}${i}`):e.noLeading&&i.startsWith(e.noLeading)&&(i=i.slice(e.noLeading.length)),e.trailing?i.endsWith(e.trailing)||(i=`${i}${e.trailing}`):e.noTrailing&&i.endsWith(e.noTrailing)&&(i=i.slice(0,-e.noTrailing.length)),i}function _isLeftSubPathOfRight(t,e){if(!e)return!0;if(e=normalizePath(e),t=normalizePath(t),!e.endsWith("/")){if(t===e)return!0;e=`${e}/`}return!!t.startsWith(e)}function isLeftSubPathOfRight(t,e){void 0===t&&(console.error(new Error("The child string is undefined here, please check!!")),t="");const i=t.startsWith(e),r=_isLeftSubPathOfRight(t,e);return i===r||r||console.error(new Error(`${t} ${e} difference check sub path here! new result: ${r}`)),r}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wccPipe=void 0;const compilewxmlService_1=require("../../../../../services/compilewxml/common/compilewxmlService"),types_1=require("../types");exports.wccPipe={name:types_1.EPipeCMD.WCC,async execute(e,i){const{files:c,isCut:o,lazyloadConfig:t,configSplit:n,configContent:l,hasWxs:p,genfuncName:s,cwd:r,replaceContent:m,isMiniAppProject:a}=i;return await e.getService(compilewxmlService_1.ICompilewxmlService).compileWxml({files:c,isCut:o,lazyloadConfig:t,configSplit:n,configContent:l,hasWxs:p,genfuncName:s,cwd:r,replaceContent:m,isMiniAppProject:a})}};
@@ -0,0 +1 @@
1
+ "use strict";var EPipeCMD;Object.defineProperty(exports,"__esModule",{value:!0}),exports.EPipeCMD=void 0,function(E){E.WCC="WCC",E.TRANS_WXML_TO_GLASS_EASEL="TRANS_WXML_TO_GLASS_EASEL",E.COMPILE_WXSS="COMPILE_WXSS",E.PAGEFRAME="PAGEFRAME",E.PAGE_INIT_SOURCE="PAGE_INIT_SOURCE",E.APPSERVICE="APPSERVICE"}(EPipeCMD||(exports.EPipeCMD=EPipeCMD={}));
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PluginDriver=void 0,exports.genResovleExtConf=genResovleExtConf,exports.getPluginContext=getPluginContext;const customError_1=require("../../../utils/customError"),workerThread_1=require("../original/workerThread"),worker_1=require("./worker"),debug_1=require("../../../utils/debug");function genResovleExtConf(r){const o={json:["json"],wxml:["wxml"],wxss:["wxss"],js:["js"],wxs:["wxs"]};for(const e of r)if(e.resolveExt)for(const r of["json","wxml","wxss","js","wxs"]){const t=e.resolveExt[r];if("string"==typeof t)o[r].includes(t)||o[r].push(t);else if(Array.isArray(t))for(const e of t)o[r].includes(e)||o[r].push(e)}return o}function throwPluginError(r,o,{hook:e,id:t}={}){const s=(0,customError_1.makeCustomError)(r);throw s.code||(s.code=customError_1.CustomErrors.SUMMER_PLUGIN_ERR),s.plugin=o,e&&(s.hook=e),t&&!s.path&&(s.path=t),r.stack&&(s.stack=r.stack),s}function getPluginContext(r,o){return{addWatchFile(){throw new Error("addWatchFile should be implemented by replaceContext")},async runWorkerMethod(e,...t){const s=await o.project.serialize(),n={command:"runMethod",plugin:r.name,projectInfo:s,pluginOption:{},method:e,args:t};let i;if(await(0,debug_1.shouldNotRunInWorker)())i=await(0,worker_1.runSummerPluginHook)(n);else try{i=await(0,workerThread_1.runTask)(workerThread_1.TASK_NAME.SUMMER_HOOK,n)}catch(r){throw r}if(i.error){if("CustomError"===i.error.type)throw new customError_1.CustomError(i.error);throw i.error}return i.result},error:o=>throwPluginError(o,r.name)}}class PluginDriver{constructor(r,o){this.graph=r,this.options=o,this.pluginContexts=new Map,this.plugins=o.plugins,this.resolveExtConf=genResovleExtConf(o.plugins);for(const o of this.plugins)this.pluginContexts.set(o,getPluginContext(o,r))}runHook(r,o,e,t){const s=e[r];if(!s)return;let n=this.pluginContexts.get(e);return t&&(n=t(n,e)),Promise.resolve().then(()=>s.apply(n,o)).catch(o=>throwPluginError(o,e.name,{hook:r}))}hookFirst(r,o,e){let t=Promise.resolve(void 0);for(const s of this.plugins)t=t.then(t=>t||this.runHook(r,o,s,e));return t}hookParallel(r,o,e){const t=[];for(const s of this.plugins){const n=this.runHook(r,o,s,e);n&&t.push(n)}return Promise.all(t).then(()=>{})}hookReduceArg0(r,[o,...e],t,s){let n=Promise.resolve(o);for(const o of this.plugins)n=n.then(n=>{const i=[n,...e],u=this.runHook(r,i,o,s);return u?u.then(r=>t.call(this.pluginContexts.get(o),n,r,o)):n});return n}}exports.PluginDriver=PluginDriver;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PluginDriver=void 0,exports.genResovleExtConf=genResovleExtConf,exports.getPluginContext=getPluginContext;const customError_1=require("../../../utils/customError"),workerThread_1=require("../original/workerThread"),worker_1=require("./worker"),debug_1=require("../../../utils/debug");function genResovleExtConf(r){const o={json:["json"],wxml:["wxml"],wxss:["wxss"],js:["js"],wxs:["wxs"]};for(const e of r)if(e.resolveExt)for(const r of["json","wxml","wxss","js","wxs"]){const t=e.resolveExt[r];if("string"==typeof t)o[r].includes(t)||o[r].push(t);else if(Array.isArray(t))for(const e of t)o[r].includes(e)||o[r].push(e)}return o}function throwPluginError(r,o,{hook:e,id:t}={}){const s=(0,customError_1.makeCustomError)(r);throw s.code||(s.code=customError_1.CustomErrors.SUMMER_PLUGIN_ERR),s.plugin=o,e&&(s.hook=e),t&&!s.path&&(s.path=t),r.stack&&(s.stack=r.stack),s}function getPluginContext(r,o){return{addWatchFile(){throw new Error("addWatchFile should be implemented by replaceContext")},async runWorkerMethod(e,...t){const s=await o.project.serialize(),n={command:"runMethod",plugin:r.name,projectInfo:s,pluginOption:{},method:e,args:t};let i;if(await(0,debug_1.shouldNotRunInWorker)())i=await(0,worker_1.runSummerPluginHook)(n);else try{i=await(0,workerThread_1.runTask)(workerThread_1.TASK_NAME.SUMMER_HOOK,n)}catch(r){throw r}if(i.error){if("CustomError"===i.error.type)throw new customError_1.CustomError(i.error);throw i.error}return i.result},error:o=>throwPluginError(o,r.name)}}class PluginDriver{constructor(r,o){this.graph=r,this.options=o,this.pluginContexts=new Map,this.plugins=o.plugins,this.resolveExtConf=genResovleExtConf(o.plugins);for(const o of this.plugins)this.pluginContexts.set(o,getPluginContext(o,r))}runHook(r,o,e,t){const s=e[r];if(!s)return;let n=this.pluginContexts.get(e);return t&&(n=t(n,e)),Promise.resolve().then((()=>s.apply(n,o))).catch((o=>throwPluginError(o,e.name,{hook:r})))}hookFirst(r,o,e){let t=Promise.resolve(void 0);for(const s of this.plugins)t=t.then((t=>t||this.runHook(r,o,s,e)));return t}hookParallel(r,o,e){const t=[];for(const s of this.plugins){const n=this.runHook(r,o,s,e);n&&t.push(n)}return Promise.all(t).then((()=>{}))}hookReduceArg0(r,[o,...e],t,s){let n=Promise.resolve(o);for(const o of this.plugins)n=n.then((n=>{const i=[n,...e],u=this.runHook(r,i,o,s);return u?u.then((r=>t.call(this.pluginContexts.get(o),n,r,o))):n}));return n}}exports.PluginDriver=PluginDriver;
@@ -1 +1 @@
1
- "use strict";function couldUseSWCMode(e){if(e.compileWorklet)return!1;return!1===e.disableSWC||null===e.disableSWC&&(e.es6||e.enhance)||void 0===e.disableSWC&&1==e.swc}function getSummerPluginConfig(e){const i=new Set,{disableUseStrict:r}=e;return i.add(["script",{disableUseStrict:r}]),(e.minifyWXSS||e.postcss)&&i.add("wxss"),e.minifyWXML&&i.add("minifywxml"),e.useCompilerPlugins&&e.useCompilerPlugins.forEach(e=>{if("string"==typeof e)"typescript"!==e&&i.add(e);else{if(!Array.isArray(e))throw new Error("invalid useCompilerPlugins options: "+JSON.stringify(e));if("string"!=typeof e[0]||void 0===e[1])throw new Error("invalid useCompilerPlugins options: "+JSON.stringify(e));"typescript"!==e[0]&&i.add(e)}}),Array.from(i)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.couldUseSWCMode=couldUseSWCMode,exports.getSummerPluginConfig=getSummerPluginConfig;
1
+ "use strict";function couldUseSWCMode(e){if(e.compileWorklet)return!1;return!1===e.disableSWC||null===e.disableSWC&&(e.es6||e.enhance)||void 0===e.disableSWC&&1==e.swc}function getSummerPluginConfig(e){const i=new Set,{disableUseStrict:r}=e;return i.add(["script",{disableUseStrict:r}]),(e.minifyWXSS||e.postcss)&&i.add("wxss"),e.minifyWXML&&i.add("minifywxml"),e.useCompilerPlugins&&e.useCompilerPlugins.forEach((e=>{if("string"==typeof e)"typescript"!==e&&i.add(e);else{if(!Array.isArray(e))throw new Error(`invalid useCompilerPlugins options: ${JSON.stringify(e)}`);if("string"!=typeof e[0]||void 0===e[1])throw new Error(`invalid useCompilerPlugins options: ${JSON.stringify(e)}`);"typescript"!==e[0]&&i.add(e)}})),Array.from(i)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.couldUseSWCMode=couldUseSWCMode,exports.getSummerPluginConfig=getSummerPluginConfig;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const babel_script_task_1=require("../script_task/babel_script_task");function default_1(e,t){return{name:"summer-es6module",workerMethods:{async doGenerate(e,t,s){const r=await(0,babel_script_task_1.transformES6ModuleAndGenCode)(e,t,s);return Object.assign(Object.assign({},r),{resultType:s.resultType})}},async generate(e,s,r,{independentRoot:o,isBabelIgnore:a,resultType:n}){const c=Date.now(),{source:i}=e;if(s.endsWith(".js")&&!i.largeFile&&!a){if(!i.astInfo){if(null===i.sourceCode)throw new Error("source.sourceCode is null");return Object.assign(Object.assign({},e),{target:{code:i.sourceCode,map:i.inputMap,helpers:[],resultType:n||"prod"},process:[...e.process,{cost:Date.now()-c,pluginName:"summer-es6module",action:"generate"}]})}const s={babelRoot:(0,babel_script_task_1.getBabelRoot)(o),disableUseStrict:t.disableUseStrict,resultType:n},a=await this.runWorkerMethod("doGenerate",r,i,s);return Object.assign(Object.assign({},e),{target:a,process:[...e.process,{cost:Date.now()-c,pluginName:"summer-es6module",action:"generate",options:s}]})}}}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const babel_script_task_1=require("../script_task/babel_script_task");function default_1(e,t){const s="summer-es6module";return{name:s,workerMethods:{async doGenerate(e,t,s){const r=await(0,babel_script_task_1.transformES6ModuleAndGenCode)(e,t,s);return Object.assign(Object.assign({},r),{resultType:s.resultType})}},async generate(e,r,o,{independentRoot:a,isBabelIgnore:n,resultType:c}){const i=Date.now(),{source:u}=e;if(r.endsWith(".js")&&!u.largeFile&&!n){if(!u.astInfo){if(null===u.sourceCode)throw new Error("source.sourceCode is null");return Object.assign(Object.assign({},e),{target:{code:u.sourceCode,map:u.inputMap,helpers:[],resultType:c||"prod"},process:[...e.process,{cost:Date.now()-i,pluginName:s,action:"generate"}]})}const r={babelRoot:(0,babel_script_task_1.getBabelRoot)(a),disableUseStrict:t.disableUseStrict,resultType:c},n=await this.runWorkerMethod("doGenerate",o,u,r);return Object.assign(Object.assign({},e),{target:n,process:[...e.process,{cost:Date.now()-i,pluginName:s,action:"generate",options:r}]})}}}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAX_CODE_LENGTH=void 0,exports.default=default_1;const load_script_task_1=require("../script_task/load_script_task");var config_1=require("../../../../../config/config");function default_1(e){return{name:"summer-javascript",async load(t,r){if(r.endsWith(".js"))return await(0,load_script_task_1.loadScriptFile)(e,t,r,"summer-javascript")}}}Object.defineProperty(exports,"MAX_CODE_LENGTH",{enumerable:!0,get:function(){return config_1.MAX_CODE_LENGTH}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAX_CODE_LENGTH=void 0,exports.default=default_1;const load_script_task_1=require("../script_task/load_script_task");var config_1=require("../../../../../config/config");function default_1(e){const t="summer-javascript";return{name:t,async load(r,i){if(i.endsWith(".js"))return await(0,load_script_task_1.loadScriptFile)(e,r,i,t)}}}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.MAX_CODE_LENGTH=void 0,exports.getSWCRoot=getSWCRoot,exports.default=default_1;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),config_1=require("../../../../../config/config"),tools_1=require("../../../../../utils/tools"),swc_helper_1=require("../../../../../utils/swc_helper"),inputsourcemap_1=require("../../utils/inputsourcemap"),swc_task_1=require("../script_task/swc_task");var config_2=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 default_1(e,t){return{name:"summer-swc",workerMethods:{async doGenerate(e,t,s,r){const o=await(0,swc_task_1.swcCompileTask)(t,e,Object.assign(Object.assign({},r),{swcRoot:s}));return{code:o.code,map:o.map,helpers:o.helpers,resultType:r.resultType}}},async load(t,s){if(!t.endsWith(".js"))return;const r=Date.now(),o=path_1.default.relative(e.projectPath,s),i=e.getFile("",o).toString(),n=e.stat("",o),a=await(0,inputsourcemap_1.tryGetInputSourceMap)(i,s);return{targetPath:t,source:{sourceCode:i,inputMap:null!=a?a:void 0,astInfo:void 0,largeFile:i.length>=config_1.MAX_CODE_LENGTH,mtime:null==n?void 0:n.mtimeMs},process:[{cost:Date.now()-r,pluginName:"summer-swc",action:"load"}]}},async generate(s,r,o,{independentRoot:i,isBabelIgnore:n,resultType:a}){var c;if(!r.endsWith(".js")||n)return;const u=Date.now(),l=getSWCRoot(e,i),p={disableUseStrict:t.disableUseStrict,target:e.setting.enhance||e.setting.es6?"es5":"es2022",rc:null===(c=e.setting.swcSetting)||void 0===c?void 0:c.rc,minify:e.setting.minified,resultType:a},_=await this.runWorkerMethod("doGenerate",s.source,o,l,p);return Object.assign(Object.assign({},s),{target:_,process:[...s.process,{cost:Date.now()-u,pluginName:"summer-swc",action:"transform",options:p}]})}}}Object.defineProperty(exports,"MAX_CODE_LENGTH",{enumerable:!0,get:function(){return config_2.MAX_CODE_LENGTH}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAX_CODE_LENGTH=void 0,exports.getSWCRoot=getSWCRoot,exports.default=default_1;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),config_1=require("../../../../../config/config"),tools_1=require("../../../../../utils/tools"),swc_helper_1=require("../../../../../utils/swc_helper"),inputsourcemap_1=require("../../utils/inputsourcemap"),swc_task_1=require("../script_task/swc_task");var config_2=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 default_1(e,t){const s="summer-swc";return{name:s,workerMethods:{async doGenerate(e,t,s,r){const o=await(0,swc_task_1.swcCompileTask)(t,e,Object.assign(Object.assign({},r),{swcRoot:s}));return{code:o.code,map:o.map,helpers:o.helpers,resultType:r.resultType}}},async load(t,r){if(!t.endsWith(".js"))return;const o=Date.now(),i=path_1.default.relative(e.projectPath,r),n=e.getFile("",i).toString(),a=e.stat("",i),c=await(0,inputsourcemap_1.tryGetInputSourceMap)(n,r);return{targetPath:t,source:{sourceCode:n,inputMap:null!=c?c:void 0,astInfo:void 0,largeFile:n.length>=config_1.MAX_CODE_LENGTH,mtime:null==a?void 0:a.mtimeMs},process:[{cost:Date.now()-o,pluginName:s,action:"load"}]}},async generate(r,o,i,{independentRoot:n,isBabelIgnore:a,resultType:c}){var u;if(!o.endsWith(".js")||a)return;const l=Date.now(),p=getSWCRoot(e,n),_={disableUseStrict:t.disableUseStrict,target:e.setting.enhance||e.setting.es6?"es5":"es2022",rc:null===(u=e.setting.swcSetting)||void 0===u?void 0:u.rc,minify:e.setting.minified,resultType:c},g=await this.runWorkerMethod("doGenerate",r.source,i,p,_);return Object.assign(Object.assign({},r),{target:g,process:[...r.process,{cost:Date.now()-l,pluginName:s,action:"transform",options:_}]})}}}Object.defineProperty(exports,"MAX_CODE_LENGTH",{enumerable:!0,get:function(){return config_2.MAX_CODE_LENGTH}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const tslib_1=require("tslib"),postcss_1=tslib_1.__importDefault(require("postcss")),autoprefixer_1=tslib_1.__importDefault(require("autoprefixer")),cssnano_1=tslib_1.__importDefault(require("cssnano")),tools_1=require("../../../../../utils/tools"),config_1=require("../../../../../config/config"),customError_1=require("../../../../../utils/customError");"undefined"!=typeof process&&process.env&&(process.env.BROWSERSLIST=process.env.BROWSERSLIST||"iOS >= 8, Chrome >= 37");const MAX_LINE_SHOW_LENGTH=45;function shortString(r,e,t=-1){const s=r.length;if(s<=e)return{result:r,marker:t};const o=Math.floor(e/2);return-1===t||t<=o?{result:r.substr(0,e-3)+"...",marker:t}:t+o>=s?{result:"..."+r.substr(s-e+3,e-3),marker:Math.min(e,e-(s-t))}:{result:`...${r.substr(t-o+3,e-6)}...`,marker:o}}function formatPostcssError(r,e){try{const t=e.line-1,s=e.column-1,o=r.replace(/\r\n/g,"\n").split("\n"),n=[],i=Math.max(0,t-1),u=Math.min(t+2,o.length);for(let r=i;r<u;r++){const e=shortString(o[r],45,s);r===t?n.push(`> ${r+1} | ${e.result.substr(0,e.marker)}${e.result.substr(e.marker)}`):n.push(`> ${r+1} | ${e.result}`)}return`${e.message}\n${n.join("\n")}`}catch(r){}return e.message}function default_1(r,e){const{autoPrefix:t=!0,minify:s=!0}=e||{},o=["iOS >= 8","Chrome >= 37"];return{name:"summer-wxss",workerMethods:{async doOptimize(r,e){try{const n=[];t&&n.push((0,autoprefixer_1.default)({overrideBrowserslist:o,remove:!1})),s&&n.push((0,cssnano_1.default)({preset:["default",{reduceTransforms:!1,calc:!1,minifySelectors:!1,normalizeUrl:!1}]}));return{error:null,content:(await(0,postcss_1.default)(n).process(e,{from:(0,tools_1.leading)(r,"/")})).css.replace(/\r\n/g,"\n")}}catch(t){throw(0,customError_1.makeCustomError)(formatPostcssError(e,t),config_1.POST_WXSS_ERR,r)}}},async optimize(r,e){if("dev"===e.resultType||!r.targetPath.endsWith(".wxss")||!t&&!s)return r;const o=Date.now(),n=await this.runWorkerMethod("doOptimize",r.targetPath,r.target.code);if(n.error)throw n.error;return Object.assign(Object.assign({},r),{target:Object.assign(Object.assign({},r.target),{code:n.content}),process:[...r.process,{cost:Date.now()-o,pluginName:"summer-wxss",action:"optimize"}]})}}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const tslib_1=require("tslib"),postcss_1=tslib_1.__importDefault(require("postcss")),autoprefixer_1=tslib_1.__importDefault(require("autoprefixer")),cssnano_1=tslib_1.__importDefault(require("cssnano")),tools_1=require("../../../../../utils/tools"),config_1=require("../../../../../config/config"),customError_1=require("../../../../../utils/customError");"undefined"!=typeof process&&process.env&&(process.env.BROWSERSLIST=process.env.BROWSERSLIST||"iOS >= 8, Chrome >= 37");const MAX_LINE_SHOW_LENGTH=45;function shortString(r,e,t=-1){const s=r.length;if(s<=e)return{result:r,marker:t};const o=Math.floor(e/2);return-1===t||t<=o?{result:`${r.substr(0,e-3)}...`,marker:t}:t+o>=s?{result:`...${r.substr(s-e+3,e-3)}`,marker:Math.min(e,e-(s-t))}:{result:`...${r.substr(t-o+3,e-6)}...`,marker:o}}function formatPostcssError(r,e){try{const t=e.line-1,s=e.column-1,o=r.replace(/\r\n/g,"\n").split("\n"),n=[],i=Math.max(0,t-1),u=Math.min(t+2,o.length);for(let r=i;r<u;r++){const e=shortString(o[r],MAX_LINE_SHOW_LENGTH,s);r===t?n.push(`> ${r+1} | ${e.result.substr(0,e.marker)}${e.result.substr(e.marker)}`):n.push(`> ${r+1} | ${e.result}`)}return`${e.message}\n${n.join("\n")}`}catch(r){}return e.message}function default_1(r,e){const{autoPrefix:t=!0,minify:s=!0}=e||{},o=["iOS >= 8","Chrome >= 37"],n="summer-wxss";return{name:n,workerMethods:{async doOptimize(r,e){try{const n=[];t&&n.push((0,autoprefixer_1.default)({overrideBrowserslist:o,remove:!1})),s&&n.push((0,cssnano_1.default)({preset:["default",{reduceTransforms:!1,calc:!1,minifySelectors:!1,normalizeUrl:!1}]}));return{error:null,content:(await(0,postcss_1.default)(n).process(e,{from:(0,tools_1.leading)(r,"/")})).css.replace(/\r\n/g,"\n")}}catch(t){throw(0,customError_1.makeCustomError)(formatPostcssError(e,t),config_1.POST_WXSS_ERR,r)}}},async optimize(r,e){if("dev"===e.resultType||!r.targetPath.endsWith(".wxss")||!t&&!s)return r;const o=Date.now(),i=await this.runWorkerMethod("doOptimize",r.targetPath,r.target.code);if(i.error)throw i.error;return Object.assign(Object.assign({},r),{target:Object.assign(Object.assign({},r.target),{code:i.content}),process:[...r.process,{cost:Date.now()-o,pluginName:n,action:"optimize"}]})}}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const babel_script_task_1=require("./script_task/babel_script_task");function default_1(e,s){return{name:"summer-enhance",workerMethods:{doTransform:async(e,s,t,r)=>await(0,babel_script_task_1.babelTransformJS)(e,s)},async transform(e,t,r,{independentRoot:a,isBabelIgnore:n}){const{source:o}=e;if(t.endsWith(".js")&&!o.largeFile&&!n){const t=Date.now(),n=(0,babel_script_task_1.getBabelRoot)(a),c=await this.runWorkerMethod("doTransform",o,r,n,s.disableUseStrict);return Object.assign(Object.assign({},e),{source:Object.assign(Object.assign({},e.source),c),process:[...e.process,{cost:Date.now()-t,pluginName:"summer-enhance",action:"transform"}]})}return e}}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const babel_script_task_1=require("./script_task/babel_script_task");function default_1(e,s){const t="summer-enhance";return{name:t,workerMethods:{doTransform:async(e,s,t,r)=>await(0,babel_script_task_1.babelTransformJS)(e,s)},async transform(e,r,a,{independentRoot:n,isBabelIgnore:o}){const{source:c}=e;if(r.endsWith(".js")&&!c.largeFile&&!o){const r=Date.now(),o=(0,babel_script_task_1.getBabelRoot)(n),i=await this.runWorkerMethod("doTransform",c,a,o,s.disableUseStrict);return Object.assign(Object.assign({},e),{source:Object.assign(Object.assign({},e.source),i),process:[...e.process,{cost:Date.now()-r,pluginName:t,action:"transform"}]})}return e}}}
@@ -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 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=e.setting.minified,r=e.setting.enhance||e.setting.es6,i=useCompilerPlugin(e,"typescript"),o=(0,pluginconfig_1.couldUseSWCMode)(e.setting);return{name:"script",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});if(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,s){if(t.endsWith(".js"))return await(0,load_script_task_1.loadScriptFile)(e,t,s,"script")},async compile(c,a,n,p){var l;if(!c.endsWith(".js"))return;const{independentRoot:u,isBabelIgnore:_,resultType:d}=p;if(_)return{targetPath:c,source:n.source,target:{code:n.source.sourceCode,map:n.source.inputMap,helpers:[],resultType:d},process:n.process};const g=Date.now();if(o){const i={swcRoot:getSWCRoot(e,u),minify:s,resultType:d,rc:null===(l=e.setting.swcSetting)||void 0===l?void 0:l.rc,disableUseStrict:t.disableUseStrict,target:r?"es5":"es2022"},o=await this.runWorkerMethod("doSwcTask",a,n.source,i);return{targetPath:c,source:n.source,target:o,process:[...n.process,{cost:Date.now()-g,pluginName:"script",action:"compile",options:i}]}}const f={babelRoot:(0,babel_script_task_1.getBabelRoot)(u),disableUseStrict:t.disableUseStrict,resultType:d,minify:s,enhance:r,typescript:i},m=await this.runWorkerMethod("doBabelTask",a,n.source,f);return{targetPath:c,source:n.source,target:m,process:[...n.process,{cost:Date.now()-g,pluginName:"script",action:"compile",options:f}]}}}}Object.defineProperty(exports,"MAX_CODE_LENGTH",{enumerable:!0,get:function(){return config_1.MAX_CODE_LENGTH}});
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"),o=(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});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(c,n,a,p){var l;if(!c.endsWith(".js"))return;const{independentRoot:u,isBabelIgnore:_,resultType:d}=p,g=a.source.largeFile;if(_||g)return{targetPath:c,source:a.source,target:{code:a.source.sourceCode,map:a.source.inputMap,helpers:[],resultType:d},process:a.process};const f=Date.now(),y=shouldMinify(d,e.setting.minified);if(o){const i={swcRoot:getSWCRoot(e,u),minify:y,resultType:d,rc:null===(l=e.setting.swcSetting)||void 0===l?void 0:l.rc,disableUseStrict:t.disableUseStrict,target:r?"es5":"es2022"},o=await this.runWorkerMethod("doSwcTask",n,a.source,i);return{targetPath:c,source:a.source,target:o,process:[...a.process,{cost:Date.now()-f,pluginName:s,action:"compile",options:i}]}}const m={babelRoot:(0,babel_script_task_1.getBabelRoot)(u),disableUseStrict:t.disableUseStrict,resultType:d,minify:y,enhance:r,typescript:i},b=await this.runWorkerMethod("doBabelTask",n,a.source,m);return{targetPath:c,source:a.source,target:b,process:[...a.process,{cost:Date.now()-f,pluginName:s,action:"compile",options:m}]}}}}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.importWxssCssReg=exports.importWxssReg=void 0,exports.default=default_1;const tslib_1=require("tslib"),tools_1=require("../../../../utils/tools"),customError_1=require("../../../../utils/customError"),path_1=tslib_1.__importDefault(require("path")),less=()=>require("less");function default_1(s,t){return{name:"summer-less",resolveExt:{wxss:"less"},async load(e,o){var r,i,a;if(o.endsWith(".less")){const l=Date.now(),p=(0,tools_1.pathRelative)(s.projectPath,o);let u=s.getFile("",p).toString();if(p!==s.getTargetPath(s.miniprogramRoot,"app")+".less"){const t=(null===(i=null===(r=s.setting)||void 0===r?void 0:r.lessSetting)||void 0===i?void 0:i.commonUseFilePath)||"app.less";if(s.exists(s.miniprogramRoot,t)){const e=(0,tools_1.pathRelative)(s.miniprogramRoot,path_1.default.dirname(p))||".";u=`@import (optional, reference) '${"."===e?".":(0,tools_1.pathRelative)(e,"./")}/${t}';\n${u}`}}const c=[];u=u.replace(exports.importWxssReg,(s,t,e)=>(c.push(e),s.replace(e,e+"?css")));try{const r=await require("less").render(u,{sourceMap:{outputSourceFiles:!0},paths:this.rootPath?[this.rootPath]:[],filename:o,globalVars:null!==(a=null==t?void 0:t.globalVars)&&void 0!==a?a:{}}),i=r.css.replace(exports.importWxssCssReg,(s,t,e)=>{const o=e.slice(0,-4);return c.includes(o)?s.replace(e,o):s});if(r.imports.length)for(const s of r.imports)this.addWatchFile(s);let p=void 0;return r.map&&(p=JSON.parse(r.map),p.sources=p.sources.map(t=>path_1.default.posix.relative(s.projectPath,t))),{targetPath:e,source:{sourceCode:i,inputMap:p},process:[{cost:Date.now()-l,pluginName:"summer-less",action:"load"}]}}catch(s){throw(0,customError_1.makeCustomError)(s,customError_1.CustomErrors.SUMMER_PLUGIN_CODE_ERR)}}}}}exports.importWxssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss)\1(?:\s*);/g,exports.importWxssCssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss\?css)\1(?:\s*);/g;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.importWxssCssReg=exports.importWxssReg=void 0,exports.default=default_1;const tslib_1=require("tslib"),tools_1=require("../../../../utils/tools"),customError_1=require("../../../../utils/customError"),path_1=tslib_1.__importDefault(require("path")),getservice_1=tslib_1.__importDefault(require("../../../../services/common/getservice")),pluginFileReader_1=require("../../../../services/pluginFileReader/common/pluginFileReader"),less=()=>require("less");function default_1(e,s){const t="summer-less";return{name:t,resolveExt:{wxss:"less"},async load(r,o){var i,a,l;if(o.endsWith(".less")){const p=Date.now(),u=(0,getservice_1.default)(pluginFileReader_1.IPluginFileReaderService),c=(0,tools_1.pathRelative)(e.projectPath,o);let n=await u.readFile(e,c);if(c!==`${e.getTargetPath(e.miniprogramRoot,"app")}.less`){const s=(null===(a=null===(i=e.setting)||void 0===i?void 0:i.lessSetting)||void 0===a?void 0:a.commonUseFilePath)||"app.less";if(await u.exists(e,e.miniprogramRoot,s)){const t=(0,tools_1.pathRelative)(e.miniprogramRoot,path_1.default.dirname(c))||".";n=`@import (optional, reference) '${"."===t?".":(0,tools_1.pathRelative)(t,"./")}/${s}';\n${n}`}}const m=[];let d;n=n.replace(exports.importWxssReg,((e,s,t)=>(m.push(t),e.replace(t,`${t}?css`))));try{const i=await less().render(n,{sourceMap:{outputSourceFiles:!0},paths:this.rootPath?[this.rootPath]:[],filename:o,globalVars:null!==(l=null==s?void 0:s.globalVars)&&void 0!==l?l:{},plugins:d}),a=i.css.replace(exports.importWxssCssReg,((e,s,t)=>{const r=t.slice(0,-4);return m.includes(r)?e.replace(t,r):e}));if(i.imports.length)for(const e of i.imports)this.addWatchFile(e);let u;return i.map&&(u=JSON.parse(i.map),u.sources=u.sources.map((s=>path_1.default.posix.relative(e.projectPath,s)))),{targetPath:r,source:{sourceCode:a,inputMap:u},process:[{cost:Date.now()-p,pluginName:t,action:"load"}]}}catch(e){throw(0,customError_1.makeCustomError)(e,customError_1.CustomErrors.SUMMER_PLUGIN_CODE_ERR)}}}}}exports.importWxssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss)\1(?:\s*);/g,exports.importWxssCssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss\?css)\1(?:\s*);/g;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const tslib_1=require("tslib"),config_1=require("../../../../config/config"),log=tslib_1.__importStar(require("../../../../utils/log")),customError_1=require("../../../../utils/customError"),minifywxml_1=require("../../original/workerThread/task/minifywxml");function default_1(e,t){const{minify:r=!0}=t||{};return{name:"summer-minifywxml",workerMethods:{async doCompress(e,t,r){try{const i=await(0,minifywxml_1.minifyWXML)({code:e,filePath:t,setting:r});if(i.error)throw i.error;return i.code}catch(e){throw log.error(e),(0,customError_1.makeCustomError)(e.message,config_1.MINIFY_WXML_ERR,t)}}},async compress(t,i){var s,o;if(!r||"dev"===i.resultType||!t.targetPath.endsWith(".wxml"))return t;const n=Date.now(),a=t.target.code,c=await this.runWorkerMethod("doCompress",a,t.targetPath,Object.assign(Object.assign({collapseWhitespace:!0,conservativeCollapse:!1,preserveLineBreaks:!1},null===(s=e.setting.minifyWXMLSetting)||void 0===s?void 0:s.global),null===(o=e.setting.minifyWXMLSetting)||void 0===o?void 0:o[t.targetPath]));return Object.assign(Object.assign({},t),{target:Object.assign(Object.assign({},t.target),{code:c}),process:[...t.process,{cost:Date.now()-n,pluginName:"summer-minifywxml",action:"compress"}]})}}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const tslib_1=require("tslib"),config_1=require("../../../../config/config"),log=tslib_1.__importStar(require("../../../../utils/log")),customError_1=require("../../../../utils/customError"),minifywxml_1=require("../../original/workerThread/task/minifywxml");function default_1(e,t){const{minify:r=!0}=t||{},i="summer-minifywxml";return{name:i,workerMethods:{async doCompress(e,t,r){try{const i=await(0,minifywxml_1.minifyWXML)({code:e,filePath:t,setting:r});if(i.error)throw i.error;return i.code}catch(e){throw log.error(e),(0,customError_1.makeCustomError)(e.message,config_1.MINIFY_WXML_ERR,t)}}},async compress(t,s){var o,n;if(!r||"dev"===s.resultType||!t.targetPath.endsWith(".wxml"))return t;const a=Date.now(),c=t.target.code,l=await this.runWorkerMethod("doCompress",c,t.targetPath,Object.assign(Object.assign({collapseWhitespace:!0,conservativeCollapse:!1,preserveLineBreaks:!1},null===(o=e.setting.minifyWXMLSetting)||void 0===o?void 0:o.global),null===(n=e.setting.minifyWXMLSetting)||void 0===n?void 0:n[t.targetPath]));return Object.assign(Object.assign({},t),{target:Object.assign(Object.assign({},t.target),{code:l}),process:[...t.process,{cost:Date.now()-a,pluginName:i,action:"compress"}]})}}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.random=random,exports.default=default_1;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../../../utils/tools"),customError_1=require("../../../../utils/customError"),debug_1=require("../../../../utils/debug");let runInMainProcess=void 0;const sass=async()=>{if(void 0===runInMainProcess&&(runInMainProcess=await(0,debug_1.shouldRunInMainProcess)()),runInMainProcess){return require("sass")}return require("sass")};function random(){return(0,tools_1.generateMD5)(`${Math.random()}${Date.now()}`)}const importWxssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss)\1(?:\s*);/g,importCssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.css)\1(?:\s*);/g;async function sassRender(s,t){if("undefined"!=typeof WEBIDE_WEBPECK_DEFINE_PLUGIN);else{(await sass()).render(s,t)}}function default_1(s){return{name:"summer-sass",resolveExt:{wxss:["sass","scss"]},async load(t,e){var o,r,a,i;if(e.endsWith(".scss")||e.endsWith(".sass")){const n=(0,tools_1.pathRelative)(s.projectPath,e);let l=s.getFile("",n).toString();const u=s.getTargetPath(s.miniprogramRoot,"global");if(n!==u+".scss"&&n!==u+".sass"){const t=path_1.default.extname(n),e=(null===(r=null===(o=s.setting)||void 0===o?void 0:o.sassSetting)||void 0===r?void 0:r.sassCommonUseFilePath)||"global.sass",u=(null===(i=null===(a=s.setting)||void 0===a?void 0:a.sassSetting)||void 0===i?void 0:i.scssCommonUseFilePath)||"global.scss";let c=".sass"===t?e:u;const d=(0,tools_1.pathRelative)(s.miniprogramRoot,path_1.default.dirname(n))||".";s.exists(s.miniprogramRoot,c)||(c=".sass"===t?u:e),s.exists(s.miniprogramRoot,c)&&(l=".sass"===t?`@use '${"."===d?".":(0,tools_1.pathRelative)(d,"./")}/${c}'\n${l}`:`@use '${"."===d?".":(0,tools_1.pathRelative)(d,"./")}/${c}';\n${l}`)}const c=[];l=l.replace(importWxssReg,(s,t,e)=>(c.push(e),s.replace(e,e.slice(0,-4)+"css")));const d=path_1.default.posix.dirname((0,tools_1.pathRelative)(s.projectPath,e));return new Promise((s,o)=>{const r=Date.now();sassRender({file:e,data:l,sourceMap:!0,sourceMapContents:!0,omitSourceMapUrl:!0,outFile:e.slice(0,-5)+".wxss",includePaths:this.rootPath?[this.rootPath]:[]},(a,i)=>{if(a){const s=(0,customError_1.makeCustomError)(a,customError_1.CustomErrors.SUMMER_PLUGIN_CODE_ERR);return void o(s)}if(!i)return void o(new Error("no result"));const n=i.css.toString("utf-8").replace(importCssReg,(s,t,e)=>{const o=e.slice(0,-3)+"wxss";return c.includes(o)?s.replace(e,o):s});if(i.stats.includedFiles.length>0)for(const s of i.stats.includedFiles)s!==e&&this.addWatchFile(s);const l=i.map?JSON.parse(i.map.toString("utf-8")):void 0;l&&(l.sourceRoot=d),s({targetPath:t,source:{sourceCode:n,inputMap:l},process:[{cost:Date.now()-r,pluginName:"summer-sass",action:"load"}]})})})}}}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.random=random,exports.default=default_1;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../../../utils/tools"),customError_1=require("../../../../utils/customError"),debug_1=require("../../../../utils/debug"),getservice_1=tslib_1.__importDefault(require("../../../../services/common/getservice")),pluginFileReader_1=require("../../../../services/pluginFileReader/common/pluginFileReader");let runInMainProcess;const sass=async()=>{if(void 0===runInMainProcess&&(runInMainProcess=await(0,debug_1.shouldRunInMainProcess)()),runInMainProcess){return require("sass")}return require("sass")};function random(){return(0,tools_1.generateMD5)(`${Math.random()}${Date.now()}`)}const importWxssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.wxss)\1(?:\s*);/g,importCssReg=/(?:^|\s)?(?:@import)(?:\s*)?(["'])([^"']+.css)\1(?:\s*);/g;async function sassRender(s,e){if("undefined"!=typeof WEBIDE_WEBPECK_DEFINE_PLUGIN);else{(await sass()).render(s,e)}}function default_1(s){const e="summer-sass";return{name:e,resolveExt:{wxss:["sass","scss"]},async load(t,o){var r,i,a,n;if(o.endsWith(".scss")||o.endsWith(".sass")){const l=(0,getservice_1.default)(pluginFileReader_1.IPluginFileReaderService),u=(0,tools_1.pathRelative)(s.projectPath,o);let c=(await l.readFile(s,u)).toString();const d=s.getTargetPath(s.miniprogramRoot,"global");if(u!==`${d}.scss`&&u!==`${d}.sass`){const e=path_1.default.extname(u),t=(null===(i=null===(r=s.setting)||void 0===r?void 0:r.sassSetting)||void 0===i?void 0:i.sassCommonUseFilePath)||"global.sass",o=(null===(n=null===(a=s.setting)||void 0===a?void 0:a.sassSetting)||void 0===n?void 0:n.scssCommonUseFilePath)||"global.scss";let d=".sass"===e?t:o;const p=(0,tools_1.pathRelative)(s.miniprogramRoot,path_1.default.dirname(u))||".";await l.exists(s,s.miniprogramRoot,d)||(d=".sass"===e?o:t),await l.exists(s,s.miniprogramRoot,d)&&(c=".sass"===e?`@use '${"."===p?".":(0,tools_1.pathRelative)(p,"./")}/${d}'\n${c}`:`@use '${"."===p?".":(0,tools_1.pathRelative)(p,"./")}/${d}';\n${c}`)}const p=[];c=c.replace(importWxssReg,((s,e,t)=>(p.push(t),s.replace(t,`${t.slice(0,-4)}css`))));const m=path_1.default.posix.dirname((0,tools_1.pathRelative)(s.projectPath,o));return new Promise(((s,r)=>{const i=Date.now();sassRender({file:o,data:c,sourceMap:!0,sourceMapContents:!0,omitSourceMapUrl:!0,outFile:`${o.slice(0,-5)}.wxss`,includePaths:this.rootPath?[this.rootPath]:[]},((a,n)=>{if(a){const s=(0,customError_1.makeCustomError)(a,customError_1.CustomErrors.SUMMER_PLUGIN_CODE_ERR);return void r(s)}if(!n)return void r(new Error("no result"));const l=n.css.toString("utf-8").replace(importCssReg,((s,e,t)=>{const o=`${t.slice(0,-3)}wxss`;return p.includes(o)?s.replace(t,o):s}));if(n.stats.includedFiles.length>0)for(const s of n.stats.includedFiles)s!==o&&this.addWatchFile(s);const u=n.map?JSON.parse(n.map.toString("utf-8")):void 0;u&&(u.sourceRoot=m),s({targetPath:t,source:{sourceCode:l,inputMap:u},process:[{cost:Date.now()-i,pluginName:e,action:"load"}]})}))}))}}}}
@@ -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=[[require("../../../../../utils/babel_transform_plugin")],[require("@babel/plugin-transform-runtime"),{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[[require("@babel/preset-env"),{targets:{chrome:53,ios:8},modules:!1,include:["@babel/plugin-transform-computed-properties"]}]]}function getTSTransformPluginsList(){return[[pluginReplaceTsImportEqualsDeclaration,{}],[pluginReplaceTsExportAssignment,{}],[require("@babel/plugin-transform-typescript"),{}]]}function getES6ModulePluginsList(e){return[[require("@babel/plugin-transform-modules-commonjs"),{allowTopLevelThis:e,importInterop:e=>e.startsWith("@babel/runtime/helpers/")?"node":"babel"}]]}function getBabelRoot(e){return""===e?"@babel/runtime":(0,tools_1.normalizePath)(e+"/@babel/runtime")}async function babelTransformJS(e,r){const o=babel7(),t=e.sourceCode.includes('"worklet"')||e.sourceCode.includes("'worklet'");let s;try{const n={babelrc:!1,sourceFileName:r,configFile:!1,presets:getCommonPresets(),plugins:getEnhancePluginsList({supportWorklet:t}),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");s=await o.transformFromAstAsync(e.astInfo.ast,e.sourceCode,n)}else{if(null===e.sourceCode)throw new Error("source.sourceCode is null");s=await babel7().transformAsync(e.sourceCode,n)}}catch(e){console.error(e,e.stack);const o=`file: ${r}\n ${e.message}`,t=new Error(o);throw t.code=config_1.BABEL_TRANS_JS_ERR,t}return{sourceCode:e.sourceCode,inputMap:e.inputMap,astInfo:{ast:s.ast,type:config_1.AstType.Babel}}}async function transformES6ModuleAndGenCode(e,r,o){const t=o.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r.sourceCode||"");let s;try{const o={babelrc:!1,sourceFileName:e,configFile:!1,plugins:getES6ModulePluginsList(t),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");s=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(!s)throw new Error("no trans result for callPostEnhance");let n=s.code;const l=s.map;t&&(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 t=babel7(),s=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&&l.push(...getTSTransformPluginsList()),s&&l.push([_pluginTransformWorklet()]),o.enhance&&l.push(...getEnhancePluginsList({})),l.push(...getES6ModulePluginsList(n));const a={babelrc:!1,sourceFileName:e,filename:e,configFile:!1,presets:o.enhance?getCommonPresets():[],plugins:l,inputSourceMap:r.inputMap,sourceMaps:!0,code:!0,ast:!1,cloneInputAst:!1};let i;try{i=await t.transformAsync(r.sourceCode,a)}catch(r){console.error(r,r.stack);const o=`file: ${e}\n ${r.message}`,t=new Error(o);throw t.code=config_1.BABEL_TRANS_JS_ERR,t}if(!i||!i.code)throw new Error("no trans result for bableCompile");let u=i.code;const c=i.map;n&&(u=u.replace(/^"use strict";/,""));const p=(0,babel_helper_1.collectBabelHelpers)(r.sourceCode),b=(0,babel_helper_1.replaceBabelHelpers)(u,p,e,o.babelRoot);return{code:b.transformCode,map:c,helpers:b.helpers}}
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=[];e.endsWith(".ts")&&o.typescript&&l.push(...getTSTransformPluginsList()),t&&l.push([_pluginTransformWorklet()]),o.enhance&&l.push(...getEnhancePluginsList({})),l.push(...getES6ModulePluginsList(n));const a={babelrc:!1,sourceFileName:e,filename:e,configFile:!1,presets:o.enhance?getCommonPresets():[],plugins:l,inputSourceMap:r.inputMap,sourceMaps:!0,code:!0,ast:!1,cloneInputAst:!1};let i;try{i=await s.transformAsync(r.sourceCode,a)}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(!i||!i.code)throw new Error("no trans result for bableCompile");let c=i.code;const u=i.map;n&&(c=c.replace(/^"use strict";/,""));const p=(0,babel_helper_1.collectBabelHelpers)(r.sourceCode),m=(0,babel_helper_1.replaceBabelHelpers)(c,p,e,o.babelRoot);return{code:m.transformCode,map:u,helpers:m.helpers}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadScriptFile=loadScriptFile;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),config_1=require("../../../../../config/config"),inputsourcemap_1=require("../../utils/inputsourcemap");async function loadScriptFile(t,e,i,o){const r=Date.now(),a=path_1.default.relative(t.projectPath,i),u=t.getFile("",a).toString(),l=t.stat("",a),n=await(0,inputsourcemap_1.tryGetInputSourceMap)(u,i);return{targetPath:e,source:{sourceCode:u,inputMap:null!=n?n:void 0,astInfo:void 0,largeFile:u.length>=config_1.MAX_CODE_LENGTH,mtime:null==l?void 0:l.mtimeMs},process:[{cost:Date.now()-r,pluginName:o,action:"load"}]}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadScriptFile=loadScriptFile;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),config_1=require("../../../../../config/config"),inputsourcemap_1=require("../../utils/inputsourcemap"),getservice_1=tslib_1.__importDefault(require("../../../../../services/common/getservice")),pluginFileReader_1=require("../../../../../services/pluginFileReader/common/pluginFileReader");async function loadScriptFile(e,i,t,r){const a=Date.now(),o=(0,getservice_1.default)(pluginFileReader_1.IPluginFileReaderService),l=path_1.default.relative(e.projectPath,t),u=(await o.readFile(e,l)).toString(),n=await o.stat(e,l),c=await(0,inputsourcemap_1.tryGetInputSourceMap)(u,t);return{targetPath:i,source:{sourceCode:u,inputMap:null!=c?c:void 0,astInfo:void 0,largeFile:u.length>=config_1.MAX_CODE_LENGTH,mtime:null==n?void 0:n.mtimeMs},process:[{cost:Date.now()-a,pluginName:r,action:"load"}]}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.doCompress=doCompress;const config_1=require("../../../../../config/config"),customError_1=require("../../../../../utils/customError"),terser=()=>require("terser"),babelCodeFrame=()=>require("babel-code-frame");async function doCompress(e,r){const{code:o,map:s}=r,c=s?{includeSources:!0,content:"string"==typeof s?JSON.parse(s):s,filename:e}:{includeSources:!0,content:void 0,filename:e},t=require("terser").minify(o,{toplevel:!0,compress:{drop_console:!1,drop_debugger:!1},sourceMap:c});if(t.error){const r=t.error,s=`file: ${e}\n ${t.error.message}\n ${require("babel-code-frame")(o,r.line,r.col>0?r.col:1)}`;throw(0,customError_1.makeCustomError)(s,config_1.UGLIFY_JS_ERR,e)}return{code:t.code,map:t.map}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.doCompress=doCompress;const config_1=require("../../../../../config/config"),customError_1=require("../../../../../utils/customError"),terser=()=>require("terser"),babelCodeFrame=()=>require("babel-code-frame");async function doCompress(e,r){const{code:o,map:s}=r,c=s?{includeSources:!0,content:"string"==typeof s?JSON.parse(s):s,filename:e}:{includeSources:!0,content:void 0,filename:e};let t=null;try{t=await terser().minify(o,{toplevel:!0,compress:{drop_console:!1,drop_debugger:!1},sourceMap:c})}catch(r){const s=`file: ${e}\n ${t.error.message}\n ${babelCodeFrame()(o,r.line,r.col>0?r.col:1)}`;throw(0,customError_1.makeCustomError)(s,config_1.UGLIFY_JS_ERR,e)}return console.log("terser done"),{code:t.code,map:t.map}}
@@ -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 require("@swc/core").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:!0,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
+ "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:!0,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.default=default_1;const minify_script_task_1=require("./script_task/minify_script_task");function default_1(e){const t=e.setting.minified;return{name:"summer-terser",workerMethods:{doCompress:minify_script_task_1.doCompress},async compress(e,s){const r=e.targetPath;if(!t||"dev"===s.resultType||!r.endsWith(".js"))return e;const o=Date.now(),a=await this.runWorkerMethod("doCompress",r,{code:e.target.code,map:e.target.map});return Object.assign(Object.assign({},e),{target:Object.assign(Object.assign({},e.target),{code:a.code,map:a.map}),process:[...e.process,{cost:Date.now()-o,pluginName:"summer-terser",action:"compress"}]})}}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const minify_script_task_1=require("./script_task/minify_script_task");function default_1(e){const t="summer-terser",s=e.setting.minified;return{name:t,workerMethods:{doCompress:minify_script_task_1.doCompress},async compress(e,r){const o=e.targetPath;if(!s||"dev"===r.resultType||!o.endsWith(".js"))return e;const a=Date.now(),i=await this.runWorkerMethod("doCompress",o,{code:e.target.code,map:e.target.map});return Object.assign(Object.assign({},e),{target:Object.assign(Object.assign({},e.target),{code:i.code,map:i.map}),process:[...e.process,{cost:Date.now()-a,pluginName:t,action:"compress"}]})}}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),pluginconfig_1=require("../pluginconfig"),babel_script_task_1=require("./script_task/babel_script_task");function default_1(t){return{name:"summer-typescript",resolveExt:{js:"ts"},workerMethods:{async doLoad(t,e,s){const r={sourceCode:t,inputMap:s};return await(0,babel_script_task_1.babelTransformTS)(r,e)}},async load(e,s){if(!(0,pluginconfig_1.couldUseSWCMode)(t.setting)&&s.endsWith(".ts")){const r=Date.now(),a=path_1.default.relative(t.projectPath,s),i=t.getFile("",a).toString(),o=t.stat("",a),n=await this.runWorkerMethod("doLoad",i,s);return{targetPath:e,source:Object.assign(Object.assign({},n),{mtime:null==o?void 0:o.mtimeMs}),process:[{cost:Date.now()-r,pluginName:"summer-typescript",action:"load"}]}}}}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),pluginconfig_1=require("../pluginconfig"),babel_script_task_1=require("./script_task/babel_script_task");function default_1(t){const e="summer-typescript";return{name:e,resolveExt:{js:"ts"},workerMethods:{async doLoad(t,e,s){const a={sourceCode:t,inputMap:s};return await(0,babel_script_task_1.babelTransformTS)(a,e)}},async load(s,a){if(!(0,pluginconfig_1.couldUseSWCMode)(t.setting)&&a.endsWith(".ts")){const r=Date.now(),i=path_1.default.relative(t.projectPath,a),o=t.getFile("",i).toString(),n=t.stat("",i),u=await this.runWorkerMethod("doLoad",o,a);return{targetPath:s,source:Object.assign(Object.assign({},u),{mtime:null==n?void 0:n.mtimeMs}),process:[{cost:Date.now()-r,pluginName:e,action:"load"}]}}}}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const config_1=require("../../../../config/config"),_pluginTransformWorklet=()=>require("../../../../utils/babel_plugin_worklet"),babel7=()=>require("@babel/core"),worklet=(e,r)=>{const o=babel7();let t;try{const s={babelrc:!1,plugins:[require("../../../../utils/babel_plugin_worklet")],sourceFileName:r,inputSourceMap:!1,configFile:!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=o.transformFromAstSync(e.astInfo.ast,e.sourceCode,s)}else{if(null===e.sourceCode)throw new Error("source.targetCode is null");t=babel7().transform(e.sourceCode,s)}}catch(e){const o=`file: ${r}\n ${e.message}`,t=new Error(o);throw t.code=config_1.BABEL_TRANS_JS_ERR,t}return{sourceCode:e.sourceCode,inputMap:e.inputMap,astInfo:{ast:t.ast,type:config_1.AstType.Babel}}};function default_1(e,r){return{name:"summer-worklet",workerMethods:{worklet:worklet},async transform(e,r,o,{isBabelIgnore:t}){if(r.endsWith(".js")&&!t){const{source:r}=e;if(r.sourceCode.includes('"worklet"')||r.sourceCode.includes("'worklet'")){const t=Date.now(),s=await this.runWorkerMethod("worklet",r,o);return Object.assign(Object.assign({},e),{source:Object.assign(Object.assign({},e.source),s),process:[...e.process,{cost:Date.now()-t,pluginName:"summer-worklet",action:"transform"}]})}return e}return e}}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const config_1=require("../../../../config/config"),_pluginTransformWorklet=()=>require("../../../../utils/babel_plugin_worklet"),babel7=()=>require("@babel/core"),worklet=(e,o)=>{const r=babel7();let t;try{const s={babelrc:!1,plugins:[_pluginTransformWorklet()],sourceFileName:o,inputSourceMap:!1,configFile:!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=r.transformFromAstSync(e.astInfo.ast,e.sourceCode,s)}else{if(null===e.sourceCode)throw new Error("source.targetCode is null");t=babel7().transform(e.sourceCode,s)}}catch(e){const r=`file: ${o}\n ${e.message}`,t=new Error(r);throw t.code=config_1.BABEL_TRANS_JS_ERR,t}return{sourceCode:e.sourceCode,inputMap:e.inputMap,astInfo:{ast:t.ast,type:config_1.AstType.Babel}}};function default_1(e,o){const r="summer-worklet";return{name:r,workerMethods:{worklet:worklet},async transform(e,o,t,{isBabelIgnore:s}){if(o.endsWith(".js")&&!s){const{source:o}=e;if(o.sourceCode.includes('"worklet"')||o.sourceCode.includes("'worklet'")){const s=Date.now(),n=await this.runWorkerMethod("worklet",o,t);return Object.assign(Object.assign({},e),{source:Object.assign(Object.assign({},e.source),n),process:[...e.process,{cost:Date.now()-s,pluginName:r,action:"transform"}]})}return e}return e}}}