create-instantsearch-app 7.5.14 → 7.5.16

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 (32) hide show
  1. package/README.md +2 -7
  2. package/package.json +5 -5
  3. package/src/api/__tests__/__snapshots__/index.test.js.snap +3 -3
  4. package/src/cli/__tests__/getInformationFromIndex.js +2 -2
  5. package/src/cli/getInformationFromIndex.js +4 -4
  6. package/src/templates/InstantSearch.js widget/example/index.ts.hbs +3 -3
  7. package/src/templates/React InstantSearch Native/types/ProductHit.ts +1 -1
  8. package/src/utils/__tests__/index.test.js +0 -2
  9. package/src/templates/Angular InstantSearch/.browserslistrc +0 -17
  10. package/src/templates/Angular InstantSearch/.editorconfig +0 -16
  11. package/src/templates/Angular InstantSearch/.gitignore.template +0 -5
  12. package/src/templates/Angular InstantSearch/.template.js +0 -15
  13. package/src/templates/Angular InstantSearch/README.md +0 -21
  14. package/src/templates/Angular InstantSearch/angular.json +0 -99
  15. package/src/templates/Angular InstantSearch/karma.conf.js +0 -41
  16. package/src/templates/Angular InstantSearch/package.json +0 -41
  17. package/src/templates/Angular InstantSearch/src/app/app.component.css +0 -55
  18. package/src/templates/Angular InstantSearch/src/app/app.component.html.hbs +0 -69
  19. package/src/templates/Angular InstantSearch/src/app/app.component.ts +0 -16
  20. package/src/templates/Angular InstantSearch/src/app/app.module.ts +0 -13
  21. package/src/templates/Angular InstantSearch/src/assets/.gitkeep +0 -0
  22. package/src/templates/Angular InstantSearch/src/environments/environment.prod.ts +0 -3
  23. package/src/templates/Angular InstantSearch/src/environments/environment.ts +0 -16
  24. package/src/templates/Angular InstantSearch/src/favicon.ico +0 -0
  25. package/src/templates/Angular InstantSearch/src/index.html +0 -17
  26. package/src/templates/Angular InstantSearch/src/main.ts +0 -13
  27. package/src/templates/Angular InstantSearch/src/polyfills.ts +0 -68
  28. package/src/templates/Angular InstantSearch/src/styles.css +0 -11
  29. package/src/templates/Angular InstantSearch/src/test.ts +0 -31
  30. package/src/templates/Angular InstantSearch/tsconfig.app.json +0 -15
  31. package/src/templates/Angular InstantSearch/tsconfig.json +0 -32
  32. package/src/templates/Angular InstantSearch/tsconfig.spec.json +0 -18
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][react-instantsearch-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], [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">
@@ -50,9 +50,7 @@ cd my-app
50
50
  yarn start
51
51
  ```
52
52
 
53
- > **Important**
54
- > Selecting 'Y' when being prompted to ‘Enable user events’ activates the [`insights`](https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-insights) option for compatible templates, allowing Algolia to process your user Events. Events can unlock powerful features, enhancing your application's effectiveness and we encourage you to consider enabling this valuable functionality. Please review our [API reference](https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-insights) for more details about Events collection and settings.
55
-
53
+ > **Important** Selecting 'Y' when being prompted to ‘Enable user events’ activates the [`insights`](https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-insights) option for compatible templates, allowing Algolia to process your user Events. Events can unlock powerful features, enhancing your application's effectiveness and we encourage you to consider enabling this valuable functionality. Please review our [API reference](https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-insights) for more details about Events collection and settings.
56
54
 
57
55
  ## Usage
58
56
 
@@ -89,7 +87,6 @@ Supported templates are:
89
87
  - [`React InstantSearch`][react-instantsearch-github]
90
88
  - [`React InstantSearch Native`][react-instantsearch-github]
91
89
  - [`Vue InstantSearch`][vue-instantsearch-github]
92
- - [`Angular InstantSearch`][angular-instantsearch-github]
93
90
  - [`InstantSearch iOS`][instantsearch-ios-github]
94
91
  - [`InstantSearch Android`][instantsearch-android-github]
95
92
 
@@ -158,7 +155,6 @@ You can use the web templates on CodeSandbox:
158
155
  - [InstantSearch.js](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/instantsearch.js)
159
156
  - [React InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/react-instantsearch)
160
157
  - [Vue InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/vue-instantsearch)
161
- - [Angular InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/angular-instantsearch)
162
158
  - [Autocomplete.js](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/autocomplete.js)
163
159
  - [JavaScript Client](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/javascript-client)
164
160
  - [JavaScript Helper](https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/javascript-helper)
@@ -198,7 +194,6 @@ Create InstantSearch App is [MIT licensed](LICENSE).
198
194
  [instantsearchjs-github]: https://github.com/algolia/instantsearch/tree/master/packages/instantsearch.js
199
195
  [react-instantsearch-github]: https://github.com/algolia/instantsearch/tree/master/packages/react-instantsearch
200
196
  [vue-instantsearch-github]: https://github.com/algolia/instantsearch/tree/master/packages/vue-instantsearch
201
- [angular-instantsearch-github]: https://github.com/algolia/angular-instantsearch
202
197
  [instantsearch-ios-github]: https://github.com/algolia/instantsearch-ios
203
198
  [instantsearch-android-github]: https://github.com/algolia/instantsearch-android
204
199
  [contributing-bugreport]: https://github.com/algolia/instantsearch/issues/new?template=BUG_REPORT.yml&labels=triage,Library%3A%20Create+InstantSearch+App
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-instantsearch-app",
3
- "version": "7.5.14",
3
+ "version": "7.5.16",
4
4
  "license": "MIT",
5
5
  "description": "⚡️ Build InstantSearch apps at the speed of thought",
6
6
  "keywords": [
@@ -32,10 +32,10 @@
32
32
  "node": ">= 10"
33
33
  },
34
34
  "dependencies": {
35
- "@algolia/cache-in-memory": "4",
35
+ "@algolia/client-common": "5.1.1",
36
36
  "@metalsmith/in-place": "4.6.0",
37
37
  "@metalsmith/remove": "1.3.0",
38
- "algoliasearch": "4",
38
+ "algoliasearch": "5.1.1",
39
39
  "chalk": "3.0.0",
40
40
  "commander": "4.1.1",
41
41
  "inquirer": "8.2.0",
@@ -49,9 +49,9 @@
49
49
  "validate-npm-package-name": "3.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@instantsearch/testutils": "1.44.0",
52
+ "@instantsearch/testutils": "1.48.0",
53
53
  "jest-image-snapshot": "2.12.0",
54
54
  "walk-sync": "2.0.2"
55
55
  },
56
- "gitHead": "1583f2bc8e74ccccc59a0bd0193f69f9c77bf636"
56
+ "gitHead": "bd1f4a7e1cdb277169486c4735ac6651fc053716"
57
57
  }
@@ -6,10 +6,10 @@ exports[`Options with invalid name throws 1`] = `
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, 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"`;
9
+ exports[`Options with unknown template throws 1`] = `"The template directory must contain a configuration file \`.template.js\` or must be one of those: 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, 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"`;
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: 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, 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"`;
15
+ exports[`Options without template throws 1`] = `"The template directory must contain a configuration file \`.template.js\` or must be one of those: 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"`;
@@ -1,4 +1,4 @@
1
- const algoliasearch = require('algoliasearch');
1
+ const { algoliasearch } = require('algoliasearch');
2
2
 
3
3
  const getInformationFromIndex = require('../getInformationFromIndex');
4
4
 
@@ -15,7 +15,7 @@ jest.mock('algoliasearch', () => {
15
15
  })
16
16
  );
17
17
 
18
- return _algoliasearch;
18
+ return { algoliasearch: _algoliasearch };
19
19
  });
20
20
 
21
21
  test('returns default information', async () => {
@@ -1,5 +1,5 @@
1
- const { createInMemoryCache } = require('@algolia/cache-in-memory');
2
- const algoliasearch = require('algoliasearch');
1
+ const { createMemoryCache } = require('@algolia/client-common');
2
+ const { algoliasearch } = require('algoliasearch');
3
3
 
4
4
  const clients = new Map();
5
5
  function getClient(appId, apiKey) {
@@ -7,8 +7,8 @@ function getClient(appId, apiKey) {
7
7
  let client = clients.get(key);
8
8
  if (!client) {
9
9
  client = algoliasearch(appId, apiKey, {
10
- responsesCache: createInMemoryCache(),
11
- requestsCache: createInMemoryCache(),
10
+ responsesCache: createMemoryCache(),
11
+ requestsCache: createMemoryCache(),
12
12
  });
13
13
 
14
14
  clients.set(key, client);
@@ -20,12 +20,12 @@ search.addWidgets([
20
20
  hits({
21
21
  container: '#hits',
22
22
  templates: {
23
- item: `
23
+ item: (hit, { html, components }) => html`
24
24
  <p>
25
- {{#helpers.highlight}}{ "attribute": "name" }{{/helpers.highlight}}
25
+ ${components.Highlight({ hit, attribute: 'name' })}
26
26
  </p>
27
27
  <small>
28
- {{#helpers.snippet}}{ "attribute": "description" }{{/helpers.snippet}}
28
+ ${components.Snippet({ hit, attribute: 'description' })}
29
29
  </small>
30
30
  `,
31
31
  },
@@ -1,4 +1,4 @@
1
- import { Hit as AlgoliaHit } from '@algolia/client-search';
1
+ import { Hit as AlgoliaHit } from 'instantsearch.js';
2
2
 
3
3
  export type ProductHit = AlgoliaHit<{
4
4
  brand: string;
@@ -121,7 +121,6 @@ describe('getTemplatesByCategory', () => {
121
121
  beforeAll(() => {
122
122
  mockReaddirSync.mockImplementation(() => [
123
123
  'InstantSearch.js',
124
- 'Angular InstantSearch',
125
124
  'React InstantSearch',
126
125
  'Vue InstantSearch',
127
126
  'React InstantSearch Native',
@@ -135,7 +134,6 @@ describe('getTemplatesByCategory', () => {
135
134
  expect(utils.getTemplatesByCategory()).toEqual({
136
135
  Web: expect.arrayContaining([
137
136
  'InstantSearch.js',
138
- 'Angular InstantSearch',
139
137
  'React InstantSearch',
140
138
  'Vue InstantSearch',
141
139
  ]),
@@ -1,17 +0,0 @@
1
- # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2
- # For additional information regarding the format and rule options, please see:
3
- # https://github.com/browserslist/browserslist#queries
4
-
5
- # For the full list of supported browsers by the Angular framework, please see:
6
- # https://angular.io/guide/browser-support
7
-
8
- # You can see what browsers were selected by your queries by running:
9
- # npx browserslist
10
-
11
- last 1 Chrome version
12
- last 1 Firefox version
13
- last 2 Edge major versions
14
- last 2 Safari major versions
15
- last 2 iOS major versions
16
- Firefox ESR
17
- not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
@@ -1,16 +0,0 @@
1
- # Editor configuration, see https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = space
7
- indent_size = 2
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.ts]
12
- quote_type = single
13
-
14
- [*.md]
15
- max_line_length = off
16
- trim_trailing_whitespace = false
@@ -1,5 +0,0 @@
1
- node_modules/
2
- npm-debug.log
3
- yarn-debug.log
4
- yarn-error.log
5
- dist/
@@ -1,15 +0,0 @@
1
- const install = require('../../tasks/node/install');
2
- const teardown = require('../../tasks/node/teardown');
3
-
4
- module.exports = {
5
- category: 'Web',
6
- libraryName: 'angular-instantsearch',
7
- templateName: 'angular-instantsearch',
8
- supportedVersion: '^4.0.0',
9
- appName: 'angular-instantsearch-app',
10
- keywords: ['algolia', 'InstantSearch', 'Angular', 'angular-instantsearch'],
11
- tasks: {
12
- install,
13
- teardown,
14
- },
15
- };
@@ -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,99 +0,0 @@
1
- {
2
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
- "version": 1,
4
- "newProjectRoot": "projects",
5
- "projects": {
6
- "{{name}}": {
7
- "projectType": "application",
8
- "schematics": {
9
- "@schematics/angular:application": {
10
- "strict": true
11
- }
12
- },
13
- "root": "",
14
- "sourceRoot": "src",
15
- "prefix": "app",
16
- "architect": {
17
- "build": {
18
- "builder": "@angular-devkit/build-angular:browser",
19
- "options": {
20
- "outputPath": "dist/{{name}}",
21
- "index": "src/index.html",
22
- "main": "src/main.ts",
23
- "polyfills": "src/polyfills.ts",
24
- "tsConfig": "tsconfig.app.json",
25
- "assets": ["src/favicon.ico", "src/assets"],
26
- "styles": ["src/styles.css"],
27
- "scripts": []
28
- },
29
- "configurations": {
30
- "production": {
31
- "budgets": [
32
- {
33
- "type": "initial",
34
- "maximumWarning": "500kb",
35
- "maximumError": "1mb"
36
- },
37
- {
38
- "type": "anyComponentStyle",
39
- "maximumWarning": "2kb",
40
- "maximumError": "4kb"
41
- }
42
- ],
43
- "fileReplacements": [
44
- {
45
- "replace": "src/environments/environment.ts",
46
- "with": "src/environments/environment.prod.ts"
47
- }
48
- ],
49
- "outputHashing": "all"
50
- },
51
- "development": {
52
- "buildOptimizer": false,
53
- "optimization": false,
54
- "vendorChunk": true,
55
- "extractLicenses": false,
56
- "sourceMap": true,
57
- "namedChunks": true
58
- }
59
- },
60
- "defaultConfiguration": "production"
61
- },
62
- "serve": {
63
- "builder": "@angular-devkit/build-angular:dev-server",
64
- "configurations": {
65
- "production": {
66
- "browserTarget": "{{name}}:build:production"
67
- },
68
- "development": {
69
- "browserTarget": "{{name}}:build:development"
70
- }
71
- },
72
- "defaultConfiguration": "development"
73
- },
74
- "extract-i18n": {
75
- "builder": "@angular-devkit/build-angular:extract-i18n",
76
- "options": {
77
- "browserTarget": "{{name}}:build"
78
- }
79
- },
80
- "test": {
81
- "builder": "@angular-devkit/build-angular:karma",
82
- "options": {
83
- "main": "src/test.ts",
84
- "polyfills": "src/polyfills.ts",
85
- "tsConfig": "tsconfig.spec.json",
86
- "karmaConfig": "karma.conf.js",
87
- "assets": ["src/favicon.ico", "src/assets"],
88
- "styles": [
89
- "node_modules/instantsearch.css/themes/satellite.css",
90
- "src/styles.css"
91
- ],
92
- "scripts": []
93
- }
94
- }
95
- }
96
- }
97
- },
98
- "defaultProject": "{{name}}"
99
- }
@@ -1,41 +0,0 @@
1
- // Karma configuration file, see link for more information
2
- // https://karma-runner.github.io/1.0/config/configuration-file.html
3
-
4
- module.exports = function (config) {
5
- config.set({
6
- basePath: '',
7
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
- plugins: [
9
- require('karma-jasmine'),
10
- require('karma-chrome-launcher'),
11
- require('karma-jasmine-html-reporter'),
12
- require('karma-coverage'),
13
- require('@angular-devkit/build-angular/plugins/karma'),
14
- ],
15
- client: {
16
- jasmine: {
17
- // you can add configuration options for Jasmine here
18
- // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19
- // for example, you can disable the random execution with `random: false`
20
- // or set a specific seed with `seed: 4321`
21
- },
22
- clearContext: false, // leave Jasmine Spec Runner output visible in browser
23
- },
24
- jasmineHtmlReporter: {
25
- suppressAll: true, // removes the duplicated traces
26
- },
27
- coverageReporter: {
28
- dir: require('path').join(__dirname, './coverage/{{name}}'),
29
- subdir: '.',
30
- reporters: [{ type: 'html' }, { type: 'text-summary' }],
31
- },
32
- reporters: ['progress', 'kjhtml'],
33
- port: 9876,
34
- colors: true,
35
- logLevel: config.LOG_INFO,
36
- autoWatch: true,
37
- browsers: ['Chrome'],
38
- singleRun: false,
39
- restartOnFileChange: true,
40
- });
41
- };
@@ -1,41 +0,0 @@
1
- {
2
- "name": "{{name}}",
3
- "version": "1.0.0",
4
- "scripts": {
5
- "ng": "ng",
6
- "start": "ng serve --port 3000",
7
- "build": "ng build",
8
- "watch": "ng build --watch --configuration development",
9
- "test": "ng test"
10
- },
11
- "private": true,
12
- "dependencies": {
13
- "@angular/animations": "15.2.10",
14
- "@angular/common": "15.2.10",
15
- "@angular/compiler": "15.2.10",
16
- "@angular/core": "15.2.10",
17
- "@angular/forms": "15.2.10",
18
- "@angular/platform-browser": "15.2.10",
19
- "@angular/platform-browser-dynamic": "15.2.10",
20
- "@angular/router": "15.2.10",
21
- "algoliasearch": "4",
22
- "angular-instantsearch": "{{libraryVersion}}",
23
- "rxjs": "6.6.0",
24
- "tslib": "2.3.0",
25
- "zone.js": "0.11.4"
26
- },
27
- "devDependencies": {
28
- "@angular-devkit/build-angular": "15.2.10",
29
- "@angular/cli": "15.2.10",
30
- "@angular/compiler-cli": "15.2.10",
31
- "@types/jasmine": "3.8.0",
32
- "@types/node": "12.11.1",
33
- "jasmine-core": "3.8.0",
34
- "karma": "6.3.0",
35
- "karma-chrome-launcher": "3.1.0",
36
- "karma-coverage": "2.0.3",
37
- "karma-jasmine": "4.0.0",
38
- "karma-jasmine-html-reporter": "1.7.0",
39
- "typescript": "4.9.5"
40
- }
41
- }
@@ -1,55 +0,0 @@
1
- .header {
2
- display: flex;
3
- align-items: center;
4
- min-height: 50px;
5
- padding: 0.5rem 1rem;
6
- background-image: linear-gradient(to right, #c3002f, #dd0031);
7
- color: #fff;
8
- margin-bottom: 1rem;
9
- }
10
-
11
- .header a {
12
- color: #fff;
13
- text-decoration: none;
14
- }
15
-
16
- .header-title {
17
- font-size: 1.2rem;
18
- font-weight: normal;
19
- }
20
-
21
- .header-title::after {
22
- content: ' ▸ ';
23
- padding: 0 0.5rem;
24
- }
25
-
26
- .header-subtitle {
27
- font-size: 1.2rem;
28
- }
29
-
30
- .container {
31
- max-width: 1200px;
32
- margin: 0 auto;
33
- padding: 1rem;
34
- }
35
-
36
- .search-panel {
37
- display: flex;
38
- }
39
-
40
- .search-panel__filters {
41
- flex: 1;
42
- }
43
-
44
- .search-panel__results {
45
- flex: 3;
46
- }
47
-
48
- .searchbox {
49
- margin-bottom: 2rem;
50
- }
51
-
52
- .pagination {
53
- margin: 2rem auto;
54
- text-align: center;
55
- }
@@ -1,69 +0,0 @@
1
- <header class="header">
2
- <h1 class="header-title">
3
- <a href="/">{{name}}</a>
4
- </h1>
5
- <p class="header-subtitle">
6
- using
7
- <a href="https://github.com/algolia/angular-instantsearch">
8
- Angular InstantSearch
9
- </a>
10
- </p>
11
- </header>
12
-
13
- <div class="container">
14
- <ais-instantsearch [config]="config">
15
- <ais-configure [searchParameters]="{ hitsPerPage: 8 }"></ais-configure>
16
- <div class="search-panel">
17
- {{#if attributesForFaceting}}
18
- <div class="search-panel__filters">
19
- {{#each attributesForFaceting}}
20
- <ais-panel header="{{this}}">
21
- <ais-refinement-list attribute="{{this}}"></ais-refinement-list>
22
- </ais-panel>
23
- {{/each}}
24
- </div>
25
-
26
- {{/if}}
27
- <div class="search-panel__results">
28
- <div class="searchbox">
29
- <ais-search-box placeholder="{{searchPlaceholder}}"></ais-search-box>
30
- </div>
31
-
32
- {{#if attributesToDisplay}}
33
- <ais-hits>
34
- <ng-template let-hits="hits" let-results="results">
35
- <div *ngIf="hits.length === 0">
36
- No results found matching <strong></strong>.
37
- </div>
38
-
39
- <ol class="ais-Hits-list">
40
- <li class="ais-Hits-item" *ngFor="let hit of hits">
41
- <article>
42
- <h1>
43
- <ais-highlight attribute="{{attributesToDisplay.[0]}}" [hit]="hit"></ais-highlight>
44
- </h1>
45
-
46
- {{#each attributesToDisplay}}
47
- {{#unless @first}}
48
- <p>
49
- <ais-highlight attribute="{{this}}" [hit]="hit"></ais-highlight>
50
- </p>
51
- {{/unless}}
52
- {{/each}}
53
- </article>
54
- </li>
55
- </ol>
56
- </ng-template>
57
- </ais-hits>
58
- {{else}}
59
- <ais-hits></ais-hits>
60
- {{/if}}
61
-
62
- <div class="pagination">
63
- <ais-pagination></ais-pagination>
64
- </div>
65
- </div>
66
-
67
- </div>
68
- </ais-instantsearch>
69
- </div>
@@ -1,16 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import algoliasearch from 'algoliasearch/lite';
3
-
4
- const searchClient = algoliasearch('{{appId}}', '{{apiKey}}');
5
-
6
- @Component({
7
- selector: 'app-root',
8
- templateUrl: './app.component.html',
9
- styleUrls: ['./app.component.css'],
10
- })
11
- export class AppComponent {
12
- config = {
13
- indexName: '{{indexName}}',
14
- searchClient,
15
- };
16
- }
@@ -1,13 +0,0 @@
1
- import { BrowserModule } from '@angular/platform-browser';
2
- import { NgModule } from '@angular/core';
3
- import { NgAisModule } from 'angular-instantsearch';
4
-
5
- import { AppComponent } from './app.component';
6
-
7
- @NgModule({
8
- declarations: [AppComponent],
9
- imports: [NgAisModule.forRoot(), BrowserModule],
10
- providers: [],
11
- bootstrap: [AppComponent],
12
- })
13
- export class AppModule {}
@@ -1,3 +0,0 @@
1
- export const environment = {
2
- production: true,
3
- };
@@ -1,16 +0,0 @@
1
- // This file can be replaced during build by using the `fileReplacements` array.
2
- // `ng build` replaces `environment.ts` with `environment.prod.ts`.
3
- // The list of file replacements can be found in `angular.json`.
4
-
5
- export const environment = {
6
- production: false,
7
- };
8
-
9
- /*
10
- * For easier debugging in development mode, you can import the following file
11
- * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12
- *
13
- * This import should be commented out in production mode because it will have a negative impact
14
- * on performance if an error is thrown.
15
- */
16
- // import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
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
10
- href="https://cdn.jsdelivr.net/npm/instantsearch.css@8/themes/satellite.css"
11
- rel="stylesheet"
12
- />
13
- </head>
14
- <body>
15
- <app-root></app-root>
16
- </body>
17
- </html>
@@ -1,13 +0,0 @@
1
- import { enableProdMode } from '@angular/core';
2
- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3
-
4
- import { AppModule } from './app/app.module';
5
- import { environment } from './environments/environment';
6
-
7
- if (environment.production) {
8
- enableProdMode();
9
- }
10
-
11
- platformBrowserDynamic()
12
- .bootstrapModule(AppModule)
13
- .catch((err) => console.error(err));
@@ -1,68 +0,0 @@
1
- /**
2
- * This file includes polyfills needed by Angular and is loaded before the app.
3
- * You can add your own extra polyfills to this file.
4
- *
5
- * This file is divided into 2 sections:
6
- * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
- * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
- * file.
9
- *
10
- * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
- * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
- * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
- *
14
- * Learn more in https://angular.io/guide/browser-support
15
- */
16
-
17
- /***************************************************************************************************
18
- * BROWSER POLYFILLS
19
- */
20
-
21
- /**
22
- * IE11 requires the following for NgClass support on SVG elements
23
- */
24
- // import 'classlist.js'; // Run `npm install --save classlist.js`.
25
-
26
- /**
27
- * Web Animations `@angular/platform-browser/animations`
28
- * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
29
- * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
30
- */
31
- // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
32
-
33
- /**
34
- * By default, zone.js will patch all possible macroTask and DomEvents
35
- * user can disable parts of macroTask/DomEvents patch by setting following flags
36
- * because those flags need to be set before `zone.js` being loaded, and webpack
37
- * will put import in the top of bundle, so user need to create a separate file
38
- * in this directory (for example: zone-flags.ts), and put the following flags
39
- * into that file, and then add the following code before importing zone.js.
40
- * import './zone-flags';
41
- *
42
- * The flags allowed in zone-flags.ts are listed here.
43
- *
44
- * The following flags will work for all browsers.
45
- *
46
- * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
47
- * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
48
- * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
49
- *
50
- * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
51
- * with the following flag, it will bypass `zone.js` patch for IE/Edge
52
- *
53
- * (window as any).__Zone_enable_cross_context_check = true;
54
- *
55
- */
56
-
57
- /***************************************************************************************************
58
- * Zone JS is required by default for Angular itself.
59
- */
60
- import 'zone.js'; // Included with Angular CLI.
61
-
62
- /***************************************************************************************************
63
- * APPLICATION IMPORTS
64
- */
65
-
66
- (window as any).process = {
67
- env: { DEBUG: undefined },
68
- };
@@ -1,11 +0,0 @@
1
- /* You can add global styles to this file, and also import other style files */
2
- body,
3
- h1 {
4
- margin: 0;
5
- padding: 0;
6
- }
7
-
8
- body {
9
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
10
- Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
11
- }
@@ -1,31 +0,0 @@
1
- // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
-
3
- import 'zone.js/testing';
4
- import { getTestBed } from '@angular/core/testing';
5
- import {
6
- BrowserDynamicTestingModule,
7
- platformBrowserDynamicTesting,
8
- } from '@angular/platform-browser-dynamic/testing';
9
-
10
- declare const require: {
11
- context(
12
- path: string,
13
- deep?: boolean,
14
- filter?: RegExp
15
- ): {
16
- keys(): string[];
17
- <T>(id: string): T;
18
- };
19
- };
20
-
21
- // First, initialize the Angular testing environment.
22
- getTestBed().initTestEnvironment(
23
- BrowserDynamicTestingModule,
24
- platformBrowserDynamicTesting(),
25
- { teardown: { destroyAfterEach: true } }
26
- );
27
-
28
- // Then we find all the tests.
29
- const context = require.context('./', true, /\.spec\.ts$/);
30
- // And load the modules.
31
- context.keys().map(context);
@@ -1,15 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "./tsconfig.json",
4
- "compilerOptions": {
5
- "outDir": "./out-tsc/app",
6
- "types": []
7
- },
8
- "files": [
9
- "src/main.ts",
10
- "src/polyfills.ts"
11
- ],
12
- "include": [
13
- "src/**/*.d.ts"
14
- ]
15
- }
@@ -1,32 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "compileOnSave": false,
4
- "compilerOptions": {
5
- "baseUrl": "./",
6
- "outDir": "./dist/out-tsc",
7
- "forceConsistentCasingInFileNames": true,
8
- "strict": true,
9
- "noImplicitReturns": true,
10
- "noFallthroughCasesInSwitch": true,
11
- "sourceMap": true,
12
- "declaration": false,
13
- "downlevelIteration": true,
14
- "experimentalDecorators": true,
15
- "moduleResolution": "node",
16
- "esModuleInterop": true,
17
- "importHelpers": true,
18
- "target": "es2017",
19
- "module": "es2020",
20
- "lib": [
21
- "es2018",
22
- "dom"
23
- ],
24
- "allowSyntheticDefaultImports": true
25
- },
26
- "angularCompilerOptions": {
27
- "enableI18nLegacyMessageIdFormat": false,
28
- "strictInjectionParameters": true,
29
- "strictInputAccessModifiers": true,
30
- "strictTemplates": true
31
- }
32
- }
@@ -1,18 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "./tsconfig.json",
4
- "compilerOptions": {
5
- "outDir": "./out-tsc/spec",
6
- "types": [
7
- "jasmine"
8
- ]
9
- },
10
- "files": [
11
- "src/test.ts",
12
- "src/polyfills.ts"
13
- ],
14
- "include": [
15
- "src/**/*.spec.ts",
16
- "src/**/*.d.ts"
17
- ]
18
- }