feat(npm): publish bundles and their typings in npm distribution

The same bundles that are published to https://code.angularjs.org
are now included in a "bundles" folder inside the npm distribution.

Closes #3555
This commit is contained in:
Jeff Cross 2015-08-11 16:33:03 -07:00
parent 8f5360c387
commit 7b3cca20d2
3 changed files with 19 additions and 3 deletions

View File

@ -6,11 +6,13 @@ ROOT_DIR=$(cd $(dirname $0)/../..; pwd)
cd $ROOT_DIR
gulp clean
gulp build.js.prod build.js.dev build.js.cjs benchpress.bundle
# benchpress.bundle and bundles.js will implicitly build everything we need
gulp benchpress.bundle bundles.js docs/typings
NPM_DIR=$ROOT_DIR/dist/npm
rm -fr $NPM_DIR
FILES='!(test|e2e_test|docs)'
DTS_FILES='*.d.ts'
function publishRttsAssert {
NAME='rtts_assert'
@ -38,6 +40,20 @@ function publishModule {
mkdir -p $PUBLISH_DIR/ts
cp -r $ROOT_DIR/modules/$NAME/$FILES $PUBLISH_DIR/ts
if [ $NAME = "angular2" ]; then
# Publish bundles and typings
mkdir -p $PUBLISH_DIR/bundles/typings/angular2
mkdir -p $PUBLISH_DIR/bundles/typings/es6-promise
mkdir -p $PUBLISH_DIR/bundles/typings/rx
# Copy Bundles
cp -r $ROOT_DIR/dist/js/bundle/$FILES $PUBLISH_DIR/bundles
# Copy Typings
cp -r $ROOT_DIR/dist/docs/typings/angular2/$DTS_FILES $PUBLISH_DIR/bundles/typings/angular2
cp -r $ROOT_DIR/dist/docs/typings/http/$DTS_FILES $PUBLISH_DIR/bundles/typings/angular2
cp -r $ROOT_DIR/modules/angular2/typings/es6-promise/$DTS_FILES $PUBLISH_DIR/bundles/typings/es6-promise
cp -r $ROOT_DIR/modules/angular2/typings/rx/$DTS_FILES $PUBLISH_DIR/bundles/typings/rx
fi
if [ $NAME = "benchpress" ]; then
cp -r $ROOT_DIR/dist/build/benchpress_bundle/$FILES $PUBLISH_DIR
cp -r $ROOT_DIR/dist/js/cjs/benchpress/README.md $PUBLISH_DIR

View File

@ -98,7 +98,7 @@ module.exports = function makeBrowserTree(options, destinationPath) {
// Use TypeScript to transpile the *.ts files to ES6
var es6Tree = compileWithTypescript(modulesTree, {
allowNonTsExtensions: false,
declaration: true,
declaration: false,
emitDecoratorMetadata: true,
mapRoot: '', // force sourcemaps to use relative path
noEmitOnError: false,

View File

@ -31,7 +31,7 @@ module.exports = function makeNodeTree(destinationPath) {
allowNonTsExtensions: false,
emitDecoratorMetadata: true,
experimentalDecorators: true,
declaration: true,
declaration: false,
mapRoot: '', /* force sourcemaps to use relative path */
module: 'commonjs',
noEmitOnError: true,