Skip to content

Commit

Permalink
Move commons into /app (#2486)
Browse files Browse the repository at this point in the history
* stash

* move commons into the app
  • Loading branch information
iljadaderko authored Aug 14, 2019
1 parent 800ee77 commit b40d44c
Show file tree
Hide file tree
Showing 122 changed files with 242 additions and 453 deletions.
5 changes: 2 additions & 3 deletions packages/admob/lib/AdsConsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*
*/

import { NativeModules } from 'react-native';
import {
hasOwnProperty,
isArray,
Expand All @@ -24,8 +23,8 @@ import {
isString,
isUndefined,
isValidUrl,
} from '@react-native-firebase/common';

} from '@react-native-firebase/app/lib/common';
import { NativeModules } from 'react-native';
import AdsConsentDebugGeography from './AdsConsentDebugGeography';
import AdsConsentStatus from './AdsConsentStatus';

Expand Down
3 changes: 1 addition & 2 deletions packages/admob/lib/ads/InterstitialAd.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*
*/

import { isFunction, isString } from '@react-native-firebase/common';
import { isFunction, isString } from '@react-native-firebase/app/lib/common';
import { getFirebaseRoot } from '@react-native-firebase/app/lib/internal';
import validateAdRequestOptions from '../validateAdRequestOptions';
import validateAdShowOptions from '../validateAdShowOptions';

import MobileAd from './MobileAd';

let _interstitialRequest = 0;
Expand Down
5 changes: 2 additions & 3 deletions packages/admob/lib/ads/RewardedAd.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
*
*/

import { isFunction, isString } from '@react-native-firebase/common';
import { isFunction, isString } from '@react-native-firebase/app/lib/common';
import { getFirebaseRoot } from '@react-native-firebase/app/lib/internal';
import validateAdRequestOptions from '../validateAdRequestOptions';

import MobileAd from './MobileAd';
import validateAdShowOptions from '../validateAdShowOptions';
import MobileAd from './MobileAd';

let _rewardedRequest = 0;

Expand Down
11 changes: 3 additions & 8 deletions packages/admob/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@ import {
FirebaseModule,
getFirebaseRoot,
} from '@react-native-firebase/app/lib/internal';

import version from './version';
import AdEventType from './AdEventType';
import AdsConsentDebugGeography from './AdsConsentDebugGeography';
import AdsConsentStatus from './AdsConsentStatus';
import MaxAdContentRating from './MaxAdContentRating';
import TestIds from './TestIds';

import AdEventType from './AdEventType';
import RewardedAdEventType from './RewardedAdEventType';

import TestIds from './TestIds';
import validateAdRequestConfiguration from './validateAdRequestConfiguration';
import version from './version';

const statics = {
AdsConsentDebugGeography,
Expand Down Expand Up @@ -101,9 +98,7 @@ export MaxAdContentRating from './MaxAdContentRating';
export TestIds from './TestIds';
export AdEventType from './AdEventType';
export RewardedAdEventType from './RewardedAdEventType';

export AdsConsent from './AdsConsent';

export InterstitialAd from './ads/InterstitialAd';
export RewardedAd from './ads/RewardedAd';
export BannerAd from './ads/BannerAd';
3 changes: 1 addition & 2 deletions packages/admob/lib/validateAdRequestConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*
*/

import { hasOwnProperty, isBoolean, isObject, isUndefined } from '@react-native-firebase/common';

import { hasOwnProperty, isBoolean, isObject } from '@react-native-firebase/app/lib/common';
import MaxAdContentRating from './MaxAdContentRating';

export default function validateAdRequestConfiguration(requestConfiguration) {
Expand Down
2 changes: 1 addition & 1 deletion packages/admob/lib/validateAdRequestOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
isString,
isUndefined,
isValidUrl,
} from '@react-native-firebase/common';
} from '@react-native-firebase/app/lib/common';

export default function validateAdRequestOptions(options) {
const out = {};
Expand Down
7 changes: 6 additions & 1 deletion packages/admob/lib/validateAdShowOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
*
*/

import { hasOwnProperty, isBoolean, isObject, isUndefined } from '@react-native-firebase/common';
import {
hasOwnProperty,
isBoolean,
isObject,
isUndefined,
} from '@react-native-firebase/app/lib/common';

export default function validateAdShowOptions(options) {
const out = {};
Expand Down
3 changes: 1 addition & 2 deletions packages/admob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"@react-native-firebase/app": "*"
},
"dependencies": {
"@react-native-firebase/app-types": "0.2.3",
"@react-native-firebase/common": "0.2.3"
"@react-native-firebase/app-types": "0.2.3"
},
"gitHead": "889bf5379c8ce5257b33fb3ad1ac9c905fe26fff",
"publishConfig": {
Expand Down
1 change: 0 additions & 1 deletion packages/analytics/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

import { ReactNativeFirebase } from '@react-native-firebase/app';
import { Invites } from '@react-native-firebase/invites';

/**
* Firebase Analytics package for React Native.
Expand Down
13 changes: 6 additions & 7 deletions packages/analytics/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@
*
*/

import {
createModuleNamespace,
FirebaseModule,
getFirebaseRoot,
} from '@react-native-firebase/app/lib/internal';
import {
isAlphaNumericUnderscore,
isNull,
isObject,
isOneOf,
isString,
isUndefined,
} from '@react-native-firebase/common';

} from '@react-native-firebase/app/lib/common';
import {
createModuleNamespace,
FirebaseModule,
getFirebaseRoot,
} from '@react-native-firebase/app/lib/internal';
import version from './version';

const ReservedEventNames = [
Expand Down
3 changes: 1 addition & 2 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"@react-native-firebase/app": "*"
},
"dependencies": {
"@react-native-firebase/app-types": "0.2.3",
"@react-native-firebase/common": "0.2.3"
"@react-native-firebase/app-types": "0.2.3"
},
"gitHead": "889bf5379c8ce5257b33fb3ad1ac9c905fe26fff",
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
/**
* window.btoa
*/
function btoa(input): string {
function btoa(input) {
let map;
let i = 0;
let block = 0;
Expand Down Expand Up @@ -52,7 +52,7 @@ function btoa(input): string {
/**
* window.atob
*/
function atob(input): string {
function atob(input) {
let i = 0;
let bc = 0;
let bs = 0;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
*
*/
import { Platform } from 'react-native';
import { isString } from './validate';
import Base64 from './Base64';
import { isString } from './validate';

export * from './id';
export * from './path';
export * from './validate';
export * from './promise';
export * from './validate';

export Base64 from './Base64';
export ReferenceBase from './ReferenceBase';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/app/lib/internal/FirebaseModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

import { getNativeModule, getAppModule } from './registry/nativeModule';
import { getAppModule, getNativeModule } from './registry/nativeModule';
import SharedEventEmitter from './SharedEventEmitter';

let firebaseJson = null;
Expand Down
2 changes: 1 addition & 1 deletion packages/app/lib/internal/RNFBNativeEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

import { NativeModules, NativeEventEmitter } from 'react-native';
import { NativeEventEmitter, NativeModules } from 'react-native';

const { RNFBAppModule } = NativeModules;

Expand Down
6 changes: 3 additions & 3 deletions packages/app/lib/internal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*
*/

export { default as FirebaseApp } from '../FirebaseApp';
export * from './constants';
export { default as FirebaseModule } from './FirebaseModule';
export { default as NativeFirebaseError } from './NativeFirebaseError';
export * from './registry/app';
export * from './registry/namespace';
export * from './registry/nativeModule';
export { default as FirebaseApp } from '../FirebaseApp';
export { default as FirebaseModule } from './FirebaseModule';
export { default as SharedEventEmitter } from './SharedEventEmitter';
export { default as NativeFirebaseError } from './NativeFirebaseError';
5 changes: 2 additions & 3 deletions packages/app/lib/internal/registry/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*
*/

import { isObject, isNull, isString, isUndefined } from '@react-native-firebase/common';

import { isNull, isObject, isString, isUndefined } from '@react-native-firebase/app/lib/common';
import FirebaseApp from '../../FirebaseApp';
import { getAppModule } from './nativeModule';
import { DEFAULT_APP_NAME } from '../constants';
import { getAppModule } from './nativeModule';

const APP_REGISTRY = {};
let onAppCreateFn = null;
Expand Down
7 changes: 3 additions & 4 deletions packages/app/lib/internal/registry/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
*
*/

import { isString } from '@react-native-firebase/common';

import SDK_VERSION from '../../version';
import { isString } from '@react-native-firebase/app/lib/common';
import FirebaseApp from '../../FirebaseApp';
import SDK_VERSION from '../../version';
import { DEFAULT_APP_NAME, KNOWN_NAMESPACES } from '../constants';
import FirebaseModule from '../FirebaseModule';
import { getApp, getApps, initializeApp, setOnAppCreate, setOnAppDestroy } from './app';
import { KNOWN_NAMESPACES, DEFAULT_APP_NAME } from '../constants';

// firebase.X
let FIREBASE_ROOT = null;
Expand Down
3 changes: 1 addition & 2 deletions packages/app/lib/internal/registry/nativeModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
*/

import { NativeModules, Platform } from 'react-native';

import { APP_NATIVE_MODULE } from '../constants';
import SharedEventEmitter from '../SharedEventEmitter';
import NativeFirebaseError from '../NativeFirebaseError';
import RNFBNativeEventEmitter from '../RNFBNativeEventEmitter';
import SharedEventEmitter from '../SharedEventEmitter';

const NATIVE_MODULE_REGISTRY = {};
const NATIVE_MODULE_EVENT_SUBSCRIPTIONS = {};
Expand Down
1 change: 0 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
},
"dependencies": {
"@react-native-firebase/app-types": "0.2.3",
"@react-native-firebase/common": "0.2.3",
"opencollective-postinstall": "^2.0.1"
},
"collective": {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/lib/PhoneAuthListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

import { promiseDefer, isFunction, isAndroid, isIOS } from '@react-native-firebase/common';
import { isAndroid, isFunction, isIOS, promiseDefer } from '@react-native-firebase/app/lib/common';

let REQUEST_ID = 0;

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/lib/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

import { isAndroid, isIOS } from '@react-native-firebase/common';
import { isAndroid, isIOS } from '@react-native-firebase/app/lib/common';

export default class Settings {
constructor(auth) {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/lib/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

import { isObject, isString } from '@react-native-firebase/common';
import { isObject, isString } from '@react-native-firebase/app/lib/common';

export default class User {
constructor(auth, user) {
Expand Down
17 changes: 7 additions & 10 deletions packages/auth/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,24 @@
*
*/

import { isAndroid, isBoolean } from '@react-native-firebase/app/lib/common';
import {
createModuleNamespace,
FirebaseModule,
getFirebaseRoot,
} from '@react-native-firebase/app/lib/internal';

import { isAndroid, isBoolean } from '@react-native-firebase/common';

import ConfirmationResult from './ConfirmationResult';
import PhoneAuthListener from './PhoneAuthListener';
import EmailAuthProvider from './providers/EmailAuthProvider';
import PhoneAuthProvider from './providers/PhoneAuthProvider';
import GoogleAuthProvider from './providers/GoogleAuthProvider';
import FacebookAuthProvider from './providers/FacebookAuthProvider';
import GithubAuthProvider from './providers/GithubAuthProvider';
import GoogleAuthProvider from './providers/GoogleAuthProvider';
import OAuthProvider from './providers/OAuthProvider';
import PhoneAuthProvider from './providers/PhoneAuthProvider';
import TwitterAuthProvider from './providers/TwitterAuthProvider';
import FacebookAuthProvider from './providers/FacebookAuthProvider';

import Settings from './Settings';
import User from './User';
import version from './version';
import Settings from './Settings';
import PhoneAuthListener from './PhoneAuthListener';
import ConfirmationResult from './ConfirmationResult';

const statics = {
EmailAuthProvider,
Expand Down
3 changes: 1 addition & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"@react-native-firebase/app": "*"
},
"dependencies": {
"@react-native-firebase/app-types": "0.2.3",
"@react-native-firebase/common": "0.2.3"
"@react-native-firebase/app-types": "0.2.3"
},
"gitHead": "889bf5379c8ce5257b33fb3ad1ac9c905fe26fff",
"publishConfig": {
Expand Down
Loading

0 comments on commit b40d44c

Please sign in to comment.