@metamask/snaps-cli 5.1.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/dist/builders.js +10 -0
- package/dist/builders.js.map +1 -0
- package/dist/builders.mjs +10 -0
- package/dist/builders.mjs.map +1 -0
- package/dist/chunk-25SLEORF.mjs +28 -0
- package/dist/chunk-25SLEORF.mjs.map +1 -0
- package/dist/chunk-2QVYYMUD.js +365 -0
- package/dist/chunk-2QVYYMUD.js.map +1 -0
- package/dist/{esm/webpack/config.js → chunk-3LNPS7AX.js} +182 -156
- package/dist/chunk-3LNPS7AX.js.map +1 -0
- package/dist/chunk-46JUPGRY.js +22 -0
- package/dist/chunk-46JUPGRY.js.map +1 -0
- package/dist/chunk-4NHBPMKT.js +54 -0
- package/dist/chunk-4NHBPMKT.js.map +1 -0
- package/dist/chunk-4OKAI7AP.js +52 -0
- package/dist/chunk-4OKAI7AP.js.map +1 -0
- package/dist/chunk-5DDAAM2X.js +41 -0
- package/dist/chunk-5DDAAM2X.js.map +1 -0
- package/dist/chunk-5DSV76XV.mjs +10 -0
- package/dist/chunk-5DSV76XV.mjs.map +1 -0
- package/dist/chunk-5JPLNWCO.js +24 -0
- package/dist/chunk-5JPLNWCO.js.map +1 -0
- package/dist/chunk-5VAZH7L7.js +64 -0
- package/dist/chunk-5VAZH7L7.js.map +1 -0
- package/dist/chunk-5YUHRLH6.js +22 -0
- package/dist/chunk-5YUHRLH6.js.map +1 -0
- package/dist/chunk-6IF2UBYA.mjs +13 -0
- package/dist/chunk-6IF2UBYA.mjs.map +1 -0
- package/dist/chunk-6NJAXMSB.js +135 -0
- package/dist/chunk-6NJAXMSB.js.map +1 -0
- package/dist/chunk-6VFUO2H5.mjs +124 -0
- package/dist/chunk-6VFUO2H5.mjs.map +1 -0
- package/dist/chunk-7SN4Y44H.js +287 -0
- package/dist/chunk-7SN4Y44H.js.map +1 -0
- package/dist/chunk-ASOCIPDR.js +10 -0
- package/dist/chunk-ASOCIPDR.js.map +1 -0
- package/dist/chunk-B455GFXP.mjs +54 -0
- package/dist/chunk-B455GFXP.mjs.map +1 -0
- package/dist/chunk-DWS4BJTE.mjs +64 -0
- package/dist/chunk-DWS4BJTE.mjs.map +1 -0
- package/dist/chunk-EQRMXKXY.js +346 -0
- package/dist/chunk-EQRMXKXY.js.map +1 -0
- package/dist/chunk-EXGQAOQS.js +64 -0
- package/dist/chunk-EXGQAOQS.js.map +1 -0
- package/dist/chunk-EXJCMAUI.mjs +23 -0
- package/dist/chunk-EXJCMAUI.mjs.map +1 -0
- package/dist/chunk-FPG4GBXZ.js +30 -0
- package/dist/chunk-FPG4GBXZ.js.map +1 -0
- package/dist/chunk-FYTQTDZU.mjs +52 -0
- package/dist/chunk-FYTQTDZU.mjs.map +1 -0
- package/dist/chunk-G3IYVYVR.js +31 -0
- package/dist/chunk-G3IYVYVR.js.map +1 -0
- package/dist/chunk-GC7BNDLY.js +23 -0
- package/dist/chunk-GC7BNDLY.js.map +1 -0
- package/dist/chunk-GKG7TO7T.js +28 -0
- package/dist/chunk-GKG7TO7T.js.map +1 -0
- package/dist/chunk-GU2KH52B.mjs +53 -0
- package/dist/chunk-GU2KH52B.mjs.map +1 -0
- package/dist/chunk-GUXDSKV4.mjs +51 -0
- package/dist/chunk-GUXDSKV4.mjs.map +1 -0
- package/dist/chunk-HGYXRW5B.js +50 -0
- package/dist/chunk-HGYXRW5B.js.map +1 -0
- package/dist/chunk-HJ4276TR.mjs +41 -0
- package/dist/chunk-HJ4276TR.mjs.map +1 -0
- package/dist/chunk-HNLMKJBX.js +30 -0
- package/dist/chunk-HNLMKJBX.js.map +1 -0
- package/dist/chunk-IJYBCHVM.js +32 -0
- package/dist/chunk-IJYBCHVM.js.map +1 -0
- package/dist/chunk-IQTGFRWK.js +18 -0
- package/dist/chunk-IQTGFRWK.js.map +1 -0
- package/dist/chunk-IYAFFTJU.js +23 -0
- package/dist/chunk-IYAFFTJU.js.map +1 -0
- package/dist/chunk-JMISQ4HT.mjs +31 -0
- package/dist/chunk-JMISQ4HT.mjs.map +1 -0
- package/dist/chunk-K3TSXPME.js +16 -0
- package/dist/chunk-K3TSXPME.js.map +1 -0
- package/dist/{cjs/webpack/config.js → chunk-KKTPKAZN.mjs} +181 -153
- package/dist/chunk-KKTPKAZN.mjs.map +1 -0
- package/dist/chunk-KZFWI73A.js +28 -0
- package/dist/chunk-KZFWI73A.js.map +1 -0
- package/dist/chunk-L5TMG6BQ.js +37 -0
- package/dist/chunk-L5TMG6BQ.js.map +1 -0
- package/dist/chunk-MCN7UXG3.mjs +287 -0
- package/dist/chunk-MCN7UXG3.mjs.map +1 -0
- package/dist/chunk-MIV2UFTA.js +13 -0
- package/dist/chunk-MIV2UFTA.js.map +1 -0
- package/dist/chunk-MMBQXT2G.mjs +30 -0
- package/dist/chunk-MMBQXT2G.mjs.map +1 -0
- package/dist/chunk-NO53G7NT.js +61 -0
- package/dist/chunk-NO53G7NT.js.map +1 -0
- package/dist/chunk-O2QUFUOY.js +53 -0
- package/dist/chunk-O2QUFUOY.js.map +1 -0
- package/dist/chunk-OF4BF57X.mjs +22 -0
- package/dist/chunk-OF4BF57X.mjs.map +1 -0
- package/dist/chunk-OVCYXVWI.mjs +1 -0
- package/dist/chunk-OVCYXVWI.mjs.map +1 -0
- package/dist/chunk-PDNDGMB2.mjs +365 -0
- package/dist/chunk-PDNDGMB2.mjs.map +1 -0
- package/dist/chunk-QCP4QKMQ.mjs +24 -0
- package/dist/chunk-QCP4QKMQ.mjs.map +1 -0
- package/dist/chunk-QH4AQR33.mjs +61 -0
- package/dist/chunk-QH4AQR33.mjs.map +1 -0
- package/dist/chunk-S5ERYB6I.mjs +64 -0
- package/dist/chunk-S5ERYB6I.mjs.map +1 -0
- package/dist/chunk-SAEZHRJJ.mjs +23 -0
- package/dist/chunk-SAEZHRJJ.mjs.map +1 -0
- package/dist/chunk-T3KPXUAU.js +24 -0
- package/dist/chunk-T3KPXUAU.js.map +1 -0
- package/dist/chunk-T74IXMA3.mjs +50 -0
- package/dist/chunk-T74IXMA3.mjs.map +1 -0
- package/dist/chunk-TLTTWAEI.mjs +37 -0
- package/dist/chunk-TLTTWAEI.mjs.map +1 -0
- package/dist/chunk-TX4BG5GS.mjs +50 -0
- package/dist/chunk-TX4BG5GS.mjs.map +1 -0
- package/dist/chunk-UA5FEKKH.mjs +30 -0
- package/dist/chunk-UA5FEKKH.mjs.map +1 -0
- package/dist/chunk-UBWM7UOC.mjs +32 -0
- package/dist/chunk-UBWM7UOC.mjs.map +1 -0
- package/dist/chunk-USFFVX52.mjs +35 -0
- package/dist/chunk-USFFVX52.mjs.map +1 -0
- package/dist/chunk-V5Q5HRXB.mjs +30 -0
- package/dist/chunk-V5Q5HRXB.mjs.map +1 -0
- package/dist/chunk-VI3ZJJYO.mjs +346 -0
- package/dist/chunk-VI3ZJJYO.mjs.map +1 -0
- package/dist/chunk-VTJFPUIA.mjs +22 -0
- package/dist/chunk-VTJFPUIA.mjs.map +1 -0
- package/dist/chunk-WH7GOZP7.js +51 -0
- package/dist/chunk-WH7GOZP7.js.map +1 -0
- package/dist/chunk-WJNHZ4YF.js +35 -0
- package/dist/chunk-WJNHZ4YF.js.map +1 -0
- package/dist/chunk-WKL7DYYW.mjs +16 -0
- package/dist/chunk-WKL7DYYW.mjs.map +1 -0
- package/dist/chunk-X2RPNWBJ.mjs +24 -0
- package/dist/chunk-X2RPNWBJ.mjs.map +1 -0
- package/dist/chunk-X3D3MHWF.js +44 -0
- package/dist/chunk-X3D3MHWF.js.map +1 -0
- package/dist/chunk-X4FWMO4H.mjs +18 -0
- package/dist/chunk-X4FWMO4H.mjs.map +1 -0
- package/dist/chunk-Y5PQG4KA.js +1 -0
- package/dist/chunk-Y5PQG4KA.js.map +1 -0
- package/dist/chunk-YDLKS46R.js +30 -0
- package/dist/chunk-YDLKS46R.js.map +1 -0
- package/dist/chunk-YURDB35F.js +124 -0
- package/dist/chunk-YURDB35F.js.map +1 -0
- package/dist/chunk-YYYOE2GO.mjs +32 -0
- package/dist/chunk-YYYOE2GO.mjs.map +1 -0
- package/dist/chunk-ZOQ32RQI.mjs +135 -0
- package/dist/chunk-ZOQ32RQI.mjs.map +1 -0
- package/dist/cli.js +21 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.mjs +21 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/commands/build/build.js +29 -0
- package/dist/commands/build/build.js.map +1 -0
- package/dist/commands/build/build.mjs +29 -0
- package/dist/commands/build/build.mjs.map +1 -0
- package/dist/commands/build/implementation.js +28 -0
- package/dist/commands/build/implementation.js.map +1 -0
- package/dist/commands/build/implementation.mjs +28 -0
- package/dist/commands/build/implementation.mjs.map +1 -0
- package/dist/commands/build/index.js +33 -0
- package/dist/commands/build/index.js.map +1 -0
- package/dist/commands/build/index.mjs +33 -0
- package/dist/commands/build/index.mjs.map +1 -0
- package/dist/commands/eval/eval.js +18 -0
- package/dist/commands/eval/eval.js.map +1 -0
- package/dist/commands/eval/eval.mjs +18 -0
- package/dist/commands/eval/eval.mjs.map +1 -0
- package/dist/commands/eval/implementation.js +9 -0
- package/dist/commands/eval/implementation.js.map +1 -0
- package/dist/commands/eval/implementation.mjs +9 -0
- package/dist/commands/eval/implementation.mjs.map +1 -0
- package/dist/commands/eval/index.js +22 -0
- package/dist/commands/eval/index.js.map +1 -0
- package/dist/commands/eval/index.mjs +22 -0
- package/dist/commands/eval/index.mjs.map +1 -0
- package/dist/commands/index.js +39 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/index.mjs +39 -0
- package/dist/commands/index.mjs.map +1 -0
- package/dist/commands/manifest/implementation.js +17 -0
- package/dist/commands/manifest/implementation.js.map +1 -0
- package/dist/commands/manifest/implementation.mjs +17 -0
- package/dist/commands/manifest/implementation.mjs.map +1 -0
- package/dist/commands/manifest/index.js +22 -0
- package/dist/commands/manifest/index.js.map +1 -0
- package/dist/commands/manifest/index.mjs +22 -0
- package/dist/commands/manifest/index.mjs.map +1 -0
- package/dist/commands/manifest/manifest.js +18 -0
- package/dist/commands/manifest/manifest.js.map +1 -0
- package/dist/commands/manifest/manifest.mjs +18 -0
- package/dist/commands/manifest/manifest.mjs.map +1 -0
- package/dist/commands/serve/index.js +29 -0
- package/dist/commands/serve/index.js.map +1 -0
- package/dist/commands/serve/index.mjs +29 -0
- package/dist/commands/serve/index.mjs.map +1 -0
- package/dist/commands/serve/serve.js +28 -0
- package/dist/commands/serve/serve.js.map +1 -0
- package/dist/commands/serve/serve.mjs +28 -0
- package/dist/commands/serve/serve.mjs.map +1 -0
- package/dist/commands/watch/implementation.js +28 -0
- package/dist/commands/watch/implementation.js.map +1 -0
- package/dist/commands/watch/implementation.mjs +28 -0
- package/dist/commands/watch/implementation.mjs.map +1 -0
- package/dist/commands/watch/index.js +33 -0
- package/dist/commands/watch/index.js.map +1 -0
- package/dist/commands/watch/index.mjs +33 -0
- package/dist/commands/watch/index.mjs.map +1 -0
- package/dist/commands/watch/watch.js +29 -0
- package/dist/commands/watch/watch.js.map +1 -0
- package/dist/commands/watch/watch.mjs +29 -0
- package/dist/commands/watch/watch.mjs.map +1 -0
- package/dist/config.js +36 -0
- package/dist/config.js.map +1 -0
- package/dist/config.mjs +36 -0
- package/dist/config.mjs.map +1 -0
- package/dist/errors.js +12 -0
- package/dist/errors.js.map +1 -0
- package/dist/errors.mjs +12 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +43 -0
- package/dist/index.mjs.map +1 -0
- package/dist/main.js +49 -0
- package/dist/main.js.map +1 -0
- package/dist/main.mjs +49 -0
- package/dist/main.mjs.map +1 -0
- package/dist/structs.js +8 -0
- package/dist/structs.js.map +1 -0
- package/dist/structs.mjs +8 -0
- package/dist/structs.mjs.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types/commands/eval/implementation.d.ts +1 -1
- package/dist/types/config.d.ts +2 -2
- package/dist/types/structs.d.ts +20 -0
- package/dist/types/webpack/loaders/function.d.ts +34 -0
- package/dist/types/webpack/loaders/index.d.ts +3 -0
- package/dist/types/webpack/utils.d.ts +13 -11
- package/dist/types/yargs.d.js +1 -0
- package/dist/types/yargs.d.js.map +1 -0
- package/dist/types/yargs.d.mjs +2 -0
- package/dist/types/yargs.d.mjs.map +1 -0
- package/dist/utils/cli.js +14 -0
- package/dist/utils/cli.js.map +1 -0
- package/dist/utils/cli.mjs +14 -0
- package/dist/utils/cli.mjs.map +1 -0
- package/dist/utils/errors.js +11 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/errors.mjs +11 -0
- package/dist/utils/errors.mjs.map +1 -0
- package/dist/utils/index.js +47 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +47 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/legacy.js +13 -0
- package/dist/utils/legacy.js.map +1 -0
- package/dist/utils/legacy.mjs +13 -0
- package/dist/utils/legacy.mjs.map +1 -0
- package/dist/utils/logging.js +12 -0
- package/dist/utils/logging.js.map +1 -0
- package/dist/utils/logging.mjs +12 -0
- package/dist/utils/logging.mjs.map +1 -0
- package/dist/utils/path.js +8 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/path.mjs +8 -0
- package/dist/utils/path.mjs.map +1 -0
- package/dist/utils/steps.js +11 -0
- package/dist/utils/steps.js.map +1 -0
- package/dist/utils/steps.mjs +11 -0
- package/dist/utils/steps.mjs.map +1 -0
- package/dist/webpack/compiler.js +25 -0
- package/dist/webpack/compiler.js.map +1 -0
- package/dist/webpack/compiler.mjs +25 -0
- package/dist/webpack/compiler.mjs.map +1 -0
- package/dist/webpack/config.js +24 -0
- package/dist/webpack/config.js.map +1 -0
- package/dist/webpack/config.mjs +24 -0
- package/dist/webpack/config.mjs.map +1 -0
- package/dist/webpack/index.js +44 -0
- package/dist/webpack/index.js.map +1 -0
- package/dist/webpack/index.mjs +44 -0
- package/dist/webpack/index.mjs.map +1 -0
- package/dist/webpack/loaders/browserify.js +19 -0
- package/dist/webpack/loaders/browserify.js.map +1 -0
- package/dist/webpack/loaders/browserify.mjs +19 -0
- package/dist/webpack/loaders/browserify.mjs.map +1 -0
- package/dist/webpack/loaders/function.js +10 -0
- package/dist/webpack/loaders/function.js.map +1 -0
- package/dist/webpack/loaders/function.mjs +10 -0
- package/dist/webpack/loaders/function.mjs.map +1 -0
- package/dist/webpack/loaders/index.js +25 -0
- package/dist/webpack/loaders/index.js.map +1 -0
- package/dist/webpack/loaders/index.mjs +25 -0
- package/dist/webpack/loaders/index.mjs.map +1 -0
- package/dist/webpack/loaders/wasm.js +16 -0
- package/dist/webpack/loaders/wasm.js.map +1 -0
- package/dist/webpack/loaders/wasm.mjs +16 -0
- package/dist/webpack/loaders/wasm.mjs.map +1 -0
- package/dist/webpack/plugins.js +29 -0
- package/dist/webpack/plugins.js.map +1 -0
- package/dist/webpack/plugins.mjs +29 -0
- package/dist/webpack/plugins.mjs.map +1 -0
- package/dist/webpack/server.js +10 -0
- package/dist/webpack/server.js.map +1 -0
- package/dist/webpack/server.mjs +10 -0
- package/dist/webpack/server.mjs.map +1 -0
- package/dist/webpack/utils.js +37 -0
- package/dist/webpack/utils.js.map +1 -0
- package/dist/webpack/utils.mjs +37 -0
- package/dist/webpack/utils.mjs.map +1 -0
- package/package.json +21 -21
- package/.browserslistrc +0 -3
- package/dist/cjs/builders.js +0 -148
- package/dist/cjs/builders.js.map +0 -1
- package/dist/cjs/cli.js +0 -68
- package/dist/cjs/cli.js.map +0 -1
- package/dist/cjs/commands/build/build.js +0 -54
- package/dist/cjs/commands/build/build.js.map +0 -1
- package/dist/cjs/commands/build/implementation.js +0 -31
- package/dist/cjs/commands/build/implementation.js.map +0 -1
- package/dist/cjs/commands/build/index.js +0 -45
- package/dist/cjs/commands/build/index.js.map +0 -1
- package/dist/cjs/commands/eval/eval.js +0 -57
- package/dist/cjs/commands/eval/eval.js.map +0 -1
- package/dist/cjs/commands/eval/implementation.js +0 -27
- package/dist/cjs/commands/eval/implementation.js.map +0 -1
- package/dist/cjs/commands/eval/index.js +0 -50
- package/dist/cjs/commands/eval/index.js.map +0 -1
- package/dist/cjs/commands/index.js +0 -30
- package/dist/cjs/commands/index.js.map +0 -1
- package/dist/cjs/commands/manifest/implementation.js +0 -34
- package/dist/cjs/commands/manifest/implementation.js.map +0 -1
- package/dist/cjs/commands/manifest/index.js +0 -50
- package/dist/cjs/commands/manifest/index.js.map +0 -1
- package/dist/cjs/commands/manifest/manifest.js +0 -55
- package/dist/cjs/commands/manifest/manifest.js.map +0 -1
- package/dist/cjs/commands/serve/index.js +0 -33
- package/dist/cjs/commands/serve/index.js.map +0 -1
- package/dist/cjs/commands/serve/serve.js +0 -21
- package/dist/cjs/commands/serve/serve.js.map +0 -1
- package/dist/cjs/commands/watch/implementation.js +0 -35
- package/dist/cjs/commands/watch/implementation.js.map +0 -1
- package/dist/cjs/commands/watch/index.js +0 -47
- package/dist/cjs/commands/watch/index.js.map +0 -1
- package/dist/cjs/commands/watch/watch.js +0 -51
- package/dist/cjs/commands/watch/watch.js.map +0 -1
- package/dist/cjs/config.js +0 -320
- package/dist/cjs/config.js.map +0 -1
- package/dist/cjs/errors.js +0 -37
- package/dist/cjs/errors.js.map +0 -1
- package/dist/cjs/index.js +0 -77
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/main.js +0 -19
- package/dist/cjs/main.js.map +0 -1
- package/dist/cjs/utils/cli.js +0 -61
- package/dist/cjs/utils/cli.js.map +0 -1
- package/dist/cjs/utils/errors.js +0 -42
- package/dist/cjs/utils/errors.js.map +0 -1
- package/dist/cjs/utils/index.js +0 -25
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/legacy.js +0 -48
- package/dist/cjs/utils/legacy.js.map +0 -1
- package/dist/cjs/utils/logging.js +0 -46
- package/dist/cjs/utils/logging.js.map +0 -1
- package/dist/cjs/utils/path.js +0 -16
- package/dist/cjs/utils/path.js.map +0 -1
- package/dist/cjs/utils/steps.js +0 -52
- package/dist/cjs/utils/steps.js.map +0 -1
- package/dist/cjs/webpack/compiler.js +0 -19
- package/dist/cjs/webpack/compiler.js.map +0 -1
- package/dist/cjs/webpack/config.js.map +0 -1
- package/dist/cjs/webpack/index.js +0 -23
- package/dist/cjs/webpack/index.js.map +0 -1
- package/dist/cjs/webpack/loaders/browserify.js +0 -97
- package/dist/cjs/webpack/loaders/browserify.js.map +0 -1
- package/dist/cjs/webpack/loaders/wasm.js +0 -92
- package/dist/cjs/webpack/loaders/wasm.js.map +0 -1
- package/dist/cjs/webpack/plugins.js +0 -341
- package/dist/cjs/webpack/plugins.js.map +0 -1
- package/dist/cjs/webpack/server.js +0 -139
- package/dist/cjs/webpack/server.js.map +0 -1
- package/dist/cjs/webpack/utils.js +0 -240
- package/dist/cjs/webpack/utils.js.map +0 -1
- package/dist/esm/builders.js +0 -130
- package/dist/esm/builders.js.map +0 -1
- package/dist/esm/cli.js +0 -56
- package/dist/esm/cli.js.map +0 -1
- package/dist/esm/commands/build/build.js +0 -51
- package/dist/esm/commands/build/build.js.map +0 -1
- package/dist/esm/commands/build/implementation.js +0 -27
- package/dist/esm/commands/build/implementation.js.map +0 -1
- package/dist/esm/commands/build/index.js +0 -17
- package/dist/esm/commands/build/index.js.map +0 -1
- package/dist/esm/commands/eval/eval.js +0 -54
- package/dist/esm/commands/eval/eval.js.map +0 -1
- package/dist/esm/commands/eval/implementation.js +0 -24
- package/dist/esm/commands/eval/implementation.js.map +0 -1
- package/dist/esm/commands/eval/index.js +0 -22
- package/dist/esm/commands/eval/index.js.map +0 -1
- package/dist/esm/commands/index.js +0 -15
- package/dist/esm/commands/index.js.map +0 -1
- package/dist/esm/commands/manifest/implementation.js +0 -33
- package/dist/esm/commands/manifest/implementation.js.map +0 -1
- package/dist/esm/commands/manifest/index.js +0 -22
- package/dist/esm/commands/manifest/index.js.map +0 -1
- package/dist/esm/commands/manifest/manifest.js +0 -52
- package/dist/esm/commands/manifest/manifest.js.map +0 -1
- package/dist/esm/commands/serve/index.js +0 -18
- package/dist/esm/commands/serve/index.js.map +0 -1
- package/dist/esm/commands/serve/serve.js +0 -17
- package/dist/esm/commands/serve/serve.js.map +0 -1
- package/dist/esm/commands/watch/implementation.js +0 -34
- package/dist/esm/commands/watch/implementation.js.map +0 -1
- package/dist/esm/commands/watch/index.js +0 -19
- package/dist/esm/commands/watch/index.js.map +0 -1
- package/dist/esm/commands/watch/watch.js +0 -50
- package/dist/esm/commands/watch/watch.js.map +0 -1
- package/dist/esm/config.js +0 -324
- package/dist/esm/config.js.map +0 -1
- package/dist/esm/errors.js +0 -30
- package/dist/esm/errors.js.map +0 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/main.js +0 -10
- package/dist/esm/main.js.map +0 -1
- package/dist/esm/utils/cli.js +0 -43
- package/dist/esm/utils/cli.js.map +0 -1
- package/dist/esm/utils/errors.js +0 -43
- package/dist/esm/utils/errors.js.map +0 -1
- package/dist/esm/utils/index.js +0 -8
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/legacy.js +0 -47
- package/dist/esm/utils/legacy.js.map +0 -1
- package/dist/esm/utils/logging.js +0 -40
- package/dist/esm/utils/logging.js.map +0 -1
- package/dist/esm/utils/path.js +0 -13
- package/dist/esm/utils/path.js.map +0 -1
- package/dist/esm/utils/steps.js +0 -43
- package/dist/esm/utils/steps.js.map +0 -1
- package/dist/esm/webpack/compiler.js +0 -15
- package/dist/esm/webpack/compiler.js.map +0 -1
- package/dist/esm/webpack/config.js.map +0 -1
- package/dist/esm/webpack/index.js +0 -6
- package/dist/esm/webpack/index.js.map +0 -1
- package/dist/esm/webpack/loaders/browserify.js +0 -82
- package/dist/esm/webpack/loaders/browserify.js.map +0 -1
- package/dist/esm/webpack/loaders/wasm.js +0 -87
- package/dist/esm/webpack/loaders/wasm.js.map +0 -1
- package/dist/esm/webpack/plugins.js +0 -344
- package/dist/esm/webpack/plugins.js.map +0 -1
- package/dist/esm/webpack/server.js +0 -133
- package/dist/esm/webpack/server.js.map +0 -1
- package/dist/esm/webpack/utils.js +0 -271
- package/dist/esm/webpack/utils.js.map +0 -1
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "evaluateHandler", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return evaluateHandler;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _snapsutils = require("@metamask/snaps-utils");
|
|
12
|
-
const _path = require("path");
|
|
13
|
-
const _errors = require("../../errors");
|
|
14
|
-
const _utils = require("../../utils");
|
|
15
|
-
const _implementation = require("./implementation");
|
|
16
|
-
const steps = [
|
|
17
|
-
{
|
|
18
|
-
name: 'Checking the input file.',
|
|
19
|
-
task: async ({ input })=>{
|
|
20
|
-
if (!await (0, _snapsutils.isFile)(input)) {
|
|
21
|
-
const relativePath = (0, _utils.getRelativePath)(input);
|
|
22
|
-
throw new _errors.CommandError(`Input file not found: "${relativePath}". Make sure that the "input" field in your snap config or the specified input file is correct.`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'Evaluating the snap bundle.',
|
|
28
|
-
task: async ({ input, spinner })=>{
|
|
29
|
-
await (0, _implementation.evaluate)(input);
|
|
30
|
-
spinner.succeed('Snap bundle evaluated successfully.');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
];
|
|
34
|
-
/**
|
|
35
|
-
* Returns the path to the bundle, based on the config and options.
|
|
36
|
-
*
|
|
37
|
-
* - If `options.input` is specified, it is used as the bundle path.
|
|
38
|
-
* - Otherwise, the bundle path is resolved from the config's output path and
|
|
39
|
-
* filename.
|
|
40
|
-
*
|
|
41
|
-
* @param config - The processed config object.
|
|
42
|
-
* @param options - The eval options.
|
|
43
|
-
* @returns The path to the bundle.
|
|
44
|
-
*/ function getBundlePath(config, options) {
|
|
45
|
-
if (options.input) {
|
|
46
|
-
return (0, _path.resolve)(process.cwd(), options.input);
|
|
47
|
-
}
|
|
48
|
-
return (0, _path.resolve)(config.output.path, config.output.filename);
|
|
49
|
-
}
|
|
50
|
-
async function evaluateHandler(config, options = {}) {
|
|
51
|
-
const input = getBundlePath(config, options);
|
|
52
|
-
await (0, _utils.executeSteps)(steps, {
|
|
53
|
-
input
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
//# sourceMappingURL=eval.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/eval/eval.ts"],"sourcesContent":["import { isFile } from '@metamask/snaps-utils';\nimport { resolve } from 'path';\n\nimport type { ProcessedConfig } from '../../config';\nimport { CommandError } from '../../errors';\nimport type { Steps } from '../../utils';\nimport { executeSteps, getRelativePath } from '../../utils';\nimport { evaluate } from './implementation';\n\nexport type EvalOptions = {\n input?: string;\n};\n\nexport type EvalContext = Required<EvalOptions>;\n\nconst steps: Steps<EvalContext> = [\n {\n name: 'Checking the input file.',\n task: async ({ input }) => {\n if (!(await isFile(input))) {\n const relativePath = getRelativePath(input);\n throw new CommandError(\n `Input file not found: \"${relativePath}\". Make sure that the \"input\" field in your snap config or the specified input file is correct.`,\n );\n }\n },\n },\n {\n name: 'Evaluating the snap bundle.',\n task: async ({ input, spinner }) => {\n await evaluate(input);\n spinner.succeed('Snap bundle evaluated successfully.');\n },\n },\n];\n\n/**\n * Returns the path to the bundle, based on the config and options.\n *\n * - If `options.input` is specified, it is used as the bundle path.\n * - Otherwise, the bundle path is resolved from the config's output path and\n * filename.\n *\n * @param config - The processed config object.\n * @param options - The eval options.\n * @returns The path to the bundle.\n */\nfunction getBundlePath(config: ProcessedConfig, options: EvalOptions): string {\n if (options.input) {\n return resolve(process.cwd(), options.input);\n }\n\n return resolve(config.output.path, config.output.filename);\n}\n\n/**\n * Runs the snap in a worker, to ensure SES compatibility.\n *\n * @param config - The processed config object.\n * @param options - The eval options.\n * @returns A promise that resolves once the eval has finished.\n * @throws If the eval failed.\n */\nexport async function evaluateHandler(\n config: ProcessedConfig,\n options: EvalOptions = {},\n): Promise<void> {\n const input = getBundlePath(config, options);\n await executeSteps(steps, { input });\n}\n"],"names":["evaluateHandler","steps","name","task","input","isFile","relativePath","getRelativePath","CommandError","spinner","evaluate","succeed","getBundlePath","config","options","resolve","process","cwd","output","path","filename","executeSteps"],"mappings":";;;;+BA+DsBA;;;eAAAA;;;4BA/DC;sBACC;wBAGK;uBAEiB;gCACrB;AAQzB,MAAMC,QAA4B;IAChC;QACEC,MAAM;QACNC,MAAM,OAAO,EAAEC,KAAK,EAAE;YACpB,IAAI,CAAE,MAAMC,IAAAA,kBAAM,EAACD,QAAS;gBAC1B,MAAME,eAAeC,IAAAA,sBAAe,EAACH;gBACrC,MAAM,IAAII,oBAAY,CACpB,CAAC,uBAAuB,EAAEF,aAAa,+FAA+F,CAAC;YAE3I;QACF;IACF;IACA;QACEJ,MAAM;QACNC,MAAM,OAAO,EAAEC,KAAK,EAAEK,OAAO,EAAE;YAC7B,MAAMC,IAAAA,wBAAQ,EAACN;YACfK,QAAQE,OAAO,CAAC;QAClB;IACF;CACD;AAED;;;;;;;;;;CAUC,GACD,SAASC,cAAcC,MAAuB,EAAEC,OAAoB;IAClE,IAAIA,QAAQV,KAAK,EAAE;QACjB,OAAOW,IAAAA,aAAO,EAACC,QAAQC,GAAG,IAAIH,QAAQV,KAAK;IAC7C;IAEA,OAAOW,IAAAA,aAAO,EAACF,OAAOK,MAAM,CAACC,IAAI,EAAEN,OAAOK,MAAM,CAACE,QAAQ;AAC3D;AAUO,eAAepB,gBACpBa,MAAuB,EACvBC,UAAuB,CAAC,CAAC;IAEzB,MAAMV,QAAQQ,cAAcC,QAAQC;IACpC,MAAMO,IAAAA,mBAAY,EAACpB,OAAO;QAAEG;IAAM;AACpC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "evaluate", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return evaluate;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _snapsutils = require("@metamask/snaps-utils");
|
|
12
|
-
const _chalk = require("chalk");
|
|
13
|
-
const _errors = require("../../errors");
|
|
14
|
-
async function evaluate(path) {
|
|
15
|
-
try {
|
|
16
|
-
return await (0, _snapsutils.evalBundle)(path);
|
|
17
|
-
} catch (evalError) {
|
|
18
|
-
if (evalError instanceof _snapsutils.SnapEvalError) {
|
|
19
|
-
throw new _errors.CommandError(`Failed to evaluate snap bundle in SES. This is likely due to an incompatibility with the SES environment in your snap.\nReceived the following error from the SES environment:\n\n${(0, _snapsutils.indent)((0, _chalk.red)(evalError.output.stderr), 2)}`);
|
|
20
|
-
}
|
|
21
|
-
// If the error is not a `SnapEvalError`, we don't know what it is, so
|
|
22
|
-
// we just throw it.
|
|
23
|
-
throw evalError;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=implementation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/eval/implementation.ts"],"sourcesContent":["import { evalBundle, SnapEvalError, indent } from '@metamask/snaps-utils';\nimport { red } from 'chalk';\n\nimport { CommandError } from '../../errors';\n\n/**\n * Evaluate the given bundle in the SES environment. This is a wrapper around\n * {@link evalBundle} that throws a {@link CommandError} if the bundle cannot be\n * evaluated.\n *\n * @param path - The path to the bundle.\n * @throws If the bundle cannot be evaluated.\n */\nexport async function evaluate(path: string) {\n try {\n return await evalBundle(path);\n } catch (evalError) {\n if (evalError instanceof SnapEvalError) {\n throw new CommandError(\n `Failed to evaluate snap bundle in SES. This is likely due to an incompatibility with the SES environment in your snap.\\nReceived the following error from the SES environment:\\n\\n${indent(\n red(evalError.output.stderr),\n 2,\n )}`,\n );\n }\n\n // If the error is not a `SnapEvalError`, we don't know what it is, so\n // we just throw it.\n throw evalError;\n }\n}\n"],"names":["evaluate","path","evalBundle","evalError","SnapEvalError","CommandError","indent","red","output","stderr"],"mappings":";;;;+BAasBA;;;eAAAA;;;4BAb4B;uBAC9B;wBAES;AAUtB,eAAeA,SAASC,IAAY;IACzC,IAAI;QACF,OAAO,MAAMC,IAAAA,sBAAU,EAACD;IAC1B,EAAE,OAAOE,WAAW;QAClB,IAAIA,qBAAqBC,yBAAa,EAAE;YACtC,MAAM,IAAIC,oBAAY,CACpB,CAAC,kLAAkL,EAAEC,IAAAA,kBAAM,EACzLC,IAAAA,UAAG,EAACJ,UAAUK,MAAM,CAACC,MAAM,GAC3B,GACA,CAAC;QAEP;QAEA,sEAAsE;QACtE,oBAAoB;QACpB,MAAMN;IACR;AACF"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _builders = /*#__PURE__*/ _interop_require_default(require("../../builders"));
|
|
12
|
-
const _eval = require("./eval");
|
|
13
|
-
_export_star(require("./implementation"), exports);
|
|
14
|
-
function _export_star(from, to) {
|
|
15
|
-
Object.keys(from).forEach(function(k) {
|
|
16
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
17
|
-
Object.defineProperty(to, k, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return from[k];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return from;
|
|
26
|
-
}
|
|
27
|
-
function _interop_require_default(obj) {
|
|
28
|
-
return obj && obj.__esModule ? obj : {
|
|
29
|
-
default: obj
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const command = {
|
|
33
|
-
command: [
|
|
34
|
-
'eval',
|
|
35
|
-
'e'
|
|
36
|
-
],
|
|
37
|
-
desc: 'Attempt to evaluate snap bundle in SES',
|
|
38
|
-
builder: (yarg)=>{
|
|
39
|
-
// Browserify options. These are merged into the config object.
|
|
40
|
-
yarg.option('bundle', _builders.default.bundle);
|
|
41
|
-
// Webpack options.
|
|
42
|
-
yarg.option('input', _builders.default.input);
|
|
43
|
-
},
|
|
44
|
-
handler: async (argv)=>(0, _eval.evaluateHandler)(argv.context.config, {
|
|
45
|
-
input: argv.input
|
|
46
|
-
})
|
|
47
|
-
};
|
|
48
|
-
const _default = command;
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/eval/index.ts"],"sourcesContent":["import type yargs from 'yargs';\n\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\nimport { evaluateHandler } from './eval';\n\nconst command = {\n command: ['eval', 'e'],\n desc: 'Attempt to evaluate snap bundle in SES',\n builder: (yarg: yargs.Argv) => {\n // Browserify options. These are merged into the config object.\n yarg.option('bundle', builders.bundle);\n\n // Webpack options.\n yarg.option('input', builders.input);\n },\n handler: async (argv: YargsArgs) =>\n evaluateHandler(argv.context.config, { input: argv.input }),\n};\n\nexport * from './implementation';\nexport default command;\n"],"names":["command","desc","builder","yarg","option","builders","bundle","input","handler","argv","evaluateHandler","context","config"],"mappings":";;;;+BAqBA;;;eAAA;;;iEAnBqB;sBAEW;qBAgBlB;;;;;;;;;;;;;;;;;;;AAdd,MAAMA,UAAU;IACdA,SAAS;QAAC;QAAQ;KAAI;IACtBC,MAAM;IACNC,SAAS,CAACC;QACR,+DAA+D;QAC/DA,KAAKC,MAAM,CAAC,UAAUC,iBAAQ,CAACC,MAAM;QAErC,mBAAmB;QACnBH,KAAKC,MAAM,CAAC,SAASC,iBAAQ,CAACE,KAAK;IACrC;IACAC,SAAS,OAAOC,OACdC,IAAAA,qBAAe,EAACD,KAAKE,OAAO,CAACC,MAAM,EAAE;YAAEL,OAAOE,KAAKF,KAAK;QAAC;AAC7D;MAGA,WAAeP"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _build = /*#__PURE__*/ _interop_require_default(require("./build"));
|
|
12
|
-
const _eval = /*#__PURE__*/ _interop_require_default(require("./eval"));
|
|
13
|
-
const _manifest = /*#__PURE__*/ _interop_require_default(require("./manifest"));
|
|
14
|
-
const _serve = /*#__PURE__*/ _interop_require_default(require("./serve"));
|
|
15
|
-
const _watch = /*#__PURE__*/ _interop_require_default(require("./watch"));
|
|
16
|
-
function _interop_require_default(obj) {
|
|
17
|
-
return obj && obj.__esModule ? obj : {
|
|
18
|
-
default: obj
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const commands = [
|
|
22
|
-
_build.default,
|
|
23
|
-
_eval.default,
|
|
24
|
-
_manifest.default,
|
|
25
|
-
_serve.default,
|
|
26
|
-
_watch.default
|
|
27
|
-
];
|
|
28
|
-
const _default = commands;
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/index.ts"],"sourcesContent":["import buildCommand from './build';\nimport evaluateCommand from './eval';\nimport manifestCommand from './manifest';\nimport serveCommand from './serve';\nimport watchCommand from './watch';\n\nconst commands = [\n buildCommand,\n evaluateCommand,\n manifestCommand,\n serveCommand,\n watchCommand,\n];\n\nexport default commands;\n"],"names":["commands","buildCommand","evaluateCommand","manifestCommand","serveCommand","watchCommand"],"mappings":";;;;+BAcA;;;eAAA;;;8DAdyB;6DACG;iEACA;8DACH;8DACA;;;;;;AAEzB,MAAMA,WAAW;IACfC,cAAY;IACZC,aAAe;IACfC,iBAAe;IACfC,cAAY;IACZC,cAAY;CACb;MAED,WAAeL"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "manifest", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return manifest;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _snapsutils = require("@metamask/snaps-utils");
|
|
12
|
-
const _chalk = require("chalk");
|
|
13
|
-
const _path = require("path");
|
|
14
|
-
const _utils = require("../../utils");
|
|
15
|
-
async function manifest(path, write, spinner) {
|
|
16
|
-
const { warnings, errors, updated } = await (0, _snapsutils.checkManifest)((0, _path.dirname)(path), write);
|
|
17
|
-
if (write && updated) {
|
|
18
|
-
(0, _utils.info)('The snap manifest file has been updated.', spinner);
|
|
19
|
-
}
|
|
20
|
-
if (!write && errors.length > 0) {
|
|
21
|
-
const formattedErrors = errors.map((manifestError)=>(0, _snapsutils.indent)((0, _chalk.red)(`• ${manifestError}`))).join('\n');
|
|
22
|
-
(0, _utils.error)(`The snap manifest file is invalid.\n\n${formattedErrors}\n\nRun the command with the \`--fix\` flag to attempt to fix the manifest.`, spinner);
|
|
23
|
-
spinner?.stop();
|
|
24
|
-
process.exitCode = 1;
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
if (warnings.length > 0) {
|
|
28
|
-
const formattedWarnings = warnings.map((manifestWarning)=>(0, _snapsutils.indent)((0, _chalk.yellow)(`• ${manifestWarning}`)));
|
|
29
|
-
(0, _utils.warn)(`The snap manifest file has warnings.\n\n${formattedWarnings.join('\n')}`, spinner);
|
|
30
|
-
}
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=implementation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/manifest/implementation.ts"],"sourcesContent":["import { checkManifest, indent } from '@metamask/snaps-utils';\nimport { red, yellow } from 'chalk';\nimport type { Ora } from 'ora';\nimport { dirname } from 'path';\n\nimport { error, info, warn } from '../../utils';\n\n/**\n * Check the snap manifest file at the given path. If `write` is `true`, the\n * manifest will be written to disk if it is invalid. If `write` is `false`,\n * the manifest will not be written to disk, and the function will log any\n * errors and warnings to the console.\n *\n * @param path - The path to the manifest file.\n * @param write - Whether to write the manifest to disk if it is invalid.\n * @param spinner - An optional spinner to use for logging.\n */\nexport async function manifest(\n path: string,\n write: boolean,\n spinner?: Ora,\n): Promise<boolean> {\n const { warnings, errors, updated } = await checkManifest(\n dirname(path),\n write,\n );\n\n if (write && updated) {\n info('The snap manifest file has been updated.', spinner);\n }\n\n if (!write && errors.length > 0) {\n const formattedErrors = errors\n .map((manifestError) => indent(red(`• ${manifestError}`)))\n .join('\\n');\n\n error(\n `The snap manifest file is invalid.\\n\\n${formattedErrors}\\n\\nRun the command with the \\`--fix\\` flag to attempt to fix the manifest.`,\n spinner,\n );\n\n spinner?.stop();\n process.exitCode = 1;\n return false;\n }\n\n if (warnings.length > 0) {\n const formattedWarnings = warnings.map((manifestWarning) =>\n indent(yellow(`• ${manifestWarning}`)),\n );\n\n warn(\n `The snap manifest file has warnings.\\n\\n${formattedWarnings.join('\\n')}`,\n spinner,\n );\n }\n\n return true;\n}\n"],"names":["manifest","path","write","spinner","warnings","errors","updated","checkManifest","dirname","info","length","formattedErrors","map","manifestError","indent","red","join","error","stop","process","exitCode","formattedWarnings","manifestWarning","yellow","warn"],"mappings":";;;;+BAiBsBA;;;eAAAA;;;4BAjBgB;uBACV;sBAEJ;uBAEU;AAY3B,eAAeA,SACpBC,IAAY,EACZC,KAAc,EACdC,OAAa;IAEb,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAG,MAAMC,IAAAA,yBAAa,EACvDC,IAAAA,aAAO,EAACP,OACRC;IAGF,IAAIA,SAASI,SAAS;QACpBG,IAAAA,WAAI,EAAC,4CAA4CN;IACnD;IAEA,IAAI,CAACD,SAASG,OAAOK,MAAM,GAAG,GAAG;QAC/B,MAAMC,kBAAkBN,OACrBO,GAAG,CAAC,CAACC,gBAAkBC,IAAAA,kBAAM,EAACC,IAAAA,UAAG,EAAC,CAAC,EAAE,EAAEF,cAAc,CAAC,IACtDG,IAAI,CAAC;QAERC,IAAAA,YAAK,EACH,CAAC,sCAAsC,EAAEN,gBAAgB,2EAA2E,CAAC,EACrIR;QAGFA,SAASe;QACTC,QAAQC,QAAQ,GAAG;QACnB,OAAO;IACT;IAEA,IAAIhB,SAASM,MAAM,GAAG,GAAG;QACvB,MAAMW,oBAAoBjB,SAASQ,GAAG,CAAC,CAACU,kBACtCR,IAAAA,kBAAM,EAACS,IAAAA,aAAM,EAAC,CAAC,EAAE,EAAED,gBAAgB,CAAC;QAGtCE,IAAAA,WAAI,EACF,CAAC,wCAAwC,EAAEH,kBAAkBL,IAAI,CAAC,MAAM,CAAC,EACzEb;IAEJ;IAEA,OAAO;AACT"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _builders = /*#__PURE__*/ _interop_require_default(require("../../builders"));
|
|
12
|
-
const _manifest = require("./manifest");
|
|
13
|
-
_export_star(require("./implementation"), exports);
|
|
14
|
-
function _export_star(from, to) {
|
|
15
|
-
Object.keys(from).forEach(function(k) {
|
|
16
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
17
|
-
Object.defineProperty(to, k, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return from[k];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return from;
|
|
26
|
-
}
|
|
27
|
-
function _interop_require_default(obj) {
|
|
28
|
-
return obj && obj.__esModule ? obj : {
|
|
29
|
-
default: obj
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const command = {
|
|
33
|
-
command: [
|
|
34
|
-
'manifest',
|
|
35
|
-
'm'
|
|
36
|
-
],
|
|
37
|
-
desc: 'Validate the snap.manifest.json file',
|
|
38
|
-
builder: (yarg)=>{
|
|
39
|
-
// Browserify options. These are merged into the config object.
|
|
40
|
-
yarg.option('writeManifest', _builders.default.writeManifest);
|
|
41
|
-
// Webpack options.
|
|
42
|
-
yarg.option('fix', _builders.default.fix);
|
|
43
|
-
},
|
|
44
|
-
handler: async (argv)=>(0, _manifest.manifestHandler)(argv.context.config, {
|
|
45
|
-
fix: argv.fix
|
|
46
|
-
})
|
|
47
|
-
};
|
|
48
|
-
const _default = command;
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/manifest/index.ts"],"sourcesContent":["import type yargs from 'yargs';\n\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\nimport { manifestHandler } from './manifest';\n\nconst command = {\n command: ['manifest', 'm'],\n desc: 'Validate the snap.manifest.json file',\n builder: (yarg: yargs.Argv) => {\n // Browserify options. These are merged into the config object.\n yarg.option('writeManifest', builders.writeManifest);\n\n // Webpack options.\n yarg.option('fix', builders.fix);\n },\n handler: async (argv: YargsArgs) =>\n manifestHandler(argv.context.config, { fix: argv.fix }),\n};\n\nexport * from './implementation';\nexport default command;\n"],"names":["command","desc","builder","yarg","option","builders","writeManifest","fix","handler","argv","manifestHandler","context","config"],"mappings":";;;;+BAqBA;;;eAAA;;;iEAnBqB;0BAEW;qBAgBlB;;;;;;;;;;;;;;;;;;;AAdd,MAAMA,UAAU;IACdA,SAAS;QAAC;QAAY;KAAI;IAC1BC,MAAM;IACNC,SAAS,CAACC;QACR,+DAA+D;QAC/DA,KAAKC,MAAM,CAAC,iBAAiBC,iBAAQ,CAACC,aAAa;QAEnD,mBAAmB;QACnBH,KAAKC,MAAM,CAAC,OAAOC,iBAAQ,CAACE,GAAG;IACjC;IACAC,SAAS,OAAOC,OACdC,IAAAA,yBAAe,EAACD,KAAKE,OAAO,CAACC,MAAM,EAAE;YAAEL,KAAKE,KAAKF,GAAG;QAAC;AACzD;MAGA,WAAeP"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "manifestHandler", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return manifestHandler;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _snapsutils = require("@metamask/snaps-utils");
|
|
12
|
-
const _errors = require("../../errors");
|
|
13
|
-
const _utils = require("../../utils");
|
|
14
|
-
const _implementation = require("./implementation");
|
|
15
|
-
const steps = [
|
|
16
|
-
{
|
|
17
|
-
name: 'Checking the input file.',
|
|
18
|
-
task: async ({ input })=>{
|
|
19
|
-
if (!await (0, _snapsutils.isFile)(input)) {
|
|
20
|
-
throw new _errors.CommandError(`Manifest file not found: "${input}". Make sure that the \`snap.manifest.json\` file exists.`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'Validating the snap manifest.',
|
|
26
|
-
task: async ({ input, config, options, spinner })=>{
|
|
27
|
-
const write = getWriteManifest(config, options);
|
|
28
|
-
const valid = await (0, _implementation.manifest)(input, write, spinner);
|
|
29
|
-
if (valid) {
|
|
30
|
-
spinner.succeed('The snap manifest file is valid.');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
];
|
|
35
|
-
/**
|
|
36
|
-
* Get whether to write the manifest to disk.
|
|
37
|
-
*
|
|
38
|
-
* @param config - The config object.
|
|
39
|
-
* @param options - The options object.
|
|
40
|
-
* @returns Whether to write the manifest to disk.
|
|
41
|
-
*/ function getWriteManifest(config, options) {
|
|
42
|
-
if (typeof options.fix === 'boolean') {
|
|
43
|
-
return options.fix;
|
|
44
|
-
}
|
|
45
|
-
return config.legacy?.writeManifest ?? false;
|
|
46
|
-
}
|
|
47
|
-
async function manifestHandler(config, options) {
|
|
48
|
-
await (0, _utils.executeSteps)(steps, {
|
|
49
|
-
input: config.manifest.path,
|
|
50
|
-
config,
|
|
51
|
-
options
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/manifest/manifest.ts"],"sourcesContent":["import { isFile } from '@metamask/snaps-utils';\n\nimport type { ProcessedConfig } from '../../config';\nimport { CommandError } from '../../errors';\nimport type { Steps } from '../../utils';\nimport { executeSteps } from '../../utils';\nimport { manifest } from './implementation';\n\ntype ManifestOptions = {\n fix?: boolean;\n};\n\ntype ManifestContext = {\n input: string;\n config: ProcessedConfig;\n options: ManifestOptions;\n};\n\nconst steps: Steps<ManifestContext> = [\n {\n name: 'Checking the input file.',\n task: async ({ input }) => {\n if (!(await isFile(input))) {\n throw new CommandError(\n `Manifest file not found: \"${input}\". Make sure that the \\`snap.manifest.json\\` file exists.`,\n );\n }\n },\n },\n {\n name: 'Validating the snap manifest.',\n task: async ({ input, config, options, spinner }) => {\n const write = getWriteManifest(config, options);\n const valid = await manifest(input, write, spinner);\n\n if (valid) {\n spinner.succeed('The snap manifest file is valid.');\n }\n },\n },\n];\n\n/**\n * Get whether to write the manifest to disk.\n *\n * @param config - The config object.\n * @param options - The options object.\n * @returns Whether to write the manifest to disk.\n */\nfunction getWriteManifest(config: ProcessedConfig, options: ManifestOptions) {\n if (typeof options.fix === 'boolean') {\n return options.fix;\n }\n\n return config.legacy?.writeManifest ?? false;\n}\n\n/**\n * Validates a snap.manifest.json file. Attempts to fix the manifest and write\n * the fixed version to disk if `writeManifest` is true. Throws if validation\n * fails.\n *\n * @param config - The config object.\n * @param options - The options object.\n */\nexport async function manifestHandler(\n config: ProcessedConfig,\n options: ManifestOptions,\n) {\n await executeSteps(steps, {\n input: config.manifest.path,\n config,\n options,\n });\n}\n"],"names":["manifestHandler","steps","name","task","input","isFile","CommandError","config","options","spinner","write","getWriteManifest","valid","manifest","succeed","fix","legacy","writeManifest","executeSteps","path"],"mappings":";;;;+BAiEsBA;;;eAAAA;;;4BAjEC;wBAGM;uBAEA;gCACJ;AAYzB,MAAMC,QAAgC;IACpC;QACEC,MAAM;QACNC,MAAM,OAAO,EAAEC,KAAK,EAAE;YACpB,IAAI,CAAE,MAAMC,IAAAA,kBAAM,EAACD,QAAS;gBAC1B,MAAM,IAAIE,oBAAY,CACpB,CAAC,0BAA0B,EAAEF,MAAM,yDAAyD,CAAC;YAEjG;QACF;IACF;IACA;QACEF,MAAM;QACNC,MAAM,OAAO,EAAEC,KAAK,EAAEG,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAE;YAC9C,MAAMC,QAAQC,iBAAiBJ,QAAQC;YACvC,MAAMI,QAAQ,MAAMC,IAAAA,wBAAQ,EAACT,OAAOM,OAAOD;YAE3C,IAAIG,OAAO;gBACTH,QAAQK,OAAO,CAAC;YAClB;QACF;IACF;CACD;AAED;;;;;;CAMC,GACD,SAASH,iBAAiBJ,MAAuB,EAAEC,OAAwB;IACzE,IAAI,OAAOA,QAAQO,GAAG,KAAK,WAAW;QACpC,OAAOP,QAAQO,GAAG;IACpB;IAEA,OAAOR,OAAOS,MAAM,EAAEC,iBAAiB;AACzC;AAUO,eAAejB,gBACpBO,MAAuB,EACvBC,OAAwB;IAExB,MAAMU,IAAAA,mBAAY,EAACjB,OAAO;QACxBG,OAAOG,OAAOM,QAAQ,CAACM,IAAI;QAC3BZ;QACAC;IACF;AACF"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _builders = /*#__PURE__*/ _interop_require_default(require("../../builders"));
|
|
12
|
-
const _serve = require("./serve");
|
|
13
|
-
function _interop_require_default(obj) {
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const command = {
|
|
19
|
-
command: [
|
|
20
|
-
'serve',
|
|
21
|
-
's'
|
|
22
|
-
],
|
|
23
|
-
desc: 'Locally serve Snap file(s) for testing',
|
|
24
|
-
builder: (yarg)=>{
|
|
25
|
-
yarg.option('root', _builders.default.root).option('port', _builders.default.port);
|
|
26
|
-
},
|
|
27
|
-
handler: async (argv)=>(0, _serve.serveHandler)(argv.context.config, {
|
|
28
|
-
port: argv.port ?? argv.context.config.server.port
|
|
29
|
-
})
|
|
30
|
-
};
|
|
31
|
-
const _default = command;
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/serve/index.ts"],"sourcesContent":["import type yargs from 'yargs';\n\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\nimport { serveHandler } from './serve';\n\nconst command = {\n command: ['serve', 's'],\n desc: 'Locally serve Snap file(s) for testing',\n builder: (yarg: yargs.Argv) => {\n yarg.option('root', builders.root).option('port', builders.port);\n },\n handler: async (argv: YargsArgs) =>\n serveHandler(argv.context.config, {\n port: argv.port ?? argv.context.config.server.port,\n }),\n};\n\nexport default command;\n"],"names":["command","desc","builder","yarg","option","builders","root","port","handler","argv","serveHandler","context","config","server"],"mappings":";;;;+BAkBA;;;eAAA;;;iEAhBqB;uBAEQ;;;;;;AAE7B,MAAMA,UAAU;IACdA,SAAS;QAAC;QAAS;KAAI;IACvBC,MAAM;IACNC,SAAS,CAACC;QACRA,KAAKC,MAAM,CAAC,QAAQC,iBAAQ,CAACC,IAAI,EAAEF,MAAM,CAAC,QAAQC,iBAAQ,CAACE,IAAI;IACjE;IACAC,SAAS,OAAOC,OACdC,IAAAA,mBAAY,EAACD,KAAKE,OAAO,CAACC,MAAM,EAAE;YAChCL,MAAME,KAAKF,IAAI,IAAIE,KAAKE,OAAO,CAACC,MAAM,CAACC,MAAM,CAACN,IAAI;QACpD;AACJ;MAEA,WAAeP"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "serveHandler", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return serveHandler;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _utils = require("../../utils");
|
|
12
|
-
const _webpack = require("../../webpack");
|
|
13
|
-
async function serveHandler(config, options) {
|
|
14
|
-
const server = (0, _webpack.getServer)(config);
|
|
15
|
-
// If the `configPort` is `0`, the OS will choose a random port for us, so we
|
|
16
|
-
// need to get the port from the server after it starts.
|
|
17
|
-
const { port } = await server.listen(options.port);
|
|
18
|
-
(0, _utils.info)(`The server is listening on http://localhost:${port}.`);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=serve.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/serve/serve.ts"],"sourcesContent":["import type { ProcessedConfig } from '../../config';\nimport { info } from '../../utils';\nimport { getServer } from '../../webpack';\n\ntype ServeOptions = {\n /**\n * The port to listen on.\n */\n port: number;\n};\n\n/**\n * Starts a local, static HTTP server on the given port with the given root\n * directory.\n *\n * @param config - The config object.\n * @param options - The options object.\n */\nexport async function serveHandler(\n config: ProcessedConfig,\n options: ServeOptions,\n): Promise<void> {\n const server = getServer(config);\n\n // If the `configPort` is `0`, the OS will choose a random port for us, so we\n // need to get the port from the server after it starts.\n const { port } = await server.listen(options.port);\n\n info(`The server is listening on http://localhost:${port}.`);\n}\n"],"names":["serveHandler","config","options","server","getServer","port","listen","info"],"mappings":";;;;+BAkBsBA;;;eAAAA;;;uBAjBD;yBACK;AAgBnB,eAAeA,aACpBC,MAAuB,EACvBC,OAAqB;IAErB,MAAMC,SAASC,IAAAA,kBAAS,EAACH;IAEzB,6EAA6E;IAC7E,wDAAwD;IACxD,MAAM,EAAEI,IAAI,EAAE,GAAG,MAAMF,OAAOG,MAAM,CAACJ,QAAQG,IAAI;IAEjDE,IAAAA,WAAI,EAAC,CAAC,4CAA4C,EAAEF,KAAK,CAAC,CAAC;AAC7D"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "watch", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return watch;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _path = require("path");
|
|
12
|
-
const _webpack = require("../../webpack");
|
|
13
|
-
async function watch(config, options) {
|
|
14
|
-
const compiler = await (0, _webpack.getCompiler)(config, {
|
|
15
|
-
evaluate: config.evaluate,
|
|
16
|
-
watch: true,
|
|
17
|
-
spinner: options?.spinner
|
|
18
|
-
});
|
|
19
|
-
return new Promise((resolve, reject)=>{
|
|
20
|
-
compiler.watch({
|
|
21
|
-
ignored: [
|
|
22
|
-
'**/node_modules/**/*',
|
|
23
|
-
`**/${(0, _path.basename)(config.output.path)}/**/*`
|
|
24
|
-
]
|
|
25
|
-
}, (watchError)=>{
|
|
26
|
-
if (watchError) {
|
|
27
|
-
reject(watchError);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
resolve(compiler.watching);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=implementation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/watch/implementation.ts"],"sourcesContent":["import { basename } from 'path';\nimport type { Watching } from 'webpack';\n\nimport type { ProcessedWebpackConfig } from '../../config';\nimport type { WebpackOptions } from '../../webpack';\nimport { getCompiler } from '../../webpack';\n\n/**\n * Build the snap bundle and watch for changes. This uses Webpack to build the\n * bundle.\n *\n * @param config - The config object.\n * @param options - The Webpack options.\n * @returns A promise that resolves when the bundle is built for the first time.\n * The promise resolves with a Webpack watching instance that can be used to\n * close the watcher.\n */\nexport async function watch(\n config: ProcessedWebpackConfig,\n options?: WebpackOptions,\n) {\n const compiler = await getCompiler(config, {\n evaluate: config.evaluate,\n watch: true,\n spinner: options?.spinner,\n });\n\n return new Promise<Watching>((resolve, reject) => {\n compiler.watch(\n {\n ignored: [\n '**/node_modules/**/*',\n `**/${basename(config.output.path)}/**/*`,\n ],\n },\n (watchError) => {\n if (watchError) {\n reject(watchError);\n return;\n }\n\n resolve(compiler.watching);\n },\n );\n });\n}\n"],"names":["watch","config","options","compiler","getCompiler","evaluate","spinner","Promise","resolve","reject","ignored","basename","output","path","watchError","watching"],"mappings":";;;;+BAiBsBA;;;eAAAA;;;sBAjBG;yBAKG;AAYrB,eAAeA,MACpBC,MAA8B,EAC9BC,OAAwB;IAExB,MAAMC,WAAW,MAAMC,IAAAA,oBAAW,EAACH,QAAQ;QACzCI,UAAUJ,OAAOI,QAAQ;QACzBL,OAAO;QACPM,SAASJ,SAASI;IACpB;IAEA,OAAO,IAAIC,QAAkB,CAACC,SAASC;QACrCN,SAASH,KAAK,CACZ;YACEU,SAAS;gBACP;gBACA,CAAC,GAAG,EAAEC,IAAAA,cAAQ,EAACV,OAAOW,MAAM,CAACC,IAAI,EAAE,KAAK,CAAC;aAC1C;QACH,GACA,CAACC;YACC,IAAIA,YAAY;gBACdL,OAAOK;gBACP;YACF;YAEAN,QAAQL,SAASY,QAAQ;QAC3B;IAEJ;AACF"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _builders = /*#__PURE__*/ _interop_require_default(require("../../builders"));
|
|
12
|
-
const _watch = require("./watch");
|
|
13
|
-
_export_star(require("./implementation"), exports);
|
|
14
|
-
function _export_star(from, to) {
|
|
15
|
-
Object.keys(from).forEach(function(k) {
|
|
16
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
17
|
-
Object.defineProperty(to, k, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return from[k];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return from;
|
|
26
|
-
}
|
|
27
|
-
function _interop_require_default(obj) {
|
|
28
|
-
return obj && obj.__esModule ? obj : {
|
|
29
|
-
default: obj
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const command = {
|
|
33
|
-
command: [
|
|
34
|
-
'watch',
|
|
35
|
-
'w'
|
|
36
|
-
],
|
|
37
|
-
desc: 'Build Snap on change',
|
|
38
|
-
builder: (yarg)=>{
|
|
39
|
-
yarg.option('src', _builders.default.src).option('eval', _builders.default.eval).option('dist', _builders.default.dist).option('outfileName', _builders.default.outfileName).option('sourceMaps', _builders.default.sourceMaps).option('stripComments', _builders.default.stripComments).option('transpilationMode', _builders.default.transpilationMode).option('depsToTranspile', _builders.default.depsToTranspile).option('manifest', _builders.default.manifest).option('writeManifest', _builders.default.writeManifest).option('serve', _builders.default.serve).option('root', _builders.default.root).option('port', _builders.default.port).implies('writeManifest', 'manifest').implies('depsToTranspile', 'transpilationMode');
|
|
40
|
-
},
|
|
41
|
-
handler: async (argv)=>(0, _watch.watchHandler)(argv.context.config, {
|
|
42
|
-
port: argv.port
|
|
43
|
-
})
|
|
44
|
-
};
|
|
45
|
-
const _default = command;
|
|
46
|
-
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/watch/index.ts"],"sourcesContent":["import type yargs from 'yargs';\n\nimport builders from '../../builders';\nimport type { YargsArgs } from '../../types/yargs';\nimport { watchHandler } from './watch';\n\nconst command = {\n command: ['watch', 'w'],\n desc: 'Build Snap on change',\n builder: (yarg: yargs.Argv) => {\n yarg\n .option('src', builders.src)\n .option('eval', builders.eval)\n .option('dist', builders.dist)\n .option('outfileName', builders.outfileName)\n .option('sourceMaps', builders.sourceMaps)\n .option('stripComments', builders.stripComments)\n .option('transpilationMode', builders.transpilationMode)\n .option('depsToTranspile', builders.depsToTranspile)\n .option('manifest', builders.manifest)\n .option('writeManifest', builders.writeManifest)\n .option('serve', builders.serve)\n .option('root', builders.root)\n .option('port', builders.port)\n .implies('writeManifest', 'manifest')\n .implies('depsToTranspile', 'transpilationMode');\n },\n handler: async (argv: YargsArgs) =>\n watchHandler(argv.context.config, {\n port: argv.port,\n }),\n};\n\nexport * from './implementation';\nexport default command;\n"],"names":["command","desc","builder","yarg","option","builders","src","eval","dist","outfileName","sourceMaps","stripComments","transpilationMode","depsToTranspile","manifest","writeManifest","serve","root","port","implies","handler","argv","watchHandler","context","config"],"mappings":";;;;+BAkCA;;;eAAA;;;iEAhCqB;uBAEQ;qBA6Bf;;;;;;;;;;;;;;;;;;;AA3Bd,MAAMA,UAAU;IACdA,SAAS;QAAC;QAAS;KAAI;IACvBC,MAAM;IACNC,SAAS,CAACC;QACRA,KACGC,MAAM,CAAC,OAAOC,iBAAQ,CAACC,GAAG,EAC1BF,MAAM,CAAC,QAAQC,iBAAQ,CAACE,IAAI,EAC5BH,MAAM,CAAC,QAAQC,iBAAQ,CAACG,IAAI,EAC5BJ,MAAM,CAAC,eAAeC,iBAAQ,CAACI,WAAW,EAC1CL,MAAM,CAAC,cAAcC,iBAAQ,CAACK,UAAU,EACxCN,MAAM,CAAC,iBAAiBC,iBAAQ,CAACM,aAAa,EAC9CP,MAAM,CAAC,qBAAqBC,iBAAQ,CAACO,iBAAiB,EACtDR,MAAM,CAAC,mBAAmBC,iBAAQ,CAACQ,eAAe,EAClDT,MAAM,CAAC,YAAYC,iBAAQ,CAACS,QAAQ,EACpCV,MAAM,CAAC,iBAAiBC,iBAAQ,CAACU,aAAa,EAC9CX,MAAM,CAAC,SAASC,iBAAQ,CAACW,KAAK,EAC9BZ,MAAM,CAAC,QAAQC,iBAAQ,CAACY,IAAI,EAC5Bb,MAAM,CAAC,QAAQC,iBAAQ,CAACa,IAAI,EAC5BC,OAAO,CAAC,iBAAiB,YACzBA,OAAO,CAAC,mBAAmB;IAChC;IACAC,SAAS,OAAOC,OACdC,IAAAA,mBAAY,EAACD,KAAKE,OAAO,CAACC,MAAM,EAAE;YAChCN,MAAMG,KAAKH,IAAI;QACjB;AACJ;MAGA,WAAelB"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "watchHandler", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return watchHandler;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _snapsutils = require("@metamask/snaps-utils");
|
|
12
|
-
const _errors = require("../../errors");
|
|
13
|
-
const _utils = require("../../utils");
|
|
14
|
-
const _webpack = require("../../webpack");
|
|
15
|
-
const _implementation = require("./implementation");
|
|
16
|
-
const steps = [
|
|
17
|
-
{
|
|
18
|
-
name: 'Checking the input file.',
|
|
19
|
-
task: async ({ config })=>{
|
|
20
|
-
const { input } = config;
|
|
21
|
-
if (!await (0, _snapsutils.isFile)(input)) {
|
|
22
|
-
throw new _errors.CommandError(`Input file not found: "${input}". Make sure that the "input" field in your snap config is correct.`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'Starting the development server.',
|
|
28
|
-
condition: ({ config })=>config.server.enabled,
|
|
29
|
-
task: async ({ config, options, spinner })=>{
|
|
30
|
-
const server = (0, _webpack.getServer)(config);
|
|
31
|
-
const { port } = await server.listen(options.port ?? config.server.port);
|
|
32
|
-
(0, _utils.info)(`The server is listening on http://localhost:${port}.`, spinner);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'Building the snap bundle.',
|
|
37
|
-
task: async ({ config, spinner })=>{
|
|
38
|
-
await (0, _implementation.watch)(config, {
|
|
39
|
-
spinner
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
];
|
|
44
|
-
async function watchHandler(config, options) {
|
|
45
|
-
await (0, _utils.executeSteps)(steps, {
|
|
46
|
-
config,
|
|
47
|
-
options
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=watch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/watch/watch.ts"],"sourcesContent":["import { isFile } from '@metamask/snaps-utils';\n\nimport type { ProcessedConfig, ProcessedWebpackConfig } from '../../config';\nimport { CommandError } from '../../errors';\nimport type { Steps } from '../../utils';\nimport { executeSteps, info } from '../../utils';\nimport { getServer } from '../../webpack';\nimport { watch } from './implementation';\n\ntype WatchOptions = {\n /**\n * The port to listen on.\n */\n port?: number;\n};\n\ntype WatchContext = {\n config: ProcessedWebpackConfig;\n options: WatchOptions;\n};\n\nconst steps: Steps<WatchContext> = [\n {\n name: 'Checking the input file.',\n task: async ({ config }) => {\n const { input } = config;\n\n if (!(await isFile(input))) {\n throw new CommandError(\n `Input file not found: \"${input}\". Make sure that the \"input\" field in your snap config is correct.`,\n );\n }\n },\n },\n {\n name: 'Starting the development server.',\n condition: ({ config }) => config.server.enabled,\n task: async ({ config, options, spinner }) => {\n const server = getServer(config);\n const { port } = await server.listen(options.port ?? config.server.port);\n\n info(`The server is listening on http://localhost:${port}.`, spinner);\n },\n },\n {\n name: 'Building the snap bundle.',\n task: async ({ config, spinner }) => {\n await watch(config, { spinner });\n },\n },\n];\n\n/**\n * Watch a directory and its subdirectories for changes, and build when files\n * are added or changed.\n *\n * Ignores 'node_modules' and dotfiles.\n * Creates destination directory if it doesn't exist.\n *\n * @param config - The config object.\n * @param options - The options object.\n */\nexport async function watchHandler(\n config: ProcessedConfig,\n options: WatchOptions,\n): Promise<void> {\n await executeSteps(steps, { config, options });\n}\n"],"names":["watchHandler","steps","name","task","config","input","isFile","CommandError","condition","server","enabled","options","spinner","getServer","port","listen","info","watch","executeSteps"],"mappings":";;;;+BA8DsBA;;;eAAAA;;;4BA9DC;wBAGM;uBAEM;yBACT;gCACJ;AActB,MAAMC,QAA6B;IACjC;QACEC,MAAM;QACNC,MAAM,OAAO,EAAEC,MAAM,EAAE;YACrB,MAAM,EAAEC,KAAK,EAAE,GAAGD;YAElB,IAAI,CAAE,MAAME,IAAAA,kBAAM,EAACD,QAAS;gBAC1B,MAAM,IAAIE,oBAAY,CACpB,CAAC,uBAAuB,EAAEF,MAAM,mEAAmE,CAAC;YAExG;QACF;IACF;IACA;QACEH,MAAM;QACNM,WAAW,CAAC,EAAEJ,MAAM,EAAE,GAAKA,OAAOK,MAAM,CAACC,OAAO;QAChDP,MAAM,OAAO,EAAEC,MAAM,EAAEO,OAAO,EAAEC,OAAO,EAAE;YACvC,MAAMH,SAASI,IAAAA,kBAAS,EAACT;YACzB,MAAM,EAAEU,IAAI,EAAE,GAAG,MAAML,OAAOM,MAAM,CAACJ,QAAQG,IAAI,IAAIV,OAAOK,MAAM,CAACK,IAAI;YAEvEE,IAAAA,WAAI,EAAC,CAAC,4CAA4C,EAAEF,KAAK,CAAC,CAAC,EAAEF;QAC/D;IACF;IACA;QACEV,MAAM;QACNC,MAAM,OAAO,EAAEC,MAAM,EAAEQ,OAAO,EAAE;YAC9B,MAAMK,IAAAA,qBAAK,EAACb,QAAQ;gBAAEQ;YAAQ;QAChC;IACF;CACD;AAYM,eAAeZ,aACpBI,MAAuB,EACvBO,OAAqB;IAErB,MAAMO,IAAAA,mBAAY,EAACjB,OAAO;QAAEG;QAAQO;IAAQ;AAC9C"}
|