build: resolve review comments on flat modules PR and fix more bugs (#14660)
This commit is contained in:
parent
4b54c0e23f
commit
c53621be8e
4
.babelrc
4
.babelrc
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": ["transform-es2015-modules-umd"],
|
|
||||||
"presets": ["es2015"]
|
|
||||||
}
|
|
95
build.sh
95
build.sh
@ -54,33 +54,24 @@ for ARG in "$@"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
getPackageContents() {
|
getPackageContents() {
|
||||||
echo "{\"typings\": \"../typings/${2}/${2}.d.ts\", \"main\": \"../bundles/${1}-${2}.umd.js\", \"module\": \"../@angular/${1}/${2}.es5.js\", \"es2015\": \"../@angular/${1}/${2}.js\"}"
|
echo "{\"typings\": \"../typings/${2}/${3:-$2}.d.ts\", \"main\": \"../bundles/${1}-${2}.umd.js\", \"module\": \"../@angular/${1}/${2}.es5.js\", \"es2015\": \"../@angular/${1}/${2}.js\"}"
|
||||||
}
|
}
|
||||||
|
|
||||||
containsElement () {
|
#######################################
|
||||||
local e
|
# Downlevel ES2015 to ESM/ES5
|
||||||
for e in "${@:2}"; do
|
# Arguments:
|
||||||
[[ "$e" == "$1" ]] && return 0;
|
# param1 - Destination folder
|
||||||
done
|
# param2 - Input path
|
||||||
return 1
|
# param3 - Output path
|
||||||
|
# Returns:
|
||||||
|
# None
|
||||||
|
#######################################
|
||||||
|
downlevelES2015() {
|
||||||
|
echo '{"presets": [ ["es2015", { "modules": false }] ], "compact": true }' > ${1}/.babelrc
|
||||||
|
$BABELJS ${2} -o ${3}
|
||||||
|
rm -f ${1}/.babelrc
|
||||||
}
|
}
|
||||||
|
|
||||||
NON_MODULE=(
|
|
||||||
platform-browser
|
|
||||||
)
|
|
||||||
|
|
||||||
moveTypings() {
|
|
||||||
# $1 == Source copy root (/src or /testing)
|
|
||||||
# $2 == Final destination directory
|
|
||||||
rsync -a --exclude=*.js* ${1} ${2}
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanTypings() {
|
|
||||||
# $1 == Source root (where index.d.ts file is, for instance)
|
|
||||||
# $2 == Source copy root (/src or /typings)
|
|
||||||
rm -f ${1}/index.*
|
|
||||||
rm -rf ${2}
|
|
||||||
}
|
|
||||||
VERSION="${VERSION_PREFIX}${VERSION_SUFFIX}"
|
VERSION="${VERSION_PREFIX}${VERSION_SUFFIX}"
|
||||||
ROUTER_VERSION="${ROUTER_VERSION_PREFIX}${VERSION_SUFFIX}"
|
ROUTER_VERSION="${ROUTER_VERSION_PREFIX}${VERSION_SUFFIX}"
|
||||||
echo "====== BUILDING: Version ${VERSION} (Router ${ROUTER_VERSION})"
|
echo "====== BUILDING: Version ${VERSION} (Router ${ROUTER_VERSION})"
|
||||||
@ -152,7 +143,7 @@ do
|
|||||||
DEST_MODULE=${DESTDIR}/@angular
|
DEST_MODULE=${DESTDIR}/@angular
|
||||||
DEST_BUNDLES=${DESTDIR}/bundles
|
DEST_BUNDLES=${DESTDIR}/bundles
|
||||||
|
|
||||||
# ESM/ES6
|
# ESM/2015
|
||||||
JS_PATH=${DEST_MODULE}/${PACKAGE}.js
|
JS_PATH=${DEST_MODULE}/${PACKAGE}.js
|
||||||
JS_PATH_ES5=${DEST_MODULE}/${PACKAGE}.es5.js
|
JS_PATH_ES5=${DEST_MODULE}/${PACKAGE}.es5.js
|
||||||
JS_TESTING_PATH=${DEST_MODULE}/${PACKAGE}/testing.js
|
JS_TESTING_PATH=${DEST_MODULE}/${PACKAGE}/testing.js
|
||||||
@ -187,11 +178,15 @@ do
|
|||||||
|
|
||||||
rm -rf ${DESTDIR}
|
rm -rf ${DESTDIR}
|
||||||
|
|
||||||
echo "====== [${PACKAGE}]: COMPILING: ${TSC} --skipImportRename -p ${SRCDIR}/tsconfig-build.json"
|
# When .babelrc file exists, the dist package will have ES2015 sources, ESM/ES5, and UMD bundles. Because of a bug
|
||||||
|
# preventing the @angular/compiler package from running through this pipeline, we have to manually check for the Compiler
|
||||||
|
# package as well. The tsconfig-build.json defaults to building to the root of the package dist dir, but when
|
||||||
|
# outputting ES2015 then bundling from there, built files should go to the DEST_MODULE folder.
|
||||||
|
echo "====== [${PACKAGE}]: COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-build.json"
|
||||||
if [[ -e ${SRCDIR}/.babelrc || ${PACKAGE} == "compiler" ]]; then
|
if [[ -e ${SRCDIR}/.babelrc || ${PACKAGE} == "compiler" ]]; then
|
||||||
$TSC --skipImportRename -p ${SRCDIR}/tsconfig-build.json -outDir ${DEST_MODULE}
|
$TSC -p ${SRCDIR}/tsconfig-build.json -outDir ${DEST_MODULE}
|
||||||
else
|
else
|
||||||
$TSC --skipImportRename -p ${SRCDIR}/tsconfig-build.json
|
$TSC -p ${SRCDIR}/tsconfig-build.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "====== Move ${PACKAGE} typings"
|
echo "====== Move ${PACKAGE} typings"
|
||||||
@ -264,55 +259,54 @@ do
|
|||||||
mv ${JS_PATH}.tmp ${JS_PATH}
|
mv ${JS_PATH}.tmp ${JS_PATH}
|
||||||
|
|
||||||
if ! [[ ${PACKAGE} == 'benchpress' ]]; then
|
if ! [[ ${PACKAGE} == 'benchpress' ]]; then
|
||||||
cleanTypings ${DEST_MODULE} ${DEST_MODULE}/src
|
rm -f ${DEST_MODULE}/index.*
|
||||||
|
rm -rf ${DEST_MODULE}/src
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -e ${DESTDIR}/.babelrc ]]; then
|
if [[ -e ${DESTDIR}/.babelrc ]]; then
|
||||||
|
|
||||||
echo "====== Downleveling ${PACKAGE} to ES5/UMD"
|
echo "====== Downleveling ES2015 to UMD/ES5"
|
||||||
$BABELJS ${JS_PATH} -o ${UMD_ES5_PATH}
|
$BABELJS ${JS_PATH} -o ${UMD_ES5_PATH}
|
||||||
|
|
||||||
### Minification ###
|
### Minification ###
|
||||||
echo "====== Minifying JavaScript"
|
echo "====== Minifying ES2015"
|
||||||
$BABILI ${JS_PATH} -o ${UMD_ES5_MIN_PATH}
|
$BABILI ${JS_PATH} -o ${UMD_ES5_MIN_PATH}
|
||||||
echo "====== Downleveling min JavaScript to ES5/UMD"
|
echo "====== Downleveling minified ES2015 to UMD/ES5"
|
||||||
$BABELJS ${UMD_ES5_MIN_PATH} -o ${UMD_ES5_MIN_PATH}
|
$BABELJS ${UMD_ES5_MIN_PATH} -o ${UMD_ES5_MIN_PATH}
|
||||||
|
|
||||||
echo "====== Minifying ${PACKAGE}"
|
echo "====== Minifying UMD/ES5"
|
||||||
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_MIN_PATH}
|
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_MIN_PATH}
|
||||||
### END Minification ###
|
### END Minification ###
|
||||||
else
|
else
|
||||||
# For packages not running through babel, use the es5/umd config
|
# For packages not running through babel, use the UMD/ES5 config
|
||||||
echo "====== Rollup ${PACKAGE} index to UMD"
|
echo "====== Rollup ${PACKAGE} index to UMD/ES5"
|
||||||
../../../node_modules/.bin/rollup -c rollup-umd.config.js
|
../../../node_modules/.bin/rollup -c rollup-umd.config.js
|
||||||
[[ -d ${DESTDIR}/es5 ]] && rm -rf ${DESTDIR}/es5
|
[[ -d ${DESTDIR}/es5 ]] && rm -rf ${DESTDIR}/es5
|
||||||
echo "====== Minifying UMD ${PACKAGE}"
|
echo "====== Minifying UMD/ES5"
|
||||||
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_PATH}
|
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_PATH}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f ${DISTDIR}/.babelrc
|
rm -f ${DISTDIR}/.babelrc
|
||||||
cp ${ROOTDIR}/.babelrc ${DEST_MODULE}/.babelrc
|
echo "====== Downleveling ES2015 to ESM/ES5"
|
||||||
$BABELJS ${JS_PATH} -o ${JS_PATH_ES5}
|
downlevelES2015 ${DEST_MODULE} ${JS_PATH} ${JS_PATH_ES5}
|
||||||
|
|
||||||
if [[ -d testing ]]; then
|
if [[ -d testing ]]; then
|
||||||
echo "====== Rollup ${PACKAGE} testing"
|
echo "====== Rollup ${PACKAGE} testing"
|
||||||
../../../node_modules/.bin/rollup -i ${DESTDIR}/testing/index.js -o ${DESTDIR}/testing.tmp.js
|
../../../node_modules/.bin/rollup -i ${DESTDIR}/testing/index.js -o ${DESTDIR}/testing.tmp.js
|
||||||
|
|
||||||
echo "====== Downleveling ${PACKAGE} TESTING to ES5/UMD"
|
echo "====== Downleveling ${PACKAGE} TESTING to UMD/ES5"
|
||||||
[[ -e ${SRCDIR}/.babelrc-testing ]] && cp ${SRCDIR}/.babelrc-testing ${DESTDIR}/.babelrc
|
[[ -e ${SRCDIR}/.babelrc-testing ]] && cp ${SRCDIR}/.babelrc-testing ${DESTDIR}/.babelrc
|
||||||
$BABELJS ${DESTDIR}/testing.tmp.js -o ${UMD_TESTING_ES5_PATH}
|
$BABELJS ${DESTDIR}/testing.tmp.js -o ${UMD_TESTING_ES5_PATH}
|
||||||
rm -f ${DESTDIR}/.babelrc
|
rm -f ${DESTDIR}/.babelrc
|
||||||
|
|
||||||
echo "====== Move ${PACKAGE} testing typings"
|
echo "====== Move ${PACKAGE} testing typings"
|
||||||
rsync -a --exclude=*.js --exclude=*.js.map ${DESTDIR}/testing/ ${DESTDIR}/typings/testing
|
rsync -a --exclude=*.js --exclude=*.js.map ${DESTDIR}/testing/ ${DESTDIR}/typings/testing
|
||||||
mv ${DESTDIR}/typings/testing/index.d.ts ${DESTDIR}/typings/testing/testing.d.ts
|
|
||||||
mv ${DESTDIR}/typings/testing/index.metadata.json ${DESTDIR}/typings/testing/testing.metadata.json
|
|
||||||
|
|
||||||
rm -rf ${DESTDIR}/testing
|
rm -rf ${DESTDIR}/testing
|
||||||
|
|
||||||
mkdir ${DESTDIR}/testing && [[ -d ${DEST_MODULE}/${PACKAGE} ]] || mkdir ${DEST_MODULE}/${PACKAGE}
|
mkdir ${DESTDIR}/testing && [[ -d ${DEST_MODULE}/${PACKAGE} ]] || mkdir ${DEST_MODULE}/${PACKAGE}
|
||||||
|
|
||||||
getPackageContents "${PACKAGE}" "testing" > ${DESTDIR}/testing/package.json
|
getPackageContents "${PACKAGE}" "testing" "index" > ${DESTDIR}/testing/package.json
|
||||||
|
|
||||||
mv ${DESTDIR}/testing.tmp.js ${JS_TESTING_PATH}
|
mv ${DESTDIR}/testing.tmp.js ${JS_TESTING_PATH}
|
||||||
$BABELJS ${JS_TESTING_PATH} -o ${JS_TESTING_PATH_ES5}
|
$BABELJS ${JS_TESTING_PATH} -o ${JS_TESTING_PATH_ES5}
|
||||||
@ -326,7 +320,7 @@ do
|
|||||||
rm -f ${DEST_MODULE}/static.*
|
rm -f ${DEST_MODULE}/static.*
|
||||||
../../../node_modules/.bin/rollup -i ${DESTDIR}/static/static.js -o ${DESTDIR}/static.tmp.js
|
../../../node_modules/.bin/rollup -i ${DESTDIR}/static/static.js -o ${DESTDIR}/static.tmp.js
|
||||||
|
|
||||||
echo "====== Downleveling ${PACKAGE} STATIC to ES5/UMD"
|
echo "====== Downleveling ${PACKAGE} STATIC to UMD/ES5"
|
||||||
[[ -e ${SRCDIR}/.babelrc-static ]] && cp ${SRCDIR}/.babelrc-static ${DESTDIR}/.babelrc
|
[[ -e ${SRCDIR}/.babelrc-static ]] && cp ${SRCDIR}/.babelrc-static ${DESTDIR}/.babelrc
|
||||||
$BABELJS ${DESTDIR}/static.tmp.js -o ${UMD_STATIC_ES5_PATH}
|
$BABELJS ${DESTDIR}/static.tmp.js -o ${UMD_STATIC_ES5_PATH}
|
||||||
rm -f ${DESTDIR}/.babelrc
|
rm -f ${DESTDIR}/.babelrc
|
||||||
@ -353,7 +347,7 @@ do
|
|||||||
rm -f ${DEST_MODULE}/upgrade.*
|
rm -f ${DEST_MODULE}/upgrade.*
|
||||||
../../../node_modules/.bin/rollup -i ${DESTDIR}/upgrade/upgrade.js -o ${DESTDIR}/upgrade.tmp.js
|
../../../node_modules/.bin/rollup -i ${DESTDIR}/upgrade/upgrade.js -o ${DESTDIR}/upgrade.tmp.js
|
||||||
|
|
||||||
echo "====== Downleveling ${PACKAGE} UPGRADE to ES5/UMD"
|
echo "====== Downleveling ${PACKAGE} UPGRADE to UMD/ES5"
|
||||||
[[ -e ${SRCDIR}/.babelrc-upgrade ]] && cp ${SRCDIR}/.babelrc-upgrade ${DESTDIR}/.babelrc
|
[[ -e ${SRCDIR}/.babelrc-upgrade ]] && cp ${SRCDIR}/.babelrc-upgrade ${DESTDIR}/.babelrc
|
||||||
$BABELJS ${DESTDIR}/upgrade.tmp.js -o ${UMD_UPGRADE_ES5_PATH}
|
$BABELJS ${DESTDIR}/upgrade.tmp.js -o ${UMD_UPGRADE_ES5_PATH}
|
||||||
rm -f ${DESTDIR}/.babelrc
|
rm -f ${DESTDIR}/.babelrc
|
||||||
@ -399,8 +393,6 @@ do
|
|||||||
|
|
||||||
echo "====== Move ${PACKAGE} animations testing typings"
|
echo "====== Move ${PACKAGE} animations testing typings"
|
||||||
rsync -a --exclude=*.js --exclude=*.js.map ${DESTDIR}/animations/testing/ ${DESTDIR}/typings/animations/testing
|
rsync -a --exclude=*.js --exclude=*.js.map ${DESTDIR}/animations/testing/ ${DESTDIR}/typings/animations/testing
|
||||||
mv ${DESTDIR}/typings/animations/testing/index.d.ts ${DESTDIR}/typings/animations/testing/testing.d.ts
|
|
||||||
mv ${DESTDIR}/typings/animations/testing/index.metadata.json ${DESTDIR}/typings/animations/testing/testing.metadata.json
|
|
||||||
|
|
||||||
rm -rf ${DESTDIR}/animations
|
rm -rf ${DESTDIR}/animations
|
||||||
|
|
||||||
@ -409,7 +401,7 @@ do
|
|||||||
|
|
||||||
getPackageContents "${PACKAGE}" "animations" > ${DESTDIR}/animations/package.json
|
getPackageContents "${PACKAGE}" "animations" > ${DESTDIR}/animations/package.json
|
||||||
|
|
||||||
echo '{"typings": "../../typings/animations/testing/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"}' > ${DESTDIR}/animations/testing/package.json
|
echo '{"typings": "../../typings/animations/testing/index.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"}' > ${DESTDIR}/animations/testing/package.json
|
||||||
|
|
||||||
mv ${DESTDIR}/animations.tmp.js ${JS_ANIMATIONS_PATH}
|
mv ${DESTDIR}/animations.tmp.js ${JS_ANIMATIONS_PATH}
|
||||||
$BABELJS ${JS_ANIMATIONS_PATH} -o ${JS_ANIMATIONS_PATH_ES5}
|
$BABELJS ${JS_ANIMATIONS_PATH} -o ${JS_ANIMATIONS_PATH_ES5}
|
||||||
@ -426,17 +418,18 @@ do
|
|||||||
cat ${UMD_ANIMATIONS_TESTING_ES5_PATH} >> ${UMD_ANIMATIONS_TESTING_ES5_PATH}.tmp
|
cat ${UMD_ANIMATIONS_TESTING_ES5_PATH} >> ${UMD_ANIMATIONS_TESTING_ES5_PATH}.tmp
|
||||||
mv ${UMD_ANIMATIONS_TESTING_ES5_PATH}.tmp ${UMD_ANIMATIONS_TESTING_ES5_PATH}
|
mv ${UMD_ANIMATIONS_TESTING_ES5_PATH}.tmp ${UMD_ANIMATIONS_TESTING_ES5_PATH}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for FILE in ${DEST_MODULE}/public_api*; do
|
||||||
|
rm -f ${FILE}
|
||||||
|
done
|
||||||
|
|
||||||
) 2>&1 | grep -v "as external dependency"
|
) 2>&1 | grep -v "as external dependency"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
echo "====== VERSION: Updating version references"
|
echo "====== VERSION: Updating version references"
|
||||||
if [[ -e ${SRCDIR}/.babelrc ]]; then
|
cd ${DESTDIR}
|
||||||
cd ${DEST_MODULE}
|
|
||||||
else
|
|
||||||
cd ${DESTDIR}
|
|
||||||
fi
|
|
||||||
echo "====== EXECUTE: perl -p -i -e \"s/0\.0\.0\-PLACEHOLDER/${VERSION}/g\" $""(grep -ril 0\.0\.0\-PLACEHOLDER .)"
|
echo "====== EXECUTE: perl -p -i -e \"s/0\.0\.0\-PLACEHOLDER/${VERSION}/g\" $""(grep -ril 0\.0\.0\-PLACEHOLDER .)"
|
||||||
perl -p -i -e "s/0\.0\.0\-PLACEHOLDER/${VERSION}/g" $(grep -ril 0\.0\.0\-PLACEHOLDER .) < /dev/null 2> /dev/null
|
perl -p -i -e "s/0\.0\.0\-PLACEHOLDER/${VERSION}/g" $(grep -ril 0\.0\.0\-PLACEHOLDER .) < /dev/null 2> /dev/null
|
||||||
echo "====== EXECUTE: perl -p -i -e \"s/0\.0\.0\-ROUTERPLACEHOLDER/${ROUTER_VERSION}/g\" $""(grep -ril 0\.0\.0\-ROUTERPLACEHOLDER .)"
|
echo "====== EXECUTE: perl -p -i -e \"s/0\.0\.0\-ROUTERPLACEHOLDER/${ROUTER_VERSION}/g\" $""(grep -ril 0\.0\.0\-ROUTERPLACEHOLDER .)"
|
||||||
|
@ -43,7 +43,7 @@ See the `package.json` of the test(s) you're debugging, to see which dist/ folde
|
|||||||
Then run the right `tsc --watch` command to keep those dist folders up-to-date, for example:
|
Then run the right `tsc --watch` command to keep those dist folders up-to-date, for example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ ./node_modules/.bin/tsc -p modules/@angular/core/tsconfig-build.json --outDir dist/packages-dist/core --watch
|
$ ./node_modules/.bin/tsc -p modules/@angular/core/tsconfig-build.json --watch
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can run the integration test, it will re-install from the dist/ folder on each run.
|
Now you can run the integration test, it will re-install from the dist/ folder on each run.
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
["es2015", { "modules": false }]
|
|
||||||
]
|
|
||||||
}
|
|
@ -10,5 +10,5 @@
|
|||||||
},
|
},
|
||||||
"exactGlobals": true
|
"exactGlobals": true
|
||||||
}]],
|
}]],
|
||||||
"moduleId": "@angular/animation"
|
"moduleId": "@angular/animations"
|
||||||
}
|
}
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
{
|
|
||||||
"presets": ["es2015"],
|
|
||||||
"plugins": [["transform-es2015-modules-umd", {
|
|
||||||
"globals": {
|
|
||||||
"@angular/core": "ng.core",
|
|
||||||
"@angular/animations": "ng.animations",
|
|
||||||
"rxjs/Observable": "Rx",
|
|
||||||
"rxjs/Subject": "Rx"
|
|
||||||
},
|
|
||||||
"exactGlobals": true
|
|
||||||
}]],
|
|
||||||
"moduleId": "@angular/animation/testing"
|
|
||||||
}
|
|
@ -18,7 +18,6 @@
|
|||||||
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
|
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
|
||||||
"types": []
|
"types": []
|
||||||
},
|
},
|
||||||
"exclude": ["integrationtest"],
|
|
||||||
"files": [
|
"files": [
|
||||||
"index.ts",
|
"index.ts",
|
||||||
"../../../node_modules/@types/node/index.d.ts",
|
"../../../node_modules/@types/node/index.d.ts",
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"extends": "./tsconfig-build",
|
"extends": "./tsconfig-build",
|
||||||
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../../dist/packages-dist/common",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core/"],
|
"@angular/core": ["../../../dist/packages-dist/core/"],
|
||||||
"@angular/common": ["../../../dist/packages-dist/common"]
|
"@angular/common": ["../../../dist/packages-dist/common"]
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
// Test that we rely on decorator downleveling
|
// Test that we rely on decorator downleveling
|
||||||
"emitDecoratorMetadata": false,
|
"emitDecoratorMetadata": false,
|
||||||
"outDir": "../../../dist/packages-dist/compiler",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
},
|
},
|
||||||
"exactGlobals": true
|
"exactGlobals": true
|
||||||
}]],
|
}]],
|
||||||
"moduleId": "@angular/core"
|
"moduleId": "@angular/core",
|
||||||
|
"compact": false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,4 +9,4 @@
|
|||||||
"exactGlobals": true
|
"exactGlobals": true
|
||||||
}]],
|
}]],
|
||||||
"moduleId": "@angular/core/testing"
|
"moduleId": "@angular/core/testing"
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"extends": "./tsconfig-build",
|
"extends": "./tsconfig-build",
|
||||||
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../../dist/packages-dist/core",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"rxjs/*": ["../../../node_modules/rxjs/*"],
|
"rxjs/*": ["../../../node_modules/rxjs/*"],
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"]
|
"@angular/core": ["../../../dist/packages-dist/core"]
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"presets": ["es2015"],
|
"presets": ["es2015"],
|
||||||
"plugins": [["transform-es2015-modules-umd", {
|
"plugins": [["transform-es2015-modules-umd", {
|
||||||
"globals": {
|
"globals": {
|
||||||
"@angular/core": "ng.core",
|
"@angular/core": "ng.core",
|
||||||
"@angular/compiler": "ng.compiler",
|
|
||||||
"@angular/platform-browser": "ng.platformBrowser",
|
"@angular/platform-browser": "ng.platformBrowser",
|
||||||
"@angular/http": "ng.http",
|
"@angular/http": "ng.http",
|
||||||
"rxjs/Observable": "Rx",
|
"rxjs/Observable": "Rx",
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"presets": ["es2015"],
|
"presets": ["es2015"],
|
||||||
"plugins": [["transform-es2015-modules-umd", {
|
"plugins": [["transform-es2015-modules-umd", {
|
||||||
"globals": {
|
"globals": {
|
||||||
"@angular/core": "ng.core",
|
"@angular/core": "ng.core",
|
||||||
"@angular/compiler": "ng.compiler",
|
|
||||||
"@angular/platform-browser": "ng.platformBrowser",
|
"@angular/platform-browser": "ng.platformBrowser",
|
||||||
"@angular/http": "ng.http",
|
"@angular/http": "ng.http",
|
||||||
"@angular/http/testing": "ng.http.testing",
|
"@angular/http/testing": "ng.http.testing",
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig-build",
|
"extends": "./tsconfig-build",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../../dist/packages-dist/http",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/http": ["../../../dist/packages-dist/http"],
|
"@angular/http": ["../../../dist/packages-dist/http"],
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig-build",
|
"extends": "./tsconfig-build",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../../dist/packages-dist/platform-browser-dynamic",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig-build",
|
"extends": "./tsconfig-build",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../../dist/packages-dist/platform-browser",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig-build",
|
"extends": "./tsconfig-build",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../../dist/packages-dist/platform-server",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig-build",
|
"extends": "./tsconfig-build",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../../dist/packages-dist/router",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig-build",
|
"extends": "./tsconfig-build",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
@ -16,9 +16,6 @@ PKGS=(
|
|||||||
jasmine@2.4.1
|
jasmine@2.4.1
|
||||||
webpack@2.1.0-beta.21
|
webpack@2.1.0-beta.21
|
||||||
@angular2-material/{core,button}@2.0.0-alpha.8-1
|
@angular2-material/{core,button}@2.0.0-alpha.8-1
|
||||||
babel-core@6.23.1
|
|
||||||
babel-loader@6.3.0
|
|
||||||
babel-preset-es2015@6.22.0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
TMPDIR=${TMPDIR:-.}
|
TMPDIR=${TMPDIR:-.}
|
||||||
|
@ -30,7 +30,7 @@ export type CodegenExtension =
|
|||||||
|
|
||||||
export function main(
|
export function main(
|
||||||
project: string | VinylFile, cliOptions: CliOptions, codegen?: CodegenExtension,
|
project: string | VinylFile, cliOptions: CliOptions, codegen?: CodegenExtension,
|
||||||
options?: ts.CompilerOptions, skipImportRename?: boolean): Promise<any> {
|
options?: ts.CompilerOptions): Promise<any> {
|
||||||
try {
|
try {
|
||||||
let projectDir = project;
|
let projectDir = project;
|
||||||
// project is vinyl like file object
|
// project is vinyl like file object
|
||||||
@ -117,7 +117,7 @@ export function main(
|
|||||||
const tsickleCompilerHostOptions: tsickle.Options = {
|
const tsickleCompilerHostOptions: tsickle.Options = {
|
||||||
googmodule: false,
|
googmodule: false,
|
||||||
untyped: true,
|
untyped: true,
|
||||||
convertIndexImportShorthand: !skipImportRename &&
|
convertIndexImportShorthand:
|
||||||
ngOptions.target === ts.ScriptTarget.ES2015, // This covers ES6 too
|
ngOptions.target === ts.ScriptTarget.ES2015, // This covers ES6 too
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -172,19 +172,13 @@ export function main(
|
|||||||
|
|
||||||
// CLI entry point
|
// CLI entry point
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
let args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
let idx = args.indexOf('--skipImportRename');
|
|
||||||
let skipImportRename = false;
|
|
||||||
if (idx !== -1) {
|
|
||||||
args.splice(idx, 1);
|
|
||||||
skipImportRename = true;
|
|
||||||
}
|
|
||||||
let {options, fileNames, errors} = (ts as any).parseCommandLine(args);
|
let {options, fileNames, errors} = (ts as any).parseCommandLine(args);
|
||||||
check(errors);
|
check(errors);
|
||||||
const project = options.project || '.';
|
const project = options.project || '.';
|
||||||
// TODO(alexeagle): command line should be TSC-compatible, remove "CliOptions" here
|
// TODO(alexeagle): command line should be TSC-compatible, remove "CliOptions" here
|
||||||
const cliOptions = new CliOptions(require('minimist')(args));
|
const cliOptions = new CliOptions(require('minimist')(args));
|
||||||
main(project, cliOptions, null, options, skipImportRename)
|
main(project, cliOptions, null, options)
|
||||||
.then((exitCode: any) => process.exit(exitCode))
|
.then((exitCode: any) => process.exit(exitCode))
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
console.error(e.stack);
|
console.error(e.stack);
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
const entrypoints = [
|
const entrypoints = [
|
||||||
'dist/packages-dist/core/typings/core.d.ts',
|
'dist/packages-dist/core/typings/core.d.ts', 'dist/packages-dist/core/typings/testing/index.d.ts',
|
||||||
'dist/packages-dist/core/typings/testing/testing.d.ts',
|
|
||||||
'dist/packages-dist/common/typings/common.d.ts',
|
'dist/packages-dist/common/typings/common.d.ts',
|
||||||
'dist/packages-dist/common/typings/testing/testing.d.ts',
|
'dist/packages-dist/common/typings/testing/index.d.ts',
|
||||||
// The API surface of the compiler is currently unstable - all of the important APIs are exposed
|
// 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.
|
// via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead.
|
||||||
//'dist/packages-dist/compiler/index.d.ts',
|
//'dist/packages-dist/compiler/index.d.ts',
|
||||||
@ -10,19 +9,18 @@ const entrypoints = [
|
|||||||
'dist/packages-dist/upgrade/typings/upgrade.d.ts',
|
'dist/packages-dist/upgrade/typings/upgrade.d.ts',
|
||||||
'dist/packages-dist/upgrade/typings/static/static.d.ts',
|
'dist/packages-dist/upgrade/typings/static/static.d.ts',
|
||||||
'dist/packages-dist/platform-browser/typings/platform-browser.d.ts',
|
'dist/packages-dist/platform-browser/typings/platform-browser.d.ts',
|
||||||
'dist/packages-dist/platform-browser/typings/testing/testing.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/platform-browser-dynamic.d.ts',
|
||||||
'dist/packages-dist/platform-browser-dynamic/typings/testing/testing.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/typings/platform-webworker.d.ts',
|
||||||
'dist/packages-dist/platform-webworker-dynamic/typings/platform-webworker-dynamic.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/platform-server.d.ts',
|
||||||
'dist/packages-dist/platform-server/typings/testing/testing.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/http.d.ts', 'dist/packages-dist/http/typings/testing/index.d.ts',
|
||||||
'dist/packages-dist/http/typings/testing/testing.d.ts',
|
|
||||||
'dist/packages-dist/forms/typings/forms.d.ts', 'dist/packages-dist/router/typings/router.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/animations.d.ts',
|
||||||
'dist/packages-dist/platform-browser/typings/animations/animations.d.ts',
|
'dist/packages-dist/platform-browser/typings/animations/animations.d.ts',
|
||||||
'dist/packages-dist/platform-browser/typings/animations/testing/testing.d.ts'
|
'dist/packages-dist/platform-browser/typings/animations/testing/index.d.ts'
|
||||||
];
|
];
|
||||||
|
|
||||||
const publicApiDir = 'tools/public_api_guard';
|
const publicApiDir = 'tools/public_api_guard';
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
/** @experimental */
|
|
||||||
export declare function animate(timings: string | number, styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata): AnimationAnimateMetadata;
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare class Animation {
|
|
||||||
constructor(input: AnimationMetadata | AnimationMetadata[]);
|
|
||||||
buildTimelines(startingStyles: StyleData | StyleData[], destinationStyles: StyleData | StyleData[]): AnimationTimelineInstruction[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export interface AnimationGroupMetadata extends AnimationMetadata {
|
|
||||||
steps: AnimationMetadata[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {
|
|
||||||
steps: AnimationStyleMetadata[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare class AnimationModule {
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export interface AnimationSequenceMetadata extends AnimationMetadata {
|
|
||||||
steps: AnimationMetadata[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export interface AnimationStateMetadata extends AnimationMetadata {
|
|
||||||
name: string;
|
|
||||||
styles: AnimationStyleMetadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export interface AnimationStyleMetadata extends AnimationMetadata {
|
|
||||||
offset: number;
|
|
||||||
styles: StyleData[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export interface AnimationTransitionMetadata extends AnimationMetadata {
|
|
||||||
animation: AnimationMetadata;
|
|
||||||
expr: string | ((fromState: string, toState: string) => boolean);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare class AnimationTrigger implements Trigger {
|
|
||||||
name: string;
|
|
||||||
states: {
|
|
||||||
[stateName: string]: StyleData;
|
|
||||||
};
|
|
||||||
transitionFactories: AnimationTransitionFactory[];
|
|
||||||
constructor(name: string, states: {
|
|
||||||
[stateName: string]: StyleData;
|
|
||||||
}, _transitionAsts: AnimationTransitionMetadata[]);
|
|
||||||
matchTransition(currentState: any, nextState: any): AnimationTransitionInstruction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare const AUTO_STYLE = "*";
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare function group(steps: AnimationMetadata[]): AnimationGroupMetadata;
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSequenceMetadata;
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare function sequence(steps: AnimationMetadata[]): AnimationSequenceMetadata;
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare function state(name: string, styles: AnimationStyleMetadata): AnimationStateMetadata;
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare function style(tokens: {
|
|
||||||
[key: string]: string | number;
|
|
||||||
} | Array<{
|
|
||||||
[key: string]: string | number;
|
|
||||||
}>): AnimationStyleMetadata;
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare function transition(stateChangeExpr: string | ((fromState: string, toState: string) => boolean), steps: AnimationMetadata | AnimationMetadata[]): AnimationTransitionMetadata;
|
|
||||||
|
|
||||||
/** @experimental */
|
|
||||||
export declare function trigger(name: string, definitions: AnimationMetadata[]): AnimationTrigger;
|
|
Loading…
x
Reference in New Issue
Block a user