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

Upgrade to pnpm #444

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e7634ab
update gh actions, gitignore, husky, lintstage
technophile-04 Jul 20, 2023
e9cc46f
add pnpm workspace and lock file
technophile-04 Jul 21, 2023
5f6a6d8
generate pnpm-lock.yaml per workspace
technophile-04 Jul 24, 2023
d0a2d15
add use-hooks patch
technophile-04 Jul 24, 2023
da47e55
remove --immutable from gh-workflow
technophile-04 Jul 24, 2023
80e48fd
setup pnpm in gh workflow
technophile-04 Jul 24, 2023
ec68f70
add downloading Git reference back
technophile-04 Jul 26, 2023
d148eb0
updater packageManger version in package.json
technophile-04 Jul 26, 2023
e720b86
add preinstall script
technophile-04 Jul 27, 2023
ba393c0
use glob pattern for workspace
technophile-04 Jul 27, 2023
714a6e8
put back OG deploy command
technophile-04 Aug 1, 2023
073ce50
fix localStorage patch, update pnpm version to 8.6.12
technophile-04 Aug 7, 2023
43665f7
update gh-actions to use pnpm run while running scripts
technophile-04 Aug 7, 2023
f04127e
Merge remote-tracking branch 'origin/main' into feat/pnpm
technophile-04 Sep 3, 2023
ab36f9b
add abitype
technophile-04 Sep 3, 2023
2580043
Merge branch 'main' into feat/pnpm
carletex Sep 7, 2023
1e43995
add check for pnpm version >=8.7.1 & use shorthand -F instead of --fi…
technophile-04 Sep 8, 2023
047fc2c
update readme with lowercase pnpm and mention version
technophile-04 Sep 8, 2023
a792eca
Fix pnpm installation link
carletex Sep 14, 2023
e38ee17
Merge branch 'main' into feat/pnpm
carletex Sep 14, 2023
c3982e2
Merge branch 'main' into feat/pnpm
technophile-04 Sep 21, 2023
e703240
Merge branch 'origin/main' into feat/pnpm
technophile-04 Sep 24, 2023
c09290d
use node v18 in actions
technophile-04 Sep 24, 2023
3b9b57c
update abitype ovveride path
technophile-04 Sep 24, 2023
8fd3023
Merge branch 'main' into feat/pnpm
technophile-04 Sep 26, 2023
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
19 changes: 12 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,34 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [16.x]
node: [18.x]

steps:
- name: Checkout
uses: actions/checkout@master

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup node env
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache : yarn
cache: pnpm

- name: Install dependencies
run: yarn install --immutable
run: pnpm install

- name: Run hardhat node, deploy contracts (& generate contracts typescript output)
run: yarn chain & yarn deploy
run: pnpm run chain & pnpm run deploy

- name: Run nextjs lint
run: yarn next:lint --max-warnings=0
run: pnpm run next:lint --max-warnings=0

- name: Check typings on nextjs
run: yarn next:check-types
run: pnpm run next:check-types

- name: Run hardhat lint
run: yarn hardhat:lint --max-warnings=0
run: pnpm run hardhat:lint --max-warnings=0
14 changes: 12 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
node_modules

# dependencies, yarn, etc
# yarn / eslint
# pnpm
pnpm-debug.log*
pnpm-error.log*
.pnpm-debug.log*

# yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# eslint
.eslintcache

# Visual Studio Code
.vscode/**

# macOS
.DS_Store
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged --verbose
pnpm lint-staged --verbose
6 changes: 3 additions & 3 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const path = require("path");

const buildNextEslintCommand = (filenames) =>
`yarn next:lint --fix --file ${filenames
`pnpm next:lint --fix --file ${filenames
.map((f) => path.relative(path.join("packages", "nextjs"), f))
.join(" --file ")}`;

const checkTypesNextCommand = () => "yarn next:check-types";
const checkTypesNextCommand = () => "pnpm next:check-types";

const buildHardhatEslintCommand = (filenames) =>
`yarn hardhat:lint-staged --fix ${filenames
`pnpm hardhat:lint-staged --fix ${filenames
.map((f) => path.relative(path.join("packages", "hardhat"), f))
.join(" ")}`;

Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shared-workspace-lockfile = false
9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

This file was deleted.

783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.3.cjs

This file was deleted.

11 changes: 0 additions & 11 deletions .yarnrc.yml

This file was deleted.

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Before you begin, you need to install the following tools:

- [Node (v18 LTS)](https://nodejs.org/en/download/)
- Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install))
- [pnpm (v8.7.1+)](https://pnpm.io/installation)
- [Git](https://git-scm.com/downloads)
technophile-04 marked this conversation as resolved.
Show resolved Hide resolved

## Quickstart
Expand All @@ -32,34 +32,34 @@ To get started with Scaffold-ETH 2, follow the steps below:
```
git clone https://github.com/scaffold-eth/scaffold-eth-2.git
cd scaffold-eth-2
yarn install
pnpm install
```

2. Run a local network in the first terminal:

```
yarn chain
pnpm chain
```

This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in `hardhat.config.ts`.

3. On a second terminal, deploy the test contract:

```
yarn deploy
pnpm hardhat:deploy
```

This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script.
This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `pnpm hardhat:deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script.

4. On a third terminal, start your NextJS app:

```
yarn start
pnpm start
```

Visit your app on: `http://localhost:3000`. You can interact with your smart contract using the contract component or the example ui in the frontend. You can tweak the app config in `packages/nextjs/scaffold.config.ts`.

Run smart contract test with `yarn hardhat:test`
Run smart contract test with `pnpm hardhat:test`

- Edit your smart contract `YourContract.sol` in `packages/hardhat/contracts`
- Edit your frontend in `packages/nextjs/pages`
Expand Down
43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,33 @@
]
},
"scripts": {
technophile-04 marked this conversation as resolved.
Show resolved Hide resolved
"account": "yarn workspace @se-2/hardhat account",
"chain": "yarn workspace @se-2/hardhat chain",
"fork": "yarn workspace @se-2/hardhat fork",
"deploy": "yarn workspace @se-2/hardhat deploy",
"verify": "yarn workspace @se-2/hardhat verify",
"compile": "yarn workspace @se-2/hardhat compile",
"generate": "yarn workspace @se-2/hardhat generate",
"hardhat:lint": "yarn workspace @se-2/hardhat lint",
"hardhat:lint-staged": "yarn workspace @se-2/hardhat lint-staged",
"hardhat:test": "yarn workspace @se-2/hardhat test",
"test": "yarn hardhat:test",
"start": "yarn workspace @se-2/nextjs dev",
"next:lint": "yarn workspace @se-2/nextjs lint",
"next:format": "yarn workspace @se-2/nextjs format",
"next:check-types": "yarn workspace @se-2/nextjs check-types",
"preinstall": "npx only-allow pnpm",
"account": "pnpm -F @se-2/hardhat run account",
"chain": "pnpm -F @se-2/hardhat run chain",
"fork": "pnpm -F @se-2/hardhat run fork",
"deploy": "pnpm -F @se-2/hardhat run deploy",
"verify": "pnpm -F @se-2/hardhat run verify",
"compile": "pnpm -F @se-2/hardhat run compile",
"generate": "pnpm -F @se-2/hardhat run generate",
"hardhat:lint": "pnpm -F @se-2/hardhat run lint",
"hardhat:lint-staged": "pnpm -F @se-2/hardhat run lint-staged",
"hardhat:test": "pnpm -F @se-2/hardhat run test",
"start": "pnpm -F @se-2/nextjs run dev",
"next:lint": "pnpm -F @se-2/nextjs run lint",
"next:format": "pnpm -F @se-2/nextjs run format",
"next:check-types": "pnpm -F @se-2/nextjs run check-types",
"test": "pnpm -F @se-2/hardhat run test",
"postinstall": "husky install",
"precommit": "lint-staged",
"vercel": "yarn workspace @se-2/nextjs vercel",
"vercel:yolo": "yarn workspace @se-2/nextjs vercel:yolo"
"vercel": "pnpm -F @se-2/nextjs run vercel",
"vercel:yolo": "pnpm -F @se-2/nextjs run vercel:yolo"
},
"engines": {
"node": ">=16.14.0",
"pnpm": ">=8.7.1"
},
"packageManager": "[email protected]",
"devDependencies": {
"husky": "^8.0.1",
"lint-staged": "^13.0.3"
},
"resolutions": {
"usehooks-ts@^2.7.2": "patch:usehooks-ts@npm:^2.7.2#./.yarn/patches/usehooks-ts-npm-2.7.2-fceffe0e43.patch"
}
}
Loading