Skip to content

Commit b411fe7

Browse files
authored
chore: upgrade runtime to node 24 (#56)
chore: upgrade runtime to node 24
2 parents 6029ff1 + a27accf commit b411fe7

18 files changed

Lines changed: 5145 additions & 11306 deletions

.github/workflows/ci.yml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,43 @@ name: Node.js CI
22

33
on:
44
push:
5-
branches: [ master, develop ]
5+
branches: [master, develop]
66
pull_request:
7-
branches: [ master, develop ]
7+
branches: [master, develop]
88

99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
15-
16-
- name: Set up Node.js
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: '20'
20-
cache: 'npm'
21-
cache-dependency-path: nodejs/package-lock.json
22-
23-
- name: Install dependencies
24-
working-directory: nodejs
25-
run: npm ci
26-
27-
- name: Run lint
28-
working-directory: nodejs
29-
run: npm run lint
30-
31-
- name: Build
32-
working-directory: nodejs
33-
run: npm run build
34-
35-
- name: Run tests
36-
working-directory: nodejs
37-
env:
38-
HACKMD_ACCESS_TOKEN: "test_token_123456789"
39-
run: npm test
14+
- uses: actions/checkout@v4
15+
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v6
18+
with:
19+
version: 10.33.2
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 24
25+
cache: "pnpm"
26+
cache-dependency-path: nodejs/pnpm-lock.yaml
27+
28+
- name: Install dependencies
29+
working-directory: nodejs
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Run lint
33+
working-directory: nodejs
34+
run: pnpm lint
35+
36+
- name: Build
37+
working-directory: nodejs
38+
run: pnpm build
39+
40+
- name: Run tests
41+
working-directory: nodejs
42+
env:
43+
HACKMD_ACCESS_TOKEN: "test_token_123456789"
44+
run: pnpm test

.github/workflows/e2e.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15+
- name: Install pnpm
16+
uses: pnpm/action-setup@v6
17+
with:
18+
version: 10.33.2
19+
1520
- name: Set up Node.js
1621
uses: actions/setup-node@v4
1722
with:
18-
node-version: '20'
19-
cache: 'npm'
20-
cache-dependency-path: nodejs/package-lock.json
23+
node-version: 24
24+
cache: "pnpm"
25+
cache-dependency-path: nodejs/pnpm-lock.yaml
2126

2227
- name: Install dependencies
2328
working-directory: nodejs
24-
run: npm ci
29+
run: pnpm install --frozen-lockfile
2530

2631
- name: Run e2e tests
2732
working-directory: nodejs
@@ -33,4 +38,4 @@ jobs:
3338
echo "::error::Add repository secret HACKMD_E2E_ACCESS_TOKEN (a valid API token for the target environment)."
3439
exit 1
3540
fi
36-
npm run test:e2e
41+
pnpm test:e2e

.github/workflows/publish.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,30 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v6
2121

22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v6
24+
with:
25+
version: 10.33.2
26+
2227
- name: Set up Node.js
2328
uses: actions/setup-node@v6
2429
with:
25-
node-version: '24'
26-
registry-url: 'https://registry.npmjs.org'
27-
cache: 'npm'
28-
cache-dependency-path: nodejs/package-lock.json
30+
node-version: 24
31+
registry-url: "https://registry.npmjs.org"
32+
cache: "pnpm"
33+
cache-dependency-path: nodejs/pnpm-lock.yaml
2934

3035
- name: Install dependencies
3136
working-directory: nodejs
32-
run: npm ci
37+
run: pnpm install --frozen-lockfile
3338

3439
- name: Build
3540
working-directory: nodejs
36-
run: npm run build
41+
run: pnpm build
3742

3843
- name: Publish to NPM
3944
working-directory: nodejs
40-
run: npm publish --access public
45+
run: pnpm publish --access public
4146

4247
- name: Extract version from tag
4348
run: |
@@ -62,17 +67,22 @@ jobs:
6267
with:
6368
fetch-depth: 0
6469

70+
- name: Install pnpm
71+
uses: pnpm/action-setup@v6
72+
with:
73+
version: 10.33.2
74+
6575
- name: Set up Node.js
6676
uses: actions/setup-node@v6
6777
with:
68-
node-version: '24'
69-
registry-url: 'https://registry.npmjs.org'
70-
cache: 'npm'
71-
cache-dependency-path: nodejs/package-lock.json
78+
node-version: 24
79+
registry-url: "https://registry.npmjs.org"
80+
cache: "pnpm"
81+
cache-dependency-path: nodejs/pnpm-lock.yaml
7282

7383
- name: Install dependencies
7484
working-directory: nodejs
75-
run: npm ci
85+
run: pnpm install --frozen-lockfile
7686

7787
- name: Configure Git
7888
run: |
@@ -88,15 +98,15 @@ jobs:
8898
PRE_RELEASE_VERSION="${CURRENT_VERSION}-beta.${TIMESTAMP}.${SHORT_SHA}"
8999
echo "Pre-release version: $PRE_RELEASE_VERSION"
90100
echo "PRE_RELEASE_VERSION=$PRE_RELEASE_VERSION" >> $GITHUB_ENV
91-
npm version $PRE_RELEASE_VERSION --no-git-tag-version
101+
pnpm version $PRE_RELEASE_VERSION --no-git-tag-version
92102
93103
- name: Build
94104
working-directory: nodejs
95-
run: npm run build
105+
run: pnpm build
96106

97107
- name: Publish pre-release to NPM
98108
working-directory: nodejs
99-
run: npm publish --tag beta --access public
109+
run: pnpm publish --tag beta --access public
100110

101111
- name: Create GitHub pre-release
102112
env:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To run the Node.js example:
2626
1. Navigate to the example directory: `cd examples/nodejs`
2727
2. Follow the setup instructions in [examples/nodejs/README.md](./examples/nodejs/README.md)
2828
3. Set your HackMD access token
29-
4. Run `npm start`
29+
4. Run `pnpm start`
3030

3131
The example includes detailed comments and demonstrates best practices for using the HackMD API client.
3232

@@ -47,7 +47,7 @@ To run the book mode conference example:
4747
2. Follow the setup instructions in [examples/book-mode-conference/README.md](./examples/book-mode-conference/README.md)
4848
3. Customize the configuration constants and session data
4949
4. Set your HackMD access token
50-
5. Run `npm start`
50+
5. Run `pnpm start`
5151

5252
This example demonstrates advanced usage patterns including bulk operations, team note management, and creating interconnected note structures for conferences or events.
5353

examples/book-mode-conference/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,21 @@ This example demonstrates how to create a "book mode" conference note system usi
2323
## Setup
2424

2525
### 1. Install Dependencies
26+
2627
```bash
2728
cd /path/to/api-client/examples/book-mode-conference
28-
npm install
29+
pnpm install
2930
```
3031

3132
### 2. Configure Environment
33+
3234
```bash
3335
cp .env.example .env
3436
# Edit .env with your settings
3537
```
3638

3739
Required `.env` settings:
40+
3841
```bash
3942
HACKMD_ACCESS_TOKEN=your_access_token_here
4043
HACKMD_API_ENDPOINT=https://api.hackmd.io/v1

0 commit comments

Comments
 (0)