Skip to content

Commit 56d5a46

Browse files
committed
Merge with latest changes to main
2 parents 5b6be19 + 26ce5c3 commit 56d5a46

File tree

22 files changed

+196
-68
lines changed

22 files changed

+196
-68
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ updates:
55
schedule:
66
interval: "monthly"
77
labels:
8-
- "skip-changelog"
98
- "dependencies"
109
rebase-strategy: disabled
1110

.github/workflows/dependabot-auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
auto-merge:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- uses: ahmadnassri/action-dependabot-auto-merge@v2
1414
with:
1515
target: patch

.github/workflows/meilisearch-prototype-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
outputs:
1717
version: ${{ steps.grep-step.outputs.meilisearch_version }}
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Grep docker beta version of Meilisearch
2121
id: grep-step
2222
run: |
@@ -43,7 +43,7 @@ jobs:
4343
name: autocomplete-client end-to-end-tests
4444
steps:
4545
- name: Checkout
46-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
4747
- name: Setup node
4848
uses: actions/setup-node@v3
4949
with:
@@ -83,7 +83,7 @@ jobs:
8383
name: instant-meilisearch end-to-end-tests
8484
steps:
8585
- name: Checkout
86-
uses: actions/checkout@v3
86+
uses: actions/checkout@v4
8787
- name: Setup node
8888
uses: actions/setup-node@v3
8989
with:
@@ -126,7 +126,7 @@ jobs:
126126
node: ['14', '16', '18']
127127
name: integration-tests (Node.js ${{ matrix.node }})
128128
steps:
129-
- uses: actions/checkout@v3
129+
- uses: actions/checkout@v4
130130
- name: Setup node
131131
uses: actions/setup-node@v3
132132
with:

.github/workflows/pre-release-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
outputs:
2121
version: ${{ steps.grep-step.outputs.meilisearch_version }}
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
- name: Grep docker beta version of Meilisearch
2525
id: grep-step
2626
run: |
@@ -41,7 +41,7 @@ jobs:
4141
name: autocomplete-client end-to-end-tests
4242
steps:
4343
- name: Checkout
44-
uses: actions/checkout@v3
44+
uses: actions/checkout@v4
4545
- name: Setup node
4646
uses: actions/setup-node@v3
4747
with:
@@ -82,7 +82,7 @@ jobs:
8282
name: instant-meilisearch end-to-end-tests
8383
steps:
8484
- name: Checkout
85-
uses: actions/checkout@v3
85+
uses: actions/checkout@v4
8686
- name: Setup node
8787
uses: actions/setup-node@v3
8888
with:
@@ -126,7 +126,7 @@ jobs:
126126
node: ['14', '16', '18']
127127
name: integration-tests (Node.js ${{ matrix.node }})
128128
steps:
129-
- uses: actions/checkout@v3
129+
- uses: actions/checkout@v4
130130
- name: Setup node
131131
uses: actions/setup-node@v3
132132
with:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Release
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- uses: actions/setup-node@v3
2020
with:
2121
node-version: '18.x'

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
name: autocomplete-client end-to-end-tests
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@v3
37+
uses: actions/checkout@v4
3838
- name: Setup node
3939
uses: actions/setup-node@v3
4040
with:
@@ -84,7 +84,7 @@ jobs:
8484
name: instant-meilisearch end-to-end-tests
8585
steps:
8686
- name: Checkout
87-
uses: actions/checkout@v3
87+
uses: actions/checkout@v4
8888
- name: Setup node
8989
uses: actions/setup-node@v3
9090
with:
@@ -137,7 +137,7 @@ jobs:
137137
node: ['14', '16', '18']
138138
name: integration-tests (Node.js ${{ matrix.node }})
139139
steps:
140-
- uses: actions/checkout@v3
140+
- uses: actions/checkout@v4
141141
- name: Setup node
142142
uses: actions/setup-node@v3
143143
with:
@@ -155,7 +155,7 @@ jobs:
155155
name: style-check
156156
runs-on: ubuntu-latest
157157
steps:
158-
- uses: actions/checkout@v3
158+
- uses: actions/checkout@v4
159159
- name: Setup node
160160
uses: actions/setup-node@v3
161161
with:
@@ -173,7 +173,7 @@ jobs:
173173
runs-on: ubuntu-latest
174174
name: types-check
175175
steps:
176-
- uses: actions/checkout@v3
176+
- uses: actions/checkout@v4
177177
- name: Setup node
178178
uses: actions/setup-node@v3
179179
with:

CONTRIBUTING.md

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

33
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

@@ -26,13 +26,13 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
2626

2727
## Development Workflow
2828

29-
### Setup <!-- omit in TOC -->
29+
### Setup
3030

3131
```bash
3232
yarn --dev
3333
```
3434

35-
### Tests and Linter <!-- omit in TOC -->
35+
### Tests and Linter
3636

3737
Each PR should pass the tests and the linter to be accepted.
3838

@@ -59,7 +59,26 @@ Example:
5959
turbo run test --filter=@meilisearch/instant-meilisearch
6060
```
6161

62-
### Playgrounds <!-- omit in TOC -->
62+
### Versioning with Changesets
63+
64+
⚠️ This step is crucial to merge a PR containing impacting changes for the package(s)! ⚠️
65+
66+
💡 Example of PR that does [NOT require a changeset](https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md#not-every-change-requires-a-changeset): updating the README.md or changes in tests files.
67+
68+
We use [changesets](https://github.com/Noviny/changesets) to do versioning.
69+
70+
For each PR that changes something in the package(s), you need to [add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) by running `yarn changeset`.
71+
72+
This command will run questions:
73+
- select the packages concerned by the PR changes
74+
- indicate how these changes impact the version (press enter to skip the question if you don't want to upgrade the `major` or the `minor`)
75+
- Write a brief summary of the changes
76+
77+
Modification will be applied to the `.changesets` directory. These changes should added to your PR.
78+
79+
Before the release, the new files in `.changesets` will be automatically removed. See our [release process](release-on-github-and-npm).
80+
81+
### Playgrounds
6382

6483
#### @meilisearch/instant-meilisearch playgrounds
6584

@@ -104,12 +123,12 @@ yarn playground:autocomplete
104123

105124
## Git Guidelines
106125

107-
### Git Branches <!-- omit in TOC -->
126+
### Git Branches
108127

109128
All changes must be made in a branch and submitted as PR.
110129
We do not enforce any branch naming style, but please use something descriptive of your changes.
111130

112-
### Git Commits <!-- omit in TOC -->
131+
### Git Commits
113132

114133
As minimal requirements, your commit message should:
115134
- be capitalized
@@ -119,19 +138,7 @@ As minimal requirements, your commit message should:
119138

120139
We don't follow any other convention, but if you want to use one, we recommend [this one](https://chris.beams.io/posts/git-commit/).
121140

122-
### Changesets <!-- omit in TOC -->
123-
124-
We use [changesets](https://github.com/Noviny/changesets) to do versioning. What that means is that you need to [add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) by running `yarn changeset`. The changeset you create contains which packages should be bumped, their associated semver type and the changelogs.
125-
126-
127-
> avant chaque release, les fichiers sont supprimés (voir process qui suit)
128-
129-
These changesets are added to the `.changesets` directory at the root of the repository, and should be added to your PR.
130-
Before a release, these files are removed (see [process](#release-on-github-and-npm)).
131-
132-
Some changes do [not require a changeset](https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md#not-every-change-requires-a-changeset). For example changes that does not impact the packages, e.g. : Updating the README.md or changes in tests files.
133-
134-
### GitHub Pull Requests <!-- omit in TOC -->
141+
### GitHub Pull Requests
135142

136143
Some notes on GitHub PRs:
137144

@@ -145,7 +152,7 @@ Some notes on GitHub PRs:
145152

146153
Meilisearch tools follow the [Semantic Versioning Convention](https://semver.org/).
147154

148-
### Automation to Rebase and Merge the PRs <!-- omit in TOC -->
155+
### Automation to Rebase and Merge the PRs
149156

150157
This project integrates a bot that helps us manage pull requests merging.<br>
151158
_[Read more about this](https://github.com/meilisearch/integration-guides/blob/main/resources/bors.md)._
@@ -154,15 +161,18 @@ _[Read more about this](https://github.com/meilisearch/integration-guides/blob/m
154161

155162
This repository uses the [changesets](https://github.com/Noviny/changesets) library to handle the version updates and the publishing on GitHub and `npm`.
156163

157-
When PRs are merged on `main`, they trigger the [`release` CI](./.github/workflows/publish.yml). This CI creates a PR titled `Version Packages` containing all the version updates and changelogs of the impacted packages. The PR updates the versions and the changelogs based on the `changesets` that were previously pushed on main (see [changeset section](#changesets)).
164+
⚠️ Each PR merged on `main` involving a change in the package(s) should contain modifications in the `.changeset` folder. See [changeset section](#versioning-with-changesets).
158165

159-
To release on GitHub and `npm` you must merge the `Version packages` PR. This will trigger the publishing action and create the GitHub and `npm` releases for all affected packages.
166+
Each merge on `main` triggers the [`release` CI](./.github/workflows/publish.yml) generating a PR titled `Version Packages`. This PR updates the versions and contains changelogs of the impacted packages based on the `yarn changesets` commands you ran on each PR.
167+
168+
To release on GitHub and `npm` you must merge this `Version packages` PR. This will trigger the publishing action and create the GitHub and `npm` releases for all affected packages.
160169

161170
See more in depth explaination on [versioning](https://github.com/changesets/changesets/blob/main/docs/command-line-options.md#version), [publishing](https://github.com/changesets/changesets/blob/main/docs/command-line-options.md#publish) and the [changesets github-action](https://github.com/changesets/action).
162171

163172
If you merged a beta branch, that was released, into main, you were probably in the `changesets` [pre-release](https://github.com/changesets/changesets/blob/main/docs/prereleases.md) mode (see section on [releasing a beta](#release-a-beta-version)). If the `pre.json` file is present in the `.changesets` folder, you need to exit that mode. This is possible by running `yarn changeset pre exit`. Once done, create a PR with the changes and merge it to main.
164173

165174
#### Codesandbox update
175+
166176
Once the version is available on npm, please update the instant-meilisearch version used in the different Code-Sandboxes we provide:
167177

168178
- [Meilisearch + InstantSearch](https://codesandbox.io/s/ms-is-mese9)

packages/instant-meilisearch/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @meilisearch/instant-meilisearch
22

3+
## 0.13.6
4+
5+
### Patch Changes
6+
7+
- abd298e: Fix HierarchicalMenu when keepZeroFacets is set to true
8+
- 52c3d9b: Update the meilisearch-js version
9+
310
## 0.13.5
411

512
### Patch Changes

packages/instant-meilisearch/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meilisearch/instant-meilisearch",
3-
"version": "0.13.5",
3+
"version": "0.13.6",
44
"private": false,
55
"description": "The search client to use Meilisearch with InstantSearch.",
66
"homepage": "https://github.com/meilisearch/meilisearch-js-plugins/tree/main/packages/instant-meilisearch",
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { fillMissingFacets } from '../init-facets-distribution'
2+
3+
describe('Fill missing facets', () => {
4+
it('should fill missing facets without changing the results', () => {
5+
const initialFacetDistribution = {
6+
movies: {
7+
'categories.lvl0': {
8+
goods: 6,
9+
},
10+
genres: {
11+
Action: 2,
12+
},
13+
},
14+
}
15+
16+
const searchResults = [
17+
{
18+
hits: [{ id: 1 }, { id: 2 }, { id: 3 }],
19+
processingTimeMs: 0,
20+
query: '',
21+
indexUid: 'movies',
22+
pagination: {
23+
finite: true,
24+
hitsPerPage: 0,
25+
page: 0,
26+
},
27+
facetDistribution: {
28+
'categories.lvl0': {
29+
goods: 42,
30+
},
31+
'categories.lvl1': {
32+
'goods > to drink': 1,
33+
},
34+
genres: {
35+
Action: 1,
36+
},
37+
},
38+
},
39+
]
40+
41+
const result = fillMissingFacets(initialFacetDistribution, searchResults)
42+
expect(result).toEqual({
43+
movies: {
44+
'categories.lvl0': {
45+
goods: 6,
46+
},
47+
'categories.lvl1': {
48+
'goods > to drink': 1,
49+
},
50+
genres: {
51+
Action: 2,
52+
},
53+
},
54+
})
55+
})
56+
})

0 commit comments

Comments
 (0)