Skip to content

Commit

Permalink
fix: remove typesVersions from package.json (#219)
Browse files Browse the repository at this point in the history
We have `typesVersions` to allow deep requires 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 deep requires are disallowed and consequently
`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
  • Loading branch information
achingbrain authored May 27, 2022
1 parent 5802bd3 commit 465670e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 40 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"private": true,
"scripts": {
"reset": "lerna run clean && rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist",
"reset": "lerna run clean && rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json",
"test": "lerna run --concurrency 1 test -- --",
"test:node": "lerna run --concurrency 1 test:node -- --",
"test:chrome": "lerna run --concurrency 1 test:chrome -- --",
Expand All @@ -26,6 +26,7 @@
"test:firefox-webworker": "lerna run --concurrency 1 test:firefox-webworker -- --",
"test:electron-main": "lerna run --concurrency 1 test:electron-main -- --",
"test:electron-renderer": "lerna run --concurrency 1 test:electron-renderer -- --",
"clean": "lerna run clean",
"build": "lerna run build",
"lint": "lerna run lint",
"dep-check": "lerna run dep-check",
Expand Down
14 changes: 1 addition & 13 deletions packages/ipfs-unixfs-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@
},
"type": "module",
"types": "types/src/index.d.ts",
"typesVersions": {
"*": {
"*": [
"types/*",
"types/src/*"
],
"types/*": [
"types/*",
"types/src/*"
]
}
},
"files": [
"*",
"!**/*.tsbuildinfo",
Expand Down Expand Up @@ -144,7 +132,7 @@
"test:firefox": "aegir test -t browser -- --browser firefox",
"build": "aegir build && cp -R types dist",
"preleaseOnly": "npx json -I -f dist/package.json -e this.types='\"src/index.d.ts\"'",
"clean": "rimraf ./dist",
"clean": "rimraf ./dist ./types",
"lint": "aegir ts -p check && aegir lint",
"dep-check": "aegir dep-check -i @types/sinon -i nyc -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i interface-blockstore",
"release": "semantic-release"
Expand Down
14 changes: 1 addition & 13 deletions packages/ipfs-unixfs-importer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@
},
"type": "module",
"types": "types/src/index.d.ts",
"typesVersions": {
"*": {
"*": [
"types/*",
"types/src/*"
],
"types/*": [
"types/*",
"types/src/*"
]
}
},
"files": [
"*",
"!**/*.tsbuildinfo",
Expand Down Expand Up @@ -144,7 +132,7 @@
"test:firefox": "aegir test -t browser -- --browser firefox",
"build": "aegir build && cp -R types dist",
"preleaseOnly": "npx json -I -f dist/package.json -e this.types='\"src/index.d.ts\"'",
"clean": "rimraf ./dist",
"clean": "rimraf ./dist ./types",
"lint": "aegir ts -p check && aegir lint",
"dep-check": "aegir dep-check -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i assert -i interface-blockstore",
"release": "semantic-release"
Expand Down
14 changes: 1 addition & 13 deletions packages/ipfs-unixfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@
},
"type": "module",
"types": "types/src/index.d.ts",
"typesVersions": {
"*": {
"*": [
"types/*",
"types/src/*"
],
"types/*": [
"types/*",
"types/src/*"
]
}
},
"files": [
"*",
"!**/*.tsbuildinfo",
Expand Down Expand Up @@ -148,7 +136,7 @@
"test:chrome": "aegir test -t browser --cov",
"test:firefox": "aegir test -t browser -- --browser firefox",
"build": "aegir build && cp -R types dist",
"clean": "rimraf ./dist",
"clean": "rimraf ./dist ./types",
"lint": "aegir ts -p check && aegir lint",
"dep-check": "aegir dep-check -i mkdirp -i npm-run-all -i copy -i util",
"release": "semantic-release"
Expand Down

0 comments on commit 465670e

Please sign in to comment.