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

Commit c760db3

Browse files
committed
chore: update to Angular v5.2 and update peer dep requirements
* Update to Angular v5.2 and TypeScript v2.6 * Update build config to conform with angular/components#9355 * Update travis to node 8 and npm latest * Bring package build patterns in line with angular/material2 * Enable strictNullChecks and refactor as necessary
1 parent 703add0 commit c760db3

Some content is hidden

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

62 files changed

+4974
-4146
lines changed

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sudo: false
33
dist: trusty
44

55
node_js:
6-
- '--lts'
6+
- '8'
77

88
addons:
99
jwt:
@@ -21,11 +21,13 @@ jobs:
2121
- env: "MODE=lint"
2222
- env: "MODE=aot"
2323
- env: "MODE=prerender"
24+
# Closure Compiler CI check is temporarily disabled until a new version of
25+
# the tool is released with https://github.com/google/closure-compiler/pull/2600
26+
# - env: "MODE=closure-compiler"
2427
- env: "MODE=saucelabs_required"
2528
- env: "MODE=browserstack_required"
2629
- env: "MODE=travis_required"
27-
- stage: Deploy
28-
env: "DEPLOY_MODE=build-artifacts"
30+
- env: "DEPLOY_MODE=build-artifacts"
2931
env:
3032
global:
3133
- LOGS_DIR=/tmp/flex-layout-build/logs
@@ -38,7 +40,6 @@ env:
3840

3941
before_install:
4042
- source ./scripts/ci/env.sh
41-
- npm i -g npm@^5.3
4243

4344
install:
4445
- npm install
@@ -51,4 +52,4 @@ script:
5152

5253
cache:
5354
directories:
54-
- $HOME/.npm
55+
- ./node_modules/

build-config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ const package = require('./package.json');
99
/** Current version of the project*/
1010
const buildVersion = package.version;
1111

12-
/** Required Angular version for the project. */
13-
const angularVersion = package.dependencies['@angular/core'];
12+
/**
13+
* Required Angular version for all Angular Layout packages. This version will be used
14+
* as the peer dependency version for Angular in all release packages.
15+
*/
16+
const angularVersion = '^5.0.0';
1417

1518
/** License that will be placed inside of all created bundles. */
1619
const buildLicense = `/**

package-lock.json

Lines changed: 4461 additions & 3677 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"node": ">= 5.4.1"
2727
},
2828
"dependencies": {
29-
"@angular/core": "~5.1.0",
30-
"@angular/common": "~5.1.0",
31-
"@angular/compiler": "~5.1.0",
32-
"@angular/platform-browser": "~5.1.0",
29+
"@angular/core": "~5.2.0",
30+
"@angular/common": "~5.2.0",
31+
"@angular/compiler": "~5.2.0",
32+
"@angular/platform-browser": "~5.2.0",
3333
"core-js": "^2.4.1",
3434
"rxjs": "^5.5.5",
3535
"systemjs": "0.19.43",
@@ -38,15 +38,15 @@
3838
"zone.js": "^0.8.18"
3939
},
4040
"devDependencies": {
41-
"@angular/animations": "~5.1.0",
41+
"@angular/animations": "~5.2.0",
4242
"@angular/cdk": "^5.0.1",
43-
"@angular/compiler-cli": "~5.1.0",
44-
"@angular/forms": "~5.1.0",
45-
"@angular/http": "~5.1.0",
43+
"@angular/compiler-cli": "~5.2.0",
44+
"@angular/forms": "~5.2.0",
45+
"@angular/http": "~5.2.0",
4646
"@angular/material": "^5.0.1",
47-
"@angular/platform-browser-dynamic": "~5.1.0",
48-
"@angular/platform-server": "~5.1.0",
49-
"@angular/router": "~5.1.0",
47+
"@angular/platform-browser-dynamic": "~5.2.0",
48+
"@angular/platform-server": "~5.2.0",
49+
"@angular/router": "~5.2.0",
5050
"@angular/tsc-wrapped": "^4.4.6",
5151
"@google-cloud/storage": "^1.4.0",
5252
"@types/chalk": "^0.4.31",
@@ -122,7 +122,7 @@
122122
"tsconfig-paths": "^2.3.0",
123123
"tslint": "^5.8.0",
124124
"tsutils": "^2.13.0",
125-
"typescript": "^2.4.2",
125+
"typescript": "^2.6.2",
126126
"uglify-js": "^2.8.14"
127127
}
128-
}
128+
}

scripts/ci/travis-testing.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ else
2525
fi
2626

2727
# Check if tests can be skipped
28-
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]] && (is_e2e || is_unit); then
29-
echo "Skipping e2e and unit tests since only markdown files changed"
28+
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]]; then
29+
echo "Skipping tests since only markdown files changed."
3030
exit 0
3131
fi
3232

@@ -41,9 +41,8 @@ elif is_unit; then
4141
$(npm bin)/gulp ci:test
4242
elif is_prerender; then
4343
$(npm bin)/gulp ci:prerender
44-
# Temporarily disabled due to Material Beta.11 package restructures
45-
#elif is_closure_compiler; then
46-
# ./scripts/closure-compiler/build-devapp-bundle.sh
44+
elif is_closure_compiler; then
45+
./scripts/closure-compiler/build-devapp-bundle.sh
4746
fi
4847

4948
teardown_tunnel

scripts/closure-compiler/build-devapp-bundle.sh

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ $(npm bin)/tsc -p src/demo-app/tsconfig-build.json --target ES2015 --module ES20
1919
# Create a list of all RxJS source files.
2020
rxjsSourceFiles=$(find node_modules/rxjs/ -name '*.js');
2121

22-
# List of entry points in the CDK package. Exclude "testing" since it's not an entry point.
23-
cdkEntryPoints=($(find node_modules/@angular/cdk -maxdepth 1 -mindepth 1 -type d -not -name testing -not -name typings -not -name esm5 -not -name esm2015 -not -name bundles -not -name cdk -exec basename {} \;))
24-
2522
OPTS=(
2623
"--language_in=ES6_STRICT"
2724
"--language_out=ES5"
@@ -39,9 +36,9 @@ OPTS=(
3936
"--js_module_root=dist/releases/flex-layout"
4037
"--js_module_root=node_modules/@angular/core"
4138
"--js_module_root=node_modules/@angular/common"
39+
"--js_module_root=node_modules/@angular/common/http"
4240
"--js_module_root=node_modules/@angular/compiler"
4341
"--js_module_root=node_modules/@angular/forms"
44-
"--js_module_root=node_modules/@angular/http"
4542
"--js_module_root=node_modules/@angular/router"
4643
"--js_module_root=node_modules/@angular/platform-browser"
4744
"--js_module_root=node_modules/@angular/platform-browser/animations"
@@ -55,23 +52,24 @@ OPTS=(
5552
"--formatting=PRETTY_PRINT"
5653
"--debug"
5754

58-
# Include the Material and CDK FESM bundles
55+
# Include the Flex Layout FESM bundles
5956
dist/releases/flex-layout/esm2015/flex-layout.js
6057

6158
# Include all Angular FESM bundles.
62-
node_modules/@angular/core/@angular/core.js
63-
node_modules/@angular/common/@angular/common.js
64-
node_modules/@angular/compiler/@angular/compiler.js
65-
node_modules/@angular/forms/@angular/forms.js
66-
node_modules/@angular/http/@angular/http.js
67-
node_modules/@angular/router/@angular/router.js
68-
node_modules/@angular/platform-browser/@angular/platform-browser.js
69-
node_modules/@angular/platform-browser/@angular/platform-browser/animations.js
70-
node_modules/@angular/platform-browser-dynamic/@angular/platform-browser-dynamic.js
71-
node_modules/@angular/animations/@angular/animations.js
72-
node_modules/@angular/animations/@angular/animations/browser.js
73-
node_modules/@angular/material/esm2015/material.js
74-
node_modules/@angular/cdk/esm2015/cdk.js
59+
node_modules/@angular/core/esm5/index.js
60+
node_modules/@angular/common/esm5/index.js
61+
node_modules/@angular/common/esm5/http.js
62+
node_modules/@angular/compiler/esm5/index.js
63+
node_modules/@angular/forms/esm5/index.js
64+
node_modules/@angular/http/esm5/index.js
65+
node_modules/@angular/router/esm5/index.js
66+
node_modules/@angular/platform-browser/esm5/index.js
67+
node_modules/@angular/platform-browser/esm5/animations/index.js
68+
node_modules/@angular/platform-browser-dynamic/esm5/index.js
69+
node_modules/@angular/animations/esm5/index.js
70+
node_modules/@angular/animations/esm5/browser/index.js
71+
node_modules/@angular/material/esm5/material.js
72+
node_modules/@angular/cdk/esm5/cdk.js
7573

7674
# Include other dependencies like Zone.js and RxJS
7775
node_modules/zone.js/dist/zone.js
@@ -84,12 +82,6 @@ OPTS=(
8482
"--dependency_mode=STRICT"
8583
)
8684

87-
# Walk through every entry-point of the CDK and add it to closure options.
88-
for i in "${cdkEntryPoints[@]}"; do
89-
OPTS+=("--js_module_root=node_modules/@angular/cdk/${i}")
90-
OPTS+=("node_modules/@angular/cdk/esm2015/${i}.js")
91-
done
92-
9385
# Write closure flags to a closure flagfile.
9486
closureFlags=$(mktemp)
9587
echo ${OPTS[*]} > $closureFlags

src/demo-app/app/docs-layout-responsive/responsiveRowColumns.demo.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ import {ObservableMedia} from '@angular/flex-layout';
1717
<div class="containerX">
1818
1919
<div class="colorNested box" fxLayout="row" *ngIf="isVisible">
20-
<div [fxLayout]="firstCol"
21-
[fxLayout.xs]="firstColXs"
22-
[fxLayout.md]="firstColMd"
23-
[fxLayout.lg]="firstColLg"
24-
[fxLayout.gt-lg]="firstColGtLg"
20+
<div [fxLayout]="cols.firstCol"
21+
[fxLayout.xs]="cols.firstColXs"
22+
[fxLayout.md]="cols.firstColMd"
23+
[fxLayout.lg]="cols.firstColLg"
24+
[fxLayout.gt-lg]="cols.firstColGtLg"
2525
fxFlex="50%"
2626
fxFlex.gt-sm="25"
2727
fxHide.md
2828
(click)="toggleLayoutFor(1)" style="cursor: pointer;">
2929
<div fxFlex>Col #1: First item in row</div>
3030
<div fxFlex>Col #1: Second item in row</div>
3131
</div>
32-
<div [fxLayout]="secondCol" fxFlex (click)="toggleLayoutFor(2)"
32+
<div [fxLayout]="cols.secondCol" fxFlex (click)="toggleLayoutFor(2)"
3333
style="cursor: pointer;">
3434
<div fxFlex>Col #2: First item in column</div>
3535
<div fxFlex>Col #2: Second item in column</div>
@@ -39,10 +39,10 @@ import {ObservableMedia} from '@angular/flex-layout';
3939
</mat-card-content>
4040
<mat-card-footer style="width:95%; font-size: 0.9em; padding-left: 25px;">
4141
<div fxLayout="row" class="hint" fxLayoutAlign="space-around">
42-
<div>&lt;div fxLayout="{{ firstCol }}" fxFlex="50%" fxFlex.gt-sm="25%" fxHide.md &gt;
42+
<div>&lt;div fxLayout="{{ cols.firstCol }}" fxFlex="50%" fxFlex.gt-sm="25%" fxHide.md &gt;
4343
</div>
4444
<div fxFlex></div>
45-
<div>&lt;div fxLayout="{{ secondCol }}" fxFlex &gt;</div>
45+
<div>&lt;div fxLayout="{{ cols.secondCol }}" fxFlex &gt;</div>
4646
</div>
4747
</mat-card-footer>
4848
</mat-card>
@@ -52,13 +52,14 @@ export class DemoResponsiveRows implements OnDestroy {
5252
private _activeMQC: MediaChange;
5353
private _watcher: Subscription;
5454

55-
firstCol = 'row';
56-
firstColXs = 'column';
57-
firstColMd = 'column';
58-
firstColLg = 'invalid';
59-
firstColGtLg = 'column';
60-
61-
secondCol = 'column';
55+
cols: {[key: string]: string} = {
56+
firstCol: 'row',
57+
firstColXs: 'column',
58+
firstColMd: 'column',
59+
firstColLg: 'invalid',
60+
firstColGtLg: 'column',
61+
secondCol: 'column'
62+
};
6263

6364
isVisible = true;
6465

@@ -73,17 +74,17 @@ export class DemoResponsiveRows implements OnDestroy {
7374
this._watcher.unsubscribe();
7475
}
7576

76-
toggleLayoutFor(col) {
77+
toggleLayoutFor(col: number) {
7778
switch (col) {
7879
case 1:
7980

80-
col = `firstCol${this._activeMQC ? this._activeMQC.suffix : ''}`;
81-
this[col] = (this[col] === 'column') ? 'row' : 'column';
81+
const set1 = `firstCol${this._activeMQC ? this._activeMQC.suffix : ''}`;
82+
this.cols[set1] = (this.cols[set1] === 'column') ? 'row' : 'column';
8283
break;
8384

8485
case 2:
85-
col = 'secondCol';
86-
this[col] = (this[col] == 'row') ? 'column' : 'row';
86+
const set2 = 'secondCol';
87+
this.cols[set2] = (this.cols[set2] == 'row') ? 'column' : 'row';
8788
break;
8889
}
8990
}

src/demo-app/app/github-issues/splitter/split.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class SplitDirective implements AfterContentInit, OnDestroy {
3838
* While dragging, continually update the `flex.activatedValue` for each area
3939
* managed by the splitter.
4040
*/
41-
onDrag({x, y}): void {
41+
onDrag({x, y}: {x: number, y: number}): void {
4242
const dragAmount = (this.direction === 'row') ? x : y;
4343

4444
this.areas.forEach((area, i) => {
@@ -56,7 +56,7 @@ export class SplitDirective implements AfterContentInit, OnDestroy {
5656
* Use the pixel delta change to recalculate the area size (%)
5757
* Note: flex value may be '', %, px, or '<grow> <shrink> <basis>'
5858
*/
59-
calculateSize(value, delta) {
59+
calculateSize(value: string|number, delta: number) {
6060
const containerSizePx = this.elementRef.nativeElement.clientWidth;
6161
const elementSizePx = Math.round(this.valueToPixel(value, containerSizePx));
6262

src/demo-app/app/stack-overflow/mozHolyGrail.demo.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ article, nav, aside, header, footer {
1010
border-radius: 7px;
1111
}
1212

13-
#main > article {
13+
.main > article {
1414
border-color: #cccc33;
1515
background: #dddd88;
1616
cursor: pointer;
1717
}
1818

19-
#main > nav, #main > aside {
19+
.main > nav, .main > aside {
2020
border-color: #8888bb;
2121
background: #ccccff;
2222
}

src/demo-app/app/stack-overflow/mozHolyGrail.demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {Component} from '@angular/core';
2828
<div class="containerX">
2929
<div class="colorNested box" fxLayout="column">
3030
<header>header</header>
31-
<div id="main" [fxLayout]="direction" fxLayout.xs="column" fxFlex
31+
<div class="main" [fxLayout]="direction" fxLayout.xs="column" fxFlex
3232
(click)="toggleDirection()">
3333
<nav fxFlex="1 6 20%" fxFlexOrder fxFlexOrder.xs="2"> nav</nav>
3434
<article fxFlex="3 1 60%" fxFlexOrder fxFlexOrder.xs="1"> article</article>

src/demo-app/demo-app-module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
import {ApplicationRef, NgModule} from '@angular/core';
210
import {BrowserModule} from '@angular/platform-browser';
311
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';

src/demo-app/demo-app-types.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
declare var module: { id: string };

src/demo-app/main-aot.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
/**
210
* This is the main entry-point for the AOT compilation. File will be used to test AOT support.
311
*/

src/demo-app/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
19
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
210
import {DemoAppModule} from './demo-app-module';
311

0 commit comments

Comments
 (0)