vaadin / platform

Vaadin platform 10+ is a Java web development platform based on Vaadin web components. If you don't know to which repository your bug report should be filed, use this and we'll move it to the right one.
https://vaadin.com
515 stars 76 forks source link

chore: added codestarts for vaadin-quarkus-extension #4114

Closed mcollovati closed 11 months ago

mcollovati commented 1 year ago

The vaadin-quarkus artifact provides a codestart that provides a minimal Vaadin application when the extension is selected during a Quarkus project creation. However, that artifact has no knowledge of platform version so the codestart cannot add the necessary dependencies to the pom file. This changes generates a copy of the codestart artifact for the vaadin-quarkus-extension, pinning the platform version in the codestart metadata, to allow the correct creation of the project.

mcollovati commented 1 year ago

Requires vaadin/quarkus#119 to be merged

It can be tested locally after building the platform with the following command

mvn io.quarkus.platform:quarkus-maven-plugin:3.0.1.Final:create  \
  -DprojectGroupId=org.acme -DprojectArtifactId=getting-started \
  -Dextensions='com.vaadin:vaadin-quarkus-extension:24.1-SNAPSHOT' \
  -DwithCodestart -Dexample=vaadin-flow-codestart
mcollovati commented 1 year ago

If accepted, the change should be ported on 24.0 and 23.3

czp13 commented 1 year ago

Good job @mcollovati once more with Quarkus! Checking the changes by eyeballs the changes seem safe to me. Unfortunately could not test as I got some platform build errors following this doc (which is very nice btw):

[INFO] Creating a new development mode bundle. This can take a while but will only run when the project setup is changed, addons are added or frontend files are modified
[ERROR] Command `/Users/pczuczor/.nvm/versions/node/v18.12.1/bin/node /Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/vite/bin/vite.js build` failed:
vite v4.3.7 building for production...
transforming...
✓ 293 modules transformed.
✓ built in 839ms
[vite]: Rollup failed to resolve import "@vaadin/field-base/src/styles/sr-only-styles.js" from "/Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/@vaadin/select/src/vaadin-select.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "@vaadin/field-base/src/styles/sr-only-styles.js" from "/Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/@vaadin/select/src/vaadin-select.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at viteWarn (file:///Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/vite/dist/node/chunks/dep-1f986b87.js:46597:23)
    at onwarn (file:///Users/pczuczor/Projects/platform/vaadin-dev-bundle/vite.config.ts.timestamp-1684476159143-3a6c2535c188e.mjs:1159:11)
    at onRollupWarning (file:///Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/vite/dist/node/chunks/dep-1f986b87.js:46618:9)
    at onwarn (file:///Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/vite/dist/node/chunks/dep-1f986b87.js:46368:13)
    at Object.onwarn (file:///Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/rollup/dist/es/shared/node-entry.js:25346:13)
    at ModuleLoader.handleInvalidResolvedId (file:///Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/rollup/dist/es/shared/node-entry.js:23981:26)
    at file:///Users/pczuczor/Projects/platform/vaadin-dev-bundle/node_modules/rollup/dist/es/shared/node-entry.js:23941:26
mcollovati commented 11 months ago

It would be good to have this merged so that we can then update the coordinates on Quarkus catalog and provide a working application example when creating new projects with Quarkus tooling.

@manolo or @ZheSun88 do you mind taking a look?

github-actions[bot] commented 11 months ago

Dependencies Report

[Click for more Details]

ZheSun88 commented 11 months ago

now the validation works. but when i run the provided way to generate the quarkus project, the vaadin.version inside the generated pom is still unspecified.

<vaadin.version>${vaadin.version}</vaadin.version>
Marco:
It seems like the problem is have the codestart in the same directory for add-on and platform-addon
So it is not predictable what you will get
ZheSun88 commented 11 months ago

now everything is working.. let us merge after validation.