@metamask/snaps-cli 8.0.0 → 8.1.1
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 +15 -1
- package/dist/cli.cjs +1 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts.map +1 -1
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +2 -3
- package/dist/cli.mjs.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [8.1.1]
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Display CLI minimum version range properly ([#3531](https://github.com/MetaMask/snaps/pull/3531))
|
|
15
|
+
|
|
16
|
+
## [8.1.0]
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Support scheduling cronjobs with an ISO 8601 duration ([#3421](https://github.com/MetaMask/snaps/pull/3421))
|
|
21
|
+
|
|
10
22
|
## [8.0.0]
|
|
11
23
|
|
|
12
24
|
### Changed
|
|
@@ -381,7 +393,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
381
393
|
- The version of the package no longer needs to match the version of all other
|
|
382
394
|
MetaMask Snaps packages.
|
|
383
395
|
|
|
384
|
-
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@8.
|
|
396
|
+
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@8.1.1...HEAD
|
|
397
|
+
[8.1.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@8.1.0...@metamask/snaps-cli@8.1.1
|
|
398
|
+
[8.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@8.0.0...@metamask/snaps-cli@8.1.0
|
|
385
399
|
[8.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@7.2.0...@metamask/snaps-cli@8.0.0
|
|
386
400
|
[7.2.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@7.1.0...@metamask/snaps-cli@7.2.0
|
|
387
401
|
[7.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-cli@7.0.0...@metamask/snaps-cli@7.1.0
|
package/dist/cli.cjs
CHANGED
|
@@ -19,9 +19,8 @@ const package_json_1 = __importDefault(require("@metamask/snaps-cli/package.json
|
|
|
19
19
|
*/
|
|
20
20
|
function checkNodeVersion(nodeVersion = process.version.slice(1)) {
|
|
21
21
|
const versionRange = package_json_1.default.engines.node;
|
|
22
|
-
const minimumVersion = (0, semver_1.minVersion)(versionRange).format();
|
|
23
22
|
if (!(0, semver_1.satisfies)(nodeVersion, versionRange)) {
|
|
24
|
-
(0, utils_1.error)(`Node version ${nodeVersion} is not supported. Please use Node ${
|
|
23
|
+
(0, utils_1.error)(`Node version ${nodeVersion} is not supported. Please use a Node version that satisfies the following range: ${versionRange}.`);
|
|
25
24
|
process.exit(1);
|
|
26
25
|
}
|
|
27
26
|
}
|
package/dist/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.cjs","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"cli.cjs","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAmC;AACnC,kDAA0B;AAC1B,2CAAwC;AAExC,8DAAkC;AAClC,yCAA2C;AAC3C,6CAAsE;AACtE,oFAA2D;AAE3D;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,cAAsB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9C,MAAM,YAAY,GAAG,sBAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IAE9C,IAAI,CAAC,IAAA,kBAAS,EA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CAAC;SAED,IAAI,EAAE;SACN,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;SAClB,UAAU,EAAE,CAAC;AAClB,CAAC;AA5CD,kBA4CC","sourcesContent":["import { satisfies } from 'semver';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\n\nimport builders from './builders';\nimport { getConfigByArgv } from './config';\nimport { error, getYargsErrorMessage, sanitizeInputs } from './utils';\nimport packageJson from '@metamask/snaps-cli/package.json';\n\n/**\n * Check the Node version. If the Node version is less than the minimum required\n * version, this logs an error and exits the process.\n *\n * @param nodeVersion - The Node version to check.\n */\nexport function checkNodeVersion(\n nodeVersion: string = process.version.slice(1),\n) {\n const versionRange = packageJson.engines.node;\n\n if (!satisfies(nodeVersion, versionRange)) {\n error(\n `Node version ${nodeVersion} is not supported. Please use a Node version that satisfies the following range: ${versionRange}.`,\n );\n process.exit(1);\n }\n}\n\n/**\n * The main CLI entry point function. This processes the command line args, and\n * runs the appropriate function.\n *\n * @param argv - The raw command line arguments, i.e., `process.argv`.\n * @param commands - The list of commands to use.\n */\nexport async function cli(argv: string[], commands: any) {\n checkNodeVersion();\n\n await yargs(hideBin(argv))\n .scriptName('mm-snap')\n .usage('Usage: $0 <command> [options]')\n\n .example('$0 build', `Build './src/index.js' as './dist/bundle.js'`)\n .example(\n '$0 build --config ./snap.config.build.ts',\n `Build './src/index.js' as './dist/bundle.js' using the config in './snap.config.build.ts'`,\n )\n .example('$0 manifest --fix', `Check the snap manifest, and fix any errors`)\n .example(\n '$0 watch --port 8000',\n `The snap input file for changes, and serve it on port 8000`,\n )\n .example('$0 serve --port 8000', `Serve the snap bundle on port 8000`)\n\n .command(commands)\n\n .option('config', builders.config)\n\n .strict()\n\n .middleware(async (args: any) => {\n // eslint-disable-next-line require-atomic-updates\n args.context = {\n config: await getConfigByArgv(args),\n };\n\n sanitizeInputs(args);\n }, false)\n\n .demandCommand(1, 'You must specify at least one command.')\n\n .fail((message, failure) => {\n error(getYargsErrorMessage(message, failure));\n process.exit(1);\n })\n\n .help()\n .alias('help', 'h')\n .parseAsync();\n}\n"]}
|
package/dist/cli.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.cts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.cts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,GAAE,MAAiC,QAU/C;AAED;;;;;;GAMG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAG,iBA4CtD"}
|
package/dist/cli.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.mts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.mts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,GAAE,MAAiC,QAU/C;AAED;;;;;;GAMG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAG,iBA4CtD"}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { satisfies } from "semver";
|
|
2
2
|
import yargs from "yargs";
|
|
3
3
|
import { hideBin } from "yargs/helpers";
|
|
4
4
|
import builders from "./builders.mjs";
|
|
@@ -13,9 +13,8 @@ import packageJson from "@metamask/snaps-cli/package.json" with { type: "json" }
|
|
|
13
13
|
*/
|
|
14
14
|
export function checkNodeVersion(nodeVersion = process.version.slice(1)) {
|
|
15
15
|
const versionRange = packageJson.engines.node;
|
|
16
|
-
const minimumVersion = minVersion(versionRange).format();
|
|
17
16
|
if (!satisfies(nodeVersion, versionRange)) {
|
|
18
|
-
error(`Node version ${nodeVersion} is not supported. Please use Node ${
|
|
17
|
+
error(`Node version ${nodeVersion} is not supported. Please use a Node version that satisfies the following range: ${versionRange}.`);
|
|
19
18
|
process.exit(1);
|
|
20
19
|
}
|
|
21
20
|
}
|
package/dist/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.mjs","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe;AACnC,OAAO,KAAK,cAAc;AAC1B,OAAO,EAAE,OAAO,EAAE,sBAAsB;AAExC,OAAO,QAAQ,uBAAmB;AAClC,OAAO,EAAE,eAAe,EAAE,qBAAiB;AAC3C,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,0BAAgB;AACtE,OAAO,WAAW,+DAAyC;AAE3D;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,cAAsB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9C,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IAE9C,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,CAAC;QAC1C,KAAK,CACH,gBAAgB,WAAW,oFAAoF,YAAY,GAAG,CAC/H,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,IAAc,EAAE,QAAa;IACrD,gBAAgB,EAAE,CAAC;IAEnB,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACvB,UAAU,CAAC,SAAS,CAAC;SACrB,KAAK,CAAC,+BAA+B,CAAC;SAEtC,OAAO,CAAC,UAAU,EAAE,8CAA8C,CAAC;SACnE,OAAO,CACN,0CAA0C,EAC1C,2FAA2F,CAC5F;SACA,OAAO,CAAC,mBAAmB,EAAE,6CAA6C,CAAC;SAC3E,OAAO,CACN,sBAAsB,EACtB,4DAA4D,CAC7D;SACA,OAAO,CAAC,sBAAsB,EAAE,oCAAoC,CAAC;SAErE,OAAO,CAAC,QAAQ,CAAC;SAEjB,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC;SAEjC,MAAM,EAAE;SAER,UAAU,CAAC,KAAK,EAAE,IAAS,EAAE,EAAE;QAC9B,kDAAkD;QAClD,IAAI,CAAC,OAAO,GAAG;YACb,MAAM,EAAE,MAAM,eAAe,CAAC,IAAI,CAAC;SACpC,CAAC;QAEF,cAAc,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC,EAAE,KAAK,CAAC;SAER,aAAa,CAAC,CAAC,EAAE,wCAAwC,CAAC;SAE1D,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;QACzB,KAAK,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;SAED,IAAI,EAAE;SACN,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;SAClB,UAAU,EAAE,CAAC;AAClB,CAAC","sourcesContent":["import { satisfies } from 'semver';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\n\nimport builders from './builders';\nimport { getConfigByArgv } from './config';\nimport { error, getYargsErrorMessage, sanitizeInputs } from './utils';\nimport packageJson from '@metamask/snaps-cli/package.json';\n\n/**\n * Check the Node version. If the Node version is less than the minimum required\n * version, this logs an error and exits the process.\n *\n * @param nodeVersion - The Node version to check.\n */\nexport function checkNodeVersion(\n nodeVersion: string = process.version.slice(1),\n) {\n const versionRange = packageJson.engines.node;\n\n if (!satisfies(nodeVersion, versionRange)) {\n error(\n `Node version ${nodeVersion} is not supported. Please use a Node version that satisfies the following range: ${versionRange}.`,\n );\n process.exit(1);\n }\n}\n\n/**\n * The main CLI entry point function. This processes the command line args, and\n * runs the appropriate function.\n *\n * @param argv - The raw command line arguments, i.e., `process.argv`.\n * @param commands - The list of commands to use.\n */\nexport async function cli(argv: string[], commands: any) {\n checkNodeVersion();\n\n await yargs(hideBin(argv))\n .scriptName('mm-snap')\n .usage('Usage: $0 <command> [options]')\n\n .example('$0 build', `Build './src/index.js' as './dist/bundle.js'`)\n .example(\n '$0 build --config ./snap.config.build.ts',\n `Build './src/index.js' as './dist/bundle.js' using the config in './snap.config.build.ts'`,\n )\n .example('$0 manifest --fix', `Check the snap manifest, and fix any errors`)\n .example(\n '$0 watch --port 8000',\n `The snap input file for changes, and serve it on port 8000`,\n )\n .example('$0 serve --port 8000', `Serve the snap bundle on port 8000`)\n\n .command(commands)\n\n .option('config', builders.config)\n\n .strict()\n\n .middleware(async (args: any) => {\n // eslint-disable-next-line require-atomic-updates\n args.context = {\n config: await getConfigByArgv(args),\n };\n\n sanitizeInputs(args);\n }, false)\n\n .demandCommand(1, 'You must specify at least one command.')\n\n .fail((message, failure) => {\n error(getYargsErrorMessage(message, failure));\n process.exit(1);\n })\n\n .help()\n .alias('help', 'h')\n .parseAsync();\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/snaps-cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.1",
|
|
4
4
|
"description": "A CLI for developing MetaMask Snaps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -64,13 +64,13 @@
|
|
|
64
64
|
"test:watch": "jest --watch"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@metamask/snaps-rpc-methods": "^13.
|
|
67
|
+
"@metamask/snaps-rpc-methods": "^13.3.0",
|
|
68
68
|
"@metamask/snaps-sandbox": "^1.0.0",
|
|
69
|
-
"@metamask/snaps-sdk": "^
|
|
70
|
-
"@metamask/snaps-utils": "^
|
|
71
|
-
"@metamask/snaps-webpack-plugin": "^
|
|
69
|
+
"@metamask/snaps-sdk": "^9.2.0",
|
|
70
|
+
"@metamask/snaps-utils": "^11.1.0",
|
|
71
|
+
"@metamask/snaps-webpack-plugin": "^5.0.0",
|
|
72
72
|
"@metamask/superstruct": "^3.2.1",
|
|
73
|
-
"@metamask/utils": "^11.4.
|
|
73
|
+
"@metamask/utils": "^11.4.2",
|
|
74
74
|
"@swc/core": "1.11.31",
|
|
75
75
|
"assert": "^2.0.0",
|
|
76
76
|
"browserify-zlib": "^0.2.0",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"yargs": "^17.7.1"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
|
-
"@lavamoat/allow-scripts": "^3.3.
|
|
112
|
+
"@lavamoat/allow-scripts": "^3.3.4",
|
|
113
113
|
"@metamask/auto-changelog": "^5.0.2",
|
|
114
114
|
"@swc/jest": "^0.2.38",
|
|
115
115
|
"@ts-bridge/cli": "^0.6.1",
|