diff --git a/src/main/java/tech/jhipster/lite/generator/client/vite/react/core/domain/ViteReactDomainService.java b/src/main/java/tech/jhipster/lite/generator/client/vite/react/core/domain/ViteReactDomainService.java index 440e5c7d63a..d4978a333c5 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/vite/react/core/domain/ViteReactDomainService.java +++ b/src/main/java/tech/jhipster/lite/generator/client/vite/react/core/domain/ViteReactDomainService.java @@ -89,15 +89,11 @@ public void addViteReactUnstyledFiles(Project project) { } public void addViteReactStyledFiles(Project project) { + String imagesPath = "src/main/webapp/content/images"; projectRepository.template(project, getPath(SOURCE, SOURCE_APP), "StyledApp.css", SOURCE_APP, "App.css"); projectRepository.template(project, getPath(SOURCE, SOURCE_APP), "StyledApp.tsx", SOURCE_APP, "App.tsx"); - projectRepository.add(project, getPath(SOURCE, "src/main/webapp/content.images"), "ReactLogo.png", "src/main/webapp/content/images"); - projectRepository.add( - project, - getPath(SOURCE, "src/main/webapp/content.images"), - "JHipster-Lite-neon-blue.png", - "src/main/webapp/content/images" - ); + projectRepository.add(project, getPath(SOURCE, imagesPath), "ReactLogo.png", imagesPath); + projectRepository.add(project, getPath(SOURCE, imagesPath), "JHipster-Lite-neon-blue.png", imagesPath); } public void addJestSonar(Project project) { diff --git a/src/main/resources/generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.css.mustache b/src/main/resources/generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.css.mustache index 4203fb45f83..4a1e11c0f15 100644 --- a/src/main/resources/generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.css.mustache +++ b/src/main/resources/generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.css.mustache @@ -1,23 +1,23 @@ - #app { - font-family: Avenir, Helvetica, Arial, sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - text-align: center; - color: #2c3e50; - margin-top: 60px; - } - a { - color: #42b983; - } +#app { + font-family: Avenir, Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-align: center; + color: #2c3e50; + margin-top: 60px; +} +a { + color: #64dafb; +} - label { - margin: 0 0.5em; - font-weight: bold; - } +label { + margin: 0 0.5em; + font-weight: bold; +} - code { - background-color: #eee; - padding: 2px 4px; - border-radius: 4px; - color: #304455; - } +code { + background-color: #eee; + padding: 2px 4px; + border-radius: 4px; + color: #304455; +} diff --git a/src/main/resources/generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.tsx.mustache b/src/main/resources/generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.tsx.mustache index 4510be1a5eb..cb83565ac49 100644 --- a/src/main/resources/generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.tsx.mustache +++ b/src/main/resources/generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.tsx.mustache @@ -1,35 +1,41 @@ import './App.css'; function App() { -return ( -
-
- React logo -
- JHipster logo -

JHipster Lite Vite + React app

-

- Recommended IDE setup: - VSCode - + - Volar -

+ return ( +
+
+ React logo +
+ JHipster logo +

React + TypeScript + Vite

+

+ Recommended IDE setup:  + + VSCode + +  +  + + Volar + +

-

- - React Documentation - - | - React Official -

+

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

-

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

-
-
-); +

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

+
+
+ ); } export default App; diff --git a/src/main/resources/generator/client/vite/react/src/main/webapp/app/index.css.mustache b/src/main/resources/generator/client/vite/react/src/main/webapp/app/index.css.mustache index ec2585e8c0b..e69792553f0 100644 --- a/src/main/resources/generator/client/vite/react/src/main/webapp/app/index.css.mustache +++ b/src/main/resources/generator/client/vite/react/src/main/webapp/app/index.css.mustache @@ -1,13 +1,7 @@ body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', + 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/src/main/resources/generator/client/vite/react/src/main/webapp/content.images/JHipster-Lite-neon-blue.png b/src/main/resources/generator/client/vite/react/src/main/webapp/content/images/JHipster-Lite-neon-blue.png similarity index 100% rename from src/main/resources/generator/client/vite/react/src/main/webapp/content.images/JHipster-Lite-neon-blue.png rename to src/main/resources/generator/client/vite/react/src/main/webapp/content/images/JHipster-Lite-neon-blue.png diff --git a/src/main/resources/generator/client/vite/react/src/main/webapp/content.images/ReactLogo.png b/src/main/resources/generator/client/vite/react/src/main/webapp/content/images/ReactLogo.png similarity index 100% rename from src/main/resources/generator/client/vite/react/src/main/webapp/content.images/ReactLogo.png rename to src/main/resources/generator/client/vite/react/src/main/webapp/content/images/ReactLogo.png diff --git a/src/main/resources/generator/client/vite/react/src/main/webapp/index.html.mustache b/src/main/resources/generator/client/vite/react/src/main/webapp/index.html.mustache index 4de96723d66..73982c0a8bf 100644 --- a/src/main/resources/generator/client/vite/react/src/main/webapp/index.html.mustache +++ b/src/main/resources/generator/client/vite/react/src/main/webapp/index.html.mustache @@ -4,7 +4,7 @@ - Jhipster Lite Vite+React + JHipster Lite Vite+React
diff --git a/src/main/resources/generator/client/vite/react/src/test/javascript/spec/common/primary/app/App.test.tsx.mustache b/src/main/resources/generator/client/vite/react/src/test/javascript/spec/common/primary/app/App.test.tsx.mustache index 515d10c0fb0..ddba834fc03 100644 --- a/src/main/resources/generator/client/vite/react/src/test/javascript/spec/common/primary/app/App.test.tsx.mustache +++ b/src/main/resources/generator/client/vite/react/src/test/javascript/spec/common/primary/app/App.test.tsx.mustache @@ -1,14 +1,8 @@ -import { render, screen } from '@testing-library/react'; +import { render } from '@testing-library/react'; import App from '@/common/primary/app/App'; describe('App tests', () => { it('renders without crashing', () => { render(); }); - - test('renders learn react link', () => { - render(); - const linkElement = screen.getByText("JHipster Lite Vite + React app"); - expect(linkElement).toBeTruthy(); - }); -}) +});