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

Commit 4702a5d

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 b9745c6 commit 4702a5d

Some content is hidden

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

57 files changed

+4924
-4091
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/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

src/demo-app/system-config.ts

Lines changed: 10 additions & 13 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
/** Type declaration for ambient System. */
210
declare const System: any;
311

@@ -13,29 +21,18 @@ System.config({
1321

1422
// Angular specific mappings.
1523
'@angular/core': 'node:@angular/core/bundles/core.umd.js',
16-
'@angular/core/testing': 'node:@angular/core/bundles/core-testing.umd.js',
1724
'@angular/common': 'node:@angular/common/bundles/common.umd.js',
18-
'@angular/common/testing': 'node:@angular/common/bundles/common-testing.umd.js',
1925
'@angular/common/http': 'node:@angular/common/bundles/common-http.umd.js',
20-
'@angular/common/http/testing': 'node:@angular/common/bundles/common-http-testing.umd.js',
2126
'@angular/compiler': 'node:@angular/compiler/bundles/compiler.umd.js',
22-
'@angular/compiler/testing': 'node:@angular/compiler/bundles/compiler-testing.umd.js',
23-
'@angular/http': 'node:@angular/http/bundles/http.umd.js',
24-
'@angular/http/testing': 'node:@angular/http/bundles/http-testing.umd.js',
2527
'@angular/forms': 'node:@angular/forms/bundles/forms.umd.js',
26-
'@angular/forms/testing': 'node:@angular/forms/bundles/forms-testing.umd.js',
2728
'@angular/animations': 'node:@angular/animations/bundles/animations.umd.js',
2829
'@angular/animations/browser': 'node:@angular/animations/bundles/animations-browser.umd.js',
2930
'@angular/platform-browser/animations':
3031
'node:@angular/platform-browser/bundles/platform-browser-animations.umd',
3132
'@angular/platform-browser':
3233
'node:@angular/platform-browser/bundles/platform-browser.umd.js',
33-
'@angular/platform-browser/testing':
34-
'node:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
3534
'@angular/platform-browser-dynamic':
3635
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
37-
'@angular/platform-browser-dynamic/testing':
38-
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
3936

4037
'@angular/material': 'node:@angular/material/bundles/material.umd.js',
4138
'@angular/cdk': 'node:@angular/cdk/bundles/cdk.umd.js',
@@ -55,11 +52,11 @@ System.config({
5552
'@angular/cdk/stepper': 'node:@angular/cdk/bundles/cdk-stepper.umd.js',
5653
'@angular/cdk/table': 'node:@angular/cdk/bundles/cdk-table.umd.js',
5754

58-
'@angular/flex-layout': 'dist/bundles/flex-layout.umd.js',
55+
'@angular/flex-layout': 'dist/packages/flex-layout.umd.js',
5956

6057
},
6158
packages: {
62-
// 3rd-Party barrels.
59+
// Thirdparty barrels.
6360
'rxjs': { main: 'index' },
6461
// Set the default extension for the root package, because otherwise the demo-app can't
6562
// be built within the production mode. Due to missing file extensions.

src/demo-app/tsconfig-aot.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
"extends": "./tsconfig-build",
66
"compilerOptions": {
77
"experimentalDecorators": true,
8-
"noUnusedParameters": false,
9-
"strictNullChecks": false,
10-
"outDir": ".",
8+
"noUnusedParameters": true,
9+
"strictNullChecks": true,
10+
"outDir": "../../dist/packages/demo-app",
11+
"rootDirs": [
12+
".",
13+
"../../dist/packages/demo-app"
14+
],
1115
"paths": {
12-
"@angular/flex-layout": ["./flex-layout"]
16+
"@angular/flex-layout/*": ["../../dist/releases/flex-layout/*"],
17+
"@angular/flex-layout": ["../../dist/releases/flex-layout"]
1318
}
1419
},
1520
"files": [
@@ -18,6 +23,8 @@
1823
"./main-aot.ts"
1924
],
2025
"angularCompilerOptions": {
21-
"skipTemplateCodegen": false
26+
"skipTemplateCodegen": false,
27+
// TODO: disabled for now due to @angular/forms
28+
"fullTemplateTypeCheck": false
2229
}
2330
}

src/demo-app/tsconfig-build.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
"noUnusedParameters": true,
99
"strictNullChecks": false,
1010
"lib": ["es6", "es2015", "dom"],
11+
"skipLibCheck": true,
1112
"module": "commonjs",
1213
"moduleResolution": "node",
1314
"noEmitOnError": true,
14-
"noImplicitAny": false,
15+
"noImplicitAny": true,
1516
"outDir": "../../dist/packages/demo-app",
1617
"sourceMap": true,
1718
"target": "es5",
@@ -21,6 +22,7 @@
2122
],
2223
"baseUrl": ".",
2324
"paths": {
25+
"@angular/flex-layout/*": ["../../dist/packages/flex-layout/*"],
2426
"@angular/flex-layout": ["../../dist/packages/flex-layout/public-api"]
2527
}
2628
},

src/demo-app/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Configuration for IDEs only.
2+
{
3+
"extends": "../../tsconfig.json",
4+
"compilerOptions": {
5+
"rootDir": "..",
6+
"baseUrl": ".",
7+
"paths": {
8+
"@angular/flex-layout/*": ["../lib/*"],
9+
"@angular/flex-layout": ["../lib/public-api.ts"]
10+
}
11+
},
12+
"include": ["./**/*.ts"]
13+
}

0 commit comments

Comments
 (0)