-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: Replace Create React App with Vite. Replace jest with vitest
Signed-off-by: Oleksandr Dubenko <oldubenko@microsoft.com> Co-authored-by: Mariusz Winnik <tazo90@gmail.com>
- Loading branch information
Showing
175 changed files
with
99,103 additions
and
137,188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,5 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
.eslintcache | ||
|
||
**/locales/**/*_old.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,50 @@ | ||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
# Headlamp Frontend | ||
|
||
## Available Scripts | ||
React frontend for the Headlamp. Used by the electron app and for in-cluster deployment. | ||
|
||
In the project directory, you can run: | ||
## Development | ||
|
||
### `npm start` | ||
To start the project run: | ||
|
||
Runs the app in the development mode.<br /> | ||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
```sh | ||
npm run start | ||
``` | ||
|
||
The page will reload if you make edits.<br /> | ||
You will also see any lint errors in the console. | ||
This will start a development server at the 3000 port. | ||
Make sure the backend is running. See more in [Backend Readme](../backend/README.md). | ||
|
||
### `npm test` | ||
## Storybook | ||
|
||
Launches the test runner in the interactive watch mode.<br /> | ||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
[Storybook documentation](https://storybook.js.org/docs/get-started) | ||
We have stories for a lot of components. Stories are files that end in .stories.tsx. To open storybook run: | ||
|
||
### `npm run build` | ||
```sh | ||
npm run storybook | ||
``` | ||
|
||
Builds the app for production to the `build` folder.<br /> | ||
It correctly bundles React in production mode and optimizes the build for the best performance. | ||
## Tests | ||
|
||
The build is minified and the filenames include the hashes.<br /> | ||
Your app is ready to be deployed! | ||
[Vitest documentation](https://vitest.dev/guide/) | ||
Tests are run using vitest. To run all test use: | ||
|
||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
```sh | ||
npm run test | ||
``` | ||
|
||
### `npm run eject` | ||
To run some particular test: | ||
|
||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** | ||
```sh | ||
npm run test -- testFileName | ||
``` | ||
|
||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
If you're using VSCode consider installing [vitest extension](https://marketplace.visualstudio.com/items?itemName=vitest.explorer). | ||
|
||
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. | ||
## Production build | ||
|
||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. | ||
To create a production build run | ||
|
||
## Learn More | ||
```sh | ||
npm run build | ||
``` | ||
|
||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
|
||
To learn React, check out the [React documentation](https://reactjs.org/). | ||
|
||
### Code Splitting | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting | ||
|
||
### Analyzing the Bundle Size | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size | ||
|
||
### Making a Progressive Web App | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app | ||
|
||
### Advanced Configuration | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration | ||
|
||
### Deployment | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment | ||
|
||
### `npm run build` fails to minify | ||
|
||
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify | ||
This will create static production app in the `build/` folder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.