The following commands are available through npm run
Command | Purpose |
---|---|
dist | Transpile code into dist/ , to be checked in so the GitHub repo can be sourced directly from a package.json file |
test | Run tests |
Use guidelines in the React Native development docs to get your environment set up in your OS. For Mac OS X, that would look like:
brew install node
# if you don't already have node 8.3 or laterbrew install watchman
# watches filesystem for changesnpm install -g react-native-cli
# react-native CLI- Install XCode, probably from the App Store. Make sure it's version 9.4 or later. Also set up the XCode Command Line Tools.
- clone this repo
In the examples/Hello
subdirectory, the following script commands are available:
Command | Purpose |
---|---|
start | Start JavaScript bundler, listening on a port |
ios | Build the ios XCode project (requires XCode set up) |
android | Build the Android project |
start-with-cache-reset | Useful when after modifying JavaScript modules, something isn't resolving that you're pretty sure should be there |
clean | clean out build cache. Useful when the build isn't working and you're pretty sure it should be |
In one terminal tab:
cd examples/Hello
npm install
npm run start
This will get the JavaScript bundler running and listening for connections from a device or iOS Simulator.
In another terminal tab:
1 cd examples/Hello
react-native link react-native-svg
# to link the native components in the ios projectnpm run ios
This will build the project via XCode, launch the iOS Simulator, and when the project builds successfully, install the app into the Simulator and have it connect to the JavaScript bundler. When it's all built and loaded, it will render the view for the example app--with Font Awesome icons.
Seems like things don't always go smoothly and you have to use some hackery to get the build unjammed.
Try this:
- shutdown any instances of the bundler you have running.
npm run clean
npm run start-with-cache-reset
# from the examples/Hello directory
From another terminal tab:
npm run ios
For now, we're just using the GitHub repo as our source for development versions. This means that when you want to
test changes to the component using the example app, you'll have to push the component changes to a development branch
and then update the package.json
of the example app to pull the component from that branch.
Here's the step-by-step:
- make changes to this component
npm run dist
# to transpile via babel intodist/
git commit
# whatever changes you're trying to commitgit push origin my-dev
# to whatever topic branch you're working on, say "my-dev"- Modify
examples/Hello/package.json
and find the line that looks like this:"@fortawesome/react-native-fontawesome": "^0.0.1"
And change it to something like this:"@fortawesome/react-native-fontawesome": "https://github.com/FortAwesome/react-native-fontawesome#my-dev"
npm update
oryarn upgrade
# insist that packages be updated, in this case, that the code from the GitHub branch be pulled down into node_modules- Launch the Example App using the instructions above.
- Edit
package.json
and update the version number - Add new contributors to the
contributors
section - Update the
README.md
and add any contributors - Update the
CHANGELOG.md
npm run dist
npm run test
npm publish
npm pack
CLOUDSMITH_API_KEY=API_TOKEN cloudsmith upload npm fortawesome/fontawesome-pro ./fortawesome-react-native-fontawesome-VERSION.tgz
git add . && git commit -m 'Release VERSION'
git push
- Create a new release with
CHANGELOG
details