create-instantsearch-app 7.0.1 → 7.1.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 (25) hide show
  1. package/README.md +1 -1
  2. package/package.json +5 -5
  3. package/src/cli/index.js +1 -1
  4. package/src/templates/Angular InstantSearch/angular.json +3 -11
  5. package/src/templates/Angular InstantSearch/karma.conf.js +5 -8
  6. package/src/templates/Angular InstantSearch/src/app/app.component.ts +2 -5
  7. package/src/templates/Angular InstantSearch/src/app/app.module.ts +4 -9
  8. package/src/templates/Angular InstantSearch/src/environments/environment.prod.ts +1 -1
  9. package/src/templates/Angular InstantSearch/src/environments/environment.ts +1 -1
  10. package/src/templates/Angular InstantSearch/src/index.html +15 -12
  11. package/src/templates/Angular InstantSearch/src/main.ts +3 -2
  12. package/src/templates/Angular InstantSearch/src/polyfills.ts +1 -2
  13. package/src/templates/Angular InstantSearch/src/test.ts +7 -3
  14. package/src/templates/InstantSearch iOS/App/Assets.xcassets/AppIcon.appiconset/Contents.json +29 -29
  15. package/src/templates/InstantSearch.js widget/config/api-extractor.json +1 -1
  16. package/src/templates/InstantSearch.js widget/example/index.css +1 -1
  17. package/src/templates/InstantSearch.js widget/example/index.html +17 -14
  18. package/src/templates/React InstantSearch/index.html +1 -1
  19. package/src/templates/React InstantSearch Native/babel.config.js +1 -1
  20. package/src/templates/React InstantSearch Native/src/InfiniteHits.tsx +3 -3
  21. package/src/templates/Vue InstantSearch/public/index.html +13 -7
  22. package/src/templates/Vue InstantSearch/src/main.js +1 -1
  23. package/src/templates/Vue InstantSearch with Vue 3/index.html +5 -2
  24. /package/src/templates/JavaScript Client/{package.json → package.json.hbs} +0 -0
  25. /package/src/templates/React InstantSearch Native/{package.json → package.json.hbs} +0 -0
package/README.md CHANGED
@@ -180,7 +180,7 @@ Create InstantSearch App is [MIT licensed](LICENSE).
180
180
  [version-svg]: https://img.shields.io/npm/v/create-instantsearch-app.svg?style=flat-square
181
181
  [package-url]: https://npmjs.org/package/create-instantsearch-app
182
182
  [ci-svg]: https://img.shields.io/circleci/project/github/algolia/create-instantsearch-app.svg?style=flat-square
183
- [ci-url]: https://circleci.com/gh/algolia/instantsearch.js
183
+ [ci-url]: https://circleci.com/gh/algolia/instantsearch
184
184
  [license-image]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square
185
185
  [license-url]: LICENSE
186
186
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-instantsearch-app",
3
- "version": "7.0.1",
3
+ "version": "7.1.0",
4
4
  "license": "MIT",
5
5
  "description": "⚡️ Build InstantSearch apps at the speed of thought",
6
6
  "keywords": [
@@ -38,20 +38,20 @@
38
38
  "algoliasearch": "4",
39
39
  "chalk": "3.0.0",
40
40
  "commander": "4.1.1",
41
- "inquirer": "8.0.0",
41
+ "inquirer": "8.2.0",
42
42
  "jstransformer-handlebars": "1.1.0",
43
43
  "load-json-file": "6.2.0",
44
44
  "lodash.camelcase": "4.3.0",
45
45
  "metalsmith": "2.5.1",
46
46
  "metalsmith-rename": "1.0.0",
47
- "prettier": "1.19.1",
47
+ "prettier": "^2.4.1",
48
48
  "semver": "6.1.1",
49
49
  "validate-npm-package-name": "3.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@instantsearch/testutils": "1.13.0",
52
+ "@instantsearch/testutils": "1.15.0",
53
53
  "jest-image-snapshot": "2.12.0",
54
54
  "walk-sync": "2.0.2"
55
55
  },
56
- "gitHead": "90a5e43746613d2f9eb3dc49fa15b1895d45c7bd"
56
+ "gitHead": "b2196f01f03c6bea37a3aa048e4e5b45a9bbf33d"
57
57
  }
package/src/cli/index.js CHANGED
@@ -162,7 +162,7 @@ const getQuestions = ({ appName }) => ({
162
162
  {
163
163
  type: 'checkbox',
164
164
  name: 'attributesForFaceting',
165
- message: 'Attributes to display',
165
+ message: 'Attributes for faceting',
166
166
  suffix: `\n ${chalk.gray('Used to filter the search interface')}`,
167
167
  pageSize: 10,
168
168
  choices: async (answers) => {
@@ -22,13 +22,8 @@
22
22
  "main": "src/main.ts",
23
23
  "polyfills": "src/polyfills.ts",
24
24
  "tsConfig": "tsconfig.app.json",
25
- "assets": [
26
- "src/favicon.ico",
27
- "src/assets"
28
- ],
29
- "styles": [
30
- "src/styles.css"
31
- ],
25
+ "assets": ["src/favicon.ico", "src/assets"],
26
+ "styles": ["src/styles.css"],
32
27
  "scripts": []
33
28
  },
34
29
  "configurations": {
@@ -89,10 +84,7 @@
89
84
  "polyfills": "src/polyfills.ts",
90
85
  "tsConfig": "tsconfig.spec.json",
91
86
  "karmaConfig": "karma.conf.js",
92
- "assets": [
93
- "src/favicon.ico",
94
- "src/assets"
95
- ],
87
+ "assets": ["src/favicon.ico", "src/assets"],
96
88
  "styles": [
97
89
  "node_modules/instantsearch.css/themes/satellite.css",
98
90
  "src/styles.css"
@@ -10,7 +10,7 @@ module.exports = function (config) {
10
10
  require('karma-chrome-launcher'),
11
11
  require('karma-jasmine-html-reporter'),
12
12
  require('karma-coverage'),
13
- require('@angular-devkit/build-angular/plugins/karma')
13
+ require('@angular-devkit/build-angular/plugins/karma'),
14
14
  ],
15
15
  client: {
16
16
  jasmine: {
@@ -19,18 +19,15 @@ module.exports = function (config) {
19
19
  // for example, you can disable the random execution with `random: false`
20
20
  // or set a specific seed with `seed: 4321`
21
21
  },
22
- clearContext: false // leave Jasmine Spec Runner output visible in browser
22
+ clearContext: false, // leave Jasmine Spec Runner output visible in browser
23
23
  },
24
24
  jasmineHtmlReporter: {
25
- suppressAll: true // removes the duplicated traces
25
+ suppressAll: true, // removes the duplicated traces
26
26
  },
27
27
  coverageReporter: {
28
28
  dir: require('path').join(__dirname, './coverage/{{name}}'),
29
29
  subdir: '.',
30
- reporters: [
31
- { type: 'html' },
32
- { type: 'text-summary' }
33
- ]
30
+ reporters: [{ type: 'html' }, { type: 'text-summary' }],
34
31
  },
35
32
  reporters: ['progress', 'kjhtml'],
36
33
  port: 9876,
@@ -39,6 +36,6 @@ module.exports = function (config) {
39
36
  autoWatch: true,
40
37
  browsers: ['Chrome'],
41
38
  singleRun: false,
42
- restartOnFileChange: true
39
+ restartOnFileChange: true,
43
40
  });
44
41
  };
@@ -1,15 +1,12 @@
1
1
  import { Component } from '@angular/core';
2
2
  import algoliasearch from 'algoliasearch/lite';
3
3
 
4
- const searchClient = algoliasearch(
5
- '{{appId}}',
6
- '{{apiKey}}'
7
- );
4
+ const searchClient = algoliasearch('{{appId}}', '{{apiKey}}');
8
5
 
9
6
  @Component({
10
7
  selector: 'app-root',
11
8
  templateUrl: './app.component.html',
12
- styleUrls: ['./app.component.css']
9
+ styleUrls: ['./app.component.css'],
13
10
  })
14
11
  export class AppComponent {
15
12
  config = {
@@ -5,14 +5,9 @@ import { NgAisModule } from 'angular-instantsearch';
5
5
  import { AppComponent } from './app.component';
6
6
 
7
7
  @NgModule({
8
- declarations: [
9
- AppComponent
10
- ],
11
- imports: [
12
- NgAisModule.forRoot(),
13
- BrowserModule
14
- ],
8
+ declarations: [AppComponent],
9
+ imports: [NgAisModule.forRoot(), BrowserModule],
15
10
  providers: [],
16
- bootstrap: [AppComponent]
11
+ bootstrap: [AppComponent],
17
12
  })
18
- export class AppModule { }
13
+ export class AppModule {}
@@ -1,3 +1,3 @@
1
1
  export const environment = {
2
- production: true
2
+ production: true,
3
3
  };
@@ -3,7 +3,7 @@
3
3
  // The list of file replacements can be found in `angular.json`.
4
4
 
5
5
  export const environment = {
6
- production: false
6
+ production: false,
7
7
  };
8
8
 
9
9
  /*
@@ -1,14 +1,17 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>{{name}}</title>
6
- <base href="/">
7
- <meta name="viewport" content="width=device-width, initial-scale=1">
8
- <link rel="icon" type="image/x-icon" href="favicon.ico">
9
- <link href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite.css" rel="stylesheet" />
10
- </head>
11
- <body>
12
- <app-root></app-root>
13
- </body>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>{{name}}</title>
6
+ <base href="/" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ <link rel="icon" type="image/x-icon" href="favicon.ico" />
9
+ <link
10
+ href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite.css"
11
+ rel="stylesheet"
12
+ />
13
+ </head>
14
+ <body>
15
+ <app-root></app-root>
16
+ </body>
14
17
  </html>
@@ -8,5 +8,6 @@ if (environment.production) {
8
8
  enableProdMode();
9
9
  }
10
10
 
11
- platformBrowserDynamic().bootstrapModule(AppModule)
12
- .catch(err => console.error(err));
11
+ platformBrowserDynamic()
12
+ .bootstrapModule(AppModule)
13
+ .catch((err) => console.error(err));
@@ -57,8 +57,7 @@
57
57
  /***************************************************************************************************
58
58
  * Zone JS is required by default for Angular itself.
59
59
  */
60
- import 'zone.js'; // Included with Angular CLI.
61
-
60
+ import 'zone.js'; // Included with Angular CLI.
62
61
 
63
62
  /***************************************************************************************************
64
63
  * APPLICATION IMPORTS
@@ -4,11 +4,15 @@ import 'zone.js/testing';
4
4
  import { getTestBed } from '@angular/core/testing';
5
5
  import {
6
6
  BrowserDynamicTestingModule,
7
- platformBrowserDynamicTesting
7
+ platformBrowserDynamicTesting,
8
8
  } from '@angular/platform-browser-dynamic/testing';
9
9
 
10
10
  declare const require: {
11
- context(path: string, deep?: boolean, filter?: RegExp): {
11
+ context(
12
+ path: string,
13
+ deep?: boolean,
14
+ filter?: RegExp
15
+ ): {
12
16
  keys(): string[];
13
17
  <T>(id: string): T;
14
18
  };
@@ -18,7 +22,7 @@ declare const require: {
18
22
  getTestBed().initTestEnvironment(
19
23
  BrowserDynamicTestingModule,
20
24
  platformBrowserDynamicTesting(),
21
- { teardown: { destroyAfterEach: true }},
25
+ { teardown: { destroyAfterEach: true } }
22
26
  );
23
27
 
24
28
  // Then we find all the tests.
@@ -1,48 +1,48 @@
1
1
  {
2
- "images" : [
2
+ "images": [
3
3
  {
4
- "idiom" : "iphone",
5
- "size" : "20x20",
6
- "scale" : "2x"
4
+ "idiom": "iphone",
5
+ "size": "20x20",
6
+ "scale": "2x"
7
7
  },
8
8
  {
9
- "idiom" : "iphone",
10
- "size" : "20x20",
11
- "scale" : "3x"
9
+ "idiom": "iphone",
10
+ "size": "20x20",
11
+ "scale": "3x"
12
12
  },
13
13
  {
14
- "idiom" : "iphone",
15
- "size" : "29x29",
16
- "scale" : "2x"
14
+ "idiom": "iphone",
15
+ "size": "29x29",
16
+ "scale": "2x"
17
17
  },
18
18
  {
19
- "idiom" : "iphone",
20
- "size" : "29x29",
21
- "scale" : "3x"
19
+ "idiom": "iphone",
20
+ "size": "29x29",
21
+ "scale": "3x"
22
22
  },
23
23
  {
24
- "idiom" : "iphone",
25
- "size" : "40x40",
26
- "scale" : "2x"
24
+ "idiom": "iphone",
25
+ "size": "40x40",
26
+ "scale": "2x"
27
27
  },
28
28
  {
29
- "idiom" : "iphone",
30
- "size" : "40x40",
31
- "scale" : "3x"
29
+ "idiom": "iphone",
30
+ "size": "40x40",
31
+ "scale": "3x"
32
32
  },
33
33
  {
34
- "idiom" : "iphone",
35
- "size" : "60x60",
36
- "scale" : "2x"
34
+ "idiom": "iphone",
35
+ "size": "60x60",
36
+ "scale": "2x"
37
37
  },
38
38
  {
39
- "idiom" : "iphone",
40
- "size" : "60x60",
41
- "scale" : "3x"
39
+ "idiom": "iphone",
40
+ "size": "60x60",
41
+ "scale": "3x"
42
42
  }
43
43
  ],
44
- "info" : {
45
- "version" : 1,
46
- "author" : "xcode"
44
+ "info": {
45
+ "version": 1,
46
+ "author": "xcode"
47
47
  }
48
- }
48
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Config file for API Extractor. For more info, please visit: https://api-extractor.com
3
3
  */
4
- {
4
+ {
5
5
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
6
6
 
7
7
  /**
@@ -2,6 +2,6 @@ body {
2
2
  font-family: sans-serif;
3
3
  }
4
4
 
5
- [class^=ais-] {
5
+ [class^='ais-'] {
6
6
  font-size: 1em;
7
7
  }
@@ -1,17 +1,20 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/algolia-min.css">
8
- <link rel="stylesheet" href="style.css">
9
- <title>{{ name }} example</title>
10
- </head>
11
- <body>
12
- <div id="search-box"></div>
13
- <div id="example"></div>
14
- <div id="hits"></div>
15
- <script src="index.ts"></script>
16
- </body>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <link
8
+ rel="stylesheet"
9
+ href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/algolia-min.css"
10
+ />
11
+ <link rel="stylesheet" href="style.css" />
12
+ <title>{{ name }} example</title>
13
+ </head>
14
+ <body>
15
+ <div id="search-box"></div>
16
+ <div id="example"></div>
17
+ <div id="hits"></div>
18
+ <script src="index.ts"></script>
19
+ </body>
17
20
  </html>
@@ -7,7 +7,7 @@
7
7
  content="width=device-width, initial-scale=1, shrink-to-fit=no"
8
8
  />
9
9
 
10
- <link rel="shortcut icon" href="favicon.png">
10
+ <link rel="shortcut icon" href="favicon.png" />
11
11
 
12
12
  <!--
13
13
  Do not use @7 in production, use a complete version like x.x.x, see website for latest version:
@@ -1,4 +1,4 @@
1
- module.exports = function(api) {
1
+ module.exports = function (api) {
2
2
  api.cache(true);
3
3
  return {
4
4
  presets: ['babel-preset-expo'],
@@ -20,8 +20,8 @@ export const InfiniteHits = forwardRef(
20
20
  return (
21
21
  <FlatList
22
22
  ref={ref}
23
- data={(hits as unknown) as THit[]}
24
- keyExtractor={item => item.objectID}
23
+ data={hits as unknown as THit[]}
24
+ keyExtractor={(item) => item.objectID}
25
25
  ItemSeparatorComponent={() => <View style={styles.separator} />}
26
26
  onEndReached={() => {
27
27
  if (!isLastPage) {
@@ -30,7 +30,7 @@ export const InfiniteHits = forwardRef(
30
30
  }}
31
31
  renderItem={({ item }) => (
32
32
  <View style={styles.item}>
33
- <Hit hit={(item as unknown) as THit} />
33
+ <Hit hit={item as unknown as THit} />
34
34
  </View>
35
35
  )}
36
36
  />
@@ -1,20 +1,26 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
- <link rel="icon" href="<%= BASE_URL %>favicon.png">
8
- <!--
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
+ <link rel="icon" href="<%= BASE_URL %>favicon.png" />
8
+ <!--
9
9
  Do not use @7 in production, use a complete version like x.x.x, see website for latest version:
10
10
  https://www.algolia.com/doc/guides/building-search-ui/installation/react/#load-the-style
11
11
  -->
12
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite-min.css">
12
+ <link
13
+ rel="stylesheet"
14
+ href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite-min.css"
15
+ />
13
16
  <title>{{name}}</title>
14
17
  </head>
15
18
  <body>
16
19
  <noscript>
17
- <strong>We're sorry but {{name}} doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
20
+ <strong
21
+ >We're sorry but {{name}} doesn't work properly without JavaScript
22
+ enabled. Please enable it to continue.</strong
23
+ >
18
24
  </noscript>
19
25
  <div id="app"></div>
20
26
  <!-- built files will be auto injected -->
@@ -7,5 +7,5 @@ Vue.config.productionTip = false;
7
7
  Vue.use(InstantSearch);
8
8
 
9
9
  new Vue({
10
- render: h => h(App),
10
+ render: (h) => h(App),
11
11
  }).$mount('#app');
@@ -2,14 +2,17 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
5
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <link rel="icon" href="/favicon.png" />
8
8
  <!--
9
9
  Do not use @7 in production, use a complete version like x.x.x, see website for latest version:
10
10
  https://www.algolia.com/doc/guides/building-search-ui/installation/react/#load-the-style
11
11
  -->
12
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite-min.css">
12
+ <link
13
+ rel="stylesheet"
14
+ href="https://cdn.jsdelivr.net/npm/instantsearch.css@7/themes/satellite-min.css"
15
+ />
13
16
  <title>{{name}}</title>
14
17
  </head>
15
18
  <body>