Skip to content

Commit 658181c

Browse files
Andaristbvaughn
andauthored
Make module ESM only; replace Jest with Vitest (#217)
* Make module ESM only; replace Jest with Vitest * try with cjs babel config * Add Vitest config file to exlcude tests from .trunk directory --------- Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
1 parent 3ed17cc commit 658181c

9 files changed

+1065
-2590
lines changed
File renamed without changes.

jest.config.js

-5
This file was deleted.

package.json

+13-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "react-error-boundary",
33
"version": "5.0.0",
4+
"type": "module",
45
"description": "Simple reusable React error boundary component",
56
"author": "Brian Vaughn <brian.david.vaughn@gmail.com>",
67
"license": "MIT",
@@ -9,22 +10,11 @@
910
"url": "https://github.com/bvaughn/react-error-boundary"
1011
},
1112
"packageManager": "pnpm@9.6.0",
12-
"main": "dist/react-error-boundary.cjs.js",
13-
"module": "dist/react-error-boundary.esm.js",
1413
"exports": {
1514
".": {
16-
"types": {
17-
"import": "./dist/react-error-boundary.cjs.mjs",
18-
"default": "./dist/react-error-boundary.cjs.js"
19-
},
20-
"development": {
21-
"module": "./dist/react-error-boundary.development.esm.js",
22-
"import": "./dist/react-error-boundary.development.cjs.mjs",
23-
"default": "./dist/react-error-boundary.development.cjs.js"
24-
},
25-
"module": "./dist/react-error-boundary.esm.js",
26-
"import": "./dist/react-error-boundary.cjs.mjs",
27-
"default": "./dist/react-error-boundary.cjs.js"
15+
"types": "./dist/react-error-boundary.js",
16+
"development": "./dist/react-error-boundary.development.js",
17+
"default": "./dist/react-error-boundary.js"
2818
},
2919
"./package.json": "./package.json"
3020
},
@@ -34,7 +24,7 @@
3424
"default": "./src/env-conditions/production.ts"
3525
}
3626
},
37-
"types": "dist/react-error-boundary.cjs.d.ts",
27+
"types": "dist/react-error-boundary.d.ts",
3828
"files": [
3929
"dist"
4030
],
@@ -46,8 +36,8 @@
4636
"prerelease": "preconstruct build",
4737
"lint": "eslint .",
4838
"lint:fix": "eslint . --fix",
49-
"test": "jest",
50-
"test:watch": "jest --watch",
39+
"test": "vitest --environment=jsdom --watch=false",
40+
"test:watch": "vitest --environment=jsdom --watch",
5141
"typescript": "tsc --noEmit",
5242
"typescript:watch": "tsc --noEmit --watch"
5343
},
@@ -57,9 +47,8 @@
5747
"devDependencies": {
5848
"@babel/preset-env": "^7.22.5",
5949
"@babel/preset-typescript": "^7.21.5",
60-
"@preconstruct/cli": "^2.8.1",
50+
"@preconstruct/cli": "^2.8.12",
6151
"@types/assert": "^1.5.10",
62-
"@types/jest": "^26.0.15",
6352
"@types/react": "^18.3.17",
6453
"@types/react-dom": "^18",
6554
"assert": "^2.0.0",
@@ -69,14 +58,12 @@
6958
"eslint-plugin-prettier": "^5.2.1",
7059
"eslint-plugin-react": "^7.37.2",
7160
"globals": "^15.11.0",
72-
"jest": "^29.4.3",
73-
"jest-environment-jsdom": "^29.4.3",
7461
"prettier": "^3.0.1",
7562
"react": "^18",
7663
"react-dom": "^18",
7764
"rimraf": "^6.0.1",
78-
"ts-jest": "^29.0.5",
79-
"typescript": "^5.1.6",
65+
"vitest": "^3.1.2",
66+
"typescript": "^5.8.3",
8067
"typescript-eslint": "^8.18.0"
8168
},
8269
"peerDependencies": {
@@ -87,7 +74,9 @@
8774
"importConditionDefaultExport": "default"
8875
},
8976
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
90-
"importsConditions": true
77+
"distInRoot": true,
78+
"importsConditions": true,
79+
"typeModule": true
9180
}
9281
}
9382
}

0 commit comments

Comments
 (0)