Skip to content

Commit 2e6cd36

Browse files
authored
Merge branch 'main' into optional-words-beta
2 parents b3129a4 + bf8ef3a commit 2e6cd36

18 files changed

+306
-271
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v3
1111
- uses: actions/setup-node@v3
1212
with:
13-
node-version: 12
13+
node-version: 16
1414
registry-url: https://registry.npmjs.org/
1515
- name: Check release validity
1616
run: sh .github/scripts/check-release.sh

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ Here are the steps to release a beta version of this package:
175175
git checkout -b bump-meilisearch-v*.*.*-beta
176176
```
177177

178-
- Change the version in `package.json` with `*.*.*-xxx-beta.0` and commit it to the `v*.*.*-beta` branch. None or multiple `-xxx`are valid. Examples:
179-
- `v*.*.*-my-feature-beta.0`
180-
- `v*.*.*-beta.0`
178+
- Change the version in [`package.json`](/package.json) and [`src/package-version`](/src/package-version.ts) with `*.*.*-xxx-beta.0` and commit it to the `v*.*.*-beta` branch.
181179

182180
- Go to the [GitHub interface for releasing](https://github.com/meilisearch/instant-meilisearch/releases): on this page, click on `Draft a new release`.
183181

@@ -194,7 +192,7 @@ GitHub Actions will be triggered and push the beta version to [npm](https://www.
194192
💡 If you need to release a new beta for the same version (i.e. `vX.X.X-beta.1`):
195193
- merge the change into `bump-meilisearch-v*.*.*`
196194
- rebase the `vX.X.X-beta.0` branch
197-
- change the version name in `package.json`
195+
- change the version name in [`package.json`](/package.json) and [`src/package-version`](/src/package-version.ts)
198196
- creata a pre-release via the GitHub interface
199197

200198
<hr>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Usage:
127127

128128
### Finite Pagination
129129

130-
Finite pagination is used when you want to add a numbered pagination at the bottom of your hits (for example: `< << 1, 2, 3 > >>`).
130+
Finite pagination is used when you want to add a numbered pagination at the bottom of your hits (for example: `<< < 1, 2, 3 > >>`).
131131
To be able to know the amount of page numbers you have, a search is done requesting `paginationTotalHits` documents (default: `200`).
132132
With the amount of documents returned, instantsearch is able to render the correct amount of numbers in the pagination widget.
133133

@@ -271,7 +271,7 @@ This package only guarantees the compatibility with the [version v0.28.0 of Meil
271271

272272
**Node / NPM versions**:
273273

274-
- NodeJS >= 12.10 <= 14
274+
- NodeJS >= 12.10 <= 18
275275
- NPM >= 6.x
276276

277277
## 📜 API resources

src/adapter/search-request-adapter/__tests__/facets-distribution-assigns.tests.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ test('One field in cache present in distribution', () => {
55
{ genre: ['comedy'] },
66
{ genre: { comedy: 1 } }
77
)
8+
89
expect(returnedDistribution).toMatchObject({ genre: { comedy: 1 } })
910
})
1011

1112
test('One field in cache not present in distribution', () => {
1213
const returnedDistribution = addMissingFacets({ genre: ['comedy'] }, {})
14+
1315
expect(returnedDistribution).toMatchObject({ genre: { comedy: 0 } })
1416
})
1517

@@ -18,6 +20,7 @@ test('two field in cache only one present in distribution', () => {
1820
{ genre: ['comedy'], title: ['hamlet'] },
1921
{ genre: { comedy: 12 } }
2022
)
23+
2124
expect(returnedDistribution).toMatchObject({
2225
genre: { comedy: 12 },
2326
title: { hamlet: 0 },
@@ -29,6 +32,7 @@ test('two field in cache w/ different facet name none present in distribution',
2932
{ genre: ['comedy'], title: ['hamlet'] },
3033
{}
3134
)
35+
3236
expect(returnedDistribution).toMatchObject({
3337
genre: { comedy: 0 },
3438
title: { hamlet: 0 },
@@ -40,6 +44,7 @@ test('two field in cache w/ different facet name both present in distribution',
4044
{ genre: ['comedy'], title: ['hamlet'] },
4145
{ genre: { comedy: 12 }, title: { hamlet: 1 } }
4246
)
47+
4348
expect(returnedDistribution).toMatchObject({
4449
genre: { comedy: 12 },
4550
title: { hamlet: 1 },
@@ -51,6 +56,7 @@ test('Three field in cache w/ different facet name two present in distribution',
5156
{ genre: ['comedy', 'horror'], title: ['hamlet'] },
5257
{ genre: { comedy: 12 }, title: { hamlet: 1 } }
5358
)
59+
5460
expect(returnedDistribution).toMatchObject({
5561
genre: { comedy: 12, horror: 0 },
5662
title: { hamlet: 1 },
@@ -61,25 +67,30 @@ test('Cache is undefined and facets distribution is not', () => {
6167
const returnedDistribution = addMissingFacets(undefined, {
6268
genre: { comedy: 12 },
6369
})
70+
6471
expect(returnedDistribution).toMatchObject({ genre: { comedy: 12 } })
6572
})
6673

6774
test('Cache is empty object and facets distribution is not', () => {
6875
const returnedDistribution = addMissingFacets({}, { genre: { comedy: 12 } })
76+
6977
expect(returnedDistribution).toMatchObject({ genre: { comedy: 12 } })
7078
})
7179

7280
test('Cache is empty object and facets distribution empty object', () => {
7381
const returnedDistribution = addMissingFacets({}, {})
82+
7483
expect(returnedDistribution).toMatchObject({})
7584
})
7685

7786
test('Cache is undefined and facets distribution empty object', () => {
7887
const returnedDistribution = addMissingFacets(undefined, {})
88+
7989
expect(returnedDistribution).toMatchObject({})
8090
})
8191

8292
test('Cache is undefined and facets distribution is undefined', () => {
8393
const returnedDistribution = addMissingFacets(undefined, undefined)
94+
8495
expect(returnedDistribution).toMatchObject({})
8596
})

src/adapter/search-request-adapter/__tests__/filter-cache.tests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ describe.each(facetCacheData)(
6464
{ keepZeroFacets: false, defaultFacetDistribution: {} },
6565
{ filter: filters }
6666
)
67+
6768
expect(cache).toEqual(expectedCache)
6869
})
6970
}

src/adapter/search-request-adapter/__tests__/geo-rules.tests.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,23 @@ test('Adapt geoPoints rules with integer geo points', () => {
1717
const rules = adaptGeoPointsRules({
1818
insideBoundingBox: '1,2,3,4',
1919
})
20+
2021
expect(rules?.filter).toBe('_geoRadius(3.17650, 3.19394, 157201.47551181243)')
2122
})
2223

2324
test('Try geoContext with only a radius', () => {
2425
const rules = adaptGeoPointsRules({
2526
aroundRadius: 1,
2627
})
28+
2729
expect(rules).toBeUndefined()
2830
})
2931

3032
test('Try geoContext with an aroundLatLng', () => {
3133
const rules = adaptGeoPointsRules({
3234
aroundLatLng: '51.1241999, 9.662499900000057',
3335
})
36+
3437
expect(rules?.filter).toBeUndefined()
3538
})
3639

@@ -39,6 +42,7 @@ test('Try geoContext with an aroundLatLng and a radius', () => {
3942
aroundLatLng: '51.1241999, 9.662499900000057',
4043
aroundRadius: 1,
4144
})
45+
4246
expect(rules?.filter).toBe('_geoRadius(51.12420, 9.66250, 1)')
4347
})
4448

@@ -47,6 +51,7 @@ test('Try geoContext with an aroundLatLng and a 0 radius', () => {
4751
aroundLatLng: '51.1241999, 9.662499900000057',
4852
aroundRadius: 0,
4953
})
54+
5055
expect(rules?.filter).toBe('_geoRadius(51.12420, 9.66250, 0)')
5156
})
5257

@@ -56,19 +61,22 @@ test('Try geoContext with aroundLatLng, radius and insideBoundingBox', () => {
5661
aroundRadius: 1,
5762
insideBoundingBox: '1,2,3,4',
5863
})
64+
5965
expect(rules?.filter).toBe('_geoRadius(3.17650, 3.19394, 157201.47551181243)')
6066
})
6167
test('Try geoContext with a radius and insideBoundingBox', () => {
6268
const rules = adaptGeoPointsRules({
6369
aroundRadius: 1,
6470
insideBoundingBox: '1,2,3,4',
6571
})
72+
6673
expect(rules?.filter).toBe('_geoRadius(3.17650, 3.19394, 157201.47551181243)')
6774
})
6875
test('Try geoContext with aroundLatLng and insideBoundingBox', () => {
6976
const rules = adaptGeoPointsRules({
7077
aroundLatLng: '51.1241999, 9.662499900000057',
7178
insideBoundingBox: '1,2,3,4',
7279
})
80+
7381
expect(rules?.filter).toBe('_geoRadius(3.17650, 3.19394, 157201.47551181243)')
7482
})

0 commit comments

Comments
 (0)