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: Add type declarations to exports fields #1758

Merged
merged 2 commits into from
Jun 9, 2022
Merged
Changes from 1 commit
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
45 changes: 30 additions & 15 deletions package.json
Expand Up @@ -113,63 +113,78 @@
".": "./lib/index.js",
"./app": {
"require": "./lib/app/index.js",
"import": "./lib/esm/app/index.js"
"import": "./lib/esm/app/index.js",
"types": "./lib/app/index.d.ts"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs say that the types field should always come first in exports: https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing

"Note that the "types" condition should always come first in "exports"." (under the second code sample in that section)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thank you!

},
"./app-check": {
"require": "./lib/app-check/index.js",
"import": "./lib/esm/app-check/index.js"
"import": "./lib/esm/app-check/index.js",
"types": "./lib/app-check/index.d.ts"
},
"./auth": {
"require": "./lib/auth/index.js",
"import": "./lib/esm/auth/index.js"
"import": "./lib/esm/auth/index.js",
"types": "./lib/auth/index.d.ts"
},
"./database": {
"require": "./lib/database/index.js",
"import": "./lib/esm/database/index.js"
"import": "./lib/esm/database/index.js",
"types": "./lib/database/index.d.ts"
},
"./eventarc": {
"require": "./lib/eventarc/index.js",
"import": "./lib/esm/eventarc/index.js"
"import": "./lib/esm/eventarc/index.js",
"types": "./lib/eventarc/index.d.ts"
},
"./firestore": {
"require": "./lib/firestore/index.js",
"import": "./lib/esm/firestore/index.js"
"import": "./lib/esm/firestore/index.js",
"types": "./lib/firestore/index.d.ts"
},
"./functions": {
"require": "./lib/functions/index.js",
"import": "./lib/esm/functions/index.js"
"import": "./lib/esm/functions/index.js",
"types": "./lib/functions/index.d.ts"
},
"./installations": {
"require": "./lib/installations/index.js",
"import": "./lib/esm/installations/index.js"
"import": "./lib/esm/installations/index.js",
"types": "./lib/installations/index.d.ts"
},
"./instance-id": {
"require": "./lib/instance-id/index.js",
"import": "./lib/esm/instance-id/index.js"
"import": "./lib/esm/instance-id/index.js",
"types": "./lib/instance-id/index.d.ts"
},
"./machine-learning": {
"require": "./lib/machine-learning/index.js",
"import": "./lib/esm/machine-learning/index.js"
"import": "./lib/esm/machine-learning/index.js",
"types": "./lib/machine-learning/index.d.ts"
},
"./messaging": {
"require": "./lib/messaging/index.js",
"import": "./lib/esm/messaging/index.js"
"import": "./lib/esm/messaging/index.js",
"types": "./lib/messaging/index.d.ts"
},
"./project-management": {
"require": "./lib/project-management/index.js",
"import": "./lib/esm/project-management/index.js"
"import": "./lib/esm/project-management/index.js",
"types": "./lib/project-management/index.d.ts"
},
"./remote-config": {
"require": "./lib/remote-config/index.js",
"import": "./lib/esm/remote-config/index.js"
"import": "./lib/esm/remote-config/index.js",
"types": "./lib/remote-config/index.d.ts"
},
"./security-rules": {
"require": "./lib/security-rules/index.js",
"import": "./lib/esm/security-rules/index.js"
"import": "./lib/esm/security-rules/index.js",
"types": "./lib/security-rules/index.d.ts"
},
"./storage": {
"require": "./lib/storage/index.js",
"import": "./lib/esm/storage/index.js"
"import": "./lib/esm/storage/index.js",
"types": "./lib/storage/index.d.ts"
}
},
"dependencies": {
Expand Down