Skip to content

Commit

Permalink
[v1.5.0] Bootstrap Fixes and Updates (#182)
Browse files Browse the repository at this point in the history
* Use @react-native-community/async-storage instad of rn-community for AsyncStorage. Firebase Analytics: Replaced  with . Used the latest version of . Updated  configuration for AsyncStorage handler

* Update CHANGELOG

* 1.5.0
  • Loading branch information
Santiago Fernández authored Oct 27, 2020
1 parent 627cf6d commit 7801565
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.5.0] - 2020-10-XX
- Replaced `@react-native-community/async-storage` with `@react-native-async-storage/async-storage`
- Firebase Analytics: Replaced `setCurrentScreen` with `logScreenView`
- Used the latest version of `react-native-flipper`
- Updated `Reactotron` configuration for AsyncStorage handler

## [1.4.0] - 2020-09-30

- Removed global dependency of `react-native-cli` and `reactNativeCliInstall` step.
Expand Down
5 changes: 2 additions & 3 deletions generators/app/tasks/configuringTasks/installDependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const semverRegex = require('semver-regex');
const runCommand = require('../runCommand');

const DEPENDENCIES = [
'@react-native-community/async-storage',
'@react-native-async-storage/async-storage',
'@react-native-community/masked-view',
'@react-navigation/native',
'@react-navigation/stack',
Expand All @@ -13,8 +13,7 @@ const DEPENDENCIES = [
'formik',
'i18next',
'react-native-config',
// Delete '@0.47.0' when react-native-flipper fix a build issue on Android Release mode
'react-native-flipper@0.47.0',
'react-native-flipper',
'react-native-gesture-handler',
'react-native-localize',
'react-native-reanimated',
Expand Down
2 changes: 1 addition & 1 deletion generators/app/tasks/installTasks/installPods.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const runCommand = require('../runCommand');

module.exports = function installPods() {
return runCommand({
command: ['pod', ['install'], { cwd: `${process.cwd()}/${this.projectName}/ios` }],
command: ['pod', ['install', '--repo-update'], { cwd: `${process.cwd()}/${this.projectName}/ios` }],
loadingMessage: 'Installing Pods...',
successMessage: 'Pods ready!',
failureMessage: 'Pod install failed. Turn verbose mode on for detailed logging',
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/__tests__/redux/auth/actions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { actionCreators, actions } from '@redux/auth/actions';
import api from '@config/api';

Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
'@testing-library/jest-native/extend-expect'
],
transformIgnorePatterns: [
'/node_modules/@react-native-community/async-storage/(?!(lib))',
'/node_modules/@react-native-async-storage/async-storage/(?!(lib))',
'node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|@react-native-firebase/app)'
],
moduleNameMapper: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable camelcase */
import React, { useEffect, useState } from 'react';
<%_ if(features.firebaseanalytics) { _%>
import analytics from '@react-native-firebase/analytics';
Expand All @@ -21,7 +22,7 @@ const AppNavigator = () => {
const currentRouteName = getRoute(state)?.name;
if (previousRouteName !== currentRouteName) {
<%_ if(features.firebaseanalytics) { _%>
analytics().setCurrentScreen(currentRouteName, currentRouteName);
analytics().logScreenView({ screen_class: currentRouteName, screen_name: currentRouteName });
<%_ } _%>
setRouteName(currentRouteName);
}
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/config/pushNotifications.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Config from 'react-native-config';
import PushNotification from 'react-native-push-notification';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import messaging from '@react-native-firebase/messaging';

let lastId = 0;
Expand Down
5 changes: 3 additions & 2 deletions generators/app/templates/src/config/reactotronConfig.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Immutable from 'seamless-immutable';
import Reactotron, { asyncStorage, overlay, trackGlobalErrors } from 'reactotron-react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Reactotron, { overlay, trackGlobalErrors } from 'reactotron-react-native';
import ReactotronFlipper from 'reactotron-react-native/dist/flipper';
import apisaucePlugin from 'reactotron-apisauce';
import { reactotronRedux } from 'reactotron-redux';
Expand Down Expand Up @@ -33,7 +34,7 @@ if (__DEV__) {
)
})
)
.use(asyncStorage({}))
.setAsyncStorageHandler(AsyncStorage)
.use(overlay())
.connect();

Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/redux/store.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Reactotron from 'reactotron-react-native';
import thunk from 'redux-thunk';
import { fetchMiddleware, configureMergeState } from 'redux-recompose';
<%_ if(features.reduxpersist) { _%>
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { persistReducer } from 'redux-persist';
import {
seamlessImmutableReconciler,
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/services/AuthService.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%_ if(features.loginandsignup) { _%>
import { ApiResponse } from 'apisauce';
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';
import api from '@config/api';
import { CurrentUser, AuthData, SignUpData } from '@interfaces/authInterfaces';
<%_ } _%>
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/services/OnBoardingService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

const ONBOARDING_KEY = '@OnBoarding:hasAccess';

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-wolmo-bootstrap-rn",
"version": "1.4.0",
"version": "1.5.0",
"description": "A project generator for react native applications with some boilerplates already configured and ready to use.",
"files": [
"generators"
Expand Down

0 comments on commit 7801565

Please sign in to comment.