react-native-rename
Advanced tools
Comparing version
@@ -14,3 +14,3 @@ 'use strict'; | ||
return ['ios/' + nS_CurrentAppName, 'ios/' + nS_CurrentAppName + '-tvOS', 'ios/' + nS_CurrentAppName + '-tvOSTests', 'ios/' + nS_CurrentAppName + '.xcodeproj', 'ios/' + nS_NewName + '.xcodeproj/xcshareddata/xcschemes/' + nS_CurrentAppName + '-tvOS.xcscheme', 'ios/' + nS_NewName + '.xcodeproj/xcshareddata/xcschemes/' + nS_CurrentAppName + '.xcscheme', 'ios/' + nS_CurrentAppName + 'Tests', 'ios/' + nS_NewName + 'Tests/' + nS_CurrentAppName + 'Tests.m', 'ios/' + nS_CurrentAppName + '.xcworkspace', 'ios/' + nS_NewName + '/' + nS_CurrentAppName + '.entitlements']; | ||
return ['ios/' + nS_CurrentAppName, 'ios/' + nS_CurrentAppName + '-tvOS', 'ios/' + nS_CurrentAppName + '-tvOSTests', 'ios/' + nS_CurrentAppName + '.xcodeproj', 'ios/' + nS_NewName + '.xcodeproj/xcshareddata/xcschemes/' + nS_CurrentAppName + '-tvOS.xcscheme', 'ios/' + nS_NewName + '.xcodeproj/xcshareddata/xcschemes/' + nS_CurrentAppName + '.xcscheme', 'ios/' + nS_CurrentAppName + 'Tests', 'ios/' + nS_NewName + 'Tests/' + nS_CurrentAppName + 'Tests.m', 'ios/' + nS_CurrentAppName + '.xcworkspace', 'ios/' + nS_NewName + '/' + nS_CurrentAppName + '.entitlements', 'ios/' + nS_CurrentAppName + '-Bridging-Header.h']; | ||
} |
@@ -120,5 +120,10 @@ #!/usr/bin/env node | ||
readFile(_path2.default.join(__dirname, 'android/app/src/main/res/values/strings.xml')).then(function (data) { | ||
var $ = _cheerio2.default.load(data); | ||
var currentAppName = $('string[name=app_name]').text(); | ||
var loadAppConfig = function loadAppConfig() { | ||
return readFile(_path2.default.join(__dirname, 'app.json')).then(function (data) { | ||
return JSON.parse(data); | ||
}); | ||
}; | ||
loadAppConfig().then(function (appConfig) { | ||
var currentAppName = appConfig.name; | ||
var nS_CurrentAppName = currentAppName.replace(/\s/g, ''); | ||
@@ -139,3 +144,9 @@ var lC_Ns_CurrentAppName = nS_CurrentAppName.toLowerCase(); | ||
var id = bundleID.split('.'); | ||
if (id.length < 2) return console.log('Invalid Bundle Identifier. Add something like "com.travelapp" or "com.junedomingo.travelapp"'); | ||
var validBundleID = /^([A-Za-z]([0-9A-Z_a-z])*\.)+[A-Za-z]([0-9A-Z_a-z])*$/; | ||
if (id.length < 2) { | ||
return console.log('Invalid Bundle Identifier. Add something like "com.travelapp" or "com.junedomingo.travelapp"'); | ||
} | ||
if (!validBundleID.test(bundleID)) { | ||
return console.log('Invalid Bundle Identifier. It must have at least two segments (one or more dots). Each segment must start with a letter. All characters must be alphanumeric or an underscore [a-zA-Z0-9_]'); | ||
} | ||
} | ||
@@ -142,0 +153,0 @@ |
{ | ||
"name": "react-native-rename", | ||
"version": "2.4.1", | ||
"version": "2.5.0", | ||
"description": "Rename react-native app with just one command", | ||
@@ -49,3 +49,3 @@ "main": "lib/index.js", | ||
"node-replace": "^0.3.3", | ||
"shelljs": "^0.7.7" | ||
"shelljs": "^0.8.4" | ||
}, | ||
@@ -52,0 +52,0 @@ "babel": { |
@@ -11,35 +11,38 @@ # react-native-rename [](https://www.npmjs.com/package/react-native-rename) [](https://npm-stat.com/charts.html?package=react-native-rename) [](https://npm-stat.com/charts.html?package=react-native-rename) [](https://www.paypal.me/junedomingo) | ||
#### Installation | ||
### Usage | ||
``` | ||
yarn global add react-native-rename | ||
or | ||
npm install react-native-rename -g | ||
$ npx react-native-rename <newName> | ||
``` | ||
Switch to new branch first | ||
> better to have back-up | ||
> With custom Bundle Identifier (Android only. For iOS, please use Xcode) | ||
``` | ||
git checkout -b rename-app | ||
$ npx react-native-rename <newName> -b <bundleIdentifier> | ||
``` | ||
#### Usage | ||
### Example | ||
##### First, Switch to new branch (optional but recommended) | ||
``` | ||
react-native-rename <newName> | ||
$ git checkout -b rename-app | ||
``` | ||
> With custom Bundle Identifier (Android only. For iOS, please use Xcode) | ||
##### Then, Rename your app | ||
``` | ||
react-native-rename <newName> -b <bundleIdentifier> | ||
$ npx react-native-rename "Travel App" | ||
``` | ||
> With custom Bundle Identifier | ||
``` | ||
$ npx react-native-rename "Travel App" -b com.junedomingo.travelapp | ||
``` | ||
#### Example | ||
### Local installation | ||
With **Yarn**: | ||
``` | ||
react-native-rename "Travel App" | ||
$ yarn global add react-native-rename | ||
``` | ||
> With custom Bundle Identifier | ||
With **npm**: | ||
``` | ||
react-native-rename "Travel App" -b com.junedomingo.travelapp | ||
$ npm install react-native-rename -g | ||
``` | ||
### Support | ||
<a href="https://www.buymeacoffee.com/junedomingo"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" target="_blank"></a> |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
244358
61.12%5882
1381.61%48
6.67%2
Infinity%+ Added
- Removed
Updated