Skip to content

Commit ebca9e6

Browse files
committed
Use the correct folders
1 parent 4c80379 commit ebca9e6

File tree

88 files changed

+12
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+12
-12
lines changed

packages/create-react-app/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var program = require('commander')
6969
})
7070
.option('--verbose', 'print additional logs')
7171
.option('--scripts-version <alternative-package>', 'use a non-standard version of react-scripts')
72-
.option('--template <variant> [app]', 'to select a template variant', 'app')
72+
.option('--template <path-to-variant>', 'to select a template variant')
7373
.on('--help', function () {
7474
console.log(' Only ' + chalk.green('<project-directory>') + ' is required.');
7575
console.log();

packages/react-scripts/.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/templates/kitchensink
1+
/fixtures

packages/react-scripts/config/paths.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ module.exports = {
8080
if (__dirname.indexOf(path.join('packages', 'react-scripts', 'config')) !== -1) {
8181
module.exports = {
8282
appBuild: resolveOwn('../../../build'),
83-
appPublic: resolveOwn('../templates/app/public'),
84-
appHtml: resolveOwn('../templates/app/public/index.html'),
85-
appIndexJs: resolveOwn('../templates/app/src/index.js'),
83+
appPublic: resolveOwn('../template/public'),
84+
appHtml: resolveOwn('../template/public/index.html'),
85+
appIndexJs: resolveOwn('../template/src/index.js'),
8686
appPackageJson: resolveOwn('../package.json'),
87-
appSrc: resolveOwn('../templates/app/src'),
88-
yarnLockFile: resolveOwn('../templates/app/yarn.lock'),
89-
testsSetup: resolveOwn('../templates/app/src/setupTests.js'),
87+
appSrc: resolveOwn('../template/src'),
88+
yarnLockFile: resolveOwn('../template/yarn.lock'),
89+
testsSetup: resolveOwn('../template/src/setupTests.js'),
9090
appNodeModules: resolveOwn('../node_modules'),
9191
ownNodeModules: resolveOwn('../node_modules'),
9292
nodePaths: nodePaths

packages/react-scripts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"bin",
1717
"config",
1818
"scripts",
19-
"templates",
19+
"template",
2020
"utils"
2121
],
2222
"bin": {

packages/react-scripts/scripts/init.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ module.exports = function(appPath, appName, verbose, originalDirectory, template
4141
}
4242

4343
// Copy the files for the user
44-
var templatePath = path.join(ownPath, 'templates', template);
44+
var templatePath = template ? path.resolve(originalDirectory, template) : path.join(ownPath, 'template');
4545
if (fs.existsSync(templatePath)) {
4646
fs.copySync(templatePath, appPath);
4747
} else {
48-
console.error('Could not locate supplied template: ' + template);
48+
console.error('Could not locate supplied template: ' + chalk.green(templatePath));
4949
return;
5050
}
5151

tasks/e2e.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ npm install $cli_path
138138

139139
# Install the app in a temporary location
140140
cd $temp_app_path
141-
create_react_app --scripts-version=$scripts_path --template=kitchensink test-app
141+
create_react_app --scripts-version=$scripts_path --template=$root_path/packages/react-scripts/fixtures/kitchensink test-app
142142

143143
# ******************************************************************************
144144
# Now that we used create-react-app to create an app depending on react-scripts,

0 commit comments

Comments
 (0)