Skip to content

Commit

Permalink
chore(version): bump algoliasearch version to v0.11.0 (#4938)
Browse files Browse the repository at this point in the history
* refactor(version): bump algoliasearch version to v0.11.0

* Import algoliasearch tarball package with type fix

* refactor(packages): Remove algoliasearch tarball

* refactor(types): Remove type work-arround for boundingBox (#2)

* Import algoliasearch client with type fix

* Remove unecessary type enforcement

* refactor(package): Bump algoliasearch to v0.11.0

fixes: #4916
  • Loading branch information
bidoubiwa authored Oct 21, 2021
1 parent e74411c commit ce6e159
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 145 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"search-insights": "^2.0.5"
},
"devDependencies": {
"@algolia/client-search": "4.10.3",
"@algolia/client-search": "4.11.0",
"@babel/cli": "7.8.4",
"@babel/core": "7.9.6",
"@babel/plugin-proposal-class-properties": "7.8.3",
Expand Down Expand Up @@ -95,7 +95,7 @@
"@wdio/selenium-standalone-service": "5.16.5",
"@wdio/spec-reporter": "5.16.5",
"@wdio/static-server-service": "5.16.5",
"algoliasearch": "4.10.3",
"algoliasearch": "4.11.0",
"algoliasearch-v3": "npm:algoliasearch@3.35.1",
"babel-eslint": "10.0.3",
"babel-jest": "27.1.0",
Expand Down
6 changes: 0 additions & 6 deletions src/connectors/geo-search/__tests__/connectGeoSearch-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
}),
]);

// @ts-expect-error connector uses strings
helper.setQueryParameter('insideBoundingBox', '10,12,14,16');

widget.init!(
Expand Down Expand Up @@ -660,7 +659,6 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
}),
]);

// @ts-expect-error connector uses strings
helper.setQueryParameter('insideBoundingBox', '10,12,14,16');

widget.init!(
Expand Down Expand Up @@ -696,7 +694,6 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
expect(lastRenderArgs(render).hasMapMoveSinceLastRefine()).toBe(true);
expect(lastRenderArgs(render).isRefinedWithMap()).toBe(true);

// @ts-expect-error connector uses strings
helper.setQueryParameter('insideBoundingBox', '12,14,16,18');

widget.render!(
Expand All @@ -721,7 +718,6 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
const helper = createFakeHelper();

// Simulate the configuration or external setter (like URLSync)
// @ts-expect-error connector uses strings
helper.setQueryParameter('insideBoundingBox', '10,12,12,14');

widget.init!(
Expand Down Expand Up @@ -1342,7 +1338,6 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
const widget = customGeoSearch({});
const helper = createFakeHelper();

// @ts-expect-error connector uses strings
helper.setQueryParameter('insideBoundingBox', '10,12,12,14');

const expectation = new SearchParameters({ index: '' });
Expand Down Expand Up @@ -1562,7 +1557,6 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/geo-search/
it('gives all render functions with refinement', () => {
const [widget, helper] = getInitializedWidget();
helper.setQueryParameter('aroundLatLng', '10, 12');
// @ts-expect-error connector uses strings
helper.setQueryParameter('insideBoundingBox', '10,12,11,2');

expect(
Expand Down
27 changes: 12 additions & 15 deletions src/connectors/geo-search/connectGeoSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,13 @@ const withUsage = createDocumentationMessageGenerator({
connector: true,
});

// in this connector, we assume insideBoundingBox is only a string,
// even though in the helper it's defined as number[][] alone.
// This can be done, since the connector assumes "control" of the parameter
function getBoundingBoxAsString(state: SearchParameters) {
return (state.insideBoundingBox as unknown as string) || '';
}
function setBoundingBoxAsString(state: SearchParameters, value: string) {
return state.setQueryParameter(
'insideBoundingBox',
value as unknown as number[][]
);
// in this connector, we ensure that boundIngBox is parsed into a string
function getBoundingBoxAsString(state: SearchParameters): string {
if (typeof state.insideBoundingBox === 'string')
return state.insideBoundingBox;
else {
return state.insideBoundingBox?.join() || '';
}
}

export type GeoHit = Hit & Required<Pick<Hit, '_geoLoc'>>;
Expand Down Expand Up @@ -188,7 +184,9 @@ const connectGeoSearch: GeoSearchConnector = (renderFn, unmountFn = noop) => {

helper
.setState(
setBoundingBoxAsString(helper.state, boundingBox).resetPage()
helper.state
.setQueryParameter('insideBoundingBox', boundingBox)
.resetPage()
)
.search();

Expand Down Expand Up @@ -392,9 +390,8 @@ const connectGeoSearch: GeoSearchConnector = (renderFn, unmountFn = noop) => {
undefined
);
}

return setBoundingBoxAsString(
searchParameters,
return searchParameters.setQueryParameter(
'insideBoundingBox',
uiState.geoSearch.boundingBox
);
},
Expand Down
244 changes: 122 additions & 122 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,109 @@
# yarn lockfile v1


"@algolia/cache-browser-local-storage@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.10.3.tgz#3bf81e0f66a4a1079a75914a987eb1ef432c7c68"
integrity sha512-TD1N7zg5lb56/PLjjD4bBl2eccEvVHhC7yfgFu2r9k5tf+gvbGxEZ3NhRZVKu2MObUIcEy2VR4LVLxOQu45Hlg==
dependencies:
"@algolia/cache-common" "4.10.3"

"@algolia/cache-common@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/cache-common/-/cache-common-4.10.3.tgz#311b2b5ae06d55300f4230944c99bc39ad15847d"
integrity sha512-q13cPPUmtf8a2suBC4kySSr97EyulSXuxUkn7l1tZUCX/k1y5KNheMp8npBy8Kc8gPPmHpacxddRSfOncjiKFw==

"@algolia/cache-in-memory@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/cache-in-memory/-/cache-in-memory-4.10.3.tgz#697e4994538426272ea29ccf2b32b46ea4c48862"
integrity sha512-JhPajhOXAjUP+TZrZTh6KJpF5VKTKyWK2aR1cD8NtrcVHwfGS7fTyfXfVm5BqBqkD9U0gVvufUt/mVyI80aZww==
dependencies:
"@algolia/cache-common" "4.10.3"

"@algolia/client-account@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/client-account/-/client-account-4.10.3.tgz#f2cbefb1abce74c341115607d6af199df1b056ae"
integrity sha512-S/IsJB4s+e1xYctdpW3nAbwrR2y3pjSo9X21fJGoiGeIpTRdvQG7nydgsLkhnhcgAdLnmqBapYyAqMGmlcyOkg==
dependencies:
"@algolia/client-common" "4.10.3"
"@algolia/client-search" "4.10.3"
"@algolia/transporter" "4.10.3"

"@algolia/client-analytics@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-4.10.3.tgz#43d934ef8df0cf551c78e6b2e9f2452e7fb27d93"
integrity sha512-vlHTbBqJktRgclh3v7bPQLfZvFIqY4erNFIZA5C7nisCj9oLeTgzefoUrr+R90+I+XjfoLxnmoeigS1Z1yg1vw==
dependencies:
"@algolia/client-common" "4.10.3"
"@algolia/client-search" "4.10.3"
"@algolia/requester-common" "4.10.3"
"@algolia/transporter" "4.10.3"

"@algolia/client-common@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-4.10.3.tgz#c4257dd5c57c5c8ec4bd48a7b1897573e372d403"
integrity sha512-uFyP2Z14jG2hsFRbAoavna6oJf4NTXaSDAZgouZUZlHlBp5elM38sjNeA5HR9/D9J/GjwaB1SgB7iUiIWYBB4w==
dependencies:
"@algolia/requester-common" "4.10.3"
"@algolia/transporter" "4.10.3"

"@algolia/client-personalization@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-4.10.3.tgz#58c800f90ab8ab4aa29abdf29a97e89e6bda419e"
integrity sha512-NS7Nx8EJ/nduGXT8CFo5z7kLF0jnFehTP3eC+z+GOEESH3rrs7uR12IZHxv5QhQswZa9vl925zCOZDcDVoENCg==
dependencies:
"@algolia/client-common" "4.10.3"
"@algolia/requester-common" "4.10.3"
"@algolia/transporter" "4.10.3"

"@algolia/client-search@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.10.3.tgz#aa6b02c2d528cb264830f276739b7f68b58988ef"
integrity sha512-Zwnp2G94IrNFKWCG/k7epI5UswRkPvL9FCt7/slXe2bkjP2y/HA37gzRn+9tXoLVRwd7gBzrtOA4jFKIyjrtVw==
dependencies:
"@algolia/client-common" "4.10.3"
"@algolia/requester-common" "4.10.3"
"@algolia/transporter" "4.10.3"

"@algolia/logger-common@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/logger-common/-/logger-common-4.10.3.tgz#6773d2e38581bf9ac57e2dda02f0c4f1bc72ce94"
integrity sha512-M6xi+qov2bkgg1H9e1Qtvq/E/eKsGcgz8RBbXNzqPIYoDGZNkv+b3b8YMo3dxd4Wd6M24HU1iqF3kmr1LaXndg==

"@algolia/logger-console@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/logger-console/-/logger-console-4.10.3.tgz#bd8bdc1f9dba89db37be25d673ac1f2e68de7913"
integrity sha512-vVgRI7b4PHjgBdRkv/cRz490twvkLoGdpC4VYzIouSrKj8SIVLRhey3qgXk7oQXi3xoxVAv6NrklHfpO8Bpx0w==
dependencies:
"@algolia/logger-common" "4.10.3"

"@algolia/requester-browser-xhr@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.10.3.tgz#81ae8f6caf562a28f96102f03da7f4b19bba568c"
integrity sha512-4WIk1zreFbc1EF6+gsfBTQvwSNjWc20zJAAExRWql/Jq5yfVHmwOqi/CajA53/cXKFBqo80DAMRvOiwP+hOLYw==
dependencies:
"@algolia/requester-common" "4.10.3"

"@algolia/requester-common@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/requester-common/-/requester-common-4.10.3.tgz#c3112393cff97be79863bc28de76f9c69b2f5a95"
integrity sha512-PNfLHmg0Hujugs3rx55uz/ifv7b9HVdSFQDb2hj0O5xZaBEuQCNOXC6COrXR8+9VEfqp2swpg7zwgtqFxh+BtQ==

"@algolia/requester-node-http@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-4.10.3.tgz#75ea7805ac0ba25a1124989d8632ef39c31441c1"
integrity sha512-A9ZcGfEvgqf0luJApdNcIhsRh6MShn2zn2tbjwjGG1joF81w+HUY+BWuLZn56vGwAA9ZB9n00IoJJpxibbfofg==
dependencies:
"@algolia/requester-common" "4.10.3"

"@algolia/transporter@4.10.3":
version "4.10.3"
resolved "https://registry.yarnpkg.com/@algolia/transporter/-/transporter-4.10.3.tgz#0aeee752923957cffe63e4cf1c7a22ca48d96dde"
integrity sha512-n1lRyKDbrckbMEgm7QXtj3nEWUuzA3aKLzVQ43/F/RCFib15j4IwtmYhXR6OIBRSc7+T0Hm48S0J6F+HeYCQkw==
dependencies:
"@algolia/cache-common" "4.10.3"
"@algolia/logger-common" "4.10.3"
"@algolia/requester-common" "4.10.3"
"@algolia/cache-browser-local-storage@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.11.0.tgz#1c168add00b398a860db6c86039e33b2843a9425"
integrity sha512-4sr9vHIG1fVA9dONagdzhsI/6M5mjs/qOe2xUP0yBmwsTsuwiZq3+Xu6D3dsxsuFetcJgC6ydQoCW8b7fDJHYQ==
dependencies:
"@algolia/cache-common" "4.11.0"

"@algolia/cache-common@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/cache-common/-/cache-common-4.11.0.tgz#066fe6d58b18e4b028dbef9bb8de07c5e22a3594"
integrity sha512-lODcJRuPXqf+6mp0h6bOxPMlbNoyn3VfjBVcQh70EDP0/xExZbkpecgHyyZK4kWg+evu+mmgvTK3GVHnet/xKw==

"@algolia/cache-in-memory@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/cache-in-memory/-/cache-in-memory-4.11.0.tgz#763c8cb655e6fd2261588e04214fca0959ac07c1"
integrity sha512-aBz+stMSTBOBaBEQ43zJXz2DnwS7fL6dR0e2myehAgtfAWlWwLDHruc/98VOy1ZAcBk1blE2LCU02bT5HekGxQ==
dependencies:
"@algolia/cache-common" "4.11.0"

"@algolia/client-account@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/client-account/-/client-account-4.11.0.tgz#67fadd3b0802b013ebaaa4b47bb7babae892374e"
integrity sha512-jwmFBoUSzoMwMqgD3PmzFJV/d19p1RJXB6C1ADz4ju4mU7rkaQLtqyZroQpheLoU5s5Tilmn/T8/0U2XLoJCRQ==
dependencies:
"@algolia/client-common" "4.11.0"
"@algolia/client-search" "4.11.0"
"@algolia/transporter" "4.11.0"

"@algolia/client-analytics@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-4.11.0.tgz#cbdc8128205e2da749cafc79e54708d14c413974"
integrity sha512-v5U9585aeEdYml7JqggHAj3E5CQ+jPwGVztPVhakBk8H/cmLyPS2g8wvmIbaEZCHmWn4TqFj3EBHVYxAl36fSA==
dependencies:
"@algolia/client-common" "4.11.0"
"@algolia/client-search" "4.11.0"
"@algolia/requester-common" "4.11.0"
"@algolia/transporter" "4.11.0"

"@algolia/client-common@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-4.11.0.tgz#9a2d1f6f8eaad25ba5d6d4ce307ba5bd84e6f999"
integrity sha512-Qy+F+TZq12kc7tgfC+FM3RvYH/Ati7sUiUv/LkvlxFwNwNPwWGoZO81AzVSareXT/ksDDrabD4mHbdTbBPTRmQ==
dependencies:
"@algolia/requester-common" "4.11.0"
"@algolia/transporter" "4.11.0"

"@algolia/client-personalization@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-4.11.0.tgz#d3bf0e760f85df876b4baf5b81996f0aa3a59940"
integrity sha512-mI+X5IKiijHAzf9fy8VSl/GTT67dzFDnJ0QAM8D9cMPevnfX4U72HRln3Mjd0xEaYUOGve8TK/fMg7d3Z5yG6g==
dependencies:
"@algolia/client-common" "4.11.0"
"@algolia/requester-common" "4.11.0"
"@algolia/transporter" "4.11.0"

"@algolia/client-search@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.11.0.tgz#c1105d715a2a04ba27231eca86f5d6620f68f4ae"
integrity sha512-iovPLc5YgiXBdw2qMhU65sINgo9umWbHFzInxoNErWnYoTQWfXsW6P54/NlKx5uscoLVjSf+5RUWwFu5BX+lpw==
dependencies:
"@algolia/client-common" "4.11.0"
"@algolia/requester-common" "4.11.0"
"@algolia/transporter" "4.11.0"

"@algolia/logger-common@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/logger-common/-/logger-common-4.11.0.tgz#bac1c2d59d29dee378b57412c8edd435b97de663"
integrity sha512-pRMJFeOY8hoWKIxWuGHIrqnEKN/kqKh7UilDffG/+PeEGxBuku+Wq5CfdTFG0C9ewUvn8mAJn5BhYA5k8y0Jqg==

"@algolia/logger-console@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/logger-console/-/logger-console-4.11.0.tgz#ced19e3abb22eb782ed5268d51efb5aa9ef109ef"
integrity sha512-wXztMk0a3VbNmYP8Kpc+F7ekuvaqZmozM2eTLok0XIshpAeZ/NJDHDffXK2Pw+NF0wmHqurptLYwKoikjBYvhQ==
dependencies:
"@algolia/logger-common" "4.11.0"

"@algolia/requester-browser-xhr@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.11.0.tgz#f9e1ad56f185432aa8dde8cad53ae271fd5d6181"
integrity sha512-Fp3SfDihAAFR8bllg8P5ouWi3+qpEVN5e7hrtVIYldKBOuI/qFv80Zv/3/AMKNJQRYglS4zWyPuqrXm58nz6KA==
dependencies:
"@algolia/requester-common" "4.11.0"

"@algolia/requester-common@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/requester-common/-/requester-common-4.11.0.tgz#d16de98d3ff72434bac39e4d915eab08035946a9"
integrity sha512-+cZGe/9fuYgGuxjaBC+xTGBkK7OIYdfapxhfvEf03dviLMPmhmVYFJtJlzAjQ2YmGDJpHrGgAYj3i/fbs8yhiA==

"@algolia/requester-node-http@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-4.11.0.tgz#beb2b6b68d5f4ce15aec80ede623f0ac96991368"
integrity sha512-qJIk9SHRFkKDi6dMT9hba8X1J1z92T5AZIgl+tsApjTGIRQXJLTIm+0q4yOefokfu4CoxYwRZ9QAq+ouGwfeOg==
dependencies:
"@algolia/requester-common" "4.11.0"

"@algolia/transporter@4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@algolia/transporter/-/transporter-4.11.0.tgz#a8de3c173093ceceb02b26b577395ce3b3d4b96f"
integrity sha512-k4dyxiaEfYpw4UqybK9q7lrFzehygo6KV3OCYJMMdX0IMWV0m4DXdU27c1zYRYtthaFYaBzGF4Kjcl8p8vxCKw==
dependencies:
"@algolia/cache-common" "4.11.0"
"@algolia/logger-common" "4.11.0"
"@algolia/requester-common" "4.11.0"

"@babel/cli@7.8.4":
version "7.8.4"
Expand Down Expand Up @@ -3200,25 +3200,25 @@ algoliasearch@3.35.0, algoliasearch@^3.35.1:
semver "^5.1.0"
tunnel-agent "^0.6.0"

algoliasearch@4.10.3:
version "4.10.3"
resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.10.3.tgz#22df4bb02fbf13a765b18b85df8745ee9c04f00a"
integrity sha512-OLY0AWlPKGLbSaw14ivMB7BT5fPdp8VdzY4L8FtzZnqmLKsyes24cltGlf7/X96ACkYEcT390SReCDt/9SUIRg==
dependencies:
"@algolia/cache-browser-local-storage" "4.10.3"
"@algolia/cache-common" "4.10.3"
"@algolia/cache-in-memory" "4.10.3"
"@algolia/client-account" "4.10.3"
"@algolia/client-analytics" "4.10.3"
"@algolia/client-common" "4.10.3"
"@algolia/client-personalization" "4.10.3"
"@algolia/client-search" "4.10.3"
"@algolia/logger-common" "4.10.3"
"@algolia/logger-console" "4.10.3"
"@algolia/requester-browser-xhr" "4.10.3"
"@algolia/requester-common" "4.10.3"
"@algolia/requester-node-http" "4.10.3"
"@algolia/transporter" "4.10.3"
algoliasearch@4.11.0:
version "4.11.0"
resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.11.0.tgz#234befb3ac355c094077f0edf3777240b1ee013c"
integrity sha512-IXRj8kAP2WrMmj+eoPqPc6P7Ncq1yZkFiyDrjTBObV1ADNL8Z/KdZ+dWC5MmYcBLAbcB/mMCpak5N/D1UIZvsA==
dependencies:
"@algolia/cache-browser-local-storage" "4.11.0"
"@algolia/cache-common" "4.11.0"
"@algolia/cache-in-memory" "4.11.0"
"@algolia/client-account" "4.11.0"
"@algolia/client-analytics" "4.11.0"
"@algolia/client-common" "4.11.0"
"@algolia/client-personalization" "4.11.0"
"@algolia/client-search" "4.11.0"
"@algolia/logger-common" "4.11.0"
"@algolia/logger-console" "4.11.0"
"@algolia/requester-browser-xhr" "4.11.0"
"@algolia/requester-common" "4.11.0"
"@algolia/requester-node-http" "4.11.0"
"@algolia/transporter" "4.11.0"

anchor-markdown-header@^0.5.5:
version "0.5.7"
Expand Down

0 comments on commit ce6e159

Please sign in to comment.