generator-wolmo-bootstrap-rn
Advanced tools
Comparing version 0.6.2 to 0.7.0
@@ -5,4 +5,11 @@ # Changelog | ||
## [0.6.2] - 2020-01-29 | ||
## [0.7.0] - 2020-03-20 | ||
- Updated some bootstrap configurations, README and fixed linter problems (added Wolox CI) | ||
- Upgraded Firebase package configuration to v6 (Analytics and Push Notifications). Added Firebase Performance Monitoring as a new feature | ||
- Upgraded some libs to solve vulnerabilities | ||
- Added the automatization on fetching the `Fastlane` files from `fastlane-mobile` repo and deleted static files | ||
## [0.6.2] - 2020-02-05 | ||
- Added `@react-native-community/masked-view` and `react-native-safe-area-context` to solve the dependencies issue | ||
@@ -9,0 +16,0 @@ - Change `publicApp` default to `false` in `bitriseInfo.json` |
const apisauce = require('apisauce'); | ||
const baseURL = 'https://api.bitbucket.org/2.0'; | ||
@@ -11,3 +12,3 @@ | ||
if (!response.ok) { | ||
console.log(response.data) | ||
console.log(response.data); | ||
} | ||
@@ -14,0 +15,0 @@ }); |
const apisauce = require('apisauce'); | ||
const baseURL = 'https://api.bitrise.io/v0.1'; | ||
@@ -11,3 +12,3 @@ | ||
if (!response.ok) { | ||
console.log(response.data) | ||
console.log(response.data); | ||
} | ||
@@ -14,0 +15,0 @@ }); |
@@ -12,7 +12,6 @@ const apisauce = require('apisauce'); | ||
if (!response.ok) { | ||
console.log(response.data) | ||
console.log(response.data); | ||
} | ||
}); | ||
module.exports = githubApi; |
const apisauce = require('apisauce'); | ||
const baseURL = 'https://gitlab.com/api/v4'; | ||
@@ -11,3 +12,3 @@ | ||
if (!response.ok) { | ||
console.log(response.data) | ||
console.log(response.data); | ||
} | ||
@@ -14,0 +15,0 @@ }); |
module.exports.PUSH_NOTIFICATIONS_SETUP_LINK = | ||
'https://facebook.github.io/react-native/docs/pushnotificationios.html'; | ||
'https://github.com/react-native-community/react-native-push-notification-ios'; | ||
@@ -4,0 +4,0 @@ module.exports.BITRISE_PROMPTS = { |
@@ -26,3 +26,2 @@ /* eslint-disable id-length */ | ||
module.exports.APP = `${module.exports.APP_PATH}/index.js`; | ||
module.exports.FASTLANE_EV = `${module.exports.IOS_PATH}/fastlane/config/.env`; | ||
@@ -96,11 +95,3 @@ // TESTING - MOCKS | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_PATH = `${module.exports.CUSTOM_TEXT_INPUT_PATH}/assets`; | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY = `${module.exports.CUSTOM_TEXT_INPUT_ASSETS_PATH}/ic_visibility.png`; | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_2X = `${module.exports.CUSTOM_TEXT_INPUT_ASSETS_PATH}/ic_visibility@2x.png`; | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_3X = `${module.exports.CUSTOM_TEXT_INPUT_ASSETS_PATH}/ic_visibility@3x.png`; | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF = `${module.exports.CUSTOM_TEXT_INPUT_ASSETS_PATH}/ic_visibility_off.png`; | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF_2X = `${module.exports.CUSTOM_TEXT_INPUT_ASSETS_PATH}/ic_visibility_off@2x.png`; | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF_3X = `${module.exports.CUSTOM_TEXT_INPUT_ASSETS_PATH}/ic_visibility_off@3x.png`; | ||
module.exports.CUSTOM_TEXT_INPUT_SHOW_PASSWORD_PATH = `${module.exports.CUSTOM_TEXT_INPUT_PATH}/components/ShowPassword`; | ||
module.exports.CUSTOM_TEXT_INPUT_SHOW_PASSWORD = `${module.exports.CUSTOM_TEXT_INPUT_SHOW_PASSWORD_PATH}/index.js`; | ||
module.exports.CUSTOM_TEXT_INPUT_SHOW_PASSWORD_STYLES = `${module.exports.CUSTOM_TEXT_INPUT_SHOW_PASSWORD_PATH}/styles.js`; | ||
module.exports.CTI_SHOW_PASSWORD_PATH = `${module.exports.CUSTOM_TEXT_INPUT_PATH}/components/ShowPassword`; | ||
@@ -120,6 +111,2 @@ // COMPONENTS - CUSTOM TEXT | ||
// REDUX - PUSH NOTIFICATIONS | ||
module.exports.PUSH_NOTIFICATIONS_REDUCER = `${module.exports.REDUX_PATH}/pushNotifications/reducer.js`; | ||
module.exports.PUSH_NOTIFICATIONS_ACTIONS = `${module.exports.REDUX_PATH}/pushNotifications/actions.js`; | ||
// REDUX - AUTH | ||
@@ -133,3 +120,2 @@ module.exports.AUTH_REDUCER = `${module.exports.REDUX_PATH}/auth/reducer.js`; | ||
// SERVICES | ||
module.exports.PUSH_NOTIFICATIONS_SERVICE = `${module.exports.SERVICES_PATH}/PushNotificationsService.js`; | ||
module.exports.AUTH_SERVICE = `${module.exports.SERVICES_PATH}/AuthService.js`; | ||
@@ -139,3 +125,2 @@ | ||
module.exports.PUSH_NOTIFICATIONS_CONFIG = `${module.exports.CONFIG_PATH}/pushNotifications.js`; | ||
module.exports.HUAWEI_DEVICES_CONFIG = `${module.exports.CONFIG_PATH}/huaweiPushNotifications.js`; | ||
module.exports.API_CONFIG = `${module.exports.CONFIG_PATH}/api.js`; | ||
@@ -142,0 +127,0 @@ module.exports.CONFIG = `${module.exports.CONFIG_PATH}/index.js`; |
@@ -12,2 +12,3 @@ const Generator = require('yeoman-generator'); | ||
const configurePods = require('./tasks/configurePods'); | ||
const configureFastlane = require('./tasks/configureFastlane'); | ||
const installPods = require('./tasks/installPods'); | ||
@@ -49,6 +50,7 @@ const linkAppAssets = require('./tasks/linkAppAssets'); | ||
'Drawer', | ||
'Redux Persist', | ||
'Firebase Analytics', | ||
'Crashlytics', | ||
'Firebase Performance', | ||
'Push Notifications', | ||
'Google Analytics', | ||
'Redux Persist', | ||
'Bitrise' | ||
@@ -91,2 +93,3 @@ ], | ||
.then(() => installDependencies.bind(this)()) | ||
.then(() => configureFastlane.bind(this)()) | ||
.then(() => configurePods.bind(this)()); | ||
@@ -93,0 +96,0 @@ } |
@@ -19,10 +19,4 @@ const { copyFile, copyTemplateFile } = require('../../utils'); | ||
CUSTOM_TEXT_INPUT_STYLES, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_2X, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_3X, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF_2X, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF_3X, | ||
CUSTOM_TEXT_INPUT_SHOW_PASSWORD, | ||
CUSTOM_TEXT_INPUT_SHOW_PASSWORD_STYLES, | ||
CUSTOM_TEXT_INPUT_ASSETS_PATH, | ||
CTI_SHOW_PASSWORD_PATH, | ||
LOADABLE, | ||
@@ -53,3 +47,2 @@ LOADABLE_STYLES, | ||
IOS_PATH, | ||
FASTLANE_EV, | ||
ASYNC_STORAGE_MOCK, | ||
@@ -77,10 +70,4 @@ I18NEXT_MOCK, | ||
CUSTOM_TEXT_INPUT_STYLES, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_2X, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_3X, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF_2X, | ||
CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_OFF_3X, | ||
CUSTOM_TEXT_INPUT_SHOW_PASSWORD, | ||
CUSTOM_TEXT_INPUT_SHOW_PASSWORD_STYLES, | ||
CUSTOM_TEXT_INPUT_ASSETS_PATH, | ||
CTI_SHOW_PASSWORD_PATH, | ||
LOADABLE, | ||
@@ -102,3 +89,2 @@ LOADABLE_STYLES, | ||
IOS_PATH, | ||
FASTLANE_EV, | ||
ASYNC_STORAGE_MOCK, | ||
@@ -105,0 +91,0 @@ I18NEXT_MOCK, |
@@ -1,2 +0,1 @@ | ||
/* eslint-disable complexity */ | ||
const ora = require('ora'); | ||
@@ -14,5 +13,6 @@ | ||
const pushNotificationsFeatureFiles = require('./pushNotificationsFeatureFiles'); | ||
const pushNotificationsSetup = require('./pushNotificationsSetup'); | ||
const firebaseCoreFeatureFiles = require('./firebaseCoreFeatureFiles'); | ||
const crashlyticsFeatureFiles = require('./crashlyticsFeatureFiles'); | ||
const googleAnalyticsFeatureFiles = require('./googleAnalyticsFeatureFiles'); | ||
const firebaseAnalyticsFeatureFiles = require('./firebaseAnalyticsFeatureFiles'); | ||
const loginFeatureFiles = require('./loginFeatureFiles'); | ||
@@ -25,3 +25,5 @@ const bitriseFeatureFiles = require('./bitriseFeatureFiles'); | ||
const splashScreenSetup = require('./splashScreenSetup'); | ||
const firebasePerformanceSetup = require('./firebasePerformanceSetup'); | ||
// eslint-disable-next-line max-statements | ||
module.exports = function index() { | ||
@@ -77,3 +79,8 @@ const spinner = ora({ | ||
// ---------------- Features: Firebase ---------------- | ||
if (this.features.crashlytics || this.features.googleanalytics || this.features.pushnotifications) { | ||
if ( | ||
this.features.crashlytics || | ||
this.features.firebaseanalytics || | ||
this.features.pushnotifications || | ||
this.features.firebaseperformance | ||
) { | ||
firebaseCoreFeatureFiles.bind(this)(); | ||
@@ -84,9 +91,14 @@ | ||
} | ||
if (this.features.googleanalytics) { | ||
googleAnalyticsFeatureFiles.bind(this)(); | ||
if (this.features.firebaseanalytics) { | ||
firebaseAnalyticsFeatureFiles.bind(this)(); | ||
} | ||
if (this.features.pushnotifications) { | ||
pushNotificationsFeatureFiles.bind(this)(); | ||
pushNotificationsSetup.bind(this)(); | ||
} | ||
if (this.features.firebaseperformance) { | ||
firebasePerformanceSetup.bind(this)(); | ||
} | ||
installPods.bind(this)(); | ||
@@ -93,0 +105,0 @@ } |
const { copyFile } = require('../../utils'); | ||
const { | ||
PUSH_NOTIFICATIONS_REDUCER, | ||
PUSH_NOTIFICATIONS_ACTIONS, | ||
PUSH_NOTIFICATIONS_SERVICE, | ||
PUSH_NOTIFICATIONS_CONFIG, | ||
HUAWEI_DEVICES_CONFIG | ||
} = require('../../files'); | ||
const { PUSH_NOTIFICATIONS_CONFIG } = require('../../files'); | ||
const FILES = [ | ||
PUSH_NOTIFICATIONS_REDUCER, | ||
PUSH_NOTIFICATIONS_ACTIONS, | ||
PUSH_NOTIFICATIONS_SERVICE, | ||
PUSH_NOTIFICATIONS_CONFIG, | ||
HUAWEI_DEVICES_CONFIG | ||
]; | ||
const FILES = [PUSH_NOTIFICATIONS_CONFIG]; | ||
@@ -18,0 +6,0 @@ module.exports = function pushNotificationsFeatureFiles() { |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable camelcase */ | ||
const bitriseApi = require('../apis/bitriseApiConfig'); | ||
@@ -45,2 +46,3 @@ const githubApi = require('../apis/githubApiConfig'); | ||
auth_ssh_public_key: publicSshKey, | ||
// eslint-disable-next-line id-length | ||
is_register_key_into_provider_service: false | ||
@@ -47,0 +49,0 @@ }); |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable max-nested-callbacks */ | ||
const runCommand = require('./runCommand'); | ||
@@ -30,6 +31,5 @@ | ||
} | ||
// eslint-disable-next-line consistent-return | ||
]).then(({ pushToRepo }) => { | ||
if (!pushToRepo) { | ||
spinner.succeed('git ready'); | ||
} else { | ||
if (pushToRepo) { | ||
// ask for the repository url | ||
@@ -69,2 +69,3 @@ return this.prompt([ | ||
} | ||
spinner.succeed('git ready'); | ||
}); | ||
@@ -71,0 +72,0 @@ }) |
@@ -1,2 +0,1 @@ | ||
/* eslint-disable complexity */ | ||
const latestSemver = require('latest-semver'); | ||
@@ -119,3 +118,3 @@ const semverRegex = require('semver-regex'); | ||
if (this.features.crashlytics || this.features.googleanalytics || this.features.pushnotifications) { | ||
if (this.features.crashlytics || this.features.firebaseanalytics || this.features.pushnotifications) { | ||
DEPENDENCIES.push('@react-native-firebase/app'); | ||
@@ -128,6 +127,4 @@ } | ||
if (this.features.googleanalytics) { | ||
DEPENDENCIES.push('react-native-google-analytics-bridge'); | ||
DEPENDENCIES.push('redux-beacon'); | ||
DEPENDENCIES.push('@redux-beacon/react-native-google-analytics'); | ||
if (this.features.firebaseanalytics) { | ||
DEPENDENCIES.push('@react-native-firebase/analytics'); | ||
} | ||
@@ -137,5 +134,11 @@ | ||
DEPENDENCIES.push('react-native-push-notification'); | ||
DEPENDENCIES.push('react-native-huawei-protected-apps'); | ||
DEPENDENCIES.push('@react-native-firebase/messaging'); | ||
DEPENDENCIES.push('@types/react-native-push-notification'); | ||
DEPENDENCIES.push('@react-native-community/push-notification-ios'); | ||
} | ||
if (this.features.firebaseperformance) { | ||
DEPENDENCIES.push('@react-native-firebase/perf'); | ||
} | ||
if (this.features.drawer) { | ||
@@ -142,0 +145,0 @@ DEPENDENCIES.push('react-navigation-drawer'); |
require('colors'); | ||
const spawn = require('child_process').spawn; | ||
const { spawn } = require('child_process'); | ||
@@ -8,3 +8,3 @@ const ora = require('ora'); | ||
/** | ||
* Receives only one argument which is an object of options: | ||
* @param {obj} options Receives only one argument which is an object of options: | ||
* - (mandatory) command {array}: list of paramaters to send to child_process.spawn | ||
@@ -17,3 +17,3 @@ * - loadingMessage {string}: Message shown while the command is running | ||
* | ||
* Returns a promise that resolves to the loading spinner if the loading message is present | ||
* @returns {Promise} Returns a promise that resolves to the loading spinner if the loading message is present | ||
*/ | ||
@@ -28,4 +28,6 @@ module.exports = function runCommand(options) { | ||
// eslint-disable-next-line init-declarations | ||
let killTimeout; | ||
let processKilled; | ||
let processKilled = false; | ||
function killProcess() { | ||
@@ -52,3 +54,3 @@ command.kill(); | ||
if (options.context && options.context.verbose) { | ||
console.log(data.toString()); // eslint-disable-line no-console | ||
console.log(data.toString()); | ||
} | ||
@@ -64,3 +66,3 @@ } | ||
const msg = data.toString(); | ||
console.log(/warning/.test(msg) ? msg.yellow : msg.red); // eslint-disable-line no-console | ||
console.log(/warning/.test(msg) ? msg.yellow : msg.red); | ||
} | ||
@@ -67,0 +69,0 @@ }); |
@@ -8,18 +8,16 @@ let cache = {}; | ||
setItem: (key, value) => | ||
new Promise( | ||
(resolve, reject) => | ||
typeof key !== 'string' || typeof value !== 'string' | ||
? reject(new Error('key and value must be string')) | ||
: resolve((cache[key] = value)) | ||
new Promise((resolve, reject) => | ||
typeof key !== 'string' || typeof value !== 'string' | ||
? reject(new Error('key and value must be string')) | ||
: resolve((cache[key] = value)) | ||
), | ||
getItem: key => | ||
new Promise( | ||
resolve => (Object.prototype.hasOwnProperty.call(cache, key) ? resolve(cache[key]) : resolve(null)) | ||
new Promise(resolve => | ||
Object.prototype.hasOwnProperty.call(cache, key) ? resolve(cache[key]) : resolve(null) | ||
), | ||
removeItem: key => | ||
new Promise( | ||
(resolve, reject) => | ||
Object.prototype.hasOwnProperty.call(cache, key) | ||
? resolve(delete cache[key]) | ||
: reject(new Error('No such key!')) | ||
new Promise((resolve, reject) => | ||
Object.prototype.hasOwnProperty.call(cache, key) | ||
? resolve(delete cache[key]) | ||
: reject(new Error('No such key!')) | ||
), | ||
@@ -26,0 +24,0 @@ clear: () => new Promise(resolve => resolve((cache = {}))), |
import AsyncStorage from '@react-native-community/async-storage'; | ||
import { actionCreators, actions } from '@redux/auth/actions'; | ||
@@ -4,0 +3,0 @@ import api from '@config/api'; |
@@ -11,3 +11,3 @@ import { actions } from '@redux/auth/actions'; | ||
}; | ||
expect(authReducer(undefined, action)).toEqual({ | ||
await expect(authReducer(undefined, action)).toEqual({ | ||
...initialState, | ||
@@ -23,3 +23,3 @@ initialLoading: false, | ||
}; | ||
expect(authReducer(undefined, action)).toEqual({ | ||
await expect(authReducer(undefined, action)).toEqual({ | ||
...initialState, | ||
@@ -26,0 +26,0 @@ currentUserLoading: false, |
@@ -9,3 +9,2 @@ import React, { useEffect } from 'react'; | ||
import { getCurrentRouteName } from '@utils/navUtils'; | ||
import Navigator from '@screens'; | ||
@@ -16,3 +15,3 @@ | ||
const AppNavigator = () => { | ||
const state = useSelector(state => state.nav); | ||
const state = useSelector(store => store.nav); | ||
const dispatch = useDispatch(); | ||
@@ -19,0 +18,0 @@ const statusBarProps = statusBarStyles[getCurrentRouteName(state)] || statusBarStyles.default; |
@@ -37,3 +37,2 @@ import React, { useCallback, memo } from 'react'; | ||
return ( | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
<Text {...textProps} style={[styles.base, customStyles(), style]}> | ||
@@ -40,0 +39,0 @@ {children} |
@@ -13,3 +13,3 @@ import Reactotron from 'reactotron-react-native'; | ||
export const apiSetup = dispatch => { // eslint-disable-line no-unused-vars, prettier/prettier | ||
export const apiSetup = dispatch => { | ||
if (baseURL === 'http://wolox.com') { | ||
@@ -16,0 +16,0 @@ console.warn('API baseURL has not been properly initialized'); |
@@ -1,52 +0,76 @@ | ||
let PushNotification; | ||
try { | ||
PushNotification = require('react-native-push-notification'); // eslint-disable-line global-require | ||
} catch (e) {} // eslint-disable-line no-empty, prettier/prettier | ||
import Config from 'react-native-config'; | ||
import PushNotification from 'react-native-push-notification'; | ||
import AsyncStorage from '@react-native-community/async-storage'; | ||
import messaging from '@react-native-firebase/messaging'; | ||
import { actionCreators as notificationActions } from '@redux/pushNotifications/actions'; // eslint-disable-line import/first | ||
let lastId = 0; | ||
const senderId = Config.NOTIFICATIONS_SENDER_ID; | ||
const formatReceivedNotification = push => { | ||
if (push.alert && push.alert.APNS_SANDBOX) { | ||
push.alert = JSON.parse(push.alert.APNS_SANDBOX).aps.alert; | ||
export const getFirebaseToken = async () => { | ||
let fcmToken = await AsyncStorage.getItem('fcmToken'); | ||
if (!fcmToken) { | ||
fcmToken = await messaging().getToken(); | ||
if (fcmToken) await AsyncStorage.setItem('fcmToken', fcmToken); | ||
} | ||
if (push.message && push.message.APNS_SANDBOX) { | ||
push.message = JSON.parse(push.message.APNS_SANDBOX).aps.message; | ||
} | ||
return push; | ||
return fcmToken; | ||
}; | ||
export default function setUp(dispatch, isLoggedIn) { | ||
const senderID = ''; | ||
export const deleteFirebaseToken = async () => { | ||
await AsyncStorage.removeItem('fcmToken'); | ||
}; | ||
if (!senderID) { | ||
console.warn('Push notifications senderID has not been set. Make sure to setup your google project'); | ||
} | ||
if (PushNotification) { | ||
PushNotification.configure({ | ||
onRegister(data) { | ||
dispatch(notificationActions.register(data.token)); | ||
if (isLoggedIn) { | ||
dispatch(notificationActions.updateToken()); | ||
} | ||
}, | ||
onNotification(notification) { | ||
dispatch(notificationActions.notificationReceived(formatReceivedNotification(notification))); | ||
}, | ||
senderID, | ||
permissions: { | ||
alert: true, | ||
badge: true, | ||
sound: true | ||
}, | ||
popInitialNotification: true, | ||
requestPermissions: true | ||
export const requestPermission = () => | ||
messaging() | ||
.requestPermission() | ||
.then(() => { | ||
getFirebaseToken(); | ||
}) | ||
.catch(() => { | ||
// TODO: add a better handler for permissions rejection | ||
console.log('Error with permissions'); | ||
}); | ||
console.warn( | ||
'If PushNotificationIOS has already been linked, remove the unnecessary checks in src/config/pushNotifications.js' | ||
); | ||
} else { | ||
console.warn( | ||
'PushNotificationIOS has not been linked and will not work. Read more here: https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking' | ||
); | ||
} | ||
} | ||
export const checkPermission = async () => { | ||
const enabled = await messaging().hasPermission(); | ||
if (enabled) getFirebaseToken(); | ||
else requestPermission(); | ||
}; | ||
export const registerAppWithFCM = async () => { | ||
await messaging().registerForRemoteNotifications(); | ||
checkPermission(); | ||
}; | ||
export const configPushNotifications = () => { | ||
PushNotification.configure({ | ||
onRegister: async token => { | ||
if (token) await AsyncStorage.setItem('gcmToken', JSON.stringify(token)); | ||
}, | ||
senderID: senderId, | ||
permissions: { | ||
alert: true, | ||
badge: true, | ||
sound: true | ||
}, | ||
popInitialNotification: true, | ||
requestPermissions: true | ||
}); | ||
}; | ||
// TODO this make us able to send notifications locally | ||
export const setLocalNotifications = () => { | ||
lastId++; | ||
PushNotification.localNotification({ | ||
id: `${lastId}`, | ||
autoCancel: true, | ||
vibration: 100, | ||
ongoing: false, | ||
title: 'Local Notification', | ||
message: 'Local Notification message', | ||
playSound: false, | ||
soundName: 'default', | ||
actions: '["Yes", "No"]' | ||
}); | ||
}; | ||
export const checkNotificationPermission = cbk => PushNotification.checkPermissions(cbk); |
@@ -1,3 +0,2 @@ | ||
import { blue, white, gray } from './colors'; | ||
import { isIos } from './platform'; | ||
import { blue, white } from './colors'; | ||
@@ -4,0 +3,0 @@ const statusBarConfig = { |
@@ -22,2 +22,4 @@ import { createReducer, completeReducer, completeState, onSuccess } from 'redux-recompose'; | ||
}; | ||
// eslint-disable-next-line new-cap | ||
export default createReducer(Immutable(initialState), completeReducer(reducerDescription)); | ||
@@ -24,0 +26,0 @@ |
@@ -1,46 +0,28 @@ | ||
import Config from 'react-native-config'; | ||
import { NavigationActions, StackActions } from 'react-navigation'; | ||
import { GoogleAnalyticsTracker } from 'react-native-google-analytics-bridge'; | ||
import GoogleAnalytics from '@redux-beacon/react-native-google-analytics'; | ||
import { createMiddleware } from 'redux-beacon'; | ||
import analytics from '@react-native-firebase/analytics'; | ||
import { getPreviousRouteName } from '@utils/navUtils'; | ||
const trackingId = Config.ANALYTICS_TRACKING_ID; | ||
const PAGE_VIEW = 'pageview'; | ||
const trackNavigation = routeName => { | ||
if (routeName) analytics().setCurrentScreen(routeName, routeName); | ||
}; | ||
export const checkAnalyticsTrackingID = () => { | ||
if (!trackingId) { | ||
console.warn('Google Analytics Tracking ID has not been properly initialized'); | ||
const eventsTrackingMiddleware = getState => next => action => { | ||
switch (action.type) { | ||
case NavigationActions.NAVIGATE: | ||
case StackActions.REPLACE: | ||
trackNavigation(action.routeName); | ||
break; | ||
case NavigationActions.BACK: | ||
trackNavigation(getPreviousRouteName(getState().nav)); | ||
break; | ||
case StackActions.RESET: | ||
trackNavigation(action.actions[action.index].routeName); | ||
break; | ||
default: | ||
break; | ||
} | ||
return next(action); | ||
// TODO: Add other actions | ||
}; | ||
const target = GoogleAnalytics(trackingId, GoogleAnalyticsTracker); | ||
const pageView = action => ({ hitType: PAGE_VIEW, page: action.routeName }); | ||
const backNavigationView = (action, prevState) => ({ | ||
hitType: PAGE_VIEW, | ||
page: getPreviousRouteName(prevState.nav) | ||
}); | ||
const eventsMap = { | ||
[NavigationActions.NAVIGATE]: pageView, | ||
[NavigationActions.BACK]: backNavigationView, | ||
[StackActions.RESET]: action => pageView(action.actions[0]) | ||
// TODO: Replace with anothers actions. | ||
// For search the possible actions, check this: https://developers.google.com/analytics/devguides/collection/analyticsjs/events | ||
// These actions are by way of example. | ||
/* | ||
'@@redux-form/SET_SUBMIT_SUCCEEDED': () => ({ | ||
hitType: 'event', | ||
eventCategory: 'button-click', | ||
eventAction: 'Login Submit' | ||
}), | ||
'@@redux-form/DESTROY': () => ({ | ||
hitType: 'event', | ||
eventCategory: 'action', | ||
eventAction: 'Login Success' | ||
}) | ||
*/ | ||
}; | ||
export default createMiddleware(eventsMap, target); | ||
export default eventsTrackingMiddleware; |
@@ -23,3 +23,3 @@ import { appScreensNavOptions } from '@config/navigation'; | ||
export function inferRoute(screenObj) { | ||
const screenName = Routes[(Object.keys(screenObj)?.[0])]; | ||
const screenName = Routes[Object.keys(screenObj)?.[0]]; | ||
return ( | ||
@@ -26,0 +26,0 @@ screenName && { |
{ | ||
"name": "generator-wolmo-bootstrap-rn", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"description": "A project generator for react native applications with some boilerplates already configured and ready to use.", | ||
@@ -28,6 +28,10 @@ "files": [ | ||
"dependencies": { | ||
"acorn": "^7.1.1", | ||
"apisauce": "^1.1.1", | ||
"colors": "^1.1.2", | ||
"deep-extend": "0.5.1", | ||
"diff": "3.5.0", | ||
"fs": "0.0.1-security", | ||
"latest-semver": "^1.0.0", | ||
"minimist": "^1.2.5", | ||
"ora": "^1.1.0", | ||
@@ -38,21 +42,22 @@ "semver-regex": "^1.0.0", | ||
"devDependencies": { | ||
"@babel/core": "^7.5.5", | ||
"@babel/core": "^7.7.4", | ||
"@babel/runtime": "^7.7.4", | ||
"babel-eslint": "^10.0.3", | ||
"eslint": "^6.3.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb": "^18.0.1", | ||
"eslint-config-prettier": "^6.2.0", | ||
"eslint-config-wolox": "^3.0.0", | ||
"eslint-config-wolox-react": "^1.1.0", | ||
"eslint-config-prettier": "^6.7.0", | ||
"eslint-config-wolox-react-native": "^1.0.1", | ||
"eslint-plugin-babel": "^5.3.0", | ||
"eslint-plugin-flowtype": "^4.3.0", | ||
"eslint-plugin-eslint-comments": "^3.1.2", | ||
"eslint-plugin-flowtype": "^4.5.2", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jest": "^22.15.2", | ||
"eslint-plugin-jest": "^23.1.1", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"eslint-plugin-react": "^7.14.3", | ||
"eslint-plugin-react-hooks": "^2.0.1", | ||
"eslint-plugin-react-native": "^3.7.0", | ||
"husky": "^3.0.5", | ||
"prettier": "^1.18.2", | ||
"prettier-eslint": "^9.0.0" | ||
"eslint-plugin-react-native": "^3.8.1", | ||
"husky": "^3.1.0", | ||
"prettier": "^1.19.1", | ||
"prettier-eslint": "^9.0.1" | ||
}, | ||
@@ -59,0 +64,0 @@ "husky": { |
@@ -28,4 +28,4 @@ # Wolmo Bootstrap: React Native | ||
- Login | ||
- Tabs | ||
- Login | ||
- Drawer | ||
@@ -35,2 +35,3 @@ - Redux Persist | ||
- Firebase Crashlytics | ||
- Firebase Performance | ||
- Firebase Push Notifications | ||
@@ -50,2 +51,3 @@ - Bitrise | ||
- [Analytics Tracking](/generators/app/templates/src/redux/middlewares/analyticsMiddleware.js) | ||
- [Push Notifications configuration](/generators/app/templates/src/config/pushNotifications.js) | ||
- [Splash Screen](/generators/app/tasks/appSetup/splashScreenSetup.js) | ||
@@ -68,2 +70,3 @@ - [Font Customization](/generators/app/templates/src/config/fonts.js) | ||
- [Bitrise](https://devcenter.bitrise.io/) | ||
- [React Native Firebase](https://invertase.io/oss/react-native-firebase) | ||
@@ -134,3 +137,3 @@ ### Tooling | ||
Copyright © 2018. WOLOX. All rights reserved. <hello@wolox.co> | ||
Copyright © 2020. WOLOX. All rights reserved. <hello@wolox.co> | ||
@@ -137,0 +140,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152
1749748
11
20
152
3049
+ Addedacorn@^7.1.1
+ Addeddeep-extend@0.5.1
+ Addeddiff@3.5.0
+ Addedminimist@^1.2.5
+ Addedacorn@7.4.1(transitive)
+ Addeddeep-extend@0.5.1(transitive)
+ Addeddiff@3.5.0(transitive)