@metamask/snaps-cli 6.3.0 → 6.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -1
- package/dist/__fixtures__/configs/cjs.cjs +9 -0
- package/dist/__fixtures__/configs/cjs.cjs.map +1 -0
- package/dist/__fixtures__/configs/cjs.d.cts +2 -0
- package/dist/__fixtures__/configs/cjs.d.cts.map +1 -0
- package/dist/__fixtures__/configs/cjs.d.mts +2 -0
- package/dist/__fixtures__/configs/cjs.d.mts.map +1 -0
- package/dist/__fixtures__/configs/cjs.mjs +8 -0
- package/dist/__fixtures__/configs/cjs.mjs.map +1 -0
- package/dist/__fixtures__/configs/esm.cjs +7 -0
- package/dist/__fixtures__/configs/esm.cjs.map +1 -0
- package/dist/__fixtures__/configs/esm.d.cts +4 -0
- package/dist/__fixtures__/configs/esm.d.cts.map +1 -0
- package/dist/__fixtures__/configs/esm.d.mts +4 -0
- package/dist/__fixtures__/configs/esm.d.mts.map +1 -0
- package/dist/__fixtures__/configs/esm.mjs +5 -0
- package/dist/__fixtures__/configs/esm.mjs.map +1 -0
- package/dist/__fixtures__/configs/invalid.cjs +8 -0
- package/dist/__fixtures__/configs/invalid.cjs.map +1 -0
- package/dist/__fixtures__/configs/invalid.d.cts +4 -0
- package/dist/__fixtures__/configs/invalid.d.cts.map +1 -0
- package/dist/__fixtures__/configs/invalid.d.mts +4 -0
- package/dist/__fixtures__/configs/invalid.d.mts.map +1 -0
- package/dist/__fixtures__/configs/invalid.mjs +6 -0
- package/dist/__fixtures__/configs/invalid.mjs.map +1 -0
- package/dist/__fixtures__/configs/javascript/snap.config.cjs +6 -0
- package/dist/__fixtures__/configs/javascript/snap.config.cjs.map +1 -0
- package/dist/__fixtures__/configs/javascript/snap.config.d.cts +2 -0
- package/dist/__fixtures__/configs/javascript/snap.config.d.cts.map +1 -0
- package/dist/__fixtures__/configs/javascript/snap.config.d.mts +2 -0
- package/dist/__fixtures__/configs/javascript/snap.config.d.mts.map +1 -0
- package/dist/__fixtures__/configs/javascript/snap.config.mjs +5 -0
- package/dist/__fixtures__/configs/javascript/snap.config.mjs.map +1 -0
- package/dist/__fixtures__/configs/typescript/snap.config.cjs +7 -0
- package/dist/__fixtures__/configs/typescript/snap.config.cjs.map +1 -0
- package/dist/__fixtures__/configs/typescript/snap.config.d.cts +4 -0
- package/dist/__fixtures__/configs/typescript/snap.config.d.cts.map +1 -0
- package/dist/__fixtures__/configs/typescript/snap.config.d.mts +4 -0
- package/dist/__fixtures__/configs/typescript/snap.config.d.mts.map +1 -0
- package/dist/__fixtures__/configs/typescript/snap.config.mjs +5 -0
- package/dist/__fixtures__/configs/typescript/snap.config.mjs.map +1 -0
- package/dist/builders.cjs +132 -0
- package/dist/builders.cjs.map +1 -0
- package/dist/{types/builders.d.ts → builders.d.cts} +2 -1
- package/dist/builders.d.cts.map +1 -0
- package/dist/builders.d.mts +9 -0
- package/dist/builders.d.mts.map +1 -0
- package/dist/builders.mjs +127 -8
- package/dist/builders.mjs.map +1 -1
- package/dist/cli.cjs +71 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/{types/cli.d.ts → cli.d.cts} +1 -0
- package/dist/cli.d.cts.map +1 -0
- package/dist/cli.d.mts +16 -0
- package/dist/cli.d.mts.map +1 -0
- package/dist/cli.mjs +69 -20
- package/dist/cli.mjs.map +1 -1
- package/dist/commands/build/build.cjs +53 -0
- package/dist/commands/build/build.cjs.map +1 -0
- package/dist/{types/commands/build/build.d.ts → commands/build/build.d.cts} +3 -1
- package/dist/commands/build/build.d.cts.map +1 -0
- package/dist/commands/build/build.d.mts +12 -0
- package/dist/commands/build/build.d.mts.map +1 -0
- package/dist/commands/build/build.mjs +48 -28
- package/dist/commands/build/build.mjs.map +1 -1
- package/dist/commands/build/implementation.cjs +31 -0
- package/dist/commands/build/implementation.cjs.map +1 -0
- package/dist/{types/commands/build/implementation.d.ts → commands/build/implementation.d.cts} +3 -2
- package/dist/commands/build/implementation.d.cts.map +1 -0
- package/dist/commands/build/implementation.d.mts +11 -0
- package/dist/commands/build/implementation.d.mts.map +1 -0
- package/dist/commands/build/implementation.mjs +26 -27
- package/dist/commands/build/implementation.mjs.map +1 -1
- package/dist/commands/build/index.cjs +44 -0
- package/dist/commands/build/index.cjs.map +1 -0
- package/dist/{types/commands/eval/index.d.ts → commands/build/index.d.cts} +4 -3
- package/dist/commands/build/index.d.cts.map +1 -0
- package/dist/{types/commands/manifest/index.d.ts → commands/build/index.d.mts} +4 -3
- package/dist/commands/build/index.d.mts.map +1 -0
- package/dist/commands/build/index.mjs +23 -31
- package/dist/commands/build/index.mjs.map +1 -1
- package/dist/commands/eval/__test__/browserify/bad/snap.config.cjs +10 -0
- package/dist/commands/eval/__test__/browserify/bad/snap.config.cjs.map +1 -0
- package/dist/commands/eval/__test__/browserify/bad/snap.config.d.cts +4 -0
- package/dist/commands/eval/__test__/browserify/bad/snap.config.d.cts.map +1 -0
- package/dist/commands/eval/__test__/browserify/bad/snap.config.d.mts +4 -0
- package/dist/commands/eval/__test__/browserify/bad/snap.config.d.mts.map +1 -0
- package/dist/commands/eval/__test__/browserify/bad/snap.config.mjs +8 -0
- package/dist/commands/eval/__test__/browserify/bad/snap.config.mjs.map +1 -0
- package/dist/commands/eval/__test__/browserify/good/snap.config.cjs +10 -0
- package/dist/commands/eval/__test__/browserify/good/snap.config.cjs.map +1 -0
- package/dist/commands/eval/__test__/browserify/good/snap.config.d.cts +4 -0
- package/dist/commands/eval/__test__/browserify/good/snap.config.d.cts.map +1 -0
- package/dist/commands/eval/__test__/browserify/good/snap.config.d.mts +4 -0
- package/dist/commands/eval/__test__/browserify/good/snap.config.d.mts.map +1 -0
- package/dist/commands/eval/__test__/browserify/good/snap.config.mjs +8 -0
- package/dist/commands/eval/__test__/browserify/good/snap.config.mjs.map +1 -0
- package/dist/commands/eval/__test__/webpack/bad/snap.config.cjs +12 -0
- package/dist/commands/eval/__test__/webpack/bad/snap.config.cjs.map +1 -0
- package/dist/commands/eval/__test__/webpack/bad/snap.config.d.cts +4 -0
- package/dist/commands/eval/__test__/webpack/bad/snap.config.d.cts.map +1 -0
- package/dist/commands/eval/__test__/webpack/bad/snap.config.d.mts +4 -0
- package/dist/commands/eval/__test__/webpack/bad/snap.config.d.mts.map +1 -0
- package/dist/commands/eval/__test__/webpack/bad/snap.config.mjs +10 -0
- package/dist/commands/eval/__test__/webpack/bad/snap.config.mjs.map +1 -0
- package/dist/commands/eval/__test__/webpack/good/snap.config.cjs +12 -0
- package/dist/commands/eval/__test__/webpack/good/snap.config.cjs.map +1 -0
- package/dist/commands/eval/__test__/webpack/good/snap.config.d.cts +4 -0
- package/dist/commands/eval/__test__/webpack/good/snap.config.d.cts.map +1 -0
- package/dist/commands/eval/__test__/webpack/good/snap.config.d.mts +4 -0
- package/dist/commands/eval/__test__/webpack/good/snap.config.d.mts.map +1 -0
- package/dist/commands/eval/__test__/webpack/good/snap.config.mjs +10 -0
- package/dist/commands/eval/__test__/webpack/good/snap.config.mjs.map +1 -0
- package/dist/commands/eval/__test__/webpack/snap.config.cjs +8 -0
- package/dist/commands/eval/__test__/webpack/snap.config.cjs.map +1 -0
- package/dist/commands/eval/__test__/webpack/snap.config.d.cts +4 -0
- package/dist/commands/eval/__test__/webpack/snap.config.d.cts.map +1 -0
- package/dist/commands/eval/__test__/webpack/snap.config.d.mts +4 -0
- package/dist/commands/eval/__test__/webpack/snap.config.d.mts.map +1 -0
- package/dist/commands/eval/__test__/webpack/snap.config.mjs +6 -0
- package/dist/commands/eval/__test__/webpack/snap.config.mjs.map +1 -0
- package/dist/commands/eval/eval.cjs +57 -0
- package/dist/commands/eval/eval.cjs.map +1 -0
- package/dist/{types/commands/eval/eval.d.ts → commands/eval/eval.d.cts} +2 -1
- package/dist/commands/eval/eval.d.cts.map +1 -0
- package/dist/commands/eval/eval.d.mts +15 -0
- package/dist/commands/eval/eval.d.mts.map +1 -0
- package/dist/commands/eval/eval.mjs +52 -17
- package/dist/commands/eval/eval.mjs.map +1 -1
- package/dist/commands/eval/implementation.cjs +30 -0
- package/dist/commands/eval/implementation.cjs.map +1 -0
- package/dist/{types/commands/eval/implementation.d.ts → commands/eval/implementation.d.cts} +2 -0
- package/dist/commands/eval/implementation.d.cts.map +1 -0
- package/dist/commands/eval/implementation.d.mts +11 -0
- package/dist/commands/eval/implementation.d.mts.map +1 -0
- package/dist/commands/eval/implementation.mjs +26 -8
- package/dist/commands/eval/implementation.mjs.map +1 -1
- package/dist/commands/eval/index.cjs +35 -0
- package/dist/commands/eval/index.cjs.map +1 -0
- package/dist/commands/eval/index.d.cts +11 -0
- package/dist/commands/eval/index.d.cts.map +1 -0
- package/dist/commands/eval/index.d.mts +11 -0
- package/dist/commands/eval/index.d.mts.map +1 -0
- package/dist/commands/eval/index.mjs +14 -20
- package/dist/commands/eval/index.mjs.map +1 -1
- package/dist/commands/index.cjs +19 -0
- package/dist/commands/index.cjs.map +1 -0
- package/dist/{types/commands/index.d.ts → commands/index.d.cts} +1 -0
- package/dist/commands/index.d.cts.map +1 -0
- package/dist/commands/index.d.mts +9 -0
- package/dist/commands/index.d.mts.map +1 -0
- package/dist/commands/index.mjs +13 -38
- package/dist/commands/index.mjs.map +1 -1
- package/dist/commands/manifest/implementation.cjs +64 -0
- package/dist/commands/manifest/implementation.cjs.map +1 -0
- package/dist/{types/commands/manifest/implementation.d.ts → commands/manifest/implementation.d.cts} +3 -1
- package/dist/commands/manifest/implementation.d.cts.map +1 -0
- package/dist/commands/manifest/implementation.d.mts +14 -0
- package/dist/commands/manifest/implementation.d.mts.map +1 -0
- package/dist/commands/manifest/implementation.mjs +60 -16
- package/dist/commands/manifest/implementation.mjs.map +1 -1
- package/dist/commands/manifest/index.cjs +35 -0
- package/dist/commands/manifest/index.cjs.map +1 -0
- package/dist/commands/manifest/index.d.cts +11 -0
- package/dist/commands/manifest/index.d.cts.map +1 -0
- package/dist/commands/manifest/index.d.mts +11 -0
- package/dist/commands/manifest/index.d.mts.map +1 -0
- package/dist/commands/manifest/index.mjs +14 -20
- package/dist/commands/manifest/index.mjs.map +1 -1
- package/dist/commands/manifest/manifest.cjs +57 -0
- package/dist/commands/manifest/manifest.cjs.map +1 -0
- package/dist/{types/commands/manifest/manifest.d.ts → commands/manifest/manifest.d.cts} +2 -1
- package/dist/commands/manifest/manifest.d.cts.map +1 -0
- package/dist/commands/manifest/manifest.d.mts +15 -0
- package/dist/commands/manifest/manifest.d.mts.map +1 -0
- package/dist/commands/manifest/manifest.mjs +52 -17
- package/dist/commands/manifest/manifest.mjs.map +1 -1
- package/dist/commands/serve/index.cjs +19 -0
- package/dist/commands/serve/index.cjs.map +1 -0
- package/dist/{types/commands/serve/index.d.ts → commands/serve/index.d.cts} +3 -2
- package/dist/commands/serve/index.d.cts.map +1 -0
- package/dist/{types/commands/build/index.d.ts → commands/serve/index.d.mts} +3 -3
- package/dist/commands/serve/index.d.mts.map +1 -0
- package/dist/commands/serve/index.mjs +12 -27
- package/dist/commands/serve/index.mjs.map +1 -1
- package/dist/commands/serve/serve.cjs +21 -0
- package/dist/commands/serve/serve.cjs.map +1 -0
- package/dist/{types/commands/serve/serve.d.ts → commands/serve/serve.d.cts} +2 -1
- package/dist/commands/serve/serve.d.cts.map +1 -0
- package/dist/commands/serve/serve.d.mts +17 -0
- package/dist/commands/serve/serve.d.mts.map +1 -0
- package/dist/commands/serve/serve.mjs +16 -27
- package/dist/commands/serve/serve.mjs.map +1 -1
- package/dist/commands/watch/implementation.cjs +38 -0
- package/dist/{chunk-BAEGXYL7.mjs.map → commands/watch/implementation.cjs.map} +1 -1
- package/dist/{types/commands/watch/implementation.d.ts → commands/watch/implementation.d.cts} +4 -3
- package/dist/commands/watch/implementation.d.cts.map +1 -0
- package/dist/commands/watch/implementation.d.mts +15 -0
- package/dist/commands/watch/implementation.d.mts.map +1 -0
- package/dist/commands/watch/implementation.mjs +33 -27
- package/dist/commands/watch/implementation.mjs.map +1 -1
- package/dist/commands/watch/index.cjs +49 -0
- package/dist/commands/watch/index.cjs.map +1 -0
- package/dist/commands/watch/index.d.cts +11 -0
- package/dist/commands/watch/index.d.cts.map +1 -0
- package/dist/commands/watch/index.d.mts +11 -0
- package/dist/commands/watch/index.d.mts.map +1 -0
- package/dist/commands/watch/index.mjs +28 -31
- package/dist/commands/watch/index.mjs.map +1 -1
- package/dist/commands/watch/watch.cjs +49 -0
- package/dist/commands/watch/watch.cjs.map +1 -0
- package/dist/{types/commands/watch/watch.d.ts → commands/watch/watch.d.cts} +2 -1
- package/dist/commands/watch/watch.d.cts.map +1 -0
- package/dist/commands/watch/watch.d.mts +20 -0
- package/dist/commands/watch/watch.d.mts.map +1 -0
- package/dist/commands/watch/watch.mjs +44 -28
- package/dist/commands/watch/watch.mjs.map +1 -1
- package/dist/config.cjs +334 -0
- package/dist/config.cjs.map +1 -0
- package/dist/{types/config.d.ts → config.d.cts} +44 -43
- package/dist/config.d.cts.map +1 -0
- package/dist/config.d.mts +821 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +322 -35
- package/dist/config.mjs.map +1 -1
- package/dist/errors.cjs +38 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/{types/errors.d.ts → errors.d.cts} +1 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.mts +26 -0
- package/dist/errors.d.mts.map +1 -0
- package/dist/errors.mjs +32 -11
- package/dist/errors.mjs.map +1 -1
- package/dist/index.cjs +39 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +4 -44
- package/dist/index.mjs.map +1 -1
- package/dist/main.cjs +24 -0
- package/dist/main.cjs.map +1 -0
- package/dist/main.d.cts +3 -0
- package/dist/main.d.cts.map +1 -0
- package/dist/main.d.mts +3 -0
- package/dist/main.d.mts.map +1 -0
- package/dist/main.mjs +15 -45
- package/dist/main.mjs.map +1 -1
- package/dist/structs.cjs +31 -0
- package/dist/structs.cjs.map +1 -0
- package/dist/{types/structs.d.ts → structs.d.cts} +1 -0
- package/dist/structs.d.cts.map +1 -0
- package/dist/structs.d.mts +21 -0
- package/dist/structs.d.mts.map +1 -0
- package/dist/structs.mjs +26 -7
- package/dist/structs.mjs.map +1 -1
- package/dist/utils/cli.cjs +52 -0
- package/dist/utils/cli.cjs.map +1 -0
- package/dist/{types/utils/cli.d.ts → utils/cli.d.cts} +1 -0
- package/dist/utils/cli.d.cts.map +1 -0
- package/dist/utils/cli.d.mts +18 -0
- package/dist/utils/cli.d.mts.map +1 -0
- package/dist/utils/cli.mjs +43 -13
- package/dist/utils/cli.mjs.map +1 -1
- package/dist/utils/errors.cjs +49 -0
- package/dist/utils/errors.cjs.map +1 -0
- package/dist/{types/utils/errors.d.ts → utils/errors.d.cts} +1 -0
- package/dist/utils/errors.d.cts.map +1 -0
- package/dist/utils/errors.d.mts +24 -0
- package/dist/utils/errors.d.mts.map +1 -0
- package/dist/utils/errors.mjs +43 -10
- package/dist/utils/errors.mjs.map +1 -1
- package/dist/utils/index.cjs +23 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +7 -0
- package/dist/utils/index.d.cts.map +1 -0
- package/dist/utils/index.d.mts +7 -0
- package/dist/utils/index.d.mts.map +1 -0
- package/dist/utils/index.mjs +6 -46
- package/dist/utils/index.mjs.map +1 -1
- package/dist/utils/legacy.cjs +53 -0
- package/dist/utils/legacy.cjs.map +1 -0
- package/dist/{types/utils/legacy.d.ts → utils/legacy.d.cts} +2 -1
- package/dist/utils/legacy.d.cts.map +1 -0
- package/dist/utils/legacy.d.mts +28 -0
- package/dist/utils/legacy.d.mts.map +1 -0
- package/dist/utils/legacy.mjs +46 -12
- package/dist/utils/legacy.mjs.map +1 -1
- package/dist/utils/logging.cjs +48 -0
- package/dist/utils/logging.cjs.map +1 -0
- package/dist/{types/utils/logging.d.ts → utils/logging.d.cts} +2 -1
- package/dist/utils/logging.d.cts.map +1 -0
- package/dist/utils/logging.d.mts +23 -0
- package/dist/utils/logging.d.mts.map +1 -0
- package/dist/utils/logging.mjs +42 -11
- package/dist/utils/logging.mjs.map +1 -1
- package/dist/utils/path.cjs +17 -0
- package/dist/utils/path.cjs.map +1 -0
- package/dist/{types/utils/path.d.ts → utils/path.d.cts} +1 -0
- package/dist/utils/path.d.cts.map +1 -0
- package/dist/utils/path.d.mts +10 -0
- package/dist/utils/path.d.mts.map +1 -0
- package/dist/utils/path.mjs +12 -7
- package/dist/utils/path.mjs.map +1 -1
- package/dist/utils/steps.cjs +51 -0
- package/dist/utils/steps.cjs.map +1 -0
- package/dist/{types/utils/steps.d.ts → utils/steps.d.cts} +2 -1
- package/dist/utils/steps.d.cts.map +1 -0
- package/dist/utils/steps.d.mts +18 -0
- package/dist/utils/steps.d.mts.map +1 -0
- package/dist/utils/steps.mjs +51 -10
- package/dist/utils/steps.mjs.map +1 -1
- package/dist/webpack/compiler.cjs +19 -0
- package/dist/webpack/compiler.cjs.map +1 -0
- package/dist/{types/webpack/compiler.d.ts → webpack/compiler.d.cts} +3 -2
- package/dist/webpack/compiler.d.cts.map +1 -0
- package/dist/webpack/compiler.d.mts +11 -0
- package/dist/webpack/compiler.d.mts.map +1 -0
- package/dist/webpack/compiler.mjs +15 -24
- package/dist/webpack/compiler.mjs.map +1 -1
- package/dist/webpack/config.cjs +349 -0
- package/dist/webpack/config.cjs.map +1 -0
- package/dist/{types/webpack/config.d.ts → webpack/config.d.cts} +4 -3
- package/dist/webpack/config.d.cts.map +1 -0
- package/dist/webpack/config.d.mts +38 -0
- package/dist/webpack/config.d.mts.map +1 -0
- package/dist/webpack/config.mjs +349 -23
- package/dist/webpack/config.mjs.map +1 -1
- package/dist/webpack/index.cjs +21 -0
- package/dist/webpack/index.cjs.map +1 -0
- package/dist/webpack/index.d.cts +5 -0
- package/dist/webpack/index.d.cts.map +1 -0
- package/dist/webpack/index.d.mts +5 -0
- package/dist/webpack/index.d.mts.map +1 -0
- package/dist/webpack/index.mjs +4 -43
- package/dist/webpack/index.mjs.map +1 -1
- package/dist/webpack/loaders/browserify.cjs +84 -0
- package/dist/webpack/loaders/browserify.cjs.map +1 -0
- package/dist/{types/webpack/loaders/browserify.d.ts → webpack/loaders/browserify.d.cts} +4 -2
- package/dist/webpack/loaders/browserify.d.cts.map +1 -0
- package/dist/webpack/loaders/browserify.d.mts +18 -0
- package/dist/webpack/loaders/browserify.d.mts.map +1 -0
- package/dist/webpack/loaders/browserify.mjs +84 -17
- package/dist/webpack/loaders/browserify.mjs.map +1 -1
- package/dist/webpack/loaders/function.cjs +45 -0
- package/dist/webpack/loaders/function.cjs.map +1 -0
- package/dist/{types/webpack/loaders/function.d.ts → webpack/loaders/function.d.cts} +2 -1
- package/dist/webpack/loaders/function.d.cts.map +1 -0
- package/dist/webpack/loaders/function.d.mts +35 -0
- package/dist/webpack/loaders/function.d.mts.map +1 -0
- package/dist/webpack/loaders/function.mjs +39 -8
- package/dist/webpack/loaders/function.mjs.map +1 -1
- package/dist/webpack/loaders/index.cjs +26 -0
- package/dist/webpack/loaders/index.cjs.map +1 -0
- package/dist/webpack/loaders/index.d.cts +4 -0
- package/dist/webpack/loaders/index.d.cts.map +1 -0
- package/dist/webpack/loaders/index.d.mts +4 -0
- package/dist/webpack/loaders/index.d.mts.map +1 -0
- package/dist/webpack/loaders/index.mjs +3 -24
- package/dist/webpack/loaders/index.mjs.map +1 -1
- package/dist/webpack/loaders/wasm.cjs +103 -0
- package/dist/webpack/loaders/wasm.cjs.map +1 -0
- package/dist/{types/webpack/loaders/wasm.d.ts → webpack/loaders/wasm.d.cts} +2 -1
- package/dist/webpack/loaders/wasm.d.cts.map +1 -0
- package/dist/webpack/loaders/wasm.d.mts +43 -0
- package/dist/webpack/loaders/wasm.d.mts.map +1 -0
- package/dist/webpack/loaders/wasm.mjs +95 -14
- package/dist/webpack/loaders/wasm.mjs.map +1 -1
- package/dist/webpack/plugins.cjs +277 -0
- package/dist/webpack/plugins.cjs.map +1 -0
- package/dist/{types/webpack/plugins.d.ts → webpack/plugins.d.cts} +3 -2
- package/dist/webpack/plugins.d.cts.map +1 -0
- package/dist/webpack/plugins.d.mts +148 -0
- package/dist/webpack/plugins.d.mts.map +1 -0
- package/dist/webpack/plugins.mjs +270 -27
- package/dist/webpack/plugins.mjs.map +1 -1
- package/dist/webpack/server.cjs +144 -0
- package/dist/webpack/server.cjs.map +1 -0
- package/dist/{types/webpack/server.d.ts → webpack/server.d.cts} +5 -3
- package/dist/webpack/server.d.cts.map +1 -0
- package/dist/webpack/server.d.mts +32 -0
- package/dist/webpack/server.d.mts.map +1 -0
- package/dist/webpack/server.mjs +142 -9
- package/dist/webpack/server.mjs.map +1 -1
- package/dist/webpack/utils.cjs +359 -0
- package/dist/webpack/utils.cjs.map +1 -0
- package/dist/{types/webpack/utils.d.ts → webpack/utils.d.cts} +4 -3
- package/dist/webpack/utils.d.cts.map +1 -0
- package/dist/webpack/utils.d.mts +259 -0
- package/dist/webpack/utils.d.mts.map +1 -0
- package/dist/webpack/utils.mjs +350 -37
- package/dist/webpack/utils.mjs.map +1 -1
- package/package.json +22 -22
- package/dist/builders.js +0 -10
- package/dist/builders.js.map +0 -1
- package/dist/chunk-24QJ2ZUZ.mjs +0 -55
- package/dist/chunk-24QJ2ZUZ.mjs.map +0 -1
- package/dist/chunk-2P3D6FNV.mjs +0 -23
- package/dist/chunk-2P3D6FNV.mjs.map +0 -1
- package/dist/chunk-2ZBAKBVW.js +0 -28
- package/dist/chunk-2ZBAKBVW.js.map +0 -1
- package/dist/chunk-3WWFQLH4.mjs +0 -30
- package/dist/chunk-3WWFQLH4.mjs.map +0 -1
- package/dist/chunk-45LOTCC4.mjs +0 -1
- package/dist/chunk-45LOTCC4.mjs.map +0 -1
- package/dist/chunk-4A5QZUC7.mjs +0 -68
- package/dist/chunk-4A5QZUC7.mjs.map +0 -1
- package/dist/chunk-4JEJ7WKR.js +0 -61
- package/dist/chunk-4JEJ7WKR.js.map +0 -1
- package/dist/chunk-4QUVE3EK.js +0 -53
- package/dist/chunk-4QUVE3EK.js.map +0 -1
- package/dist/chunk-5IN3GGMV.js +0 -68
- package/dist/chunk-5IN3GGMV.js.map +0 -1
- package/dist/chunk-6ABGZTV7.mjs +0 -16
- package/dist/chunk-6ABGZTV7.mjs.map +0 -1
- package/dist/chunk-6EEZHGF5.js +0 -23
- package/dist/chunk-6EEZHGF5.js.map +0 -1
- package/dist/chunk-7H5FH7RY.js +0 -22
- package/dist/chunk-7H5FH7RY.js.map +0 -1
- package/dist/chunk-7RHK2YTB.mjs +0 -32
- package/dist/chunk-7RHK2YTB.mjs.map +0 -1
- package/dist/chunk-AQSQ7YYP.mjs +0 -24
- package/dist/chunk-AQSQ7YYP.mjs.map +0 -1
- package/dist/chunk-AZMQTZXZ.mjs +0 -28
- package/dist/chunk-AZMQTZXZ.mjs.map +0 -1
- package/dist/chunk-B3NNVTA6.js +0 -32
- package/dist/chunk-B3NNVTA6.js.map +0 -1
- package/dist/chunk-BAEGXYL7.mjs +0 -35
- package/dist/chunk-BALQOCUO.js +0 -22
- package/dist/chunk-BALQOCUO.js.map +0 -1
- package/dist/chunk-BYNQODL3.mjs +0 -23
- package/dist/chunk-BYNQODL3.mjs.map +0 -1
- package/dist/chunk-C44RRX3H.js +0 -18
- package/dist/chunk-C44RRX3H.js.map +0 -1
- package/dist/chunk-C46KEPAC.js +0 -37
- package/dist/chunk-C46KEPAC.js.map +0 -1
- package/dist/chunk-CB77QR32.js +0 -52
- package/dist/chunk-CB77QR32.js.map +0 -1
- package/dist/chunk-CZRGAFVI.mjs +0 -28
- package/dist/chunk-CZRGAFVI.mjs.map +0 -1
- package/dist/chunk-D2ZIM5W2.js +0 -370
- package/dist/chunk-D2ZIM5W2.js.map +0 -1
- package/dist/chunk-DBLADLQ4.js +0 -10
- package/dist/chunk-DBLADLQ4.js.map +0 -1
- package/dist/chunk-ERSRIVYH.mjs +0 -64
- package/dist/chunk-ERSRIVYH.mjs.map +0 -1
- package/dist/chunk-G62Q4YO5.js +0 -30
- package/dist/chunk-G62Q4YO5.js.map +0 -1
- package/dist/chunk-HAYK73YO.js +0 -23
- package/dist/chunk-HAYK73YO.js.map +0 -1
- package/dist/chunk-HLQEI6DV.js +0 -54
- package/dist/chunk-HLQEI6DV.js.map +0 -1
- package/dist/chunk-HLSCFGA7.mjs +0 -13
- package/dist/chunk-HLSCFGA7.mjs.map +0 -1
- package/dist/chunk-HOVEQTF3.mjs +0 -346
- package/dist/chunk-HOVEQTF3.mjs.map +0 -1
- package/dist/chunk-JAHNVVLT.mjs +0 -18
- package/dist/chunk-JAHNVVLT.mjs.map +0 -1
- package/dist/chunk-JCVSYVPD.mjs +0 -24
- package/dist/chunk-JCVSYVPD.mjs.map +0 -1
- package/dist/chunk-JL3URCHO.mjs +0 -53
- package/dist/chunk-JL3URCHO.mjs.map +0 -1
- package/dist/chunk-K26BOY6Z.mjs +0 -51
- package/dist/chunk-K26BOY6Z.mjs.map +0 -1
- package/dist/chunk-KLOPX6DO.js +0 -51
- package/dist/chunk-KLOPX6DO.js.map +0 -1
- package/dist/chunk-KWHAT6UJ.mjs +0 -22
- package/dist/chunk-KWHAT6UJ.mjs.map +0 -1
- package/dist/chunk-L72RLBV5.mjs +0 -37
- package/dist/chunk-L72RLBV5.mjs.map +0 -1
- package/dist/chunk-MECBOP7G.js +0 -35
- package/dist/chunk-MECBOP7G.js.map +0 -1
- package/dist/chunk-MR44GPM3.mjs +0 -135
- package/dist/chunk-MR44GPM3.mjs.map +0 -1
- package/dist/chunk-MR5TAGOG.mjs +0 -54
- package/dist/chunk-MR5TAGOG.mjs.map +0 -1
- package/dist/chunk-MUYXNION.js +0 -30
- package/dist/chunk-MUYXNION.js.map +0 -1
- package/dist/chunk-MXOKUCLH.js +0 -347
- package/dist/chunk-MXOKUCLH.js.map +0 -1
- package/dist/chunk-NGS23BTR.js +0 -13
- package/dist/chunk-NGS23BTR.js.map +0 -1
- package/dist/chunk-NOBUMOYX.mjs +0 -61
- package/dist/chunk-NOBUMOYX.mjs.map +0 -1
- package/dist/chunk-NR4OJOGX.mjs +0 -370
- package/dist/chunk-NR4OJOGX.mjs.map +0 -1
- package/dist/chunk-OIFTFHZ4.mjs +0 -30
- package/dist/chunk-OIFTFHZ4.mjs.map +0 -1
- package/dist/chunk-PDYQXXLP.js +0 -30
- package/dist/chunk-PDYQXXLP.js.map +0 -1
- package/dist/chunk-QAM2JJRA.mjs +0 -52
- package/dist/chunk-QAM2JJRA.mjs.map +0 -1
- package/dist/chunk-QHCKVO3P.js +0 -28
- package/dist/chunk-QHCKVO3P.js.map +0 -1
- package/dist/chunk-QMB2ZRWW.js +0 -16
- package/dist/chunk-QMB2ZRWW.js.map +0 -1
- package/dist/chunk-QMD3VO6R.mjs +0 -30
- package/dist/chunk-QMD3VO6R.mjs.map +0 -1
- package/dist/chunk-QRW2GKA3.mjs +0 -347
- package/dist/chunk-QRW2GKA3.mjs.map +0 -1
- package/dist/chunk-R77RJHC5.mjs +0 -44
- package/dist/chunk-R77RJHC5.mjs.map +0 -1
- package/dist/chunk-RANTKN66.js +0 -24
- package/dist/chunk-RANTKN66.js.map +0 -1
- package/dist/chunk-S7UP2YYF.js +0 -135
- package/dist/chunk-S7UP2YYF.js.map +0 -1
- package/dist/chunk-SQXMNT7M.js +0 -326
- package/dist/chunk-SQXMNT7M.js.map +0 -1
- package/dist/chunk-SYRWT2KT.mjs +0 -124
- package/dist/chunk-SYRWT2KT.mjs.map +0 -1
- package/dist/chunk-TDSL55B3.mjs +0 -10
- package/dist/chunk-TDSL55B3.mjs.map +0 -1
- package/dist/chunk-TJ2F3J6X.js +0 -31
- package/dist/chunk-TJ2F3J6X.js.map +0 -1
- package/dist/chunk-U4VFMIGO.js +0 -24
- package/dist/chunk-U4VFMIGO.js.map +0 -1
- package/dist/chunk-V6SYDSWM.mjs +0 -326
- package/dist/chunk-V6SYDSWM.mjs.map +0 -1
- package/dist/chunk-VXOV3ZCB.js +0 -1
- package/dist/chunk-VXOV3ZCB.js.map +0 -1
- package/dist/chunk-X3D3MHWF.js +0 -44
- package/dist/chunk-X3D3MHWF.js.map +0 -1
- package/dist/chunk-X7TESUC7.mjs +0 -22
- package/dist/chunk-X7TESUC7.mjs.map +0 -1
- package/dist/chunk-XGWLFH7Y.js +0 -41
- package/dist/chunk-XGWLFH7Y.js.map +0 -1
- package/dist/chunk-YCOC4VEP.js +0 -346
- package/dist/chunk-YCOC4VEP.js.map +0 -1
- package/dist/chunk-YCYGKEXF.mjs +0 -41
- package/dist/chunk-YCYGKEXF.mjs.map +0 -1
- package/dist/chunk-YGEAZQSC.js +0 -124
- package/dist/chunk-YGEAZQSC.js.map +0 -1
- package/dist/chunk-YQ2E7NEA.js +0 -64
- package/dist/chunk-YQ2E7NEA.js.map +0 -1
- package/dist/chunk-ZAW4ZWQX.mjs +0 -31
- package/dist/chunk-ZAW4ZWQX.mjs.map +0 -1
- package/dist/chunk-ZVUF6JDJ.js +0 -55
- package/dist/chunk-ZVUF6JDJ.js.map +0 -1
- package/dist/cli.js +0 -21
- package/dist/cli.js.map +0 -1
- package/dist/commands/build/build.js +0 -29
- package/dist/commands/build/build.js.map +0 -1
- package/dist/commands/build/implementation.js +0 -28
- package/dist/commands/build/implementation.js.map +0 -1
- package/dist/commands/build/index.js +0 -33
- package/dist/commands/build/index.js.map +0 -1
- package/dist/commands/eval/eval.js +0 -18
- package/dist/commands/eval/eval.js.map +0 -1
- package/dist/commands/eval/implementation.js +0 -9
- package/dist/commands/eval/implementation.js.map +0 -1
- package/dist/commands/eval/index.js +0 -22
- package/dist/commands/eval/index.js.map +0 -1
- package/dist/commands/index.js +0 -39
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/manifest/implementation.js +0 -17
- package/dist/commands/manifest/implementation.js.map +0 -1
- package/dist/commands/manifest/index.js +0 -22
- package/dist/commands/manifest/index.js.map +0 -1
- package/dist/commands/manifest/manifest.js +0 -18
- package/dist/commands/manifest/manifest.js.map +0 -1
- package/dist/commands/serve/index.js +0 -29
- package/dist/commands/serve/index.js.map +0 -1
- package/dist/commands/serve/serve.js +0 -28
- package/dist/commands/serve/serve.js.map +0 -1
- package/dist/commands/watch/implementation.js +0 -28
- package/dist/commands/watch/implementation.js.map +0 -1
- package/dist/commands/watch/index.js +0 -33
- package/dist/commands/watch/index.js.map +0 -1
- package/dist/commands/watch/watch.js +0 -29
- package/dist/commands/watch/watch.js.map +0 -1
- package/dist/config.js +0 -36
- package/dist/config.js.map +0 -1
- package/dist/errors.js +0 -12
- package/dist/errors.js.map +0 -1
- package/dist/index.js +0 -45
- package/dist/index.js.map +0 -1
- package/dist/main.js +0 -49
- package/dist/main.js.map +0 -1
- package/dist/structs.js +0 -8
- package/dist/structs.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/__fixtures__/configs/cjs.d.ts +0 -1
- package/dist/types/__fixtures__/configs/esm.d.ts +0 -3
- package/dist/types/__fixtures__/configs/invalid.d.ts +0 -3
- package/dist/types/__fixtures__/configs/javascript/snap.config.d.ts +0 -0
- package/dist/types/__fixtures__/configs/typescript/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/browserify/bad/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/browserify/good/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/webpack/bad/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/webpack/good/snap.config.d.ts +0 -3
- package/dist/types/commands/eval/__test__/webpack/snap.config.d.ts +0 -3
- package/dist/types/commands/watch/index.d.ts +0 -10
- package/dist/types/index.d.ts +0 -5
- package/dist/types/main.d.ts +0 -2
- package/dist/types/utils/index.d.ts +0 -6
- package/dist/types/webpack/index.d.ts +0 -4
- package/dist/types/webpack/loaders/index.d.ts +0 -3
- package/dist/types/yargs.d.js +0 -1
- package/dist/types/yargs.d.js.map +0 -1
- package/dist/types/yargs.d.mjs +0 -1
- package/dist/types/yargs.d.mjs.map +0 -1
- package/dist/utils/cli.js +0 -14
- package/dist/utils/cli.js.map +0 -1
- package/dist/utils/errors.js +0 -11
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/index.js +0 -47
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/legacy.js +0 -13
- package/dist/utils/legacy.js.map +0 -1
- package/dist/utils/logging.js +0 -12
- package/dist/utils/logging.js.map +0 -1
- package/dist/utils/path.js +0 -8
- package/dist/utils/path.js.map +0 -1
- package/dist/utils/steps.js +0 -11
- package/dist/utils/steps.js.map +0 -1
- package/dist/webpack/compiler.js +0 -25
- package/dist/webpack/compiler.js.map +0 -1
- package/dist/webpack/config.js +0 -24
- package/dist/webpack/config.js.map +0 -1
- package/dist/webpack/index.js +0 -44
- package/dist/webpack/index.js.map +0 -1
- package/dist/webpack/loaders/browserify.js +0 -19
- package/dist/webpack/loaders/browserify.js.map +0 -1
- package/dist/webpack/loaders/function.js +0 -10
- package/dist/webpack/loaders/function.js.map +0 -1
- package/dist/webpack/loaders/index.js +0 -25
- package/dist/webpack/loaders/index.js.map +0 -1
- package/dist/webpack/loaders/wasm.js +0 -16
- package/dist/webpack/loaders/wasm.js.map +0 -1
- package/dist/webpack/plugins.js +0 -29
- package/dist/webpack/plugins.js.map +0 -1
- package/dist/webpack/server.js +0 -10
- package/dist/webpack/server.js.map +0 -1
- package/dist/webpack/utils.js +0 -39
- package/dist/webpack/utils.js.map +0 -1
package/dist/chunk-QMD3VO6R.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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-QMD3VO6R.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
package/dist/chunk-QRW2GKA3.mjs
DELETED
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SnapsBuiltInResolver,
|
|
3
|
-
SnapsBundleWarningsPlugin,
|
|
4
|
-
SnapsStatsPlugin,
|
|
5
|
-
SnapsWatchPlugin
|
|
6
|
-
} from "./chunk-HOVEQTF3.mjs";
|
|
7
|
-
import {
|
|
8
|
-
BROWSERSLIST_FILE,
|
|
9
|
-
getDefaultLoader,
|
|
10
|
-
getDevTool,
|
|
11
|
-
getEnvironmentVariables,
|
|
12
|
-
getFallbacks,
|
|
13
|
-
getImageSVG,
|
|
14
|
-
getProgressHandler
|
|
15
|
-
} from "./chunk-V6SYDSWM.mjs";
|
|
16
|
-
import {
|
|
17
|
-
getFunctionLoader
|
|
18
|
-
} from "./chunk-AZMQTZXZ.mjs";
|
|
19
|
-
import {
|
|
20
|
-
wasm_default
|
|
21
|
-
} from "./chunk-ERSRIVYH.mjs";
|
|
22
|
-
|
|
23
|
-
// src/webpack/config.ts
|
|
24
|
-
import SnapsWebpackPlugin from "@metamask/snaps-webpack-plugin";
|
|
25
|
-
import { resolve } from "path";
|
|
26
|
-
import TerserPlugin from "terser-webpack-plugin";
|
|
27
|
-
import { DefinePlugin, ProgressPlugin, ProvidePlugin } from "webpack";
|
|
28
|
-
async function getDefaultConfiguration(config, options = {
|
|
29
|
-
evaluate: config.evaluate
|
|
30
|
-
}) {
|
|
31
|
-
const spinnerText = options.spinner?.text;
|
|
32
|
-
const builtInResolver = config.stats.builtIns && new SnapsBuiltInResolver(config.stats.builtIns, options.spinner);
|
|
33
|
-
return {
|
|
34
|
-
/**
|
|
35
|
-
* The target is set to `browserslist` so that Webpack will compile the
|
|
36
|
-
* bundle to support the browsers specified in the `.browserslistrc` file.
|
|
37
|
-
* This Browserslist file contains the browsers that are supported by
|
|
38
|
-
* MetaMask Snaps.
|
|
39
|
-
*
|
|
40
|
-
* @see https://webpack.js.org/configuration/target/
|
|
41
|
-
*/
|
|
42
|
-
target: `browserslist:${BROWSERSLIST_FILE}`,
|
|
43
|
-
/**
|
|
44
|
-
* The mode is set to `production` by default, so that Webpack will minify
|
|
45
|
-
* and optimize the bundle.
|
|
46
|
-
*
|
|
47
|
-
* @see https://webpack.js.org/configuration/mode/
|
|
48
|
-
*/
|
|
49
|
-
mode: "production",
|
|
50
|
-
/**
|
|
51
|
-
* The entry point is set to the `input` value from the config object.
|
|
52
|
-
*
|
|
53
|
-
* @see https://webpack.js.org/configuration/entry-context/
|
|
54
|
-
*/
|
|
55
|
-
entry: config.input,
|
|
56
|
-
/**
|
|
57
|
-
* The devtool option controls how source maps are generated. We set it to
|
|
58
|
-
* the `sourceMap` value from the config object.
|
|
59
|
-
*
|
|
60
|
-
* @see https://webpack.js.org/configuration/devtool/
|
|
61
|
-
*/
|
|
62
|
-
devtool: getDevTool(config.sourceMap),
|
|
63
|
-
/**
|
|
64
|
-
* The stats option controls how much information is printed to the console
|
|
65
|
-
* when Webpack is running. We set it to `none` so that we can control the
|
|
66
|
-
* output ourselves.
|
|
67
|
-
*
|
|
68
|
-
* @see https://webpack.js.org/configuration/stats/
|
|
69
|
-
*/
|
|
70
|
-
stats: "none",
|
|
71
|
-
/**
|
|
72
|
-
* The output options.
|
|
73
|
-
*
|
|
74
|
-
* @see https://webpack.js.org/configuration/output/
|
|
75
|
-
*/
|
|
76
|
-
output: {
|
|
77
|
-
/**
|
|
78
|
-
* This indicates whether Webpack should clear the output directory
|
|
79
|
-
* before building. We set it to the `clean` value from the config
|
|
80
|
-
* object.
|
|
81
|
-
*
|
|
82
|
-
* @see https://webpack.js.org/configuration/output/#outputclean
|
|
83
|
-
*/
|
|
84
|
-
clean: config.output.clean,
|
|
85
|
-
/**
|
|
86
|
-
* The filename of the bundle. We set it to the `filename` value from
|
|
87
|
-
* the config object.
|
|
88
|
-
*
|
|
89
|
-
* @see https://webpack.js.org/configuration/output/#outputfilename
|
|
90
|
-
*/
|
|
91
|
-
filename: config.output.filename,
|
|
92
|
-
/**
|
|
93
|
-
* The path to the output directory. We set it to the `path` value from
|
|
94
|
-
* the config object.
|
|
95
|
-
*
|
|
96
|
-
* @see https://webpack.js.org/configuration/output/#outputpath
|
|
97
|
-
*/
|
|
98
|
-
path: config.output.path,
|
|
99
|
-
/**
|
|
100
|
-
* The public path of the bundle. We set it to `/` by default, so that
|
|
101
|
-
* the bundle can be loaded from the root of the server.
|
|
102
|
-
*
|
|
103
|
-
* @see https://webpack.js.org/configuration/output/#outputpublicpath
|
|
104
|
-
*/
|
|
105
|
-
publicPath: "/",
|
|
106
|
-
/**
|
|
107
|
-
* The library configuration. This tells Webpack how to export the
|
|
108
|
-
* bundle.
|
|
109
|
-
*
|
|
110
|
-
* @see https://webpack.js.org/configuration/output/#outputlibrary
|
|
111
|
-
*/
|
|
112
|
-
library: {
|
|
113
|
-
/**
|
|
114
|
-
* This tells Webpack to export the bundle as a CommonJS module. This
|
|
115
|
-
* is necessary for MetaMask Snaps.
|
|
116
|
-
*
|
|
117
|
-
* @see https://webpack.js.org/configuration/output/#outputlibrarytarget
|
|
118
|
-
*/
|
|
119
|
-
type: "commonjs"
|
|
120
|
-
},
|
|
121
|
-
/**
|
|
122
|
-
* The chunk format. This tells Webpack how to export chunks. This is
|
|
123
|
-
* required because we use browserslist to target browsers, but Snaps are
|
|
124
|
-
* not fully compatible with browser APIs (such as `window` and
|
|
125
|
-
* `document`).
|
|
126
|
-
*
|
|
127
|
-
* @see https://webpack.js.org/configuration/output/#outputchunkformat
|
|
128
|
-
*/
|
|
129
|
-
chunkFormat: "commonjs"
|
|
130
|
-
},
|
|
131
|
-
/**
|
|
132
|
-
* The module configuration. This is where we tell Webpack how to handle
|
|
133
|
-
* different types of files.
|
|
134
|
-
*
|
|
135
|
-
* @see https://webpack.js.org/configuration/module/
|
|
136
|
-
*/
|
|
137
|
-
module: {
|
|
138
|
-
rules: [
|
|
139
|
-
{
|
|
140
|
-
test: /\.(js|jsx|mjs|cjs|ts|tsx)$/u,
|
|
141
|
-
exclude: /node_modules/u,
|
|
142
|
-
use: await getDefaultLoader(config)
|
|
143
|
-
},
|
|
144
|
-
/**
|
|
145
|
-
* This allows importing modules that uses `.js` and not `.mjs` for the
|
|
146
|
-
* ES build.
|
|
147
|
-
*
|
|
148
|
-
* @see https://webpack.js.org/configuration/module/#resolvefullyspecified
|
|
149
|
-
*/
|
|
150
|
-
{
|
|
151
|
-
test: /\.m?js$/u,
|
|
152
|
-
resolve: {
|
|
153
|
-
fullySpecified: false
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
/**
|
|
157
|
-
* This allows importing `.svg` files as a string.
|
|
158
|
-
*/
|
|
159
|
-
config.features.images && {
|
|
160
|
-
test: /\.svg$/u,
|
|
161
|
-
// `asset/source` returns the source as a UTF-8 string.
|
|
162
|
-
type: "asset/source"
|
|
163
|
-
},
|
|
164
|
-
/**
|
|
165
|
-
* This allows importing `.png` files as a data URL.
|
|
166
|
-
*/
|
|
167
|
-
config.features.images && {
|
|
168
|
-
test: /\.png$/u,
|
|
169
|
-
type: "asset/inline",
|
|
170
|
-
generator: {
|
|
171
|
-
dataUrl: getImageSVG.bind(null, "image/png")
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
/**
|
|
175
|
-
* This allows importing `.jpe?g` files as a data URL.
|
|
176
|
-
*/
|
|
177
|
-
config.features.images && {
|
|
178
|
-
test: /\.jpe?g$/u,
|
|
179
|
-
type: "asset/inline",
|
|
180
|
-
generator: {
|
|
181
|
-
dataUrl: getImageSVG.bind(null, "image/jpeg")
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
config.experimental.wasm && {
|
|
185
|
-
test: /\.wasm$/u,
|
|
186
|
-
use: getFunctionLoader(wasm_default, {})
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
},
|
|
190
|
-
/**
|
|
191
|
-
* The resolve configuration. This tells Webpack how to resolve imports.
|
|
192
|
-
* We set it to resolve `.js` and `.ts` files.
|
|
193
|
-
*
|
|
194
|
-
* @see https://webpack.js.org/configuration/resolve/
|
|
195
|
-
*/
|
|
196
|
-
resolve: {
|
|
197
|
-
/**
|
|
198
|
-
* The extensions to resolve. We set it to resolve `.(c|m)?jsx?` and
|
|
199
|
-
* `.tsx?` files.
|
|
200
|
-
*/
|
|
201
|
-
extensions: [".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx"],
|
|
202
|
-
/**
|
|
203
|
-
* The fallback options. This tells Webpack how to handle imports that
|
|
204
|
-
* aren't resolved. By default, we set Node.js built-ins to `false`, so
|
|
205
|
-
* that they are ignored.
|
|
206
|
-
*/
|
|
207
|
-
fallback: getFallbacks(config.polyfills),
|
|
208
|
-
/**
|
|
209
|
-
* The plugins to use. We use the {@link SnapsBuiltInResolver} to show
|
|
210
|
-
* warnings about using Node.js built-ins, when no fallback is specified.
|
|
211
|
-
*/
|
|
212
|
-
plugins: [builtInResolver]
|
|
213
|
-
},
|
|
214
|
-
/**
|
|
215
|
-
* The plugins to use.
|
|
216
|
-
*
|
|
217
|
-
* @see https://webpack.js.org/configuration/plugins/
|
|
218
|
-
*/
|
|
219
|
-
plugins: [
|
|
220
|
-
/**
|
|
221
|
-
* The `SnapsWebpackPlugin` is a Webpack plugin that checks and updates
|
|
222
|
-
* the manifest file, and evaluates the bundle in SES. While not strictly
|
|
223
|
-
* required, it's highly recommended to use this plugin.
|
|
224
|
-
*/
|
|
225
|
-
new SnapsWebpackPlugin({
|
|
226
|
-
manifestPath: config.manifest.path,
|
|
227
|
-
writeManifest: config.manifest.update,
|
|
228
|
-
eval: !options.watch && options.evaluate
|
|
229
|
-
}),
|
|
230
|
-
/**
|
|
231
|
-
* The `SnapsStatsPlugin` is a Webpack plugin that handles the stats
|
|
232
|
-
* output. It's used to show the stats in the terminal, in a format that
|
|
233
|
-
* is easy to read.
|
|
234
|
-
*/
|
|
235
|
-
new SnapsStatsPlugin({ verbose: config.stats.verbose }, options.spinner),
|
|
236
|
-
/**
|
|
237
|
-
* The `DefinePlugin` is a Webpack plugin that adds static values to the
|
|
238
|
-
* bundle. We use it to add the `NODE_DEBUG`, `NODE_ENV`, and `DEBUG`
|
|
239
|
-
* environment variables, as well as any custom environment
|
|
240
|
-
* variables (as `process.env`).
|
|
241
|
-
*/
|
|
242
|
-
new DefinePlugin(getEnvironmentVariables(config.environment)),
|
|
243
|
-
/**
|
|
244
|
-
* The `ProgressPlugin` is a Webpack plugin that logs the progress of
|
|
245
|
-
* the build. We set it to log the progress to the spinner.
|
|
246
|
-
*/
|
|
247
|
-
new ProgressPlugin({
|
|
248
|
-
handler: getProgressHandler(options.spinner, spinnerText)
|
|
249
|
-
}),
|
|
250
|
-
/**
|
|
251
|
-
* The `SnapsBundleWarningPlugin` is a Webpack plugin that shows a
|
|
252
|
-
* warning when the bundle is potentially incompatible with MetaMask
|
|
253
|
-
* Snaps.
|
|
254
|
-
*/
|
|
255
|
-
new SnapsBundleWarningsPlugin({
|
|
256
|
-
builtInResolver,
|
|
257
|
-
builtIns: Boolean(config.stats.builtIns),
|
|
258
|
-
buffer: config.stats.buffer
|
|
259
|
-
}),
|
|
260
|
-
/**
|
|
261
|
-
* The `WatchPlugin` is a Webpack plugin that adds extra files to watch
|
|
262
|
-
* for changes. This is useful for rebuilding the bundle when the
|
|
263
|
-
* manifest file changes.
|
|
264
|
-
*/
|
|
265
|
-
options.watch && new SnapsWatchPlugin(
|
|
266
|
-
{
|
|
267
|
-
bundle: resolve(config.output.path, config.output.filename),
|
|
268
|
-
evaluate: options.evaluate,
|
|
269
|
-
files: [config.manifest.path]
|
|
270
|
-
},
|
|
271
|
-
options.spinner
|
|
272
|
-
),
|
|
273
|
-
/**
|
|
274
|
-
* The `ProviderPlugin` is a Webpack plugin that automatically load
|
|
275
|
-
* modules instead of having to import or require them everywhere.
|
|
276
|
-
*/
|
|
277
|
-
(config.polyfills === true || config.polyfills !== false && config.polyfills.buffer) && new ProvidePlugin({
|
|
278
|
-
Buffer: ["buffer", "Buffer"]
|
|
279
|
-
})
|
|
280
|
-
].filter(Boolean),
|
|
281
|
-
/**
|
|
282
|
-
* The optimization configuration. This tells Webpack how to optimize the
|
|
283
|
-
* bundle. Most of the time, you won't need to change this, as the default
|
|
284
|
-
* options set by the `mode` option are sufficient.
|
|
285
|
-
*/
|
|
286
|
-
optimization: {
|
|
287
|
-
minimize: config.output.minimize,
|
|
288
|
-
/**
|
|
289
|
-
* The minimizer to use. We set it to use the `TerserPlugin`.
|
|
290
|
-
*/
|
|
291
|
-
minimizer: [
|
|
292
|
-
new TerserPlugin({
|
|
293
|
-
parallel: true
|
|
294
|
-
})
|
|
295
|
-
]
|
|
296
|
-
},
|
|
297
|
-
/**
|
|
298
|
-
* The experiments configuration. This configures which Webpack
|
|
299
|
-
* experiments to enable/disable.
|
|
300
|
-
*
|
|
301
|
-
* @see https://webpack.js.org/configuration/experiments
|
|
302
|
-
*/
|
|
303
|
-
experiments: {
|
|
304
|
-
/**
|
|
305
|
-
* Experimental support for top level await.
|
|
306
|
-
*
|
|
307
|
-
* This is unsupported in Snaps and therefore disabled.
|
|
308
|
-
*
|
|
309
|
-
* @see https://webpack.js.org/configuration/experiments/#experimentstoplevelawait
|
|
310
|
-
*/
|
|
311
|
-
topLevelAwait: false
|
|
312
|
-
},
|
|
313
|
-
/**
|
|
314
|
-
* The performance configuration. This tells Webpack how to handle
|
|
315
|
-
* performance hints.
|
|
316
|
-
*
|
|
317
|
-
* @see https://webpack.js.org/configuration/performance/
|
|
318
|
-
*/
|
|
319
|
-
performance: {
|
|
320
|
-
/**
|
|
321
|
-
* The hints to show. We set it to `false`, so that we don't get
|
|
322
|
-
* performance hints, as they are not relevant for Snaps.
|
|
323
|
-
*
|
|
324
|
-
* @see https://webpack.js.org/configuration/performance/#performancehints
|
|
325
|
-
*/
|
|
326
|
-
hints: false
|
|
327
|
-
},
|
|
328
|
-
/**
|
|
329
|
-
* The infrastructure logging configuration. This tells Webpack how to
|
|
330
|
-
* log messages.
|
|
331
|
-
*
|
|
332
|
-
* @see https://webpack.js.org/configuration/infrastructure-logging
|
|
333
|
-
*/
|
|
334
|
-
infrastructureLogging: {
|
|
335
|
-
/**
|
|
336
|
-
* The level of logging to use. We set it to `none`, so that we can
|
|
337
|
-
* control the output ourselves.
|
|
338
|
-
*/
|
|
339
|
-
level: "none"
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
export {
|
|
345
|
-
getDefaultConfiguration
|
|
346
|
-
};
|
|
347
|
-
//# sourceMappingURL=chunk-QRW2GKA3.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/webpack/config.ts"],"sourcesContent":["import SnapsWebpackPlugin from '@metamask/snaps-webpack-plugin';\nimport type { Ora } from 'ora';\nimport { resolve } from 'path';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport type { Configuration } from 'webpack';\nimport { DefinePlugin, ProgressPlugin, ProvidePlugin } from 'webpack';\n\nimport type { ProcessedWebpackConfig } from '../config';\nimport { getFunctionLoader, wasm } from './loaders';\nimport {\n SnapsBuiltInResolver,\n SnapsBundleWarningsPlugin,\n SnapsStatsPlugin,\n SnapsWatchPlugin,\n} from './plugins';\nimport {\n BROWSERSLIST_FILE,\n getDefaultLoader,\n getDevTool,\n getEnvironmentVariables,\n getFallbacks,\n getImageSVG,\n getProgressHandler,\n} from './utils';\n\nexport type WebpackOptions = {\n /**\n * Whether to watch for changes.\n */\n watch?: boolean;\n\n /**\n * Whether to evaluate the bundle. If this is set, it will override the\n * `evaluate` option in the config object.\n */\n evaluate?: boolean;\n\n /**\n * The spinner to use for logging.\n */\n spinner?: Ora;\n};\n\n/**\n * Get the default Webpack configuration. This is the configuration that will\n * be used if the user doesn't provide a custom Webpack configuration. The\n * configuration is based on the snap config.\n *\n * The default configuration includes:\n *\n * - `SWC` to transpile TypeScript and JavaScript files.\n * - `TerserPlugin` to minify the bundle.\n * - `SnapsWebpackPlugin` to validate the bundle and update the manifest.\n *\n * It can be customized through the `customizeWebpackConfig` function in the\n * snap config, but in most cases, you shouldn't need to do that.\n *\n * @param config - The processed snap Webpack config.\n * @param options - The Webpack options.\n * @returns The default Webpack configuration.\n */\nexport async function getDefaultConfiguration(\n config: ProcessedWebpackConfig,\n options: WebpackOptions = {\n evaluate: config.evaluate,\n },\n): Promise<Configuration> {\n const spinnerText = options.spinner?.text;\n const builtInResolver =\n config.stats.builtIns &&\n new SnapsBuiltInResolver(config.stats.builtIns, options.spinner);\n\n return {\n /**\n * The target is set to `browserslist` so that Webpack will compile the\n * bundle to support the browsers specified in the `.browserslistrc` file.\n * This Browserslist file contains the browsers that are supported by\n * MetaMask Snaps.\n *\n * @see https://webpack.js.org/configuration/target/\n */\n target: `browserslist:${BROWSERSLIST_FILE}`,\n\n /**\n * The mode is set to `production` by default, so that Webpack will minify\n * and optimize the bundle.\n *\n * @see https://webpack.js.org/configuration/mode/\n */\n mode: 'production',\n\n /**\n * The entry point is set to the `input` value from the config object.\n *\n * @see https://webpack.js.org/configuration/entry-context/\n */\n entry: config.input,\n\n /**\n * The devtool option controls how source maps are generated. We set it to\n * the `sourceMap` value from the config object.\n *\n * @see https://webpack.js.org/configuration/devtool/\n */\n devtool: getDevTool(config.sourceMap),\n\n /**\n * The stats option controls how much information is printed to the console\n * when Webpack is running. We set it to `none` so that we can control the\n * output ourselves.\n *\n * @see https://webpack.js.org/configuration/stats/\n */\n stats: 'none',\n\n /**\n * The output options.\n *\n * @see https://webpack.js.org/configuration/output/\n */\n output: {\n /**\n * This indicates whether Webpack should clear the output directory\n * before building. We set it to the `clean` value from the config\n * object.\n *\n * @see https://webpack.js.org/configuration/output/#outputclean\n */\n clean: config.output.clean,\n\n /**\n * The filename of the bundle. We set it to the `filename` value from\n * the config object.\n *\n * @see https://webpack.js.org/configuration/output/#outputfilename\n */\n filename: config.output.filename,\n\n /**\n * The path to the output directory. We set it to the `path` value from\n * the config object.\n *\n * @see https://webpack.js.org/configuration/output/#outputpath\n */\n path: config.output.path,\n\n /**\n * The public path of the bundle. We set it to `/` by default, so that\n * the bundle can be loaded from the root of the server.\n *\n * @see https://webpack.js.org/configuration/output/#outputpublicpath\n */\n publicPath: '/',\n\n /**\n * The library configuration. This tells Webpack how to export the\n * bundle.\n *\n * @see https://webpack.js.org/configuration/output/#outputlibrary\n */\n library: {\n /**\n * This tells Webpack to export the bundle as a CommonJS module. This\n * is necessary for MetaMask Snaps.\n *\n * @see https://webpack.js.org/configuration/output/#outputlibrarytarget\n */\n type: 'commonjs',\n },\n\n /**\n * The chunk format. This tells Webpack how to export chunks. This is\n * required because we use browserslist to target browsers, but Snaps are\n * not fully compatible with browser APIs (such as `window` and\n * `document`).\n *\n * @see https://webpack.js.org/configuration/output/#outputchunkformat\n */\n chunkFormat: 'commonjs',\n },\n\n /**\n * The module configuration. This is where we tell Webpack how to handle\n * different types of files.\n *\n * @see https://webpack.js.org/configuration/module/\n */\n module: {\n rules: [\n {\n test: /\\.(js|jsx|mjs|cjs|ts|tsx)$/u,\n exclude: /node_modules/u,\n use: await getDefaultLoader(config),\n },\n\n /**\n * This allows importing modules that uses `.js` and not `.mjs` for the\n * ES build.\n *\n * @see https://webpack.js.org/configuration/module/#resolvefullyspecified\n */\n {\n test: /\\.m?js$/u,\n resolve: {\n fullySpecified: false,\n },\n },\n\n /**\n * This allows importing `.svg` files as a string.\n */\n config.features.images && {\n test: /\\.svg$/u,\n // `asset/source` returns the source as a UTF-8 string.\n type: 'asset/source',\n },\n\n /**\n * This allows importing `.png` files as a data URL.\n */\n config.features.images && {\n test: /\\.png$/u,\n type: 'asset/inline',\n generator: {\n dataUrl: getImageSVG.bind(null, 'image/png'),\n },\n },\n\n /**\n * This allows importing `.jpe?g` files as a data URL.\n */\n config.features.images && {\n test: /\\.jpe?g$/u,\n type: 'asset/inline',\n generator: {\n dataUrl: getImageSVG.bind(null, 'image/jpeg'),\n },\n },\n\n config.experimental.wasm && {\n test: /\\.wasm$/u,\n use: getFunctionLoader(wasm, {}),\n },\n ],\n },\n\n /**\n * The resolve configuration. This tells Webpack how to resolve imports.\n * We set it to resolve `.js` and `.ts` files.\n *\n * @see https://webpack.js.org/configuration/resolve/\n */\n resolve: {\n /**\n * The extensions to resolve. We set it to resolve `.(c|m)?jsx?` and\n * `.tsx?` files.\n */\n extensions: ['.js', '.jsx', '.mjs', '.cjs', '.ts', '.tsx'],\n\n /**\n * The fallback options. This tells Webpack how to handle imports that\n * aren't resolved. By default, we set Node.js built-ins to `false`, so\n * that they are ignored.\n */\n fallback: getFallbacks(config.polyfills),\n\n /**\n * The plugins to use. We use the {@link SnapsBuiltInResolver} to show\n * warnings about using Node.js built-ins, when no fallback is specified.\n */\n plugins: [builtInResolver],\n },\n\n /**\n * The plugins to use.\n *\n * @see https://webpack.js.org/configuration/plugins/\n */\n plugins: [\n /**\n * The `SnapsWebpackPlugin` is a Webpack plugin that checks and updates\n * the manifest file, and evaluates the bundle in SES. While not strictly\n * required, it's highly recommended to use this plugin.\n */\n new SnapsWebpackPlugin({\n manifestPath: config.manifest.path,\n writeManifest: config.manifest.update,\n eval: !options.watch && options.evaluate,\n }),\n\n /**\n * The `SnapsStatsPlugin` is a Webpack plugin that handles the stats\n * output. It's used to show the stats in the terminal, in a format that\n * is easy to read.\n */\n new SnapsStatsPlugin({ verbose: config.stats.verbose }, options.spinner),\n\n /**\n * The `DefinePlugin` is a Webpack plugin that adds static values to the\n * bundle. We use it to add the `NODE_DEBUG`, `NODE_ENV`, and `DEBUG`\n * environment variables, as well as any custom environment\n * variables (as `process.env`).\n */\n new DefinePlugin(getEnvironmentVariables(config.environment)),\n\n /**\n * The `ProgressPlugin` is a Webpack plugin that logs the progress of\n * the build. We set it to log the progress to the spinner.\n */\n new ProgressPlugin({\n handler: getProgressHandler(options.spinner, spinnerText),\n }),\n\n /**\n * The `SnapsBundleWarningPlugin` is a Webpack plugin that shows a\n * warning when the bundle is potentially incompatible with MetaMask\n * Snaps.\n */\n new SnapsBundleWarningsPlugin({\n builtInResolver,\n builtIns: Boolean(config.stats.builtIns),\n buffer: config.stats.buffer,\n }),\n\n /**\n * The `WatchPlugin` is a Webpack plugin that adds extra files to watch\n * for changes. This is useful for rebuilding the bundle when the\n * manifest file changes.\n */\n options.watch &&\n new SnapsWatchPlugin(\n {\n bundle: resolve(config.output.path, config.output.filename),\n evaluate: options.evaluate,\n files: [config.manifest.path],\n },\n options.spinner,\n ),\n\n /**\n * The `ProviderPlugin` is a Webpack plugin that automatically load\n * modules instead of having to import or require them everywhere.\n */\n (config.polyfills === true ||\n (config.polyfills !== false && config.polyfills.buffer)) &&\n new ProvidePlugin({\n Buffer: ['buffer', 'Buffer'],\n }),\n ].filter(Boolean),\n\n /**\n * The optimization configuration. This tells Webpack how to optimize the\n * bundle. Most of the time, you won't need to change this, as the default\n * options set by the `mode` option are sufficient.\n */\n optimization: {\n minimize: config.output.minimize,\n\n /**\n * The minimizer to use. We set it to use the `TerserPlugin`.\n */\n minimizer: [\n new TerserPlugin({\n parallel: true,\n }),\n ],\n },\n\n /**\n * The experiments configuration. This configures which Webpack\n * experiments to enable/disable.\n *\n * @see https://webpack.js.org/configuration/experiments\n */\n experiments: {\n /**\n * Experimental support for top level await.\n *\n * This is unsupported in Snaps and therefore disabled.\n *\n * @see https://webpack.js.org/configuration/experiments/#experimentstoplevelawait\n */\n topLevelAwait: false,\n },\n\n /**\n * The performance configuration. This tells Webpack how to handle\n * performance hints.\n *\n * @see https://webpack.js.org/configuration/performance/\n */\n performance: {\n /**\n * The hints to show. We set it to `false`, so that we don't get\n * performance hints, as they are not relevant for Snaps.\n *\n * @see https://webpack.js.org/configuration/performance/#performancehints\n */\n hints: false,\n },\n\n /**\n * The infrastructure logging configuration. This tells Webpack how to\n * log messages.\n *\n * @see https://webpack.js.org/configuration/infrastructure-logging\n */\n infrastructureLogging: {\n /**\n * The level of logging to use. We set it to `none`, so that we can\n * control the output ourselves.\n */\n level: 'none',\n },\n };\n}\n"],"mappings":"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","names":[]}
|
package/dist/chunk-R77RJHC5.mjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
export {
|
|
37
|
-
__require,
|
|
38
|
-
__export,
|
|
39
|
-
__privateGet,
|
|
40
|
-
__privateAdd,
|
|
41
|
-
__privateSet,
|
|
42
|
-
__privateMethod
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=chunk-R77RJHC5.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-RANTKN66.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkHLQEI6DVjs = require('./chunk-HLQEI6DV.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkS7UP2YYFjs = require('./chunk-S7UP2YYF.js');
|
|
7
|
-
|
|
8
|
-
// src/commands/watch/index.ts
|
|
9
|
-
var command = {
|
|
10
|
-
command: ["watch", "w"],
|
|
11
|
-
desc: "Build Snap on change",
|
|
12
|
-
builder: (yarg) => {
|
|
13
|
-
yarg.option("src", _chunkS7UP2YYFjs.builders_default.src).option("eval", _chunkS7UP2YYFjs.builders_default.eval).option("dist", _chunkS7UP2YYFjs.builders_default.dist).option("outfileName", _chunkS7UP2YYFjs.builders_default.outfileName).option("sourceMaps", _chunkS7UP2YYFjs.builders_default.sourceMaps).option("stripComments", _chunkS7UP2YYFjs.builders_default.stripComments).option("transpilationMode", _chunkS7UP2YYFjs.builders_default.transpilationMode).option("depsToTranspile", _chunkS7UP2YYFjs.builders_default.depsToTranspile).option("manifest", _chunkS7UP2YYFjs.builders_default.manifest).option("writeManifest", _chunkS7UP2YYFjs.builders_default.writeManifest).option("serve", _chunkS7UP2YYFjs.builders_default.serve).option("root", _chunkS7UP2YYFjs.builders_default.root).option("port", _chunkS7UP2YYFjs.builders_default.port).implies("writeManifest", "manifest").implies("depsToTranspile", "transpilationMode");
|
|
14
|
-
},
|
|
15
|
-
handler: async (argv) => _chunkHLQEI6DVjs.watchHandler.call(void 0, argv.context.config, {
|
|
16
|
-
port: argv.port
|
|
17
|
-
})
|
|
18
|
-
};
|
|
19
|
-
var watch_default = command;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.watch_default = watch_default;
|
|
24
|
-
//# sourceMappingURL=chunk-RANTKN66.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/watch/index.ts"],"names":[],"mappings":";;;;;;;;AAMA,IAAM,UAAU;AAAA,EACd,SAAS,CAAC,SAAS,GAAG;AAAA,EACtB,MAAM;AAAA,EACN,SAAS,CAAC,SAAqB;AAC7B,SACG,OAAO,OAAO,iBAAS,GAAG,EAC1B,OAAO,QAAQ,iBAAS,IAAI,EAC5B,OAAO,QAAQ,iBAAS,IAAI,EAC5B,OAAO,eAAe,iBAAS,WAAW,EAC1C,OAAO,cAAc,iBAAS,UAAU,EACxC,OAAO,iBAAiB,iBAAS,aAAa,EAC9C,OAAO,qBAAqB,iBAAS,iBAAiB,EACtD,OAAO,mBAAmB,iBAAS,eAAe,EAClD,OAAO,YAAY,iBAAS,QAAQ,EACpC,OAAO,iBAAiB,iBAAS,aAAa,EAC9C,OAAO,SAAS,iBAAS,KAAK,EAC9B,OAAO,QAAQ,iBAAS,IAAI,EAC5B,OAAO,QAAQ,iBAAS,IAAI,EAC5B,QAAQ,iBAAiB,UAAU,EACnC,QAAQ,mBAAmB,mBAAmB;AAAA,EACnD;AAAA,EACA,SAAS,OAAO,SACd,aAAa,KAAK,QAAQ,QAAQ;AAAA,IAChC,MAAM,KAAK;AAAA,EACb,CAAC;AACL;AAGA,IAAO,gBAAQ","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"]}
|
package/dist/chunk-S7UP2YYF.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/builders.ts
|
|
2
|
-
var TranspilationModes = /* @__PURE__ */ ((TranspilationModes2) => {
|
|
3
|
-
TranspilationModes2["LocalAndDeps"] = "localAndDeps";
|
|
4
|
-
TranspilationModes2["LocalOnly"] = "localOnly";
|
|
5
|
-
TranspilationModes2["None"] = "none";
|
|
6
|
-
return TranspilationModes2;
|
|
7
|
-
})(TranspilationModes || {});
|
|
8
|
-
var builders = {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10
|
-
config: {
|
|
11
|
-
alias: "c",
|
|
12
|
-
describe: "Path to config file",
|
|
13
|
-
type: "string",
|
|
14
|
-
normalize: true
|
|
15
|
-
},
|
|
16
|
-
fix: {
|
|
17
|
-
describe: "Attempt to fix snap.manifest.json",
|
|
18
|
-
type: "boolean"
|
|
19
|
-
},
|
|
20
|
-
input: {
|
|
21
|
-
alias: "i",
|
|
22
|
-
describe: "Snap bundle file to evaluate",
|
|
23
|
-
type: "string",
|
|
24
|
-
normalize: true
|
|
25
|
-
},
|
|
26
|
-
// Deprecated Browserify options.
|
|
27
|
-
bundle: {
|
|
28
|
-
alias: "b",
|
|
29
|
-
describe: "Snap bundle file",
|
|
30
|
-
type: "string",
|
|
31
|
-
normalize: true,
|
|
32
|
-
deprecated: "Use --input instead."
|
|
33
|
-
},
|
|
34
|
-
dist: {
|
|
35
|
-
alias: "d",
|
|
36
|
-
describe: "Output directory",
|
|
37
|
-
type: "string",
|
|
38
|
-
normalize: true,
|
|
39
|
-
deprecated: true
|
|
40
|
-
},
|
|
41
|
-
eval: {
|
|
42
|
-
alias: "e",
|
|
43
|
-
describe: "Attempt to evaluate Snap bundle in SES",
|
|
44
|
-
type: "boolean",
|
|
45
|
-
deprecated: true
|
|
46
|
-
},
|
|
47
|
-
manifest: {
|
|
48
|
-
alias: "m",
|
|
49
|
-
describe: "Validate snap.manifest.json",
|
|
50
|
-
type: "boolean",
|
|
51
|
-
deprecated: true
|
|
52
|
-
},
|
|
53
|
-
port: {
|
|
54
|
-
alias: "p",
|
|
55
|
-
describe: "Local server port for testing",
|
|
56
|
-
type: "number",
|
|
57
|
-
coerce: (arg) => {
|
|
58
|
-
const port = Number.parseInt(String(arg), 10);
|
|
59
|
-
if (Number.isNaN(port)) {
|
|
60
|
-
throw new Error(`Invalid port: "${String(arg)}".`);
|
|
61
|
-
}
|
|
62
|
-
return port;
|
|
63
|
-
},
|
|
64
|
-
deprecated: true
|
|
65
|
-
},
|
|
66
|
-
outfileName: {
|
|
67
|
-
alias: "n",
|
|
68
|
-
describe: "Output file name",
|
|
69
|
-
type: "string",
|
|
70
|
-
deprecated: true
|
|
71
|
-
},
|
|
72
|
-
root: {
|
|
73
|
-
alias: "r",
|
|
74
|
-
describe: "Server root directory",
|
|
75
|
-
type: "string",
|
|
76
|
-
normalize: true,
|
|
77
|
-
deprecated: true
|
|
78
|
-
},
|
|
79
|
-
sourceMaps: {
|
|
80
|
-
describe: "Whether builds include sourcemaps",
|
|
81
|
-
type: "boolean",
|
|
82
|
-
deprecated: true
|
|
83
|
-
},
|
|
84
|
-
src: {
|
|
85
|
-
alias: "s",
|
|
86
|
-
describe: "Source file",
|
|
87
|
-
type: "string",
|
|
88
|
-
normalize: true,
|
|
89
|
-
deprecated: true
|
|
90
|
-
},
|
|
91
|
-
stripComments: {
|
|
92
|
-
alias: "strip",
|
|
93
|
-
describe: "Whether to remove code comments from the build output",
|
|
94
|
-
type: "boolean",
|
|
95
|
-
deprecated: true
|
|
96
|
-
},
|
|
97
|
-
suppressWarnings: {
|
|
98
|
-
type: "boolean",
|
|
99
|
-
describe: "Whether to suppress warnings",
|
|
100
|
-
deprecated: true
|
|
101
|
-
},
|
|
102
|
-
transpilationMode: {
|
|
103
|
-
type: "string",
|
|
104
|
-
describe: "Whether to use Babel to transpile all source code (including dependencies), local source code only, or nothing",
|
|
105
|
-
choices: Object.values(TranspilationModes),
|
|
106
|
-
deprecated: true
|
|
107
|
-
},
|
|
108
|
-
depsToTranspile: {
|
|
109
|
-
type: "array",
|
|
110
|
-
describe: "Transpile only the listed dependencies.",
|
|
111
|
-
deprecated: true
|
|
112
|
-
},
|
|
113
|
-
verboseErrors: {
|
|
114
|
-
type: "boolean",
|
|
115
|
-
describe: "Display original errors",
|
|
116
|
-
deprecated: true
|
|
117
|
-
},
|
|
118
|
-
writeManifest: {
|
|
119
|
-
describe: "Make necessary changes to the snap manifest file",
|
|
120
|
-
type: "boolean",
|
|
121
|
-
deprecated: true
|
|
122
|
-
},
|
|
123
|
-
serve: {
|
|
124
|
-
describe: "Serve snap file(s) locally for testing",
|
|
125
|
-
type: "boolean",
|
|
126
|
-
deprecated: true
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
var builders_default = builders;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
exports.TranspilationModes = TranspilationModes; exports.builders_default = builders_default;
|
|
135
|
-
//# sourceMappingURL=chunk-S7UP2YYF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/builders.ts"],"names":["TranspilationModes"],"mappings":";AAEO,IAAK,qBAAL,kBAAKA,wBAAL;AACL,EAAAA,oBAAA,kBAAe;AACf,EAAAA,oBAAA,eAAY;AACZ,EAAAA,oBAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;AAMZ,IAAM,WAA8C;AAAA;AAAA,EAElD,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EAEA,KAAK;AAAA,IACH,UAAU;AAAA,IACV,MAAM;AAAA,EACR;AAAA,EAEA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA;AAAA,EAGA,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EAEA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EAEA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,EACd;AAAA,EAEA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,EACd;AAAA,EAEA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,QAAQ,CAAC,QAAiB;AACxB,YAAM,OAAO,OAAO,SAAS,OAAO,GAAG,GAAG,EAAE;AAC5C,UAAI,OAAO,MAAM,IAAI,GAAG;AACtB,cAAM,IAAI,MAAM,kBAAkB,OAAO,GAAG,CAAC,IAAI;AAAA,MACnD;AAEA,aAAO;AAAA,IACT;AAAA,IACA,YAAY;AAAA,EACd;AAAA,EAEA,aAAa;AAAA,IACX,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,EACd;AAAA,EAEA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EAEA,YAAY;AAAA,IACV,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,EACd;AAAA,EAEA,KAAK;AAAA,IACH,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EAEA,eAAe;AAAA,IACb,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,EACd;AAAA,EAEA,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EAEA,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,UACE;AAAA,IACF,SAAS,OAAO,OAAO,kBAAkB;AAAA,IACzC,YAAY;AAAA,EACd;AAAA,EAEA,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EAEA,eAAe;AAAA,IACb,MAAM;AAAA,IACN,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EAEA,eAAe;AAAA,IACb,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,EACd;AAAA,EAEA,OAAO;AAAA,IACL,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,EACd;AACF;AAEA,IAAO,mBAAQ","sourcesContent":["import type { Options } from 'yargs';\n\nexport enum TranspilationModes {\n LocalAndDeps = 'localAndDeps',\n LocalOnly = 'localOnly',\n None = 'none',\n}\n\nconst builders: Record<string, Readonly<Options>> = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n config: {\n alias: 'c',\n describe: 'Path to config file',\n type: 'string',\n normalize: true,\n },\n\n fix: {\n describe: 'Attempt to fix snap.manifest.json',\n type: 'boolean',\n },\n\n input: {\n alias: 'i',\n describe: 'Snap bundle file to evaluate',\n type: 'string',\n normalize: true,\n },\n\n // Deprecated Browserify options.\n bundle: {\n alias: 'b',\n describe: 'Snap bundle file',\n type: 'string',\n normalize: true,\n deprecated: 'Use --input instead.',\n },\n\n dist: {\n alias: 'd',\n describe: 'Output directory',\n type: 'string',\n normalize: true,\n deprecated: true,\n },\n\n eval: {\n alias: 'e',\n describe: 'Attempt to evaluate Snap bundle in SES',\n type: 'boolean',\n deprecated: true,\n },\n\n manifest: {\n alias: 'm',\n describe: 'Validate snap.manifest.json',\n type: 'boolean',\n deprecated: true,\n },\n\n port: {\n alias: 'p',\n describe: 'Local server port for testing',\n type: 'number',\n coerce: (arg: unknown) => {\n const port = Number.parseInt(String(arg), 10);\n if (Number.isNaN(port)) {\n throw new Error(`Invalid port: \"${String(arg)}\".`);\n }\n\n return port;\n },\n deprecated: true,\n },\n\n outfileName: {\n alias: 'n',\n describe: 'Output file name',\n type: 'string',\n deprecated: true,\n },\n\n root: {\n alias: 'r',\n describe: 'Server root directory',\n type: 'string',\n normalize: true,\n deprecated: true,\n },\n\n sourceMaps: {\n describe: 'Whether builds include sourcemaps',\n type: 'boolean',\n deprecated: true,\n },\n\n src: {\n alias: 's',\n describe: 'Source file',\n type: 'string',\n normalize: true,\n deprecated: true,\n },\n\n stripComments: {\n alias: 'strip',\n describe: 'Whether to remove code comments from the build output',\n type: 'boolean',\n deprecated: true,\n },\n\n suppressWarnings: {\n type: 'boolean',\n describe: 'Whether to suppress warnings',\n deprecated: true,\n },\n\n transpilationMode: {\n type: 'string',\n describe:\n 'Whether to use Babel to transpile all source code (including dependencies), local source code only, or nothing',\n choices: Object.values(TranspilationModes),\n deprecated: true,\n },\n\n depsToTranspile: {\n type: 'array',\n describe: 'Transpile only the listed dependencies.',\n deprecated: true,\n },\n\n verboseErrors: {\n type: 'boolean',\n describe: 'Display original errors',\n deprecated: true,\n },\n\n writeManifest: {\n describe: 'Make necessary changes to the snap manifest file',\n type: 'boolean',\n deprecated: true,\n },\n\n serve: {\n describe: 'Serve snap file(s) locally for testing',\n type: 'boolean',\n deprecated: true,\n },\n};\n\nexport default builders;\n"]}
|