Skip to content

Commit

Permalink
refactor(core): migrate to ng9 (#743)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulls1z3 authored Apr 27, 2020
1 parent 9d1d3e3 commit 28327e9
Show file tree
Hide file tree
Showing 81 changed files with 5,412 additions and 6,096 deletions.
92 changes: 51 additions & 41 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"root": "apps/universal",
"sourceRoot": "apps/universal/src",
"prefix": "app",
"prefix": "universal",
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
Expand All @@ -27,8 +27,7 @@
"main": "apps/universal/src/main-browser.ts",
"polyfills": "apps/universal/src/polyfills.ts",
"tsConfig": "apps/universal/tsconfig.app.json",
"aot": false,
"es5BrowserSupport": true,
"aot": true,
"assets": [
{
"glob": "**/*",
Expand All @@ -40,7 +39,8 @@
"styles": [
"apps/universal/src/styles.scss",
"./node_modules/perfect-scrollbar/css/perfect-scrollbar.css"
]
],
"scripts": []
},
"configurations": {
"hmr": {
Expand All @@ -63,7 +63,6 @@
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand Down Expand Up @@ -103,7 +102,6 @@
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
Expand Down Expand Up @@ -137,14 +135,14 @@
"options": {
"jestConfig": "apps/universal/jest.config.js",
"tsConfig": "apps/universal/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "apps/universal/src/test-setup.ts"
}
}
}
},
"shared-store": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/store",
"sourceRoot": "libs/shared/store/src",
"prefix": "fulls1z3",
Expand All @@ -161,14 +159,15 @@
"options": {
"jestConfig": "libs/shared/store/jest.config.js",
"tsConfig": "libs/shared/store/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/store/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-store-account": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/store-account",
"sourceRoot": "libs/shared/store-account/src",
"prefix": "fulls1z3",
Expand All @@ -185,14 +184,15 @@
"options": {
"jestConfig": "libs/shared/store-account/jest.config.js",
"tsConfig": "libs/shared/store-account/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/store-account/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-store-air-universal": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/store-air-universal",
"sourceRoot": "libs/shared/store-air-universal/src",
"prefix": "fulls1z3",
Expand All @@ -209,14 +209,15 @@
"options": {
"jestConfig": "libs/shared/store-air-universal/jest.config.js",
"tsConfig": "libs/shared/store-air-universal/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/store-air-universal/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-store-i18n": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/store-i18n",
"sourceRoot": "libs/shared/store-i18n/src",
"prefix": "fulls1z3",
Expand All @@ -233,14 +234,15 @@
"options": {
"jestConfig": "libs/shared/store-i18n/jest.config.js",
"tsConfig": "libs/shared/store-i18n/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/store-i18n/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-ui-base": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/ui-base",
"sourceRoot": "libs/shared/ui-base/src",
"prefix": "fulls1z3",
Expand All @@ -257,14 +259,15 @@
"options": {
"jestConfig": "libs/shared/ui-base/jest.config.js",
"tsConfig": "libs/shared/ui-base/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/ui-base/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-ui-i18n": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/ui-i18n",
"sourceRoot": "libs/shared/ui-i18n/src",
"prefix": "fulls1z3",
Expand All @@ -281,14 +284,15 @@
"options": {
"jestConfig": "libs/shared/ui-i18n/jest.config.js",
"tsConfig": "libs/shared/ui-i18n/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/ui-i18n/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-ui-material": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/ui-material",
"sourceRoot": "libs/shared/ui-material/src",
"prefix": "fulls1z3",
Expand All @@ -305,14 +309,15 @@
"options": {
"jestConfig": "libs/shared/ui-material/jest.config.js",
"tsConfig": "libs/shared/ui-material/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/ui-material/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-ui-store": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/ui-store",
"sourceRoot": "libs/shared/ui-store/src",
"prefix": "fulls1z3",
Expand All @@ -329,14 +334,15 @@
"options": {
"jestConfig": "libs/shared/ui-store/jest.config.js",
"tsConfig": "libs/shared/ui-store/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/ui-store/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-util-analytics": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/util-analytics",
"sourceRoot": "libs/shared/util-analytics/src",
"prefix": "fulls1z3",
Expand All @@ -353,14 +359,15 @@
"options": {
"jestConfig": "libs/shared/util-analytics/jest.config.js",
"tsConfig": "libs/shared/util-analytics/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/util-analytics/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-util-auth": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/util-auth",
"sourceRoot": "libs/shared/util-auth/src",
"prefix": "fulls1z3",
Expand All @@ -377,14 +384,15 @@
"options": {
"jestConfig": "libs/shared/util-auth/jest.config.js",
"tsConfig": "libs/shared/util-auth/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/util-auth/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-util-core": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/util-core",
"sourceRoot": "libs/shared/util-core/src",
"prefix": "fulls1z3",
Expand All @@ -401,14 +409,15 @@
"options": {
"jestConfig": "libs/shared/util-core/jest.config.js",
"tsConfig": "libs/shared/util-core/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/util-core/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-util-http-interceptor": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/util-http-interceptor",
"sourceRoot": "libs/shared/util-http-interceptor/src",
"prefix": "fulls1z3",
Expand All @@ -425,14 +434,15 @@
"options": {
"jestConfig": "libs/shared/util-http-interceptor/jest.config.js",
"tsConfig": "libs/shared/util-http-interceptor/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/util-http-interceptor/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-util-i18n": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/util-i18n",
"sourceRoot": "libs/shared/util-i18n/src",
"prefix": "fulls1z3",
Expand All @@ -449,14 +459,15 @@
"options": {
"jestConfig": "libs/shared/util-i18n/jest.config.js",
"tsConfig": "libs/shared/util-i18n/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/util-i18n/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-util-store": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/util-store",
"sourceRoot": "libs/shared/util-store/src",
"prefix": "fulls1z3",
Expand All @@ -473,14 +484,15 @@
"options": {
"jestConfig": "libs/shared/util-store/jest.config.js",
"tsConfig": "libs/shared/util-store/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/util-store/src/test-setup.ts"
}
}
}
},
"schematics": {}
},
"shared-util-testing": {
"projectType": "library",
"schematics": {},
"root": "libs/shared/util-testing",
"sourceRoot": "libs/shared/util-testing/src",
"prefix": "fulls1z3",
Expand All @@ -497,18 +509,16 @@
"options": {
"jestConfig": "libs/shared/util-testing/jest.config.js",
"tsConfig": "libs/shared/util-testing/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/shared/util-testing/src/test-setup.ts"
}
}
}
},
"schematics": {}
}
},
"cli": {
"warnings": {
"typescriptMismatch": false,
"versionMismatch": false
},
"defaultCollection": "@ngrx/schematics",
"defaultCollection": "@nrwl/angular",
"packageManager": "yarn"
},
"schematics": {
Expand Down
7 changes: 6 additions & 1 deletion apps/universal/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
module.exports = {
name: 'universal',
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/apps/universal/'
coverageDirectory: '../../coverage/apps/universal',
snapshotSerializers: [
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js'
]
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MaterialModule } from '@fulls1z3/shared/ui-material';
import { CoreTestingModule } from '@fulls1z3/shared/util-core/testing';
import { I18NTestingModule } from '@fulls1z3/shared/util-i18n/testing';
import { EMPTY_UNIQUE_ID } from '@fulls1z3/shared/util-store';
import { getState, StoreTestingModule } from '@fulls1z3/shared/util-store/testing';
import { getState, MockStore, StoreTestingModule } from '@fulls1z3/shared/util-store/testing';
import { Store } from '@ngrx/store';
import { cold } from 'jasmine-marbles';
import { of as observableOf } from 'rxjs';
Expand Down Expand Up @@ -68,9 +68,9 @@ describe('AirlineDetailComponent', () => {

test('should `getSelected` from AirlineSelectors on init', () => {
const fixture = TestBed.createComponent(AirlineDetailComponent);
const store$ = TestBed.get(Store);
const store$ = TestBed.inject(Store);
const state = getState<Airline>(AIRLINE, MOCK_AIRLINE);
store$.setState(state);
(store$ as MockStore<{}>).setState(state);
fixture.detectChanges();

const actual = fixture.componentInstance.airline$;
Expand All @@ -81,7 +81,7 @@ describe('AirlineDetailComponent', () => {

test('should dispatch `airUniversalAddOneAirline` action on init', () => {
const fixture = TestBed.createComponent(AirlineDetailComponent);
const store$ = TestBed.get(Store);
const store$ = TestBed.inject(Store);
const spy = spyOn(store$, 'dispatch');
fixture.detectChanges();

Expand All @@ -99,7 +99,7 @@ describe('AirlineDetailComponent for renderFlag=`Update`', () => {

test('should dispatch `airUniversalGetOneAirline` action on init', () => {
const fixture = TestBed.createComponent(AirlineDetailComponent);
const store$ = TestBed.get(Store);
const store$ = TestBed.inject(Store);
const spy = spyOn(store$, 'dispatch');
fixture.detectChanges();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource } from '@angular/material';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { Airline } from '@fulls1z3/shared/store-air-universal';
import { BaseComponent } from '@fulls1z3/shared/ui-base';
import { flow, get } from 'lodash/fp';
Expand Down
Loading

0 comments on commit 28327e9

Please sign in to comment.