@metamask/snaps-cli 5.1.1 → 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 +8 -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 -254
- 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 -285
- package/dist/esm/webpack/utils.js.map +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunkIQTGFRWKjs = require('./chunk-IQTGFRWK.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk6NJAXMSBjs = require('./chunk-6NJAXMSB.js');
|
|
7
|
+
|
|
8
|
+
// src/commands/serve/index.ts
|
|
9
|
+
var command = {
|
|
10
|
+
command: ["serve", "s"],
|
|
11
|
+
desc: "Locally serve Snap file(s) for testing",
|
|
12
|
+
builder: (yarg) => {
|
|
13
|
+
yarg.option("root", _chunk6NJAXMSBjs.builders_default.root).option("port", _chunk6NJAXMSBjs.builders_default.port);
|
|
14
|
+
},
|
|
15
|
+
handler: async (argv) => _chunkIQTGFRWKjs.serveHandler.call(void 0, argv.context.config, {
|
|
16
|
+
port: _nullishCoalesce(argv.port, () => ( argv.context.config.server.port))
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
var serve_default = command;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
exports.serve_default = serve_default;
|
|
24
|
+
//# sourceMappingURL=chunk-T3KPXUAU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/serve/index.ts"],"names":[],"mappings":";;;;;;;;AAMA,IAAM,UAAU;AAAA,EACd,SAAS,CAAC,SAAS,GAAG;AAAA,EACtB,MAAM;AAAA,EACN,SAAS,CAAC,SAAqB;AAC7B,SAAK,OAAO,QAAQ,iBAAS,IAAI,EAAE,OAAO,QAAQ,iBAAS,IAAI;AAAA,EACjE;AAAA,EACA,SAAS,OAAO,SACd,aAAa,KAAK,QAAQ,QAAQ;AAAA,IAChC,MAAM,KAAK,QAAQ,KAAK,QAAQ,OAAO,OAAO;AAAA,EAChD,CAAC;AACL;AAEA,IAAO,gBAAQ","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"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
+
}) : x)(function(x) {
|
|
5
|
+
if (typeof require !== "undefined")
|
|
6
|
+
return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __accessCheck = (obj, member, msg) => {
|
|
14
|
+
if (!member.has(obj))
|
|
15
|
+
throw TypeError("Cannot " + msg);
|
|
16
|
+
};
|
|
17
|
+
var __privateGet = (obj, member, getter) => {
|
|
18
|
+
__accessCheck(obj, member, "read from private field");
|
|
19
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
20
|
+
};
|
|
21
|
+
var __privateAdd = (obj, member, value) => {
|
|
22
|
+
if (member.has(obj))
|
|
23
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
24
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
25
|
+
};
|
|
26
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
27
|
+
__accessCheck(obj, member, "write to private field");
|
|
28
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
var __privateMethod = (obj, member, method) => {
|
|
32
|
+
__accessCheck(obj, member, "access private method");
|
|
33
|
+
return method;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// ../../node_modules/tsup/assets/esm_shims.js
|
|
37
|
+
import { fileURLToPath } from "url";
|
|
38
|
+
var getFilename = () => fileURLToPath(import.meta.url);
|
|
39
|
+
var __filename = /* @__PURE__ */ getFilename();
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
__require,
|
|
43
|
+
__export,
|
|
44
|
+
__privateGet,
|
|
45
|
+
__privateAdd,
|
|
46
|
+
__privateSet,
|
|
47
|
+
__privateMethod,
|
|
48
|
+
__filename
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-T74IXMA3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/tsup/assets/esm_shims.js"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAG9B,IAAM,cAAc,MAAM,cAAc,YAAY,GAAG;AAIhD,IAAM,aAA6B,4BAAY;","names":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/utils/cli.ts
|
|
2
|
+
import path from "path";
|
|
3
|
+
var CONFIG_FILE = "snap.config.js";
|
|
4
|
+
var TS_CONFIG_FILE = "snap.config.ts";
|
|
5
|
+
var pathArguments = /* @__PURE__ */ new Set([
|
|
6
|
+
"src",
|
|
7
|
+
"s",
|
|
8
|
+
"dist",
|
|
9
|
+
"d",
|
|
10
|
+
"bundle",
|
|
11
|
+
"b",
|
|
12
|
+
"root",
|
|
13
|
+
"r"
|
|
14
|
+
]);
|
|
15
|
+
function sanitizeInputs(argv) {
|
|
16
|
+
Object.keys(argv).forEach((key) => {
|
|
17
|
+
if (typeof argv[key] === "string") {
|
|
18
|
+
if (argv[key] === "./") {
|
|
19
|
+
argv[key] = ".";
|
|
20
|
+
}
|
|
21
|
+
if (pathArguments.has(key)) {
|
|
22
|
+
argv[key] = path.normalize(argv[key]);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function trimPathString(pathString) {
|
|
28
|
+
return pathString.replace(/^[./]+|[./]+$/gu, "");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
CONFIG_FILE,
|
|
33
|
+
TS_CONFIG_FILE,
|
|
34
|
+
sanitizeInputs,
|
|
35
|
+
trimPathString
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=chunk-TLTTWAEI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/cli.ts"],"sourcesContent":["import path from 'path';\n\nexport const CONFIG_FILE = 'snap.config.js';\nexport const TS_CONFIG_FILE = 'snap.config.ts';\n\n// CLI arguments whose values are file paths.\nconst pathArguments = new Set([\n 'src',\n 's',\n 'dist',\n 'd',\n 'bundle',\n 'b',\n 'root',\n 'r',\n]);\n\n/**\n * Sanitizes inputs. Currently normalizes \"./\" paths to \".\".\n * Yargs handles other path normalization as specified in builders.\n *\n * @param argv - Arguments as an object generated by yargs.\n */\nexport function sanitizeInputs(argv: Record<string, unknown>) {\n Object.keys(argv).forEach((key) => {\n if (typeof argv[key] === 'string') {\n // Node's path.normalize() does not do this\n if (argv[key] === './') {\n argv[key] = '.';\n }\n\n if (pathArguments.has(key)) {\n argv[key] = path.normalize(argv[key] as string);\n }\n }\n });\n}\n\n/**\n * Trims leading and trailing periods \".\" and forward slashes \"/\" from the\n * given path string.\n *\n * @param pathString - The path string to trim.\n * @returns The trimmed path string.\n */\nexport function trimPathString(pathString: string): string {\n return pathString.replace(/^[./]+|[./]+$/gu, '');\n}\n"],"mappings":";AAAA,OAAO,UAAU;AAEV,IAAM,cAAc;AACpB,IAAM,iBAAiB;AAG9B,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAQM,SAAS,eAAe,MAA+B;AAC5D,SAAO,KAAK,IAAI,EAAE,QAAQ,CAAC,QAAQ;AACjC,QAAI,OAAO,KAAK,GAAG,MAAM,UAAU;AAEjC,UAAI,KAAK,GAAG,MAAM,MAAM;AACtB,aAAK,GAAG,IAAI;AAAA,MACd;AAEA,UAAI,cAAc,IAAI,GAAG,GAAG;AAC1B,aAAK,GAAG,IAAI,KAAK,UAAU,KAAK,GAAG,CAAW;AAAA,MAChD;AAAA,IACF;AAAA,EACF,CAAC;AACH;AASO,SAAS,eAAe,YAA4B;AACzD,SAAO,WAAW,QAAQ,mBAAmB,EAAE;AACjD;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
error,
|
|
3
|
+
info,
|
|
4
|
+
warn
|
|
5
|
+
} from "./chunk-JMISQ4HT.mjs";
|
|
6
|
+
|
|
7
|
+
// src/commands/manifest/implementation.ts
|
|
8
|
+
import { checkManifest, indent } from "@metamask/snaps-utils/node";
|
|
9
|
+
import { red, yellow } from "chalk";
|
|
10
|
+
import { dirname } from "path";
|
|
11
|
+
async function manifest(path, write, spinner) {
|
|
12
|
+
const { warnings, errors, updated } = await checkManifest(
|
|
13
|
+
dirname(path),
|
|
14
|
+
write
|
|
15
|
+
);
|
|
16
|
+
if (write && updated) {
|
|
17
|
+
info("The snap manifest file has been updated.", spinner);
|
|
18
|
+
}
|
|
19
|
+
if (!write && errors.length > 0) {
|
|
20
|
+
const formattedErrors = errors.map((manifestError) => indent(red(`\u2022 ${manifestError}`))).join("\n");
|
|
21
|
+
error(
|
|
22
|
+
`The snap manifest file is invalid.
|
|
23
|
+
|
|
24
|
+
${formattedErrors}
|
|
25
|
+
|
|
26
|
+
Run the command with the \`--fix\` flag to attempt to fix the manifest.`,
|
|
27
|
+
spinner
|
|
28
|
+
);
|
|
29
|
+
spinner?.stop();
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (warnings.length > 0) {
|
|
34
|
+
const formattedWarnings = warnings.map(
|
|
35
|
+
(manifestWarning) => indent(yellow(`\u2022 ${manifestWarning}`))
|
|
36
|
+
);
|
|
37
|
+
warn(
|
|
38
|
+
`The snap manifest file has warnings.
|
|
39
|
+
|
|
40
|
+
${formattedWarnings.join("\n")}`,
|
|
41
|
+
spinner
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
manifest
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-TX4BG5GS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/manifest/implementation.ts"],"sourcesContent":["import { checkManifest, indent } from '@metamask/snaps-utils/node';\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"],"mappings":";;;;;;;AAAA,SAAS,eAAe,cAAc;AACtC,SAAS,KAAK,cAAc;AAE5B,SAAS,eAAe;AAcxB,eAAsB,SACpB,MACA,OACA,SACkB;AAClB,QAAM,EAAE,UAAU,QAAQ,QAAQ,IAAI,MAAM;AAAA,IAC1C,QAAQ,IAAI;AAAA,IACZ;AAAA,EACF;AAEA,MAAI,SAAS,SAAS;AACpB,SAAK,4CAA4C,OAAO;AAAA,EAC1D;AAEA,MAAI,CAAC,SAAS,OAAO,SAAS,GAAG;AAC/B,UAAM,kBAAkB,OACrB,IAAI,CAAC,kBAAkB,OAAO,IAAI,UAAK,aAAa,EAAE,CAAC,CAAC,EACxD,KAAK,IAAI;AAEZ;AAAA,MACE;AAAA;AAAA,EAAyC,eAAe;AAAA;AAAA;AAAA,MACxD;AAAA,IACF;AAEA,aAAS,KAAK;AACd,YAAQ,WAAW;AACnB,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,SAAS,GAAG;AACvB,UAAM,oBAAoB,SAAS;AAAA,MAAI,CAAC,oBACtC,OAAO,OAAO,UAAK,eAAe,EAAE,CAAC;AAAA,IACvC;AAEA;AAAA,MACE;AAAA;AAAA,EAA2C,kBAAkB,KAAK,IAAI,CAAC;AAAA,MACvE;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
watch_default
|
|
3
|
+
} from "./chunk-X2RPNWBJ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
build_default
|
|
6
|
+
} from "./chunk-VTJFPUIA.mjs";
|
|
7
|
+
import {
|
|
8
|
+
manifest_default
|
|
9
|
+
} from "./chunk-EXJCMAUI.mjs";
|
|
10
|
+
import {
|
|
11
|
+
serve_default
|
|
12
|
+
} from "./chunk-QCP4QKMQ.mjs";
|
|
13
|
+
import {
|
|
14
|
+
eval_default
|
|
15
|
+
} from "./chunk-SAEZHRJJ.mjs";
|
|
16
|
+
|
|
17
|
+
// src/commands/index.ts
|
|
18
|
+
var commands = [
|
|
19
|
+
build_default,
|
|
20
|
+
eval_default,
|
|
21
|
+
manifest_default,
|
|
22
|
+
serve_default,
|
|
23
|
+
watch_default
|
|
24
|
+
];
|
|
25
|
+
var commands_default = commands;
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
commands_default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=chunk-UA5FEKKH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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"],"mappings":";;;;;;;;;;;;;;;;;AAMA,IAAM,WAAW;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAO,mBAAQ;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__filename
|
|
3
|
+
} from "./chunk-T74IXMA3.mjs";
|
|
4
|
+
|
|
5
|
+
// src/webpack/loaders/function.ts
|
|
6
|
+
var loader = function(content) {
|
|
7
|
+
const { fn } = this.getOptions();
|
|
8
|
+
return fn.bind(this)(content);
|
|
9
|
+
};
|
|
10
|
+
var function_default = loader;
|
|
11
|
+
function getFunctionLoader(fn, options) {
|
|
12
|
+
return {
|
|
13
|
+
// We use `__filename` as the loader, so Webpack will execute the loader in
|
|
14
|
+
// this file, with the actual function in the options.
|
|
15
|
+
loader: __filename,
|
|
16
|
+
options: {
|
|
17
|
+
fn,
|
|
18
|
+
...options
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (typeof module !== "undefined" && process?.env?.NODE_ENV !== "test") {
|
|
23
|
+
module.exports = loader;
|
|
24
|
+
module.exports.getFunctionLoader = getFunctionLoader;
|
|
25
|
+
module.exports.raw = true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
function_default,
|
|
30
|
+
getFunctionLoader
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-UBWM7UOC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/webpack/loaders/function.ts"],"sourcesContent":["import type { LoaderDefinitionFunction } from 'webpack';\n\n/**\n * Options for the function loader.\n */\nexport type FunctionLoaderOptions = {\n /**\n * The function to execute. This is bound to the loader context, so it can\n * access the loader options and other properties.\n */\n fn: LoaderDefinitionFunction;\n};\n\n/**\n * A loader that executes a function. See {@link getFunctionLoader} for more\n * information.\n *\n * @param content - The input file contents as a `Uint8Array`.\n * @returns The output of the function.\n */\nconst loader: LoaderDefinitionFunction<FunctionLoaderOptions> = function (\n content,\n) {\n const { fn } = this.getOptions();\n return fn.bind(this)(content);\n};\n\nexport default loader;\n\n/**\n * Get a loader that executes the given function. This is useful for executing\n * loaders without needing to pass a file to Webpack.\n *\n * @param fn - The function to execute.\n * @param options - The options to pass to the loader.\n * @returns The loader definition.\n */\nexport function getFunctionLoader<Options>(\n fn: LoaderDefinitionFunction<Options>,\n options: Options,\n) {\n return {\n // We use `__filename` as the loader, so Webpack will execute the loader in\n // this file, with the actual function in the options.\n loader: __filename,\n options: {\n fn,\n ...options,\n },\n };\n}\n\n// When running as CJS, we need to export the loader as a default export, since\n// `tsup` exports it as `loader_default`.\n// istanbul ignore next 3\n// eslint-disable-next-line n/no-process-env\nif (typeof module !== 'undefined' && process?.env?.NODE_ENV !== 'test') {\n module.exports = loader;\n module.exports.getFunctionLoader = getFunctionLoader;\n module.exports.raw = true;\n}\n"],"mappings":";;;;;AAoBA,IAAM,SAA0D,SAC9D,SACA;AACA,QAAM,EAAE,GAAG,IAAI,KAAK,WAAW;AAC/B,SAAO,GAAG,KAAK,IAAI,EAAE,OAAO;AAC9B;AAEA,IAAO,mBAAQ;AAUR,SAAS,kBACd,IACA,SACA;AACA,SAAO;AAAA;AAAA;AAAA,IAGL,QAAQ;AAAA,IACR,SAAS;AAAA,MACP;AAAA,MACA,GAAG;AAAA,IACL;AAAA,EACF;AACF;AAMA,IAAI,OAAO,WAAW,eAAe,SAAS,KAAK,aAAa,QAAQ;AACtE,SAAO,UAAU;AACjB,SAAO,QAAQ,oBAAoB;AACnC,SAAO,QAAQ,MAAM;AACvB;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCompiler
|
|
3
|
+
} from "./chunk-WKL7DYYW.mjs";
|
|
4
|
+
|
|
5
|
+
// src/commands/watch/implementation.ts
|
|
6
|
+
import { basename } from "path";
|
|
7
|
+
async function watch(config, options) {
|
|
8
|
+
const compiler = await getCompiler(config, {
|
|
9
|
+
evaluate: config.evaluate,
|
|
10
|
+
watch: true,
|
|
11
|
+
spinner: options?.spinner
|
|
12
|
+
});
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
compiler.watch(
|
|
15
|
+
{
|
|
16
|
+
ignored: [
|
|
17
|
+
"**/node_modules/**/*",
|
|
18
|
+
`**/${basename(config.output.path)}/**/*`
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
(watchError) => {
|
|
22
|
+
if (watchError) {
|
|
23
|
+
reject(watchError);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
resolve(compiler.watching);
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
watch
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=chunk-USFFVX52.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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"],"mappings":";;;;;AAAA,SAAS,gBAAgB;AAiBzB,eAAsB,MACpB,QACA,SACA;AACA,QAAM,WAAW,MAAM,YAAY,QAAQ;AAAA,IACzC,UAAU,OAAO;AAAA,IACjB,OAAO;AAAA,IACP,SAAS,SAAS;AAAA,EACpB,CAAC;AAED,SAAO,IAAI,QAAkB,CAAC,SAAS,WAAW;AAChD,aAAS;AAAA,MACP;AAAA,QACE,SAAS;AAAA,UACP;AAAA,UACA,MAAM,SAAS,OAAO,OAAO,IAAI,CAAC;AAAA,QACpC;AAAA,MACF;AAAA,MACA,CAAC,eAAe;AACd,YAAI,YAAY;AACd,iBAAO,UAAU;AACjB;AAAA,QACF;AAEA,gBAAQ,SAAS,QAAQ;AAAA,MAC3B;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/utils/legacy.ts
|
|
2
|
+
function processDependencies(config) {
|
|
3
|
+
const { depsToTranspile, transpilationMode } = config;
|
|
4
|
+
if (transpilationMode === "localAndDeps" /* LocalAndDeps */) {
|
|
5
|
+
const regex = getDependencyRegExp(depsToTranspile);
|
|
6
|
+
if (regex !== null) {
|
|
7
|
+
return [regex];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
function getDependencyRegExp(dependencies) {
|
|
13
|
+
if (!dependencies || dependencies.includes(".") || !dependencies.length) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const paths = sanitizeDependencyPaths(dependencies);
|
|
17
|
+
return RegExp(`/node_modules/(?!${paths.join("|")})`, "u");
|
|
18
|
+
}
|
|
19
|
+
function sanitizeDependencyPaths(dependencies) {
|
|
20
|
+
return dependencies.map((dependency) => {
|
|
21
|
+
return dependency.replace(/^[/\\]+/u, "").replace(/[/\\]+$/u, "");
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
processDependencies,
|
|
27
|
+
getDependencyRegExp,
|
|
28
|
+
sanitizeDependencyPaths
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=chunk-V5Q5HRXB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/legacy.ts"],"sourcesContent":["import { TranspilationModes } from '../builders';\nimport type { LegacyOptions } from '../config';\n\n/**\n * Get the dependencies to transpile, as well as the regular input file.\n *\n * If `transpilationMode` is not set to `localAndDeps`, this will return an\n * empty array.\n *\n * @param config - The config object.\n * @returns An array with regular expressions of dependencies that should be\n * transpiled.\n */\nexport function processDependencies(config: LegacyOptions) {\n const { depsToTranspile, transpilationMode } = config;\n if (transpilationMode === TranspilationModes.LocalAndDeps) {\n const regex = getDependencyRegExp(depsToTranspile);\n if (regex !== null) {\n return [regex];\n }\n }\n\n return [];\n}\n\n/**\n * Processes a string of space delimited dependencies into one RegExp string.\n *\n * @param dependencies - An array of dependencies to add to the RegExp.\n * @returns A RegExp object.\n */\nexport function getDependencyRegExp(dependencies: string[]): RegExp | null {\n if (!dependencies || dependencies.includes('.') || !dependencies.length) {\n return null;\n }\n\n const paths: string[] = sanitizeDependencyPaths(dependencies);\n return RegExp(`/node_modules/(?!${paths.join('|')})`, 'u');\n}\n\n/**\n * Helper function to remove any leading and trailing slashes from dependency\n * list.\n *\n * @param dependencies - An array of dependencies to sanitize.\n * @returns An array of sanitized paths.\n */\nexport function sanitizeDependencyPaths(dependencies: string[]): string[] {\n return dependencies.map((dependency) => {\n return dependency.replace(/^[/\\\\]+/u, '').replace(/[/\\\\]+$/u, '');\n });\n}\n"],"mappings":";AAaO,SAAS,oBAAoB,QAAuB;AACzD,QAAM,EAAE,iBAAiB,kBAAkB,IAAI;AAC/C,MAAI,yDAAuD;AACzD,UAAM,QAAQ,oBAAoB,eAAe;AACjD,QAAI,UAAU,MAAM;AAClB,aAAO,CAAC,KAAK;AAAA,IACf;AAAA,EACF;AAEA,SAAO,CAAC;AACV;AAQO,SAAS,oBAAoB,cAAuC;AACzE,MAAI,CAAC,gBAAgB,aAAa,SAAS,GAAG,KAAK,CAAC,aAAa,QAAQ;AACvE,WAAO;AAAA,EACT;AAEA,QAAM,QAAkB,wBAAwB,YAAY;AAC5D,SAAO,OAAO,oBAAoB,MAAM,KAAK,GAAG,CAAC,KAAK,GAAG;AAC3D;AASO,SAAS,wBAAwB,cAAkC;AACxE,SAAO,aAAa,IAAI,CAAC,eAAe;AACtC,WAAO,WAAW,QAAQ,YAAY,EAAE,EAAE,QAAQ,YAAY,EAAE;AAAA,EAClE,CAAC;AACH;","names":[]}
|