Skip to content

Commit f4b381e

Browse files
* chore: update readme Co-authored-by: Ness Li <nessgor@users.noreply.github.com> * add esm support * Using builtin formdata (nodejs + browsers) * CI/CD improvements * Docs generation fixes * Exports clarification --------- Co-authored-by: Ness Li <nessgor@users.noreply.github.com>
1 parent 30a5bf9 commit f4b381e

File tree

242 files changed

+3709
-7532
lines changed

Some content is hidden

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

242 files changed

+3709
-7532
lines changed

.eslintrc.yml

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

.github/workflows/ci.yaml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,54 @@ on:
55
repository_dispatch:
66
types: [ pr-approved ]
77

8+
env:
9+
PNPM_VERSION: '10'
10+
811
jobs:
912
build:
1013
name: Build
1114
runs-on: ubuntu-latest
1215
strategy:
1316
matrix:
14-
node-version: [18.x, 20.x]
17+
node-version: [20.x, 22.x]
1518
steps:
1619
- name: Checkout sources
1720
uses: actions/checkout@v4
1821
- name: Use Node.js ${{ matrix.node-version }}
1922
uses: actions/setup-node@v4
2023
with:
2124
node-version: ${{ matrix.node-version }}
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v4
27+
with:
28+
version: ${{ env.PNPM_VERSION }}
2229
- name: Installing dependencies
23-
run: npm ci
30+
run: pnpm install --frozen-lockfile
2431
- name: Building sources
25-
run: npm run build
32+
run: pnpm run build
2633

2734
lint:
2835
name: Lint Code
2936
needs: build
3037
runs-on: ubuntu-latest
3138
strategy:
3239
matrix:
33-
node-version: [18.x, 20.x]
40+
node-version: [20.x, 22.x]
3441
steps:
3542
- name: Checkout sources
3643
uses: actions/checkout@v4
3744
- name: Use Node.js ${{ matrix.node-version }}
3845
uses: actions/setup-node@v4
3946
with:
4047
node-version: ${{ matrix.node-version }}
48+
- name: Install pnpm
49+
uses: pnpm/action-setup@v4
50+
with:
51+
version: ${{ env.PNPM_VERSION }}
4152
- name: Installing dependencies
42-
run: npm ci
53+
run: pnpm install --frozen-lockfile
4354
- name: Linting
44-
run: npm run lint
55+
run: pnpm run lint
4556
env:
4657
CI: true
4758

@@ -51,18 +62,22 @@ jobs:
5162
runs-on: ubuntu-latest
5263
strategy:
5364
matrix:
54-
node-version: [18.x, 20.x]
65+
node-version: [20.x, 22.x]
5566
steps:
5667
- name: Checkout sources
5768
uses: actions/checkout@v4
5869
- name: Use Node.js ${{ matrix.node-version }}
5970
uses: actions/setup-node@v4
6071
with:
6172
node-version: ${{ matrix.node-version }}
73+
- name: Install pnpm
74+
uses: pnpm/action-setup@v4
75+
with:
76+
version: ${{ env.PNPM_VERSION }}
6277
- name: Installing dependencies
63-
run: npm ci
78+
run: pnpm install --frozen-lockfile
6479
- name: Running unit tests
65-
run: npm run test:unit
80+
run: pnpm run test:unit
6681

6782
test_integration:
6883
name: Integration Tests
@@ -73,21 +88,25 @@ jobs:
7388
strategy:
7489
max-parallel: 1
7590
matrix:
76-
node-version: [18.x, 20.x]
91+
node-version: [20.x, 22.x]
7792
steps:
7893
- name: Checkout sources
7994
uses: actions/checkout@v4
8095
- name: Use Node.js ${{ matrix.node-version }}
8196
uses: actions/setup-node@v4
8297
with:
8398
node-version: ${{ matrix.node-version }}
99+
- name: Install pnpm
100+
uses: pnpm/action-setup@v4
101+
with:
102+
version: ${{ env.PNPM_VERSION }}
84103
- name: Installing dependencies
85-
run: npm ci
104+
run: pnpm install --frozen-lockfile
86105
- name: Creating `.env` file
87106
run: |
88107
touch .env
89108
echo HOST=${{ secrets.HOST }} >> .env
90109
echo EMAIL=${{ secrets.EMAIL }} >> .env
91110
echo API_TOKEN=${{ secrets.API_TOKEN }} >> .env
92111
- name: Running integration tests
93-
run: npm run test:integration
112+
run: pnpm run test:integration

.github/workflows/publish-dev.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,22 @@ name: Publish to NPM Dev Channel
33
on:
44
workflow_dispatch
55

6+
permissions:
7+
contents: read
8+
9+
610
jobs:
711
build-and-publish:
812
runs-on: ubuntu-latest
913

1014
steps:
1115
- name: Checkout code
1216
uses: actions/checkout@v4
13-
with:
14-
fetch-depth: 0
15-
16-
- name: Check branch
17-
run: |
18-
if [ "$GITHUB_REF" != "refs/heads/develop" ]; then
19-
echo "This workflow can only be run on the 'develop' branch."
20-
exit 1
21-
fi
2217

2318
- name: Set up Node.js
2419
uses: actions/setup-node@v4
2520
with:
26-
node-version: 18
21+
node-version: 20
2722
registry-url: https://registry.npmjs.org/
2823

2924
- name: Install dependencies
@@ -45,16 +40,6 @@ jobs:
4540
- name: Update package-lock.json
4641
run: npm install
4742

48-
- name: Commit version update
49-
run: |
50-
git config --global user.name "GitHub Actions"
51-
git config --global user.email "actions@github.com"
52-
git add package.json package-lock.json
53-
git commit -m "Update version to $NEW_VERSION [skip ci]"
54-
git push origin develop
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.PAT }}
57-
5843
- name: Publish to NPM Dev Channel
5944
run: npm publish --tag dev
6045
env:

0 commit comments

Comments
 (0)