From 410aa33005f2dc6f6500db71e7f019a744f909d9 Mon Sep 17 00:00:00 2001 From: Jason Aden Date: Wed, 15 Mar 2017 13:26:09 -0700 Subject: [PATCH] build: fix paths to typings files so tsickle resolves imports correctly Fixes #15080 --- build.sh | 60 ++++++++++++------- packages/animations/browser/package.json | 2 +- .../animations/browser/testing/package.json | 2 +- packages/animations/package.json | 2 +- packages/common/package.json | 2 +- packages/common/testing/package.json | 2 +- packages/compiler-cli/src/compiler_host.ts | 2 +- packages/compiler-cli/test/aot_host_spec.ts | 4 +- packages/compiler/package.json | 2 +- packages/compiler/testing/package.json | 2 +- packages/core/package.json | 2 +- packages/core/testing/package.json | 2 +- packages/forms/package.json | 2 +- packages/http/package.json | 2 +- packages/http/testing/package.json | 2 +- packages/language-service/package.json | 2 +- .../platform-browser-dynamic/package.json | 2 +- .../testing/package.json | 2 +- .../platform-browser/animations/package.json | 2 +- packages/platform-browser/package.json | 2 +- .../platform-browser/testing/package.json | 2 +- packages/platform-server/package.json | 2 +- packages/platform-server/testing/package.json | 2 +- .../platform-webworker-dynamic/package.json | 2 +- packages/platform-webworker/package.json | 2 +- packages/router/package.json | 2 +- packages/router/testing/package.json | 2 +- packages/router/upgrade/package.json | 2 +- packages/upgrade/package.json | 2 +- packages/upgrade/static/package.json | 2 +- packages/upgrade/static/public_api.ts | 10 ++-- packages/upgrade/static/src | 1 + scripts/ci/_travis-fold.sh | 8 ++- scripts/ci/offline_compiler_test.sh | 3 +- tools/gulp-tasks/public-api.js | 35 +++++------ .../animations/{typings => }/animations.d.ts | 0 .../browser/index.d.ts => browser.d.ts} | 0 .../index.d.ts => browser/testing.d.ts} | 0 .../common/{typings => }/common.d.ts | 0 .../testing/index.d.ts => testing.d.ts} | 0 .../compiler/{typings => }/compiler.d.ts | 0 .../testing/index.d.ts => testing.d.ts} | 0 .../core/{typings => }/core.d.ts | 0 .../testing/index.d.ts => testing.d.ts} | 0 .../forms/{typings => }/forms.d.ts | 0 .../http/{typings => }/http.d.ts | 0 .../testing/index.d.ts => testing.d.ts} | 0 .../platform-browser-dynamic.d.ts | 0 .../testing/index.d.ts => testing.d.ts} | 0 .../animations/index.d.ts => animations.d.ts} | 0 .../index.d.ts => animations/testing.d.ts} | 0 .../{typings => }/platform-browser.d.ts | 0 .../testing/index.d.ts => testing.d.ts} | 0 .../{typings => }/platform-server.d.ts | 0 .../testing/index.d.ts => testing.d.ts} | 0 .../platform-webworker-dynamic.d.ts | 0 .../{typings => }/platform-webworker.d.ts | 0 .../router/{typings => }/router.d.ts | 0 .../static/index.d.ts => static.d.ts} | 0 .../upgrade/{typings => }/upgrade.d.ts | 0 60 files changed, 96 insertions(+), 81 deletions(-) create mode 120000 packages/upgrade/static/src rename tools/public_api_guard/animations/{typings => }/animations.d.ts (100%) rename tools/public_api_guard/animations/{typings/browser/index.d.ts => browser.d.ts} (100%) rename tools/public_api_guard/animations/{typings/browser/testing/index.d.ts => browser/testing.d.ts} (100%) rename tools/public_api_guard/common/{typings => }/common.d.ts (100%) rename tools/public_api_guard/common/{typings/testing/index.d.ts => testing.d.ts} (100%) rename tools/public_api_guard/compiler/{typings => }/compiler.d.ts (100%) rename tools/public_api_guard/compiler/{typings/testing/index.d.ts => testing.d.ts} (100%) rename tools/public_api_guard/core/{typings => }/core.d.ts (100%) rename tools/public_api_guard/core/{typings/testing/index.d.ts => testing.d.ts} (100%) rename tools/public_api_guard/forms/{typings => }/forms.d.ts (100%) rename tools/public_api_guard/http/{typings => }/http.d.ts (100%) rename tools/public_api_guard/http/{typings/testing/index.d.ts => testing.d.ts} (100%) rename tools/public_api_guard/platform-browser-dynamic/{typings => }/platform-browser-dynamic.d.ts (100%) rename tools/public_api_guard/platform-browser-dynamic/{typings/testing/index.d.ts => testing.d.ts} (100%) rename tools/public_api_guard/platform-browser/{typings/animations/index.d.ts => animations.d.ts} (100%) rename tools/public_api_guard/platform-browser/{typings/animations/testing/index.d.ts => animations/testing.d.ts} (100%) rename tools/public_api_guard/platform-browser/{typings => }/platform-browser.d.ts (100%) rename tools/public_api_guard/platform-browser/{typings/testing/index.d.ts => testing.d.ts} (100%) rename tools/public_api_guard/platform-server/{typings => }/platform-server.d.ts (100%) rename tools/public_api_guard/platform-server/{typings/testing/index.d.ts => testing.d.ts} (100%) rename tools/public_api_guard/platform-webworker-dynamic/{typings => }/platform-webworker-dynamic.d.ts (100%) rename tools/public_api_guard/platform-webworker/{typings => }/platform-webworker.d.ts (100%) rename tools/public_api_guard/router/{typings => }/router.d.ts (100%) rename tools/public_api_guard/upgrade/{typings/static/index.d.ts => static.d.ts} (100%) rename tools/public_api_guard/upgrade/{typings => }/upgrade.d.ts (100%) diff --git a/build.sh b/build.sh index 6835e07164..1921604723 100755 --- a/build.sh +++ b/build.sh @@ -37,9 +37,16 @@ REMOVE_BENCHPRESS=false BUILD_EXAMPLES=true COMPILE_SOURCE=true TYPECHECK_ALL=true +BUILD_TOOLS=true for ARG in "$@"; do case "$ARG" in + --quick-bundle=*) + COMPILE_SOURCE=false + TYPECHECK_ALL=false + BUILD_EXAMPLES=false + BUILD_TOOLS=false + ;; --packages=*) PACKAGES_STR=${ARG#--packages=} PACKAGES=( ${PACKAGES_STR//,/ } ) @@ -61,6 +68,9 @@ for ARG in "$@"; do --typecheck=*) TYPECHECK_ALL=${ARG#--typecheck=} ;; + --tools=*) + BUILD_TOOLS=${ARG#--tools=} + ;; *) echo "Unknown option $ARG." exit 1 @@ -257,6 +267,7 @@ compilePackage() { $NGC -p ${1}/tsconfig-build.json echo "====== Create ${1}/../${package_name}.d.ts re-export file for Closure" echo "$(cat ${LICENSE_BANNER}) ${N} export * from './${package_name}/index'" > ${2}/../${package_name}.d.ts + echo "{\"alias\": \"./${package_name}/index.metadata.json\"}" > ${2}/../${package_name}.metadata.json fi for DIR in ${1}/* ; do @@ -269,15 +280,16 @@ compilePackage() { } ####################################### -# Renames typings index to package name +# Moves typings and metadata files appropriately # Arguments: -# param1 - Source directory of typings files -# param2 - Package name +# param1 - Source of typings & metadata files +# param2 - Root of destination directory +# param3 - Package name (needed to correspond to name of d.ts and metadata.json files) # Returns: # None ####################################### moveTypings() { - if [[ -f ${1}/index.d.ts ]]; then + if [[ -f ${1}/index.d.ts && -f ${1}/index.metadata.json ]]; then mv ${1}/index.d.ts ${1}/${2}.d.ts mv ${1}/index.metadata.json ${1}/${2}.metadata.json fi @@ -329,24 +341,25 @@ UGLIFYJS=`pwd`/node_modules/.bin/uglifyjs TSCONFIG=./tools/tsconfig.json ROLLUP=`pwd`/node_modules/.bin/rollup +if [[ ${BUILD_TOOLS} == true ]]; then + travisFoldStart "build tools" "no-xtrace" + echo "====== (tools)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} =====" + rm -rf ./dist/tools/ + mkdir -p ./dist/tools/ + $(npm bin)/tsc -p ${TSCONFIG} -travisFoldStart "build tools" - echo "====== (tools)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} =====" - rm -rf ./dist/tools/ - mkdir -p ./dist/tools/ - $(npm bin)/tsc -p ${TSCONFIG} - - cp ./tools/@angular/tsc-wrapped/package.json ./dist/tools/@angular/tsc-wrapped -travisFoldEnd "build tools" + cp ./tools/@angular/tsc-wrapped/package.json ./dist/tools/@angular/tsc-wrapped + travisFoldEnd "build tools" +fi if [[ ${BUILD_ALL} == true && ${TYPECHECK_ALL} == true ]]; then - travisFoldStart "clean dist" + travisFoldStart "clean dist" "no-xtrace" rm -rf ./dist/all/ rm -rf ./dist/packages travisFoldEnd "clean dist" - travisFoldStart "copy e2e files" + travisFoldStart "copy e2e files" "no-xtrace" mkdir -p ./dist/all/ echo "====== Copying files needed for e2e tests =====" @@ -384,11 +397,11 @@ if [[ ${BUILD_ALL} == true && ${TYPECHECK_ALL} == true ]]; then travisFoldEnd "copy e2e files" TSCONFIG="packages/tsconfig.json" - travisFoldStart "tsc -p ${TSCONFIG}" + travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace" $NGC -p ${TSCONFIG} travisFoldEnd "tsc -p ${TSCONFIG}" TSCONFIG="modules/tsconfig.json" - travisFoldStart "tsc -p ${TSCONFIG}" + travisFoldStart "tsc -p ${TSCONFIG}" "no-xtrace" $NGC -p ${TSCONFIG} travisFoldEnd "tsc -p ${TSCONFIG}" @@ -403,7 +416,7 @@ fi for PACKAGE in ${PACKAGES[@]} do - travisFoldStart "build package: ${PACKAGE}" + travisFoldStart "build package: ${PACKAGE}" "no-xtrace" PWD=`pwd` ROOT_DIR=${PWD}/packages SRC_DIR=${ROOT_DIR}/${PACKAGE} @@ -433,9 +446,12 @@ do if ! containsElement "${PACKAGE}" "${NODE_PACKAGES[@]}"; then echo "====== Copy ${PACKAGE} typings" - rsync -a --exclude=*.js --exclude=*.js.map ${OUT_DIR}/ ${NPM_DIR}/typings - moveTypings ${NPM_DIR}/typings ${PACKAGE} - addNgcPackageJson ${NPM_DIR}/typings + rsync -a --exclude=*.js --exclude=*.js.map ${OUT_DIR}/ ${NPM_DIR} +# echo "$(cat ${LICENSE_BANNER}) ${N} export * from './index'" > ${NPM_DIR}/${PACKAGE}.d.ts +# echo "{\"alias\": \"./index.metadata.json\"}" > ${NPM_DIR}/${PACKAGE}.metadata.json +# exit 0 + moveTypings ${NPM_DIR} ${PACKAGE} +# addNgcPackageJson ${NPM_DIR}/typings ( cd ${SRC_DIR} @@ -478,14 +494,14 @@ do done if [[ ${BUILD_EXAMPLES} == true ]]; then - travisFoldStart "build examples" + travisFoldStart "build examples" "no-xtrace" echo "====== Building examples: ./packages/examples/build.sh =====" ./packages/examples/build.sh travisFoldEnd "build examples" fi if [[ ${REMOVE_BENCHPRESS} == true ]]; then - travisFoldStart "remove benchpress" + travisFoldStart "remove benchpress" "no-xtrace" echo "" echo "==== Removing benchpress from publication" rm -r dist/packages-dist/benchpress diff --git a/packages/animations/browser/package.json b/packages/animations/browser/package.json index 584c245aef..36660b4370 100644 --- a/packages/animations/browser/package.json +++ b/packages/animations/browser/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/browser/index.d.ts", + "typings": "../browser.d.ts", "main": "../bundles/animation-browser.umd.js", "module": "../@angular/animations/browser.es5.js", "es2015": "../@angular/animations/browser.js" diff --git a/packages/animations/browser/testing/package.json b/packages/animations/browser/testing/package.json index 99cfa4544e..5382dfa2ad 100644 --- a/packages/animations/browser/testing/package.json +++ b/packages/animations/browser/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../../typings/animations/testing.d.ts", + "typings": "../testing.d.ts", "main": "../../bundles/platform-browser-animations-testing.umd.js", "module": "../../@angular/platform-browser/animations/testing.es5.js", "es2015": "../../@angular/platform-browser/animations/testing.js" diff --git a/packages/animations/package.json b/packages/animations/package.json index c5eee8ab58..7f0dcebbdc 100644 --- a/packages/animations/package.json +++ b/packages/animations/package.json @@ -5,7 +5,7 @@ "main": "./bundles/animations.umd.js", "module": "./@angular/animations.es5.js", "es2015": "./@angular/animations.js", - "typings": "./typings/animations.d.ts", + "typings": "./animations.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/common/package.json b/packages/common/package.json index 448b0285db..70b2255e3a 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -5,7 +5,7 @@ "main": "./bundles/common.umd.js", "module": "./@angular/common.es5.js", "es2015": "./@angular/common.js", - "typings": "./typings/common.d.ts", + "typings": "./common.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/common/testing/package.json b/packages/common/testing/package.json index 5611599bf6..6f7afe11ae 100644 --- a/packages/common/testing/package.json +++ b/packages/common/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing/index.d.ts", + "typings": "../testing.d.ts", "main": "../bundles/common-testing.umd.js", "module": "../@angular/common/testing.es5.js", "es2015": "../@angular/common/testing.js" diff --git a/packages/compiler-cli/src/compiler_host.ts b/packages/compiler-cli/src/compiler_host.ts index 1d760b476a..904b53c818 100644 --- a/packages/compiler-cli/src/compiler_host.ts +++ b/packages/compiler-cli/src/compiler_host.ts @@ -208,7 +208,7 @@ export class CompilerHost implements AotCompilerHost { } try { let metadataOrMetadatas = JSON.parse(this.context.readFile(filePath)); - while (metadataOrMetadatas.alias) { + while (metadataOrMetadatas && metadataOrMetadatas.alias) { filePath = path.join(path.dirname(filePath), metadataOrMetadatas.alias); metadataOrMetadatas = JSON.parse(this.context.readFile(filePath)); } diff --git a/packages/compiler-cli/test/aot_host_spec.ts b/packages/compiler-cli/test/aot_host_spec.ts index e7611822f7..f88480ac97 100644 --- a/packages/compiler-cli/test/aot_host_spec.ts +++ b/packages/compiler-cli/test/aot_host_spec.ts @@ -244,9 +244,7 @@ const FILES: Entry = { 'alias': { 'file.d.ts': dummyModule, 'file.metadata.json': '{ "alias": "sub/index.metadata.json"}', - 'sub': { - 'index.metadata.json': JSON.stringify(dummyMetadata) - } + 'sub': {'index.metadata.json': JSON.stringify(dummyMetadata)} }, 'metadata_versions': { 'v1.d.ts': ` diff --git a/packages/compiler/package.json b/packages/compiler/package.json index 72e6de1a38..17f3d9dfab 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -5,7 +5,7 @@ "main": "./bundles/compiler.umd.js", "module": "./@angular/compiler.es5.js", "es2015": "./@angular/compiler.js", - "typings": "./typings/compiler.d.ts", + "typings": "./compiler.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/compiler/testing/package.json b/packages/compiler/testing/package.json index 46beb8e2f2..350c254bf8 100644 --- a/packages/compiler/testing/package.json +++ b/packages/compiler/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing/index.d.ts", + "typings": "../testing.d.ts", "main": "../bundles/compiler-testing.umd.js", "module": "../@angular/compiler/testing.es5.js", "es2015": "../@angular/compiler/testing.js" diff --git a/packages/core/package.json b/packages/core/package.json index b01e73f373..bc666fd794 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -5,7 +5,7 @@ "main": "./bundles/core.umd.js", "module": "./@angular/core.es5.js", "es2015": "./@angular/core.js", - "typings": "./typings/core.d.ts", + "typings": "./core.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/core/testing/package.json b/packages/core/testing/package.json index 2429a97862..9aba1cca48 100644 --- a/packages/core/testing/package.json +++ b/packages/core/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing/index.d.ts", + "typings": "../testing.d.ts", "main": "../bundles/core-testing.umd.js", "module": "../@angular/core/testing.es5.js", "es2015": "../@angular/core/testing.js" diff --git a/packages/forms/package.json b/packages/forms/package.json index 44b2c0c005..77944bb6c5 100644 --- a/packages/forms/package.json +++ b/packages/forms/package.json @@ -5,7 +5,7 @@ "main": "./bundles/forms.umd.js", "module": "./@angular/forms.es5.js", "es2015": "./@angular/forms.js", - "typings": "./typings/forms.d.ts", + "typings": "./forms.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/http/package.json b/packages/http/package.json index 9e19b9da83..9154aa8647 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -5,7 +5,7 @@ "main": "./bundles/http.umd.js", "module": "./@angular/http.es5.js", "es2015": "./@angular/http.js", - "typings": "./typings/http.d.ts", + "typings": "./http.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/http/testing/package.json b/packages/http/testing/package.json index b17d41a900..c754277dd7 100644 --- a/packages/http/testing/package.json +++ b/packages/http/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing/index.d.ts", + "typings": "../testing.d.ts", "main": "../bundles/http-testing.umd.js", "module": "../@angular/http/testing.es5.js", "es2015": "../@angular/http/testing.js" diff --git a/packages/language-service/package.json b/packages/language-service/package.json index 385f30f4b9..122710099f 100644 --- a/packages/language-service/package.json +++ b/packages/language-service/package.json @@ -4,7 +4,7 @@ "description": "Angular - language services", "main": "./bundles/language-service.umd.js", "module": "./@angular/language-service.es5.js", - "typings": "./typings/language-service.d.ts", + "typings": "./language-service.d.ts", "author": "angular", "license": "MIT", "repository": { diff --git a/packages/platform-browser-dynamic/package.json b/packages/platform-browser-dynamic/package.json index 29f5366f4f..1bf868775c 100644 --- a/packages/platform-browser-dynamic/package.json +++ b/packages/platform-browser-dynamic/package.json @@ -5,7 +5,7 @@ "main": "./bundles/platform-browser-dynamic.umd.js", "module": "./@angular/platform-browser-dynamic.es5.js", "es2015": "./@angular/platform-browser-dynamic.js", - "typings": "./typings/platform-browser-dynamic.d.ts", + "typings": "./platform-browser-dynamic.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/platform-browser-dynamic/testing/package.json b/packages/platform-browser-dynamic/testing/package.json index d831b9d4d1..9a473f9487 100644 --- a/packages/platform-browser-dynamic/testing/package.json +++ b/packages/platform-browser-dynamic/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing/index.d.ts", + "typings": "../testing.d.ts", "main": "../bundles/platform-browser-dynamic-testing.umd.js", "module": "../@angular/platform-browser-dynamic/testing.es5.js", "es2015": "../@angular/platform-browser-dynamic/testing.js" diff --git a/packages/platform-browser/animations/package.json b/packages/platform-browser/animations/package.json index f37f7a1b45..365617b67f 100644 --- a/packages/platform-browser/animations/package.json +++ b/packages/platform-browser/animations/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/animations/index.d.ts", + "typings": "../animations.d.ts", "main": "../bundles/platform-browser-animations.umd.js", "module": "../@angular/platform-browser/animations.es5.js", "es2015": "../@angular/platform-browser/animations.js" diff --git a/packages/platform-browser/package.json b/packages/platform-browser/package.json index 51cfc46a58..2317e379fc 100644 --- a/packages/platform-browser/package.json +++ b/packages/platform-browser/package.json @@ -5,7 +5,7 @@ "main": "./bundles/platform-browser.umd.js", "module": "./@angular/platform-browser.es5.js", "es2015": "./@angular/platform-browser.js", - "typings": "./typings/platform-browser.d.ts", + "typings": "./platform-browser.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/platform-browser/testing/package.json b/packages/platform-browser/testing/package.json index bf2ef8312d..f5f866aa77 100644 --- a/packages/platform-browser/testing/package.json +++ b/packages/platform-browser/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing/index.d.ts", + "typings": "../testing.d.ts", "main": "../bundles/platform-browser-testing.umd.js", "module": "../@angular/platform-browser/testing.es5.js", "es2015": "../@angular/platform-browser/testing.js" diff --git a/packages/platform-server/package.json b/packages/platform-server/package.json index 0e0fd87996..3b8d85e526 100644 --- a/packages/platform-server/package.json +++ b/packages/platform-server/package.json @@ -5,7 +5,7 @@ "main": "./bundles/platform-server.umd.js", "module": "./@angular/platform-server.es5.js", "es2015": "./@angular/platform-server.js", - "typings": "./typings/platform-server.d.ts", + "typings": "./platform-server.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/platform-server/testing/package.json b/packages/platform-server/testing/package.json index 987bfb91a4..0f14f7db9e 100644 --- a/packages/platform-server/testing/package.json +++ b/packages/platform-server/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing/index.d.ts", + "typings": "../testing.d.ts", "main": "../bundles/platform-server-testing.umd.js", "module": "../@angular/platform-server/testing.es5.js", "es2015": "../@angular/platform-server/testing.js" diff --git a/packages/platform-webworker-dynamic/package.json b/packages/platform-webworker-dynamic/package.json index 2b48517a48..1fb3788abd 100644 --- a/packages/platform-webworker-dynamic/package.json +++ b/packages/platform-webworker-dynamic/package.json @@ -5,7 +5,7 @@ "main": "./bundles/platform-webworker-dynamic.umd.js", "module": "./@angular/platform-webworker-dynamic.es5.js", "es2015": "./@angular/platform-webworker-dynamic.js", - "typings": "./typings/platform-webworker-dynamic.d.ts", + "typings": "./platform-webworker-dynamic.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/platform-webworker/package.json b/packages/platform-webworker/package.json index 70cd8593ea..d253b3a71c 100644 --- a/packages/platform-webworker/package.json +++ b/packages/platform-webworker/package.json @@ -5,7 +5,7 @@ "main": "./bundles/platform-webworker.umd.js", "module": "./@angular/platform-webworker.es5.js", "es2015": "./@angular/platform-webworker.js", - "typings": "./typings/platform-webworker.d.ts", + "typings": "./platform-webworker.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/router/package.json b/packages/router/package.json index 0ed18a5ce7..71c9caab37 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -5,7 +5,7 @@ "main": "./bundles/router.umd.js", "module": "./@angular/router.es5.js", "es2015": "./@angular/router.js", - "typings": "./typings/router.d.ts", + "typings": "./router.d.ts", "keywords": [ "angular", "router" diff --git a/packages/router/testing/package.json b/packages/router/testing/package.json index f4a9089bb3..6fca99822d 100644 --- a/packages/router/testing/package.json +++ b/packages/router/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing/index.d.ts", + "typings": "../testing.d.ts", "main": "../bundles/router-testing.umd.js", "module": "../@angular/router/testing.es5.js", "es2015": "../@angular/router/testing.js" diff --git a/packages/router/upgrade/package.json b/packages/router/upgrade/package.json index fd4ae6b0e5..71fca1a84b 100644 --- a/packages/router/upgrade/package.json +++ b/packages/router/upgrade/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/upgrade/index.d.ts", + "typings": "../upgrade.d.ts", "main": "../bundles/router-upgrade.umd.js", "module": "../@angular/router/upgrade.es5.js", "es2015": "../@angular/router/upgrade.js" diff --git a/packages/upgrade/package.json b/packages/upgrade/package.json index fe7229461c..e468c41e0d 100644 --- a/packages/upgrade/package.json +++ b/packages/upgrade/package.json @@ -5,7 +5,7 @@ "main": "./bundles/upgrade.umd.js", "module": "./@angular/upgrade.es5.js", "es2015": "./@angular/upgrade.js", - "typings": "./typings/upgrade.d.ts", + "typings": "./upgrade.d.ts", "author": "angular", "license": "MIT", "peerDependencies": { diff --git a/packages/upgrade/static/package.json b/packages/upgrade/static/package.json index 3e9a10e550..39434eb1dc 100644 --- a/packages/upgrade/static/package.json +++ b/packages/upgrade/static/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/static/index.d.ts", + "typings": "../static.d.ts", "main": "../bundles/upgrade-static.umd.js", "module": "../@angular/upgrade/static.es5.js", "es2015": "../@angular/upgrade/static.js" diff --git a/packages/upgrade/static/public_api.ts b/packages/upgrade/static/public_api.ts index 1ac3984a56..57b16cedc6 100644 --- a/packages/upgrade/static/public_api.ts +++ b/packages/upgrade/static/public_api.ts @@ -12,10 +12,10 @@ * Entry point for all public APIs of the upgrade/static package, allowing * Angular 1 and Angular 2+ to run side by side in the same application. */ -export {downgradeComponent} from '../src/common/downgrade_component'; -export {downgradeInjectable} from '../src/common/downgrade_injectable'; -export {VERSION} from '../src/common/version'; -export {UpgradeComponent} from '../src/static/upgrade_component'; -export {UpgradeModule} from '../src/static/upgrade_module'; +export {downgradeComponent} from './src/common/downgrade_component'; +export {downgradeInjectable} from './src/common/downgrade_injectable'; +export {VERSION} from './src/common/version'; +export {UpgradeComponent} from './src/static/upgrade_component'; +export {UpgradeModule} from './src/static/upgrade_module'; // This file only re-exports content of the `src` folder. Keep it that way. diff --git a/packages/upgrade/static/src b/packages/upgrade/static/src new file mode 120000 index 0000000000..5cd551cf26 --- /dev/null +++ b/packages/upgrade/static/src @@ -0,0 +1 @@ +../src \ No newline at end of file diff --git a/scripts/ci/_travis-fold.sh b/scripts/ci/_travis-fold.sh index 6ba6265bf7..b3dd69c725 100644 --- a/scripts/ci/_travis-fold.sh +++ b/scripts/ci/_travis-fold.sh @@ -20,9 +20,11 @@ function travisFoldStart() { local enterArrow="===> ${foldName} ==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>" # keep all messages consistently wide 80chars regardless of the foldName echo ${enterArrow:0:100} - # turn on verbose mode so that we have better visibility into what's going on - # http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html#table_02_01 - set -x + if [[ ${2:-} != "no-xtrace" ]]; then + # turn on verbose mode so that we have better visibility into what's going on + # http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html#table_02_01 + set -x + fi } function travisFoldEnd() { diff --git a/scripts/ci/offline_compiler_test.sh b/scripts/ci/offline_compiler_test.sh index db0a29daeb..51f942cf36 100755 --- a/scripts/ci/offline_compiler_test.sh +++ b/scripts/ci/offline_compiler_test.sh @@ -54,7 +54,8 @@ cp -v package.json $TMP ./node_modules/.bin/ng-xi18n -p tsconfig-xi18n.json --i18nFormat=xlf --locale=fr ./node_modules/.bin/ng-xi18n -p tsconfig-xi18n.json --i18nFormat=xmb --outFile=custom_file.xmb - node test/test_summaries.js + # Removed until #15219 is fixed + # node test/test_summaries.js node test/test_ngtools_api.js ./node_modules/.bin/jasmine init diff --git a/tools/gulp-tasks/public-api.js b/tools/gulp-tasks/public-api.js index be79b22c47..ade38d2f85 100644 --- a/tools/gulp-tasks/public-api.js +++ b/tools/gulp-tasks/public-api.js @@ -1,27 +1,24 @@ const entrypoints = [ - 'dist/packages-dist/core/typings/core.d.ts', 'dist/packages-dist/core/typings/testing/index.d.ts', - 'dist/packages-dist/common/typings/common.d.ts', - 'dist/packages-dist/common/typings/testing/index.d.ts', + 'dist/packages-dist/core/core.d.ts', 'dist/packages-dist/core/testing.d.ts', + 'dist/packages-dist/common/common.d.ts', 'dist/packages-dist/common/testing.d.ts', // The API surface of the compiler is currently unstable - all of the important APIs are exposed // via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead. //'dist/packages-dist/compiler/index.d.ts', //'dist/packages-dist/compiler/testing.d.ts', - 'dist/packages-dist/upgrade/typings/upgrade.d.ts', - 'dist/packages-dist/upgrade/typings/static/index.d.ts', - 'dist/packages-dist/platform-browser/typings/platform-browser.d.ts', - 'dist/packages-dist/platform-browser/typings/testing/index.d.ts', - 'dist/packages-dist/platform-browser-dynamic/typings/platform-browser-dynamic.d.ts', - 'dist/packages-dist/platform-browser-dynamic/typings/testing/index.d.ts', - 'dist/packages-dist/platform-webworker/typings/platform-webworker.d.ts', - 'dist/packages-dist/platform-webworker-dynamic/typings/platform-webworker-dynamic.d.ts', - 'dist/packages-dist/platform-server/typings/platform-server.d.ts', - 'dist/packages-dist/platform-server/typings/testing/index.d.ts', - 'dist/packages-dist/http/typings/http.d.ts', 'dist/packages-dist/http/typings/testing/index.d.ts', - 'dist/packages-dist/forms/typings/forms.d.ts', 'dist/packages-dist/router/typings/router.d.ts', - 'dist/packages-dist/animations/typings/animations.d.ts', - 'dist/packages-dist/animations/typings/browser/index.d.ts', - 'dist/packages-dist/animations/typings/browser/testing/index.d.ts', - 'dist/packages-dist/platform-browser/typings/animations/index.d.ts' + 'dist/packages-dist/upgrade/upgrade.d.ts', 'dist/packages-dist/upgrade/static.d.ts', + 'dist/packages-dist/platform-browser/platform-browser.d.ts', + 'dist/packages-dist/platform-browser/testing.d.ts', + 'dist/packages-dist/platform-browser-dynamic/platform-browser-dynamic.d.ts', + 'dist/packages-dist/platform-browser-dynamic/testing.d.ts', + 'dist/packages-dist/platform-webworker/platform-webworker.d.ts', + 'dist/packages-dist/platform-webworker-dynamic/platform-webworker-dynamic.d.ts', + 'dist/packages-dist/platform-server/platform-server.d.ts', + 'dist/packages-dist/platform-server/testing.d.ts', 'dist/packages-dist/http/http.d.ts', + 'dist/packages-dist/http/testing.d.ts', 'dist/packages-dist/forms/forms.d.ts', + 'dist/packages-dist/router/router.d.ts', 'dist/packages-dist/animations/animations.d.ts', + 'dist/packages-dist/animations/browser.d.ts', + 'dist/packages-dist/animations/browser/testing.d.ts', + 'dist/packages-dist/platform-browser/animations.d.ts' ]; const publicApiDir = 'tools/public_api_guard'; diff --git a/tools/public_api_guard/animations/typings/animations.d.ts b/tools/public_api_guard/animations/animations.d.ts similarity index 100% rename from tools/public_api_guard/animations/typings/animations.d.ts rename to tools/public_api_guard/animations/animations.d.ts diff --git a/tools/public_api_guard/animations/typings/browser/index.d.ts b/tools/public_api_guard/animations/browser.d.ts similarity index 100% rename from tools/public_api_guard/animations/typings/browser/index.d.ts rename to tools/public_api_guard/animations/browser.d.ts diff --git a/tools/public_api_guard/animations/typings/browser/testing/index.d.ts b/tools/public_api_guard/animations/browser/testing.d.ts similarity index 100% rename from tools/public_api_guard/animations/typings/browser/testing/index.d.ts rename to tools/public_api_guard/animations/browser/testing.d.ts diff --git a/tools/public_api_guard/common/typings/common.d.ts b/tools/public_api_guard/common/common.d.ts similarity index 100% rename from tools/public_api_guard/common/typings/common.d.ts rename to tools/public_api_guard/common/common.d.ts diff --git a/tools/public_api_guard/common/typings/testing/index.d.ts b/tools/public_api_guard/common/testing.d.ts similarity index 100% rename from tools/public_api_guard/common/typings/testing/index.d.ts rename to tools/public_api_guard/common/testing.d.ts diff --git a/tools/public_api_guard/compiler/typings/compiler.d.ts b/tools/public_api_guard/compiler/compiler.d.ts similarity index 100% rename from tools/public_api_guard/compiler/typings/compiler.d.ts rename to tools/public_api_guard/compiler/compiler.d.ts diff --git a/tools/public_api_guard/compiler/typings/testing/index.d.ts b/tools/public_api_guard/compiler/testing.d.ts similarity index 100% rename from tools/public_api_guard/compiler/typings/testing/index.d.ts rename to tools/public_api_guard/compiler/testing.d.ts diff --git a/tools/public_api_guard/core/typings/core.d.ts b/tools/public_api_guard/core/core.d.ts similarity index 100% rename from tools/public_api_guard/core/typings/core.d.ts rename to tools/public_api_guard/core/core.d.ts diff --git a/tools/public_api_guard/core/typings/testing/index.d.ts b/tools/public_api_guard/core/testing.d.ts similarity index 100% rename from tools/public_api_guard/core/typings/testing/index.d.ts rename to tools/public_api_guard/core/testing.d.ts diff --git a/tools/public_api_guard/forms/typings/forms.d.ts b/tools/public_api_guard/forms/forms.d.ts similarity index 100% rename from tools/public_api_guard/forms/typings/forms.d.ts rename to tools/public_api_guard/forms/forms.d.ts diff --git a/tools/public_api_guard/http/typings/http.d.ts b/tools/public_api_guard/http/http.d.ts similarity index 100% rename from tools/public_api_guard/http/typings/http.d.ts rename to tools/public_api_guard/http/http.d.ts diff --git a/tools/public_api_guard/http/typings/testing/index.d.ts b/tools/public_api_guard/http/testing.d.ts similarity index 100% rename from tools/public_api_guard/http/typings/testing/index.d.ts rename to tools/public_api_guard/http/testing.d.ts diff --git a/tools/public_api_guard/platform-browser-dynamic/typings/platform-browser-dynamic.d.ts b/tools/public_api_guard/platform-browser-dynamic/platform-browser-dynamic.d.ts similarity index 100% rename from tools/public_api_guard/platform-browser-dynamic/typings/platform-browser-dynamic.d.ts rename to tools/public_api_guard/platform-browser-dynamic/platform-browser-dynamic.d.ts diff --git a/tools/public_api_guard/platform-browser-dynamic/typings/testing/index.d.ts b/tools/public_api_guard/platform-browser-dynamic/testing.d.ts similarity index 100% rename from tools/public_api_guard/platform-browser-dynamic/typings/testing/index.d.ts rename to tools/public_api_guard/platform-browser-dynamic/testing.d.ts diff --git a/tools/public_api_guard/platform-browser/typings/animations/index.d.ts b/tools/public_api_guard/platform-browser/animations.d.ts similarity index 100% rename from tools/public_api_guard/platform-browser/typings/animations/index.d.ts rename to tools/public_api_guard/platform-browser/animations.d.ts diff --git a/tools/public_api_guard/platform-browser/typings/animations/testing/index.d.ts b/tools/public_api_guard/platform-browser/animations/testing.d.ts similarity index 100% rename from tools/public_api_guard/platform-browser/typings/animations/testing/index.d.ts rename to tools/public_api_guard/platform-browser/animations/testing.d.ts diff --git a/tools/public_api_guard/platform-browser/typings/platform-browser.d.ts b/tools/public_api_guard/platform-browser/platform-browser.d.ts similarity index 100% rename from tools/public_api_guard/platform-browser/typings/platform-browser.d.ts rename to tools/public_api_guard/platform-browser/platform-browser.d.ts diff --git a/tools/public_api_guard/platform-browser/typings/testing/index.d.ts b/tools/public_api_guard/platform-browser/testing.d.ts similarity index 100% rename from tools/public_api_guard/platform-browser/typings/testing/index.d.ts rename to tools/public_api_guard/platform-browser/testing.d.ts diff --git a/tools/public_api_guard/platform-server/typings/platform-server.d.ts b/tools/public_api_guard/platform-server/platform-server.d.ts similarity index 100% rename from tools/public_api_guard/platform-server/typings/platform-server.d.ts rename to tools/public_api_guard/platform-server/platform-server.d.ts diff --git a/tools/public_api_guard/platform-server/typings/testing/index.d.ts b/tools/public_api_guard/platform-server/testing.d.ts similarity index 100% rename from tools/public_api_guard/platform-server/typings/testing/index.d.ts rename to tools/public_api_guard/platform-server/testing.d.ts diff --git a/tools/public_api_guard/platform-webworker-dynamic/typings/platform-webworker-dynamic.d.ts b/tools/public_api_guard/platform-webworker-dynamic/platform-webworker-dynamic.d.ts similarity index 100% rename from tools/public_api_guard/platform-webworker-dynamic/typings/platform-webworker-dynamic.d.ts rename to tools/public_api_guard/platform-webworker-dynamic/platform-webworker-dynamic.d.ts diff --git a/tools/public_api_guard/platform-webworker/typings/platform-webworker.d.ts b/tools/public_api_guard/platform-webworker/platform-webworker.d.ts similarity index 100% rename from tools/public_api_guard/platform-webworker/typings/platform-webworker.d.ts rename to tools/public_api_guard/platform-webworker/platform-webworker.d.ts diff --git a/tools/public_api_guard/router/typings/router.d.ts b/tools/public_api_guard/router/router.d.ts similarity index 100% rename from tools/public_api_guard/router/typings/router.d.ts rename to tools/public_api_guard/router/router.d.ts diff --git a/tools/public_api_guard/upgrade/typings/static/index.d.ts b/tools/public_api_guard/upgrade/static.d.ts similarity index 100% rename from tools/public_api_guard/upgrade/typings/static/index.d.ts rename to tools/public_api_guard/upgrade/static.d.ts diff --git a/tools/public_api_guard/upgrade/typings/upgrade.d.ts b/tools/public_api_guard/upgrade/upgrade.d.ts similarity index 100% rename from tools/public_api_guard/upgrade/typings/upgrade.d.ts rename to tools/public_api_guard/upgrade/upgrade.d.ts