Skip to content

Commit b8890b8

Browse files
committed
feat(lib): upgrade to Angular 9
BREAKING CHANGE: requires angular 9 This fixes #101, fixes #102, fixes #134
1 parent 7e07ca2 commit b8890b8

14 files changed

+3796
-1908
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dist: trusty
44

55
language: node_js
66
node_js:
7-
- '10'
7+
- '12'
88

99
# https://github.com/cypress-io/cypress/issues/4069
1010
addons:

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Install the [npm package](https://www.npmjs.com/package/ngx-sub-form): `ngx-sub-
2929
_Note about the versions:_
3030

3131
Angular <= 7: `2.7.1`
32-
Angular >= 8: Latest
32+
Angular 8.x : `4.x`
33+
Angular >= 9: Latest
3334

3435
## Demo
3536

angular.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"build": {
1818
"builder": "@angular-devkit/build-angular:browser",
1919
"options": {
20+
"aot": true,
2021
"outputPath": "dist/ngx-sub-form-demo",
2122
"index": "src/index.html",
2223
"main": "src/main.ts",
@@ -48,6 +49,10 @@
4849
"type": "initial",
4950
"maximumWarning": "2mb",
5051
"maximumError": "5mb"
52+
},
53+
{
54+
"type": "anyComponentStyle",
55+
"maximumWarning": "6kb"
5156
}
5257
]
5358
}
@@ -102,6 +107,11 @@
102107
"options": {
103108
"tsConfig": "projects/ngx-sub-form/tsconfig.lib.json",
104109
"project": "projects/ngx-sub-form/ng-package.json"
110+
},
111+
"configurations": {
112+
"production": {
113+
"tsConfig": "projects/ngx-sub-form/tsconfig.lib.prod.json"
114+
}
105115
}
106116
},
107117
"test": {

package.json

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -34,56 +34,55 @@
3434
},
3535
"private": true,
3636
"dependencies": {
37-
"@angular/animations": "8.2.14",
38-
"@angular/cdk": "8.2.3",
39-
"@angular/common": "8.2.14",
40-
"@angular/compiler": "8.2.14",
41-
"@angular/core": "8.2.14",
42-
"@angular/forms": "8.2.14",
43-
"@angular/http": "7.2.15",
44-
"@angular/material": "8.2.3",
45-
"@angular/platform-browser": "8.2.14",
46-
"@angular/platform-browser-dynamic": "8.2.14",
47-
"@angular/router": "8.2.14",
48-
"@types/uuid": "3.4.4",
49-
"commitizen": "3.1.1",
50-
"core-js": "3.1.3",
51-
"fast-deep-equal": "3.0.1",
52-
"rxjs": "6.5.2",
53-
"uuid": "3.3.2",
54-
"zone.js": "0.9.1"
37+
"@angular/animations": "9.0.1",
38+
"@angular/cdk": "9.0.0",
39+
"@angular/common": "9.0.1",
40+
"@angular/compiler": "9.0.1",
41+
"@angular/core": "9.0.1",
42+
"@angular/forms": "9.0.1",
43+
"@angular/http": "7.2.16",
44+
"@angular/material": "9.0.0",
45+
"@angular/platform-browser": "9.0.1",
46+
"@angular/platform-browser-dynamic": "9.0.1",
47+
"@angular/router": "9.0.1",
48+
"@types/uuid": "3.4.7",
49+
"commitizen": "4.0.3",
50+
"core-js": "3.6.4",
51+
"fast-deep-equal": "3.1.1",
52+
"rxjs": "6.5.4",
53+
"tslib": "1.10.0",
54+
"uuid": "3.4.0",
55+
"zone.js": "0.10.2"
5556
},
5657
"devDependencies": {
57-
"@angular-devkit/build-angular": "0.803.20",
58-
"@angular-devkit/build-ng-packagr": "0.803.20",
59-
"@angular/cli": "8.3.20",
60-
"@angular/compiler-cli": "8.2.14",
61-
"@angular/language-service": "8.2.14",
58+
"@angular-devkit/build-angular": "0.900.2",
59+
"@angular-devkit/build-ng-packagr": "0.900.2",
60+
"@angular/cli": "9.0.2",
61+
"@angular/compiler-cli": "9.0.1",
62+
"@angular/language-service": "9.0.1",
6263
"@bahmutov/add-typescript-to-cypress": "2.1.2",
63-
"@types/jasmine": "3.3.13",
64-
"@types/jasminewd2": "2.0.6",
65-
"@types/node": "12.0.7",
66-
"codelyzer": "5.1.0",
67-
"cypress": "3.2.0",
68-
"cz-conventional-changelog": "2.1.0",
69-
"embedme": "1.6.0",
64+
"@types/jasmine": "3.5.5",
65+
"@types/jasminewd2": "2.0.8",
66+
"@types/node": "13.7.2",
67+
"codelyzer": "5.2.1",
68+
"cypress": "4.0.2",
69+
"cz-conventional-changelog": "3.1.0",
70+
"embedme": "1.20.0",
7071
"http-server-spa": "1.3.0",
71-
"jasmine-core": "3.4.0",
72+
"jasmine-core": "3.5.0",
7273
"jasmine-spec-reporter": "4.2.1",
73-
"karma": "4.1.0",
74-
"karma-chrome-launcher": "2.2.0",
75-
"karma-coverage-istanbul-reporter": "2.0.5",
76-
"karma-jasmine": "2.0.1",
77-
"karma-jasmine-html-reporter": "1.4.2",
78-
"ng-packagr": "5.7.1",
74+
"karma": "4.4.1",
75+
"karma-chrome-launcher": "3.1.0",
76+
"karma-coverage-istanbul-reporter": "2.1.1",
77+
"karma-jasmine": "3.1.1",
78+
"karma-jasmine-html-reporter": "1.5.2",
79+
"ng-packagr": "9.0.1",
7980
"prettier": "1.19.1",
80-
"semantic-release": "15.13.12",
81-
"ts-node": "8.2.0",
81+
"semantic-release": "17.0.4",
82+
"ts-node": "8.6.2",
8283
"tsconfig-paths-webpack-plugin": "3.2.0",
83-
"tsickle": "0.35.0",
84-
"tslib": "1.10.0",
85-
"tslint": "5.17.0",
86-
"typescript": "3.4.5"
84+
"tslint": "6.0.0",
85+
"typescript": "3.7.5"
8786
},
8887
"repository": {
8988
"type": "git",

projects/ngx-sub-form/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"fast-deep-equal": "^3.0.1"
77
},
88
"peerDependencies": {
9-
"@angular/common": "^8.0.0",
10-
"@angular/core": "^8.0.0"
9+
"@angular/common": "^9.0.0",
10+
"@angular/core": "^9.0.0"
1111
},
1212
"keywords": [
1313
"Angular",

projects/ngx-sub-form/src/lib/ngx-automatic-root-form.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { OnInit } from '@angular/core';
1+
import { OnInit, Directive } from '@angular/core';
22
import { NgxRootFormComponent } from './ngx-root-form.component';
33

4+
@Directive()
5+
// tslint:disable-next-line: directive-class-suffix
46
export abstract class NgxAutomaticRootFormComponent<ControlInterface, FormInterface = ControlInterface>
57
extends NgxRootFormComponent<ControlInterface, FormInterface>
68
implements OnInit {

projects/ngx-sub-form/src/lib/ngx-root-form.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { EventEmitter, OnInit, Input } from '@angular/core';
1+
import { EventEmitter, OnInit, Input, Component, Directive } from '@angular/core';
22
import isEqual from 'fast-deep-equal';
33
import { BehaviorSubject, Subject } from 'rxjs';
44
import { filter, tap } from 'rxjs/operators';
55
import { NgxSubFormRemapComponent } from './ngx-sub-form.component';
66
import { takeUntilDestroyed, isNullOrUndefined } from './ngx-sub-form-utils';
77

8+
@Directive()
9+
// tslint:disable-next-line: directive-class-suffix
810
export abstract class NgxRootFormComponent<ControlInterface, FormInterface = ControlInterface>
911
extends NgxSubFormRemapComponent<ControlInterface, FormInterface>
1012
implements OnInit {

projects/ngx-sub-form/src/lib/ngx-sub-form.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OnDestroy } from '@angular/core';
1+
import { OnDestroy, Directive, Component } from '@angular/core';
22
import {
33
AbstractControl,
44
AbstractControlOptions,
@@ -31,6 +31,8 @@ type FilterControlFunction<FormInterface> = (
3131
isCtrlWithinFormArray: boolean,
3232
) => boolean;
3333

34+
@Directive()
35+
// tslint:disable-next-line: directive-class-suffix
3436
export abstract class NgxSubFormComponent<ControlInterface, FormInterface = ControlInterface>
3537
implements ControlValueAccessor, Validator, OnDestroy, OnFormUpdate<FormInterface> {
3638
public get formGroupControls(): ControlsType<FormInterface> {
@@ -420,6 +422,8 @@ export abstract class NgxSubFormComponent<ControlInterface, FormInterface = Cont
420422
}
421423
}
422424

425+
@Directive()
426+
// tslint:disable-next-line: directive-class-suffix
423427
export abstract class NgxSubFormRemapComponent<ControlInterface, FormInterface> extends NgxSubFormComponent<
424428
ControlInterface,
425429
FormInterface

projects/ngx-sub-form/tsconfig.lib.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
"lib": ["dom", "es2018"]
1616
},
1717
"angularCompilerOptions": {
18-
"annotateForClosureCompiler": true,
1918
"skipTemplateCodegen": true,
2019
"strictMetadataEmit": true,
21-
"fullTemplateTypeCheck": true,
20+
"strictTemplates": true,
2221
"strictInjectionParameters": true,
2322
"enableResourceInlining": true
2423
},
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.lib.json",
3+
"angularCompilerOptions": {
4+
"enableIvy": false
5+
}
6+
}

0 commit comments

Comments
 (0)