misc/ upgrade to Angular 11

This commit is contained in:
Maxime GRIS
2020-11-14 21:10:45 +01:00
parent e0fb53998c
commit d265dfa80b
13 changed files with 86 additions and 97 deletions

View File

@@ -42,13 +42,14 @@
} }
], ],
"@typescript-eslint/no-empty-function": 0, "@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-unsafe-call": 0, "@typescript-eslint/no-unsafe-call": 0,
"@typescript-eslint/no-unsafe-member-access": 0, "@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/no-unsafe-assignment": 0, "@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-return": 0, "@typescript-eslint/no-unsafe-return": 0,
"@typescript-eslint/no-floating-promises": 0, "@typescript-eslint/no-floating-promises": 0,
"@typescript-eslint/semi": "error",
"@angular-eslint/use-injectable-provided-in": "error", "@angular-eslint/use-injectable-provided-in": "error",
"@angular-eslint/no-attribute-decorator": "error" "@angular-eslint/no-attribute-decorator": "error"
} }

View File

@@ -15,9 +15,9 @@ Bootstrap and package your project with Angular 10 and Electron 9 (Typescript +
Currently runs with: Currently runs with:
- Angular v10.0.14 - Angular v11.0.0
- Electron v9.3.0 - Electron v10.1.5
- Electron Builder v22.8.0 - Electron Builder v22.9.1
With this sample, you can : With this sample, you can :
@@ -27,7 +27,7 @@ With this sample, you can :
/!\ Hot reload only pertains to the renderer process. The main electron process is not able to be hot reloaded, only restarted. /!\ Hot reload only pertains to the renderer process. The main electron process is not able to be hot reloaded, only restarted.
/!\ Angular 10.x CLI needs Node 10.13 or later to work correctly. /!\ Angular 11.x CLI needs Node 10.13 or later to work correctly.
## Getting Started ## Getting Started
@@ -106,7 +106,8 @@ Note: To make it work behind a proxy, you can add this proxy exception in your t
- Angular 7 & Electron 3 : Branch [angular7](https://github.com/maximegris/angular-electron/tree/angular7) - Angular 7 & Electron 3 : Branch [angular7](https://github.com/maximegris/angular-electron/tree/angular7)
- Angular 8 & Electron 7 : Branch [angular8](https://github.com/maximegris/angular-electron/tree/angular8) - Angular 8 & Electron 7 : Branch [angular8](https://github.com/maximegris/angular-electron/tree/angular8)
- Angular 9 & Electron 7 : Branch [angular9](https://github.com/maximegris/angular-electron/tree/angular9) - Angular 9 & Electron 7 : Branch [angular9](https://github.com/maximegris/angular-electron/tree/angular9)
- Angular 10 & Electron 9 : (master) - Angular 10 & Electron 9 : Branch [angular10](https://github.com/maximegris/angular-electron/tree/angular9)
- Angular 11 & Electron 10 : (master)
[build-badge]: https://travis-ci.org/maximegris/angular-electron.svg?branch=master&style=style=flat-square [build-badge]: https://travis-ci.org/maximegris/angular-electron.svg?branch=master&style=style=flat-square
[build]: https://travis-ci.org/maximegris/angular-electron [build]: https://travis-ci.org/maximegris/angular-electron

View File

@@ -1,5 +1,5 @@
{ {
"extends": "../tsconfig.base.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/e2e", "outDir": "../out-tsc/e2e",
"module": "commonjs", "module": "commonjs",

View File

@@ -1,7 +1,7 @@
{ {
"name": "angular-electron", "name": "angular-electron",
"version": "8.0.6", "version": "9.0.0",
"description": "Angular 10 with Electron (Typescript + SASS + Hot Reload)", "description": "Angular 11 with Electron (Typescript + SASS + Hot Reload)",
"homepage": "https://github.com/maximegris/angular-electron", "homepage": "https://github.com/maximegris/angular-electron",
"author": { "author": {
"name": "Maxime GRIS", "name": "Maxime GRIS",
@@ -9,7 +9,7 @@
}, },
"keywords": [ "keywords": [
"angular", "angular",
"angular 10", "angular 11",
"electron", "electron",
"nodejs", "nodejs",
"typescript", "typescript",
@@ -40,55 +40,59 @@
"version": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md", "version": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"lint": "ng lint" "lint": "ng lint"
}, },
"dependencies": {},
"devDependencies": { "devDependencies": {
"@angular-builders/custom-webpack": "10.0.1", "@angular-builders/custom-webpack": "10.0.1",
"@angular-devkit/build-angular": "0.1001.3", "@angular-devkit/build-angular": "0.1100.1",
"@angular-eslint/builder": "0.4.0-beta.2", "@angular-eslint/builder": "0.8.0-beta.0",
"@angular-eslint/eslint-plugin": "0.4.0-beta.2", "@angular-eslint/eslint-plugin": "0.8.0-beta.0",
"@angular-eslint/eslint-plugin-template": "0.4.0-beta.2", "@angular-eslint/eslint-plugin-template": "0.8.0-beta.0",
"@angular-eslint/template-parser": "0.4.0-beta.2", "@angular-eslint/schematics": "0.8.0-beta.0",
"@angular/cli": "10.1.3", "@angular-eslint/template-parser": "0.8.0-beta.0",
"@angular/common": "10.1.3", "@angular/cli": "11.0.1",
"@angular/compiler": "10.1.3", "@angular/common": "11.0.0",
"@angular/compiler-cli": "10.1.3", "@angular/compiler": "11.0.0",
"@angular/core": "10.1.3", "@angular/compiler-cli": "11.0.0",
"@angular/forms": "10.1.3", "@angular/core": "11.0.0",
"@angular/language-service": "10.1.3", "@angular/forms": "11.0.0",
"@angular/platform-browser": "10.1.3", "@angular/language-service": "11.0.0",
"@angular/platform-browser-dynamic": "10.1.3", "@angular/platform-browser": "11.0.0",
"@angular/router": "10.1.3", "@angular/platform-browser-dynamic": "11.0.0",
"@angular/router": "11.0.0",
"@ngx-translate/core": "13.0.0", "@ngx-translate/core": "13.0.0",
"@ngx-translate/http-loader": "6.0.0", "@ngx-translate/http-loader": "6.0.0",
"@types/jasmine": "3.5.14", "@types/jasmine": "3.6.0",
"@types/jasminewd2": "2.0.8", "@types/jasminewd2": "2.0.8",
"@types/mocha": "8.0.3", "@types/mocha": "8.0.3",
"@types/node": "12.12.6", "@types/node": "12.12.6",
"@typescript-eslint/eslint-plugin": "4.2.0", "@typescript-eslint/eslint-plugin": "4.3.0",
"@typescript-eslint/eslint-plugin-tslint": "4.2.0", "@typescript-eslint/eslint-plugin-tslint": "3.10.1",
"@typescript-eslint/parser": "4.2.0", "@typescript-eslint/parser": "4.3.0",
"chai": "4.2.0", "chai": "4.2.0",
"conventional-changelog-cli": "2.1.0", "conventional-changelog-cli": "2.1.0",
"core-js": "3.6.5", "core-js": "3.6.5",
"cross-env": "7.0.2", "cross-env": "7.0.2",
"electron": "10.1.2", "electron": "10.1.5",
"electron-builder": "22.8.1", "electron-builder": "22.9.1",
"electron-reload": "1.5.0", "electron-reload": "1.5.0",
"eslint": "7.10.0", "eslint": "7.13.0",
"eslint-plugin-import": "2.22.1", "eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "3.6.0", "jasmine-core": "3.6.0",
"jasmine-spec-reporter": "6.0.0", "jasmine-spec-reporter": "6.0.0",
"karma": "5.2.3", "karma": "5.2.3",
"karma-coverage-istanbul-reporter": "3.0.3", "karma-coverage-istanbul-reporter": "3.0.3",
"karma-electron": "6.3.1", "karma-electron": "6.3.1",
"karma-jasmine": "4.0.1", "karma-jasmine": "4.0.0",
"karma-jasmine-html-reporter": "1.5.4", "karma-jasmine-html-reporter": "1.5.0",
"mocha": "8.1.3", "mocha": "8.1.3",
"npm-run-all": "4.1.5", "npm-run-all": "4.1.5",
"rxjs": "6.6.3", "rxjs": "6.6.3",
"spectron": "12.0.0", "spectron": "12.0.0",
"ts-node": "9.0.0", "ts-node": "9.0.0",
"tslib": "2.0.1", "tslib": "2.0.3",
"typescript": "3.9.7", "typescript": "4.0.5",
"wait-on": "5.0.1", "wait-on": "5.0.1",
"webdriver-manager": "12.1.7", "webdriver-manager": "12.1.7",
"zone.js": "0.10.3" "zone.js": "0.10.3"

View File

@@ -19,7 +19,7 @@ const routes: Routes = [
@NgModule({ @NgModule({
imports: [ imports: [
RouterModule.forRoot(routes), RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }),
HomeRoutingModule, HomeRoutingModule,
DetailRoutingModule DetailRoutingModule
], ],

View File

@@ -1,11 +1,11 @@
import { TestBed, async } from '@angular/core/testing'; import { TestBed, waitForAsync } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { ElectronService } from './core/services'; import { ElectronService } from './core/services';
describe('AppComponent', () => { describe('AppComponent', () => {
beforeEach(async(() => { beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [AppComponent], declarations: [AppComponent],
providers: [ElectronService], providers: [ElectronService],
@@ -13,7 +13,7 @@ describe('AppComponent', () => {
}).compileComponents(); }).compileComponents();
})); }));
it('should create the app', async(() => { it('should create the app', waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance; const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy(); expect(app).toBeTruthy();

View File

@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DetailComponent } from './detail.component'; import { DetailComponent } from './detail.component';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
@@ -9,7 +9,7 @@ describe('DetailComponent', () => {
let component: DetailComponent; let component: DetailComponent;
let fixture: ComponentFixture<DetailComponent>; let fixture: ComponentFixture<DetailComponent>;
beforeEach(async(() => { beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [DetailComponent], declarations: [DetailComponent],
imports: [TranslateModule.forRoot(), RouterTestingModule] imports: [TranslateModule.forRoot(), RouterTestingModule]
@@ -26,7 +26,7 @@ describe('DetailComponent', () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
it('should render title in a h1 tag', async(() => { it('should render title in a h1 tag', waitForAsync(() => {
const compiled = fixture.debugElement.nativeElement; const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain( expect(compiled.querySelector('h1').textContent).toContain(
'PAGES.DETAIL.TITLE' 'PAGES.DETAIL.TITLE'

View File

@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { HomeComponent } from './home.component'; import { HomeComponent } from './home.component';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
@@ -8,7 +8,7 @@ describe('HomeComponent', () => {
let component: HomeComponent; let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>; let fixture: ComponentFixture<HomeComponent>;
beforeEach(async(() => { beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [HomeComponent], declarations: [HomeComponent],
imports: [TranslateModule.forRoot(), RouterTestingModule] imports: [TranslateModule.forRoot(), RouterTestingModule]
@@ -25,7 +25,7 @@ describe('HomeComponent', () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
it('should render title in a h1 tag', async(() => { it('should render title in a h1 tag', waitForAsync(() => {
const compiled = fixture.debugElement.nativeElement; const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain( expect(compiled.querySelector('h1').textContent).toContain(
'PAGES.HOME.TITLE' 'PAGES.HOME.TITLE'

View File

@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { PageNotFoundComponent } from './page-not-found.component'; import { PageNotFoundComponent } from './page-not-found.component';
@@ -6,7 +6,7 @@ describe('PageNotFoundComponent', () => {
let component: PageNotFoundComponent; let component: PageNotFoundComponent;
let fixture: ComponentFixture<PageNotFoundComponent>; let fixture: ComponentFixture<PageNotFoundComponent>;
beforeEach(async(() => { beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [PageNotFoundComponent] declarations: [PageNotFoundComponent]
}) })

View File

@@ -1,5 +1,5 @@
{ {
"extends": "../tsconfig.base.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/app", "outDir": "../out-tsc/app",
"module": "es2015", "module": "es2015",

View File

@@ -1,5 +1,5 @@
{ {
"extends": "../tsconfig.base.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/spec", "outDir": "../out-tsc/spec",
"module": "commonjs", "module": "commonjs",

View File

@@ -1,32 +0,0 @@
{
"compileOnSave": false,
"compilerOptions": {
"module": "es2020",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"es2016",
"es2015",
"dom"
]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
],
"exclude": [
"node_modules"
]
}

View File

@@ -1,17 +1,32 @@
/*
This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScripts language server to improve development experience.
It is not intended to be used to perform a compilation.
To learn more about this file see: https://angular.io/config/solution-tsconfig.
*/
{ {
"files": [], "compileOnSave": false,
"references": [ "compilerOptions": {
{ "module": "es2020",
"path": "./src/tsconfig.app.json" "outDir": "./dist/out-tsc",
}, "sourceMap": true,
{ "declaration": false,
"path": "./src/tsconfig.spec.json" "moduleResolution": "node",
} "emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"es2016",
"es2015",
"dom"
]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
],
"exclude": [
"node_modules"
] ]
} }