diff --git a/modules/@angular/core/src/util/decorators.ts b/modules/@angular/core/src/util/decorators.ts index d497f16d2f..5928fb321c 100644 --- a/modules/@angular/core/src/util/decorators.ts +++ b/modules/@angular/core/src/util/decorators.ts @@ -26,7 +26,7 @@ export interface ClassDefinition { * Other methods on the class. Note that values should have type 'Function' but TS requires * all properties to have a narrower type than the index signature. */ - [x: string]: Type | Function | any[] | undefined; + [x: string]: Type | Function | any[]; } /** diff --git a/scripts/ci-lite/build.sh b/scripts/ci-lite/build.sh index 0fb8e9271c..3a24d80eb4 100755 --- a/scripts/ci-lite/build.sh +++ b/scripts/ci-lite/build.sh @@ -9,6 +9,7 @@ cd `dirname $0` source ./env.sh cd ../.. +$(npm bin)/tsc -v $(npm bin)/tsc -p tools cp tools/@angular/tsc-wrapped/package.json dist/tools/@angular/tsc-wrapped node dist/tools/@angular/tsc-wrapped/src/main -p modules diff --git a/scripts/ci-lite/test_e2e.sh b/scripts/ci-lite/test_e2e.sh index 93c137af0f..e1f9d317f6 100755 --- a/scripts/ci-lite/test_e2e.sh +++ b/scripts/ci-lite/test_e2e.sh @@ -23,6 +23,7 @@ echo 'travis_fold:end:test.buildPackages' ./scripts/ci-lite/offline_compiler_test.sh +./tools/typings-test/test.sh echo 'travis_fold:start:test.e2e.localChrome' cd dist/ diff --git a/tools/tsconfig.json b/tools/tsconfig.json index 948841ae97..f8a392730a 100644 --- a/tools/tsconfig.json +++ b/tools/tsconfig.json @@ -17,6 +17,7 @@ "target": "es5" }, "exclude": [ - "node_modules" + "node_modules", + "typings-test" ] } diff --git a/tools/typings-test/include-all.ts b/tools/typings-test/include-all.ts new file mode 100644 index 0000000000..dd205706eb --- /dev/null +++ b/tools/typings-test/include-all.ts @@ -0,0 +1,37 @@ +import * as compiler from '@angular/compiler'; +import * as compiler_cli from '@angular/compiler-cli'; +import * as compilerTesting from '@angular/compiler/testing'; +import * as coreTesting from '@angular/core'; +import * as core from '@angular/core/testing'; +import * as httpTesting from '@angular/http'; +import * as http from '@angular/http/testing'; +import * as platformBrowserTesting from '@angular/platform-browser'; +import * as platformBrowserDynmic from '@angular/platform-browser-dynamic'; +import * as platformBrowser from '@angular/platform-browser/testing'; +import * as platfomrServerTesting from '@angular/platform-server'; +import * as platfomrServer from '@angular/platform-server/testing'; +import * as router from '@angular/router'; +import * as routerDeprecatedTesting from '@angular/router-deprecated'; +import * as routerDeprecated from '@angular/router-deprecated/testing'; +import * as routerTesting from '@angular/router/testing'; +import * as upgrade from '@angular/upgrade'; + +export default { + compiler, + compilerTesting, + compiler_cli, + core, + coreTesting, + http, + httpTesting, + platformBrowser, + platformBrowserTesting, + platformBrowserDynmic, + platfomrServer, + platfomrServerTesting, + router, + routerTesting, + routerDeprecated, + routerDeprecatedTesting, + upgrade +} diff --git a/tools/typings-test/test.sh b/tools/typings-test/test.sh new file mode 100755 index 0000000000..ef20426d38 --- /dev/null +++ b/tools/typings-test/test.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -ex -o pipefail + +# These ones can be `npm link`ed for fast development +LINKABLE_PKGS=( + $(pwd)/dist/packages-dist/{common,core,compiler,compiler-cli,http,router,router-deprecated,upgrade,platform-{browser,browser-dynamic,server}} +) + +TMPDIR=${TMPDIR:-/tmp/angular-build/} +readonly TMP=$TMPDIR/typings-test.$(date +%s) +mkdir -p $TMP +cp -R -v tools/typings-test/* $TMP + +# run in subshell to avoid polluting cwd +( + cd $TMP + # create package.json so that npm install doesn't pollute any parent node_modules's directory + npm init --yes + npm install ${LINKABLE_PKGS[*]} + npm install @types/es6-promise @types/es6-collections @types/jasmine rxjs@5.0.0-beta.6 + npm install typescript@1.8.10 + $(npm bin)/tsc --version + $(npm bin)/tsc -p tsconfig.json +) diff --git a/tools/typings-test/tsconfig.json b/tools/typings-test/tsconfig.json new file mode 100644 index 0000000000..5abcf721b8 --- /dev/null +++ b/tools/typings-test/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "module": "commonjs", + "moduleResolution": "node", + "outDir": "../../dist/typing-test/", + "rootDir": ".", + "target": "es5" + }, + "files": [ + "include-all.ts", + "node_modules/@types/es6-promise/index.d.ts", + "node_modules/@types/es6-collections/index.d.ts", + "node_modules/@types/jasmine/index.d.ts" + ] +}