Skip to content

Commit 9f11be8

Browse files
committed
fix: remove typesVersions from package.json
We have `typesVersions` to allow deep imports from these modules, but they cause incorrect paths to be detected by tsc (see #214). Since #161 we control exports using the exports map, and we only export the root from each module so `typesVersions` isn't necessary. Since it's causing problems and we don't need it, remove it. We can revisit once we publish ESM-only but right now this fixes up the types tsc generates. Fixes #214
1 parent 0cb6aff commit 9f11be8

File tree

4 files changed

+5
-40
lines changed

4 files changed

+5
-40
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"private": true,
1919
"scripts": {
20-
"reset": "lerna run clean && rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist",
20+
"reset": "lerna run clean && rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json",
2121
"test": "lerna run --concurrency 1 test -- --",
2222
"test:node": "lerna run --concurrency 1 test:node -- --",
2323
"test:chrome": "lerna run --concurrency 1 test:chrome -- --",
@@ -26,6 +26,7 @@
2626
"test:firefox-webworker": "lerna run --concurrency 1 test:firefox-webworker -- --",
2727
"test:electron-main": "lerna run --concurrency 1 test:electron-main -- --",
2828
"test:electron-renderer": "lerna run --concurrency 1 test:electron-renderer -- --",
29+
"clean": "lerna run clean",
2930
"build": "lerna run build",
3031
"lint": "lerna run lint",
3132
"dep-check": "lerna run dep-check",

packages/ipfs-unixfs-exporter/package.json

+1-13
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@
2020
},
2121
"type": "module",
2222
"types": "types/src/index.d.ts",
23-
"typesVersions": {
24-
"*": {
25-
"*": [
26-
"types/*",
27-
"types/src/*"
28-
],
29-
"types/*": [
30-
"types/*",
31-
"types/src/*"
32-
]
33-
}
34-
},
3523
"files": [
3624
"*",
3725
"!**/*.tsbuildinfo",
@@ -144,7 +132,7 @@
144132
"test:firefox": "aegir test -t browser -- --browser firefox",
145133
"build": "aegir build && cp -R types dist",
146134
"preleaseOnly": "npx json -I -f dist/package.json -e this.types='\"src/index.d.ts\"'",
147-
"clean": "rimraf ./dist",
135+
"clean": "rimraf ./dist ./types",
148136
"lint": "aegir ts -p check && aegir lint",
149137
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
150138
"dep-check": "aegir dep-check -i @types/mocha -i @types/sinon -i nyc -i abort-controller -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i interface-blockstore",

packages/ipfs-unixfs-importer/package.json

+1-13
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@
2020
},
2121
"type": "module",
2222
"types": "types/src/index.d.ts",
23-
"typesVersions": {
24-
"*": {
25-
"*": [
26-
"types/*",
27-
"types/src/*"
28-
],
29-
"types/*": [
30-
"types/*",
31-
"types/src/*"
32-
]
33-
}
34-
},
3523
"files": [
3624
"*",
3725
"!**/*.tsbuildinfo",
@@ -144,7 +132,7 @@
144132
"test:firefox": "aegir test -t browser -- --browser firefox",
145133
"build": "aegir build && cp -R types dist",
146134
"preleaseOnly": "npx json -I -f dist/package.json -e this.types='\"src/index.d.ts\"'",
147-
"clean": "rimraf ./dist",
135+
"clean": "rimraf ./dist ./types",
148136
"lint": "aegir ts -p check && aegir lint",
149137
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
150138
"de-pcheck": "aegir dep-check -i @types/mocha -i nyc -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i assert",

packages/ipfs-unixfs/package.json

+1-13
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@
2020
},
2121
"type": "module",
2222
"types": "types/src/index.d.ts",
23-
"typesVersions": {
24-
"*": {
25-
"*": [
26-
"types/*",
27-
"types/src/*"
28-
],
29-
"types/*": [
30-
"types/*",
31-
"types/src/*"
32-
]
33-
}
34-
},
3523
"files": [
3624
"*",
3725
"!**/*.tsbuildinfo",
@@ -148,7 +136,7 @@
148136
"test:chrome": "aegir test -t browser --cov",
149137
"test:firefox": "aegir test -t browser -- --browser firefox",
150138
"build": "aegir build && cp -R types dist",
151-
"clean": "rimraf ./dist",
139+
"clean": "rimraf ./dist ./types",
152140
"lint": "aegir ts -p check && aegir lint",
153141
"coverage": "nyc -s aegir test -t node && nyc report --reporter=html",
154142
"dep-check": "aegir dep-check -i mkdirp -i @types/mocha -i nyc -i npm-run-all -i copy -i util",

0 commit comments

Comments
 (0)