Skip to content

Commit a0f4557

Browse files
committed
Merge branch 'master' into update-from-template-merged
2 parents 1f69b6d + 878a14a commit a0f4557

File tree

14 files changed

+369
-38
lines changed

14 files changed

+369
-38
lines changed

.config/pmd/java/ruleset.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,25 @@
194194
</rule>
195195

196196
<rule ref="category/java/security.xml"/>
197+
198+
<rule name="VaadinNativeHTMLUnsafe"
199+
language="java"
200+
message="Unescaped native HTML is unsafe and will result in XSS vulnerabilities"
201+
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule" >
202+
<description>
203+
Do not used native HTML! Use Vaadin layouts and components to create required structure.
204+
If you are 100% sure that you escaped the value properly and you have no better options you can suppress this.
205+
</description>
206+
<priority>2</priority>
207+
<properties>
208+
<property name="xpath">
209+
<value>
210+
<![CDATA[
211+
//ConstructorCall[pmd-java:typeIs('com.vaadin.flow.component.Html')] |
212+
//MethodCall[@MethodName='setAttribute' and //ImportDeclaration[starts-with(@PackageName,'com.vaadin')]]/ArgumentList/StringLiteral[1][contains(lower-case(@Image),'html')]
213+
]]>
214+
</value>
215+
</property>
216+
</properties>
217+
</rule>
197218
</ruleset>

.github/workflows/check-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
cache: 'maven'
4545

4646
- name: Build with Maven
47-
run: ./mvnw -B clean package
47+
run: ./mvnw -B clean package -Pproduction
4848

4949
- name: Check for uncommited changes
5050
run: |
@@ -60,7 +60,7 @@ jobs:
6060
echo ----------------------------------------
6161
echo Troubleshooting
6262
echo ----------------------------------------
63-
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package"
63+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package -Pproduction"
6464
exit 1
6565
fi
6666

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
cache: 'maven'
2727

2828
- name: Build with Maven
29-
run: ./mvnw -B clean package -T2C
29+
run: ./mvnw -B clean package -Pproduction -T2C
3030

3131
- name: Check for uncommited changes
3232
run: |
@@ -42,7 +42,7 @@ jobs:
4242
echo ----------------------------------------
4343
echo Troubleshooting
4444
echo ----------------------------------------
45-
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package"
45+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package -Pproduction"
4646
exit 1
4747
fi
4848
@@ -100,6 +100,9 @@ jobs:
100100
</dependency>
101101
```
102102
103+
### Additional notes
104+
* [Spring-Boot] You may have to include ``software/xdev`` inside [``vaadin.allowed-packages``](https://vaadin.com/docs/latest/integrations/spring/configuration#configure-the-scanning-of-packages)
105+
103106
publish-maven:
104107
runs-on: ubuntu-latest
105108
needs: [prepare-release]

.github/workflows/update-from-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
env:
2222
UPDATE_BRANCH: update-from-template
2323
UPDATE_BRANCH_MERGED: update-from-template-merged
24-
REMOTE_URL: https://github.com/xdev-software/standard-maven-template.git
24+
REMOTE_URL: https://github.com/xdev-software/vaadin-addon-template.git
2525
REMOTE_BRANCH: master
2626

2727
permissions:

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,29 @@ hs_err_pid*
3333
.classpath
3434
.project
3535

36+
#vaadin/node webpack/frontend stuff
37+
# Ignore Node
38+
node/
39+
40+
# The following files are generated/updated by vaadin-maven-plugin
41+
node_modules/
42+
43+
# Vaadin
44+
package.json
45+
package-lock.json
46+
webpack.generated.js
47+
webpack.config.js
48+
tsconfig.json
49+
types.d.ts
50+
vite.config.ts
51+
vite.generated.ts
52+
/*/src/main/frontend/generated/
53+
/*/src/main/frontend/index.html
54+
/*/src/main/dev-bundle/
55+
/*/src/main/bundles/
56+
*.lock
57+
58+
3659
# == IntelliJ ==
3760
*.iml
3861
*.ipr

.run/Run Demo.run.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
3-
<option name="MAIN_CLASS_NAME" value="software.xdev.Application" />
3+
<option name="MAIN_CLASS_NAME" value="software.xdev.vaadin.Application" />
44
<module name="template-placeholder-demo" />
55
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
66
<extension name="coverage">
77
<pattern>
8-
<option name="PATTERN" value="software.xdev.*" />
8+
<option name="PATTERN" value="software.xdev.vaadin.*" />
99
<option name="ENABLED" value="true" />
1010
</pattern>
1111
</extension>

CONTRIBUTING.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,20 @@ You should have the following things installed:
3232
* Import the project
3333
* Ensure that everything is encoded in ``UTF-8``
3434
* Ensure that the JDK/Java-Version is correct
35-
35+
* To enable AUTOMATIC reloading/restarting while developing and running the app do this (further information in "
36+
SpringBoot-Devtools" section below; [Source](https://stackoverflow.com/q/33349456)):
37+
* ``Settings > Build, Execution, Deployment > Compiler``:<br/>
38+
Enable [``Build project automatically``](https://www.jetbrains.com/help/idea/compiling-applications.html#auto-build)
39+
* ``Settings > Advanced Settings``:<br/>
40+
Enable [``Allow auto-make to start even if developed application is currently running``](https://www.jetbrains.com/help/idea/advanced-settings.html#advanced_compiler)
41+
* To launch the Demo execute the predefined (launch) configuration ``Run Demo``
42+
43+
#### [SpringBoot-Developer-Tools](https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.devtools)
44+
... should automatically be enabled.<br/>
45+
If you are changing a file and build the project, parts of the app get restarted.<br/>
46+
Bigger changes may require a complete restart.
47+
* [Vaadin automatically reloads the UI on each restart](https://vaadin.com/docs/latest/configuration/live-reload/spring-boot).<br/>
48+
You can control this behavior with the ``vaadin.devmode.liveReload.enabled`` property (default: ``true``).
3649

3750
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
3851

@@ -44,6 +57,7 @@ If the ``develop`` is ready for release, create a pull request to the ``master``
4457

4558
When the release is finished do the following:
4659
* Merge the auto-generated PR (with the incremented version number) back into the ``develop``
60+
* Ensure that [Vaadin Directory](https://vaadin.com/directory) syncs the update and maybe update the component / version there
4761

4862
### Release failures
4963

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1+
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/template-placeholder)
12
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
23
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
34
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
5+
![Vaadin 24+](https://img.shields.io/badge/Vaadin%20Platform/Flow-24+-00b4f0)
46

57
# template-placeholder
8+
A Vaadin Template Repo
9+
10+
![demo](assets/demo.png)
611

712

813
## Installation
914
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
1015

16+
### Spring-Boot
17+
* You may have to include ``software/xdev`` inside [``vaadin.allowed-packages``](https://vaadin.com/docs/latest/integrations/spring/configuration#configure-the-scanning-of-packages)
18+
19+
## Run the Demo
20+
* Checkout the repo
21+
* Run ``mvn install && mvn -f template-placeholder-demo spring-boot:run``
22+
* Open http://localhost:8080
23+
24+
<details>
25+
<summary>Show example</summary>
26+
27+
![demo](assets/demo.avif)
28+
</details>
29+
1130
## Support
1231
If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
1332

assets/demo.avif

1.4 KB
Binary file not shown.

assets/demo.png

13.9 KB
Loading

0 commit comments

Comments
 (0)