From b3eb8caf283949a8672fb0ebbe5b67cab12f0b45 Mon Sep 17 00:00:00 2001 From: Shubheksha Jalan Date: Mon, 26 Sep 2016 00:14:37 +0530 Subject: [PATCH 1/3] Forked react-scripts should retain the binary name --- packages/react-scripts/scripts/eject.js | 5 ++--- packages/react-scripts/scripts/init.js | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index c0c498d12df..48b53e6c331 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -95,9 +95,8 @@ prompt( Object.keys(appPackage.scripts).forEach(function (key) { appPackage.scripts[key] = appPackage.scripts[key] .replace( - new RegExp(ownPackageName + ' (\\w+)', 'g'), - 'node scripts/$1.js' - ); + new RegExp(/react-scripts (\w+)/g, 'node scripts/$1.js' + )); }); // Add Jest config diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index 222902a7413..cbefd413c29 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -24,10 +24,10 @@ module.exports = function(appPath, appName, verbose, originalDirectory) { // Setup the script rules appPackage.scripts = { - 'start': ownPackageName + ' start', - 'build': ownPackageName + ' build', - 'test': ownPackageName + ' test --env=jsdom', - 'eject': ownPackageName + ' eject' + 'start': 'react-scripts start', + 'build': 'react-scripts build', + 'test': 'react-scripts test --env=jsdom', + 'eject': 'react-scripts eject' }; fs.writeFileSync( From ed89982b090e3d019a63b3853b6c49edc3c865be Mon Sep 17 00:00:00 2001 From: Shubheksha Jalan Date: Mon, 26 Sep 2016 03:11:18 +0530 Subject: [PATCH 2/3] Forked react-scripts should retain the binary name -- fixed issue with regex --- packages/react-scripts/scripts/eject.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 48b53e6c331..8acbcf03b0c 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -94,9 +94,8 @@ prompt( delete appPackage.scripts['eject']; Object.keys(appPackage.scripts).forEach(function (key) { appPackage.scripts[key] = appPackage.scripts[key] - .replace( - new RegExp(/react-scripts (\w+)/g, 'node scripts/$1.js' - )); + .replace(/react-scripts (\w+)/g, 'node scripts/$1.js' + ); }); // Add Jest config From 447c162bf76b6ea92dc812eb3c822530b32a9dd8 Mon Sep 17 00:00:00 2001 From: Shubheksha Jalan Date: Mon, 26 Sep 2016 03:31:26 +0530 Subject: [PATCH 3/3] Forked react-scripts should retain the binary name -- fixed style nit --- packages/react-scripts/scripts/eject.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 8acbcf03b0c..9eb6d4fd44c 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -94,8 +94,7 @@ prompt( delete appPackage.scripts['eject']; Object.keys(appPackage.scripts).forEach(function (key) { appPackage.scripts[key] = appPackage.scripts[key] - .replace(/react-scripts (\w+)/g, 'node scripts/$1.js' - ); + .replace(/react-scripts (\w+)/g, 'node scripts/$1.js'); }); // Add Jest config