@metamask/snaps-cli 6.3.1 → 6.3.3
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 +28 -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 +28 -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} +2 -1
- 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 -46
- 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 +86 -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 +43 -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} +8 -7
- 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 -50
- 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/index.d.cts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as utils from "./utils/index.cjs";
|
|
2
|
+
export type { SnapConfig } from "./config.cjs";
|
|
3
|
+
export { getDefaultConfiguration, SnapsStatsPlugin, SnapsWatchPlugin, SnapsBuiltInResolver, SnapsBundleWarningsPlugin, } from "./webpack/index.cjs";
|
|
4
|
+
export type { SnapsStatsPluginOptions, SnapsWatchPluginOptions, SnapsBuiltInResolverOptions, SnapsBundleWarningsPluginOptions, } from "./webpack/index.cjs";
|
|
5
|
+
export { merge, mergeWithCustomize, mergeWithRules } from "webpack-merge";
|
|
6
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,0BAAgB;AACjC,YAAY,EAAE,UAAU,EAAE,qBAAiB;AAC3C,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,GAC1B,4BAAkB;AACnB,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,GACjC,4BAAkB;AAGnB,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,sBAAsB"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as utils from "./utils/index.mjs";
|
|
2
|
+
export type { SnapConfig } from "./config.mjs";
|
|
3
|
+
export { getDefaultConfiguration, SnapsStatsPlugin, SnapsWatchPlugin, SnapsBuiltInResolver, SnapsBundleWarningsPlugin, } from "./webpack/index.mjs";
|
|
4
|
+
export type { SnapsStatsPluginOptions, SnapsWatchPluginOptions, SnapsBuiltInResolverOptions, SnapsBundleWarningsPluginOptions, } from "./webpack/index.mjs";
|
|
5
|
+
export { merge, mergeWithCustomize, mergeWithRules } from "webpack-merge";
|
|
6
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,0BAAgB;AACjC,YAAY,EAAE,UAAU,EAAE,qBAAiB;AAC3C,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,GAC1B,4BAAkB;AACnB,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,GACjC,4BAAkB;AAGnB,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,sBAAsB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,45 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./chunk-QRW2GKA3.mjs";
|
|
6
|
-
import {
|
|
7
|
-
SnapsBuiltInResolver,
|
|
8
|
-
SnapsBundleWarningsPlugin,
|
|
9
|
-
SnapsStatsPlugin,
|
|
10
|
-
SnapsWatchPlugin
|
|
11
|
-
} from "./chunk-HOVEQTF3.mjs";
|
|
12
|
-
import "./chunk-BYNQODL3.mjs";
|
|
13
|
-
import "./chunk-K26BOY6Z.mjs";
|
|
14
|
-
import "./chunk-3WWFQLH4.mjs";
|
|
15
|
-
import "./chunk-SYRWT2KT.mjs";
|
|
16
|
-
import "./chunk-V6SYDSWM.mjs";
|
|
17
|
-
import "./chunk-AZMQTZXZ.mjs";
|
|
18
|
-
import "./chunk-ERSRIVYH.mjs";
|
|
19
|
-
import {
|
|
20
|
-
utils_exports
|
|
21
|
-
} from "./chunk-JL3URCHO.mjs";
|
|
22
|
-
import "./chunk-L72RLBV5.mjs";
|
|
23
|
-
import "./chunk-QMD3VO6R.mjs";
|
|
24
|
-
import "./chunk-TDSL55B3.mjs";
|
|
25
|
-
import "./chunk-YCYGKEXF.mjs";
|
|
26
|
-
import "./chunk-7RHK2YTB.mjs";
|
|
27
|
-
import "./chunk-ZAW4ZWQX.mjs";
|
|
28
|
-
import "./chunk-MR44GPM3.mjs";
|
|
29
|
-
import "./chunk-X7TESUC7.mjs";
|
|
30
|
-
import "./chunk-R77RJHC5.mjs";
|
|
31
|
-
|
|
32
|
-
// src/index.ts
|
|
33
|
-
import { merge, mergeWithCustomize, mergeWithRules } from "webpack-merge";
|
|
34
|
-
export {
|
|
35
|
-
SnapsBuiltInResolver,
|
|
36
|
-
SnapsBundleWarningsPlugin,
|
|
37
|
-
SnapsStatsPlugin,
|
|
38
|
-
SnapsWatchPlugin,
|
|
39
|
-
getDefaultConfiguration,
|
|
40
|
-
merge,
|
|
41
|
-
mergeWithCustomize,
|
|
42
|
-
mergeWithRules,
|
|
43
|
-
utils_exports as utils
|
|
44
|
-
};
|
|
1
|
+
export * as utils from "./utils/index.mjs";
|
|
2
|
+
export { getDefaultConfiguration, SnapsStatsPlugin, SnapsWatchPlugin, SnapsBuiltInResolver, SnapsBundleWarningsPlugin } from "./webpack/index.mjs";
|
|
3
|
+
// Re-exported from `snaps-cli` for convenience.
|
|
4
|
+
export { merge, mergeWithCustomize, mergeWithRules } from "webpack-merge";
|
|
45
5
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * as utils from './utils';\nexport type { SnapConfig } from './config';\nexport {\n getDefaultConfiguration,\n SnapsStatsPlugin,\n SnapsWatchPlugin,\n SnapsBuiltInResolver,\n SnapsBundleWarningsPlugin,\n} from './webpack';\nexport type {\n SnapsStatsPluginOptions,\n SnapsWatchPluginOptions,\n SnapsBuiltInResolverOptions,\n SnapsBundleWarningsPluginOptions,\n} from './webpack';\n\n// Re-exported from `snaps-cli` for convenience.\nexport { merge, mergeWithCustomize, mergeWithRules } from 'webpack-merge';\n"]
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,0BAAgB;AAEjC,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EAC1B,4BAAkB;AAQnB,gDAAgD;AAChD,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,sBAAsB","sourcesContent":["export * as utils from './utils';\nexport type { SnapConfig } from './config';\nexport {\n getDefaultConfiguration,\n SnapsStatsPlugin,\n SnapsWatchPlugin,\n SnapsBuiltInResolver,\n SnapsBundleWarningsPlugin,\n} from './webpack';\nexport type {\n SnapsStatsPluginOptions,\n SnapsWatchPluginOptions,\n SnapsBuiltInResolverOptions,\n SnapsBundleWarningsPluginOptions,\n} from './webpack';\n\n// Re-exported from `snaps-cli` for convenience.\nexport { merge, mergeWithCustomize, mergeWithRules } from 'webpack-merge';\n"]}
|
package/dist/main.cjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const snaps_utils_1 = require("@metamask/snaps-utils");
|
|
8
|
+
const cli_1 = require("./cli.cjs");
|
|
9
|
+
const commands_1 = __importDefault(require("./commands/index.cjs"));
|
|
10
|
+
/*
|
|
11
|
+
* Disable the following error, we target an old version
|
|
12
|
+
* of a browser, and this error is not useful to our users.
|
|
13
|
+
*
|
|
14
|
+
* Browserslist: caniuse-lite is outdated. Please run:
|
|
15
|
+
* npx update-browserslist-db@latest
|
|
16
|
+
* Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
17
|
+
*/
|
|
18
|
+
// eslint-disable-next-line n/no-process-env
|
|
19
|
+
process.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';
|
|
20
|
+
(0, cli_1.cli)(process.argv, commands_1.default).catch((error) => {
|
|
21
|
+
(0, snaps_utils_1.logError)(error);
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=main.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.cjs","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;AAEA,uDAAiD;AAEjD,mCAA4B;AAC5B,oEAAkC;AAElC;;;;;;;GAOG;AACH,4CAA4C;AAC5C,OAAO,CAAC,GAAG,CAAC,4BAA4B,GAAG,GAAG,CAAC;AAE/C,IAAA,SAAG,EAAC,OAAO,CAAC,IAAI,EAAE,kBAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IAC1C,IAAA,sBAAQ,EAAC,KAAK,CAAC,CAAC;IAChB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { logError } from '@metamask/snaps-utils';\n\nimport { cli } from './cli';\nimport commands from './commands';\n\n/*\n * Disable the following error, we target an old version\n * of a browser, and this error is not useful to our users.\n *\n * Browserslist: caniuse-lite is outdated. Please run:\n * npx update-browserslist-db@latest\n * Why you should do it regularly: https://github.com/browserslist/update-db#readme\n */\n// eslint-disable-next-line n/no-process-env\nprocess.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';\n\ncli(process.argv, commands).catch((error) => {\n logError(error);\n process.exitCode = 1;\n});\n"]}
|
package/dist/main.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.cts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
|
package/dist/main.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.mts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
|
package/dist/main.mjs
CHANGED
|
@@ -1,50 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
cli
|
|
4
|
-
} from "./chunk-24QJ2ZUZ.mjs";
|
|
5
|
-
import "./chunk-NR4OJOGX.mjs";
|
|
6
|
-
import "./chunk-HLSCFGA7.mjs";
|
|
7
|
-
import {
|
|
8
|
-
commands_default
|
|
9
|
-
} from "./chunk-OIFTFHZ4.mjs";
|
|
10
|
-
import "./chunk-AQSQ7YYP.mjs";
|
|
11
|
-
import "./chunk-MR5TAGOG.mjs";
|
|
12
|
-
import "./chunk-BAEGXYL7.mjs";
|
|
13
|
-
import "./chunk-KWHAT6UJ.mjs";
|
|
14
|
-
import "./chunk-2P3D6FNV.mjs";
|
|
15
|
-
import "./chunk-QAM2JJRA.mjs";
|
|
16
|
-
import "./chunk-4A5QZUC7.mjs";
|
|
17
|
-
import "./chunk-JCVSYVPD.mjs";
|
|
18
|
-
import "./chunk-JAHNVVLT.mjs";
|
|
19
|
-
import "./chunk-NOBUMOYX.mjs";
|
|
20
|
-
import "./chunk-CZRGAFVI.mjs";
|
|
21
|
-
import "./chunk-45LOTCC4.mjs";
|
|
22
|
-
import "./chunk-6ABGZTV7.mjs";
|
|
23
|
-
import "./chunk-QRW2GKA3.mjs";
|
|
24
|
-
import "./chunk-HOVEQTF3.mjs";
|
|
25
|
-
import "./chunk-BYNQODL3.mjs";
|
|
26
|
-
import "./chunk-K26BOY6Z.mjs";
|
|
27
|
-
import "./chunk-3WWFQLH4.mjs";
|
|
28
|
-
import "./chunk-SYRWT2KT.mjs";
|
|
29
|
-
import "./chunk-V6SYDSWM.mjs";
|
|
30
|
-
import "./chunk-AZMQTZXZ.mjs";
|
|
31
|
-
import "./chunk-ERSRIVYH.mjs";
|
|
32
|
-
import "./chunk-JL3URCHO.mjs";
|
|
33
|
-
import "./chunk-L72RLBV5.mjs";
|
|
34
|
-
import "./chunk-QMD3VO6R.mjs";
|
|
35
|
-
import "./chunk-TDSL55B3.mjs";
|
|
36
|
-
import "./chunk-YCYGKEXF.mjs";
|
|
37
|
-
import "./chunk-7RHK2YTB.mjs";
|
|
38
|
-
import "./chunk-ZAW4ZWQX.mjs";
|
|
39
|
-
import "./chunk-MR44GPM3.mjs";
|
|
40
|
-
import "./chunk-X7TESUC7.mjs";
|
|
41
|
-
import "./chunk-R77RJHC5.mjs";
|
|
42
|
-
|
|
43
|
-
// src/main.ts
|
|
44
2
|
import { logError } from "@metamask/snaps-utils";
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
3
|
+
import { cli } from "./cli.mjs";
|
|
4
|
+
import commands from "./commands/index.mjs";
|
|
5
|
+
/*
|
|
6
|
+
* Disable the following error, we target an old version
|
|
7
|
+
* of a browser, and this error is not useful to our users.
|
|
8
|
+
*
|
|
9
|
+
* Browserslist: caniuse-lite is outdated. Please run:
|
|
10
|
+
* npx update-browserslist-db@latest
|
|
11
|
+
* Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
12
|
+
*/
|
|
13
|
+
// eslint-disable-next-line n/no-process-env
|
|
14
|
+
process.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';
|
|
15
|
+
cli(process.argv, commands).catch((error) => {
|
|
16
|
+
logError(error);
|
|
17
|
+
process.exitCode = 1;
|
|
49
18
|
});
|
|
50
19
|
//# sourceMappingURL=main.mjs.map
|
package/dist/main.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { logError } from '@metamask/snaps-utils';\n\nimport { cli } from './cli';\nimport commands from './commands';\n\n/*\n * Disable the following error, we target an old version\n * of a browser, and this error is not useful to our users.\n *\n * Browserslist: caniuse-lite is outdated. Please run:\n * npx update-browserslist-db@latest\n * Why you should do it regularly: https://github.com/browserslist/update-db#readme\n */\n// eslint-disable-next-line n/no-process-env\nprocess.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';\n\ncli(process.argv, commands).catch((error) => {\n logError(error);\n process.exitCode = 1;\n});\n"]
|
|
1
|
+
{"version":3,"file":"main.mjs","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAEjD,OAAO,EAAE,GAAG,EAAE,kBAAc;AAC5B,OAAO,QAAQ,6BAAmB;AAElC;;;;;;;GAOG;AACH,4CAA4C;AAC5C,OAAO,CAAC,GAAG,CAAC,4BAA4B,GAAG,GAAG,CAAC;AAE/C,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IAC1C,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { logError } from '@metamask/snaps-utils';\n\nimport { cli } from './cli';\nimport commands from './commands';\n\n/*\n * Disable the following error, we target an old version\n * of a browser, and this error is not useful to our users.\n *\n * Browserslist: caniuse-lite is outdated. Please run:\n * npx update-browserslist-db@latest\n * Why you should do it regularly: https://github.com/browserslist/update-db#readme\n */\n// eslint-disable-next-line n/no-process-env\nprocess.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';\n\ncli(process.argv, commands).catch((error) => {\n logError(error);\n process.exitCode = 1;\n});\n"]}
|
package/dist/structs.cjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.file = void 0;
|
|
4
|
+
const superstruct_1 = require("@metamask/superstruct");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* A wrapper of `superstruct`'s `string` struct that coerces a value to a string
|
|
8
|
+
* and resolves it relative to the current working directory. This is useful
|
|
9
|
+
* for specifying file paths in a configuration file, as it allows the user to
|
|
10
|
+
* use both relative and absolute paths.
|
|
11
|
+
*
|
|
12
|
+
* @returns The `superstruct` struct, which validates that the value is a
|
|
13
|
+
* string, and resolves it relative to the current working directory.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const config = struct({
|
|
17
|
+
* file: file(),
|
|
18
|
+
* // ...
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* const value = create({ file: 'path/to/file' }, config);
|
|
22
|
+
* console.log(value.file); // /process/cwd/path/to/file
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
function file() {
|
|
26
|
+
return (0, superstruct_1.coerce)((0, superstruct_1.string)(), (0, superstruct_1.string)(), (value) => {
|
|
27
|
+
return (0, path_1.resolve)(process.cwd(), value);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.file = file;
|
|
31
|
+
//# sourceMappingURL=structs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.cjs","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,+BAA+B;AAE/B;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,IAAI;IAClB,OAAO,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,oBAAM,GAAE,EAAE,CAAC,KAAK,EAAE,EAAE;QAC1C,OAAO,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,oBAIC","sourcesContent":["import { coerce, string } from '@metamask/superstruct';\nimport { resolve } from 'path';\n\n/**\n * A wrapper of `superstruct`'s `string` struct that coerces a value to a string\n * and resolves it relative to the current working directory. This is useful\n * for specifying file paths in a configuration file, as it allows the user to\n * use both relative and absolute paths.\n *\n * @returns The `superstruct` struct, which validates that the value is a\n * string, and resolves it relative to the current working directory.\n * @example\n * ```ts\n * const config = struct({\n * file: file(),\n * // ...\n * });\n *\n * const value = create({ file: 'path/to/file' }, config);\n * console.log(value.file); // /process/cwd/path/to/file\n * ```\n */\nexport function file() {\n return coerce(string(), string(), (value) => {\n return resolve(process.cwd(), value);\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.d.cts","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,yDAInB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A wrapper of `superstruct`'s `string` struct that coerces a value to a string
|
|
3
|
+
* and resolves it relative to the current working directory. This is useful
|
|
4
|
+
* for specifying file paths in a configuration file, as it allows the user to
|
|
5
|
+
* use both relative and absolute paths.
|
|
6
|
+
*
|
|
7
|
+
* @returns The `superstruct` struct, which validates that the value is a
|
|
8
|
+
* string, and resolves it relative to the current working directory.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const config = struct({
|
|
12
|
+
* file: file(),
|
|
13
|
+
* // ...
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* const value = create({ file: 'path/to/file' }, config);
|
|
17
|
+
* console.log(value.file); // /process/cwd/path/to/file
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function file(): import("@metamask/superstruct").Struct<string, null>;
|
|
21
|
+
//# sourceMappingURL=structs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.d.mts","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,yDAInB"}
|
package/dist/structs.mjs
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { coerce, string } from "@metamask/superstruct";
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
/**
|
|
4
|
+
* A wrapper of `superstruct`'s `string` struct that coerces a value to a string
|
|
5
|
+
* and resolves it relative to the current working directory. This is useful
|
|
6
|
+
* for specifying file paths in a configuration file, as it allows the user to
|
|
7
|
+
* use both relative and absolute paths.
|
|
8
|
+
*
|
|
9
|
+
* @returns The `superstruct` struct, which validates that the value is a
|
|
10
|
+
* string, and resolves it relative to the current working directory.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const config = struct({
|
|
14
|
+
* file: file(),
|
|
15
|
+
* // ...
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const value = create({ file: 'path/to/file' }, config);
|
|
19
|
+
* console.log(value.file); // /process/cwd/path/to/file
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function file() {
|
|
23
|
+
return coerce(string(), string(), (value) => {
|
|
24
|
+
return resolve(process.cwd(), value);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
8
27
|
//# sourceMappingURL=structs.mjs.map
|
package/dist/structs.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"structs.mjs","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACvD,OAAO,EAAE,OAAO,EAAE,aAAa;AAE/B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE;QAC1C,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { coerce, string } from '@metamask/superstruct';\nimport { resolve } from 'path';\n\n/**\n * A wrapper of `superstruct`'s `string` struct that coerces a value to a string\n * and resolves it relative to the current working directory. This is useful\n * for specifying file paths in a configuration file, as it allows the user to\n * use both relative and absolute paths.\n *\n * @returns The `superstruct` struct, which validates that the value is a\n * string, and resolves it relative to the current working directory.\n * @example\n * ```ts\n * const config = struct({\n * file: file(),\n * // ...\n * });\n *\n * const value = create({ file: 'path/to/file' }, config);\n * console.log(value.file); // /process/cwd/path/to/file\n * ```\n */\nexport function file() {\n return coerce(string(), string(), (value) => {\n return resolve(process.cwd(), value);\n });\n}\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.trimPathString = exports.sanitizeInputs = exports.TS_CONFIG_FILE = exports.CONFIG_FILE = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
exports.CONFIG_FILE = 'snap.config.js';
|
|
9
|
+
exports.TS_CONFIG_FILE = 'snap.config.ts';
|
|
10
|
+
// CLI arguments whose values are file paths.
|
|
11
|
+
const pathArguments = new Set([
|
|
12
|
+
'src',
|
|
13
|
+
's',
|
|
14
|
+
'dist',
|
|
15
|
+
'd',
|
|
16
|
+
'bundle',
|
|
17
|
+
'b',
|
|
18
|
+
'root',
|
|
19
|
+
'r',
|
|
20
|
+
]);
|
|
21
|
+
/**
|
|
22
|
+
* Sanitizes inputs. Currently normalizes "./" paths to ".".
|
|
23
|
+
* Yargs handles other path normalization as specified in builders.
|
|
24
|
+
*
|
|
25
|
+
* @param argv - Arguments as an object generated by yargs.
|
|
26
|
+
*/
|
|
27
|
+
function sanitizeInputs(argv) {
|
|
28
|
+
Object.keys(argv).forEach((key) => {
|
|
29
|
+
if (typeof argv[key] === 'string') {
|
|
30
|
+
// Node's path.normalize() does not do this
|
|
31
|
+
if (argv[key] === './') {
|
|
32
|
+
argv[key] = '.';
|
|
33
|
+
}
|
|
34
|
+
if (pathArguments.has(key)) {
|
|
35
|
+
argv[key] = path_1.default.normalize(argv[key]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
exports.sanitizeInputs = sanitizeInputs;
|
|
41
|
+
/**
|
|
42
|
+
* Trims leading and trailing periods "." and forward slashes "/" from the
|
|
43
|
+
* given path string.
|
|
44
|
+
*
|
|
45
|
+
* @param pathString - The path string to trim.
|
|
46
|
+
* @returns The trimmed path string.
|
|
47
|
+
*/
|
|
48
|
+
function trimPathString(pathString) {
|
|
49
|
+
return pathString.replace(/^[./]+|[./]+$/gu, '');
|
|
50
|
+
}
|
|
51
|
+
exports.trimPathString = trimPathString;
|
|
52
|
+
//# sourceMappingURL=cli.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.cjs","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAEX,QAAA,WAAW,GAAG,gBAAgB,CAAC;AAC/B,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAE/C,6CAA6C;AAC7C,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,KAAK;IACL,GAAG;IACH,MAAM;IACN,GAAG;IACH,QAAQ;IACR,GAAG;IACH,MAAM;IACN,GAAG;CACJ,CAAC,CAAC;AAEH;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,IAA6B;IAC1D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE,CAAC;YAClC,2CAA2C;YAC3C,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;gBACvB,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;YAClB,CAAC;YAED,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,cAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAW,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAbD,wCAaC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,UAAkB;IAC/C,OAAO,UAAU,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC;AAFD,wCAEC","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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.cts","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAC5C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAc/C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAa3D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const CONFIG_FILE = "snap.config.js";
|
|
2
|
+
export declare const TS_CONFIG_FILE = "snap.config.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Sanitizes inputs. Currently normalizes "./" paths to ".".
|
|
5
|
+
* Yargs handles other path normalization as specified in builders.
|
|
6
|
+
*
|
|
7
|
+
* @param argv - Arguments as an object generated by yargs.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sanitizeInputs(argv: Record<string, unknown>): void;
|
|
10
|
+
/**
|
|
11
|
+
* Trims leading and trailing periods "." and forward slashes "/" from the
|
|
12
|
+
* given path string.
|
|
13
|
+
*
|
|
14
|
+
* @param pathString - The path string to trim.
|
|
15
|
+
* @returns The trimmed path string.
|
|
16
|
+
*/
|
|
17
|
+
export declare function trimPathString(pathString: string): string;
|
|
18
|
+
//# sourceMappingURL=cli.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.mts","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAC5C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAc/C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAa3D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
package/dist/utils/cli.mjs
CHANGED
|
@@ -1,14 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import path from "path";
|
|
2
|
+
export const CONFIG_FILE = 'snap.config.js';
|
|
3
|
+
export const TS_CONFIG_FILE = 'snap.config.ts';
|
|
4
|
+
// CLI arguments whose values are file paths.
|
|
5
|
+
const pathArguments = new Set([
|
|
6
|
+
'src',
|
|
7
|
+
's',
|
|
8
|
+
'dist',
|
|
9
|
+
'd',
|
|
10
|
+
'bundle',
|
|
11
|
+
'b',
|
|
12
|
+
'root',
|
|
13
|
+
'r',
|
|
14
|
+
]);
|
|
15
|
+
/**
|
|
16
|
+
* Sanitizes inputs. Currently normalizes "./" paths to ".".
|
|
17
|
+
* Yargs handles other path normalization as specified in builders.
|
|
18
|
+
*
|
|
19
|
+
* @param argv - Arguments as an object generated by yargs.
|
|
20
|
+
*/
|
|
21
|
+
export function sanitizeInputs(argv) {
|
|
22
|
+
Object.keys(argv).forEach((key) => {
|
|
23
|
+
if (typeof argv[key] === 'string') {
|
|
24
|
+
// Node's path.normalize() does not do this
|
|
25
|
+
if (argv[key] === './') {
|
|
26
|
+
argv[key] = '.';
|
|
27
|
+
}
|
|
28
|
+
if (pathArguments.has(key)) {
|
|
29
|
+
argv[key] = path.normalize(argv[key]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Trims leading and trailing periods "." and forward slashes "/" from the
|
|
36
|
+
* given path string.
|
|
37
|
+
*
|
|
38
|
+
* @param pathString - The path string to trim.
|
|
39
|
+
* @returns The trimmed path string.
|
|
40
|
+
*/
|
|
41
|
+
export function trimPathString(pathString) {
|
|
42
|
+
return pathString.replace(/^[./]+|[./]+$/gu, '');
|
|
43
|
+
}
|
|
14
44
|
//# sourceMappingURL=cli.mjs.map
|
package/dist/utils/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"cli.mjs","sourceRoot":"","sources":["../../src/utils/cli.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,aAAa;AAExB,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAC5C,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C,6CAA6C;AAC7C,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,KAAK;IACL,GAAG;IACH,MAAM;IACN,GAAG;IACH,QAAQ;IACR,GAAG;IACH,MAAM;IACN,GAAG;CACJ,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAA6B;IAC1D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE,CAAC;YAClC,2CAA2C;YAC3C,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;gBACvB,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;YAClB,CAAC;YAED,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAW,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,OAAO,UAAU,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC","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"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getErrorMessage = exports.getYargsErrorMessage = void 0;
|
|
4
|
+
const utils_1 = require("@metamask/utils");
|
|
5
|
+
const errors_1 = require("../errors.cjs");
|
|
6
|
+
/**
|
|
7
|
+
* Get the error message from an error in a Yargs `fail` handler. If the error
|
|
8
|
+
* is not `undefined`, {@link getErrorMessage} is used to get the error message.
|
|
9
|
+
* Otherwise, the given message is returned.
|
|
10
|
+
*
|
|
11
|
+
* @param message - The error message.
|
|
12
|
+
* @param error - The error object. This may be `undefined`.
|
|
13
|
+
* @returns The error message.
|
|
14
|
+
*/
|
|
15
|
+
function getYargsErrorMessage(message, error) {
|
|
16
|
+
if (error) {
|
|
17
|
+
if (error instanceof errors_1.CLIError) {
|
|
18
|
+
return error.message;
|
|
19
|
+
}
|
|
20
|
+
return getErrorMessage(error);
|
|
21
|
+
}
|
|
22
|
+
return message;
|
|
23
|
+
}
|
|
24
|
+
exports.getYargsErrorMessage = getYargsErrorMessage;
|
|
25
|
+
/**
|
|
26
|
+
* Get the error message from an error.
|
|
27
|
+
*
|
|
28
|
+
* - If the error is an object with a `stack` property, the `stack` property is
|
|
29
|
+
* returned.
|
|
30
|
+
* - If the error is an object with a `message` property, the `message`
|
|
31
|
+
* property is returned.
|
|
32
|
+
* - Otherwise, the error is converted to a string and returned.
|
|
33
|
+
*
|
|
34
|
+
* @param error - The error to get the message from.
|
|
35
|
+
* @returns The error message.
|
|
36
|
+
*/
|
|
37
|
+
function getErrorMessage(error) {
|
|
38
|
+
if ((0, utils_1.isObject)(error)) {
|
|
39
|
+
if ((0, utils_1.hasProperty)(error, 'stack') && typeof error.stack === 'string') {
|
|
40
|
+
return error.stack;
|
|
41
|
+
}
|
|
42
|
+
if ((0, utils_1.hasProperty)(error, 'message') && typeof error.message === 'string') {
|
|
43
|
+
return error.message;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return String(error);
|
|
47
|
+
}
|
|
48
|
+
exports.getErrorMessage = getErrorMessage;
|
|
49
|
+
//# sourceMappingURL=errors.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.cjs","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":";;;AAAA,2CAAwD;AAExD,0CAAqC;AAErC;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,OAAe,EAAE,KAAe;IACnE,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,KAAK,YAAY,iBAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,OAAO,CAAC;QACvB,CAAC;QAED,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAVD,oDAUC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,eAAe,CAAC,KAAc;IAC5C,IAAI,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAE,CAAC;QACpB,IAAI,IAAA,mBAAW,EAAC,KAAK,EAAE,OAAO,CAAC,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACnE,OAAO,KAAK,CAAC,KAAK,CAAC;QACrB,CAAC;QAED,IAAI,IAAA,mBAAW,EAAC,KAAK,EAAE,SAAS,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACvE,OAAO,KAAK,CAAC,OAAO,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAZD,0CAYC","sourcesContent":["import { hasProperty, isObject } from '@metamask/utils';\n\nimport { CLIError } from '../errors';\n\n/**\n * Get the error message from an error in a Yargs `fail` handler. If the error\n * is not `undefined`, {@link getErrorMessage} is used to get the error message.\n * Otherwise, the given message is returned.\n *\n * @param message - The error message.\n * @param error - The error object. This may be `undefined`.\n * @returns The error message.\n */\nexport function getYargsErrorMessage(message: string, error?: unknown): string {\n if (error) {\n if (error instanceof CLIError) {\n return error.message;\n }\n\n return getErrorMessage(error);\n }\n\n return message;\n}\n\n/**\n * Get the error message from an error.\n *\n * - If the error is an object with a `stack` property, the `stack` property is\n * returned.\n * - If the error is an object with a `message` property, the `message`\n * property is returned.\n * - Otherwise, the error is converted to a string and returned.\n *\n * @param error - The error to get the message from.\n * @returns The error message.\n */\nexport function getErrorMessage(error: unknown): string {\n if (isObject(error)) {\n if (hasProperty(error, 'stack') && typeof error.stack === 'string') {\n return error.stack;\n }\n\n if (hasProperty(error, 'message') && typeof error.message === 'string') {\n return error.message;\n }\n }\n\n return String(error);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.cts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAU7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAYtD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the error message from an error in a Yargs `fail` handler. If the error
|
|
3
|
+
* is not `undefined`, {@link getErrorMessage} is used to get the error message.
|
|
4
|
+
* Otherwise, the given message is returned.
|
|
5
|
+
*
|
|
6
|
+
* @param message - The error message.
|
|
7
|
+
* @param error - The error object. This may be `undefined`.
|
|
8
|
+
* @returns The error message.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getYargsErrorMessage(message: string, error?: unknown): string;
|
|
11
|
+
/**
|
|
12
|
+
* Get the error message from an error.
|
|
13
|
+
*
|
|
14
|
+
* - If the error is an object with a `stack` property, the `stack` property is
|
|
15
|
+
* returned.
|
|
16
|
+
* - If the error is an object with a `message` property, the `message`
|
|
17
|
+
* property is returned.
|
|
18
|
+
* - Otherwise, the error is converted to a string and returned.
|
|
19
|
+
*
|
|
20
|
+
* @param error - The error to get the message from.
|
|
21
|
+
* @returns The error message.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getErrorMessage(error: unknown): string;
|
|
24
|
+
//# sourceMappingURL=errors.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAU7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAYtD"}
|
package/dist/utils/errors.mjs
CHANGED
|
@@ -1,11 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { hasProperty, isObject } from "@metamask/utils";
|
|
2
|
+
import { CLIError } from "../errors.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Get the error message from an error in a Yargs `fail` handler. If the error
|
|
5
|
+
* is not `undefined`, {@link getErrorMessage} is used to get the error message.
|
|
6
|
+
* Otherwise, the given message is returned.
|
|
7
|
+
*
|
|
8
|
+
* @param message - The error message.
|
|
9
|
+
* @param error - The error object. This may be `undefined`.
|
|
10
|
+
* @returns The error message.
|
|
11
|
+
*/
|
|
12
|
+
export function getYargsErrorMessage(message, error) {
|
|
13
|
+
if (error) {
|
|
14
|
+
if (error instanceof CLIError) {
|
|
15
|
+
return error.message;
|
|
16
|
+
}
|
|
17
|
+
return getErrorMessage(error);
|
|
18
|
+
}
|
|
19
|
+
return message;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the error message from an error.
|
|
23
|
+
*
|
|
24
|
+
* - If the error is an object with a `stack` property, the `stack` property is
|
|
25
|
+
* returned.
|
|
26
|
+
* - If the error is an object with a `message` property, the `message`
|
|
27
|
+
* property is returned.
|
|
28
|
+
* - Otherwise, the error is converted to a string and returned.
|
|
29
|
+
*
|
|
30
|
+
* @param error - The error to get the message from.
|
|
31
|
+
* @returns The error message.
|
|
32
|
+
*/
|
|
33
|
+
export function getErrorMessage(error) {
|
|
34
|
+
if (isObject(error)) {
|
|
35
|
+
if (hasProperty(error, 'stack') && typeof error.stack === 'string') {
|
|
36
|
+
return error.stack;
|
|
37
|
+
}
|
|
38
|
+
if (hasProperty(error, 'message') && typeof error.message === 'string') {
|
|
39
|
+
return error.message;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return String(error);
|
|
43
|
+
}
|
|
11
44
|
//# sourceMappingURL=errors.mjs.map
|