# @andrioid/react-native-version-setter

> Update your app version with a single command.

Latest version **2.2.0** (published 2021-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @andrioid/react-native-version-setter
pnpm add @andrioid/react-native-version-setter
yarn add @andrioid/react-native-version-setter
bun add @andrioid/react-native-version-setter
```

Provides the command `setVersion`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2021-02-17 |
| First published | 2020-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 37.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tom McIntosh |
| Maintainers | andrioid |
| Keywords | version, setVersion, javascript, react-native, setter, react, semver, rn-version, react-native-versioning, rnvs, react-native-version-setter |

## Links

- npm: https://www.npmjs.com/package/@andrioid/react-native-version-setter
- Homepage: https://www.github.com/tj-mc/react-native-version-setter
- npm.io page: https://npm.io/package/@andrioid/react-native-version-setter

## Dependencies (1)

- [replace-in-file](https://npm.io/package/replace-in-file.md) 6.1.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2021-02-17
- 2.0.4 — 2020-11-11
- 2.0.3 — 2020-11-11
- 2.0.2 — 2020-11-11
- 2.0.1 — 2020-11-11
- 2.0.0 — 2020-11-11
- 1.7.2 — 2020-11-10
- 1.7.1 — 2020-11-10

## README

# react-native-version-setter
![](./rnvs.png)

![licence](https://img.shields.io/npm/l/react-native-version-setter?style=flat-square)
![NPM Version](https://img.shields.io/npm/v/react-native-version-setter?style=flat-square)
![download](https://img.shields.io/npm/dt/react-native-version-setter?style=flat-square)
![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-gree?&style=flat-square)

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"
```

## 🌐 Install
npm: ```npm i react-native-version-setter```

yarn: ```yarn add react-native-version-setter```

## 🚀 Usage
Simply call `npm run setVersion` or `yarn run setVersion` 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
RNVS does not impose restrictions on versioning style. 
Feel free set your version numbers in whatever format works for you. For example, Date-based versioning:
```
$: npm run setVersion 1.20200909.1
[RNVS] MyApp: 1.0.0: ==> 1.20200909.1 ✅ 
```

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.

---
_Source: https://npm.io/package/@andrioid/react-native-version-setter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
