Skip to content

Commit

Permalink
feat(ng): update to v8
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Upgrade to Angular 8 and Typescript 3.5. Public API stays unchanged.
  • Loading branch information
gund authored Jul 2, 2019
2 parents 3f92785 + d85fc4b commit 4db0bfc
Show file tree
Hide file tree
Showing 10 changed files with 4,661 additions and 4,214 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode/*
.idea/*
!.vscode/settings.json
node_modules/*
dist/*
Expand Down
54 changes: 32 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"es2015": "dist/bundles/ng-dynamic-component.es2015.js",
"typings": "dist/ng-dynamic-component.d.ts",
"scripts": {
"commitmsg": "commitlint -E HUSKY_GIT_PARAMS",
"precommit": "lint-staged",
"prepush": "npm-run-all -p lint test",
"ct": "git-cz",
"build": "node scripts/build.js",
"build:release": "node scripts/release.js",
Expand Down Expand Up @@ -50,37 +47,38 @@
"node": ">=6.0.0"
},
"peerDependencies": {
"@angular/common": "^7.0.0",
"@angular/core": "^7.0.0",
"@angular/common": "^8.0.0",
"@angular/core": "^8.0.0",
"rxjs": "^6.0.0",
"tslib": "^1.9.0"
},
"devDependencies": {
"@angular/animations": "^7.1.3",
"@angular/common": "^7.1.3",
"@angular/compiler": "^7.1.3",
"@angular/compiler-cli": "^7.1.3",
"@angular/core": "^7.1.3",
"@angular/http": "^7.1.3",
"@angular/platform-browser": "^7.1.3",
"@angular/platform-browser-dynamic": "^7.1.3",
"@angular/platform-server": "^7.1.3",
"@angular/animations": "^8.0.3",
"@angular/common": "^8.0.3",
"@angular/compiler": "^8.0.3",
"@angular/compiler-cli": "^8.0.3",
"@angular/core": "^8.0.3",
"@angular/platform-browser": "^8.0.3",
"@angular/platform-browser-dynamic": "^8.0.3",
"@angular/platform-server": "^8.0.3",
"@commitlint/cli": "^7.2.1",
"@commitlint/config-conventional": "^7.1.2",
"@starptech/prettyhtml": "^0.8.12",
"@types/jest": "^23.3.10",
"@types/jasmine": "^3.3.13",
"@types/jest": "^24.0.15",
"angular2-template-loader": "^0.6.2",
"awesome-typescript-loader": "^5.0.0",
"codecov": "^3.1.0",
"codelyzer": "^4.5.0",
"codelyzer": "^5.1.0",
"commitizen": "^3.0.5",
"copy-dir": "^0.3.0",
"copyfiles": "^2.0.0",
"core-js": "^2.6.9",
"cz-conventional-changelog": "^2.1.0",
"husky": "^1.1.0",
"istanbul": "^0.4.5",
"jest": "^23.6.0",
"jest-preset-angular": "^6.0.2",
"jest": "^24.8.0",
"jest-preset-angular": "^7.0.1",
"json-loader": "^0.5.4",
"lint-staged": "^8.0.4",
"npm-run-all": "^4.1.5",
Expand All @@ -95,15 +93,15 @@
"source-map": "^0.7.2",
"source-map-loader": "^0.2.0",
"sourcemap-istanbul-instrumenter-loader": "^0.2.0",
"tsickle": "^0.34.0",
"tsickle": "^0.35.0",
"tslib": "^1.9.3",
"tslint": "^5.11.0",
"tslint-loader": "^3.5.4",
"typescript": "~3.1.3",
"typescript": "~3.4.5",
"uglify-js": "^3.3.24",
"webpack": "^4.27.1",
"webpack-dev-server": "^3.1.10",
"zone.js": "~0.8.26"
"zone.js": "^0.9.1"
},
"config": {
"commitizen": {
Expand All @@ -129,12 +127,24 @@
"git add"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-push": "npm-run-all -p lint test",
"pre-commit": "lint-staged"
}
},
"jest": {
"preset": "jest-preset-angular",
"roots": [
"<rootDir>/src"
],
"setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts",
"modulePathIgnorePatterns": [
"src/test.ts"
],
"setupFilesAfterEnv": [
"<rootDir>/src/setupJest.ts"
],
"collectCoverageFrom": [
"src/dynamic/**/*.ts",
"!src/dynamic/index.ts",
Expand Down
6 changes: 4 additions & 2 deletions src/dynamic/component-outlet-injector.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import {
import { ComponentOutletInjectorDirective } from './component-outlet-injector.directive';

@Component({
template: `<ng-container *ngComponentOutlet="comp"></ng-container>`,
template: `
<ng-container *ngComponentOutlet="comp"></ng-container>
`,
})
class TestComponent extends TestComponentBase {
@ViewChild(ComponentOutletInjectorDirective)
@ViewChild(ComponentOutletInjectorDirective, { static: false })
directive: ComponentOutletInjectorDirective;
comp: Type<any>;
}
Expand Down
26 changes: 21 additions & 5 deletions src/dynamic/dynamic-attributes.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ describe('DynamicAttributesDirective', () => {
let fixture: ComponentFixture<TestComponent>;

@Component({
template: `<ng-container [ngComponentOutlet]="comp" [ndcDynamicAttributes]="attrs"></ng-container>`,
template: `
<ng-container
[ngComponentOutlet]="comp"
[ndcDynamicAttributes]="attrs"
></ng-container>
`,
})
class TestComponent extends TestComponentBase {
comp = InjectedComponent;
Expand Down Expand Up @@ -216,7 +221,11 @@ describe('DynamicAttributesDirective', () => {
let fixture: ComponentFixture<TestComponent>;

@Component({
template: `<ng-container *ngComponentOutlet="comp; ndcDynamicAttributes: attrs"></ng-container>`,
template: `
<ng-container
*ngComponentOutlet="comp; ndcDynamicAttributes: attrs"
></ng-container>
`,
})
class TestComponent extends TestComponentBase {
comp = InjectedComponent;
Expand Down Expand Up @@ -259,10 +268,15 @@ describe('DynamicAttributesDirective', () => {

@Component({
selector: 'host-comp',
template: `<ndc-dynamic [ndcDynamicComponent]="comp" [ndcDynamicAttributes]="attrs"></ndc-dynamic>`,
template: `
<ndc-dynamic
[ndcDynamicComponent]="comp"
[ndcDynamicAttributes]="attrs"
></ndc-dynamic>
`,
})
class TestComponent {
@ViewChild(DynamicComponent)
@ViewChild(DynamicComponent, { static: false })
dynamicComp: DynamicComponent;
comp = InjectedComponent;
attrs: AttributesMap;
Expand Down Expand Up @@ -303,7 +317,9 @@ describe('DynamicAttributesDirective', () => {
let fixture: ComponentFixture<TestComponent>;

@Component({
template: `<div [ngComponentOutlet]="comp" [ndcDynamicAttributes]="attrs"></div>`,
template: `
<div [ngComponentOutlet]="comp" [ndcDynamicAttributes]="attrs"></div>
`,
})
class TestComponent extends TestComponentBase {
comp: any;
Expand Down
10 changes: 5 additions & 5 deletions src/dynamic/dynamic-directives.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ describe('Directive: DynamicDirectives', () => {

describe('with `ngComponentOutlet`', () => {
let fixture: ComponentFixture<TestComponent>;
let created = jest.fn<MockDirective>();
let created = jest.fn<MockDirective, any>();

beforeEach(() => {
created.mockReset();
Expand All @@ -385,7 +385,7 @@ describe('Directive: DynamicDirectives', () => {

describe('with `*ngComponentOutlet`', () => {
let fixture: ComponentFixture<TestComponent>;
let created = jest.fn<MockDirective>();
let created = jest.fn<MockDirective, any>();

beforeEach(() => {
created.mockReset();
Expand All @@ -408,7 +408,7 @@ describe('Directive: DynamicDirectives', () => {

describe('injector', () => {
let fixture: ComponentFixture<TestComponent>;
let created = jest.fn<any>();
let created = jest.fn<any, any>();

beforeEach(() => {
created.mockReset();
Expand Down Expand Up @@ -473,7 +473,7 @@ describe('Directive: DynamicDirectives', () => {

describe('directive inputs', () => {
let fixture: ComponentFixture<TestComponent>;
let created = jest.fn<MockDirective>();
let created = jest.fn<MockDirective, any>();
let hostComp: any;

beforeEach(() => {
Expand Down Expand Up @@ -590,7 +590,7 @@ describe('Directive: DynamicDirectives', () => {

describe('directive outputs', () => {
let fixture: ComponentFixture<TestComponent>;
let created = jest.fn<MockDirective>();
let created = jest.fn<MockDirective, any>();
let hostComp: any;

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": ["jasmine", "node"]
"types": ["jest", "node"]
},
"files": ["test.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
Expand Down
4 changes: 1 addition & 3 deletions tsconfig.es2015.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"outDir": "./dist",
"sourceMap": true,
"target": "es2015",
"typeRoots": [
"./node_modules/@types"
]
"types": []
},
"files": [
"src/index.ts"
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.es5.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"moduleResolution": "node",
"outDir": "./dist/bundles/es5",
"target": "es5",
"allowJs": true
"allowJs": true,
"types": []
},
"files": [
"dist/bundles/ng-dynamic-component.es2015.js"
Expand Down
9 changes: 4 additions & 5 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
Expand Down Expand Up @@ -89,12 +88,12 @@
"check-type"
],

"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-inputs-metadata-property": true,
"no-outputs-metadata-property": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
Expand Down
Loading

0 comments on commit 4db0bfc

Please sign in to comment.