Skip to content

Commit 0736ff6

Browse files
erikras-dinesh-agentErik RasmussenDinesh Bot
authored
Migrate from bundlesize to size-limit (#44)
* Migrate from bundlesize to size-limit - Remove bundlesize dependency - Add @size-limit/preset-small-lib and size-limit dependencies - Convert bundlesize config to size-limit format - Add Bundle Size Check job to CI workflow - Update GitHub Actions to v4 (checkout, setup-node) Bundle size limits: - dist/final-form-focus.umd.min.js: 1kB - dist/final-form-focus.es.js: 1.5kB - dist/final-form-focus.cjs.js: 1.5kB * Address CodeRabbit feedback - Update codecov action to v4 - Alphabetize devDependencies * Update yarn.lock for new dependencies * Increase UMD bundle size limit to 1.1kB --------- Co-authored-by: Erik Rasmussen <erik@mini.local> Co-authored-by: Dinesh Bot <dinesh@openclaw.dev>
1 parent 5255471 commit 0736ff6

File tree

3 files changed

+317
-498
lines changed

3 files changed

+317
-498
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: Use Node.js ${{ matrix.node_version }}
13-
uses: actions/setup-node@v2
11+
- uses: actions/checkout@v4
12+
- name: Use Node.js 22
13+
uses: actions/setup-node@v4
1414
with:
1515
node-version: "22"
1616
- name: Prepare env
@@ -23,9 +23,9 @@ jobs:
2323
runs-on: ubuntu-latest
2424

2525
steps:
26-
- uses: actions/checkout@v2
27-
- name: Use Node.js ${{ matrix.node_version }}
28-
uses: actions/setup-node@v2
26+
- uses: actions/checkout@v4
27+
- name: Use Node.js 22
28+
uses: actions/setup-node@v4
2929
with:
3030
node-version: "22"
3131
- name: Prepare env
@@ -38,14 +38,31 @@ jobs:
3838
runs-on: ubuntu-latest
3939

4040
steps:
41-
- uses: actions/checkout@v2
42-
- name: Use Node.js ${{ matrix.node_version }}
43-
uses: actions/setup-node@v2
41+
- uses: actions/checkout@v4
42+
- name: Use Node.js 22
43+
uses: actions/setup-node@v4
4444
with:
4545
node-version: "22"
4646
- name: Prepare env
4747
run: yarn install --ignore-scripts --frozen-lockfile
4848
- name: Run unit tests
4949
run: yarn start test
5050
- name: Run code coverage
51-
uses: codecov/codecov-action@v2.1.0
51+
uses: codecov/codecov-action@v4
52+
53+
size:
54+
name: Bundle Size Check
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Use Node.js 22
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: "22"
63+
- name: Prepare env
64+
run: yarn install --ignore-scripts --frozen-lockfile
65+
- name: Build
66+
run: yarn start build
67+
- name: Check bundle size
68+
run: npx size-limit

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
"@babel/preset-env": "^7.27.2",
4343
"@babel/preset-typescript": "^7.27.1",
4444
"@eslint/js": "^9.27.0",
45+
"@size-limit/preset-small-lib": "^11.1.6",
4546
"@types/jest": "^29.5.14",
4647
"@types/node": "^22.15.27",
4748
"@typescript-eslint/eslint-plugin": "^8.33.0",
4849
"@typescript-eslint/parser": "^8.33.0",
4950
"babel-core": "^7.0.0-bridge.0",
5051
"babel-eslint": "^10.1.0",
5152
"babel-jest": "^29.7.0",
52-
"bundlesize": "^0.18.2",
5353
"doctoc": "^2.2.1",
5454
"eslint": "^9.27.0",
5555
"eslint-config-react-app": "^7.0.1",
@@ -72,6 +72,7 @@
7272
"rollup-plugin-node-resolve": "^5.2.0",
7373
"rollup-plugin-replace": "^2.2.0",
7474
"rollup-plugin-uglify": "^6.0.4",
75+
"size-limit": "^11.1.6",
7576
"typescript": "^5.8.3"
7677
},
7778
"peerDependencies": {
@@ -83,18 +84,18 @@
8384
"git add"
8485
]
8586
},
86-
"bundlesize": [
87+
"size-limit": [
8788
{
8889
"path": "dist/final-form-focus.umd.min.js",
89-
"threshold": "800B"
90+
"limit": "1.1kB"
9091
},
9192
{
9293
"path": "dist/final-form-focus.es.js",
93-
"threshold": "1.2kB"
94+
"limit": "1.5kB"
9495
},
9596
{
9697
"path": "dist/final-form-focus.cjs.js",
97-
"threshold": "1.2kB"
98+
"limit": "1.5kB"
9899
}
99100
]
100101
}

0 commit comments

Comments
 (0)