Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermoe committed Sep 25, 2023
1 parent f085285 commit 91d921f
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ This repo contains 3 npm packages:

# Development

This multimodule repository uses `npm` workspaces. All commands are intended to be run from the root folder.
This multi-package repository uses [`pnpm` workspaces](https://pnpm.io/workspaces).

## Prerequisites
### `node` and `npm`
This project is using `node v20.3.0` and `npm v9.6.7`. You can verify your `node` and `npm` installation via the terminal:
### `node`
This project is using `node v20.3.0`. You can verify your `node` and `npm` installation via the terminal:

```
$ node --version
v20.3.0
$ npm --version
9.6.7
```

If you don't have `node` installed. Feel free to choose whichever approach you feel the most comfortable with. If you don't have a preferred installation method, we recommend using `nvm` (aka [node version manager](https://github.com/nvm-sh/nvm)). `nvm` allows you to install and use different versions of node. It can be installed by running `brew install nvm` (assuming that you have homebrew)
If you don't have `node` installed, Feel free to choose whichever approach you feel the most comfortable with. If you don't have a preferred installation method, we recommend using `nvm` (aka [node version manager](https://github.com/nvm-sh/nvm)). `nvm` allows you to install and use different versions of node. It can be installed by running `brew install nvm` (assuming that you have homebrew)

Once you have installed `nvm`, install the desired node version with `nvm install vX.Y.Z`. After installation, you may run `nvm use` to automatically tell `nvm` which `node` version to use (this will be picked up from the target version noted in `.nvmrc`):

Expand All @@ -30,24 +28,32 @@ Found '/Users/.../TBD54566975/tbdex-js/packages/protocol/.nvmrc' with version <v
Now using node v20.3.0 (npm v9.6.7)
```

### [`pnpm`](https://pnpm.io/)

If you don't have `pnpm` installed, choose whichever approach you feel most comfortable with [here](https://pnpm.io/installation)

> [!NOTE]
>
> it's possible that this project may work with `npm` as well but it's not guaranteed.
## Running Tests
> [!NOTE]
>
> Make sure you have all the [prerequisites](#prerequisites)
0. clone the repo and `cd` into the project directory
1. Install all project dependencies by `npm install`
1. Install all project dependencies by `pnpm install`
2. Build all workspace projects in this repo by running `npm run build`
3. run tests using `npm run test:node` to run tests within a nodejs runtime
4. run tests using `npm run test:browser` to run tests within a browser runtime. Before doing so, run `npx playwright install --with-deps`, only required once.

## `npm` scripts

| Script | Description |
| ---------------------- | --------------------------------------------------------- |
| `npm run clean` | deletes `dist` dir and compiled tests |
| `npm run test:node` | runs tests in node runtime |
| `npm run test:browser` | runs tests in headless browsers (chrome, safari, firefox) |
| `npm run lint` | runs linter without auto-fixing |
| `npm run lint:fix` | runs linter and applies automatic fixes wherever possible |
| `npm run build` | builds all distributions and dumps them into `dist` |
3. run tests using `pnpm run test:node` to run tests within a nodejs runtime
4. run tests using `pnpm run test:browser` to run tests within a browser runtime. Before doing so, run `npx playwright install --with-deps`, only required once.

## `pnpm` scripts

| Script | Description |
| ----------------------- | --------------------------------------------------------- |
| `pnpm run clean` | deletes `dist` dir and compiled tests |
| `pnpm run test:node` | runs tests in node runtime |
| `pnpm run test:browser` | runs tests in headless browsers (chrome, safari, firefox) |
| `pnpm run lint` | runs linter without auto-fixing |
| `pnpm run lint:fix` | runs linter and applies automatic fixes wherever possible |
| `pnpm run build` | builds all distributions and dumps them into `dist` |

0 comments on commit 91d921f

Please sign in to comment.