-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #934 from pascalgrimaud/refactoring-vite-react
Refactoring: rename ViteReact to React
- Loading branch information
Showing
38 changed files
with
220 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...a/tech/jhipster/lite/generator/client/react/core/application/ReactApplicationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package tech.jhipster.lite.generator.client.react.core.application; | ||
|
||
import org.springframework.stereotype.Service; | ||
import tech.jhipster.lite.generator.client.react.core.domain.ReactService; | ||
import tech.jhipster.lite.generator.project.domain.Project; | ||
|
||
@Service | ||
public class ReactApplicationService { | ||
|
||
private final ReactService reactService; | ||
|
||
public ReactApplicationService(ReactService reactService) { | ||
this.reactService = reactService; | ||
} | ||
|
||
public void addReact(Project project) { | ||
reactService.addReact(project); | ||
} | ||
|
||
public void addStyledReact(Project project) { | ||
reactService.addStyledReact(project); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...ent/vite/react/core/domain/ViteReact.java → ...rator/client/react/core/domain/React.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package tech.jhipster.lite.generator.client.react.core.domain; | ||
|
||
import tech.jhipster.lite.generator.project.domain.Project; | ||
|
||
public interface ReactService { | ||
void addReact(Project project); | ||
void addStyledReact(Project project); | ||
} |
25 changes: 25 additions & 0 deletions
25
...ipster/lite/generator/client/react/core/infrastructure/config/ReactBeanConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package tech.jhipster.lite.generator.client.react.core.infrastructure.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import tech.jhipster.lite.generator.client.react.core.domain.ReactDomainService; | ||
import tech.jhipster.lite.generator.client.react.core.domain.ReactService; | ||
import tech.jhipster.lite.generator.packagemanager.npm.domain.NpmService; | ||
import tech.jhipster.lite.generator.project.domain.ProjectRepository; | ||
|
||
@Configuration | ||
public class ReactBeanConfiguration { | ||
|
||
private final ProjectRepository projectRepository; | ||
private final NpmService npmService; | ||
|
||
public ReactBeanConfiguration(ProjectRepository projectRepository, NpmService npmService) { | ||
this.projectRepository = projectRepository; | ||
this.npmService = npmService; | ||
} | ||
|
||
@Bean | ||
public ReactService reactService() { | ||
return new ReactDomainService(projectRepository, npmService); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
.../jhipster/lite/generator/client/react/core/infrastructure/primary/rest/ReactResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package tech.jhipster.lite.generator.client.react.core.infrastructure.primary.rest; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import tech.jhipster.lite.generator.client.react.core.application.ReactApplicationService; | ||
import tech.jhipster.lite.generator.project.domain.Project; | ||
import tech.jhipster.lite.generator.project.infrastructure.primary.dto.ProjectDTO; | ||
import tech.jhipster.lite.technical.infrastructure.primary.annotation.GeneratorStep; | ||
|
||
@RestController | ||
@RequestMapping("/api/react") | ||
@Tag(name = "React") | ||
class ReactResource { | ||
|
||
private final ReactApplicationService reactApplicationService; | ||
|
||
public ReactResource(ReactApplicationService reactApplicationService) { | ||
this.reactApplicationService = reactApplicationService; | ||
} | ||
|
||
@Operation(summary = "Init React+Vite", description = "Init React+Vite project") | ||
@ApiResponse(responseCode = "500", description = "An error occurred while initializing React+Vite project") | ||
@PostMapping | ||
@GeneratorStep(id = "react") | ||
public void addReact(@RequestBody ProjectDTO projectDTO) { | ||
Project project = ProjectDTO.toProject(projectDTO); | ||
reactApplicationService.addReact(project); | ||
} | ||
|
||
@Operation(summary = "Add React+Vite with minimal CSS", description = "Add React+Vite with minimal CSS") | ||
@ApiResponse(responseCode = "500", description = "An error occurred while adding React+Vite with minimal CSS") | ||
@PostMapping("/styled") | ||
@GeneratorStep(id = "react-styled") | ||
public void addStyledReact(@RequestBody ProjectDTO projectDTO) { | ||
Project project = ProjectDTO.toProject(projectDTO); | ||
reactApplicationService.addStyledReact(project); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
src/main/java/tech/jhipster/lite/generator/client/react/core/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@tech.jhipster.lite.BusinessContext | ||
package tech.jhipster.lite.generator.client.react.core; |
23 changes: 0 additions & 23 deletions
23
...ipster/lite/generator/client/vite/react/core/application/ViteReactApplicationService.java
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ain/java/tech/jhipster/lite/generator/client/vite/react/core/domain/ViteReactService.java
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
...te/generator/client/vite/react/core/infrastructure/config/ViteReactBeanConfiguration.java
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
.../lite/generator/client/vite/react/core/infrastructure/primary/rest/ViteReactResource.java
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
src/main/java/tech/jhipster/lite/generator/client/vite/react/core/package-info.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ator/dependencies/vite/react/package.json → ...generator/dependencies/react/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.