Skip to content

Commit 7acc5f8

Browse files
authored
Merge branch 'main' into fix_url
2 parents 8714033 + 1fff6fa commit 7acc5f8

Some content is hidden

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

69 files changed

+6524
-388
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
/*
66
* REACT
77
*/
8-
files: ['playgrounds/react/**/*.js'],
8+
files: ['playgrounds/react/**/*.js', 'tests/env/react/**/*.js'],
99
env: {
1010
es2020: true,
1111
commonjs: true, // Needed to avoid import is reserved error

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ If applicable, add screenshots or logs to help explain your problem.
2323
**Environment (please complete the following information):**
2424
- OS: [e.g. Debian GNU/Linux]
2525
- Browser: [e.g. Chrome version 90.0]
26-
- MeiliSearch version: [e.g. v.0.20.0]
26+
- Meilisearch version: [e.g. v.0.20.0]
2727
- instant-meilisearch version: [e.g. v0.5.0]
2828
- instantsearch.js version: [e.g. v4.23.0]

.github/scripts/check-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# Checking if current tag matches the package version
4-
current_tag=$(echo $GITHUB_REF | tr -d 'refs/tags/v')
4+
current_tag=$(echo $GITHUB_REF | cut -d '/' -f 3 | tr -d ' ',v)
55
file_tag=$(grep '"version":' package.json | cut -d ':' -f 2- | tr -d ' ' | tr -d '"' | tr -d ',')
66
if [ "$current_tag" != "$file_tag" ]; then
77
echo "Error: the current tag does not match the version in package file(s)."
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Testing the code base against the Meilisearch pre-releases
2+
name: Pre-Release Tests
3+
4+
# Will only run for PRs and pushes to bump-meilisearch-v*
5+
on:
6+
push:
7+
branches: [bump-meilisearch-v*]
8+
pull_request:
9+
branches: [bump-meilisearch-v*]
10+
11+
jobs:
12+
cypress-run:
13+
runs-on: ubuntu-latest
14+
# Only test on Google Chrome
15+
container: cypress/browsers:node12.18.3-chrome87-ff82
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Cache dependencies
20+
uses: actions/cache@v2
21+
with:
22+
path: |
23+
./node_modules
24+
key: ${{ hashFiles('yarn.lock') }}
25+
- name: Setup node
26+
uses: actions/setup-node@v2
27+
with:
28+
node-version: "14.x"
29+
- name: Install dependencies
30+
run: yarn --dev && yarn --cwd ./tests/env/react
31+
- name: Grep latest version of Meilisearch
32+
run: |
33+
echo "MEILISEARCH_LATEST=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | sh)" >> $GITHUB_ENV
34+
- name: Download Meilisearch
35+
run: |
36+
curl https://github.com/meilisearch/meilisearch/releases/download/${{ env.MEILISEARCH_LATEST }}/meilisearch-linux-amd64 --output meilisearch --location
37+
chmod +x meilisearch
38+
- name: Run Meilisearch
39+
run: |
40+
./meilisearch --master-key=masterKey --no-analytics true &
41+
- name: Setup Meilisearch Index
42+
run: yarn local:env:setup
43+
- name: Run local browser tests
44+
uses: cypress-io/github-action@v2
45+
with:
46+
# Tests are only done on one playground to avoid long testing time
47+
start: yarn local:env:react
48+
env: playground=reactlocal
49+
spec: cypress/integration/local-ui.spec.js
50+
- uses: actions/upload-artifact@v2
51+
if: failure()
52+
with:
53+
name: cypress-screenshots
54+
path: cypress/screenshots
55+
- uses: actions/upload-artifact@v2
56+
if: failure()
57+
with:
58+
name: cypress-videos
59+
path: cypress/videos
60+
61+
tests:
62+
runs-on: ubuntu-latest
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
node: ["12", "14", "16"]
67+
name: integration-tests (Node.js ${{ matrix.node }})
68+
steps:
69+
- uses: actions/checkout@v2
70+
- name: Cache dependencies
71+
uses: actions/cache@v2
72+
with:
73+
path: |
74+
./node_modules
75+
key: ${{ hashFiles('yarn.lock') }}
76+
- name: Get the latest Meilisearch RC
77+
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
78+
- name: Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
79+
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} ./meilisearch --master-key=masterKey --no-analytics=true
80+
- name: Install dependencies
81+
run: yarn install
82+
- name: Run tests
83+
run: yarn test
84+
- name: Build project
85+
run: yarn build
86+
87+
style:
88+
name: style-check
89+
runs-on: ubuntu-latest
90+
91+
steps:
92+
- uses: actions/checkout@v2
93+
- name: Cache dependencies
94+
uses: actions/cache@v2
95+
with:
96+
path: |
97+
./node_modules
98+
key: ${{ hashFiles('yarn.lock') }}
99+
- name: Install dependencies
100+
run: yarn install
101+
- name: Tests style
102+
run: yarn lint
103+
- name: Yaml Style
104+
uses: ibiqlik/action-yamllint@v3
105+
with:
106+
config_file: .yamllint.yml
107+
types_test:
108+
runs-on: ubuntu-latest
109+
name: types-check
110+
steps:
111+
- uses: actions/checkout@v2
112+
- name: Cache dependencies
113+
uses: actions/cache@v2
114+
with:
115+
path: |
116+
./node_modules
117+
key: ${{ hashFiles('yarn.lock') }}
118+
- name: Setup node
119+
uses: actions/setup-node@v2
120+
- name: Install dependencies
121+
run: yarn --dev
122+
- name: Build project
123+
run: yarn build
124+
- name: Run types check
125+
run: yarn types

.github/workflows/publish.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Publish to npm
22
on:
3-
push:
4-
tags:
5-
- v*
3+
release:
4+
types: [published]
65

76
jobs:
87
publish-npm:
@@ -17,9 +16,15 @@ jobs:
1716
run: sh .github/scripts/check-release.sh
1817
- name: Install dependencies
1918
run: yarn install
20-
- name: Build
19+
- name: Build instant-meilisearch
2120
run: yarn build
22-
- name: Publish
21+
- name: Publish with latest tag
22+
if: "!github.event.release.prerelease"
2323
run: npm publish .
2424
env:
2525
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
26+
- name: Publish with beta tag
27+
if: "github.event.release.prerelease"
28+
run: npm publish . --tag beta
29+
env:
30+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/test.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111

1212
jobs:
1313
cypress-run:
14+
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
15+
# Will still run for each push to bump-meilisearch-v*
16+
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
1417
runs-on: ubuntu-latest
1518
# Only test on Google Chrome
1619
container: cypress/browsers:node12.18.3-chrome87-ff82
@@ -35,6 +38,7 @@ jobs:
3538
# Tests are only done on one playground to avoid long testing time
3639
start: yarn playground:vue
3740
env: playground=vue
41+
spec: cypress/integration/search-ui.spec.js
3842
- uses: actions/upload-artifact@v2
3943
if: failure()
4044
with:
@@ -45,8 +49,10 @@ jobs:
4549
with:
4650
name: cypress-videos
4751
path: cypress/videos
48-
4952
tests:
53+
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
54+
# Will still run for each push to bump-meilisearch-v*
55+
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
5056
runs-on: ubuntu-latest
5157
strategy:
5258
fail-fast: false
@@ -69,8 +75,10 @@ jobs:
6975
run: yarn test
7076
- name: Build project
7177
run: yarn build
72-
7378
style:
79+
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
80+
# Will still run for each push to bump-meilisearch-v*
81+
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
7482
name: style-check
7583
runs-on: ubuntu-latest
7684

@@ -90,3 +98,25 @@ jobs:
9098
uses: ibiqlik/action-yamllint@v3
9199
with:
92100
config_file: .yamllint.yml
101+
types_test:
102+
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
103+
# Will still run for each push to bump-meilisearch-v*
104+
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
105+
runs-on: ubuntu-latest
106+
name: types-check
107+
steps:
108+
- uses: actions/checkout@v2
109+
- name: Cache dependencies
110+
uses: actions/cache@v2
111+
with:
112+
path: |
113+
./node_modules
114+
key: ${{ hashFiles('yarn.lock') }}
115+
- name: Setup node
116+
uses: actions/setup-node@v2
117+
- name: Install dependencies
118+
run: yarn --dev
119+
- name: Build project
120+
run: yarn build
121+
- name: Run types check
122+
run: yarn types

CONTRIBUTING.md

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing <!-- omit in TOC -->
22

3-
First of all, thank you for contributing to MeiliSearch! The goal of this document is to provide everything you need to know in order to contribute to MeiliSearch and its different integrations.
3+
First of all, thank you for contributing to Meilisearch! The goal of this document is to provide everything you need to know in order to contribute to Meilisearch and its different integrations.
44

55
- [Assumptions](#assumptions)
66
- [How to Contribute](#how-to-contribute)
@@ -11,8 +11,8 @@ First of all, thank you for contributing to MeiliSearch! The goal of this docume
1111
## Assumptions
1212

1313
1. **You're familiar with [GitHub](https://github.com) and the [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) (PR) workflow.**
14-
2. **You've read the MeiliSearch [documentation](https://docs.meilisearch.com) and the [README](/README.md).**
15-
3. **You know about the [MeiliSearch community](https://docs.meilisearch.com/learn/what_is_meilisearch/contact.html). Please use this for help.**
14+
2. **You've read the Meilisearch [documentation](https://docs.meilisearch.com) and the [README](/README.md).**
15+
3. **You know about the [Meilisearch community](https://docs.meilisearch.com/learn/what_is_meilisearch/contact.html). Please use this for help.**
1616

1717
## How to Contribute
1818

@@ -38,7 +38,7 @@ Each PR should pass the tests and the linter to be accepted.
3838

3939
```bash
4040
# Tests with Jest
41-
docker pull getmeili/meilisearch:latest # Fetch the latest version of MeiliSearch image from Docker Hub
41+
docker pull getmeili/meilisearch:latest # Fetch the latest version of Meilisearch image from Docker Hub
4242
docker run -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics=true
4343
# Integration tests
4444
yarn test
@@ -115,7 +115,7 @@ Some notes on GitHub PRs:
115115

116116
## Release Process (for internal team only)
117117

118-
MeiliSearch tools follow the [Semantic Versioning Convention](https://semver.org/).
118+
Meilisearch tools follow the [Semantic Versioning Convention](https://semver.org/).
119119

120120
### Automation to Rebase and Merge the PRs <!-- omit in TOC -->
121121

@@ -143,12 +143,45 @@ GitHub Actions will be triggered and push the package to [npm](https://www.npmjs
143143

144144
Once the version is available on npm, please update the instant-meilisearch version used in the different Code-Sandboxes we provide:
145145

146-
- [MeiliSearch + InstantSearch](https://codesandbox.io/s/ms-is-mese9)
147-
- [MeiliSearch + Vue InstantSearch](https://codesandbox.io/s/ms-vue-is-1d6bi)
148-
- [MeiliSearch + React InstantSearch](https://codesandbox.io/s/ms-react-is-sh9ud)
146+
- [Meilisearch + InstantSearch](https://codesandbox.io/s/ms-is-mese9)
147+
- [Meilisearch + Vue InstantSearch](https://codesandbox.io/s/ms-vue-is-1d6bi)
148+
- [Meilisearch + React InstantSearch](https://codesandbox.io/s/ms-react-is-sh9ud)
149149

150150
If you don't have the access to do it, please request it internally.
151151

152+
#### Release a `beta` Version
153+
154+
Here are the steps to release a beta version of this package:
155+
156+
- Create a new branch originating the branch containing the "beta" changes. For example, if during the Meilisearch pre-release, create a branch originating `bump-meilisearch-v*.*.*`.<br>
157+
`vX.X.X` is the next version of the package, NOT the version of Meilisearch!
158+
159+
```bash
160+
git checkout bump-meilisearch-v*.*.*
161+
git pull origin bump-meilisearch-v*.*.*
162+
git checkout -b vX.X.X-beta.0
163+
```
164+
165+
- Change the version in `package.json` by `vX.X.X-beta.0` and commit it to the `vX.X.X-beta.0` branch
166+
167+
- Go to the [GitHub interface for releasing](https://github.com/meilisearch/instant-meilisearch/releases): on this page, click on `Draft a new release`.
168+
169+
- Create a GitHub pre-release:
170+
- Fill the description with the detailed changelogs
171+
- Fill the title with `vX.X.X-beta.0`
172+
- Fill the tag with `vX.X.X-beta.0`
173+
- ⚠️ Select the `vX.X.X-beta.0` branch and NOT `main`
174+
- ⚠️ Click on the "This is a pre-release" checkbox
175+
- Click on "Publish release"
176+
177+
GitHub Actions will be triggered and push the beta version to [npm](https://www.npmjs.com/package/@meilisearch/instant-meilisearch).
178+
179+
💡 If you need to release a new beta for the same version (i.e. `vX.X.X-beta.1`):
180+
- merge the change into `bump-meilisearch-v*.*.*`
181+
- rebase the `vX.X.X-beta.0` branch
182+
- change the version name in `package.json`
183+
- creata a pre-release via the GitHub interface
184+
152185
<hr>
153186

154187
Thank you again for reading this through, we can not wait to begin to work with you if you made your way through this contributing guide ❤️

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2021 MeiliSearch
3+
Copyright (c) 2020-2021 Meilisearch
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)