Skip to content

Commit

Permalink
Merge pull request #156 from /issues/148
Browse files Browse the repository at this point in the history
feat: angular 10 support
  • Loading branch information
satanTime authored Jul 5, 2020
2 parents 466d5ca + 83debd2 commit bba57d3
Show file tree
Hide file tree
Showing 430 changed files with 178,466 additions and 372 deletions.
22 changes: 16 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
/coverage
/dist
/node_modules
/e2e/angular5/node_modules
/e2e/angular6/node_modules
/e2e/angular7/node_modules
/e2e/angular8/node_modules
/e2e/angular9-ivy-false/node_modules
/e2e/angular9-ivy-true/node_modules
/e2e/a5es5/node_modules
/e2e/a5es2015/node_modules
/e2e/a6es5/node_modules
/e2e/a6es2015/node_modules
/e2e/a7es5/node_modules
/e2e/a7es2015/node_modules
/e2e/a8es5/node_modules
/e2e/a8es2015/node_modules
/e2e/a9es5ivy/node_modules
/e2e/a9es5noivy/node_modules
/e2e/a9es2015ivy/node_modules
/e2e/a9es2015noivy/node_modules
/e2e/a10es5ivy/node_modules
/e2e/a10es5noivy/node_modules
/e2e/a10es2015ivy/node_modules
/e2e/a10es2015noivy/node_modules
19 changes: 9 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ git:
autocrlf: false
install:
- npm install
script:
- npm run test:angular-versions
jobs:
include:
- name: 'Unit Tests'
script:
- npm run test:angular-versions
- name: 'E2E'
script:
- npm run e2e
cache:
npm: false
npm: true
directories:
- $HOME/.npm
- $HOME/.node-gyp
- node_modules
- e2e/angular5/node_modules
- e2e/angular6/node_modules
- e2e/angular7/node_modules
- e2e/angular8/node_modules
- e2e/angular9-ivy-false/node_modules
- e2e/angular9-ivy-true/node_modules
22 changes: 16 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ CMD ["sh", "build-with-supported-angluars.sh"]

VOLUME /npm
VOLUME /app/node_modules
VOLUME /app/e2e/angular5/node_modules
VOLUME /app/e2e/angular6/node_modules
VOLUME /app/e2e/angular7/node_modules
VOLUME /app/e2e/angular8/node_modules
VOLUME /app/e2e/angular9-ivy-false/node_modules
VOLUME /app/e2e/angular9-ivy-true/node_modules
VOLUME /app/e2e/a5es5/node_modules
VOLUME /app/e2e/a5es2015/node_modules
VOLUME /app/e2e/a6es5/node_modules
VOLUME /app/e2e/a6es2015/node_modules
VOLUME /app/e2e/a7es5/node_modules
VOLUME /app/e2e/a7es2015/node_modules
VOLUME /app/e2e/a8es5/node_modules
VOLUME /app/e2e/a8es2015/node_modules
VOLUME /app/e2e/a9es5ivy/node_modules
VOLUME /app/e2e/a9es5noivy/node_modules
VOLUME /app/e2e/a9es2015ivy/node_modules
VOLUME /app/e2e/a9es2015noivy/node_modules
VOLUME /app/e2e/a10es5ivy/node_modules
VOLUME /app/e2e/a10es5noivy/node_modules
VOLUME /app/e2e/a10es2015ivy/node_modules
VOLUME /app/e2e/a10es2015noivy/node_modules

RUN npm config set cache /npm --global

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Helper function for creating angular mocks for test.

Tested on:

- Angular 5 (Jasmine, Jest)
- Angular 6 (Jasmine, Jest)
- Angular 7 (Jasmine, Jest)
- Angular 8 (Jasmine, Jest)
- Angular 9 (Jasmine, Jest, Ivy)
- Angular 5 (Jasmine, Jest, es5, es2015)
- Angular 6 (Jasmine, Jest, es5, es2015)
- Angular 7 (Jasmine, Jest, es5, es2015)
- Angular 8 (Jasmine, Jest, es5, es2015)
- Angular 9 (Jasmine, Jest, Ivy, es5, es2015)
- Angular 10 (Jasmine, Jest, Ivy, es2015), es5 isn't supported, use `target: es2015` in `tsconfig.spec.json`

## Why use this?

Expand Down
14 changes: 7 additions & 7 deletions build-with-supported-angluars.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
set -e
VERSIONS="5 6 7 8 9"
VERSIONS="5 6 7 8 9 10"
PACKAGES="animations common compiler core forms platform-browser platform-browser-dynamic router"

for version in $VERSIONS
Expand All @@ -14,11 +14,12 @@ do
NEW="$NEW @angular/$package@$version"
done

echo $version | grep -Eq "^5" && NEW="$NEW rxjs@5.5.5 zone.js@0.8.14 typescript@2.4"
echo $version | grep -Eq "^6" && NEW="$NEW rxjs@6.0.0 zone.js@0.8.26 typescript@2.7"
echo $version | grep -Eq "^7" && NEW="$NEW rxjs@6.0.0 zone.js@0.8.26 typescript@3.1"
echo $version | grep -Eq "^8" && NEW="$NEW rxjs@6.4.0 zone.js@0.9.1 typescript@3.4.3"
echo $version | grep -Eq "^9" && NEW="$NEW rxjs@6.5.3 zone.js@0.10.2 typescript@3.6.4"
echo $version | grep -Eq "^5$" && NEW="$NEW rxjs@5.5.5 zone.js@0.8.14 typescript@2.4"
echo $version | grep -Eq "^6$" && NEW="$NEW rxjs@6.0.0 zone.js@0.8.26 typescript@2.7"
echo $version | grep -Eq "^7$" && NEW="$NEW rxjs@6.0.0 zone.js@0.8.26 typescript@3.1"
echo $version | grep -Eq "^8$" && NEW="$NEW rxjs@6.4.0 zone.js@0.9.1 typescript@3.4.3"
echo $version | grep -Eq "^9$" && NEW="$NEW rxjs@6.5.3 zone.js@0.10.2 typescript@3.6.4"
echo $version | grep -Eq "^10$" && NEW="$NEW rxjs@6.5.5 zone.js@0.10.3 typescript@3.9.5"

echo $NEW

Expand All @@ -27,5 +28,4 @@ do
npm run build:all
done
npm install --silent --quiet --no-progress
npm run e2e
echo Testing complete
17 changes: 17 additions & 0 deletions e2e/a10es2015ivy/.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 version
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.
File renamed without changes.
File renamed without changes.
101 changes: 101 additions & 0 deletions e2e/a10es2015ivy/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"a10es2015ivy": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/a10es2015ivy",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "a10es2015ivy:build"
},
"configurations": {
"production": {
"browserTarget": "a10es2015ivy:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "a10es2015ivy:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
}
}
}
}
},
"defaultProject": "a10es2015ivy"
}
40 changes: 40 additions & 0 deletions e2e/a10es2015ivy/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-chrome-launcher'),
require('karma-coverage-istanbul-reporter'),
require('karma-ie-launcher'),
require('karma-jasmine'),
require('karma-jasmine-html-reporter'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/app'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
},
customLaunchers: {
ChromeCi: {
base: 'ChromeHeadless',
flags: ['--headless', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage'],
},
},
reporters: ['kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['ChromeCi'],
singleRun: true,
});
};
Loading

0 comments on commit bba57d3

Please sign in to comment.