react-instantsearch-router-nextjs 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-present Algolia, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,151 @@
1
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
2
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3
+ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
4
+
5
+ - [react-instantsearch-router-nextjs](#react-instantsearch-router-nextjs)
6
+ - [Installation](#installation)
7
+ - [Usage](#usage)
8
+ - [API](#api)
9
+ - [Troubleshooting](#troubleshooting)
10
+ - [Contributing](#contributing)
11
+ - [License](#license)
12
+
13
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
14
+
15
+ # react-instantsearch-router-nextjs
16
+
17
+ This package is a router for [React InstantSearch](https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/react/) that is compatible with [Next.js](https://nextjs.org/) routing.
18
+
19
+ > :warning: **This function cannot be used in conjunction with [`getStaticProps()`](https://nextjs.org/docs/api-reference/data-fetching/get-static-props). Use `getServerSideProps()` or client-side rendering instead.**
20
+
21
+ ## Installation
22
+
23
+ ```sh
24
+ yarn add react-instantsearch-router-nextjs
25
+ # or with npm
26
+ npm install react-instantsearch-router-nextjs
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ You need to pass the Next.js router singleton that you can import from `next/router`.
32
+
33
+ If you are doing SSR with the `getServerState` and `InstantSearchSSRProvider` from `react-instantsearch/server`, you need to pass the `url` prop to `createInstantSearchRouterNext`'s `serverUrl` option :
34
+
35
+ ```js
36
+ import singletonRouter from 'next/router';
37
+ import { createInstantSearchRouterNext } from 'react-instantsearch-router-nextjs';
38
+
39
+ export default function Page({ serverState, url }) {
40
+ return (
41
+ <InstantSearchSSRProvider {...serverState}>
42
+ <InstantSearch
43
+ searchClient={searchClient}
44
+ indexName="instant_search"
45
+ routing={{ router: createInstantSearchRouterNext({ singletonRouter, serverUrl: url }) }}
46
+ >
47
+ {/* ... */}
48
+ </InstantSearch>
49
+ </InstantSearchSSRProvider>
50
+ );
51
+ }
52
+ ```
53
+
54
+ If you are not doing SSR but only CSR, you can omit the `serverUrl` option:
55
+
56
+ ```js
57
+ import singletonRouter from 'next/router';
58
+ import { createInstantSearchRouterNext } from 'react-instantsearch-router-nextjs';
59
+
60
+ export default function Page() {
61
+ return (
62
+ <InstantSearch
63
+ searchClient={searchClient}
64
+ indexName="instant_search"
65
+ routing={{ router: createInstantSearchRouterNext({ singletonRouter }) }}
66
+ >
67
+ {/* ... */}
68
+ </InstantSearch>
69
+ );
70
+ }
71
+ ```
72
+
73
+ Lastly, if you had custom routing logic in your app, you can pass it to the `createInstantSearchRouterNext`'s `routerOptions` option:
74
+
75
+ ```js
76
+ import singletonRouter from 'next/router';
77
+ import { createInstantSearchRouterNext } from 'react-instantsearch-router-nextjs';
78
+
79
+ export default function Page({ serverState, url }) {
80
+ return (
81
+ {/* ... */}
82
+ <InstantSearch
83
+ searchClient={searchClient}
84
+ indexName="instant_search"
85
+ routing={{
86
+ router: createInstantSearchRouterNext({
87
+ singletonRouter,
88
+ serverUrl: url,
89
+ routerOptions: {
90
+ createURL: /* ... */,
91
+ parseURL: /* ... */,
92
+ },
93
+ }),
94
+ // if you are using a custom `stateMapping` you can still pass it :
95
+ stateMapping: /* ... */,
96
+ }}
97
+ >
98
+ {/* ... */}
99
+ </InstantSearch>
100
+ {/* ... */}
101
+ );
102
+ }
103
+ ```
104
+
105
+ ## API
106
+
107
+ The options are :
108
+
109
+ - `singletonRouter: SingletonRouter`: the required Next.js router singleton.
110
+ - `serverUrl?: string`: the URL of the page on the server. Required if you are doing SSR with `getServerState` and `InstantSearchSSRProvider`.
111
+ - `routerOptions?: RouterOptions`: the options passed to the `history` router. See [the documentation](https://www.algolia.com/doc/api-reference/widgets/history-router/js/) for more details.
112
+
113
+ For troubleshooting purposes, some other options are available :
114
+
115
+ - `beforeStart?: (onUpdate: () => void) => void`: a function called before the router starts. You can use it to inform InstantSearch to update on router events by calling `onUpdate`.
116
+ - `beforeDispose?: () => void`: a function called before the router disposes. You can use it to clean up handlers you added in `beforeStart`.
117
+ - `beforePopState?: (options: { state: NextHistoryState, ownBeforePopState: BeforePopStateCallback, libraryBeforePopState: BeforePopStateCallback }) => boolean`: a function used by the Next.js router to know whether it should trigger SSR when using back/forward buttons. You can use it to override the default one by writing your own logic. The `ownBeforePopState` is the pre-existing handler that you may have set yourself, and the `libraryBeforePopState` is the default one from the library.
118
+
119
+ ## Troubleshooting
120
+
121
+ If you're experiencing issues, please refer to the [**Need help?**](https://algolia.com/doc/guides/building-search-ui/what-is-instantsearch/react/#need-help) section of the docs, or [open a new issue](https://github.com/algolia/instantsearch.js/issues/new?assignees=&labels=triage&template=BUG_REPORT.yml).
122
+
123
+ ## Contributing
124
+
125
+ We welcome all contributors, from casual to regular 💙
126
+
127
+ - **Bug report**. Is something not working as expected? [Send a bug report][contributing-bugreport].
128
+ - **Feature request**. Would you like to add something to the library? [Send a feature request][contributing-featurerequest].
129
+ - **Documentation**. Did you find a typo in the doc? [Open an issue][contributing-newissue] and we'll take care of it.
130
+ - **Development**. If you don't know where to start, you can check the open issues that are [tagged easy][contributing-label-easy], the [bugs][contributing-label-bug] or [chores][contributing-label-chore].
131
+
132
+ To start contributing to code, you need to:
133
+
134
+ 1. [Fork the project](https://help.github.com/articles/fork-a-repo/)
135
+ 1. [Clone the repository](https://help.github.com/articles/cloning-a-repository/)
136
+ 1. Install the dependencies: `yarn`
137
+
138
+ Please read [our contribution process](https://github.com/algolia/instantsearch.js/blob/master/CONTRIBUTING.md) to learn more.
139
+
140
+ ## License
141
+
142
+ React InstantSearch is [MIT licensed](../../LICENSE).
143
+
144
+ <!-- Links -->
145
+
146
+ [contributing-bugreport]: https://github.com/algolia/instantsearch.js/issues/new?template=BUG_REPORT.yml&labels=triage,Library%3A%20React+InstantSearch
147
+ [contributing-featurerequest]: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage,Library%3A%20React+InstantSearch&title=Feature%20request%3A%20
148
+ [contributing-newissue]: https://github.com/algolia/instantsearch.js/issues/new?labels=triage,Library%3A%20React+InstantSearch
149
+ [contributing-label-easy]: https://github.com/algolia/instantsearch.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty%3A+Easy%22+label%3A%22Library%3A%20React+InstantSearch%22
150
+ [contributing-label-bug]: https://github.com/algolia/instantsearch.js/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Bug%22+label%3A%22Library%3A%20React+InstantSearch%22
151
+ [contributing-label-chore]: https://github.com/algolia/instantsearch.js/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Chore%22+label%3A%22Library%3A%20React+InstantSearch%22
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createInstantSearchRouterNext = createInstantSearchRouterNext;
7
+ var _history = _interopRequireDefault(require("instantsearch.js/cjs/lib/routers/history"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
+ function createInstantSearchRouterNext(options) {
16
+ var _ref = options || {},
17
+ beforePopState = _ref.beforePopState,
18
+ singletonRouter = _ref.singletonRouter,
19
+ serverUrl = _ref.serverUrl,
20
+ beforeStart = _ref.beforeStart,
21
+ beforeDispose = _ref.beforeDispose,
22
+ routerOptions = _ref.routerOptions;
23
+ var handler;
24
+ var ownBeforePopState = function ownBeforePopState() {
25
+ return true;
26
+ };
27
+
28
+ // If we're rendering on the server, we create a simpler router
29
+ if (typeof window === 'undefined') {
30
+ return (0, _history.default)(_objectSpread({
31
+ getLocation: function getLocation() {
32
+ return new URL(serverUrl);
33
+ }
34
+ }, routerOptions));
35
+ }
36
+ var router = (0, _history.default)(_objectSpread({
37
+ start: function start(onUpdate) {
38
+ var _singletonRouter$rout;
39
+ if (beforeStart) {
40
+ beforeStart(onUpdate);
41
+ }
42
+ var initialPathname = singletonRouter.pathname;
43
+ handler = function handler() {
44
+ // Without this check, we would trigger an unnecessary search when navigating
45
+ // to a page without InstantSearch
46
+ if (singletonRouter.pathname === initialPathname) {
47
+ onUpdate();
48
+ }
49
+ };
50
+ singletonRouter.events.on('routeChangeComplete', handler);
51
+ if ((_singletonRouter$rout = singletonRouter.router) !== null && _singletonRouter$rout !== void 0 && _singletonRouter$rout._bps) {
52
+ ownBeforePopState = singletonRouter.router._bps;
53
+ }
54
+ function libraryBeforePopState() {
55
+ var previousPathname = singletonRouter.asPath.split('?')[0];
56
+ var nextPathname = new URL(window.location.href).pathname;
57
+
58
+ // We strip the locale from the pathname if it's present
59
+ if (singletonRouter.locale) {
60
+ nextPathname = nextPathname.replace(previousPathname === '/' ? singletonRouter.locale : "/".concat(singletonRouter.locale), '');
61
+ }
62
+
63
+ // We only want to trigger a server request when going back/forward to a different page
64
+ return previousPathname !== nextPathname;
65
+ }
66
+ singletonRouter.beforePopState(function (state) {
67
+ if (beforePopState) {
68
+ return beforePopState({
69
+ state: state,
70
+ libraryBeforePopState: libraryBeforePopState,
71
+ ownBeforePopState: ownBeforePopState
72
+ });
73
+ }
74
+ return libraryBeforePopState();
75
+ });
76
+ },
77
+ dispose: function dispose() {
78
+ if (beforeDispose) {
79
+ beforeDispose();
80
+ }
81
+ singletonRouter.events.off('routeChangeComplete', handler);
82
+ singletonRouter.beforePopState(ownBeforePopState);
83
+ },
84
+ push: function push(newUrl) {
85
+ var url = newUrl;
86
+ // We need to do this because there's an error when using i18n on the root path
87
+ // it says for example `pages/fr.js` doesn't exist
88
+ if (singletonRouter.locale) {
89
+ url = url.replace("/".concat(singletonRouter.locale), '');
90
+ }
91
+
92
+ // No need to provide the second argument, Next.js will know what to do
93
+ singletonRouter.push(url, undefined, {
94
+ shallow: true
95
+ });
96
+ }
97
+ }, routerOptions));
98
+ router._isNextRouter = true;
99
+ router.$$type = 'ais.nextjs';
100
+ return router;
101
+ }
@@ -0,0 +1 @@
1
+ { "type": "commonjs", "sideEffects": false }
@@ -0,0 +1,59 @@
1
+ import type { Router, UiState } from 'instantsearch.js';
2
+ import type { BrowserHistoryArgs } from 'instantsearch.js/es/lib/routers/history';
3
+ import type { Router as NextRouter, SingletonRouter } from 'next/router';
4
+ type BeforePopStateCallback = NonNullable<NextRouter['_bps']>;
5
+ type NextHistoryState = Parameters<BeforePopStateCallback>[0];
6
+ type CreateInstantSearchRouterNextOptions<TRouteState> = {
7
+ /**
8
+ * The Next.js singleton router instance.
9
+ *
10
+ * @example
11
+ * import singletonRouter from 'next/router';
12
+ * import { createInstantSearchNextRouter } from 'react-instantsearch-router-nextjs';
13
+ *
14
+ * const router = createInstantSearchNextRouter({ singletonRouter });
15
+ */
16
+ singletonRouter: SingletonRouter;
17
+ /**
18
+ * Required URL when rendering on the server.
19
+ */
20
+ serverUrl?: string;
21
+ /**
22
+ * If you need to add additional logic to the `beforePopState` method of the Next.js router,
23
+ * you can use this option.
24
+ **/
25
+ beforePopState?: (options: {
26
+ /**
27
+ * The Next.js router's `beforePopState` method.
28
+ */
29
+ state: NextHistoryState;
30
+ /**
31
+ * The library's default `beforePopState` method.
32
+ * It returns `false` if staying on the same page to avoid unnecessary SSR.
33
+ */
34
+ libraryBeforePopState: BeforePopStateCallback;
35
+ /**
36
+ * Your own `beforePopState` method if you had set one before.
37
+ * You can use it to compose your own logic for whether to call SSR or not.
38
+ */
39
+ ownBeforePopState: BeforePopStateCallback;
40
+ }) => boolean;
41
+ /**
42
+ * Called before the router starts.
43
+ * Useful to add additional logic if you need the router to tell InstantSearch when to update.
44
+ */
45
+ beforeStart?: BrowserHistoryArgs<TRouteState>['start'];
46
+ /**
47
+ * Called before the router disposes.
48
+ * Useful to detach what was attached in `beforeStart`.
49
+ */
50
+ beforeDispose?: () => void;
51
+ /**
52
+ * Options passed to the underlying history router.
53
+ * See https://www.algolia.com/doc/api-reference/widgets/history-router/react/
54
+ * for the list of available options.
55
+ */
56
+ routerOptions?: Partial<Omit<BrowserHistoryArgs<TRouteState>, 'start' | 'dispose'>>;
57
+ };
58
+ export declare function createInstantSearchRouterNext<TRouteState = UiState>(options: CreateInstantSearchRouterNextOptions<TRouteState>): Router<TRouteState>;
59
+ export {};
@@ -0,0 +1,94 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import history from "instantsearch.js/es/lib/routers/history.js";
8
+ export function createInstantSearchRouterNext(options) {
9
+ var _ref = options || {},
10
+ beforePopState = _ref.beforePopState,
11
+ singletonRouter = _ref.singletonRouter,
12
+ serverUrl = _ref.serverUrl,
13
+ beforeStart = _ref.beforeStart,
14
+ beforeDispose = _ref.beforeDispose,
15
+ routerOptions = _ref.routerOptions;
16
+ var handler;
17
+ var ownBeforePopState = function ownBeforePopState() {
18
+ return true;
19
+ };
20
+
21
+ // If we're rendering on the server, we create a simpler router
22
+ if (typeof window === 'undefined') {
23
+ return history(_objectSpread({
24
+ getLocation: function getLocation() {
25
+ return new URL(serverUrl);
26
+ }
27
+ }, routerOptions));
28
+ }
29
+ var router = history(_objectSpread({
30
+ start: function start(onUpdate) {
31
+ var _singletonRouter$rout;
32
+ if (beforeStart) {
33
+ beforeStart(onUpdate);
34
+ }
35
+ var initialPathname = singletonRouter.pathname;
36
+ handler = function handler() {
37
+ // Without this check, we would trigger an unnecessary search when navigating
38
+ // to a page without InstantSearch
39
+ if (singletonRouter.pathname === initialPathname) {
40
+ onUpdate();
41
+ }
42
+ };
43
+ singletonRouter.events.on('routeChangeComplete', handler);
44
+ if ((_singletonRouter$rout = singletonRouter.router) !== null && _singletonRouter$rout !== void 0 && _singletonRouter$rout._bps) {
45
+ ownBeforePopState = singletonRouter.router._bps;
46
+ }
47
+ function libraryBeforePopState() {
48
+ var previousPathname = singletonRouter.asPath.split('?')[0];
49
+ var nextPathname = new URL(window.location.href).pathname;
50
+
51
+ // We strip the locale from the pathname if it's present
52
+ if (singletonRouter.locale) {
53
+ nextPathname = nextPathname.replace(previousPathname === '/' ? singletonRouter.locale : "/".concat(singletonRouter.locale), '');
54
+ }
55
+
56
+ // We only want to trigger a server request when going back/forward to a different page
57
+ return previousPathname !== nextPathname;
58
+ }
59
+ singletonRouter.beforePopState(function (state) {
60
+ if (beforePopState) {
61
+ return beforePopState({
62
+ state: state,
63
+ libraryBeforePopState: libraryBeforePopState,
64
+ ownBeforePopState: ownBeforePopState
65
+ });
66
+ }
67
+ return libraryBeforePopState();
68
+ });
69
+ },
70
+ dispose: function dispose() {
71
+ if (beforeDispose) {
72
+ beforeDispose();
73
+ }
74
+ singletonRouter.events.off('routeChangeComplete', handler);
75
+ singletonRouter.beforePopState(ownBeforePopState);
76
+ },
77
+ push: function push(newUrl) {
78
+ var url = newUrl;
79
+ // We need to do this because there's an error when using i18n on the root path
80
+ // it says for example `pages/fr.js` doesn't exist
81
+ if (singletonRouter.locale) {
82
+ url = url.replace("/".concat(singletonRouter.locale), '');
83
+ }
84
+
85
+ // No need to provide the second argument, Next.js will know what to do
86
+ singletonRouter.push(url, undefined, {
87
+ shallow: true
88
+ });
89
+ }
90
+ }, routerOptions));
91
+ router._isNextRouter = true;
92
+ router.$$type = 'ais.nextjs';
93
+ return router;
94
+ }
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "react-instantsearch-router-nextjs",
3
+ "version": "7.0.0",
4
+ "description": "React InstantSearch Router for Next.js",
5
+ "source": "src/index.ts",
6
+ "types": "dist/es/index.d.ts",
7
+ "main": "dist/cjs/index.js",
8
+ "module": "dist/es/index.js",
9
+ "type": "module",
10
+ "exports": {
11
+ "types": "./dist/es/index.d.ts",
12
+ "require": "./dist/cjs/index.js",
13
+ "default": "./dist/es/index.js"
14
+ },
15
+ "sideEffects": false,
16
+ "license": "MIT",
17
+ "homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/react/",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/algolia/instantsearch.js"
21
+ },
22
+ "author": {
23
+ "name": "Algolia, Inc.",
24
+ "url": "https://www.algolia.com"
25
+ },
26
+ "keywords": [
27
+ "algolia",
28
+ "router",
29
+ "fast",
30
+ "instantsearch",
31
+ "react",
32
+ "search",
33
+ "next",
34
+ "nextjs"
35
+ ],
36
+ "files": [
37
+ "README.md",
38
+ "dist"
39
+ ],
40
+ "scripts": {
41
+ "clean": "rm -rf dist",
42
+ "build": "yarn build:cjs && yarn build:es && yarn build:types",
43
+ "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/cjs --ignore '**/__tests__/**/*','**/__mocks__/**/*' --quiet && ../../scripts/prepare-cjs.sh",
44
+ "build:es": "BABEL_ENV=es babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/es --ignore '**/__tests__/**/*','**/__mocks__/**/*' --quiet",
45
+ "build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/es",
46
+ "test:exports": "node ./__tests__/module/is-es-module.mjs && node ./__tests__/module/is-cjs-module.cjs",
47
+ "test:start-server": "yarn workspace example-react-instantsearch-next-routing-example build && yarn workspace example-react-instantsearch-next-routing-example start",
48
+ "test:e2e": "start-server-and-test test:start-server 3000 'wdio run ./wdio.conf.cjs'",
49
+ "test:e2e:saucelabs": "start-server-and-test test:start-server 3000 'wdio run ./wdio.saucelabs.conf.cjs'"
50
+ },
51
+ "dependencies": {
52
+ "instantsearch.js": "4.56.8",
53
+ "react-instantsearch-core": "7.0.0"
54
+ },
55
+ "devDependencies": {
56
+ "@types/jasmine": "3.3.16",
57
+ "@wdio/cli": "5.16.9",
58
+ "@wdio/jasmine-framework": "5.16.5",
59
+ "@wdio/junit-reporter": "5.16.11",
60
+ "@wdio/local-runner": "5.16.9",
61
+ "@wdio/sauce-service": "5.16.5",
62
+ "@wdio/selenium-standalone-service": "5.16.5",
63
+ "@wdio/spec-reporter": "5.16.5",
64
+ "start-server-and-test": "1.15.3",
65
+ "ts-node": "8.4.1"
66
+ },
67
+ "peerDependencies": {
68
+ "next": ">= 9 && < 14"
69
+ },
70
+ "gitHead": "c0a9fe132d2c64939763f64f7c265ed8ceb89ae2"
71
+ }