Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Vite (copy from #493) #496

Merged
merged 9 commits into from
Oct 25, 2023
Merged

Migrate to Vite (copy from #493) #496

merged 9 commits into from
Oct 25, 2023

Conversation

nikomakela
Copy link
Contributor

@nikomakela nikomakela commented Oct 23, 2023

KK-1040 KK-1017

The #493 was merged too early and it was rolledback. The reason for this was that the Vite needs a new set of environment variables that are prefixed with "VITE_" (#493 (comment)). This PR is just a recreation of that earlier PR that was accidentally merged, because in Github, the PRs cannot be unmerged.


Bases to the huge pile of upgrading and migration changes in #492.

The Create React App (CRA) is deprecated. It is advised to replace the CRA with Vite.

The migration process is done by following the instructions from
https://www.robinwieruch.de/vite-create-react-app/:

  • The index.html is moved from the /public to the root. The relative paths are migrated.
  • Vitest is installed and the configuration for testing-library is made

The Sass styles from HDS and the app itself needed a couple of aliases.

The new setup includes

  • Vite instead of CRA
  • Vitest with the Testing-library instead of Jest
  • Typescript for Vite

More about this:

@nikomakela
Copy link
Contributor Author

nikomakela commented Oct 23, 2023

Note that the review environment will fail until the pipeline is configured to use env-variables prefixed with VITE_ instead of REACT_APP_.

  • Fix the pipeline configuration

@terovirtanen
Copy link
Contributor

TestCafe result is failed for https://kukkuu-local.api.dev.hel.ninja 😿💢💥💥

@terovirtanen
Copy link
Contributor

TestCafe result is failed for https://kukkuu-local.api.dev.hel.ninja 😿💢💥💥

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

1 similar comment
@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

KK-1017.

The Create React App (CRA) is deprecated.
It is advised to replace the CRA for example with Vite.
For example the latest version of the Helsinki Design System (HDS)
does not work properly with the CRA.

The migration process is done by following the instructions from
https://www.robinwieruch.de/vite-create-react-app/:
- The index.html is moved from the `/public` to the root. The relative paths are migrated.
-  Vitest is installed and the configuration for testing-library is made

The Sass styles from HDS and the app itself needed a couple of aliases.

The new setup includes
- Vite instead of CRA
- Vitest with the Testing-library instead of Jest
- Typescript for Vite
KK-1017.

For some reason, the moment in event utils works
differently in Vite than what it worked in CRA.
However, the same method seems to work
when manually tested on a running env.
KK-1017 KK-1040.
The CI has been collecting the test coverage.
@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

1 similar comment
@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr496.dev.hel.ninja 🚀🚀🚀

KK-1040.
For some reason the CI needs all the dev dependencies as a prod deps.
@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-ui-pr496.dev.hel.ninja 😆🎉🎉🎉

@nikomakela
Copy link
Contributor Author

The Sonarcloud may need some configuration or new packages still

  • Check and configure the Sonarcloud coverage report for the CI

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

1 similar comment
@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-local.api.dev.hel.ninja 😆🎉🎉🎉

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@terovirtanen
Copy link
Contributor

KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr496.dev.hel.ninja 🚀🚀🚀

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kukkuu-ui-pr496.dev.hel.ninja 😆🎉🎉🎉

@nikomakela nikomakela merged commit 1160f51 into master Oct 25, 2023
46 of 47 checks passed
@nikomakela nikomakela deleted the KK-1017-vite branch October 25, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants