Skip to content

Commit 50156b3

Browse files
committed
Replace CRA with Vite
1 parent 62d7223 commit 50156b3

File tree

14 files changed

+3626
-19219
lines changed

14 files changed

+3626
-19219
lines changed

.github/workflows/deploy_demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Upload artifact
4343
uses: actions/upload-pages-artifact@v3
4444
with:
45-
path: ./search_interface/build
45+
path: ./search_interface/dist
4646

4747
- name: Deploy to github pages
4848
id: deployment

search_interface/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/coverage
1010

1111
# production
12-
/build
12+
/dist
1313

1414
# misc
1515
.DS_Store
File renamed without changes.

search_interface/public/index.html renamed to search_interface/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
5+
<link rel="icon" href="favicon.png" />
6+
<script type="module" src="src/index.jsx"></script>
67
<meta name="viewport" content="width=device-width, initial-scale=1" />
78
<meta name="theme-color" content="#000000" />
89
<title>Boost.Gecko</title>

search_interface/package-lock.json

Lines changed: 3535 additions & 19169 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

search_interface/package.json

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
{
2-
"name": "search-interface",
3-
"version": "0.1.0",
4-
"private": true,
2+
"name": "boost-gecko",
3+
"title": "Boost.Gecko",
4+
"description": "A search interface for Boost.Gecko project",
5+
"version": "0.1.2",
6+
"license": "BSL-1.0",
7+
"author": "Mohammad Nejati",
8+
"homepage": "https://github.com/cppalliance/boost-gecko",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/cppalliance/boost-gecko.git"
12+
},
13+
"files": [
14+
"dist/*",
15+
"src/*"
16+
],
517
"dependencies": {
618
"@emotion/react": "^11.13.5",
719
"@emotion/styled": "^11.13.5",
@@ -16,17 +28,15 @@
1628
"react": "^18.3.1",
1729
"react-dom": "^18.3.1",
1830
"react-instantsearch": "^7.13.8",
19-
"react-scripts": "^5.0.1",
2031
"recent-searches": "^1.0.5",
2132
"url-join": "^5.0.0",
2233
"web-vitals": "^2.1.4"
2334
},
2435
"scripts": {
25-
"start": "react-scripts start",
26-
"build": "react-scripts build",
27-
"test": "react-scripts test",
28-
"eject": "react-scripts eject",
29-
"format": "prettier --write ./src"
36+
"format": "prettier --write ./src",
37+
"start": "vite",
38+
"build": "vite build",
39+
"preview": "vite preview"
3040
},
3141
"eslintConfig": {
3242
"extends": [
@@ -56,7 +66,9 @@
5666
"devDependencies": {
5767
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
5868
"@svgr/cli": "^8.1.0",
59-
"prettier": "^2.8.8"
69+
"@vitejs/plugin-react": "^4.3.4",
70+
"prettier": "^2.8.8",
71+
"vite": "^6.2.6"
6072
},
6173
"overrides": {
6274
"nth-check": "$nth-check"

search_interface/src/Demo.js renamed to search_interface/src/Demo.jsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,21 @@ function Demo() {
3838
<FormControl fullWidth>
3939
<InputLabel>Theme</InputLabel>
4040
<Select size='small' value={themeMode} onChange={handleModeChange} label='Theme' sx={{ height: 36 }}>
41-
<MenuItem value='light'>
42-
Light
43-
</MenuItem>
44-
<MenuItem value='dark'>
45-
Dark
46-
</MenuItem>
41+
<MenuItem value='light'>Light</MenuItem>
42+
<MenuItem value='dark'>Dark</MenuItem>
4743
</Select>
4844
</FormControl>
4945
</Grid>
5046
<Grid item md={8} xs={5}>
5147
<FormControl fullWidth>
5248
<InputLabel>Library</InputLabel>
53-
<Select size='small' value={library ? library.key : 'none'} onChange={handleLibraryChange} label='Library' sx={{ height: 36 }}>
49+
<Select
50+
size='small'
51+
value={library ? library.key : 'none'}
52+
onChange={handleLibraryChange}
53+
label='Library'
54+
sx={{ height: 36 }}
55+
>
5456
<MenuItem value='none'>
5557
<em>None</em>
5658
</MenuItem>

search_interface/src/Search/SearchBox.js renamed to search_interface/src/Search/SearchBox.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,17 @@ function SearchBox({ inputRef, recentSearches }) {
4343
{...params}
4444
sx={{
4545
'& input:focus': {
46-
boxShadow: 'none'
47-
}
46+
boxShadow: 'none',
47+
},
4848
}}
4949
placeholder='Search...'
5050
inputRef={inputRef}
5151
InputProps={{
5252
...params.InputProps,
53-
style: { fontSize: "1.2rem" },
53+
style: { fontSize: '1.2rem' },
5454
endAdornment: (
5555
<React.Fragment>
56-
{status === 'loading' || status === 'stalled' ? (
57-
<CircularProgress size={16} />
58-
) : null}
56+
{status === 'loading' || status === 'stalled' ? <CircularProgress size={16} /> : null}
5957
{params.InputProps.endAdornment}
6058
</React.Fragment>
6159
),

0 commit comments

Comments
 (0)