From 2618becaa53d898d20e39aca48c7507d9dc96b87 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Fri, 30 Oct 2015 15:32:57 -0700 Subject: [PATCH] chore(): npm release script for router artifacts. Closes #5171 --- modules/angular2/src/router/package.json | 4 +++ scripts/publish/npm_publish_router.sh | 40 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 modules/angular2/src/router/package.json create mode 100755 scripts/publish/npm_publish_router.sh diff --git a/modules/angular2/src/router/package.json b/modules/angular2/src/router/package.json new file mode 100644 index 0000000000..6c9eb3640a --- /dev/null +++ b/modules/angular2/src/router/package.json @@ -0,0 +1,4 @@ +{ + "name": "@angular/router", + "version": "0.0.1" +} diff --git a/scripts/publish/npm_publish_router.sh b/scripts/publish/npm_publish_router.sh new file mode 100755 index 0000000000..19d2bb69c7 --- /dev/null +++ b/scripts/publish/npm_publish_router.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -ex +shopt -s extglob + +ROOT_DIR=$(cd $(dirname $0)/../..; pwd) +cd ${ROOT_DIR} + +gulp clean +gulp build.js buildRouter.dev + +NPM_DIR=${ROOT_DIR}/dist/npm +rm -fr ${NPM_DIR} +FILES='!(test|e2e_test|docs)' +DTS_FILES='*.d.ts' + +NAME=router +PUBLISH_DIR=${NPM_DIR}/${NAME} + +# Clean the publish directory. This is the root directory for npm publish. +rm -fr ${PUBLISH_DIR} +mkdir -p ${PUBLISH_DIR} + +# Copy package.json that contains the (scoped) package name and version. +cp ${ROOT_DIR}/modules/angular2/src/router/package.json ${PUBLISH_DIR} + +# Create directory for the separate framework versions +mkdir -p ${PUBLISH_DIR}/angular1 +mkdir -p ${PUBLISH_DIR}/angular2 + +# Copy router build artifacts to the publish directory. +cp ${ROOT_DIR}/dist/angular_1_router.js ${PUBLISH_DIR}/angular1/ +cp ${ROOT_DIR}/modules/angular1_router/src/ng_route_shim.js ${PUBLISH_DIR}/angular1/ + +cp ${ROOT_DIR}/dist/js/bundle/router* ${PUBLISH_DIR}/angular2/ + +# Remove any dart related files +rm -f ${PUBLISH_DIR}/{,**/}{*.dart,*.dart.md} + +# Actually publish to npm +npm publish ${PUBLISH_DIR} --tag pre-release --access public