Skip to content

fix!: Extract addon files to frontend/generated/jar-resources instead of a fake npm package - #14979

Merged
Artur- merged 14 commits into
masterfrom
jar-resources-in-generated
Nov 3, 2022
Merged

Artur- merged 14 commits into
masterfrom
jar-resources-in-generated

Conversation

@Artur-

@Artur- Artur- commented Nov 2, 2022

Copy link
Copy Markdown
Member

No longer creates target/flow-frontend so any tool or script relying on that needs to be updated

Fixes #14695

@caalador

caalador commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

Add to NodeUpdater:getPackageJson the same update fix as removeWebpackPlugins that removes "@vaadin/flow-frontend": "./target/flow-frontend", from the package.json if there. Else running the clean-frontend plugin goal would fix it.

@github-actions

github-actions Bot commented Nov 2, 2022 •

Copy link
Copy Markdown
Contributor

Unit Test Results

   954 files   - 2     954 suites   - 2   55m 38s ⏱️ + 4m 15s
6 083 tests +2  6 029 ✔️ +2  54 💤 ±0  0 ❌ ±0 
6 345 runs  +2  6 283 ✔️ +2  62 💤 ±0  0 ❌ ±0 

Results for commit fa80491. ± Comparison against base commit 2e61479.

♻️ This comment has been updated with latest results.

@Artur-

Artur- commented Nov 2, 2022

Copy link
Copy Markdown
Member Author

Add to NodeUpdater:getPackageJson the same update fix as removeWebpackPlugins that removes "@vaadin/flow-frontend": "./target/flow-frontend", from the package.json if there. Else running the clean-frontend plugin goal would fix it.

Is that the correct place for cleanup? There is cleanup for @vaadin/flow-deps in TaskUpdatePackages.java

@caalador

caalador commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

removeLegacyProperties sounds like a good place to have it.

@Artur-
Artur- force-pushed the jar-resources-in-generated branch from 894d862 to 9283216 Compare November 3, 2022 07:25
@Artur-
Artur- marked this pull request as ready for review November 3, 2022 07:34
@Artur-
Artur- requested a review from caalador November 3, 2022 07:34
@Artur-

Artur- commented Nov 3, 2022

Copy link
Copy Markdown
Member Author

Cosmetic question, would frontend/generated/jar-resources actually look better than jarResources?

@caalador

caalador commented Nov 3, 2022

Copy link
Copy Markdown
Contributor

I would choose jar-resources as camelcase on folders feel a bit off for some reason.

Gradle build probably fails on the VaadinSmokeTest as there is the expectation:

        val cssFile = File(testProject.dir, "build/flow-frontend/mystyle.css")
        expect(true, cssFile.toString()) { cssFile.exists() }

@Artur- Artur- changed the title fix!: Extract addon files to frontend/generated/jarResources instead of a fake npm package fix!: Extract addon files to frontend/generated/jar-resources instead of a fake npm package Nov 3, 2022

@caalador caalador left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, but VaadinSmokeTest.kt:vaadinBuildFrontendShouldScanForResourcesOnClasspath needs a fix for the tested path.

Also formatting

@Artur-

Artur- commented Nov 3, 2022

Copy link
Copy Markdown
Member Author

Seems like gradle is somehow broken still because it does not fail on the asserted path but before that when trying to find the file in frontend

@Artur-
Artur- requested a review from caalador November 3, 2022 12:05
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2022

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Artur-
Artur- merged commit cf4dd5f into master Nov 3, 2022
@Artur-
Artur- deleted the jar-resources-in-generated branch November 3, 2022 12:37
@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @Artur- and @Artur-, when i performed cherry-pick to this commit to 23.3, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick cf4dd5f
error: could not apply cf4dd5f... fix!: Extract addon files to frontend/generated/jar-resources instead of a fake npm package (#14979)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

vaadin-bot pushed a commit that referenced this pull request Nov 3, 2022
… of a fake npm package (#14979)

No longer creates target/flow-frontend so any tool or script relying on that needs to be updated

Fixes #14695
Artur- pushed a commit that referenced this pull request Nov 4, 2022
… of a fake npm package (#14979) (#15001)

No longer creates target/flow-frontend so any tool or script relying on that needs to be updated

Any manual import in JS/TS files from `@vaadin/flow-frontend` needs to be updated to `Frontend/generated/jar-resources`

Fixes #14695
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vite doesn't detect changes in files in target/flow-frontend

3 participants