From 1dc70fd43f6c68ba6890343d7aaf1097172c5f01 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Wed, 10 Jul 2019 22:02:54 +0100 Subject: [PATCH] build: process JavaScript components with Babel. As "frontend" plugin gets activated before executing any goals, this leads to a non obvious outcome that "mvn clean " command doesn't regenerate JS-files. It happens because "frontent" plugin doesn't get activated as the target/classes/js/components directory exists in the begginning and hasn't been removed yet. As a workaround you might use: - mvn -Pfrontend clean - mvn clean; mvn Addressed to #1060 and (a little bit to) #1057 --- Dangerfile | 5 ++++- README.md | 2 +- pom.xml | 17 +++++++++++++++++ src/main/frontend/package.json | 3 ++- .../src/components/SeriesSaleImportForm.js | 5 +++++ src/main/scripts/ci/check-build-and-verify.sh | 4 ++-- src/main/scripts/ci/publish-code-coverage.sh | 2 +- 7 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 src/main/frontend/src/components/SeriesSaleImportForm.js diff --git a/Dangerfile b/Dangerfile index e31a851711..f10c3c773d 100644 --- a/Dangerfile +++ b/Dangerfile @@ -405,6 +405,8 @@ if File.file?(validator_output) print_errors_summary 'html5validator', errors_count end +# @todo #1060 Danger: handle Babel errors from frontend-maven-plugin + # Handle `mvn org.apache.maven.plugins:maven-compiler-plugin:compile` output # Handle `mvn org.apache.maven.plugins:maven-compiler-plugin:testCompile` output # Handle `mvn org.codehaus.gmavenplus:gmavenplus-plugin:testCompile` output @@ -696,8 +698,9 @@ if github.branch_for_head !~ /^gh[0-9]+_/ end js_file = %r{^src/main/javascript/.*\.js$} +component_file = %r{^src/main/frontend/src/.*\.js$} css_file = %r{^src/main/webapp/.*\.css$} -modified_resources = git.modified_files.any? { |file| file =~ js_file || file =~ css_file } +modified_resources = git.modified_files.any? { |file| file =~ js_file || file =~ component_file || file =~ css_file } updated_url = git.modified_files.include? 'src/main/java/ru/mystamps/web/feature/site/ResourceUrl.java' if modified_resources && !updated_url warn("danger check: looks like you forgot to update `ResourceUrl.RESOURCES_VERSION` after modifying JS/CSS file(s)") diff --git a/README.md b/README.md index eb0df00fd7..2995408355 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ If you are programmer/sysadmin or you just feeling that you are able to run a lo * *At the heart of*: Spring Framework (and especially Spring Boot) * *Template engine*: Thymeleaf -* *UI*: HTML, Bootstrap and a bit of JavaScript with JQuery +* *UI*: HTML, Bootstrap and JavaScript (React, JQuery) * *Security*: Spring Security * *Databases*: H2, MySQL or PostgreSQL * *Database access*: Spring's `JdbcTemplate` diff --git a/pom.xml b/pom.xml index 8dc455b9c8..0e2bb9c893 100644 --- a/pom.xml +++ b/pom.xml @@ -1223,8 +1223,15 @@ frontend + + + + target/classes/js/components + + +