Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 4d81949

Browse files
authored
build: upgrade to Angular and CDK v14 (#1414)
1 parent ee5d93a commit 4d81949

File tree

46 files changed

+3274
-2709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3274
-2709
lines changed

.circleci/config.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# To validate changes, use an online parser, eg.
1010
# http://yaml-online-parser.appspot.com/
1111

12-
var_1: &docker_image circleci/node:14.16.1
12+
var_1: &docker_image cimg/node:16.14.0
1313
var_2: &cache_key v2-ng-layout-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.7.0
1414

1515
# Settings common to each job
@@ -53,7 +53,7 @@ var_8: &docker-firefox-image
5353
# TODO(devversion): Temporarily use a image that includes Firefox 62 because the
5454
# ngcontainer image does include an old Firefox version that does not support headless.
5555
# See the PR that fixes this: https://github.com/angular/angular/pull/26435
56-
- image: circleci/node:14.16.1-browsers
56+
- image: cimg/node:16.14.0-browsers
5757

5858
# Attaches the release output which has been stored in the workspace to the current job.
5959
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
@@ -64,7 +64,9 @@ var_9: &attach_release_output
6464
# -----------------------------
6565
# Container version of CircleCI
6666
# -----------------------------
67-
version: 2
67+
version: 2.1
68+
orbs:
69+
browser-tools: circleci/[email protected]
6870

6971
# -----------------------------------------------------------------------------------------
7072
# Job definitions. Jobs which are defined just here, will not run automatically. Each job
@@ -103,6 +105,7 @@ jobs:
103105
steps:
104106
- *checkout_code
105107
- *attach_release_output
108+
- browser-tools/install-browser-tools
106109
- run: ./scripts/circleci/run-local-browser-tests.sh
107110

108111
# ----------------------------------------------------------------------------
@@ -111,6 +114,7 @@ jobs:
111114
# ----------------------------------------------------------------------------
112115
tests_browserstack:
113116
<<: *job_defaults
117+
resource_class: xlarge
114118
environment:
115119
BROWSER_STACK_USERNAME: 'adamplumer1'
116120
BROWSER_STACK_ACCESS_KEY: 'WgLjxoB2zQ3tqmsznKnz'
@@ -135,6 +139,7 @@ jobs:
135139
steps:
136140
- *checkout_code
137141
- *attach_release_output
142+
- browser-tools/install-browser-tools
138143

139144
- run: ./scripts/circleci/run-saucelabs-tests.sh
140145

angular.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,5 @@
249249
}
250250
}
251251
}
252-
},
253-
"defaultProject": "@angular/flex-layout"
252+
}
254253
}

package.json

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"license": "MIT",
1212
"engines": {
13-
"node": "^12.20.0 || ^14.15.0 || >=16.10.0",
13+
"node": "^14.15.0 || >=16.10.0",
1414
"yarn": ">=1.22.4 <2",
1515
"npm": "Please use yarn instead of NPM to install dependencies"
1616
},
@@ -31,34 +31,34 @@
3131
"private": true,
3232
"requiredAngularVersion": "^13.0.0",
3333
"dependencies": {
34-
"@angular/animations": "~13.0.0",
35-
"@angular/common": "~13.0.0",
36-
"@angular/compiler": "~13.0.0",
37-
"@angular/core": "~13.0.0",
38-
"@angular/forms": "~13.0.0",
39-
"@angular/material": "^13.0.2",
40-
"@angular/platform-browser": "~13.0.0",
41-
"@angular/platform-browser-dynamic": "~13.0.0",
42-
"@angular/platform-server": "~13.0.0",
43-
"@angular/router": "~13.0.0",
44-
"@nguniversal/builders": "^13.0.1",
45-
"@nguniversal/express-engine": "^13.0.1",
34+
"@angular/animations": "~14.0.0",
35+
"@angular/common": "~14.0.0",
36+
"@angular/compiler": "~14.0.0",
37+
"@angular/core": "~14.0.0",
38+
"@angular/forms": "~14.0.0",
39+
"@angular/material": "~14.0.0",
40+
"@angular/platform-browser": "~14.0.0",
41+
"@angular/platform-browser-dynamic": "~14.0.0",
42+
"@angular/platform-server": "~14.0.0",
43+
"@angular/router": "~14.0.0",
44+
"@nguniversal/builders": "~14.0.0",
45+
"@nguniversal/express-engine": "~14.0.0",
4646
"express": "^4.17.1",
4747
"rxjs": "~7.4.0",
4848
"tslib": "^2.3.0",
4949
"zone.js": "~0.11.4"
5050
},
5151
"devDependencies": {
52-
"@angular-devkit/build-angular": "~13.0.0",
53-
"@angular/cdk": "^13.0.2",
54-
"@angular/cli": "~13.0.0",
55-
"@angular/compiler-cli": "~13.0.0",
56-
"@ngtools/webpack": "^13.0.3",
57-
"@nguniversal/builders": "^13.0.1",
52+
"@angular-devkit/build-angular": "~14.0.0",
53+
"@angular/cdk": "~14.0.0",
54+
"@angular/cli": "~14.0.0",
55+
"@angular/compiler-cli": "~14.0.0",
56+
"@ngtools/webpack": "~14.0.0",
57+
"@nguniversal/builders": "~14.0.0",
5858
"@types/express": "^4.17.0",
5959
"@types/jasmine": "~3.10.0",
6060
"@types/minimatch": "^3.0.5",
61-
"@types/node": "^12.11.1",
61+
"@types/node": "^14.18.21",
6262
"conventional-changelog-cli": "^2.1.1",
6363
"jasmine-core": "~3.10.0",
6464
"karma": "~6.3.0",
@@ -71,15 +71,19 @@
7171
"karma-parallel": "^0.3.1",
7272
"karma-sauce-launcher": "^2.0.2",
7373
"minimatch": "^3.0.4",
74-
"ng-packagr": "^13.0.0",
74+
"ng-packagr": "~14.0.0",
7575
"postcss": "^8.3.3",
7676
"postcss-scss": "^4.0.2",
7777
"protractor": "^7.0.0",
7878
"stylelint": "^14.1.0",
7979
"ts-node": "^10.4.0",
8080
"tslint": "^6.1.3",
81-
"typescript": "~4.4.3",
81+
"typescript": "~4.7.3",
8282
"webpack": "^5.64.1",
8383
"webpack-cli": "^4.9.1"
84+
},
85+
"resolutions": {
86+
"browser-sync-client": "2.26.13",
87+
"**/https-proxy-agent": "5.0.0"
8488
}
8589
}

projects/apps/demo-app/src/app/stack-overflow/hide-custom-bp/hide-with-custom-bp.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const selector = `[fxHide], [fxHide.yba]`;
1919

2020
@Directive({selector, inputs})
2121
export class CustomHideDirective extends ShowHideDirective {
22-
protected inputs = inputs;
22+
protected override inputs = inputs;
2323
}
2424

2525
@Component({

projects/libs/flex-layout/_private-utils/testing/custom-matchers.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,9 @@ export const customMatchers: jasmine.CustomMatcherFactories = {
8181
toEqual: function (util) {
8282
return {
8383
compare: function (actual: any, expected: any) {
84-
return {pass: util.equals(actual, expected, [compareMap])};
84+
return {pass: util.equals(actual, expected)};
8585
}
8686
};
87-
88-
function compareMap(actual: any, expected: any) {
89-
if (actual instanceof Map) {
90-
let pass = actual.size === expected.size;
91-
if (pass) {
92-
actual.forEach((v: any, k: any) => {
93-
pass = pass && util.equals(v, expected.get(k));
94-
});
95-
}
96-
return pass;
97-
} else {
98-
return undefined;
99-
}
100-
}
10187
},
10288

10389
toHaveText: function () {

projects/libs/flex-layout/core/match-media/mock/mock-match-media.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class MockMatchMedia extends MatchMedia {
150150
* Call window.matchMedia() to build a MediaQueryList; which
151151
* supports 0..n listeners for activation/deactivation
152152
*/
153-
protected buildMQL(query: string): MediaQueryList {
153+
protected override buildMQL(query: string): MediaQueryList {
154154
return new MockMediaQueryList(query);
155155
}
156156

projects/libs/flex-layout/extended/class/class.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {BaseDirective2, StyleUtils, MediaMarshaller} from '@angular/flex-layout/
2222
@Directive()
2323
export class ClassDirective extends BaseDirective2 implements DoCheck {
2424

25-
protected DIRECTIVE_KEY = 'ngClass';
25+
protected override DIRECTIVE_KEY = 'ngClass';
2626

2727
/**
2828
* Capture class assignments so we cache the default classes
@@ -51,7 +51,7 @@ export class ClassDirective extends BaseDirective2 implements DoCheck {
5151
this.setValue('', '');
5252
}
5353

54-
protected updateWithValue(value: any) {
54+
protected override updateWithValue(value: any) {
5555
this.ngClassInstance.ngClass = value;
5656
this.ngClassInstance.ngDoCheck();
5757
}
@@ -87,5 +87,5 @@ const selector = `
8787
*/
8888
@Directive({selector, inputs})
8989
export class DefaultClassDirective extends ClassDirective {
90-
protected inputs = inputs;
90+
protected override inputs = inputs;
9191
}

projects/libs/flex-layout/extended/img-src/img-src.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ImgSrcStyleBuilder extends StyleBuilder {
2525

2626
@Directive()
2727
export class ImgSrcDirective extends BaseDirective2 {
28-
protected DIRECTIVE_KEY = 'img-src';
28+
protected override DIRECTIVE_KEY = 'img-src';
2929
protected defaultSrc = '';
3030

3131
@Input('src')
@@ -56,7 +56,7 @@ export class ImgSrcDirective extends BaseDirective2 {
5656
* Do nothing to standard `<img src="">` usages, only when responsive
5757
* keys are present do we actually call `setAttribute()`
5858
*/
59-
protected updateWithValue(value?: string) {
59+
protected override updateWithValue(value?: string) {
6060
const url = value || this.defaultSrc;
6161
if (isPlatformServer(this.platformId) && this.serverModuleLoaded) {
6262
this.addStyles(url);
@@ -65,7 +65,7 @@ export class ImgSrcDirective extends BaseDirective2 {
6565
}
6666
}
6767

68-
protected styleCache = imgSrcCache;
68+
protected override styleCache = imgSrcCache;
6969
}
7070

7171
const imgSrcCache: Map<string, StyleDefinition> = new Map();
@@ -93,5 +93,5 @@ const selector = `
9393
*/
9494
@Directive({selector, inputs})
9595
export class DefaultImgSrcDirective extends ImgSrcDirective {
96-
protected inputs = inputs;
96+
protected override inputs = inputs;
9797
}

projects/libs/flex-layout/extended/show-hide/show-hide.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class ShowHideStyleBuilder extends StyleBuilder {
4343

4444
@Directive()
4545
export class ShowHideDirective extends BaseDirective2 implements AfterViewInit, OnChanges {
46-
protected DIRECTIVE_KEY = 'show-hide';
46+
protected override DIRECTIVE_KEY = 'show-hide';
4747

4848
/** Original DOM Element CSS display style */
4949
protected display: string = '';
@@ -97,7 +97,7 @@ export class ShowHideDirective extends BaseDirective2 implements AfterViewInit,
9797
* Default to use the non-responsive Input value ('fxShow')
9898
* Then conditionally override with the mq-activated Input's current value
9999
*/
100-
ngOnChanges(changes: SimpleChanges) {
100+
override ngOnChanges(changes: SimpleChanges) {
101101
Object.keys(changes).forEach(key => {
102102
if (this.inputs.indexOf(key) !== -1) {
103103
const inputKey = key.split('.');
@@ -143,7 +143,7 @@ export class ShowHideDirective extends BaseDirective2 implements AfterViewInit,
143143
}
144144

145145
/** Validate the visibility value and then update the host's inline display style */
146-
protected updateWithValue(value: boolean | string = true) {
146+
protected override updateWithValue(value: boolean | string = true) {
147147
if (value === '') {
148148
return;
149149
}
@@ -185,5 +185,5 @@ const selector = `
185185
*/
186186
@Directive({selector, inputs})
187187
export class DefaultShowHideDirective extends ShowHideDirective {
188-
protected inputs = inputs;
188+
protected override inputs = inputs;
189189
}

projects/libs/flex-layout/extended/show-hide/show.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ const selector = `[fxShow.sm-md], [fxHide.sm-md], [fxShow.sm.lg], [fxHide.sm.lg]
386386
// Used to test custom breakpoint functionality
387387
@Directive({inputs, selector})
388388
class FxShowHideDirective extends ShowHideDirective {
389-
protected inputs = inputs;
389+
protected override inputs = inputs;
390390
}
391391

392392

0 commit comments

Comments
 (0)