Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-cross-platform-cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cross-platform-cli - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

bin/app.js

@@ -24,3 +24,3 @@ import React from 'react';

<Text style={styles.instructions}>
To get started, edit index.&lt;platform&gt;.js
To get started, edit app.js
</Text>

@@ -27,0 +27,0 @@ <Text style={styles.instructions}>

@@ -60,23 +60,25 @@ #!/usr/bin/env node

checkForYarn(function() {
console.log('Please answer the following questions:');
console.log('');
var project = readInput();
checkForYarn(function(yarn) {
checkForReactNativeCli(function() {
console.log('Please answer the following questions:');
console.log('');
var project = readInput();
console.log('');
console.log('Initializing application...');
execSync('react-native init ' + project.project.name);
fs.writeFileSync(path.join(path.resolve('.'), project.project.name, 'package.json'), JSON.stringify(project.project, null, 2));
execSync('cd ' + project.project.name + ' && rm -r -f node_modules && yarn');
console.log('');
console.log('Initializing application...');
execSync('react-native init ' + project.project.name);
fs.writeFileSync(path.join(path.resolve('.'), project.project.name, 'package.json'), JSON.stringify(project.project, null, 2));
execSync('cd ' + project.project.name + ' && rm -r -f node_modules && ' + (yarn ? 'yarn' : 'npm install'));
console.log('Copying files...');
copyFiles(project.project.name, project.web, project.desktop);
console.log('');
console.log('Doing stuff...');
correctXcodeProject(project.project.name);
console.log('Copying files...');
copyFiles(project.project.name, project.web, project.desktop);
console.log('');
console.log('Doing stuff...');
correctXcodeProject(project.project.name);
console.log('');
console.log('We did it! Happy coding :)');
console.log('');
process.exit();
console.log('');
console.log('We did it! Happy coding :)');
console.log('');
process.exit();
});
});

@@ -88,5 +90,34 @@ }

if (stderr === '' && stdout.replace('\n', '').match(/^[0-9]+.[0-9]+.[0-9]+$/)) {
callback(true);
} else {
console.log('It seems that you don\'t have yarn installed. We recommend it as package manager as it is much faster than npm.');
console.log('');
var install = readline.question('\tDo you want to install yarn globally now? Enter Y/n: ');
console.log('');
if (install === 'y' || install === 'Y') {
installYarn(callback);
} else {
callback(false);
}
}
});
}
function installYarn(callback) {
console.log('Installing yarn...');
let response = execSync('npm install -g yarn').toString();
if (response.indexOf('npm ERR!') > -1) {
console.log('Oh no, something went wrong! Try to install yarn manually and come back later!');
process.exit();
}
console.log('Horray! You now have yarn installed.');
callback(true);
}
function checkForReactNativeCli(callback) {
require('child_process').exec('react-native --version', (error, stdout, stderr) => {
if (stderr === '' && stdout.substr(0, 17) === 'react-native-cli:') {
callback();
} else {
installYarn(callback);
installReactNativeCli(callback);
}

@@ -96,15 +127,15 @@ });

function installYarn(callback) {
console.log('It seems that you don\'t have yarn installed. You will like it, believe me!');
function installReactNativeCli(callback) {
console.log('It seems that you don\'t have react-native-cli installed. We need this to initialize your application.');
console.log('');
var install = readline.question('\tDo you want to install yarn globally now? Enter Y/n: ');
var install = readline.question('\tDo you want to install react-native-cli globally now? Enter Y/n: ');
console.log('');
if (install === 'y' || install === 'Y') {
console.log('Installing yarn...');
let response = execSync('npm install -g yarn').toString();
console.log('Installing react-native-cli...');
let response = execSync('npm install -g react-native-cli').toString();
if (response.indexOf('npm ERR!') > -1) {
console.log('Oh no, something went wrong! Try to install yarn manually and come back later!');
console.log('Oh no, something went wrong! Try to install react-native-cli manually and come back later!');
process.exit();
}
console.log('Horray! You now have yarn installed.');
console.log('Horray! You now have react-native-cli installed.');
callback();

@@ -192,3 +223,3 @@ } else {

project['main'] = 'index.desktop.js';
project['scripts']['desktop'] = 'npm run web:build && electron .';
project['scripts']['desktop'] = 'npm run web:build & electron .';
project['dependencies']['electron'] = '^1.6.11';

@@ -195,0 +226,0 @@ }

{
"name": "react-cross-platform-cli",
"version": "1.0.1",
"version": "1.0.2",
"description": "Command line interface to create a boilerplate for a cross platform react application.",

@@ -32,5 +32,4 @@ "bin": {

"minimist": "^1.2.0",
"react-native-cli": "^2.0.1",
"readline-sync": "^1.4.7"
}
}

@@ -22,4 +22,6 @@ # react-cross-platform-cli

The CLI uses `yarn` as package manager. You can either install `yarn` manually or let the CLI do this for you. (In the future this CLI shall also work using native `npm` instead of `yarn`.)
The recommended package manager is `yarn`. If you don't have it installed, you can let the CLI do it for you. If you don't want to use yarn, the CLI will go on using `npm` as package manager.
The CLI uses `react-native-cli` to initialize the application. You can either install `react-native-cli` manually or let the CLI do this for you.
## Usage

@@ -26,0 +28,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc