Skip to content

Commit d93b74e

Browse files
committed
chore(): update to Beta.6, including having our own typings.
1 parent a24d5fa commit d93b74e

File tree

14 files changed

+90
-37
lines changed

14 files changed

+90
-37
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# compiled output
44
/dist
55
/tmp
6+
/typings
67

78
# dependencies
89
/node_modules

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ node_js:
99

1010
cache:
1111
directories:
12-
- node_modules
1312
- $HOME/.pub-cache
1413

1514
env:
@@ -50,6 +49,7 @@ before_install:
5049

5150
install:
5251
- npm install
52+
- npm run typings
5353

5454
before_script:
5555
# Necessary to run test on Travis CI that require a graphical interface.

DEV_ENVIRONMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
4. Clone your fork.
77
Recommendation: name your git remotes `upstream` for `angular/material2`
88
and `<your-username>` for your fork. Also see the [team git shortcuts](https://github.com/angular/material2/wiki/Team-git----bash-shortcuts).
9-
5. From the root of the project, run `npm install`
9+
5. From the root of the project, run `npm install`, then run `npm run typings` to install typescript definitions.
1010

1111

1212
To build the project, run `ng build`.
@@ -15,7 +15,7 @@ To watch for changes and automatically rebuild, run `ng build --watch`
1515
To bring up a local server, run `ng serve`. This will automatically watch for changes and rebuild.
1616
After the changes rebuild, the browser currently needs to be manually refreshed.
1717

18-
To run unit tests, run `ng test`.
18+
To run unit tests, run `npm test`.
1919

2020
Running e2e tests: <not yet implemented>
2121
Running benchmarks: <not yet implemented>

ember-cli-build.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
1111
var BroccoliSass = require('broccoli-sass');
1212
var broccoliAutoprefixer = require('broccoli-autoprefixer');
1313

14+
const BroccoliTypescript = require('./tools/broccoli/broccoli-typescript').default;
1415
const BroccoliTs2Dart = require('./tools/broccoli/broccoli-ts2dart').default;
1516
const BroccoliDestCopy = require('./tools/broccoli/broccoli-dest-copy').default;
1617
const BroccoliDartFmt = require('./tools/broccoli/broccoli-dartfmt').default;
@@ -24,6 +25,7 @@ module.exports = function(defaults) {
2425
var demoCssTree = getCssTree('demo-app');
2526
var componentCssTree = getCssTree('components');
2627
var angularAppTree = new Angular2App(defaults);
28+
2729
var dartAppTree = getDartTree('src/');
2830

2931
return mergeTrees([
@@ -51,6 +53,8 @@ function getDartTree(root) {
5153
generateLibraryName: true,
5254
generateSourceMap: false,
5355
translateBuiltins: true,
56+
typingsRoot: '../../typings/browser/ambient/',
57+
additionalFiles: [path.join(process.cwd(), root, 'typings.d.ts')],
5458
});
5559

5660
const formatter = new BroccoliDartFmt(ts2dart, { dartSDK });
@@ -65,11 +69,6 @@ function getDartTree(root) {
6569
formatter
6670
]);
6771

68-
//const pubSpecTree = new BroccoliFunnel('.', {
69-
// files: ['pubspec.yaml'],
70-
// //exclude: ['**/*'],
71-
// destDir: 'dart'
72-
//});
7372
const pubSpecTree = new BroccoliFunnel(new BroccoliSource.UnwatchedDir('.'), {
7473
files: ['pubspec.yaml'],
7574
destDir: 'dart',

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@
1111
"build": "ng build",
1212
"dartanalyzer": "cd dist/dart && pub install && cd ../.. && ts-node scripts/ci/dart_analyzer",
1313
"demo-app": "cd src && ng serve",
14-
"test": "karma start test/karma.conf.js"
14+
"test": "karma start test/karma.conf.js",
15+
"typings": "typings install --ambient"
1516
},
1617
"version": "2.0.0-alpha.0",
1718
"license": "MIT",
1819
"engines": {
1920
"node": ">= 4.2.1 < 5"
2021
},
2122
"dependencies": {
22-
"angular2": "2.0.0-beta.0",
23+
"angular2": "2.0.0-beta.6",
2324
"es6-promise": "^3.0.2",
2425
"es6-shim": "^0.33.3",
2526
"reflect-metadata": "0.1.2",
2627
"rxjs": "5.0.0-beta.0",
2728
"systemjs": "0.19.4",
28-
"zone.js": "0.5.10"
29+
"zone.js": "0.5.14"
2930
},
3031
"devDependencies": {
31-
"angular-cli": "0.0.*",
32+
"angular-cli": "^0.0.24",
3233
"angular-cli-github-pages": "^0.2.0",
3334
"broccoli-autoprefixer": "^4.1.0",
3435
"broccoli-funnel": "^1.0.1",
@@ -51,9 +52,10 @@
5152
"strip-ansi": "^3.0.0",
5253
"symlink-or-copy": "^1.0.1",
5354
"ts-node": "^0.5.5",
54-
"ts2dart": "^0.7.25",
55+
"ts2dart": "^0.7.27",
5556
"tslint": "^3.2.2",
5657
"typescript": "^1.7.5",
58+
"typings": "^0.6.8",
5759
"which": "^1.2.4"
5860
}
5961
}

scripts/ci/build-and-test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
set -e
23

34
echo "======= Starting build-and-test.sh ========================================"
45

src/components/sidenav/sidenav.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export function main() {
156156
.then((_: any) => { done(); });
157157
}, 8000);
158158

159-
it('open() twice returns the same promise', (done: any) => {
159+
it('open/close() twice returns the same promise', (done: any) => {
160160
let fixture: ComponentFixture;
161161
let sidenav: MdSidenav;
162162

@@ -169,12 +169,14 @@ export function main() {
169169

170170
promise = sidenav.open();
171171
expect(sidenav.open()).toBe(promise);
172+
return wait(1);
172173
})
173174
.then((_: any) => { return wait(1); })
174175
.then((_: any) => {
175176
fixture.detectChanges();
176177
return promise;
177178
})
179+
.then((_: any) => { return wait(1); })
178180
.then((_: any) => {
179181
promise = sidenav.close();
180182
expect(sidenav.close()).toBe(promise);

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<demo-app>Loading...</demo-app>
1515

1616
<script src="vendor/systemjs/dist/system.src.js"></script>
17-
<script src="vendor/systemjs/dist/system-polyfills.src.js"></script>
17+
<script src="vendor/systemjs/dist/system-polyfills.js"></script>
1818
<script src="vendor/rxjs/bundles/Rx.js"></script>
1919
<script src="vendor/angular2/bundles/angular2.dev.js"></script>
2020
<script src="vendor/angular2/bundles/http.dev.js"></script>

src/typings.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="../typings/browser.d.ts" />

test/karma-test-shim.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,32 @@ System.config({
4141
}
4242
});
4343

44-
System.import('angular2/platform/browser').then(function(browser_adapter) {
45-
// TODO: once beta is out we should change this code to use a "test platform"
46-
browser_adapter.BrowserDomAdapter.makeCurrent();
47-
}).then(function() {
44+
45+
/**
46+
* Bootstrap the browser testing providers from Angular2. The equivalent code in TypeScript
47+
* would be:
48+
*
49+
* <code>
50+
* import {setBaseTestProviders} from 'angular2/testing';
51+
* import * as browser from 'angular2/platform/testing/browser';
52+
*
53+
* setBaseTestProviders(browser.TEST_BROWSER_PLATFORM_PROVIDERS,
54+
* browser.TEST_BROWSER_APPLICATION_PROVIDERS);
55+
* </code>
56+
*
57+
* See https://github.com/angular/angular/blob/master/CHANGELOG.md#200-beta2-2016-01-28
58+
*
59+
* Followed by the normal import of all spec files, then bootstrap Karma.
60+
*/
61+
Promise.all([
62+
System.import('angular2/testing'),
63+
System.import('angular2/platform/testing/browser'),
64+
]).then(function(imports) {
65+
var testing = imports[0];
66+
var browser = imports[1];
67+
testing.setBaseTestProviders(browser.TEST_BROWSER_PLATFORM_PROVIDERS,
68+
browser.TEST_BROWSER_APPLICATION_PROVIDERS);
69+
4870
return Promise.all(
4971
Object.keys(window.__karma__.files)
5072
.filter(isSpecFile)

0 commit comments

Comments
 (0)