diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/core/application/ReactCoreApplicationService.java b/src/main/java/tech/jhipster/lite/generator/client/react/core/application/ReactCoreApplicationService.java index 773ea2d1743..c9438980ebe 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/react/core/application/ReactCoreApplicationService.java +++ b/src/main/java/tech/jhipster/lite/generator/client/react/core/application/ReactCoreApplicationService.java @@ -14,7 +14,7 @@ public ReactCoreApplicationService() { factory = new ReactCoreModulesFactory(); } - public JHipsterModule buildModuleWithStyle(JHipsterModuleProperties properties) { - return factory.buildModuleWithStyle(properties); + public JHipsterModule buildModule(JHipsterModuleProperties properties) { + return factory.buildModule(properties); } } diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java b/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java index 528a0253bf1..83d5bb9b546 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java @@ -27,7 +27,7 @@ public class ReactCoreModulesFactory { private static final String TEST_PRIMARY = "src/test/javascript/spec/common/primary/app"; - public JHipsterModule buildModuleWithStyle(JHipsterModuleProperties properties) { + public JHipsterModule buildModule(JHipsterModuleProperties properties) { //@formatter:off return ClientsModulesFactory.clientModuleBuilder(properties) .packageJson() @@ -71,7 +71,7 @@ public JHipsterModule buildModuleWithStyle(JHipsterModuleProperties properties) .add(WEBAPP_SOURCE.template("index.html"), WEBAPP_DESTINATION.append("index.html")) .add(SOURCE.append(TEST_PRIMARY).template("App.spec.tsx"), to(TEST_PRIMARY).append("App.spec.tsx")) .add(WEBAPP_SOURCE.template("config/setupTests.ts"), WEBAPP_DESTINATION.append("config/setupTests.ts")) - .add(PRIMARY_APP_SOURCE.template("StyledApp.tsx"), PRIMARY_APP_DESTINATION.append("App.tsx")) + .add(PRIMARY_APP_SOURCE.template("App.tsx"), PRIMARY_APP_DESTINATION.append("App.tsx")) .add(PRIMARY_APP_SOURCE.template("App.css"), PRIMARY_APP_DESTINATION.append("App.css")) .batch(WEBAPP_SOURCE.append(CONTENT_IMAGES), WEBAPP_DESTINATION.append(CONTENT_IMAGES)) .addFile("JHipster-Lite-neon-blue.png") diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/core/infrastructure/primary/ReactCoreModulesConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/react/core/infrastructure/primary/ReactCoreModulesConfiguration.java index 136dc26a674..fc6b551dbc7 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/react/core/infrastructure/primary/ReactCoreModulesConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/react/core/infrastructure/primary/ReactCoreModulesConfiguration.java @@ -14,7 +14,7 @@ class ReactCoreModulesConfiguration { public static final String REACT = "react"; @Bean - JHipsterModuleResource styledReactCoreModule(ReactCoreApplicationService react) { + JHipsterModuleResource reactCoreModule(ReactCoreApplicationService react) { return JHipsterModuleResource .builder() .slug("react-core") @@ -22,7 +22,7 @@ JHipsterModuleResource styledReactCoreModule(ReactCoreApplicationService react) .apiDoc(new JHipsterModuleApiDoc("React", "Add React+Vite with minimal CSS")) .organization(JHipsterModuleOrganization.builder().feature("client-core").addModuleDependency("init").build()) .tags("client", REACT) - .factory(react::buildModuleWithStyle); + .factory(react::buildModule); } private JHipsterModulePropertiesDefinition properties() { diff --git a/src/main/java/tech/jhipster/lite/generator/client/svelte/core/domain/SvelteModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/svelte/core/domain/SvelteModuleFactory.java index 6141a009d47..8818fb46032 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/svelte/core/domain/SvelteModuleFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/client/svelte/core/domain/SvelteModuleFactory.java @@ -83,7 +83,7 @@ public JHipsterModule buildSvelteModule(JHipsterModuleProperties properties) { .add(SOURCE.file("jest.config.cjs"), to("jest.config.cjs")) .add(SOURCE.file("vite.config.js"), to("vite.config.js")) .add(SOURCE.append("src/main/webapp/routes").template("+page.svelte"), to("src/main/webapp/routes/+page.svelte")) - .add(PRIMARY_MAIN_SOURCE.template("StyledApp.svelte"), PRIMARY_MAIN_DESTINATION.append("App.svelte")) + .add(PRIMARY_MAIN_SOURCE.template("App.svelte"), PRIMARY_MAIN_DESTINATION.append("App.svelte")) .add(PRIMARY_TEST_SOURCE.template("App.spec.ts"), PRIMARY_TEST_DESTINATION.append("App.spec.ts")) .move(path(".lintstagedrc.js"), to(".lintstagedrc.cjs")) .batch(SOURCE.file("src/main/webapp"), to("src/main/webapp")) diff --git a/src/main/resources/generator/client/react/src/main/webapp/app/common/primary/app/StyledApp.tsx.mustache b/src/main/resources/generator/client/react/src/main/webapp/app/common/primary/app/App.tsx.mustache similarity index 100% rename from src/main/resources/generator/client/react/src/main/webapp/app/common/primary/app/StyledApp.tsx.mustache rename to src/main/resources/generator/client/react/src/main/webapp/app/common/primary/app/App.tsx.mustache diff --git a/src/main/resources/generator/client/svelte/src/main/webapp/app/common/primary/app/StyledApp.svelte.mustache b/src/main/resources/generator/client/svelte/src/main/webapp/app/common/primary/app/App.svelte.mustache similarity index 100% rename from src/main/resources/generator/client/svelte/src/main/webapp/app/common/primary/app/StyledApp.svelte.mustache rename to src/main/resources/generator/client/svelte/src/main/webapp/app/common/primary/app/App.svelte.mustache diff --git a/src/test/features/react-jwt.feature b/src/test/features/react-jwt.feature index f6ecb10e796..898a0eef358 100644 --- a/src/test/features/react-jwt.feature +++ b/src/test/features/react-jwt.feature @@ -1,6 +1,6 @@ Feature: React JWT - Scenario: Should apply react jwt module to styled react + Scenario: Should apply react jwt module to react When I apply modules to default project | init | | react-core | diff --git a/src/test/features/react.feature b/src/test/features/react.feature index 22aaa4c2d0d..40f06698928 100644 --- a/src/test/features/react.feature +++ b/src/test/features/react.feature @@ -1,8 +1,7 @@ Feature: React modules - Scenario: Should apply styled react module - When I apply "react-core" module to default project with package json + Scenario: Should apply react module + When I apply "react-core" module to default project with package json | baseName | jhipster | Then I should have files in "src/main/webapp/app/common/primary/app" | App.tsx | - \ No newline at end of file diff --git a/src/test/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.java index 43fe8ad6033..46bd0cd8427 100644 --- a/src/test/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.java @@ -15,7 +15,7 @@ class ReactCoreModulesFactoryTest { @Test void shouldBuildModuleWithStyle() { - JHipsterModule module = factory.buildModuleWithStyle( + JHipsterModule module = factory.buildModule( JHipsterModulesFixture.propertiesBuilder(TestFileUtils.tmpDirForTest()).projectBaseName("jhipster").build() ); diff --git a/src/test/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactoryTest.java index 596cf20ca06..f6e834a5c82 100644 --- a/src/test/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactoryTest.java @@ -17,23 +17,10 @@ class ReactJwtModuleFactoryTest { private static final ReactJwtModuleFactory factory = new ReactJwtModuleFactory(); @Test - void shouldBuildModuleOnNotStyledApp() { + void shouldBuildModule() { JHipsterModule module = factory.buildModule(properties()); - ModuleAsserter asserter = assertThatModuleWithFiles(module, packageJsonFile(), notStyledApp()); - - assertReactApp(asserter); - } - - private ModuleFile notStyledApp() { - return file("src/test/resources/projects/react-app/App.tsx", APP_TSX); - } - - @Test - void shouldBuildModuleOnStyledApp() { - JHipsterModule module = factory.buildModule(properties()); - - ModuleAsserter asserter = assertThatModuleWithFiles(module, packageJsonFile(), styledApp(), appCss()); + ModuleAsserter asserter = assertThatModuleWithFiles(module, packageJsonFile(), app(), appCss()); assertReactApp(asserter); asserter @@ -49,8 +36,8 @@ void shouldBuildModuleOnStyledApp() { ); } - private ModuleFile styledApp() { - return file("src/test/resources/projects/react-app/StyledApp.tsx", APP_TSX); + private ModuleFile app() { + return file("src/test/resources/projects/react-app/App.tsx", APP_TSX); } private ModuleFile appCss() { diff --git a/src/test/resources/projects/react-app/App.tsx b/src/test/resources/projects/react-app/App.tsx index 81ac8a1a3e0..1208d958eee 100644 --- a/src/test/resources/projects/react-app/App.tsx +++ b/src/test/resources/projects/react-app/App.tsx @@ -1,5 +1,37 @@ +import './App.css'; + function App() { - return
Myapp
; + return ( +
+
+ React logo +
+ JHipster logo +

React + TypeScript + Vite

+

+ Recommended IDE setup:  + + VSCode + +

+ +

+ + Vite Documentation + +  |  + + React Documentation + +

+ +

+ Edit  + src/main/webapp/app/common/primary/app/App.tsx to test hot module replacement. +

+
+
+ ); } export default App; diff --git a/src/test/resources/projects/react-app/StyledApp.tsx b/src/test/resources/projects/react-app/StyledApp.tsx deleted file mode 100644 index 1208d958eee..00000000000 --- a/src/test/resources/projects/react-app/StyledApp.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import './App.css'; - -function App() { - return ( -
-
- React logo -
- JHipster logo -

React + TypeScript + Vite

-

- Recommended IDE setup:  - - VSCode - -

- -

- - Vite Documentation - -  |  - - React Documentation - -

- -

- Edit  - src/main/webapp/app/common/primary/app/App.tsx to test hot module replacement. -

-
-
- ); -} - -export default App;