- This project is under development and is only for test.
- All copyright reserved
- And yes the name is Fantastec, major typo!
git clone https://github.com/maminio/Fantastic-TestApp.git
- Install dependencies
brew install node watchman
- Make sure you have node version 4 or newer
- Install react-native
npm install -g react-native-cli
- Install Xcode (https://itunes.apple.com/us/app/xcode/id497799835?mt=12)
- Run the project
react-native run-ios
Fast, reliable, and secure dependency management
yarn add file:PATH_TO_YOUR_MODULE
You need to include file:
in front of the path.
Module name is derived from modules package.json
an d can differ from the folder name.
yarn add MODULE_NAME
#### Re-install module
```bash
yarn add --force MODULE_NAME
yarn remove MODULE_NAME
yarn cache clean
rm -rf node_modules && yarn cache clean && yarn install
react-native link
react-native link MODULE_NAME
react-native unlink
react-native unlink MODULE_NAME
- Install
react-native-git-upgrade
globally using
npm install -g react-native-git-upgrade
-
?? Delete node modules, then run npm install (or better yet yarn) and after everything has finished downloading, run react-native upgrade which should give you the option to replace old files with the template ones, by doing so you re-link your native dependencies in react-native which should fix your problem. Of course don't forget to clean your project in Xcode.
-
For more info please go to this website
The module provides a one-step operation to upgrade the source files with a minimum of conflicts. Under the hood, it consists in 2 phases:
- First, it computes a Git patch between both old and new template files,
- Then, the patch is applied on the user's sources.
react-native-git-upgrade
# Upgrade React Native to the latest version
# Or:
react-native-git-upgrade X.Y.Z
# Upgrade React Native to the X.Y.Z version
Copy all assets under app/assets
directory.
- You will need to run Link modules command in order to copy assets across to iOS & Android.
If successful, you should see similar output
rnpm-install info Linking assets to ios project
rnpm-install info Linking assets to android project
rnpm-install info Assets have been successfully linked to your project
- If you're packager is running, please restart it.
Once you have 2 or more components that have a common usage purposes, eq. used only on one of the scenes, or if you have a set of components that could be grouped together, create a new empty folder and move those components in there.
Everything is stored under app
root folder
- Actions There are two types of files here
constants.js
andother .js files
constants.js
is where all actions constants are definedother .js files
Each file represent a different set of actions (eq. actions defined insessions.js
reflects all actions that are used to control user session (SignIn, SignOut, SetAuthData, ValidateAuthToken, RestoreUserSession, ...)
- Assets
- Components
- Config
- Views
- Helpers
- Reducers
- Scenes
Install the library creator npm install -g react-native-create-library
.
Please find more about it here.
- Run
npm run new-module MODULE_NAME
- Navigate to
./modules/
Note that MODULE_NAME
will be the modules folder, so keep it lower case and dashed.
It will automatically add react-native-
prefix to the module package name.
Open appropriate XCode project or Android files and edit them.
Please refer to the Install local module section.
All tests are located inside __tests__
sub-folders. Each component has it's own testing folder, actions,
reducers, each have common testing folder.
To write a test, match the filename with the component/action you want to test and append -test
to the filename.
For some tests we're using manual comparisons, for others snapshots. We're mocking the build-in React Native fetch and
Mocking redux store
with redux-mock-store
.
- Testing Actions
- A simple action creator is just a function that returns an object which we're comparing to the snapshot.
- Testing Reducers
- Testing a reducer is one of the easiest parts to test from your app. Given the current state and an action, a reducer should return a new state after that action is applied.
- Testing Components
- Testing a component is just a matter of comparing it to generated snapshot. Snapshots are automatically generated first time you ran tests and are then used for comparison.
yarn test
You can run test continuously while changing the code. This will run tests every time you make a change to the code.
yarn test -- --watch
yarn test -- --coverage
yarn test -- --watch --coverage
yarn test -- -u
yarn test -- -u Button
https://github.com/jhen0409/react-native-debugger
https://github.com/jhen0409/react-native-debugger/blob/master/docs/getting-started.md
open "rndebugger://set-debugger-loc?host=localhost&port=8081"
react-native log-ios
watchman watch-del-all && rm -rf node_modules && yarn install && rm -fr $TMPDIR/react-* && npm start -- --reset-cache
w
react-native-device-log
react-native bundle --platform ios --entry-file index.ios.js --dev false --bundle-output ./ios/main.jsbundle --assets-dest ./ios --sourcemap-output ./sourcemap.js
Please contact md.aminmoradi@gmail.com for further information.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Amin Moradi - Developer - LinkedIn
This project is licensed under the Fantastec License.