Skip to content

Commit 6250386

Browse files
committed
feat: use esm-first approach, use vitest for tests
1 parent b70d6dd commit 6250386

15 files changed

+435
-771
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jspm_packages
4646
.cache
4747

4848
# Compiled portable text library + demo
49-
/dist
49+
/lib
5050
/demo/dist
5151

5252
*.iml

package.json

+13-20
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,25 @@
1616
"license": "MIT",
1717
"author": "Sanity.io <hello@sanity.io>",
1818
"sideEffects": false,
19+
"type": "module",
1920
"exports": {
2021
".": {
21-
"types": "./dist/react-portable-text.d.ts",
22+
"types": "./lib/index.d.ts",
2223
"source": "./src/index.ts",
23-
"require": "./dist/react-portable-text.js",
24+
"require": "./lib/index.cjs",
2425
"node": {
25-
"import": "./dist/react-portable-text.cjs.mjs",
26-
"require": "./dist/react-portable-text.js"
26+
"module": "./lib/index.js",
27+
"import": "./lib/index.cjs.js"
2728
},
28-
"import": "./dist/react-portable-text.esm.js",
29-
"default": "./dist/react-portable-text.esm.js"
29+
"import": "./lib/index.js",
30+
"default": "./lib/index.js"
3031
},
3132
"./package.json": "./package.json"
3233
},
33-
"main": "./dist/react-portable-text.js",
34-
"module": "./dist/react-portable-text.esm.js",
34+
"main": "./lib/index.cjs",
35+
"module": "./lib/index.js",
3536
"source": "./src/index.ts",
36-
"types": "./dist/react-portable-text.d.ts",
37+
"types": "./lib/index.d.ts",
3738
"files": [
3839
"dist",
3940
"!dist/stats.html",
@@ -51,7 +52,7 @@
5152
"prepare": "husky install",
5253
"prepublishOnly": "run-s build lint type-check",
5354
"start": "vite demo",
54-
"test": "tap test/*.test.*",
55+
"test": "vitest",
5556
"type-check": "tsc --noEmit"
5657
},
5758
"commitlint": {
@@ -106,13 +107,6 @@
106107
],
107108
"extends": "@sanity/semantic-release-preset"
108109
},
109-
"tap": {
110-
"check-coverage": false,
111-
"node-arg": [
112-
"-r",
113-
"esbuild-register"
114-
]
115-
},
116110
"dependencies": {
117111
"@portabletext/toolkit": "^2.0.4",
118112
"@portabletext/types": "^2.0.5"
@@ -129,7 +123,6 @@
129123
"@types/react-dom": "^18.2.7",
130124
"@types/refractor": "^3.0.2",
131125
"@types/styled-components": "^5.1.26",
132-
"@types/tap": "^15.0.8",
133126
"@types/ws": "^8.5.5",
134127
"@typescript-eslint/eslint-plugin": "^5.62.0",
135128
"@typescript-eslint/parser": "^5.62.0",
@@ -157,9 +150,9 @@
157150
"rollup-plugin-visualizer": "^5.9.2",
158151
"semantic-release": "^21.0.9",
159152
"styled-components": "^5.3.11",
160-
"tap": "^16.3.8",
161153
"typescript": "^5.1.6",
162-
"vite": "^4.4.9"
154+
"vite": "^4.4.9",
155+
"vitest": "^0.34.2"
163156
},
164157
"peerDependencies": {
165158
"react": "^17 || ^18"

0 commit comments

Comments
 (0)