Skip to content

Commit 3886985

Browse files
authored
Update quickwit-ui dependencies (#5982)
* [ui] remove unused asset * [ui] avoid using automatically generated svg component (for the sake of having less non-standard configuration) * [ui] replace react-monaco-editor with @monaco-editor/react which seems to be the officially supported one * [ui] use vite for build and local dev server * [ui] run type checking on CI * [ui] eject from react-create-app and fix jest config * [ui] ensure install step is determinist * [ui] update readme * [ui] fix linting errors + replace eslint by biome * [ui] bump typescript version * [ui] bump react 19 * [ui] Avoid using loader-utils@0.2.17 , glob@10.4.5 , dompurify@3.1.7 which are flag as vulnerable
1 parent cfb543d commit 3886985

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3615
-8820
lines changed

.github/workflows/ui-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
yarn --cwd quickwit-ui cypress run
3939
- name: Lint
4040
command: yarn --cwd quickwit-ui lint
41-
- name: Check formatting
42-
command: yarn --cwd quickwit-ui check-formatting
41+
- name: Check type consistency
42+
command: yarn --cwd quickwit-ui type
4343
- name: Unit Test
4444
command: yarn --cwd quickwit-ui test
4545
services:

quickwit/quickwit-serve/src/ui_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::rest::recover_fn;
2525

2626
/// Regular expression to identify which path should serve an asset file.
2727
/// If not matched, the server serves the `index.html` file.
28-
const PATH_PATTERN: &str = r"(^static|\.(png|json|txt|ico|js|map)$)";
28+
const PATH_PATTERN: &str = r"(^static|\.(png|json|txt|ico|js|map|css|woff2|ttf)$)";
2929

3030
const UI_INDEX_FILE_NAME: &str = "index.html";
3131

quickwit/quickwit-ui/.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

quickwit/quickwit-ui/.eslintrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

quickwit/quickwit-ui/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build:
44
yarn build
55

66
install:
7-
yarn install
7+
yarn install --frozen-lockfile
88

99
start:
1010
yarn start

quickwit/quickwit-ui/README.md

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Getting Started with Create React App
1+
# quickwit-ui
2+
23

3-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
44

55
## Prerequisites
66

7-
`node` and `npm` need to be installed on your system.
7+
`node` and `yarn` need to be installed on your system.
88
The project then relies on misc nodejs tools that can be installed locally by
9-
running `npm install`.
9+
running `yarn`.
1010

1111
## Available Scripts
1212

@@ -24,36 +24,22 @@ You will also see any lint errors in the console.
2424

2525
### `yarn test`
2626

27-
Launches the test runner in the interactive watch mode.\
28-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
27+
Launches the test runner.
2928

3029
### `yarn e2e-test`
3130

3231
Launches the e2e test runner with [cypress](https://www.cypress.io/). To make them work, you need to start a
3332
searcher beforehand with `cargo r run --service searcher --config config/quickwit.yaml`.
3433

34+
### `yarn format`
35+
36+
Re-writes files with the correct formatting if needed.\
37+
You might want to configure your IDE to do that [automatically](https://biomejs.dev/guides/editors/first-party-extensions/).
38+
3539
### `yarn build`
3640

3741
Builds the app for production to the `build` folder.\
3842
It correctly bundles React in production mode and optimizes the build for the best performance.
3943

4044
The build is minified and the filenames include the hashes.\
4145
Your app is ready to be deployed!
42-
43-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
44-
45-
### `yarn eject`
46-
47-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
48-
49-
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.
50-
51-
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.
52-
53-
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.
54-
55-
## Learn More
56-
57-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
58-
59-
To learn React, check out the [React documentation](https://reactjs.org/).

quickwit/quickwit-ui/biome.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@
33
"formatter": {
44
"enabled": true,
55
"indentStyle": "space",
6-
"includes": ["**", "!**/build"]
6+
"includes": ["**", "!build/**"]
77
},
8-
"linter": { "enabled": false }
8+
"linter": {
9+
"enabled": true,
10+
"rules": {
11+
"recommended": true,
12+
"style": "off",
13+
"complexity": "off",
14+
"correctness": {
15+
"useExhaustiveDependencies": "off"
16+
},
17+
"suspicious": {
18+
"noTsIgnore": "off",
19+
"useIterableCallbackReturn": "off",
20+
"noExplicitAny": "off",
21+
"noArrayIndexKey": "off"
22+
}
23+
},
24+
"includes": ["**", "!build/**"]
25+
}
926
}

quickwit/quickwit-ui/config-overrides.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

quickwit/quickwit-ui/cypress/plugins/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
/**
1616
* @type {Cypress.PluginConfig}
1717
*/
18-
// eslint-disable-next-line no-unused-vars
1918
module.exports = (on, config) => {
2019
// `on` is used to hook into various events Cypress emits
2120
// `config` is the resolved Cypress config

quickwit/quickwit-ui/index.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Sub-second search & analytics engine on cloud storage"
11+
/>
12+
<link rel="apple-touch-icon" href="logo192.png" />
13+
<!--
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16+
-->
17+
<link rel="manifest" href="manifest.json" />
18+
<!--
19+
TODO: remove and replace with Quickwit fonts.
20+
-->
21+
<link
22+
rel="stylesheet"
23+
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
24+
/>
25+
<title>Quickwit UI</title>
26+
</head>
27+
<body>
28+
<noscript>You need to enable JavaScript to run this app.</noscript>
29+
<div id="root"></div>
30+
<script type="module" src="src/index.tsx"></script>
31+
</body>
32+
</html>

0 commit comments

Comments
 (0)