@metamask/snaps-cli 0.14.0 → 0.17.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 (70) hide show
  1. package/README.md +5 -2
  2. package/dist/builders.d.ts +6 -0
  3. package/dist/builders.js +20 -1
  4. package/dist/builders.js.map +1 -1
  5. package/dist/cli.d.ts +7 -0
  6. package/dist/cli.js +8 -0
  7. package/dist/cli.js.map +1 -1
  8. package/dist/cmds/build/buildHandler.d.ts +4 -4
  9. package/dist/cmds/build/buildHandler.js +4 -4
  10. package/dist/cmds/build/buildHandler.js.map +1 -1
  11. package/dist/cmds/build/bundle.d.ts +4 -2
  12. package/dist/cmds/build/bundle.js +13 -4
  13. package/dist/cmds/build/bundle.js.map +1 -1
  14. package/dist/cmds/build/utils.d.ts +21 -8
  15. package/dist/cmds/build/utils.js +21 -8
  16. package/dist/cmds/build/utils.js.map +1 -1
  17. package/dist/cmds/eval/eval-worker.js +19 -9
  18. package/dist/cmds/eval/eval-worker.js.map +1 -1
  19. package/dist/cmds/eval/evalHandler.d.ts +7 -0
  20. package/dist/cmds/eval/evalHandler.js +7 -0
  21. package/dist/cmds/eval/evalHandler.js.map +1 -1
  22. package/dist/cmds/eval/mock.d.ts +11 -0
  23. package/dist/cmds/eval/mock.js +36 -1
  24. package/dist/cmds/eval/mock.js.map +1 -1
  25. package/dist/cmds/eval/workerEval.d.ts +7 -0
  26. package/dist/cmds/eval/workerEval.js +11 -6
  27. package/dist/cmds/eval/workerEval.js.map +1 -1
  28. package/dist/cmds/index.d.ts +1 -0
  29. package/dist/cmds/init/index.js +13 -1
  30. package/dist/cmds/init/index.js.map +1 -1
  31. package/dist/cmds/init/init-template.json +5 -1
  32. package/dist/cmds/init/initHandler.d.ts +11 -0
  33. package/dist/cmds/init/initHandler.js +38 -3
  34. package/dist/cmds/init/initHandler.js.map +1 -1
  35. package/dist/cmds/init/initUtils.d.ts +21 -4
  36. package/dist/cmds/init/initUtils.js +55 -7
  37. package/dist/cmds/init/initUtils.js.map +1 -1
  38. package/dist/cmds/manifest/manifestHandler.d.ts +1 -0
  39. package/dist/cmds/manifest/manifestHandler.js +6 -0
  40. package/dist/cmds/manifest/manifestHandler.js.map +1 -1
  41. package/dist/cmds/serve/index.js +2 -44
  42. package/dist/cmds/serve/index.js.map +1 -1
  43. package/dist/cmds/serve/serveHandler.d.ts +10 -0
  44. package/dist/cmds/serve/serveHandler.js +51 -0
  45. package/dist/cmds/serve/serveHandler.js.map +1 -0
  46. package/dist/cmds/serve/serveUtils.d.ts +17 -0
  47. package/dist/cmds/serve/serveUtils.js +17 -0
  48. package/dist/cmds/serve/serveUtils.js.map +1 -1
  49. package/dist/cmds/watch/index.js +3 -0
  50. package/dist/cmds/watch/index.js.map +1 -1
  51. package/dist/cmds/watch/watchHandler.d.ts +4 -4
  52. package/dist/cmds/watch/watchHandler.js +12 -6
  53. package/dist/cmds/watch/watchHandler.js.map +1 -1
  54. package/dist/utils/fs.d.ts +5 -5
  55. package/dist/utils/fs.js +5 -5
  56. package/dist/utils/fs.js.map +1 -1
  57. package/dist/utils/misc.d.ts +16 -13
  58. package/dist/utils/misc.js +19 -15
  59. package/dist/utils/misc.js.map +1 -1
  60. package/dist/utils/readline.d.ts +25 -0
  61. package/dist/utils/readline.js +25 -0
  62. package/dist/utils/readline.js.map +1 -1
  63. package/dist/utils/snap-config.d.ts +15 -0
  64. package/dist/utils/snap-config.js +18 -4
  65. package/dist/utils/snap-config.js.map +1 -1
  66. package/dist/utils/validate-fs.d.ts +19 -18
  67. package/dist/utils/validate-fs.js +21 -20
  68. package/dist/utils/validate-fs.js.map +1 -1
  69. package/package.json +20 -19
  70. package/CHANGELOG.md +0 -209
package/CHANGELOG.md DELETED
@@ -1,209 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
7
- ## [Unreleased]
8
-
9
- ## [0.14.0]
10
- ### Changed
11
- - **BREAKING:** Increase TypeScript compilation target to ES2020 ([#449](https://github.com/MetaMask/snaps-skunkworks/pull/449))
12
- - This should not be breaking for consumers on any non-deprecated browser or Node.js version.
13
-
14
- ## [0.13.0]
15
- ### Changed
16
- - No changes this release.
17
-
18
- ## [0.12.0]
19
- ### Changed
20
- - No changes this release.
21
-
22
- ## [0.11.1]
23
- ### Changed
24
- - No changes this release.
25
-
26
- ## [0.11.0]
27
- ### Added
28
- - Add self to mock endowments ([#341](https://github.com/MetaMask/snaps-skunkworks/pull/341))
29
-
30
- ### Changed
31
- - Bump `ses` to `0.15.15` ([#396](https://github.com/MetaMask/snaps-skunkworks/pull/396))
32
- - Upgraded TypeScript version to minimum 4.4 ([#360](https://github.com/MetaMask/snaps-skunkworks/pull/360))
33
- - Update template files ([#350](https://github.com/MetaMask/snaps-skunkworks/pull/350))
34
-
35
- ## [0.10.7]
36
- ### Changed
37
- - **BREAKING:** Bump minimum Node version from 12 to 14 ([#331](https://github.com/MetaMask/snaps-skunkworks/pull/331))
38
- - Update `mm-snap init` template files ([#330](https://github.com/MetaMask/snaps-skunkworks/pull/330))
39
-
40
- ### Fixed
41
- - Fix issue where comment stripping would create invalid bundles ([#336](https://github.com/MetaMask/snaps-skunkworks/pull/336))
42
-
43
- ## [0.10.6]
44
- ### Fixed
45
- - Fix endowment mocking during `mm-snap eval` ([#311](https://github.com/MetaMask/snaps-skunkworks/pull/311))
46
-
47
- ## [0.10.5]
48
- ### Changed
49
- - No changes this release.
50
-
51
- ## [0.10.3]
52
- ### Fixed
53
- - Improve dynamic mocking ([#262](https://github.com/MetaMask/snaps-skunkworks/pull/262))
54
-
55
- ## [0.10.2]
56
- ### Fixed
57
- - Installation failure ([#279](https://github.com/MetaMask/snaps-skunkworks/pull/279))
58
- - A faulty installation script in a dependency caused the installation of this package to fail.
59
-
60
- ## [0.10.1]
61
- ### Fixed
62
- - Comment stripping will no longer remove empty block comments in strings ([#276](https://github.com/MetaMask/snaps-skunkworks/pull/276))
63
-
64
- ## [0.10.0]
65
- ### Added
66
- - **BREAKING:** Transform HTML comments by default ([#237](https://github.com/MetaMask/snaps-skunkworks/pull/237))
67
- - The strings `<!--` and `-->` will be transformed into `< !--` and `-- >` respectively by default. If these strings appear as operands in an expression or in a string literal, this transform will change the behavior of your program. This behavior was added because these strings are rejected by SES. The behavior can be toggled using the `--transformHtmlComments` option.
68
- - `--transpiledDeps` flag to `build` and `watch` commands ([#221](https://github.com/MetaMask/snaps-skunkworks/pull/221))
69
- - This flag allows the user to specify which dependencies will be transpiled at build time if the `--transpilationMode` is `--localAndDeps`.
70
- - Add CLI usage instructions to readme ([#228](https://github.com/MetaMask/snaps-skunkworks/pull/228))
71
- - Build process customization ([#251](https://github.com/MetaMask/snaps-skunkworks/pull/251))
72
- - Builds can now be customized by adding a `bundlerCustomizer` function to `snap.config.js`. See the README for details.
73
-
74
- ### Changed
75
- - **BREAKING:** Change Snap config file format ([#251](https://github.com/MetaMask/snaps-skunkworks/pull/251))
76
- - The CLI now expects a file `snap.config.js` instead of `snap.config.json`, with a different structure. See the README for details.
77
- - **BREAKING:** Strip comments in source code by default ([#243](https://github.com/MetaMask/snaps-skunkworks/pull/243))
78
- - All comments will now be stripped from snap source code (including dependencies) by default.
79
- - Enable `--verboseErrors` by default ([#249](https://github.com/MetaMask/snaps-skunkworks/pull/249))
80
-
81
- ### Fixed
82
- - Comment stripping bug ([#270](https://github.com/MetaMask/snaps-skunkworks/pull/270))
83
- - Prior to this change, if the `--strip-comments` option was provided to `mm-snap build` and an empty block comment of the form `/**/` appeared anywhere in the source code (including dependencies), the remainder of the string after the empty block comment would be truncated. This was resolved by removing all instances of the string `/**/` from the raw bundle string.
84
- - In an upcoming release, the string `/**/` will only be removed if it is in fact an empty block comment, and not if it e.g. appears in a string literal.
85
- - `watch` command parity with `build` command ([#241](https://github.com/MetaMask/snaps-skunkworks/pull/241))
86
- - The `build` command had received a number of options that were not made available to the `watch` command. They now have the same options.
87
- - Update dead link in readme ([#240](https://github.com/MetaMask/snaps-skunkworks/pull/240))
88
-
89
- ## [0.9.0]
90
- ### Added
91
- - Transpilation configuration ([#213](https://github.com/MetaMask/snaps-skunkworks/pull/213))
92
- - `mm-snap build` now takes a `--transpilationMode` argument which determines what will be transpiled by Babel during building: all source code (including dependencies), local source code only, or nothing.
93
-
94
- ### Fixed
95
- - `mm-snap build` command when CLI is installed globally ([#216](https://github.com/MetaMask/snaps-skunkworks/pull/216))
96
- - Update installation command in readme ([#205](https://github.com/MetaMask/snaps-skunkworks/pull/205))
97
-
98
- ## [0.8.0]
99
- ### Changed
100
- - Update template snap created by `mm-snap init` ([#195](https://github.com/MetaMask/snaps-skunkworks/pull/195))
101
- - Exit by throwing errors instead of calling `process.exit` ([#190](https://github.com/MetaMask/snaps-skunkworks/pull/190))
102
-
103
- ## [0.7.0]
104
- ### Added
105
- - ESM support for `mm-snap build` ([#185](https://github.com/MetaMask/snaps-skunkworks/pull/185))
106
- - The `build` command can now handle snap source code that includes ESM import / export statements. They will be transpiled to their CommonJS equivalents via Babel.
107
-
108
- ### Fixed
109
- - Fix `mm-snap init` `src` default value ([#186](https://github.com/MetaMask/snaps-skunkworks/pull/186))
110
- - It now correctly defaults to `src/index.js` instead of just `index.js`.
111
- - Fix comment stripping ([#189](https://github.com/MetaMask/snaps-skunkworks/pull/189))
112
- - Comments wouldn't be stripped under certain circumstances due to a RegEx error, details [here](https://github.com/jonschlinkert/strip-comments/pull/49).
113
-
114
- ## [0.6.3]
115
- ### Changed
116
- - No changes this release.
117
-
118
- ## [0.6.2]
119
- ### Changed
120
- - No changes this release.
121
-
122
- ## [0.6.1]
123
- ### Fixed
124
- - `mm-snap init` Snap `snap_confirm` call ([#168](https://github.com/MetaMask/snaps-skunkworks/pull/168))
125
- - The generated Snap was passing invalid parameters to the method.
126
-
127
- ## [0.6.0]
128
- ### Added
129
- - Snap SVG icon support ([#163](https://github.com/MetaMask/snaps-skunkworks/pull/163))
130
-
131
- ### Changed
132
- - **BREAKING:** Support the new Snaps publishing specification ([#140](https://github.com/MetaMask/snaps-skunkworks/pull/140), [#160](https://github.com/MetaMask/snaps-skunkworks/pull/160))
133
- - This introduces several breaking changes to how Snaps are developed, hosted, and represented at runtime. See [the specification](https://github.com/MetaMask/specifications/blob/d4a5bf5d6990bb5b02a98bd3f95a24ffb28c701c/snaps/publishing.md) and the referenced pull requests for details.
134
- - **BREAKING:** Rename Snap `name` property to `id` ([#147](https://github.com/MetaMask/snaps-skunkworks/pull/147))
135
- - **BREAKING:** Update `ses` to version `^0.15.3` ([#159](https://github.com/MetaMask/snaps-skunkworks/pull/159))
136
- - This will cause behavioral changes for code executed under SES, and may require modifications to code that previously executed without issues.
137
-
138
- ## [0.5.0]
139
- ### Changed
140
- - **BREAKING:** Convert all TypeScript `interface` declarations to `type` equivalents ([#143](https://github.com/MetaMask/snaps-skunkworks/pull/143))
141
-
142
- ## [0.4.0]
143
- ### Fixed
144
- - Make Windows-compatible ([#131](https://github.com/MetaMask/snaps-skunkworks/pull/131))
145
-
146
- ## [0.3.1]
147
- ### Changed
148
- - No changes this release.
149
-
150
- ## [0.3.0]
151
- ### Changed
152
- - **BREAKING:** Enforce consistent naming for Snaps-related functionality ([#119](https://github.com/MetaMask/snaps-skunkworks/pull/119))
153
-
154
- ## [0.2.2]
155
- ### Fixed
156
- - Package script issues ([#97](https://github.com/MetaMask/snaps-skunkworks/pull/97), [#98](https://github.com/MetaMask/snaps-skunkworks/pull/98))
157
-
158
- ## [0.2.1]
159
- ### Fixed
160
- - Snap produced by `mm-snap init` ([#94](https://github.com/MetaMask/snaps-skunkworks/pull/94))
161
- - The template used to create the "Hello, world!" snap had become outdated due to a build-time bug.
162
-
163
- ## [0.2.0]
164
- ### Changed
165
- - Update publish scripts ([#92](https://github.com/MetaMask/snaps-skunkworks/pull/92))
166
-
167
- ## [0.1.1]
168
- ### Added
169
- - Missing publish scripts to new packages
170
-
171
- ## [0.1.0]
172
- ### Changed
173
- - **BREAKING:** Rename package to `@metamask/snaps-cli` ([#72](https://github.com/MetaMask/snaps-skunkworks/pull/72))
174
- - This package was previously named [`snaps-cli`](https://npmjs.com/package/snaps-cli).
175
- - As part of the renaming, and due to the scope of the changes to both this package and MetaMask Snaps generally, its versioning and changelog have been reset. The original changelog can be found [here](https://github.com/MetaMask/snaps-cli/blob/main/CHANGELOG.md).
176
-
177
- ### Removed
178
- - Example snaps ([#72](https://github.com/MetaMask/snaps-skunkworks/pull/72))
179
- - The examples now live in their own package, [`@metamask/snap-examples`](https://npmjs.com/package/@metamask/snap-examples).
180
-
181
- [Unreleased]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.14.0...HEAD
182
- [0.14.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.13.0...v0.14.0
183
- [0.13.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.12.0...v0.13.0
184
- [0.12.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.11.1...v0.12.0
185
- [0.11.1]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.11.0...v0.11.1
186
- [0.11.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.10.7...v0.11.0
187
- [0.10.7]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.10.6...v0.10.7
188
- [0.10.6]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.10.5...v0.10.6
189
- [0.10.5]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.10.3...v0.10.5
190
- [0.10.3]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.10.2...v0.10.3
191
- [0.10.2]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.10.1...v0.10.2
192
- [0.10.1]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.10.0...v0.10.1
193
- [0.10.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.9.0...v0.10.0
194
- [0.9.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.8.0...v0.9.0
195
- [0.8.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.7.0...v0.8.0
196
- [0.7.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.6.3...v0.7.0
197
- [0.6.3]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.6.2...v0.6.3
198
- [0.6.2]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.6.1...v0.6.2
199
- [0.6.1]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.6.0...v0.6.1
200
- [0.6.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.5.0...v0.6.0
201
- [0.5.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.4.0...v0.5.0
202
- [0.4.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.3.1...v0.4.0
203
- [0.3.1]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.3.0...v0.3.1
204
- [0.3.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.2.2...v0.3.0
205
- [0.2.2]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.2.1...v0.2.2
206
- [0.2.1]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.2.0...v0.2.1
207
- [0.2.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.1.1...v0.2.0
208
- [0.1.1]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.1.0...v0.1.1
209
- [0.1.0]: https://github.com/MetaMask/snaps-skunkworks/releases/tag/v0.1.0