From dd2574f1ca4db62a01878f7cf416e37918de0ec1 Mon Sep 17 00:00:00 2001 From: James Bennett Date: Sat, 29 Apr 2017 22:58:27 -0400 Subject: [PATCH] Support for using create-react-app with Spring Boot * Modified the create-react-script to allow the generation of files with a project generated with the Spring Initializer * Customized the paths used to match Maven and Spring Boot conventions * Modified the init script which copies the template files into place so they follow the customized directory structure * Removed "static" from the paths for generated files since it would require additional Spring customization to use it * Updated Jest and its configuration so tests can be in a separate directory which matches Maven conventions --- packages/react-scripts/config/paths.js | 13 +++++++------ .../template/{src => test}/App.test.js | 0 2 files changed, 7 insertions(+), 6 deletions(-) rename packages/react-scripts/template/{src => test}/App.test.js (100%) diff --git a/packages/react-scripts/config/paths.js b/packages/react-scripts/config/paths.js index 42ec8374a15..113c51928c6 100644 --- a/packages/react-scripts/config/paths.js +++ b/packages/react-scripts/config/paths.js @@ -71,14 +71,15 @@ const resolveOwn = relativePath => path.resolve(__dirname, '..', relativePath); module.exports = { dotenv: resolveApp('.env'), appPath: resolveApp('.'), - appBuild: resolveApp('build'), - appPublic: resolveApp('public'), - appHtml: resolveApp('public/index.html'), - appIndexJs: resolveApp('src/index.js'), + appBuild: resolveApp('target/classes/static'), + appPublic: resolveApp('src/main/resources/static'), + appHtml: resolveApp('src/main/resources/index.html'), + appIndexJs: resolveApp('src/main/js/index.js'), appPackageJson: resolveApp('package.json'), - appSrc: resolveApp('src'), + appSrc: resolveApp('src/main/js'), + appTest: resolveApp('src/test/js'), yarnLockFile: resolveApp('yarn.lock'), - testsSetup: resolveApp('src/setupTests.js'), + testsSetup: resolveApp('src/test/js/setupTests.js'), appNodeModules: resolveApp('node_modules'), publicUrl: getPublicUrl(resolveApp('package.json')), servedPath: getServedPath(resolveApp('package.json')), diff --git a/packages/react-scripts/template/src/App.test.js b/packages/react-scripts/template/test/App.test.js similarity index 100% rename from packages/react-scripts/template/src/App.test.js rename to packages/react-scripts/template/test/App.test.js