create-react-app
Advanced tools
Comparing version 1.0.3 to 1.0.4
30
index.js
@@ -55,3 +55,4 @@ #!/usr/bin/env node | ||
var fs = require('fs'); | ||
var commander = require('commander'); | ||
var fs = require('fs-extra'); | ||
var path = require('path'); | ||
@@ -61,7 +62,6 @@ var execSync = require('child_process').execSync; | ||
var semver = require('semver'); | ||
var pathExists = require('path-exists'); | ||
var projectName; | ||
var program = require('commander') | ||
var program = commander | ||
.version(require('./package.json').version) | ||
@@ -75,2 +75,3 @@ .arguments('<project-directory>') | ||
.option('--scripts-version <alternative-package>', 'use a non-standard version of react-scripts') | ||
.allowUnknownOption() | ||
.on('--help', function () { | ||
@@ -89,3 +90,3 @@ console.log(' Only ' + chalk.green('<project-directory>') + ' is required.'); | ||
}) | ||
.parse(process.argv) | ||
.parse(process.argv); | ||
@@ -103,5 +104,10 @@ if (typeof projectName === 'undefined') { | ||
createApp(projectName, program.verbose, program.scriptsVersion); | ||
var hiddenProgram = new commander.Command() | ||
.option('--internal-testing-template <path-to-template>', '(internal usage only, DO NOT RELY ON THIS) ' + | ||
'use a non-standard application template') | ||
.parse(process.argv) | ||
function createApp(name, verbose, version) { | ||
createApp(projectName, program.verbose, program.scriptsVersion, hiddenProgram.internalTestingTemplate); | ||
function createApp(name, verbose, version, template) { | ||
var root = path.resolve(name); | ||
@@ -111,6 +117,4 @@ var appName = path.basename(root); | ||
checkAppName(appName); | ||
if (!pathExists.sync(name)) { | ||
fs.mkdirSync(root); | ||
} else if (!isSafeToCreateProjectIn(root)) { | ||
fs.ensureDirSync(name); | ||
if (!isSafeToCreateProjectIn(root)) { | ||
console.log('The directory ' + chalk.green(name) + ' contains files that could conflict.'); | ||
@@ -142,3 +146,3 @@ console.log('Try using a new directory name.'); | ||
run(root, appName, version, verbose, originalDirectory); | ||
run(root, appName, version, verbose, originalDirectory, template); | ||
} | ||
@@ -176,3 +180,3 @@ | ||
function run(root, appName, version, verbose, originalDirectory) { | ||
function run(root, appName, version, verbose, originalDirectory, template) { | ||
var packageToInstall = getInstallPackage(version); | ||
@@ -197,3 +201,3 @@ var packageName = getPackageName(packageToInstall); | ||
var init = require(scriptsPath); | ||
init(root, appName, verbose, originalDirectory); | ||
init(root, appName, verbose, originalDirectory, template); | ||
}); | ||
@@ -200,0 +204,0 @@ } |
{ | ||
"name": "create-react-app", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"keywords": [ | ||
@@ -26,5 +26,5 @@ "react" | ||
"cross-spawn": "^4.0.0", | ||
"path-exists": "^2.1.0", | ||
"fs-extra": "^1.0.0", | ||
"semver": "^5.0.3" | ||
} | ||
} |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
10393
250
2
+ Addedfs-extra@^1.0.0
+ Addedfs-extra@1.0.0(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedjsonfile@2.4.0(transitive)
+ Addedklaw@1.3.1(transitive)
- Removedpath-exists@^2.1.0
- Removedpath-exists@2.1.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)