Skip to content

Commit

Permalink
fix: add type declarations to exports field (#6307)
Browse files Browse the repository at this point in the history
* fix: add type exports to `firebase` package

* fix: add type exports to `@firebase` packages

* chore: add changeset

* fix: default condition should be last

* fix: move `types` condition to the top of `exports`

* fix: wrong type paths in @firebase/installations-compat
  • Loading branch information
andipaetzold committed Jun 2, 2022
1 parent 9fddd5c commit 2cd1cc7
Show file tree
Hide file tree
Showing 31 changed files with 126 additions and 8 deletions.
34 changes: 34 additions & 0 deletions .changeset/eighty-beds-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
"@firebase/analytics-compat": patch
"@firebase/analytics": patch
"@firebase/app-check-compat": patch
"@firebase/app-check": patch
"@firebase/app-compat": patch
"@firebase/app": patch
"@firebase/auth-compat": patch
"@firebase/auth": patch
"@firebase/component": patch
"@firebase/database-compat": patch
"@firebase/database": patch
"firebase": patch
"@firebase/firestore-compat": patch
"@firebase/firestore": patch
"@firebase/functions-compat": patch
"@firebase/functions": patch
"@firebase/installations-compat": patch
"@firebase/installations": patch
"@firebase/logger": patch
"@firebase/messaging-compat": patch
"@firebase/messaging": patch
"@firebase/performance-compat": patch
"@firebase/performance": patch
"@firebase/remote-config-compat": patch
"@firebase/remote-config": patch
"@firebase/storage-compat": patch
"@firebase/storage": patch
"@firebase/template": patch
"@firebase/util": patch
"@firebase/webchannel-wrapper": patch
---

fix: add type declarations to exports field
1 change: 1 addition & 0 deletions packages/analytics-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"esm5": "dist/esm/index.esm.js",
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
Expand Down
1 change: 1 addition & 0 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"esm5": "dist/esm/index.esm.js",
"exports": {
".": {
"types": "./dist/analytics-public.d.ts",
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
Expand Down
1 change: 1 addition & 0 deletions packages/app-check-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"esm5": "dist/esm/index.esm.js",
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
Expand Down
1 change: 1 addition & 0 deletions packages/app-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"esm5": "dist/esm/index.esm.js",
"exports": {
".": {
"types": "./dist/app-check-public.d.ts",
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
Expand Down
1 change: 1 addition & 0 deletions packages/app-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"liteesm5": "dist/index.lite.esm5.js",
"exports": {
".": {
"types": "./dist/app-compat-public.d.ts",
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"lite": "./dist/index.lite.js",
Expand Down
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"esm5": "dist/esm/index.esm5.js",
"exports": {
".": {
"types": "./dist/app-public.d.ts",
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
Expand Down
2 changes: 2 additions & 0 deletions packages/auth-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"esm5": "dist/index.esm.js",
"exports": {
".": {
"types": "./dist/auth-compat/index.d.ts",
"node": {
"types": "./dist/auth-compat/index.node.d.ts",
"import": "./dist/esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
Expand Down
39 changes: 32 additions & 7 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,50 @@
"esm5": "dist/esm5/index.js",
"exports": {
".": {
"types": "./dist/auth-public.d.ts",
"node": {
"types": "./dist/node/index.d.ts",
"import": "./dist/node-esm/index.js",
"require": "./dist/node/index.js"
},
"react-native": "./dist/rn/index.js",
"cordova": "./dist/cordova/index.js",
"webworker": "./dist/index.webworker.esm5.js",
"react-native": {
"types": "./dist/rn/index.rn.d.ts",
"default": "./dist/rn/index.js"
},
"cordova": {
"types": "./dist/cordova/index.cordova.d.ts",
"default": "./dist/cordova/index.js"
},
"webworker": {
"types": "./dist/index.webworker.d.ts",
"default": "./dist/index.webworker.esm5.js"
},
"esm5": "./dist/esm5/index.js",
"default": "./dist/esm2017/index.js"
},
"./cordova": "./dist/cordova/index.js",
"./react-native": "./dist/rn/index.js",
"./cordova": {
"types": "./dist/cordova/index.cordova.d.ts",
"default": "./dist/cordova/index.js"
},
"./react-native": {
"types": "./dist/rn/index.rn.d.ts",
"default": "./dist/rn/index.js"
},
"./internal": {
"types": "./dist/internal/index.d.ts",
"node": {
"types": "./dist/node/internal/index.d.ts",
"import": "./dist/node-esm/internal.js",
"require": "./dist/node/internal.js"
},
"react-native": "./dist/rn/internal.js",
"cordova": "./dist/cordova/internal.js",
"react-native": {
"types": "./dist/rn/internal/index.d.ts",
"default": "./dist/rn/internal.js"
},
"cordova": {
"types": "./dist/cordova/internal/index.d.ts",
"default": "./dist/cordova/internal.js"
},
"esm5": "./dist/esm5/internal.js",
"default": "./dist/esm2017/internal.js"
},
Expand Down
1 change: 1 addition & 0 deletions packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"esm5": "dist/esm/index.esm5.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
Expand Down
3 changes: 3 additions & 0 deletions packages/database-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
],
"exports": {
".": {
"types": "./dist/database-compat/src/index.d.ts",
"node": {
"types": "./dist/database-compat/src/index.node.d.ts",
"import": "./dist/node-esm/index.js",
"require": "./dist/index.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./standalone": {
"types": "./dist/database-compat/src/index.standalone.d.ts",
"node": "./dist/index.standalone.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"standalone": "dist/index.standalone.js",
"exports": {
".": {
"types": "./dist/public.d.ts",
"node": {
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
Expand Down
26 changes: 26 additions & 0 deletions packages/firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,181 +24,207 @@
],
"exports": {
"./analytics": {
"types": "./analytics/dist/analytics/index.d.ts",
"node": {
"require": "./analytics/dist/index.cjs.js",
"import": "./analytics/dist/index.mjs"
},
"default": "./analytics/dist/index.esm.js"
},
"./app": {
"types": "./app/dist/app/index.d.ts",
"node": {
"require": "./app/dist/index.cjs.js",
"import": "./app/dist/index.mjs"
},
"default": "./app/dist/index.esm.js"
},
"./app-check": {
"types": "./app-check/dist/app-check/index.d.ts",
"node": {
"require": "./app-check/dist/index.cjs.js",
"import": "./app-check/dist/index.mjs"
},
"default": "./app-check/dist/index.esm.js"
},
"./auth": {
"types": "./auth/dist/auth/index.d.ts",
"node": {
"require": "./auth/dist/index.cjs.js",
"import": "./auth/dist/index.mjs"
},
"default": "./auth/dist/index.esm.js"
},
"./auth/cordova": {
"types": "./auth/cordova/dist/auth/cordova/index.d.ts",
"node": {
"require": "./auth/cordova/dist/index.cjs.js",
"import": "./auth/cordova/dist/index.mjs"
},
"default": "./auth/cordova/dist/index.esm.js"
},
"./auth/react-native": {
"types": "./auth/react-native/dist/auth/react-native/index.d.ts",
"node": {
"require": "./auth/react-native/dist/index.cjs.js",
"import": "./auth/react-native/dist/index.mjs"
},
"default": "./auth/react-native/dist/index.esm.js"
},
"./database": {
"types": "./database/dist/database/index.d.ts",
"node": {
"require": "./database/dist/index.cjs.js",
"import": "./database/dist/index.mjs"
},
"default": "./database/dist/index.esm.js"
},
"./firestore": {
"types": "./firestore/dist/firestore/index.d.ts",
"node": {
"require": "./firestore/dist/index.cjs.js",
"import": "./firestore/dist/index.mjs"
},
"default": "./firestore/dist/index.esm.js"
},
"./firestore/lite": {
"types": "./firestore/lite/dist/firestore/lite/index.d.ts",
"node": {
"require": "./firestore/lite/dist/index.cjs.js",
"import": "./firestore/lite/dist/index.mjs"
},
"default": "./firestore/lite/dist/index.esm.js"
},
"./functions": {
"types": "./functions/dist/functions/index.d.ts",
"node": {
"require": "./functions/dist/index.cjs.js",
"import": "./functions/dist/index.mjs"
},
"default": "./functions/dist/index.esm.js"
},
"./messaging": {
"types": "./messaging/dist/messaging/index.d.ts",
"node": {
"require": "./messaging/dist/index.cjs.js",
"import": "./messaging/dist/index.mjs"
},
"default": "./messaging/dist/index.esm.js"
},
"./messaging/sw": {
"types": "./messaging/sw/dist/messaging/sw/index.d.ts",
"node": {
"require": "./messaging/sw/dist/index.cjs.js",
"import": "./messaging/sw/dist/index.mjs"
},
"default": "./messaging/sw/dist/index.esm.js"
},
"./performance": {
"types": "./performance/dist/performance/index.d.ts",
"node": {
"require": "./performance/dist/index.cjs.js",
"import": "./performance/dist/index.mjs"
},
"default": "./performance/dist/index.esm.js"
},
"./remote-config": {
"types": "./remote-config/dist/remote-config/index.d.ts",
"node": {
"require": "./remote-config/dist/index.cjs.js",
"import": "./remote-config/dist/index.mjs"
},
"default": "./remote-config/dist/index.esm.js"
},
"./storage": {
"types": "./storage/dist/storage/index.d.ts",
"node": {
"require": "./storage/dist/index.cjs.js",
"import": "./storage/dist/index.mjs"
},
"default": "./storage/dist/index.esm.js"
},
"./compat/analytics": {
"types": "./compat/analytics/dist/compat/analytics/index.d.ts",
"node": {
"require": "./compat/analytics/dist/index.cjs.js",
"import": "./compat/analytics/dist/index.mjs"
},
"default": "./compat/analytics/dist/index.esm.js"
},
"./compat/app": {
"types": "./compat/app/dist/compat/app/index.d.ts",
"node": {
"require": "./compat/app/dist/index.cjs.js",
"import": "./compat/app/dist/index.mjs"
},
"default": "./compat/app/dist/index.esm.js"
},
"./compat/app-check": {
"types": "./compat/app-check/dist/compat/app-check/index.d.ts",
"node": {
"require": "./compat/app-check/dist/index.cjs.js",
"import": "./compat/app-check/dist/index.mjs"
},
"default": "./compat/app-check/dist/index.esm.js"
},
"./compat/auth": {
"types": "./compat/auth/dist/compat/auth/index.d.ts",
"node": {
"require": "./compat/auth/dist/index.cjs.js",
"import": "./compat/auth/dist/index.mjs"
},
"default": "./compat/auth/dist/index.esm.js"
},
"./compat/database": {
"types": "./compat/database/dist/compat/database/index.d.ts",
"node": {
"require": "./compat/database/dist/index.cjs.js",
"import": "./compat/database/dist/index.mjs"
},
"default": "./compat/database/dist/index.esm.js"
},
"./compat/firestore": {
"types": "./compat/firestore/dist/compat/firestore/index.d.ts",
"node": {
"require": "./compat/firestore/dist/index.cjs.js",
"import": "./compat/firestore/dist/index.mjs"
},
"default": "./compat/firestore/dist/index.esm.js"
},
"./compat/functions": {
"types": "./compat/functions/dist/compat/functions/index.d.ts",
"node": {
"require": "./compat/functions/dist/index.cjs.js",
"import": "./compat/functions/dist/index.mjs"
},
"default": "./compat/functions/dist/index.esm.js"
},
"./compat/messaging": {
"types": "./compat/messaging/dist/compat/messaging/index.d.ts",
"node": {
"require": "./compat/messaging/dist/index.cjs.js",
"import": "./compat/messaging/dist/index.mjs"
},
"default": "./compat/messaging/dist/index.esm.js"
},
"./compat/performance": {
"types": "./compat/performance/dist/compat/performance/index.d.ts",
"node": {
"require": "./compat/performance/dist/index.cjs.js",
"import": "./compat/performance/dist/index.mjs"
},
"default": "./compat/performance/dist/index.esm.js"
},
"./compat/remote-config": {
"types": "./compat/remote-config/dist/compat/remote-config/index.d.ts",
"node": {
"require": "./compat/remote-config/dist/index.cjs.js",
"import": "./compat/remote-config/dist/index.mjs"
},
"default": "./compat/remote-config/dist/index.esm.js"
},
"./compat/storage": {
"types": "./compat/storage/dist/compat/storage/index.d.ts",
"node": {
"require": "./compat/storage/dist/index.cjs.js",
"import": "./compat/storage/dist/index.mjs"
Expand Down
Loading

0 comments on commit 2cd1cc7

Please sign in to comment.