Skip to content

Commit e8e78e8

Browse files
committed
Install npm2yarn.
Signed-off-by: bgravenorst <[email protected]>
1 parent 44f4b1b commit e8e78e8

File tree

4 files changed

+46
-28
lines changed

4 files changed

+46
-28
lines changed

delegation-toolkit/get-started/install.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ description: Learn how to install and set up the MetaMask Delegation Toolkit.
44
sidebar_position: 1
55
---
66

7-
import Tabs from "@theme/Tabs";
8-
import TabItem from "@theme/TabItem";
7+
import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem";
98

109
# Install and set up the Delegation Toolkit
1110

@@ -14,40 +13,22 @@ This page provides instructions to install and set up the MetaMask Delegation To
1413
## Prerequisites
1514

1615
- Install [Node.js](https://nodejs.org/en/blog/release/v18.18.0) v18 or later.
17-
- Install [Yarn](https://yarnpkg.com/),
18-
[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager.
19-
- If you plan to use any smart contracts (for example, to
20-
[create a custom caveat enforcer](../how-to/create-delegation/create-custom-caveat-enforcer.md)), install
21-
[Foundry](https://book.getfoundry.sh/getting-started/installation).
16+
- Install [Yarn](https://yarnpkg.com/), [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager.
17+
- If you plan to use any smart contracts (for example, to [create a custom caveat enforcer](../how-to/create-delegation/create-custom-caveat-enforcer.md)), install [Foundry](https://book.getfoundry.sh/getting-started/installation).
2218

2319
## Steps
2420

2521
### 1. Install the toolkit
2622

2723
Install the [MetaMask Delegation Toolkit](https://github.com/MetaMask/delegation-toolkit) dependencies:
2824

29-
<Tabs>
30-
<TabItem value="npm">
31-
32-
```bash
33-
npm install @metamask/delegation-toolkit
34-
```
35-
36-
</TabItem>
37-
<TabItem value="yarn">
38-
39-
```bash
40-
yarn add @metamask/delegation-toolkit
41-
```
42-
43-
</TabItem>
44-
</Tabs>
25+
```bash npm2yarn
26+
npm install @metamask/delegation-toolkit
27+
```
4528

4629
### 2. (Optional) Install the contracts
4730

48-
If you plan to extend the Delegation Framework smart contracts (for example, to
49-
[create a custom caveat enforcer](../how-to/create-delegation/create-custom-caveat-enforcer.md)), install the contract
50-
package using Foundry's command-line tool, Forge:
31+
If you plan to extend the Delegation Framework smart contracts (for example, to [create a custom caveat enforcer](../how-to/create-delegation/create-custom-caveat-enforcer.md)), install the contract package using Foundry's command-line tool, Forge:
5132

5233
```bash
5334
forge install metamask/[email protected]
@@ -57,5 +38,4 @@ Add `@metamask/delegation-framework/=lib/metamask/delegation-framework/` in your
5738

5839
### 3. Get started
5940

60-
You're now ready to start using the MetaMask Delegation Toolkit.
61-
Check out the [Delegation Toolkit quickstart](quickstart.md) to walk through a simple example.
41+
You're now ready to start using the MetaMask Delegation Toolkit. Check out the [Delegation Toolkit quickstart](quickstart.md) to walk through a simple example.

docusaurus.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const helpDropdown = fs.readFileSync("./src/components/NavDropdown/DeveloperTool
1616
const connectDropdown = fs.readFileSync("./src/components/NavDropdown/ConnectMetaMask.html", "utf-8");
1717
const embedDropdown = fs.readFileSync("./src/components/NavDropdown/EmbedMetaMask.html", "utf-8");
1818
const extendDropdown = fs.readFileSync("./src/components/NavDropdown/ExtendScale.html", "utf-8");
19+
const npm2yarnPlugin = [require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }];
1920
/** @type {import('@docusaurus/types').Config} */
2021
const config = {
2122
title: 'MetaMask developer documentation',
@@ -72,6 +73,7 @@ const config = {
7273
editUrl: 'https://github.com/MetaMask/metamask-docs/edit/main/',
7374
sidebarPath: false,
7475
breadcrumbs: false,
76+
remarkPlugins: [npm2yarnPlugin],
7577
},
7678
theme: {
7779
customCss: require.resolve('./src/scss/custom.scss'),
@@ -91,6 +93,7 @@ const config = {
9193
editUrl: 'https://github.com/MetaMask/metamask-docs/edit/main/',
9294
sidebarPath: require.resolve('./snaps-sidebar.js'),
9395
breadcrumbs: false,
96+
remarkPlugins: [npm2yarnPlugin],
9497
admonitions: {
9598
keywords: [
9699
'info',
@@ -116,6 +119,7 @@ const config = {
116119
editUrl: 'https://github.com/MetaMask/metamask-docs/edit/main/',
117120
sidebarPath: require.resolve('./gator-sidebar.js'),
118121
breadcrumbs: false,
122+
remarkPlugins: [npm2yarnPlugin],
119123
sidebarCollapsed: false,
120124
includeCurrentVersion: true,
121125
// Set to the latest release.
@@ -143,6 +147,7 @@ const config = {
143147
editUrl: 'https://github.com/MetaMask/metamask-docs/edit/main/',
144148
sidebarPath: require.resolve('./services-sidebar.js'),
145149
breadcrumbs: false,
150+
remarkPlugins: [npm2yarnPlugin],
146151
},
147152
],
148153
[
@@ -154,6 +159,7 @@ const config = {
154159
editUrl: 'https://github.com/MetaMask/metamask-docs/edit/main/',
155160
sidebarPath: require.resolve('./dashboard-sidebar.js'),
156161
breadcrumbs: false,
162+
remarkPlugins: [npm2yarnPlugin],
157163
},
158164
],
159165
[
@@ -165,6 +171,7 @@ const config = {
165171
editUrl: 'https://github.com/MetaMask/metamask-docs/edit/main/',
166172
sidebarPath: require.resolve('./wallet-sidebar.js'),
167173
breadcrumbs: false,
174+
remarkPlugins: [npm2yarnPlugin],
168175
sidebarItemsGenerator: async function ({ defaultSidebarItemsGenerator, ...args }) {
169176
const sidebarItems = await defaultSidebarItemsGenerator(args)
170177
const dynamicItems = await fetchAndGenerateDynamicSidebarItems(
@@ -188,6 +195,7 @@ const config = {
188195
editUrl: 'https://github.com/MetaMask/metamask-docs/edit/main/',
189196
sidebarPath: require.resolve('./sdk-sidebar.js'),
190197
breadcrumbs: false,
198+
remarkPlugins: [npm2yarnPlugin],
191199
},
192200
],
193201
'./src/plugins/plugin-json-rpc.ts',

package-lock.json

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@docusaurus/plugin-content-docs": "3.8.1",
3434
"@docusaurus/plugin-content-pages": "3.8.1",
3535
"@docusaurus/preset-classic": "3.8.1",
36+
"@docusaurus/remark-plugin-npm2yarn": "^3.8.1",
3637
"@docusaurus/theme-common": "3.8.1",
3738
"@docusaurus/theme-mermaid": "3.8.1",
3839
"@intercom/messenger-js-sdk": "^0.0.14",

0 commit comments

Comments
 (0)