Skip to content

Commit a2e484a

Browse files
committed
.
Summary: Test Plan: Reviewers: CC: Task ID: #
1 parent b0540e7 commit a2e484a

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

cli.js

Whitespace-only changes.

global-cli/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
var fs = require('fs');
3939
var path = require('path');
40-
var exec = require('child_process').exec;
4140
var spawn = require('child_process').spawn;
4241
var chalk = require('chalk');
4342
var semver = require('semver');

init.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1-
module.exports = function(root, appName) {
2-
console.log('Creating the app', appName, 'at', root);
1+
module.exports = function(hostPath, appName) {
2+
var selfPath = hostPath + '/node_modules/create-react-app-scripts';
3+
4+
var hostPackage = require(hostPath + '/package.json');
5+
var selfPackage = require(selfPath + '/package.json');
6+
7+
// Copy over devDependencies
8+
for (var key in selfPackage.devDependencies) {
9+
hostPackage.dependencies[key] = selfPackage.devDependencies[key];
10+
}
11+
12+
// Setup the script rules
13+
hostPackage.scripts = {};
14+
['start', 'build', 'publish-gh-pages'].forEach(function(command) {
15+
hostPackage.scripts[command] = 'node node_modules/create-react-app-scripts/' + command + '.js';
16+
});
17+
18+
fs.writeFileSync(hostPath + '/package.json', JSON.stringify(hostPackage, null, 2));
19+
20+
// Move the src folder
21+
fs.renameSync(selfPackage + '/src', hostPackage + '/src');
22+
23+
console.log('Creating the app', appName, 'at', hostPath);
324
};

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
"html-webpack-plugin": "^2.22.0",
2828
"json-loader": "^0.5.4",
2929
"postcss-loader": "^0.9.1",
30-
"react": "^15.2.1",
31-
"react-dom": "^15.2.1",
3230
"rimraf": "^2.5.3",
3331
"style-loader": "^0.13.1",
3432
"url-loader": "^0.5.7",
3533
"webpack": "^1.13.1",
3634
"webpack-dev-server": "^1.14.1"
35+
},
36+
"devDependencies": {
37+
"react": "^15.2.1",
38+
"react-dom": "^15.2.1"
3739
}
3840
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy