miniprogram-ci 1.9.27 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (976) hide show
  1. package/CHANGELOG.md +6 -169
  2. package/README.md +12 -7
  3. package/bin/.DS_Store +0 -0
  4. package/bin/miniprogram-ci.js +1 -1
  5. package/dist/@types/ci/checkCodeQuality.d.ts +2 -2
  6. package/dist/@types/ci/cloud/cloudapi.d.ts +7 -0
  7. package/dist/@types/ci/cloud/createTimeTrigger.d.ts +13 -0
  8. package/dist/@types/ci/cloud/uploadContainer.d.ts +71 -0
  9. package/dist/@types/ci/cloud/uploadFile.d.ts +9 -0
  10. package/dist/@types/ci/cloud/uploadFunction.d.ts +13 -0
  11. package/dist/@types/ci/cloud/utils.d.ts +17 -0
  12. package/dist/@types/ci/code-analyse.d.ts +1 -1
  13. package/dist/@types/ci/getcompiler.d.ts +5 -0
  14. package/dist/@types/ci/index.d.ts +39 -0
  15. package/dist/@types/ci/project.d.ts +1 -47
  16. package/dist/@types/ci/utils/codeDenpendencyQualityChecker.d.ts +1 -1
  17. package/dist/@types/ci/utils/tools.d.ts +5 -0
  18. package/dist/@types/cli/cmdForDonutH5.d.ts +22 -0
  19. package/dist/@types/common/cloud-api/src/apis/tcb/tcb.apis.d.ts +180 -0
  20. package/dist/@types/common/cloud-api/src/transaction/contracts/account.contracts.d.ts +2 -0
  21. package/dist/@types/common/cloud-api/src/transaction/contracts/contracts.d.ts +9 -0
  22. package/dist/@types/common/cloud-api/src/transaction/contracts/lowcode.contracts.d.ts +3 -0
  23. package/dist/@types/common/cloud-api/src/transaction/contracts/tcb.contracts.d.ts +183 -0
  24. package/dist/@types/common/cloud-api/src/transaction/validations/account.validations.d.ts +2 -0
  25. package/dist/@types/common/cloud-api/src/transaction/validations/common.validations.d.ts +118 -0
  26. package/dist/@types/common/cloud-api/src/transaction/validations/lowcode.validations.d.ts +3 -0
  27. package/dist/@types/common/cloud-api/src/transaction/validations/tcb.validations.d.ts +188 -0
  28. package/dist/@types/common/cloud-api/src/transaction/validations/validations.d.ts +8 -0
  29. package/dist/@types/common/code-analyse/index.d.ts +371 -0
  30. package/dist/@types/config/compiletype.config.d.ts +17 -0
  31. package/dist/@types/config/config.d.ts +93 -0
  32. package/dist/@types/config/define.d.ts +5 -0
  33. package/dist/@types/config/url.config.d.ts +25 -0
  34. package/dist/@types/index.d.ts +27 -38
  35. package/dist/@types/modules/corecompiler/baseCompiler.d.ts +132 -0
  36. package/dist/@types/modules/corecompiler/original/analyse/partial.d.ts +25 -0
  37. package/dist/@types/modules/corecompiler/original/compile/common.d.ts +17 -0
  38. package/dist/@types/modules/corecompiler/original/compile/game.d.ts +5 -0
  39. package/dist/@types/modules/corecompiler/original/compile/gamePlugin.d.ts +8 -0
  40. package/dist/@types/modules/corecompiler/original/compile/handler/js.d.ts +15 -0
  41. package/dist/@types/modules/corecompiler/original/compile/handler/mpjson.d.ts +10 -0
  42. package/dist/@types/modules/corecompiler/original/compile/handler/wxml.d.ts +9 -0
  43. package/dist/@types/modules/corecompiler/original/compile/handler/wxss.d.ts +10 -0
  44. package/dist/@types/modules/corecompiler/original/compile/index.d.ts +5 -0
  45. package/dist/@types/modules/corecompiler/original/compile/miniprogram.d.ts +5 -0
  46. package/dist/@types/modules/corecompiler/original/compile/miniprogramPlugin.d.ts +8 -0
  47. package/dist/@types/modules/corecompiler/original/index.d.ts +51 -0
  48. package/dist/@types/modules/corecompiler/original/js/index.d.ts +3 -0
  49. package/dist/@types/modules/corecompiler/original/js/minifyjs.d.ts +16 -0
  50. package/dist/@types/modules/corecompiler/original/js/minifyjsAfterWrap.d.ts +12 -0
  51. package/dist/@types/modules/corecompiler/original/json/app/appJSON.d.ts +6 -0
  52. package/dist/@types/modules/corecompiler/original/json/app/checkAppFields.d.ts +43 -0
  53. package/dist/@types/modules/corecompiler/original/json/app/extJSON.d.ts +3 -0
  54. package/dist/@types/modules/corecompiler/original/json/app/index.d.ts +4 -0
  55. package/dist/@types/modules/corecompiler/original/json/common.d.ts +19 -0
  56. package/dist/@types/modules/corecompiler/original/json/game.d.ts +4 -0
  57. package/dist/@types/modules/corecompiler/original/json/page/checkPageJSON.d.ts +6 -0
  58. package/dist/@types/modules/corecompiler/original/json/page/getPageJSON.d.ts +14 -0
  59. package/dist/@types/modules/corecompiler/original/json/plugin/plugin.d.ts +12 -0
  60. package/dist/@types/modules/corecompiler/original/json/plugin/pluginPage.d.ts +9 -0
  61. package/dist/@types/modules/corecompiler/original/json/projectconfig.d.ts +2 -0
  62. package/dist/@types/modules/corecompiler/original/json/reactiveCache.d.ts +24 -0
  63. package/dist/@types/modules/corecompiler/original/json/signaturejson.d.ts +21 -0
  64. package/dist/@types/modules/corecompiler/original/json/sitemap.d.ts +3 -0
  65. package/dist/@types/modules/corecompiler/original/json/theme.d.ts +18 -0
  66. package/dist/@types/modules/corecompiler/original/npm/packnpm.d.ts +13 -0
  67. package/dist/@types/modules/corecompiler/original/protect/uglifyfilenames.d.ts +9 -0
  68. package/dist/@types/modules/corecompiler/original/utils/env.d.ts +7 -0
  69. package/dist/@types/modules/corecompiler/original/validate/appjson.d.ts +3 -0
  70. package/dist/@types/modules/corecompiler/original/validate/extjson.d.ts +3 -0
  71. package/dist/@types/modules/corecompiler/original/validate/gamejson.d.ts +3 -0
  72. package/dist/@types/modules/corecompiler/original/validate/gamepluginjson.d.ts +3 -0
  73. package/dist/@types/modules/corecompiler/original/validate/pagejson.d.ts +3 -0
  74. package/dist/@types/modules/corecompiler/original/validate/pluginjson.d.ts +3 -0
  75. package/dist/@types/modules/corecompiler/original/validate/pluginpagejson.d.ts +3 -0
  76. package/dist/@types/modules/corecompiler/original/validate/projectconfig.d.ts +3 -0
  77. package/dist/@types/modules/corecompiler/original/validate/schemaValidate.d.ts +8 -0
  78. package/dist/@types/modules/corecompiler/original/validate/signaturejson.d.ts +3 -0
  79. package/dist/@types/modules/corecompiler/original/validate/sitemapjson.d.ts +3 -0
  80. package/dist/@types/modules/corecompiler/original/workerThread/childprocessManager.d.ts +16 -0
  81. package/dist/@types/modules/corecompiler/original/workerThread/index.d.ts +4 -0
  82. package/dist/@types/modules/corecompiler/original/workerThread/task/compilejs.d.ts +43 -0
  83. package/dist/@types/modules/corecompiler/original/workerThread/task/compilewxss.d.ts +21 -0
  84. package/dist/@types/modules/corecompiler/original/workerThread/task/index.d.ts +2 -0
  85. package/dist/@types/modules/corecompiler/original/workerThread/task/minifywxml.d.ts +46 -0
  86. package/dist/@types/modules/corecompiler/original/workerThread/workerManager.d.ts +19 -0
  87. package/dist/@types/modules/corecompiler/originalCompiler.d.ts +106 -0
  88. package/dist/@types/modules/corecompiler/summer/graph/appconf.d.ts +36 -0
  89. package/dist/@types/modules/corecompiler/summer/graph/appgraph.d.ts +24 -0
  90. package/dist/@types/modules/corecompiler/summer/graph/baseconf.d.ts +16 -0
  91. package/dist/@types/modules/corecompiler/summer/graph/basegraph.d.ts +88 -0
  92. package/dist/@types/modules/corecompiler/summer/graph/gameconf.d.ts +20 -0
  93. package/dist/@types/modules/corecompiler/summer/graph/gamegraph.d.ts +24 -0
  94. package/dist/@types/modules/corecompiler/summer/graph/gamepluginconf.d.ts +11 -0
  95. package/dist/@types/modules/corecompiler/summer/graph/gameplugingraph.d.ts +23 -0
  96. package/dist/@types/modules/corecompiler/summer/graph/pluginconf.d.ts +21 -0
  97. package/dist/@types/modules/corecompiler/summer/graph/plugingraph.d.ts +23 -0
  98. package/dist/@types/modules/corecompiler/summer/graph/util.d.ts +2 -0
  99. package/dist/@types/modules/corecompiler/summer/index.d.ts +3 -0
  100. package/dist/@types/modules/corecompiler/summer/initPlugin.d.ts +2 -0
  101. package/dist/@types/modules/corecompiler/summer/module.d.ts +44 -0
  102. package/dist/@types/modules/corecompiler/summer/persistCache.d.ts +13 -0
  103. package/dist/@types/modules/corecompiler/summer/pluginDriver.d.ts +45 -0
  104. package/dist/@types/modules/corecompiler/summer/pluginconfig.d.ts +4 -0
  105. package/dist/@types/modules/corecompiler/summer/plugins/base/es6module.d.ts +21 -0
  106. package/dist/@types/modules/corecompiler/summer/plugins/base/javascript.d.ts +3 -0
  107. package/dist/@types/modules/corecompiler/summer/plugins/base/swc.d.ts +6 -0
  108. package/dist/@types/modules/corecompiler/summer/plugins/base/wxss.d.ts +6 -0
  109. package/dist/@types/modules/corecompiler/summer/plugins/enhance.d.ts +4 -0
  110. package/dist/@types/modules/corecompiler/summer/plugins/less.d.ts +5 -0
  111. package/dist/@types/modules/corecompiler/summer/plugins/minifywxml.d.ts +5 -0
  112. package/dist/@types/modules/corecompiler/summer/plugins/sass.d.ts +3 -0
  113. package/dist/@types/modules/corecompiler/summer/plugins/terser.d.ts +2 -0
  114. package/dist/@types/modules/corecompiler/summer/plugins/typescript.d.ts +2 -0
  115. package/dist/@types/modules/corecompiler/summer/plugins/worklet.d.ts +4 -0
  116. package/dist/@types/modules/corecompiler/summer/resolver.d.ts +29 -0
  117. package/dist/@types/modules/corecompiler/summer/summer.d.ts +40 -0
  118. package/dist/@types/modules/corecompiler/summer/utils/ensureArray.d.ts +1 -0
  119. package/dist/@types/modules/corecompiler/summer/utils/inputsourcemap.d.ts +2 -0
  120. package/dist/@types/modules/corecompiler/summer/worker.d.ts +16 -0
  121. package/dist/@types/modules/corecompiler/summerCompiler.d.ts +121 -0
  122. package/dist/@types/modules/createSummer.d.ts +18 -0
  123. package/dist/@types/modules/fullcompiler/app/app.d.ts +74 -0
  124. package/dist/@types/modules/fullcompiler/app/contactandlaunch/originalcontactbase64.d.ts +2 -0
  125. package/dist/@types/modules/fullcompiler/app/contactandlaunch/originallaunchbase64.d.ts +2 -0
  126. package/dist/@types/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.d.ts +2 -0
  127. package/dist/@types/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.d.ts +3 -0
  128. package/dist/@types/modules/fullcompiler/appservice/appservice.config.d.ts +4 -0
  129. package/dist/@types/modules/fullcompiler/appservice/generatecode.utils.d.ts +12 -0
  130. package/dist/@types/modules/fullcompiler/appservice/getappservice.d.ts +9 -0
  131. package/dist/@types/modules/fullcompiler/appservice/getcompiledjs.d.ts +32 -0
  132. package/dist/@types/modules/fullcompiler/appservice/getjsfile.d.ts +18 -0
  133. package/dist/@types/modules/fullcompiler/appservice/getmainpkgsortedjsfiles.d.ts +12 -0
  134. package/dist/@types/modules/fullcompiler/appservice/getsubpackage.d.ts +7 -0
  135. package/dist/@types/modules/fullcompiler/appservice/getsubpkgsortedjsfiles.d.ts +10 -0
  136. package/dist/@types/modules/fullcompiler/appservice/getwxappcode.d.ts +13 -0
  137. package/dist/@types/modules/fullcompiler/config/apperrcode.config.d.ts +48 -0
  138. package/dist/@types/modules/fullcompiler/filerules.d.ts +5 -0
  139. package/dist/@types/modules/fullcompiler/getallrawfiles.d.ts +11 -0
  140. package/dist/@types/modules/fullcompiler/getallwmltohtmlmap.d.ts +11 -0
  141. package/dist/@types/modules/fullcompiler/index.d.ts +28 -0
  142. package/dist/@types/modules/fullcompiler/pageframe/getsubpackage.d.ts +10 -0
  143. package/dist/@types/modules/fullcompiler/pageframe/getwxappcode.d.ts +13 -0
  144. package/dist/@types/modules/fullcompiler/pageframe/index.d.ts +10 -0
  145. package/dist/@types/modules/fullcompiler/trans/transwxmltojs.d.ts +11 -0
  146. package/dist/@types/modules/fullcompiler/trans/transwxsstojs.d.ts +21 -0
  147. package/dist/@types/modules/fullcompiler/trans/wcc/index.d.ts +2 -0
  148. package/dist/@types/modules/fullcompiler/trans/wxml/compilewxml.d.ts +18 -0
  149. package/dist/@types/modules/fullcompiler/trans/wxss/compilewxss.d.ts +11 -0
  150. package/dist/@types/modules/fullcompiler/utils/appconfig/appconfig.d.ts +12 -0
  151. package/dist/@types/modules/fullcompiler/utils/appconfig/appjson.d.ts +3 -0
  152. package/dist/@types/modules/fullcompiler/utils/appconfig/checkcustomcomponent.d.ts +14 -0
  153. package/dist/@types/modules/fullcompiler/utils/appconfig/pagejson.d.ts +3 -0
  154. package/dist/@types/modules/fullcompiler/utils/appconfig/wxappcodejson.d.ts +3 -0
  155. package/dist/@types/modules/fullcompiler/utils/filewriter/index.d.ts +14 -0
  156. package/dist/@types/modules/fullcompiler/utils/handleerror/errorconfig.d.ts +9 -0
  157. package/dist/@types/modules/fullcompiler/utils/handleerror/handleError.d.ts +3 -0
  158. package/dist/@types/modules/fullcompiler/utils/handleerror/parseerr.d.ts +41 -0
  159. package/dist/@types/modules/fullcompiler/utils/index.d.ts +4 -0
  160. package/dist/@types/modules/fullcompiler/utils/taskmanager.d.ts +23 -0
  161. package/dist/@types/modules/fullcompiler/utils/theme/index.d.ts +40 -0
  162. package/dist/@types/modules/fullcompiler/utils/tools.d.ts +15 -0
  163. package/dist/@types/modules/fullcompiler/utils/transformsourcemap.d.ts +1 -0
  164. package/dist/@types/modules/index.d.ts +52 -0
  165. package/dist/@types/modules/nativecompiler/android/adb.d.ts +7 -0
  166. package/dist/@types/modules/nativecompiler/android/device.d.ts +15 -0
  167. package/dist/@types/modules/nativecompiler/android/index.d.ts +17 -0
  168. package/dist/@types/modules/nativecompiler/android/projectconfig.d.ts +11 -0
  169. package/dist/@types/modules/nativecompiler/index.d.ts +32 -0
  170. package/dist/@types/modules/nativecompiler/ios/buildCloud.d.ts +56 -0
  171. package/dist/@types/modules/nativecompiler/ios/device.d.ts +24 -0
  172. package/dist/@types/modules/nativecompiler/ios/index.d.ts +52 -0
  173. package/dist/@types/modules/nativecompiler/ios/projectconfig.d.ts +3 -0
  174. package/dist/@types/modules/nativecompiler/nativeCompiler.d.ts +40 -0
  175. package/dist/@types/modules/nativecompiler/nativeEntryProcess.d.ts +1 -0
  176. package/dist/@types/modules/precompiler/conditioncompile/compiler/base.d.ts +27 -0
  177. package/dist/@types/modules/precompiler/conditioncompile/compiler/json.d.ts +10 -0
  178. package/dist/@types/modules/precompiler/conditioncompile/compiler/macro.d.ts +44 -0
  179. package/dist/@types/modules/precompiler/conditioncompile/compiler/plant.d.ts +10 -0
  180. package/dist/@types/modules/precompiler/conditioncompile/define.d.ts +18 -0
  181. package/dist/@types/modules/precompiler/conditioncompile/index.d.ts +24 -0
  182. package/dist/@types/modules/precompiler/index.d.ts +10 -0
  183. package/dist/@types/project/advance/precompileProject.d.ts +35 -0
  184. package/dist/@types/project/advance/reactiveProject.d.ts +39 -0
  185. package/dist/@types/project/baseProject.d.ts +74 -0
  186. package/dist/@types/project/ciProject.d.ts +25 -0
  187. package/dist/@types/project/ciProjectWithMockBuffer.d.ts +11 -0
  188. package/dist/@types/project/devtoolsProject.d.ts +11 -0
  189. package/dist/@types/project/summerCPProject.d.ts +14 -0
  190. package/dist/@types/project/webProject.d.ts +10 -0
  191. package/dist/@types/types/ci.d.ts +182 -0
  192. package/dist/@types/types/core.d.ts +129 -0
  193. package/dist/@types/types/devtools.d.ts +220 -0
  194. package/dist/@types/types/index.d.ts +5 -169
  195. package/dist/@types/types/miniapp/index.d.ts +246 -0
  196. package/dist/@types/types/miniprogram-json/app.d.ts +26 -11
  197. package/dist/@types/types/miniprogram-json/index.d.ts +1 -0
  198. package/dist/@types/types/miniprogram-json/page.d.ts +5 -1
  199. package/dist/@types/types/miniprogram-json/plugin.d.ts +6 -1
  200. package/dist/@types/types/miniprogram-json/projectconfig.d.ts +6 -9
  201. package/dist/@types/types/summer.d.ts +161 -0
  202. package/dist/@types/utils/babel_helper.d.ts +7 -4
  203. package/dist/@types/utils/babel_plugin_worklet.d.ts +0 -1
  204. package/dist/@types/utils/codesign.d.ts +19 -0
  205. package/dist/@types/utils/common.d.ts +2 -4
  206. package/dist/@types/utils/cp.d.ts +3 -0
  207. package/dist/@types/utils/customError.d.ts +22 -0
  208. package/dist/@types/utils/download.d.ts +1 -0
  209. package/dist/@types/utils/env.d.ts +2 -0
  210. package/dist/@types/utils/expression.d.ts +61 -0
  211. package/dist/@types/utils/filerules.d.ts +0 -0
  212. package/dist/@types/utils/fs.d.ts +3 -3
  213. package/dist/@types/utils/fsagent.d.ts +9 -9
  214. package/dist/@types/utils/generateIpa.d.ts +2 -0
  215. package/dist/@types/utils/helper_util.d.ts +11 -0
  216. package/dist/@types/utils/interruptibletask.d.ts +4 -4
  217. package/dist/@types/utils/jsonlint.d.ts +2 -2
  218. package/dist/@types/utils/locales/locales.d.ts +18 -0
  219. package/dist/@types/utils/locales/zh.d.ts +18 -0
  220. package/dist/@types/utils/log.d.ts +13 -19
  221. package/dist/@types/utils/messageHub.d.ts +17 -0
  222. package/dist/@types/utils/miniapp-builder.d.ts +68 -0
  223. package/dist/@types/utils/miniappJson.d.ts +151 -0
  224. package/dist/@types/utils/packOptionsHelper.d.ts +17 -0
  225. package/dist/@types/utils/progressRecorder.d.ts +14 -0
  226. package/dist/@types/utils/request.d.ts +4 -4
  227. package/dist/@types/utils/signature.d.ts +13 -0
  228. package/dist/@types/utils/singletontask.d.ts +29 -0
  229. package/dist/@types/utils/subprocess/entryProcess.d.ts +7 -0
  230. package/dist/@types/utils/subprocess/processManager.d.ts +25 -0
  231. package/dist/@types/utils/swc_config.d.ts +3 -0
  232. package/dist/@types/utils/swc_helper.d.ts +11 -0
  233. package/dist/@types/utils/taskmanager.d.ts +22 -0
  234. package/dist/@types/utils/taskqueue.d.ts +0 -0
  235. package/dist/@types/utils/taskstatus.d.ts +2 -2
  236. package/dist/@types/utils/tools.d.ts +16 -1
  237. package/dist/@types/utils/waitable.d.ts +12 -0
  238. package/dist/@types/utils/wxapkg/pack.d.ts +7 -0
  239. package/dist/@types/utils/zip.d.ts +3 -0
  240. package/dist/ci/checkCodeQuality.js +1 -3
  241. package/dist/ci/cloud/cloudapi.js +1 -0
  242. package/dist/ci/cloud/createTimeTrigger.js +1 -0
  243. package/dist/ci/cloud/uploadContainer.js +1 -0
  244. package/dist/ci/cloud/uploadFile.js +1 -0
  245. package/dist/ci/cloud/uploadFunction.js +1 -0
  246. package/dist/ci/cloud/utils.js +1 -0
  247. package/dist/ci/code-analyse.js +1 -3
  248. package/dist/ci/cos-upload.js +1 -3
  249. package/dist/ci/getCompiledResult.js +1 -3
  250. package/dist/ci/getDevSourceMap.js +1 -3
  251. package/dist/ci/getLatestVersion.js +1 -3
  252. package/dist/ci/getcompiler.js +1 -0
  253. package/dist/ci/index.js +1 -0
  254. package/dist/ci/jsserver.js +1 -3
  255. package/dist/ci/preview.js +1 -3
  256. package/dist/ci/project.js +1 -3
  257. package/dist/ci/projectattr.js +1 -3
  258. package/dist/ci/upload.js +1 -3
  259. package/dist/ci/utils/codeDenpendencyQualityChecker.js +1 -3
  260. package/dist/ci/utils/filterUnusedFile.js +1 -3
  261. package/dist/ci/utils/pack.js +1 -3
  262. package/dist/ci/utils/packfile.js +1 -3
  263. package/dist/ci/utils/qualitycheckoption.js +1 -3
  264. package/dist/ci/utils/terminalQrcode.js +1 -3
  265. package/dist/ci/utils/tools.js +1 -0
  266. package/dist/cli/index.js +1 -0
  267. package/dist/common/cloud-api/index.js +279 -0
  268. package/dist/common/cloud-api/src/apis/apis.js +1 -0
  269. package/dist/common/cloud-api/src/apis/cdn/cdn.apis.js +1 -0
  270. package/dist/common/cloud-api/src/apis/cdn/index.js +1 -0
  271. package/dist/common/cloud-api/src/apis/flexdb/flexdb.apis.js +1 -0
  272. package/dist/common/cloud-api/src/apis/flexdb/index.js +1 -0
  273. package/dist/common/cloud-api/src/apis/scf/index.js +1 -0
  274. package/dist/common/cloud-api/src/apis/scf/scf.apis.js +1 -0
  275. package/dist/common/cloud-api/src/apis/ssl/index.js +1 -0
  276. package/dist/common/cloud-api/src/apis/ssl/ssl.apis.js +1 -0
  277. package/dist/common/cloud-api/src/apis/tcb/general.apis.js +1 -0
  278. package/dist/common/cloud-api/src/apis/tcb/index.js +1 -0
  279. package/dist/common/cloud-api/src/apis/tcb/tcb.apis.js +1 -0
  280. package/dist/common/cloud-api/src/index.js +1 -0
  281. package/dist/common/cloud-api/src/transaction/contracts/account.contracts.js +1 -0
  282. package/dist/common/cloud-api/src/transaction/contracts/cdn.contracts.js +1 -0
  283. package/dist/common/cloud-api/src/transaction/contracts/contracts.js +1 -0
  284. package/dist/common/cloud-api/src/transaction/contracts/factory.js +1 -0
  285. package/dist/common/cloud-api/src/transaction/contracts/flexdb.contracts.js +1 -0
  286. package/dist/common/cloud-api/src/transaction/contracts/lowcode.contracts.js +1 -0
  287. package/dist/common/cloud-api/src/transaction/contracts/scf.contracts.js +1 -0
  288. package/dist/common/cloud-api/src/transaction/contracts/ssl.contracts.js +1 -0
  289. package/dist/common/cloud-api/src/transaction/contracts/tcb.contracts.js +1 -0
  290. package/dist/common/cloud-api/src/transaction/transactor.js +1 -0
  291. package/dist/common/cloud-api/src/transaction/validations/account.validations.js +1 -0
  292. package/dist/common/cloud-api/src/transaction/validations/cdn.validations.js +1 -0
  293. package/dist/common/cloud-api/src/transaction/validations/common.validations.js +1 -0
  294. package/dist/common/cloud-api/src/transaction/validations/flexdb.validations.js +1 -0
  295. package/dist/common/cloud-api/src/transaction/validations/lowcode.validations.js +1 -0
  296. package/dist/common/cloud-api/src/transaction/validations/scf.validations.js +1 -0
  297. package/dist/common/cloud-api/src/transaction/validations/ssl.validations.js +1 -0
  298. package/dist/common/cloud-api/src/transaction/validations/tcb.validations.js +1 -0
  299. package/dist/common/cloud-api/src/transaction/validations/validations.js +1 -0
  300. package/dist/common/cloud-api/src/utils/common.js +1 -0
  301. package/dist/common/cloud-api/src/utils/validator.js +1 -0
  302. package/dist/common/code-analyse/index.js +2 -0
  303. package/dist/config/compiletype.config.js +1 -0
  304. package/dist/config/config.js +1 -0
  305. package/dist/config/define.js +1 -0
  306. package/dist/config/url.config.js +1 -0
  307. package/dist/index.js +1 -3
  308. package/dist/manifest.json +2 -2
  309. package/dist/modules/corecompiler/baseCompiler.js +1 -0
  310. package/dist/modules/corecompiler/original/analyse/partial.js +1 -0
  311. package/dist/modules/corecompiler/original/compile/common.js +1 -0
  312. package/dist/modules/corecompiler/original/compile/game.js +1 -0
  313. package/dist/modules/corecompiler/original/compile/gamePlugin.js +1 -0
  314. package/dist/modules/corecompiler/original/compile/handler/js.js +1 -0
  315. package/dist/modules/corecompiler/original/compile/handler/mpjson.js +1 -0
  316. package/dist/modules/corecompiler/original/compile/handler/wxml.js +1 -0
  317. package/dist/modules/corecompiler/original/compile/handler/wxss.js +1 -0
  318. package/dist/modules/corecompiler/original/compile/index.js +1 -0
  319. package/dist/modules/corecompiler/original/compile/miniprogram.js +1 -0
  320. package/dist/modules/corecompiler/original/compile/miniprogramPlugin.js +1 -0
  321. package/dist/modules/corecompiler/original/index.js +1 -0
  322. package/dist/modules/corecompiler/original/js/enhance.js +1 -0
  323. package/dist/modules/corecompiler/original/js/es6Transform.js +1 -0
  324. package/dist/modules/corecompiler/original/js/index.js +1 -0
  325. package/dist/modules/corecompiler/original/js/minifyjs.js +1 -0
  326. package/dist/modules/corecompiler/original/js/minifyjsAfterWrap.js +1 -0
  327. package/dist/modules/corecompiler/original/js/workletCompile.js +1 -0
  328. package/dist/modules/corecompiler/original/json/app/appJSON.js +1 -0
  329. package/dist/modules/corecompiler/original/json/app/checkAppFields.js +1 -0
  330. package/dist/modules/corecompiler/original/json/app/extJSON.js +1 -0
  331. package/dist/modules/corecompiler/original/json/app/index.js +1 -0
  332. package/dist/modules/corecompiler/original/json/common.js +1 -0
  333. package/dist/modules/corecompiler/original/json/game.js +1 -0
  334. package/dist/modules/corecompiler/original/json/page/checkPageJSON.js +1 -0
  335. package/dist/modules/corecompiler/original/json/page/getPageJSON.js +1 -0
  336. package/dist/modules/corecompiler/original/json/plugin/plugin.js +1 -0
  337. package/dist/modules/corecompiler/original/json/plugin/pluginPage.js +1 -0
  338. package/dist/modules/corecompiler/original/json/projectconfig.js +1 -0
  339. package/dist/modules/corecompiler/original/json/reactiveCache.js +1 -0
  340. package/dist/modules/corecompiler/original/json/signaturejson.js +1 -0
  341. package/dist/modules/corecompiler/original/json/sitemap.js +1 -0
  342. package/dist/modules/corecompiler/original/json/theme.js +1 -0
  343. package/dist/modules/corecompiler/original/npm/filterdeps.js +1 -0
  344. package/dist/modules/corecompiler/original/npm/packnpm.js +1 -0
  345. package/dist/modules/corecompiler/original/protect/fileFlatter.js +1 -0
  346. package/dist/modules/corecompiler/original/protect/uglifyfilenames.js +1 -0
  347. package/dist/modules/corecompiler/original/utils/env.js +1 -0
  348. package/dist/modules/corecompiler/original/utils/logger.js +1 -0
  349. package/dist/modules/corecompiler/original/validate/appjson.js +1 -0
  350. package/dist/modules/corecompiler/original/validate/extjson.js +1 -0
  351. package/dist/modules/corecompiler/original/validate/gamejson.js +1 -0
  352. package/dist/modules/corecompiler/original/validate/gamepluginjson.js +1 -0
  353. package/dist/modules/corecompiler/original/validate/pagejson.js +1 -0
  354. package/dist/modules/corecompiler/original/validate/pluginjson.js +1 -0
  355. package/dist/modules/corecompiler/original/validate/pluginpagejson.js +1 -0
  356. package/dist/modules/corecompiler/original/validate/projectconfig.js +1 -0
  357. package/dist/modules/corecompiler/original/validate/schemaValidate.js +1 -0
  358. package/dist/modules/corecompiler/original/validate/signaturejson.js +1 -0
  359. package/dist/modules/corecompiler/original/validate/sitemapjson.js +1 -0
  360. package/dist/modules/corecompiler/original/validate/validate.js +1 -0
  361. package/dist/modules/corecompiler/original/workerThread/childprocess.js +1 -0
  362. package/dist/modules/corecompiler/original/workerThread/childprocessManager.js +1 -0
  363. package/dist/modules/corecompiler/original/workerThread/fork.js +1 -0
  364. package/dist/modules/corecompiler/original/workerThread/index.js +1 -0
  365. package/dist/modules/corecompiler/original/workerThread/task/compilejs.js +1 -0
  366. package/dist/modules/corecompiler/original/workerThread/task/compilewxss.js +1 -0
  367. package/dist/modules/corecompiler/original/workerThread/task/minifywxml.js +1 -0
  368. package/dist/modules/corecompiler/original/workerThread/worker.js +1 -0
  369. package/dist/modules/corecompiler/original/workerThread/workerManager.js +1 -0
  370. package/dist/modules/corecompiler/originalCompiler.js +1 -0
  371. package/dist/modules/corecompiler/summer/graph/appconf.js +1 -0
  372. package/dist/modules/corecompiler/summer/graph/appgraph.js +1 -0
  373. package/dist/modules/corecompiler/summer/graph/baseconf.js +1 -0
  374. package/dist/modules/corecompiler/summer/graph/basegraph.js +1 -0
  375. package/dist/modules/corecompiler/summer/graph/gameconf.js +1 -0
  376. package/dist/modules/corecompiler/summer/graph/gamegraph.js +1 -0
  377. package/dist/modules/corecompiler/summer/graph/gamepluginconf.js +1 -0
  378. package/dist/modules/corecompiler/summer/graph/gameplugingraph.js +1 -0
  379. package/dist/modules/corecompiler/summer/graph/pluginconf.js +1 -0
  380. package/dist/modules/corecompiler/summer/graph/plugingraph.js +1 -0
  381. package/dist/modules/corecompiler/summer/graph/util.js +1 -0
  382. package/dist/modules/corecompiler/summer/index.js +1 -0
  383. package/dist/modules/corecompiler/summer/initPlugin.js +1 -0
  384. package/dist/modules/corecompiler/summer/module.js +1 -0
  385. package/dist/modules/corecompiler/summer/persistCache.js +1 -0
  386. package/dist/modules/corecompiler/summer/pluginDriver.js +1 -0
  387. package/dist/modules/corecompiler/summer/pluginconfig.js +1 -0
  388. package/dist/modules/corecompiler/summer/plugins/base/es6module.js +1 -0
  389. package/dist/modules/corecompiler/summer/plugins/base/javascript.js +1 -0
  390. package/dist/modules/corecompiler/summer/plugins/base/swc.js +1 -0
  391. package/dist/modules/corecompiler/summer/plugins/base/wxss.js +1 -0
  392. package/dist/modules/corecompiler/summer/plugins/enhance.js +1 -0
  393. package/dist/modules/corecompiler/summer/plugins/index.js +1 -0
  394. package/dist/modules/corecompiler/summer/plugins/less.js +1 -0
  395. package/dist/modules/corecompiler/summer/plugins/minifywxml.js +1 -0
  396. package/dist/modules/corecompiler/summer/plugins/sass.js +1 -0
  397. package/dist/modules/corecompiler/summer/plugins/terser.js +1 -0
  398. package/dist/modules/corecompiler/summer/plugins/typescript.js +1 -0
  399. package/dist/modules/corecompiler/summer/plugins/worklet.js +1 -0
  400. package/dist/modules/corecompiler/summer/resolver.js +1 -0
  401. package/dist/modules/corecompiler/summer/summer.js +1 -0
  402. package/dist/modules/corecompiler/summer/utils/async.js +1 -0
  403. package/dist/modules/corecompiler/summer/utils/ensureArray.js +1 -0
  404. package/dist/modules/corecompiler/summer/utils/inputsourcemap.js +1 -0
  405. package/dist/modules/corecompiler/summer/worker.js +1 -0
  406. package/dist/modules/corecompiler/summerCompiler.js +1 -0
  407. package/dist/modules/corecompiler/summerEntryProcess.js +1 -0
  408. package/dist/modules/createSummer.js +1 -0
  409. package/dist/modules/fullcompiler/app/app.js +1 -0
  410. package/dist/modules/fullcompiler/app/contactandlaunch/originalcontactbase64.js +1 -0
  411. package/dist/modules/fullcompiler/app/contactandlaunch/originallaunchbase64.js +1 -0
  412. package/dist/modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg.js +1 -0
  413. package/dist/modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch.js +1 -0
  414. package/dist/modules/fullcompiler/appservice/appservice.config.js +1 -0
  415. package/dist/modules/fullcompiler/appservice/generatecode.utils.js +1 -0
  416. package/dist/modules/fullcompiler/appservice/getappservice.js +1 -0
  417. package/dist/modules/fullcompiler/appservice/getcompiledjs.js +1 -0
  418. package/dist/modules/fullcompiler/appservice/getjsfile.js +1 -0
  419. package/dist/modules/fullcompiler/appservice/getmainpkgsortedjsfiles.js +1 -0
  420. package/dist/modules/fullcompiler/appservice/getsubpackage.js +1 -0
  421. package/dist/modules/fullcompiler/appservice/getsubpkgsortedjsfiles.js +1 -0
  422. package/dist/modules/fullcompiler/appservice/getwxappcode.js +1 -0
  423. package/dist/modules/fullcompiler/config/apperrcode.config.js +1 -0
  424. package/dist/modules/fullcompiler/filerules.js +1 -0
  425. package/dist/modules/fullcompiler/getallrawfiles.js +1 -0
  426. package/dist/modules/fullcompiler/getallwmltohtmlmap.js +1 -0
  427. package/dist/modules/fullcompiler/index.js +1 -0
  428. package/dist/modules/fullcompiler/pageframe/getsubpackage.js +1 -0
  429. package/dist/modules/fullcompiler/pageframe/getwxappcode.js +1 -0
  430. package/dist/modules/fullcompiler/pageframe/index.js +1 -0
  431. package/dist/modules/fullcompiler/trans/transwxmltojs.js +1 -0
  432. package/dist/modules/fullcompiler/trans/transwxsstojs.js +1 -0
  433. package/dist/modules/fullcompiler/trans/wcc/build/darwin_arm64/wcc.node +0 -0
  434. package/dist/modules/fullcompiler/trans/wcc/build/darwin_arm64/wcsc.node +0 -0
  435. package/dist/modules/fullcompiler/trans/wcc/build/darwin_x64/wcc.node +0 -0
  436. package/dist/modules/fullcompiler/trans/wcc/build/darwin_x64/wcsc.node +0 -0
  437. package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_arm64_release/wcc.node +0 -0
  438. package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_arm64_release/wcsc.node +0 -0
  439. package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_x64_release/wcc.node +0 -0
  440. package/dist/modules/fullcompiler/trans/wcc/build/node_16.1.0_darwin_x64_release/wcsc.node +0 -0
  441. package/dist/modules/fullcompiler/trans/wcc/build/win32_ia32/wcc.node +0 -0
  442. package/dist/modules/fullcompiler/trans/wcc/build/win32_ia32/wcsc.node +0 -0
  443. package/dist/modules/fullcompiler/trans/wcc/build/win32_x64/wcc.node +0 -0
  444. package/dist/modules/fullcompiler/trans/wcc/build/win32_x64/wcsc.node +0 -0
  445. package/dist/modules/fullcompiler/trans/wcc/index.js +1 -0
  446. package/dist/modules/fullcompiler/trans/wcc/lib/addonVersion.js +19 -0
  447. package/dist/modules/fullcompiler/trans/wcc/lib/index.js +4 -0
  448. package/dist/modules/fullcompiler/trans/wcc/lib/util.js +1134 -0
  449. package/dist/modules/fullcompiler/trans/wcc/lib/wcc.js +94 -0
  450. package/dist/modules/fullcompiler/trans/wcc/lib/wcsc.js +93 -0
  451. package/dist/modules/fullcompiler/trans/wxml/compilewxml.js +1 -0
  452. package/dist/modules/fullcompiler/trans/wxss/compilewxss.js +1 -0
  453. package/dist/modules/fullcompiler/utils/appconfig/appconfig.js +1 -0
  454. package/dist/modules/fullcompiler/utils/appconfig/appjson.js +1 -0
  455. package/dist/modules/fullcompiler/utils/appconfig/checkcustomcomponent.js +1 -0
  456. package/dist/modules/fullcompiler/utils/appconfig/pagejson.js +1 -0
  457. package/dist/modules/fullcompiler/utils/appconfig/wxappcodejson.js +1 -0
  458. package/dist/modules/fullcompiler/utils/filewriter/index.js +1 -0
  459. package/dist/modules/fullcompiler/utils/handleerror/errorconfig.js +1 -0
  460. package/dist/modules/fullcompiler/utils/handleerror/handleError.js +1 -0
  461. package/dist/modules/fullcompiler/utils/handleerror/parseerr.js +1 -0
  462. package/dist/modules/fullcompiler/utils/index.js +1 -0
  463. package/dist/modules/fullcompiler/utils/taskmanager.js +1 -0
  464. package/dist/modules/fullcompiler/utils/theme/index.js +1 -0
  465. package/dist/modules/fullcompiler/utils/tools.js +1 -0
  466. package/dist/modules/fullcompiler/utils/transformsourcemap.js +1 -0
  467. package/dist/modules/index.js +1 -0
  468. package/dist/modules/nativecompiler/android/adb.js +1 -0
  469. package/dist/modules/nativecompiler/android/device.js +1 -0
  470. package/dist/modules/nativecompiler/android/index.js +1 -0
  471. package/dist/modules/nativecompiler/android/projectconfig.js +1 -0
  472. package/dist/modules/nativecompiler/index.js +1 -0
  473. package/dist/modules/nativecompiler/ios/buildCloud.js +1 -0
  474. package/dist/modules/nativecompiler/ios/device.js +1 -0
  475. package/dist/modules/nativecompiler/ios/index.js +1 -0
  476. package/dist/modules/nativecompiler/ios/projectconfig.js +1 -0
  477. package/dist/modules/nativecompiler/nativeCompiler.js +1 -0
  478. package/dist/modules/nativecompiler/nativeEntryProcess.js +1 -0
  479. package/dist/modules/precompiler/conditioncompile/compiler/base.js +1 -0
  480. package/dist/modules/precompiler/conditioncompile/compiler/json.js +1 -0
  481. package/dist/modules/precompiler/conditioncompile/compiler/macro.js +1 -0
  482. package/dist/modules/precompiler/conditioncompile/compiler/plant.js +1 -0
  483. package/dist/modules/precompiler/conditioncompile/define.js +1 -0
  484. package/dist/modules/precompiler/conditioncompile/index.js +1 -0
  485. package/dist/modules/precompiler/index.js +1 -0
  486. package/dist/project/advance/precompileProject.js +1 -0
  487. package/dist/project/advance/reactiveProject.js +1 -0
  488. package/dist/project/baseProject.js +1 -0
  489. package/dist/project/ciProject.js +1 -0
  490. package/dist/project/ciProjectWithMockBuffer.js +1 -0
  491. package/dist/project/devtoolsProject.js +1 -0
  492. package/dist/project/summerCPProject.js +1 -0
  493. package/dist/project/webProject.js +1 -0
  494. package/dist/schema/dist/app.js +2221 -0
  495. package/dist/schema/dist/ext.js +1088 -0
  496. package/dist/schema/dist/game.js +211 -0
  497. package/dist/schema/dist/page.js +516 -0
  498. package/dist/schema/dist/plugin.js +53 -0
  499. package/dist/schema/dist/pluginpage.js +14 -0
  500. package/dist/schema/dist/projectconfig.js +655 -0
  501. package/dist/schema/dist/projectprivateconfig.js +371 -0
  502. package/dist/schema/dist/sitemap.js +53 -0
  503. package/dist/schema/dist/theme.js +20 -0
  504. package/dist/static/images/donut-icon1024x1024.png +0 -0
  505. package/dist/static/images/donut-icon120x120.png +0 -0
  506. package/dist/static/images/donut-icon152x152.png +0 -0
  507. package/dist/static/images/donut-icon167x167.png +0 -0
  508. package/dist/static/scripts/assetsCar/Assets.xcassets/AppIcon.appiconset/Contents.json +119 -0
  509. package/dist/static/scripts/assetsCar/Assets.xcassets/Contents.json +6 -0
  510. package/dist/static/scripts/assetsCar/Assets.xcassets/disconnect.imageset/Contents.json +21 -0
  511. package/dist/static/scripts/assetsCar/Assets.xcassets/disconnect.imageset/disconnect.png +0 -0
  512. package/dist/static/scripts/assetsCar/createAssetsCar +9 -0
  513. package/dist/static/scripts/checkXcodeEnv +18 -0
  514. package/dist/static/scripts/resignIpa +269 -0
  515. package/dist/types/ci.js +1 -0
  516. package/dist/types/core.js +1 -0
  517. package/dist/types/devtools.js +1 -0
  518. package/dist/types/index.js +1 -3
  519. package/dist/types/miniapp/index.js +1 -0
  520. package/dist/types/miniprogram-json/app.js +1 -3
  521. package/dist/types/miniprogram-json/base.js +1 -3
  522. package/dist/types/miniprogram-json/ext.js +1 -3
  523. package/dist/types/miniprogram-json/game.js +1 -3
  524. package/dist/types/miniprogram-json/index.js +1 -3
  525. package/dist/types/miniprogram-json/page.js +1 -3
  526. package/dist/types/miniprogram-json/plugin.js +1 -3
  527. package/dist/types/miniprogram-json/projectconfig.js +1 -3
  528. package/dist/types/miniprogram-json/sitemap.js +1 -3
  529. package/dist/types/miniprogram-json/theme.js +1 -3
  530. package/dist/types/summer.js +1 -0
  531. package/dist/utils/babel_helper.js +1 -3
  532. package/dist/utils/babel_plugin_worklet.js +1 -3
  533. package/dist/utils/babel_transform_plugin.js +1 -3
  534. package/dist/utils/cache.js +1 -3
  535. package/dist/utils/codesign.js +1 -0
  536. package/dist/utils/common.js +1 -3
  537. package/dist/utils/cp.js +1 -0
  538. package/dist/utils/customError.js +1 -0
  539. package/dist/utils/download.js +1 -0
  540. package/dist/utils/env.js +1 -0
  541. package/dist/utils/error.js +1 -3
  542. package/dist/utils/expression.js +1 -0
  543. package/dist/utils/filerules.js +1 -0
  544. package/dist/utils/fs.js +1 -3
  545. package/dist/utils/fsagent.js +1 -3
  546. package/dist/utils/generateIpa.js +1 -0
  547. package/dist/utils/glob.js +1 -3
  548. package/dist/utils/hackrequire/fs.js +1 -1
  549. package/dist/utils/hackrequire/module.js +1 -1
  550. package/dist/utils/helper_util.js +1 -0
  551. package/dist/utils/interruptibletask.js +1 -3
  552. package/dist/utils/jsonParse.js +1 -3
  553. package/dist/utils/jsonlint.js +1 -3
  554. package/dist/utils/locales/en.js +1 -3
  555. package/dist/utils/locales/fomatable_string.js +1 -3
  556. package/dist/utils/locales/locales.js +1 -3
  557. package/dist/utils/locales/zh.js +1 -3
  558. package/dist/utils/log.js +1 -3
  559. package/dist/utils/messageHub.js +1 -0
  560. package/dist/utils/miniapp-builder.js +1 -0
  561. package/dist/utils/miniappJson.js +1 -0
  562. package/dist/utils/packOptionsHelper.js +1 -0
  563. package/dist/utils/progressRecorder.js +1 -0
  564. package/dist/utils/report.js +1 -3
  565. package/dist/utils/request.js +1 -3
  566. package/dist/utils/sign.js +1 -3
  567. package/dist/utils/signature.js +1 -0
  568. package/dist/utils/singletontask.js +1 -0
  569. package/dist/utils/subprocess/entryProcess.js +1 -0
  570. package/dist/utils/subprocess/processManager.js +1 -0
  571. package/dist/utils/swc_config.js +1 -0
  572. package/dist/utils/swc_helper.js +1 -0
  573. package/dist/utils/taskmanager.js +1 -0
  574. package/dist/utils/taskqueue.js +1 -0
  575. package/dist/utils/taskstatus.js +1 -3
  576. package/dist/utils/tools.js +1 -3
  577. package/dist/utils/waitable.js +1 -0
  578. package/dist/utils/white_ext_list.js +1 -3
  579. package/dist/utils/wxapkg/pack.js +1 -0
  580. package/dist/utils/wxvpkgreader/wxvpkg/unpack/version0.js +1 -1
  581. package/dist/utils/wxvpkgreader/wxvpkg/unpack/version10.js +1 -1
  582. package/dist/utils/wxvpkgreader/wxvpkgreader.js +1 -1
  583. package/dist/utils/zip.js +1 -0
  584. package/dist/vendor/ios-deploy/ios-deploy +0 -0
  585. package/dist/vendor/swc_runtime/_apply_decorated_descriptor.js +1 -0
  586. package/dist/vendor/swc_runtime/_apply_decs_2203_r.js +1 -0
  587. package/dist/vendor/swc_runtime/_array_like_to_array.js +1 -0
  588. package/dist/vendor/swc_runtime/_array_with_holes.js +1 -0
  589. package/dist/vendor/swc_runtime/_array_without_holes.js +1 -0
  590. package/dist/vendor/swc_runtime/_assert_this_initialized.js +1 -0
  591. package/dist/vendor/swc_runtime/_async_generator.js +1 -0
  592. package/dist/vendor/swc_runtime/_async_generator_delegate.js +1 -0
  593. package/dist/vendor/swc_runtime/_async_iterator.js +1 -0
  594. package/dist/vendor/swc_runtime/_async_to_generator.js +1 -0
  595. package/dist/vendor/swc_runtime/_await_async_generator.js +1 -0
  596. package/dist/vendor/swc_runtime/_await_value.js +1 -0
  597. package/dist/vendor/swc_runtime/_check_private_redeclaration.js +1 -0
  598. package/dist/vendor/swc_runtime/_class_apply_descriptor_destructure.js +1 -0
  599. package/dist/vendor/swc_runtime/_class_apply_descriptor_get.js +1 -0
  600. package/dist/vendor/swc_runtime/_class_apply_descriptor_set.js +1 -0
  601. package/dist/vendor/swc_runtime/_class_apply_descriptor_update.js +1 -0
  602. package/dist/vendor/swc_runtime/_class_call_check.js +1 -0
  603. package/dist/vendor/swc_runtime/_class_check_private_static_access.js +1 -0
  604. package/dist/vendor/swc_runtime/_class_check_private_static_field_descriptor.js +1 -0
  605. package/dist/vendor/swc_runtime/_class_extract_field_descriptor.js +1 -0
  606. package/dist/vendor/swc_runtime/_class_name_tdz_error.js +1 -0
  607. package/dist/vendor/swc_runtime/_class_private_field_destructure.js +1 -0
  608. package/dist/vendor/swc_runtime/_class_private_field_get.js +1 -0
  609. package/dist/vendor/swc_runtime/_class_private_field_init.js +1 -0
  610. package/dist/vendor/swc_runtime/_class_private_field_loose_base.js +1 -0
  611. package/dist/vendor/swc_runtime/_class_private_field_loose_key.js +1 -0
  612. package/dist/vendor/swc_runtime/_class_private_field_set.js +1 -0
  613. package/dist/vendor/swc_runtime/_class_private_field_update.js +1 -0
  614. package/dist/vendor/swc_runtime/_class_private_method_get.js +1 -0
  615. package/dist/vendor/swc_runtime/_class_private_method_init.js +1 -0
  616. package/dist/vendor/swc_runtime/_class_private_method_set.js +1 -0
  617. package/dist/vendor/swc_runtime/_class_static_private_field_destructure.js +1 -0
  618. package/dist/vendor/swc_runtime/_class_static_private_field_spec_get.js +1 -0
  619. package/dist/vendor/swc_runtime/_class_static_private_field_spec_set.js +1 -0
  620. package/dist/vendor/swc_runtime/_class_static_private_field_update.js +1 -0
  621. package/dist/vendor/swc_runtime/_class_static_private_method_get.js +1 -0
  622. package/dist/vendor/swc_runtime/_construct.js +1 -0
  623. package/dist/vendor/swc_runtime/_create_class.js +1 -0
  624. package/dist/vendor/swc_runtime/_create_for_of_iterator_helper_loose.js +1 -0
  625. package/dist/vendor/swc_runtime/_create_super.js +1 -0
  626. package/dist/vendor/swc_runtime/_decorate.js +1 -0
  627. package/dist/vendor/swc_runtime/_defaults.js +1 -0
  628. package/dist/vendor/swc_runtime/_define_enumerable_properties.js +1 -0
  629. package/dist/vendor/swc_runtime/_define_property.js +1 -0
  630. package/dist/vendor/swc_runtime/_dispose.js +1 -0
  631. package/dist/vendor/swc_runtime/_export_star.js +1 -0
  632. package/dist/vendor/swc_runtime/_extends.js +1 -0
  633. package/dist/vendor/swc_runtime/_get.js +1 -0
  634. package/dist/vendor/swc_runtime/_get_prototype_of.js +1 -0
  635. package/dist/vendor/swc_runtime/_identity.js +1 -0
  636. package/dist/vendor/swc_runtime/_inherits.js +1 -0
  637. package/dist/vendor/swc_runtime/_inherits_loose.js +1 -0
  638. package/dist/vendor/swc_runtime/_initializer_define_property.js +1 -0
  639. package/dist/vendor/swc_runtime/_initializer_warning_helper.js +1 -0
  640. package/dist/vendor/swc_runtime/_instanceof.js +1 -0
  641. package/dist/vendor/swc_runtime/_interop_require_default.js +1 -0
  642. package/dist/vendor/swc_runtime/_interop_require_wildcard.js +1 -0
  643. package/dist/vendor/swc_runtime/_is_native_function.js +1 -0
  644. package/dist/vendor/swc_runtime/_is_native_reflect_construct.js +1 -0
  645. package/dist/vendor/swc_runtime/_iterable_to_array.js +1 -0
  646. package/dist/vendor/swc_runtime/_iterable_to_array_limit.js +1 -0
  647. package/dist/vendor/swc_runtime/_iterable_to_array_limit_loose.js +1 -0
  648. package/dist/vendor/swc_runtime/_jsx.js +1 -0
  649. package/dist/vendor/swc_runtime/_new_arrow_check.js +1 -0
  650. package/dist/vendor/swc_runtime/_non_iterable_rest.js +1 -0
  651. package/dist/vendor/swc_runtime/_non_iterable_spread.js +1 -0
  652. package/dist/vendor/swc_runtime/_object_destructuring_empty.js +1 -0
  653. package/dist/vendor/swc_runtime/_object_spread.js +1 -0
  654. package/dist/vendor/swc_runtime/_object_spread_props.js +1 -0
  655. package/dist/vendor/swc_runtime/_object_without_properties.js +1 -0
  656. package/dist/vendor/swc_runtime/_object_without_properties_loose.js +1 -0
  657. package/dist/vendor/swc_runtime/_possible_constructor_return.js +1 -0
  658. package/dist/vendor/swc_runtime/_read_only_error.js +1 -0
  659. package/dist/vendor/swc_runtime/_set.js +1 -0
  660. package/dist/vendor/swc_runtime/_set_prototype_of.js +1 -0
  661. package/dist/vendor/swc_runtime/_skip_first_generator_next.js +1 -0
  662. package/dist/vendor/swc_runtime/_sliced_to_array.js +1 -0
  663. package/dist/vendor/swc_runtime/_sliced_to_array_loose.js +1 -0
  664. package/dist/vendor/swc_runtime/_super_prop_base.js +1 -0
  665. package/dist/vendor/swc_runtime/_tagged_template_literal.js +1 -0
  666. package/dist/vendor/swc_runtime/_tagged_template_literal_loose.js +1 -0
  667. package/dist/vendor/swc_runtime/_throw.js +1 -0
  668. package/dist/vendor/swc_runtime/_to_array.js +1 -0
  669. package/dist/vendor/swc_runtime/_to_consumable_array.js +1 -0
  670. package/dist/vendor/swc_runtime/_to_primitive.js +1 -0
  671. package/dist/vendor/swc_runtime/_to_property_key.js +1 -0
  672. package/dist/vendor/swc_runtime/_ts_decorate.js +1 -0
  673. package/dist/vendor/swc_runtime/_ts_generator.js +1 -0
  674. package/dist/vendor/swc_runtime/_ts_metadata.js +1 -0
  675. package/dist/vendor/swc_runtime/_ts_param.js +1 -0
  676. package/dist/vendor/swc_runtime/_ts_values.js +1 -0
  677. package/dist/vendor/swc_runtime/_type_of.js +1 -0
  678. package/dist/vendor/swc_runtime/_unsupported_iterable_to_array.js +1 -0
  679. package/dist/vendor/swc_runtime/_update.js +1 -0
  680. package/dist/vendor/swc_runtime/_using.js +1 -0
  681. package/dist/vendor/swc_runtime/_wrap_async_generator.js +1 -0
  682. package/dist/vendor/swc_runtime/_wrap_native_super.js +1 -0
  683. package/dist/vendor/swc_runtime/_write_only_error.js +1 -0
  684. package/dist/vendor/swc_runtime/index.js +1 -0
  685. package/package.json +45 -10
  686. package/dist/@types/cloud/cloudapi.d.ts +0 -7
  687. package/dist/@types/cloud/createTimeTrigger.d.ts +0 -13
  688. package/dist/@types/cloud/uploadContainer.d.ts +0 -71
  689. package/dist/@types/cloud/uploadFile.d.ts +0 -9
  690. package/dist/@types/cloud/uploadFunction.d.ts +0 -13
  691. package/dist/@types/cloud/utils.d.ts +0 -17
  692. package/dist/@types/config.d.ts +0 -78
  693. package/dist/@types/core/analyse/partial.d.ts +0 -25
  694. package/dist/@types/core/compile/common.d.ts +0 -17
  695. package/dist/@types/core/compile/game.d.ts +0 -5
  696. package/dist/@types/core/compile/game_plugin.d.ts +0 -8
  697. package/dist/@types/core/compile/handler/js.d.ts +0 -15
  698. package/dist/@types/core/compile/handler/mpjson.d.ts +0 -10
  699. package/dist/@types/core/compile/handler/wxml.d.ts +0 -9
  700. package/dist/@types/core/compile/handler/wxss.d.ts +0 -10
  701. package/dist/@types/core/compile/index.d.ts +0 -5
  702. package/dist/@types/core/compile/mini_program.d.ts +0 -5
  703. package/dist/@types/core/compile/mini_program_plugin.d.ts +0 -8
  704. package/dist/@types/core/js/index.d.ts +0 -3
  705. package/dist/@types/core/js/minifyjs.d.ts +0 -16
  706. package/dist/@types/core/js/minifyjs_after_wrap.d.ts +0 -12
  707. package/dist/@types/core/json/app/checkAppFields.d.ts +0 -42
  708. package/dist/@types/core/json/app/getAppJSON.d.ts +0 -10
  709. package/dist/@types/core/json/app/getExtJSON.d.ts +0 -5
  710. package/dist/@types/core/json/app/index.d.ts +0 -5
  711. package/dist/@types/core/json/common.d.ts +0 -20
  712. package/dist/@types/core/json/game.d.ts +0 -6
  713. package/dist/@types/core/json/page/checkPageJSON.d.ts +0 -6
  714. package/dist/@types/core/json/page/getPageJSON.d.ts +0 -10
  715. package/dist/@types/core/json/plugin/plugin.d.ts +0 -14
  716. package/dist/@types/core/json/plugin/plugin_page.d.ts +0 -9
  717. package/dist/@types/core/json/projectWithMockBuffer.d.ts +0 -14
  718. package/dist/@types/core/json/projectconfig.d.ts +0 -3
  719. package/dist/@types/core/json/reactiveCache.d.ts +0 -63
  720. package/dist/@types/core/json/signaturejson.d.ts +0 -21
  721. package/dist/@types/core/json/sitemap.d.ts +0 -5
  722. package/dist/@types/core/json/theme.d.ts +0 -20
  723. package/dist/@types/core/npm/packnpm.d.ts +0 -17
  724. package/dist/@types/core/protect/uglifyfilenames.d.ts +0 -9
  725. package/dist/@types/core/utils/env.d.ts +0 -6
  726. package/dist/@types/core/validate/appjson.d.ts +0 -3
  727. package/dist/@types/core/validate/extjson.d.ts +0 -3
  728. package/dist/@types/core/validate/gamejson.d.ts +0 -3
  729. package/dist/@types/core/validate/gamepluginjson.d.ts +0 -3
  730. package/dist/@types/core/validate/pagejson.d.ts +0 -3
  731. package/dist/@types/core/validate/pluginjson.d.ts +0 -3
  732. package/dist/@types/core/validate/pluginpagejson.d.ts +0 -3
  733. package/dist/@types/core/validate/projectconfig.d.ts +0 -3
  734. package/dist/@types/core/validate/schemaValidate.d.ts +0 -7
  735. package/dist/@types/core/validate/signaturejson.d.ts +0 -3
  736. package/dist/@types/core/validate/sitemapjson.d.ts +0 -3
  737. package/dist/@types/core/worker_thread/childprocess_manager.d.ts +0 -16
  738. package/dist/@types/core/worker_thread/index.d.ts +0 -4
  739. package/dist/@types/core/worker_thread/task/compilejs.d.ts +0 -43
  740. package/dist/@types/core/worker_thread/task/compilewxss.d.ts +0 -21
  741. package/dist/@types/core/worker_thread/task/index.d.ts +0 -28
  742. package/dist/@types/core/worker_thread/task/minifywxml.d.ts +0 -46
  743. package/dist/@types/core/worker_thread/worker_manager.d.ts +0 -19
  744. package/dist/@types/core.d.ts +0 -26
  745. package/dist/@types/summer/ci.d.ts +0 -3
  746. package/dist/@types/summer/devtool.d.ts +0 -254
  747. package/dist/@types/summer/error.d.ts +0 -22
  748. package/dist/@types/summer/graph/appconf.d.ts +0 -25
  749. package/dist/@types/summer/graph/appgraph.d.ts +0 -25
  750. package/dist/@types/summer/graph/basegraph.d.ts +0 -64
  751. package/dist/@types/summer/graph/pluginconf.d.ts +0 -19
  752. package/dist/@types/summer/graph/plugingraph.d.ts +0 -22
  753. package/dist/@types/summer/index.d.ts +0 -1
  754. package/dist/@types/summer/initPlugin.d.ts +0 -2
  755. package/dist/@types/summer/module.d.ts +0 -42
  756. package/dist/@types/summer/persist_cache.d.ts +0 -12
  757. package/dist/@types/summer/plugin_driver.d.ts +0 -45
  758. package/dist/@types/summer/plugins/base/es6module.d.ts +0 -18
  759. package/dist/@types/summer/plugins/base/javascript.d.ts +0 -3
  760. package/dist/@types/summer/plugins/base/wxss.d.ts +0 -6
  761. package/dist/@types/summer/plugins/enhance.d.ts +0 -4
  762. package/dist/@types/summer/plugins/less.d.ts +0 -5
  763. package/dist/@types/summer/plugins/minifywxml.d.ts +0 -5
  764. package/dist/@types/summer/plugins/sass.d.ts +0 -3
  765. package/dist/@types/summer/plugins/terser.d.ts +0 -2
  766. package/dist/@types/summer/plugins/typescript.d.ts +0 -2
  767. package/dist/@types/summer/plugins/worklet.d.ts +0 -4
  768. package/dist/@types/summer/project.d.ts +0 -47
  769. package/dist/@types/summer/recorder.d.ts +0 -12
  770. package/dist/@types/summer/resolver.d.ts +0 -28
  771. package/dist/@types/summer/summer.d.ts +0 -32
  772. package/dist/@types/summer/types.d.ts +0 -164
  773. package/dist/@types/summer/utils/ensureArray.d.ts +0 -1
  774. package/dist/@types/summer/worker.d.ts +0 -16
  775. package/dist/@types/utils/url_config.d.ts +0 -19
  776. package/dist/@types/vendor/cloud-api/src/apis/tcb/tcb.apis.d.ts +0 -162
  777. package/dist/@types/vendor/cloud-api/src/transaction/contracts/contracts.d.ts +0 -7
  778. package/dist/@types/vendor/cloud-api/src/transaction/contracts/tcb.contracts.d.ts +0 -165
  779. package/dist/@types/vendor/cloud-api/src/transaction/validations/common.validations.d.ts +0 -106
  780. package/dist/@types/vendor/cloud-api/src/transaction/validations/tcb.validations.d.ts +0 -170
  781. package/dist/@types/vendor/cloud-api/src/transaction/validations/validations.d.ts +0 -6
  782. package/dist/@types/vendor/code-analyse/index.d.ts +0 -374
  783. package/dist/cli.js +0 -3
  784. package/dist/cloud/cloudapi.js +0 -3
  785. package/dist/cloud/createTimeTrigger.js +0 -3
  786. package/dist/cloud/uploadContainer.js +0 -3
  787. package/dist/cloud/uploadFile.js +0 -3
  788. package/dist/cloud/uploadFunction.js +0 -3
  789. package/dist/cloud/utils.js +0 -3
  790. package/dist/config.js +0 -3
  791. package/dist/core/analyse/partial.js +0 -3
  792. package/dist/core/compile/common.js +0 -3
  793. package/dist/core/compile/game.js +0 -3
  794. package/dist/core/compile/game_plugin.js +0 -3
  795. package/dist/core/compile/handler/js.js +0 -3
  796. package/dist/core/compile/handler/mpjson.js +0 -3
  797. package/dist/core/compile/handler/wxml.js +0 -3
  798. package/dist/core/compile/handler/wxss.js +0 -3
  799. package/dist/core/compile/index.js +0 -3
  800. package/dist/core/compile/mini_program.js +0 -3
  801. package/dist/core/compile/mini_program_plugin.js +0 -3
  802. package/dist/core/js/enhance.js +0 -1
  803. package/dist/core/js/es6_transform.js +0 -1
  804. package/dist/core/js/index.js +0 -1
  805. package/dist/core/js/minifyjs.js +0 -1
  806. package/dist/core/js/minifyjs_after_wrap.js +0 -1
  807. package/dist/core/js/workletCompile.js +0 -1
  808. package/dist/core/json/app/checkAppFields.js +0 -3
  809. package/dist/core/json/app/getAppJSON.js +0 -3
  810. package/dist/core/json/app/getExtJSON.js +0 -3
  811. package/dist/core/json/app/index.js +0 -3
  812. package/dist/core/json/common.js +0 -3
  813. package/dist/core/json/game.js +0 -3
  814. package/dist/core/json/page/checkPageJSON.js +0 -3
  815. package/dist/core/json/page/getPageJSON.js +0 -3
  816. package/dist/core/json/plugin/plugin.js +0 -3
  817. package/dist/core/json/plugin/plugin_page.js +0 -3
  818. package/dist/core/json/projectWithMockBuffer.js +0 -3
  819. package/dist/core/json/projectconfig.js +0 -3
  820. package/dist/core/json/reactiveCache.js +0 -3
  821. package/dist/core/json/signaturejson.js +0 -3
  822. package/dist/core/json/sitemap.js +0 -3
  823. package/dist/core/json/theme.js +0 -3
  824. package/dist/core/npm/filterdeps.js +0 -3
  825. package/dist/core/npm/packnpm.js +0 -3
  826. package/dist/core/protect/file_flatter.js +0 -3
  827. package/dist/core/protect/uglifyfilenames.js +0 -3
  828. package/dist/core/utils/env.js +0 -3
  829. package/dist/core/utils/logger.js +0 -3
  830. package/dist/core/validate/appjson.js +0 -1
  831. package/dist/core/validate/extjson.js +0 -1
  832. package/dist/core/validate/gamejson.js +0 -1
  833. package/dist/core/validate/gamepluginjson.js +0 -1
  834. package/dist/core/validate/pagejson.js +0 -1
  835. package/dist/core/validate/pluginjson.js +0 -1
  836. package/dist/core/validate/pluginpagejson.js +0 -1
  837. package/dist/core/validate/projectconfig.js +0 -1
  838. package/dist/core/validate/schemaValidate.js +0 -1
  839. package/dist/core/validate/signaturejson.js +0 -1
  840. package/dist/core/validate/sitemapjson.js +0 -1
  841. package/dist/core/validate/validate.js +0 -1
  842. package/dist/core/worker_thread/childprocess.js +0 -1
  843. package/dist/core/worker_thread/childprocess_manager.js +0 -1
  844. package/dist/core/worker_thread/fork.js +0 -1
  845. package/dist/core/worker_thread/index.js +0 -1
  846. package/dist/core/worker_thread/task/compilejs.js +0 -1
  847. package/dist/core/worker_thread/task/compilewxss.js +0 -1
  848. package/dist/core/worker_thread/task/minifywxml.js +0 -1
  849. package/dist/core/worker_thread/worker.js +0 -1
  850. package/dist/core/worker_thread/worker_manager.js +0 -1
  851. package/dist/core.js +0 -3
  852. package/dist/summer/ci.js +0 -3
  853. package/dist/summer/devtool.js +0 -3
  854. package/dist/summer/entry_process.js +0 -1
  855. package/dist/summer/error.js +0 -3
  856. package/dist/summer/graph/appconf.js +0 -3
  857. package/dist/summer/graph/appgraph.js +0 -3
  858. package/dist/summer/graph/basegraph.js +0 -3
  859. package/dist/summer/graph/pluginconf.js +0 -3
  860. package/dist/summer/graph/plugingraph.js +0 -3
  861. package/dist/summer/index.js +0 -3
  862. package/dist/summer/initPlugin.js +0 -3
  863. package/dist/summer/module.js +0 -3
  864. package/dist/summer/persist_cache.js +0 -3
  865. package/dist/summer/plugin_driver.js +0 -3
  866. package/dist/summer/plugins/base/es6module.js +0 -1
  867. package/dist/summer/plugins/base/javascript.js +0 -1
  868. package/dist/summer/plugins/base/wxss.js +0 -1
  869. package/dist/summer/plugins/enhance.js +0 -1
  870. package/dist/summer/plugins/index.js +0 -1
  871. package/dist/summer/plugins/less.js +0 -1
  872. package/dist/summer/plugins/minifywxml.js +0 -1
  873. package/dist/summer/plugins/sass.js +0 -1
  874. package/dist/summer/plugins/terser.js +0 -1
  875. package/dist/summer/plugins/typescript.js +0 -1
  876. package/dist/summer/plugins/worklet.js +0 -1
  877. package/dist/summer/project.js +0 -3
  878. package/dist/summer/recorder.js +0 -3
  879. package/dist/summer/resolver.js +0 -3
  880. package/dist/summer/summer.js +0 -3
  881. package/dist/summer/types.js +0 -3
  882. package/dist/summer/utils/async.js +0 -3
  883. package/dist/summer/utils/ensureArray.js +0 -3
  884. package/dist/summer/worker.js +0 -3
  885. package/dist/utils/url_config.js +0 -3
  886. package/dist/vendor/cloud-api/index.js +0 -2
  887. package/dist/vendor/cloud-api/src/apis/apis.js +0 -3
  888. package/dist/vendor/cloud-api/src/apis/cdn/cdn.apis.js +0 -3
  889. package/dist/vendor/cloud-api/src/apis/cdn/index.js +0 -3
  890. package/dist/vendor/cloud-api/src/apis/flexdb/flexdb.apis.js +0 -3
  891. package/dist/vendor/cloud-api/src/apis/flexdb/index.js +0 -3
  892. package/dist/vendor/cloud-api/src/apis/scf/index.js +0 -3
  893. package/dist/vendor/cloud-api/src/apis/scf/scf.apis.js +0 -3
  894. package/dist/vendor/cloud-api/src/apis/ssl/index.js +0 -3
  895. package/dist/vendor/cloud-api/src/apis/ssl/ssl.apis.js +0 -3
  896. package/dist/vendor/cloud-api/src/apis/tcb/general.apis.js +0 -3
  897. package/dist/vendor/cloud-api/src/apis/tcb/index.js +0 -3
  898. package/dist/vendor/cloud-api/src/apis/tcb/tcb.apis.js +0 -3
  899. package/dist/vendor/cloud-api/src/index.js +0 -3
  900. package/dist/vendor/cloud-api/src/transaction/contracts/cdn.contracts.js +0 -3
  901. package/dist/vendor/cloud-api/src/transaction/contracts/contracts.js +0 -3
  902. package/dist/vendor/cloud-api/src/transaction/contracts/factory.js +0 -3
  903. package/dist/vendor/cloud-api/src/transaction/contracts/flexdb.contracts.js +0 -3
  904. package/dist/vendor/cloud-api/src/transaction/contracts/scf.contracts.js +0 -3
  905. package/dist/vendor/cloud-api/src/transaction/contracts/ssl.contracts.js +0 -3
  906. package/dist/vendor/cloud-api/src/transaction/contracts/tcb.contracts.js +0 -3
  907. package/dist/vendor/cloud-api/src/transaction/transactor.js +0 -3
  908. package/dist/vendor/cloud-api/src/transaction/validations/cdn.validations.js +0 -3
  909. package/dist/vendor/cloud-api/src/transaction/validations/common.validations.js +0 -3
  910. package/dist/vendor/cloud-api/src/transaction/validations/flexdb.validations.js +0 -3
  911. package/dist/vendor/cloud-api/src/transaction/validations/scf.validations.js +0 -3
  912. package/dist/vendor/cloud-api/src/transaction/validations/ssl.validations.js +0 -3
  913. package/dist/vendor/cloud-api/src/transaction/validations/tcb.validations.js +0 -3
  914. package/dist/vendor/cloud-api/src/transaction/validations/validations.js +0 -3
  915. package/dist/vendor/cloud-api/src/utils/common.js +0 -3
  916. package/dist/vendor/cloud-api/src/utils/validator.js +0 -3
  917. package/dist/vendor/code-analyse/index.js +0 -2
  918. package/dist/vendor/schema/dist/app.js +0 -618
  919. package/dist/vendor/schema/dist/ext.js +0 -862
  920. package/dist/vendor/schema/dist/game.js +0 -211
  921. package/dist/vendor/schema/dist/page.js +0 -313
  922. package/dist/vendor/schema/dist/plugin.js +0 -41
  923. package/dist/vendor/schema/dist/pluginpage.js +0 -14
  924. package/dist/vendor/schema/dist/projectconfig.js +0 -474
  925. package/dist/vendor/schema/dist/projectprivateconfig.js +0 -358
  926. package/dist/vendor/schema/dist/sitemap.js +0 -53
  927. package/dist/vendor/schema/dist/theme.js +0 -20
  928. /package/dist/@types/{cli.d.ts → cli/index.d.ts} +0 -0
  929. /package/dist/@types/{vendor → common}/cloud-api/src/apis/apis.d.ts +0 -0
  930. /package/dist/@types/{vendor → common}/cloud-api/src/apis/cdn/cdn.apis.d.ts +0 -0
  931. /package/dist/@types/{vendor → common}/cloud-api/src/apis/cdn/index.d.ts +0 -0
  932. /package/dist/@types/{vendor → common}/cloud-api/src/apis/flexdb/flexdb.apis.d.ts +0 -0
  933. /package/dist/@types/{vendor → common}/cloud-api/src/apis/flexdb/index.d.ts +0 -0
  934. /package/dist/@types/{vendor → common}/cloud-api/src/apis/scf/index.d.ts +0 -0
  935. /package/dist/@types/{vendor → common}/cloud-api/src/apis/scf/scf.apis.d.ts +0 -0
  936. /package/dist/@types/{vendor → common}/cloud-api/src/apis/ssl/index.d.ts +0 -0
  937. /package/dist/@types/{vendor → common}/cloud-api/src/apis/ssl/ssl.apis.d.ts +0 -0
  938. /package/dist/@types/{vendor → common}/cloud-api/src/apis/tcb/general.apis.d.ts +0 -0
  939. /package/dist/@types/{vendor → common}/cloud-api/src/apis/tcb/index.d.ts +0 -0
  940. /package/dist/@types/{vendor → common}/cloud-api/src/index.d.ts +0 -0
  941. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/cdn.contracts.d.ts +0 -0
  942. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/factory.d.ts +0 -0
  943. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/flexdb.contracts.d.ts +0 -0
  944. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/scf.contracts.d.ts +0 -0
  945. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/contracts/ssl.contracts.d.ts +0 -0
  946. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/transactor.d.ts +0 -0
  947. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/validations/cdn.validations.d.ts +0 -0
  948. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/validations/flexdb.validations.d.ts +0 -0
  949. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/validations/scf.validations.d.ts +0 -0
  950. /package/dist/@types/{vendor → common}/cloud-api/src/transaction/validations/ssl.validations.d.ts +0 -0
  951. /package/dist/@types/{vendor → common}/cloud-api/src/utils/common.d.ts +0 -0
  952. /package/dist/@types/{vendor → common}/cloud-api/src/utils/validator.d.ts +0 -0
  953. /package/dist/@types/{core → modules/corecompiler/original}/js/enhance.d.ts +0 -0
  954. /package/dist/@types/{core/js/es6_transform.d.ts → modules/corecompiler/original/js/es6Transform.d.ts} +0 -0
  955. /package/dist/@types/{core → modules/corecompiler/original}/js/generateMap.d.ts +0 -0
  956. /package/dist/@types/{core → modules/corecompiler/original}/js/workletCompile.d.ts +0 -0
  957. /package/dist/@types/{core → modules/corecompiler/original}/npm/filterdeps.d.ts +0 -0
  958. /package/dist/@types/{core/protect/file_flatter.d.ts → modules/corecompiler/original/protect/fileFlatter.d.ts} +0 -0
  959. /package/dist/@types/{core → modules/corecompiler/original}/utils/logger.d.ts +0 -0
  960. /package/dist/@types/{core → modules/corecompiler/original}/validate/validate.d.ts +0 -0
  961. /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/childprocess.d.ts +0 -0
  962. /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/config.d.ts +0 -0
  963. /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/fork.d.ts +0 -0
  964. /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/task/call_func.d.ts +0 -0
  965. /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/task/func.d.ts +0 -0
  966. /package/dist/@types/{core/worker_thread → modules/corecompiler/original/workerThread}/worker.d.ts +0 -0
  967. /package/dist/@types/{summer → modules/corecompiler/summer}/plugins/index.d.ts +0 -0
  968. /package/dist/@types/{summer → modules/corecompiler/summer}/utils/async.d.ts +0 -0
  969. /package/dist/@types/{summer/entry_process.d.ts → modules/corecompiler/summerEntryProcess.d.ts} +0 -0
  970. /package/dist/{schema → @types/schema}/dist/index.d.ts +0 -0
  971. /package/dist/{core → modules/corecompiler/original}/js/generateMap.js +0 -0
  972. /package/dist/{core/worker_thread → modules/corecompiler/original/workerThread}/config.js +0 -0
  973. /package/dist/{core/worker_thread → modules/corecompiler/original/workerThread}/task/call_func.js +0 -0
  974. /package/dist/{core/worker_thread → modules/corecompiler/original/workerThread}/task/func.js +0 -0
  975. /package/dist/{core/worker_thread → modules/corecompiler/original/workerThread}/task/index.js +0 -0
  976. /package/dist/{vendor/schema → schema}/dist/index.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidCompileType=exports.isMPKindProject=exports.isPluginKindProject=exports.isGameKindProject=exports.isMPKindCompileType=exports.isPluginKindCompileType=exports.isGameKindCompileType=exports.gamePlugin=exports.plugin=exports.game=exports.weapp=void 0,exports.weapp="weapp",exports.game="game",exports.plugin="plugin",exports.gamePlugin="gamePlugin";const isGameKindCompileType=e=>e===exports.game||e===exports.gamePlugin;exports.isGameKindCompileType=isGameKindCompileType;const isPluginKindCompileType=e=>e===exports.plugin||e===exports.gamePlugin;exports.isPluginKindCompileType=isPluginKindCompileType;const isMPKindCompileType=e=>e===exports.weapp||e===exports.plugin;exports.isMPKindCompileType=isMPKindCompileType;const isGameKindProject=e=>(0,exports.isGameKindCompileType)(null==e?void 0:e.compileType);exports.isGameKindProject=isGameKindProject;const isPluginKindProject=e=>(0,exports.isPluginKindCompileType)(null==e?void 0:e.compileType);exports.isPluginKindProject=isPluginKindProject;const isMPKindProject=e=>(0,exports.isMPKindCompileType)(null==e?void 0:e.compileType);exports.isMPKindProject=isMPKindProject;const isValidCompileType=e=>e===exports.weapp||e===exports.game||e===exports.plugin||e===exports.gamePlugin;exports.isValidCompileType=isValidCompileType;
@@ -0,0 +1 @@
1
+ "use strict";var COMPILE_TYPE,AstType;function getDefaultIgnores(e){const _=["node_modules/**/*","**/node_modules/**","**/.git/**",".git/**/*","**/.svn/**",".svn/**/*",".DS_Store","**/.DS_Store"];return"multiPlatform"===e.projectArchitecture&&_.push(exports.multiPlatformRoot+"/**/*"),_}Object.defineProperty(exports,"__esModule",{value:!0}),exports.AstType=exports.compileTypeConfig=exports.getDefaultIgnores=exports.FullPkg=exports.MainPkg=exports.multiPlatformRoot=exports.extendedLibMap=exports.jsonVariablePropertyWhiteList=exports.DefaultProjectAttr=exports.TABBAR_ICON_WHITE_LIST=exports.COMPILE_TYPE=exports.APP_TYPE=exports.MINI_GAME_WORKERS_PACKAGE_ROOT=exports.MINI_GAME_MAIN_PACKAGE_ROOT=exports.MINI_PROGRAM_MAIN_PACKAGE_ROOT=exports.PROJECT_TYPE_ERROR=exports.GET_LATEST_VERSION_CGI_ERR=exports.UPLOAD_JS_SERVER_CGI_ERR=exports.CODE_PROTECT_TRANSLATE_FILENAME=exports.UPLOAD_CGI_ERR=exports.GENERATE_LOCAL_SIGNATURE_ERR=exports.GET_SIGNATURE_RAND_STRING_ERR=exports.APP_JSON_NOT_FOUND=exports.JSON_CONTENT_ERR=exports.FILE_NOT_UTF8=exports.JSON_PARSE_ERR=exports.FILE_NOT_FOUND=exports.PLUGIN_JSON_PARSE_ERR=exports.PLUGIN_JSON_CONTENT_ERR=exports.PLUGIN_JSON_FILE_NOT_FOUND=exports.GAME_PLUGIN_LIB_MD5_NOT_MATCH=exports.SUMMER_PLUGIN_CODE_ERR=exports.SUMMER_PLUGIN_ERR=exports.MINIFY_WXML_ERR=exports.POST_WXSS_ERR=exports.FILE_FLAT_ERR=exports.JS_ES6_ERR=exports.BABILI_JS_ERR=exports.UGLIFY_JS_ERR=exports.BABEL_TRANS_JS_ERR=exports.JS_NOT_FOUND=exports.WXML_NOT_FOUND=exports.PARAM_ERROR=exports.CI_VERSION=void 0,exports.CI_VERSION="2.0.1",exports.PARAM_ERROR=1e4,exports.WXML_NOT_FOUND=10007,exports.JS_NOT_FOUND=10008,exports.BABEL_TRANS_JS_ERR=10032,exports.UGLIFY_JS_ERR=10033,exports.BABILI_JS_ERR=10034,exports.JS_ES6_ERR=10035,exports.FILE_FLAT_ERR=10036,exports.POST_WXSS_ERR=10037,exports.MINIFY_WXML_ERR=10038,exports.SUMMER_PLUGIN_ERR=10045,exports.SUMMER_PLUGIN_CODE_ERR=10046,exports.GAME_PLUGIN_LIB_MD5_NOT_MATCH=10081,exports.PLUGIN_JSON_FILE_NOT_FOUND=10091,exports.PLUGIN_JSON_CONTENT_ERR=10092,exports.PLUGIN_JSON_PARSE_ERR=10093,exports.FILE_NOT_FOUND=10005,exports.JSON_PARSE_ERR=10006,exports.FILE_NOT_UTF8=10031,exports.JSON_CONTENT_ERR=10009,exports.APP_JSON_NOT_FOUND=2e4,exports.GET_SIGNATURE_RAND_STRING_ERR=20001,exports.GENERATE_LOCAL_SIGNATURE_ERR=20002,exports.UPLOAD_CGI_ERR=20003,exports.CODE_PROTECT_TRANSLATE_FILENAME=20004,exports.UPLOAD_JS_SERVER_CGI_ERR=20005,exports.GET_LATEST_VERSION_CGI_ERR=20006,exports.PROJECT_TYPE_ERROR=3e4,exports.MINI_PROGRAM_MAIN_PACKAGE_ROOT="__APP__",exports.MINI_GAME_MAIN_PACKAGE_ROOT="__GAME__",exports.MINI_GAME_WORKERS_PACKAGE_ROOT="workers.js",exports.APP_TYPE={NORMAL:0,PLUGIN:1,SHOP:2,MINISHOP:3,GAME:4,CARD:5,NATIVE:7},function(e){e.miniProgram="miniProgram",e.miniProgramPlugin="miniProgramPlugin",e.miniGame="miniGame",e.miniGamePlugin="miniGamePlugin"}(COMPILE_TYPE=exports.COMPILE_TYPE||(exports.COMPILE_TYPE={})),exports.TABBAR_ICON_WHITE_LIST=[".png",".jpg",".jpeg"],exports.DefaultProjectAttr={platform:!1,appType:0,isSandbox:!1,released:!1,setting:{MaxCodeSize:2,MaxSubpackageSubCodeSize:2,MaxSubpackageFullCodeSize:12,NavigateMiniprogramLimit:10,MaxSubPackageLimit:100,MinTabbarCount:2,MaxTabbarCount:5,MaxCustomTabbarCount:10,MaxTabbarIconSize:40}},exports.jsonVariablePropertyWhiteList={windowPropertWhiteList:["navigationBarBackgroundColor","navigationBarTextStyle","backgroundColor","backgroundTextStyle","backgroundColorTop","backgroundColorBottom","backgroundColorContent"],tabBarPropertyWhiteList:["color","selectedColor","backgroundColor","borderStyle"],tabbarListItemPropertyWhiteList:["iconPath","selectedIconPath"]},exports.extendedLibMap={kbone:{packages:["miniprogram-element","miniprogram-render"]},weui:{packages:["weui-miniprogram"]}},exports.multiPlatformRoot="miniapp",exports.MainPkg="__APP__",exports.FullPkg="__FULL__",exports.getDefaultIgnores=getDefaultIgnores,exports.compileTypeConfig={weapp:"weapp",game:"game",plugin:"plugin",gamePlugin:"gamePlugin"},function(e){e.Babel="babel",e.Acorn="acorn"}(AstType=exports.AstType||(exports.AstType={}));
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PLATFORM=void 0,exports.PLATFORM={"mini-android":"mini-android","mini-ios":"mini-ios","mini-weixin":"mini-weixin"};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAsyncResult=exports.testSourceNewFeatureURL=exports.testSourceURL=exports.getUploadToken=exports.commitSourceURL=exports.commitSourceNewFeatureURL=exports.tcbTencentCloudUrl=exports.dbTencentCloudUrl=exports.scfTencentCloudUrl=exports.cloudCosUploadURL=exports.get3rdCloudCodeSecret=exports.cloudAPIAgentURL=exports.GET_LATEST_VERSION=exports.UPLOAD_JS_SERVER=exports.GET_ASYNC_RESULT=exports.GET_UPLOAD_TOKEN=exports.GET_CLOUD_API_SIGNATURE=exports.TRANSLATE_FILENAME=exports.GET_DEV_SOURCE_MAP=exports.GET_RAND_STRING=exports.GET_ONLINE_SCHEMA=exports.GET_WHITE_EXT_LIST=exports.TEST_SOURCE_URL=exports.UPLOAD_URL=exports.GET_ATTR_URL=void 0;const Domain="https://servicewechat.com";exports.GET_ATTR_URL=Domain+"/wxa/ci/getattr",exports.UPLOAD_URL=Domain+"/wxa/ci/upload",exports.TEST_SOURCE_URL=Domain+"/wxa/ci/testSourceURL",exports.GET_WHITE_EXT_LIST=Domain+"/wxa/ci/getwhiteextlist",exports.GET_ONLINE_SCHEMA=Domain+"/wxa/ci/getonlineschema",exports.GET_RAND_STRING=Domain+"/wxa/ci/getrandstr",exports.GET_DEV_SOURCE_MAP=Domain+"/wxa/ci/get_dev_sourcemap",exports.TRANSLATE_FILENAME=Domain+"/wxa/ci/translate_filename",exports.GET_CLOUD_API_SIGNATURE=Domain+"/wxa/ci/getqcloudapisignature",exports.GET_UPLOAD_TOKEN=Domain+"/wxa/ci/getuploadtoken",exports.GET_ASYNC_RESULT=Domain+"/wxa/ci/getasyncresult",exports.UPLOAD_JS_SERVER=Domain+"/wxa/ci/uploadjsserver",exports.GET_LATEST_VERSION=Domain+"/wxa/ci/getlatestversion",exports.cloudAPIAgentURL=Domain+"/wxa/ci/cloudapihttpagent",exports.get3rdCloudCodeSecret=Domain+"/wxa/ci/getcloudcodesecret",exports.cloudCosUploadURL=Domain+"/wxa/ci/cloudcosupload",exports.scfTencentCloudUrl="https://scf.tencentcloudapi.com",exports.dbTencentCloudUrl="https://flexdb.tencentcloudapi.com",exports.tcbTencentCloudUrl="https://tcb.tencentcloudapi.com",exports.commitSourceNewFeatureURL=Domain+"wxa-dev-new/commitsource",exports.commitSourceURL=Domain+"wxa-dev/commitsource",exports.getUploadToken=Domain+"wxa-dev/getuploadtoken",exports.testSourceURL=Domain+"wxa-dev/testsource",exports.testSourceNewFeatureURL=Domain+"wxa-dev-new/testsource",exports.getAsyncResult=Domain+"wxa-dev/getasyncresult";
package/dist/index.js CHANGED
@@ -1,3 +1 @@
1
- !function(require, directRequire){
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.workletVersion=exports.getWhiteExtList=exports.checkCodeQuality=exports.analyseCode=exports.getLatestVersion=exports.uploadJsServer=exports.cloud=exports.getDevSourceMap=exports.proxy=exports.packNpmManually=exports.packNpm=exports.getCompiledResult=exports.preview=exports.upload=exports.Project=void 0;const tslib_1=require("tslib"),project_1=require("./ci/project");Object.defineProperty(exports,"Project",{enumerable:!0,get:function(){return project_1.Project}});const upload_1=require("./ci/upload"),preview_1=require("./ci/preview"),getDevSourceMap_1=require("./ci/getDevSourceMap"),packnpm_1=require("./core/npm/packnpm");Object.defineProperty(exports,"packNpm",{enumerable:!0,get:function(){return packnpm_1.packNpm}}),Object.defineProperty(exports,"packNpmManually",{enumerable:!0,get:function(){return packnpm_1.packNpmManually}});const request_1=require("./utils/request");Object.defineProperty(exports,"proxy",{enumerable:!0,get:function(){return request_1.setCiProxy}});const uploadFunction_1=require("./cloud/uploadFunction"),createTimeTrigger_1=require("./cloud/createTimeTrigger"),uploadContainer_1=require("./cloud/uploadContainer"),uploadFile_1=require("./cloud/uploadFile"),report_1=require("./utils/report"),jsserver_1=require("./ci/jsserver");Object.defineProperty(exports,"uploadJsServer",{enumerable:!0,get:function(){return jsserver_1.uploadJsServer}});const code_analyse_1=require("./ci/code-analyse");Object.defineProperty(exports,"analyseCode",{enumerable:!0,get:function(){return code_analyse_1.analyseCode}});const getCompiledResult_1=require("./ci/getCompiledResult");Object.defineProperty(exports,"getCompiledResult",{enumerable:!0,get:function(){return getCompiledResult_1.getCompiledResult}});const getLatestVersion_1=require("./ci/getLatestVersion");Object.defineProperty(exports,"getLatestVersion",{enumerable:!0,get:function(){return getLatestVersion_1.getLatestVersion}});const white_ext_list_1=require("./utils/white_ext_list");Object.defineProperty(exports,"getWhiteExtList",{enumerable:!0,get:function(){return white_ext_list_1.getWhiteExtList}});const checkCodeQuality_1=require("./ci/checkCodeQuality");Object.defineProperty(exports,"checkCodeQuality",{enumerable:!0,get:function(){return checkCodeQuality_1.checkCodeQuality}}),exports.upload=(0,report_1.wrapReport)("upload",upload_1.upload),exports.preview=(0,report_1.wrapReport)("preview",preview_1.preview),exports.getDevSourceMap=(0,report_1.wrapReport)("getDevSourceMap",getDevSourceMap_1.getDevSourceMap),exports.cloud={uploadFunction:uploadFunction_1.uploadFunction,createTimeTrigger:createTimeTrigger_1.createTimeTrigger,uploadStaticStorage:e=>(0,uploadFile_1.uploadFiles)(e,"staticstorage"),uploadStorage:e=>(0,uploadFile_1.uploadFiles)(e,"storage"),uploadContainer:uploadContainer_1.uploadContainer},tslib_1.__exportStar(require("./core"),exports),tslib_1.__exportStar(require("./summer"),exports),exports.workletVersion=require("./utils/babel_plugin_worklet").version;
3
- }(require("licia/lazyImport")(require), require)
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.miniappBuilder=exports.iosDeviceUtils=exports.adroidDeviceUtils=exports.getSummerPluginConfig=exports.updateContactBase64=exports.updateContactBase64ForSubPkgs=exports.escapeScript=exports.escapeQuot=exports.getBabelHelperDepMap=exports.getBabelHelperVersion=exports.getHelperDeps=exports.getHelperContent=exports.getHelperName=exports.isValidHelperFunc=exports.getHelperOutputPath=exports.checkIsInSubPackage=exports.normalizePath=exports.mkdirSync=exports.generateMD5=exports.compileTypeConfig=exports.JSON_CONTENT_ERR=exports.DefaultProjectAttr=exports.isHexColor=exports.locales=exports.proxy=exports.getWhiteExtList=exports.workletVersion=exports.Builder=exports.SummerCompiler=exports.OriginalCompiler=exports.BaseCoreCompiler=exports.PreCompileProject=exports.WebProject=exports.DevtoolsProject=exports.CIProject=exports.Project=exports.BaseProject=void 0;const tslib_1=require("tslib"),baseProject_1=require("./project/baseProject");Object.defineProperty(exports,"BaseProject",{enumerable:!0,get:function(){return baseProject_1.BaseProject}});const ciProject_1=require("./project/ciProject");Object.defineProperty(exports,"Project",{enumerable:!0,get:function(){return ciProject_1.CIProject}}),Object.defineProperty(exports,"CIProject",{enumerable:!0,get:function(){return ciProject_1.CIProject}});const devtoolsProject_1=require("./project/devtoolsProject");Object.defineProperty(exports,"DevtoolsProject",{enumerable:!0,get:function(){return devtoolsProject_1.DevtoolsProject}});const webProject_1=require("./project/webProject");Object.defineProperty(exports,"WebProject",{enumerable:!0,get:function(){return webProject_1.WebProject}});const precompileProject_1=require("./project/advance/precompileProject");Object.defineProperty(exports,"PreCompileProject",{enumerable:!0,get:function(){return precompileProject_1.PreCompileProject}});const baseCompiler_1=require("./modules/corecompiler/baseCompiler");Object.defineProperty(exports,"BaseCoreCompiler",{enumerable:!0,get:function(){return baseCompiler_1.BaseCoreCompiler}});const originalCompiler_1=require("./modules/corecompiler/originalCompiler");Object.defineProperty(exports,"OriginalCompiler",{enumerable:!0,get:function(){return originalCompiler_1.OriginalCompiler}});const summerCompiler_1=require("./modules/corecompiler/summerCompiler");Object.defineProperty(exports,"SummerCompiler",{enumerable:!0,get:function(){return summerCompiler_1.SummerCompiler}});const modules_1=require("./modules");Object.defineProperty(exports,"Builder",{enumerable:!0,get:function(){return modules_1.Builder}});const white_ext_list_1=require("./utils/white_ext_list");Object.defineProperty(exports,"getWhiteExtList",{enumerable:!0,get:function(){return white_ext_list_1.getWhiteExtList}});const request_1=require("./utils/request");Object.defineProperty(exports,"proxy",{enumerable:!0,get:function(){return request_1.setCiProxy}});const locales_1=tslib_1.__importDefault(require("./utils/locales/locales"));exports.locales=locales_1.default;const tools_1=require("./utils/tools");Object.defineProperty(exports,"checkIsInSubPackage",{enumerable:!0,get:function(){return tools_1.checkIsInSubPackage}}),Object.defineProperty(exports,"escapeQuot",{enumerable:!0,get:function(){return tools_1.escapeQuot}}),Object.defineProperty(exports,"escapeScript",{enumerable:!0,get:function(){return tools_1.escapeScript}}),Object.defineProperty(exports,"generateMD5",{enumerable:!0,get:function(){return tools_1.generateMD5}}),Object.defineProperty(exports,"isHexColor",{enumerable:!0,get:function(){return tools_1.isHexColor}}),Object.defineProperty(exports,"mkdirSync",{enumerable:!0,get:function(){return tools_1.mkdirSync}}),Object.defineProperty(exports,"normalizePath",{enumerable:!0,get:function(){return tools_1.normalizePath}});const config_1=require("./config/config");Object.defineProperty(exports,"DefaultProjectAttr",{enumerable:!0,get:function(){return config_1.DefaultProjectAttr}}),Object.defineProperty(exports,"JSON_CONTENT_ERR",{enumerable:!0,get:function(){return config_1.JSON_CONTENT_ERR}}),Object.defineProperty(exports,"compileTypeConfig",{enumerable:!0,get:function(){return config_1.compileTypeConfig}});const babel_helper_1=require("./utils/babel_helper");Object.defineProperty(exports,"getBabelHelperVersion",{enumerable:!0,get:function(){return babel_helper_1.getBabelHelperVersion}}),Object.defineProperty(exports,"getBabelHelperDepMap",{enumerable:!0,get:function(){return babel_helper_1.getBabelHelperDepMap}});const pluginconfig_1=require("./modules/corecompiler/summer/pluginconfig");Object.defineProperty(exports,"getSummerPluginConfig",{enumerable:!0,get:function(){return pluginconfig_1.getSummerPluginConfig}});const helper_util_1=require("./utils/helper_util");Object.defineProperty(exports,"getHelperOutputPath",{enumerable:!0,get:function(){return helper_util_1.getHelperOutputPath}}),Object.defineProperty(exports,"getHelperDeps",{enumerable:!0,get:function(){return helper_util_1.getHelperDeps}}),Object.defineProperty(exports,"isValidHelperFunc",{enumerable:!0,get:function(){return helper_util_1.isValidHelperFunc}}),Object.defineProperty(exports,"getHelperContent",{enumerable:!0,get:function(){return helper_util_1.getHelperContent}}),Object.defineProperty(exports,"getHelperName",{enumerable:!0,get:function(){return helper_util_1.getHelperName}});const updateContactForSubpkg_1=require("./modules/fullcompiler/app/contactandlaunch/updateContactForSubpkg");Object.defineProperty(exports,"updateContactBase64ForSubPkgs",{enumerable:!0,get:function(){return updateContactForSubpkg_1.updateContactBase64ForSubPkgs}});const updatecontactandlaunch_1=require("./modules/fullcompiler/app/contactandlaunch/updatecontactandlaunch");Object.defineProperty(exports,"updateContactBase64",{enumerable:!0,get:function(){return updatecontactandlaunch_1.updateContactBase64}});const adroidDeviceUtils=tslib_1.__importStar(require("./modules/nativecompiler/android/device"));exports.adroidDeviceUtils=adroidDeviceUtils;const iosDeviceUtils=tslib_1.__importStar(require("./modules/nativecompiler/ios/device"));exports.iosDeviceUtils=iosDeviceUtils;const miniappBuilder=tslib_1.__importStar(require("./utils/miniapp-builder"));exports.miniappBuilder=miniappBuilder,tslib_1.__exportStar(require("./modules/corecompiler/original"),exports),exports.workletVersion=require("./utils/babel_plugin_worklet").version,tslib_1.__exportStar(require("./ci/index"),exports);
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "1.9.27",
3
- "buildTime": 1710494178033
2
+ "version": "2.0.1",
3
+ "buildTime": 1717057637680
4
4
  }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BaseCoreCompiler=void 0;const tslib_1=require("tslib"),fs_1=tslib_1.__importDefault(require("fs")),path_1=tslib_1.__importDefault(require("path")),lodash_1=tslib_1.__importDefault(require("lodash")),locales_1=tslib_1.__importDefault(require("../../utils/locales/locales")),index_1=require("./original/index"),singletontask_1=require("../../utils/singletontask"),config_1=require("../../config/config");class BaseCoreCompiler{isGameType(t){return t===config_1.COMPILE_TYPE.miniGame||t===config_1.COMPILE_TYPE.miniGamePlugin}isPluginType(t){return t===config_1.COMPILE_TYPE.miniGame||t===config_1.COMPILE_TYPE.miniGamePlugin}get projectPath(){return this.project.projectPath}get srcPath(){return this.project.srcPath||this.project.projectPath}get pluginSrcPath(){return this.project.pluginSrcPath}constructor(t){this.isSummer=!1,this.project=t}async ready(){return this._checkReadyTask||(this._checkReadyTask=new singletontask_1.SingletonTask(this.init.bind(this))),await this._checkReadyTask.getResult(!0)}watch(t){this.project.event.on("fileChange",t)}unwatch(t){this.project.event.off("fileChange",t)}compileJS(t){throw new Error("no implement compileJS")}compile(t){throw new Error("no implement compile")}clearCache(){throw new Error("no implement clearCache")}async uglifyFileNames(t,e,i){throw new Error("no implement uglifyFileNames")}async packNpm(t){var e;const i=(null===(e=this.project)||void 0===e?void 0:e.setting)||{};if(!i.packNpmManually)return await(0,index_1.packNpm)(this.project,t);if(!i.packNpmRelationList)throw new Error("project.config.json setting.packNpmRelationList 必须存在");const{projectPath:r}=this.project;for(const t of i.packNpmRelationList){if(!t.packageJsonPath||"string"!=typeof t.packageJsonPath||!t.packageJsonPath.endsWith("package.json"))throw new Error(locales_1.default.config.PACKAGE_JSON_PATH_IN_VALID.format(t.packageJsonPath));const e=path_1.default.join(r,t.packageJsonPath);if(!fs_1.default.existsSync(e))throw new Error(locales_1.default.config.NOT_FOUND.format(e));const i=path_1.default.join(r,t.packageJsonPath,"../node_modules");if(!fs_1.default.existsSync(i))throw new Error(locales_1.default.config.RELATED_NODE_MODULES_NOT_FOUND.format(e,path_1.default.join(e,"..")));const o=path_1.default.join(r,t.miniprogramNpmDistDir);if(!fs_1.default.existsSync(o))throw new Error(locales_1.default.config.NOT_FOUND.format(o))}const o=lodash_1.default.cloneDeep(i.packNpmRelationList);return o.forEach(t=>{t.packageJsonPath=path_1.default.join(r,t.packageJsonPath),t.miniprogramNpmDistDir=path_1.default.join(r,t.miniprogramNpmDistDir)}),await this.packNpmManually(o)}async packNpmManually(t){const e={miniProgramPackNum:0,otherNpmPackNum:0,warnList:[]};for(const i of t){const t=await(0,index_1.packNpmManually)(i);e.miniProgramPackNum+=t.miniProgramPackNum,e.otherNpmPackNum+=t.otherNpmPackNum,e.warnList=e.warnList.concat(t.warnList)}return e.warnList}stat(t="",e=""){return this.project.stat(t,e)}exists(t="",e=""){return this.project.exists(t,e)}excludeRoot(t=[],e=""){return e?t.map(t=>path_1.default.posix.relative(e,t)):t}excludeKeyRoot(t,e=""){if(!e)return t;const i={};let r="";for(const o in t)r=path_1.default.posix.relative(e,o),i[r]=t[o];return i}getFile(t="",e=""){return this.project.getFile(t,e)}getFileString(t="",e=""){return this.project.getFile(t,e).toString()}getMPFileWithDir(t=""){var e;const{files:i=[],dirs:r=[]}=(null===(e=this.project)||void 0===e?void 0:e.getFilesAndDirs())||{};return t=this.project.miniprogramRoot?path_1.default.posix.join(this.project.miniprogramRoot,t):t,this.excludeRoot(i.concat(r),this.project.miniprogramRoot||"")}getMPFileList(t="",e=""){return t=this.project.miniprogramRoot?path_1.default.posix.join(this.project.miniprogramRoot||"",t):t,this.excludeRoot(this.project.getFileList(t,e),this.project.miniprogramRoot||"")}getMPWXMLFileList(t=""){return this.getMPFileList(t,".wxml")}getMPWXSFileList(t=""){return this.getMPFileList(t,".wxs")}getMPJSFileList(t=""){return this.getMPFileList(t,".js")}getMPWXSSFileList(t=""){return this.getMPFileList(t,".wxss")}getMPJSONFileList(t=""){return this.getMPFileList(t,".json")}getPluginFileList(t="",e=""){return t=path_1.default.posix.join(this.project.pluginRoot||"",t),this.excludeRoot(this.project.getFileList(t,e),this.project.pluginRoot)}getPluginWXMLFileList(t=""){return this.getPluginFileList(t,".wxml")}getPluginWXSFileList(t=""){return this.getPluginFileList(t,".wxs")}getPluginJSFileList(t=""){return this.getPluginFileList(t,".js")}getPluginWXSSFileList(t=""){return this.getPluginFileList(t,".wxss")}getPluginJSONFileList(t=""){return this.getPluginFileList(t,".json")}isValidComponent(t="",e){const i=this.excludeRoot(this.project.getFileList(t),t),r=i.some(t=>t===e+".json"),o=i.some(t=>t===e+".wxml"),s=i.some(t=>t===e+".js"||t===e+".ts");return r&&o&&s}getAllFileInfo(t=""){const e=this.project.getFileList(t),i={};return e.forEach(t=>{i[t]=this.stat("",t)||{}}),i}}exports.BaseCoreCompiler=BaseCoreCompiler;
@@ -0,0 +1 @@
1
+ "use strict";function findAllDescendant(e,t){let n;n=Array.isArray(e)?e:[e];const s=n.slice(0),o=[],a=[];for(;s.length>0;){const e=s.pop();o.push(e),e.childModules.forEach(e=>{s.indexOf(e)<0&&o.indexOf(e)<0&&(s.push(e),e.type===t&&a.push(e))})}return a}function findModsByType(e,t){var n;return(null===(n=null==e?void 0:e.graph)||void 0===n?void 0:n.modules.filter(e=>e.type===t))||[]}function findModByTypeAndPath(e,t,n){var s;return null===(s=e.graph)||void 0===s?void 0:s.modules.find(e=>e.type===t&&e.path===n)}function findPageMods(e,t){return(findModsByType(e,"Page")||[]).filter(e=>t.includes(e.path.replace(/\.json$/,"")))}function findGlobalCompMods(e){const t=findModByTypeAndPath(e,"MainPackage","app.json");return(null==t?void 0:t.childModules.filter(e=>"Component"===e.type))||[]}function getAllSubpackagePath(e){return findModsByType(e,"SubPackage").map(e=>e.path)}function innerGetSortedJSFiles(e,t){const n=new Set,s=new Set,o=new Set,a=[];for(const t of e){const e=t.findChild("Js");e&&(t.config?o.add(e.path):s.add(e.path),n.add(e.path),a.push(e))}const i=findAllDescendant(e.concat(t),"Component");for(const e of i.concat(t)){const t=e.findChild("Js");t&&(o.add(t.path),n.add(t.path),a.push(t))}const l=findAllDescendant(a,"Js");for(const e of l){const t=e.path;n.add(t)}return{allFiles:Array.from(n),pageFiles:Array.from(s),componentFiles:Array.from(o)}}function groupBySubpackage(e,t){const n=[],s={};for(const o of e){const e=t.find(e=>o.startsWith(e));e?(s[e]||(s[e]=[]),s[e].push(o)):n.push(o)}return{main:n,subs:s}}function partialGetSubPkgSortedJSFiles(e,t,n){const s=findPageMods(e,t),{allFiles:o,pageFiles:a,componentFiles:i}=innerGetSortedJSFiles(s,[]),l=getAllSubpackagePath(e);return{allFiles:groupBySubpackage(o,l).subs[n]||[],pageFiles:groupBySubpackage(a,l).subs[n]||[],componentFiles:groupBySubpackage(i,l).subs[n]||[]}}function partialGetMainPkgSortedJSFiles(e,t){const n=findPageMods(e,t),s=findGlobalCompMods(e),{allFiles:o,pageFiles:a,componentFiles:i}=innerGetSortedJSFiles(n,s);let l=!1;const p=findModByTypeAndPath(e,"Js","app.js");if(p){l=!0,o.push(p.path);const e=findAllDescendant([p],"Js");for(const t of e){const e=t.path;o.indexOf(e)<0&&o.push(e)}}const r=getAllSubpackagePath(e);return{hasAppJS:l,allFiles:groupBySubpackage(o,r).main,pageFiles:groupBySubpackage(a,r).main,componentFiles:groupBySubpackage(i,r).main}}function partialWholePkgGetSortedJSFiles(e,t){const n=findPageMods(e,t),s=findGlobalCompMods(e),{allFiles:o,pageFiles:a,componentFiles:i}=innerGetSortedJSFiles(n,s);let l=!1;const p=findModByTypeAndPath(e,"Js","app.js");if(p){l=!0,o.push(p.path);const e=findAllDescendant([p],"Js");for(const t of e){const e=t.path;o.indexOf(e)<0&&o.push(e)}}return{hasAppJS:l,allFiles:o,pageFiles:a,componentFiles:i}}function innerGetResourceFiles(e,t){let n=[];for(const s of e){const e=findAllDescendant(s,t);n=n.concat(e.map(e=>e.path))}return n}function partialGetWxmlAndWxsFiles(e,t,n){const s=findPageMods(e,t),o=findGlobalCompMods(e),a=innerGetResourceFiles(s.concat(o),"Wxml"),i=innerGetResourceFiles(s.concat(o),"Wxs"),l=getAllSubpackagePath(e),p=groupBySubpackage(a,l),r=groupBySubpackage(i,l);return{wxmlFiles:n?p.main.concat(p.subs[n]||[]):p.main,wxsFiles:n?r.main.concat(r.subs[n]||[]):r.main}}function partialGetWxssFiles(e,t,n){const s=findPageMods(e,t),o=findGlobalCompMods(e),a=innerGetResourceFiles(s.concat(o),"Wxss"),i=findModByTypeAndPath(e,"Wxss","app.wxss");if(i&&!a.includes(i.path)){a.push(i.path);const e=findAllDescendant(i,"Wxss");for(const t of e)a.includes(t.path)||a.push(t.path)}const l=groupBySubpackage(a,getAllSubpackagePath(e));return n?l.main.concat(l.subs[n]||[]):l.main}function partialGetCodeFiles(e,t){var n;const s=new Set,o=findModByTypeAndPath(e,"MainPackage","app.json");s.add("app.json");const a=new Set;function i(e){switch(a.add(e),e.type){case"Page":case"Component":case"Wxml":case"Wxss":case"Wxs":case"Js":case"Config":s.add(e.path)}for(const t of e.childModules)a.has(t)||i(t)}for(const e of null==o?void 0:o.childModules)if("Page"===e.type)t.includes(e.path.replace(/\.json$/,""))&&i(e);else if("SubPackage"===e.type)for(const n of e.childModules)t.includes(n.path.replace(/\.json$/,""))&&i(n);else i(e);return(null===(n=process.env)||void 0===n?void 0:n.isDevtools)&&console.log("[partial-compile] compile",s),Array.from(s)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.partialGetCodeFiles=exports.partialGetWxssFiles=exports.partialGetWxmlAndWxsFiles=exports.partialWholePkgGetSortedJSFiles=exports.partialGetMainPkgSortedJSFiles=exports.partialGetSubPkgSortedJSFiles=exports.findAllDescendant=void 0,exports.findAllDescendant=findAllDescendant,exports.partialGetSubPkgSortedJSFiles=partialGetSubPkgSortedJSFiles,exports.partialGetMainPkgSortedJSFiles=partialGetMainPkgSortedJSFiles,exports.partialWholePkgGetSortedJSFiles=partialWholePkgGetSortedJSFiles,exports.partialGetWxmlAndWxsFiles=partialGetWxmlAndWxsFiles,exports.partialGetWxssFiles=partialGetWxssFiles,exports.partialGetCodeFiles=partialGetCodeFiles;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getUploadProjectConfig=exports.compileWXMLFiles=exports.compileWXSSFiles=exports.compileJSFiles=exports.compileOther=exports.isNotIgnoredByProjectConfig=exports.getBabelRoot=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../../../utils/tools"),taskstatus_1=require("../../../../utils/taskstatus"),index_1=require("../workerThread/index"),helper_util_1=require("../../../../utils/helper_util"),projectconfig_1=require("../json/projectconfig"),game_1=tslib_1.__importDefault(require("../json/game")),signaturejson_1=require("../json/signaturejson"),config_1=require("../../../../config/config"),wxml_1=require("./handler/wxml"),wxss_1=require("./handler/wxss"),js_1=require("./handler/js");async function getBabelRoot(o){var t,e;const i=(0,projectconfig_1.getProjectConfigJSON)(o);let s=null===(e=null===(t=null==i?void 0:i.setting)||void 0===t?void 0:t.babelSetting)||void 0===e?void 0:e.outputPath;return s?(s=(0,tools_1.normalizePath)(s),s.replace(/(^[./\\])|(\/$)/g,""),s):"@babel/runtime"}function isNotIgnoredByProjectConfig(o,t,e){var i,s;const n=path_1.default.posix.relative(t,e),l=(null===(i=o.packOptions)||void 0===i?void 0:i.include)||[];if((0,tools_1.isFileIncluded)(n,l))return!0;const r=(null===(s=o.packOptions)||void 0===s?void 0:s.ignore)||[];return!(0,tools_1.isFileIgnored)(path_1.default.posix.relative(t,e),r)}async function copyFile(o,t){return{filePath:t,code:o.getFile("",t)}}async function compileOther(o,t,e){const{onProgressUpdate:i=(()=>{})}=e,s=new taskstatus_1.TaskStatus("compiling other files");i(s);const n=[];for(const e of t)n.push(copyFile(o,e));const l=await Promise.all(n),r={};for(const o of l){const{code:t,filePath:e}=o;t&&(r[e]=t)}return s.done(),i(s),r}async function canWeCompileJS(o,t,e){let i;for(const o of t)if((0,tools_1.normalizePath)(e).startsWith((0,tools_1.normalizePath)((0,signaturejson_1.trailing)(o.fullPath,"/")))){i=o;break}if(i){return i.signature.findIndex(o=>(0,tools_1.normalizePath)(o.fullPath)===(0,tools_1.normalizePath)(e))>=0}return!0}async function compileJSFiles(o,t,e,i){const{setting:s={}}=i;let n="@babel/runtime";s.enhance&&(n=await getBabelRoot(o));const l=[];if(o.type===config_1.COMPILE_TYPE.miniGame||o.type===config_1.COMPILE_TYPE.miniGamePlugin){const s=await(0,signaturejson_1.getAllPluginSignatures)(o);for(const r of t){const t=path_1.default.join(o.projectPath,e,r);await canWeCompileJS(o,s,t)&&l.push((0,js_1.compileJS)(o,r,Object.assign(Object.assign({},i),{babelRoot:n,root:e})))}}else for(const s of t)l.push((0,js_1.compileJS)(o,s,Object.assign(Object.assign({},i),{babelRoot:n,root:e})));let r=[];try{r=await Promise.all(l)}catch(o){throw(0,index_1.abortTask)(index_1.TASK_NAME.COMPILE_JS),o}const a={},c=new Set;for(const o of r){const{filePath:t,map:i,code:s,helpers:n}=o,l=(0,tools_1.formatSourceMap)(i);void 0!==s&&(a[path_1.default.posix.normalize(path_1.default.posix.join(e,t))]=s),l&&(a[path_1.default.posix.normalize(path_1.default.posix.join(e,t+".map"))]=l),n.length>0&&n.forEach(o=>{c.add(o)})}return await(0,helper_util_1.appendHelpers)(o,c,path_1.default.join(e),a),a}async function compileWXSSFiles(o,t,e,i){const s=[];for(const n of t)s.push((0,wxss_1.compileWXSS)(o,n,Object.assign(Object.assign({},i),{root:e})));let n=[];try{n=await Promise.all(s)}catch(o){throw(0,index_1.abortTask)(index_1.TASK_NAME.COMPILE_WXSS),o}const l={};for(const o of n){const{filePath:t,code:i}=o;void 0!==i&&(l[path_1.default.posix.normalize(path_1.default.posix.join(e,t))]=i)}return l}async function compileWXMLFiles(o,t,e,i){const s=[];for(const n of t)s.push((0,wxml_1.compileWXML)(o,n,Object.assign(Object.assign({},i),{root:e})));let n=[];try{n=await Promise.all(s)}catch(o){throw(0,index_1.abortTask)(index_1.TASK_NAME.MINIFY_WXML),o}const l={};for(const o of n){const{filePath:t,code:i}=o;void 0!==i&&(l[path_1.default.posix.normalize(path_1.default.posix.join(e,t))]=i)}return l}async function getUploadProjectConfig(o,t){const e={miniprogramRoot:t.miniprogramRoot,localPlugins:[]};t.pluginRoot&&(e.pluginRoot=t.pluginRoot);const i=(0,game_1.default)(o),s=(o,t="")=>{const i=e.localPlugins||[];for(const e in o)if(o.hasOwnProperty(e)&&o[e]&&"string"==typeof o[e].path){const s=o[e],n=path_1.default.posix.normalize(path_1.default.posix.join(t,s.path.replace(/\\/g,"/")).replace(/^\/+/,""));i.push({alias:e,provider:s.provider,path:n})}e.localPlugins=i};if(i.plugins){const{plugins:o}=i;s(o)}const n=i.subpackages||i.subPackages;if(Array.isArray(n))for(const o of n)(null==o?void 0:o.plugins)&&s(o.plugins,o.root||"");return e}exports.getBabelRoot=getBabelRoot,exports.isNotIgnoredByProjectConfig=isNotIgnoredByProjectConfig,exports.compileOther=compileOther,exports.compileJSFiles=compileJSFiles,exports.compileWXSSFiles=compileWXSSFiles,exports.compileWXMLFiles=compileWXMLFiles,exports.getUploadProjectConfig=getUploadProjectConfig;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),game_1=tslib_1.__importDefault(require("../json/game")),projectconfig_1=require("../json/projectconfig"),taskstatus_1=require("../../../../utils/taskstatus"),config_1=require("../../../../config/config"),common_1=require("../../../../utils/common"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),white_ext_list_1=require("../../../../utils/white_ext_list"),uglifyfilenames_1=require("../protect/uglifyfilenames"),common_2=require("./common");async function compileGameJSON(e,i){const{onProgressUpdate:t=(()=>{})}=i,o=new taskstatus_1.TaskStatus("game.json");t(o);const a=(0,game_1.default)(e);return o.done(),t(o),a}async function compile(e,i){var t;const o=(0,projectconfig_1.getProjectConfigJSON)(e),a=o.miniprogramRoot||"",{GameWhiteList:s}=await(0,white_ext_list_1.getWhiteExtList)(),n=e.getFileList(a,"").filter(common_2.isNotIgnoredByProjectConfig.bind(null,o,a)).filter(e=>s.has(path_1.default.posix.extname(e))),r=await compileGameJSON(e,i);e.stat(a,"game.js")||(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_FOUND.format(path_1.default.posix.join(a,"game.js")),filePath:path_1.default.posix.join(a,"game.js"),code:config_1.FILE_NOT_FOUND});const l=n.filter(e=>".js"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(a,e)),m=await(0,common_2.compileJSFiles)(e,l,a,i),_=n.filter(e=>e!==path_1.default.posix.join(a,"game.json")&&".js"!==path_1.default.posix.extname(e)),c=await(0,common_2.compileOther)(e,_,i),p=await(0,common_2.getUploadProjectConfig)(e,o);let f=Object.assign(Object.assign({},m),c);if(e.type===config_1.COMPILE_TYPE.miniGame){if(p.miniprogramRoot&&"."!==p.miniprogramRoot&&"./"!==p.miniprogramRoot){const i={};for(const t in f)i[path_1.default.posix.relative(e.miniprogramRoot,t)]=f[t];f=i}p.miniprogramRoot="",f["game.json"]=JSON.stringify(r)}else f[path_1.default.posix.join(p.miniprogramRoot||"","game.json")]=JSON.stringify(r);return p.__compileDebugInfo__=i.__compileDebugInfo__||{},f["project.config.json"]=JSON.stringify(p),delete f["project.private.config.json"],e.type===config_1.COMPILE_TYPE.miniGame&&(null===(t=i.setting)||void 0===t?void 0:t.uglifyFileName)&&(f=await(0,uglifyfilenames_1.uglifyFileNames)(e,f)),f}exports.compile=compile;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=exports.compilePlugin=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),projectconfig_1=require("../json/projectconfig"),plugin_1=require("../json/plugin/plugin"),white_ext_list_1=require("../../../../utils/white_ext_list"),game_1=require("./game"),common_1=require("./common");async function compilePlugin(e,i){const t=(0,projectconfig_1.getProjectConfigJSON)(e),o=t.pluginRoot,{GameWhiteList:n}=await(0,white_ext_list_1.getWhiteExtList)(),l=e.getFileList(o,"").filter(common_1.isNotIgnoredByProjectConfig.bind(null,t,o)).filter(e=>n.has(path_1.default.posix.extname(e))),s=(0,plugin_1.getDevPluginJSON)(e,!1),p=l.filter(e=>".js"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(o,e)),c=await(0,common_1.compileJSFiles)(e,p,o,i),a=l.filter(e=>".js"!==path_1.default.posix.extname(e)&&e!==path_1.default.posix.join(o,"plugin.json")),r=await(0,common_1.compileOther)(e,a,i);return Object.assign(Object.assign({[path_1.default.posix.join(o,"plugin.json")]:JSON.stringify(s)},c),r)}async function compile(e,i){const t=(0,projectconfig_1.getProjectConfigJSON)(e),o=await compilePlugin(e,i),n=await(0,game_1.compile)(e,i),l=await(0,common_1.getUploadProjectConfig)(e,t);return l.__compileDebugInfo__=i.__compileDebugInfo__||{},Object.assign(Object.assign(Object.assign({},o),n),{"project.config.json":JSON.stringify(l)})}exports.compilePlugin=compilePlugin,exports.compile=compile;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileJS=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),taskstatus_1=require("../../../../../utils/taskstatus"),workerThread_1=require("../../workerThread"),common_1=require("../../../../../utils/common"),config_1=require("../../../../../config/config"),tools_1=require("../../../../../utils/tools"),app_1=require("../../json/app"),common_2=require("../../json/common"),projectconfig_1=require("../../json/projectconfig"),game_1=tslib_1.__importDefault(require("../../json/game")),plugin_1=require("../../json/plugin/plugin");async function formatBabelRoot(e,t,o,r){const{type:a}=e;if(a===config_1.COMPILE_TYPE.miniProgram){const t=(0,app_1.getAppJSON)(e),a=(0,common_2.checkPagePathIsInIndependentSubpackage)(t,o);a&&(r=`${a.root}/${r}`),"object"==typeof t.functionalPages&&!0===t.functionalPages.independent&&o.startsWith("functional-pages/")&&(r="functional-pages/"+r),"string"==typeof t.openDataContext&&o.startsWith(t.openDataContext)&&(r=`${t.openDataContext}/${r}`),t.workers&&o.startsWith((0,tools_1.getWorkersPath)(t.workers))&&(r=`${(0,tools_1.getWorkersPath)(t.workers)}/${r}`)}else if(a===config_1.COMPILE_TYPE.miniGame){const t=await(0,game_1.default)(e),a=(0,common_2.checkFilePathIsInIndependentSubpackage)(t,o);a&&(r=`${a}/${r}`),"string"==typeof t.openDataContext&&o.startsWith(t.openDataContext)&&(r=`${t.openDataContext}/${r}`),t.workers&&o.startsWith((0,tools_1.getWorkersPath)(t.workers))&&(r=`${(0,tools_1.getWorkersPath)(t.workers)}/${r}`)}else if(a===config_1.COMPILE_TYPE.miniProgramPlugin||a===config_1.COMPILE_TYPE.miniGamePlugin){const t=await(0,plugin_1.getDevPluginJSON)(e);"string"==typeof t.workers&&o.startsWith(t.workers)&&(r=`${t.workers}/${r}`)}return(0,tools_1.normalizePath)(""+r)}async function compileJS(e,t,o){var r,a;const{setting:i={},onProgressUpdate:n=(()=>{}),root:s="",devToolsCompileCache:l}=o,c=path_1.default.posix.join(s,t);let g=[],p=o.babelRoot||"@babel/runtime";if(i.enhance){const o=await(0,projectconfig_1.getProjectConfigJSON)(e);g=(null===(a=null===(r=o.setting)||void 0===r?void 0:r.babelSetting)||void 0===a?void 0:a.ignore)||[],p=await formatBabelRoot(e,s,t,p)}const u=new taskstatus_1.TaskStatus(t),_=o.sourceCode?o.sourceCode:await e.getFile(s,t);async function f(){const o=await(0,workerThread_1.runTask)(workerThread_1.TASK_NAME.COMPILE_JS,{projectPath:e.projectPath,root:s,filePath:t,setting:i,code:_,babelRoot:p,babelIgnore:g},e=>{e===workerThread_1.ETaskStatus.progress?n(u):e===workerThread_1.ETaskStatus.done&&(u.done(),n(u))});return o.error&&(0,common_1.throwError)({msg:o.error.message,code:o.error.code,filePath:c}),o}let m={};if(l){const o=(0,tools_1.normalizePath)(path_1.default.posix.join(e.projectPath,s,t)),r=`${o}_${JSON.stringify(i)}`;m=await l.getFile(o,r),m&&!i.uglifyFileName||(m=await f(),l.setFile(o,m,r))}else m=await f();return Object.assign({filePath:t},m)}exports.compileJS=compileJS;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileJSON=exports.addSkylineRendererToComponents=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),app_1=require("../../json/app"),extJSON_1=require("../../json/app/extJSON"),common_1=require("../../../../../utils/common"),getPageJSON_1=require("../../json/page/getPageJSON"),taskstatus_1=require("../../../../../utils/taskstatus"),projectconfig_1=require("../../json/projectconfig"),common_2=require("../common");function addSkylineRendererToComponents(e,t){const o=new Set,n=new Set;function s(e,t){Object.values(t.usingComponents||{}).forEach(t=>{const s=t.startsWith("/")?t.substring(1)+".json":path_1.default.posix.join(path_1.default.posix.dirname(e),t+".json");o.has(s)||n.add(s)}),Object.values(t.componentGenerics||{}).forEach(t=>{if("object"==typeof t&&"string"==typeof t.default){const s=t.default.startsWith("/")?t.default.substring(1)+".json":path_1.default.posix.join(path_1.default.posix.dirname(e),t.default+".json");o.has(s)||n.add(s)}})}for(const t of Object.keys(e)){const o=JSON.parse(e[t]);"skyline"===o.renderer&&s(t,o)}for(;n.size>0;){const e=n.values().next().value;if(n.delete(e),o.add(e),t[e]&&"string"==typeof t[e]){const o=JSON.parse(t[e]);if("xr-frame"===o.renderer)continue;if("webview"===o.renderer)throw new Error(`The component (${e}) is configured with renderer: 'webview', but is used in skyline pages`);o.renderer="skyline",t[e]=JSON.stringify(o),s(e,o)}}}async function compilePageJSON(e,t,o,n){const{onProgressUpdate:s=(()=>{})}=n,a={};for(const i of t){const t=new taskstatus_1.TaskStatus(i);s(t);const r=await(n.disableSpreadingUsingComponents?getPageJSON_1.getPageJSONWithDisableSpreading:getPageJSON_1.getPageJSON)(e,{miniprogramRoot:o,pagePath:i});a[path_1.default.posix.join(o,i+".json")]=JSON.stringify(Object.assign(Object.assign({},r),{__warning__:void 0})),t.done(),s(t)}return a}async function compileJSON(e,t){const{onProgressUpdate:o=(()=>{})}=t,n=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:s=""}=n;let a=new taskstatus_1.TaskStatus("app.json");o(a);const i=(0,app_1.getAppJSON)(e);let r;a.done(),o(a);const p=await e.attr();(null==p?void 0:p.platform)&&(a=new taskstatus_1.TaskStatus("ext.json"),o(a),r=await(0,extJSON_1.getExtJSON)(e),a.done(),o(a));const c=(0,common_1.getAllPages)(i),l=await compilePageJSON(e,c,s,t),d=new Set(["app.json","ext.json"].concat(c.map(e=>e+".json"))),g=(0,common_1.getAllTargetTypeFilesWithOtherTypeFilesOfSameName)(e,".json",[".wxml",".js"],s).filter(common_2.isNotIgnoredByProjectConfig.bind(null,n,s)).filter(e=>{const t=path_1.default.posix.relative(s,e);return!d.has(t)}).map(e=>path_1.default.posix.relative(s,e).replace(/\.json$/,"")),u=await compilePageJSON(e,g,s,t);g.forEach(e=>d.add(e+".json")),addSkylineRendererToComponents(l,u);const f=e.getFileList(s,".json").filter(common_2.isNotIgnoredByProjectConfig.bind(null,n,s)).filter(e=>{const t=path_1.default.posix.relative(s,e);return!d.has(t)}),m=await(0,common_2.compileOther)(e,f,t),_=Object.assign(Object.assign(Object.assign({[path_1.default.posix.join(s,"app.json")]:JSON.stringify(Object.assign(Object.assign({},i),{__warning__:void 0}))},l),u),m);return r&&(_[path_1.default.posix.join(s,"ext.json")]=JSON.stringify(r)),_}exports.addSkylineRendererToComponents=addSkylineRendererToComponents,exports.compileJSON=compileJSON;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileWXML=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../../../../utils/tools"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),config_1=require("../../../../../config/config"),taskstatus_1=require("../../../../../utils/taskstatus"),workerThread_1=require("../../workerThread"),common_1=require("../../../../../utils/common");async function compileWXML(e,r,o){const{root:t="",setting:s={},onProgressUpdate:a=(()=>{})}=o,{minifyWXML:i}=s,l=new taskstatus_1.TaskStatus(r),c=path_1.default.posix.join(t,r),n=await e.getFile(t,r);if(!i){a(l);const e=(0,tools_1.bufferToUtf8String)(n);return void 0===e&&(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_UTF8.format(c),code:config_1.FILE_NOT_UTF8,filePath:c}),l.done(),a(l),{filePath:r,code:e.replace(/\r\n/g,"\n")}}const _=await(0,workerThread_1.runTask)(workerThread_1.TASK_NAME.MINIFY_WXML,{projectPath:e.projectPath,root:t,filePath:r,setting:s,code:n},e=>{e===workerThread_1.ETaskStatus.progress?a(l):e===workerThread_1.ETaskStatus.done&&(l.done(),a(l))});return _.error&&(0,common_1.throwError)({msg:_.error.message,code:_.error.code,filePath:c}),{filePath:r,code:_.code.replace(/\r\n/g,"\n")}}exports.compileWXML=compileWXML;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileWXSS=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../../../../utils/tools"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),config_1=require("../../../../../config/config"),taskstatus_1=require("../../../../../utils/taskstatus"),workerThread_1=require("../../workerThread"),common_1=require("../../../../../utils/common");async function compileWXSS(e,t,o){const{root:r="",setting:s={},onProgressUpdate:i=(()=>{}),devToolsCompileCache:a}=o,{minifyWXSS:l,postcss:c}=s,n=new taskstatus_1.TaskStatus(t),_=path_1.default.posix.join(r,t),u=await e.getFile(r,t);if(!l&&!c){i(n);const e=(0,tools_1.bufferToUtf8String)(u);return void 0===e&&(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_UTF8.format(_),code:config_1.FILE_NOT_UTF8,filePath:_}),n.done(),i(n),{filePath:t,code:e}}async function f(){const o=await(0,workerThread_1.runTask)(workerThread_1.TASK_NAME.COMPILE_WXSS,{projectPath:e.projectPath,root:r,filePath:t,setting:s,code:u},e=>{e===workerThread_1.ETaskStatus.progress?i(n):e===workerThread_1.ETaskStatus.done&&(n.done(),i(n))});return o.error&&(0,common_1.throwError)({msg:o.error.message,code:o.error.code,filePath:_}),o.code}let d="";if(a){const o=(0,tools_1.normalizePath)(path_1.default.posix.join(e.projectPath,r,t)),i=`${o}_${JSON.stringify(s)}`;d=await a.getFile(o,i),d&&!s.uglifyFileName||(d=await f(),a.setFile(o,d,i))}else d=await f();return{filePath:t,code:d}}exports.compileWXSS=compileWXSS;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tslib_1=require("tslib"),config_1=require("../../../../config/config"),reactiveCache_1=require("../json/reactiveCache"),common_1=require("../../../../utils/common"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),gamePlugin_1=require("./gamePlugin"),miniprogramPlugin_1=require("./miniprogramPlugin"),miniprogram_1=require("./miniprogram"),game_1=require("./game");async function checkProjectTypeMatchProjectAttr(e){const i=await e.attr();!i.gameApp||e.type!==config_1.COMPILE_TYPE.miniProgramPlugin&&e.type!==config_1.COMPILE_TYPE.miniProgram||(0,common_1.throwError)({filePath:"",msg:locales_1.default.config.PROJECT_TYPE_ERROR.format(e.type,e.appid,locales_1.default.config.MINI_GAME),code:config_1.PROJECT_TYPE_ERROR}),i.gameApp||e.type!==config_1.COMPILE_TYPE.miniGame&&e.type!==config_1.COMPILE_TYPE.miniGamePlugin||(0,common_1.throwError)({filePath:"",msg:locales_1.default.config.PROJECT_TYPE_ERROR.format(e.type,e.appid,locales_1.default.config.MINI_PROGRAM),code:config_1.PROJECT_TYPE_ERROR})}async function compile(e,i){const o=(0,reactiveCache_1.tryToGetReactiveProject)(e);return await o.updateProject(),i.__compileDebugInfo__?i.__compileDebugInfo__.ciVersion=config_1.CI_VERSION:i.__compileDebugInfo__={from:"inner",useNewCompileModule:!0,devtoolsVersion:"0",compileSetting:i.setting,ciVersion:config_1.CI_VERSION},process.env.isDevtools&&(e.nameMappingFromDevtools=i.nameMapping||{}),await checkProjectTypeMatchProjectAttr(e),e.type===config_1.COMPILE_TYPE.miniGame?(0,game_1.compile)(e,i):e.type===config_1.COMPILE_TYPE.miniProgramPlugin?(0,miniprogramPlugin_1.compile)(e,i):e.type===config_1.COMPILE_TYPE.miniGamePlugin?(0,gamePlugin_1.compile)(e,i):(0,miniprogram_1.compile)(e,i)}exports.compile=compile;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=tslib_1.__importDefault(require("lodash")),white_ext_list_1=require("../../../../utils/white_ext_list"),config_1=require("../../../../config/config"),projectconfig_1=require("../json/projectconfig"),uglifyfilenames_1=require("../protect/uglifyfilenames"),partial_1=require("../analyse/partial"),summer=tslib_1.__importStar(require("../../summer")),mpjson_1=require("./handler/mpjson"),common_1=require("./common");async function compile(e,i){var t,o,a,l;const s=(0,projectconfig_1.getProjectConfigJSON)(e);if(null===(t=s.setting)||void 0===t?void 0:t.useCompilerPlugins)return summer.compile(e,s,i,s.setting.useCompilerPlugins);const r=s.miniprogramRoot||"",{MiniProgramWhiteList:p}=await(0,white_ext_list_1.getWhiteExtList)();let n=e.getFileList(r,"").filter(common_1.isNotIgnoredByProjectConfig.bind(null,s,r)).filter(e=>p.has(path_1.default.posix.extname(e)));if((null===(o=i.compilePages)||void 0===o?void 0:o.length)&&i.analyzer){const e=(0,partial_1.partialGetCodeFiles)(i.analyzer,i.compilePages).map(e=>path_1.default.posix.join(r,e)),t=n.filter(e=>{const i=path_1.default.posix.extname(e);return".js"!==i&&".json"!==i&&".wxss"!==i&&".wxml"!==i});n=t.concat(e)}let m=!1,c=await(0,mpjson_1.compileJSON)(e,i);if((null===(a=i.compilePages)||void 0===a?void 0:a.length)&&i.analyzer){const e=JSON.parse(c[path_1.default.posix.join(r,"app.json")]);e.pages=e.pages.filter(e=>{var t;return null===(t=i.compilePages)||void 0===t?void 0:t.includes(e)}),0===e.pages.length&&(e.pages=["partialcompileplaceholder"],m=!0),e.subPackages&&(e.subPackages.forEach(e=>{e.pages=e.pages.filter(t=>{var o;return null===(o=i.compilePages)||void 0===o?void 0:o.includes(e.root+t)})}),e.subPackages=e.subPackages.filter(e=>e.pages.length>0)),c[path_1.default.posix.join(r,"app.json")]=JSON.stringify(e),c=lodash_1.default.pick(c,Object.keys(c).filter(e=>c[e]instanceof Buffer||n.includes(e)))}const _=n.filter(e=>".js"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(r,e)),u=await(0,common_1.compileJSFiles)(e,_,r,i),f=n.filter(e=>".wxss"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(r,e)),g=await(0,common_1.compileWXSSFiles)(e,f,r,i),d=n.filter(e=>".wxml"===path_1.default.posix.extname(e)).map(e=>path_1.default.posix.relative(r,e)),h=await(0,common_1.compileWXMLFiles)(e,d,r,i),j=n.filter(e=>{const i=path_1.default.posix.extname(e);return".js"!==i&&".json"!==i&&".wxss"!==i&&".wxml"!==i}),x=await(0,common_1.compileOther)(e,j,i);let v=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c),u),x),g),h);if(m&&(v[path_1.default.posix.join(r,"partialcompileplaceholder.js")]||(v[path_1.default.posix.join(r,"partialcompileplaceholder.js")]=""),v[path_1.default.posix.join(r,"partialcompileplaceholder.wxml")]||(v[path_1.default.posix.join(r,"partialcompileplaceholder.wxml")]="")),e.type===config_1.COMPILE_TYPE.miniProgram){if(s.miniprogramRoot&&"."!==s.miniprogramRoot&&"./"!==s.miniprogramRoot){const i={};for(const t in v)i[path_1.default.posix.relative(e.miniprogramRoot,t)]=v[t];v=i}v["project.config.json"]=JSON.stringify({miniprogramRoot:"",__compileDebugInfo__:i.__compileDebugInfo__||{}}),delete v["project.private.config.json"]}else v["project.config.json"]=JSON.stringify({miniprogramRoot:e.miniprogramRoot||"",__compileDebugInfo__:i.__compileDebugInfo__||{}}),delete v["project.private.config.json"];return e.type===config_1.COMPILE_TYPE.miniProgram&&(null===(l=i.setting)||void 0===l?void 0:l.uglifyFileName)&&(v=await(0,uglifyfilenames_1.uglifyFileNames)(e,v)),v}exports.compile=compile;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=exports.compilePlugin=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),plugin_1=require("../json/plugin/plugin"),pluginPage_1=require("../json/plugin/pluginPage"),white_ext_list_1=require("../../../../utils/white_ext_list"),projectconfig_1=require("../json/projectconfig"),summer=tslib_1.__importStar(require("../../summer")),common_1=require("./common"),miniprogram_1=require("./miniprogram");async function compilePlugin(i,e){const t=await(0,projectconfig_1.getProjectConfigJSON)(i),{MiniProgramWhiteList:o}=await(0,white_ext_list_1.getWhiteExtList)(),n=t.pluginRoot,s=i.getFileList(n,"").filter(common_1.isNotIgnoredByProjectConfig.bind(null,t,n)).filter(i=>o.has(path_1.default.posix.extname(i))),a=await(0,plugin_1.getDevPluginJSON)(i,!1),l=s.filter(i=>".json"===path_1.default.posix.extname(i)&&i!==path_1.default.posix.join(n,"plugin.json")),r={};for(const e of l){const t=await(0,pluginPage_1.getPluginPageJSON)({project:i,root:n,filePath:e});r[e]=JSON.stringify(t)}const p=s.filter(i=>".js"===path_1.default.posix.extname(i)).map(i=>path_1.default.posix.relative(n,i)),m=await(0,common_1.compileJSFiles)(i,p,n,e),g=s.filter(i=>".wxss"===path_1.default.posix.extname(i)).map(i=>path_1.default.posix.relative(n,i)),u=await(0,common_1.compileWXSSFiles)(i,g,n,e),c=s.filter(i=>".wxml"===path_1.default.posix.extname(i)).map(i=>path_1.default.posix.relative(n,i)),_=await(0,common_1.compileWXMLFiles)(i,c,n,e),f=s.filter(i=>{const e=path_1.default.posix.extname(i);return".js"!==e&&".json"!==e&&".wxss"!==e&&".wxml"!==e}),j=await(0,common_1.compileOther)(i,f,e);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[path_1.default.posix.join(n,"plugin.json")]:JSON.stringify(a)},r),m),j),u),_)}async function compile(i,e){var t;const o=await(0,projectconfig_1.getProjectConfigJSON)(i);if(null===(t=o.setting)||void 0===t?void 0:t.useCompilerPlugins)return summer.compile(i,o,e,o.setting.useCompilerPlugins);const n=await compilePlugin(i,e),s=await(0,miniprogram_1.compile)(i,e);return Object.assign(Object.assign(Object.assign({},n),s),{"project.config.json":JSON.stringify({miniprogramRoot:o.miniprogramRoot,pluginRoot:o.pluginRoot,__compileDebugInfo__:e.__compileDebugInfo__||{}})})}exports.compilePlugin=compilePlugin,exports.compile=compile;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OriginalCompileManager=exports.setFSAgent=exports.setLocale=exports.clearCache=exports.compile=exports.compileJS=exports.packNpmManually=exports.packNpm=exports.mergeThemeJSONToPageJSON=exports.mergeThemeJSONToAppJSON=exports.schemaValidate=exports.getSiteMapJSON=exports.checkThemeJSON=exports.getPluginPageJSON=exports.getPluginJSON=exports.getGameJSON=exports.getPageJSON=exports.getExtJSON=exports.getAppJSON=exports.partialAnalyse=void 0;const tslib_1=require("tslib"),cache_1=require("../../../utils/cache"),fs_1=require("../../../utils/fs");Object.defineProperty(exports,"setFSAgent",{enumerable:!0,get:function(){return fs_1.setFSAgent}});const locales_1=tslib_1.__importDefault(require("../../../utils/locales/locales")),index_1=require("./compile/index");Object.defineProperty(exports,"compile",{enumerable:!0,get:function(){return index_1.compile}});const app_1=require("./json/app"),getPageJSON_1=require("./json/page/getPageJSON");Object.defineProperty(exports,"getPageJSON",{enumerable:!0,get:function(){return getPageJSON_1.getPageJSON}});const js_1=require("./compile/handler/js");Object.defineProperty(exports,"compileJS",{enumerable:!0,get:function(){return js_1.compileJS}});const plugin_1=require("./json/plugin/plugin");Object.defineProperty(exports,"getPluginJSON",{enumerable:!0,get:function(){return plugin_1.getDevPluginJSON}});const pluginPage_1=require("./json/plugin/pluginPage");Object.defineProperty(exports,"getPluginPageJSON",{enumerable:!0,get:function(){return pluginPage_1.getPluginPageJSON}});const sitemap_1=require("./json/sitemap");Object.defineProperty(exports,"getSiteMapJSON",{enumerable:!0,get:function(){return sitemap_1.getSiteMapJSON}});const theme_1=require("./json/theme");Object.defineProperty(exports,"checkThemeJSON",{enumerable:!0,get:function(){return theme_1.checkThemeJSON}}),Object.defineProperty(exports,"mergeThemeJSONToAppJSON",{enumerable:!0,get:function(){return theme_1.mergeThemeJSONToAppJSON}}),Object.defineProperty(exports,"mergeThemeJSONToPageJSON",{enumerable:!0,get:function(){return theme_1.mergeThemeJSONToPageJSON}});const schemaValidate_1=require("./validate/schemaValidate");Object.defineProperty(exports,"schemaValidate",{enumerable:!0,get:function(){return schemaValidate_1.schemaValidate}});const reactiveCache_1=require("./json/reactiveCache"),game_1=tslib_1.__importDefault(require("./json/game")),packnpm_1=require("./npm/packnpm");Object.defineProperty(exports,"packNpm",{enumerable:!0,get:function(){return packnpm_1.packNpm}}),Object.defineProperty(exports,"packNpmManually",{enumerable:!0,get:function(){return packnpm_1.packNpmManually}}),exports.partialAnalyse=tslib_1.__importStar(require("./analyse/partial"));const{setLocale:setLocale}=locales_1.default;async function getAppJSON(e){try{const t=(0,reactiveCache_1.tryToGetReactiveProject)(e);return await t.updateProject(),(0,app_1.getAppJSON)(e)}catch(e){throw console.error("getAppJSON error",e),e}}async function getExtJSON(e){try{const t=(0,reactiveCache_1.tryToGetReactiveProject)(e);return await t.updateProject(),(0,app_1.getExtJSON)(e)}catch(e){throw console.error("getAppJSON error",e),e}}async function getGameJSON(e){try{const t=(0,reactiveCache_1.tryToGetReactiveProject)(e);return await t.updateProject(),(0,game_1.default)(e)}catch(e){throw console.error("getGameJSON error",e),e}}function clearCache(){cache_1.cacheManager.clean()}exports.setLocale=setLocale,exports.getAppJSON=getAppJSON,exports.getExtJSON=getExtJSON,exports.getGameJSON=getGameJSON,exports.clearCache=clearCache;class OriginalCompileManager{constructor(e){this.getPluginPageJSON=pluginPage_1.getPluginPageJSON,this.schemaValidate=schemaValidate_1.schemaValidate,this.mergeThemeJSONToAppJSON=theme_1.mergeThemeJSONToAppJSON,this.mergeThemeJSONToPageJSON=theme_1.mergeThemeJSONToPageJSON,this.packNpmManually=packnpm_1.packNpmManually,this.clearCache=clearCache,this.setLocale=setLocale,this.setFSAgent=fs_1.setFSAgent,this.project=e}getAppJSON(){return getAppJSON(this.project)}getExtJSON(){return getExtJSON(this.project)}getPageJSON(e){return(0,getPageJSON_1.getPageJSON)(this.project,e)}getGameJSON(){return getGameJSON(this.project)}getPluginJSON(...e){return(0,plugin_1.getDevPluginJSON)(this.project,...e)}checkThemeJSON(e){return(0,theme_1.checkThemeJSON)(this.project,e)}getSiteMapJSON(){return(0,sitemap_1.getSiteMapJSON)(this.project)}async packNpm(...e){return await(0,packnpm_1.packNpm)(this.project,...e)}async compileJS(e,t){return await(0,js_1.compileJS)(this.project,e,t)}async compile(e){return await(0,index_1.compile)(this.project,e)}}exports.OriginalCompileManager=OriginalCompileManager;
@@ -0,0 +1 @@
1
+ "use strict";const config_1=require("../../../../config/config"),babel_helper_1=require("../../../../utils/babel_helper"),_transformRuntimeCustom=()=>require("../../../../utils/babel_transform_plugin"),_pluginTransformWorklet=()=>require("../../../../utils/babel_plugin_worklet"),babel7=()=>require("@babel/core"),_pluginTransformRuntime=()=>require("@babel/plugin-transform-runtime"),_pluginTransformModulesCommonjs=()=>require("@babel/plugin-transform-modules-commonjs"),_presetEnv=()=>require("@babel/preset-env");function getPluginsList(e){const r=[[require("../../../../utils/babel_transform_plugin")],[require("@babel/plugin-transform-runtime"),{corejs:!1,helpers:!0,regenerator:!e.hasRegenerator,version:"7.21.0"}]].concat((0,babel_helper_1.getCustomPlugins)([]));return r.push([require("@babel/plugin-transform-modules-commonjs"),{allowTopLevelThis:e.disableUseStrict,importInterop:e=>e.startsWith("@babel/runtime/helpers/")?"node":"babel"}]),e.supportWorklet&&r.push([require("../../../../utils/babel_plugin_worklet")]),r}const enhance=e=>{const{code:r,babelRoot:l,filePath:t,inputSourceMap:s}=e,o=r,n=/regeneratorRuntime\.mark/.test(r),i=e.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r),u=o.includes('"worklet"')||o.includes("'worklet'");let a=null;try{a=require("@babel/core").transform(r,{presets:[[require("@babel/preset-env"),{targets:{chrome:53,ios:8},include:["@babel/plugin-transform-computed-properties"]}]],babelrc:!1,plugins:getPluginsList({hasRegenerator:n,disableUseStrict:i,supportWorklet:u}),sourceFileName:t,inputSourceMap:s,sourceMaps:!0,configFile:!1})}catch(e){return{error:{message:`file: ${t}\n ${e.message}`,code:config_1.BABEL_TRANS_JS_ERR}}}let b=(null==a?void 0:a.code)||r;const p=(null==a?void 0:a.map)||s;i&&(b=b.replace(/^"use strict";/,""));const c=(0,babel_helper_1.collectBabelHelpers)(o),{transformCode:m,helpers:g}=(0,babel_helper_1.replaceBabelHelpers)(b,c,t,l);return b=m,{code:b,map:p,helpers:g||[]}};module.exports=enhance;
@@ -0,0 +1 @@
1
+ "use strict";const config_1=require("../../../../config/config"),_babelCodeFrame=()=>require("babel-code-frame"),_babel=()=>require("babel-core"),es6Compile=e=>{const{code:r,filePath:o,inputSourceMap:c}=e;try{const e=require("babel-core").transform(r,{presets:["babel-preset-es2015","babel-preset-stage-0"].map(e=>require.resolve(e)),babelrc:!1,sourceFileName:o,filename:o,inputSourceMap:c,sourceMaps:!0});return{code:e.code,map:e.map}}catch(e){if(e.loc){return{error:{message:`file: ${o}\n ${e.message}\n ${require("babel-code-frame")(r,e.loc.line,e.loc.column>0?e.loc.column:1)}`,code:config_1.BABEL_TRANS_JS_ERR}}}return{error:{message:""+e,code:config_1.BABEL_TRANS_JS_ERR}}}};module.exports=es6Compile;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compile=void 0;const tslib_1=require("tslib"),config_1=require("../../../../config/config"),tools_1=require("../../../../utils/tools"),error_1=require("../../../../utils/error"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales"));function compile(e,o,r){if(void 0===(0,tools_1.bufferToUtf8String)(e))throw new error_1.CodeError(locales_1.default.config.FILE_NOT_UTF8.format(o),config_1.FILE_NOT_UTF8)}exports.compile=compile;
@@ -0,0 +1 @@
1
+ "use strict";const config_1=require("../../../../config/config"),_Terser=()=>require("terser"),_UglifyJS=()=>require("uglify-js"),_babelCodeFrame=()=>require("babel-code-frame"),minify=e=>{const{code:r,inputSourceMap:o,useTerser:i,filePath:n}=e;let c;const s=o?{includeSources:!0,content:o,filename:n}:{includeSources:!0,content:void 0,filename:n};if(c=i?require("terser").minify(r,{output:{comments:!1},toplevel:!0,compress:{drop_console:!1,drop_debugger:!1},sourceMap:s}):require("uglify-js").minify(r,{toplevel:!0,sourceMap:s}),c.error){const e=c.error;return{error:{message:`file: ${n}\n ${c.error.message}\n ${require("babel-code-frame")(r,e.line,e.col>0?e.col:1)}`,code:config_1.UGLIFY_JS_ERR}}}return c};module.exports=minify;
@@ -0,0 +1 @@
1
+ "use strict";const tslib_1=require("tslib"),minifyjs_1=tslib_1.__importDefault(require("./minifyjs")),_sourcemap=()=>require("source-map"),transformInputSourceMapWhenWraped=e=>{const{code:n,filePath:r,inputSourceMap:o}=e;if(o){const e=new(_sourcemap().SourceMapConsumer)(o),n=new(_sourcemap().SourceMapGenerator)({file:r});return e.eachMapping(e=>{if("number"!=typeof e.originalLine||"number"!=typeof e.originalColumn)return;const r={generated:{line:e.generatedLine+1,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)}),e.sources.forEach(r=>{const o=r;n._sources.has(o)||n._sources.add(o);const s=e.sourceContentFor(r);null!==s&&n.setSourceContent(r,s)}),n.toJSON()}const s=new(_sourcemap().SourceMapGenerator)({file:r}),t=n.split("\n").length;for(let e=0;e<t;e++)s.addMapping({generated:{line:e+2,column:0},original:{line:e+1,column:0},source:r});return s._sources.add(r),s.setSourceContent(r,n),s.toJSON()},minifyAfterWrap=e=>{const n=transformInputSourceMapWhenWraped(Object.assign({},e)),r=(0,minifyjs_1.default)(Object.assign(Object.assign({},e),{inputSourceMap:n,code:`(function(){\n${e.code}\n})()`,useTerser:!0}));return r.error?(console.error(r.error),(0,minifyjs_1.default)(Object.assign(Object.assign({},e),{useTerser:!0}))):r};module.exports=minifyAfterWrap;
@@ -0,0 +1 @@
1
+ "use strict";const config_1=require("../../../../config/config"),_pluginTransformWorklet=()=>require("../../../../utils/babel_plugin_worklet"),babel7=()=>require("@babel/core"),workletCompile=e=>{const{code:r,filePath:l,inputSourceMap:i}=e,o=e.disableUseStrict||/^\s*\/\/\s?use strict disable;/i.test(r);let t=null;try{t=require("@babel/core").transform(r,{babelrc:!1,plugins:[require("../../../../utils/babel_plugin_worklet")],sourceFileName:l,inputSourceMap:i,sourceMaps:!0,configFile:!1})}catch(e){return{error:{message:`file: ${l}\n ${e.message}`,code:config_1.BABEL_TRANS_JS_ERR}}}let s=(null==t?void 0:t.code)||r;const c=(null==t?void 0:t.map)||i;return o&&(s=s.replace(/^"use strict";/,"")),{code:s,map:c,helpers:[]}};module.exports=workletCompile;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAppJSON=exports.getRawAppJSON=exports.checkAppJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=require("lodash"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),projectconfig_1=require("../projectconfig"),common_1=require("../../../../../utils/common"),config_1=require("../../../../../config/config"),common_2=require("../common"),cache_1=require("../../../../../utils/cache"),schemaValidate_1=require("../../validate/schemaValidate"),tools_1=require("../../../../../utils/tools"),theme_1=require("../theme"),reactiveCache_1=require("../reactiveCache"),checkAppFields_1=require("./checkAppFields");function checkAppJSON(e){const{inputJSON:c}=e,{filePath:a}=e,t=(0,theme_1.getThemeLocation)(e.project);if(!t){const e=(0,checkAppFields_1.getAppJSONVariableDecalearProperty)(c);e.length&&(0,common_1.throwError)({msg:'appJSON["themeLocation"] is required because:\n'+e.map(e=>`"${e.value}" as variable was declared at ${a}:${e.property}`).join("\n"),filePath:a})}let o={light:{},dark:{}};t&&(o=(0,theme_1.checkThemeJSON)(e.project,{themeLocation:t}));const p=(0,theme_1.mergeThemeJSONToAppJSON)(o,c),i=(0,checkAppFields_1.getAppJSONVariableDecalearProperty)(p.appJSONLight);i.length&&(0,common_1.throwError)({msg:i.map(e=>`"${e.value}" as variable was declared at ${a}:${e.property}, but not found at ${t}["light"]`).join("\n"),filePath:a});const r=(0,checkAppFields_1.getAppJSONVariableDecalearProperty)(p.appJSONDark);r.length&&(0,common_1.throwError)({msg:r.map(e=>`"${e.value}" as variable was declared at ${a}:${e.property}, but not found at ${t}["dark"]`).join("\n"),filePath:a});const l=(0,schemaValidate_1.schemaValidate)("app",p.appJSONLight),s=(0,schemaValidate_1.schemaValidate)("app",p.appJSONDark);l.warning&&(c.__warning__=locales_1.default.config.INVALID.format(l.warning)),t&&s.warning&&(c.__warning__=locales_1.default.config.INVALID.format(s.warning)),(0,schemaValidate_1.transValidateResult)(t?`${a} or ${t}["light"]`:a,l),t&&(0,schemaValidate_1.transValidateResult)(`${a} or ${t}["dark"]`,s);const n=Object.assign(Object.assign({},e),{mode:"light",inputJSON:p.appJSONLight}),h=Object.assign(Object.assign({},e),{mode:"dark",inputJSON:p.appJSONDark});(0,checkAppFields_1.checkMainPkgPages)(e),(0,checkAppFields_1.checkSubpackages)(e),(0,checkAppFields_1.checkTabbar)(n),t&&(0,checkAppFields_1.checkTabbar)(h),(0,checkAppFields_1.checkWorkers)(e),(0,checkAppFields_1.checkFunctionalPages)(e),(0,checkAppFields_1.checkOpenLocationPagePath)(e),(0,checkAppFields_1.checkOpenDataContext)(e,c),(0,checkAppFields_1.checkPlugins)(e),(0,checkAppFields_1.checkWindow)(n),t&&(0,checkAppFields_1.checkWindow)(h),(0,checkAppFields_1.checkComponentPath)(e);const _=(0,common_1.getAllPagesInfo)(c);return(0,checkAppFields_1.checkEntryPagePath)(e,_),(0,checkAppFields_1.checkPreloadRule)(e,_),(0,checkAppFields_1.checkTabbarPage)(e),(0,checkAppFields_1.checkMainPkgPageIsInSubpkg)(e),(0,checkAppFields_1.checkMainPkgPluginIsInSubPkg)(e),(0,checkAppFields_1.checkEntranceDeclare)(e),(0,checkAppFields_1.checkRenderer)(e),(0,checkAppFields_1.checkResolveAlias)(e),(0,checkAppFields_1.checkRequiredPrivateInfos)(e),(0,checkAppFields_1.checkAccountCardPackage)(e),c}exports.checkAppJSON=checkAppJSON,exports.getRawAppJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.RAW_APP_JSON,e=>{const c=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:a=""}=c,t=(0,tools_1.normalizePath)(path_1.default.posix.join(a,"app.json"));e.stat(a,"app.json")||(""===a?(0,common_1.throwError)({msg:locales_1.default.config.NOT_FOUND_IN_ROOT_DIR.format(t),code:config_1.FILE_NOT_FOUND,filePath:t}):(0,common_1.throwError)({msg:locales_1.default.config.MINIPROGRAM_APP_JSON_NOT_FOUND.format(a,"app.json"),code:config_1.FILE_NOT_FOUND,filePath:t}));const o=e.getFile(a,"app.json");return(0,common_2.checkJSONFormat)((0,common_1.checkUTF8)(o,t),t)}),exports.getAppJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.APP_JSON,e=>{const c=(0,lodash_1.cloneDeep)((0,exports.getRawAppJSON)(e)),a=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:t=""}=a;return checkAppJSON({project:e,miniprogramRoot:t,filePath:(0,tools_1.normalizePath)(path_1.default.posix.join(t,"app.json")),inputJSON:c}),c});
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkAccountCardPackage=exports.checkRequiredPrivateInfos=exports.checkResolveAlias=exports.checkRenderer=exports.checkOpenDataContext=exports.getAppJSONVariableDecalearProperty=exports.checkEntranceDeclare=exports.checkComponentPath=exports.checkMainPkgPluginIsInSubPkg=exports.checkMainPkgPageIsInSubpkg=exports.checkTabbarPage=exports.checkEntryPagePath=exports.checkPreloadRule=exports.checkFunctionalPages=exports.checkNavigateToMiniProgramAppIdList=exports.checkPlugins=exports.checkSubpackages=exports.checkSitemapLocation=exports.checkMainPkgPages=exports.checkOpenLocationPagePath=exports.checkWorkers=exports.checkTabbar=exports.checkWindow=exports.checkPageExist=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=tslib_1.__importDefault(require("lodash")),config_1=require("../../../../../config/config"),common_1=require("../common"),common_2=require("../../../../../utils/common"),tools_1=require("../../../../../utils/tools"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),schemaValidate_1=require("../../validate/schemaValidate"),projectconfig_1=require("../projectconfig");function checkPageExist(o,t,e){const{miniprogramRoot:a,project:n,filePath:c}=o;n.stat(a,t+".wxml")||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(e,t+".wxml"),code:config_1.FILE_NOT_FOUND,filePath:c}),n.stat(a,t+".js")||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(e,t+".js"),code:config_1.FILE_NOT_FOUND,filePath:c})}function checkWindow(o){const{inputJSON:t,mode:e}=o;let a=""+o.filePath;t.themeLocation&&(a+=` or ${t.themeLocation}["${e}"]`);const n=[],{window:c}=t;c&&(void 0!==c.navigationBarBackgroundColor&&((0,tools_1.isHexColor)(c.navigationBarBackgroundColor)||n.push(`["window"]["navigationBarBackgroundColor"]: "${c.navigationBarBackgroundColor}" is not hexColor`)),void 0!==c.backgroundColor&&((0,tools_1.isHexColor)(c.backgroundColor)||n.push(`["window"]["backgroundColor"]: "${c.backgroundColor}" is not hexColor`)),n.length>0&&(0,common_2.throwError)({msg:n.join("\n"),filePath:a}))}function checkTabbar(o){const{project:t,miniprogramRoot:e,inputJSON:a,mode:n}=o;let c=""+o.filePath;a.themeLocation&&(c+=` or ${a.themeLocation}["${n}"]`);const{tabBar:i}=a,r=t.attrSync(),{setting:s}=r;if(!i)return;const l=[];i.list.length<s.MinTabbarCount&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_TABBAR_AT_LEAST.format(s.MinTabbarCount),filePath:c});const _=i.custom?s.MaxCustomTabbarCount:s.MaxTabbarCount;i.list.length>_&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_TABBAR_AT_MOST.format(_),filePath:c});for(let o=0;o<i.list.length;o++){const a=i.list[o],{pagePath:n}=a;if((0,common_2.checkPath)({value:n,tips:`["tabBar"]["list"][${o}]["pagePath"]`,filePath:c}),!n){l.push(locales_1.default.config.JSON_TABBAR_PATH_EMPTY.format(o));continue}n.indexOf("?")>=0&&l.push(locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format(`["tabBar"]["list"][${o}]["pagePath"]`,"?")),n.indexOf(".")>=0&&l.push(locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format(`["tabBar"]["list"][${o}]["pagePath"]`,"."));const r=i.list.slice(0,o).findIndex(o=>o.pagePath===n);r>=0&&l.push(locales_1.default.config.JSON_TABBAR_PATH_SAME_WITH_OTHER.format(o,r));const _=[];a.iconPath&&((0,common_2.checkPath)({value:a.iconPath,tips:`["tabBar"]["list"][${o}]["iconPath"]`,filePath:c,checkPathType:common_2.ECheckPathType.TAB_BAR_ICON}),_.push({name:"iconPath",path:a.iconPath})),a.selectedIconPath&&((0,common_2.checkPath)({value:a.selectedIconPath,tips:`["tabBar"]["list"][${o}]["selectedIconPath"]`,filePath:c,checkPathType:common_2.ECheckPathType.TAB_BAR_ICON}),_.push({name:"selectedIconPath",path:a.selectedIconPath})),_.forEach(a=>{const n=t.stat(e,a.path);if(!n)return void l.push(locales_1.default.config.NOT_FOUND.format(`["tabBar"]["list"][${o}]["${a.name}"]: "${a.path}"`));if(n.isDirectory)return void l.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(`["tabBar"]["list"][${o}]["${a.name}"]`,locales_1.default.config.FILE));n.size>1024*s.MaxTabbarIconSize&&l.push(locales_1.default.config.JSON_TABBAR_ICON_MAX_SIZE.format([o,a.name,s.MaxTabbarIconSize]));const c=path_1.default.posix.extname(a.path);config_1.TABBAR_ICON_WHITE_LIST.indexOf(c)<0&&l.push(locales_1.default.config.JSON_TABBAR_ICON_EXT.format([o,a.name,config_1.TABBAR_ICON_WHITE_LIST.join("、")]))})}l.length>0&&(0,common_2.throwError)({msg:l.join("\n"),filePath:c})}function checkWorkers(o){const{project:t,miniprogramRoot:e,filePath:a,inputJSON:n}=o,{workers:c}=n;if(void 0===c)return;const i='["workers"]';""===c&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(i,locales_1.default.config.DIRECTORY),filePath:a});const r=(0,tools_1.getWorkersPath)(c);(0,common_2.checkPath)({value:r,tips:i,filePath:a});const s=t.stat(e,r);s&&s.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([i,locales_1.default.config.DIRECTORY]),filePath:a}),"string"==typeof n.workers?n.workers=(0,tools_1.normalizePath)(n.workers+"/"):n.workers.path=(0,tools_1.normalizePath)(n.workers.path+"/")}function checkOpenLocationPagePath(o){const{filePath:t,inputJSON:e}=o,{openLocationPagePath:a}=e;if(void 0===a)return;const n='["openLocationPagePath"]';(0,common_2.checkPath)({value:a,tips:n,filePath:t}),checkPageExist(o,a,n)}exports.checkPageExist=checkPageExist,exports.checkWindow=checkWindow,exports.checkTabbar=checkTabbar,exports.checkWorkers=checkWorkers,exports.checkOpenLocationPagePath=checkOpenLocationPagePath;const checkMainPkgPages=o=>{const{filePath:t,inputJSON:e}=o,{pages:a}=e;if(!a)return;const n={};for(let e=0;e<a.length;e++){const c=a[e],i=`["pages"][${e}]`;(0,common_2.checkPath)({value:c,tips:i,filePath:t}),n[c]&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_PAGES_REPEAT.format(`"${c}"`,'["pages"]'),filePath:t}),n[c]=!0,checkPageExist(o,c,i)}};function checkSitemapLocation(o){const{filePath:t,inputJSON:e}=o,{sitemapLocation:a}=e;if(void 0===a)return;const{project:n,miniprogramRoot:c}=o,i='["sitemapLocation"]';(0,common_2.checkPath)({value:a,tips:i,filePath:t});const r=n.stat(c,a);r&&!r.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(i,a),filePath:t});".json"!==path_1.default.posix.extname(a)&&(0,common_2.throwError)({msg:locales_1.default.config.EXT_SHOULD_BE_ERROR.format(i,".json"),filePath:t});const s=n.getFile(c,a),l=(0,common_2.checkUTF8)(s,a),_=(0,common_1.checkJSONFormat)(l,a),f=(0,schemaValidate_1.schemaValidate)("sitemap",_);(0,schemaValidate_1.transValidateResult)(a,f)}function checkSubpackages(o){const{project:t,miniprogramRoot:e,filePath:a,inputJSON:n}=o;let c='["subPackages"]';n.subpackages&&(c='["subpackages"]',n.subPackages=n.subpackages,delete n.subpackages);const i=[];if(n.subPackages){const r=t.attrSync(),{setting:s}=r;n.subPackages.length>s.MaxSubPackageLimit&&(0,common_2.throwError)({msg:locales_1.default.config.EXCEED_LIMIT.format([c,s.MaxSubPackageLimit]),filePath:a});const l={},_={};for(let r=0;r<n.subPackages.length;r++){const s=n.subPackages[r],f=`${c}[${r}]`;if((0,common_2.checkPath)({value:s.root,tips:`${c}[${r}]["root"]`,filePath:a}),s.root===config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${c}[${r}]["root"]`,config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT));continue}if(s.name){if(s.name===config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${c}[${r}]["name"]`,config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT));continue}if(_[s.name]){i.push(locales_1.default.config.SAME_ITEM.format(f,_[s.name],"name"));continue}_[s.name]=f}if(s.root=(0,tools_1.normalizePath)(s.root+"/"),l[s.root]){i.push(locales_1.default.config.SAME_ITEM.format(f,l[s.root],"root"));continue}l[s.root]=f;const h=t.stat(e,s.root);if(!h){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([`${c}[${r}]["root"]`,locales_1.default.config.DIRECTORY]));continue}if(!h.isDirectory){i.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([`${c}[${r}]["root"]`,locales_1.default.config.DIRECTORY]));continue}const g={};for(let t=0,e=s.pages.length;t<e;t++){const e=s.pages[t];(0,common_2.checkPath)({value:e,tips:`${c}[${r}]["pages"][${t}]`,filePath:a});const n=(0,tools_1.normalizePath)(path_1.default.posix.join(s.root,e));g[n]?i.push(locales_1.default.config.JSON_PAGES_REPEAT.format([`"${e}"`,`${c}[${r}]`])):(g[n]=!0,checkPageExist(o,n,`${c}[${r}]["pages"][${t}]`))}}i.length>0&&(0,common_2.throwError)({msg:i.join("\n"),filePath:a});for(let o=0;o<n.subPackages.length;o++){const t=n.subPackages[o];let e=-1;const a="/"+t.root;n.subPackages.forEach((t,n)=>{if(n!==o&&t.root){const o="/"+t.root;a.startsWith(o)&&(e=n)}}),-1===e||i.push(locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format(`${c}[${e}]["root"]`,`${c}[${o}]["root"]`))}i.length>0&&(0,common_2.throwError)({msg:i.join("\n"),filePath:a})}}function checkPlugins(o){const{filePath:t,inputJSON:e,project:a}=o,n=[],c=e.plugins||{},i=(0,projectconfig_1.getProjectConfigJSON)(a),r=(null==i?void 0:i.pluginAppid)||a.appid;function s(o,t){const e=a.type===config_1.COMPILE_TYPE.miniProgramPlugin;if(e||"dev"!==o.version)if(e)"dev"===o.version&&o.provider!==r?n.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(t+'["provider"]',`"${r}"`)):o.provider===r&&"dev"!==o.version&&n.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(t+'["version"]','"dev"'));else{if("dev"===o.version||"latest"===o.version||/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/.test(o.version)||/^dev-[A-Za-z0-9]+$/.test(o.version))return!0;n.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([t+'["version"]',locales_1.default.config.TRIPLE_NUMBER_DOT]))}else n.push(`${locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(t+'["version"]',"dev")}\n${locales_1.default.config.PLEASE_CHOOSE_PLUGIN_MODE}`)}for(const o in c){s(c[o],`["plugins"]["${o}"]`)}e.subPackages&&e.subPackages.forEach((o,t)=>{if(!o.plugins)return;const e=`["subPackages"][${t}]`;for(const t in o.plugins){s(o.plugins[t],`${e}["plugins"]["${t}"]`)}}),n.length>0&&(0,common_2.throwError)({msg:n.join("\n"),filePath:t})}function checkNavigateToMiniProgramAppIdList(o){const{filePath:t,inputJSON:e,project:a}=o,n=[];if(e.navigateToMiniProgramAppIdList){const o=a.attrSync(),{appType:t=config_1.APP_TYPE.NORMAL,setting:c}=o;if(t!==config_1.APP_TYPE.NATIVE){const o=null==c?void 0:c.NavigateMiniprogramLimit;e.navigateToMiniProgramAppIdList.length>o&&n.push(locales_1.default.config.EXCEED_LIMIT.format('["navigateToMiniProgramAppIdList"]',o))}}n.length>0&&(0,common_2.throwError)({msg:n.join("\n"),filePath:t})}function checkFunctionalPages(o){const{inputJSON:t}=o;if(t.functionalPages&&"object"!==(0,tools_1.getType)(t.functionalPages)){const o='["functionalPages"] 配置需要更新,详见文档: https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages.html';t.__warning__?t.__warning__=`${t.__warning__}\n${o}`:t.__warning__=o}}function checkPreloadRule(o,t){const{inputJSON:e,filePath:a}=o,{preloadRule:n,subPackages:c}=e;if(!n||!c)return;const i=[],r={},s={},l={};t.forEach(o=>{r[o.root]=!0,l[o.path]=!0,o.name&&(s[o.name]=!0)});for(const o in n){if(!l[o]&&!o.includes("__plugin__/")){i.push(locales_1.default.config.NOT_FOUND.format(`["preloadRule"]["${o}"]: ${locales_1.default.config.PAGE_PATH}`));continue}const t=n[o];for(let e=0,a=t.packages.length;e<a;e++){let a=t.packages[e];a!==config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT&&(s[a]||(a=(0,tools_1.normalizePath)(a+"/"),r[a]||i.push(locales_1.default.config.NOT_FOUND.format(`["preloadRule"]["${o}"]["packages"][${e}]: ${a}`))))}}i.length>0&&(0,common_2.throwError)({msg:i.join("\n"),filePath:a})}function checkEntryPagePath(o,t){const{inputJSON:e,filePath:a}=o,{entryPagePath:n}=e;if(!n)return;(0,common_2.checkPath)({value:n,tips:'["entryPagePath"]',filePath:a});let c=!1;for(const o of t)if(o.path===n){c=!0;break}c||(0,common_2.throwError)({msg:locales_1.default.config.JSON_ENTRY_PAGE_PATH_NOT_FOUND.format(["pages、subPackages","entryPagePath"]),filePath:a})}function checkTabbarPage(o){const{filePath:t,inputJSON:e}=o,{tabBar:a,pages:n=[]}=e;if(!a)return;const c=[];for(let o=0;o<a.list.length;o++){const t=a.list[o],{pagePath:e}=t;n.indexOf(e)<0&&c.push(`["tabBar"][${o}]["pagePath"]: "${e}" need in ["pages"]`)}c.length>0&&(0,common_2.throwError)({msg:c.join("\n"),filePath:t})}function checkMainPkgPageIsInSubpkg(o){const{filePath:t,inputJSON:e}=o,{subPackages:a,pages:n=[]}=e;if(!a)return;const c=[];for(let o=0;o<a.length;o++){const t=a[o];for(let e=0;e<n.length;e++){const a=n[e];a.startsWith(t.root)&&c.push(locales_1.default.config.SHOULD_NOT_IN.format([`["pages"][${e}]: "${a}"`,`["subPackages"][${o}]`]))}}c.length>0&&(0,common_2.throwError)({msg:c.join("\n"),filePath:t})}function checkMainPkgPluginIsInSubPkg(o){const{filePath:t,inputJSON:e}=o,{plugins:a={},subPackages:n}=e,c={},i={},r=[];for(const o in a){const t=a[o],e=`["plugins"]["${o}"]`;c[t.provider]?r.push(locales_1.default.config.SAME_ITEM.format(`["plugins"]["${o}"]`,c[t.provider].tips,"provider")):c[t.provider]=i[o]={provider:t.provider,version:t.version,alias:o,tips:e}}if(n)for(let o=0;o<n.length;o++){const t=n[o];if(t.plugins)for(const e in t.plugins){const a=`["subPackages"][${o}]["plugins"]`,n=t.plugins[e];c[n.provider]?r.push(locales_1.default.config.SAME_ITEM.format(`${a}["${e}"]`,c[n.provider].tips,"provider")):i[e]?r.push(locales_1.default.config.PLUGINS_SAME_ALIAS.format(`${a}["${e}"]`,i[e].tips)):c[n.provider]=i[e]={provider:n.provider,version:n.version,alias:n,tips:a}}}r.length>0&&(0,common_2.throwError)({msg:r.join("\n"),filePath:t})}function checkComponentPath(o){const{project:t,miniprogramRoot:e,filePath:a,inputJSON:n}=o;(0,common_1.checkComponentPath)({project:t,root:e,relativePath:path_1.default.posix.relative(e,a),inputJSON:n})}function checkEntranceDeclare(o){const t=o.inputJSON;if(!t.entranceDeclare||!t.entranceDeclare.locationMessage)return;let e=t.pages||[];t.subpackages&&(e=e.concat(t.subpackages.map(o=>o.pages.map(t=>o.root+t))),e=lodash_1.default.flattenDeep(e)),t.subPackages&&(e=e.concat(t.subPackages.map(o=>o.pages.map(t=>o.root+t))),e=lodash_1.default.flattenDeep(e));const a=[],n=t.entranceDeclare.locationMessage.path;void 0===n?a.push(locales_1.default.config.JSON_ENTRANCE_DECLARE_PATH_EMPTY.format([])):e.includes(n)||a.push(locales_1.default.config.JSON_ENTRANCE_DECLARE_PATH_ERR.format([n||"undefined"])),a.length>0&&(0,common_2.throwError)({msg:a.join("\n"),filePath:o.filePath})}function getAppJSONVariableDecalearProperty(o){const{windowPropertWhiteList:t,tabBarPropertyWhiteList:e,tabbarListItemPropertyWhiteList:a}=config_1.jsonVariablePropertyWhiteList;let n=[];return"[object Object]"===Object.prototype.toString.call(o.window)&&(n=n.concat(Object.keys(o.window).filter(o=>t.includes(o)).map(t=>({property:`["window"]["${t}"]`,value:o.window[t]})).filter(o=>"string"==typeof o.value&&o.value.startsWith("@")))),"[object Object]"===Object.prototype.toString.call(o.tabBar)&&(n=n.concat(Object.keys(o.tabBar).filter(o=>e.includes(o)).map(t=>({property:`["tabBar"]["${t}"]`,value:o.tabBar[t]})).filter(o=>"string"==typeof o.value&&o.value.startsWith("@"))),Array.isArray(o.tabBar.list)&&o.tabBar.list.forEach((t,e)=>{n=n.concat(Object.keys(t).filter(o=>a.includes(o)).map(t=>({property:`["tabBar"]["list"][${e}]["${t}"]`,value:o.tabBar.list[e][t]})).filter(o=>"string"==typeof o.value&&o.value.startsWith("@")))})),n}function checkOpenDataContext(o,t){const{project:e,miniprogramRoot:a,filePath:n}=o,{openDataContext:c}=t;if(void 0===c)return;(0,common_2.checkPath)({value:c,tips:'["openDataContext"]',filePath:n});const i=e.stat(a,c);i&&i.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(['["openDataContext"]',locales_1.default.config.DIRECTORY]),filePath:n});const r=path_1.default.posix.join(c,"./index.js"),s=e.stat(a,r);s&&s.isFile||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["openDataContext"]',r),filePath:n}),t.openDataContext=(0,tools_1.normalizePath)(c+"/")}function checkRenderer(o){var t,e,a,n;const{filePath:c,inputJSON:i}=o,{renderer:r,lazyCodeLoading:s,rendererOptions:l}=i;if("skyline"===r&&"requiredComponents"!==s&&(0,common_2.throwError)({msg:locales_1.default.config.APP_JSON_SHOULD_SET_LAZYCODELOADING.format("app.json"),filePath:c}),"skyline"===r&&(void 0===l?(0,common_2.throwError)({msg:locales_1.default.config.JSON_SHOULD_SET_RENDEREROPTIONS.format("app.json"),filePath:c}):void 0===l.skyline&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_SHOULD_SET_RENDEREROPTIONS_SKYLINE.format("app.json"),filePath:c})),"skyline"===r||(null==l?void 0:l.skyline)){const o=(null===(t=i.window)||void 0===t?void 0:t.navigationBarTextStyle)||(null===(e=i.window)||void 0===e?void 0:e.navigationBarTitleText)||(null===(a=i.window)||void 0===a?void 0:a.navigationBarBackgroundColor),c="custom"===(null===(n=i.window)||void 0===n?void 0:n.navigationStyle);if(o&&!c){const o=locales_1.default.config.APP_JSON_SKYLINE_WINDOW_TIPS.format("");i.__warning__?i.__warning__=`${i.__warning__}\n${o}`:i.__warning__=o}}}function checkResolveAlias(o){const{filePath:t,inputJSON:e}=o,{resolveAlias:a}=e;if(a){const o=o=>o.includes("//");for(const e in a)(o(e)||o(a[e]))&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_RESOLVE_ALIAS_ILLEGAL.format(e,a[e]),filePath:t}),a[e].startsWith("./")&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_RESOLVE_ALIAS_SHOULD_NOT_START_WITH.format(a[e]),filePath:t}),e.endsWith("/*")&&a[e].endsWith("/*")||(0,common_2.throwError)({msg:locales_1.default.config.JSON_RESOLVE_ALIAS_INCLUDE_STAR.format(e,a[e]),filePath:t})}}exports.checkMainPkgPages=checkMainPkgPages,exports.checkSitemapLocation=checkSitemapLocation,exports.checkSubpackages=checkSubpackages,exports.checkPlugins=checkPlugins,exports.checkNavigateToMiniProgramAppIdList=checkNavigateToMiniProgramAppIdList,exports.checkFunctionalPages=checkFunctionalPages,exports.checkPreloadRule=checkPreloadRule,exports.checkEntryPagePath=checkEntryPagePath,exports.checkTabbarPage=checkTabbarPage,exports.checkMainPkgPageIsInSubpkg=checkMainPkgPageIsInSubpkg,exports.checkMainPkgPluginIsInSubPkg=checkMainPkgPluginIsInSubPkg,exports.checkComponentPath=checkComponentPath,exports.checkEntranceDeclare=checkEntranceDeclare,exports.getAppJSONVariableDecalearProperty=getAppJSONVariableDecalearProperty,exports.checkOpenDataContext=checkOpenDataContext,exports.checkRenderer=checkRenderer,exports.checkResolveAlias=checkResolveAlias;const detailLocationApis={getLocation:!0,onLocationChange:!0,startLocationUpdate:!0,startLocationUpdateBackground:!0};function checkRequiredPrivateInfos(o){const{filePath:t,inputJSON:e}=o,{requiredPrivateInfos:a}=e;if(a){if(a.indexOf("getFuzzyLocation")>=0){const o=[];for(let t=0;t<a.length;t++){const e=a[t];detailLocationApis[e]&&o.push(`'${e}'`)}o.length>0&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_REQUIRED_PRIVATE_INFOS_MUTUALLY_EXCLUSIVE.format("'getFuzzyLocation'",o.join("、")),filePath:t})}}}function checkAccountCardPackage(o){const{project:t,filePath:e,inputJSON:a,miniprogramRoot:n}=o,{accountCardPackage:c}=a;if(c){c.root=(0,tools_1.normalizePath)(c.root+"/");const o=a.subPackages||a.subpackages||[];console.log("subPackages",o),o.find(o=>o.root===c.root&&o.independent)||(0,common_2.throwError)({msg:locales_1.default.config.ACCOUNT_CARD_PACKAPGE_IN_VALID.format(),filePath:e});for(const o of c.cardList){const{componentPath:a}=o,i=path_1.default.posix.join(c.root,a+".js");t.stat(n,path_1.default.posix.join(c.root,a+".js"))||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["accountCardPackage"]',i),code:config_1.FILE_NOT_FOUND,filePath:e})}}}exports.checkRequiredPrivateInfos=checkRequiredPrivateInfos,exports.checkAccountCardPackage=checkAccountCardPackage;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getExtJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=require("lodash"),cache_1=require("../../../../../utils/cache"),common_1=require("../common"),common_2=require("../../../../../utils/common"),tools_1=require("../../../../../utils/tools"),projectconfig_1=require("../projectconfig"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),schemaValidate_1=require("../../validate/schemaValidate"),theme_1=require("../theme"),reactiveCache_1=require("../reactiveCache"),checkAppFields_1=require("./checkAppFields");function checkExtPages(e){const{project:o,inputJSON:t,filePath:c,miniprogramRoot:a}=e,{extPages:i}=t;if(i)for(const e in i){const t=i[e];if(t){t.navigationBarBackgroundColor&&!(0,tools_1.isHexColor)(t.navigationBarBackgroundColor)&&(0,common_2.throwError)({msg:`["extPages"]["${e}"]["navigationBarBackgroundColor"]: "${t.navigationBarBackgroundColor}" is not hexColor`,filePath:c}),t.backgroundColor&&!(0,tools_1.isHexColor)(t.backgroundColor)&&(0,common_2.throwError)({msg:`["extPages"]["${e}"]["backgroundColor"]: "${t.backgroundColor}" is not hexColor`,filePath:c});try{(0,checkAppFields_1.checkComponentPath)({project:o,miniprogramRoot:a,inputJSON:t,filePath:e+".json"})}catch(o){(0,common_2.throwError)({msg:`["extPages"]["${e}"]${o.message}`,filePath:c})}}}}exports.getExtJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.EXT_JSON,e=>{const o=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:t=""}=o,c=e.attrSync(),a=(0,tools_1.normalizePath)(path_1.default.posix.join(t,"ext.json"));if(!e.exists(a))return;if(!c||!c.platform)return e.stat(t,"ext.json")?{__warning__:locales_1.default.config.EXT_JSON_INVALID.format(e.appid,"https://developers.weixin.qq.com/miniprogram/dev/devtools/ext.html")}:void 0;if(!e.stat(t,"ext.json"))return;const i=e.getFile(t,"ext.json"),r=(0,common_1.checkJSONFormat)((0,common_2.checkUTF8)(i,a),a);if(!r.extEnable)return{};const n=(0,theme_1.getThemeLocation)(e);let s={};n&&(s=(0,theme_1.checkThemeJSON)(e,{themeLocation:n}));const l=(0,theme_1.mergeThemeJSONToAppJSON)(s,r),h=(0,schemaValidate_1.schemaValidate)("ext",l.appJSONLight),p=(0,schemaValidate_1.schemaValidate)("ext",l.appJSONDark);h.warning&&(r.__warning__=locales_1.default.config.INVALID.format(h.warning)),p.warning&&(r.__warning__=locales_1.default.config.INVALID.format(p.warning)),(0,schemaValidate_1.transValidateResult)(a,h),(0,schemaValidate_1.transValidateResult)(a,p),r.extAppid||(0,common_2.throwError)({msg:""+locales_1.default.config.EXT_APPID_SHOULD_NOT_BE_EMPTY,filePath:a});const _={filePath:a,project:e,miniprogramRoot:t,inputJSON:r},m=(0,lodash_1.cloneDeep)(_);m.inputJSON=l.appJSONLight,m.mode="light";const g=(0,lodash_1.cloneDeep)(_);return g.inputJSON=l.appJSONDark,g.mode="dark",(0,checkAppFields_1.checkMainPkgPages)(_),(0,checkAppFields_1.checkMainPkgPages)(_),(0,checkAppFields_1.checkSubpackages)(_),(0,checkAppFields_1.checkTabbar)(m),(0,checkAppFields_1.checkTabbar)(g),(0,checkAppFields_1.checkWorkers)(_),(0,checkAppFields_1.checkFunctionalPages)(_),(0,checkAppFields_1.checkOpenLocationPagePath)(_),(0,checkAppFields_1.checkPlugins)(_),(0,checkAppFields_1.checkWindow)(m),(0,checkAppFields_1.checkWindow)(g),(0,checkAppFields_1.checkComponentPath)(_),checkExtPages(_),r});
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getExtJSON=exports.getAppJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=require("lodash"),cache_1=require("../../../../../utils/cache"),projectconfig_1=require("../projectconfig"),common_1=require("../../../../../utils/common"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),theme_1=require("../theme"),reactiveCache_1=require("../reactiveCache"),tools_1=require("../../../../../utils/tools"),appJSON_1=require("./appJSON"),extJSON_1=require("./extJSON");function mergeExtJSON(e,t){if(t)for(const o in t)if("__warning__"!==o){if("extPages"!==o){if("plugins"===o||"supportedMaterials"===o){e[o]=t[o];continue}"object"===(0,tools_1.getType)(t[o])?"object"!==(0,tools_1.getType)(e[o])?e[o]=Object.assign({},t[o]):e[o]=Object.assign({},e[o]||{},t[o]):e[o]=t[o]}}else e.__warning__=e.__warning__?`${e.__warning__}、${t.__warning__}`:t.__warning__}exports.getAppJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.COMPILED_APP_JSON,e=>{const t=(0,projectconfig_1.getProjectConfigJSON)(e),{miniprogramRoot:o=""}=t;let r=(0,appJSON_1.getAppJSON)(e);const i=(0,extJSON_1.getExtJSON)(e);if(i&&(r=(0,lodash_1.cloneDeep)(r),mergeExtJSON(r,i),i.extEnable))try{const t=(0,theme_1.getThemeLocation)(e);let i={};t&&(i=(0,theme_1.checkThemeJSON)(e,{themeLocation:t}));const _=(0,theme_1.mergeThemeJSONToAppJSON)(i,r);(0,appJSON_1.checkAppJSON)({project:e,miniprogramRoot:o,inputJSON:_.appJSONLight,filePath:path_1.default.posix.join(o,"app.json")}),(0,appJSON_1.checkAppJSON)({project:e,miniprogramRoot:o,inputJSON:_.appJSONDark,filePath:path_1.default.posix.join(o,"app.json")})}catch(e){(0,common_1.throwError)({msg:e.message,code:e.code,filePath:`app.json ${locales_1.default.config.OR} ext.json`})}return r});var extJSON_2=require("./extJSON");Object.defineProperty(exports,"getExtJSON",{enumerable:!0,get:function(){return extJSON_2.getExtJSON}});
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPageJSONVariableDecalearProperty=exports.checkComponentPath=exports.getUseExtendLib=exports.checkFilePathIsInIndependentSubpackage=exports.checkPagePathIsInIndependentSubpackage=exports.checkPagePathIsInSubPackage=exports.checkJSONFormat=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=require("lodash"),tools_1=require("../../../../utils/tools"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),common_1=require("../../../../utils/common"),config_1=require("../../../../config/config"),appJSON_1=require("./app/appJSON");function checkJSONFormat(e,t){let o={};e||(0,common_1.throwError)({filePath:t,msg:"Empty file is NOT a valid json file",code:config_1.JSON_PARSE_ERR});try{o=JSON.parse(e)}catch(o){const n=(0,tools_1.formatJSONParseErr)({filePath:t,data:e,error:o});(0,common_1.throwError)({filePath:t,msg:n,code:config_1.JSON_PARSE_ERR})}return o}function checkPagePathIsInSubPackage(e,t){const{subPackages:o,subpackages:n}=e;if(o||n)for(const e of o||n)if(t.startsWith(e.root))return e}function checkPagePathIsInIndependentSubpackage(e,t){const o=checkPagePathIsInSubPackage(e,t);if(o&&!0===o.independent)return o}function checkFilePathIsInIndependentSubpackage(e,t){const{subPackages:o}=e;if(o)for(const e of o)if(!0===e.independent){const o=e.root.replace(/^\//,"");if(t.startsWith(o))return o}}function checkNodeModulesFile2(e,t,o){var n,a;for(const i of o){const o=i+".json",r=i+".wxml";if((null===(n=e.stat(t,o))||void 0===n?void 0:n.isFile)&&(null===(a=e.stat(t,r))||void 0===a?void 0:a.isFile))return i}return""}function resolveComponentPath2(e,t,o,n){n=(0,tools_1.normalizePath)(n);const a=[path_1.default.posix.join(o,n),path_1.default.posix.join(o,n,"index")];let i=o.split(path_1.default.posix.sep);for(i=i.filter(e=>!!e);i.length;){const e=[path_1.default.posix.join(i.join(path_1.default.posix.sep),"miniprogram_npm",n),path_1.default.posix.join(i.join(path_1.default.posix.sep),"miniprogram_npm",n,"index")];a.push(...e),i.pop()}const r=[path_1.default.posix.join("miniprogram_npm",n),path_1.default.posix.join("miniprogram_npm",n,"index")];a.push(...r);const s=checkNodeModulesFile2(e,t,a);return s?{searchedPaths:a,requirePath:path_1.default.posix.relative(o,s)}:{searchedPaths:a,requirePath:""}}exports.checkJSONFormat=checkJSONFormat,exports.checkPagePathIsInSubPackage=checkPagePathIsInSubPackage,exports.checkPagePathIsInIndependentSubpackage=checkPagePathIsInIndependentSubpackage,exports.checkFilePathIsInIndependentSubpackage=checkFilePathIsInIndependentSubpackage;const innerCheckComponentPath=e=>{const{value:t,tips:o,project:n,root:a,relativePath:i}=e,r=`${o}: "${t}"`,s=path_1.default.posix.join(a,i);if(t.startsWith("plugin://")||t.startsWith("plugin-private://"))return t;const c=e=>n.stat(a,e+".json")&&n.stat(a,e+".wxml"),p=(0,exports.getUseExtendLib)(n,i);if(t.startsWith("/")){if(p.length){const e=p.map(e=>"/miniprogram_npm/"+e);let o=!1;for(const n of e)if(t.startsWith(n)){o=!0;break}if(o)return t}if(c(t))return t;if(c(t+"/index"))return t+"/index";(0,common_1.throwError)({msg:locales_1.default.config.COMPONENT_NOT_FOUND.format(r,path_1.default.posix.join(n.projectPath,a,t)),filePath:s})}if(t.startsWith(".")){if(t.startsWith("../")){const e=t.replace(/^(\.\.\/)+/,"");if(c("/"+e))return t;if(c(`/${e}/index`))return t+"/index"}if(c(path_1.default.posix.join(path_1.default.posix.dirname(i),""+t)))return t;if(c(path_1.default.posix.join(path_1.default.posix.dirname(i),t+"/index")))return t+"/index";(0,common_1.throwError)({msg:locales_1.default.config.COMPONENT_NOT_FOUND.format(r,path_1.default.posix.join(n.projectPath,a,path_1.default.posix.dirname(i),t)),filePath:s})}for(const e of p)if(t.startsWith(e))return"miniprogram-element"===e?`/miniprogram_npm/${e}/index`:t.replace(e,"/miniprogram_npm/"+e);const l=resolveComponentPath2(n,a,path_1.default.posix.dirname(i),t);l.requirePath||(0,common_1.throwError)({msg:locales_1.default.config.COMPONENT_NOT_FOUND.format(r,l.searchedPaths.map(e=>path_1.default.posix.join(n.projectPath,a,e)).join("\n")),filePath:s});const h=l.requirePath||"";return h.startsWith(".")?h:"./"+h},getUseExtendLib=(e,t)=>{var o;const n=(0,appJSON_1.getRawAppJSON)(e);let a=[];if("[object Object]"===Object.prototype.toString.call(n.useExtendedLib)){const e=Object.keys(config_1.extendedLibMap),t=Object.keys(n.useExtendedLib).filter(t=>!e.includes(t));t.length&&(0,common_1.throwError)({msg:t.join(", ")+' is not allowed in ["useExtendedLib"]',filePath:"app.json"}),a=Object.keys(n.useExtendedLib||{}).filter(e=>n.useExtendedLib[e]).map(e=>config_1.extendedLibMap[e].packages),a=(0,lodash_1.flattenDeep)(a)}const i=checkPagePathIsInSubPackage(n,t);if((null==i?void 0:i.useExtendedLib)&&"[object Object]"===Object.prototype.toString.call(i.useExtendedLib)){const e=Object.keys(config_1.extendedLibMap),t=Object.keys(i.useExtendedLib).filter(t=>!e.includes(t));t.length&&(0,common_1.throwError)({msg:`${t.join(", ")} is not allowed in subPackages[${null===(o=n.subPackages)||void 0===o?void 0:o.indexOf(i)}]["useExtendedLib"]`,filePath:"app.json"});const r=Object.keys(i.useExtendedLib||{}).filter(e=>i.useExtendedLib[e]).map(e=>config_1.extendedLibMap[e].packages);a=(0,lodash_1.uniq)(a.concat((0,lodash_1.flattenDeep)(r)))}return a};exports.getUseExtendLib=getUseExtendLib;const checkComponentPath=e=>{const{project:t,root:o,relativePath:n,inputJSON:a}=e,{usingComponents:i,componentGenerics:r}=a;if(i)for(const e in i){const a=i[e]||"";i[e]=innerCheckComponentPath({tips:`["usingComponents"]["${e}"]`,value:a,project:t,root:o,relativePath:n})}if(r)for(const e in r){const a="object"==typeof r[e],i=a?r[e].default:r[e];if(!i||"string"!=typeof i)continue;const s=innerCheckComponentPath({tips:`["componentGenerics"]["${e}"]`,value:i,project:t,root:o,relativePath:n});a?r[e].default=s:r[e]=s}};function getPageJSONVariableDecalearProperty(e){const{windowPropertWhiteList:t}=config_1.jsonVariablePropertyWhiteList;let o=[];return"[object Object]"===Object.prototype.toString.call(e)&&(o=o.concat(Object.keys(e).filter(e=>t.includes(e)).map(t=>({property:`["${t}"]`,value:e[t]})).filter(e=>e.value.startsWith("@")))),o}exports.checkComponentPath=checkComponentPath,exports.getPageJSONVariableDecalearProperty=getPageJSONVariableDecalearProperty;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),cache_1=require("../../../../utils/cache"),common_1=require("../../../../utils/common"),config_1=require("../../../../config/config"),tools_1=require("../../../../utils/tools"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),schemaValidate_1=require("../validate/schemaValidate"),signaturejson_1=tslib_1.__importDefault(require("../validate/signaturejson")),gamepluginjson_1=tslib_1.__importDefault(require("../validate/gamepluginjson")),projectconfig_1=require("./projectconfig"),common_2=require("./common"),reactiveCache_1=require("./reactiveCache");function isPluginMode(o){return o.type===config_1.COMPILE_TYPE.miniGamePlugin}function checkLocalPlugin(o,t){const{project:e,root:a,filePath:i}=o,r=t.path;let n=e.stat(a,r);n&&n.isDirectory||(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(t.tips+'["path"]',locales_1.default.config.DIRECTORY),filePath:i});const s=path_1.default.posix.join(r,"signature.json");n=e.stat(a,s);let c=(0,tools_1.normalizePath)(path_1.default.posix.join(a,s));n||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(t.tips+'["path"]',c),filePath:i,code:config_1.FILE_NOT_FOUND});let _=e.getFile(a,s),l=(0,common_1.checkUTF8)(_,c);const f=(0,common_2.checkJSONFormat)(l,c);try{signaturejson_1.default.check(f)}catch(o){(0,common_1.throwError)({msg:"signature.json"+o.message,filePath:c})}f.provider!==t.provider&&(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format('["provider"]',`"${t.provider}"`),filePath:c});for(let o=0;o<f.signature.length;o++){const t=f.signature[o];(0,common_1.checkPath)({value:t.path,tips:`["signature"][${o}]["path"]`,filePath:c});const i=path_1.default.posix.join(r,t.path);n=e.stat(a,i),n&&n.isFile||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["signature"][${o}]["path"]`,i),filePath:c,code:config_1.FILE_NOT_FOUND});const s=e.getFile(a,i),_=(0,tools_1.generateMD5)(s);_!==t.md5&&(0,common_1.throwError)({msg:locales_1.default.config.GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT.format(path_1.default.posix.join(r,t.path),_,t.md5),code:config_1.GAME_PLUGIN_LIB_MD5_NOT_MATCH,filePath:c})}const u=path_1.default.posix.join(r,"plugin.json");n=e.stat(a,u),c=(0,tools_1.normalizePath)(path_1.default.posix.join(a,u)),n||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(t.tips+'["path"]',c),code:config_1.FILE_NOT_FOUND,filePath:i}),_=e.getFile(a,u),l=(0,common_1.checkUTF8)(_,c);const h=(0,common_2.checkJSONFormat)(l,c);try{gamepluginjson_1.default.check(h)}catch(o){(0,common_1.throwError)({msg:"plugin.json"+o.message,filePath:c})}h.main&&((0,common_1.checkPath)({value:h.main,tips:'["main"]',filePath:c}),n=e.stat(a,path_1.default.posix.join(r,h.main)),n||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["main"]',""+h.main),filePath:c,code:config_1.FILE_NOT_FOUND}))}function checkPluginPath(o,t){const{subPackages:e}=t,a=[],i=(o,t,e)=>{const{plugins:i}=o;if(i)for(const o in i){if(!i.hasOwnProperty(o))continue;const r=i[o];r&&r.path&&a.push({alias:o,version:r.version||"",provider:r.provider||"",tips:`${e}["plugins"]["${o}"]`,path:(0,tools_1.normalizePath)(path_1.default.posix.join(t,r.path))})}};if(i(t,"",""),e)for(let o=0;o<e.length;o++){const t=e[o];i(t,t.root||"",`["subPackages"][${o}]`)}if(!(a.length<=0))for(const t of a)checkLocalPlugin(o,t)}function checkPlugins(o,t){const{project:e,filePath:a}=o,i=[],r=t.plugins||{};function n(o,t){const{appid:r}=e,n=isPluginMode(e);if(n||"dev"!==o.version)if(n&&"dev"===o.version&&o.provider!==r)i.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(t+'["provider"]',r));else if("dev"!==o.version||"string"!=typeof o.path){if("dev"===o.version||"latest"===o.version||/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/.test(o.version)||/^dev-[A-Za-z0-9]+$/.test(o.version))return o.path&&(0,common_1.checkPath)({value:o.path,tips:t+'["path"]',filePath:a}),!0;i.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(t+'["version"]',locales_1.default.config.TRIPLE_NUMBER_DOT))}else i.push(locales_1.default.config.GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH.format(t,t+'["path"]'));else i.push(`${locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(t+'["version"]',"dev")}\n${locales_1.default.config.PLEASE_CHOOSE_PLUGIN_MODE}`)}const s={},c={};for(const o in r){if(!r.hasOwnProperty(o))continue;const t=r[o];n(t,`["plugins"]["${o}"]`)&&(s[t.provider]?i.push(locales_1.default.config.SAME_ITEM.format(`["plugins"]["${o}"]`,s[t.provider].tips,"provider")):s[t.provider]=c[o]={provider:t.provider,version:t.version,alias:o,path:t.path||"",tips:`["plugins"]["${o}"]`})}const _=t.subPackages||t.subpackages;if(Array.isArray(_))for(let o=0,t=_.length;o<t;o++){const t=_[o];if(!t.plugins)continue;const e=`["subPackages"][${o}]["plugins"]`;for(const o in t.plugins){const a=t.plugins[o],r=`${e}["${o}"]`;n(a,r)&&(s[a.provider]?i.push(locales_1.default.config.SAME_ITEM.format(r,s[a.provider].tips,"provider")):c[o]?i.push(locales_1.default.config.PLUGINS_SAME_ALIAS.format(r,c[o].tips)):s[a.provider]=c[o]={provider:a.provider,version:a.version,alias:o,path:a.path||"",tips:r})}}i.length>0&&(0,common_1.throwError)({msg:i.join("\n"),filePath:a})}function checkSubpackages(o,t){const{root:e,project:a,filePath:i}=o,r=[];let n='["subPackages"]';if(t.subpackages&&(n='["subpackages"]',t.subPackages=t.subpackages,delete t.subpackages),t.subPackages){const o=a.attrSync(),{setting:s}=o;t.subPackages.length>s.MaxSubPackageLimit&&(0,common_1.throwError)({msg:locales_1.default.config.EXCEED_LIMIT.format([n,s.MaxSubPackageLimit]),filePath:i});const c={},_={};for(let o=0,i=t.subPackages.length;o<i;o++){const i=t.subPackages[o];if(i.name){if(i.name===config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["name"]`,config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT));continue}if(i.name===config_1.MINI_GAME_MAIN_PACKAGE_ROOT){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["name"]`,config_1.MINI_GAME_MAIN_PACKAGE_ROOT));continue}c[i.name]&&r.push(locales_1.default.config.SAME_ITEM.format(`${n}[${o}]`,c[i.name],"name")),c[i.name]=`${n}[${o}]`}if(i.root===config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["root"]`,config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT));continue}if(i.root===config_1.MINI_GAME_MAIN_PACKAGE_ROOT){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["root"]`,config_1.MINI_GAME_MAIN_PACKAGE_ROOT));continue}if(i.root===config_1.MINI_GAME_WORKERS_PACKAGE_ROOT){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["root"]`,config_1.MINI_GAME_WORKERS_PACKAGE_ROOT));continue}if(i.root==="/"+config_1.MINI_GAME_WORKERS_PACKAGE_ROOT){r.push(locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format(`${n}[${o}]["root"]`,"/"+config_1.MINI_GAME_WORKERS_PACKAGE_ROOT));continue}if(i.root.startsWith(".")){r.push(locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format(`${n}[${o}]["root"]`,"."));continue}if(i.root.startsWith("__wx__")){r.push(locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format(`${n}[${o}]["root"]`,"__wx__"));continue}i.root.startsWith("/")||(i.root=(0,tools_1.normalizePath)("/"+i.root)),i.root.endsWith(".js")?i.root=(0,tools_1.normalizePath)(i.root):i.root=(0,tools_1.normalizePath)(i.root+"/"),_[i.root]&&r.push(locales_1.default.config.SAME_ITEM.format(`${n}[${o}]`,_[i.root],"root")),_[i.root]=`${n}[${o}]`;const s=a.stat(e,i.root);if(s){if(s.isDirectory){i.root.endsWith("/")||(i.root+="/");const t=path_1.default.posix.join(i.root,"./game.js"),s=a.stat(e,t);s&&s.isFile||r.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`${n}[${o}]["root"]`,t))}}else r.push(locales_1.default.config.JSON_CONTENT_NOT_FOUND.format(`${n}[${o}]["root"]`))}}r.length>0&&(0,common_1.throwError)({msg:r.join("\n"),filePath:i})}function checkLoadingImageUrl(o,t){const{project:e,root:a,filePath:i}=o,{loadingImageInfo:r}=t;if(!r)return;(0,common_1.checkPath)({tips:'["loadingImageInfo"]["path"]',value:r.path,filePath:i});const n=e.stat(a,r.path);n&&n.isFile||(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_NOT_FOUND.format(`["loadingImageInfo"]["path"]: "${r.path}"`),filePath:i}),r.progressBarColor&&!(0,tools_1.isHexColor)(r.progressBarColor)&&(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(`["loadingImageInfo"]["progressBarColor"]: "${r.progressBarColor}"`,"HexColor"),filePath:i})}function checkWorkers(o,t){const{project:e,root:a,filePath:i}=o,{workers:r}=t;if(void 0===r)return;const n=(0,tools_1.getWorkersPath)(r);(0,common_1.checkPath)({tips:'["workers"]',value:n,filePath:i});const s=e.stat(a,n);s&&!s.isFile||(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(['["workers"]',locales_1.default.config.DIRECTORY]),filePath:i})}function checkOpenDataContext(o,t){const{project:e,root:a,filePath:i}=o,{openDataContext:r}=t;if(void 0===r)return;(0,common_1.checkPath)({value:r,tips:'["openDataContext"]',filePath:i});const n=e.stat(a,r);n&&n.isDirectory||(0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(['["openDataContext"]',locales_1.default.config.DIRECTORY]),filePath:i});const s=path_1.default.posix.join(r,"./index.js"),c=e.stat(a,s);c&&c.isFile||(0,common_1.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["openDataContext"]',s),filePath:i}),t.openDataContext=(0,tools_1.normalizePath)(r+"/")}function checkGameJSON(o){const{project:t,root:e,filePath:a}=o;t.stat(e,"game.json")||(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_FOUND.format(path_1.default.posix.join(a)),filePath:a,code:config_1.FILE_NOT_FOUND});const i=t.getFile(e,"game.json"),r=(0,common_2.checkJSONFormat)((0,common_1.checkUTF8)(i,a),a),n=(0,schemaValidate_1.schemaValidate)("game",r);return n.warning&&(r.__warning__=locales_1.default.config.INVALID.format(n.warning)),(0,schemaValidate_1.transValidateResult)(a,n),checkOpenDataContext(o,r),checkPlugins(o,r),checkSubpackages(o,r),checkPluginPath(o,r),checkLoadingImageUrl(o,r),checkWorkers(o,r),r}const getGameJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.GAME_JSON,o=>{const t=(0,projectconfig_1.getProjectConfigJSON)(o).miniprogramRoot||"";return checkGameJSON({project:o,root:t,filePath:(0,tools_1.normalizePath)(path_1.default.posix.join(t,"game.json"))})});exports.default=getGameJSON;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkPageJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),common_1=require("../common"),schemaValidate_1=require("../../validate/schemaValidate"),tools_1=require("../../../../../utils/tools"),common_2=require("../../../../../utils/common"),theme_1=require("../theme"),checkHexColor=e=>{const{inputJSON:a,mode:o,pagePath:t,themeLocation:r}=e;let i=t+".json";if(a){r&&(i=`${t}.json or ${r}["${o}"]`);const{navigationBarBackgroundColor:e,backgroundColor:l}=a;void 0===e||(0,tools_1.isHexColor)(e)||(0,common_2.throwError)({msg:`["navigationBarBackgroundColor"]: "${e}" is not hexColor`,filePath:i}),void 0===l||(0,tools_1.isHexColor)(l)||(0,common_2.throwError)({msg:`["backgroundColor"]: "${l}" is not hexColor`,filePath:i})}};function checkPageJSON(e,a){const{pagePath:o,miniprogramRoot:t=""}=a,r=(0,tools_1.normalizePath)(path_1.default.posix.join(t,o+".json"));if(!e.stat("",r))return{};const i=e.getFile("",r),l=(0,common_1.checkJSONFormat)((0,common_2.checkUTF8)(i,r),r),n=(0,theme_1.getThemeLocation)(e);if(!n){const e=(0,common_1.getPageJSONVariableDecalearProperty)(l);e.length&&(0,common_2.throwError)({msg:'["themeLocation"] is required because:\n'+e.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}`).join("\n"),filePath:r})}let c={light:{},dark:{}};n&&(c=(0,theme_1.checkThemeJSON)(e,{themeLocation:n}));const m=(0,theme_1.mergeThemeJSONToPageJSON)(c,l,r),s=(0,schemaValidate_1.schemaValidate)("page",m.pageJSONLight),h=(0,schemaValidate_1.schemaValidate)("page",m.pageJSONDark),g=(0,common_1.getPageJSONVariableDecalearProperty)(m.pageJSONLight);g.length&&(0,common_2.throwError)({msg:g.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}, but not found at ${n}["light"]`).join("\n"),filePath:r});const _=(0,common_1.getPageJSONVariableDecalearProperty)(m.pageJSONDark);return _.length&&(0,common_2.throwError)({msg:_.map(e=>`"${e.value}" as variable was declared at ${r}:${e.property}, but not found at ${n}["dark"]`).join("\n"),filePath:r}),s.warning&&(l.__warning__=locales_1.default.config.INVALID.format(s.warning)),n&&h.warning&&(l.__warning__=locales_1.default.config.INVALID.format(h.warning)),(0,schemaValidate_1.transValidateResult)(n?`${r} or ${n}["light"]`:r,s),n&&(0,schemaValidate_1.transValidateResult)(`${r} or ${n}["dark"]`,h),checkHexColor({inputJSON:m.pageJSONLight,mode:"light",themeLocation:n||"",filePath:r,pagePath:o}),checkHexColor({inputJSON:m.pageJSONDark,mode:"dark",themeLocation:n||"",filePath:r,pagePath:o}),l}exports.checkPageJSON=checkPageJSON;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPageJSONWithDisableSpreading=exports.getPageJSON=exports.originGetPageJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=require("lodash"),extJSON_1=require("../app/extJSON"),app_1=require("../app"),tools_1=require("../../../../../utils/tools"),common_1=require("../common"),common_2=require("../../../../../utils/common"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),reactiveCache_1=require("../reactiveCache"),checkPageJSON_1=require("./checkPageJSON"),spreadUsingComponent=e=>{const{project:o,pagePath:t,inputJSON:n}=e;if(t.includes("miniprogram_npm"))return;const a=(0,app_1.getAppJSON)(o);if((0,common_1.checkPagePathIsInIndependentSubpackage)(a,t))return;if(a.componentPlaceholder){n.componentPlaceholder=n.componentPlaceholder||{};for(const e in a.componentPlaceholder)n.componentPlaceholder[e]=n.componentPlaceholder[e]||a.componentPlaceholder[e]}const i=Object.assign({},a.usingComponents);if(0!==Object.keys(i).length){n.usingComponents||(n.usingComponents={});for(const e in i){if(n.usingComponents[e])continue;const o=i[e]||"";if(o.startsWith("/")||o.startsWith("plugin://")){n.usingComponents[e]=o;continue}const a=(0,tools_1.normalizePath)(path_1.default.posix.relative(path_1.default.posix.dirname(t),o));n.usingComponents[e]=a.startsWith(".")?a:"./"+a}}},mergeExtJSON=e=>{var o;const{project:t,inputJSON:n,pagePath:a}=e,i=(0,extJSON_1.getExtJSON)(t);(null===(o=null==i?void 0:i.extPages)||void 0===o?void 0:o[a])&&Object.assign(n,i.extPages[a])},checkComponentPath=e=>{const{project:o,miniprogramRoot:t,pagePath:n,inputJSON:a}=e;(0,common_1.checkComponentPath)({project:o,root:t,relativePath:n+".json",inputJSON:a})},checkComponentGenerics=e=>{const{pagePath:o,inputJSON:t}=e,n=o+".json";if(!t.componentGenerics)return;const a=[];for(const e in t.componentGenerics){const o=t.componentGenerics[e],n=(0,tools_1.getType)(o);"boolean"===n||"object"===n?"object"===n&&"string"!==(0,tools_1.getType)(o.default)&&a.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([`["componentGenerics"]["${e}"]["default"]`,"string"])):a.push(locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([`["componentGenerics"]["${e}"]`,"boolean/object"]))}a.length>0&&(0,common_2.throwError)({msg:a.join("\n"),filePath:n})};function checkRenderer(e){var o,t;const{filePath:n,inputJSON:a}=e,{renderer:i}=a,r=(0,app_1.getAppJSON)(e.project);if((0,common_2.getAllPages)(r).includes(e.pagePath)&&("skyline"===i&&("requiredComponents"!==r.lazyCodeLoading&&(0,common_2.throwError)({msg:locales_1.default.config.APP_JSON_SHOULD_SET_LAZYCODELOADING.format(n),filePath:n}),(null===(o=r.rendererOptions)||void 0===o?void 0:o.skyline)||(0,common_2.throwError)({msg:locales_1.default.config.APP_JSON_SHOULD_SET_RENDEREROPTIONS.format(n),filePath:n})),"skyline"===i||"skyline"===r.renderer&&void 0===i)){!1===a.disableScroll&&(0,common_2.throwError)({msg:locales_1.default.config.PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE.format(n),filePath:n}),"default"===a.navigationStyle&&(0,common_2.throwError)({msg:locales_1.default.config.PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM.format(n),filePath:n});!(a.navigationStyle?"custom"===a.navigationStyle:"custom"===(null===(t=r.window)||void 0===t?void 0:t.navigationStyle))&&(a.navigationBarTitleText||a.navigationBarTextStyle||a.navigationBarBackgroundColor)&&(0,common_2.throwError)({msg:locales_1.default.config.PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM.format(n),filePath:n}),a.disableScroll=!0,a.navigationStyle="custom"}}function checkComponentFramework(e){const{filePath:o,inputJSON:t}=e,{renderer:n,componentFramework:a}=t,i=(0,app_1.getAppJSON)(e.project);if(!(0,common_2.getAllPages)(i).includes(e.pagePath))return;const r="skyline"===n||"skyline"===i.renderer&&void 0===n,c="glass-easel"===a||"glass-easel"===i.componentFramework&&void 0===a;r&&(c||(0,common_2.throwError)({msg:locales_1.default.config.JSON_SHOULD_SET_COMPONENTFRAMEWORK_SKYLINE.format(o),filePath:o}))}const compilePageJSON=(e,o=!1)=>{mergeExtJSON(e),checkComponentGenerics(e),checkComponentPath(e),o||spreadUsingComponent(e),checkRenderer(e),checkComponentFramework(e)};function originGetPageJSON(e,o){const{pagePath:t,miniprogramRoot:n=""}=o,a=(0,tools_1.normalizePath)(path_1.default.posix.join(n,t+".json")),i=(0,reactiveCache_1.tryToGetReactiveJSONCompiler)(e),r=(0,lodash_1.cloneDeep)(i.getPageJSON("checked",o));return compilePageJSON({project:e,miniprogramRoot:n,inputJSON:r,filePath:a,pagePath:t}),r.usingComponents||(r.usingComponents={}),r}async function getPageJSON(e,o){const t=(0,reactiveCache_1.tryToGetReactiveProject)(e);return(0,reactiveCache_1.tryToGetReactiveJSONCompiler)(t).getPageJSON("compiled",o)}function getPageJSONWithDisableSpreading(e,o){const t=(0,reactiveCache_1.tryToGetReactiveProject)(e),n=(0,reactiveCache_1.tryToGetReactiveJSONCompiler)(t),{pagePath:a,miniprogramRoot:i=""}=o,r=(0,tools_1.normalizePath)(path_1.default.posix.join(i,a+".json")),c=(0,lodash_1.cloneDeep)(n.getPageJSON("checked",o));return compilePageJSON({project:t,miniprogramRoot:i,inputJSON:c,filePath:r,pagePath:a},!0),c.usingComponents||(c.usingComponents={}),c}exports.originGetPageJSON=originGetPageJSON,reactiveCache_1.ReactiveJSONCompiler.setOriginCheckPageJSON(checkPageJSON_1.checkPageJSON),reactiveCache_1.ReactiveJSONCompiler.setOriginGetPageJSON(originGetPageJSON),exports.getPageJSON=getPageJSON,exports.getPageJSONWithDisableSpreading=getPageJSONWithDisableSpreading;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getGameLocalPluginJSON=exports.getDevPluginJSON=exports.checkWorkers=exports.checkComponentPath=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),projectconfig_1=require("../projectconfig"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),common_1=require("../common"),config_1=require("../../../../../config/config"),schemaValidate_1=require("../../validate/schemaValidate"),tools_1=require("../../../../../utils/tools"),cache_1=require("../../../../../utils/cache"),common_2=require("../../../../../utils/common"),reactiveCache_1=require("../reactiveCache");function checkComponentPath(o,e){const{project:t,root:c,filePath:i}=o;void 0!==e.usingComponents&&(0,common_1.checkComponentPath)({project:t,root:c,relativePath:path_1.default.posix.relative(c,i),inputJSON:e})}function checkPublicComponentsAndPages(o,e){const{project:t,root:c,filePath:i}=o,{publicComponents:n,pages:a}=e,r={};if(n){const o=[];for(const a in n){const n=e.publicComponents[a];(0,common_2.checkPath)({value:n,tips:`["publicComponents"]["${a}"]`,filePath:i,code:config_1.PLUGIN_JSON_CONTENT_ERR});let s=t.stat(c,n+".wxml");s&&!s.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["publicComponents"]["${n}"]`,n+".wxml")),s=t.stat(c,n+".js"),s&&!s.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["publicComponents"]["${n}"]`,n+".js")),s=t.stat(c,n+".json"),s&&!s.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["publicComponents"]["${n}"]`,n+".json")),r[a]=!0}o.length>0&&(0,common_2.throwError)({msg:o.join("\n"),code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:i})}if(a){const o=[];for(const e in a){const n=a[e];(0,common_2.checkPath)({value:n,tips:`["pages"]["${e}"]`,filePath:i,code:config_1.PLUGIN_JSON_CONTENT_ERR});let s=t.stat(c,n+".wxml");s&&!s.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["pages"]["${n}"]`,n+".wxml")),s=t.stat(c,n+".js"),s&&!s.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["pages"]["${n}"]`,n+".js")),s=t.stat(c,n+".json"),s&&!s.isDirectory||o.push(locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format(`["pages"]["${n}"]`,n+".json")),r[e]&&o.push(locales_1.default.config.SAME_KEY_PAGE_PUBLICCOMPONENTS.format(`"${e}"`)),r[e]=!0}o.length>0&&(0,common_2.throwError)({msg:o.join("\n"),code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:i})}}function checkWorkers(o,e){const{project:t,root:c,filePath:i}=o,{workers:n}=e;if(void 0===n)return;const a='["workers"]';""===n&&(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(a,locales_1.default.config.DIRECTORY),filePath:i}),(0,common_2.checkPath)({value:n,tips:a,filePath:i});const r=t.stat(c,n);r&&r.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([a,locales_1.default.config.DIRECTORY]),filePath:i}),e.workers=(0,tools_1.normalizePath)(n+"/")}function checkMain(o,e){const{project:t,root:c,filePath:i}=o,{main:n}=e;if(void 0===n)return;""===n&&(0,common_2.throwError)({msg:locales_1.default.config.SHOULD_NOT_BE_EMPTY.format('["main"]'),code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:i}),(0,common_2.checkPath)({value:n,tips:'["main"]',filePath:i,code:config_1.PLUGIN_JSON_CONTENT_ERR});const a=t.stat(c,n);a&&!a.isDirectory||(0,common_2.throwError)({msg:locales_1.default.config.CORRESPONDING_FILE_NOT_FOUND.format('["main"]',n),code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:i})}function isKindOfGamePlugin(o){return o.type===config_1.COMPILE_TYPE.miniGamePlugin}function checkPluginJSON(o){const{root:e="",project:t}=o,c=path_1.default.posix.join(e,"plugin.json");t.stat(e,"plugin.json")||(0,common_2.throwError)({msg:locales_1.default.config.PLUGIN_JSON_NOT_FOUND.format(e,"plugin.json"),code:config_1.PLUGIN_JSON_FILE_NOT_FOUND,filePath:c});const i=t.getFile(e,"plugin.json"),n=(0,common_1.checkJSONFormat)((0,common_2.checkUTF8)(i,c),c),a=(0,schemaValidate_1.schemaValidate)("plugin",n);if(a.error.length){const o=(0,schemaValidate_1.transValidateResult)(c,a,!0);(0,common_2.throwError)({msg:"pluginJSON$"+o,code:config_1.PLUGIN_JSON_CONTENT_ERR,filePath:c})}return void 0!==n.themeLocation&&(0,common_2.checkPath)({value:n.themeLocation,tips:'["themeLocation"]',filePath:c}),isKindOfGamePlugin(t)||(checkPublicComponentsAndPages(o,n),checkComponentPath(o,n)),checkMain(o,n),checkWorkers(o,n),n}exports.checkComponentPath=checkComponentPath,exports.checkWorkers=checkWorkers,exports.getDevPluginJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.PLUGIN_JSON,(o,e="")=>{const t=(0,projectconfig_1.getProjectConfigJSON)(o),{pluginRoot:c=""}=t;let i=c;o.type===config_1.COMPILE_TYPE.miniGame&&e&&(i=e),e||c||(0,common_2.throwError)({msg:locales_1.default.config.NOT_FOUND.format('["pluginRoot"]'),filePath:"project.config.json",code:config_1.JSON_CONTENT_ERR});return checkPluginJSON({project:o,filePath:path_1.default.posix.join(i,"plugin.json"),root:i})});const getGameLocalPluginJSON=async(o,e)=>{const t=await(0,projectconfig_1.getProjectConfigJSON)(o),{miniprogramRoot:c}=t;if(!e)return{};const i=(0,tools_1.normalizePath)(path_1.default.posix.join(c||"",e));return checkPluginJSON({project:(0,reactiveCache_1.tryToGetReactiveProject)(o),filePath:path_1.default.posix.join(i,"plugin.json"),root:i})};exports.getGameLocalPluginJSON=getGameLocalPluginJSON;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPluginPageJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),common_1=require("../common"),schemaValidate_1=require("../../validate/schemaValidate"),locales_1=tslib_1.__importDefault(require("../../../../../utils/locales/locales")),common_2=require("../../../../../utils/common"),theme_1=require("../theme"),plugin_1=require("./plugin"),spreadUsingComponent=async(e,t)=>{const{project:a,root:i,filePath:n}=t,o=path_1.default.posix.relative(i,n);if(n.includes("miniprogram_npm/"))return;const r=await(0,plugin_1.getDevPluginJSON)(a,!0),s=Object.assign({},r.usingComponents);if(0!==Object.keys(s).length){e.usingComponents||(e.usingComponents={});for(const t in s){if(e.usingComponents[t])continue;const a=s[t]||"";if(a.startsWith("/")||a.startsWith("plugin://")){e.usingComponents[t]=a;continue}const i=path_1.default.posix.normalize(path_1.default.posix.relative(path_1.default.posix.dirname(o),a));e.usingComponents[t]=i.startsWith(".")?i:"./"+i}}};async function checkComponentPath(e,t){const{project:a,root:i,filePath:n}=t;await(0,common_1.checkComponentPath)({project:a,root:i,relativePath:path_1.default.posix.relative(i,n),inputJSON:e})}async function getPluginPageJSON(e){const{project:t}=e,{filePath:a}=e;if(!t.stat("",a))return{};const i=await t.getFile("",a),n=(0,common_1.checkJSONFormat)((0,common_2.checkUTF8)(i,a),a),o=await(0,theme_1.getPluginThemeLocation)(t);if(!o){const e=(0,common_1.getPageJSONVariableDecalearProperty)(n);e.length&&(0,common_2.throwError)({msg:'pluginJSON["themeLocation"] is required because:\n'+e.map(e=>`"${e.value}" as variable was declared at ${a}:${e.property}`).join("\n"),filePath:a})}let r={light:{},dark:{}};o&&(r=await(0,theme_1.checkThemeJSON)(t,{themeLocation:o,isPlugin:!0}));const s=(0,theme_1.mergeThemeJSONToPageJSON)(r,n,a),l=(0,schemaValidate_1.schemaValidate)("page",s.pageJSONLight),c=(0,schemaValidate_1.schemaValidate)("page",s.pageJSONDark);return l.warning&&(n.__warning__=locales_1.default.config.INVALID.format(l.warning)),o&&c.warning&&(n.__warning__=locales_1.default.config.INVALID.format(c.warning)),(0,schemaValidate_1.transValidateResult)(o?`${a} or ${o}["light"]`:a,l),o&&(0,schemaValidate_1.transValidateResult)(`${a} or ${o}["dark"]`,c),await checkComponentPath(n,e),await spreadUsingComponent(n,e),n}exports.getPluginPageJSON=getPluginPageJSON;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getProjectConfigJSON=void 0;const tslib_1=require("tslib"),lodash_1=require("lodash"),common_1=require("../../../../utils/common"),schemaValidate_1=require("../validate/schemaValidate"),cache_1=require("../../../../utils/cache"),tools_1=require("../../../../utils/tools"),config_1=require("../../../../config/config"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),reactiveCache_1=require("./reactiveCache"),common_2=require("./common"),PROJECT_CONFIG_JSON="project.config.json",rootConfig=["svr","client","qcloudRoot","miniprogramRoot","pluginRoot","cloudfunctionRoot","jsserverRoot","testRoot"];function formatPath(o=""){return o&&"/"!==o?(o=(0,tools_1.normalizePath)(o+"/")).replace(/^(\/)*/,"").replace(/\.\.\//g,"").replace(/^\.\//,""):""}const _getProjectConfigJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.PROJECT_CONFIG,o=>{if(!o.stat("",PROJECT_CONFIG_JSON))return o.type!==config_1.COMPILE_TYPE.miniGamePlugin&&o.type!==config_1.COMPILE_TYPE.miniProgramPlugin||(0,common_1.throwError)({msg:locales_1.default.config.NOT_FOUND.format("project.config.json"),code:config_1.FILE_NOT_FOUND,filePath:PROJECT_CONFIG_JSON}),{};const e=o.getFile("",PROJECT_CONFIG_JSON),t=(0,common_1.checkUTF8)(e,PROJECT_CONFIG_JSON),i=(0,common_2.checkJSONFormat)(t,PROJECT_CONFIG_JSON),r=(0,schemaValidate_1.schemaValidate)("projectconfig",i);return(0,schemaValidate_1.transValidateResult)(PROJECT_CONFIG_JSON,r),o.miniprogramRoot=i.miniprogramRoot||"",o.pluginRoot=i.pluginRoot||"",rootConfig.forEach(o=>{"string"==typeof i[o]?i[o]=formatPath(i[o]):i[o]=""}),"gamePlugin"!==i.compileType&&"plugin"!==i.compileType||i.pluginRoot||(0,common_1.throwError)({msg:locales_1.default.config.SHOULD_NOT_BE_EMPTY.format('["pluginRoot"]'),filePath:PROJECT_CONFIG_JSON}),"gamePlugin"!==i.compileType&&"plugin"!==i.compileType||i.pluginRoot!==i.miniprogramRoot||(0,common_1.throwError)({msg:locales_1.default.config.PLUGIN_PATH_SAME_WITH_MINIPROGRAM.format([i.pluginRoot,i.miniprogramRoot]),filePath:PROJECT_CONFIG_JSON}),i}),getProjectConfigJSON=function(o){const e=_getProjectConfigJSON(o);return(0,lodash_1.cloneDeep)(e)};exports.getProjectConfigJSON=getProjectConfigJSON;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.cleanReactiveCache=exports.wrapCompileJSONFunc=exports.tryToGetReactiveJSONCompiler=exports.ReactiveJSONCompiler=exports.tryToGetReactiveProject=exports.ReactiveProject=void 0;const process_1=require("process"),reactivity_1=require("@vue/reactivity"),lodash_1=require("lodash"),tools_1=require("../../../../utils/tools"),reactiveProject_1=require("../../../../project/advance/reactiveProject");function makeReadonly(e){return e&&"object"==typeof e?(0,reactivity_1.readonly)(e):e}Object.defineProperty(exports,"ReactiveProject",{enumerable:!0,get:function(){return reactiveProject_1.ReactiveProject}});const reactiveProjectMap=new Map;function tryToGetReactiveProject(e){let t=reactiveProjectMap.get(e.projectPath);return t||(t=new reactiveProject_1.ReactiveProject(e),reactiveProjectMap.set(e.projectPath,t),t)}exports.tryToGetReactiveProject=tryToGetReactiveProject;let isPending=!1;const pendingRunner=new Set,resolvedPromise=Promise.resolve();function runInNextTick(e){pendingRunner.add(e),isPending||(isPending=!0,resolvedPromise.then(()=>{const e=Date.now();try{const t=Array.from(pendingRunner);pendingRunner.clear(),isPending=!1,t.forEach(e=>{e()})}finally{(0,tools_1.devtoolsInfo)(`[reactiveCache] nextTick update cost ${Date.now()-e} ms`)}}))}class ReactiveJSONCompiler{constructor(e){this.pageComputeds=new Map,this.jsonComputeds=new Map,this.project=e}release(){(0,tools_1.devtoolsLog)("[reactiveCache] reactiveJSONCompiler release")}registerOrGet(e,t,...r){let o=this.jsonComputeds.get(e);if(!o){o=(0,reactivity_1.ref)(void 0),this.jsonComputeds.set(e,o);let i=void 0;i=(0,reactivity_1.effect)(()=>{try{const e=t.call(null,this.project,...r);(0,lodash_1.isEqual)(e,o.value)||(o.value=makeReadonly(e))}catch(t){o.value=t instanceof Error?t:new Error(t.toString()),(0,tools_1.devtoolsLog)(`[reactiveCache] update ${e} failed: `,t)}},{scheduler(){i&&i.active&&runInNextTick(i)}})}const{value:i}=o;if(i instanceof Error)throw i;return i}static setOriginGetPageJSON(e){this.originGetPageJSON=e}static setOriginCheckPageJSON(e){this.originCheckPageJSON=e}getPageJSON(e,t){let r=this.pageComputeds.get(t.pagePath);r||(r={checked:(0,reactivity_1.ref)(void 0),compiled:(0,reactivity_1.ref)(void 0)},this.pageComputeds.set(t.pagePath,r));const o=r[e];if(void 0===o.value){let r=void 0;r=(0,reactivity_1.effect)(()=>{try{(0,tools_1.devtoolsInfo)(`[reactiveCache] start to update ${e} ${t.pagePath}`);const r="compiled"===e?ReactiveJSONCompiler.originGetPageJSON(this.project,t):ReactiveJSONCompiler.originCheckPageJSON(this.project,t);o.value=makeReadonly(r),(0,tools_1.devtoolsInfo)(`[reactiveCache] update finish ${e} ${t.pagePath}`)}catch(r){o.value=r instanceof Error?r:new Error(r.toString()),(0,tools_1.devtoolsLog)(`[reactiveCache] update ${e} ${t.pagePath} failed: `,r)}},{scheduler(){r&&r.active&&(0,process_1.nextTick)(r)}})}const{value:i}=o;if(i instanceof Error)throw i;return i}}exports.ReactiveJSONCompiler=ReactiveJSONCompiler;const reactiveJSONCompilerMap=new Map;function tryToGetReactiveJSONCompiler(e){let t=reactiveJSONCompilerMap.get(e.projectPath);return t||(t=new ReactiveJSONCompiler(e),reactiveJSONCompilerMap.set(e.projectPath,t),t)}function wrapCompileJSONFunc(e,t){return function(r,...o){r instanceof reactiveProject_1.ReactiveProject||(r=tryToGetReactiveProject(r));return tryToGetReactiveJSONCompiler(r).registerOrGet(e,t,...o)}}function cleanReactiveCache(){reactiveProjectMap.forEach(e=>{e.release()}),reactiveProjectMap.clear(),reactiveJSONCompilerMap.forEach(e=>{e.release()}),reactiveJSONCompilerMap.clear()}exports.tryToGetReactiveJSONCompiler=tryToGetReactiveJSONCompiler,exports.wrapCompileJSONFunc=wrapCompileJSONFunc,exports.cleanReactiveCache=cleanReactiveCache;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllPluginSignatures=exports.isPathValid=exports.getAllPluginsWithPath=exports.friendlyPathMake=exports.trailing=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),fs_extra_1=tslib_1.__importDefault(require("fs-extra")),tools_1=require("../../../../utils/tools"),log=tslib_1.__importStar(require("../../../../utils/log")),game_1=tslib_1.__importDefault(require("./game")),trailing=(t,e)=>t.endsWith(e)?t:t+e;exports.trailing=trailing;const friendlyPathMake=(t,e)=>path_1.default.normalize(path_1.default.join(t,e.replace(/\\/g,"/")).replace(/^\/+/,""));async function getAllPluginsWithPath(t){const e=(0,game_1.default)(t),i=[],a=(t,e="")=>{if(t.plugins)for(const a in t.plugins){if(!t.plugins.hasOwnProperty(a))continue;const r=t.plugins[a];r&&"string"==typeof r.path&&i.push({alias:a,version:r.version||"",provider:r.provider||"",path:r.path,friendlyPath:(0,exports.friendlyPathMake)(e,r.path)})}};a(e,"");const r=e.subPackages||e.subpackages;if(Array.isArray(r))for(const t of r)t&&"string"==typeof t.root&&a(t,t.root);return i}function isPathValid(t,e){if(e=e.replace(/\\/g,"/"),t=t.replace(/\\/g,"/"),e.includes("../")||e.endsWith("/.."))return!1;const i=(0,tools_1.normalizePath)(path_1.default.join(t,e)),a=(0,tools_1.normalizePath)(t);return!!i.startsWith(a)}async function getAllPluginSignatures(t){const e=await getAllPluginsWithPath(t),i=[];let a=t.miniprogramRoot?path_1.default.join(t.projectPath,t.miniprogramRoot):t.projectPath;a=(0,tools_1.normalizePath)(a),a=a.endsWith("/")?a:a+"/";for(const t of e)try{const e=path_1.default.join(a,t.friendlyPath);let r=await fs_extra_1.default.pathExists(e);if(!r)continue;const n=await fs_extra_1.default.stat(e);let s=e;n.isDirectory()||(s=path_1.default.dirname(e));const l=path_1.default.join(s,"signature.json");if(r=await fs_extra_1.default.pathExists(l),!r)continue;const o=await fs_extra_1.default.readFile(l,"utf8");let u=null;try{u=JSON.parse(o)}catch(t){log.error(t);continue}if(!u||!Array.isArray(u.signature))continue;const p=[];for(let t=0;t<u.signature.length;t++){const e=u.signature[t];if(!e)continue;if("string"!=typeof e.path||"string"!=typeof e.md5)continue;if(!isPathValid(s,e.path))continue;const i=path_1.default.join(s,e.path);p.push({fullPath:i,md5:e.md5})}i.push({provider:t.provider,fullPath:e,signature:p})}catch(t){log.error(t);continue}return i}exports.friendlyPathMake=friendlyPathMake,exports.getAllPluginsWithPath=getAllPluginsWithPath,exports.isPathValid=isPathValid,exports.getAllPluginSignatures=getAllPluginSignatures;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSiteMapJSON=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),tools_1=require("../../../../utils/tools"),common_1=require("../../../../utils/common"),schemaValidate_1=require("../validate/schemaValidate"),cache_1=require("../../../../utils/cache"),config_1=require("../../../../config/config"),reactiveCache_1=require("./reactiveCache"),common_2=require("./common"),projectconfig_1=require("./projectconfig"),appJSON_1=require("./app/appJSON");exports.getSiteMapJSON=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.SITE_MAP_JSON,e=>{const t=(0,projectconfig_1.getProjectConfigJSON)(e),i=(0,appJSON_1.getAppJSON)(e),{sitemapLocation:o=""}=i;let a=o;if(a)a=(0,tools_1.normalizePath)(path_1.default.posix.join(t.miniprogramRoot||"",a));else{if(a=(0,tools_1.normalizePath)(path_1.default.posix.join(t.miniprogramRoot||"","sitemap.json")),!e.stat("",a))return e.type,config_1.COMPILE_TYPE.miniProgramPlugin,{desc:"",rules:[{action:"disallow",page:"*"}]}}const r=e.getFile("",a),c=(0,common_1.checkUTF8)(r,a),s=(0,common_2.checkJSONFormat)(c,a),p=(0,schemaValidate_1.schemaValidate)("sitemap",s);return(0,schemaValidate_1.transValidateResult)(a,p),s});
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeThemeJSONToPageJSON=exports.mergeThemeJSONToAppJSON=exports.checkThemeJSON=exports.getPluginThemeLocation=exports.getThemeLocation=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),lodash_1=tslib_1.__importStar(require("lodash")),tools_1=require("../../../../utils/tools"),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),common_1=require("../../../../utils/common"),cache_1=require("../../../../utils/cache"),schemaValidate_1=require("../validate/schemaValidate"),config_1=require("../../../../config/config"),common_2=require("./common"),appJSON_1=require("./app/appJSON"),plugin_1=require("./plugin/plugin"),reactiveCache_1=require("./reactiveCache"),projectconfig_1=require("./projectconfig");async function getPluginThemeLocation(e){return(await(0,plugin_1.getDevPluginJSON)(e)).themeLocation||null}function checkThemeJSON(e,o){const{isPlugin:t}=o;return t?originCheckThemeJSONForPlugin(e,o):originCheckThemeJSONForMiniProgram(e,o)}exports.getThemeLocation=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.APP_JSON_THEME_LOCATION,e=>{const o=(0,appJSON_1.getRawAppJSON)(e),{themeLocation:t}=o;return"[object Undefined]"!==Object.prototype.toString.call(t)?"string"==typeof t?((0,common_1.checkPath)({value:t,tips:'["themeLocation"]',filePath:"app.json"}),t):((0,common_1.throwError)({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format('appJSON["themeLocation"]',"string"),filePath:"app.json"}),null):null}),exports.getPluginThemeLocation=getPluginThemeLocation,exports.checkThemeJSON=checkThemeJSON;const originCheckThemeJSONForMiniProgram=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.THEME_JSON,originCheckThemeJSON),originCheckThemeJSONForPlugin=(0,reactiveCache_1.wrapCompileJSONFunc)(cache_1.CACHE_KEY.PLUGIN_THEME_JSON,originCheckThemeJSON);function originCheckThemeJSON(e,o){const{isPlugin:t}=o,i=(0,exports.getThemeLocation)(e),r=(0,projectconfig_1.getProjectConfigJSON)(e),a=t?r.pluginRoot:r.miniprogramRoot,c=(0,tools_1.normalizePath)(path_1.default.posix.join(a||"",i));e.stat("",c)||(0,common_1.throwError)({msg:locales_1.default.config.FILE_NOT_FOUND.format(c),filePath:"app.json"});const n=e.getFile("",c),l=(0,common_1.checkUTF8)(n,c),s=(0,common_2.checkJSONFormat)(l,c),h=(0,schemaValidate_1.schemaValidate)("theme",s);return(0,schemaValidate_1.transValidateResult)(c,h),s}function mergeThemeJSONToAppJSON(e,o){var t,i;const{windowPropertWhiteList:r,tabBarPropertyWhiteList:a,tabbarListItemPropertyWhiteList:c}=config_1.jsonVariablePropertyWhiteList,n=/^@/,l=lodash_1.default.cloneDeep(o.window||{}),s=lodash_1.default.cloneDeep(o.window||{});Object.keys(l).forEach(o=>{const t=l[o];if(n.test(t)){r.includes(o)||(0,common_1.throwError)({msg:""+locales_1.default.config.SHOULD_NOT_IN.format([t,o]),filePath:"app.json"});const i=t.slice(1);l[o]=e.light[i]||t,s[o]=e.dark[i]||t}});const h=(0,lodash_1.cloneDeep)(o),m=(0,lodash_1.cloneDeep)(o);if(h.window=l,m.window=s,null===(i=null===(t=o.tabBar)||void 0===t?void 0:t.list)||void 0===i?void 0:i.length){const t=lodash_1.default.cloneDeep(o.tabBar||{list:[]}),i=lodash_1.default.cloneDeep(o.tabBar||{list:[]});t.list&&t.list.length>0&&Object.keys(t).forEach(o=>{if("list"!==o){const r=t[o];if(n.test(r)){a.includes(o)||(0,common_1.throwError)({msg:""+locales_1.default.config.SHOULD_NOT_IN.format([r,o]),filePath:"app.json"});const c=r.slice(1);t[o]=e.light[c]||r,i[o]=e.dark[c]||r}}else t.list.forEach((o,r)=>{Object.keys(o).forEach(a=>{const l=o[a];if(n.test(l)){c.includes(a)||(0,common_1.throwError)({msg:""+locales_1.default.config.SHOULD_NOT_IN.format([l,a]),filePath:"app.json"});const o=l.slice(1);t.list[r][a]=e.light[o]||l,i.list[r][a]=e.dark[o]||l}})})}),m.tabBar=i,h.tabBar=t}return{appJSONLight:h,appJSONDark:m}}function mergeThemeJSONToPageJSON(e,o,t){const i=config_1.jsonVariablePropertyWhiteList.windowPropertWhiteList,r=lodash_1.default.cloneDeep(o||{}),a=lodash_1.default.cloneDeep(o||{}),c=/^@/;return Object.keys(o).forEach(n=>{const l=o[n];if(c.test(l)){const o=l.slice(1);i.includes(n)||(0,common_1.throwError)({msg:""+locales_1.default.config.SHOULD_NOT_IN.format([l,n]),filePath:t}),a[n]=e.light[o]||l,r[n]=e.dark[o]||l}}),{pageJSONDark:r,pageJSONLight:a}}exports.mergeThemeJSONToAppJSON=mergeThemeJSONToAppJSON,exports.mergeThemeJSONToPageJSON=mergeThemeJSONToPageJSON;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),read_package_tree_1=tslib_1.__importDefault(require("read-package-tree"));function checkDeps(e,t){var a,r;const n=new Set(Object.keys((null===(a=e.package)||void 0===a?void 0:a.dependencies)||{})),o=[];let s=e;for(;s;){const e=s.children||[];for(const t of e){const e=(null===(r=t.package)||void 0===r?void 0:r.name)||"";n.has(e)&&(n.delete(e),o.push(t))}s=s.parent}for(const e of o)t.has(e)||(t.add(e),checkDeps(e,t))}async function getDeps(e){return new Promise((t,a)=>{(0,read_package_tree_1.default)(e,(e,r)=>{if(e)return a(e);const n=new Set;try{checkDeps(r,n)}catch(e){return a(e)}t(Array.from(n))})})}async function default_1(e,t){if(null==t?void 0:t.length){const a=t.filter(e=>!/([\\/]|\b)node_modules/.test(e)),r=[],n={};for(const t of a){(await getDeps(path_1.default.join(e,path_1.default.dirname(t)))).forEach(e=>{r.push(e)})}for(const e of r){const t=e.isLink?e.path:e.realpath;n[path_1.default.normalize(path_1.default.join(t,"./package.json"))]=e}t=t.filter(t=>{const a=path_1.default.normalize(path_1.default.join(e,t));return!!n[a]})}return t}exports.default=default_1;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.packNpmManually=exports.packNpm=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),fs_1=tslib_1.__importDefault(require("fs")),rimraf_1=tslib_1.__importDefault(require("rimraf")),lodash_1=tslib_1.__importDefault(require("lodash")),glob_1=tslib_1.__importDefault(require("glob")),source_map_1=tslib_1.__importDefault(require("source-map")),locales_1=tslib_1.__importDefault(require("../../../../utils/locales/locales")),error_1=require("../../../../utils/error"),log=tslib_1.__importStar(require("../../../../utils/log")),projectconfig_1=require("../json/projectconfig"),config_1=require("../../../../config/config"),filterdeps_1=tslib_1.__importDefault(require("./filterdeps")),acorn=require("acorn"),NPM_RECORD={start_time:Date.now(),pack_time:0,miniprogram_pack_num:0,other_pack_num:0,warn_not_found_num:0,warn_require_var_num:0,warn_require_rename_num:0,extra1:"",extra2:"",extra3:""},REPORT_LIST=["pack_time","miniprogram_pack_num","other_pack_num","warn_not_found_num","warn_require_var_num","warn_require_rename_num","extra1","extra2","extra3"];function wrap(e,t){return function(...a){if(a.length){const e=a.pop();"function"!=typeof e&&a.push(e)}return new Promise((r,n)=>{a.push((e,t)=>{e?n(e):r(t)}),e.apply(t||null,a)})}}const statSync=wrap(fs_1.default.stat),mkdirSync=wrap(fs_1.default.mkdir),readFileSync=wrap(fs_1.default.readFile),writeFileSync=wrap(fs_1.default.writeFile),accessSync=wrap(fs_1.default.access),renameSync=wrap(fs_1.default.rename),globSync=wrap(glob_1.default);let seed=+new Date;function getId(){return++seed}function startRecord(){NPM_RECORD.start_time=Date.now(),REPORT_LIST.forEach(e=>NPM_RECORD[e]=e.startsWith("extra")?"":0)}function endRecord(e){NPM_RECORD.pack_time=Date.now()-NPM_RECORD.start_time;const t={};REPORT_LIST.forEach(e=>t[e]=NPM_RECORD[e]);try{null==e||e(t)}catch(e){}}async function recursiveMkdir(e){const t=path_1.default.posix.dirname(e);try{await accessSync(t)}catch(e){await recursiveMkdir(t)}try{await accessSync(e);const t=await statSync(e);t&&!t.isDirectory()&&(await renameSync(e,e+".bak"),log.warn(e+" already exists but is not a directory, so it will be rename to a file with the suffix ending in '.bak'"),await mkdirSync(e))}catch(t){await mkdirSync(e)}}async function copyFile(e,t){const a=await readFileSync(e);await writeFile(a,t)}async function writeFile(e,t){await recursiveMkdir(path_1.default.posix.dirname(t)),await writeFileSync(t,e)}function walkNode(e,t){t(e),Object.keys(e).forEach(a=>{const r=e[a];Array.isArray(r)&&r.forEach(e=>{(null==e?void 0:e.type)&&walkNode(e,t)}),(null==r?void 0:r.type)&&walkNode(r,t)})}function parseDeps(e,t,a){const r=[];let n,o=[];try{n=acorn.parse(e,{sourceType:"module",locations:!0,allowHashBang:!0,onComment(t,a,r,n){t||"#"!==e[r]||o.push({start:r,end:n,adjustContent:""})}})}catch(e){const a=`parse js file (${t}) failed: ${e.message}`;throw console.error(a),e.message=a,e}return walkNode(n,n=>{const{callee:i}=n,s=n.arguments;if("CallExpression"===n.type&&i&&"Identifier"===i.type&&"require"===i.name&&s&&1===s.length&&("Literal"===s[0].type?r.push(s[0].value):(a.push({jsPath:t,code:e.substring(n.start,n.end),startLine:n.loc.start.line,endLine:n.loc.end.line,tips:"require variable is not allowed",msg:locales_1.default.config.NOT_ALLOWED_REQUIRE_VAR.format()}),NPM_RECORD.warn_require_var_num++)),"ExpressionStatement"===n.type&&n.expression&&"use strict"===n.expression.value&&o.push({start:n.start,end:n.end,adjustContent:""}),"ImportDeclaration"===n.type){const{source:e}=n,{specifiers:t}=n,a={start:n.start,end:n.end,adjustContent:""},i=[];e&&"Literal"===e.type&&(r.push(e.value),i.push(`var __TEMP__ = require('${e.value}');`)),t&&Array.isArray(t)&&t.forEach(e=>{if("ImportSpecifier"===e.type){const{local:t}=e,{imported:a}=e;"Identifier"===t.type&&"Identifier"===a.type&&i.push(`var ${t.name} = __TEMP__['${a.name}'];`)}else if("ImportDefaultSpecifier"===e.type){const{local:t}=e;"Identifier"===t.type&&i.push(`var ${t.name} = __REQUIRE_DEFAULT__(__TEMP__);`)}else if("ImportNamespaceSpecifier"===e.type){const{local:t}=e;"Identifier"===t.type&&i.push(`var ${t.name} = __REQUIRE_WILDCARD__(__TEMP__);`)}}),a.adjustContent=i.join(""),o.push(a)}if("ExportNamedDeclaration"===n.type){const{source:t}=n,{specifiers:a}=n,{declaration:i}=n;let s=!1;const p={start:n.start,end:n.end,adjustContent:""},c=['if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });'];if(t&&"Literal"===t.type&&(r.push(t.value),c.push(`var __TEMP__ = require('${t.value}');`),s=!0),i){if("VariableDeclaration"===i.type){const{declarations:t}=i;t&&Array.isArray(t)&&t.forEach(t=>{if("VariableDeclarator"===t.type){const{id:a}=t,{init:r}=t;a&&"Identifier"===a.type&&(p.notAddLines=!0,c.push(`var ${a.name} = exports.${a.name} = ${r?e.substring(r.start,r.end):"undefined"};`))}})}else if("FunctionDeclaration"===i.type){const{id:t}=i;t&&"Identifier"===t.type&&(p.notAddLines=!0,c.push(`${e.substring(i.start,i.end)};exports.${t.name} = ${t.name}`))}else if("ClassDeclaration"===i.type){const{id:t}=i;t&&"Identifier"===t.type&&(p.notAddLines=!0,c.push(`${e.substring(i.start,i.end)};exports.${t.name} = ${t.name}`))}}else;a&&Array.isArray(a)&&a.forEach(e=>{if("ExportSpecifier"===e.type){const{local:t}=e,{exported:a}=e;"Identifier"===t.type&&"Identifier"===a.type&&c.push(`Object.defineProperty(exports, '${a.name}', { enumerable: true, configurable: true, get: function() { return ${s?"__TEMP__.":""}${t.name}; } });`)}}),p.adjustContent=c.join(""),o.push(p)}else if("ExportAllDeclaration"===n.type){const{source:e}=n,t={start:n.start,end:n.end,adjustContent:""},a=['if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });'];e&&"Literal"===e.type&&(r.push(e.value),a.push(`var __TEMP__ = require('${e.value}');`)),a.push('Object.keys(__TEMP__).forEach(function(k) { if (k === "default" || k === "__esModule") return; Object.defineProperty(exports, k, { enumerable: true, configurable: true, get: function() { return __TEMP__[k]; } }); });'),t.adjustContent=a.join(""),o.push(t)}else if("ExportDefaultDeclaration"===n.type){const{declaration:t}=n,a={start:n.start,end:n.end,adjustContent:""},r=['if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });'];if(t)if(a.notAddLines=!0,t.id){const{id:a}=t;r.push(`${e.substring(t.start,t.end)};exports.default = ${a.name}`)}else r.push(`exports.default = ${e.substring(t.start,t.end)};`);a.adjustContent=r.join(""),o.push(a)}const{expression:p}=n;"ExpressionStatement"===n.type&&p&&"AssignmentExpression"===p.type&&"Identifier"===p.right.type&&"require"===p.right.name&&(a.push({jsPath:t,code:e.substring(n.start,n.end),startLine:n.loc.start.line,endLine:n.loc.end.line,tips:"assign require function to a variable is not allowed",msg:locales_1.default.config.NOT_ALLOWED_REQUIRE_ASSIGN.format()}),NPM_RECORD.warn_require_rename_num++);const{declarations:c}=n;"VariableDeclaration"===n.type&&c.length>0&&c.forEach(r=>{const{init:o}=r;"VariableDeclarator"===r.type&&o&&"Identifier"===o.type&&"require"===o.name&&(a.push({jsPath:t,code:e.substring(n.start,n.end),startLine:n.loc.start.line,endLine:n.loc.end.line,tips:"assign require function to a variable is not allowed",msg:locales_1.default.config.NOT_ALLOWED_REQUIRE_ASSIGN.format()}),NPM_RECORD.warn_require_rename_num++)})}),o=o.sort((e,t)=>t.start-e.start),o.forEach(t=>{const a=e.substring(t.start,t.end),r=t.notAddLines?0:a.split("\n").length;e=e.substring(0,t.start)+t.adjustContent+new Array(r).join("\n")+e.substring(t.end)}),{deps:r,parsedContent:e}}async function parseJs(e,t,a,r,n,o){if(n[t=path_1.default.posix.normalize(t)])return n[t];const i=await readFileSync(t,"utf8"),s=getId(),p=path_1.default.posix.relative(e,t);if(t.endsWith(".json")){const e={id:s,name:p,content:"module.exports = "+i,deps:[],depsMap:{}};return n[t]=s,r.push(e),s}const{deps:c,parsedContent:_}=parseDeps(i,t,o),u={id:s,name:p,content:_,deps:c,depsMap:{}};n[t]=s,r.push(u);for(const i of c){let s,p=path_1.default.posix.join(path_1.default.posix.dirname(t),i);if(!p.endsWith(".js")&&!p.endsWith(".json")){const e=p+".js";try{await accessSync(e),p=e}catch(e){}}try{const e=await statSync(p);(null==e?void 0:e.isDirectory())&&(p=path_1.default.posix.join(p,"index.js"))}catch(e){}p.endsWith(".js")||p.endsWith(".json")||(p+=".js");try{await accessSync(p),s=await parseJs(e,p,a,r,n,o)}catch(e){}s&&(u.depsMap[i]=s)}return s}function addJsToMap(e,t,a,r){const n=t.split("\n").length;for(let o=1;o<=n;o++)e.addMapping({generated:{line:r+o,column:0},original:{line:o,column:0},source:a}),e.setSourceContent(a,t)}function findOutsideDeps(e){const t=new Set;return e.forEach(e=>{e.deps.forEach(a=>{Object.keys(e.depsMap).includes(a)||t.add(a)})}),Array.from(t)}async function packJs(e,t,a){try{const t=await statSync(e);(null==t?void 0:t.isDirectory())&&(e=path_1.default.posix.join(e,"index.js"))}catch(e){}e.endsWith(".js")||e.endsWith(".json")||(e+=".js");try{await accessSync(e)}catch(t){return a.push({jsPath:e,code:"",tips:"entry file is not found",msg:locales_1.default.config.NOT_FOUND_NPM_ENTRY.format()}),void NPM_RECORD.warn_not_found_num++}const r=new source_map_1.default.SourceMapGenerator({file:"index.js"}),n=[];await parseJs(path_1.default.posix.dirname(e),e,t,n,{},a);const o=findOutsideDeps(n),i=["module.exports = (function() {","var __MODS__ = {};","var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };",'var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };',"var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };","var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };"];if(n.length){const e=n.shift();i.push(`__DEFINE__(${e.id}, function(require, module, exports) {`),addJsToMap(r,e.content,e.name,i.length),i.push(e.content),i.push(`}, function(modId) {var map = ${JSON.stringify(e.depsMap)}; return __REQUIRE__(map[modId], modId); })`);for(const e of n)i.push(`__DEFINE__(${e.id}, function(require, module, exports) {`),addJsToMap(r,e.content,e.name,i.length),i.push(e.content),i.push(`}, function(modId) { var map = ${JSON.stringify(e.depsMap)}; return __REQUIRE__(map[modId], modId); })`);i.push(`return __REQUIRE__(${e.id});`)}return i.push("})()"),i.push("//miniprogram-npm-outsideDeps="+JSON.stringify(o)),i.push("//# sourceMappingURL=index.js.map"),{js:i.join("\n"),map:r.toString()}}async function checkIsMiniprogramPack(e,t){let a="miniprogram_dist";t.miniprogram&&"string"==typeof t.miniprogram&&(a=t.miniprogram);try{const t=path_1.default.posix.join(e,a);await accessSync(t);const r=await statSync(t);if(null==r?void 0:r.isDirectory())return t}catch(e){}return""}async function packNpm(e,t={}){const{projectPath:a}=e,r=e.type,n=await(0,projectconfig_1.getProjectConfigJSON)(e),o=n.pluginRoot||"",i=n.miniprogramRoot||"",s="miniProgramPlugin"===r||"miniGamePlugin"===r,{ignores:p,reporter:c}=t;if(!a)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format("projectPath"),config_1.PARAM_ERROR);if("miniProgramPlugin"===r&&!o)throw new error_1.CodeError(locales_1.default.config.SHOULD_NOT_BE_EMPTY.format('project.config.json "pluginRoot"'),config_1.PARAM_ERROR);startRecord();const _=path_1.default.isAbsolute(a)?a:path_1.default.posix.join(process.cwd(),a),u=[{searchRoot:path_1.default.posix.join(_,i),paths:await globSync("**/package.json",{cwd:path_1.default.posix.join(_,i),nodir:!0,dot:!0,ignore:(p||[]).concat("**/node_modules/**")})}];s&&u.push({searchRoot:path_1.default.posix.join(_,o),paths:await globSync("**/package.json",{cwd:path_1.default.posix.join(_,o),nodir:!0,dot:!0,ignore:(p||[]).concat("**/node_modules/**")})});lodash_1.default.flattenDeep(u.map(e=>e.paths.map(t=>path_1.default.posix.join(e.searchRoot,path_1.default.dirname(t),"miniprogram_npm")))).forEach(e=>rimraf_1.default.sync(e));const l=[];for(const e of u)for(const t of e.paths){const a=path_1.default.dirname(path_1.default.posix.join(e.searchRoot,t)),r=lodash_1.default.xorWith(e.paths,[t]).map(e=>path_1.default.posix.join(path_1.default.posix.dirname(e),"/**")).filter(e=>"**"!==e);let n=await globSync("**/package.json",{cwd:a.replace(/\\/g,"/"),nodir:!0,dot:!0,ignore:(p||[]).concat(r).concat(["node_modules/@types/**"])});if(n=await(0,filterdeps_1.default)(a,n),n&&n.length)for(const e of n){const t=path_1.default.posix.join(a,e);let r=await readFileSync(t,"utf8");const n=path_1.default.dirname(t);let o=n.replace(/([\b/\\])node_modules([\b/\\])/g,(e,t,a)=>`${t}miniprogram_npm${a}`),i=path_1.default.basename(o);const s=i.split("@");s.length&&(i=s.pop()||""),o=o.replace(path_1.default.basename(o),i),r=JSON.parse(r);const p=path_1.default.posix.join(n,r.main||"index.js"),c=await checkIsMiniprogramPack(n,r);if(c){const e=await globSync("**/*",{cwd:c.replace(/\\/g,"/"),nodir:!0,dot:!0,ignore:"**/node_modules/**"});for(const t of e)await copyFile(path_1.default.posix.join(c,t),path_1.default.posix.join(o,t));NPM_RECORD.miniprogram_pack_num++}else{const e=await packJs(p,o,l);if(!e)continue;await writeFile(e.js,path_1.default.posix.join(o,"./index.js")),await writeFile(e.map,path_1.default.posix.join(o,"./index.js.map")),NPM_RECORD.other_pack_num++}}}if(endRecord(c),NPM_RECORD.miniprogram_pack_num+NPM_RECORD.other_pack_num<=0)throw new Error("__NO_NODE_MODULES__ "+locales_1.default.config.NOT_FOUND_NODE_MODULES.format());return"function"==typeof e.updateFileAndDirs&&e.updateFileAndDirs(),l}async function packNpmManually(e){let{packageJsonPath:t,miniprogramNpmDistDir:a}=e;const r=e.ignores||[],n={pack_time:0,miniprogram_pack_num:0,other_pack_num:0,warn_not_found_num:0,warn_require_var_num:0,warn_require_rename_num:0},o=[];if(!a)throw new Error("param miniprogramNpmDistDir is required");if(!t)throw new Error("param packageJsonPath is required");if(path_1.default.isAbsolute(a)||(a=path_1.default.join(process.cwd(),a)),path_1.default.isAbsolute(t)||(t=path_1.default.join(process.cwd(),t)),!fs_1.default.existsSync(t))throw new Error(`param packageJsonPath: ${t} file is not exited`);const i=path_1.default.dirname(t);let s=await globSync("**/package.json",{cwd:i.replace(/\\/g,"/"),nodir:!0,dot:!0,ignore:(r||[]).concat(["node_modules/@types/**"])});if(s=await(0,filterdeps_1.default)(i,s),!s||!s.length)return log.warn("No miniprogram_npm package was built."),{miniProgramPackNum:0,otherNpmPackNum:0,warnList:[]};s=s.filter(e=>e.startsWith("node_modules"));for(const e of s){const t=path_1.default.posix.join(i,e);let r=await readFileSync(t,"utf8");const s=path_1.default.dirname(t);let p=s.replace(/([\b/\\])node_modules([\b/\\])/g,(e,t,a)=>`${t}miniprogram_npm${a}`);p=path_1.default.posix.normalize(path_1.default.posix.join(a,"miniprogram_npm",p.split(/[/\\]miniprogram_npm[/\\]/)[1]));let c=path_1.default.basename(p);const _=c.split("@");_.length&&(c=_.pop()||""),p=p.replace(path_1.default.basename(p),c),r=JSON.parse(r);const u=path_1.default.posix.join(s,r.main||"index.js"),l=await checkIsMiniprogramPack(s,r);if(l){const e=await globSync("**/*",{cwd:l.replace(/\\/g,"/"),nodir:!0,dot:!0,ignore:"**/node_modules/**"});for(const t of e)await copyFile(path_1.default.posix.join(l,t),path_1.default.posix.join(p,t));n.miniprogram_pack_num++}else{const e=await packJs(u,p,o);if(!e)continue;await writeFile(e.js,path_1.default.posix.join(p,"./index.js")),await writeFile(e.map,path_1.default.posix.join(p,"./index.js.map")),n.other_pack_num++}}return{miniProgramPackNum:n.miniprogram_pack_num,otherNpmPackNum:n.other_pack_num,warnList:o}}exports.packNpm=packNpm,exports.packNpmManually=packNpmManually;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.tryTranslateSingleFile=void 0;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),parser=tslib_1.__importStar(require("@babel/parser")),traverse_1=tslib_1.__importDefault(require("@babel/traverse")),sourcemap=tslib_1.__importStar(require("source-map")),babel_code_frame_1=tslib_1.__importDefault(require("babel-code-frame"));class TranslateResult{constructor(){this.translated=!0,this.errMsg="",this.debugs=[],this.translatedContent="",this.fullPath="",this.translatedSourceMap=""}}function getErrorCodeFrame(e,n,t,r){let i;try{i=new sourcemap.SourceMapConsumer(n||""),e=i.sourceContentFor(t)||e}catch(e){}const o=[];for(const n of r){let t={line:n.line,column:n.column>0?n.column:0};try{i&&(t=i.originalPositionFor({line:n.line,column:n.column}))}catch(e){}const r=(0,babel_code_frame_1.default)(e,t.line,t.column);o.push(`${n.reason}\n${r}`)}return o.join("\n\n")}function translateCode(e,n){const t=e.replace(/\r\n/g,"\n").split("\n");for(let e=0;e<t.length;e++){const r=t[e],i=n[e+1];if(i){const n=[];let o=0;for(const e in i){const t=i[e];n.push(r.substr(o,t.column-o+1)),n.push(t.toString),o=t.column+t.fromString.length+1}n.push(r.substr(o)),t[e]=n.join("")}}return t.join("\n")}function translateSourceMap(e,n,t){const r=new sourcemap.SourceMapConsumer(e),i=new sourcemap.SourceMapGenerator({file:n});let o;return r.eachMapping(e=>{if("number"!=typeof e.originalLine||"number"!=typeof e.originalColumn)return;const n={generated:{line:e.generatedLine,column:e.generatedColumn},source:e.source,name:e.name,original:{line:e.originalLine,column:e.originalColumn}};if(o&&o.line===e.generatedLine?n.generated.column+=o.offset:o=void 0,t[e.generatedLine]){const n=t[e.generatedLine][e.generatedColumn];n&&(o&&o.line===n.line?o.offset+=n.offset:o={line:n.line,offset:n.offset})}i.addMapping(n)}),i.toString()}function dirname(e){const n=e.split("/");return n.pop(),n.join("/")}function getNpmRequirePath(e,n,t){if(e.startsWith(".")||e.startsWith("/"))return!1;let r,i=n;for(;i;)if(i=dirname(i),r=e.endsWith(".js")?path_1.default.posix.join(i,"miniprogram_npm",e):path_1.default.posix.join(i,"miniprogram_npm",e,"index.js"),t.includes(r))return r;return!1}const tryTranslateSingleFile=e=>{var n,t;const r=new TranslateResult,{filePath:i,nameMapping:o,code:a,rootPath:l,miniProgramJSFiles:s}=e;let u=path_1.default.posix.dirname(path_1.default.posix.relative(l,i));"."===u&&(u="");const c=[];let p;try{p=parser.parse(a)}catch(o){return c.push({line:(null===(n=o.loc)||void 0===n?void 0:n.line)||1,column:(null===(t=o.loc)||void 0===t?void 0:t.column)||1,reason:o.message}),r.translated=!1,r.errMsg=`in ${path_1.default.posix.join(l,i)}\n${getErrorCodeFrame(a,e.sourceMap,e.sourceFileName,c)}`,r}const d={};if((0,traverse_1.default)(p,{AssignmentExpression(e){const n=e.node.loc.start;"Identifier"===e.node.left.type&&"require"===e.node.left.name&&c.push({line:n.line,column:n.column,reason:"assigning other name with 'require'"}),"Identifier"===e.node.right.type&&"require"===e.node.right.name&&c.push({line:n.line,column:n.column,reason:"'require' should not be renamed"})},VariableDeclarator(e){const n=e.node.loc.start;e.node.id&&"Identifier"===e.node.id.type&&"require"===e.node.id.name&&c.push({line:n.line,column:n.column,reason:"(init) assigning other name with 'require'"}),e.node.init&&"Identifier"===e.node.init.type&&"require"===e.node.init.name&&c.push({line:n.line,column:n.column,reason:"(init) 'require' should not be renamed"})},CallExpression(n){const t=n.node.loc.start;for(const e of n.node.arguments)"Identifier"===e.type&&"require"===e.name&&c.push({line:t.line,column:t.column,reason:"passing 'require' as a parameter is not a good taste"});if("Identifier"===n.node.callee.type&&"require"===n.node.callee.name&&(1===n.node.arguments.length&&"StringLiteral"===n.node.arguments[0].type||c.push({line:t.line,column:t.column,reason:"'require' requires one and only one static string literal"})),"require"===n.node.callee.name&&1===n.node.arguments.length&&"StringLiteral"===n.node.arguments[0].type){const t=n.node.arguments[0].loc.start,a=n.node.arguments[0].value,c=e.resolveAlias(a);let p;p=c?path_1.default.posix.join(l,c):path_1.default.posix.normalize(path_1.default.posix.join(u,a)),p.endsWith(".js")||(p+=".js"),p.startsWith("/")&&(p=p.replace(/^\//,""));let m=o[p];if(m)m=o[i]?path_1.default.posix.relative(path_1.default.posix.dirname(o[i]),m):path_1.default.posix.relative(u,m),d[t.line]||(d[t.line]={}),d[t.line][t.column]={line:t.line,column:t.column,fromString:a,toString:m,offset:m.length-a.length},r.debugs.push([i,a,"replace",[p,m]]);else{if(o[i]){const e=getNpmRequirePath(a,i,s);e&&(p=e),m=path_1.default.posix.relative(path_1.default.posix.dirname(o[i]),p),d[t.line]||(d[t.line]={}),d[t.line][t.column]={line:t.line,column:t.column,fromString:a,toString:m,offset:m.length-a.length},r.debugs.push([i,a,"replace",[p,m]])}r.debugs.push([i,a,"ignored"])}}},Identifier(e){const n=e.node.loc.start;if("require"===e.node.name){if("UnaryExpression"===e.parent.type&&"typeof"===e.parent.operator)return;"CallExpression"!==e.parent.type&&c.push({line:n.line,column:n.column,reason:`require is not being used properly in '${e.parent.type}'`})}}}),c.length>0)return r.translated=!1,r.errMsg=`in ${i}\n${getErrorCodeFrame(a,e.sourceMap,e.sourceFileName,c)}`,r;if(Object.keys(d).length>0){r.translatedContent=translateCode(a,d);try{r.translatedSourceMap=translateSourceMap(e.sourceMap||"",e.sourceFileName,d)}catch(e){}}else r.translatedContent=a,r.translatedSourceMap=e.sourceMap;return r};exports.tryTranslateSingleFile=tryTranslateSingleFile;