diff --git a/ng2-components/ng2-alfresco-social/package.json b/ng2-components/ng2-alfresco-social/package.json index 1d3180c9b1..4e1107e646 100644 --- a/ng2-components/ng2-alfresco-social/package.json +++ b/ng2-components/ng2-alfresco-social/package.json @@ -14,9 +14,7 @@ "coverage": "npm run test && ../node_modules/wsrv/bin/wsrv -o -p 9875 ./coverage/report", "publish:prod": "npm run test && npm publish" }, - "main": "./index.js", - "module": "./index.js", - "typings": "./index.d.ts", + "main": "bundles/ng2-alfresco-social.js", "repository": { "type": "git", "url": "https://github.com/Alfresco/alfresco-ng2-components.git" diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh index a8ea1ee0ad..945e2f097a 100755 --- a/scripts/npm-publish.sh +++ b/scripts/npm-publish.sh @@ -3,6 +3,25 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" "$DIR/npm-clean.sh" +eval FORCE_PUBLISH=false + +show_help() { + echo "Usage: npm-publish.sh" + echo "" + echo "-f or -force publish the package with force" +} + +enable_force(){ + FORCE_PUBLISH=true +} + +while [[ $1 == -* ]]; do + case "$1" in + -h|--help|-\?) show_help; exit 0;; + -f|--force) enable_force; shift;; + -*) echo "invalid option: $1" 1>&2; show_help; exit 1;; + esac +done for PACKAGE in \ ng2-alfresco-core \ @@ -27,6 +46,11 @@ do cd ${DESTDIR} npm run clean npm install - npm run publish:prod + 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 cd ${DIR} done