Skip to content

Commit

Permalink
swap monorepo from npm to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeyTM authored and kanej committed May 1, 2024
1 parent 2ece952 commit 4c3c6e6
Show file tree
Hide file tree
Showing 14 changed files with 8,840 additions and 20,046 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"version": "18" /* Keep in sync with the oldest version of Node.js that Hardhat supports */
},
},
/* installs npm dependencies on the new container. */
"postCreateCommand": "npm install"
/* installs pnpm dependencies on the new container. */
"postCreateCommand": "pnpm install"
}
50 changes: 28 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,38 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v2
with:
node-version: 18
cache: npm
cache: "pnpm"
- name: Install
run: npm install
run: pnpm install
- name: Build
run: npm run build
run: pnpm build
- name: Run tests
run: npm run test
- name: Run tests in examples
run: npm run test:examples
run: pnpm test

test_on_macos:
name: Test Ignition on MacOS with Node 18
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v2
with:
node-version: 18
cache: npm
cache: "pnpm"
- name: Install
run: npm install
run: pnpm install
- name: Build
run: npm run build
run: pnpm build
- name: Run tests
run: npm run test
- name: Run tests in examples
run: npm run test:examples
run: pnpm test

test_on_linux:
name: Test Ignition on Ubuntu with Node ${{ matrix.node }}
Expand All @@ -52,31 +54,35 @@ jobs:
node: [18, 20.5]
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
cache: "pnpm"
- name: Install
run: npm install
run: pnpm install
- name: Build
run: npm run build
run: pnpm build
- name: Run tests
run: npm run test
- name: Run tests in examples
run: npm run test:examples
run: pnpm test

lint:
name: Lint the project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v2
with:
node-version: 18
cache: npm
cache: "pnpm"
- name: Install
run: npm install
run: pnpm install
- name: Build
run: npm run build
run: pnpm build
- name: Lint
run: npm run lint
run: pnpm lint
37 changes: 19 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If you find a bug or want to propose a new feature, please [open an issue](https

## Project Structure

This repository is a monorepo handled with `npm` workspaces.
This repository is a monorepo handled with `pnpm` workspaces.

There are five packages:

Expand All @@ -20,50 +20,50 @@ There are five packages:

## Setup

Ignition is a `typescript` project managed by `npm`.
Ignition is a `typescript` project managed by `pnpm`.

To install the dependencies, run `npm` in the project root:
To install the dependencies, run `pnpm` in the project root:

```shell
npm install
pnpm install
```

## Building

The packages are written in `typescript` and so require a build step, to build:

```shell
npm run build
pnpm build
```

The **Hardhat** plugin depends on **core**, while developing you may want to run a continuous build with `watch`:

```shell
npm run watch
pnpm watch
```

## Testing

The test suite is written in `mocha`, to run:

```shell
npm run test
pnpm test
```

## Linting

Formatting is enforced with `prettier` and code rules with `eslint`, to run both:

```shell
npm run lint
pnpm lint
```

## Clean

If typescript or testing gets into a weird state, `clean` will remove ephemeral folders (i.e. `./dist`, `./coverage` etc) and clear the typescript build info cache, allowing you to start from a clean slate:

```shell
npm run clean
pnpm clean
```

## Branching
Expand All @@ -85,16 +85,16 @@ If you are working purely on the documentation, not as a result of a technical c
To publish ignition:

1. git fetch, Checkout out `development`, then ensure your branch is up to date `git pull --ff-only`
2. Perform a clean install and build (will lose all uncommitted changes) git clean -fdx ., npm install, npm run build
3. Run a full check, stopping on failure: `npm run fullcheck`
2. Perform a clean install and build (will lose all uncommitted changes) git clean -fdx ., pnpm install, pnpm build
3. Run a full check, stopping on failure: `pnpm fullcheck`
4. Confirm the commits represent the features for the release
5. Create a release branch `git checkout -b release/yyyy-mm-dd`
6. Update the `CHANGELOG.md` under `./packages/core`.
7. Update the `CHANGELOG.md` under `./packages/hardhat-plugin`.
8. Update the `CHANGELOG.md` under `./packages/hardhat-plugin-ethers`.
9. Update the `CHANGELOG.md` under `./packages/hardhat-plugin-viem`.
10. Update the `CHANGELOG.md` under `./packages/ui`.
11. Update the package versions based on semver: `npm version --no-git-tag-version --workspaces patch #minor #major`
11. Update the package versions based on semver: `pnpm version --no-git-tag-version --workspaces patch #minor #major`
12. Update the version of dependencies:

- cores version in hardhat-ui deps
Expand All @@ -110,12 +110,13 @@ Update the packages versions and changelogs for the `X.X.X -
yyyy-mm-dd` release.
```

14. Push the release branch and open a pull request on `main`, the PR description should match the changelogs
15. On a successful check, `rebase merge` the release branch into `main`
16. Switch to main branch and pull the latest changes
17. Git tag the version, `g tag -a v0.x.x -m "v0.x.x"` and push the tag `git push --follow-tags`
18. Publish `@nomicfoundation/ignition-core`, `@nomicfoundation/ignition-ui`, `@nomicfoundation/hardhat-ignition` and `@nomicfoundation/hardhat-ignition-viem` : `npm publish -w @nomicfoundation/ignition-core -w @nomicfoundation/ignition-ui -w @nomicfoundation/hardhat-ignition -w @nomicfoundation/hardhat-ignition-ethers -w @nomicfoundation/hardhat-ignition-viem`
19. Create a release on github off of the pushed tag, the release notes should match the changelogs followed by a hiring entry:
14. Deploy to a local verdaccio instance and test each of the `./examples` based on the new version.
15. Push the release branch and open a pull request on `main`, the PR description should match the changelogs
16. On a successful check, `rebase merge` the release branch into `main`
17. Switch to main branch and pull the latest changes
18. Git tag the version, `g tag -a v0.x.x -m "v0.x.x"` and push the tag `git push --follow-tags`
19. Publish `@nomicfoundation/ignition-core`, `@nomicfoundation/ignition-ui`, `@nomicfoundation/hardhat-ignition` and `@nomicfoundation/hardhat-ignition-viem` : `pnpm publish -w @nomicfoundation/ignition-core -w @nomicfoundation/ignition-ui -w @nomicfoundation/hardhat-ignition -w @nomicfoundation/hardhat-ignition-ethers -w @nomicfoundation/hardhat-ignition-viem`
20. Create a release on github off of the pushed tag, the release notes should match the changelogs followed by a hiring entry:

```markdown
---
Expand Down
Loading

0 comments on commit 4c3c6e6

Please sign in to comment.