https://github.com/tj-mc/react-native-version-setter
Update your app version with a single command.
https://github.com/tj-mc/react-native-version-setter
Last synced: about 2 months ago
JSON representation
Update your app version with a single command.
- Host: GitHub
- URL: https://github.com/tj-mc/react-native-version-setter
- Owner: tj-mc
- License: mit
- Created: 2020-09-13T05:12:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-25T08:13:23.000Z (over 3 years ago)
- Last Synced: 2025-03-27T19:44:56.009Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# react-native-version-setter



The simplest way to update your app version.
Will auto update the following files:
```
android/app/build.gradle versionName
android/app/build.gradle versionCode
ios/{projectName}.xcodeproj/project.pbxproj MARKETING_VERSION
package.json "version"
```## π Usage
Simply call `npx react-native-version-setter [version]` in your project root.```
$: npm run setVersion 1.2.0
[RNVS] MyApp: 1.0.0: ==> 1.2.0 β$: npm run setVersion 1.2.0
[RNVS] Version is already 1.2.0 π
```## π©βπ» Freeform Versioning
In most cases it makes sense to use conventional [semantic versioning.](https://semver.org/spec/v2.0.0.html)From version 2, RNVS has full support for extended semVer syntax, like `1.2.3-alpha`. These symbols are not supported on iOS,
so they are stripped out automatically. They will be inserted as normal into android files and `package.json`.## β³ Flags
`-d`: Runs with debug logging.`-r`: Prepares version strings, but logs to console instead of writing to file.
`-android`: Set version for android only
`-ios`: Set version for iOS only
## βοΈ Config
In most cases you won't need any config at all, but creating a `.rnvs.json` file in your project root will expose some extra options. Below are all accepted properties with example values.
```
{
// RNVS uses the project name
// in package.json by default,
// But your ios project name might differ.
"iosProjectName": "MyApp"
}
```## π» Compatibility
- Compatible with iOS projects using Xcode 11+## πΊοΈ Roadmap
- getVersion command
- setVersion per-platform β v2.1.0## π Troubleshooting
#### Version setting not working on new project
Ensure you have opened the generated `.xcodeproj` file at least once. On the first opening, Xcode will create the
`MARKETING_VERSION` field that holds your app version. Prioed to this, there is nowhere to store the iOS version.#### Need Help?
If you're after a new feature that isn't listed on the roadmap, or you're having trouble with this package, please open an issue.