react-native-semver-update
v1.1.7
Published
Automaticly updates a project version and build number for react-native
Downloads
32
Maintainers
Readme
React Native Semver Update
Automaticly updates a project version and build number in:
- package.json
- iOS
- Android
Install
Install global package by:
npm i -g react-native-semver-update
Usage
Change Version by Manual Control
- Write commmand in terminal and press [enter]:
rnsemup
- Choose what do you need from menu.
Auto Increase by cli
Build Number:
rnsemup -b
Project Version:
rnsemup -u <unit>
where unit
is:
major
1.2.3 → 2.0.0minor
1.2.3 → 1.3.0patch
1.2.3 → 1.2.4
For example:
rnsemup -b -u minor
- Increase build number
- Increase minor in project version
- Set patch is 0
How it works
- It find files in current directory by defined paths array (see paths.js)
PACKAGE: resolve(CURRENT_DIRECTORY_PATH, './package.json'),
ANDROID: resolve(CURRENT_DIRECTORY_PATH, './android/app/build.gradle'),
IOS: resolve(CURRENT_DIRECTORY_PATH, './ios/<YOUR PROJECT NAME FROM app.json>.xcodeproj/project.pbxproj'),
- Find & replace versions by regular expressions (see searchPatterns.js)
Android
- versionName
- versionCode
iOS
- MARKETING_VERSION
- CURRENT_PROJECT_VERSION
- Display previous and new versions in terminal
Support
- react-native 0.60+
Why?
- I just tired to change build number by manual. Maybe you too...
- https://semver.org/