@metamask/snaps-cli 5.1.1 → 6.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 (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-26C34AS7.mjs +287 -0
  7. package/dist/chunk-26C34AS7.mjs.map +1 -0
  8. package/dist/chunk-2SUDRRT6.mjs +50 -0
  9. package/dist/chunk-2SUDRRT6.mjs.map +1 -0
  10. package/dist/chunk-3WWFQLH4.mjs +30 -0
  11. package/dist/chunk-3WWFQLH4.mjs.map +1 -0
  12. package/dist/chunk-45LOTCC4.mjs +1 -0
  13. package/dist/chunk-45LOTCC4.mjs.map +1 -0
  14. package/dist/chunk-4QUVE3EK.js +53 -0
  15. package/dist/chunk-4QUVE3EK.js.map +1 -0
  16. package/dist/chunk-5CLEKHXE.js +54 -0
  17. package/dist/chunk-5CLEKHXE.js.map +1 -0
  18. package/dist/chunk-5KQNAW4C.mjs +346 -0
  19. package/dist/chunk-5KQNAW4C.mjs.map +1 -0
  20. package/dist/chunk-6EEZHGF5.js +23 -0
  21. package/dist/chunk-6EEZHGF5.js.map +1 -0
  22. package/dist/chunk-7NQQGJZJ.mjs +35 -0
  23. package/dist/chunk-7NQQGJZJ.mjs.map +1 -0
  24. package/dist/chunk-7RHK2YTB.mjs +32 -0
  25. package/dist/chunk-7RHK2YTB.mjs.map +1 -0
  26. package/dist/chunk-AZMQTZXZ.mjs +28 -0
  27. package/dist/chunk-AZMQTZXZ.mjs.map +1 -0
  28. package/dist/chunk-B3NNVTA6.js +32 -0
  29. package/dist/chunk-B3NNVTA6.js.map +1 -0
  30. package/dist/chunk-BALQOCUO.js +22 -0
  31. package/dist/chunk-BALQOCUO.js.map +1 -0
  32. package/dist/chunk-BVPYLBE5.js +365 -0
  33. package/dist/chunk-BVPYLBE5.js.map +1 -0
  34. package/dist/chunk-BYNQODL3.mjs +23 -0
  35. package/dist/chunk-BYNQODL3.mjs.map +1 -0
  36. package/dist/chunk-C44RRX3H.js +18 -0
  37. package/dist/chunk-C44RRX3H.js.map +1 -0
  38. package/dist/chunk-C46KEPAC.js +37 -0
  39. package/dist/chunk-C46KEPAC.js.map +1 -0
  40. package/dist/chunk-CGJKCIHP.js +28 -0
  41. package/dist/chunk-CGJKCIHP.js.map +1 -0
  42. package/dist/chunk-CIYE263O.js +30 -0
  43. package/dist/chunk-CIYE263O.js.map +1 -0
  44. package/dist/chunk-DBLADLQ4.js +10 -0
  45. package/dist/chunk-DBLADLQ4.js.map +1 -0
  46. package/dist/chunk-EDEA4QTA.js +35 -0
  47. package/dist/chunk-EDEA4QTA.js.map +1 -0
  48. package/dist/chunk-ERSRIVYH.mjs +64 -0
  49. package/dist/chunk-ERSRIVYH.mjs.map +1 -0
  50. package/dist/chunk-G3COWLG5.mjs +23 -0
  51. package/dist/chunk-G3COWLG5.mjs.map +1 -0
  52. package/dist/chunk-GKRRE4WN.mjs +30 -0
  53. package/dist/chunk-GKRRE4WN.mjs.map +1 -0
  54. package/dist/chunk-HQBA5RU6.mjs +54 -0
  55. package/dist/chunk-HQBA5RU6.mjs.map +1 -0
  56. package/dist/chunk-HYPSSFE5.mjs +13 -0
  57. package/dist/chunk-HYPSSFE5.mjs.map +1 -0
  58. package/dist/chunk-JAHNVVLT.mjs +18 -0
  59. package/dist/chunk-JAHNVVLT.mjs.map +1 -0
  60. package/dist/chunk-JCVSYVPD.mjs +24 -0
  61. package/dist/chunk-JCVSYVPD.mjs.map +1 -0
  62. package/dist/chunk-JI3B665Z.js +24 -0
  63. package/dist/chunk-JI3B665Z.js.map +1 -0
  64. package/dist/chunk-JL3URCHO.mjs +53 -0
  65. package/dist/chunk-JL3URCHO.mjs.map +1 -0
  66. package/dist/chunk-K26BOY6Z.mjs +51 -0
  67. package/dist/chunk-K26BOY6Z.mjs.map +1 -0
  68. package/dist/chunk-K5QMGTQL.mjs +22 -0
  69. package/dist/chunk-K5QMGTQL.mjs.map +1 -0
  70. package/dist/chunk-KLOPX6DO.js +51 -0
  71. package/dist/chunk-KLOPX6DO.js.map +1 -0
  72. package/dist/chunk-KUSHMQXD.js +64 -0
  73. package/dist/chunk-KUSHMQXD.js.map +1 -0
  74. package/dist/chunk-L72RLBV5.mjs +37 -0
  75. package/dist/chunk-L72RLBV5.mjs.map +1 -0
  76. package/dist/chunk-MDHJ5HLM.js +287 -0
  77. package/dist/chunk-MDHJ5HLM.js.map +1 -0
  78. package/dist/chunk-MR44GPM3.mjs +135 -0
  79. package/dist/chunk-MR44GPM3.mjs.map +1 -0
  80. package/dist/chunk-MUYXNION.js +30 -0
  81. package/dist/chunk-MUYXNION.js.map +1 -0
  82. package/dist/chunk-OKDY7C7S.js +346 -0
  83. package/dist/chunk-OKDY7C7S.js.map +1 -0
  84. package/dist/chunk-OPE2PGM6.mjs +24 -0
  85. package/dist/chunk-OPE2PGM6.mjs.map +1 -0
  86. package/dist/chunk-PDYQXXLP.js +30 -0
  87. package/dist/chunk-PDYQXXLP.js.map +1 -0
  88. package/dist/chunk-PFB25A2Q.mjs +52 -0
  89. package/dist/chunk-PFB25A2Q.mjs.map +1 -0
  90. package/dist/chunk-QFK7JVP3.js +52 -0
  91. package/dist/chunk-QFK7JVP3.js.map +1 -0
  92. package/dist/chunk-QHCKVO3P.js +28 -0
  93. package/dist/chunk-QHCKVO3P.js.map +1 -0
  94. package/dist/chunk-QMD3VO6R.mjs +30 -0
  95. package/dist/chunk-QMD3VO6R.mjs.map +1 -0
  96. package/dist/chunk-R6NBQKVH.js +16 -0
  97. package/dist/chunk-R6NBQKVH.js.map +1 -0
  98. package/dist/chunk-R77RJHC5.mjs +44 -0
  99. package/dist/chunk-R77RJHC5.mjs.map +1 -0
  100. package/dist/chunk-S45DIQPN.js +13 -0
  101. package/dist/chunk-S45DIQPN.js.map +1 -0
  102. package/dist/chunk-S76EZ6HY.js +23 -0
  103. package/dist/chunk-S76EZ6HY.js.map +1 -0
  104. package/dist/chunk-S7UP2YYF.js +135 -0
  105. package/dist/chunk-S7UP2YYF.js.map +1 -0
  106. package/dist/chunk-SVYNCWMH.js +61 -0
  107. package/dist/chunk-SVYNCWMH.js.map +1 -0
  108. package/dist/chunk-SYRWT2KT.mjs +124 -0
  109. package/dist/chunk-SYRWT2KT.mjs.map +1 -0
  110. package/dist/chunk-T7NEPTM5.mjs +61 -0
  111. package/dist/chunk-T7NEPTM5.mjs.map +1 -0
  112. package/dist/chunk-TDSL55B3.mjs +10 -0
  113. package/dist/chunk-TDSL55B3.mjs.map +1 -0
  114. package/dist/chunk-TJ2F3J6X.js +31 -0
  115. package/dist/chunk-TJ2F3J6X.js.map +1 -0
  116. package/dist/chunk-U4VFMIGO.js +24 -0
  117. package/dist/chunk-U4VFMIGO.js.map +1 -0
  118. package/dist/chunk-VXOV3ZCB.js +1 -0
  119. package/dist/chunk-VXOV3ZCB.js.map +1 -0
  120. package/dist/chunk-WO7DMSQU.mjs +16 -0
  121. package/dist/chunk-WO7DMSQU.mjs.map +1 -0
  122. package/dist/chunk-WP2N4NCO.js +50 -0
  123. package/dist/chunk-WP2N4NCO.js.map +1 -0
  124. package/dist/chunk-WYDHPUWV.mjs +28 -0
  125. package/dist/chunk-WYDHPUWV.mjs.map +1 -0
  126. package/dist/chunk-X3D3MHWF.js +44 -0
  127. package/dist/chunk-X3D3MHWF.js.map +1 -0
  128. package/dist/chunk-X7TESUC7.mjs +22 -0
  129. package/dist/chunk-X7TESUC7.mjs.map +1 -0
  130. package/dist/chunk-X7VYAL2L.mjs +365 -0
  131. package/dist/chunk-X7VYAL2L.mjs.map +1 -0
  132. package/dist/chunk-XGWLFH7Y.js +41 -0
  133. package/dist/chunk-XGWLFH7Y.js.map +1 -0
  134. package/dist/{cjs/webpack/config.js → chunk-XUYXKO4F.js} +181 -153
  135. package/dist/chunk-XUYXKO4F.js.map +1 -0
  136. package/dist/chunk-XZJLYKES.mjs +64 -0
  137. package/dist/chunk-XZJLYKES.mjs.map +1 -0
  138. package/dist/chunk-YCYGKEXF.mjs +41 -0
  139. package/dist/chunk-YCYGKEXF.mjs.map +1 -0
  140. package/dist/chunk-YGEAZQSC.js +124 -0
  141. package/dist/chunk-YGEAZQSC.js.map +1 -0
  142. package/dist/chunk-YQ2E7NEA.js +64 -0
  143. package/dist/chunk-YQ2E7NEA.js.map +1 -0
  144. package/dist/chunk-YQVCFM6L.js +22 -0
  145. package/dist/chunk-YQVCFM6L.js.map +1 -0
  146. package/dist/{esm/webpack/config.js → chunk-YWCNJELN.mjs} +182 -156
  147. package/dist/chunk-YWCNJELN.mjs.map +1 -0
  148. package/dist/chunk-ZAW4ZWQX.mjs +31 -0
  149. package/dist/chunk-ZAW4ZWQX.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 +1 -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 -254
  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 -285
  456. package/dist/esm/webpack/utils.js.map +0 -1
@@ -1,276 +1,302 @@
1
- import SnapsWebpackPlugin from '@metamask/snaps-webpack-plugin';
2
- import { resolve } from 'path';
3
- import TerserPlugin from 'terser-webpack-plugin';
4
- import { DefinePlugin, ProgressPlugin, ProvidePlugin } from 'webpack';
5
- import { SnapsBuiltInResolver, SnapsBundleWarningsPlugin, SnapsStatsPlugin, SnapsWatchPlugin } from './plugins';
6
- import { BROWSERSLIST_FILE, getDefaultLoader, getDevTool, getEnvironmentVariables, getFallbacks, getProgressHandler } from './utils';
7
- /**
8
- * Get the default Webpack configuration. This is the configuration that will
9
- * be used if the user doesn't provide a custom Webpack configuration. The
10
- * configuration is based on the snap config.
11
- *
12
- * The default configuration includes:
13
- *
14
- * - `SWC` to transpile TypeScript and JavaScript files.
15
- * - `TerserPlugin` to minify the bundle.
16
- * - `SnapsWebpackPlugin` to validate the bundle and update the manifest.
17
- *
18
- * It can be customized through the `customizeWebpackConfig` function in the
19
- * snap config, but in most cases, you shouldn't need to do that.
20
- *
21
- * @param config - The processed snap Webpack config.
22
- * @param options - The Webpack options.
23
- * @returns The default Webpack configuration.
24
- */ export async function getDefaultConfiguration(config, options = {
25
- evaluate: config.evaluate
1
+ import {
2
+ SnapsBuiltInResolver,
3
+ SnapsBundleWarningsPlugin,
4
+ SnapsStatsPlugin,
5
+ SnapsWatchPlugin
6
+ } from "./chunk-5KQNAW4C.mjs";
7
+ import {
8
+ BROWSERSLIST_FILE,
9
+ getDefaultLoader,
10
+ getDevTool,
11
+ getEnvironmentVariables,
12
+ getFallbacks,
13
+ getProgressHandler
14
+ } from "./chunk-26C34AS7.mjs";
15
+ import {
16
+ getFunctionLoader
17
+ } from "./chunk-AZMQTZXZ.mjs";
18
+ import {
19
+ wasm_default
20
+ } from "./chunk-ERSRIVYH.mjs";
21
+
22
+ // src/webpack/config.ts
23
+ import SnapsWebpackPlugin from "@metamask/snaps-webpack-plugin";
24
+ import { resolve } from "path";
25
+ import TerserPlugin from "terser-webpack-plugin";
26
+ import { DefinePlugin, ProgressPlugin, ProvidePlugin } from "webpack";
27
+ async function getDefaultConfiguration(config, options = {
28
+ evaluate: config.evaluate
26
29
  }) {
27
- const spinnerText = options.spinner?.text;
28
- const builtInResolver = config.stats.builtIns && new SnapsBuiltInResolver(config.stats.builtIns, options.spinner);
29
- return {
30
- /**
30
+ const spinnerText = options.spinner?.text;
31
+ const builtInResolver = config.stats.builtIns && new SnapsBuiltInResolver(config.stats.builtIns, options.spinner);
32
+ return {
33
+ /**
31
34
  * The target is set to `browserslist` so that Webpack will compile the
32
35
  * bundle to support the browsers specified in the `.browserslistrc` file.
33
36
  * This Browserslist file contains the browsers that are supported by
34
37
  * MetaMask Snaps.
35
38
  *
36
39
  * @see https://webpack.js.org/configuration/target/
37
- */ target: `browserslist:${BROWSERSLIST_FILE}`,
38
- /**
40
+ */
41
+ target: `browserslist:${BROWSERSLIST_FILE}`,
42
+ /**
39
43
  * The mode is set to `production` by default, so that Webpack will minify
40
44
  * and optimize the bundle.
41
45
  *
42
46
  * @see https://webpack.js.org/configuration/mode/
43
- */ mode: 'production',
44
- /**
47
+ */
48
+ mode: "production",
49
+ /**
45
50
  * The entry point is set to the `input` value from the config object.
46
51
  *
47
52
  * @see https://webpack.js.org/configuration/entry-context/
48
- */ entry: config.input,
49
- /**
53
+ */
54
+ entry: config.input,
55
+ /**
50
56
  * The devtool option controls how source maps are generated. We set it to
51
57
  * the `sourceMap` value from the config object.
52
58
  *
53
59
  * @see https://webpack.js.org/configuration/devtool/
54
- */ devtool: getDevTool(config.sourceMap),
55
- /**
60
+ */
61
+ devtool: getDevTool(config.sourceMap),
62
+ /**
56
63
  * The stats option controls how much information is printed to the console
57
64
  * when Webpack is running. We set it to `none` so that we can control the
58
65
  * output ourselves.
59
66
  *
60
67
  * @see https://webpack.js.org/configuration/stats/
61
- */ stats: 'none',
62
- /**
68
+ */
69
+ stats: "none",
70
+ /**
63
71
  * The output options.
64
72
  *
65
73
  * @see https://webpack.js.org/configuration/output/
66
- */ output: {
67
- /**
74
+ */
75
+ output: {
76
+ /**
68
77
  * This indicates whether Webpack should clear the output directory
69
78
  * before building. We set it to the `clean` value from the config
70
79
  * object.
71
80
  *
72
81
  * @see https://webpack.js.org/configuration/output/#outputclean
73
- */ clean: config.output.clean,
74
- /**
82
+ */
83
+ clean: config.output.clean,
84
+ /**
75
85
  * The filename of the bundle. We set it to the `filename` value from
76
86
  * the config object.
77
87
  *
78
88
  * @see https://webpack.js.org/configuration/output/#outputfilename
79
- */ filename: config.output.filename,
80
- /**
89
+ */
90
+ filename: config.output.filename,
91
+ /**
81
92
  * The path to the output directory. We set it to the `path` value from
82
93
  * the config object.
83
94
  *
84
95
  * @see https://webpack.js.org/configuration/output/#outputpath
85
- */ path: config.output.path,
86
- /**
96
+ */
97
+ path: config.output.path,
98
+ /**
87
99
  * The public path of the bundle. We set it to `/` by default, so that
88
100
  * the bundle can be loaded from the root of the server.
89
101
  *
90
102
  * @see https://webpack.js.org/configuration/output/#outputpublicpath
91
- */ publicPath: '/',
92
- /**
103
+ */
104
+ publicPath: "/",
105
+ /**
93
106
  * The library configuration. This tells Webpack how to export the
94
107
  * bundle.
95
108
  *
96
109
  * @see https://webpack.js.org/configuration/output/#outputlibrary
97
- */ library: {
98
- /**
110
+ */
111
+ library: {
112
+ /**
99
113
  * This tells Webpack to export the bundle as a CommonJS module. This
100
114
  * is necessary for MetaMask Snaps.
101
115
  *
102
116
  * @see https://webpack.js.org/configuration/output/#outputlibrarytarget
103
- */ type: 'commonjs'
104
- },
105
- /**
117
+ */
118
+ type: "commonjs"
119
+ },
120
+ /**
106
121
  * The chunk format. This tells Webpack how to export chunks. This is
107
122
  * required because we use browserslist to target browsers, but Snaps are
108
123
  * not fully compatible with browser APIs (such as `window` and
109
124
  * `document`).
110
125
  *
111
126
  * @see https://webpack.js.org/configuration/output/#outputchunkformat
112
- */ chunkFormat: 'commonjs'
113
- },
114
- /**
127
+ */
128
+ chunkFormat: "commonjs"
129
+ },
130
+ /**
115
131
  * The module configuration. This is where we tell Webpack how to handle
116
132
  * different types of files.
117
133
  *
118
134
  * @see https://webpack.js.org/configuration/module/
119
- */ module: {
120
- rules: [
121
- {
122
- test: /\.(js|mjs|cjs|ts)$/u,
123
- exclude: /node_modules/u,
124
- use: await getDefaultLoader(config)
125
- },
126
- /**
135
+ */
136
+ module: {
137
+ rules: [
138
+ {
139
+ test: /\.(js|mjs|cjs|ts)$/u,
140
+ exclude: /node_modules/u,
141
+ use: await getDefaultLoader(config)
142
+ },
143
+ /**
127
144
  * This allows importing modules that uses `.js` and not `.mjs` for the
128
145
  * ES build.
129
146
  *
130
147
  * @see https://webpack.js.org/configuration/module/#resolvefullyspecified
131
- */ {
132
- test: /\.m?js/u,
133
- resolve: {
134
- fullySpecified: false
135
- }
136
- },
137
- config.experimental.wasm && {
138
- test: /\.wasm$/u,
139
- use: {
140
- loader: resolve(__dirname, 'loaders', 'wasm')
141
- }
142
- }
143
- ]
148
+ */
149
+ {
150
+ test: /\.m?js/u,
151
+ resolve: {
152
+ fullySpecified: false
153
+ }
144
154
  },
145
- /**
155
+ config.experimental.wasm && {
156
+ test: /\.wasm$/u,
157
+ use: getFunctionLoader(wasm_default, {})
158
+ }
159
+ ]
160
+ },
161
+ /**
146
162
  * The resolve configuration. This tells Webpack how to resolve imports.
147
163
  * We set it to resolve `.js` and `.ts` files.
148
164
  *
149
165
  * @see https://webpack.js.org/configuration/resolve/
150
- */ resolve: {
151
- /**
166
+ */
167
+ resolve: {
168
+ /**
152
169
  * The extensions to resolve. We set it to resolve `.(c|m)?js` and `.ts`
153
170
  * files.
154
- */ extensions: [
155
- '.js',
156
- '.mjs',
157
- '.cjs',
158
- '.ts'
159
- ],
160
- /**
171
+ */
172
+ extensions: [".js", ".mjs", ".cjs", ".ts"],
173
+ /**
161
174
  * The fallback options. This tells Webpack how to handle imports that
162
175
  * aren't resolved. By default, we set Node.js built-ins to `false`, so
163
176
  * that they are ignored.
164
- */ fallback: getFallbacks(config.polyfills),
165
- /**
177
+ */
178
+ fallback: getFallbacks(config.polyfills),
179
+ /**
166
180
  * The plugins to use. We use the {@link SnapsBuiltInResolver} to show
167
181
  * warnings about using Node.js built-ins, when no fallback is specified.
168
- */ plugins: [
169
- builtInResolver
170
- ]
171
- },
172
- /**
182
+ */
183
+ plugins: [builtInResolver]
184
+ },
185
+ /**
173
186
  * The plugins to use.
174
187
  *
175
188
  * @see https://webpack.js.org/configuration/plugins/
176
- */ plugins: [
177
- /**
189
+ */
190
+ plugins: [
191
+ /**
178
192
  * The `SnapsWebpackPlugin` is a Webpack plugin that checks and updates
179
193
  * the manifest file, and evaluates the bundle in SES. While not strictly
180
194
  * required, it's highly recommended to use this plugin.
181
- */ new SnapsWebpackPlugin({
182
- manifestPath: config.manifest.path,
183
- writeManifest: config.manifest.update,
184
- eval: !options.watch && options.evaluate
185
- }),
186
- /**
195
+ */
196
+ new SnapsWebpackPlugin({
197
+ manifestPath: config.manifest.path,
198
+ writeManifest: config.manifest.update,
199
+ eval: !options.watch && options.evaluate
200
+ }),
201
+ /**
187
202
  * The `SnapsStatsPlugin` is a Webpack plugin that handles the stats
188
203
  * output. It's used to show the stats in the terminal, in a format that
189
204
  * is easy to read.
190
- */ new SnapsStatsPlugin({
191
- verbose: config.stats.verbose
192
- }, options.spinner),
193
- /**
205
+ */
206
+ new SnapsStatsPlugin({ verbose: config.stats.verbose }, options.spinner),
207
+ /**
194
208
  * The `DefinePlugin` is a Webpack plugin that adds static values to the
195
209
  * bundle. We use it to add the `NODE_DEBUG`, `NODE_ENV`, and `DEBUG`
196
210
  * environment variables, as well as any custom environment
197
211
  * variables (as `process.env`).
198
- */ new DefinePlugin(getEnvironmentVariables(config.environment)),
199
- /**
212
+ */
213
+ new DefinePlugin(getEnvironmentVariables(config.environment)),
214
+ /**
200
215
  * The `ProgressPlugin` is a Webpack plugin that logs the progress of
201
216
  * the build. We set it to log the progress to the spinner.
202
- */ new ProgressPlugin({
203
- handler: getProgressHandler(options.spinner, spinnerText)
204
- }),
205
- /**
217
+ */
218
+ new ProgressPlugin({
219
+ handler: getProgressHandler(options.spinner, spinnerText)
220
+ }),
221
+ /**
206
222
  * The `SnapsBundleWarningPlugin` is a Webpack plugin that shows a
207
223
  * warning when the bundle is potentially incompatible with MetaMask
208
224
  * Snaps.
209
- */ new SnapsBundleWarningsPlugin({
210
- builtInResolver,
211
- builtIns: Boolean(config.stats.builtIns),
212
- buffer: config.stats.buffer
213
- }),
214
- /**
225
+ */
226
+ new SnapsBundleWarningsPlugin({
227
+ builtInResolver,
228
+ builtIns: Boolean(config.stats.builtIns),
229
+ buffer: config.stats.buffer
230
+ }),
231
+ /**
215
232
  * The `WatchPlugin` is a Webpack plugin that adds extra files to watch
216
233
  * for changes. This is useful for rebuilding the bundle when the
217
234
  * manifest file changes.
218
- */ options.watch && new SnapsWatchPlugin({
219
- bundle: resolve(config.output.path, config.output.filename),
220
- evaluate: options.evaluate,
221
- files: [
222
- config.manifest.path
223
- ]
224
- }, options.spinner),
225
- /**
235
+ */
236
+ options.watch && new SnapsWatchPlugin(
237
+ {
238
+ bundle: resolve(config.output.path, config.output.filename),
239
+ evaluate: options.evaluate,
240
+ files: [config.manifest.path]
241
+ },
242
+ options.spinner
243
+ ),
244
+ /**
226
245
  * The `ProviderPlugin` is a Webpack plugin that automatically load
227
246
  * modules instead of having to import or require them everywhere.
228
- */ (config.polyfills === true || config.polyfills !== false && config.polyfills.buffer) && new ProvidePlugin({
229
- Buffer: [
230
- 'buffer',
231
- 'Buffer'
232
- ]
233
- })
234
- ].filter(Boolean),
235
- /**
247
+ */
248
+ (config.polyfills === true || config.polyfills !== false && config.polyfills.buffer) && new ProvidePlugin({
249
+ Buffer: ["buffer", "Buffer"]
250
+ })
251
+ ].filter(Boolean),
252
+ /**
236
253
  * The optimization configuration. This tells Webpack how to optimize the
237
254
  * bundle. Most of the time, you won't need to change this, as the default
238
255
  * options set by the `mode` option are sufficient.
239
- */ optimization: {
240
- minimize: config.output.minimize,
241
- /**
256
+ */
257
+ optimization: {
258
+ minimize: config.output.minimize,
259
+ /**
242
260
  * The minimizer to use. We set it to use the `TerserPlugin`.
243
- */ minimizer: [
244
- new TerserPlugin({
245
- parallel: true
246
- })
247
- ]
248
- },
249
- /**
261
+ */
262
+ minimizer: [
263
+ new TerserPlugin({
264
+ parallel: true
265
+ })
266
+ ]
267
+ },
268
+ /**
250
269
  * The performance configuration. This tells Webpack how to handle
251
270
  * performance hints.
252
271
  *
253
272
  * @see https://webpack.js.org/configuration/performance/
254
- */ performance: {
255
- /**
273
+ */
274
+ performance: {
275
+ /**
256
276
  * The hints to show. We set it to `false`, so that we don't get
257
277
  * performance hints, as they are not relevant for Snaps.
258
278
  *
259
279
  * @see https://webpack.js.org/configuration/performance/#performancehints
260
- */ hints: false
261
- },
262
- /**
280
+ */
281
+ hints: false
282
+ },
283
+ /**
263
284
  * The infrastructure logging configuration. This tells Webpack how to
264
285
  * log messages.
265
286
  *
266
287
  * @see https://webpack.js.org/configuration/infrastructure-logging
267
- */ infrastructureLogging: {
268
- /**
288
+ */
289
+ infrastructureLogging: {
290
+ /**
269
291
  * The level of logging to use. We set it to `none`, so that we can
270
292
  * control the output ourselves.
271
- */ level: 'none'
272
- }
273
- };
293
+ */
294
+ level: "none"
295
+ }
296
+ };
274
297
  }
275
298
 
276
- //# sourceMappingURL=config.js.map
299
+ export {
300
+ getDefaultConfiguration
301
+ };
302
+ //# sourceMappingURL=chunk-YWCNJELN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/webpack/config.ts"],"sourcesContent":["import SnapsWebpackPlugin from '@metamask/snaps-webpack-plugin';\nimport type { Ora } from 'ora';\nimport { resolve } from 'path';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport type { Configuration } from 'webpack';\nimport { DefinePlugin, ProgressPlugin, ProvidePlugin } from 'webpack';\n\nimport type { ProcessedWebpackConfig } from '../config';\nimport { getFunctionLoader, wasm } from './loaders';\nimport {\n SnapsBuiltInResolver,\n SnapsBundleWarningsPlugin,\n SnapsStatsPlugin,\n SnapsWatchPlugin,\n} from './plugins';\nimport {\n BROWSERSLIST_FILE,\n getDefaultLoader,\n getDevTool,\n getEnvironmentVariables,\n getFallbacks,\n getProgressHandler,\n} from './utils';\n\nexport type WebpackOptions = {\n /**\n * Whether to watch for changes.\n */\n watch?: boolean;\n\n /**\n * Whether to evaluate the bundle. If this is set, it will override the\n * `evaluate` option in the config object.\n */\n evaluate?: boolean;\n\n /**\n * The spinner to use for logging.\n */\n spinner?: Ora;\n};\n\n/**\n * Get the default Webpack configuration. This is the configuration that will\n * be used if the user doesn't provide a custom Webpack configuration. The\n * configuration is based on the snap config.\n *\n * The default configuration includes:\n *\n * - `SWC` to transpile TypeScript and JavaScript files.\n * - `TerserPlugin` to minify the bundle.\n * - `SnapsWebpackPlugin` to validate the bundle and update the manifest.\n *\n * It can be customized through the `customizeWebpackConfig` function in the\n * snap config, but in most cases, you shouldn't need to do that.\n *\n * @param config - The processed snap Webpack config.\n * @param options - The Webpack options.\n * @returns The default Webpack configuration.\n */\nexport async function getDefaultConfiguration(\n config: ProcessedWebpackConfig,\n options: WebpackOptions = {\n evaluate: config.evaluate,\n },\n): Promise<Configuration> {\n const spinnerText = options.spinner?.text;\n const builtInResolver =\n config.stats.builtIns &&\n new SnapsBuiltInResolver(config.stats.builtIns, options.spinner);\n\n return {\n /**\n * The target is set to `browserslist` so that Webpack will compile the\n * bundle to support the browsers specified in the `.browserslistrc` file.\n * This Browserslist file contains the browsers that are supported by\n * MetaMask Snaps.\n *\n * @see https://webpack.js.org/configuration/target/\n */\n target: `browserslist:${BROWSERSLIST_FILE}`,\n\n /**\n * The mode is set to `production` by default, so that Webpack will minify\n * and optimize the bundle.\n *\n * @see https://webpack.js.org/configuration/mode/\n */\n mode: 'production',\n\n /**\n * The entry point is set to the `input` value from the config object.\n *\n * @see https://webpack.js.org/configuration/entry-context/\n */\n entry: config.input,\n\n /**\n * The devtool option controls how source maps are generated. We set it to\n * the `sourceMap` value from the config object.\n *\n * @see https://webpack.js.org/configuration/devtool/\n */\n devtool: getDevTool(config.sourceMap),\n\n /**\n * The stats option controls how much information is printed to the console\n * when Webpack is running. We set it to `none` so that we can control the\n * output ourselves.\n *\n * @see https://webpack.js.org/configuration/stats/\n */\n stats: 'none',\n\n /**\n * The output options.\n *\n * @see https://webpack.js.org/configuration/output/\n */\n output: {\n /**\n * This indicates whether Webpack should clear the output directory\n * before building. We set it to the `clean` value from the config\n * object.\n *\n * @see https://webpack.js.org/configuration/output/#outputclean\n */\n clean: config.output.clean,\n\n /**\n * The filename of the bundle. We set it to the `filename` value from\n * the config object.\n *\n * @see https://webpack.js.org/configuration/output/#outputfilename\n */\n filename: config.output.filename,\n\n /**\n * The path to the output directory. We set it to the `path` value from\n * the config object.\n *\n * @see https://webpack.js.org/configuration/output/#outputpath\n */\n path: config.output.path,\n\n /**\n * The public path of the bundle. We set it to `/` by default, so that\n * the bundle can be loaded from the root of the server.\n *\n * @see https://webpack.js.org/configuration/output/#outputpublicpath\n */\n publicPath: '/',\n\n /**\n * The library configuration. This tells Webpack how to export the\n * bundle.\n *\n * @see https://webpack.js.org/configuration/output/#outputlibrary\n */\n library: {\n /**\n * This tells Webpack to export the bundle as a CommonJS module. This\n * is necessary for MetaMask Snaps.\n *\n * @see https://webpack.js.org/configuration/output/#outputlibrarytarget\n */\n type: 'commonjs',\n },\n\n /**\n * The chunk format. This tells Webpack how to export chunks. This is\n * required because we use browserslist to target browsers, but Snaps are\n * not fully compatible with browser APIs (such as `window` and\n * `document`).\n *\n * @see https://webpack.js.org/configuration/output/#outputchunkformat\n */\n chunkFormat: 'commonjs',\n },\n\n /**\n * The module configuration. This is where we tell Webpack how to handle\n * different types of files.\n *\n * @see https://webpack.js.org/configuration/module/\n */\n module: {\n rules: [\n {\n test: /\\.(js|mjs|cjs|ts)$/u,\n exclude: /node_modules/u,\n use: await getDefaultLoader(config),\n },\n\n /**\n * This allows importing modules that uses `.js` and not `.mjs` for the\n * ES build.\n *\n * @see https://webpack.js.org/configuration/module/#resolvefullyspecified\n */\n {\n test: /\\.m?js/u,\n resolve: {\n fullySpecified: false,\n },\n },\n\n config.experimental.wasm && {\n test: /\\.wasm$/u,\n use: getFunctionLoader(wasm, {}),\n },\n ],\n },\n\n /**\n * The resolve configuration. This tells Webpack how to resolve imports.\n * We set it to resolve `.js` and `.ts` files.\n *\n * @see https://webpack.js.org/configuration/resolve/\n */\n resolve: {\n /**\n * The extensions to resolve. We set it to resolve `.(c|m)?js` and `.ts`\n * files.\n */\n extensions: ['.js', '.mjs', '.cjs', '.ts'],\n\n /**\n * The fallback options. This tells Webpack how to handle imports that\n * aren't resolved. By default, we set Node.js built-ins to `false`, so\n * that they are ignored.\n */\n fallback: getFallbacks(config.polyfills),\n\n /**\n * The plugins to use. We use the {@link SnapsBuiltInResolver} to show\n * warnings about using Node.js built-ins, when no fallback is specified.\n */\n plugins: [builtInResolver],\n },\n\n /**\n * The plugins to use.\n *\n * @see https://webpack.js.org/configuration/plugins/\n */\n plugins: [\n /**\n * The `SnapsWebpackPlugin` is a Webpack plugin that checks and updates\n * the manifest file, and evaluates the bundle in SES. While not strictly\n * required, it's highly recommended to use this plugin.\n */\n new SnapsWebpackPlugin({\n manifestPath: config.manifest.path,\n writeManifest: config.manifest.update,\n eval: !options.watch && options.evaluate,\n }),\n\n /**\n * The `SnapsStatsPlugin` is a Webpack plugin that handles the stats\n * output. It's used to show the stats in the terminal, in a format that\n * is easy to read.\n */\n new SnapsStatsPlugin({ verbose: config.stats.verbose }, options.spinner),\n\n /**\n * The `DefinePlugin` is a Webpack plugin that adds static values to the\n * bundle. We use it to add the `NODE_DEBUG`, `NODE_ENV`, and `DEBUG`\n * environment variables, as well as any custom environment\n * variables (as `process.env`).\n */\n new DefinePlugin(getEnvironmentVariables(config.environment)),\n\n /**\n * The `ProgressPlugin` is a Webpack plugin that logs the progress of\n * the build. We set it to log the progress to the spinner.\n */\n new ProgressPlugin({\n handler: getProgressHandler(options.spinner, spinnerText),\n }),\n\n /**\n * The `SnapsBundleWarningPlugin` is a Webpack plugin that shows a\n * warning when the bundle is potentially incompatible with MetaMask\n * Snaps.\n */\n new SnapsBundleWarningsPlugin({\n builtInResolver,\n builtIns: Boolean(config.stats.builtIns),\n buffer: config.stats.buffer,\n }),\n\n /**\n * The `WatchPlugin` is a Webpack plugin that adds extra files to watch\n * for changes. This is useful for rebuilding the bundle when the\n * manifest file changes.\n */\n options.watch &&\n new SnapsWatchPlugin(\n {\n bundle: resolve(config.output.path, config.output.filename),\n evaluate: options.evaluate,\n files: [config.manifest.path],\n },\n options.spinner,\n ),\n\n /**\n * The `ProviderPlugin` is a Webpack plugin that automatically load\n * modules instead of having to import or require them everywhere.\n */\n (config.polyfills === true ||\n (config.polyfills !== false && config.polyfills.buffer)) &&\n new ProvidePlugin({\n Buffer: ['buffer', 'Buffer'],\n }),\n ].filter(Boolean),\n\n /**\n * The optimization configuration. This tells Webpack how to optimize the\n * bundle. Most of the time, you won't need to change this, as the default\n * options set by the `mode` option are sufficient.\n */\n optimization: {\n minimize: config.output.minimize,\n\n /**\n * The minimizer to use. We set it to use the `TerserPlugin`.\n */\n minimizer: [\n new TerserPlugin({\n parallel: true,\n }),\n ],\n },\n\n /**\n * The performance configuration. This tells Webpack how to handle\n * performance hints.\n *\n * @see https://webpack.js.org/configuration/performance/\n */\n performance: {\n /**\n * The hints to show. We set it to `false`, so that we don't get\n * performance hints, as they are not relevant for Snaps.\n *\n * @see https://webpack.js.org/configuration/performance/#performancehints\n */\n hints: false,\n },\n\n /**\n * The infrastructure logging configuration. This tells Webpack how to\n * log messages.\n *\n * @see https://webpack.js.org/configuration/infrastructure-logging\n */\n infrastructureLogging: {\n /**\n * The level of logging to use. We set it to `none`, so that we can\n * control the output ourselves.\n */\n level: 'none',\n },\n };\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,31 @@
1
+ // src/utils/logging.ts
2
+ import { logError, logInfo, logWarning } from "@metamask/snaps-utils";
3
+ import { blue, dim, red, yellow } from "chalk";
4
+ function warn(message, spinner) {
5
+ if (spinner) {
6
+ spinner.clear();
7
+ spinner.frame();
8
+ }
9
+ logWarning(`${yellow("\u26A0")} ${message}`);
10
+ }
11
+ function info(message, spinner) {
12
+ if (spinner) {
13
+ spinner.clear();
14
+ spinner.frame();
15
+ }
16
+ logInfo(`${blue("\u2139")} ${dim(message)}`);
17
+ }
18
+ function error(message, spinner) {
19
+ if (spinner) {
20
+ spinner.clear();
21
+ spinner.frame();
22
+ }
23
+ logError(`${red("\u2716")} ${message}`);
24
+ }
25
+
26
+ export {
27
+ warn,
28
+ info,
29
+ error
30
+ };
31
+ //# sourceMappingURL=chunk-ZAW4ZWQX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/logging.ts"],"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"],"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;","names":[]}
package/dist/cli.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkKUSHMQXDjs = require('./chunk-KUSHMQXD.js');
5
+ require('./chunk-BVPYLBE5.js');
6
+ require('./chunk-S45DIQPN.js');
7
+ require('./chunk-4QUVE3EK.js');
8
+ require('./chunk-C46KEPAC.js');
9
+ require('./chunk-PDYQXXLP.js');
10
+ require('./chunk-DBLADLQ4.js');
11
+ require('./chunk-XGWLFH7Y.js');
12
+ require('./chunk-B3NNVTA6.js');
13
+ require('./chunk-TJ2F3J6X.js');
14
+ require('./chunk-S7UP2YYF.js');
15
+ require('./chunk-BALQOCUO.js');
16
+ require('./chunk-X3D3MHWF.js');
17
+
18
+
19
+
20
+ exports.checkNodeVersion = _chunkKUSHMQXDjs.checkNodeVersion; exports.cli = _chunkKUSHMQXDjs.cli;
21
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/dist/cli.mjs ADDED
@@ -0,0 +1,21 @@
1
+ import {
2
+ checkNodeVersion,
3
+ cli
4
+ } from "./chunk-XZJLYKES.mjs";
5
+ import "./chunk-X7VYAL2L.mjs";
6
+ import "./chunk-HYPSSFE5.mjs";
7
+ import "./chunk-JL3URCHO.mjs";
8
+ import "./chunk-L72RLBV5.mjs";
9
+ import "./chunk-QMD3VO6R.mjs";
10
+ import "./chunk-TDSL55B3.mjs";
11
+ import "./chunk-YCYGKEXF.mjs";
12
+ import "./chunk-7RHK2YTB.mjs";
13
+ import "./chunk-ZAW4ZWQX.mjs";
14
+ import "./chunk-MR44GPM3.mjs";
15
+ import "./chunk-X7TESUC7.mjs";
16
+ import "./chunk-R77RJHC5.mjs";
17
+ export {
18
+ checkNodeVersion,
19
+ cli
20
+ };
21
+ //# sourceMappingURL=cli.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkSVYNCWMHjs = require('../../chunk-SVYNCWMH.js');
4
+ require('../../chunk-CGJKCIHP.js');
5
+ require('../../chunk-VXOV3ZCB.js');
6
+ require('../../chunk-R6NBQKVH.js');
7
+ require('../../chunk-XUYXKO4F.js');
8
+ require('../../chunk-OKDY7C7S.js');
9
+ require('../../chunk-6EEZHGF5.js');
10
+ require('../../chunk-KLOPX6DO.js');
11
+ require('../../chunk-MUYXNION.js');
12
+ require('../../chunk-YGEAZQSC.js');
13
+ require('../../chunk-MDHJ5HLM.js');
14
+ require('../../chunk-QHCKVO3P.js');
15
+ require('../../chunk-YQ2E7NEA.js');
16
+ require('../../chunk-4QUVE3EK.js');
17
+ require('../../chunk-C46KEPAC.js');
18
+ require('../../chunk-PDYQXXLP.js');
19
+ require('../../chunk-DBLADLQ4.js');
20
+ require('../../chunk-XGWLFH7Y.js');
21
+ require('../../chunk-B3NNVTA6.js');
22
+ require('../../chunk-TJ2F3J6X.js');
23
+ require('../../chunk-S7UP2YYF.js');
24
+ require('../../chunk-BALQOCUO.js');
25
+ require('../../chunk-X3D3MHWF.js');
26
+
27
+
28
+ exports.buildHandler = _chunkSVYNCWMHjs.buildHandler;
29
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import {
2
+ buildHandler
3
+ } from "../../chunk-T7NEPTM5.mjs";
4
+ import "../../chunk-WYDHPUWV.mjs";
5
+ import "../../chunk-45LOTCC4.mjs";
6
+ import "../../chunk-WO7DMSQU.mjs";
7
+ import "../../chunk-YWCNJELN.mjs";
8
+ import "../../chunk-5KQNAW4C.mjs";
9
+ import "../../chunk-BYNQODL3.mjs";
10
+ import "../../chunk-K26BOY6Z.mjs";
11
+ import "../../chunk-3WWFQLH4.mjs";
12
+ import "../../chunk-SYRWT2KT.mjs";
13
+ import "../../chunk-26C34AS7.mjs";
14
+ import "../../chunk-AZMQTZXZ.mjs";
15
+ import "../../chunk-ERSRIVYH.mjs";
16
+ import "../../chunk-JL3URCHO.mjs";
17
+ import "../../chunk-L72RLBV5.mjs";
18
+ import "../../chunk-QMD3VO6R.mjs";
19
+ import "../../chunk-TDSL55B3.mjs";
20
+ import "../../chunk-YCYGKEXF.mjs";
21
+ import "../../chunk-7RHK2YTB.mjs";
22
+ import "../../chunk-ZAW4ZWQX.mjs";
23
+ import "../../chunk-MR44GPM3.mjs";
24
+ import "../../chunk-X7TESUC7.mjs";
25
+ import "../../chunk-R77RJHC5.mjs";
26
+ export {
27
+ buildHandler
28
+ };
29
+ //# sourceMappingURL=build.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}