Skip to content

Commit 5f734e7

Browse files
committed
Adapt and fix playgrounds
1 parent f4b1f90 commit 5f734e7

File tree

21 files changed

+69
-192
lines changed

21 files changed

+69
-192
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"release": "yarn build && changeset publish"
3535
},
3636
"dependencies": {
37-
"instantsearch.css": "^8.0.0"
37+
"instantsearch.css": "^8.5.1"
3838
},
3939
"devDependencies": {
4040
"prettier": "^3.4.2",

playgrounds/autocomplete/.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineConfig } from 'vite';
2+
3+
// https://vite.dev/config/
4+
export default defineConfig({
5+
server: { strictPort: true },
6+
});

playgrounds/geo-javascript/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"private": true,
55
"description": "Instant-meilisearch playground focussed on GeoSearch written with vanilla javascript",
66
"scripts": {
7-
"dev": "parcel serve index.html --open",
8-
"build": "parcel build index.html",
7+
"dev": "vite",
8+
"build": "vite build",
99
"lint": "eslint --ext .js .",
1010
"lint:fix": "eslint --ext .js --fix ."
1111
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"local": {
3-
"host": "http://localhost:5173"
3+
"host": "http://localhost:5174"
44
}
55
}

playgrounds/local-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"setup": "node setup.mjs",
1111
"lint": "eslint --ext .jsx,.js .",
1212
"lint:fix": "eslint --ext .jsx,.js --fix .",
13-
"test:e2e": "concurrently --kill-others -s first \"yarn dev\" \"cypress run --env playground=local --headed --no-exit\"",
13+
"test:e2e": "concurrently --kill-others -s first \"yarn dev\" \"cypress run --env playground=local\"",
1414
"test:e2e:watch": "concurrently --kill-others -s first \"yarn dev\" \"cypress open --env playground=local\""
1515
},
1616
"keywords": [

playgrounds/local-react/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ import react from '@vitejs/plugin-react';
33

44
// https://vite.dev/config/
55
export default defineConfig({
6+
server: { port: 5174, strictPort: true },
67
plugins: [react()],
78
});

playgrounds/react/.babelrc

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

playgrounds/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"private": true,
55
"description": "React playground for instant-meilisearch",
66
"scripts": {
7-
"dev": "parcel serve index.html --open --port 1111",
8-
"build": "parcel build index.html",
7+
"dev": "vite",
8+
"build": "vite build",
99
"lint": "eslint --ext .jsx,.js .",
1010
"lint:fix": "eslint --ext .jsx,.js --fix ."
1111
},

playgrounds/react/src/App.jsx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import 'instantsearch.css/themes/algolia-min.css'
2-
import React from 'react'
1+
import "instantsearch.css/themes/algolia-min.css";
32
import {
43
InstantSearch,
54
InfiniteHits,
@@ -11,24 +10,24 @@ import {
1110
Configure,
1211
SortBy,
1312
Snippet,
14-
} from 'react-instantsearch-dom'
13+
} from "react-instantsearch";
1514

16-
import './App.css'
17-
import { instantMeiliSearch } from '@meilisearch/instant-meilisearch'
15+
import "./App.css";
16+
import { instantMeiliSearch } from "@meilisearch/instant-meilisearch";
1817

1918
const { searchClient } = instantMeiliSearch(
20-
'https://ms-adf78ae33284-106.lon.meilisearch.io',
21-
'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303',
19+
"https://ms-adf78ae33284-106.lon.meilisearch.io",
20+
"a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303",
2221
{
23-
primaryKey: 'id',
24-
}
25-
)
22+
primaryKey: "id",
23+
},
24+
);
2625

2726
const App = () => (
2827
<div className="ais-InstantSearch">
2928
<h1>Meilisearch + React InstantSearch</h1>
3029
<h2>
31-
Search in Steam video games{' '}
30+
Search in Steam video games{" "}
3231
<span role="img" aria-label="emoji">
3332
🎮
3433
</span>
@@ -44,14 +43,14 @@ const App = () => (
4443
<SortBy
4544
defaultRefinement="steam-video-games"
4645
items={[
47-
{ value: 'steam-video-games', label: 'Relevant' },
46+
{ value: "steam-video-games", label: "Relevant" },
4847
{
49-
value: 'steam-video-games:recommendationCount:desc',
50-
label: 'Most Recommended',
48+
value: "steam-video-games:recommendationCount:desc",
49+
label: "Most Recommended",
5150
},
5251
{
53-
value: 'steam-video-games:recommendationCount:asc',
54-
label: 'Least Recommended',
52+
value: "steam-video-games:recommendationCount:asc",
53+
label: "Least Recommended",
5554
},
5655
]}
5756
/>
@@ -65,8 +64,8 @@ const App = () => (
6564
<RefinementList attribute="misc" />
6665
<Configure
6766
hitsPerPage={6}
68-
attributesToSnippet={['description:50']}
69-
snippetEllipsisText={'...'}
67+
attributesToSnippet={["description:50"]}
68+
snippetEllipsisText={"..."}
7069
/>
7170
</div>
7271
<div className="right-panel">
@@ -75,7 +74,7 @@ const App = () => (
7574
</div>
7675
</InstantSearch>
7776
</div>
78-
)
77+
);
7978

8079
const Hit = ({ hit }) => {
8180
return (
@@ -100,7 +99,7 @@ const Hit = ({ hit }) => {
10099
<b>Recommended:</b> {hit.recommendationCount}
101100
</div>
102101
</div>
103-
)
104-
}
102+
);
103+
};
105104

106-
export default App
105+
export default App;

0 commit comments

Comments
 (0)