Fix build problem (#1861)

* fix sourcemap
fix relative path and pre publish build
change travis wait
all test run build and remove unused cpx

* global test task
modify publish script to accept options

* appveyor run

* different approach single test run

* make it work the analytics test
modify start demo shell script to use a different registry

* sourcemap demo shell working

* update readme and add install after any clean
add registry option in start.sh script
add develop and normal mode in demo shell
add -d option in start.sh to point to the local components
add -c option in build script to point to the local components
This commit is contained in:
Mario Romano
2017-05-11 18:08:35 +01:00
committed by Eugenio Romano
parent b0be88ec37
commit 6da0eaba37
88 changed files with 3203 additions and 774 deletions

View File

@@ -2,24 +2,57 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
"$DIR/npm-clean.sh"
eval FORCE_PUBLISH=false
eval NPM_REGISTRY=""
eval OPTIONS=""
cd "$DIR/../demo-shell-ng2"
show_help() {
echo "Usage: npm-publish.sh"
echo ""
echo "-f or -force publish the package with force"
echo "-r or -registry to publish in an alternative npm registry -registry 'http://npm.local.me:8080/' "
echo "-t or -tag to add a tag when publish a package"
}
enable_force(){
FORCE_PUBLISH=true
OPTIONS="$OPTIONS -force"
}
add_tag(){
eval TAG=$1
if [[ "${TAG}" == "" ]]
then
echo "tag missing -t | -tag"
exit 0
fi
echo "====== TAG WILL BE ADDED DURING THE PUBLISH: ${TAG} ====="
OPTIONS="$OPTIONS -tag $1"
}
change_registry(){
NPM_REGISTRY=$1
if [[ "${NPM_REGISTRY}" == "" ]]
then
echo "NPM registry required WITH OPTION -r | -registry"
exit 0
fi
echo "====== CHANGE REGISTRY: ${NPM_REGISTRY} ====="
npm config set registry ${NPM_REGISTRY}
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-t|--tag) add_tag $2; shift 2;;
-f|--force) enable_force; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
-r|--registry) change_registry $2; shift 2;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
esac
done
@@ -42,15 +75,10 @@ for PACKAGE in \
ng2-alfresco-userinfo
do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
echo "====== PUBLISHING: ${DESTDIR} ====="
echo "====== PUBLISHING: ${DESTDIR} ===== npm publish ${OPTIONS}"
cd ${DESTDIR}
npm run clean
npm install
if FORCE_PUBLISH == false; then
npm run publish:prod
fi
if FORCE_PUBLISH == true; then
npm run test && npm run publish --force || exit 1
fi
npm publish ${OPTIONS}
cd ${DIR}
done