@metamask/snaps-cli 6.3.0 → 6.3.2

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 (636) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/dist/__fixtures__/configs/cjs.cjs +9 -0
  3. package/dist/__fixtures__/configs/cjs.cjs.map +1 -0
  4. package/dist/__fixtures__/configs/cjs.d.cts +2 -0
  5. package/dist/__fixtures__/configs/cjs.d.cts.map +1 -0
  6. package/dist/__fixtures__/configs/cjs.d.mts +2 -0
  7. package/dist/__fixtures__/configs/cjs.d.mts.map +1 -0
  8. package/dist/__fixtures__/configs/cjs.mjs +8 -0
  9. package/dist/__fixtures__/configs/cjs.mjs.map +1 -0
  10. package/dist/__fixtures__/configs/esm.cjs +7 -0
  11. package/dist/__fixtures__/configs/esm.cjs.map +1 -0
  12. package/dist/__fixtures__/configs/esm.d.cts +4 -0
  13. package/dist/__fixtures__/configs/esm.d.cts.map +1 -0
  14. package/dist/__fixtures__/configs/esm.d.mts +4 -0
  15. package/dist/__fixtures__/configs/esm.d.mts.map +1 -0
  16. package/dist/__fixtures__/configs/esm.mjs +5 -0
  17. package/dist/__fixtures__/configs/esm.mjs.map +1 -0
  18. package/dist/__fixtures__/configs/invalid.cjs +8 -0
  19. package/dist/__fixtures__/configs/invalid.cjs.map +1 -0
  20. package/dist/__fixtures__/configs/invalid.d.cts +4 -0
  21. package/dist/__fixtures__/configs/invalid.d.cts.map +1 -0
  22. package/dist/__fixtures__/configs/invalid.d.mts +4 -0
  23. package/dist/__fixtures__/configs/invalid.d.mts.map +1 -0
  24. package/dist/__fixtures__/configs/invalid.mjs +6 -0
  25. package/dist/__fixtures__/configs/invalid.mjs.map +1 -0
  26. package/dist/__fixtures__/configs/javascript/snap.config.cjs +6 -0
  27. package/dist/__fixtures__/configs/javascript/snap.config.cjs.map +1 -0
  28. package/dist/__fixtures__/configs/javascript/snap.config.d.cts +2 -0
  29. package/dist/__fixtures__/configs/javascript/snap.config.d.cts.map +1 -0
  30. package/dist/__fixtures__/configs/javascript/snap.config.d.mts +2 -0
  31. package/dist/__fixtures__/configs/javascript/snap.config.d.mts.map +1 -0
  32. package/dist/__fixtures__/configs/javascript/snap.config.mjs +5 -0
  33. package/dist/__fixtures__/configs/javascript/snap.config.mjs.map +1 -0
  34. package/dist/__fixtures__/configs/typescript/snap.config.cjs +7 -0
  35. package/dist/__fixtures__/configs/typescript/snap.config.cjs.map +1 -0
  36. package/dist/__fixtures__/configs/typescript/snap.config.d.cts +4 -0
  37. package/dist/__fixtures__/configs/typescript/snap.config.d.cts.map +1 -0
  38. package/dist/__fixtures__/configs/typescript/snap.config.d.mts +4 -0
  39. package/dist/__fixtures__/configs/typescript/snap.config.d.mts.map +1 -0
  40. package/dist/__fixtures__/configs/typescript/snap.config.mjs +5 -0
  41. package/dist/__fixtures__/configs/typescript/snap.config.mjs.map +1 -0
  42. package/dist/builders.cjs +132 -0
  43. package/dist/builders.cjs.map +1 -0
  44. package/dist/{types/builders.d.ts → builders.d.cts} +2 -1
  45. package/dist/builders.d.cts.map +1 -0
  46. package/dist/builders.d.mts +9 -0
  47. package/dist/builders.d.mts.map +1 -0
  48. package/dist/builders.mjs +127 -8
  49. package/dist/builders.mjs.map +1 -1
  50. package/dist/cli.cjs +71 -0
  51. package/dist/cli.cjs.map +1 -0
  52. package/dist/{types/cli.d.ts → cli.d.cts} +1 -0
  53. package/dist/cli.d.cts.map +1 -0
  54. package/dist/cli.d.mts +16 -0
  55. package/dist/cli.d.mts.map +1 -0
  56. package/dist/cli.mjs +69 -20
  57. package/dist/cli.mjs.map +1 -1
  58. package/dist/commands/build/build.cjs +53 -0
  59. package/dist/commands/build/build.cjs.map +1 -0
  60. package/dist/{types/commands/build/build.d.ts → commands/build/build.d.cts} +3 -1
  61. package/dist/commands/build/build.d.cts.map +1 -0
  62. package/dist/commands/build/build.d.mts +12 -0
  63. package/dist/commands/build/build.d.mts.map +1 -0
  64. package/dist/commands/build/build.mjs +48 -28
  65. package/dist/commands/build/build.mjs.map +1 -1
  66. package/dist/commands/build/implementation.cjs +31 -0
  67. package/dist/commands/build/implementation.cjs.map +1 -0
  68. package/dist/{types/commands/build/implementation.d.ts → commands/build/implementation.d.cts} +3 -2
  69. package/dist/commands/build/implementation.d.cts.map +1 -0
  70. package/dist/commands/build/implementation.d.mts +11 -0
  71. package/dist/commands/build/implementation.d.mts.map +1 -0
  72. package/dist/commands/build/implementation.mjs +26 -27
  73. package/dist/commands/build/implementation.mjs.map +1 -1
  74. package/dist/commands/build/index.cjs +44 -0
  75. package/dist/commands/build/index.cjs.map +1 -0
  76. package/dist/{types/commands/eval/index.d.ts → commands/build/index.d.cts} +4 -3
  77. package/dist/commands/build/index.d.cts.map +1 -0
  78. package/dist/{types/commands/manifest/index.d.ts → commands/build/index.d.mts} +4 -3
  79. package/dist/commands/build/index.d.mts.map +1 -0
  80. package/dist/commands/build/index.mjs +23 -31
  81. package/dist/commands/build/index.mjs.map +1 -1
  82. package/dist/commands/eval/__test__/browserify/bad/snap.config.cjs +10 -0
  83. package/dist/commands/eval/__test__/browserify/bad/snap.config.cjs.map +1 -0
  84. package/dist/commands/eval/__test__/browserify/bad/snap.config.d.cts +4 -0
  85. package/dist/commands/eval/__test__/browserify/bad/snap.config.d.cts.map +1 -0
  86. package/dist/commands/eval/__test__/browserify/bad/snap.config.d.mts +4 -0
  87. package/dist/commands/eval/__test__/browserify/bad/snap.config.d.mts.map +1 -0
  88. package/dist/commands/eval/__test__/browserify/bad/snap.config.mjs +8 -0
  89. package/dist/commands/eval/__test__/browserify/bad/snap.config.mjs.map +1 -0
  90. package/dist/commands/eval/__test__/browserify/good/snap.config.cjs +10 -0
  91. package/dist/commands/eval/__test__/browserify/good/snap.config.cjs.map +1 -0
  92. package/dist/commands/eval/__test__/browserify/good/snap.config.d.cts +4 -0
  93. package/dist/commands/eval/__test__/browserify/good/snap.config.d.cts.map +1 -0
  94. package/dist/commands/eval/__test__/browserify/good/snap.config.d.mts +4 -0
  95. package/dist/commands/eval/__test__/browserify/good/snap.config.d.mts.map +1 -0
  96. package/dist/commands/eval/__test__/browserify/good/snap.config.mjs +8 -0
  97. package/dist/commands/eval/__test__/browserify/good/snap.config.mjs.map +1 -0
  98. package/dist/commands/eval/__test__/webpack/bad/snap.config.cjs +12 -0
  99. package/dist/commands/eval/__test__/webpack/bad/snap.config.cjs.map +1 -0
  100. package/dist/commands/eval/__test__/webpack/bad/snap.config.d.cts +4 -0
  101. package/dist/commands/eval/__test__/webpack/bad/snap.config.d.cts.map +1 -0
  102. package/dist/commands/eval/__test__/webpack/bad/snap.config.d.mts +4 -0
  103. package/dist/commands/eval/__test__/webpack/bad/snap.config.d.mts.map +1 -0
  104. package/dist/commands/eval/__test__/webpack/bad/snap.config.mjs +10 -0
  105. package/dist/commands/eval/__test__/webpack/bad/snap.config.mjs.map +1 -0
  106. package/dist/commands/eval/__test__/webpack/good/snap.config.cjs +12 -0
  107. package/dist/commands/eval/__test__/webpack/good/snap.config.cjs.map +1 -0
  108. package/dist/commands/eval/__test__/webpack/good/snap.config.d.cts +4 -0
  109. package/dist/commands/eval/__test__/webpack/good/snap.config.d.cts.map +1 -0
  110. package/dist/commands/eval/__test__/webpack/good/snap.config.d.mts +4 -0
  111. package/dist/commands/eval/__test__/webpack/good/snap.config.d.mts.map +1 -0
  112. package/dist/commands/eval/__test__/webpack/good/snap.config.mjs +10 -0
  113. package/dist/commands/eval/__test__/webpack/good/snap.config.mjs.map +1 -0
  114. package/dist/commands/eval/__test__/webpack/snap.config.cjs +8 -0
  115. package/dist/commands/eval/__test__/webpack/snap.config.cjs.map +1 -0
  116. package/dist/commands/eval/__test__/webpack/snap.config.d.cts +4 -0
  117. package/dist/commands/eval/__test__/webpack/snap.config.d.cts.map +1 -0
  118. package/dist/commands/eval/__test__/webpack/snap.config.d.mts +4 -0
  119. package/dist/commands/eval/__test__/webpack/snap.config.d.mts.map +1 -0
  120. package/dist/commands/eval/__test__/webpack/snap.config.mjs +6 -0
  121. package/dist/commands/eval/__test__/webpack/snap.config.mjs.map +1 -0
  122. package/dist/commands/eval/eval.cjs +57 -0
  123. package/dist/commands/eval/eval.cjs.map +1 -0
  124. package/dist/{types/commands/eval/eval.d.ts → commands/eval/eval.d.cts} +2 -1
  125. package/dist/commands/eval/eval.d.cts.map +1 -0
  126. package/dist/commands/eval/eval.d.mts +15 -0
  127. package/dist/commands/eval/eval.d.mts.map +1 -0
  128. package/dist/commands/eval/eval.mjs +52 -17
  129. package/dist/commands/eval/eval.mjs.map +1 -1
  130. package/dist/commands/eval/implementation.cjs +30 -0
  131. package/dist/commands/eval/implementation.cjs.map +1 -0
  132. package/dist/{types/commands/eval/implementation.d.ts → commands/eval/implementation.d.cts} +2 -0
  133. package/dist/commands/eval/implementation.d.cts.map +1 -0
  134. package/dist/commands/eval/implementation.d.mts +11 -0
  135. package/dist/commands/eval/implementation.d.mts.map +1 -0
  136. package/dist/commands/eval/implementation.mjs +26 -8
  137. package/dist/commands/eval/implementation.mjs.map +1 -1
  138. package/dist/commands/eval/index.cjs +35 -0
  139. package/dist/commands/eval/index.cjs.map +1 -0
  140. package/dist/commands/eval/index.d.cts +11 -0
  141. package/dist/commands/eval/index.d.cts.map +1 -0
  142. package/dist/commands/eval/index.d.mts +11 -0
  143. package/dist/commands/eval/index.d.mts.map +1 -0
  144. package/dist/commands/eval/index.mjs +14 -20
  145. package/dist/commands/eval/index.mjs.map +1 -1
  146. package/dist/commands/index.cjs +19 -0
  147. package/dist/commands/index.cjs.map +1 -0
  148. package/dist/{types/commands/index.d.ts → commands/index.d.cts} +1 -0
  149. package/dist/commands/index.d.cts.map +1 -0
  150. package/dist/commands/index.d.mts +9 -0
  151. package/dist/commands/index.d.mts.map +1 -0
  152. package/dist/commands/index.mjs +13 -38
  153. package/dist/commands/index.mjs.map +1 -1
  154. package/dist/commands/manifest/implementation.cjs +64 -0
  155. package/dist/commands/manifest/implementation.cjs.map +1 -0
  156. package/dist/{types/commands/manifest/implementation.d.ts → commands/manifest/implementation.d.cts} +3 -1
  157. package/dist/commands/manifest/implementation.d.cts.map +1 -0
  158. package/dist/commands/manifest/implementation.d.mts +14 -0
  159. package/dist/commands/manifest/implementation.d.mts.map +1 -0
  160. package/dist/commands/manifest/implementation.mjs +60 -16
  161. package/dist/commands/manifest/implementation.mjs.map +1 -1
  162. package/dist/commands/manifest/index.cjs +35 -0
  163. package/dist/commands/manifest/index.cjs.map +1 -0
  164. package/dist/commands/manifest/index.d.cts +11 -0
  165. package/dist/commands/manifest/index.d.cts.map +1 -0
  166. package/dist/commands/manifest/index.d.mts +11 -0
  167. package/dist/commands/manifest/index.d.mts.map +1 -0
  168. package/dist/commands/manifest/index.mjs +14 -20
  169. package/dist/commands/manifest/index.mjs.map +1 -1
  170. package/dist/commands/manifest/manifest.cjs +57 -0
  171. package/dist/commands/manifest/manifest.cjs.map +1 -0
  172. package/dist/{types/commands/manifest/manifest.d.ts → commands/manifest/manifest.d.cts} +2 -1
  173. package/dist/commands/manifest/manifest.d.cts.map +1 -0
  174. package/dist/commands/manifest/manifest.d.mts +15 -0
  175. package/dist/commands/manifest/manifest.d.mts.map +1 -0
  176. package/dist/commands/manifest/manifest.mjs +52 -17
  177. package/dist/commands/manifest/manifest.mjs.map +1 -1
  178. package/dist/commands/serve/index.cjs +19 -0
  179. package/dist/commands/serve/index.cjs.map +1 -0
  180. package/dist/{types/commands/serve/index.d.ts → commands/serve/index.d.cts} +3 -2
  181. package/dist/commands/serve/index.d.cts.map +1 -0
  182. package/dist/{types/commands/build/index.d.ts → commands/serve/index.d.mts} +3 -3
  183. package/dist/commands/serve/index.d.mts.map +1 -0
  184. package/dist/commands/serve/index.mjs +12 -27
  185. package/dist/commands/serve/index.mjs.map +1 -1
  186. package/dist/commands/serve/serve.cjs +21 -0
  187. package/dist/commands/serve/serve.cjs.map +1 -0
  188. package/dist/{types/commands/serve/serve.d.ts → commands/serve/serve.d.cts} +2 -1
  189. package/dist/commands/serve/serve.d.cts.map +1 -0
  190. package/dist/commands/serve/serve.d.mts +17 -0
  191. package/dist/commands/serve/serve.d.mts.map +1 -0
  192. package/dist/commands/serve/serve.mjs +16 -27
  193. package/dist/commands/serve/serve.mjs.map +1 -1
  194. package/dist/commands/watch/implementation.cjs +38 -0
  195. package/dist/{chunk-BAEGXYL7.mjs.map → commands/watch/implementation.cjs.map} +1 -1
  196. package/dist/{types/commands/watch/implementation.d.ts → commands/watch/implementation.d.cts} +4 -3
  197. package/dist/commands/watch/implementation.d.cts.map +1 -0
  198. package/dist/commands/watch/implementation.d.mts +15 -0
  199. package/dist/commands/watch/implementation.d.mts.map +1 -0
  200. package/dist/commands/watch/implementation.mjs +33 -27
  201. package/dist/commands/watch/implementation.mjs.map +1 -1
  202. package/dist/commands/watch/index.cjs +49 -0
  203. package/dist/commands/watch/index.cjs.map +1 -0
  204. package/dist/commands/watch/index.d.cts +11 -0
  205. package/dist/commands/watch/index.d.cts.map +1 -0
  206. package/dist/commands/watch/index.d.mts +11 -0
  207. package/dist/commands/watch/index.d.mts.map +1 -0
  208. package/dist/commands/watch/index.mjs +28 -31
  209. package/dist/commands/watch/index.mjs.map +1 -1
  210. package/dist/commands/watch/watch.cjs +49 -0
  211. package/dist/commands/watch/watch.cjs.map +1 -0
  212. package/dist/{types/commands/watch/watch.d.ts → commands/watch/watch.d.cts} +2 -1
  213. package/dist/commands/watch/watch.d.cts.map +1 -0
  214. package/dist/commands/watch/watch.d.mts +20 -0
  215. package/dist/commands/watch/watch.d.mts.map +1 -0
  216. package/dist/commands/watch/watch.mjs +44 -28
  217. package/dist/commands/watch/watch.mjs.map +1 -1
  218. package/dist/config.cjs +334 -0
  219. package/dist/config.cjs.map +1 -0
  220. package/dist/{types/config.d.ts → config.d.cts} +44 -43
  221. package/dist/config.d.cts.map +1 -0
  222. package/dist/config.d.mts +821 -0
  223. package/dist/config.d.mts.map +1 -0
  224. package/dist/config.mjs +322 -35
  225. package/dist/config.mjs.map +1 -1
  226. package/dist/errors.cjs +38 -0
  227. package/dist/errors.cjs.map +1 -0
  228. package/dist/{types/errors.d.ts → errors.d.cts} +1 -0
  229. package/dist/errors.d.cts.map +1 -0
  230. package/dist/errors.d.mts +26 -0
  231. package/dist/errors.d.mts.map +1 -0
  232. package/dist/errors.mjs +32 -11
  233. package/dist/errors.mjs.map +1 -1
  234. package/dist/index.cjs +39 -0
  235. package/dist/index.cjs.map +1 -0
  236. package/dist/index.d.cts +6 -0
  237. package/dist/index.d.cts.map +1 -0
  238. package/dist/index.d.mts +6 -0
  239. package/dist/index.d.mts.map +1 -0
  240. package/dist/index.mjs +4 -44
  241. package/dist/index.mjs.map +1 -1
  242. package/dist/main.cjs +24 -0
  243. package/dist/main.cjs.map +1 -0
  244. package/dist/main.d.cts +3 -0
  245. package/dist/main.d.cts.map +1 -0
  246. package/dist/main.d.mts +3 -0
  247. package/dist/main.d.mts.map +1 -0
  248. package/dist/main.mjs +15 -45
  249. package/dist/main.mjs.map +1 -1
  250. package/dist/structs.cjs +31 -0
  251. package/dist/structs.cjs.map +1 -0
  252. package/dist/{types/structs.d.ts → structs.d.cts} +1 -0
  253. package/dist/structs.d.cts.map +1 -0
  254. package/dist/structs.d.mts +21 -0
  255. package/dist/structs.d.mts.map +1 -0
  256. package/dist/structs.mjs +26 -7
  257. package/dist/structs.mjs.map +1 -1
  258. package/dist/utils/cli.cjs +52 -0
  259. package/dist/utils/cli.cjs.map +1 -0
  260. package/dist/{types/utils/cli.d.ts → utils/cli.d.cts} +1 -0
  261. package/dist/utils/cli.d.cts.map +1 -0
  262. package/dist/utils/cli.d.mts +18 -0
  263. package/dist/utils/cli.d.mts.map +1 -0
  264. package/dist/utils/cli.mjs +43 -13
  265. package/dist/utils/cli.mjs.map +1 -1
  266. package/dist/utils/errors.cjs +49 -0
  267. package/dist/utils/errors.cjs.map +1 -0
  268. package/dist/{types/utils/errors.d.ts → utils/errors.d.cts} +1 -0
  269. package/dist/utils/errors.d.cts.map +1 -0
  270. package/dist/utils/errors.d.mts +24 -0
  271. package/dist/utils/errors.d.mts.map +1 -0
  272. package/dist/utils/errors.mjs +43 -10
  273. package/dist/utils/errors.mjs.map +1 -1
  274. package/dist/utils/index.cjs +23 -0
  275. package/dist/utils/index.cjs.map +1 -0
  276. package/dist/utils/index.d.cts +7 -0
  277. package/dist/utils/index.d.cts.map +1 -0
  278. package/dist/utils/index.d.mts +7 -0
  279. package/dist/utils/index.d.mts.map +1 -0
  280. package/dist/utils/index.mjs +6 -46
  281. package/dist/utils/index.mjs.map +1 -1
  282. package/dist/utils/legacy.cjs +53 -0
  283. package/dist/utils/legacy.cjs.map +1 -0
  284. package/dist/{types/utils/legacy.d.ts → utils/legacy.d.cts} +2 -1
  285. package/dist/utils/legacy.d.cts.map +1 -0
  286. package/dist/utils/legacy.d.mts +28 -0
  287. package/dist/utils/legacy.d.mts.map +1 -0
  288. package/dist/utils/legacy.mjs +46 -12
  289. package/dist/utils/legacy.mjs.map +1 -1
  290. package/dist/utils/logging.cjs +48 -0
  291. package/dist/utils/logging.cjs.map +1 -0
  292. package/dist/{types/utils/logging.d.ts → utils/logging.d.cts} +2 -1
  293. package/dist/utils/logging.d.cts.map +1 -0
  294. package/dist/utils/logging.d.mts +23 -0
  295. package/dist/utils/logging.d.mts.map +1 -0
  296. package/dist/utils/logging.mjs +42 -11
  297. package/dist/utils/logging.mjs.map +1 -1
  298. package/dist/utils/path.cjs +17 -0
  299. package/dist/utils/path.cjs.map +1 -0
  300. package/dist/{types/utils/path.d.ts → utils/path.d.cts} +1 -0
  301. package/dist/utils/path.d.cts.map +1 -0
  302. package/dist/utils/path.d.mts +10 -0
  303. package/dist/utils/path.d.mts.map +1 -0
  304. package/dist/utils/path.mjs +12 -7
  305. package/dist/utils/path.mjs.map +1 -1
  306. package/dist/utils/steps.cjs +51 -0
  307. package/dist/utils/steps.cjs.map +1 -0
  308. package/dist/{types/utils/steps.d.ts → utils/steps.d.cts} +2 -1
  309. package/dist/utils/steps.d.cts.map +1 -0
  310. package/dist/utils/steps.d.mts +18 -0
  311. package/dist/utils/steps.d.mts.map +1 -0
  312. package/dist/utils/steps.mjs +51 -10
  313. package/dist/utils/steps.mjs.map +1 -1
  314. package/dist/webpack/compiler.cjs +19 -0
  315. package/dist/webpack/compiler.cjs.map +1 -0
  316. package/dist/{types/webpack/compiler.d.ts → webpack/compiler.d.cts} +3 -2
  317. package/dist/webpack/compiler.d.cts.map +1 -0
  318. package/dist/webpack/compiler.d.mts +11 -0
  319. package/dist/webpack/compiler.d.mts.map +1 -0
  320. package/dist/webpack/compiler.mjs +15 -24
  321. package/dist/webpack/compiler.mjs.map +1 -1
  322. package/dist/webpack/config.cjs +349 -0
  323. package/dist/webpack/config.cjs.map +1 -0
  324. package/dist/{types/webpack/config.d.ts → webpack/config.d.cts} +4 -3
  325. package/dist/webpack/config.d.cts.map +1 -0
  326. package/dist/webpack/config.d.mts +38 -0
  327. package/dist/webpack/config.d.mts.map +1 -0
  328. package/dist/webpack/config.mjs +349 -23
  329. package/dist/webpack/config.mjs.map +1 -1
  330. package/dist/webpack/index.cjs +21 -0
  331. package/dist/webpack/index.cjs.map +1 -0
  332. package/dist/webpack/index.d.cts +5 -0
  333. package/dist/webpack/index.d.cts.map +1 -0
  334. package/dist/webpack/index.d.mts +5 -0
  335. package/dist/webpack/index.d.mts.map +1 -0
  336. package/dist/webpack/index.mjs +4 -43
  337. package/dist/webpack/index.mjs.map +1 -1
  338. package/dist/webpack/loaders/browserify.cjs +84 -0
  339. package/dist/webpack/loaders/browserify.cjs.map +1 -0
  340. package/dist/{types/webpack/loaders/browserify.d.ts → webpack/loaders/browserify.d.cts} +4 -2
  341. package/dist/webpack/loaders/browserify.d.cts.map +1 -0
  342. package/dist/webpack/loaders/browserify.d.mts +18 -0
  343. package/dist/webpack/loaders/browserify.d.mts.map +1 -0
  344. package/dist/webpack/loaders/browserify.mjs +84 -17
  345. package/dist/webpack/loaders/browserify.mjs.map +1 -1
  346. package/dist/webpack/loaders/function.cjs +45 -0
  347. package/dist/webpack/loaders/function.cjs.map +1 -0
  348. package/dist/{types/webpack/loaders/function.d.ts → webpack/loaders/function.d.cts} +2 -1
  349. package/dist/webpack/loaders/function.d.cts.map +1 -0
  350. package/dist/webpack/loaders/function.d.mts +35 -0
  351. package/dist/webpack/loaders/function.d.mts.map +1 -0
  352. package/dist/webpack/loaders/function.mjs +39 -8
  353. package/dist/webpack/loaders/function.mjs.map +1 -1
  354. package/dist/webpack/loaders/index.cjs +26 -0
  355. package/dist/webpack/loaders/index.cjs.map +1 -0
  356. package/dist/webpack/loaders/index.d.cts +4 -0
  357. package/dist/webpack/loaders/index.d.cts.map +1 -0
  358. package/dist/webpack/loaders/index.d.mts +4 -0
  359. package/dist/webpack/loaders/index.d.mts.map +1 -0
  360. package/dist/webpack/loaders/index.mjs +3 -24
  361. package/dist/webpack/loaders/index.mjs.map +1 -1
  362. package/dist/webpack/loaders/wasm.cjs +103 -0
  363. package/dist/webpack/loaders/wasm.cjs.map +1 -0
  364. package/dist/{types/webpack/loaders/wasm.d.ts → webpack/loaders/wasm.d.cts} +2 -1
  365. package/dist/webpack/loaders/wasm.d.cts.map +1 -0
  366. package/dist/webpack/loaders/wasm.d.mts +43 -0
  367. package/dist/webpack/loaders/wasm.d.mts.map +1 -0
  368. package/dist/webpack/loaders/wasm.mjs +95 -14
  369. package/dist/webpack/loaders/wasm.mjs.map +1 -1
  370. package/dist/webpack/plugins.cjs +277 -0
  371. package/dist/webpack/plugins.cjs.map +1 -0
  372. package/dist/{types/webpack/plugins.d.ts → webpack/plugins.d.cts} +3 -2
  373. package/dist/webpack/plugins.d.cts.map +1 -0
  374. package/dist/webpack/plugins.d.mts +148 -0
  375. package/dist/webpack/plugins.d.mts.map +1 -0
  376. package/dist/webpack/plugins.mjs +270 -27
  377. package/dist/webpack/plugins.mjs.map +1 -1
  378. package/dist/webpack/server.cjs +144 -0
  379. package/dist/webpack/server.cjs.map +1 -0
  380. package/dist/{types/webpack/server.d.ts → webpack/server.d.cts} +5 -3
  381. package/dist/webpack/server.d.cts.map +1 -0
  382. package/dist/webpack/server.d.mts +32 -0
  383. package/dist/webpack/server.d.mts.map +1 -0
  384. package/dist/webpack/server.mjs +142 -9
  385. package/dist/webpack/server.mjs.map +1 -1
  386. package/dist/webpack/utils.cjs +359 -0
  387. package/dist/webpack/utils.cjs.map +1 -0
  388. package/dist/{types/webpack/utils.d.ts → webpack/utils.d.cts} +4 -3
  389. package/dist/webpack/utils.d.cts.map +1 -0
  390. package/dist/webpack/utils.d.mts +259 -0
  391. package/dist/webpack/utils.d.mts.map +1 -0
  392. package/dist/webpack/utils.mjs +350 -37
  393. package/dist/webpack/utils.mjs.map +1 -1
  394. package/package.json +22 -22
  395. package/dist/builders.js +0 -10
  396. package/dist/builders.js.map +0 -1
  397. package/dist/chunk-24QJ2ZUZ.mjs +0 -55
  398. package/dist/chunk-24QJ2ZUZ.mjs.map +0 -1
  399. package/dist/chunk-2P3D6FNV.mjs +0 -23
  400. package/dist/chunk-2P3D6FNV.mjs.map +0 -1
  401. package/dist/chunk-2ZBAKBVW.js +0 -28
  402. package/dist/chunk-2ZBAKBVW.js.map +0 -1
  403. package/dist/chunk-3WWFQLH4.mjs +0 -30
  404. package/dist/chunk-3WWFQLH4.mjs.map +0 -1
  405. package/dist/chunk-45LOTCC4.mjs +0 -1
  406. package/dist/chunk-45LOTCC4.mjs.map +0 -1
  407. package/dist/chunk-4A5QZUC7.mjs +0 -68
  408. package/dist/chunk-4A5QZUC7.mjs.map +0 -1
  409. package/dist/chunk-4JEJ7WKR.js +0 -61
  410. package/dist/chunk-4JEJ7WKR.js.map +0 -1
  411. package/dist/chunk-4QUVE3EK.js +0 -53
  412. package/dist/chunk-4QUVE3EK.js.map +0 -1
  413. package/dist/chunk-5IN3GGMV.js +0 -68
  414. package/dist/chunk-5IN3GGMV.js.map +0 -1
  415. package/dist/chunk-6ABGZTV7.mjs +0 -16
  416. package/dist/chunk-6ABGZTV7.mjs.map +0 -1
  417. package/dist/chunk-6EEZHGF5.js +0 -23
  418. package/dist/chunk-6EEZHGF5.js.map +0 -1
  419. package/dist/chunk-7H5FH7RY.js +0 -22
  420. package/dist/chunk-7H5FH7RY.js.map +0 -1
  421. package/dist/chunk-7RHK2YTB.mjs +0 -32
  422. package/dist/chunk-7RHK2YTB.mjs.map +0 -1
  423. package/dist/chunk-AQSQ7YYP.mjs +0 -24
  424. package/dist/chunk-AQSQ7YYP.mjs.map +0 -1
  425. package/dist/chunk-AZMQTZXZ.mjs +0 -28
  426. package/dist/chunk-AZMQTZXZ.mjs.map +0 -1
  427. package/dist/chunk-B3NNVTA6.js +0 -32
  428. package/dist/chunk-B3NNVTA6.js.map +0 -1
  429. package/dist/chunk-BAEGXYL7.mjs +0 -35
  430. package/dist/chunk-BALQOCUO.js +0 -22
  431. package/dist/chunk-BALQOCUO.js.map +0 -1
  432. package/dist/chunk-BYNQODL3.mjs +0 -23
  433. package/dist/chunk-BYNQODL3.mjs.map +0 -1
  434. package/dist/chunk-C44RRX3H.js +0 -18
  435. package/dist/chunk-C44RRX3H.js.map +0 -1
  436. package/dist/chunk-C46KEPAC.js +0 -37
  437. package/dist/chunk-C46KEPAC.js.map +0 -1
  438. package/dist/chunk-CB77QR32.js +0 -52
  439. package/dist/chunk-CB77QR32.js.map +0 -1
  440. package/dist/chunk-CZRGAFVI.mjs +0 -28
  441. package/dist/chunk-CZRGAFVI.mjs.map +0 -1
  442. package/dist/chunk-D2ZIM5W2.js +0 -370
  443. package/dist/chunk-D2ZIM5W2.js.map +0 -1
  444. package/dist/chunk-DBLADLQ4.js +0 -10
  445. package/dist/chunk-DBLADLQ4.js.map +0 -1
  446. package/dist/chunk-ERSRIVYH.mjs +0 -64
  447. package/dist/chunk-ERSRIVYH.mjs.map +0 -1
  448. package/dist/chunk-G62Q4YO5.js +0 -30
  449. package/dist/chunk-G62Q4YO5.js.map +0 -1
  450. package/dist/chunk-HAYK73YO.js +0 -23
  451. package/dist/chunk-HAYK73YO.js.map +0 -1
  452. package/dist/chunk-HLQEI6DV.js +0 -54
  453. package/dist/chunk-HLQEI6DV.js.map +0 -1
  454. package/dist/chunk-HLSCFGA7.mjs +0 -13
  455. package/dist/chunk-HLSCFGA7.mjs.map +0 -1
  456. package/dist/chunk-HOVEQTF3.mjs +0 -346
  457. package/dist/chunk-HOVEQTF3.mjs.map +0 -1
  458. package/dist/chunk-JAHNVVLT.mjs +0 -18
  459. package/dist/chunk-JAHNVVLT.mjs.map +0 -1
  460. package/dist/chunk-JCVSYVPD.mjs +0 -24
  461. package/dist/chunk-JCVSYVPD.mjs.map +0 -1
  462. package/dist/chunk-JL3URCHO.mjs +0 -53
  463. package/dist/chunk-JL3URCHO.mjs.map +0 -1
  464. package/dist/chunk-K26BOY6Z.mjs +0 -51
  465. package/dist/chunk-K26BOY6Z.mjs.map +0 -1
  466. package/dist/chunk-KLOPX6DO.js +0 -51
  467. package/dist/chunk-KLOPX6DO.js.map +0 -1
  468. package/dist/chunk-KWHAT6UJ.mjs +0 -22
  469. package/dist/chunk-KWHAT6UJ.mjs.map +0 -1
  470. package/dist/chunk-L72RLBV5.mjs +0 -37
  471. package/dist/chunk-L72RLBV5.mjs.map +0 -1
  472. package/dist/chunk-MECBOP7G.js +0 -35
  473. package/dist/chunk-MECBOP7G.js.map +0 -1
  474. package/dist/chunk-MR44GPM3.mjs +0 -135
  475. package/dist/chunk-MR44GPM3.mjs.map +0 -1
  476. package/dist/chunk-MR5TAGOG.mjs +0 -54
  477. package/dist/chunk-MR5TAGOG.mjs.map +0 -1
  478. package/dist/chunk-MUYXNION.js +0 -30
  479. package/dist/chunk-MUYXNION.js.map +0 -1
  480. package/dist/chunk-MXOKUCLH.js +0 -347
  481. package/dist/chunk-MXOKUCLH.js.map +0 -1
  482. package/dist/chunk-NGS23BTR.js +0 -13
  483. package/dist/chunk-NGS23BTR.js.map +0 -1
  484. package/dist/chunk-NOBUMOYX.mjs +0 -61
  485. package/dist/chunk-NOBUMOYX.mjs.map +0 -1
  486. package/dist/chunk-NR4OJOGX.mjs +0 -370
  487. package/dist/chunk-NR4OJOGX.mjs.map +0 -1
  488. package/dist/chunk-OIFTFHZ4.mjs +0 -30
  489. package/dist/chunk-OIFTFHZ4.mjs.map +0 -1
  490. package/dist/chunk-PDYQXXLP.js +0 -30
  491. package/dist/chunk-PDYQXXLP.js.map +0 -1
  492. package/dist/chunk-QAM2JJRA.mjs +0 -52
  493. package/dist/chunk-QAM2JJRA.mjs.map +0 -1
  494. package/dist/chunk-QHCKVO3P.js +0 -28
  495. package/dist/chunk-QHCKVO3P.js.map +0 -1
  496. package/dist/chunk-QMB2ZRWW.js +0 -16
  497. package/dist/chunk-QMB2ZRWW.js.map +0 -1
  498. package/dist/chunk-QMD3VO6R.mjs +0 -30
  499. package/dist/chunk-QMD3VO6R.mjs.map +0 -1
  500. package/dist/chunk-QRW2GKA3.mjs +0 -347
  501. package/dist/chunk-QRW2GKA3.mjs.map +0 -1
  502. package/dist/chunk-R77RJHC5.mjs +0 -44
  503. package/dist/chunk-R77RJHC5.mjs.map +0 -1
  504. package/dist/chunk-RANTKN66.js +0 -24
  505. package/dist/chunk-RANTKN66.js.map +0 -1
  506. package/dist/chunk-S7UP2YYF.js +0 -135
  507. package/dist/chunk-S7UP2YYF.js.map +0 -1
  508. package/dist/chunk-SQXMNT7M.js +0 -326
  509. package/dist/chunk-SQXMNT7M.js.map +0 -1
  510. package/dist/chunk-SYRWT2KT.mjs +0 -124
  511. package/dist/chunk-SYRWT2KT.mjs.map +0 -1
  512. package/dist/chunk-TDSL55B3.mjs +0 -10
  513. package/dist/chunk-TDSL55B3.mjs.map +0 -1
  514. package/dist/chunk-TJ2F3J6X.js +0 -31
  515. package/dist/chunk-TJ2F3J6X.js.map +0 -1
  516. package/dist/chunk-U4VFMIGO.js +0 -24
  517. package/dist/chunk-U4VFMIGO.js.map +0 -1
  518. package/dist/chunk-V6SYDSWM.mjs +0 -326
  519. package/dist/chunk-V6SYDSWM.mjs.map +0 -1
  520. package/dist/chunk-VXOV3ZCB.js +0 -1
  521. package/dist/chunk-VXOV3ZCB.js.map +0 -1
  522. package/dist/chunk-X3D3MHWF.js +0 -44
  523. package/dist/chunk-X3D3MHWF.js.map +0 -1
  524. package/dist/chunk-X7TESUC7.mjs +0 -22
  525. package/dist/chunk-X7TESUC7.mjs.map +0 -1
  526. package/dist/chunk-XGWLFH7Y.js +0 -41
  527. package/dist/chunk-XGWLFH7Y.js.map +0 -1
  528. package/dist/chunk-YCOC4VEP.js +0 -346
  529. package/dist/chunk-YCOC4VEP.js.map +0 -1
  530. package/dist/chunk-YCYGKEXF.mjs +0 -41
  531. package/dist/chunk-YCYGKEXF.mjs.map +0 -1
  532. package/dist/chunk-YGEAZQSC.js +0 -124
  533. package/dist/chunk-YGEAZQSC.js.map +0 -1
  534. package/dist/chunk-YQ2E7NEA.js +0 -64
  535. package/dist/chunk-YQ2E7NEA.js.map +0 -1
  536. package/dist/chunk-ZAW4ZWQX.mjs +0 -31
  537. package/dist/chunk-ZAW4ZWQX.mjs.map +0 -1
  538. package/dist/chunk-ZVUF6JDJ.js +0 -55
  539. package/dist/chunk-ZVUF6JDJ.js.map +0 -1
  540. package/dist/cli.js +0 -21
  541. package/dist/cli.js.map +0 -1
  542. package/dist/commands/build/build.js +0 -29
  543. package/dist/commands/build/build.js.map +0 -1
  544. package/dist/commands/build/implementation.js +0 -28
  545. package/dist/commands/build/implementation.js.map +0 -1
  546. package/dist/commands/build/index.js +0 -33
  547. package/dist/commands/build/index.js.map +0 -1
  548. package/dist/commands/eval/eval.js +0 -18
  549. package/dist/commands/eval/eval.js.map +0 -1
  550. package/dist/commands/eval/implementation.js +0 -9
  551. package/dist/commands/eval/implementation.js.map +0 -1
  552. package/dist/commands/eval/index.js +0 -22
  553. package/dist/commands/eval/index.js.map +0 -1
  554. package/dist/commands/index.js +0 -39
  555. package/dist/commands/index.js.map +0 -1
  556. package/dist/commands/manifest/implementation.js +0 -17
  557. package/dist/commands/manifest/implementation.js.map +0 -1
  558. package/dist/commands/manifest/index.js +0 -22
  559. package/dist/commands/manifest/index.js.map +0 -1
  560. package/dist/commands/manifest/manifest.js +0 -18
  561. package/dist/commands/manifest/manifest.js.map +0 -1
  562. package/dist/commands/serve/index.js +0 -29
  563. package/dist/commands/serve/index.js.map +0 -1
  564. package/dist/commands/serve/serve.js +0 -28
  565. package/dist/commands/serve/serve.js.map +0 -1
  566. package/dist/commands/watch/implementation.js +0 -28
  567. package/dist/commands/watch/implementation.js.map +0 -1
  568. package/dist/commands/watch/index.js +0 -33
  569. package/dist/commands/watch/index.js.map +0 -1
  570. package/dist/commands/watch/watch.js +0 -29
  571. package/dist/commands/watch/watch.js.map +0 -1
  572. package/dist/config.js +0 -36
  573. package/dist/config.js.map +0 -1
  574. package/dist/errors.js +0 -12
  575. package/dist/errors.js.map +0 -1
  576. package/dist/index.js +0 -45
  577. package/dist/index.js.map +0 -1
  578. package/dist/main.js +0 -49
  579. package/dist/main.js.map +0 -1
  580. package/dist/structs.js +0 -8
  581. package/dist/structs.js.map +0 -1
  582. package/dist/tsconfig.build.tsbuildinfo +0 -1
  583. package/dist/types/__fixtures__/configs/cjs.d.ts +0 -1
  584. package/dist/types/__fixtures__/configs/esm.d.ts +0 -3
  585. package/dist/types/__fixtures__/configs/invalid.d.ts +0 -3
  586. package/dist/types/__fixtures__/configs/javascript/snap.config.d.ts +0 -0
  587. package/dist/types/__fixtures__/configs/typescript/snap.config.d.ts +0 -3
  588. package/dist/types/commands/eval/__test__/browserify/bad/snap.config.d.ts +0 -3
  589. package/dist/types/commands/eval/__test__/browserify/good/snap.config.d.ts +0 -3
  590. package/dist/types/commands/eval/__test__/webpack/bad/snap.config.d.ts +0 -3
  591. package/dist/types/commands/eval/__test__/webpack/good/snap.config.d.ts +0 -3
  592. package/dist/types/commands/eval/__test__/webpack/snap.config.d.ts +0 -3
  593. package/dist/types/commands/watch/index.d.ts +0 -10
  594. package/dist/types/index.d.ts +0 -5
  595. package/dist/types/main.d.ts +0 -2
  596. package/dist/types/utils/index.d.ts +0 -6
  597. package/dist/types/webpack/index.d.ts +0 -4
  598. package/dist/types/webpack/loaders/index.d.ts +0 -3
  599. package/dist/types/yargs.d.js +0 -1
  600. package/dist/types/yargs.d.js.map +0 -1
  601. package/dist/types/yargs.d.mjs +0 -1
  602. package/dist/types/yargs.d.mjs.map +0 -1
  603. package/dist/utils/cli.js +0 -14
  604. package/dist/utils/cli.js.map +0 -1
  605. package/dist/utils/errors.js +0 -11
  606. package/dist/utils/errors.js.map +0 -1
  607. package/dist/utils/index.js +0 -47
  608. package/dist/utils/index.js.map +0 -1
  609. package/dist/utils/legacy.js +0 -13
  610. package/dist/utils/legacy.js.map +0 -1
  611. package/dist/utils/logging.js +0 -12
  612. package/dist/utils/logging.js.map +0 -1
  613. package/dist/utils/path.js +0 -8
  614. package/dist/utils/path.js.map +0 -1
  615. package/dist/utils/steps.js +0 -11
  616. package/dist/utils/steps.js.map +0 -1
  617. package/dist/webpack/compiler.js +0 -25
  618. package/dist/webpack/compiler.js.map +0 -1
  619. package/dist/webpack/config.js +0 -24
  620. package/dist/webpack/config.js.map +0 -1
  621. package/dist/webpack/index.js +0 -44
  622. package/dist/webpack/index.js.map +0 -1
  623. package/dist/webpack/loaders/browserify.js +0 -19
  624. package/dist/webpack/loaders/browserify.js.map +0 -1
  625. package/dist/webpack/loaders/function.js +0 -10
  626. package/dist/webpack/loaders/function.js.map +0 -1
  627. package/dist/webpack/loaders/index.js +0 -25
  628. package/dist/webpack/loaders/index.js.map +0 -1
  629. package/dist/webpack/loaders/wasm.js +0 -16
  630. package/dist/webpack/loaders/wasm.js.map +0 -1
  631. package/dist/webpack/plugins.js +0 -29
  632. package/dist/webpack/plugins.js.map +0 -1
  633. package/dist/webpack/server.js +0 -10
  634. package/dist/webpack/server.js.map +0 -1
  635. package/dist/webpack/utils.js +0 -39
  636. package/dist/webpack/utils.js.map +0 -1
@@ -0,0 +1,821 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ import type { BrowserifyObject } from "browserify";
3
+ import type { Configuration as WebpackConfiguration } from "webpack";
4
+ import { TranspilationModes } from "./builders.mjs";
5
+ import type { YargsArgs } from "./types/yargs.d.mjs";
6
+ /**
7
+ * The configuration for the Snaps CLI, stored as `snap.config.js` or
8
+ * `snap.config.ts` in the root of the project.
9
+ *
10
+ * @deprecated The Browserify bundler is deprecated and will be removed in a
11
+ * future release. Use the Webpack bundler instead.
12
+ */
13
+ export type SnapBrowserifyConfig = {
14
+ /**
15
+ * The bundler to use to build the snap. For backwards compatibility, if not
16
+ * specified, Browserify will be used. However, the Browserify bundler is
17
+ * deprecated and will be removed in a future release, so it's recommended to
18
+ * use the Webpack bundler instead.
19
+ */
20
+ bundler: 'browserify';
21
+ /**
22
+ * The options for the Snaps CLI. These are merged with the options passed to
23
+ * the CLI, with the CLI options taking precedence.
24
+ *
25
+ * @deprecated The Browserify bundler is deprecated and will be removed in a
26
+ * future release. Use the Webpack bundler instead.
27
+ */
28
+ cliOptions?: {
29
+ /**
30
+ * The path to the snap bundle file.
31
+ *
32
+ * @default 'dist/bundle.js'
33
+ */
34
+ bundle?: string;
35
+ /**
36
+ * The directory to output the snap to. This is only used if `bundle` is
37
+ * not specified.
38
+ *
39
+ * @default 'dist'
40
+ */
41
+ dist?: string;
42
+ /**
43
+ * Whether to attempt to evaluate the snap in SES. This can catch some errors
44
+ * that would otherwise only be caught at runtime.
45
+ *
46
+ * @default true
47
+ */
48
+ eval?: boolean;
49
+ /**
50
+ * Whether to validate the snap manifest.
51
+ *
52
+ * @default true
53
+ */
54
+ manifest?: boolean;
55
+ /**
56
+ * The name of the bundle file. This is only used if `bundle` is not
57
+ * specified.
58
+ *
59
+ * @default 'bundle.js'
60
+ */
61
+ outfileName?: string;
62
+ /**
63
+ * The port to run the server on.
64
+ *
65
+ * @default 8081
66
+ */
67
+ port?: number;
68
+ /**
69
+ * The root directory to serve the snap from.
70
+ *
71
+ * @default `process.cwd()`
72
+ */
73
+ root?: string;
74
+ /**
75
+ * Whether to generate source maps for the snap bundle.
76
+ *
77
+ * @default false
78
+ */
79
+ sourceMaps?: boolean;
80
+ /**
81
+ * The path to the snap entry point.
82
+ *
83
+ * @default 'src/index.js'
84
+ */
85
+ src?: string;
86
+ /**
87
+ * Whether to remove comments from the bundle.
88
+ *
89
+ * @default true
90
+ */
91
+ stripComments?: boolean;
92
+ /**
93
+ * Whether to suppress warnings.
94
+ *
95
+ * @default false
96
+ */
97
+ suppressWarnings?: boolean;
98
+ /**
99
+ * The transpilation mode to use, which determines which files are
100
+ * transpiled.
101
+ *
102
+ * - `'localAndDeps'`: Transpile the snap entry point and all dependencies.
103
+ * - `'localOnly'`: Transpile only the snap entry point.
104
+ * - `'none'`: Don't transpile any files.
105
+ *
106
+ * @default 'localOnly'
107
+ */
108
+ transpilationMode?: 'localAndDeps' | 'localOnly' | 'none';
109
+ /**
110
+ * The dependencies to transpile when `transpilationMode` is set to
111
+ * `'localAndDeps'`. If not specified, all dependencies will be transpiled.
112
+ */
113
+ depsToTranspile?: string[];
114
+ /**
115
+ * Whether to show original errors.
116
+ *
117
+ * @default true
118
+ */
119
+ verboseErrors?: boolean;
120
+ /**
121
+ * Whether to write the updated manifest to disk.
122
+ *
123
+ * @default true
124
+ */
125
+ writeManifest?: boolean;
126
+ /**
127
+ * Whether to serve the snap locally.
128
+ *
129
+ * @default true
130
+ */
131
+ serve?: boolean;
132
+ };
133
+ /**
134
+ * A function that can be used to customize the Browserify instance used to
135
+ * build the snap.
136
+ *
137
+ * @param bundler - The Browserify instance.
138
+ * @deprecated The Browserify bundler is deprecated and will be removed in a
139
+ * future release. Use the Webpack bundler instead.
140
+ */
141
+ bundlerCustomizer?: (bundler: BrowserifyObject) => void;
142
+ };
143
+ /**
144
+ * The configuration for the Snaps CLI, stored as `snap.config.js` or
145
+ * `snap.config.ts` in the root of the project.
146
+ */
147
+ export type SnapWebpackConfig = {
148
+ /**
149
+ * The bundler to use to build the snap. For backwards compatibility, if not
150
+ * specified, Browserify will be used. However, the Browserify bundler is
151
+ * deprecated and will be removed in a future release, so it's recommended to
152
+ * use the Webpack bundler instead.
153
+ */
154
+ bundler?: 'webpack';
155
+ /**
156
+ * The path to the snap entry point. This should be a JavaScript or TypeScript
157
+ * file.
158
+ */
159
+ input: string;
160
+ /**
161
+ * Whether to generate source maps for the snap. If `true`, source maps will
162
+ * be generated as separate files. If `'inline'`, source maps will be
163
+ * inlined in the generated JavaScript bundle.
164
+ *
165
+ * @default true
166
+ */
167
+ sourceMap?: boolean | 'inline';
168
+ /**
169
+ * Whether to attempt to evaluate the snap in SES. This can catch some errors
170
+ * that would otherwise only be caught at runtime.
171
+ *
172
+ * @default true
173
+ */
174
+ evaluate?: boolean;
175
+ output?: {
176
+ /**
177
+ * The path to the directory where the snap will be built. This directory
178
+ * will be created if it doesn't exist.
179
+ *
180
+ * If the path is relative, it will be resolved relative to the current
181
+ * working directory.
182
+ *
183
+ * @default 'dist'
184
+ */
185
+ path?: string;
186
+ /**
187
+ * The name of the JavaScript bundle file.
188
+ *
189
+ * @default 'bundle.js'
190
+ */
191
+ filename?: string;
192
+ /**
193
+ * Whether to clean the output directory before building the snap. If
194
+ * `true`, the output directory will be deleted and recreated. Otherwise,
195
+ * the output directory will be left as-is.
196
+ *
197
+ * @default false
198
+ */
199
+ clean?: boolean;
200
+ /**
201
+ * Whether to minimize the snap bundle. If `true`, the bundle will be
202
+ * minified. Otherwise, the bundle will be left as-is.
203
+ *
204
+ * @default true
205
+ */
206
+ minimize?: boolean;
207
+ };
208
+ manifest?: {
209
+ /**
210
+ * The path to the snap manifest file. If the path is relative, it will be
211
+ * resolved relative to the current working directory.
212
+ *
213
+ * @default 'snap.manifest.json'
214
+ */
215
+ path?: string;
216
+ /**
217
+ * Whether to automatically update the manifest. If `true`, the manifest
218
+ * will be updated with the latest shasum of the snap bundle, and some
219
+ * common fields will be updated if they are missing or incorrect. If
220
+ * `false`, the manifest will be left as-is.
221
+ *
222
+ * @default true
223
+ */
224
+ update?: boolean;
225
+ };
226
+ server?: {
227
+ /**
228
+ * Whether to enable the local server. If `true`, the snap will be served
229
+ * from a local server, when running the `watch` command. If `false`, the
230
+ * snap will not be served.
231
+ *
232
+ * @default true
233
+ */
234
+ enabled?: boolean;
235
+ /**
236
+ * The root directory to serve the snap from. If the path is relative, it
237
+ * will be resolved relative to the current working directory.
238
+ *
239
+ * @default `process.cwd()`
240
+ */
241
+ root?: string;
242
+ /**
243
+ * The port to run the server on.
244
+ *
245
+ * @default 8081
246
+ */
247
+ port?: number;
248
+ };
249
+ /**
250
+ * The environment variables to set when building the snap. These will be
251
+ * available in the snap as `process.env`. In addition to these environment
252
+ * variables, the following environment variables will always be set:
253
+ *
254
+ * - `NODE_DEBUG`: `false`
255
+ * - `NODE_ENV`: `'production'`
256
+ * - `DEBUG`: `false`
257
+ *
258
+ * Any environment variables specified here will override these defaults. You
259
+ * can also override any variables here by setting them in your shell when
260
+ * running the CLI.
261
+ */
262
+ environment?: Record<string, unknown>;
263
+ /**
264
+ * Options that control the logging output of the CLI.
265
+ */
266
+ stats?: {
267
+ /**
268
+ * Whether to enable verbose logging.
269
+ *
270
+ * @default false
271
+ */
272
+ verbose?: boolean;
273
+ /**
274
+ * Whether to log warnings about unresolved built-in modules. If `false`,
275
+ * warnings will not be logged.
276
+ */
277
+ builtIns?: {
278
+ /**
279
+ * The built-in modules to ignore when resolving modules. If a module
280
+ * is ignored, no warning will be logged if it is not resolved.
281
+ */
282
+ ignore?: string[];
283
+ } | false;
284
+ /**
285
+ * Whether to log warnings about the use of the `Buffer` global. If `false`,
286
+ * warnings will not be logged. If `true`, the CLI will warn if the `Buffer`
287
+ * global is used, but not provided by Webpack's `DefinePlugin`.
288
+ */
289
+ buffer?: boolean;
290
+ };
291
+ /**
292
+ * Whether to provide polyfills for node builtins. If `true`, all the available
293
+ * polyfills will be provided. If `false` no polyfills will be provided. If a
294
+ * configuration object is passed only the polyfills set to `true` will be provided.
295
+ *
296
+ * @default false
297
+ * @example
298
+ * ```ts
299
+ * polyfills: true
300
+ *
301
+ * // or
302
+ *
303
+ * polyfills: {
304
+ * assert: true,
305
+ * buffer: true
306
+ * }
307
+ * ```
308
+ */
309
+ polyfills?: boolean | {
310
+ assert?: boolean;
311
+ buffer?: boolean;
312
+ console?: boolean;
313
+ constants?: boolean;
314
+ crypto?: boolean;
315
+ domain?: boolean;
316
+ events?: boolean;
317
+ http?: boolean;
318
+ https?: boolean;
319
+ os?: boolean;
320
+ path?: boolean;
321
+ punycode?: boolean;
322
+ process?: boolean;
323
+ querystring?: boolean;
324
+ stream?: boolean;
325
+ _stream_duplex?: boolean;
326
+ _stream_passthrough?: boolean;
327
+ _stream_readable?: boolean;
328
+ _stream_transform?: boolean;
329
+ _stream_writable?: boolean;
330
+ string_decoder?: boolean;
331
+ sys?: boolean;
332
+ timers?: boolean;
333
+ tty?: boolean;
334
+ url?: boolean;
335
+ util?: boolean;
336
+ vm?: boolean;
337
+ zlib?: boolean;
338
+ };
339
+ /**
340
+ * Optional features to enable in the CLI.
341
+ *
342
+ * @example
343
+ * {
344
+ * features: {
345
+ * images: true,
346
+ * }
347
+ * }
348
+ */
349
+ features?: {
350
+ /**
351
+ * Whether to enable support for images. If `true`, the Webpack
352
+ * configuration will be modified to support images. If `false`, the
353
+ * Webpack configuration will not be modified.
354
+ *
355
+ * @default true
356
+ */
357
+ images?: boolean;
358
+ };
359
+ /**
360
+ * A function to customize the Webpack configuration used to build the snap.
361
+ * This function will be called with the default Webpack configuration, and
362
+ * should return the modified configuration. If not specified, the default
363
+ * configuration will be used.
364
+ *
365
+ * It's recommended to use the `webpack-merge` package to merge the default
366
+ * configuration with your customizations. The merge function is exported as
367
+ * `merge` from the `@metamask/snaps-cli` package.
368
+ *
369
+ * @example
370
+ * ```ts
371
+ * import type { SnapsConfig } from '@metamask/snaps-cli';
372
+ * import { merge } from '@metamask/snaps-cli';
373
+ *
374
+ * const config: SnapsConfig = {
375
+ * bundler: 'webpack',
376
+ * entry: 'src/index.ts',
377
+ * customizeWebpackConfig: (config) => merge(config, {
378
+ * module: {
379
+ * rules: [
380
+ * {
381
+ * test: /\.wasm$/,
382
+ * type: 'assets/resource',
383
+ * },
384
+ * ],
385
+ * },
386
+ * }),
387
+ * };
388
+ *
389
+ * export default config;
390
+ * ```
391
+ */
392
+ customizeWebpackConfig?: (config: WebpackConfiguration) => WebpackConfiguration;
393
+ /**
394
+ * Experimental features that can be enabled. These features are not
395
+ * guaranteed to be stable, and may be removed or changed in a future release.
396
+ */
397
+ experimental?: {
398
+ /**
399
+ * Whether to enable WebAssembly support. If `true`, the Webpack
400
+ * configuration will be modified to support WebAssembly. If `false`, the
401
+ * Webpack configuration will not be modified.
402
+ *
403
+ * @default false
404
+ */
405
+ wasm?: boolean;
406
+ };
407
+ };
408
+ /**
409
+ * The configuration for the Snaps CLI, stored as `snap.config.js` or
410
+ * `snap.config.ts` in the root of the project.
411
+ */
412
+ export type SnapConfig = SnapBrowserifyConfig | SnapWebpackConfig;
413
+ type SnapsBrowserifyBundlerCustomizerFunction = (bundler: BrowserifyObject) => void;
414
+ export declare const SnapsBrowserifyConfigStruct: import("@metamask/superstruct").Struct<{
415
+ bundler: "browserify";
416
+ cliOptions: {
417
+ dist: string;
418
+ eval: boolean;
419
+ manifest: boolean;
420
+ port: number;
421
+ outfileName: string;
422
+ root: string;
423
+ sourceMaps: boolean;
424
+ src: string;
425
+ stripComments: boolean;
426
+ suppressWarnings: boolean;
427
+ transpilationMode: "localAndDeps" | "localOnly" | "none";
428
+ depsToTranspile: string[];
429
+ verboseErrors: boolean;
430
+ writeManifest: boolean;
431
+ serve: boolean;
432
+ bundle?: string | undefined;
433
+ };
434
+ bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
435
+ }, {
436
+ bundler: import("@metamask/superstruct").Struct<"browserify", null>;
437
+ cliOptions: import("@metamask/superstruct").Struct<{
438
+ dist: string;
439
+ eval: boolean;
440
+ manifest: boolean;
441
+ port: number;
442
+ outfileName: string;
443
+ root: string;
444
+ sourceMaps: boolean;
445
+ src: string;
446
+ stripComments: boolean;
447
+ suppressWarnings: boolean;
448
+ transpilationMode: "localAndDeps" | "localOnly" | "none";
449
+ depsToTranspile: string[];
450
+ verboseErrors: boolean;
451
+ writeManifest: boolean;
452
+ serve: boolean;
453
+ bundle?: string | undefined;
454
+ }, {
455
+ bundle: import("@metamask/superstruct").Struct<string | undefined, null>;
456
+ dist: import("@metamask/superstruct").Struct<string, null>;
457
+ eval: import("@metamask/superstruct").Struct<boolean, null>;
458
+ manifest: import("@metamask/superstruct").Struct<boolean, null>;
459
+ port: import("@metamask/superstruct").Struct<number, null>;
460
+ outfileName: import("@metamask/superstruct").Struct<string, null>;
461
+ root: import("@metamask/superstruct").Struct<string, null>;
462
+ sourceMaps: import("@metamask/superstruct").Struct<boolean, null>;
463
+ src: import("@metamask/superstruct").Struct<string, null>;
464
+ stripComments: import("@metamask/superstruct").Struct<boolean, null>;
465
+ suppressWarnings: import("@metamask/superstruct").Struct<boolean, null>;
466
+ transpilationMode: import("@metamask/superstruct").Struct<"localAndDeps" | "localOnly" | "none", [head: import("@metamask/superstruct").Struct<"localAndDeps", null>, import("@metamask/superstruct").Struct<"localOnly", null>, import("@metamask/superstruct").Struct<"none", null>]>;
467
+ depsToTranspile: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
468
+ verboseErrors: import("@metamask/superstruct").Struct<boolean, null>;
469
+ writeManifest: import("@metamask/superstruct").Struct<boolean, null>;
470
+ serve: import("@metamask/superstruct").Struct<boolean, null>;
471
+ }>;
472
+ bundlerCustomizer: import("@metamask/superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
473
+ }>;
474
+ type SnapsWebpackCustomizeWebpackConfigFunction = (config: WebpackConfiguration) => WebpackConfiguration;
475
+ export declare const SnapsWebpackConfigStruct: import("@metamask/superstruct").Struct<{
476
+ input: string;
477
+ manifest: {
478
+ path: string;
479
+ update: boolean;
480
+ };
481
+ bundler: "webpack";
482
+ sourceMap: boolean | "inline";
483
+ evaluate: boolean;
484
+ output: {
485
+ path: string;
486
+ filename: string;
487
+ clean: boolean;
488
+ minimize: boolean;
489
+ };
490
+ server: {
491
+ port: number;
492
+ root: string;
493
+ enabled: boolean;
494
+ };
495
+ environment: Record<string, unknown>;
496
+ stats: {
497
+ verbose: boolean;
498
+ builtIns: false | {
499
+ ignore: string[];
500
+ };
501
+ buffer: boolean;
502
+ };
503
+ polyfills: boolean | {
504
+ path: boolean;
505
+ stream: boolean;
506
+ buffer: boolean;
507
+ assert: boolean;
508
+ console: boolean;
509
+ constants: boolean;
510
+ crypto: boolean;
511
+ domain: boolean;
512
+ events: boolean;
513
+ http: boolean;
514
+ https: boolean;
515
+ os: boolean;
516
+ punycode: boolean;
517
+ process: boolean;
518
+ querystring: boolean;
519
+ _stream_duplex: boolean;
520
+ _stream_passthrough: boolean;
521
+ _stream_readable: boolean;
522
+ _stream_transform: boolean;
523
+ _stream_writable: boolean;
524
+ string_decoder: boolean;
525
+ sys: boolean;
526
+ timers: boolean;
527
+ tty: boolean;
528
+ url: boolean;
529
+ util: boolean;
530
+ vm: boolean;
531
+ zlib: boolean;
532
+ };
533
+ features: {
534
+ images: boolean;
535
+ };
536
+ experimental: {
537
+ wasm: boolean;
538
+ };
539
+ customizeWebpackConfig?: SnapsWebpackCustomizeWebpackConfigFunction | undefined;
540
+ }, {
541
+ bundler: import("@metamask/superstruct").Struct<"webpack", null>;
542
+ input: import("@metamask/superstruct").Struct<string, null>;
543
+ sourceMap: import("@metamask/superstruct").Struct<boolean | "inline", [head: import("@metamask/superstruct").Struct<boolean, null>, import("@metamask/superstruct").Struct<"inline", null>]>;
544
+ evaluate: import("@metamask/superstruct").Struct<boolean, null>;
545
+ output: import("@metamask/superstruct").Struct<{
546
+ path: string;
547
+ filename: string;
548
+ clean: boolean;
549
+ minimize: boolean;
550
+ }, {
551
+ path: import("@metamask/superstruct").Struct<string, null>;
552
+ filename: import("@metamask/superstruct").Struct<string, null>;
553
+ clean: import("@metamask/superstruct").Struct<boolean, null>;
554
+ minimize: import("@metamask/superstruct").Struct<boolean, null>;
555
+ }>;
556
+ manifest: import("@metamask/superstruct").Struct<{
557
+ path: string;
558
+ update: boolean;
559
+ }, {
560
+ path: import("@metamask/superstruct").Struct<string, null>;
561
+ update: import("@metamask/superstruct").Struct<boolean, null>;
562
+ }>;
563
+ server: import("@metamask/superstruct").Struct<{
564
+ port: number;
565
+ root: string;
566
+ enabled: boolean;
567
+ }, {
568
+ enabled: import("@metamask/superstruct").Struct<boolean, null>;
569
+ root: import("@metamask/superstruct").Struct<string, null>;
570
+ port: import("@metamask/superstruct").Struct<number, null>;
571
+ }>;
572
+ environment: import("@metamask/superstruct").Struct<Record<string, unknown>, null>;
573
+ stats: import("@metamask/superstruct").Struct<{
574
+ verbose: boolean;
575
+ builtIns: false | {
576
+ ignore: string[];
577
+ };
578
+ buffer: boolean;
579
+ }, {
580
+ verbose: import("@metamask/superstruct").Struct<boolean, null>;
581
+ builtIns: import("@metamask/superstruct").Struct<false | {
582
+ ignore: string[];
583
+ }, [head: import("@metamask/superstruct").Struct<{
584
+ ignore: string[];
585
+ }, {
586
+ ignore: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
587
+ }>, import("@metamask/superstruct").Struct<false, null>]>;
588
+ buffer: import("@metamask/superstruct").Struct<boolean, null>;
589
+ }>;
590
+ polyfills: import("@metamask/superstruct").Struct<boolean | {
591
+ path: boolean;
592
+ stream: boolean;
593
+ buffer: boolean;
594
+ assert: boolean;
595
+ console: boolean;
596
+ constants: boolean;
597
+ crypto: boolean;
598
+ domain: boolean;
599
+ events: boolean;
600
+ http: boolean;
601
+ https: boolean;
602
+ os: boolean;
603
+ punycode: boolean;
604
+ process: boolean;
605
+ querystring: boolean;
606
+ _stream_duplex: boolean;
607
+ _stream_passthrough: boolean;
608
+ _stream_readable: boolean;
609
+ _stream_transform: boolean;
610
+ _stream_writable: boolean;
611
+ string_decoder: boolean;
612
+ sys: boolean;
613
+ timers: boolean;
614
+ tty: boolean;
615
+ url: boolean;
616
+ util: boolean;
617
+ vm: boolean;
618
+ zlib: boolean;
619
+ }, [head: import("@metamask/superstruct").Struct<boolean, null>, import("@metamask/superstruct").Struct<{
620
+ path: boolean;
621
+ stream: boolean;
622
+ buffer: boolean;
623
+ assert: boolean;
624
+ console: boolean;
625
+ constants: boolean;
626
+ crypto: boolean;
627
+ domain: boolean;
628
+ events: boolean;
629
+ http: boolean;
630
+ https: boolean;
631
+ os: boolean;
632
+ punycode: boolean;
633
+ process: boolean;
634
+ querystring: boolean;
635
+ _stream_duplex: boolean;
636
+ _stream_passthrough: boolean;
637
+ _stream_readable: boolean;
638
+ _stream_transform: boolean;
639
+ _stream_writable: boolean;
640
+ string_decoder: boolean;
641
+ sys: boolean;
642
+ timers: boolean;
643
+ tty: boolean;
644
+ url: boolean;
645
+ util: boolean;
646
+ vm: boolean;
647
+ zlib: boolean;
648
+ }, {
649
+ assert: import("@metamask/superstruct").Struct<boolean, null>;
650
+ buffer: import("@metamask/superstruct").Struct<boolean, null>;
651
+ console: import("@metamask/superstruct").Struct<boolean, null>;
652
+ constants: import("@metamask/superstruct").Struct<boolean, null>;
653
+ crypto: import("@metamask/superstruct").Struct<boolean, null>;
654
+ domain: import("@metamask/superstruct").Struct<boolean, null>;
655
+ events: import("@metamask/superstruct").Struct<boolean, null>;
656
+ http: import("@metamask/superstruct").Struct<boolean, null>;
657
+ https: import("@metamask/superstruct").Struct<boolean, null>;
658
+ os: import("@metamask/superstruct").Struct<boolean, null>;
659
+ path: import("@metamask/superstruct").Struct<boolean, null>;
660
+ punycode: import("@metamask/superstruct").Struct<boolean, null>;
661
+ process: import("@metamask/superstruct").Struct<boolean, null>;
662
+ querystring: import("@metamask/superstruct").Struct<boolean, null>;
663
+ stream: import("@metamask/superstruct").Struct<boolean, null>;
664
+ _stream_duplex: import("@metamask/superstruct").Struct<boolean, null>;
665
+ _stream_passthrough: import("@metamask/superstruct").Struct<boolean, null>;
666
+ _stream_readable: import("@metamask/superstruct").Struct<boolean, null>;
667
+ _stream_transform: import("@metamask/superstruct").Struct<boolean, null>;
668
+ _stream_writable: import("@metamask/superstruct").Struct<boolean, null>;
669
+ string_decoder: import("@metamask/superstruct").Struct<boolean, null>;
670
+ sys: import("@metamask/superstruct").Struct<boolean, null>;
671
+ timers: import("@metamask/superstruct").Struct<boolean, null>;
672
+ tty: import("@metamask/superstruct").Struct<boolean, null>;
673
+ url: import("@metamask/superstruct").Struct<boolean, null>;
674
+ util: import("@metamask/superstruct").Struct<boolean, null>;
675
+ vm: import("@metamask/superstruct").Struct<boolean, null>;
676
+ zlib: import("@metamask/superstruct").Struct<boolean, null>;
677
+ }>]>;
678
+ features: import("@metamask/superstruct").Struct<{
679
+ images: boolean;
680
+ }, {
681
+ images: import("@metamask/superstruct").Struct<boolean, null>;
682
+ }>;
683
+ customizeWebpackConfig: import("@metamask/superstruct").Struct<SnapsWebpackCustomizeWebpackConfigFunction | undefined, null>;
684
+ experimental: import("@metamask/superstruct").Struct<{
685
+ wasm: boolean;
686
+ }, {
687
+ wasm: import("@metamask/superstruct").Struct<boolean, null>;
688
+ }>;
689
+ }>;
690
+ export declare const SnapsConfigStruct: import("@metamask/superstruct").Struct<{
691
+ bundler: "browserify" | "webpack";
692
+ }, {
693
+ bundler: import("@metamask/superstruct").Struct<"browserify" | "webpack", [head: import("@metamask/superstruct").Struct<"browserify", null>, import("@metamask/superstruct").Struct<"webpack", null>]>;
694
+ }>;
695
+ export declare const LegacyOptionsStruct: import("@metamask/superstruct").Struct<{
696
+ transpilationMode: TranspilationModes.LocalAndDeps;
697
+ depsToTranspile: string[];
698
+ writeManifest: boolean;
699
+ bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
700
+ } | {
701
+ transpilationMode: TranspilationModes.LocalOnly | TranspilationModes.None;
702
+ depsToTranspile: unknown[];
703
+ writeManifest: boolean;
704
+ bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
705
+ }, [head: import("@metamask/superstruct").Struct<{
706
+ transpilationMode: TranspilationModes.LocalAndDeps;
707
+ depsToTranspile: string[];
708
+ writeManifest: boolean;
709
+ bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
710
+ }, {
711
+ depsToTranspile: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
712
+ transpilationMode: import("@metamask/superstruct").Struct<TranspilationModes.LocalAndDeps, null>;
713
+ writeManifest: import("@metamask/superstruct").Struct<boolean, null>;
714
+ bundlerCustomizer: import("@metamask/superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
715
+ }>, import("@metamask/superstruct").Struct<{
716
+ transpilationMode: TranspilationModes.LocalOnly | TranspilationModes.None;
717
+ depsToTranspile: unknown[];
718
+ writeManifest: boolean;
719
+ bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
720
+ }, {
721
+ depsToTranspile: import("@metamask/superstruct").Struct<unknown[], undefined>;
722
+ transpilationMode: import("@metamask/superstruct").Struct<TranspilationModes.LocalOnly | TranspilationModes.None, [head: import("@metamask/superstruct").Struct<TranspilationModes.LocalOnly, null>, import("@metamask/superstruct").Struct<TranspilationModes.None, null>]>;
723
+ writeManifest: import("@metamask/superstruct").Struct<boolean, null>;
724
+ bundlerCustomizer: import("@metamask/superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
725
+ }>]>;
726
+ export type LegacyOptions = Infer<typeof LegacyOptionsStruct>;
727
+ export type ProcessedBrowserifyConfig = Infer<typeof SnapsBrowserifyConfigStruct>;
728
+ export type ProcessedWebpackConfig = Infer<typeof SnapsWebpackConfigStruct> & {
729
+ /**
730
+ * The legacy Browserify config, if the bundler is Browserify. This is used
731
+ * to support the legacy config format.
732
+ */
733
+ legacy?: LegacyOptions;
734
+ };
735
+ export type ProcessedConfig = ProcessedWebpackConfig;
736
+ /**
737
+ * Get a validated snap config. This validates the config and adds default
738
+ * values for any missing properties.
739
+ *
740
+ * @param config - The config to validate.
741
+ * @param argv - The CLI arguments.
742
+ * @returns The validated config.
743
+ */
744
+ export declare function getConfig(config: unknown, argv: YargsArgs): ProcessedConfig;
745
+ /**
746
+ * Load a snap config from a file. This supports both JavaScript and TypeScript
747
+ * config files, in the CommonJS module format and the ES module format.
748
+ *
749
+ * This assumes that the config file exports a default object, either through
750
+ * `module.exports` or `export default`.
751
+ *
752
+ * @param path - The full path to the config file.
753
+ * @param argv - The CLI arguments.
754
+ * @returns The validated config.
755
+ * @throws If the config file is invalid, or if the config file does not have a
756
+ * default export.
757
+ */
758
+ export declare function loadConfig(path: string, argv: YargsArgs): Promise<ProcessedWebpackConfig>;
759
+ /**
760
+ * Resolve a snap config. This function will look for a `snap.config.js` or
761
+ * `snap.config.ts` file in the current or specified directory.
762
+ *
763
+ * @param path - The path to resolve the snap config from. Defaults to the
764
+ * current working directory.
765
+ * @param argv - The CLI arguments.
766
+ * @returns The resolved and validated snap config.
767
+ * @throws If a snap config could not be found.
768
+ */
769
+ export declare function resolveConfig(path: string, argv: YargsArgs): Promise<ProcessedWebpackConfig>;
770
+ /**
771
+ * Get a snap config from the CLI arguments. This will either load the config
772
+ * from the specified config file, or resolve the config from the current
773
+ * working directory.
774
+ *
775
+ * @param argv - The CLI arguments.
776
+ * @param cwd - The current working directory. Defaults to `process.cwd()`.
777
+ * @returns The resolved and validated snap config.
778
+ */
779
+ export declare function getConfigByArgv(argv: YargsArgs, cwd?: string): Promise<ProcessedWebpackConfig>;
780
+ /**
781
+ * Merge legacy CLI options into the config. This is used to support the legacy
782
+ * config format, where options can be specified both in the config file and
783
+ * through CLI flags.
784
+ *
785
+ * @param argv - The CLI arguments.
786
+ * @param config - The config to merge the CLI options into.
787
+ * @returns The config with the CLI options merged in.
788
+ * @deprecated This function is only used to support the legacy config format.
789
+ */
790
+ export declare function mergeLegacyOptions(argv: YargsArgs, config: ProcessedBrowserifyConfig): {
791
+ cliOptions: {
792
+ dist: string;
793
+ eval: boolean;
794
+ manifest: boolean;
795
+ port: number;
796
+ outfileName: string;
797
+ root: string;
798
+ sourceMaps: boolean;
799
+ src: string;
800
+ stripComments: boolean;
801
+ suppressWarnings: boolean;
802
+ transpilationMode: "localAndDeps" | "localOnly" | "none";
803
+ depsToTranspile: string[];
804
+ verboseErrors: boolean;
805
+ writeManifest: boolean;
806
+ serve: boolean;
807
+ bundle?: string | undefined;
808
+ };
809
+ bundler: "browserify";
810
+ bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
811
+ };
812
+ /**
813
+ * Get a Webpack config from a legacy browserify config. This is used to
814
+ * support the legacy config format, and convert it to the new format.
815
+ *
816
+ * @param legacyConfig - The legacy browserify config.
817
+ * @returns The Webpack config.
818
+ */
819
+ export declare function getWebpackConfig(legacyConfig: ProcessedBrowserifyConfig): ProcessedWebpackConfig;
820
+ export {};
821
+ //# sourceMappingURL=config.d.mts.map