Skip to content

Commit 827de22

Browse files
rexxarsstipsan
authored andcommitted
feat: use esm-first approach, use vitest for tests
1 parent 49f8965 commit 827de22

15 files changed

+581
-827
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-
"module": "./dist/react-portable-text.esm.js",
26-
"import": "./dist/react-portable-text.cjs.mjs"
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": {
@@ -91,13 +92,6 @@
9192
"dist/**/"
9293
]
9394
},
94-
"tap": {
95-
"check-coverage": false,
96-
"node-arg": [
97-
"-r",
98-
"esbuild-register"
99-
]
100-
},
10195
"dependencies": {
10296
"@portabletext/toolkit": "^2.0.9",
10397
"@portabletext/types": "^2.0.7"
@@ -112,7 +106,6 @@
112106
"@types/react": "^18.2.23",
113107
"@types/react-dom": "^18.2.8",
114108
"@types/refractor": "^3.0.3",
115-
"@types/tap": "^15.0.9",
116109
"@types/ws": "^8.5.6",
117110
"@typescript-eslint/eslint-plugin": "^6.7.3",
118111
"@typescript-eslint/parser": "^6.7.3",
@@ -139,9 +132,9 @@
139132
"rimraf": "^5.0.1",
140133
"rollup-plugin-visualizer": "^5.9.2",
141134
"styled-components": "^6.0.8",
142-
"tap": "^16.3.9",
143135
"typescript": "^5.2.2",
144-
"vite": "^4.4.9"
136+
"vite": "^4.4.9",
137+
"vitest": "^0.34.2"
145138
},
146139
"peerDependencies": {
147140
"react": "^17 || ^18"

0 commit comments

Comments
 (0)