Skip to content

Commit

Permalink
Update build scripts to work with exports (#5708)
Browse files Browse the repository at this point in the history
* fix standalone build

* add missing entry points to exports

* Create spotty-ducks-buy.md

* add fields back

* use the same name in all places
  • Loading branch information
Feiyang1 authored Nov 8, 2021
1 parent dbd54f7 commit 3281315
Show file tree
Hide file tree
Showing 33 changed files with 73 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .changeset/spotty-ducks-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
"@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
---

Update build scripts to work with the 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 @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
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 @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
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 @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
5 changes: 4 additions & 1 deletion packages/app-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
"module": "dist/esm/index.esm2017.js",
"esm5": "dist/esm/index.esm5.js",
"lite": "dist/index.lite.js",
"lite-esm5": "dist/index.lite.esm5.js",
"liteesm5": "dist/index.lite.esm5.js",
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"lite": "./dist/index.lite.js",
"liteesm5": "./dist/index.lite.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/app-compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const esmBuilds = [
{
input: 'src/index.lite.ts',
output: {
file: pkg['lite-esm5'],
file: pkg['liteesm5'],
format: 'es',
sourcemap: true
},
Expand Down
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/auth-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"import": "./dist/esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
2 changes: 2 additions & 0 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"react-native": "./dist/rn/index.js",
"cordova": "./dist/cordova/index.esm5.js",
"webworker": "./dist/index.webworker.esm5.js",
"esm5": "./dist/esm5/index.js",
"default": "./dist/esm2017/index.js"
},
"./internal": {
Expand All @@ -28,6 +29,7 @@
},
"react-native": "./dist/rn/internal.js",
"cordova": "./dist/cordova/internal.js",
"esm5": "./dist/esm5/internal.js",
"default": "./dist/esm2017/internal.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/database-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"import": "./dist/node-esm/index.js",
"require": "./dist/index.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./standalone": {
Expand Down
2 changes: 1 addition & 1 deletion packages/database-compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const cjsBuilds = [
plugins: [
...es5BuildPlugins,
resolveModule({
mainFields: ['standalone'],
exportConditions: ['standalone'],
preferBuiltins: true
}),
commonjs()
Expand Down
2 changes: 2 additions & 0 deletions packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"standalone": "./dist/index.standalone.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase/compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const completeBuilds = [
plugins: [
sourcemaps(),
resolveModule({
mainFields: ['lite-esm5', 'esm5', 'module']
exportConditions: ['liteesm5', 'esm5']
}),
typescriptPluginCDN,
json(),
Expand All @@ -265,7 +265,7 @@ const completeBuilds = [
plugins: [
sourcemaps(),
resolveModule({
mainFields: ['lite', 'module', 'main']
exportConditions: ['lite']
}),
rollupTypescriptPlugin({
typescript,
Expand Down
1 change: 1 addition & 0 deletions packages/firestore-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"require": "./dist/index.node.cjs.js"
},
"react-native": "./dist/index.rn.js",
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
2 changes: 2 additions & 0 deletions packages/firestore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"import": "./dist/index.node.mjs"
},
"react-native": "./dist/index.rn.js",
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./lite": {
Expand All @@ -62,6 +63,7 @@
"import": "./dist/lite/index.node.mjs"
},
"react-native": "./dist/lite/index.rn.esm2017.js",
"esm5": "./dist/lite/index.browser.esm5.js",
"default": "./dist/lite/index.browser.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/functions-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"import": "./dist/esm-node/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/installations-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/installations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/messaging-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
".": {
"browser": "./dist/esm/index.esm2017.js",
"module": "./dist/esm/index.esm2017.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/index.cjs.js"
},
"./sw": "./dist/index.sw.esm2017.js",
Expand Down
1 change: 1 addition & 0 deletions packages/performance-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/performance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/remote-config-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/remote-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/storage-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
3 changes: 2 additions & 1 deletion packages/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"node": {
"import": "./dist/node-esm/index.node.esm.js",
"default": "./dist/index.node.cjs.js"
},
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/webchannel-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"exports": {
".": {
"require": "./dist/index.js",
"esm5": "./dist/index.esm.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down

0 comments on commit 3281315

Please sign in to comment.