create-instantsearch-app 6.4.2 → 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.
Files changed (147) hide show
  1. package/README.md +4 -5
  2. package/package.json +3 -2
  3. package/src/api/__tests__/__snapshots__/index.test.js.snap +4 -4
  4. package/src/api/__tests__/resolve-template.test.js +0 -28
  5. package/src/api/resolve-template.js +1 -28
  6. package/src/templates/React InstantSearch/.editorconfig +0 -1
  7. package/src/templates/React InstantSearch/.gitignore.template +20 -18
  8. package/src/templates/React InstantSearch/.template.js +4 -3
  9. package/src/templates/React InstantSearch/README.md +0 -2
  10. package/src/templates/React InstantSearch/package.json +8 -21
  11. package/src/templates/React InstantSearch/src/App.css +11 -0
  12. package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/App.tsx.hbs +3 -3
  13. package/src/templates/React InstantSearch Native/.gitignore.template +13 -16
  14. package/src/templates/React InstantSearch Native/.template.js +2 -1
  15. package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/App.tsx.hbs +1 -1
  16. package/src/templates/React InstantSearch Native/app.json +24 -1
  17. package/src/templates/React InstantSearch Native/package.json +14 -16
  18. package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/InfiniteHits.tsx +1 -1
  19. package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/SearchBox.tsx.hbs +1 -1
  20. package/src/utils/__tests__/index.test.js +8 -5
  21. package/src/templates/Autocomplete.js 0/.editorconfig +0 -9
  22. package/src/templates/Autocomplete.js 0/.eslintignore +0 -3
  23. package/src/templates/Autocomplete.js 0/.eslintrc.js +0 -3
  24. package/src/templates/Autocomplete.js 0/.gitignore.template +0 -22
  25. package/src/templates/Autocomplete.js 0/.prettierrc +0 -5
  26. package/src/templates/Autocomplete.js 0/.template.js +0 -13
  27. package/src/templates/Autocomplete.js 0/README.md +0 -21
  28. package/src/templates/Autocomplete.js 0/favicon.png +0 -0
  29. package/src/templates/Autocomplete.js 0/index.html.hbs +0 -46
  30. package/src/templates/Autocomplete.js 0/manifest.webmanifest +0 -15
  31. package/src/templates/Autocomplete.js 0/package.json +0 -26
  32. package/src/templates/Autocomplete.js 0/src/app.css +0 -85
  33. package/src/templates/Autocomplete.js 0/src/app.js.hbs +0 -31
  34. package/src/templates/Autocomplete.js 0/src/index.css +0 -7
  35. package/src/templates/InstantSearch.js 2/.editorconfig +0 -9
  36. package/src/templates/InstantSearch.js 2/.eslintignore +0 -3
  37. package/src/templates/InstantSearch.js 2/.eslintrc.js +0 -3
  38. package/src/templates/InstantSearch.js 2/.gitignore.template +0 -22
  39. package/src/templates/InstantSearch.js 2/.prettierrc +0 -5
  40. package/src/templates/InstantSearch.js 2/.template.js +0 -14
  41. package/src/templates/InstantSearch.js 2/README.md +0 -21
  42. package/src/templates/InstantSearch.js 2/favicon.png +0 -0
  43. package/src/templates/InstantSearch.js 2/index.html.hbs +0 -56
  44. package/src/templates/InstantSearch.js 2/manifest.webmanifest +0 -15
  45. package/src/templates/InstantSearch.js 2/package.json +0 -22
  46. package/src/templates/InstantSearch.js 2/src/app.css +0 -75
  47. package/src/templates/InstantSearch.js 2/src/app.js.hbs +0 -54
  48. package/src/templates/InstantSearch.js 2/src/index.css +0 -10
  49. package/src/templates/JavaScript Helper 2/.editorconfig +0 -9
  50. package/src/templates/JavaScript Helper 2/.eslintignore +0 -3
  51. package/src/templates/JavaScript Helper 2/.eslintrc.js +0 -3
  52. package/src/templates/JavaScript Helper 2/.gitignore.template +0 -22
  53. package/src/templates/JavaScript Helper 2/.prettierrc +0 -5
  54. package/src/templates/JavaScript Helper 2/.template.js +0 -14
  55. package/src/templates/JavaScript Helper 2/README.md +0 -21
  56. package/src/templates/JavaScript Helper 2/favicon.png +0 -0
  57. package/src/templates/JavaScript Helper 2/index.html.hbs +0 -42
  58. package/src/templates/JavaScript Helper 2/manifest.webmanifest +0 -15
  59. package/src/templates/JavaScript Helper 2/package.json +0 -26
  60. package/src/templates/JavaScript Helper 2/src/app.css +0 -74
  61. package/src/templates/JavaScript Helper 2/src/app.js.hbs +0 -44
  62. package/src/templates/JavaScript Helper 2/src/index.css +0 -10
  63. package/src/templates/React InstantSearch/.eslintrc.js +0 -3
  64. package/src/templates/React InstantSearch/public/favicon.png +0 -0
  65. package/src/templates/React InstantSearch/public/index.html +0 -29
  66. package/src/templates/React InstantSearch/public/manifest.json +0 -15
  67. package/src/templates/React InstantSearch/src/App.js.hbs +0 -112
  68. package/src/templates/React InstantSearch/src/index.css +0 -10
  69. package/src/templates/React InstantSearch/src/index.js +0 -6
  70. package/src/templates/React InstantSearch Hooks/.editorconfig +0 -8
  71. package/src/templates/React InstantSearch Hooks/.gitignore.template +0 -23
  72. package/src/templates/React InstantSearch Hooks/.prettierrc +0 -5
  73. package/src/templates/React InstantSearch Hooks/.template.js +0 -25
  74. package/src/templates/React InstantSearch Hooks/README.md +0 -19
  75. package/src/templates/React InstantSearch Hooks/package.json +0 -21
  76. package/src/templates/React InstantSearch Hooks/src/App.css +0 -71
  77. package/src/templates/React InstantSearch Hooks Native/.gitignore.template +0 -14
  78. package/src/templates/React InstantSearch Hooks Native/.template.js +0 -34
  79. package/src/templates/React InstantSearch Hooks Native/README.md +0 -19
  80. package/src/templates/React InstantSearch Hooks Native/app.json +0 -30
  81. package/src/templates/React InstantSearch Hooks Native/babel.config.js +0 -6
  82. package/src/templates/React InstantSearch Hooks Native/package.json +0 -30
  83. package/src/templates/React InstantSearch Native/.editorconfig +0 -9
  84. package/src/templates/React InstantSearch Native/.eslintrc.js +0 -3
  85. package/src/templates/React InstantSearch Native/.prettierrc +0 -5
  86. package/src/templates/React InstantSearch Native/.watchmanconfig +0 -1
  87. package/src/templates/React InstantSearch Native/App.js.hbs +0 -38
  88. package/src/templates/React InstantSearch Native/src/Highlight.js +0 -36
  89. package/src/templates/React InstantSearch Native/src/InfiniteHits.js.hbs +0 -56
  90. package/src/templates/React InstantSearch Native/src/SearchBox.js.hbs +0 -42
  91. package/src/templates/React InstantSearch widget/.eslintignore +0 -2
  92. package/src/templates/React InstantSearch widget/.eslintrc.cjs +0 -13
  93. package/src/templates/React InstantSearch widget/.prettierrc +0 -5
  94. package/src/templates/React InstantSearch widget/.template.js +0 -21
  95. package/src/templates/React InstantSearch widget/CONTRIBUTING.md +0 -49
  96. package/src/templates/React InstantSearch widget/LICENSE.md.hbs +0 -21
  97. package/src/templates/React InstantSearch widget/README.md +0 -85
  98. package/src/templates/React InstantSearch widget/babel.config.cjs +0 -8
  99. package/src/templates/React InstantSearch widget/example/index.html.hbs +0 -12
  100. package/src/templates/React InstantSearch widget/example/index.tsx.hbs +0 -22
  101. package/src/templates/React InstantSearch widget/package.json.hbs +0 -81
  102. package/src/templates/React InstantSearch widget/src/index.tsx.hbs +0 -3
  103. package/src/templates/React InstantSearch widget/src/lib/__tests__/dummy-test.tsx.hbs +0 -39
  104. package/src/templates/React InstantSearch widget/src/lib/component.tsx.hbs +0 -15
  105. package/src/templates/React InstantSearch widget/src/lib/connector.ts.hbs +0 -35
  106. package/src/templates/React InstantSearch widget/src/lib/widget.tsx.hbs +0 -14
  107. package/src/templates/React InstantSearch widget/src/types/connector.ts +0 -17
  108. package/src/templates/React InstantSearch widget/tsconfig.declaration.json +0 -10
  109. package/src/templates/React InstantSearch widget/tsconfig.json +0 -20
  110. package/src/templates/React InstantSearch widget/vite.config.ts +0 -34
  111. package/src/templates/Vue InstantSearch 1/.editorconfig +0 -9
  112. package/src/templates/Vue InstantSearch 1/.eslintrc.js +0 -9
  113. package/src/templates/Vue InstantSearch 1/.gitignore.template +0 -21
  114. package/src/templates/Vue InstantSearch 1/.prettierrc +0 -5
  115. package/src/templates/Vue InstantSearch 1/.template.js +0 -14
  116. package/src/templates/Vue InstantSearch 1/README.md +0 -21
  117. package/src/templates/Vue InstantSearch 1/babel.config.js +0 -3
  118. package/src/templates/Vue InstantSearch 1/package.json +0 -35
  119. package/src/templates/Vue InstantSearch 1/public/favicon.png +0 -0
  120. package/src/templates/Vue InstantSearch 1/public/index.html +0 -22
  121. package/src/templates/Vue InstantSearch 1/src/App.vue +0 -167
  122. package/src/templates/Vue InstantSearch 1/src/main.js +0 -11
  123. package/src/templates/Vue InstantSearch 2/.editorconfig +0 -9
  124. package/src/templates/Vue InstantSearch 2/.eslintrc.js +0 -9
  125. package/src/templates/Vue InstantSearch 2/.gitignore.template +0 -21
  126. package/src/templates/Vue InstantSearch 2/.prettierrc +0 -5
  127. package/src/templates/Vue InstantSearch 2/.template.js +0 -15
  128. package/src/templates/Vue InstantSearch 2/README.md +0 -21
  129. package/src/templates/Vue InstantSearch 2/babel.config.js +0 -3
  130. package/src/templates/Vue InstantSearch 2/package.json +0 -37
  131. package/src/templates/Vue InstantSearch 2/public/favicon.png +0 -0
  132. package/src/templates/Vue InstantSearch 2/public/index.html +0 -22
  133. package/src/templates/Vue InstantSearch 2/src/App.vue +0 -147
  134. package/src/templates/Vue InstantSearch 2/src/main.js +0 -11
  135. package/src/utils/__tests__/__snapshots__/index.test.js.snap +0 -7
  136. /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/favicon.png +0 -0
  137. /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/index.html +0 -0
  138. /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/Panel.tsx +0 -0
  139. /package/src/templates/{React InstantSearch Hooks → React InstantSearch}/src/index.tsx +0 -0
  140. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/.expo-shared/assets.json +0 -0
  141. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/adaptive-icon.png +0 -0
  142. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/favicon.png +0 -0
  143. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/icon.png +0 -0
  144. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/assets/splash.png +0 -0
  145. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/src/Highlight.tsx +0 -0
  146. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/tsconfig.json +0 -0
  147. /package/src/templates/{React InstantSearch Hooks Native → React InstantSearch Native}/types/ProductHit.ts +0 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Version][version-svg]][package-url] [![License][license-image]][license-url] [![Build Status][ci-svg]][ci-url]
6
6
 
7
- `create-instantsearch-app` is a command line utility that helps you quick start your InstantSearch app using any [Algolia][algolia-website] InstantSearch flavor ([InstantSearch.js][instantsearchjs-github], [React InstantSearch Hooks][react-instantsearch-hooks-github], [Vue InstantSearch][vue-instantsearch-github], [Angular InstantSearch][angular-instantsearch-github], [InstantSearch iOS][instantsearch-ios-github] and [InstantSearch Android][instantsearch-android-github]).
7
+ `create-instantsearch-app` is a command line utility that helps you quick start your InstantSearch app using any [Algolia][algolia-website] InstantSearch flavor ([InstantSearch.js][instantsearchjs-github], [React InstantSearch][react-instantsearch-github], [Vue InstantSearch][vue-instantsearch-github], [Angular InstantSearch][angular-instantsearch-github], [InstantSearch iOS][instantsearch-ios-github] and [InstantSearch Android][instantsearch-android-github]).
8
8
 
9
9
  <p align="center">
10
10
  <img src="preview.png" width="800" alt="Preview">
@@ -147,9 +147,8 @@ app.create().then(() => console.log('App generated!'));
147
147
 
148
148
  You can use the web templates on CodeSandbox:
149
149
 
150
- - [InstantSearch.js 3](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/instantsearch.js)
151
- - [InstantSearch.js 2](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/instantsearch.js-2.x)
152
- - [React InstantSearch Hooks](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/react-instantsearch-hooks)
150
+ - [InstantSearch.js](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/instantsearch.js)
151
+ - [React InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/react-instantsearch)
153
152
  - [Vue InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/vue-instantsearch)
154
153
  - [Angular InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/angular-instantsearch)
155
154
  - [Autocomplete.js](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/autocomplete.js)
@@ -189,7 +188,7 @@ Create InstantSearch App is [MIT licensed](LICENSE).
189
188
 
190
189
  [algolia-website]: https://www.algolia.com/?utm_medium=social-owned&utm_source=GitHub&utm_campaign=create-instantsearch-app%20repository
191
190
  [instantsearchjs-github]: https://github.com/algolia/instantsearch/tree/master/packages/instantsearch.js
192
- [react-instantsearch-hooks-github]: https://github.com/algolia/instantsearch/tree/master/packages/react-instantsearch-hooks-web
191
+ [react-instantsearch-github]: https://github.com/algolia/instantsearch/tree/master/packages/react-instantsearch
193
192
  [vue-instantsearch-github]: https://github.com/algolia/instantsearch/tree/master/packages/vue-instantsearch
194
193
  [angular-instantsearch-github]: https://github.com/algolia/angular-instantsearch
195
194
  [instantsearch-ios-github]: https://github.com/algolia/instantsearch-ios
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-instantsearch-app",
3
- "version": "6.4.2",
3
+ "version": "7.0.0",
4
4
  "license": "MIT",
5
5
  "description": "⚡️ Build InstantSearch apps at the speed of thought",
6
6
  "keywords": [
@@ -49,8 +49,9 @@
49
49
  "validate-npm-package-name": "3.0.0"
50
50
  },
51
51
  "devDependencies": {
52
+ "@instantsearch/testutils": "1.12.0",
52
53
  "jest-image-snapshot": "2.12.0",
53
54
  "walk-sync": "2.0.2"
54
55
  },
55
- "gitHead": "c0a9fe132d2c64939763f64f7c265ed8ceb89ae2"
56
+ "gitHead": "94deb1ad0715410c61f4aa285a78a36ccf367fd7"
56
57
  }
@@ -1,15 +1,15 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`Options with invalid name throws 1`] = `
4
- "Could not create a project called \\"./WrongNpmName\\" because of npm naming restrictions.
4
+ "Could not create a project called \\"<red>./WrongNpmName</color>\\" because of npm naming restrictions.
5
5
  - name cannot start with a period
6
6
  - name can only contain URL-friendly characters"
7
7
  `;
8
8
 
9
- exports[`Options with unknown template throws 1`] = `"The template directory must contain a configuration file \`.template.js\` or must be one of those: Angular InstantSearch, Autocomplete, Autocomplete.js 0, InstantSearch Android, InstantSearch iOS, InstantSearch.js, InstantSearch.js 2, InstantSearch.js widget, JavaScript Client, JavaScript Helper, JavaScript Helper 2, React InstantSearch, React InstantSearch Hooks, React InstantSearch Hooks Native, React InstantSearch Native, React InstantSearch widget, Vue InstantSearch, Vue InstantSearch 1, Vue InstantSearch 2, Vue InstantSearch with Vue 3"`;
9
+ exports[`Options with unknown template throws 1`] = `"The template directory must contain a configuration file \`.template.js\` or must be one of those: Angular InstantSearch, Autocomplete, InstantSearch Android, InstantSearch iOS, InstantSearch.js, InstantSearch.js widget, JavaScript Client, JavaScript Helper, React InstantSearch, React InstantSearch Native, Vue InstantSearch, Vue InstantSearch with Vue 3"`;
10
10
 
11
- exports[`Options with wrong template path throws 1`] = `"The template directory must contain a configuration file \`.template.js\` or must be one of those: Angular InstantSearch, Autocomplete, Autocomplete.js 0, InstantSearch Android, InstantSearch iOS, InstantSearch.js, InstantSearch.js 2, InstantSearch.js widget, JavaScript Client, JavaScript Helper, JavaScript Helper 2, React InstantSearch, React InstantSearch Hooks, React InstantSearch Hooks Native, React InstantSearch Native, React InstantSearch widget, Vue InstantSearch, Vue InstantSearch 1, Vue InstantSearch 2, Vue InstantSearch with Vue 3"`;
11
+ exports[`Options with wrong template path throws 1`] = `"The template directory must contain a configuration file \`.template.js\` or must be one of those: Angular InstantSearch, Autocomplete, InstantSearch Android, InstantSearch iOS, InstantSearch.js, InstantSearch.js widget, JavaScript Client, JavaScript Helper, React InstantSearch, React InstantSearch Native, Vue InstantSearch, Vue InstantSearch with Vue 3"`;
12
12
 
13
13
  exports[`Options without path throws 1`] = `"The option \`path\` is required."`;
14
14
 
15
- exports[`Options without template throws 1`] = `"The template directory must contain a configuration file \`.template.js\` or must be one of those: Angular InstantSearch, Autocomplete, Autocomplete.js 0, InstantSearch Android, InstantSearch iOS, InstantSearch.js, InstantSearch.js 2, InstantSearch.js widget, JavaScript Client, JavaScript Helper, JavaScript Helper 2, React InstantSearch, React InstantSearch Hooks, React InstantSearch Hooks Native, React InstantSearch Native, React InstantSearch widget, Vue InstantSearch, Vue InstantSearch 1, Vue InstantSearch 2, Vue InstantSearch with Vue 3"`;
15
+ exports[`Options without template throws 1`] = `"The template directory must contain a configuration file \`.template.js\` or must be one of those: Angular InstantSearch, Autocomplete, InstantSearch Android, InstantSearch iOS, InstantSearch.js, InstantSearch.js widget, JavaScript Client, JavaScript Helper, React InstantSearch, React InstantSearch Native, Vue InstantSearch, Vue InstantSearch with Vue 3"`;
@@ -29,34 +29,6 @@ describe('resolveTemplate', () => {
29
29
  ).toBe(path.resolve('src/templates/InstantSearch.js'));
30
30
  });
31
31
 
32
- test('selects the right template with InstantSearch.js template and version 2', () => {
33
- expect(
34
- resolveTemplate(
35
- {
36
- template: 'InstantSearch.js',
37
- libraryVersion: '2.10.0',
38
- },
39
- {
40
- supportedTemplates: ['InstantSearch.js 2'],
41
- }
42
- )
43
- ).toBe(path.resolve('src/templates/InstantSearch.js 2'));
44
- });
45
-
46
- test('selects the selected template for Vue v1', () => {
47
- expect(
48
- resolveTemplate(
49
- {
50
- template: 'Vue InstantSearch',
51
- libraryVersion: '1.7.0',
52
- },
53
- {
54
- supportedTemplates: ['Vue InstantSearch', 'Vue InstantSearch 1'],
55
- }
56
- )
57
- ).toBe(path.resolve('src/templates/Vue InstantSearch 1'));
58
- });
59
-
60
32
  test('throws with unsupported version', () => {
61
33
  expect(() =>
62
34
  resolveTemplate(
@@ -4,35 +4,8 @@ const semver = require('semver');
4
4
 
5
5
  const { getAppTemplateConfig } = require('../utils');
6
6
 
7
- function getTemplateNameByLibraryVersion({
8
- template = '',
9
- libraryVersion = '',
10
- }) {
11
- const templateName = path.basename(template);
12
-
13
- if (
14
- templateName === 'InstantSearch.js' &&
15
- semver.satisfies(libraryVersion, '>= 2.0.0 < 3.0.0', {
16
- includePrerelease: true,
17
- })
18
- ) {
19
- return 'InstantSearch.js 2';
20
- }
21
-
22
- if (
23
- templateName === 'Vue InstantSearch' &&
24
- semver.satisfies(libraryVersion, '>= 1.0.0 < 2.0.0', {
25
- includePrerelease: true,
26
- })
27
- ) {
28
- return 'Vue InstantSearch 1';
29
- }
30
-
31
- return template;
32
- }
33
-
34
7
  module.exports = function resolveTemplate(options, { supportedTemplates }) {
35
- const templateName = getTemplateNameByLibraryVersion(options);
8
+ const templateName = options.template || '';
36
9
  const templatePath = path.resolve('src/templates', templateName || '');
37
10
  let supportedVersion;
38
11
 
@@ -1,7 +1,6 @@
1
1
  root = true
2
2
 
3
3
  [*]
4
- charset = utf-8
5
4
  indent_style = space
6
5
  indent_size = 2
7
6
  end_of_line = lf
@@ -1,21 +1,23 @@
1
- # See https://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
-
6
- # testing
7
- /coverage
8
-
9
- # production
10
- /build
11
-
12
- # misc
13
- .DS_Store
14
- .env.local
15
- .env.development.local
16
- .env.test.local
17
- .env.production.local
18
-
1
+ # Logs
2
+ logs
3
+ *.log
19
4
  npm-debug.log*
20
5
  yarn-debug.log*
21
6
  yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ .parcel-cache
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode
17
+ .idea
18
+ .DS_Store
19
+ *.suo
20
+ *.ntvs*
21
+ *.njsproj
22
+ *.sln
23
+ *.sw?
@@ -3,10 +3,11 @@ const teardown = require('../../tasks/node/teardown');
3
3
 
4
4
  module.exports = {
5
5
  category: 'Web',
6
- libraryName: 'react-instantsearch-dom',
7
- supportedVersion: '>= 5.0.0 < 7.0.0',
6
+ libraryName: 'react-instantsearch',
7
+ supportedVersion: '>= 7.0.0 < 8.0.0',
8
8
  flags: {
9
- dynamicWidgets: '>=6.16',
9
+ dynamicWidgets: '>=7.0',
10
+ insights: '>=7.0',
10
11
  },
11
12
  templateName: 'react-instantsearch',
12
13
  appName: 'react-instantsearch-app',
@@ -17,5 +17,3 @@ Alternatively, you may use [Yarn](https://http://yarnpkg.com/):
17
17
  yarn
18
18
  yarn start
19
19
  ```
20
-
21
- Open http://localhost:3000 to see your app.
@@ -3,32 +3,19 @@
3
3
  "version": "1.0.0",
4
4
  "private": true,
5
5
  "scripts": {
6
- "start": "react-scripts start",
7
- "build": "react-scripts build",
8
- "lint": "eslint .",
9
- "lint:fix": "npm run lint -- --fix"
6
+ "build": "parcel build index.html",
7
+ "start": "parcel index.html"
10
8
  },
11
9
  "dependencies": {
12
10
  "algoliasearch": "4",
13
11
  "react": "18.1.0",
14
12
  "react-dom": "18.1.0",
15
- "react-instantsearch-dom": "{{libraryVersion}}",
16
- "react-scripts": "2.1.1"
13
+ "react-instantsearch": "{{libraryVersion}}"
17
14
  },
18
15
  "devDependencies": {
19
- "eslint": "5.6.0",
20
- "eslint-config-algolia": "13.2.3",
21
- "eslint-config-prettier": "3.6.0",
22
- "eslint-plugin-import": "2.19.1",
23
- "eslint-plugin-prettier": "3.1.2",
24
- "eslint-plugin-react": "7.17.0",
25
- "prettier": "1.19.1",
26
- "prop-types": "15.7.2"
27
- },
28
- "browserslist": [
29
- ">0.2%",
30
- "not dead",
31
- "not ie <= 11",
32
- "not op_mini all"
33
- ]
16
+ "@types/react": "18.0.15",
17
+ "@types/react-dom": "18.0.6",
18
+ "parcel": "2.5.0",
19
+ "typescript": "4.7.4"
20
+ }
34
21
  }
@@ -1,3 +1,14 @@
1
+ body,
2
+ h1 {
3
+ margin: 0;
4
+ padding: 0;
5
+ }
6
+
7
+ body {
8
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
9
+ Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
10
+ }
11
+
1
12
  em {
2
13
  background: cyan;
3
14
  font-style: normal;
@@ -18,7 +18,7 @@ import {
18
18
  RefinementList,
19
19
  {{/if}}
20
20
  SearchBox,
21
- } from 'react-instantsearch-hooks-web';
21
+ } from 'react-instantsearch';
22
22
 
23
23
  import { Panel } from './Panel';
24
24
 
@@ -40,8 +40,8 @@ export function App() {
40
40
  </h1>
41
41
  <p className="header-subtitle">
42
42
  using{' '}
43
- <a href="https://github.com/algolia/instantsearch/tree/master/packages/react-instantsearch-hooks-web">
44
- React InstantSearch Hooks
43
+ <a href="https://github.com/algolia/instantsearch/tree/master/packages/react-instantsearch">
44
+ React InstantSearch
45
45
  </a>
46
46
  </p>
47
47
  </header>
@@ -1,17 +1,14 @@
1
- # See https://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # expo
1
+ node_modules/
4
2
  .expo/
5
-
6
- # dependencies
7
- /node_modules
8
-
9
- # misc
10
- .env.local
11
- .env.development.local
12
- .env.test.local
13
- .env.production.local
14
-
15
- npm-debug.log*
16
- yarn-debug.log*
17
- yarn-error.log*
3
+ dist/
4
+ npm-debug.*
5
+ *.jks
6
+ *.p8
7
+ *.p12
8
+ *.key
9
+ *.mobileprovision
10
+ *.orig.*
11
+ web-build/
12
+
13
+ # macOS
14
+ .DS_Store
@@ -4,7 +4,8 @@ const teardown = require('../../tasks/node/teardown');
4
4
 
5
5
  module.exports = {
6
6
  category: 'Mobile',
7
- libraryName: 'react-instantsearch-native',
7
+ libraryName: 'react-instantsearch-core',
8
+ supportedVersion: '>= 7.0.0 < 8.0.0',
8
9
  templateName: 'react-instantsearch-native',
9
10
  appName: 'react-instantsearch-native-app',
10
11
  keywords: [
@@ -2,7 +2,7 @@ import React, { useRef } from 'react';
2
2
  import { FlatList, SafeAreaView, StyleSheet, Text, View } from 'react-native';
3
3
  import { StatusBar } from 'expo-status-bar';
4
4
  import algoliasearch from 'algoliasearch/lite';
5
- import { InstantSearch } from 'react-instantsearch-hooks';
5
+ import { InstantSearch } from 'react-instantsearch-core';
6
6
 
7
7
  import { InfiniteHits } from './src/InfiniteHits';
8
8
  import { SearchBox } from './src/SearchBox';
@@ -2,6 +2,29 @@
2
2
  "expo": {
3
3
  "name": "{{name}}",
4
4
  "slug": "{{name}}",
5
- "sdkVersion": "44.0.0"
5
+ "version": "1.0.0",
6
+ "orientation": "portrait",
7
+ "icon": "./assets/icon.png",
8
+ "splash": {
9
+ "image": "./assets/splash.png",
10
+ "resizeMode": "contain",
11
+ "backgroundColor": "#ffffff"
12
+ },
13
+ "updates": {
14
+ "fallbackToCacheTimeout": 0
15
+ },
16
+ "assetBundlePatterns": ["**/*"],
17
+ "ios": {
18
+ "supportsTablet": true
19
+ },
20
+ "android": {
21
+ "adaptiveIcon": {
22
+ "foregroundImage": "./assets/adaptive-icon.png",
23
+ "backgroundColor": "#FFFFFF"
24
+ }
25
+ },
26
+ "web": {
27
+ "favicon": "./assets/favicon.png"
28
+ }
6
29
  }
7
30
  }
@@ -7,26 +7,24 @@
7
7
  "start": "expo start",
8
8
  "android": "expo start --android",
9
9
  "ios": "expo start --ios",
10
+ "web": "expo start --web",
10
11
  "eject": "expo eject"
11
12
  },
12
13
  "dependencies": {
13
- "algoliasearch": "4",
14
- "expo": "44.0.3",
15
- "prop-types": "15.8.0",
16
- "react": "17.0.2",
17
- "react-instantsearch-native": "{{libraryVersion}}",
18
- "react-native": "0.64.3"
14
+ "algoliasearch": "4.12.1",
15
+ "expo": "~44.0.0",
16
+ "expo-status-bar": "~1.2.0",
17
+ "react": "17.0.1",
18
+ "react-dom": "17.0.1",
19
+ "react-instantsearch-core": "{{libraryVersion}}",
20
+ "react-native": "0.64.3",
21
+ "react-native-web": "0.17.1"
19
22
  },
20
23
  "devDependencies": {
21
- "@babel/core": "7.16.5",
22
- "babel-preset-expo": "9.0.2",
23
- "eslint": "8.5.0",
24
- "eslint-config-algolia": "20.0.0",
25
- "eslint-config-prettier": "8.3.0",
26
- "eslint-plugin-import": "2.25.3",
27
- "eslint-plugin-prettier": "4.0.0",
28
- "eslint-plugin-react": "7.28.0",
29
- "expo-cli": "5.0.3",
30
- "prettier": "2.5.1"
24
+ "@babel/core": "^7.12.9",
25
+ "@types/react": "~17.0.21",
26
+ "@types/react-native": "~0.64.12",
27
+ "expo-cli": "5.5.1",
28
+ "typescript": "~4.3.5"
31
29
  }
32
30
  }
@@ -4,7 +4,7 @@ import { Hit as AlgoliaHit } from '@algolia/client-search';
4
4
  import {
5
5
  useInfiniteHits,
6
6
  UseInfiniteHitsProps,
7
- } from 'react-instantsearch-hooks';
7
+ } from 'react-instantsearch-core';
8
8
 
9
9
  type InfiniteHitsProps<THit> = UseInfiniteHitsProps & {
10
10
  hitComponent: (props: { hit: THit }) => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
2
  import { StyleSheet, View, TextInput } from 'react-native';
3
- import { useSearchBox, UseSearchBoxProps } from 'react-instantsearch-hooks';
3
+ import { useSearchBox, UseSearchBoxProps } from 'react-instantsearch-core';
4
4
 
5
5
  type SearchBoxProps = UseSearchBoxProps & {
6
6
  onChange: (newValue: string) => void;
@@ -16,9 +16,12 @@ describe('checkAppName', () => {
16
16
  });
17
17
 
18
18
  test('throws with correct error message', () => {
19
- expect(() =>
20
- utils.checkAppName('./project-name')
21
- ).toThrowErrorMatchingSnapshot();
19
+ expect(() => utils.checkAppName('./project-name'))
20
+ .toThrowErrorMatchingInlineSnapshot(`
21
+ "Could not create a project called \\"<red>./project-name</color>\\" because of npm naming restrictions.
22
+ - name cannot start with a period
23
+ - name can only contain URL-friendly characters"
24
+ `);
22
25
  });
23
26
  });
24
27
 
@@ -48,7 +51,7 @@ describe('checkAppPath', () => {
48
51
  expect(() =>
49
52
  utils.checkAppPath('path')
50
53
  ).toThrowErrorMatchingInlineSnapshot(
51
- `"Could not create project in destination folder \\"path\\" because it is not empty."`
54
+ `"Could not create project in destination folder \\"<red>path</color>\\" because it is not empty."`
52
55
  );
53
56
  });
54
57
 
@@ -71,7 +74,7 @@ describe('checkAppPath', () => {
71
74
  expect(() =>
72
75
  utils.checkAppPath('path')
73
76
  ).toThrowErrorMatchingInlineSnapshot(
74
- `"Could not create project at path path because a file of the same name already exists."`
77
+ `"Could not create project at path <red>path</color> because a file of the same name already exists."`
75
78
  );
76
79
  });
77
80
 
@@ -1,9 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
@@ -1,3 +0,0 @@
1
- /node_modules
2
- /dist
3
- /.cache
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: 'algolia',
3
- };
@@ -1,22 +0,0 @@
1
- # See https://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
-
6
- # testing
7
- /coverage
8
-
9
- # production
10
- /dist
11
- /.cache
12
-
13
- # misc
14
- .DS_Store
15
- .env.local
16
- .env.development.local
17
- .env.test.local
18
- .env.production.local
19
-
20
- npm-debug.log*
21
- yarn-debug.log*
22
- yarn-error.log*
@@ -1,5 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "proseWrap": "never",
4
- "trailingComma": "es5"
5
- }
@@ -1,13 +0,0 @@
1
- const install = require('../../tasks/node/install');
2
- const teardown = require('../../tasks/node/teardown');
3
-
4
- module.exports = {
5
- libraryName: 'autocomplete.js',
6
- templateName: 'autocomplete.js-0.x',
7
- appName: 'autocomplete.js-app',
8
- keywords: ['algolia', 'Autocomplete', 'autocomplete.js'],
9
- tasks: {
10
- install,
11
- teardown,
12
- },
13
- };
@@ -1,21 +0,0 @@
1
- # {{name}}
2
-
3
- _This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
4
-
5
- ## Get started
6
-
7
- To run this project locally, install the dependencies and run the local server:
8
-
9
- ```sh
10
- npm install
11
- npm start
12
- ```
13
-
14
- Alternatively, you may use [Yarn](https://http://yarnpkg.com/):
15
-
16
- ```sh
17
- yarn
18
- yarn start
19
- ```
20
-
21
- Open http://localhost:3000 to see your app.
@@ -1,46 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="utf-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7
- <meta name="theme-color" content="#000000">
8
-
9
- <link rel="manifest" href="./manifest.webmanifest">
10
- <link rel="shortcut icon" href="./favicon.png">
11
-
12
- <link rel="stylesheet" href="./src/index.css">
13
- <link rel="stylesheet" href="./src/app.css">
14
- <!--
15
- Do not use @7 in production, use a complete version like x.x.x, see website for latest version:
16
- https://www.algolia.com/doc/guides/building-search-ui/installation/react/#load-the-style
17
- -->
18
- <link rel="stylesheet" href="https://unpkg.com/instantsearch.css@7/themes/satellite-min.css" />
19
-
20
- <title>{{name}}</title>
21
- </head>
22
-
23
- <body>
24
- <header class="header">
25
- <h1 class="header-title">
26
- <a href="/">{{name}}</a>
27
- </h1>
28
- <p class="header-subtitle">using
29
- <a href="https://github.com/algolia/autocomplete.js">Autocomplete.js</a>
30
- </p>
31
- </header>
32
-
33
- <div class="container">
34
- <div class="container-app">
35
- <div id="searchBox" class="ais-SearchBox">
36
- <form role="search" class="ais-SearchBox-form">
37
- <input type="search" placeholder="{{searchPlaceholder}}" class="ais-SearchBox-input" />
38
- </form>
39
- </div>
40
- </div>
41
- </div>
42
-
43
- <script src="./src/app.js"></script>
44
- </body>
45
-
46
- </html>
@@ -1,15 +0,0 @@
1
- {
2
- "short_name": "{{name}}",
3
- "name": "{{name}} Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.png",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- }
10
- ],
11
- "start_url": "./index.html",
12
- "display": "standalone",
13
- "theme_color": "#000000",
14
- "background_color": "#ffffff"
15
- }