Skip to content

Commit ffc299c

Browse files
authored
Merge pull request #258 from alephium/switch-to-pnpm
Switch from bun to pnpm
2 parents b51b05f + d84b3af commit ffc299c

File tree

78 files changed

+19054
-614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+19054
-614
lines changed

.github/workflows/deploy-gh-pages-explorer.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ jobs:
3131
- name: Check out Git repository
3232
uses: actions/checkout@v3
3333

34-
- name: Install Bun package manager
35-
uses: oven-sh/setup-bun@v1
34+
- name: Install pnpm package manager
35+
uses: pnpm/action-setup@v2
36+
with:
37+
version: 8
3638

3739
- name: Install NPM dependencies
38-
run: bun install
40+
run: pnpm install
3941

4042
- name: Build
41-
run: cd apps/explorer && bun run ci:build:gh-pages
43+
run: cd apps/explorer && pnpm run ci:build:gh-pages
4244

4345
- name: Set up Pages
4446
uses: actions/configure-pages@v3

.github/workflows/deploy-mainnet-explorer.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ jobs:
2020
- name: Check out Git repository
2121
uses: actions/checkout@v3
2222

23-
- name: Install Bun package manager
24-
uses: oven-sh/setup-bun@v1
23+
- name: Install pnpm package manager
24+
uses: pnpm/action-setup@v2
25+
with:
26+
version: 8
2527

2628
- name: Install NPM dependencies
27-
run: bun install
29+
run: pnpm install
2830

2931
- name: Build frontend
30-
run: cd apps/explorer && bun run ci:build && bun docker/init-server-data.js
32+
run: cd apps/explorer && pnpm run ci:build && pnpm docker/init-server-data.js
3133

3234
- name: Sync files to S3
3335
run: aws s3 sync ./apps/explorer/build/ s3://$AWS_BUCKET_NAME --acl public-read --delete --cache-control max-age=604800

.github/workflows/deploy-testnet-explorer.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ jobs:
2020
- name: Check out Git repository
2121
uses: actions/checkout@v3
2222

23-
- name: Install Bun package manager
24-
uses: oven-sh/setup-bun@v1
23+
- name: Install pnpm package manager
24+
uses: pnpm/action-setup@v2
25+
with:
26+
version: 8
2527

2628
- name: Install NPM dependencies
27-
run: bun install
29+
run: pnpm install
2830

2931
- name: Build frontend
30-
run: cd apps/explorer && bun run ci:build && bun docker/init-server-data.js
32+
run: cd apps/explorer && pnpm run ci:build && pnpm docker/init-server-data.js
3133

3234
- name: Sync files to S3
3335
run: aws s3 sync ./apps/explorer/build/ s3://$AWS_BUCKET_NAME --acl public-read --delete --cache-control max-age=604800

.github/workflows/publish-docker-explorer.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ jobs:
1515
fetch-depth: 0
1616
ref: ${{ github.event.workflow_run.head_branch }}
1717

18-
- name: Install Bun package manager
19-
uses: oven-sh/setup-bun@v1
18+
- name: Install pnpm package manager
19+
uses: pnpm/action-setup@v2
20+
with:
21+
version: 8
2022

2123
- name: Install NPM dependencies
22-
run: bun install
24+
run: pnpm install
2325

2426
- name: Build the static website
25-
run: cd apps/explorer && bun run ci:build
27+
run: cd apps/explorer && pnpm run ci:build
2628

2729
- name: Set up QEMU
2830
uses: docker/setup-qemu-action@v1

.github/workflows/release-desktop.yml

Lines changed: 6 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,19 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
os: [macos-latest, ubuntu-latest]
13+
os: [macos-latest, ubuntu-latest, windows-latest]
1414

1515
steps:
1616
- name: Check out Git repository
1717
uses: actions/checkout@v3
1818

19-
- name: Install Bun package manager
20-
uses: oven-sh/setup-bun@v1
19+
- name: Install pnpm package manager
20+
uses: pnpm/action-setup@v2
21+
with:
22+
version: 8
2123

2224
- name: Install NPM dependencies
23-
run: bun install --yarn
24-
25-
- name: Change packageManager field in package.json from bun to yarn
26-
uses: jossef/[email protected]
27-
with:
28-
file: package.json
29-
field: packageManager
30-
25+
run: pnpm install
3126

3227
- name: Prepare for app notarization
3328
if: startsWith(matrix.os, 'macos')
@@ -66,69 +61,3 @@ jobs:
6661
APPLEID: ${{ secrets.APPLE_ID }}
6762
APPLEIDPASS: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
6863
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
69-
70-
generate-lockfile:
71-
runs-on: ubuntu-latest
72-
73-
steps:
74-
- name: Check out Git repository
75-
uses: actions/checkout@v3
76-
77-
- name: Install Bun package manager
78-
uses: oven-sh/setup-bun@v1
79-
80-
- name: Install NPM dependencies
81-
run: bun install --yarn
82-
83-
- name: Upload yarn.lock
84-
uses: actions/upload-artifact@v3
85-
with:
86-
name: lockfile
87-
path: ${{ github.workspace }}/yarn.lock
88-
89-
release-desktop-wallet-windows:
90-
runs-on: windows-latest
91-
92-
needs: generate-lockfile
93-
94-
steps:
95-
- name: Check out Git repository
96-
uses: actions/checkout@v3
97-
98-
- name: Download yarn.lock
99-
uses: actions/download-artifact@v3
100-
with:
101-
name: lockfile
102-
path: ${{ github.workspace }}
103-
104-
- name: Use yarn since bun is not available on Windows
105-
uses: actions/setup-node@v4
106-
with:
107-
node-version: 16
108-
109-
- name: Delete bun lockfile because it creates problems with yarn
110-
run: rm bun.lockb
111-
112-
- name: Change packageManager field in package.json from bun to yarn
113-
uses: jossef/[email protected]
114-
with:
115-
file: package.json
116-
field: packageManager
117-
118-
119-
- name: Install NPM dependencies
120-
run: yarn install --network-timeout 100000
121-
122-
- name: Compile shared package
123-
run: cd packages/shared && yarn run compile
124-
125-
- name: Build & release Electron app
126-
uses: coparse-inc/[email protected]
127-
if: ${{ startsWith(github.ref, 'refs/tags/alephium-desktop-wallet@') }}
128-
with:
129-
package_root: 'apps/desktop-wallet'
130-
args: '-w'
131-
github_token: ${{ secrets.github_token }}
132-
release: ${{ startsWith(github.ref, 'refs/tags/alephium-desktop-wallet@') }}
133-
windows_certs: ${{ secrets.windows_certs }}
134-
windows_certs_password: ${{ secrets.windows_certs_password }}

.github/workflows/static-analysis.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,19 @@ jobs:
1313
- name: Check out Git repository
1414
uses: actions/checkout@v3
1515

16-
- name: Install Bun package manager
17-
uses: oven-sh/setup-bun@v1
16+
- name: Install pnpm package manager
17+
uses: pnpm/action-setup@v2
18+
with:
19+
version: 8
1820

1921
- name: Install NPM dependencies
20-
run: bun install --yarn
22+
run: pnpm install
2123

2224
- name: Lint all workspaces in parallel
23-
run: bun run lint
25+
run: pnpm run lint
2426

2527
- name: Check that TypeScript compiles in all workspaces in parallel
26-
run: bun run typecheck
27-
28-
- name: Change packageManager field in package.json from bun to yarn
29-
uses: jossef/[email protected]
30-
with:
31-
file: package.json
32-
field: packageManager
33-
28+
run: pnpm run typecheck
3429

3530
- name: Audit NPM dependencies
36-
run: yarn audit --production
31+
run: pnpm audit --prod

.github/workflows/test.yml

Lines changed: 13 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -13,103 +13,47 @@ jobs:
1313
- name: Check out Git repository
1414
uses: actions/checkout@v3
1515

16-
- name: Install Bun package manager
17-
uses: oven-sh/setup-bun@v1
16+
- name: Install pnpm package manager
17+
uses: pnpm/action-setup@v2
18+
with:
19+
version: 8
1820

1921
- name: Install NPM dependencies
20-
run: bun install
22+
run: pnpm install
2123

2224
- name: Use Node.js for vitest
2325
uses: actions/setup-node@v4
2426
with:
2527
node-version: 16
2628

2729
- name: Run test scripts of all workspaces in parallel
28-
run: bun run test
29-
30-
generate-lockfile:
31-
runs-on: ubuntu-latest
32-
33-
steps:
34-
- name: Check out Git repository
35-
uses: actions/checkout@v3
36-
37-
- name: Install Bun package manager
38-
uses: oven-sh/setup-bun@v1
39-
40-
- name: Install NPM dependencies
41-
run: bun install --yarn
42-
43-
- name: Upload yarn.lock
44-
uses: actions/upload-artifact@v3
45-
with:
46-
name: lockfile
47-
path: ${{ github.workspace }}/yarn.lock
30+
run: pnpm run test
4831

4932
build-electron-app-unix:
5033
runs-on: ${{ matrix.os }}
5134

5235
strategy:
5336
matrix:
54-
os: [macos-latest, ubuntu-latest]
37+
os: [macos-latest, ubuntu-latest, windows-latest]
5538

5639
steps:
5740
- name: Check out Git repository
5841
uses: actions/checkout@v3
5942

60-
- name: Install Bun package manager
61-
uses: oven-sh/setup-bun@v1
43+
- name: Install pnpm package manager
44+
uses: pnpm/action-setup@v2
45+
with:
46+
version: 8
6247

6348
- name: Install NPM dependencies
64-
run: bun install
49+
run: pnpm install
6550

6651
- name: Extract platform name
6752
id: get-os
6853
run: echo "os=$(echo ${{ matrix.os }} | cut -d- -f1)" >> $GITHUB_OUTPUT
6954
shell: bash
7055

7156
- name: Building desktop wallet on ${{ steps.get-os.outputs.os }}
72-
run: cd apps/desktop-wallet && bun run ci:build:electron:${{ steps.get-os.outputs.os }}
73-
env:
74-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
76-
build-electron-app-windows:
77-
runs-on: windows-latest
78-
79-
needs: generate-lockfile
80-
81-
steps:
82-
- name: Check out Git repository
83-
uses: actions/checkout@v3
84-
85-
- name: Download yarn.lock
86-
uses: actions/download-artifact@v3
87-
with:
88-
name: lockfile
89-
path: ${{ github.workspace }}
90-
91-
- name: Use yarn since bun is not available on Windows
92-
uses: actions/setup-node@v4
93-
with:
94-
node-version: 16
95-
96-
- name: Delete bun lockfile because it creates problems with yarn
97-
run: rm bun.lockb
98-
99-
- name: Change packageManager field in package.json from bun to yarn
100-
uses: jossef/[email protected]
101-
with:
102-
file: package.json
103-
field: packageManager
104-
105-
106-
- name: Install NPM dependencies
107-
run: yarn install --network-timeout 100000
108-
109-
- name: Compile shared package
110-
run: cd packages/shared && yarn run compile
111-
112-
- name: Building desktop wallet on Windows
113-
run: cd apps/desktop-wallet && yarn run build && yarn run build:electron:windows
57+
run: cd apps/desktop-wallet && pnpm run ci:build:electron:${{ steps.get-os.outputs.os }}
11458
env:
11559
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
auto-install-peers = true
2+
ignore-scripts = false
3+
node-linker = hoisted

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ A monorepo containing all things frontend on Alephium.
44

55
## Development
66

7-
We use [Bun](https://bun.sh/) as our package manager and [Turborepo](https://turbo.build/repo) as our build system. Turborepo runs the tasks defined in `turbo.json` and Bun installs the npm packages.
7+
We use [pnpm](https://pnpm.io/) as our package manager and [Turborepo](https://turbo.build/repo) as our build system. Turborepo runs the tasks defined in `turbo.json` and Bun installs the npm packages.
88

99
Install all dependencies with:
1010

1111
```shell
12-
bun install
12+
pnpm install
1313
```
1414

1515
Turbo tasks are defined in `turbo.json`. You can execute them from the root directory of the monorepo:
@@ -42,7 +42,7 @@ turbo lint:fix
4242
### Format
4343

4444
```shell
45-
bun format
45+
pnpm format
4646
```
4747

4848
### Compile TypeScript

apps/desktop-wallet/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ along with the library. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

1919
module.exports = {
20-
extends: ['custom/base', 'custom/react']
20+
extends: ['@alephium/eslint-config/base', '@alephium/eslint-config/react']
2121
}

0 commit comments

Comments
 (0)