Skip to content

Commit

Permalink
chore: update to Angular v5.2 and update peer dep requirements
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
CaerusKaru committed Jan 14, 2018
1 parent b9745c6 commit 4702a5d
Show file tree
Hide file tree
Showing 57 changed files with 4,924 additions and 4,091 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: false
dist: trusty

node_js:
- '--lts'
- '8'

addons:
jwt:
Expand All @@ -21,11 +21,13 @@ jobs:
- env: "MODE=lint"
- env: "MODE=aot"
- env: "MODE=prerender"
# Closure Compiler CI check is temporarily disabled until a new version of
# the tool is released with https://github.com/google/closure-compiler/pull/2600
# - env: "MODE=closure-compiler"
- env: "MODE=saucelabs_required"
- env: "MODE=browserstack_required"
- env: "MODE=travis_required"
- stage: Deploy
env: "DEPLOY_MODE=build-artifacts"
- env: "DEPLOY_MODE=build-artifacts"
env:
global:
- LOGS_DIR=/tmp/flex-layout-build/logs
Expand All @@ -38,7 +40,6 @@ env:

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

install:
- npm install
Expand All @@ -51,4 +52,4 @@ script:

cache:
directories:
- $HOME/.npm
- ./node_modules/
7 changes: 5 additions & 2 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ const package = require('./package.json');
/** Current version of the project*/
const buildVersion = package.version;

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

/** License that will be placed inside of all created bundles. */
const buildLicense = `/**
Expand Down
8,138 changes: 4,461 additions & 3,677 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"node": ">= 5.4.1"
},
"dependencies": {
"@angular/core": "~5.1.0",
"@angular/common": "~5.1.0",
"@angular/compiler": "~5.1.0",
"@angular/platform-browser": "~5.1.0",
"@angular/core": "~5.2.0",
"@angular/common": "~5.2.0",
"@angular/compiler": "~5.2.0",
"@angular/platform-browser": "~5.2.0",
"core-js": "^2.4.1",
"rxjs": "^5.5.5",
"systemjs": "0.19.43",
Expand All @@ -38,15 +38,15 @@
"zone.js": "^0.8.18"
},
"devDependencies": {
"@angular/animations": "~5.1.0",
"@angular/animations": "~5.2.0",
"@angular/cdk": "^5.0.1",
"@angular/compiler-cli": "~5.1.0",
"@angular/forms": "~5.1.0",
"@angular/http": "~5.1.0",
"@angular/compiler-cli": "~5.2.0",
"@angular/forms": "~5.2.0",
"@angular/http": "~5.2.0",
"@angular/material": "^5.0.1",
"@angular/platform-browser-dynamic": "~5.1.0",
"@angular/platform-server": "~5.1.0",
"@angular/router": "~5.1.0",
"@angular/platform-browser-dynamic": "~5.2.0",
"@angular/platform-server": "~5.2.0",
"@angular/router": "~5.2.0",
"@angular/tsc-wrapped": "^4.4.6",
"@google-cloud/storage": "^1.4.0",
"@types/chalk": "^0.4.31",
Expand Down Expand Up @@ -122,7 +122,7 @@
"tsconfig-paths": "^2.3.0",
"tslint": "^5.8.0",
"tsutils": "^2.13.0",
"typescript": "^2.4.2",
"typescript": "^2.6.2",
"uglify-js": "^2.8.14"
}
}
}
9 changes: 4 additions & 5 deletions scripts/ci/travis-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ else
fi

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

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

teardown_tunnel
40 changes: 16 additions & 24 deletions scripts/closure-compiler/build-devapp-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ $(npm bin)/tsc -p src/demo-app/tsconfig-build.json --target ES2015 --module ES20
# Create a list of all RxJS source files.
rxjsSourceFiles=$(find node_modules/rxjs/ -name '*.js');

# List of entry points in the CDK package. Exclude "testing" since it's not an entry point.
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 {} \;))

OPTS=(
"--language_in=ES6_STRICT"
"--language_out=ES5"
Expand All @@ -39,9 +36,9 @@ OPTS=(
"--js_module_root=dist/releases/flex-layout"
"--js_module_root=node_modules/@angular/core"
"--js_module_root=node_modules/@angular/common"
"--js_module_root=node_modules/@angular/common/http"
"--js_module_root=node_modules/@angular/compiler"
"--js_module_root=node_modules/@angular/forms"
"--js_module_root=node_modules/@angular/http"
"--js_module_root=node_modules/@angular/router"
"--js_module_root=node_modules/@angular/platform-browser"
"--js_module_root=node_modules/@angular/platform-browser/animations"
Expand All @@ -55,23 +52,24 @@ OPTS=(
"--formatting=PRETTY_PRINT"
"--debug"

# Include the Material and CDK FESM bundles
# Include the Flex Layout FESM bundles
dist/releases/flex-layout/esm2015/flex-layout.js

# Include all Angular FESM bundles.
node_modules/@angular/core/@angular/core.js
node_modules/@angular/common/@angular/common.js
node_modules/@angular/compiler/@angular/compiler.js
node_modules/@angular/forms/@angular/forms.js
node_modules/@angular/http/@angular/http.js
node_modules/@angular/router/@angular/router.js
node_modules/@angular/platform-browser/@angular/platform-browser.js
node_modules/@angular/platform-browser/@angular/platform-browser/animations.js
node_modules/@angular/platform-browser-dynamic/@angular/platform-browser-dynamic.js
node_modules/@angular/animations/@angular/animations.js
node_modules/@angular/animations/@angular/animations/browser.js
node_modules/@angular/material/esm2015/material.js
node_modules/@angular/cdk/esm2015/cdk.js
node_modules/@angular/core/esm5/index.js
node_modules/@angular/common/esm5/index.js
node_modules/@angular/common/esm5/http.js
node_modules/@angular/compiler/esm5/index.js
node_modules/@angular/forms/esm5/index.js
node_modules/@angular/http/esm5/index.js
node_modules/@angular/router/esm5/index.js
node_modules/@angular/platform-browser/esm5/index.js
node_modules/@angular/platform-browser/esm5/animations/index.js
node_modules/@angular/platform-browser-dynamic/esm5/index.js
node_modules/@angular/animations/esm5/index.js
node_modules/@angular/animations/esm5/browser/index.js
node_modules/@angular/material/esm5/material.js
node_modules/@angular/cdk/esm5/cdk.js

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

# Walk through every entry-point of the CDK and add it to closure options.
for i in "${cdkEntryPoints[@]}"; do
OPTS+=("--js_module_root=node_modules/@angular/cdk/${i}")
OPTS+=("node_modules/@angular/cdk/esm2015/${i}.js")
done

# Write closure flags to a closure flagfile.
closureFlags=$(mktemp)
echo ${OPTS[*]} > $closureFlags
Expand Down
4 changes: 2 additions & 2 deletions src/demo-app/app/stack-overflow/mozHolyGrail.demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ article, nav, aside, header, footer {
border-radius: 7px;
}

#main > article {
.main > article {
border-color: #cccc33;
background: #dddd88;
cursor: pointer;
}

#main > nav, #main > aside {
.main > nav, .main > aside {
border-color: #8888bb;
background: #ccccff;
}
Expand Down
2 changes: 1 addition & 1 deletion src/demo-app/app/stack-overflow/mozHolyGrail.demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {Component} from '@angular/core';
<div class="containerX">
<div class="colorNested box" fxLayout="column">
<header>header</header>
<div id="main" [fxLayout]="direction" fxLayout.xs="column" fxFlex
<div class="main" [fxLayout]="direction" fxLayout.xs="column" fxFlex
(click)="toggleDirection()">
<nav fxFlex="1 6 20%" fxFlexOrder fxFlexOrder.xs="2"> nav</nav>
<article fxFlex="3 1 60%" fxFlexOrder fxFlexOrder.xs="1"> article</article>
Expand Down
8 changes: 8 additions & 0 deletions src/demo-app/demo-app-module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

import {ApplicationRef, NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
Expand Down
8 changes: 8 additions & 0 deletions src/demo-app/demo-app-types.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

declare var module: { id: string };
8 changes: 8 additions & 0 deletions src/demo-app/main-aot.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

/**
* This is the main entry-point for the AOT compilation. File will be used to test AOT support.
*/
Expand Down
8 changes: 8 additions & 0 deletions src/demo-app/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {DemoAppModule} from './demo-app-module';

Expand Down
23 changes: 10 additions & 13 deletions src/demo-app/system-config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

/** Type declaration for ambient System. */
declare const System: any;

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

// Angular specific mappings.
'@angular/core': 'node:@angular/core/bundles/core.umd.js',
'@angular/core/testing': 'node:@angular/core/bundles/core-testing.umd.js',
'@angular/common': 'node:@angular/common/bundles/common.umd.js',
'@angular/common/testing': 'node:@angular/common/bundles/common-testing.umd.js',
'@angular/common/http': 'node:@angular/common/bundles/common-http.umd.js',
'@angular/common/http/testing': 'node:@angular/common/bundles/common-http-testing.umd.js',
'@angular/compiler': 'node:@angular/compiler/bundles/compiler.umd.js',
'@angular/compiler/testing': 'node:@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/http': 'node:@angular/http/bundles/http.umd.js',
'@angular/http/testing': 'node:@angular/http/bundles/http-testing.umd.js',
'@angular/forms': 'node:@angular/forms/bundles/forms.umd.js',
'@angular/forms/testing': 'node:@angular/forms/bundles/forms-testing.umd.js',
'@angular/animations': 'node:@angular/animations/bundles/animations.umd.js',
'@angular/animations/browser': 'node:@angular/animations/bundles/animations-browser.umd.js',
'@angular/platform-browser/animations':
'node:@angular/platform-browser/bundles/platform-browser-animations.umd',
'@angular/platform-browser':
'node:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser/testing':
'node:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic':
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/platform-browser-dynamic/testing':
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',

'@angular/material': 'node:@angular/material/bundles/material.umd.js',
'@angular/cdk': 'node:@angular/cdk/bundles/cdk.umd.js',
Expand All @@ -55,11 +52,11 @@ System.config({
'@angular/cdk/stepper': 'node:@angular/cdk/bundles/cdk-stepper.umd.js',
'@angular/cdk/table': 'node:@angular/cdk/bundles/cdk-table.umd.js',

'@angular/flex-layout': 'dist/bundles/flex-layout.umd.js',
'@angular/flex-layout': 'dist/packages/flex-layout.umd.js',

},
packages: {
// 3rd-Party barrels.
// Thirdparty barrels.
'rxjs': { main: 'index' },
// Set the default extension for the root package, because otherwise the demo-app can't
// be built within the production mode. Due to missing file extensions.
Expand Down
17 changes: 12 additions & 5 deletions src/demo-app/tsconfig-aot.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
"extends": "./tsconfig-build",
"compilerOptions": {
"experimentalDecorators": true,
"noUnusedParameters": false,
"strictNullChecks": false,
"outDir": ".",
"noUnusedParameters": true,
"strictNullChecks": true,
"outDir": "../../dist/packages/demo-app",
"rootDirs": [
".",
"../../dist/packages/demo-app"
],
"paths": {
"@angular/flex-layout": ["./flex-layout"]
"@angular/flex-layout/*": ["../../dist/releases/flex-layout/*"],
"@angular/flex-layout": ["../../dist/releases/flex-layout"]
}
},
"files": [
Expand All @@ -18,6 +23,8 @@
"./main-aot.ts"
],
"angularCompilerOptions": {
"skipTemplateCodegen": false
"skipTemplateCodegen": false,
// TODO: disabled for now due to @angular/forms
"fullTemplateTypeCheck": false
}
}
4 changes: 3 additions & 1 deletion src/demo-app/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"noUnusedParameters": true,
"strictNullChecks": false,
"lib": ["es6", "es2015", "dom"],
"skipLibCheck": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": false,
"noImplicitAny": true,
"outDir": "../../dist/packages/demo-app",
"sourceMap": true,
"target": "es5",
Expand All @@ -21,6 +22,7 @@
],
"baseUrl": ".",
"paths": {
"@angular/flex-layout/*": ["../../dist/packages/flex-layout/*"],
"@angular/flex-layout": ["../../dist/packages/flex-layout/public-api"]
}
},
Expand Down
13 changes: 13 additions & 0 deletions src/demo-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Configuration for IDEs only.
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "..",
"baseUrl": ".",
"paths": {
"@angular/flex-layout/*": ["../lib/*"],
"@angular/flex-layout": ["../lib/public-api.ts"]
}
},
"include": ["./**/*.ts"]
}
Loading

0 comments on commit 4702a5d

Please sign in to comment.