Skip to content

Commit e59e47f

Browse files
committed
chore: migrate to Vitest, add GitHub Actions workflows, and remove Jest configuration
1 parent 7c8a5cf commit e59e47f

File tree

10 files changed

+478
-1579
lines changed

10 files changed

+478
-1579
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "pnpm"
3+
- package-ecosystem: "npm"
44
directories:
55
- "/examples/*"
66
- "/"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build and Test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: pnpm/action-setup@v4
16+
with:
17+
version: 10
18+
run_install: false
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 24
22+
cache: 'pnpm'
23+
- run: pnpm install --frozen-lockfile
24+
- run: pnpm build
25+
- run: pnpm test
26+
- name: Upload coverage reports to Codecov
27+
uses: codecov/codecov-action@v5
28+
with:
29+
token: ${{ secrets.CODECOV_TOKEN }}
30+
- name: Upload test results to Codecov
31+
if: ${{ !cancelled() }}
32+
uses: codecov/test-results-action@v1
33+
with:
34+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/npm-publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: NPM Package
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: pnpm/action-setup@v4
14+
with:
15+
version: 10
16+
run_install: false
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 24
20+
cache: 'pnpm'
21+
- run: pnpm install --frozen-lockfile
22+
- run: pnpm test
23+
24+
publish-npm:
25+
needs: build
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: pnpm/action-setup@v4
30+
with:
31+
version: 10
32+
run_install: false
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: 24
36+
cache: 'pnpm'
37+
registry-url: https://registry.npmjs.org/
38+
- run: pnpm install --frozen-lockfile
39+
- run: pnpm publish --no-git-checks
40+
env:
41+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ node_modules
33
dist
44
coverage/
55
package-lock.json
6-
.next
6+
.next
7+
*.junit.xml

jest.config.js

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

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"private": false,
88
"scripts": {
99
"watch": "webpack-dev-server --hot --inline --progress --colors",
10-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js && pnpm -r build",
10+
"test": "vitest && pnpm -r build",
1111
"lint": "eslint",
1212
"build": "eslint"
1313
},
@@ -62,14 +62,15 @@
6262
"@eslint/js": "^9.39.1",
6363
"@types/node": "^24.10.0",
6464
"@types/webpack": "^5.28.0",
65+
"@vitejs/plugin-react": "^5.1.0",
66+
"@vitest/coverage-v8": "^4.0.6",
6567
"acorn": "^8.15.0",
6668
"babel-loader": "^8.4.1",
6769
"babel-plugin-react-require": "^3.1.3",
6870
"core-js": "^2.5.7",
6971
"css-loader": "^6.11.0",
7072
"eslint": "~9.39.1",
7173
"globals": "^15.15.0",
72-
"jest": "^29.7.0",
7374
"lodash": "^4.17.19",
7475
"preact": "^10.27.2",
7576
"prop-types": "^15.7.2",
@@ -85,7 +86,10 @@
8586
"typescript": "^5.9.3",
8687
"use-onclickoutside": "^0.3.0",
8788
"vite": "^5.0.0",
88-
"webpack": "^5.102.1"
89+
"vitest": "^4.0.6",
90+
"webpack": "^5.102.1",
91+
"@emotion/react": "^11.14.0",
92+
"classnames": "^2.5.1"
8993
},
9094
"peerDependencies": {
9195
"vite": ">=2.0.0",
@@ -100,9 +104,7 @@
100104
}
101105
},
102106
"dependencies": {
103-
"@emotion/react": "^11.14.0",
104107
"acorn-walk": "8.3.4",
105-
"classnames": "^2.5.1",
106108
"minimatch": "7.4.6"
107109
}
108110
}

0 commit comments

Comments
 (0)