Skip to content

Commit

Permalink
docs: up contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jun 25, 2024
1 parent 4dc5ef2 commit 8e12989
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
23 changes: 9 additions & 14 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,38 +52,36 @@ gh repo clone wevm/abitype
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Installing Node.js and pnpm
## 2. Installing Node.js and pnpm

ABIType uses [pnpm](https://pnpm.io) as its package manager. You need to install **Node.js v16 or higher** and **pnpm v7 or higher**.

You can run the following commands in your terminal to check your local Node.js and npm versions:
ABIType uses Node.js with [pnpm workspaces](https://pnpm.io/workspaces) to manage multiple projects. You can run the following command in your terminal to check your local Node.js version.

```bash
node -v
pnpm -v
```

If the versions are not correct or you don't have Node.js or pnpm installed, download and follow their setup instructions:
If **`node@22`** is not installed, you can install via [fnm](https://github.com/Schniz/fnm) or from the [official website](https://nodejs.org).

Once Node.js is installed, run the following to install [Corepack](https://nodejs.org/api/corepack.html). Corepack automatically installs and manages pnpm.

- Install Node.js using [fnm](https://github.com/Schniz/fnm) or from the [official website](https://nodejs.org)
- Install [pnpm](https://pnpm.io/installation)
```bash
corepack enable
```

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

## Installing dependencies

Once in the project's root directory, run the following command to install the project's dependencies:
Once in the project's root directory, run the following command to install pnpm (via Corepack) and the project's dependencies:

```bash
pnpm install
```

After the install completes, pnpm links packages across the project for development and [git hooks](https://github.com/toplenboren/simple-git-hooks) are set up.

> **Note:** In case you have to install new packages or upgrade packages make sure to use **[email protected]** and **[email protected]**
<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>
Expand All @@ -94,11 +92,8 @@ Tests are run with [Vitest](https://vitest.dev/guide/testing-types.html):

```bash
pnpm test
pnpm test:typecheck
```

> **Note** Ensure to build the package (`pnpm build`) before running the `test:typecheck` suite.
<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
- name: Link packages
run: pnpm preconstruct

- name: Test types
run: 'pnpm test:types'
- name: Bench types
run: 'pnpm bench:types'

- name: Check types
run: pnpm typecheck
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"type": "module",
"scripts": {
"bench": "vitest bench",
"bench:types": "TYPES=true vitest bench-d.ts",
"build": "pnpm run --r --filter \"./packages/**\" build",
"changeset:prepublish": "pnpm version:update && pnpm build && bun .scripts/formatPackageJson.ts && bun .scripts/generateProxyPackages.ts",
"changeset:publish": "pnpm changeset:prepublish && changeset publish",
Expand All @@ -22,7 +23,6 @@
"test": "vitest",
"test:build": "pnpm run --r --parallel test:build",
"test:cov": "vitest run --coverage",
"test:types": "TYPES=true vitest bench-d.ts",
"test:update": "vitest --update",
"trace": "tsc --noEmit --generateTrace ./playgrounds/performance/out --incremental false --project playgrounds/performance/tsconfig.json && echo \"Open playgrounds/performance/out/trace.json in https://ui.perfetto.dev\"",
"typecheck": "pnpm run --r --parallel typecheck && tsc --noEmit",
Expand All @@ -49,6 +49,9 @@
"vitest": "^1.6.0"
},
"packageManager": "[email protected]",
"engines": {
"node": "22.x"
},
"simple-git-hooks": {
"pre-commit": "pnpm format && pnpm lint:fix"
},
Expand Down

0 comments on commit 8e12989

Please sign in to comment.