Skip to content

Commit

Permalink
chore: Support Angular v9 and v10
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen authored and mergify[bot] committed Jul 15, 2020
1 parent 25414be commit 5e5a1f9
Show file tree
Hide file tree
Showing 47 changed files with 1,508 additions and 1,666 deletions.
6 changes: 3 additions & 3 deletions downstream_projects.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"packageDir": "./dist",
"projects": {
"angular8": "./test-angular-versions/v8",
"angular9": "./test-angular-versions/v9",
"typescript3.4": "./test-typescript-versions/typescript3.4",
"typescript3.5": "./test-typescript-versions/typescript3.5",
"angular10": "./test-angular-versions/v10",
"typescript3.6": "./test-typescript-versions/typescript3.6",
"typescript3.7": "./test-typescript-versions/typescript3.7",
"typescript3.8": "./test-typescript-versions/typescript3.8",
"typescript3.9": "./test-typescript-versions/typescript3.9",
"sample-app-angular": "https://github.com/ui-router/sample-app-angular.git"
}
}
43 changes: 21 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,40 @@
"license": "MIT",
"distDir": "dist",
"peerDependencies": {
"@angular/common": "^8.0.0 || ^9.0.0 || ^9.0.0-next",
"@angular/core": "^8.0.0 || ^9.0.0 || ^9.0.0-next",
"@uirouter/core": "^6.0.1",
"@angular/common": "^9.0.0 || ^10.0.0",
"@angular/core": "^9.0.0 || ^10.0.0",
"@uirouter/core": "^6.0.5",
"@uirouter/rx": "^0.6.0"
},
"devDependencies": {
"@angular/common": "^8.2.5",
"@angular/compiler": "^8.2.14",
"@angular/compiler-cli": "^8.2.5",
"@angular/core": "^8.2.14",
"@angular/platform-browser": "^8.2.5",
"@angular/platform-browser-dynamic": "^8.2.5",
"@angular/animations": "9.1.12",
"@angular/common": "^9.1.12",
"@angular/compiler": "^9.1.12",
"@angular/compiler-cli": "9.1.12",
"@angular/core": "^9.1.12",
"@angular/platform-browser": "^9.1.12",
"@angular/platform-browser-dynamic": "^9.1.12",
"@types/jest": "^26.0.4",
"@types/jquery": "^3.3.33",
"@uirouter/core": "^6.0.1",
"@uirouter/publish-scripts": "2.3.46",
"@uirouter/core": "^6.0.5",
"@uirouter/publish-scripts": "2.4.3",
"@uirouter/rx": "^0.6.0",
"bufferutil": "4.0.1",
"canvas": "2.6.1",
"husky": "^4.2.3",
"jest": "25.x",
"jest-preset-angular": "8.2.0",
"ng-packagr": "=5.5.1",
"jest": "26.1.0",
"jest-preset-angular": "8.2.1",
"ng-packagr": "9.1.5",
"prettier": "^2.0.5",
"pretty-quick": "^2.0.1",
"rxjs": "^6.5.4",
"rxjs-compat": "^6.5.4",
"tslib": "1.13.0",
"tslint": "^6.1.0",
"typedoc": "0.16.x",
"typedoc": "0.17.8",
"typedoc-plugin-ui-router": "^3.0.1",
"typescript": "3.5.3",
"zone.js": "0.9.1"
},
"resolutions": {
"ts-jest": "25.x",
"typedoc": "0.16.x"
"typescript": "~3.8.3",
"utf-8-validate": "5.0.2",
"zone.js": "0.10.3"
},
"ngPackage": {
"lib": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# V8
# V9

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.0.0.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.4.

## Development server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,24 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"v8": {
"v9": {
"projectType": "application",
"schematics": {
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:component": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:module": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
},
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/v8",
"outputPath": "dist/v9",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"aot": true,
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
Expand All @@ -62,7 +36,6 @@
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand All @@ -71,6 +44,11 @@
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
Expand All @@ -79,18 +57,18 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "v8:build"
"browserTarget": "v9:build"
},
"configurations": {
"production": {
"browserTarget": "v8:build:production"
"browserTarget": "v9:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "v8:build"
"browserTarget": "v9:build"
}
},
"test": {
Expand All @@ -100,42 +78,32 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "v8:serve"
"devServerTarget": "v9:serve"
},
"configurations": {
"production": {
"devServerTarget": "v8:serve:production"
"devServerTarget": "v9:serve:production"
}
}
}
}
}},
"defaultProject": "v8"
}
}
},
"defaultProject": "v9"
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Angular v8 app', () => {
describe('Angular v9 app', () => {
beforeEach(() => {
window.sessionStorage.clear();
});
Expand All @@ -23,69 +23,45 @@ describe('Angular v8 app', () => {

it('renders home', () => {
cy.visit('/home');
cy.get('a')
.contains('home')
.should('have.class', 'active');
cy.get('a')
.contains('about')
.should('not.have.class', 'active');
cy.get('a').contains('home').should('have.class', 'active');
cy.get('a').contains('about').should('not.have.class', 'active');
cy.get('#default').contains('home works');
});

it('renders about', () => {
cy.visit('/home');
cy.visit('/about');
cy.get('a')
.contains('home')
.should('not.have.class', 'active');
cy.get('a')
.contains('about')
.should('have.class', 'active');
cy.get('a').contains('home').should('not.have.class', 'active');
cy.get('a').contains('about').should('have.class', 'active');
cy.get('#default').contains('about works');
});

it('loads lazy routes', () => {
cy.visit('/home');
cy.visit('/lazy');
cy.get('a')
.contains('home')
.should('not.have.class', 'active');
cy.get('a')
.contains('lazy')
.should('have.class', 'active');
cy.get('a').contains('home').should('not.have.class', 'active');
cy.get('a').contains('lazy').should('have.class', 'active');
cy.get('#default').contains('lazy works');
});

it('routes to lazy routes', () => {
cy.visit('/lazy');
cy.get('a')
.contains('home')
.should('not.have.class', 'active');
cy.get('a')
.contains('lazy')
.should('have.class', 'active');
cy.get('a').contains('home').should('not.have.class', 'active');
cy.get('a').contains('lazy').should('have.class', 'active');
cy.get('#default').contains('lazy works');
});

it('routes to lazy child routes', () => {
cy.visit('/lazy/child');
cy.get('a')
.contains('home')
.should('not.have.class', 'active');
cy.get('a')
.contains('lazy.child')
.should('have.class', 'active');
cy.get('a').contains('home').should('not.have.class', 'active');
cy.get('a').contains('lazy.child').should('have.class', 'active');
cy.get('#default').contains('lazy.child works');
});

it('targets named views', () => {
cy.visit('/lazy/child/viewtarget');
cy.get('a')
.contains('home')
.should('not.have.class', 'active');
cy.get('a')
.contains('lazy.child')
.should('have.class', 'active');
cy.get('a').contains('home').should('not.have.class', 'active');
cy.get('a').contains('lazy.child').should('have.class', 'active');
cy.get('#default').contains('lazy.child works');
cy.get('#header').contains('lazy.child.viewtarget works');
cy.get('#footer').contains('lazy.child.viewtarget works');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ module.exports = function (config) {
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/v8'),
dir: require('path').join(__dirname, './coverage/v9'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
fixWebpackSourcePaths: true,
},
reporters: ['progress', 'kjhtml'],
port: 9876,
Expand All @@ -27,6 +27,6 @@ module.exports = function (config) {
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
restartOnFileChange: true,
});
};
Loading

0 comments on commit 5e5a1f9

Please sign in to comment.