Skip to content

Commit

Permalink
Replace yarn with pnpm (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcroote authored Aug 13, 2024
1 parent b121efe commit cb66d1e
Show file tree
Hide file tree
Showing 26 changed files with 2,647 additions and 1,450 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/firebase-live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9.x

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install
- run: pnpm install

- name: Build Docs
env:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/firebase-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9.x

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install
- run: pnpm install

- name: Build Docs
env:
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/refresh-index-chains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,26 @@ jobs:
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9.x

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install
- run: pnpm install

- name: Refresh chains and flex index files
# If changes are present after build, set env variable
run: |
yarn axios:build
yarn docs:build
yarn flex:build
yarn flex:test
pnpm axios:build
pnpm docs:build
pnpm flex:build
pnpm flex:test
git diff --quiet --exit-code || echo "CHANGES_FOUND=true" >> $GITHUB_ENV
- name: Create PR if files have changed
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
yarn run format:check
yarn run zip:config-check
pnpm run format:check
pnpm run zip:config-check
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ information about getting started and making a contribution to the API3 Docs.
### Installation

```bash
yarn install
pnpm install
```

### Running the local development server

Run the following command to start the local development server on port `5173`:

```bash
yarn docs:dev
pnpm docs:dev
```

### Structure
Expand All @@ -51,7 +51,7 @@ structure of the docs.
### Building the static site

```bash
yarn docs:build
pnpm docs:build
```

### Prettier Formatting
Expand All @@ -60,7 +60,7 @@ Make sure to run the following command before submitting a PR to format the
markdown. The Github action will check for prettier formatting:

```bash
yarn format
pnpm format
```

### Formatting and Styling
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/axios-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ The local data files can be refreshed by running the
`/libs/axiosBuildScripts.js` script as follows:

```sh
yarn axios:build
pnpm axios:build
```
6 changes: 3 additions & 3 deletions docs/dev/firebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ firebase:emulator
OR

```sh
yarn docs:build
pnpm docs:build

yarn flex:build
pnpm flex:build

yarn flex:test
pnpm flex:test

firebase emulators:start
```
12 changes: 6 additions & 6 deletions docs/dev/flexsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ will index all HTML files in the `/dist` folder for the following directories:
- `/dist/reference/`

Any files that are not part of the docs but are desired to be retained should go
into the `/archive` folder before running `yarn docs:build` which will create
into the `/archive` folder before running `pnpm docs:build` which will create
the `/dist` folder. This prevents such files from being indexed.

## `<FlexStartTag/>` and `<FlexEndTag/>`
Expand Down Expand Up @@ -72,7 +72,7 @@ indexes.
Build the local data files via the Axios script.

```sh
yarn axios:build
pnpm axios:build
```

### 2. Build the `/dist` folder
Expand All @@ -82,18 +82,18 @@ Build the `/dist` folder with the latest HTML files. All markdown files in
contain the extraction markers `<Flex...Tag/>`.

```sh
yarn docs:build
pnpm docs:build
```

### 3. Script `flexBuildIndexes.js`

Builds the index files.

```sh
yarn flex:build
pnpm flex:build
```

Note the output from the command `yarn flex:build` which displays file sizes.
Note the output from the command `pnpm flex:build` which displays file sizes.
Check the size of the three `map.json` files which should be in the range of
25-31 MB. If not refer to the
[Long strings warning](/dev/flexsearch.html#long-strings-warning) section below.
Expand All @@ -112,7 +112,7 @@ Check the size of the three `map.json` files which should be in the range of
Test the index files.

```sh
yarn flex:test
pnpm flex:test
```

### 5. Firebase emulator (optional step)
Expand Down
10 changes: 5 additions & 5 deletions docs/dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Clone the remote repo and install it packages.
```sh
git clone git@github.com:api3dao/vitepress-docs.git
cd vitepress-docs
yarn install
pnpm install
```

Create a working branch.
Expand All @@ -44,7 +44,7 @@ git checkout -b <branch-name>
Run the development server.

```sh
yarn docs:dev
pnpm docs:dev
```

## Push the working branch
Expand All @@ -53,7 +53,7 @@ Before pushing your working branch to the remote repo, be sure that the branch
builds.

```sh
yarn docs:build
pnpm docs:build
```

The output should look like this:
Expand All @@ -72,8 +72,8 @@ needed.

## Memory

It maybe necessary to increase the memory for Nodejs to run `yarn docs:dev` or
`yarn docs:build`. This can be done with the command below, with a higher value
It maybe necessary to increase the memory for Nodejs to run `pnpm docs:dev` or
`pnpm docs:build`. This can be done with the command below, with a higher value
potentially necessary. For Apple silicon this may be a sign of a
[Rosetta issue](/dev/rosetta.md) which should be addressed before committing to
additional memory for Nodejs.
Expand Down
6 changes: 3 additions & 3 deletions docs/dev/link-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The script is part of a three step process to keep the links in the docs clean.

The three steps:

1. `yarn dev:build`: When doing a local build VitePress will valid markdown
1. `pnpm dev:build`: When doing a local build VitePress will valid markdown
links and does so very well. Fix them before proceeding. This step will also
catch bad `src` paths for images. It does not validate anchors.
2. Search the code base for `](#`. This will show markdown links that link
Expand All @@ -38,7 +38,7 @@ The script must be run locally and will not work as a GitHub action.
Build the docs as usual using the standard build command provided by VitePress.

```sh
yarn docs:build
pnpm docs:build
```

Note that the build script may in fact catch bad links in of itself. Any
Expand All @@ -50,7 +50,7 @@ VitePress has a built-in http server that publishes the files from the `/dist`
folder.

```sh
yarn docs:serve
pnpm docs:serve
```

### 3. Run the script
Expand Down
10 changes: 5 additions & 5 deletions docs/dev/rosetta.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,27 @@ If you are installing with npm, you can try ensuring that both npm and node are
not running under Rosetta 2 and then reinstalling esbuild. This likely involves
changing how you installed npm and/or node. For example, installing node with
the universal installer here should work: https://nodejs.org/en/download/. Or
you could consider using yarn instead of npm which has built-in support for
you could consider using pnpm instead of npm which has built-in support for
installing a package on multiple platforms simultaneously.
...
```
## How to correct
If you run `yarn docs:build` and get the above error you may have an `esbuild`
If you run `pnpm docs:build` and get the above error you may have an `esbuild`
package for use with the non-native platform for Apple silicon probably install
using NPM. Run the following (only using yarn) to update `esbuild`. If your CLI
using NPM. Run the following (only using pnpm) to update `esbuild`. If your CLI
is not running under Rosetta, it will install for the proper platform.
`esbuild` will not appear in `packages.json` under `devDependencies`, but it
does update.
```sh
yarn install --dev esbuild
pnpm install --dev esbuild
```
Next run a VitePress build.
```sh
yarn docs:build
pnpm docs:build
```
4 changes: 2 additions & 2 deletions docs/dev/zip-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Zip files are available for three quick-start Airnode deployment guides:
To facilitate the creation of these zip files, the following script can be run:

```sh
yarn zip:create
pnpm zip:create
```

To ensure that the `config.json` files within these zip files do not get
out-of-sync with their input `config.json` files, the following script is run as
part of the pre-push hook (it can also be run independently):

```sh
yarn zip:config-check
pnpm zip:config-check
```
2 changes: 1 addition & 1 deletion docs/public/indexes/all-dev/map.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/public/indexes/all/map.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/public/indexes/latest/map.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/reference/airnode/latest/packages/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ in your project.

```sh
npm install --save @api3/airnode-adapter
# or by
yarn add @api3/airnode-adapter
```

You shouldn't need to use the adapter package directly. However, you might want
Expand Down
6 changes: 1 addition & 5 deletions docs/reference/airnode/latest/packages/airnode-abi.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,12 @@ doc.

You can install
[@api3/airnode-abi](https://www.npmjs.com/package/@api3/airnode-abi?activeTab=dependencies)
with either
with
[npm](https://docs.npmjs.com/getting-started/installing-node#install-npm--manage-npm-versions)
or [Yarn](https://yarnpkg.com/en/docs/install)

```sh
# npm
npm install --save @api3/airnode-abi

# Yarn
yarn add @api3/airnode-abi
```

## Usage
Expand Down
5 changes: 1 addition & 4 deletions docs/reference/airnode/latest/packages/deployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ npx @api3/airnode-deployer deploy \

### Global Package

The airnode-deployer package can be installed globally with yarn or npm. If
installed using yarn make sure yarn bin is added to `PATH`.
The airnode-deployer package can be installed globally with npm.

```sh
yarn global add @api3/airnode-deployer
# OR
npm install @api3/airnode-deployer -g

# Executing the deployer.
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/airnode/latest/packages/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ alternatively
```sh
# First install the package
npm install @api3/airnode-validator
# Or
yarn add @api3/airnode-validator

# Run the validator CLI
npx airnode-validator --config "config.json" --secrets "secrets.env"
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/airnode/next/packages/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ in your project.

```sh
npm install --save @api3/airnode-adapter
# or by
yarn add @api3/airnode-adapter
```

You shouldn't need to use the adapter package directly. However, you might want
Expand Down
6 changes: 1 addition & 5 deletions docs/reference/airnode/next/packages/airnode-abi.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,12 @@ doc.

You can install
[@api3/airnode-abi](https://www.npmjs.com/package/@api3/airnode-abi?activeTab=dependencies)
with either
with
[npm](https://docs.npmjs.com/getting-started/installing-node#install-npm--manage-npm-versions)
or [Yarn](https://yarnpkg.com/en/docs/install)

```sh
# npm
npm install --save @api3/airnode-abi

# Yarn
yarn add @api3/airnode-abi
```

## Usage
Expand Down
5 changes: 1 addition & 4 deletions docs/reference/airnode/next/packages/deployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ npx @api3/airnode-deployer deploy \

### Global Package

The airnode-deployer package can be installed globally with yarn or npm. If
installed using yarn make sure yarn bin is added to `PATH`.
The airnode-deployer package can be installed globally with npm.

```sh
yarn global add @api3/airnode-deployer
# OR
npm install @api3/airnode-deployer -g

# Executing the deployer.
Expand Down
Loading

0 comments on commit cb66d1e

Please sign in to comment.