Skip to content

Commit 7b3cca2

Browse files
committed
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
1 parent 8f5360c commit 7b3cca2

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

scripts/publish/npm_publish.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ ROOT_DIR=$(cd $(dirname $0)/../..; pwd)
66
cd $ROOT_DIR
77

88
gulp clean
9-
gulp build.js.prod build.js.dev build.js.cjs benchpress.bundle
9+
# benchpress.bundle and bundles.js will implicitly build everything we need
10+
gulp benchpress.bundle bundles.js docs/typings
1011

1112
NPM_DIR=$ROOT_DIR/dist/npm
1213
rm -fr $NPM_DIR
1314
FILES='!(test|e2e_test|docs)'
15+
DTS_FILES='*.d.ts'
1416

1517
function publishRttsAssert {
1618
NAME='rtts_assert'
@@ -38,6 +40,20 @@ function publishModule {
3840
mkdir -p $PUBLISH_DIR/ts
3941
cp -r $ROOT_DIR/modules/$NAME/$FILES $PUBLISH_DIR/ts
4042

43+
if [ $NAME = "angular2" ]; then
44+
# Publish bundles and typings
45+
mkdir -p $PUBLISH_DIR/bundles/typings/angular2
46+
mkdir -p $PUBLISH_DIR/bundles/typings/es6-promise
47+
mkdir -p $PUBLISH_DIR/bundles/typings/rx
48+
# Copy Bundles
49+
cp -r $ROOT_DIR/dist/js/bundle/$FILES $PUBLISH_DIR/bundles
50+
# Copy Typings
51+
cp -r $ROOT_DIR/dist/docs/typings/angular2/$DTS_FILES $PUBLISH_DIR/bundles/typings/angular2
52+
cp -r $ROOT_DIR/dist/docs/typings/http/$DTS_FILES $PUBLISH_DIR/bundles/typings/angular2
53+
cp -r $ROOT_DIR/modules/angular2/typings/es6-promise/$DTS_FILES $PUBLISH_DIR/bundles/typings/es6-promise
54+
cp -r $ROOT_DIR/modules/angular2/typings/rx/$DTS_FILES $PUBLISH_DIR/bundles/typings/rx
55+
fi
56+
4157
if [ $NAME = "benchpress" ]; then
4258
cp -r $ROOT_DIR/dist/build/benchpress_bundle/$FILES $PUBLISH_DIR
4359
cp -r $ROOT_DIR/dist/js/cjs/benchpress/README.md $PUBLISH_DIR

tools/broccoli/trees/browser_tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module.exports = function makeBrowserTree(options, destinationPath) {
9898
// Use TypeScript to transpile the *.ts files to ES6
9999
var es6Tree = compileWithTypescript(modulesTree, {
100100
allowNonTsExtensions: false,
101-
declaration: true,
101+
declaration: false,
102102
emitDecoratorMetadata: true,
103103
mapRoot: '', // force sourcemaps to use relative path
104104
noEmitOnError: false,

tools/broccoli/trees/node_tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = function makeNodeTree(destinationPath) {
3131
allowNonTsExtensions: false,
3232
emitDecoratorMetadata: true,
3333
experimentalDecorators: true,
34-
declaration: true,
34+
declaration: false,
3535
mapRoot: '', /* force sourcemaps to use relative path */
3636
module: 'commonjs',
3737
noEmitOnError: true,

0 commit comments

Comments
 (0)