Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(): npm release script for router artifacts. #5171

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/angular2/src/router/package.json
@@ -0,0 +1,4 @@
{
"name": "@angular/router",
"version": "0.0.1"
}
40 changes: 40 additions & 0 deletions 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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off the top of my head, the following seems simpler (i.e. easier to read):

cd $(dirname $0)/../..
ROOT_DIR=$(pwd)

OK, this is obviously copied from another script, so...consistency ftw I guess :)


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