Skip to content

Commit

Permalink
docs: standardize shell commands in the docs
Browse files Browse the repository at this point in the history
Removed `yarn`, ensured all examples have two variations and tabularized
examples.

close #1459
  • Loading branch information
richardgreg committed Nov 30, 2023
1 parent 70233c1 commit 3dca64d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 19 deletions.
6 changes: 6 additions & 0 deletions .changeset/cuddly-days-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
docs: standardize shell commands in the docs
---

Removed `yarn`, ensured all examples have two variations and tabularized
examples.
4 changes: 0 additions & 4 deletions apps/docs/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ To begin, you need to add the `fuels` dependency to your project. You can do thi
npm install fuels --save
```

```sh [yarn]
yarn add fuels
```

```sh [pnpm]
pnpm add fuels
```
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/src/guide/abi-typegen/generating-types-from-abi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
First we install `fuels` to our project:

```console
yarn add fuels
pnpm add fuels
```

## Help

A first glance at the docs:

```console
$ yarn exec fuels typegen -h
$ pnpm fuels typegen -h

Usage: fuels typegen [options]

Expand All @@ -36,7 +36,7 @@ You can generate types for a Sway contract using the command below:
<!-- gen_types:example:start -->

```console
yarn exec fuels typegen -i ./abis/*-abi.json -o ./types
pnpm fuels typegen -i ./abis/*-abi.json -o ./types
```

<!-- gen_types:example:end -->
Expand All @@ -57,15 +57,15 @@ You can omit the `--contract` option here since it's the default.
To generate types for a Sway script, use the `--script` flag:

```console
yarn exec fuels typegen -i ./abis/*-abi.json -o ./types --script
pnpm fuels typegen -i ./abis/*-abi.json -o ./types --script
```

## Generating Types for Predicates

To generate types for a Sway predicate, use the `--predicate` flag:

```console
yarn exec fuels typegen -i ./abis/*-abi.json -o ./types --predicate
pnpm fuels typegen -i ./abis/*-abi.json -o ./types --predicate
```

---
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/src/guide/abi-typegen/using-generated-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
After generating types via:

```console
yarn exec fuels typegen -i ./abis/*-abi.json -o ./types
pnpm fuels typegen -i ./abis/*-abi.json -o ./types
```

We can use these files like so:
Expand Down Expand Up @@ -59,7 +59,7 @@ const contract = await MyContract__factory.deployContract(bytecode, wallet, {
After generating types via:

```console
yarn exec fuels typegen -i ./abis/*-abi.json -o ./types --script
pnpm fuels typegen -i ./abis/*-abi.json -o ./types --script
```

We can use these files like so:
Expand Down Expand Up @@ -87,7 +87,7 @@ Consider the following predicate:
Now, after generating types via:

```console
yarn exec fuels typegen -i ./abis/*-abi.json -o ./types --predicate
pnpm fuels typegen -i ./abis/*-abi.json -o ./types --predicate
```

We can use these files like so:
Expand Down
10 changes: 9 additions & 1 deletion apps/docs/src/guide/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,18 @@ my-fuel-dapp # NextJS app or similar

Add it to your `my-fuel-dapp` project:

```console
::: code-group

```console [npm]
npm install fuels --save
```

```console [pnpm]
pnpm add fuels
```

:::

## Double-checking

```console
Expand Down
12 changes: 6 additions & 6 deletions apps/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ Learn more about the Fuel Ecosystem.

## Install

#### YARN
::: code-group

```sh
yarn add fuels
```sh [pnpm]
pnpm add fuels
```

#### NPM

```sh
```sh [npm]
npm install fuels --save
```

:::

## Import

<!-- TODO: stop using hardcoded snippets -->
Expand Down

0 comments on commit 3dca64d

Please sign in to comment.