Skip to content

Commit b8491f3

Browse files
bors[bot]bidoubiwa
andauthored
Merge #225
225: Add css and playground r=bidoubiwa a=bidoubiwa In this PR: - Moved all examples to `tests/env` folder as they were not really examples. - Add `basic_search.css` template for ease of integration - Add HTML playground example - refactor CI commands Co-authored-by: Charlotte Vermandel <[email protected]> Co-authored-by: cvermand <[email protected]>
2 parents 78ec0c9 + 99771ca commit b8491f3

Some content is hidden

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

42 files changed

+6656
-82
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ jobs:
2424
run: yarn test
2525
- name: Build project
2626
run: yarn build
27-
- name: Run ESM demo
28-
run: yarn test:demo:esm
29-
- name: Run Node.js demo
30-
run: yarn test:demo:nodejs
31-
- name: Run Browser demo
32-
run: yarn test:demo:browser
27+
- name: Run env tests
28+
run: yarn test:env
29+
3330

3431
style:
3532
name: style-check
@@ -50,9 +47,5 @@ jobs:
5047
- uses: actions/checkout@v1
5148
- name: Install dependencies
5249
run: yarn install
53-
- name: Run Vue build
54-
run: yarn build:playground:vue
55-
- name: Run React build
56-
run: yarn build:playground:react
57-
- name: Run Vanilla JS build
58-
run: yarn build:playground:vanilla-js
50+
- name: Run Playgrounds Builds
51+
run: yarn test:playgrounds

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,6 @@ dist
105105

106106
# misc
107107
.DS_Store
108+
109+
# parcel
110+
.parcel_cache/

CONTRIBUTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,14 @@ Or the React playground:
6969
$ yarn playground:react
7070
```
7171

72-
Or the Vanilla JavaScript playground:
72+
Or the JavaScript playground:
7373
```
74-
$ yarn playground:vanilla-js
74+
$ yarn playground:javascript
75+
```
76+
77+
Or the HTML playground:
78+
```
79+
$ yarn playground:html
7580
```
7681

7782
## Git Guidelines

examples/express/.DS_Store

-6 KB
Binary file not shown.

examples/express/public/instant-meilisearch.umd.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
verbose: true,
3-
modulePathIgnorePatterns: ['<rootDir>/examples'],
3+
modulePathIgnorePatterns: ['<rootDir>/tests/env'],
44
}

package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,32 @@
55
"description": "The search client to use MeiliSearch with InstantSearch.",
66
"scripts": {
77
"test": "jest",
8-
"test:demo": "yarn build && yarn test:demo:browser && yarn test:demo:nodejs && yarn test:demo:esm",
9-
"test:demo:browser": "yarn --cwd examples/express && yarn --cwd examples/express test",
10-
"test:demo:nodejs": "node examples/node/index.js",
11-
"test:demo:esm": "yarn --cwd examples/esm && yarn --cwd examples/esm start",
8+
"test:env": "yarn build && yarn test:env:browser && yarn test:env:nodejs && yarn test:env:esm",
9+
"test:env:browser": "yarn --cwd tests/env/express && yarn --cwd tests/env/express test",
10+
"test:env:nodejs": "node tests/env/node/index.js",
11+
"test:env:esm": "yarn --cwd tests/env/esm && yarn --cwd tests/env/esm start",
12+
"test:playgrounds": "yarn build:playground:vue && yarn build:playground:react && yarn build:playground:javascript && yarn build:playground:html",
1213
"build:playground:vue": "yarn --cwd ./playgrounds/vue && yarn --cwd ./playgrounds/vue build",
1314
"build:playground:react": "yarn --cwd ./playgrounds/react && yarn --cwd ./playgrounds/react build",
14-
"build:playground:vanilla-js": "yarn --cwd ./playgrounds/vanilla-js && yarn --cwd ./playgrounds/vanilla-js build",
15+
"build:playground:javascript": "yarn --cwd ./playgrounds/javascript && yarn --cwd ./playgrounds/javascript build",
16+
"build:playground:html": "yarn --cwd ./playgrounds/html && yarn --cwd ./playgrounds/html build",
1517
"test:all": "yarn test && yarn test:demo",
1618
"lint": "eslint --ext .js,.ts,.tsx,.vue .",
1719
"lint:fix": "eslint --ext .js,.ts,.tsx,.vue --fix .",
1820
"build": "rollup -c rollup.config.js && rollup --environment NODE_ENV:production -c rollup.config.js ",
1921
"playground:vue": "yarn --cwd ./playgrounds/vue && yarn --cwd ./playgrounds/vue serve",
2022
"playground:react": "yarn --cwd ./playgrounds/react && yarn --cwd ./playgrounds/react start",
21-
"playground:vanilla-js": "yarn --cwd ./playgrounds/vanilla-js && yarn --cwd ./playgrounds/vanilla-js start"
23+
"playground:javascript": "yarn --cwd ./playgrounds/javascript && yarn --cwd ./playgrounds/javascript start",
24+
"playground:html": "yarn --cwd ./playgrounds/html && yarn --cwd ./playgrounds/html start"
2225
},
2326
"main": "./dist/instant-meilisearch.umd.js",
2427
"module": "./dist/instant-meilisearch.esm.js",
2528
"browser": "./dist/instant-meilisearch.umd.js",
2629
"cjs": "./dist/instant-meilisearch.cjs.js",
2730
"files": [
2831
"dist",
29-
"src"
32+
"src",
33+
"templates"
3034
],
3135
"keywords": [
3236
"search",
@@ -52,6 +56,7 @@
5256
"@typescript-eslint/parser": "^4.14.0",
5357
"babel-eslint": "^10.1.0",
5458
"babel-jest": "^26.1.0",
59+
"cssnano": "^4.1.10",
5560
"eslint": "^7.13.0",
5661
"eslint-config-prettier": "^7.2.0",
5762
"eslint-config-react-app": "^6.0.0",

playgrounds/html/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.parcel_cache/

playgrounds/html/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# MeiliSearch Simple Game Search
2+
3+
This repository is a **playground**, all the following files are hot-reloading:
4+
- _ROOT_/src/*
5+
- _ROOT_/template/basic_search.css
6+
- ./public/index.html
7+
8+
meaning you can change the code of this demo but also `instant-meilisearch` and it will hot reload (if you run it with `yarn serve`).
9+
10+
The main purpose of this example is to showcase that instant-meilisearch can be easely included in an existing front-end application using `<script>` tags.
11+
12+
The demo in this directory showcases a basic search that will let you search through games names.
13+
14+
[![Nobel prices demo](asset/stardew.gif)](https://nobel.meilisearch.com)
15+
16+
## Project setup
17+
18+
```bash
19+
$ yarn install
20+
```
21+
22+
### Compile and hot-reload for development
23+
```
24+
yarn serve
25+
```
26+
27+
### Compile and minify for production
28+
```
29+
yarn build
30+
```
31+
32+
### Customize configuration
33+
34+
See [Configuration Reference](https://cli.vuejs.org/config/).
35+
36+
💡 If you have never used InstantSearch, we recommend reading this [getting started documentation](https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/).

playgrounds/html/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "web",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"start": "parcel serve ./public/index.html --global instantMeiliSearch --open",
9+
"build": "parcel build ./public/index.html --global instantMeiliSearch"
10+
},
11+
"browserslist": [
12+
"last 3 and_chr versions",
13+
"last 3 chrome versions",
14+
"last 3 opera versions",
15+
"last 3 ios_saf versions",
16+
"last 3 safari versions"
17+
],
18+
"author": "",
19+
"license": "ISC",
20+
"dependencies": {},
21+
"devDependencies": {
22+
"@babel/core": "^7.12.10",
23+
"parcel-bundler": "^1.12.4"
24+
}
25+
}

0 commit comments

Comments
 (0)