@metamask/snaps-cli 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/dist/{chunk-SUSC466E.mjs → chunk-24QJ2ZUZ.mjs} +2 -2
  3. package/dist/{chunk-G3COWLG5.mjs → chunk-2P3D6FNV.mjs} +2 -2
  4. package/dist/chunk-4A5QZUC7.mjs +68 -0
  5. package/dist/chunk-4A5QZUC7.mjs.map +1 -0
  6. package/dist/chunk-5IN3GGMV.js +68 -0
  7. package/dist/chunk-5IN3GGMV.js.map +1 -0
  8. package/dist/{chunk-QFK7JVP3.js → chunk-CB77QR32.js} +3 -3
  9. package/dist/{chunk-AKAP22EL.js → chunk-D2ZIM5W2.js} +17 -17
  10. package/dist/chunk-D2ZIM5W2.js.map +1 -0
  11. package/dist/{chunk-H6BLS7BI.js → chunk-G62Q4YO5.js} +3 -3
  12. package/dist/{chunk-S76EZ6HY.js → chunk-HAYK73YO.js} +3 -3
  13. package/dist/{chunk-HYPSSFE5.mjs → chunk-HLSCFGA7.mjs} +2 -2
  14. package/dist/chunk-HLSCFGA7.mjs.map +1 -0
  15. package/dist/{chunk-S45DIQPN.js → chunk-NGS23BTR.js} +2 -2
  16. package/dist/chunk-NGS23BTR.js.map +1 -0
  17. package/dist/{chunk-7P7JW53B.mjs → chunk-NR4OJOGX.mjs} +9 -9
  18. package/dist/chunk-NR4OJOGX.mjs.map +1 -0
  19. package/dist/{chunk-SK5KZWVS.mjs → chunk-OIFTFHZ4.mjs} +2 -2
  20. package/dist/{chunk-PFB25A2Q.mjs → chunk-QAM2JJRA.mjs} +2 -2
  21. package/dist/{chunk-QXP34HW3.js → chunk-ZVUF6JDJ.js} +3 -3
  22. package/dist/cli.js +4 -4
  23. package/dist/cli.mjs +3 -3
  24. package/dist/commands/index.js +5 -5
  25. package/dist/commands/index.mjs +4 -4
  26. package/dist/commands/manifest/implementation.js +2 -2
  27. package/dist/commands/manifest/implementation.mjs +1 -1
  28. package/dist/commands/manifest/index.js +4 -4
  29. package/dist/commands/manifest/index.mjs +3 -3
  30. package/dist/commands/manifest/manifest.js +3 -3
  31. package/dist/commands/manifest/manifest.mjs +2 -2
  32. package/dist/config.js +3 -3
  33. package/dist/config.mjs +2 -2
  34. package/dist/main.js +8 -8
  35. package/dist/main.mjs +7 -7
  36. package/dist/structs.js +2 -2
  37. package/dist/structs.mjs +1 -1
  38. package/dist/tsconfig.build.tsbuildinfo +1 -1
  39. package/dist/types/commands/eval/eval.d.ts +2 -2
  40. package/dist/types/commands/manifest/manifest.d.ts +1 -1
  41. package/dist/types/commands/serve/serve.d.ts +1 -1
  42. package/dist/types/commands/watch/watch.d.ts +1 -1
  43. package/dist/types/config.d.ts +109 -109
  44. package/dist/types/structs.d.ts +1 -1
  45. package/dist/types/utils/steps.d.ts +2 -2
  46. package/dist/types/webpack/config.d.ts +1 -1
  47. package/dist/types/webpack/loaders/function.d.ts +1 -1
  48. package/dist/types/webpack/plugins.d.ts +4 -4
  49. package/package.json +8 -8
  50. package/dist/chunk-2SUDRRT6.mjs +0 -50
  51. package/dist/chunk-2SUDRRT6.mjs.map +0 -1
  52. package/dist/chunk-7P7JW53B.mjs.map +0 -1
  53. package/dist/chunk-AKAP22EL.js.map +0 -1
  54. package/dist/chunk-HYPSSFE5.mjs.map +0 -1
  55. package/dist/chunk-S45DIQPN.js.map +0 -1
  56. package/dist/chunk-WP2N4NCO.js +0 -50
  57. package/dist/chunk-WP2N4NCO.js.map +0 -1
  58. /package/dist/{chunk-SUSC466E.mjs.map → chunk-24QJ2ZUZ.mjs.map} +0 -0
  59. /package/dist/{chunk-G3COWLG5.mjs.map → chunk-2P3D6FNV.mjs.map} +0 -0
  60. /package/dist/{chunk-QFK7JVP3.js.map → chunk-CB77QR32.js.map} +0 -0
  61. /package/dist/{chunk-H6BLS7BI.js.map → chunk-G62Q4YO5.js.map} +0 -0
  62. /package/dist/{chunk-S76EZ6HY.js.map → chunk-HAYK73YO.js.map} +0 -0
  63. /package/dist/{chunk-SK5KZWVS.mjs.map → chunk-OIFTFHZ4.mjs.map} +0 -0
  64. /package/dist/{chunk-PFB25A2Q.mjs.map → chunk-QAM2JJRA.mjs.map} +0 -0
  65. /package/dist/{chunk-QXP34HW3.js.map → chunk-ZVUF6JDJ.js.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  import type { ProcessedConfig } from '../../config';
2
- export declare type EvalOptions = {
2
+ export type EvalOptions = {
3
3
  input?: string;
4
4
  };
5
- export declare type EvalContext = Required<EvalOptions>;
5
+ export type EvalContext = Required<EvalOptions>;
6
6
  /**
7
7
  * Runs the snap in a worker, to ensure SES compatibility.
8
8
  *
@@ -1,5 +1,5 @@
1
1
  import type { ProcessedConfig } from '../../config';
2
- declare type ManifestOptions = {
2
+ type ManifestOptions = {
3
3
  fix?: boolean;
4
4
  };
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import type { ProcessedConfig } from '../../config';
2
- declare type ServeOptions = {
2
+ type ServeOptions = {
3
3
  /**
4
4
  * The port to listen on.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import type { ProcessedConfig } from '../../config';
2
- declare type WatchOptions = {
2
+ type WatchOptions = {
3
3
  /**
4
4
  * The port to listen on.
5
5
  */
@@ -1,5 +1,5 @@
1
+ import type { Infer } from '@metamask/superstruct';
1
2
  import type { BrowserifyObject } from 'browserify';
2
- import type { Infer } from 'superstruct';
3
3
  import type { Configuration as WebpackConfiguration } from 'webpack';
4
4
  import { TranspilationModes } from './builders';
5
5
  import type { YargsArgs } from './types/yargs';
@@ -10,7 +10,7 @@ import type { YargsArgs } from './types/yargs';
10
10
  * @deprecated The Browserify bundler is deprecated and will be removed in a
11
11
  * future release. Use the Webpack bundler instead.
12
12
  */
13
- export declare type SnapBrowserifyConfig = {
13
+ export type SnapBrowserifyConfig = {
14
14
  /**
15
15
  * The bundler to use to build the snap. For backwards compatibility, if not
16
16
  * specified, Browserify will be used. However, the Browserify bundler is
@@ -144,7 +144,7 @@ export declare type SnapBrowserifyConfig = {
144
144
  * The configuration for the Snaps CLI, stored as `snap.config.js` or
145
145
  * `snap.config.ts` in the root of the project.
146
146
  */
147
- export declare type SnapWebpackConfig = {
147
+ export type SnapWebpackConfig = {
148
148
  /**
149
149
  * The bundler to use to build the snap. For backwards compatibility, if not
150
150
  * specified, Browserify will be used. However, the Browserify bundler is
@@ -409,22 +409,22 @@ export declare type SnapWebpackConfig = {
409
409
  * The configuration for the Snaps CLI, stored as `snap.config.js` or
410
410
  * `snap.config.ts` in the root of the project.
411
411
  */
412
- export declare type SnapConfig = SnapBrowserifyConfig | SnapWebpackConfig;
413
- declare type SnapsBrowserifyBundlerCustomizerFunction = (bundler: BrowserifyObject) => void;
414
- export declare const SnapsBrowserifyConfigStruct: import("superstruct").Struct<{
412
+ export type SnapConfig = SnapBrowserifyConfig | SnapWebpackConfig;
413
+ type SnapsBrowserifyBundlerCustomizerFunction = (bundler: BrowserifyObject) => void;
414
+ export declare const SnapsBrowserifyConfigStruct: import("@metamask/superstruct").Struct<{
415
415
  bundler: "browserify";
416
416
  cliOptions: {
417
417
  port: number;
418
- src: string;
419
418
  dist: string;
420
419
  eval: boolean;
421
420
  manifest: boolean;
422
421
  outfileName: string;
423
422
  root: string;
424
423
  sourceMaps: boolean;
424
+ src: string;
425
425
  stripComments: boolean;
426
426
  suppressWarnings: boolean;
427
- transpilationMode: "none" | "localAndDeps" | "localOnly";
427
+ transpilationMode: "localAndDeps" | "localOnly" | "none";
428
428
  depsToTranspile: string[];
429
429
  verboseErrors: boolean;
430
430
  writeManifest: boolean;
@@ -433,46 +433,46 @@ export declare const SnapsBrowserifyConfigStruct: import("superstruct").Struct<{
433
433
  };
434
434
  bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
435
435
  }, {
436
- bundler: import("superstruct").Struct<"browserify", null>;
437
- cliOptions: import("superstruct").Struct<{
436
+ bundler: import("@metamask/superstruct").Struct<"browserify", null>;
437
+ cliOptions: import("@metamask/superstruct").Struct<{
438
438
  port: number;
439
- src: string;
440
439
  dist: string;
441
440
  eval: boolean;
442
441
  manifest: boolean;
443
442
  outfileName: string;
444
443
  root: string;
445
444
  sourceMaps: boolean;
445
+ src: string;
446
446
  stripComments: boolean;
447
447
  suppressWarnings: boolean;
448
- transpilationMode: "none" | "localAndDeps" | "localOnly";
448
+ transpilationMode: "localAndDeps" | "localOnly" | "none";
449
449
  depsToTranspile: string[];
450
450
  verboseErrors: boolean;
451
451
  writeManifest: boolean;
452
452
  serve: boolean;
453
453
  bundle?: string | undefined;
454
454
  }, {
455
- bundle: import("superstruct").Struct<string | undefined, null>;
456
- dist: import("superstruct").Struct<string, null>;
457
- eval: import("superstruct").Struct<boolean, null>;
458
- manifest: import("superstruct").Struct<boolean, null>;
459
- port: import("superstruct").Struct<number, null>;
460
- outfileName: import("superstruct").Struct<string, null>;
461
- root: import("superstruct").Struct<string, null>;
462
- sourceMaps: import("superstruct").Struct<boolean, null>;
463
- src: import("superstruct").Struct<string, null>;
464
- stripComments: import("superstruct").Struct<boolean, null>;
465
- suppressWarnings: import("superstruct").Struct<boolean, null>;
466
- transpilationMode: import("superstruct").Struct<"none" | "localAndDeps" | "localOnly", [import("superstruct").Struct<"localAndDeps", null>, import("superstruct").Struct<"localOnly", null>, import("superstruct").Struct<"none", null>]>;
467
- depsToTranspile: import("superstruct").Struct<string[], import("superstruct").Struct<string, null>>;
468
- verboseErrors: import("superstruct").Struct<boolean, null>;
469
- writeManifest: import("superstruct").Struct<boolean, null>;
470
- serve: import("superstruct").Struct<boolean, null>;
455
+ bundle: import("@metamask/superstruct").Struct<string | undefined, null>;
456
+ dist: import("@metamask/superstruct").Struct<string, null>;
457
+ eval: import("@metamask/superstruct").Struct<boolean, null>;
458
+ manifest: import("@metamask/superstruct").Struct<boolean, null>;
459
+ port: import("@metamask/superstruct").Struct<number, null>;
460
+ outfileName: import("@metamask/superstruct").Struct<string, null>;
461
+ root: import("@metamask/superstruct").Struct<string, null>;
462
+ sourceMaps: import("@metamask/superstruct").Struct<boolean, null>;
463
+ src: import("@metamask/superstruct").Struct<string, null>;
464
+ stripComments: import("@metamask/superstruct").Struct<boolean, null>;
465
+ suppressWarnings: import("@metamask/superstruct").Struct<boolean, null>;
466
+ transpilationMode: import("@metamask/superstruct").Struct<"localAndDeps" | "localOnly" | "none", [import("@metamask/superstruct").Struct<"localAndDeps", null>, import("@metamask/superstruct").Struct<"localOnly", null>, import("@metamask/superstruct").Struct<"none", null>]>;
467
+ depsToTranspile: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
468
+ verboseErrors: import("@metamask/superstruct").Struct<boolean, null>;
469
+ writeManifest: import("@metamask/superstruct").Struct<boolean, null>;
470
+ serve: import("@metamask/superstruct").Struct<boolean, null>;
471
471
  }>;
472
- bundlerCustomizer: import("superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
472
+ bundlerCustomizer: import("@metamask/superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
473
473
  }>;
474
- declare type SnapsWebpackCustomizeWebpackConfigFunction = (config: WebpackConfiguration) => WebpackConfiguration;
475
- export declare const SnapsWebpackConfigStruct: import("superstruct").Struct<{
474
+ type SnapsWebpackCustomizeWebpackConfigFunction = (config: WebpackConfiguration) => WebpackConfiguration;
475
+ export declare const SnapsWebpackConfigStruct: import("@metamask/superstruct").Struct<{
476
476
  input: string;
477
477
  server: {
478
478
  port: number;
@@ -538,56 +538,56 @@ export declare const SnapsWebpackConfigStruct: import("superstruct").Struct<{
538
538
  };
539
539
  customizeWebpackConfig?: SnapsWebpackCustomizeWebpackConfigFunction | undefined;
540
540
  }, {
541
- bundler: import("superstruct").Struct<"webpack", null>;
542
- input: import("superstruct").Struct<string, null>;
543
- sourceMap: import("superstruct").Struct<boolean | "inline", [import("superstruct").Struct<boolean, null>, import("superstruct").Struct<"inline", null>]>;
544
- evaluate: import("superstruct").Struct<boolean, null>;
545
- output: import("superstruct").Struct<{
541
+ bundler: import("@metamask/superstruct").Struct<"webpack", null>;
542
+ input: import("@metamask/superstruct").Struct<string, null>;
543
+ sourceMap: import("@metamask/superstruct").Struct<boolean | "inline", [import("@metamask/superstruct").Struct<boolean, null>, import("@metamask/superstruct").Struct<"inline", null>]>;
544
+ evaluate: import("@metamask/superstruct").Struct<boolean, null>;
545
+ output: import("@metamask/superstruct").Struct<{
546
546
  path: string;
547
547
  filename: string;
548
548
  minimize: boolean;
549
549
  clean: boolean;
550
550
  }, {
551
- path: import("superstruct").Struct<string, null>;
552
- filename: import("superstruct").Struct<string, null>;
553
- clean: import("superstruct").Struct<boolean, null>;
554
- minimize: import("superstruct").Struct<boolean, null>;
551
+ path: import("@metamask/superstruct").Struct<string, null>;
552
+ filename: import("@metamask/superstruct").Struct<string, null>;
553
+ clean: import("@metamask/superstruct").Struct<boolean, null>;
554
+ minimize: import("@metamask/superstruct").Struct<boolean, null>;
555
555
  }>;
556
- manifest: import("superstruct").Struct<{
556
+ manifest: import("@metamask/superstruct").Struct<{
557
557
  path: string;
558
558
  update: boolean;
559
559
  }, {
560
- path: import("superstruct").Struct<string, null>;
561
- update: import("superstruct").Struct<boolean, null>;
560
+ path: import("@metamask/superstruct").Struct<string, null>;
561
+ update: import("@metamask/superstruct").Struct<boolean, null>;
562
562
  }>;
563
- server: import("superstruct").Struct<{
563
+ server: import("@metamask/superstruct").Struct<{
564
564
  port: number;
565
565
  root: string;
566
566
  enabled: boolean;
567
567
  }, {
568
- enabled: import("superstruct").Struct<boolean, null>;
569
- root: import("superstruct").Struct<string, null>;
570
- port: import("superstruct").Struct<number, null>;
568
+ enabled: import("@metamask/superstruct").Struct<boolean, null>;
569
+ root: import("@metamask/superstruct").Struct<string, null>;
570
+ port: import("@metamask/superstruct").Struct<number, null>;
571
571
  }>;
572
- environment: import("superstruct").Struct<Record<string, unknown>, null>;
573
- stats: import("superstruct").Struct<{
572
+ environment: import("@metamask/superstruct").Struct<Record<string, unknown>, null>;
573
+ stats: import("@metamask/superstruct").Struct<{
574
574
  buffer: boolean;
575
575
  verbose: boolean;
576
576
  builtIns: false | {
577
577
  ignore: string[];
578
578
  };
579
579
  }, {
580
- verbose: import("superstruct").Struct<boolean, null>;
581
- builtIns: import("superstruct").Struct<false | {
580
+ verbose: import("@metamask/superstruct").Struct<boolean, null>;
581
+ builtIns: import("@metamask/superstruct").Struct<false | {
582
582
  ignore: string[];
583
- }, [import("superstruct").Struct<{
583
+ }, [import("@metamask/superstruct").Struct<{
584
584
  ignore: string[];
585
585
  }, {
586
- ignore: import("superstruct").Struct<string[], import("superstruct").Struct<string, null>>;
587
- }>, import("superstruct").Struct<false, null>]>;
588
- buffer: import("superstruct").Struct<boolean, null>;
586
+ ignore: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
587
+ }>, import("@metamask/superstruct").Struct<false, null>]>;
588
+ buffer: import("@metamask/superstruct").Struct<boolean, null>;
589
589
  }>;
590
- polyfills: import("superstruct").Struct<boolean | {
590
+ polyfills: import("@metamask/superstruct").Struct<boolean | {
591
591
  path: boolean;
592
592
  assert: boolean;
593
593
  buffer: boolean;
@@ -616,7 +616,7 @@ export declare const SnapsWebpackConfigStruct: import("superstruct").Struct<{
616
616
  tty: boolean;
617
617
  util: boolean;
618
618
  vm: boolean;
619
- }, [import("superstruct").Struct<boolean, null>, import("superstruct").Struct<{
619
+ }, [import("@metamask/superstruct").Struct<boolean, null>, import("@metamask/superstruct").Struct<{
620
620
  path: boolean;
621
621
  assert: boolean;
622
622
  buffer: boolean;
@@ -646,53 +646,53 @@ export declare const SnapsWebpackConfigStruct: import("superstruct").Struct<{
646
646
  util: boolean;
647
647
  vm: boolean;
648
648
  }, {
649
- assert: import("superstruct").Struct<boolean, null>;
650
- buffer: import("superstruct").Struct<boolean, null>;
651
- console: import("superstruct").Struct<boolean, null>;
652
- constants: import("superstruct").Struct<boolean, null>;
653
- crypto: import("superstruct").Struct<boolean, null>;
654
- domain: import("superstruct").Struct<boolean, null>;
655
- events: import("superstruct").Struct<boolean, null>;
656
- http: import("superstruct").Struct<boolean, null>;
657
- https: import("superstruct").Struct<boolean, null>;
658
- os: import("superstruct").Struct<boolean, null>;
659
- path: import("superstruct").Struct<boolean, null>;
660
- punycode: import("superstruct").Struct<boolean, null>;
661
- process: import("superstruct").Struct<boolean, null>;
662
- querystring: import("superstruct").Struct<boolean, null>;
663
- stream: import("superstruct").Struct<boolean, null>;
664
- _stream_duplex: import("superstruct").Struct<boolean, null>;
665
- _stream_passthrough: import("superstruct").Struct<boolean, null>;
666
- _stream_readable: import("superstruct").Struct<boolean, null>;
667
- _stream_transform: import("superstruct").Struct<boolean, null>;
668
- _stream_writable: import("superstruct").Struct<boolean, null>;
669
- string_decoder: import("superstruct").Struct<boolean, null>;
670
- sys: import("superstruct").Struct<boolean, null>;
671
- timers: import("superstruct").Struct<boolean, null>;
672
- tty: import("superstruct").Struct<boolean, null>;
673
- url: import("superstruct").Struct<boolean, null>;
674
- util: import("superstruct").Struct<boolean, null>;
675
- vm: import("superstruct").Struct<boolean, null>;
676
- zlib: import("superstruct").Struct<boolean, null>;
649
+ assert: import("@metamask/superstruct").Struct<boolean, null>;
650
+ buffer: import("@metamask/superstruct").Struct<boolean, null>;
651
+ console: import("@metamask/superstruct").Struct<boolean, null>;
652
+ constants: import("@metamask/superstruct").Struct<boolean, null>;
653
+ crypto: import("@metamask/superstruct").Struct<boolean, null>;
654
+ domain: import("@metamask/superstruct").Struct<boolean, null>;
655
+ events: import("@metamask/superstruct").Struct<boolean, null>;
656
+ http: import("@metamask/superstruct").Struct<boolean, null>;
657
+ https: import("@metamask/superstruct").Struct<boolean, null>;
658
+ os: import("@metamask/superstruct").Struct<boolean, null>;
659
+ path: import("@metamask/superstruct").Struct<boolean, null>;
660
+ punycode: import("@metamask/superstruct").Struct<boolean, null>;
661
+ process: import("@metamask/superstruct").Struct<boolean, null>;
662
+ querystring: import("@metamask/superstruct").Struct<boolean, null>;
663
+ stream: import("@metamask/superstruct").Struct<boolean, null>;
664
+ _stream_duplex: import("@metamask/superstruct").Struct<boolean, null>;
665
+ _stream_passthrough: import("@metamask/superstruct").Struct<boolean, null>;
666
+ _stream_readable: import("@metamask/superstruct").Struct<boolean, null>;
667
+ _stream_transform: import("@metamask/superstruct").Struct<boolean, null>;
668
+ _stream_writable: import("@metamask/superstruct").Struct<boolean, null>;
669
+ string_decoder: import("@metamask/superstruct").Struct<boolean, null>;
670
+ sys: import("@metamask/superstruct").Struct<boolean, null>;
671
+ timers: import("@metamask/superstruct").Struct<boolean, null>;
672
+ tty: import("@metamask/superstruct").Struct<boolean, null>;
673
+ url: import("@metamask/superstruct").Struct<boolean, null>;
674
+ util: import("@metamask/superstruct").Struct<boolean, null>;
675
+ vm: import("@metamask/superstruct").Struct<boolean, null>;
676
+ zlib: import("@metamask/superstruct").Struct<boolean, null>;
677
677
  }>]>;
678
- features: import("superstruct").Struct<{
678
+ features: import("@metamask/superstruct").Struct<{
679
679
  images: boolean;
680
680
  }, {
681
- images: import("superstruct").Struct<boolean, null>;
681
+ images: import("@metamask/superstruct").Struct<boolean, null>;
682
682
  }>;
683
- customizeWebpackConfig: import("superstruct").Struct<SnapsWebpackCustomizeWebpackConfigFunction | undefined, null>;
684
- experimental: import("superstruct").Struct<{
683
+ customizeWebpackConfig: import("@metamask/superstruct").Struct<SnapsWebpackCustomizeWebpackConfigFunction | undefined, null>;
684
+ experimental: import("@metamask/superstruct").Struct<{
685
685
  wasm: boolean;
686
686
  }, {
687
- wasm: import("superstruct").Struct<boolean, null>;
687
+ wasm: import("@metamask/superstruct").Struct<boolean, null>;
688
688
  }>;
689
689
  }>;
690
- export declare const SnapsConfigStruct: import("superstruct").Struct<{
690
+ export declare const SnapsConfigStruct: import("@metamask/superstruct").Struct<{
691
691
  bundler: "browserify" | "webpack";
692
692
  }, {
693
- bundler: import("superstruct").Struct<"browserify" | "webpack", [import("superstruct").Struct<"browserify", null>, import("superstruct").Struct<"webpack", null>]>;
693
+ bundler: import("@metamask/superstruct").Struct<"browserify" | "webpack", [import("@metamask/superstruct").Struct<"browserify", null>, import("@metamask/superstruct").Struct<"webpack", null>]>;
694
694
  }>;
695
- export declare const LegacyOptionsStruct: import("superstruct").Struct<{
695
+ export declare const LegacyOptionsStruct: import("@metamask/superstruct").Struct<{
696
696
  transpilationMode: TranspilationModes.LocalAndDeps;
697
697
  depsToTranspile: string[];
698
698
  writeManifest: boolean;
@@ -702,37 +702,37 @@ export declare const LegacyOptionsStruct: import("superstruct").Struct<{
702
702
  depsToTranspile: unknown[];
703
703
  writeManifest: boolean;
704
704
  bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
705
- }, [import("superstruct").Struct<{
705
+ }, [import("@metamask/superstruct").Struct<{
706
706
  transpilationMode: TranspilationModes.LocalAndDeps;
707
707
  depsToTranspile: string[];
708
708
  writeManifest: boolean;
709
709
  bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
710
710
  }, {
711
- depsToTranspile: import("superstruct").Struct<string[], import("superstruct").Struct<string, null>>;
712
- transpilationMode: import("superstruct").Struct<TranspilationModes.LocalAndDeps, null>;
713
- writeManifest: import("superstruct").Struct<boolean, null>;
714
- bundlerCustomizer: import("superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
715
- }>, import("superstruct").Struct<{
711
+ depsToTranspile: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
712
+ transpilationMode: import("@metamask/superstruct").Struct<TranspilationModes.LocalAndDeps, null>;
713
+ writeManifest: import("@metamask/superstruct").Struct<boolean, null>;
714
+ bundlerCustomizer: import("@metamask/superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
715
+ }>, import("@metamask/superstruct").Struct<{
716
716
  transpilationMode: TranspilationModes.LocalOnly | TranspilationModes.None;
717
717
  depsToTranspile: unknown[];
718
718
  writeManifest: boolean;
719
719
  bundlerCustomizer?: SnapsBrowserifyBundlerCustomizerFunction | undefined;
720
720
  }, {
721
- depsToTranspile: import("superstruct").Struct<unknown[], undefined>;
722
- transpilationMode: import("superstruct").Struct<TranspilationModes.LocalOnly | TranspilationModes.None, [import("superstruct").Struct<TranspilationModes.LocalOnly, null>, import("superstruct").Struct<TranspilationModes.None, null>]>;
723
- writeManifest: import("superstruct").Struct<boolean, null>;
724
- bundlerCustomizer: import("superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
721
+ depsToTranspile: import("@metamask/superstruct").Struct<unknown[], undefined>;
722
+ transpilationMode: import("@metamask/superstruct").Struct<TranspilationModes.LocalOnly | TranspilationModes.None, [import("@metamask/superstruct").Struct<TranspilationModes.LocalOnly, null>, import("@metamask/superstruct").Struct<TranspilationModes.None, null>]>;
723
+ writeManifest: import("@metamask/superstruct").Struct<boolean, null>;
724
+ bundlerCustomizer: import("@metamask/superstruct").Struct<SnapsBrowserifyBundlerCustomizerFunction | undefined, null>;
725
725
  }>]>;
726
- export declare type LegacyOptions = Infer<typeof LegacyOptionsStruct>;
727
- export declare type ProcessedBrowserifyConfig = Infer<typeof SnapsBrowserifyConfigStruct>;
728
- export declare type ProcessedWebpackConfig = Infer<typeof SnapsWebpackConfigStruct> & {
726
+ export type LegacyOptions = Infer<typeof LegacyOptionsStruct>;
727
+ export type ProcessedBrowserifyConfig = Infer<typeof SnapsBrowserifyConfigStruct>;
728
+ export type ProcessedWebpackConfig = Infer<typeof SnapsWebpackConfigStruct> & {
729
729
  /**
730
730
  * The legacy Browserify config, if the bundler is Browserify. This is used
731
731
  * to support the legacy config format.
732
732
  */
733
733
  legacy?: LegacyOptions;
734
734
  };
735
- export declare type ProcessedConfig = ProcessedWebpackConfig;
735
+ export type ProcessedConfig = ProcessedWebpackConfig;
736
736
  /**
737
737
  * Get a validated snap config. This validates the config and adds default
738
738
  * values for any missing properties.
@@ -790,16 +790,16 @@ export declare function getConfigByArgv(argv: YargsArgs, cwd?: string): Promise<
790
790
  export declare function mergeLegacyOptions(argv: YargsArgs, config: ProcessedBrowserifyConfig): {
791
791
  cliOptions: {
792
792
  port: number;
793
- src: string;
794
793
  dist: string;
795
794
  eval: boolean;
796
795
  manifest: boolean;
797
796
  outfileName: string;
798
797
  root: string;
799
798
  sourceMaps: boolean;
799
+ src: string;
800
800
  stripComments: boolean;
801
801
  suppressWarnings: boolean;
802
- transpilationMode: "none" | "localAndDeps" | "localOnly";
802
+ transpilationMode: "localAndDeps" | "localOnly" | "none";
803
803
  depsToTranspile: string[];
804
804
  verboseErrors: boolean;
805
805
  writeManifest: boolean;
@@ -17,4 +17,4 @@
17
17
  * console.log(value.file); // /process/cwd/path/to/file
18
18
  * ```
19
19
  */
20
- export declare function file(): import("superstruct").Struct<string, null>;
20
+ export declare function file(): import("@metamask/superstruct").Struct<string, null>;
@@ -1,12 +1,12 @@
1
1
  import type { Ora } from 'ora';
2
- export declare type Step<Context extends Record<string, unknown>> = {
2
+ export type Step<Context extends Record<string, unknown>> = {
3
3
  name: string;
4
4
  condition?: (context: Context) => boolean;
5
5
  task: (context: Context & {
6
6
  spinner: Ora;
7
7
  }) => Promise<void>;
8
8
  };
9
- export declare type Steps<Context extends Record<string, unknown>> = Readonly<Step<Context>[]>;
9
+ export type Steps<Context extends Record<string, unknown>> = Readonly<Step<Context>[]>;
10
10
  /**
11
11
  * Execute a list of steps in series. Each step receives the context object and
12
12
  * a spinner instance.
@@ -1,7 +1,7 @@
1
1
  import type { Ora } from 'ora';
2
2
  import type { Configuration } from 'webpack';
3
3
  import type { ProcessedWebpackConfig } from '../config';
4
- export declare type WebpackOptions = {
4
+ export type WebpackOptions = {
5
5
  /**
6
6
  * Whether to watch for changes.
7
7
  */
@@ -2,7 +2,7 @@ import type { LoaderDefinitionFunction } from 'webpack';
2
2
  /**
3
3
  * Options for the function loader.
4
4
  */
5
- export declare type FunctionLoaderOptions = {
5
+ export type FunctionLoaderOptions = {
6
6
  /**
7
7
  * The function to execute. This is bound to the loader context, so it can
8
8
  * access the loader options and other properties.
@@ -1,6 +1,6 @@
1
1
  import type { Ora } from 'ora';
2
2
  import type { Compiler, ResolvePluginInstance, Resolver, WebpackPluginInstance } from 'webpack';
3
- export declare type SnapsStatsPluginOptions = {
3
+ export type SnapsStatsPluginOptions = {
4
4
  /**
5
5
  * Whether to log the verbose stats.
6
6
  */
@@ -27,7 +27,7 @@ export declare class SnapsStatsPlugin implements WebpackPluginInstance {
27
27
  /**
28
28
  * The options for the {@link SnapsWatchPlugin}.
29
29
  */
30
- export declare type SnapsWatchPluginOptions = {
30
+ export type SnapsWatchPluginOptions = {
31
31
  /**
32
32
  * The bundle path. This is the file that will be evaluated, if the `evaluate`
33
33
  * option is set.
@@ -65,7 +65,7 @@ export declare class SnapsWatchPlugin implements WebpackPluginInstance {
65
65
  /**
66
66
  * The options for the {@link SnapsBuiltInResolver}.
67
67
  */
68
- export declare type SnapsBuiltInResolverOptions = {
68
+ export type SnapsBuiltInResolverOptions = {
69
69
  /**
70
70
  * The built-in modules to ignore.
71
71
  */
@@ -98,7 +98,7 @@ export declare class SnapsBuiltInResolver implements ResolvePluginInstance {
98
98
  /**
99
99
  * The options for the {@link SnapsBundleWarningsPlugin}.
100
100
  */
101
- export declare type SnapsBundleWarningsPluginOptions = {
101
+ export type SnapsBundleWarningsPluginOptions = {
102
102
  /**
103
103
  * The {@link SnapsBuiltInResolver} instance to use for detecting built-in
104
104
  * modules.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-cli",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "description": "A CLI for developing MetaMask Snaps.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,10 +57,11 @@
57
57
  "@babel/plugin-transform-runtime": "^7.13.2",
58
58
  "@babel/preset-env": "^7.23.2",
59
59
  "@babel/preset-typescript": "^7.23.2",
60
- "@metamask/snaps-sdk": "^4.1.0",
61
- "@metamask/snaps-utils": "^7.3.0",
62
- "@metamask/snaps-webpack-plugin": "^4.0.1",
63
- "@metamask/utils": "^8.3.0",
60
+ "@metamask/snaps-sdk": "^6.2.0",
61
+ "@metamask/snaps-utils": "^8.0.0",
62
+ "@metamask/snaps-webpack-plugin": "^4.1.0",
63
+ "@metamask/superstruct": "^3.1.0",
64
+ "@metamask/utils": "^9.1.0",
64
65
  "@swc/core": "1.3.78",
65
66
  "assert": "^2.0.0",
66
67
  "babelify": "^10.0.0",
@@ -87,7 +88,6 @@
87
88
  "stream-http": "^3.2.0",
88
89
  "string_decoder": "^1.3.0",
89
90
  "strip-ansi": "^6.0.1",
90
- "superstruct": "^1.0.3",
91
91
  "swc-loader": "^0.2.3",
92
92
  "terser-webpack-plugin": "^5.3.9",
93
93
  "timers-browserify": "^2.0.12",
@@ -100,7 +100,7 @@
100
100
  "yargs": "^17.7.1"
101
101
  },
102
102
  "devDependencies": {
103
- "@lavamoat/allow-scripts": "^3.0.3",
103
+ "@lavamoat/allow-scripts": "^3.0.4",
104
104
  "@metamask/auto-changelog": "^3.4.4",
105
105
  "@metamask/eslint-config": "^12.1.0",
106
106
  "@metamask/eslint-config-jest": "^12.1.0",
@@ -136,7 +136,7 @@
136
136
  "ts-node": "^10.9.1",
137
137
  "tsc-watch": "^4.5.0",
138
138
  "tsup": "^8.0.1",
139
- "typescript": "~4.8.4"
139
+ "typescript": "~5.0.4"
140
140
  },
141
141
  "engines": {
142
142
  "node": "^18.16 || >=20"
@@ -1,50 +0,0 @@
1
- import {
2
- error,
3
- info,
4
- warn
5
- } from "./chunk-ZAW4ZWQX.mjs";
6
-
7
- // src/commands/manifest/implementation.ts
8
- import { checkManifest, indent } from "@metamask/snaps-utils/node";
9
- import { red, yellow } from "chalk";
10
- import { dirname } from "path";
11
- async function manifest(path, write, spinner) {
12
- const { warnings, errors, updated } = await checkManifest(
13
- dirname(path),
14
- write
15
- );
16
- if (write && updated) {
17
- info("The snap manifest file has been updated.", spinner);
18
- }
19
- if (!write && errors.length > 0) {
20
- const formattedErrors = errors.map((manifestError) => indent(red(`\u2022 ${manifestError}`))).join("\n");
21
- error(
22
- `The snap manifest file is invalid.
23
-
24
- ${formattedErrors}
25
-
26
- Run the command with the \`--fix\` flag to attempt to fix the manifest.`,
27
- spinner
28
- );
29
- spinner?.stop();
30
- process.exitCode = 1;
31
- return false;
32
- }
33
- if (warnings.length > 0) {
34
- const formattedWarnings = warnings.map(
35
- (manifestWarning) => indent(yellow(`\u2022 ${manifestWarning}`))
36
- );
37
- warn(
38
- `The snap manifest file has warnings.
39
-
40
- ${formattedWarnings.join("\n")}`,
41
- spinner
42
- );
43
- }
44
- return true;
45
- }
46
-
47
- export {
48
- manifest
49
- };
50
- //# sourceMappingURL=chunk-2SUDRRT6.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/manifest/implementation.ts"],"sourcesContent":["import { checkManifest, indent } from '@metamask/snaps-utils/node';\nimport { red, yellow } from 'chalk';\nimport type { Ora } from 'ora';\nimport { dirname } from 'path';\n\nimport { error, info, warn } from '../../utils';\n\n/**\n * Check the snap manifest file at the given path. If `write` is `true`, the\n * manifest will be written to disk if it is invalid. If `write` is `false`,\n * the manifest will not be written to disk, and the function will log any\n * errors and warnings to the console.\n *\n * @param path - The path to the manifest file.\n * @param write - Whether to write the manifest to disk if it is invalid.\n * @param spinner - An optional spinner to use for logging.\n */\nexport async function manifest(\n path: string,\n write: boolean,\n spinner?: Ora,\n): Promise<boolean> {\n const { warnings, errors, updated } = await checkManifest(\n dirname(path),\n write,\n );\n\n if (write && updated) {\n info('The snap manifest file has been updated.', spinner);\n }\n\n if (!write && errors.length > 0) {\n const formattedErrors = errors\n .map((manifestError) => indent(red(`• ${manifestError}`)))\n .join('\\n');\n\n error(\n `The snap manifest file is invalid.\\n\\n${formattedErrors}\\n\\nRun the command with the \\`--fix\\` flag to attempt to fix the manifest.`,\n spinner,\n );\n\n spinner?.stop();\n process.exitCode = 1;\n return false;\n }\n\n if (warnings.length > 0) {\n const formattedWarnings = warnings.map((manifestWarning) =>\n indent(yellow(`• ${manifestWarning}`)),\n );\n\n warn(\n `The snap manifest file has warnings.\\n\\n${formattedWarnings.join('\\n')}`,\n spinner,\n );\n }\n\n return true;\n}\n"],"mappings":";;;;;;;AAAA,SAAS,eAAe,cAAc;AACtC,SAAS,KAAK,cAAc;AAE5B,SAAS,eAAe;AAcxB,eAAsB,SACpB,MACA,OACA,SACkB;AAClB,QAAM,EAAE,UAAU,QAAQ,QAAQ,IAAI,MAAM;AAAA,IAC1C,QAAQ,IAAI;AAAA,IACZ;AAAA,EACF;AAEA,MAAI,SAAS,SAAS;AACpB,SAAK,4CAA4C,OAAO;AAAA,EAC1D;AAEA,MAAI,CAAC,SAAS,OAAO,SAAS,GAAG;AAC/B,UAAM,kBAAkB,OACrB,IAAI,CAAC,kBAAkB,OAAO,IAAI,UAAK,aAAa,EAAE,CAAC,CAAC,EACxD,KAAK,IAAI;AAEZ;AAAA,MACE;AAAA;AAAA,EAAyC,eAAe;AAAA;AAAA;AAAA,MACxD;AAAA,IACF;AAEA,aAAS,KAAK;AACd,YAAQ,WAAW;AACnB,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,SAAS,GAAG;AACvB,UAAM,oBAAoB,SAAS;AAAA,MAAI,CAAC,oBACtC,OAAO,OAAO,UAAK,eAAe,EAAE,CAAC;AAAA,IACvC;AAEA;AAAA,MACE;AAAA;AAAA,EAA2C,kBAAkB,KAAK,IAAI,CAAC;AAAA,MACvE;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}