-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Specify type declaration file in exports (#158)
It's currently not possible to use interfaces and types in consuming projects with `moduleResolution: bundler` configured, because the `.d.mts` file contains bundled js code instead of the type declarations. The issue stems from [this commit](b13d10f). The original intention was to rename `.d.ts` into `.d.mts` and `.d.cts`. However, the result was that `.cjs` and `.mts` files were mistakenly renamed to `.d.cts` and `.d.mts`, respectively. It had good intentions, because it's true that typescript will prioritize reading a `.mts` file over a `.d.ts` file when using `esm`. To fix this, this PR removes this step in the build process, and explicitely defines the path for type declartions in the package exports instead.
- Loading branch information
Showing
8 changed files
with
37 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@poap-xyz/drops", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Drops module for the poap.js library", | ||
"main": "dist/cjs/index.cjs", | ||
"module": "dist/esm/index.mjs", | ||
|
@@ -9,7 +9,8 @@ | |
"exports": { | ||
"require": "./dist/cjs/index.cjs", | ||
"import": "./dist/esm/index.mjs", | ||
"browser": "./dist/umd/index.js" | ||
"browser": "./dist/umd/index.js", | ||
"types": "./dist/cjs/index.d.ts" | ||
}, | ||
"type": "module", | ||
"repository": { | ||
|
@@ -30,7 +31,7 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@poap-xyz/providers": "0.7.4", | ||
"@poap-xyz/utils": "0.7.4" | ||
"@poap-xyz/providers": "0.7.5", | ||
"@poap-xyz/utils": "0.7.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@poap-xyz/moments", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Moments module for the poap.js library", | ||
"main": "dist/cjs/index.cjs", | ||
"module": "dist/esm/index.mjs", | ||
|
@@ -9,7 +9,8 @@ | |
"exports": { | ||
"require": "./dist/cjs/index.cjs", | ||
"import": "./dist/esm/index.mjs", | ||
"browser": "./dist/umd/index.js" | ||
"browser": "./dist/umd/index.js", | ||
"types": "./dist/cjs/index.d.ts" | ||
}, | ||
"type": "module", | ||
"repository": { | ||
|
@@ -30,8 +31,8 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@poap-xyz/providers": "0.7.4", | ||
"@poap-xyz/utils": "0.7.4", | ||
"@poap-xyz/providers": "0.7.5", | ||
"@poap-xyz/utils": "0.7.5", | ||
"uuid": "^9.0.0" | ||
}, | ||
"devDependencies": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@poap-xyz/poaps", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Poaps module for the poap.js library", | ||
"main": "dist/cjs/index.cjs", | ||
"module": "dist/esm/index.mjs", | ||
|
@@ -9,7 +9,8 @@ | |
"exports": { | ||
"require": "./dist/cjs/index.cjs", | ||
"import": "./dist/esm/index.mjs", | ||
"browser": "./dist/umd/index.js" | ||
"browser": "./dist/umd/index.js", | ||
"types": "./dist/cjs/index.d.ts" | ||
}, | ||
"type": "module", | ||
"repository": { | ||
|
@@ -30,7 +31,7 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@poap-xyz/providers": "0.7.4", | ||
"@poap-xyz/utils": "0.7.4" | ||
"@poap-xyz/providers": "0.7.5", | ||
"@poap-xyz/utils": "0.7.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@poap-xyz/providers", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Providers module for the poap.js library", | ||
"main": "dist/cjs/index.cjs", | ||
"module": "dist/esm/index.mjs", | ||
|
@@ -9,7 +9,8 @@ | |
"exports": { | ||
"require": "./dist/cjs/index.cjs", | ||
"import": "./dist/esm/index.mjs", | ||
"browser": "./dist/umd/index.js" | ||
"browser": "./dist/umd/index.js", | ||
"types": "./dist/cjs/index.d.ts" | ||
}, | ||
"type": "module", | ||
"repository": { | ||
|
@@ -30,7 +31,7 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@poap-xyz/utils": "0.7.4", | ||
"@poap-xyz/utils": "0.7.5", | ||
"axios": "^1.6.8", | ||
"lodash.chunk": "^4.2.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -931,8 +931,8 @@ __metadata: | |
version: 0.0.0-use.local | ||
resolution: "@poap-xyz/drops@workspace:packages/drops" | ||
dependencies: | ||
"@poap-xyz/providers": 0.7.4 | ||
"@poap-xyz/utils": 0.7.4 | ||
"@poap-xyz/providers": 0.7.5 | ||
"@poap-xyz/utils": 0.7.5 | ||
languageName: unknown | ||
linkType: soft | ||
|
||
|
@@ -948,8 +948,8 @@ __metadata: | |
version: 0.0.0-use.local | ||
resolution: "@poap-xyz/moments@workspace:packages/moments" | ||
dependencies: | ||
"@poap-xyz/providers": 0.7.4 | ||
"@poap-xyz/utils": 0.7.4 | ||
"@poap-xyz/providers": 0.7.5 | ||
"@poap-xyz/utils": 0.7.5 | ||
"@types/uuid": ^9.0.2 | ||
uuid: ^9.0.0 | ||
languageName: unknown | ||
|
@@ -959,24 +959,24 @@ __metadata: | |
version: 0.0.0-use.local | ||
resolution: "@poap-xyz/poaps@workspace:packages/poaps" | ||
dependencies: | ||
"@poap-xyz/providers": 0.7.4 | ||
"@poap-xyz/utils": 0.7.4 | ||
"@poap-xyz/providers": 0.7.5 | ||
"@poap-xyz/utils": 0.7.5 | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"@poap-xyz/[email protected].4, @poap-xyz/providers@workspace:packages/providers": | ||
"@poap-xyz/[email protected].5, @poap-xyz/providers@workspace:packages/providers": | ||
version: 0.0.0-use.local | ||
resolution: "@poap-xyz/providers@workspace:packages/providers" | ||
dependencies: | ||
"@poap-xyz/utils": 0.7.4 | ||
"@poap-xyz/utils": 0.7.5 | ||
axios: ^1.6.8 | ||
axios-mock-adapter: ^1.21.4 | ||
jest-fetch-mock: ^3.0.3 | ||
lodash.chunk: ^4.2.0 | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"@poap-xyz/[email protected].4, @poap-xyz/utils@workspace:packages/utils": | ||
"@poap-xyz/[email protected].5, @poap-xyz/utils@workspace:packages/utils": | ||
version: 0.0.0-use.local | ||
resolution: "@poap-xyz/utils@workspace:packages/utils" | ||
languageName: unknown | ||
|