Skip to content

Commit

Permalink
Migrate from Yarn to pnpm (#46)
Browse files Browse the repository at this point in the history
Use pnpm as a package manager
    
[pnpm](https://github.com/pnpm/pnpm) is a package manager optimized for
monorepos.
It is faster than NPM and consumes less disk storage than Yarn.
    
Disk consumption:
- Yarn
```sh
$ du -sh ~/workspace/acre/acre
2.2G    /Users/jakub/workspace/acre/acre
```
- pnpm
```sh
$  du -sh ~/workspace/acre/acre
875M    /Users/jakub/workspace/acre/acre
```
    
To install pnpm with Homebrew run `brew install pnpm`, for other
installation options
please see the [documentation](https://pnpm.io/installation).
    
To install the packages dependencies run:
```sh
pnpm install
```
  • Loading branch information
kkosiorowska authored Nov 28, 2023
2 parents 48965f3 + 3fea55e commit ff60a53
Show file tree
Hide file tree
Showing 20 changed files with 15,148 additions and 20,553 deletions.
48 changes: 29 additions & 19 deletions .github/workflows/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,40 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Format
run: yarn format
run: pnpm run format

core-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Build
run: yarn build
run: pnpm run build

- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
Expand All @@ -64,15 +68,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- uses: actions/setup-python@v4
with:
Expand All @@ -98,15 +104,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Download Build Artifacts
uses: actions/download-artifact@v3
Expand All @@ -115,23 +123,25 @@ jobs:
path: core/

- name: Test
run: yarn test --no-compile
run: pnpm run test --no-compile

core-deploy-dry-run:
needs: [core-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
cache: "yarn"
cache-dependency-path: "core/yarn.lock"
cache: "pnpm"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Download Build Artifacts
uses: actions/download-artifact@v3
Expand All @@ -140,4 +150,4 @@ jobs:
path: core/

- name: Deploy
run: yarn deploy --no-compile
run: pnpm run deploy --no-compile
22 changes: 10 additions & 12 deletions .github/workflows/dapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,31 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "dapp/.nvmrc"
cache: "yarn"
cache-dependency-path: "dapp/yarn.lock"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Format
run: yarn format
run: pnpm run format

dapp-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "dapp/.nvmrc"
cache: "yarn"
cache-dependency-path: "dapp/yarn.lock"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Build
run: yarn build
run: pnpm run build
22 changes: 10 additions & 12 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,31 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "website/.nvmrc"
cache: "yarn"
cache-dependency-path: "website/yarn.lock"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Format
run: yarn format
run: pnpm run format

website-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v2

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "website/.nvmrc"
cache: "yarn"
cache-dependency-path: "website/yarn.lock"

- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: pnpm install --prefer-offline --frozen-lockfile

- name: Build
run: yarn build
run: pnpm run build
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Node
node_modules/
pnpm-debug.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public-hoist-pattern[]=@chakra-ui/*
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/iron
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ Bitcoin Liquid Staking

## Development

### pnpm

This project uses [pnpm](https://pnpm.io/) as a package manager.

#### Install

To install pnpm with Homebrew run `brew install pnpm`, for other installation options
please see the [documentation](https://pnpm.io/installation).

#### Package Dependencies

To install the packages dependencies run:
```sh
pnpm install
```

### Pre-commit Hooks

Developers are encouraged to use [pre-commit](https://pre-commit.com/) hooks to
Expand Down
4 changes: 1 addition & 3 deletions core/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Hardhat
build/
cache/
export.json
export/
node_modules/
typechain/
yarn-debug.log*
yarn-error.log*
Loading

0 comments on commit ff60a53

Please sign in to comment.