diff --git a/.changeset/funny-ties-ring.md b/.changeset/funny-ties-ring.md new file mode 100644 index 00000000000..e7066ce4b91 --- /dev/null +++ b/.changeset/funny-ties-ring.md @@ -0,0 +1,25 @@ +--- +"@firebase/app": patch +"@firebase/auth": patch +"@firebase/component": patch +"@firebase/database": patch +"firebase": major +"@firebase/firestore": patch +"@firebase/functions": patch +"@firebase/performance": patch +"@firebase/remote-config": patch +"rxfire": patch +"@firebase/util": patch +--- + +Point browser field to esm build. Now you need to use default import instead of namespace import to import firebase. + +Before this change +``` +import * as firebase from 'firebase/app'; +``` + +After this change +``` +import firebase from 'firebase/app'; +``` diff --git a/config/webpack.test.js b/config/webpack.test.js index 5da3c423b29..c437b49365e 100644 --- a/config/webpack.test.js +++ b/config/webpack.test.js @@ -74,13 +74,30 @@ module.exports = { ] } } + }, + { + test: /\.js$/, + include: function (modulePath) { + const match = /node_modules\/@firebase.*/.test(modulePath); + if (match) { + console.log('modulePath', modulePath, match); + } + return match; + }, + use: { + loader: 'babel-loader', + options: { + plugins: ['@babel/plugin-transform-modules-commonjs'] + } + } } ] }, resolve: { modules: ['node_modules', path.resolve(__dirname, '../../node_modules')], - mainFields: ['browser', 'main', 'module'], - extensions: ['.js', '.ts'] + mainFields: ['browser', 'module', 'main'], + extensions: ['.js', '.ts'], + symlinks: false }, plugins: [ new webpack.NormalModuleReplacementPlugin( diff --git a/integration/firebase/package.json b/integration/firebase/package.json index b40ff02e341..89d082b91fa 100644 --- a/integration/firebase/package.json +++ b/integration/firebase/package.json @@ -8,8 +8,6 @@ }, "devDependencies": { "firebase": "7.24.0", - "@babel/core": "7.11.6", - "@babel/preset-env": "7.11.5", "@types/chai": "4.2.13", "@types/mocha": "7.0.2", "chai": "4.2.0", diff --git a/integration/firebase/test/namespace.test.ts b/integration/firebase/test/namespace.test.ts index ef6dce22e4b..42d4eec6390 100644 --- a/integration/firebase/test/namespace.test.ts +++ b/integration/firebase/test/namespace.test.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import * as firebase from 'firebase'; +import firebase from 'firebase'; import * as namespaceDefinition from './namespaceDefinition.json'; import validateNamespace from './validator'; diff --git a/package.json b/package.json index e30a6916b6a..d8b33834a3b 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,9 @@ "@typescript-eslint/eslint-plugin-tslint": "4.4.1", "@typescript-eslint/parser": "4.4.1", "babel-loader": "8.1.0", + "@babel/core": "7.11.6", + "@babel/preset-env": "7.11.5", + "@babel/plugin-transform-modules-commonjs": "7.12.1", "chai": "4.2.0", "chai-as-promised": "7.1.1", "chalk": "4.1.0", diff --git a/packages/app/package.json b/packages/app/package.json index 20614338819..f880b91307a 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -4,7 +4,7 @@ "description": "The primary entrypoint to the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "react-native": "dist/index.rn.cjs.js", "esm2017": "dist/index.esm2017.js", diff --git a/packages/app/rollup.config.js b/packages/app/rollup.config.js index 31f577f2310..ad81062fee2 100644 --- a/packages/app/rollup.config.js +++ b/packages/app/rollup.config.js @@ -37,10 +37,7 @@ const es5BuildPlugins = [ const es5Builds = [ { input: 'index.ts', - output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, - { file: pkg.module, format: 'es', sourcemap: true } - ], + output: [{ file: pkg.module, format: 'es', sourcemap: true }], plugins: es5BuildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, diff --git a/packages/auth/package.json b/packages/auth/package.json index d79c43ef1ea..cf6e93083c0 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -2,7 +2,7 @@ "name": "@firebase/auth", "version": "0.15.0", "main": "dist/auth.js", - "browser": "dist/auth.js", + "browser": "dist/auth.esm.js", "module": "dist/auth.esm.js", "description": "Javascript library for Firebase Auth SDK", "author": "Firebase (https://firebase.google.com/)", diff --git a/packages/component/package.json b/packages/component/package.json index 2e439671014..88f60ccedae 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -4,7 +4,7 @@ "description": "Firebase Component Platform", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "esm2017": "dist/index.esm2017.js", "files": ["dist"], diff --git a/packages/component/rollup.config.js b/packages/component/rollup.config.js index 8cfe95d6751..b97d6542ad8 100644 --- a/packages/component/rollup.config.js +++ b/packages/component/rollup.config.js @@ -1,6 +1,6 @@ /** * @license - * Copyright 2018 Google Inc. + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ const es5Builds = [ { input: 'index.ts', output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, + { file: pkg.main, format: 'cjs', sourcemap: true }, { file: pkg.module, format: 'es', sourcemap: true } ], plugins: es5BuildPlugins, diff --git a/packages/database/package.json b/packages/database/package.json index 599ef6807d9..8ed372271cf 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -4,7 +4,7 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "esm2017": "dist/index.esm2017.js", "files": ["dist"], diff --git a/packages/database/rollup.config.js b/packages/database/rollup.config.js index 668640e67ad..56a04103404 100644 --- a/packages/database/rollup.config.js +++ b/packages/database/rollup.config.js @@ -49,10 +49,7 @@ const es5Builds = [ */ { input: 'index.ts', - output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, - { file: pkg.module, format: 'es', sourcemap: true } - ], + output: [{ file: pkg.module, format: 'es', sourcemap: true }], plugins: es5BuildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) } diff --git a/packages/firebase/app/package.json b/packages/firebase/app/package.json index 57c2a83692c..06f2e67a295 100644 --- a/packages/firebase/app/package.json +++ b/packages/firebase/app/package.json @@ -1,7 +1,7 @@ { "name": "firebase/app", "main": "dist/index.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "typings": "../index.d.ts" } diff --git a/packages/firebase/index.d.ts b/packages/firebase/index.d.ts index c0d71742d59..179a2e66d0e 100644 --- a/packages/firebase/index.d.ts +++ b/packages/firebase/index.d.ts @@ -9684,5 +9684,5 @@ declare namespace firebase.firestore { } } -export = firebase; +export default firebase; export as namespace firebase; diff --git a/packages/firebase/package.json b/packages/firebase/package.json index deb2991c0c5..9473206d414 100644 --- a/packages/firebase/package.json +++ b/packages/firebase/package.json @@ -41,7 +41,7 @@ "test:ci": "echo 'No test suite for firebase wrapper'" }, "main": "dist/index.node.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "react-native": "dist/index.rn.cjs.js", "dependencies": { diff --git a/packages/firebase/rollup.config.js b/packages/firebase/rollup.config.js index 8bcb0195afa..41e03b1751f 100644 --- a/packages/firebase/rollup.config.js +++ b/packages/firebase/rollup.config.js @@ -184,10 +184,7 @@ const completeBuilds = [ */ { input: 'src/index.ts', - output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, - { file: pkg.module, format: 'es', sourcemap: true } - ], + output: [{ file: pkg.module, format: 'es', sourcemap: true }], plugins, external }, diff --git a/packages/firestore/memory/package.json b/packages/firestore/memory/package.json index 04a27eb839a..52decb62926 100644 --- a/packages/firestore/memory/package.json +++ b/packages/firestore/memory/package.json @@ -4,7 +4,7 @@ "main": "../dist/index.memory.node.cjs.js", "main-esm2017": "../dist/index.memory.node.esm2017.js", "react-native": "../dist/index.memory.rn.esm2017.js", - "browser": "../dist/index.memory.cjs.js", + "browser": "../dist/index.memory.esm.js", "module": "../dist/index.memory.esm.js", "esm2017": "../dist/index.memory.esm2017.js", "typings": "../dist/index.d.ts" diff --git a/packages/firestore/package.json b/packages/firestore/package.json index e74b0f402b2..90ee054b940 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -51,7 +51,7 @@ "main": "dist/index.node.cjs.js", "main-esm2017": "dist/index.node.esm2017.js", "react-native": "dist/index.rn.esm2017.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "esm2017": "dist/index.esm2017.js", "license": "Apache-2.0", diff --git a/packages/firestore/rollup.config.browser.js b/packages/firestore/rollup.config.browser.js index c3c947b56d6..6f3d2582a5f 100644 --- a/packages/firestore/rollup.config.browser.js +++ b/packages/firestore/rollup.config.browser.js @@ -41,14 +41,5 @@ export default [ treeshake: { moduleSideEffects: false } - }, - { - input: pkg.esm2017, - output: { file: pkg.browser, format: 'cjs', sourcemap: true }, - plugins: util.es2017ToEs5Plugins(/* mangled= */ true), - external: util.resolveBrowserExterns, - treeshake: { - moduleSideEffects: false - } } ]; diff --git a/packages/firestore/rollup.config.browser.memory.js b/packages/firestore/rollup.config.browser.memory.js index 036703eac5d..d97ae948c71 100644 --- a/packages/firestore/rollup.config.browser.memory.js +++ b/packages/firestore/rollup.config.browser.memory.js @@ -46,18 +46,5 @@ export default [ treeshake: { moduleSideEffects: false } - }, - { - input: path.resolve('./memory', memoryPkg['esm2017']), - output: { - file: path.resolve('./memory', memoryPkg.browser), - format: 'cjs', - sourcemap: true - }, - plugins: util.es2017ToEs5Plugins(/* mangled= */ true), - external: util.resolveBrowserExterns, - treeshake: { - moduleSideEffects: false - } } ]; diff --git a/packages/functions/package.json b/packages/functions/package.json index 60164e78625..8fb3d79f8ab 100644 --- a/packages/functions/package.json +++ b/packages/functions/package.json @@ -4,7 +4,7 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "esm2017": "dist/index.esm2017.js", "files": ["dist"], diff --git a/packages/functions/rollup.config.js b/packages/functions/rollup.config.js index 653177a72a1..700cea6c025 100644 --- a/packages/functions/rollup.config.js +++ b/packages/functions/rollup.config.js @@ -40,10 +40,7 @@ const es5Builds = [ */ { input: 'index.ts', - output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, - { file: pkg.module, format: 'es', sourcemap: true } - ], + output: [{ file: pkg.module, format: 'es', sourcemap: true }], plugins: es5BuildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, diff --git a/packages/performance/package.json b/packages/performance/package.json index 78d9db93ca6..181efe8bd9d 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -4,7 +4,7 @@ "description": "Firebase performance for web", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "esm2017": "dist/index.esm2017.js", "files": ["dist"], diff --git a/packages/remote-config/package.json b/packages/remote-config/package.json index 774730888aa..83ae132d614 100644 --- a/packages/remote-config/package.json +++ b/packages/remote-config/package.json @@ -4,7 +4,7 @@ "description": "The Remote Config package of the Firebase JS SDK", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "esm2017": "dist/index.esm2017.js", "files": ["dist"], diff --git a/packages/remote-config/rollup.config.js b/packages/remote-config/rollup.config.js index 85934294724..b0a656084d5 100644 --- a/packages/remote-config/rollup.config.js +++ b/packages/remote-config/rollup.config.js @@ -41,7 +41,7 @@ const es5Builds = [ { input: 'index.ts', output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, + { file: pkg.main, format: 'cjs', sourcemap: true }, { file: pkg.module, format: 'es', sourcemap: true } ], plugins: es5BuildPlugins, diff --git a/packages/rules-unit-testing/src/api/index.ts b/packages/rules-unit-testing/src/api/index.ts index 655e4174197..75d07908de3 100644 --- a/packages/rules-unit-testing/src/api/index.ts +++ b/packages/rules-unit-testing/src/api/index.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import * as firebase from 'firebase'; +import firebase from 'firebase'; import { _FirebaseApp } from '@firebase/app-types/private'; import { FirebaseAuthInternal } from '@firebase/auth-interop-types'; import * as request from 'request'; @@ -23,7 +23,8 @@ import { base64 } from '@firebase/util'; import { setLogLevel, LogLevel } from '@firebase/logger'; import { Component, ComponentType } from '@firebase/component'; -export { database, firestore } from 'firebase'; +const { firestore, database } = firebase; +export { firestore, database }; /** If this environment variable is set, use it for the database emulator's address. */ const DATABASE_ADDRESS_ENV: string = 'FIREBASE_DATABASE_EMULATOR_HOST'; diff --git a/packages/rxfire/auth/index.ts b/packages/rxfire/auth/index.ts index 1effdff9d22..10310647a61 100644 --- a/packages/rxfire/auth/index.ts +++ b/packages/rxfire/auth/index.ts @@ -17,16 +17,19 @@ // auth is used as a namespace to access types // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { auth, User } from 'firebase'; +import firebase from 'firebase'; import { Observable, from, of } from 'rxjs'; import { switchMap } from 'rxjs/operators'; +type Auth = firebase.auth.Auth; +type User = firebase.User; + /** * Create an observable of authentication state. The observer is only * triggered on sign-in or sign-out. * @param auth firebase.auth.Auth */ -export function authState(auth: auth.Auth): Observable { +export function authState(auth: Auth): Observable { return new Observable(subscriber => { const unsubscribe = auth.onAuthStateChanged(subscriber); return { unsubscribe }; @@ -38,7 +41,7 @@ export function authState(auth: auth.Auth): Observable { * sign-out, and token refresh events * @param auth firebase.auth.Auth */ -export function user(auth: auth.Auth): Observable { +export function user(auth: Auth): Observable { return new Observable(subscriber => { const unsubscribe = auth.onIdTokenChanged(subscriber); return { unsubscribe }; @@ -50,7 +53,7 @@ export function user(auth: auth.Auth): Observable { * sign-out, and token refresh events * @param auth firebase.auth.Auth */ -export function idToken(auth: auth.Auth): Observable { +export function idToken(auth: Auth): Observable { return user(auth).pipe( switchMap(user => (user ? from(user.getIdToken()) : of(null))) ); diff --git a/packages/rxfire/database/fromRef.ts b/packages/rxfire/database/fromRef.ts index bc1099d6aa3..888015eda41 100644 --- a/packages/rxfire/database/fromRef.ts +++ b/packages/rxfire/database/fromRef.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { database } from 'firebase'; +import firebase from 'firebase'; import { Observable } from 'rxjs'; import { delay } from 'rxjs/operators'; import { ListenEvent, QueryChange } from './interfaces'; @@ -26,7 +26,7 @@ import { ListenEvent, QueryChange } from './interfaces'; * @param event Listen event type ('value', 'added', 'changed', 'removed', 'moved') */ export function fromRef( - ref: database.Query, + ref: firebase.database.Query, event: ListenEvent ): Observable { return new Observable(subscriber => { diff --git a/packages/rxfire/database/interfaces.ts b/packages/rxfire/database/interfaces.ts index 76ad573f04d..6c77bb6fbe8 100644 --- a/packages/rxfire/database/interfaces.ts +++ b/packages/rxfire/database/interfaces.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { database } from 'firebase'; +import firebase from 'firebase'; export enum ListenEvent { added = 'child_added', @@ -26,7 +26,7 @@ export enum ListenEvent { } export interface QueryChange { - snapshot: database.DataSnapshot; + snapshot: firebase.database.DataSnapshot; prevKey: string | null | undefined; event: ListenEvent; } diff --git a/packages/rxfire/database/list/audit-trail.ts b/packages/rxfire/database/list/audit-trail.ts index 8e037da6790..75e7c83221b 100644 --- a/packages/rxfire/database/list/audit-trail.ts +++ b/packages/rxfire/database/list/audit-trail.ts @@ -15,20 +15,22 @@ * limitations under the License. */ -import { database } from 'firebase'; +import firebase from 'firebase'; import { Observable } from 'rxjs'; import { QueryChange, ListenEvent } from '../interfaces'; import { fromRef } from '../fromRef'; import { map, withLatestFrom, scan, skipWhile } from 'rxjs/operators'; import { stateChanges } from './index'; +type Query = firebase.database.Query; + interface LoadedMetadata { data: QueryChange; lastKeyToLoad: unknown; } export function auditTrail( - query: database.Query, + query: Query, events?: ListenEvent[] ): Observable { const auditTrail$ = stateChanges(query, events).pipe( @@ -40,7 +42,7 @@ export function auditTrail( return waitForLoaded(query, auditTrail$); } -function loadedData(query: database.Query): Observable { +function loadedData(query: Query): Observable { // Create an observable of loaded values to retrieve the // known dataset. This will allow us to know what key to // emit the "whole" array at when listening for child events. @@ -60,7 +62,7 @@ function loadedData(query: database.Query): Observable { } function waitForLoaded( - query: database.Query, + query: Query, snap$: Observable ): Observable { const loaded$ = loadedData(query); diff --git a/packages/rxfire/database/list/index.ts b/packages/rxfire/database/list/index.ts index 8fffa70f33c..2a0c0876681 100644 --- a/packages/rxfire/database/list/index.ts +++ b/packages/rxfire/database/list/index.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { database } from 'firebase'; +import firebase from 'firebase'; import { QueryChange, ListenEvent } from '../interfaces'; import { Observable, of, merge, from } from 'rxjs'; import { validateEventsArray } from '../utils'; @@ -23,8 +23,10 @@ import { fromRef } from '../fromRef'; import { switchMap, scan, distinctUntilChanged, map } from 'rxjs/operators'; import { changeToData } from '../object'; +type Query = firebase.database.Query; + export function stateChanges( - query: database.Query, + query: Query, events?: ListenEvent[] ): Observable { events = validateEventsArray(events); @@ -32,7 +34,7 @@ export function stateChanges( return merge(...childEvent$); } -function fromOnce(query: database.Query): Observable { +function fromOnce(query: Query): Observable { return from(query.once(ListenEvent.value)).pipe( map(snapshot => { const event = ListenEvent.value; @@ -42,7 +44,7 @@ function fromOnce(query: database.Query): Observable { } export function list( - query: database.Query, + query: Query, events?: ListenEvent[] ): Observable { const eventsList = validateEventsArray(events); @@ -63,10 +65,7 @@ export function list( * @param query object ref or query * @param keyField map the object key to a specific field */ -export function listVal( - query: database.Query, - keyField?: string -): Observable { +export function listVal(query: Query, keyField?: string): Observable { return list(query).pipe( map(arr => arr.map(change => changeToData(change, keyField) as T)) ); diff --git a/packages/rxfire/database/object/index.ts b/packages/rxfire/database/object/index.ts index ed66147b867..13fde88c152 100644 --- a/packages/rxfire/database/object/index.ts +++ b/packages/rxfire/database/object/index.ts @@ -15,17 +15,18 @@ * limitations under the License. */ -import { database } from 'firebase'; +import firebase from 'firebase'; import { QueryChange, ListenEvent } from '../interfaces'; import { fromRef } from '../fromRef'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +type Query = firebase.database.Query; /** * Get the snapshot changes of an object * @param query */ -export function object(query: database.Query): Observable { +export function object(query: Query): Observable { return fromRef(query, ListenEvent.value); } @@ -34,10 +35,7 @@ export function object(query: database.Query): Observable { * @param query object ref or query * @param keyField map the object key to a specific field */ -export function objectVal( - query: database.Query, - keyField?: string -): Observable { +export function objectVal(query: Query, keyField?: string): Observable { return fromRef(query, ListenEvent.value).pipe( map(change => changeToData(change, keyField) as T) ); diff --git a/packages/rxfire/firestore/collection/index.ts b/packages/rxfire/firestore/collection/index.ts index 614c15cddeb..8c57889b6ae 100644 --- a/packages/rxfire/firestore/collection/index.ts +++ b/packages/rxfire/firestore/collection/index.ts @@ -15,17 +15,18 @@ * limitations under the License. */ -import { firestore } from 'firebase/app'; +import firebase from 'firebase/app'; import { fromCollectionRef } from '../fromRef'; import { Observable, MonoTypeOperatorFunction } from 'rxjs'; import { map, filter, scan, distinctUntilChanged } from 'rxjs/operators'; import { snapToData } from '../document'; -const ALL_EVENTS: firestore.DocumentChangeType[] = [ - 'added', - 'modified', - 'removed' -]; +type DocumentChangeType = firebase.firestore.DocumentChangeType; +type DocumentChange = firebase.firestore.DocumentChange; +type Query = firebase.firestore.Query; +type QueryDocumentSnapshot = firebase.firestore.QueryDocumentSnapshot; + +const ALL_EVENTS: DocumentChangeType[] = ['added', 'modified', 'removed']; /** * Create an operator that determines if a the stream of document changes @@ -33,9 +34,9 @@ const ALL_EVENTS: firestore.DocumentChangeType[] = [ * in specified events array, it will not be emitted. */ const filterEvents = ( - events?: firestore.DocumentChangeType[] -): MonoTypeOperatorFunction => - filter((changes: firestore.DocumentChange[]) => { + events?: DocumentChangeType[] +): MonoTypeOperatorFunction => + filter((changes: DocumentChange[]) => { let hasChange = false; for (let i = 0; i < changes.length; i++) { const change = changes[i]; @@ -52,9 +53,7 @@ const filterEvents = ( * ability to filter on events, which means all changes can be filtered out. * This creates an empty array and would be incorrect to emit. */ -const filterEmpty = filter( - (changes: firestore.DocumentChange[]) => changes.length > 0 -); +const filterEmpty = filter((changes: DocumentChange[]) => changes.length > 0); /** * Splice arguments on top of a sliced array, to break top-level === @@ -77,9 +76,9 @@ function sliceAndSplice( * @param change */ function processIndividualChange( - combined: firestore.DocumentChange[], - change: firestore.DocumentChange -): firestore.DocumentChange[] { + combined: DocumentChange[], + change: DocumentChange +): DocumentChange[] { switch (change.type) { case 'added': if ( @@ -130,10 +129,10 @@ function processIndividualChange( * @param events */ function processDocumentChanges( - current: firestore.DocumentChange[], - changes: firestore.DocumentChange[], - events: firestore.DocumentChangeType[] = ALL_EVENTS -): firestore.DocumentChange[] { + current: DocumentChange[], + changes: DocumentChange[], + events: DocumentChangeType[] = ALL_EVENTS +): DocumentChange[] { changes.forEach(change => { // skip unwanted change types if (events.indexOf(change.type) > -1) { @@ -149,9 +148,9 @@ function processDocumentChanges( * @param query */ export function collectionChanges( - query: firestore.Query, - events: firestore.DocumentChangeType[] = ALL_EVENTS -): Observable { + query: Query, + events: DocumentChangeType[] = ALL_EVENTS +): Observable { return fromCollectionRef(query).pipe( map(snapshot => snapshot.docChanges()), filterEvents(events), @@ -163,9 +162,7 @@ export function collectionChanges( * Return a stream of document snapshots on a query. These results are in sort order. * @param query */ -export function collection( - query: firestore.Query -): Observable { +export function collection(query: Query): Observable { return fromCollectionRef(query).pipe(map(changes => changes.docs)); } @@ -174,15 +171,13 @@ export function collection( * @param query */ export function sortedChanges( - query: firestore.Query, - events?: firestore.DocumentChangeType[] -): Observable { + query: Query, + events?: DocumentChangeType[] +): Observable { return collectionChanges(query, events).pipe( scan( - ( - current: firestore.DocumentChange[], - changes: firestore.DocumentChange[] - ) => processDocumentChanges(current, changes, events), + (current: DocumentChange[], changes: DocumentChange[]) => + processDocumentChanges(current, changes, events), [] ), distinctUntilChanged() @@ -194,14 +189,11 @@ export function sortedChanges( * to docChanges() but it collects each event in an array over time. */ export function auditTrail( - query: firestore.Query, - events?: firestore.DocumentChangeType[] -): Observable { + query: Query, + events?: DocumentChangeType[] +): Observable { return collectionChanges(query, events).pipe( - scan( - (current, action) => [...current, ...action], - [] as firestore.DocumentChange[] - ) + scan((current, action) => [...current, ...action], [] as DocumentChange[]) ); } @@ -210,7 +202,7 @@ export function auditTrail( * @param query */ export function collectionData( - query: firestore.Query, + query: Query, idField?: string ): Observable { return collection(query).pipe( diff --git a/packages/rxfire/firestore/document/index.ts b/packages/rxfire/firestore/document/index.ts index a3e91b28190..e908af29735 100644 --- a/packages/rxfire/firestore/document/index.ts +++ b/packages/rxfire/firestore/document/index.ts @@ -15,14 +15,15 @@ * limitations under the License. */ -import { firestore } from 'firebase/app'; +import firebase from 'firebase/app'; import { fromDocRef } from '../fromRef'; import { map } from 'rxjs/operators'; import { Observable } from 'rxjs'; -export function doc( - ref: firestore.DocumentReference -): Observable { +type DocumentReference = firebase.firestore.DocumentReference; +type DocumentSnapshot = firebase.firestore.DocumentSnapshot; + +export function doc(ref: DocumentReference): Observable { return fromDocRef(ref); } @@ -31,16 +32,13 @@ export function doc( * @param query */ export function docData( - ref: firestore.DocumentReference, + ref: DocumentReference, idField?: string ): Observable { return doc(ref).pipe(map(snap => snapToData(snap, idField) as T)); } -export function snapToData( - snapshot: firestore.DocumentSnapshot, - idField?: string -): {} { +export function snapToData(snapshot: DocumentSnapshot, idField?: string): {} { return { ...snapshot.data(), ...(idField ? { [idField]: snapshot.id } : null) diff --git a/packages/rxfire/firestore/fromRef.ts b/packages/rxfire/firestore/fromRef.ts index a5a78f8c4c2..bcd50ebfc46 100644 --- a/packages/rxfire/firestore/fromRef.ts +++ b/packages/rxfire/firestore/fromRef.ts @@ -15,13 +15,19 @@ * limitations under the License. */ -import { firestore } from 'firebase/app'; +import firebase from 'firebase/app'; import { Observable } from 'rxjs'; +type DocumentReference = firebase.firestore.DocumentReference; +type SnapshotListenOptions = firebase.firestore.SnapshotListenOptions; +type Query = firebase.firestore.Query; +type DocumentSnapshot = firebase.firestore.DocumentSnapshot; +type QuerySnapshot = firebase.firestore.QuerySnapshot; + /* eslint-disable @typescript-eslint/no-explicit-any */ function _fromRef( ref: any, - options: firestore.SnapshotListenOptions | undefined + options: SnapshotListenOptions | undefined ): Observable { /* eslint-enable @typescript-eslint/no-explicit-any */ return new Observable(subscriber => { @@ -31,22 +37,22 @@ function _fromRef( } export function fromRef( - ref: firestore.DocumentReference | firestore.Query, - options?: firestore.SnapshotListenOptions + ref: DocumentReference | Query, + options?: SnapshotListenOptions ): Observable<{}> { return _fromRef(ref, options); } export function fromDocRef( - ref: firestore.DocumentReference, - options?: firestore.SnapshotListenOptions -): Observable { - return fromRef(ref, options) as Observable; + ref: DocumentReference, + options?: SnapshotListenOptions +): Observable { + return fromRef(ref, options) as Observable; } export function fromCollectionRef( - ref: firestore.Query, - options?: firestore.SnapshotListenOptions -): Observable { - return fromRef(ref, options) as Observable; + ref: Query, + options?: SnapshotListenOptions +): Observable { + return fromRef(ref, options) as Observable; } diff --git a/packages/rxfire/functions/index.ts b/packages/rxfire/functions/index.ts index b13e5ec3aae..8b633767f34 100644 --- a/packages/rxfire/functions/index.ts +++ b/packages/rxfire/functions/index.ts @@ -17,12 +17,12 @@ // function is used as a namespace to access types // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { functions } from 'firebase/app'; +import firebase from 'firebase/app'; import { from, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; export function httpsCallable( - functions: functions.Functions, + functions: firebase.functions.Functions, name: string ): (data: T) => Observable { const callable = functions.httpsCallable(name); diff --git a/packages/rxfire/package.json b/packages/rxfire/package.json index 2e5e22a6677..8703120d0de 100644 --- a/packages/rxfire/package.json +++ b/packages/rxfire/package.json @@ -32,9 +32,6 @@ "test:browser": "karma start --single-run", "test:browser:debug": "karma start --browsers=Chrome --auto-watch" }, - "main": "dist/index.node.cjs.js", - "browser": "dist/index.cjs.js", - "module": "dist/index.esm.js", "dependencies": { "tslib": "^1.11.1" }, @@ -51,7 +48,6 @@ "rollup-plugin-uglify": "6.0.4", "typescript": "4.0.2" }, - "typings": "dist/index.d.ts", "files": [ "/auth/package.json", "/auth/dist", diff --git a/packages/rxfire/storage/index.ts b/packages/rxfire/storage/index.ts index d9221d3f724..deae52ebc8f 100644 --- a/packages/rxfire/storage/index.ts +++ b/packages/rxfire/storage/index.ts @@ -15,16 +15,21 @@ * limitations under the License. */ -import { storage } from 'firebase/app'; +import firebase from 'firebase/app'; import { Observable, from } from 'rxjs'; import { map } from 'rxjs/operators'; +type UploadTaskSnapshot = firebase.storage.UploadTaskSnapshot; +type Reference = firebase.storage.Reference; +type UploadMetadata = firebase.storage.UploadMetadata; +type StringFormat = firebase.storage.StringFormat; +type UploadTask = firebase.storage.UploadTask; + export function fromTask( - task: storage.UploadTask -): Observable { - return new Observable(subscriber => { - const progress = (snap: storage.UploadTaskSnapshot): void => - subscriber.next(snap); + task: firebase.storage.UploadTask +): Observable { + return new Observable(subscriber => { + const progress = (snap: UploadTaskSnapshot): void => subscriber.next(snap); const error = (e: Error): void => subscriber.error(e); const complete = (): void => subscriber.complete(); task.on('state_changed', progress, error, complete); @@ -32,39 +37,39 @@ export function fromTask( }); } -export function getDownloadURL(ref: storage.Reference): Observable { +export function getDownloadURL(ref: Reference): Observable { return from(ref.getDownloadURL()); } // TODO: fix storage typing in firebase, then apply the same fix here // eslint-disable-next-line @typescript-eslint/no-explicit-any -export function getMetadata(ref: storage.Reference): Observable { +export function getMetadata(ref: Reference): Observable { return from(ref.getMetadata()); } export function put( - ref: storage.Reference, + ref: Reference, // eslint-disable-next-line @typescript-eslint/no-explicit-any data: any, - metadata?: storage.UploadMetadata -): Observable { + metadata?: UploadMetadata +): Observable { return fromTask(ref.put(data, metadata)); } export function putString( - ref: storage.Reference, + ref: Reference, data: string, - format?: storage.StringFormat, - metadata?: storage.UploadMetadata -): Observable { + format?: StringFormat, + metadata?: UploadMetadata +): Observable { return fromTask(ref.putString(data, format, metadata)); } export function percentage( - task: storage.UploadTask + task: UploadTask ): Observable<{ progress: number; - snapshot: storage.UploadTaskSnapshot; + snapshot: UploadTaskSnapshot; }> { return fromTask(task).pipe( map(s => ({ diff --git a/packages/rxfire/test/database.test.ts b/packages/rxfire/test/database.test.ts index 8aed6c78fc1..b7eb0f10a7d 100644 --- a/packages/rxfire/test/database.test.ts +++ b/packages/rxfire/test/database.test.ts @@ -20,7 +20,7 @@ import { expect } from 'chai'; // app/database is used as namespaces to access types // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { initializeApp, database, app } from 'firebase'; +import firebase from 'firebase'; import { fromRef } from '../database/fromRef'; import { list, @@ -50,9 +50,9 @@ const batch = ( }; describe('RxFire Database', () => { - let app: app.App; - let database: database.Database; - const ref = (path: string): database.Reference => { + let app: firebase.app.App; + let database: firebase.database.Database; + const ref = (path: string): firebase.database.Reference => { app!.database().goOffline(); return app!.database().ref(path); }; @@ -61,7 +61,7 @@ describe('RxFire Database', () => { opts: { events?: ListenEvent[]; skipnumber: number } = { skipnumber: 0 } ): { snapChanges: Observable; - ref: database.Reference; + ref: firebase.database.Reference; } { const { events, skipnumber } = opts; const aref = ref(rando()); @@ -88,7 +88,7 @@ describe('RxFire Database', () => { * account for this. */ beforeEach(() => { - app = initializeApp({ + app = firebase.initializeApp({ apiKey: TEST_PROJECT.apiKey, projectId: TEST_PROJECT.projectId, databaseURL: TEST_PROJECT.databaseURL @@ -610,7 +610,7 @@ describe('RxFire Database', () => { opts: { events?: ListenEvent[]; skipnumber: number } = { skipnumber: 0 } ): { changes: Observable; - ref: database.Reference; + ref: firebase.database.Reference; } { const { events, skipnumber } = opts; const aref = ref(rando()); diff --git a/packages/rxfire/test/firestore.test.ts b/packages/rxfire/test/firestore.test.ts index 31085dfe179..535823a90c6 100644 --- a/packages/rxfire/test/firestore.test.ts +++ b/packages/rxfire/test/firestore.test.ts @@ -20,7 +20,7 @@ import { expect } from 'chai'; // app is used as namespaces to access types // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { initializeApp, firestore, app } from 'firebase/app'; +import firebase from 'firebase/app'; import 'firebase/firestore'; import { collection, @@ -42,13 +42,13 @@ const createId = (): string => Math.random().toString(36).substring(5); * makes sure tests don't interfere with each other as they run. */ const createRandomCol = ( - firestore: firestore.Firestore -): firestore.CollectionReference => firestore.collection(createId()); + firestore: firebase.firestore.Firestore +): firebase.firestore.CollectionReference => firestore.collection(createId()); /** * Unwrap a snapshot but add the type property to the data object. */ -const unwrapChange = map((changes: firestore.DocumentChange[]) => { +const unwrapChange = map((changes: firebase.firestore.DocumentChange[]) => { return changes.map(c => ({ type: c.type, ...c.doc.data() })); }); @@ -56,7 +56,7 @@ const unwrapChange = map((changes: firestore.DocumentChange[]) => { * Create an environment for the tests to run in. The information is returned * from the function for use within the test. */ -const seedTest = (firestore: firestore.Firestore): any => { +const seedTest = (firestore: firebase.firestore.Firestore): any => { const colRef = createRandomCol(firestore); const davidDoc = colRef.doc('david'); davidDoc.set({ name: 'David' }); @@ -71,8 +71,8 @@ const seedTest = (firestore: firestore.Firestore): any => { }; describe('RxFire Firestore', () => { - let app: app.App; - let firestore: firestore.Firestore; + let app: firebase.app.App; + let firestore: firebase.firestore.Firestore; /** * Each test runs inside it's own app instance and the app @@ -86,7 +86,7 @@ describe('RxFire Firestore', () => { * offline. */ beforeEach(() => { - app = initializeApp({ projectId: TEST_PROJECT.projectId }); + app = firebase.initializeApp({ projectId: TEST_PROJECT.projectId }); firestore = app.firestore(); firestore.disableNetwork(); }); diff --git a/packages/template/package.json b/packages/template/package.json index 8e33593b52f..353c2b23bb9 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -5,7 +5,7 @@ "description": "A template package for new firebase packages", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "esm2017": "dist/index.esm2017.js", "files": ["dist"], diff --git a/packages/template/rollup.config.js b/packages/template/rollup.config.js index b7c34e85a6d..2539715af91 100644 --- a/packages/template/rollup.config.js +++ b/packages/template/rollup.config.js @@ -1,6 +1,6 @@ /** * @license - * Copyright 2019 Google Inc. + * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,10 +38,7 @@ const es5Builds = [ */ { input: 'index.ts', - output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, - { file: pkg.module, format: 'es', sourcemap: true } - ], + output: [{ file: pkg.module, format: 'es', sourcemap: true }], plugins: es5BuildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, diff --git a/packages/util/package.json b/packages/util/package.json index c865e210d2c..f3fdfb6a5bc 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -4,7 +4,7 @@ "description": "", "author": "Firebase (https://firebase.google.com/)", "main": "dist/index.node.cjs.js", - "browser": "dist/index.cjs.js", + "browser": "dist/index.esm.js", "module": "dist/index.esm.js", "esm2017": "dist/index.esm2017.js", "files": ["dist"], diff --git a/packages/util/rollup.config.js b/packages/util/rollup.config.js index bfdd6985437..0ae738eebf1 100644 --- a/packages/util/rollup.config.js +++ b/packages/util/rollup.config.js @@ -1,6 +1,6 @@ /** * @license - * Copyright 2018 Google Inc. + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,10 +39,7 @@ const es5Builds = [ */ { input: 'index.ts', - output: [ - { file: pkg.browser, format: 'cjs', sourcemap: true }, - { file: pkg.module, format: 'es', sourcemap: true } - ], + output: [{ file: pkg.module, format: 'es', sourcemap: true }], plugins: es5BuildPlugins, external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)) }, diff --git a/yarn.lock b/yarn.lock index b8cd43a30a9..c7bc8819b9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -58,6 +58,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz#0d70be32bdaa03d7c51c8597dda76e0df1f15468" + integrity sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg== + dependencies: + "@babel/types" "^7.12.1" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" @@ -151,6 +160,13 @@ dependencies: "@babel/types" "^7.11.0" +"@babel/helper-member-expression-to-functions@^7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz#fba0f2fcff3fba00e6ecb664bb5e6e26e2d6165c" + integrity sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ== + dependencies: + "@babel/types" "^7.12.1" + "@babel/helper-module-imports@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz#4c5c54be04bd31670a7382797d75b9fa2e5b5620" @@ -158,6 +174,13 @@ dependencies: "@babel/types" "^7.10.4" +"@babel/helper-module-imports@^7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz#1644c01591a15a2f084dd6d092d9430eb1d1216c" + integrity sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA== + dependencies: + "@babel/types" "^7.12.1" + "@babel/helper-module-transforms@^7.10.4", "@babel/helper-module-transforms@^7.10.5", "@babel/helper-module-transforms@^7.11.0": version "7.11.0" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz#b16f250229e47211abdd84b34b64737c2ab2d359" @@ -171,6 +194,21 @@ "@babel/types" "^7.11.0" lodash "^4.17.19" +"@babel/helper-module-transforms@^7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz#7954fec71f5b32c48e4b303b437c34453fd7247c" + integrity sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w== + dependencies: + "@babel/helper-module-imports" "^7.12.1" + "@babel/helper-replace-supers" "^7.12.1" + "@babel/helper-simple-access" "^7.12.1" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/helper-validator-identifier" "^7.10.4" + "@babel/template" "^7.10.4" + "@babel/traverse" "^7.12.1" + "@babel/types" "^7.12.1" + lodash "^4.17.19" + "@babel/helper-optimise-call-expression@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673" @@ -210,6 +248,16 @@ "@babel/traverse" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/helper-replace-supers@^7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz#f15c9cc897439281891e11d5ce12562ac0cf3fa9" + integrity sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.12.1" + "@babel/helper-optimise-call-expression" "^7.10.4" + "@babel/traverse" "^7.12.1" + "@babel/types" "^7.12.1" + "@babel/helper-simple-access@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz#0f5ccda2945277a2a7a2d3a821e15395edcf3461" @@ -218,6 +266,13 @@ "@babel/template" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/helper-simple-access@^7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz#32427e5aa61547d38eb1e6eaf5fd1426fdad9136" + integrity sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA== + dependencies: + "@babel/types" "^7.12.1" + "@babel/helper-skip-transparent-expression-wrappers@^7.11.0": version "7.11.0" resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.11.0.tgz#eec162f112c2f58d3af0af125e3bb57665146729" @@ -270,6 +325,11 @@ resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz#c7ff6303df71080ec7a4f5b8c003c58f1cf51037" integrity sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q== +"@babel/parser@^7.12.1": + version "7.12.3" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz#a305415ebe7a6c7023b40b5122a0662d928334cd" + integrity sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw== + "@babel/plugin-proposal-async-generator-functions@^7.10.4": version "7.10.5" resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.5.tgz#3491cabf2f7c179ab820606cec27fed15e0e8558" @@ -580,6 +640,16 @@ "@babel/helper-plugin-utils" "^7.10.4" babel-plugin-dynamic-import-node "^2.3.3" +"@babel/plugin-transform-modules-commonjs@7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.1.tgz#fa403124542636c786cf9b460a0ffbb48a86e648" + integrity sha512-dY789wq6l0uLY8py9c1B48V8mVL5gZh/+PQ5ZPrylPYsnAvnEMjqsUXkuoDVPeVK+0VyGar+D08107LzDQ6pag== + dependencies: + "@babel/helper-module-transforms" "^7.12.1" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-simple-access" "^7.12.1" + babel-plugin-dynamic-import-node "^2.3.3" + "@babel/plugin-transform-modules-commonjs@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz#66667c3eeda1ebf7896d41f1f16b17105a2fbca0" @@ -828,6 +898,21 @@ globals "^11.1.0" lodash "^4.17.19" +"@babel/traverse@^7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz#941395e0c5cc86d5d3e75caa095d3924526f0c1e" + integrity sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.12.1" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/parser" "^7.12.1" + "@babel/types" "^7.12.1" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + "@babel/types@^7.10.4", "@babel/types@^7.10.5", "@babel/types@^7.11.0", "@babel/types@^7.11.5", "@babel/types@^7.4.0", "@babel/types@^7.4.4": version "7.11.5" resolved "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz#d9de577d01252d77c6800cee039ee64faf75662d" @@ -837,6 +922,15 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.12.1": + version "7.12.1" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz#e109d9ab99a8de735be287ee3d6a9947a190c4ae" + integrity sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + "@changesets/apply-release-plan@^4.0.0": version "4.0.0" resolved "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-4.0.0.tgz#e78efb56a4e459a8dab814ba43045f2ace0f27c9"