Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type resolution when using modern TypeScript module resolution #373

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/small-readers-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'contentlayer': patch
---

Fix type resolution when using modern TypeScript module resolution

Ensure types exported from `contentlayer/core`, `contentlayer/source-files`,
and `contentlayer/client` that are imported into generated code resolve
properly when TypeScript is configured with `moduleResolution` set to
`nodenext` or `node16`.
28 changes: 7 additions & 21 deletions packages/contentlayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,13 @@
},
"exports": {
"./package.json": "./package.json",
"./source-files": {
"import": "./dist/source-files/index.js"
},
"./source-files/schema": {
"import": "./dist/source-files/schema/index.js"
},
"./source-remote-files": {
"import": "./dist/source-remote-files/index.js"
},
"./client": {
"import": "./dist/client/index.js"
},
"./utils": {
"import": "./dist/utils/index.js"
},
"./utils/node": {
"import": "./dist/utils/node/index.js"
},
"./core": {
"import": "./dist/core/index.js"
}
"./source-files": "./dist/source-files/index.js",
"./source-files/schema": "./dist/source-files/schema/index.js",
"./source-remote-files": "./dist/source-remote-files/index.js",
"./client": "./dist/client/index.js",
"./utils": "./dist/utils/index.js",
"./utils/node": "./dist/utils/node/index.js",
"./core": "./dist/core/index.js"
},
"_typesVersions": "Not needed anymore once this issue is closed https://github.com/microsoft/TypeScript/issues/33079",
"typesVersions": {
Expand Down