Skip to content

Commit

Permalink
Merge pull request #10924 from murdos/10873-init-with-target-in-gitig…
Browse files Browse the repository at this point in the history
…nore

Init with target in gitignore
  • Loading branch information
pascalgrimaud authored Sep 20, 2024
2 parents 7d9a0ba + b260af1 commit 0a59052
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public JHipsterModule buildMavenModule(JHipsterModuleProperties properties) {
.put("dasherizedBaseName", properties.projectBaseName().kebabCase())
.and()
.prerequisites(JAVA_PREREQUISITES)
.gitIgnore()
.comment("Maven")
.pattern("/target/")
.and()
.files()
.add(SOURCE.template("pom.xml"), to("pom.xml"))
.and()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static tech.jhipster.lite.module.domain.JHipsterModule.*;
import static tech.jhipster.lite.module.domain.npm.JHLiteNpmVersionSource.COMMON;
import static tech.jhipster.lite.module.domain.npm.JHLiteNpmVersionSource.REACT;
import static tech.jhipster.lite.module.domain.replacement.ReplacementCondition.always;

import java.util.function.Consumer;
import tech.jhipster.lite.module.domain.Indentation;
Expand Down Expand Up @@ -99,7 +100,7 @@ private Consumer<JHipsterModuleBuilder> patchEslintConfig(JHipsterModuleProperti
.mandatoryReplacements()
.in(path("eslint.config.js"))
.add(lineAfterRegex("from 'typescript-eslint'"), "import react from 'eslint-plugin-react/configs/recommended.js';")
.add(regex("\\s+\\.\\.\\.typescript\\.configs\\.recommended.*"), "")
.add(regex(always(), "\\s+\\.\\.\\.typescript\\.configs\\.recommended.*"), "")
.add(regex("[ \\t]+files: \\['src/\\*/webapp/\\*\\*\\/\\*\\.ts'],"), reactConfig)
.add(
lineAfterRegex("globals: \\{ \\.\\.\\.globals\\.browser },"),
Expand Down Expand Up @@ -154,7 +155,7 @@ private Consumer<JHipsterModuleBuilder> patchVitestConfig(JHipsterModuleProperti
.mandatoryReplacements()
.in(path("vitest.config.ts"))
.add(lineAfterRegex("from 'vitest/config';"), "import react from '@vitejs/plugin-react';")
.add(text( "plugins: ["), "plugins: [react(), ")
.add(text("plugins: ["), "plugins: [react(), ")
.add(text("environment: 'node',"), "environment: 'jsdom',")
.add(vitestCoverageExclusion(properties,"src/main/webapp/app/index.tsx"))
.and();
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/generator/init/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ out/
!.vscode/extensions.json
*.code-workspace

######################
# Maven
######################
/target/

######################
# Package Files
######################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ void shouldBuildMavenModule() {
JHipsterModule module = factory.buildMavenModule(properties);

assertThatModuleWithFiles(module, readmeFile())
.hasFile(".gitignore")
.containing(
"""
# Maven
/target/\
"""
)
.and()
.hasFile("pom.xml")
.containing("<groupId>tech.jhipster.jhlitest</groupId>")
.containing("<artifactId>my-app</artifactId>")
Expand Down

0 comments on commit 0a59052

Please sign in to comment.