Skip to content

Commit

Permalink
chore(Angular InstantSearch): upgrade infinite-scroll example to Angu…
Browse files Browse the repository at this point in the history
…lar 12 (#256)

* chore(Angular InstantSearch): upgrade infinite-scroll example to Angular 12

* Apply suggestions from code review
  • Loading branch information
tkrugg authored Sep 24, 2021
1 parent f7927d2 commit f8862b8
Show file tree
Hide file tree
Showing 33 changed files with 5,596 additions and 5,377 deletions.
17 changes: 17 additions & 0 deletions Angular InstantSearch/infinite-scroll/.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/infinite-scroll/.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
110 changes: 43 additions & 67 deletions Angular InstantSearch/infinite-scroll/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
"newProjectRoot": "projects",
"projects": {
"infinite-scroll": {
"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": "infinite-scroll:build"
},
"configurations": {
"production": {
"browserTarget": "infinite-scroll:build:production"
},
"development": {
"browserTarget": "infinite-scroll:build:development"
}
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
Expand All @@ -72,55 +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/**"
]
}
}
}
},
"infinite-scroll-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "infinite-scroll:serve"
},
"configurations": {
"production": {
"devServerTarget": "infinite-scroll:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
Expand Down
28 changes: 0 additions & 28 deletions Angular InstantSearch/infinite-scroll/e2e/protractor.conf.js

This file was deleted.

14 changes: 0 additions & 14 deletions Angular InstantSearch/infinite-scroll/e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions Angular InstantSearch/infinite-scroll/e2e/src/app.po.ts

This file was deleted.

13 changes: 0 additions & 13 deletions Angular InstantSearch/infinite-scroll/e2e/tsconfig.e2e.json

This file was deleted.

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/infinite-scroll'),
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
});
};
};
72 changes: 30 additions & 42 deletions Angular InstantSearch/infinite-scroll/package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,42 @@
{
"name": "infinite-scroll",
"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",
"e2e": "ng e2e"
"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",
"core-js": "2.6.7",
"instantsearch.js": "3.7.0",
"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",
"protractor": "6.0.0",
"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"
}
}
Loading

0 comments on commit f8862b8

Please sign in to comment.