@metamask/snaps-cli 5.1.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/builders.js +10 -0
  3. package/dist/builders.js.map +1 -0
  4. package/dist/builders.mjs +10 -0
  5. package/dist/builders.mjs.map +1 -0
  6. package/dist/chunk-25SLEORF.mjs +28 -0
  7. package/dist/chunk-25SLEORF.mjs.map +1 -0
  8. package/dist/chunk-2QVYYMUD.js +365 -0
  9. package/dist/chunk-2QVYYMUD.js.map +1 -0
  10. package/dist/{esm/webpack/config.js → chunk-3LNPS7AX.js} +182 -156
  11. package/dist/chunk-3LNPS7AX.js.map +1 -0
  12. package/dist/chunk-46JUPGRY.js +22 -0
  13. package/dist/chunk-46JUPGRY.js.map +1 -0
  14. package/dist/chunk-4NHBPMKT.js +54 -0
  15. package/dist/chunk-4NHBPMKT.js.map +1 -0
  16. package/dist/chunk-4OKAI7AP.js +52 -0
  17. package/dist/chunk-4OKAI7AP.js.map +1 -0
  18. package/dist/chunk-5DDAAM2X.js +41 -0
  19. package/dist/chunk-5DDAAM2X.js.map +1 -0
  20. package/dist/chunk-5DSV76XV.mjs +10 -0
  21. package/dist/chunk-5DSV76XV.mjs.map +1 -0
  22. package/dist/chunk-5JPLNWCO.js +24 -0
  23. package/dist/chunk-5JPLNWCO.js.map +1 -0
  24. package/dist/chunk-5VAZH7L7.js +64 -0
  25. package/dist/chunk-5VAZH7L7.js.map +1 -0
  26. package/dist/chunk-5YUHRLH6.js +22 -0
  27. package/dist/chunk-5YUHRLH6.js.map +1 -0
  28. package/dist/chunk-6IF2UBYA.mjs +13 -0
  29. package/dist/chunk-6IF2UBYA.mjs.map +1 -0
  30. package/dist/chunk-6NJAXMSB.js +135 -0
  31. package/dist/chunk-6NJAXMSB.js.map +1 -0
  32. package/dist/chunk-6VFUO2H5.mjs +124 -0
  33. package/dist/chunk-6VFUO2H5.mjs.map +1 -0
  34. package/dist/chunk-7SN4Y44H.js +287 -0
  35. package/dist/chunk-7SN4Y44H.js.map +1 -0
  36. package/dist/chunk-ASOCIPDR.js +10 -0
  37. package/dist/chunk-ASOCIPDR.js.map +1 -0
  38. package/dist/chunk-B455GFXP.mjs +54 -0
  39. package/dist/chunk-B455GFXP.mjs.map +1 -0
  40. package/dist/chunk-DWS4BJTE.mjs +64 -0
  41. package/dist/chunk-DWS4BJTE.mjs.map +1 -0
  42. package/dist/chunk-EQRMXKXY.js +346 -0
  43. package/dist/chunk-EQRMXKXY.js.map +1 -0
  44. package/dist/chunk-EXGQAOQS.js +64 -0
  45. package/dist/chunk-EXGQAOQS.js.map +1 -0
  46. package/dist/chunk-EXJCMAUI.mjs +23 -0
  47. package/dist/chunk-EXJCMAUI.mjs.map +1 -0
  48. package/dist/chunk-FPG4GBXZ.js +30 -0
  49. package/dist/chunk-FPG4GBXZ.js.map +1 -0
  50. package/dist/chunk-FYTQTDZU.mjs +52 -0
  51. package/dist/chunk-FYTQTDZU.mjs.map +1 -0
  52. package/dist/chunk-G3IYVYVR.js +31 -0
  53. package/dist/chunk-G3IYVYVR.js.map +1 -0
  54. package/dist/chunk-GC7BNDLY.js +23 -0
  55. package/dist/chunk-GC7BNDLY.js.map +1 -0
  56. package/dist/chunk-GKG7TO7T.js +28 -0
  57. package/dist/chunk-GKG7TO7T.js.map +1 -0
  58. package/dist/chunk-GU2KH52B.mjs +53 -0
  59. package/dist/chunk-GU2KH52B.mjs.map +1 -0
  60. package/dist/chunk-GUXDSKV4.mjs +51 -0
  61. package/dist/chunk-GUXDSKV4.mjs.map +1 -0
  62. package/dist/chunk-HGYXRW5B.js +50 -0
  63. package/dist/chunk-HGYXRW5B.js.map +1 -0
  64. package/dist/chunk-HJ4276TR.mjs +41 -0
  65. package/dist/chunk-HJ4276TR.mjs.map +1 -0
  66. package/dist/chunk-HNLMKJBX.js +30 -0
  67. package/dist/chunk-HNLMKJBX.js.map +1 -0
  68. package/dist/chunk-IJYBCHVM.js +32 -0
  69. package/dist/chunk-IJYBCHVM.js.map +1 -0
  70. package/dist/chunk-IQTGFRWK.js +18 -0
  71. package/dist/chunk-IQTGFRWK.js.map +1 -0
  72. package/dist/chunk-IYAFFTJU.js +23 -0
  73. package/dist/chunk-IYAFFTJU.js.map +1 -0
  74. package/dist/chunk-JMISQ4HT.mjs +31 -0
  75. package/dist/chunk-JMISQ4HT.mjs.map +1 -0
  76. package/dist/chunk-K3TSXPME.js +16 -0
  77. package/dist/chunk-K3TSXPME.js.map +1 -0
  78. package/dist/{cjs/webpack/config.js → chunk-KKTPKAZN.mjs} +181 -153
  79. package/dist/chunk-KKTPKAZN.mjs.map +1 -0
  80. package/dist/chunk-KZFWI73A.js +28 -0
  81. package/dist/chunk-KZFWI73A.js.map +1 -0
  82. package/dist/chunk-L5TMG6BQ.js +37 -0
  83. package/dist/chunk-L5TMG6BQ.js.map +1 -0
  84. package/dist/chunk-MCN7UXG3.mjs +287 -0
  85. package/dist/chunk-MCN7UXG3.mjs.map +1 -0
  86. package/dist/chunk-MIV2UFTA.js +13 -0
  87. package/dist/chunk-MIV2UFTA.js.map +1 -0
  88. package/dist/chunk-MMBQXT2G.mjs +30 -0
  89. package/dist/chunk-MMBQXT2G.mjs.map +1 -0
  90. package/dist/chunk-NO53G7NT.js +61 -0
  91. package/dist/chunk-NO53G7NT.js.map +1 -0
  92. package/dist/chunk-O2QUFUOY.js +53 -0
  93. package/dist/chunk-O2QUFUOY.js.map +1 -0
  94. package/dist/chunk-OF4BF57X.mjs +22 -0
  95. package/dist/chunk-OF4BF57X.mjs.map +1 -0
  96. package/dist/chunk-OVCYXVWI.mjs +1 -0
  97. package/dist/chunk-OVCYXVWI.mjs.map +1 -0
  98. package/dist/chunk-PDNDGMB2.mjs +365 -0
  99. package/dist/chunk-PDNDGMB2.mjs.map +1 -0
  100. package/dist/chunk-QCP4QKMQ.mjs +24 -0
  101. package/dist/chunk-QCP4QKMQ.mjs.map +1 -0
  102. package/dist/chunk-QH4AQR33.mjs +61 -0
  103. package/dist/chunk-QH4AQR33.mjs.map +1 -0
  104. package/dist/chunk-S5ERYB6I.mjs +64 -0
  105. package/dist/chunk-S5ERYB6I.mjs.map +1 -0
  106. package/dist/chunk-SAEZHRJJ.mjs +23 -0
  107. package/dist/chunk-SAEZHRJJ.mjs.map +1 -0
  108. package/dist/chunk-T3KPXUAU.js +24 -0
  109. package/dist/chunk-T3KPXUAU.js.map +1 -0
  110. package/dist/chunk-T74IXMA3.mjs +50 -0
  111. package/dist/chunk-T74IXMA3.mjs.map +1 -0
  112. package/dist/chunk-TLTTWAEI.mjs +37 -0
  113. package/dist/chunk-TLTTWAEI.mjs.map +1 -0
  114. package/dist/chunk-TX4BG5GS.mjs +50 -0
  115. package/dist/chunk-TX4BG5GS.mjs.map +1 -0
  116. package/dist/chunk-UA5FEKKH.mjs +30 -0
  117. package/dist/chunk-UA5FEKKH.mjs.map +1 -0
  118. package/dist/chunk-UBWM7UOC.mjs +32 -0
  119. package/dist/chunk-UBWM7UOC.mjs.map +1 -0
  120. package/dist/chunk-USFFVX52.mjs +35 -0
  121. package/dist/chunk-USFFVX52.mjs.map +1 -0
  122. package/dist/chunk-V5Q5HRXB.mjs +30 -0
  123. package/dist/chunk-V5Q5HRXB.mjs.map +1 -0
  124. package/dist/chunk-VI3ZJJYO.mjs +346 -0
  125. package/dist/chunk-VI3ZJJYO.mjs.map +1 -0
  126. package/dist/chunk-VTJFPUIA.mjs +22 -0
  127. package/dist/chunk-VTJFPUIA.mjs.map +1 -0
  128. package/dist/chunk-WH7GOZP7.js +51 -0
  129. package/dist/chunk-WH7GOZP7.js.map +1 -0
  130. package/dist/chunk-WJNHZ4YF.js +35 -0
  131. package/dist/chunk-WJNHZ4YF.js.map +1 -0
  132. package/dist/chunk-WKL7DYYW.mjs +16 -0
  133. package/dist/chunk-WKL7DYYW.mjs.map +1 -0
  134. package/dist/chunk-X2RPNWBJ.mjs +24 -0
  135. package/dist/chunk-X2RPNWBJ.mjs.map +1 -0
  136. package/dist/chunk-X3D3MHWF.js +44 -0
  137. package/dist/chunk-X3D3MHWF.js.map +1 -0
  138. package/dist/chunk-X4FWMO4H.mjs +18 -0
  139. package/dist/chunk-X4FWMO4H.mjs.map +1 -0
  140. package/dist/chunk-Y5PQG4KA.js +1 -0
  141. package/dist/chunk-Y5PQG4KA.js.map +1 -0
  142. package/dist/chunk-YDLKS46R.js +30 -0
  143. package/dist/chunk-YDLKS46R.js.map +1 -0
  144. package/dist/chunk-YURDB35F.js +124 -0
  145. package/dist/chunk-YURDB35F.js.map +1 -0
  146. package/dist/chunk-YYYOE2GO.mjs +32 -0
  147. package/dist/chunk-YYYOE2GO.mjs.map +1 -0
  148. package/dist/chunk-ZOQ32RQI.mjs +135 -0
  149. package/dist/chunk-ZOQ32RQI.mjs.map +1 -0
  150. package/dist/cli.js +21 -0
  151. package/dist/cli.js.map +1 -0
  152. package/dist/cli.mjs +21 -0
  153. package/dist/cli.mjs.map +1 -0
  154. package/dist/commands/build/build.js +29 -0
  155. package/dist/commands/build/build.js.map +1 -0
  156. package/dist/commands/build/build.mjs +29 -0
  157. package/dist/commands/build/build.mjs.map +1 -0
  158. package/dist/commands/build/implementation.js +28 -0
  159. package/dist/commands/build/implementation.js.map +1 -0
  160. package/dist/commands/build/implementation.mjs +28 -0
  161. package/dist/commands/build/implementation.mjs.map +1 -0
  162. package/dist/commands/build/index.js +33 -0
  163. package/dist/commands/build/index.js.map +1 -0
  164. package/dist/commands/build/index.mjs +33 -0
  165. package/dist/commands/build/index.mjs.map +1 -0
  166. package/dist/commands/eval/eval.js +18 -0
  167. package/dist/commands/eval/eval.js.map +1 -0
  168. package/dist/commands/eval/eval.mjs +18 -0
  169. package/dist/commands/eval/eval.mjs.map +1 -0
  170. package/dist/commands/eval/implementation.js +9 -0
  171. package/dist/commands/eval/implementation.js.map +1 -0
  172. package/dist/commands/eval/implementation.mjs +9 -0
  173. package/dist/commands/eval/implementation.mjs.map +1 -0
  174. package/dist/commands/eval/index.js +22 -0
  175. package/dist/commands/eval/index.js.map +1 -0
  176. package/dist/commands/eval/index.mjs +22 -0
  177. package/dist/commands/eval/index.mjs.map +1 -0
  178. package/dist/commands/index.js +39 -0
  179. package/dist/commands/index.js.map +1 -0
  180. package/dist/commands/index.mjs +39 -0
  181. package/dist/commands/index.mjs.map +1 -0
  182. package/dist/commands/manifest/implementation.js +17 -0
  183. package/dist/commands/manifest/implementation.js.map +1 -0
  184. package/dist/commands/manifest/implementation.mjs +17 -0
  185. package/dist/commands/manifest/implementation.mjs.map +1 -0
  186. package/dist/commands/manifest/index.js +22 -0
  187. package/dist/commands/manifest/index.js.map +1 -0
  188. package/dist/commands/manifest/index.mjs +22 -0
  189. package/dist/commands/manifest/index.mjs.map +1 -0
  190. package/dist/commands/manifest/manifest.js +18 -0
  191. package/dist/commands/manifest/manifest.js.map +1 -0
  192. package/dist/commands/manifest/manifest.mjs +18 -0
  193. package/dist/commands/manifest/manifest.mjs.map +1 -0
  194. package/dist/commands/serve/index.js +29 -0
  195. package/dist/commands/serve/index.js.map +1 -0
  196. package/dist/commands/serve/index.mjs +29 -0
  197. package/dist/commands/serve/index.mjs.map +1 -0
  198. package/dist/commands/serve/serve.js +28 -0
  199. package/dist/commands/serve/serve.js.map +1 -0
  200. package/dist/commands/serve/serve.mjs +28 -0
  201. package/dist/commands/serve/serve.mjs.map +1 -0
  202. package/dist/commands/watch/implementation.js +28 -0
  203. package/dist/commands/watch/implementation.js.map +1 -0
  204. package/dist/commands/watch/implementation.mjs +28 -0
  205. package/dist/commands/watch/implementation.mjs.map +1 -0
  206. package/dist/commands/watch/index.js +33 -0
  207. package/dist/commands/watch/index.js.map +1 -0
  208. package/dist/commands/watch/index.mjs +33 -0
  209. package/dist/commands/watch/index.mjs.map +1 -0
  210. package/dist/commands/watch/watch.js +29 -0
  211. package/dist/commands/watch/watch.js.map +1 -0
  212. package/dist/commands/watch/watch.mjs +29 -0
  213. package/dist/commands/watch/watch.mjs.map +1 -0
  214. package/dist/config.js +36 -0
  215. package/dist/config.js.map +1 -0
  216. package/dist/config.mjs +36 -0
  217. package/dist/config.mjs.map +1 -0
  218. package/dist/errors.js +12 -0
  219. package/dist/errors.js.map +1 -0
  220. package/dist/errors.mjs +12 -0
  221. package/dist/errors.mjs.map +1 -0
  222. package/dist/index.js +43 -0
  223. package/dist/index.js.map +1 -0
  224. package/dist/index.mjs +43 -0
  225. package/dist/index.mjs.map +1 -0
  226. package/dist/main.js +49 -0
  227. package/dist/main.js.map +1 -0
  228. package/dist/main.mjs +49 -0
  229. package/dist/main.mjs.map +1 -0
  230. package/dist/structs.js +8 -0
  231. package/dist/structs.js.map +1 -0
  232. package/dist/structs.mjs +8 -0
  233. package/dist/structs.mjs.map +1 -0
  234. package/dist/tsconfig.build.tsbuildinfo +1 -0
  235. package/dist/types/commands/eval/implementation.d.ts +1 -1
  236. package/dist/types/config.d.ts +2 -2
  237. package/dist/types/structs.d.ts +20 -0
  238. package/dist/types/webpack/loaders/function.d.ts +34 -0
  239. package/dist/types/webpack/loaders/index.d.ts +3 -0
  240. package/dist/types/webpack/utils.d.ts +13 -11
  241. package/dist/types/yargs.d.js +1 -0
  242. package/dist/types/yargs.d.js.map +1 -0
  243. package/dist/types/yargs.d.mjs +2 -0
  244. package/dist/types/yargs.d.mjs.map +1 -0
  245. package/dist/utils/cli.js +14 -0
  246. package/dist/utils/cli.js.map +1 -0
  247. package/dist/utils/cli.mjs +14 -0
  248. package/dist/utils/cli.mjs.map +1 -0
  249. package/dist/utils/errors.js +11 -0
  250. package/dist/utils/errors.js.map +1 -0
  251. package/dist/utils/errors.mjs +11 -0
  252. package/dist/utils/errors.mjs.map +1 -0
  253. package/dist/utils/index.js +47 -0
  254. package/dist/utils/index.js.map +1 -0
  255. package/dist/utils/index.mjs +47 -0
  256. package/dist/utils/index.mjs.map +1 -0
  257. package/dist/utils/legacy.js +13 -0
  258. package/dist/utils/legacy.js.map +1 -0
  259. package/dist/utils/legacy.mjs +13 -0
  260. package/dist/utils/legacy.mjs.map +1 -0
  261. package/dist/utils/logging.js +12 -0
  262. package/dist/utils/logging.js.map +1 -0
  263. package/dist/utils/logging.mjs +12 -0
  264. package/dist/utils/logging.mjs.map +1 -0
  265. package/dist/utils/path.js +8 -0
  266. package/dist/utils/path.js.map +1 -0
  267. package/dist/utils/path.mjs +8 -0
  268. package/dist/utils/path.mjs.map +1 -0
  269. package/dist/utils/steps.js +11 -0
  270. package/dist/utils/steps.js.map +1 -0
  271. package/dist/utils/steps.mjs +11 -0
  272. package/dist/utils/steps.mjs.map +1 -0
  273. package/dist/webpack/compiler.js +25 -0
  274. package/dist/webpack/compiler.js.map +1 -0
  275. package/dist/webpack/compiler.mjs +25 -0
  276. package/dist/webpack/compiler.mjs.map +1 -0
  277. package/dist/webpack/config.js +24 -0
  278. package/dist/webpack/config.js.map +1 -0
  279. package/dist/webpack/config.mjs +24 -0
  280. package/dist/webpack/config.mjs.map +1 -0
  281. package/dist/webpack/index.js +44 -0
  282. package/dist/webpack/index.js.map +1 -0
  283. package/dist/webpack/index.mjs +44 -0
  284. package/dist/webpack/index.mjs.map +1 -0
  285. package/dist/webpack/loaders/browserify.js +19 -0
  286. package/dist/webpack/loaders/browserify.js.map +1 -0
  287. package/dist/webpack/loaders/browserify.mjs +19 -0
  288. package/dist/webpack/loaders/browserify.mjs.map +1 -0
  289. package/dist/webpack/loaders/function.js +10 -0
  290. package/dist/webpack/loaders/function.js.map +1 -0
  291. package/dist/webpack/loaders/function.mjs +10 -0
  292. package/dist/webpack/loaders/function.mjs.map +1 -0
  293. package/dist/webpack/loaders/index.js +25 -0
  294. package/dist/webpack/loaders/index.js.map +1 -0
  295. package/dist/webpack/loaders/index.mjs +25 -0
  296. package/dist/webpack/loaders/index.mjs.map +1 -0
  297. package/dist/webpack/loaders/wasm.js +16 -0
  298. package/dist/webpack/loaders/wasm.js.map +1 -0
  299. package/dist/webpack/loaders/wasm.mjs +16 -0
  300. package/dist/webpack/loaders/wasm.mjs.map +1 -0
  301. package/dist/webpack/plugins.js +29 -0
  302. package/dist/webpack/plugins.js.map +1 -0
  303. package/dist/webpack/plugins.mjs +29 -0
  304. package/dist/webpack/plugins.mjs.map +1 -0
  305. package/dist/webpack/server.js +10 -0
  306. package/dist/webpack/server.js.map +1 -0
  307. package/dist/webpack/server.mjs +10 -0
  308. package/dist/webpack/server.mjs.map +1 -0
  309. package/dist/webpack/utils.js +37 -0
  310. package/dist/webpack/utils.js.map +1 -0
  311. package/dist/webpack/utils.mjs +37 -0
  312. package/dist/webpack/utils.mjs.map +1 -0
  313. package/package.json +21 -21
  314. package/.browserslistrc +0 -3
  315. package/dist/cjs/builders.js +0 -148
  316. package/dist/cjs/builders.js.map +0 -1
  317. package/dist/cjs/cli.js +0 -68
  318. package/dist/cjs/cli.js.map +0 -1
  319. package/dist/cjs/commands/build/build.js +0 -54
  320. package/dist/cjs/commands/build/build.js.map +0 -1
  321. package/dist/cjs/commands/build/implementation.js +0 -31
  322. package/dist/cjs/commands/build/implementation.js.map +0 -1
  323. package/dist/cjs/commands/build/index.js +0 -45
  324. package/dist/cjs/commands/build/index.js.map +0 -1
  325. package/dist/cjs/commands/eval/eval.js +0 -57
  326. package/dist/cjs/commands/eval/eval.js.map +0 -1
  327. package/dist/cjs/commands/eval/implementation.js +0 -27
  328. package/dist/cjs/commands/eval/implementation.js.map +0 -1
  329. package/dist/cjs/commands/eval/index.js +0 -50
  330. package/dist/cjs/commands/eval/index.js.map +0 -1
  331. package/dist/cjs/commands/index.js +0 -30
  332. package/dist/cjs/commands/index.js.map +0 -1
  333. package/dist/cjs/commands/manifest/implementation.js +0 -34
  334. package/dist/cjs/commands/manifest/implementation.js.map +0 -1
  335. package/dist/cjs/commands/manifest/index.js +0 -50
  336. package/dist/cjs/commands/manifest/index.js.map +0 -1
  337. package/dist/cjs/commands/manifest/manifest.js +0 -55
  338. package/dist/cjs/commands/manifest/manifest.js.map +0 -1
  339. package/dist/cjs/commands/serve/index.js +0 -33
  340. package/dist/cjs/commands/serve/index.js.map +0 -1
  341. package/dist/cjs/commands/serve/serve.js +0 -21
  342. package/dist/cjs/commands/serve/serve.js.map +0 -1
  343. package/dist/cjs/commands/watch/implementation.js +0 -35
  344. package/dist/cjs/commands/watch/implementation.js.map +0 -1
  345. package/dist/cjs/commands/watch/index.js +0 -47
  346. package/dist/cjs/commands/watch/index.js.map +0 -1
  347. package/dist/cjs/commands/watch/watch.js +0 -51
  348. package/dist/cjs/commands/watch/watch.js.map +0 -1
  349. package/dist/cjs/config.js +0 -320
  350. package/dist/cjs/config.js.map +0 -1
  351. package/dist/cjs/errors.js +0 -37
  352. package/dist/cjs/errors.js.map +0 -1
  353. package/dist/cjs/index.js +0 -77
  354. package/dist/cjs/index.js.map +0 -1
  355. package/dist/cjs/main.js +0 -19
  356. package/dist/cjs/main.js.map +0 -1
  357. package/dist/cjs/utils/cli.js +0 -61
  358. package/dist/cjs/utils/cli.js.map +0 -1
  359. package/dist/cjs/utils/errors.js +0 -42
  360. package/dist/cjs/utils/errors.js.map +0 -1
  361. package/dist/cjs/utils/index.js +0 -25
  362. package/dist/cjs/utils/index.js.map +0 -1
  363. package/dist/cjs/utils/legacy.js +0 -48
  364. package/dist/cjs/utils/legacy.js.map +0 -1
  365. package/dist/cjs/utils/logging.js +0 -46
  366. package/dist/cjs/utils/logging.js.map +0 -1
  367. package/dist/cjs/utils/path.js +0 -16
  368. package/dist/cjs/utils/path.js.map +0 -1
  369. package/dist/cjs/utils/steps.js +0 -52
  370. package/dist/cjs/utils/steps.js.map +0 -1
  371. package/dist/cjs/webpack/compiler.js +0 -19
  372. package/dist/cjs/webpack/compiler.js.map +0 -1
  373. package/dist/cjs/webpack/config.js.map +0 -1
  374. package/dist/cjs/webpack/index.js +0 -23
  375. package/dist/cjs/webpack/index.js.map +0 -1
  376. package/dist/cjs/webpack/loaders/browserify.js +0 -97
  377. package/dist/cjs/webpack/loaders/browserify.js.map +0 -1
  378. package/dist/cjs/webpack/loaders/wasm.js +0 -92
  379. package/dist/cjs/webpack/loaders/wasm.js.map +0 -1
  380. package/dist/cjs/webpack/plugins.js +0 -341
  381. package/dist/cjs/webpack/plugins.js.map +0 -1
  382. package/dist/cjs/webpack/server.js +0 -139
  383. package/dist/cjs/webpack/server.js.map +0 -1
  384. package/dist/cjs/webpack/utils.js +0 -240
  385. package/dist/cjs/webpack/utils.js.map +0 -1
  386. package/dist/esm/builders.js +0 -130
  387. package/dist/esm/builders.js.map +0 -1
  388. package/dist/esm/cli.js +0 -56
  389. package/dist/esm/cli.js.map +0 -1
  390. package/dist/esm/commands/build/build.js +0 -51
  391. package/dist/esm/commands/build/build.js.map +0 -1
  392. package/dist/esm/commands/build/implementation.js +0 -27
  393. package/dist/esm/commands/build/implementation.js.map +0 -1
  394. package/dist/esm/commands/build/index.js +0 -17
  395. package/dist/esm/commands/build/index.js.map +0 -1
  396. package/dist/esm/commands/eval/eval.js +0 -54
  397. package/dist/esm/commands/eval/eval.js.map +0 -1
  398. package/dist/esm/commands/eval/implementation.js +0 -24
  399. package/dist/esm/commands/eval/implementation.js.map +0 -1
  400. package/dist/esm/commands/eval/index.js +0 -22
  401. package/dist/esm/commands/eval/index.js.map +0 -1
  402. package/dist/esm/commands/index.js +0 -15
  403. package/dist/esm/commands/index.js.map +0 -1
  404. package/dist/esm/commands/manifest/implementation.js +0 -33
  405. package/dist/esm/commands/manifest/implementation.js.map +0 -1
  406. package/dist/esm/commands/manifest/index.js +0 -22
  407. package/dist/esm/commands/manifest/index.js.map +0 -1
  408. package/dist/esm/commands/manifest/manifest.js +0 -52
  409. package/dist/esm/commands/manifest/manifest.js.map +0 -1
  410. package/dist/esm/commands/serve/index.js +0 -18
  411. package/dist/esm/commands/serve/index.js.map +0 -1
  412. package/dist/esm/commands/serve/serve.js +0 -17
  413. package/dist/esm/commands/serve/serve.js.map +0 -1
  414. package/dist/esm/commands/watch/implementation.js +0 -34
  415. package/dist/esm/commands/watch/implementation.js.map +0 -1
  416. package/dist/esm/commands/watch/index.js +0 -19
  417. package/dist/esm/commands/watch/index.js.map +0 -1
  418. package/dist/esm/commands/watch/watch.js +0 -50
  419. package/dist/esm/commands/watch/watch.js.map +0 -1
  420. package/dist/esm/config.js +0 -324
  421. package/dist/esm/config.js.map +0 -1
  422. package/dist/esm/errors.js +0 -30
  423. package/dist/esm/errors.js.map +0 -1
  424. package/dist/esm/index.js +0 -6
  425. package/dist/esm/index.js.map +0 -1
  426. package/dist/esm/main.js +0 -10
  427. package/dist/esm/main.js.map +0 -1
  428. package/dist/esm/utils/cli.js +0 -43
  429. package/dist/esm/utils/cli.js.map +0 -1
  430. package/dist/esm/utils/errors.js +0 -43
  431. package/dist/esm/utils/errors.js.map +0 -1
  432. package/dist/esm/utils/index.js +0 -8
  433. package/dist/esm/utils/index.js.map +0 -1
  434. package/dist/esm/utils/legacy.js +0 -47
  435. package/dist/esm/utils/legacy.js.map +0 -1
  436. package/dist/esm/utils/logging.js +0 -40
  437. package/dist/esm/utils/logging.js.map +0 -1
  438. package/dist/esm/utils/path.js +0 -13
  439. package/dist/esm/utils/path.js.map +0 -1
  440. package/dist/esm/utils/steps.js +0 -43
  441. package/dist/esm/utils/steps.js.map +0 -1
  442. package/dist/esm/webpack/compiler.js +0 -15
  443. package/dist/esm/webpack/compiler.js.map +0 -1
  444. package/dist/esm/webpack/config.js.map +0 -1
  445. package/dist/esm/webpack/index.js +0 -6
  446. package/dist/esm/webpack/index.js.map +0 -1
  447. package/dist/esm/webpack/loaders/browserify.js +0 -82
  448. package/dist/esm/webpack/loaders/browserify.js.map +0 -1
  449. package/dist/esm/webpack/loaders/wasm.js +0 -87
  450. package/dist/esm/webpack/loaders/wasm.js.map +0 -1
  451. package/dist/esm/webpack/plugins.js +0 -344
  452. package/dist/esm/webpack/plugins.js.map +0 -1
  453. package/dist/esm/webpack/server.js +0 -133
  454. package/dist/esm/webpack/server.js.map +0 -1
  455. package/dist/esm/webpack/utils.js +0 -271
  456. package/dist/esm/webpack/utils.js.map +0 -1
@@ -0,0 +1,346 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunkYDLKS46Rjs = require('./chunk-YDLKS46R.js');
4
+
5
+
6
+
7
+ var _chunk7SN4Y44Hjs = require('./chunk-7SN4Y44H.js');
8
+
9
+
10
+ var _chunkIJYBCHVMjs = require('./chunk-IJYBCHVM.js');
11
+
12
+
13
+
14
+
15
+ var _chunkG3IYVYVRjs = require('./chunk-G3IYVYVR.js');
16
+
17
+
18
+
19
+
20
+
21
+ var _chunkX3D3MHWFjs = require('./chunk-X3D3MHWF.js');
22
+
23
+ // src/webpack/plugins.ts
24
+ var _utils = require('@metamask/utils');
25
+ var _chalk = require('chalk');
26
+ var _module = require('module');
27
+ var _webpack = require('webpack');
28
+ var _spinner, _getStatsErrorMessage, getStatsErrorMessage_fn;
29
+ var SnapsStatsPlugin = class {
30
+ constructor(options = {
31
+ verbose: false
32
+ }, spinner) {
33
+ /**
34
+ * Get the error message for the given stats error.
35
+ *
36
+ * @param statsError - The stats error.
37
+ * @param color - The color to use for the error message.
38
+ * @returns The error message.
39
+ */
40
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _getStatsErrorMessage);
41
+ /**
42
+ * The spinner to use for logging.
43
+ */
44
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _spinner, void 0);
45
+ this.options = options;
46
+ _chunkX3D3MHWFjs.__privateSet.call(void 0, this, _spinner, spinner);
47
+ }
48
+ /**
49
+ * Apply the plugin to the Webpack compiler.
50
+ *
51
+ * @param compiler - The Webpack compiler.
52
+ */
53
+ apply(compiler) {
54
+ compiler.hooks.afterDone.tap(this.constructor.name, (stats) => {
55
+ if (!stats) {
56
+ return;
57
+ }
58
+ const { modules, time, errors, warnings } = stats.toJson();
59
+ _utils.assert.call(void 0, modules, "Modules must be defined in stats.");
60
+ _utils.assert.call(void 0, time, "Time must be defined in stats.");
61
+ if (_optionalChain([errors, 'optionalAccess', _2 => _2.length])) {
62
+ const formattedErrors = errors.map((statsError) => _chunkX3D3MHWFjs.__privateMethod.call(void 0, this, _getStatsErrorMessage, getStatsErrorMessage_fn).call(this, statsError)).join("\n\n");
63
+ _chunkG3IYVYVRjs.error.call(void 0,
64
+ `Compiled ${modules.length} ${_chunk7SN4Y44Hjs.pluralize.call(void 0,
65
+ modules.length,
66
+ "file"
67
+ )} in ${time}ms with ${errors.length} ${_chunk7SN4Y44Hjs.pluralize.call(void 0,
68
+ errors.length,
69
+ "error"
70
+ )}.
71
+
72
+ ${formattedErrors}
73
+ `,
74
+ _chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner)
75
+ );
76
+ _optionalChain([_chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner), 'optionalAccess', _3 => _3.stop, 'call', _4 => _4()]);
77
+ process.exitCode = 1;
78
+ return;
79
+ }
80
+ if (_optionalChain([warnings, 'optionalAccess', _5 => _5.length])) {
81
+ const formattedWarnings = warnings.map(
82
+ (statsWarning) => _chunkX3D3MHWFjs.__privateMethod.call(void 0, this, _getStatsErrorMessage, getStatsErrorMessage_fn).call(this, statsWarning, _chalk.yellow)
83
+ ).join("\n\n");
84
+ _chunkG3IYVYVRjs.warn.call(void 0,
85
+ `Compiled ${modules.length} ${_chunk7SN4Y44Hjs.pluralize.call(void 0,
86
+ modules.length,
87
+ "file"
88
+ )} in ${time}ms with ${warnings.length} ${_chunk7SN4Y44Hjs.pluralize.call(void 0,
89
+ warnings.length,
90
+ "warning"
91
+ )}.
92
+
93
+ ${formattedWarnings}
94
+ `,
95
+ _chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner)
96
+ );
97
+ } else {
98
+ _chunkG3IYVYVRjs.info.call(void 0,
99
+ `Compiled ${modules.length} ${_chunk7SN4Y44Hjs.pluralize.call(void 0,
100
+ modules.length,
101
+ "file"
102
+ )} in ${time}ms.`,
103
+ _chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner)
104
+ );
105
+ }
106
+ if (compiler.watchMode) {
107
+ _optionalChain([_chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner), 'optionalAccess', _6 => _6.succeed, 'call', _7 => _7("Done!")]);
108
+ }
109
+ });
110
+ }
111
+ };
112
+ _spinner = new WeakMap();
113
+ _getStatsErrorMessage = new WeakSet();
114
+ getStatsErrorMessage_fn = function(statsError, color = _chalk.red) {
115
+ const baseMessage = this.options.verbose ? _chunkIJYBCHVMjs.getErrorMessage.call(void 0, statsError) : statsError.message;
116
+ const [first, ...rest] = baseMessage.split("\n");
117
+ return [
118
+ color(_chunk7SN4Y44Hjs.formatText.call(void 0, `\u2022 ${first}`, 4, 2)),
119
+ ...rest.map((message) => _chunk7SN4Y44Hjs.formatText.call(void 0, color(message), 4)),
120
+ statsError.details && `
121
+ ${_chunk7SN4Y44Hjs.formatText.call(void 0, _chalk.dim.call(void 0, statsError.details), 6)}`
122
+ ].filter(Boolean).join("\n");
123
+ };
124
+ var _spinner2, _safeEvaluate, safeEvaluate_fn;
125
+ var SnapsWatchPlugin = class {
126
+ constructor(options, spinner) {
127
+ /**
128
+ * Safely evaluate the bundle at the given path. If an error occurs, it will
129
+ * be logged to the console, rather than throwing an error.
130
+ *
131
+ * This function should never throw an error.
132
+ *
133
+ * @param bundlePath - The path to the bundle.
134
+ */
135
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _safeEvaluate);
136
+ /**
137
+ * The spinner to use for logging.
138
+ */
139
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _spinner2, void 0);
140
+ this.options = options;
141
+ _chunkX3D3MHWFjs.__privateSet.call(void 0, this, _spinner2, spinner);
142
+ }
143
+ /**
144
+ * Apply the plugin to the Webpack compiler.
145
+ *
146
+ * @param compiler - The Webpack compiler.
147
+ */
148
+ apply(compiler) {
149
+ compiler.hooks.invalid.tap(this.constructor.name, (file) => {
150
+ _optionalChain([_chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner2), 'optionalAccess', _8 => _8.start, 'call', _9 => _9()]);
151
+ _chunkG3IYVYVRjs.info.call(void 0, `Changes detected in ${_chalk.yellow.call(void 0, file)}, recompiling.`, _chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner2));
152
+ });
153
+ compiler.hooks.afterEmit.tapPromise(
154
+ this.constructor.name,
155
+ async ({ fileDependencies }) => {
156
+ _optionalChain([this, 'access', _10 => _10.options, 'access', _11 => _11.files, 'optionalAccess', _12 => _12.forEach, 'call', _13 => _13(
157
+ fileDependencies.add.bind(fileDependencies)
158
+ )]);
159
+ if (this.options.bundle && this.options.evaluate) {
160
+ await _chunkX3D3MHWFjs.__privateMethod.call(void 0, this, _safeEvaluate, safeEvaluate_fn).call(this, this.options.bundle);
161
+ }
162
+ }
163
+ );
164
+ }
165
+ };
166
+ _spinner2 = new WeakMap();
167
+ _safeEvaluate = new WeakSet();
168
+ safeEvaluate_fn = async function(bundlePath) {
169
+ try {
170
+ await _chunkYDLKS46Rjs.evaluate.call(void 0, bundlePath);
171
+ _chunkG3IYVYVRjs.info.call(void 0, `Snap bundle evaluated successfully.`, _chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner2));
172
+ } catch (evaluateError) {
173
+ _chunkG3IYVYVRjs.error.call(void 0, evaluateError.message, _chunkX3D3MHWFjs.__privateGet.call(void 0, this, _spinner2));
174
+ }
175
+ };
176
+ var _source, _spinner3;
177
+ var SnapsBuiltInResolver = class {
178
+ constructor(options = {
179
+ ignore: []
180
+ }, spinner) {
181
+ /**
182
+ * The built-in modules that have been imported, but not resolved.
183
+ */
184
+ this.unresolvedModules = /* @__PURE__ */ new Set();
185
+ /**
186
+ * The name of the resolver hook to tap into.
187
+ */
188
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _source, "described-resolve");
189
+ /**
190
+ * The spinner to use for logging.
191
+ */
192
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _spinner3, void 0);
193
+ this.options = options;
194
+ _chunkX3D3MHWFjs.__privateSet.call(void 0, this, _spinner3, spinner);
195
+ }
196
+ /**
197
+ * Apply the plugin to the Webpack resolver.
198
+ *
199
+ * @param resolver - The Webpack resolver.
200
+ */
201
+ apply(resolver) {
202
+ resolver.getHook(_chunkX3D3MHWFjs.__privateGet.call(void 0, this, _source)).tapAsync(
203
+ this.constructor.name,
204
+ ({ module: isModule, request }, _, callback) => {
205
+ if (!isModule || !request) {
206
+ return callback();
207
+ }
208
+ const baseRequest = request.split("/")[0];
209
+ if (_module.isBuiltin.call(void 0, baseRequest) && !_optionalChain([this, 'access', _14 => _14.options, 'access', _15 => _15.ignore, 'optionalAccess', _16 => _16.includes, 'call', _17 => _17(baseRequest)])) {
210
+ const fallback = resolver.options.fallback.find(
211
+ ({ name }) => name === baseRequest
212
+ );
213
+ if (fallback && !fallback.alias) {
214
+ this.unresolvedModules.add(baseRequest);
215
+ }
216
+ }
217
+ return callback();
218
+ }
219
+ );
220
+ }
221
+ };
222
+ _source = new WeakMap();
223
+ _spinner3 = new WeakMap();
224
+ var _checkBuiltIns, checkBuiltIns_fn, _isProvidePlugin, isProvidePlugin_fn, _checkBuffer, checkBuffer_fn;
225
+ var SnapsBundleWarningsPlugin = class {
226
+ constructor(options = {
227
+ buffer: true,
228
+ builtIns: true
229
+ }) {
230
+ /**
231
+ * Check if a built-in module is used, but not provided by Webpack's
232
+ * `fallback` configuration.
233
+ *
234
+ * @param compiler - The Webpack compiler.
235
+ */
236
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _checkBuiltIns);
237
+ /**
238
+ * Check if the given instance is a `ProvidePlugin`. This is not guaranteed to
239
+ * be accurate, but it's good enough for our purposes. If we were to use
240
+ * `instanceof` instead, it might not work if multiple versions of Webpack are
241
+ * installed.
242
+ *
243
+ * @param instance - The instance to check.
244
+ * @returns Whether the instance is a `ProvidePlugin`, i.e., whether it's an
245
+ * object with the name `ProvidePlugin` and a `definitions` property.
246
+ */
247
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _isProvidePlugin);
248
+ /**
249
+ * Check if the `Buffer` global is used, but not provided by Webpack's
250
+ * `DefinePlugin`.
251
+ *
252
+ * @param compiler - The Webpack compiler.
253
+ */
254
+ _chunkX3D3MHWFjs.__privateAdd.call(void 0, this, _checkBuffer);
255
+ this.options = options;
256
+ }
257
+ /**
258
+ * Apply the plugin to the Webpack compiler.
259
+ *
260
+ * @param compiler - The Webpack compiler.
261
+ */
262
+ apply(compiler) {
263
+ if (this.options.builtIns) {
264
+ _chunkX3D3MHWFjs.__privateMethod.call(void 0, this, _checkBuiltIns, checkBuiltIns_fn).call(this, compiler);
265
+ }
266
+ if (this.options.buffer) {
267
+ _chunkX3D3MHWFjs.__privateMethod.call(void 0, this, _checkBuffer, checkBuffer_fn).call(this, compiler);
268
+ }
269
+ }
270
+ };
271
+ _checkBuiltIns = new WeakSet();
272
+ checkBuiltIns_fn = function(compiler) {
273
+ compiler.hooks.afterCompile.tap(this.constructor.name, (compilation) => {
274
+ if (!this.options.builtInResolver) {
275
+ return;
276
+ }
277
+ const { unresolvedModules } = this.options.builtInResolver;
278
+ if (unresolvedModules.size === 0) {
279
+ return;
280
+ }
281
+ const formattedModules = new Array(...unresolvedModules).map((name) => `\u2022 ${name}`).join("\n");
282
+ const webpackError = new (0, _webpack.WebpackError)(
283
+ `The snap attempted to use one or more Node.js builtins, but no browser fallback has been provided. The MetaMask Snaps CLI does not support Node.js builtins by default. If you want to use this module, you must set ${_chalk.bold.call(void 0,
284
+ "`polyfills`"
285
+ )} to ${_chalk.bold.call(void 0,
286
+ "`true`"
287
+ )} or an object with the builtins to polyfill as the key and ${_chalk.bold.call(void 0,
288
+ "`true`"
289
+ )} as the value. To disable this warning, set ${_chalk.bold.call(void 0,
290
+ "`stats.builtIns`"
291
+ )} to ${_chalk.bold.call(void 0,
292
+ "`false`"
293
+ )} in your snap config file, or add the module to the ${_chalk.bold.call(void 0,
294
+ "`stats.builtIns.ignore`"
295
+ )} array.`
296
+ );
297
+ webpackError.details = formattedModules;
298
+ compilation.warnings.push(webpackError);
299
+ });
300
+ };
301
+ _isProvidePlugin = new WeakSet();
302
+ isProvidePlugin_fn = function(instance) {
303
+ return _utils.isObject.call(void 0, instance) && instance.constructor.name === "ProvidePlugin" && _utils.hasProperty.call(void 0, instance, "definitions");
304
+ };
305
+ _checkBuffer = new WeakSet();
306
+ checkBuffer_fn = function(compiler) {
307
+ const plugin = _optionalChain([compiler, 'access', _18 => _18.options, 'access', _19 => _19.plugins, 'optionalAccess', _20 => _20.find, 'call', _21 => _21(
308
+ (instance) => _chunkX3D3MHWFjs.__privateMethod.call(void 0, this, _isProvidePlugin, isProvidePlugin_fn).call(this, instance)
309
+ )]);
310
+ if (plugin) {
311
+ const { definitions } = plugin;
312
+ if (definitions.Buffer) {
313
+ return;
314
+ }
315
+ }
316
+ compiler.hooks.compilation.tap(this.constructor.name, (compilation) => {
317
+ compilation.hooks.afterProcessAssets.tap(
318
+ this.constructor.name,
319
+ (assets) => {
320
+ const bufferAssets = Object.entries(assets).filter(([name]) => name.endsWith(".js")).filter(([, asset]) => asset.source().includes("Buffer"));
321
+ if (bufferAssets.length === 0) {
322
+ return;
323
+ }
324
+ compilation.warnings.push(
325
+ new (0, _webpack.WebpackError)(
326
+ `The snap attempted to use the Node.js Buffer global, which is not supported in the MetaMask Snaps CLI by default. To use the Buffer global, you must polyfill Buffer by setting ${_chalk.bold.call(void 0,
327
+ "`buffer`"
328
+ )} to ${_chalk.bold.call(void 0, "`true`")} in the ${_chalk.bold.call(void 0,
329
+ "`polyfills`"
330
+ )} config object in your snap config. To disable this warning, set ${_chalk.bold.call(void 0,
331
+ "`stats.buffer`"
332
+ )} to ${_chalk.bold.call(void 0, "`false`")} in your snap config file.`
333
+ )
334
+ );
335
+ }
336
+ );
337
+ });
338
+ };
339
+
340
+
341
+
342
+
343
+
344
+
345
+ exports.SnapsStatsPlugin = SnapsStatsPlugin; exports.SnapsWatchPlugin = SnapsWatchPlugin; exports.SnapsBuiltInResolver = SnapsBuiltInResolver; exports.SnapsBundleWarningsPlugin = SnapsBundleWarningsPlugin;
346
+ //# sourceMappingURL=chunk-EQRMXKXY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/webpack/plugins.ts"],"names":["_spinner"],"mappings":"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","sourcesContent":["import { assert, hasProperty, isObject } from '@metamask/utils';\nimport { bold, dim, red, yellow } from 'chalk';\nimport { isBuiltin } from 'module';\nimport type { Ora } from 'ora';\nimport type {\n Compiler,\n ProvidePlugin,\n ResolvePluginInstance,\n Resolver,\n StatsError,\n WebpackPluginInstance,\n} from 'webpack';\nimport { WebpackError } from 'webpack';\n\nimport { evaluate } from '../commands/eval';\nimport { error, getErrorMessage, info, warn } from '../utils';\nimport { formatText, pluralize } from './utils';\n\nexport type SnapsStatsPluginOptions = {\n /**\n * Whether to log the verbose stats.\n */\n verbose?: boolean;\n};\n\n/**\n * A plugin that logs the stats after compilation. This is useful for logging\n * the number of files compiled, and the time taken to compile them.\n */\nexport class SnapsStatsPlugin implements WebpackPluginInstance {\n /**\n * The options for the plugin.\n */\n readonly options: SnapsStatsPluginOptions;\n\n /**\n * The spinner to use for logging.\n */\n readonly #spinner?: Ora;\n\n constructor(\n options: SnapsStatsPluginOptions = {\n verbose: false,\n },\n spinner?: Ora,\n ) {\n this.options = options;\n this.#spinner = spinner;\n }\n\n /**\n * Apply the plugin to the Webpack compiler.\n *\n * @param compiler - The Webpack compiler.\n */\n apply(compiler: Compiler) {\n compiler.hooks.afterDone.tap(this.constructor.name, (stats) => {\n if (!stats) {\n return;\n }\n\n const { modules, time, errors, warnings } = stats.toJson();\n\n assert(modules, 'Modules must be defined in stats.');\n assert(time, 'Time must be defined in stats.');\n\n if (errors?.length) {\n const formattedErrors = errors\n .map((statsError) => this.#getStatsErrorMessage(statsError))\n .join('\\n\\n');\n\n error(\n `Compiled ${modules.length} ${pluralize(\n modules.length,\n 'file',\n )} in ${time}ms with ${errors.length} ${pluralize(\n errors.length,\n 'error',\n )}.\\n\\n${formattedErrors}\\n`,\n this.#spinner,\n );\n\n this.#spinner?.stop();\n\n process.exitCode = 1;\n return;\n }\n\n if (warnings?.length) {\n const formattedWarnings = warnings\n .map((statsWarning) =>\n this.#getStatsErrorMessage(statsWarning, yellow),\n )\n .join('\\n\\n');\n\n warn(\n `Compiled ${modules.length} ${pluralize(\n modules.length,\n 'file',\n )} in ${time}ms with ${warnings.length} ${pluralize(\n warnings.length,\n 'warning',\n )}.\\n\\n${formattedWarnings}\\n`,\n this.#spinner,\n );\n } else {\n info(\n `Compiled ${modules.length} ${pluralize(\n modules.length,\n 'file',\n )} in ${time}ms.`,\n this.#spinner,\n );\n }\n\n if (compiler.watchMode) {\n // The spinner may be restarted by the watch plugin, outside of the\n // `executeSteps` flow, so we stop it here just in case.\n this.#spinner?.succeed('Done!');\n }\n });\n }\n\n /**\n * Get the error message for the given stats error.\n *\n * @param statsError - The stats error.\n * @param color - The color to use for the error message.\n * @returns The error message.\n */\n #getStatsErrorMessage(statsError: StatsError, color = red) {\n const baseMessage = this.options.verbose\n ? getErrorMessage(statsError)\n : statsError.message;\n\n const [first, ...rest] = baseMessage.split('\\n');\n\n return [\n color(formatText(`• ${first}`, 4, 2)),\n ...rest.map((message) => formatText(color(message), 4)),\n statsError.details && `\\n${formatText(dim(statsError.details), 6)}`,\n ]\n .filter(Boolean)\n .join('\\n');\n }\n}\n\n/**\n * The options for the {@link SnapsWatchPlugin}.\n */\nexport type SnapsWatchPluginOptions = {\n /**\n * The bundle path. This is the file that will be evaluated, if the `evaluate`\n * option is set.\n */\n bundle?: string;\n\n /**\n * Whether to evaluate the bundle. This only applies if the `bundle` option is\n * set.\n */\n evaluate?: boolean;\n\n /**\n * The extra files to watch.\n */\n files?: string[];\n};\n\n/**\n * A plugin that adds extra files to watch. This is useful for watching files\n * that are not imported by the entry point, such as the `snap.manifest.json`\n * file.\n */\nexport class SnapsWatchPlugin implements WebpackPluginInstance {\n /**\n * The options for the plugin.\n */\n readonly options: SnapsWatchPluginOptions;\n\n /**\n * The spinner to use for logging.\n */\n readonly #spinner?: Ora;\n\n constructor(options: SnapsWatchPluginOptions, spinner?: Ora) {\n this.options = options;\n this.#spinner = spinner;\n }\n\n /**\n * Apply the plugin to the Webpack compiler.\n *\n * @param compiler - The Webpack compiler.\n */\n apply(compiler: Compiler) {\n compiler.hooks.invalid.tap(this.constructor.name, (file) => {\n this.#spinner?.start();\n info(`Changes detected in ${yellow(file)}, recompiling.`, this.#spinner);\n });\n\n compiler.hooks.afterEmit.tapPromise(\n this.constructor.name,\n async ({ fileDependencies }) => {\n this.options.files?.forEach(\n fileDependencies.add.bind(fileDependencies),\n );\n\n if (this.options.bundle && this.options.evaluate) {\n await this.#safeEvaluate(this.options.bundle);\n }\n },\n );\n }\n\n /**\n * Safely evaluate the bundle at the given path. If an error occurs, it will\n * be logged to the console, rather than throwing an error.\n *\n * This function should never throw an error.\n *\n * @param bundlePath - The path to the bundle.\n */\n async #safeEvaluate(bundlePath: string) {\n try {\n await evaluate(bundlePath);\n info(`Snap bundle evaluated successfully.`, this.#spinner);\n } catch (evaluateError) {\n error(evaluateError.message, this.#spinner);\n }\n }\n}\n\n/**\n * The options for the {@link SnapsBuiltInResolver}.\n */\nexport type SnapsBuiltInResolverOptions = {\n /**\n * The built-in modules to ignore.\n */\n ignore?: string[];\n};\n\n/**\n * A plugin that logs a message when a built-in module is not resolved. The\n * MetaMask Snaps CLI does not support built-in modules by default, and this\n * plugin is used to warn the user when they try to import a built-in module,\n * when no fallback is configured.\n */\nexport class SnapsBuiltInResolver implements ResolvePluginInstance {\n /**\n * The built-in modules that have been imported, but not resolved.\n */\n readonly unresolvedModules = new Set<string>();\n\n /**\n * The name of the resolver hook to tap into.\n */\n readonly #source = 'described-resolve';\n\n /**\n * The options for the plugin.\n */\n readonly options: SnapsBuiltInResolverOptions;\n\n /**\n * The spinner to use for logging.\n */\n readonly #spinner?: Ora;\n\n constructor(\n options: SnapsBuiltInResolverOptions = {\n ignore: [],\n },\n spinner?: Ora,\n ) {\n this.options = options;\n this.#spinner = spinner;\n }\n\n /**\n * Apply the plugin to the Webpack resolver.\n *\n * @param resolver - The Webpack resolver.\n */\n apply(resolver: Resolver) {\n resolver\n .getHook(this.#source)\n .tapAsync(\n this.constructor.name,\n ({ module: isModule, request }, _, callback) => {\n if (!isModule || !request) {\n return callback();\n }\n\n const baseRequest = request.split('/')[0];\n if (\n isBuiltin(baseRequest) &&\n !this.options.ignore?.includes(baseRequest)\n ) {\n const fallback = resolver.options.fallback.find(\n ({ name }) => name === baseRequest,\n );\n\n if (fallback && !fallback.alias) {\n this.unresolvedModules.add(baseRequest);\n }\n }\n\n return callback();\n },\n );\n }\n}\n\n/**\n * The options for the {@link SnapsBundleWarningsPlugin}.\n */\nexport type SnapsBundleWarningsPluginOptions = {\n /**\n * The {@link SnapsBuiltInResolver} instance to use for detecting built-in\n * modules.\n */\n builtInResolver?: SnapsBuiltInResolver | false;\n\n /**\n * Whether to show warnings if built-in modules are used, but not provided by\n * Webpack's `fallback` configuration.\n */\n builtIns?: boolean;\n\n /**\n * Whether to show warnings if the `Buffer` global is used, but not provided\n * by Webpack's `DefinePlugin`.\n */\n buffer?: boolean;\n};\n\n/**\n * A plugin that logs a message when:\n *\n * - A built-in module is not resolved. The MetaMask Snaps CLI does not support\n * built-in modules by default, and this plugin is used to warn the user when\n * they try to import a built-in module, when no fallback is configured.\n * - A snap uses the `Buffer` global. The MetaMask Snaps CLI does not support\n * the `Buffer` global by default, and this plugin is used to warn the user when\n * they try to use the `Buffer` global.\n *\n * We use both a resolver and a plugin, because the resolver is used to detect\n * when a built-in module is imported, and the plugin is used to log a single\n * message when the compilation is complete. We can't do everything in a single\n * plugin, because the resolver doesn't have access to the compilation, and the\n * plugin doesn't have access to the resolver.\n */\n\nexport class SnapsBundleWarningsPlugin implements WebpackPluginInstance {\n /**\n * The options for the plugin.\n */\n readonly options: SnapsBundleWarningsPluginOptions;\n\n constructor(\n options: SnapsBundleWarningsPluginOptions = {\n buffer: true,\n builtIns: true,\n },\n ) {\n this.options = options;\n }\n\n /**\n * Apply the plugin to the Webpack compiler.\n *\n * @param compiler - The Webpack compiler.\n */\n apply(compiler: Compiler) {\n if (this.options.builtIns) {\n this.#checkBuiltIns(compiler);\n }\n\n if (this.options.buffer) {\n this.#checkBuffer(compiler);\n }\n }\n\n /**\n * Check if a built-in module is used, but not provided by Webpack's\n * `fallback` configuration.\n *\n * @param compiler - The Webpack compiler.\n */\n #checkBuiltIns(compiler: Compiler) {\n compiler.hooks.afterCompile.tap(this.constructor.name, (compilation) => {\n if (!this.options.builtInResolver) {\n return;\n }\n\n const { unresolvedModules } = this.options.builtInResolver;\n if (unresolvedModules.size === 0) {\n return;\n }\n\n const formattedModules = new Array(...unresolvedModules)\n .map((name) => `• ${name}`)\n .join('\\n');\n\n const webpackError = new WebpackError(\n `The snap attempted to use one or more Node.js builtins, but no browser fallback has been provided. The MetaMask Snaps CLI does not support Node.js builtins by default. If you want to use this module, you must set ${bold(\n '`polyfills`',\n )} to ${bold(\n '`true`',\n )} or an object with the builtins to polyfill as the key and ${bold(\n '`true`',\n )} as the value. To disable this warning, set ${bold(\n '`stats.builtIns`',\n )} to ${bold(\n '`false`',\n )} in your snap config file, or add the module to the ${bold(\n '`stats.builtIns.ignore`',\n )} array.`,\n );\n\n webpackError.details = formattedModules;\n compilation.warnings.push(webpackError);\n });\n }\n\n /**\n * Check if the given instance is a `ProvidePlugin`. This is not guaranteed to\n * be accurate, but it's good enough for our purposes. If we were to use\n * `instanceof` instead, it might not work if multiple versions of Webpack are\n * installed.\n *\n * @param instance - The instance to check.\n * @returns Whether the instance is a `ProvidePlugin`, i.e., whether it's an\n * object with the name `ProvidePlugin` and a `definitions` property.\n */\n #isProvidePlugin(instance: unknown): instance is ProvidePlugin {\n return (\n isObject(instance) &&\n instance.constructor.name === 'ProvidePlugin' &&\n hasProperty(instance, 'definitions')\n );\n }\n\n /**\n * Check if the `Buffer` global is used, but not provided by Webpack's\n * `DefinePlugin`.\n *\n * @param compiler - The Webpack compiler.\n */\n #checkBuffer(compiler: Compiler) {\n const plugin = compiler.options.plugins?.find((instance) =>\n this.#isProvidePlugin(instance),\n ) as ProvidePlugin | undefined;\n\n // If the `ProvidePlugin` is configured to provide `Buffer`, then we don't\n // need to warn the user.\n if (plugin) {\n const { definitions } = plugin;\n if (definitions.Buffer) {\n return;\n }\n }\n\n compiler.hooks.compilation.tap(this.constructor.name, (compilation) => {\n compilation.hooks.afterProcessAssets.tap(\n this.constructor.name,\n (assets) => {\n // Check if assets use `Buffer`.\n const bufferAssets = Object.entries(assets)\n .filter(([name]) => name.endsWith('.js'))\n .filter(([, asset]) => asset.source().includes('Buffer'));\n\n if (bufferAssets.length === 0) {\n return;\n }\n\n compilation.warnings.push(\n new WebpackError(\n `The snap attempted to use the Node.js Buffer global, which is not supported in the MetaMask Snaps CLI by default. To use the Buffer global, you must polyfill Buffer by setting ${bold(\n '`buffer`',\n )} to ${bold('`true`')} in the ${bold(\n '`polyfills`',\n )} config object in your snap config. To disable this warning, set ${bold(\n '`stats.buffer`',\n )} to ${bold('`false`')} in your snap config file.`,\n ),\n );\n },\n );\n });\n }\n}\n"]}
@@ -0,0 +1,64 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
+
3
+ var _chunk2QVYYMUDjs = require('./chunk-2QVYYMUD.js');
4
+
5
+
6
+ var _chunkL5TMG6BQjs = require('./chunk-L5TMG6BQ.js');
7
+
8
+
9
+ var _chunkIJYBCHVMjs = require('./chunk-IJYBCHVM.js');
10
+
11
+
12
+ var _chunkG3IYVYVRjs = require('./chunk-G3IYVYVR.js');
13
+
14
+
15
+ var _chunk6NJAXMSBjs = require('./chunk-6NJAXMSB.js');
16
+
17
+ // src/cli.ts
18
+ var _semver = require('semver'); var _semver2 = _interopRequireDefault(_semver);
19
+ var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);
20
+ var _helpers = require('yargs/helpers');
21
+ var MINIMUM_NODE_16_VERSION = "16.17.0";
22
+ var MINIMUM_NODE_18_VERSION = "18.6.0";
23
+ function checkNodeVersion(nodeVersion = process.version.slice(1)) {
24
+ const majorVersion = _semver2.default.major(nodeVersion);
25
+ const message = `Node version ${nodeVersion} is not supported. Please use Node ${MINIMUM_NODE_16_VERSION} or later.`;
26
+ if (majorVersion < 16) {
27
+ _chunkG3IYVYVRjs.error.call(void 0, message);
28
+ process.exit(1);
29
+ }
30
+ if (majorVersion === 16 && _semver2.default.lt(nodeVersion, MINIMUM_NODE_16_VERSION)) {
31
+ _chunkG3IYVYVRjs.error.call(void 0, message);
32
+ process.exit(1);
33
+ }
34
+ if (majorVersion === 18 && _semver2.default.lt(nodeVersion, MINIMUM_NODE_18_VERSION)) {
35
+ _chunkG3IYVYVRjs.error.call(void 0,
36
+ `Node version ${nodeVersion} is not supported. Please use Node ${MINIMUM_NODE_18_VERSION} or later.`
37
+ );
38
+ process.exit(1);
39
+ }
40
+ }
41
+ async function cli(argv, commands) {
42
+ checkNodeVersion();
43
+ await _yargs2.default.call(void 0, _helpers.hideBin.call(void 0, argv)).scriptName("mm-snap").usage("Usage: $0 <command> [options]").example("$0 build", `Build './src/index.js' as './dist/bundle.js'`).example(
44
+ "$0 build --config ./snap.config.build.ts",
45
+ `Build './src/index.js' as './dist/bundle.js' using the config in './snap.config.build.ts'`
46
+ ).example("$0 manifest --fix", `Check the snap manifest, and fix any errors`).example(
47
+ "$0 watch --port 8000",
48
+ `The snap input file for changes, and serve it on port 8000`
49
+ ).example("$0 serve --port 8000", `Serve the snap bundle on port 8000`).command(commands).option("config", _chunk6NJAXMSBjs.builders_default.config).option("verboseErrors", _chunk6NJAXMSBjs.builders_default.verboseErrors).option("suppressWarnings", _chunk6NJAXMSBjs.builders_default.suppressWarnings).strict().middleware(async (args) => {
50
+ args.context = {
51
+ config: await _chunk2QVYYMUDjs.getConfigByArgv.call(void 0, args)
52
+ };
53
+ _chunkL5TMG6BQjs.sanitizeInputs.call(void 0, args);
54
+ }, false).demandCommand(1, "You must specify at least one command.").fail((message, failure) => {
55
+ _chunkG3IYVYVRjs.error.call(void 0, _chunkIJYBCHVMjs.getYargsErrorMessage.call(void 0, message, failure));
56
+ process.exit(1);
57
+ }).help().alias("help", "h").parseAsync();
58
+ }
59
+
60
+
61
+
62
+
63
+ exports.checkNodeVersion = checkNodeVersion; exports.cli = cli;
64
+ //# sourceMappingURL=chunk-EXGQAOQS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,SAAS,eAAe;AAMxB,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAQzB,SAAS,iBACd,cAAsB,QAAQ,QAAQ,MAAM,CAAC,GAC7C;AACA,QAAM,eAAe,OAAO,MAAM,WAAW;AAC7C,QAAM,UAAU,gBAAgB,WAAW,sCAAsC,uBAAuB;AAExG,MAAI,eAAe,IAAI;AACrB,UAAM,OAAO;AAEb,YAAQ,KAAK,CAAC;AAAA,EAChB;AAIA,MAAI,iBAAiB,MAAM,OAAO,GAAG,aAAa,uBAAuB,GAAG;AAC1E,UAAM,OAAO;AAEb,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,MAAI,iBAAiB,MAAM,OAAO,GAAG,aAAa,uBAAuB,GAAG;AAC1E;AAAA,MACE,gBAAgB,WAAW,sCAAsC,uBAAuB;AAAA,IAC1F;AAEA,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AASA,eAAsB,IAAI,MAAgB,UAAe;AACvD,mBAAiB;AAEjB,QAAM,MAAM,QAAQ,IAAI,CAAC,EACtB,WAAW,SAAS,EACpB,MAAM,+BAA+B,EAErC,QAAQ,YAAY,8CAA8C,EAClE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,QAAQ,qBAAqB,6CAA6C,EAC1E;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,QAAQ,wBAAwB,oCAAoC,EAEpE,QAAQ,QAAQ,EAEhB,OAAO,UAAU,iBAAS,MAAM,EAChC,OAAO,iBAAiB,iBAAS,aAAa,EAC9C,OAAO,oBAAoB,iBAAS,gBAAgB,EAEpD,OAAO,EAEP,WAAW,OAAO,SAAc;AAE/B,SAAK,UAAU;AAAA,MACb,QAAQ,MAAM,gBAAgB,IAAI;AAAA,IACpC;AAEA,mBAAe,IAAI;AAAA,EACrB,GAAG,KAAK,EAEP,cAAc,GAAG,wCAAwC,EAEzD,KAAK,CAAC,SAAS,YAAY;AAC1B,UAAM,qBAAqB,SAAS,OAAO,CAAC;AAE5C,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC,EAEA,KAAK,EACL,MAAM,QAAQ,GAAG,EACjB,WAAW;AAChB","sourcesContent":["import semver from 'semver';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\n\nimport builders from './builders';\nimport { getConfigByArgv } from './config';\nimport { error, getYargsErrorMessage, sanitizeInputs } from './utils';\n\nconst MINIMUM_NODE_16_VERSION = '16.17.0';\nconst MINIMUM_NODE_18_VERSION = '18.6.0';\n\n/**\n * Check the Node version. If the Node version is less than the minimum required\n * version, this logs an error and exits the process.\n *\n * @param nodeVersion - The Node version to check.\n */\nexport function checkNodeVersion(\n nodeVersion: string = process.version.slice(1),\n) {\n const majorVersion = semver.major(nodeVersion);\n const message = `Node version ${nodeVersion} is not supported. Please use Node ${MINIMUM_NODE_16_VERSION} or later.`;\n\n if (majorVersion < 16) {\n error(message);\n // eslint-disable-next-line n/no-process-exit\n process.exit(1);\n }\n\n // Node 16 and 18 have a different minimum version requirement, so we need to\n // check for both.\n if (majorVersion === 16 && semver.lt(nodeVersion, MINIMUM_NODE_16_VERSION)) {\n error(message);\n // eslint-disable-next-line n/no-process-exit\n process.exit(1);\n }\n\n if (majorVersion === 18 && semver.lt(nodeVersion, MINIMUM_NODE_18_VERSION)) {\n error(\n `Node version ${nodeVersion} is not supported. Please use Node ${MINIMUM_NODE_18_VERSION} or later.`,\n );\n // eslint-disable-next-line n/no-process-exit\n process.exit(1);\n }\n}\n\n/**\n * The main CLI entry point function. This processes the command line args, and\n * runs the appropriate function.\n *\n * @param argv - The raw command line arguments, i.e., `process.argv`.\n * @param commands - The list of commands to use.\n */\nexport async function cli(argv: string[], commands: any) {\n checkNodeVersion();\n\n await yargs(hideBin(argv))\n .scriptName('mm-snap')\n .usage('Usage: $0 <command> [options]')\n\n .example('$0 build', `Build './src/index.js' as './dist/bundle.js'`)\n .example(\n '$0 build --config ./snap.config.build.ts',\n `Build './src/index.js' as './dist/bundle.js' using the config in './snap.config.build.ts'`,\n )\n .example('$0 manifest --fix', `Check the snap manifest, and fix any errors`)\n .example(\n '$0 watch --port 8000',\n `The snap input file for changes, and serve it on port 8000`,\n )\n .example('$0 serve --port 8000', `Serve the snap bundle on port 8000`)\n\n .command(commands)\n\n .option('config', builders.config)\n .option('verboseErrors', builders.verboseErrors)\n .option('suppressWarnings', builders.suppressWarnings)\n\n .strict()\n\n .middleware(async (args: any) => {\n // eslint-disable-next-line require-atomic-updates\n args.context = {\n config: await getConfigByArgv(args),\n };\n\n sanitizeInputs(args);\n }, false)\n\n .demandCommand(1, 'You must specify at least one command.')\n\n .fail((message, failure) => {\n error(getYargsErrorMessage(message, failure));\n // eslint-disable-next-line n/no-process-exit\n process.exit(1);\n })\n\n .help()\n .alias('help', 'h')\n .parseAsync();\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import {
2
+ manifestHandler
3
+ } from "./chunk-FYTQTDZU.mjs";
4
+ import {
5
+ builders_default
6
+ } from "./chunk-ZOQ32RQI.mjs";
7
+
8
+ // src/commands/manifest/index.ts
9
+ var command = {
10
+ command: ["manifest", "m"],
11
+ desc: "Validate the snap.manifest.json file",
12
+ builder: (yarg) => {
13
+ yarg.option("writeManifest", builders_default.writeManifest);
14
+ yarg.option("fix", builders_default.fix);
15
+ },
16
+ handler: async (argv) => manifestHandler(argv.context.config, { fix: argv.fix })
17
+ };
18
+ var manifest_default = command;
19
+
20
+ export {
21
+ manifest_default
22
+ };
23
+ //# sourceMappingURL=chunk-EXJCMAUI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/manifest/index.ts"],"sourcesContent":["import type yargs from 'yargs';\n\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\nimport { manifestHandler } from './manifest';\n\nconst command = {\n command: ['manifest', 'm'],\n desc: 'Validate the snap.manifest.json file',\n builder: (yarg: yargs.Argv) => {\n // Browserify options. These are merged into the config object.\n yarg.option('writeManifest', builders.writeManifest);\n\n // Webpack options.\n yarg.option('fix', builders.fix);\n },\n handler: async (argv: YargsArgs) =>\n manifestHandler(argv.context.config, { fix: argv.fix }),\n};\n\nexport * from './implementation';\nexport default command;\n"],"mappings":";;;;;;;;AAMA,IAAM,UAAU;AAAA,EACd,SAAS,CAAC,YAAY,GAAG;AAAA,EACzB,MAAM;AAAA,EACN,SAAS,CAAC,SAAqB;AAE7B,SAAK,OAAO,iBAAiB,iBAAS,aAAa;AAGnD,SAAK,OAAO,OAAO,iBAAS,GAAG;AAAA,EACjC;AAAA,EACA,SAAS,OAAO,SACd,gBAAgB,KAAK,QAAQ,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC;AAC1D;AAGA,IAAO,mBAAQ;","names":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk5JPLNWCOjs = require('./chunk-5JPLNWCO.js');
4
+
5
+
6
+ var _chunk5YUHRLH6js = require('./chunk-5YUHRLH6.js');
7
+
8
+
9
+ var _chunkIYAFFTJUjs = require('./chunk-IYAFFTJU.js');
10
+
11
+
12
+ var _chunkT3KPXUAUjs = require('./chunk-T3KPXUAU.js');
13
+
14
+
15
+ var _chunkGC7BNDLYjs = require('./chunk-GC7BNDLY.js');
16
+
17
+ // src/commands/index.ts
18
+ var commands = [
19
+ _chunk5YUHRLH6js.build_default,
20
+ _chunkGC7BNDLYjs.eval_default,
21
+ _chunkIYAFFTJUjs.manifest_default,
22
+ _chunkT3KPXUAUjs.serve_default,
23
+ _chunk5JPLNWCOjs.watch_default
24
+ ];
25
+ var commands_default = commands;
26
+
27
+
28
+
29
+ exports.commands_default = commands_default;
30
+ //# sourceMappingURL=chunk-FPG4GBXZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMA,IAAM,WAAW;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAO,mBAAQ","sourcesContent":["import buildCommand from './build';\nimport evaluateCommand from './eval';\nimport manifestCommand from './manifest';\nimport serveCommand from './serve';\nimport watchCommand from './watch';\n\nconst commands = [\n buildCommand,\n evaluateCommand,\n manifestCommand,\n serveCommand,\n watchCommand,\n];\n\nexport default commands;\n"]}
@@ -0,0 +1,52 @@
1
+ import {
2
+ manifest
3
+ } from "./chunk-TX4BG5GS.mjs";
4
+ import {
5
+ executeSteps
6
+ } from "./chunk-HJ4276TR.mjs";
7
+ import {
8
+ CommandError
9
+ } from "./chunk-OF4BF57X.mjs";
10
+
11
+ // src/commands/manifest/manifest.ts
12
+ import { isFile } from "@metamask/snaps-utils/node";
13
+ var steps = [
14
+ {
15
+ name: "Checking the input file.",
16
+ task: async ({ input }) => {
17
+ if (!await isFile(input)) {
18
+ throw new CommandError(
19
+ `Manifest file not found: "${input}". Make sure that the \`snap.manifest.json\` file exists.`
20
+ );
21
+ }
22
+ }
23
+ },
24
+ {
25
+ name: "Validating the snap manifest.",
26
+ task: async ({ input, config, options, spinner }) => {
27
+ const write = getWriteManifest(config, options);
28
+ const valid = await manifest(input, write, spinner);
29
+ if (valid) {
30
+ spinner.succeed("The snap manifest file is valid.");
31
+ }
32
+ }
33
+ }
34
+ ];
35
+ function getWriteManifest(config, options) {
36
+ if (typeof options.fix === "boolean") {
37
+ return options.fix;
38
+ }
39
+ return config.legacy?.writeManifest ?? false;
40
+ }
41
+ async function manifestHandler(config, options) {
42
+ await executeSteps(steps, {
43
+ input: config.manifest.path,
44
+ config,
45
+ options
46
+ });
47
+ }
48
+
49
+ export {
50
+ manifestHandler
51
+ };
52
+ //# sourceMappingURL=chunk-FYTQTDZU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/manifest/manifest.ts"],"sourcesContent":["import { isFile } from '@metamask/snaps-utils/node';\n\nimport type { ProcessedConfig } from '../../config';\nimport { CommandError } from '../../errors';\nimport type { Steps } from '../../utils';\nimport { executeSteps } from '../../utils';\nimport { manifest } from './implementation';\n\ntype ManifestOptions = {\n fix?: boolean;\n};\n\ntype ManifestContext = {\n input: string;\n config: ProcessedConfig;\n options: ManifestOptions;\n};\n\nconst steps: Steps<ManifestContext> = [\n {\n name: 'Checking the input file.',\n task: async ({ input }) => {\n if (!(await isFile(input))) {\n throw new CommandError(\n `Manifest file not found: \"${input}\". Make sure that the \\`snap.manifest.json\\` file exists.`,\n );\n }\n },\n },\n {\n name: 'Validating the snap manifest.',\n task: async ({ input, config, options, spinner }) => {\n const write = getWriteManifest(config, options);\n const valid = await manifest(input, write, spinner);\n\n if (valid) {\n spinner.succeed('The snap manifest file is valid.');\n }\n },\n },\n];\n\n/**\n * Get whether to write the manifest to disk.\n *\n * @param config - The config object.\n * @param options - The options object.\n * @returns Whether to write the manifest to disk.\n */\nfunction getWriteManifest(config: ProcessedConfig, options: ManifestOptions) {\n if (typeof options.fix === 'boolean') {\n return options.fix;\n }\n\n return config.legacy?.writeManifest ?? false;\n}\n\n/**\n * Validates a snap.manifest.json file. Attempts to fix the manifest and write\n * the fixed version to disk if `writeManifest` is true. Throws if validation\n * fails.\n *\n * @param config - The config object.\n * @param options - The options object.\n */\nexport async function manifestHandler(\n config: ProcessedConfig,\n options: ManifestOptions,\n) {\n await executeSteps(steps, {\n input: config.manifest.path,\n config,\n options,\n });\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,cAAc;AAkBvB,IAAM,QAAgC;AAAA,EACpC;AAAA,IACE,MAAM;AAAA,IACN,MAAM,OAAO,EAAE,MAAM,MAAM;AACzB,UAAI,CAAE,MAAM,OAAO,KAAK,GAAI;AAC1B,cAAM,IAAI;AAAA,UACR,6BAA6B,KAAK;AAAA,QACpC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM,OAAO,EAAE,OAAO,QAAQ,SAAS,QAAQ,MAAM;AACnD,YAAM,QAAQ,iBAAiB,QAAQ,OAAO;AAC9C,YAAM,QAAQ,MAAM,SAAS,OAAO,OAAO,OAAO;AAElD,UAAI,OAAO;AACT,gBAAQ,QAAQ,kCAAkC;AAAA,MACpD;AAAA,IACF;AAAA,EACF;AACF;AASA,SAAS,iBAAiB,QAAyB,SAA0B;AAC3E,MAAI,OAAO,QAAQ,QAAQ,WAAW;AACpC,WAAO,QAAQ;AAAA,EACjB;AAEA,SAAO,OAAO,QAAQ,iBAAiB;AACzC;AAUA,eAAsB,gBACpB,QACA,SACA;AACA,QAAM,aAAa,OAAO;AAAA,IACxB,OAAO,OAAO,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/logging.ts
2
+ var _snapsutils = require('@metamask/snaps-utils');
3
+ var _chalk = require('chalk');
4
+ function warn(message, spinner) {
5
+ if (spinner) {
6
+ spinner.clear();
7
+ spinner.frame();
8
+ }
9
+ _snapsutils.logWarning.call(void 0, `${_chalk.yellow.call(void 0, "\u26A0")} ${message}`);
10
+ }
11
+ function info(message, spinner) {
12
+ if (spinner) {
13
+ spinner.clear();
14
+ spinner.frame();
15
+ }
16
+ _snapsutils.logInfo.call(void 0, `${_chalk.blue.call(void 0, "\u2139")} ${_chalk.dim.call(void 0, message)}`);
17
+ }
18
+ function error(message, spinner) {
19
+ if (spinner) {
20
+ spinner.clear();
21
+ spinner.frame();
22
+ }
23
+ _snapsutils.logError.call(void 0, `${_chalk.red.call(void 0, "\u2716")} ${message}`);
24
+ }
25
+
26
+
27
+
28
+
29
+
30
+ exports.warn = warn; exports.info = info; exports.error = error;
31
+ //# sourceMappingURL=chunk-G3IYVYVR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/logging.ts"],"names":[],"mappings":";AAAA,SAAS,UAAU,SAAS,kBAAkB;AAC9C,SAAS,MAAM,KAAK,KAAK,cAAc;AAShC,SAAS,KAAK,SAAiB,SAAe;AACnD,MAAI,SAAS;AACX,YAAQ,MAAM;AACd,YAAQ,MAAM;AAAA,EAChB;AAEA,aAAW,GAAG,OAAO,QAAG,CAAC,IAAI,OAAO,EAAE;AACxC;AAQO,SAAS,KAAK,SAAiB,SAAe;AACnD,MAAI,SAAS;AACX,YAAQ,MAAM;AACd,YAAQ,MAAM;AAAA,EAChB;AAEA,UAAQ,GAAG,KAAK,QAAG,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE;AACxC;AAQO,SAAS,MAAM,SAAiB,SAAe;AACpD,MAAI,SAAS;AACX,YAAQ,MAAM;AACd,YAAQ,MAAM;AAAA,EAChB;AAEA,WAAS,GAAG,IAAI,QAAG,CAAC,IAAI,OAAO,EAAE;AACnC","sourcesContent":["import { logError, logInfo, logWarning } from '@metamask/snaps-utils';\nimport { blue, dim, red, yellow } from 'chalk';\nimport type { Ora } from 'ora';\n\n/**\n * Log a warning message. The message is prefixed with \"Warning:\".\n *\n * @param message - The message to log.\n * @param spinner - The spinner to clear.\n */\nexport function warn(message: string, spinner?: Ora) {\n if (spinner) {\n spinner.clear();\n spinner.frame();\n }\n\n logWarning(`${yellow('⚠')} ${message}`);\n}\n\n/**\n * Log an info message.\n *\n * @param message - The message to log.\n * @param spinner - The spinner to clear.\n */\nexport function info(message: string, spinner?: Ora) {\n if (spinner) {\n spinner.clear();\n spinner.frame();\n }\n\n logInfo(`${blue('ℹ')} ${dim(message)}`);\n}\n\n/**\n * Log an error message. The message is prefixed with \"Error:\".\n *\n * @param message - The message to log.\n * @param spinner - The spinner to clear.\n */\nexport function error(message: string, spinner?: Ora) {\n if (spinner) {\n spinner.clear();\n spinner.frame();\n }\n\n logError(`${red('✖')} ${message}`);\n}\n"]}
@@ -0,0 +1,23 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkWH7GOZP7js = require('./chunk-WH7GOZP7.js');
4
+
5
+
6
+ var _chunk6NJAXMSBjs = require('./chunk-6NJAXMSB.js');
7
+
8
+ // src/commands/eval/index.ts
9
+ var command = {
10
+ command: ["eval", "e"],
11
+ desc: "Attempt to evaluate snap bundle in SES",
12
+ builder: (yarg) => {
13
+ yarg.option("bundle", _chunk6NJAXMSBjs.builders_default.bundle);
14
+ yarg.option("input", _chunk6NJAXMSBjs.builders_default.input);
15
+ },
16
+ handler: async (argv) => _chunkWH7GOZP7js.evaluateHandler.call(void 0, argv.context.config, { input: argv.input })
17
+ };
18
+ var eval_default = command;
19
+
20
+
21
+
22
+ exports.eval_default = eval_default;
23
+ //# sourceMappingURL=chunk-GC7BNDLY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/eval/index.ts"],"names":[],"mappings":";;;;;;;;AAMA,IAAM,UAAU;AAAA,EACd,SAAS,CAAC,QAAQ,GAAG;AAAA,EACrB,MAAM;AAAA,EACN,SAAS,CAAC,SAAqB;AAE7B,SAAK,OAAO,UAAU,iBAAS,MAAM;AAGrC,SAAK,OAAO,SAAS,iBAAS,KAAK;AAAA,EACrC;AAAA,EACA,SAAS,OAAO,SACd,gBAAgB,KAAK,QAAQ,QAAQ,EAAE,OAAO,KAAK,MAAM,CAAC;AAC9D;AAGA,IAAO,eAAQ","sourcesContent":["import type yargs from 'yargs';\n\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\nimport { evaluateHandler } from './eval';\n\nconst command = {\n command: ['eval', 'e'],\n desc: 'Attempt to evaluate snap bundle in SES',\n builder: (yarg: yargs.Argv) => {\n // Browserify options. These are merged into the config object.\n yarg.option('bundle', builders.bundle);\n\n // Webpack options.\n yarg.option('input', builders.input);\n },\n handler: async (argv: YargsArgs) =>\n evaluateHandler(argv.context.config, { input: argv.input }),\n};\n\nexport * from './implementation';\nexport default command;\n"]}