Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: lint & check spelling/links in guides #91

Merged
merged 25 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
name: Playwright Tests
name: Guides

on:
pull_request:

jobs:
## SPELL CHECK ALL GUIDES
spell-check:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: rojopolis/[email protected]
name: Spellcheck
with:
config_path: .spellcheck.yml
task_name: SPCheck

## LINT CHECK ALL GUIDES
lint:
name: Lint
runs-on: ubuntu-latest
steps:
# SETUP & INSTALL
- name: Checkout repo
uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
with:
install: false
- name: Install dependencies
run: npm install -g [email protected]
# RUN LINT CHECK
- name: Lint Check
run: markdownlint --config .markdownlint.yaml --ignore-path .markdownlintignore '**/*.mdx'

## QUICKSTART TEST
quickstart-test:
timeout-minutes: 30
name: build-quickstart-contract
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Links

on:
deployment_status

jobs:
check-links:
uses: FuelLabs/github-actions/.github/workflows/next-links.yml@master
with:
status: ${{ github.event.deployment_status.state }}
preview-url: ${{ github.event.deployment_status.environment_url }}
folder-path: docs/guides/docs
4 changes: 2 additions & 2 deletions .github/workflows/update-latest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Find Latest File
name: Update Latest Versions

on:
schedule:
Expand All @@ -11,7 +11,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
find-latest-file:
update-latest-versions:
runs-on: ubuntu-latest

steps:
Expand Down
5 changes: 5 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'default': true # Default state for all rules
'MD013': false # Disable rule for line length
'MD033': false # Disable rule banning inline HTML
'MD034': false # Disable rule banning bare urls
'MD025': { 'front_matter_title': '' } # Without this, the title and h1 are considered two h1s
11 changes: 11 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
workflow
docs/latest
docs/sway
docs/builds
docs/fuelup
docs/fuels-rs
docs/fuels-ts
docs/fuels-wallet
docs/fuel-specs
docs/fuel-indexer
docs/fuel-graphql-docs
21 changes: 21 additions & 0 deletions .spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
matrix:
- name: SPCheck
aspell:
lang: en
dictionary:
encoding: utf-8
wordlists:
- ./spell-check-custom-words.txt
pipeline:
- pyspelling.filters.markdown:
markdown_extensions:
- pymdownx.superfences
- pyspelling.filters.html:
comments: false
ignores:
- code
- pre
- TestAction
sources:
- '**/guides/docs/**/*.mdx'
default_encoding: utf-8
46 changes: 23 additions & 23 deletions docs/guides/docs/installation/codespace.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ parent:

# Github Codespace

### Introduction
## Introduction

The way to think about [Github Codespaces](https://github.com/features/codespaces) is essentially VSCode in a browser. It’s a remote development environment that is extremely easy to spin up. While not all VS Code plugins are supported, the Sway LSP plugin is supported and works out of the box.

### How to set up for a new repo
## How to set up for a new repo

1. Create a devcontainer.json file. The easiest way is by navigating to the repo and clicking Code → … → Configure dev container
<Box.Centered>
![dev container walkthrough](/images/dev-container.gif)
</Box.Centered>
1. Create a `devcontainer.json` file. The easiest way is by navigating to the repo and clicking Code → … → Configure dev container

<Box.Centered>
![dev container walkthrough](/images/dev-container.gif)
</Box.Centered>

2. Edit the file to include the following features:

```json
"features": {
"ghcr.io/devcontainers/features/common-utils:1": {},
"ghcr.io/FuelLabs/devcontainer-features/fuelup:1.0.1": {},
}
```
3. Add any plugins that you want to be installed for this repo under “customizations”.

3. Add any plugins that you want to be installed for this repo under “customizations”.

```json
"customizations": {
"vscode": {
Expand All @@ -40,26 +40,26 @@ The way to think about [Github Codespaces](https://github.com/features/codespace
}
}
```

Here are examples that include the Sway LSP plugin.

3.1. [https://github.com/FuelLabs/sway/blob/master/.devcontainer/devcontainer.json](https://github.com/FuelLabs/sway/blob/master/.devcontainer/devcontainer.json)

3.2. [https://github.com/FuelLabs/quickstart/blob/master/.devcontainer/devcontainer.json](https://github.com/FuelLabs/quickstart/blob/master/.devcontainer/devcontainer.json)

### How to start a codespace
3.1. [`https://github.com/FuelLabs/sway/blob/master/.devcontainer/devcontainer.json`](https://github.com/FuelLabs/sway/blob/master/.devcontainer/devcontainer.json)

3.2. [`https://github.com/FuelLabs/quickstart/blob/master/.devcontainer/devcontainer.json`](https://github.com/FuelLabs/quickstart/blob/master/.devcontainer/devcontainer.json)

## How to start a codespace

1. Navigate to the repo that has Github Codespaces configured.
2. Choose Code → Create codespace on master

<Box.Centered>
![Create codespace walkthrough](/images/create-codespace.gif)
</Box.Centered>
<Box.Centered>
![Create codespace walkthrough](/images/create-codespace.gif)
</Box.Centered>

3. This will open a new tab with your codespace. It can take several minutes to start up.

3. This will open a new tab with your codespace. It can take several minutes to start up.
3.1. You now have a fully functional remote development environment with the Fuel toolchain installed! You can use `forc` to build and deploy Sway code, or `fuelup` to manage the toolchain version. You also have the Sway LSP plugin with full feature support for Sway, like syntax highlighting, hover docs, go-to definitions, etc.

3.1. You now have a fully functional remote dev environment with the Fuel toolchain installed! You can use `forc` to build and deploy Sway code, or `fuelup` to manage the toolchain version. You also have the Sway LSP plugin with full feature support for Sway, like syntax highlighting, hover docs, go-to definitions, etc.

3.2. Note: if you are working on a large repository and find the codespace is running slow, you can configure it to use a larger instance by clicking Code → … → change machine type on a running instance, or starting a new instance with Code → … → New with options.

### Pricing & billing
Expand Down
74 changes: 43 additions & 31 deletions docs/guides/docs/installation/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,55 @@ parent:

# Toolchain installation

This guide will help you to install the Fuel toolchain binaries and prerequisites.
This guide will help you to install the Fuel toolchain binaries and prerequisites.

This guide covers the following topics:

1. [Installing Rust](#installing-rust)
2. [Installing the Fuel toolchain using `fuelup`](#installing-the-fuel-toolchain-using-fuelup)
3. [Setting up a default toolchain](#setting-up-a-default-toolchain)

## Installing Rust

{/* install_rust:example:start */}
{/*install_rust:example:start*/}
The Fuel toolchain is built on top of the Rust programming language. To install Rust, you can use the `rustup` tool.
{/* install_rust:example:end */}
{/*install_rust:example:end*/}

Run the following command in your shell; this downloads and runs `rustup-init.sh`, which in turn downloads and runs the correct version of the `rustup-init` executable for your platform.

Run the following command in your shell; this downloads and runs rustup-init.sh, which in turn downloads and runs the correct version of the `rustup-init` executable for your platform.
{/*install_rust_command:example:start*/}

{/* install_rust_command:example:start */}
```console
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
{/* install_rust_command:example:end */}

{/*install_rust_command:example:end*/}

Check the official Rust documentation to get more information on [installing the Rust toolchain](https://www.rust-lang.org/tools/install).

## Installing the Fuel toolchain using fuelup

`fuelup` is the official package manager for Fuel that installs the Fuel toolchain
from the official release channels, enabling you to easily switch between different
toolchains and keep them updated. It makes building and maintaining Sway applications simpler with [`forc`](docs/forc) and [`fuel-core`](https://github.com/FuelLabs/fuel-core) for common platforms.
toolchains and keep them updated. It makes building and maintaining Sway applications simpler with [`forc`](/docs/forc) and [`fuel-core`](https://github.com/FuelLabs/fuel-core) for common platforms.

> 💡 Check out the [fuelup docs](docs/fuelup) for more information.
> 💡 Check out the [fuelup docs](/docs/fuelup) for more information.

### Running fuelup-init
### Running `fuelup-init`

{/* install_fuelup:example:start */}
{/*install_fuelup:example:start*/}
To install the Fuel toolchain, you'll use the `fuelup-init` script. This will install `forc`, `forc-client`, `forc-fmt`, `forc-lsp`, `forc-wallet` as well as `fuel-core` in `~/.fuelup/bin`.
{/* install_fuelup:example:end */}
{/*install_fuelup:example:end*/}

👉 Just paste the following line in your terminal and press _Enter_.
👉 Just paste the following line in your terminal and press *Enter*.

{/*install_fuelup_command:example:start*/}

{/* install_fuelup_command:example:start */}
```sh
curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh | sh
```
{/* install_fuelup_command:example:end */}

{/*install_fuelup_command:example:end*/}

> 🚧 Be aware that currently we do not natively support Windows. If you wish to use `fuelup` on Windows, please use Windows Subsystem for Linux.

Expand All @@ -71,11 +76,11 @@ If permitted, fuelup-init will configure your PATH for you by running the follow
Would you like fuelup-init to modify your PATH variable for you? (N/y)
```

👉 Press the `Y` key in your terminal and press _Enter_ to modify your PATH.
👉 Press the `Y` key in your terminal and press *Enter* to modify your PATH.

### Checking the installation

After allowing the `fuelup-init` script to modify your `PATH` variable, you will see a lot of information about packages being downloaded and installed. If everything goes as expected you will see the following message:
After allowing the `fuelup-init` script to modify your `PATH` variable, you will see a lot of information about packages being downloaded and installed. If everything goes as expected you will see the following message:

```sh
The Fuel toolchain is installed and up to date
Expand All @@ -90,6 +95,7 @@ To generate completions for your shell, run 'fuelup completions --shell=SHELL'.
```sh
fuelup --version
```

That will output your current `fuelup` version:

```sh
Expand All @@ -98,7 +104,7 @@ fuelup 0.19.5

## Setting up a default toolchain

Just as in [Rust](https://rust-lang.github.io/rustup/concepts/toolchains.html), Fuel supports multiple toolchains. A toolchain is a collection of tools (such as the compiler, lsp, etc).
Just as in [Rust](https://rust-lang.github.io/rustup/concepts/toolchains.html), Fuel supports multiple toolchains. A toolchain is a collection of tools (such as the compiler, LSP, etc).
By default, `fuelup` includes a series of packages tested to work with each other, providing a reliable set of tools.

In this case, we will install the `beta-4` toolchain, which is the stable toolchain compatible with the beta-4 network. For more information on `beta-4` check the [Fuel blog](https://fuel-labs.ghost.io/announcing-beta-4-testnet/) page.
Expand All @@ -112,7 +118,9 @@ Make sure you have the latest version of `fuelup` so you can access the latest f
```console
fuelup self update
```

Then you will get an output like this:

```console
Fetching binary from https://github.com/FuelLabs/fuelup/releases/download/v0.19.5/fuelup-0.19.5-aarch64-apple-darwin.tar.gz
Downloading component fuelup without verifying checksum
Expand All @@ -126,15 +134,17 @@ The `beta-4` network is the latest Fuel testnet. This includes public infrastruc

To properly interact with the `beta-4` network it is necessary to use its corresponding toolchain.

{/* install_beta-4:example:start */}
{/*install_beta-4:example:start*/}
👉 Run the following command to install the `beta-4` toolchain:
{/* install_beta-4:example:end */}
{/*install_beta-4:example:end*/}

{/*install_beta-4_command:example:start*/}

{/* install_beta-4_command:example:start */}
```console
fuelup toolchain install beta-4
```
{/* install_beta-4_command:example:end */}

{/*install_beta-4_command:example:end*/}

If the toolchain was successfully installed, you will see this output:

Expand All @@ -144,17 +154,19 @@ The Fuel toolchain is installed and up to date

The toolchain was installed correctly, however is not in use yet. Next, you need to configure `fuelup` to use the `beta-4` toolchain as the default.

{/* set_default_beta-4:example:start */}
{/*set_default_beta-4:example:start*/}
👉 Set `beta-4` as your default toolchain with the following command:
{/* set_default_beta-4:example:end */}
{/*set_default_beta-4:example:end*/}

{/*set_default_beta-4_command:example:start*/}

{/* set_default_beta-4_command:example:start */}
```console
fuelup default beta-4
```
{/* set_default_beta-4_command:example:end */}

You will get the following output indicating that you have successfully set `beta-4` as your default toolchain.
{/*set_default_beta-4_command:example:end*/}

You will get the following output indicating that you have successfully set `beta-4` as your default toolchain.

```console
default toolchain set to 'beta-4'
Expand Down Expand Up @@ -209,18 +221,18 @@ Now you are ready to start building with Fuel.

### Custom toolchains

You can create your own set of specific versions, this is known as 'custom toolchains'.
You can create your own set of specific versions, this is known as 'custom toolchains'.

> 👉 Visit the [Fuelup docs](docs/fuelup/concepts/toolchains) to learn how to set up your own custom toolchains.
> 👉 Visit the [Fuelup docs](/docs/fuelup/concepts/toolchains) to learn how to set up your own custom toolchains.

### Build form source

You can always build the Fuel packages from source.

> 👉 Visit the [Fuelup docs](docs/fuelup/install/other) to get more details about other types of installation.
> 👉 Visit the [Fuelup docs](/docs/fuelup/installation/other) to get more details about other types of installation.

### Github Codespaces

It's always possible to run a development environment in the browser.
It's always possible to run a development environment in the browser.

> 👉 Please visit our guide on [Github Codespaces](guides/installation/codespace) to use the Fuel toolchain in the browser.
> 👉 Please visit our guide on [Github Codespaces](/guides/installation/codespace) to use the Fuel toolchain in the browser.
Loading