Skip to content

Commit

Permalink
chore(Angular InstantSearch): upgrade conditional-request to Angular …
Browse files Browse the repository at this point in the history
…12 (#254)
  • Loading branch information
tkrugg authored Nov 16, 2021
1 parent 228daf0 commit f655596
Show file tree
Hide file tree
Showing 28 changed files with 5,645 additions and 5,091 deletions.
17 changes: 17 additions & 0 deletions Angular InstantSearch/conditional-request/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
16 changes: 16 additions & 0 deletions Angular InstantSearch/conditional-request/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
83 changes: 43 additions & 40 deletions Angular InstantSearch/conditional-request/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
"newProjectRoot": "projects",
"projects": {
"conditional-request": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
Expand All @@ -17,49 +21,60 @@
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.png",
"src/manifest.json",
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/instantsearch.css/themes/reset.css",
"node_modules/instantsearch.css/themes/algolia.css",
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "conditional-request:build"
},
"configurations": {
"production": {
"browserTarget": "conditional-request:build:production"
},
"development": {
"browserTarget": "conditional-request:build:development"
}
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
Expand All @@ -72,28 +87,16 @@
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"scripts": [],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.png",
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,36 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/conditional-request'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
singleRun: false,
restartOnFileChange: true
});
};
};
70 changes: 30 additions & 40 deletions Angular InstantSearch/conditional-request/package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,42 @@
{
"name": "conditional-request",
"version": "1.0.0",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve --port 3000",
"build": "ng build --prod --progress=false",
"test": "ng test",
"lint": "ng lint"
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "6.1.10",
"@angular/common": "6.1.10",
"@angular/compiler": "6.1.10",
"@angular/core": "6.1.10",
"@angular/forms": "6.1.10",
"@angular/http": "6.1.10",
"@angular/platform-browser": "6.1.10",
"@angular/platform-browser-dynamic": "6.1.10",
"@angular/router": "6.1.10",
"@trademe/ng-defer-load": "3.0.1",
"algoliasearch": "3.33.0",
"angular-instantsearch": "3.0.0-beta.2",
"instantsearch.js": "3.7.0",
"core-js": "2.6.7",
"rxjs": "6.3.3",
"zone.js": "0.9.1"
"@angular/animations": "~12.2.0",
"@angular/common": "~12.2.0",
"@angular/compiler": "~12.2.0",
"@angular/core": "~12.2.0",
"@angular/forms": "~12.2.0",
"@angular/platform-browser": "~12.2.0",
"@angular/platform-browser-dynamic": "~12.2.0",
"@angular/router": "~12.2.0",
"algoliasearch": "^4.10.5",
"angular-instantsearch": "4.0.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.13.8",
"@angular/cli": "7.3.8",
"@angular/compiler-cli": "6.1.10",
"@angular/language-service": "6.1.10",
"@types/algoliasearch": "3.30.13",
"@types/jasmine": "3.3.12",
"@types/jasminewd2": "2.0.6",
"@types/node": "8.10.47",
"codelyzer": "5.1.0",
"jasmine-core": "2.99.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "4.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "2.0.5",
"karma-jasmine": "2.0.1",
"karma-jasmine-html-reporter": "0.2.2",
"prettier": "1.17.1",
"ts-node": "8.1.0",
"tslint": "5.17.0",
"typescript": "2.8.4"
"@angular-devkit/build-angular": "~12.2.3",
"@angular/cli": "~12.2.3",
"@angular/compiler-cli": "~12.2.0",
"@types/algoliasearch": "^4.0.0",
"@types/jasmine": "~3.8.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.8.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.3.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,47 @@ <h1 class="header-title">
</header>

<div class="container">
<div class="results">
<ais-instantsearch [config]="config">
<p>The request is only triggered once the query is not empty.</p>
<div class="searchbox">
<ais-search-box></ais-search-box>
</div>
<div class="search-panel">
<div class="search-panel__results">
<ais-hits>
<ng-template let-hits="hits">
<ol class="ais-Hits-list">
<li class="ais-Hits-item" *ngFor="let hit of hits">
<ais-instantsearch [config]="config">
<div class="search-panel">
<div class="search-panel__results">
<p>The request is only triggered once the query is not empty.</p>
<div class="searchbox">
<ais-search-box></ais-search-box>
</div>

<ais-hits>
<ng-template let-hits="hits" let-results="results">
<ol class="ais-Hits-list">
<li class="ais-Hits-item" *ngFor="let hit of hits">
<article>
<h1>
<ais-highlight attribute="name" [hit]="hit"></ais-highlight>
</h1>

<p>
<ais-highlight
attribute="description"
[hit]="hit"
></ais-highlight>
</p>
</li>
</ol>
</ng-template>
</ais-hits>
</div>
<p>
<ais-highlight
attribute="brand"
[hit]="hit"
></ais-highlight>
</p>
<p>
<ais-highlight
attribute="categories"
[hit]="hit"
></ais-highlight>
</p>
</article>
</li>
</ol>
</ng-template>
</ais-hits>
</div>
</ais-instantsearch>
</div>
</div>
</ais-instantsearch>
</div>

This file was deleted.

Loading

0 comments on commit f655596

Please sign in to comment.