Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement β†’
Sign In

react-native-version-setter

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-version-setter - npm Package Compare versions

Comparing version
2.1.0
to
2.2.0
+30
build/readConfig.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.readConfig = void 0;
var _process = require("./process");
var fs = require('fs');
var readConfig = function readConfig(commandLineFlags) {
var config;
try {
config = String(fs.readFileSync('.rnvs.json'));
} catch (e) {
return {};
}
try {
config = JSON.parse(config);
commandLineFlags.debugLog.set && (0, _process.out)("Using config file.");
return config;
} catch (e) {
(0, _process.die)('Error reading .rnvs.json file.');
}
};
exports.readConfig = readConfig;
+4
-1

@@ -15,2 +15,3 @@ "use strict";

* @param platform
* @param config
* @returns Array

@@ -20,2 +21,4 @@ */

var platform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var config = arguments.length > 3 ? arguments[3] : undefined;
var iosProjectName = config.iosProjectName || packageJson.name;
var allLocations = [{

@@ -27,3 +30,3 @@ files: './android/app/build.gradle',

}, {
files: "./ios/".concat(packageJson.name, ".xcodeproj/project.pbxproj"),
files: "./ios/".concat(iosProjectName, ".xcodeproj/project.pbxproj"),
from: new RegExp('MARKETING_VERSION = [0-9, .]+', 'g'),

@@ -30,0 +33,0 @@ to: "MARKETING_VERSION = ".concat(version.core),

+6
-2

@@ -18,7 +18,11 @@ #!/usr/bin/env node

var _readConfig = require("./readConfig");
// Read package.json
var packageJson = (0, _readPackageJson.readPackageJson)() || (0, _process.die)('Could not read package.json.'); // Create and check for all CLI flags
var commandLineFlags = (0, _createCliFlags.createCliFlags)(); // Create the version object
var commandLineFlags = (0, _createCliFlags.createCliFlags)(); // Read config file
var config = (0, _readConfig.readConfig)(commandLineFlags); // Create the version object
var version = (0, _createVersion.createVersion)(process.argv[2]); // Use CLI args to determine the correct platform constant

@@ -28,3 +32,3 @@

var locations = (0, _createLocations.createLocations)(version, packageJson, platform); // If dryRun is set, just print versions
var locations = (0, _createLocations.createLocations)(version, packageJson, platform, config); // If dryRun is set, just print versions

@@ -31,0 +35,0 @@ commandLineFlags.dryRun.set && (0, _process.logDie)(version, 'No changes applied.'); // Make the file mutations

{
"name": "react-native-version-setter",
"version": "2.1.0",
"version": "2.2.0",
"description": "Update your app version with a single command.",

@@ -5,0 +5,0 @@ "homepage": "https://www.github.com/tj-mc/react-native-version-setter",

@@ -46,3 +46,3 @@ # react-native-version-setter

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 normal into android files and `package.json`.
so they are stripped out automatically. They will be inserted as normal into android files and `package.json`.

@@ -54,2 +54,18 @@ ## β›³ Flags

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

@@ -60,3 +76,3 @@ - Compatible with iOS projects using Xcode 11+

- getVersion command
- setVersion per-platform
- setVersion per-platform βœ… v2.1.0

@@ -63,0 +79,0 @@ ## πŸ‘‹ Troubleshooting