Skip to content

Commit b1c5e4a

Browse files
authored
Merge pull request #17 from artem-russkikh/optimize-bundle-size
#14 Move from culori to culori/fn
2 parents 7cb21fa + a5f4c9a commit b1c5e4a

File tree

8 files changed

+433
-20
lines changed

8 files changed

+433
-20
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Setup runner'
2+
description: 'It setups pnpm, node and installs dependencies'
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Install pnpm
7+
uses: pnpm/action-setup@v4
8+
with:
9+
version: 10
10+
- name: Install Node.js
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: 24
14+
cache: pnpm
15+
- name: Install dependencies
16+
shell: bash
17+
run: pnpm install --frozen-lockfile --ignore-scripts

.github/workflows/size-limit.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Check bundle size
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: ./.github/actions/prepare-runner
16+
- run: pnpm build
17+
- run: pnpm lint:size

.github/workflows/test.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout the repository
15-
uses: actions/checkout@v3
16-
- name: Install pnpm
17-
uses: pnpm/action-setup@v2
18-
with:
19-
version: 10
20-
- name: Install Node.js
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: 24
24-
cache: pnpm
25-
- name: Install dependencies
26-
run: pnpm install --frozen-lockfile --ignore-scripts
15+
uses: actions/checkout@v4
16+
- uses: ./.github/actions/prepare-runner
2717
- name: Run tests
2818
run: pnpm test

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"test:types": "tsc --skipLibCheck --noEmit",
1515
"test:unit:ui": "vitest --watch=false --coverage -c vite.config.ui.ts",
1616
"test:unit:api": "vitest --watch=false --coverage -c vite.config.api.ts",
17-
"test": "pnpm run /^test:/"
17+
"test": "pnpm run /^test:/",
18+
"lint:size": "size-limit"
1819
},
1920
"dependencies": {
2021
"@figma/plugin-typings": "^1.79.0",
@@ -51,6 +52,7 @@
5152
"vitest": "^0.34.1"
5253
},
5354
"devDependencies": {
55+
"@size-limit/preset-small-lib": "^11.2.0",
5456
"@types/node": "^20.4.1",
5557
"@typescript-eslint/eslint-plugin": "^5.61.0",
5658
"@typescript-eslint/parser": "^5.61.0",
@@ -70,7 +72,13 @@
7072
"eslint-plugin-tailwindcss": "^3.13.0",
7173
"jsdom": "^22.1.0",
7274
"prettier": "^3.0.2",
75+
"size-limit": "^11.2.0",
7376
"terser": "^5.19.0"
7477
},
78+
"size-limit": [
79+
{
80+
"path": "dist/api.js"
81+
}
82+
],
7583
"license": "MIT"
7684
}

0 commit comments

Comments
 (0)