Skip to content

Commit b88e1f7

Browse files
Merge branch 'move-to-pnpm' into 'main'
chore: replace npm with pnpm as default package manager See merge request flarenetwork/docs-team/developer-hub-v1!1
2 parents 2417aa3 + 992d348 commit b88e1f7

20 files changed

Lines changed: 23439 additions & 43604 deletions

.github/dependabot.yml

Lines changed: 0 additions & 135 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ jobs:
2121
fetch-depth: 0
2222
- uses: actions/setup-node@v6
2323
with:
24-
node-version: 22
25-
cache: "npm"
24+
node-version-file: ".nvmrc"
25+
- uses: pnpm/action-setup@v4
26+
with:
27+
cache: "true"
2628
- name: Install dependencies
27-
run: npm ci
29+
run: pnpm install --frozen-lockfile
2830
- name: Build website
29-
run: npm run build
31+
run: pnpm run build
3032
- name: Upload Build Artifact
3133
uses: actions/upload-pages-artifact@v4
3234
with:

.github/workflows/lint-check-internal-links.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ jobs:
1616
- uses: actions/checkout@v6
1717
- uses: actions/setup-node@v6
1818
with:
19-
node-version: 22
20-
cache: "npm"
19+
node-version-file: ".nvmrc"
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
cache: "true"
2123
- name: Install dependencies
22-
run: npm ci
24+
run: pnpm install --frozen-lockfile
2325
- name: Run ESLint
24-
run: npm run lint -- --max-warnings=0
26+
run: pnpm run lint:check -- --max-warnings=0
2527

2628
typecheck:
2729
name: TypeScript Check
@@ -30,12 +32,14 @@ jobs:
3032
- uses: actions/checkout@v6
3133
- uses: actions/setup-node@v6
3234
with:
33-
node-version: 22
34-
cache: "npm"
35+
node-version-file: ".nvmrc"
36+
- uses: pnpm/action-setup@v4
37+
with:
38+
cache: "true"
3539
- name: Install dependencies
36-
run: npm ci
40+
run: pnpm install --frozen-lockfile
3741
- name: Run typecheck
38-
run: npm run typecheck
42+
run: pnpm run typecheck
3943

4044
format-check:
4145
name: Format with Prettier
@@ -44,12 +48,14 @@ jobs:
4448
- uses: actions/checkout@v6
4549
- uses: actions/setup-node@v6
4650
with:
47-
node-version: 22
48-
cache: "npm"
51+
node-version-file: ".nvmrc"
52+
- uses: pnpm/action-setup@v4
53+
with:
54+
cache: "true"
4955
- name: Install dependencies
50-
run: npm ci
56+
run: pnpm install --frozen-lockfile
5157
- name: Run Prettier check
52-
run: npm run format:check
58+
run: pnpm run format:check
5359

5460
build-and-link-check:
5561
name: Build & Link Check
@@ -58,9 +64,11 @@ jobs:
5864
- uses: actions/checkout@v6
5965
- uses: actions/setup-node@v6
6066
with:
61-
node-version: 22
62-
cache: "npm"
67+
node-version-file: ".nvmrc"
68+
- uses: pnpm/action-setup@v4
69+
with:
70+
cache: "true"
6371
- name: Install dependencies
64-
run: npm ci
72+
run: pnpm install --frozen-lockfile
6573
- name: Build Docusaurus site
66-
run: npm run build
74+
run: pnpm run build

.github/workflows/lint-sentence-newline.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,20 @@ jobs:
3030
3131
- name: Setup Node.js
3232
if: steps.changed-files.outputs.any_changed == 'true'
33-
uses: actions/setup-node@v4
33+
uses: actions/setup-node@v6
3434
with:
35-
node-version: 22
36-
cache: "npm"
35+
node-version-file: ".nvmrc"
36+
37+
- name: Setup pnpm
38+
if: steps.changed-files.outputs.any_changed == 'true'
39+
uses: pnpm/action-setup@v4
40+
with:
41+
cache: "true"
3742

3843
- name: Install dependencies
3944
if: steps.changed-files.outputs.any_changed == 'true'
40-
run: npm ci --include=dev
45+
run: pnpm install --frozen-lockfile
4146

4247
- name: Run sentence newline lint
4348
if: steps.changed-files.outputs.any_changed == 'true'
44-
run: npx textlint --config .textlintrc.json ${{ steps.changed-files.outputs.all_changed_files }}
49+
run: pnpm exec textlint --config .textlintrc.json ${{ steps.changed-files.outputs.all_changed_files }}

.github/workflows/test-javascript-examples.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,19 @@ jobs:
1515
test:
1616
name: Test JavaScript Examples
1717
runs-on: ubuntu-latest
18-
defaults:
19-
run:
20-
working-directory: ./examples/developer-hub-javascript
2118
steps:
2219
- uses: actions/checkout@v6
2320
- uses: actions/setup-node@v6
2421
with:
25-
node-version: 22
26-
cache: "npm"
27-
cache-dependency-path: "examples/developer-hub-javascript/package-lock.json"
22+
node-version-file: ".nvmrc"
23+
- uses: pnpm/action-setup@v4
24+
with:
25+
cache: "true"
2826
- name: Install dependencies
29-
run: npm ci
27+
run: pnpm install --frozen-lockfile
3028
- name: Format with prettier
31-
run: npm run format:diff
29+
run: pnpm --filter ./examples/developer-hub-javascript run format:check
3230
- name: Lint with ESLint
33-
run: npm run lint
31+
run: pnpm --filter ./examples/developer-hub-javascript run lint:check
3432
- name: Test with jest
35-
run: npm run test
33+
run: pnpm --filter ./examples/developer-hub-javascript run test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
.env.production.local
1717

1818
npm-debug.log*
19+
pnpm-debug.log*
1920
yarn-debug.log*
2021
yarn-error.log*
2122

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Docusaurus and its plugin/webpack/loader chain reach into many undeclared
2+
# transitive deps, so we use a flat, npm-style node_modules instead of pnpm's
3+
# isolated layout.
4+
node-linker=hoisted

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ Run these locally before submitting a PR.
8686
1. **Build (includes internal link validation)**
8787

8888
```bash
89-
npm run build
89+
pnpm run build
9090
```
9191

9292
2. **Format, lint, and type-check**
9393

9494
```bash
95-
npm run format
96-
npm run lint
97-
npm run typecheck
95+
pnpm run format:fix
96+
pnpm run lint:check
97+
pnpm run typecheck
9898
```
9999

100100
3. **External link checking (optional but recommended)**

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Built with [Docusaurus](https://docusaurus.io/), a modern static site generator.
1212

1313
### Prerequisites
1414

15-
- [Node.js v22](https://nodejs.org/en/) and npm
15+
- [Node.js v24 LTS](https://nodejs.org/en/) and [pnpm](https://pnpm.io/) (enable with `corepack enable pnpm`)
1616
- Recommended: [nvm](https://github.com/nvm-sh/nvm) to manage Node versions
1717
- (Optional) For language-specific code in [examples](examples/):
1818
- Python: [uv](https://docs.astral.sh/uv/)
@@ -24,8 +24,9 @@ Built with [Docusaurus](https://docusaurus.io/), a modern static site generator.
2424
```bash
2525
git clone https://github.com/flare-foundation/developer-hub.git
2626
cd developer-hub
27-
npm ci
28-
npm run start
27+
corepack enable pnpm
28+
pnpm install
29+
pnpm start
2930
```
3031

3132
This starts a local development server with hot reloading and opens the site in your browser.
@@ -53,7 +54,7 @@ flare-foundation/developer-hub/
5354
Some features (for example, search and production-only behavior) only work correctly against a production build.
5455

5556
```bash
56-
npm run build && npm run serve
57+
pnpm run build && pnpm run serve
5758
```
5859

5960
- `build` outputs the static site to `build/`
@@ -64,7 +65,7 @@ npm run build && npm run serve
6465
Run [Prettier](https://prettier.io/) for docs and site code:
6566

6667
```bash
67-
npm run format
68+
pnpm run format:fix
6869
```
6970

7071
Language-specific examples use their native tooling:
@@ -99,13 +100,13 @@ Automations update generated content used by tables/components (for example, con
99100
This will update `ftso_feeds.json` and `solidity_reference.json` in `src/features/DataTables/*`.
100101
101102
```bash
102-
npm run automations
103+
pnpm run automations
103104
```
104105
105106
To update dependencies across the language example projects:
106107

107108
```bash
108-
npm run update-deps
109+
pnpm run update-deps
109110
```
110111

111112
> **Caution:**
@@ -123,7 +124,7 @@ chmod +x generate-solidity-docs.sh
123124

124125
# Return to the main site toolchain
125126
cd ..
126-
nvm use 22
127+
nvm use 24
127128
```
128129

129130
This pulls the latest smart contracts and regenerates the Solidity reference docs.

0 commit comments

Comments
 (0)