Skip to content

Commit cde8ffd

Browse files
committed
feat(publish): update files to publish to npm
1 parent 3f25f5a commit cde8ffd

File tree

10 files changed

+96
-62
lines changed

10 files changed

+96
-62
lines changed

modules/angular2/README.dart.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Angular2
2+
=========
3+
4+
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo. This is the repository for the upcoming 2.0 version. If you're looking for the current official version of Angular you should go to [angular/angular.js](https://github.com/angular/angular.js)
5+
6+
License: Apache MIT 2.0

modules/angular2/README.js.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Angular2
2+
=========
3+
4+
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo. This is the repository for the upcoming 2.0 version. If you're looking for the current official version of Angular you should go to [angular/angular.js](https://github.com/angular/angular.js)
5+
6+
This package contains different sources for different users:
7+
8+
1. The files located in the root folder can be consumed using CommonJS
9+
2. The files under `/es6` are es6 compatible files that can be transpiled to
10+
es5 using any transpiler. This contains:
11+
* `dev/`: a development version that includes runtime type assertions
12+
* `prod/`: a production version that does not include runtime type assertions
13+
3. The files under `/atscript` are the AtScript source files
14+
15+
As a convenience, we provide you with `/es6/{dev|prod}/es5build.js`, a script to transpile the es6 sources into es5
16+
using [Google Traceur](https://github.com/google/traceur-compiler/).
17+
18+
License: Apache MIT 2.0

modules/angular2/README.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

modules/angular2/package.json

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
{
22
"name": "angular2",
3-
"version": "<%= packageJson.version %>.<%= channel %>",
3+
"version": "<%= packageJson.version %>",
44
"description": "Angular 2 - a web framework for modern web apps",
55
"homepage": "<%= packageJson.homepage %>",
66
"bugs": "<%= packageJson.bugs %>",
77
"contributors": <%= JSON.stringify(packageJson.contributors) %>,
88
"license": "<%= packageJson.license %>",
99
"dependencies": {
10-
<% if (channel==='dev') { %>
11-
"rtts_assert": "<%= packageJson.version %>",
12-
<% } %>
13-
"zone.js": "0.4.*"
10+
"traceur": "<%= packageJson.dependencies.traceur %>",
11+
"rtts_assert": "<%= packageJson.version %>"
1412
},
15-
"devDependencies": {
16-
"yargs": "2.3.*",
17-
"gulp-sourcemaps": "1.3.*",
18-
"gulp-traceur": "0.16.*",
19-
"gulp": "^3.8.8",
20-
"gulp-rename": "^1.2.0",
21-
"through2": "^0.6.1"
22-
}
13+
"devDependencies": <%= JSON.stringify(packageJson.devDependencies) %>
2314
}

modules/benchpress/README.dart.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Benchpress - a framework for e2e performance tests
2+
=========
3+
4+
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo.
5+
6+
License: Apache MIT 2.0

modules/benchpress/README.js.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Benchpress - a framework for e2e performance tests
2+
=========
3+
4+
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo.
5+
6+
This package contains different sources for different users:
7+
8+
1. The files located in the root folder can be consumed using CommonJS
9+
2. The files under `/es6` are es6 compatible files that can be transpiled to
10+
es5 using any transpiler. This contains:
11+
* `dev/`: a development version that includes runtime type assertions
12+
* `prod/`: a production version that does not include runtime type assertions
13+
3. The files under `/atscript` are the AtScript source files
14+
15+
As a convenience, we provide you with `/es6/{dev|prod}/es5build.js`, a script to transpile the es6 sources into es5
16+
using [Google Traceur](https://github.com/google/traceur-compiler/).
17+
18+
License: Apache MIT 2.0

modules/benchpress/index.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require(require('traceur').RUNTIME_PATH);
2+
module.exports = require('./benchpress.js');

modules/benchpress/package.json

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
{
2-
"name": "angular-benchpress2",
2+
"name": "benchpress",
33
"version": "<%= packageJson.version %>",
4-
"description": "Angular-Benchpress - a framework for e2e performance tests",
4+
"description": "Benchpress - a framework for e2e performance tests",
55
"homepage": "<%= packageJson.homepage %>",
66
"bugs": "<%= packageJson.bugs %>",
7+
"main" : "./index.js",
78
"contributors": <%= JSON.stringify(packageJson.contributors) %>,
89
"license": "<%= packageJson.license %>",
910
"dependencies": {
11+
"traceur": "<%= packageJson.dependencies.traceur %>",
1012
"rtts_assert": "<%= packageJson.version %>",
11-
"angular2": "<%= packageJson.version %>.dev"
13+
"selenium-webdriver": "<%= packageJson.dependencies['selenium-webdriver'] %>"
1214
},
13-
"devDependencies": {
14-
"yargs": "2.3.*",
15-
"gulp-sourcemaps": "1.3.*",
16-
"gulp-traceur": "0.16.*",
17-
"gulp": "^3.8.8",
18-
"gulp-rename": "^1.2.0",
19-
"through2": "^0.6.1"
20-
}
15+
"devDependencies": <%= JSON.stringify(packageJson.devDependencies) %>
2116
}
File renamed without changes.

scripts/publish/npm_publish.sh

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,48 @@
11
#!/bin/bash
22
set -ex
3+
shopt -s extglob
34

45
ROOT_DIR=$(cd $(dirname $0)/../..; pwd)
56
cd $ROOT_DIR
7+
68
gulp clean
7-
gulp build.js.prod build.js.dev
9+
gulp build.js.prod build.js.dev build.js.cjs
810

9-
function angular {
10-
CHANNEL=$1
11-
cd $ROOT_DIR/dist/js/$CHANNEL/es6/angular2
12-
rm -fr test
13-
npm publish ./ --tag "$CHANNEL"
14-
}
11+
NPM_DIR=$ROOT_DIR/dist/npm
12+
rm -fr $NPM_DIR
13+
FILES='!(test|e2e_test|docs)'
14+
15+
function publishRttsAssert {
16+
NAME='rtts_assert'
17+
PUBLISH_DIR=$NPM_DIR/$NAME
18+
rm -fr $PUBLISH_DIR
19+
mkdir -p $PUBLISH_DIR
20+
21+
mkdir -p $PUBLISH_DIR/es6
22+
cp -r $ROOT_DIR/dist/js/prod/es6/$NAME/$FILES $PUBLISH_DIR/es6
1523

16-
function rttsAssert {
17-
cd $ROOT_DIR/dist/js/prod/es6/rtts_assert
18-
rm -fr test
19-
npm publish ./
24+
cp -r $ROOT_DIR/dist/js/cjs/$NAME/$FILES $PUBLISH_DIR
25+
npm publish $PUBLISH_DIR
2026
}
2127

22-
# only publish dev version of benchpress
23-
# as implementation is not performance sensitive
24-
function benchpress {
25-
cd $ROOT_DIR/dist/js/dev/es6/benchpress
26-
rm -fr test
27-
npm publish ./
28+
function publishModule {
29+
NAME=$1
30+
PUBLISH_DIR=$NPM_DIR/$NAME
31+
rm -fr $PUBLISH_DIR
32+
mkdir -p $PUBLISH_DIR
33+
34+
mkdir -p $PUBLISH_DIR/es6/dev
35+
cp -r $ROOT_DIR/dist/js/dev/es6/$NAME/$FILES $PUBLISH_DIR/es6/dev
36+
mkdir -p $PUBLISH_DIR/es6/prod
37+
cp -r $ROOT_DIR/dist/js/prod/es6/$NAME/$FILES $PUBLISH_DIR/es6/prod
38+
mkdir -p $PUBLISH_DIR/atscript
39+
cp -r $ROOT_DIR/modules/$NAME/$FILES $PUBLISH_DIR/atscript
40+
41+
cp -r $ROOT_DIR/dist/js/cjs/$NAME/$FILES $PUBLISH_DIR
42+
43+
npm publish $PUBLISH_DIR
2844
}
2945

30-
rttsAssert
31-
angular dev
32-
angular prod
33-
benchpress
46+
publishRttsAssert
47+
publishModule angular2
48+
publishModule benchpress

0 commit comments

Comments
 (0)