Skip to content

Commit bb2694d

Browse files
authored
chore: update dependencies
2 parents a9db8bc + babcf44 commit bb2694d

Some content is hidden

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

41 files changed

+4926
-7632
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ aliases:
2323
defaults: &defaults
2424
working_directory: ~/repo
2525
docker:
26-
- image: circleci/node:12.14.1
26+
- image: cimg/node:14.18.2
2727

2828
version: 2
2929
jobs:

.eslintrc.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
module.exports = {
22
extends: ['algolia', 'algolia/react'],
33
rules: {
4-
'react/prop-types': 0,
5-
'no-param-reassign': 0,
64
'eslint-comments/disable-enable-pair': 0,
5+
// Do not enforce a specific import order
6+
'import/order': 0,
7+
// Allow function components
8+
'react/function-component-definition': 0,
9+
// Allow boolean props without explicit values
10+
'react/jsx-boolean-value': 0,
11+
// Allow JSX content in .js files
12+
'react/jsx-filename-extension': 0,
13+
// Do not enforce event listeners naming conventions
14+
'react/jsx-handler-names': 0,
15+
// Allow passing function references to event listeners
16+
'react/jsx-no-bind': 0,
717
// Avoid errors about `UNSAFE` lifecycles (e.g. `UNSAFE_componentWillMount`)
818
'react/no-deprecated': 0,
19+
'react/prop-types': 0,
920
'react-hooks/rules-of-hooks': 'error',
1021
'react-hooks/exhaustive-deps': 'warn',
1122
},
@@ -14,4 +25,10 @@ module.exports = {
1425
version: 'detect',
1526
},
1627
},
28+
parserOptions: {
29+
requireConfigFile: false,
30+
babelOptions: {
31+
presets: ['@babel/preset-react'],
32+
},
33+
},
1734
};
153 KB
Loading

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.14.1
1+
14.18.2

.stylelintrc.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"stylelint-prettier/recommended"
1212
],
1313
"rules": {
14-
"selector-class-pattern": [
15-
"^(?:ais-|uni-)[A-Z][a-zA-Z0-9]+[-a-zA-Z0-9]+$|^(?!ais-|uni-)(?:[a-z][a-z0-9]+)(?:-[a-z0-9]+)+$"
16-
],
14+
"alpha-value-notation": "number",
15+
"color-function-notation": "legacy",
16+
"selector-class-pattern": "^(?:ais-|uni-)[A-Z][a-zA-Z0-9]+[-a-zA-Z0-9]+$|^(?!ais-|uni-)(?:[a-z][a-z0-9]+)(?:-[a-z0-9]+)+$",
1717
"prettier/prettier": true,
1818
"max-nesting-depth": [
1919
2,
@@ -31,6 +31,12 @@
3131
{
3232
"severity": "warning"
3333
}
34+
],
35+
"value-keyword-case": [
36+
"lower",
37+
{
38+
"ignoreKeywords": ["currentColor", "optimizeSpeed"]
39+
}
3440
]
3541
}
3642
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Unified InstantSearch E-Commerce
22

33
<p align="center">
4-
<img src="https://cl.ly/c3fa6a6b250a/Screenshot%2525202019-05-27%252520at%25252010.17.35.png" />
4+
<a href="https://www.algolia.com/doc/guides/building-search-ui/resources/unified-instantsearch/react/"><img src="./.github/unified-instantsearch-ecommerce.png" alt="Unified InstantSearch E-Commerce" width="1280" /></a>
55
</p>
66

77
**This project aims to be used by any e-commerce website to bootstrap a search experience powered by Algolia the fastest way possible.**

package.json

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,68 +8,69 @@
88
"export": "NODE_ENV=production webpack --config webpack/build.babel.js",
99
"preview": "NODE_ENV=production webpack --config webpack/preview.babel.js",
1010
"lint": "run-p -c lint:*",
11-
"lint:js": "eslint --ext .js .",
11+
"lint:js": "eslint --ext .js src",
1212
"lint:css": "stylelint '**/*.(s)css'",
1313
"release": "shipjs prepare"
1414
},
1515
"dependencies": {
16-
"algoliasearch": "4.1.0",
16+
"algoliasearch": "4.12.2",
1717
"invariant": "2.2.4",
18-
"preact": "10.4.0",
19-
"qs": "6.9.3",
20-
"react-instantsearch-dom": "6.4.0",
21-
"react-router-dom": "5.1.2",
18+
"preact": "10.6.6",
19+
"qs": "6.10.3",
20+
"react-instantsearch-dom": "6.22.0",
21+
"react-router-dom": "6.2.2",
2222
"rheostat": "2.2.0",
2323
"search-insights": "1.4.0"
2424
},
2525
"devDependencies": {
26-
"@babel/core": "7.9.0",
27-
"@babel/preset-env": "7.9.5",
28-
"@babel/preset-react": "7.9.4",
29-
"@babel/register": "7.9.0",
30-
"babel-eslint": "10.1.0",
31-
"babel-loader": "8.1.0",
26+
"@babel/core": "7.17.5",
27+
"@babel/eslint-parser": "7.17.0",
28+
"@babel/preset-env": "7.16.11",
29+
"@babel/preset-react": "7.16.7",
30+
"@babel/register": "7.17.0",
31+
"babel-loader": "8.2.3",
3232
"babel-plugin-strip-invariant": "1.0.0",
33-
"clean-webpack-plugin": "3.0.0",
34-
"copy-webpack-plugin": "5.1.1",
35-
"css-loader": "3.5.2",
36-
"eslint": "6.8.0",
37-
"eslint-config-algolia": "15.0.0",
38-
"eslint-config-prettier": "6.10.1",
39-
"eslint-plugin-eslint-comments": "3.1.2",
40-
"eslint-plugin-import": "2.20.2",
41-
"eslint-plugin-jest": "23.8.2",
42-
"eslint-plugin-prettier": "3.1.3",
43-
"eslint-plugin-react": "7.19.0",
44-
"eslint-plugin-react-hooks": "3.0.0",
45-
"html-webpack-plugin": "4.3.0",
33+
"copy-webpack-plugin": "10.2.4",
34+
"css-loader": "6.6.0",
35+
"css-minimizer-webpack-plugin": "3.4.1",
36+
"eslint": "8.10.0",
37+
"eslint-config-algolia": "20.0.0",
38+
"eslint-config-prettier": "8.5.0",
39+
"eslint-plugin-eslint-comments": "3.2.0",
40+
"eslint-plugin-import": "2.25.4",
41+
"eslint-plugin-jest": "26.1.1",
42+
"eslint-plugin-jsdoc": "37.9.6",
43+
"eslint-plugin-jsx-a11y": "6.5.1",
44+
"eslint-plugin-prettier": "4.0.0",
45+
"eslint-plugin-react": "7.29.2",
46+
"eslint-plugin-react-hooks": "4.3.0",
47+
"html-webpack-plugin": "5.5.0",
4648
"ignore-styles": "5.0.1",
47-
"mini-css-extract-plugin": "0.9.0",
49+
"mini-css-extract-plugin": "2.5.3",
4850
"module-alias": "2.2.2",
49-
"node-sass": "4.13.1",
5051
"npm-run-all": "4.1.5",
51-
"optimize-css-assets-webpack-plugin": "5.0.3",
52-
"postcss": "7.0.27",
52+
"postcss": "8.4.7",
5353
"postcss-inject-css-variables": "0.0.2",
54-
"postcss-loader": "3.0.0",
55-
"postcss-preset-env": "6.7.0",
56-
"prettier": "2.0.4",
57-
"sass-loader": "8.0.2",
58-
"shipjs": "0.21.0",
59-
"style-loader": "1.2.1",
60-
"stylelint": "13.3.2",
54+
"postcss-loader": "6.2.1",
55+
"postcss-preset-env": "7.4.2",
56+
"prettier": "2.5.1",
57+
"sass": "1.49.9",
58+
"sass-loader": "12.6.0",
59+
"shipjs": "0.24.3",
60+
"style-loader": "3.3.1",
61+
"stylelint": "14.5.3",
6162
"stylelint-a11y": "1.2.3",
62-
"stylelint-config-prettier": "8.0.1",
63-
"stylelint-config-sass-guidelines": "7.0.0",
64-
"stylelint-config-standard": "20.0.0",
65-
"stylelint-no-unsupported-browser-features": "4.0.0",
66-
"stylelint-order": "4.0.0",
67-
"stylelint-prettier": "1.1.2",
68-
"terser-webpack-plugin": "2.3.6",
69-
"webpack": "4.43.0",
70-
"webpack-cli": "3.3.11",
71-
"webpack-dev-server": "3.10.3",
72-
"webpack-merge": "4.2.2"
63+
"stylelint-config-prettier": "9.0.3",
64+
"stylelint-config-sass-guidelines": "9.0.1",
65+
"stylelint-config-standard": "25.0.0",
66+
"stylelint-no-unsupported-browser-features": "5.0.3",
67+
"stylelint-order": "5.0.0",
68+
"stylelint-prettier": "2.0.0",
69+
"terser-webpack-plugin": "5.3.1",
70+
"webpack": "5.69.1",
71+
"webpack-cli": "4.9.2",
72+
"webpack-dev-server": "4.7.4",
73+
"webpack-merge": "5.8.0"
7374
},
7475
"_moduleAliases": {
7576
"react": "node_modules/preact/compat"

postcss.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/* eslint-disable import/no-commonjs, no-global-assign */
22

3-
// When the configuration file refers to `window`, we need to shim it so it
4-
// doesn't break when processed with Node during the build step.
5-
window = global;
6-
73
require('module-alias/register');
84
require('ignore-styles');
95

src/App.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { createPortal } from 'preact/compat';
22
import { connectHitInsights } from 'react-instantsearch-dom';
3-
import { useHistory, useLocation } from 'react-router-dom';
3+
import { useNavigate, useLocation } from 'react-router-dom';
44

55
import { getUrlFromState, getStateFromUrl, createURL } from './router';
66
import { useSearchClient, useInsights, useMatchMedia } from './hooks';
@@ -10,7 +10,7 @@ export const AppContext = React.createContext(null);
1010
export const SearchContext = React.createContext(null);
1111

1212
export function App({ config }) {
13-
const history = useHistory();
13+
const navigate = useNavigate();
1414
const location = useLocation();
1515
const searchClient = useSearchClient(config);
1616
const { aa, userToken } = useInsights(
@@ -60,10 +60,9 @@ export function App({ config }) {
6060
clearTimeout(lastSetStateId.current);
6161

6262
lastSetStateId.current = setTimeout(() => {
63-
history.push(
64-
getUrlFromState({ location }, nextSearchState),
65-
nextSearchState
66-
);
63+
navigate(getUrlFromState({ location }, nextSearchState), {
64+
state: nextSearchState,
65+
});
6766

6867
if (config.googleAnalytics) {
6968
window.ga('send', 'pageView', `?query=${nextSearchState.query}`);
@@ -114,11 +113,11 @@ export function App({ config }) {
114113
setSearchState(nextSearchState);
115114

116115
if (JSON.stringify(searchState) !== JSON.stringify(nextSearchState)) {
117-
history.push('', nextSearchState);
116+
navigate('', { state: nextSearchState });
118117
}
119118
}
120119
// eslint-disable-next-line react-hooks/exhaustive-deps
121-
}, [isOverlayShowing, setSearchState, history]);
120+
}, [isOverlayShowing, setSearchState, navigate]);
122121

123122
React.useEffect(() => {
124123
if (topAnchor.current) {
@@ -196,6 +195,7 @@ export function App({ config }) {
196195
<div
197196
style={{ zIndex: config.styles.baseZIndex }}
198197
className="uni-Overlay"
198+
aria-hidden="true"
199199
onClick={() => setIsOverlayShowing(false)}
200200
/>
201201

@@ -214,12 +214,12 @@ export function App({ config }) {
214214
searchClient={searchClient}
215215
indexName={config.index.indexName}
216216
searchState={searchState}
217-
onSearchStateChange={onSearchStateChange}
218217
createURL={createURL}
219-
onClose={() => setIsOverlayShowing(false)}
220218
setView={setView}
221219
isFiltering={isFiltering}
222220
setIsFiltering={setIsFiltering}
221+
onSearchStateChange={onSearchStateChange}
222+
onClose={() => setIsOverlayShowing(false)}
223223
/>
224224
</SearchContext.Provider>
225225
</div>

0 commit comments

Comments
 (0)