Skip to content

Commit 0780c5c

Browse files
authored
Install npm2yarn package (#2129)
* Install npm2yarn. Signed-off-by: bgravenorst <[email protected]> * Minor text formatting. Signed-off-by: bgravenorst <[email protected]> * Fix formatting. Signed-off-by: bgravenorst <[email protected]> --------- Signed-off-by: bgravenorst <[email protected]>
1 parent c6ebf4d commit 0780c5c

File tree

4 files changed

+47
-22
lines changed

4 files changed

+47
-22
lines changed

delegation-toolkit/get-started/install.md

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,26 @@ This page provides instructions to install and set up the MetaMask Delegation To
1515

1616
- Install [Node.js](https://nodejs.org/en/blog/release/v18.18.0) v18 or later.
1717
- Install [Yarn](https://yarnpkg.com/),
18-
[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager.
18+
[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager.
1919
- 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).
20+
[create a custom caveat enforcer](../how-to/create-delegation/create-custom-caveat-enforcer.md)),
21+
install [Foundry](https://book.getfoundry.sh/getting-started/installation).
2222

2323
## Steps
2424

2525
### 1. Install the toolkit
2626

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

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>
29+
```bash npm2yarn
30+
npm install @metamask/delegation-toolkit
31+
```
4532

4633
### 2. (Optional) Install the contracts
4734

4835
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:
36+
[create a custom caveat enforcer](../how-to/create-delegation/create-custom-caveat-enforcer.md)), install
37+
the contract package using Foundry's command-line tool, Forge:
5138

5239
```bash
5340
forge install metamask/[email protected]
@@ -58,4 +45,4 @@ Add `@metamask/delegation-framework/=lib/metamask/delegation-framework/` in your
5845
### 3. Get started
5946

6047
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.
48+
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)