Skip to content

Commit

Permalink
yarn run mm-snap -> yarn mm-snap
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandratran committed Jan 4, 2024
1 parent 05fa56b commit de84522
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions snaps/concepts/anatomy.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ You might need to modify some manifest fields manually.
For example, if you change the location of the icon SVG file, you must update
`source.location.npm.iconPath` to match.
You can also use the [Snaps CLI](../reference/cli/subcommands.md) to update some fields for you.
For example, running [`yarn run mm-snap build`](../reference/cli/subcommands.md#b-build) or
[`yarn run mm-snap manifest --fix`](../reference/cli/subcommands.md#m-manifest) updates `source.shasum`.
For example, running [`yarn mm-snap build`](../reference/cli/subcommands.md#b-build) or
[`yarn mm-snap manifest --fix`](../reference/cli/subcommands.md#m-manifest) updates `source.shasum`.

## Configuration file

Expand Down Expand Up @@ -194,7 +194,7 @@ built-ins must be bundled along with the Snap.

Running `yarn start` bundles your Snap for you.

You can also run [`yarn run mm-snap build`](../reference/cli/subcommands.md#b-build) to bundle your
You can also run [`yarn mm-snap build`](../reference/cli/subcommands.md#b-build) to bundle your
Snap using [webpack](https://webpack.js.org/) or [Browserify](https://browserify.org).
This command finds all dependencies using your specified main entry point and outputs a bundle
file to your specified output path.
2 changes: 1 addition & 1 deletion snaps/how-to/develop-a-snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ For end-to-end Snap testing, [use the `@metamask/snaps-jest` package](test-a-sna
To debug your Snap, use `console.log` and inspect the MetaMask background process.
You can add your log statements in your source code and build your Snap, or add them directly
to your Snap bundle and use [`yarn run mm-snap manifest --fix`](../reference/cli/subcommands.md#m-manifest)
to your Snap bundle and use [`yarn mm-snap manifest --fix`](../reference/cli/subcommands.md#m-manifest)
to update the `shasum` in your Snap manifest file.
The manifest `shasum` must match the contents of your bundle at the time MetaMask fetches your Snap.
Expand Down
12 changes: 6 additions & 6 deletions snaps/how-to/troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ If you encounter any issues that you can't solve on your own, please
Because [Secure ECMAScript (SES)](../concepts/execution-environment.md) adds additional restrictions
on the JavaScript runtime on top of strict mode, code that executes normally under strict mode might
not under SES.
[`yarn run mm-snap build`](../reference/cli/subcommands.md#b-build) by default attempts to execute a
[`yarn mm-snap build`](../reference/cli/subcommands.md#b-build) by default attempts to execute a
Snap in a stubbed SES environment.
You can also disable this behavior and run the evaluation step separately using
[`yarn run mm-snap eval`](../reference/cli/subcommands.md#e-eval).
[`yarn mm-snap eval`](../reference/cli/subcommands.md#e-eval).
If an error is thrown during this step, it's likely due to a SES incompatibility, and you must fix
the issues manually.
These incompatibilities tend to occur in dependencies.
Expand All @@ -37,10 +37,10 @@ and therefore in SES as well.
If you get an error during the `eval` step that says something like `variableName is not defined`,
simply prepending `var variableName;` to your Snap bundle may solve the problem.
(This actually happened so frequently with [Babel's](https://babeljs.io/) `regeneratorRuntime` that
`yarn run mm-snap build` automatically handles that one.)
`yarn mm-snap build` automatically handles that one.)

:::caution
Run [`yarn run mm-snap manifest --fix`](../reference/cli/subcommands.md#m-manifest) if you modified
Run [`yarn mm-snap manifest --fix`](../reference/cli/subcommands.md#m-manifest) if you modified
your Snap bundle after building.
Otherwise your manifest `shasum` value won't be correct, and attempting to install your Snap fails.
:::
Expand All @@ -57,9 +57,9 @@ plugins for several other build systems:
For examples on how to set up these build systems yourself, please see the
[examples](https://github.com/MetaMask/snaps-monorepo/tree/main/packages/examples/examples).

We recommend running [`yarn run mm-snap manifest --fix`](../reference/cli/subcommands.md#m-manifest)
We recommend running [`yarn mm-snap manifest --fix`](../reference/cli/subcommands.md#m-manifest)
after creating your bundle to make sure your manifest `shasum` value is correct.
You might also benefit from running [`yarn run mm-snap eval`](../reference/cli/subcommands.md#e-eval)
You might also benefit from running [`yarn mm-snap eval`](../reference/cli/subcommands.md#e-eval)
to detect any SES issues up front.

## Patch dependencies
Expand Down
4 changes: 2 additions & 2 deletions snaps/reference/cli/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ You can specify options:

- In the [configuration file](../../concepts/anatomy.md#configuration-file).

- On the command line using the `yarn run mm-snap` command.
- On the command line using the `yarn mm-snap` command.

```bash
yarn run mm-snap [SUBCOMMAND] [OPTIONS]
yarn mm-snap [SUBCOMMAND] [OPTIONS]
```

## Options
Expand Down
28 changes: 14 additions & 14 deletions snaps/reference/cli/subcommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import TabItem from '@theme/TabItem';

This reference describes the syntax of the Snaps command line interface (CLI) subcommands.

You can specify subcommands and options using the `yarn run mm-snap` command:
You can specify subcommands and options using the `yarn mm-snap` command:

```bash
yarn run mm-snap [SUBCOMMAND] [OPTIONS]
yarn mm-snap [SUBCOMMAND] [OPTIONS]
```

## b, build
Expand All @@ -24,13 +24,13 @@ yarn run mm-snap [SUBCOMMAND] [OPTIONS]
# Syntax

```bash
yarn run mm-snap build [options]
yarn mm-snap build [options]
```

# Example

```bash
yarn run mm-snap b -s lib/index.js -d out -n snap.js
yarn mm-snap b -s lib/index.js -d out -n snap.js
```

<!--/tabs-->
Expand All @@ -46,13 +46,13 @@ Builds a Snap from source.
# Syntax

```bash
yarn run mm-snap eval [options]
yarn mm-snap eval [options]
```

# Example

```bash
yarn run mm-snap e -b out/snap.js
yarn mm-snap e -b out/snap.js
```

<!--/tabs-->
Expand All @@ -68,13 +68,13 @@ Attempts to evaluate the Snap bundle in SES.
# Syntax

```bash
yarn run mm-snap init [directory]
yarn mm-snap init [directory]
```

# Example

```bash
yarn run mm-snap i my-snap
yarn mm-snap i my-snap
```

<!--/tabs-->
Expand All @@ -91,13 +91,13 @@ If no directory is specified, the Snap project is initialized in the current dir
# Syntax

```bash
yarn run mm-snap manifest [options]
yarn mm-snap manifest [options]
```

# Example

```bash
yarn run mm-snap m --fix false
yarn mm-snap m --fix false
```

<!--/tabs-->
Expand All @@ -113,13 +113,13 @@ Validates the Snap [manifest file](../../concepts/anatomy.md#manifest-file).
# Syntax

```bash
yarn run mm-snap serve [options]
yarn mm-snap serve [options]
```

# Example

```bash
yarn run mm-snap s -r out -p 9000
yarn mm-snap s -r out -p 9000
```

<!--/tabs-->
Expand All @@ -135,13 +135,13 @@ Locally serves Snap files for testing.
# Syntax

```bash
yarn run mm-snap watch [options]
yarn mm-snap watch [options]
```

# Example

```bash
yarn run mm-snap w -s lib/index.js -d out
yarn mm-snap w -s lib/index.js -d out
```

<!--/tabs-->
Expand Down

0 comments on commit de84522

Please sign in to comment.