Compare commits
78 Commits
Author | SHA1 | Date | |
---|---|---|---|
18e2a32b8e | |||
6784784f86 | |||
6996193568 | |||
ebc07f4c5b | |||
088a5e6fe5 | |||
04345d1691 | |||
ab6870a193 | |||
d1486c2bef | |||
87e684aa7b | |||
9c31773f31 | |||
c0bb143128 | |||
d3069ebf5f | |||
d0e6bbd162 | |||
9b27ed9e7f | |||
93ed4fbbf9 | |||
8aa5ce6a5d | |||
2992f54f11 | |||
c9929963d7 | |||
5ea199e470 | |||
e729dd8e6f | |||
54335338ab | |||
3109585d30 | |||
b28b79cae6 | |||
a7d0bfc63f | |||
f436fffecd | |||
77b5949a81 | |||
ad9dde6fb6 | |||
e928510886 | |||
7065094a84 | |||
7e210d473f | |||
e3aa4cbbcc | |||
4a7ffa1caf | |||
872eef5de8 | |||
7d464df932 | |||
712000b688 | |||
e2ed8c5f4c | |||
245449ee13 | |||
7cd695fc92 | |||
80223dc038 | |||
7b1df4148d | |||
e81288a9dd | |||
1734a2030b | |||
65b96af6a8 | |||
eec824e959 | |||
d28634a865 | |||
540d9a9b56 | |||
65c70eec98 | |||
1622715a51 | |||
2d063f1fe4 | |||
bc87a24ae8 | |||
dd2f410fdb | |||
acde823f08 | |||
6edd270a92 | |||
be43477dca | |||
03a931a9d3 | |||
f05b790e4d | |||
61dc3347c7 | |||
2de34d9928 | |||
2c69bdd39c | |||
130f8b00d7 | |||
a87263888c | |||
802a348123 | |||
74bbd71ef4 | |||
86f7e0631b | |||
0657edac50 | |||
01a89ecad1 | |||
213cd764d8 | |||
244048fccb | |||
aee39d4a33 | |||
f5f1d59c79 | |||
895063ec65 | |||
ba29214eea | |||
5fe7d563d0 | |||
29534a3c6d | |||
e5cbefd195 | |||
83ddb95968 | |||
7afda4e508 | |||
f459bd5537 |
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,10 +1,6 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
.settings/
|
|
||||||
.idea/
|
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
test/result/
|
||||||
ts/*.js
|
coverage/
|
||||||
ts/*.js.map
|
pages/
|
||||||
ts/typings/
|
public
|
||||||
|
|
||||||
test/result/
|
|
||||||
|
95
.gitlab-ci.yml
Normal file
95
.gitlab-ci.yml
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# gitzone standard
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .yarn/
|
||||||
|
key: "$CI_BUILD_STAGE"
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- security
|
||||||
|
- test
|
||||||
|
- release
|
||||||
|
- trigger
|
||||||
|
- pages
|
||||||
|
|
||||||
|
mirror:
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci git mirror
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
snyk:
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci command yarn global add snyk
|
||||||
|
- npmci command yarn install --ignore-scripts
|
||||||
|
- npmci command snyk test
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
testLEGACY:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci node install legacy
|
||||||
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
testLTS:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci node install lts
|
||||||
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
testSTABLE:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm publish
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
stage: trigger
|
||||||
|
script:
|
||||||
|
- npmci trigger
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
pages:
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
stage: pages
|
||||||
|
script:
|
||||||
|
- npmci command yarn global add npmpage
|
||||||
|
- npmci command npmpage
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- public
|
@ -1,3 +1,4 @@
|
|||||||
node_modules
|
node_modules
|
||||||
test
|
test
|
||||||
ts
|
ts
|
||||||
|
coverage/
|
14
.travis.yml
14
.travis.yml
@ -1,14 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
node_js:
|
|
||||||
- '4.2.4'
|
|
||||||
deploy:
|
|
||||||
provider: npm
|
|
||||||
email: npm@lossless.digital
|
|
||||||
api_key:
|
|
||||||
secure: MNBFCPscAm1+rY1qIHbye3Bwif9W/bPyHxvXyoKbi8G2URQjZKNYTpRT0bVShj6UBJihBrnXa40cxmU/F+rcQhPeY4uFIC5oBIyYkSrn0XvhJEqn/yQnBl0DrdImYSuYx480jLKvvNq3RIft2K+5y6+qb8QuumV/1p4QYbiM6Ibwz54SPfmJtzsMsei8bHzbDvOtKeoX8l3mGqyIVX1D/Nnnq9rH0UZnbqf7W5IH/QlCTpVAj5v/HRCSbCbJkbmwTYtx4PV0xS9vYgXklwFr0FcJXyZPmzqSRM/EYnhOg61uQCWM1JG12nDmdv8lkE+x5L6fV+YXTeBAKmnCBAZy8D7CYX0jDELrpKp4wKFofl/AkTDAlVsjEb4U+DVXuJOWt8KQzjYGLX6nXXOUzDD9OXNmB6010a2g3SQ4vCX3jHomycPZTgKPd4MN5xiJBfg/EXn1HlJdtO8jYFB2S87VVmFrJfwQ6x4iZxabmWPtasye3DP/OLX+8/8aWNGLMjP/Lr4muPS4B9OOlI3EvVo+DR3B381NPwzKaM9NLkeM3pHgMhm0K2mqOnbvhUhhkmmMkQI1T+RRf91zraPXAh7fMRDh2lDqKfrhtKobFBmONgXAtO7QPz2Bhp+kszwRo/Vx//H2VpUD45CNfMKnN99VYY/FHGYICBYH2mK/MX50HAA=
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
repo: pushrocks/gulp-browser
|
|
||||||
notifications:
|
|
||||||
slack:
|
|
||||||
secure: f5Uss0z9RPl/QcA/DroB8loyE93aOYI6bqCkrsiUscmZtlv/TVQtT4dxqGA6uvcG6iTQDBi3Ul88dQxWkRm4IqbhY35/iMaV2dHW4FVYMAh8GQMbsfL2sALCcufxD9blw47awv3iFcwhV1EeyesscjgL0JIjduk96v/7G/6QIO2838M1lzlgtj+kRUkim8qkaEs1je3gRrhMUIjLuAdscMXyUKYFMjWo9ACSjVUl30R/ZNemb18itIja6i92GotreBgcfEMczvy58ovDC7xdJUsY8LjMI01DwY+WPRnI0tAhsuI8moBwwcdM4e3bAjKjucQRjO33O5bMWRZ6QCiYd0DnCEFyCPQLJ4GSy/tkD00n8ijLHAOSV3AH1zNbdK1EAdSPQXDvlI36KJn/2hyQLoitGHVUPr76ujJWP82ypO2tgIp3XQU0dJVCxDuHnwJO2+hjdI+gCPqxNTpjeujHx3UdkTGNRjuuf9dlZ/D08fApjYxy2fxItTqo3QjP/nrqvBXUOPP8yPHpjIT4H2t5Pr4SJjBGI6X4qhKyFj6s9rA/Xu1rL+45zu1C3uC3z+u3T9UwrbzJ/cZM6r6UQvQmUvIfBNaMlg4I/diQCDIPL+Rhop2nylY3IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=
|
|
64
README.md
64
README.md
@ -1,36 +1,62 @@
|
|||||||
# gulp-browser
|
# gulp-browser
|
||||||
|
|
||||||
browserify and other goodies for gulp
|
browserify and other goodies for gulp
|
||||||
|
|
||||||
### Build Status/Dependencies
|
## Availabililty
|
||||||
[](https://travis-ci.org/pushrocks/gulp-browser)
|
|
||||||
|
[](https://www.npmjs.com/package/gulp-browser)
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser)
|
||||||
|
[](https://github.com/pushrocks/gulp-browser)
|
||||||
|
[](https://pushrocks.gitlab.io/gulp-browser/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/gulp-browser)
|
||||||
[](https://david-dm.org/pushrocks/gulp-browser)
|
[](https://david-dm.org/pushrocks/gulp-browser)
|
||||||
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
||||||
[](https://www.bithound.io/github/pushrocks/gulp-browser)
|
[](https://www.bithound.io/github/pushrocks/gulp-browser)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
### Usage
|
Use TypeScript for best in class instellisense.
|
||||||
gulp-browser is meant to be easy:
|
|
||||||
|
|
||||||
#### Browserify:
|
#### Browserify:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var gulp = require("gulp");
|
let gulp = require('gulp');
|
||||||
var gulpBrowser = require("gulp-browser");
|
let gulpBrowser = require('gulp-browser');
|
||||||
|
|
||||||
gulp.task('gulpBrowserTest',function() {
|
let transforms = [
|
||||||
var stream = gulp.src('./test/*.js')
|
{
|
||||||
.pipe(gulpBrowser.browserify())
|
transform: 'babelify',
|
||||||
.pipe(gulp.dest("./test/browserifiedJS/"));
|
options: { presets: ['es2015'] }
|
||||||
return stream;
|
}
|
||||||
});
|
];
|
||||||
|
|
||||||
|
gulp.task('gulpBrowserTest', function() {
|
||||||
|
var stream = gulp
|
||||||
|
.src('./test/*.js')
|
||||||
|
.pipe(gulpBrowser.browserify(transforms)) // gulp.browserify() accepts an optional array of tansforms
|
||||||
|
.pipe(gulp.dest('./test/browserifiedJS/'));
|
||||||
|
return stream;
|
||||||
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note:** Be aware of how gulp.src creates values of file.base and file.path since that is important to the require statements.
|
> **Note:** Be aware of how gulp.src creates values of file.base and file.path since that is important to the require statements.
|
||||||
|
|
||||||
### Dev Information:
|
### Contributors
|
||||||
[](https://david-dm.org/pushrocks/gulp-browser#info=devDependencies)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
|
||||||
|
|
||||||
### About the authors:
|
* [Phil Kunz](https://github.com/philkunz)
|
||||||
[](https://lossless.com/)
|
* [Steffan Donal](https://github.com/SteffanDonal)
|
||||||
|
|
||||||
[](https://paypal.me/lossless)
|
For further information read the linked docs at the top of this README.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
{
|
|
||||||
"/Users/philkunz/github/pushrocks/gulp-browser/index.js":{"path":"/Users/philkunz/github/pushrocks/gulp-browser/index.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":0,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1},"b":{"1":[1,0],"2":[1,1]},"f":{"1":1,"2":1,"3":1,"4":1,"5":1},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":34}}},"2":{"name":"init","line":6,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":20}}},"3":{"name":"(anonymous_3)","line":7,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":27}}},"4":{"name":"(anonymous_4)","line":8,"loc":{"start":{"line":8,"column":39},"end":{"line":8,"column":64}}},"5":{"name":"(anonymous_5)","line":9,"loc":{"start":{"line":9,"column":37},"end":{"line":9,"column":69}}}},"statementMap":{"1":{"start":{"line":4,"column":0},"end":{"line":4,"column":26}},"2":{"start":{"line":5,"column":0},"end":{"line":24,"column":58}},"3":{"start":{"line":6,"column":4},"end":{"line":22,"column":5}},"4":{"start":{"line":7,"column":8},"end":{"line":21,"column":10}},"5":{"start":{"line":8,"column":12},"end":{"line":20,"column":15}},"6":{"start":{"line":9,"column":16},"end":{"line":17,"column":18}},"7":{"start":{"line":10,"column":20},"end":{"line":15,"column":21}},"8":{"start":{"line":11,"column":24},"end":{"line":11,"column":56}},"9":{"start":{"line":14,"column":24},"end":{"line":14,"column":94}},"10":{"start":{"line":16,"column":20},"end":{"line":16,"column":35}},"11":{"start":{"line":18,"column":16},"end":{"line":19,"column":44}},"12":{"start":{"line":23,"column":4},"end":{"line":23,"column":38}},"13":{"start":{"line":27,"column":0},"end":{"line":33,"column":2}},"14":{"start":{"line":35,"column":0},"end":{"line":35,"column":21}},"15":{"start":{"line":36,"column":0},"end":{"line":36,"column":54}},"16":{"start":{"line":37,"column":0},"end":{"line":37,"column":29}}},"branchMap":{"1":{"line":10,"type":"if","locations":[{"start":{"line":10,"column":20},"end":{"line":10,"column":20}},{"start":{"line":10,"column":20},"end":{"line":10,"column":20}}]},"2":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":3},"end":{"line":24,"column":24}},{"start":{"line":24,"column":29},"end":{"line":24,"column":55}}]}},"l":{"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"14":0,"16":1,"18":1,"23":1,"27":1,"35":1,"36":1,"37":1}}}
|
|
@ -1,212 +0,0 @@
|
|||||||
body, html {
|
|
||||||
margin:0; padding: 0;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
font-family: Helvetica Neue, Helvetica, Arial;
|
|
||||||
font-size: 14px;
|
|
||||||
color:#333;
|
|
||||||
}
|
|
||||||
.small { font-size: 12px;; }
|
|
||||||
*, *:after, *:before {
|
|
||||||
-webkit-box-sizing:border-box;
|
|
||||||
-moz-box-sizing:border-box;
|
|
||||||
box-sizing:border-box;
|
|
||||||
}
|
|
||||||
h1 { font-size: 20px; margin: 0;}
|
|
||||||
h2 { font-size: 14px; }
|
|
||||||
pre {
|
|
||||||
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
-moz-tab-size: 2;
|
|
||||||
-o-tab-size: 2;
|
|
||||||
tab-size: 2;
|
|
||||||
}
|
|
||||||
a { color:#0074D9; text-decoration:none; }
|
|
||||||
a:hover { text-decoration:underline; }
|
|
||||||
.strong { font-weight: bold; }
|
|
||||||
.space-top1 { padding: 10px 0 0 0; }
|
|
||||||
.pad2y { padding: 20px 0; }
|
|
||||||
.pad1y { padding: 10px 0; }
|
|
||||||
.pad2x { padding: 0 20px; }
|
|
||||||
.pad2 { padding: 20px; }
|
|
||||||
.pad1 { padding: 10px; }
|
|
||||||
.space-left2 { padding-left:55px; }
|
|
||||||
.space-right2 { padding-right:20px; }
|
|
||||||
.center { text-align:center; }
|
|
||||||
.clearfix { display:block; }
|
|
||||||
.clearfix:after {
|
|
||||||
content:'';
|
|
||||||
display:block;
|
|
||||||
height:0;
|
|
||||||
clear:both;
|
|
||||||
visibility:hidden;
|
|
||||||
}
|
|
||||||
.fl { float: left; }
|
|
||||||
@media only screen and (max-width:640px) {
|
|
||||||
.col3 { width:100%; max-width:100%; }
|
|
||||||
.hide-mobile { display:none!important; }
|
|
||||||
}
|
|
||||||
|
|
||||||
.quiet {
|
|
||||||
color: #7f7f7f;
|
|
||||||
color: rgba(0,0,0,0.5);
|
|
||||||
}
|
|
||||||
.quiet a { opacity: 0.7; }
|
|
||||||
|
|
||||||
.fraction {
|
|
||||||
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
|
||||||
font-size: 10px;
|
|
||||||
color: #555;
|
|
||||||
background: #E8E8E8;
|
|
||||||
padding: 4px 5px;
|
|
||||||
border-radius: 3px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.path a:link, div.path a:visited { color: #333; }
|
|
||||||
table.coverage {
|
|
||||||
border-collapse: collapse;
|
|
||||||
margin: 10px 0 0 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.coverage td {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
table.coverage td.line-count {
|
|
||||||
text-align: right;
|
|
||||||
padding: 0 5px 0 20px;
|
|
||||||
}
|
|
||||||
table.coverage td.line-coverage {
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 10px;
|
|
||||||
min-width:20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.coverage td span.cline-any {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0 5px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.missing-if-branch {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 5px;
|
|
||||||
border-radius: 3px;
|
|
||||||
position: relative;
|
|
||||||
padding: 0 4px;
|
|
||||||
background: #333;
|
|
||||||
color: yellow;
|
|
||||||
}
|
|
||||||
|
|
||||||
.skip-if-branch {
|
|
||||||
display: none;
|
|
||||||
margin-right: 10px;
|
|
||||||
position: relative;
|
|
||||||
padding: 0 4px;
|
|
||||||
background: #ccc;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.missing-if-branch .typ, .skip-if-branch .typ {
|
|
||||||
color: inherit !important;
|
|
||||||
}
|
|
||||||
.coverage-summary {
|
|
||||||
border-collapse: collapse;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
|
||||||
.keyline-all { border: 1px solid #ddd; }
|
|
||||||
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
|
||||||
.coverage-summary tbody { border: 1px solid #bbb; }
|
|
||||||
.coverage-summary td { border-right: 1px solid #bbb; }
|
|
||||||
.coverage-summary td:last-child { border-right: none; }
|
|
||||||
.coverage-summary th {
|
|
||||||
text-align: left;
|
|
||||||
font-weight: normal;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.coverage-summary th.file { border-right: none !important; }
|
|
||||||
.coverage-summary th.pct { }
|
|
||||||
.coverage-summary th.pic,
|
|
||||||
.coverage-summary th.abs,
|
|
||||||
.coverage-summary td.pct,
|
|
||||||
.coverage-summary td.abs { text-align: right; }
|
|
||||||
.coverage-summary td.file { white-space: nowrap; }
|
|
||||||
.coverage-summary td.pic { min-width: 120px !important; }
|
|
||||||
.coverage-summary tfoot td { }
|
|
||||||
|
|
||||||
.coverage-summary .sorter {
|
|
||||||
height: 10px;
|
|
||||||
width: 7px;
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 0.5em;
|
|
||||||
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
|
||||||
}
|
|
||||||
.coverage-summary .sorted .sorter {
|
|
||||||
background-position: 0 -20px;
|
|
||||||
}
|
|
||||||
.coverage-summary .sorted-desc .sorter {
|
|
||||||
background-position: 0 -10px;
|
|
||||||
}
|
|
||||||
.status-line { height: 10px; }
|
|
||||||
/* dark red */
|
|
||||||
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
|
||||||
.low .chart { border:1px solid #C21F39 }
|
|
||||||
/* medium red */
|
|
||||||
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
|
||||||
/* light red */
|
|
||||||
.low, .cline-no { background:#FCE1E5 }
|
|
||||||
/* light green */
|
|
||||||
.high, .cline-yes { background:rgb(230,245,208) }
|
|
||||||
/* medium green */
|
|
||||||
.cstat-yes { background:rgb(161,215,106) }
|
|
||||||
/* dark green */
|
|
||||||
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
|
||||||
.high .chart { border:1px solid rgb(77,146,33) }
|
|
||||||
|
|
||||||
|
|
||||||
.medium .chart { border:1px solid #666; }
|
|
||||||
.medium .cover-fill { background: #666; }
|
|
||||||
|
|
||||||
.cbranch-no { background: yellow !important; color: #111; }
|
|
||||||
|
|
||||||
.cstat-skip { background: #ddd; color: #111; }
|
|
||||||
.fstat-skip { background: #ddd; color: #111 !important; }
|
|
||||||
.cbranch-skip { background: #ddd !important; color: #111; }
|
|
||||||
|
|
||||||
span.cline-neutral { background: #eaeaea; }
|
|
||||||
.medium { background: #eaeaea; }
|
|
||||||
|
|
||||||
.cover-fill, .cover-empty {
|
|
||||||
display:inline-block;
|
|
||||||
height: 12px;
|
|
||||||
}
|
|
||||||
.chart {
|
|
||||||
line-height: 0;
|
|
||||||
}
|
|
||||||
.cover-empty {
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
.cover-full {
|
|
||||||
border-right: none !important;
|
|
||||||
}
|
|
||||||
pre.prettyprint {
|
|
||||||
border: none !important;
|
|
||||||
padding: 0 !important;
|
|
||||||
margin: 0 !important;
|
|
||||||
}
|
|
||||||
.com { color: #999 !important; }
|
|
||||||
.ignore-none { color: #999; font-weight: normal; }
|
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
min-height: 100%;
|
|
||||||
height: auto !important;
|
|
||||||
height: 100%;
|
|
||||||
margin: 0 auto -48px;
|
|
||||||
}
|
|
||||||
.footer, .push {
|
|
||||||
height: 48px;
|
|
||||||
}
|
|
@ -1,93 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Code coverage report for gulp-browser/</title>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<link rel="stylesheet" href="../prettify.css" />
|
|
||||||
<link rel="stylesheet" href="../base.css" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<style type='text/css'>
|
|
||||||
.coverage-summary .sorter {
|
|
||||||
background-image: url(../sort-arrow-sprite.png);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class='wrapper'>
|
|
||||||
<div class='pad1'>
|
|
||||||
<h1>
|
|
||||||
<a href="../index.html">all files</a> gulp-browser/
|
|
||||||
</h1>
|
|
||||||
<div class='clearfix'>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">93.75% </span>
|
|
||||||
<span class="quiet">Statements</span>
|
|
||||||
<span class='fraction'>15/16</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">75% </span>
|
|
||||||
<span class="quiet">Branches</span>
|
|
||||||
<span class='fraction'>3/4</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">100% </span>
|
|
||||||
<span class="quiet">Functions</span>
|
|
||||||
<span class='fraction'>5/5</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">93.75% </span>
|
|
||||||
<span class="quiet">Lines</span>
|
|
||||||
<span class='fraction'>15/16</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class='status-line high'></div>
|
|
||||||
<div class="pad1">
|
|
||||||
<table class="coverage-summary">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
||||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
||||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
||||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
||||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
||||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
||||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
||||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
||||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
||||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody><tr>
|
|
||||||
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
|
|
||||||
<td data-value="93.75" class="pic high"><div class="chart"><div class="cover-fill" style="width: 93%;"></div><div class="cover-empty" style="width:7%;"></div></div></td>
|
|
||||||
<td data-value="93.75" class="pct high">93.75%</td>
|
|
||||||
<td data-value="16" class="abs high">15/16</td>
|
|
||||||
<td data-value="75" class="pct medium">75%</td>
|
|
||||||
<td data-value="4" class="abs medium">3/4</td>
|
|
||||||
<td data-value="100" class="pct high">100%</td>
|
|
||||||
<td data-value="5" class="abs high">5/5</td>
|
|
||||||
<td data-value="93.75" class="pct high">93.75%</td>
|
|
||||||
<td data-value="16" class="abs high">15/16</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div><div class='push'></div><!-- for sticky footer -->
|
|
||||||
</div><!-- /wrapper -->
|
|
||||||
<div class='footer quiet pad2 space-top1 center small'>
|
|
||||||
Code coverage
|
|
||||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 16:37:40 GMT+0100 (CET)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script src="../prettify.js"></script>
|
|
||||||
<script>
|
|
||||||
window.onload = function () {
|
|
||||||
if (typeof prettyPrint === 'function') {
|
|
||||||
prettyPrint();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<script src="../sorter.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,176 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Code coverage report for gulp-browser/index.js</title>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<link rel="stylesheet" href="../prettify.css" />
|
|
||||||
<link rel="stylesheet" href="../base.css" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<style type='text/css'>
|
|
||||||
.coverage-summary .sorter {
|
|
||||||
background-image: url(../sort-arrow-sprite.png);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class='wrapper'>
|
|
||||||
<div class='pad1'>
|
|
||||||
<h1>
|
|
||||||
<a href="../index.html">all files</a> / <a href="index.html">gulp-browser/</a> index.js
|
|
||||||
</h1>
|
|
||||||
<div class='clearfix'>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">93.75% </span>
|
|
||||||
<span class="quiet">Statements</span>
|
|
||||||
<span class='fraction'>15/16</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">75% </span>
|
|
||||||
<span class="quiet">Branches</span>
|
|
||||||
<span class='fraction'>3/4</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">100% </span>
|
|
||||||
<span class="quiet">Functions</span>
|
|
||||||
<span class='fraction'>5/5</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">93.75% </span>
|
|
||||||
<span class="quiet">Lines</span>
|
|
||||||
<span class='fraction'>15/16</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class='status-line high'></div>
|
|
||||||
<pre><table class="coverage">
|
|
||||||
<tr><td class="line-count quiet">1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6
|
|
||||||
7
|
|
||||||
8
|
|
||||||
9
|
|
||||||
10
|
|
||||||
11
|
|
||||||
12
|
|
||||||
13
|
|
||||||
14
|
|
||||||
15
|
|
||||||
16
|
|
||||||
17
|
|
||||||
18
|
|
||||||
19
|
|
||||||
20
|
|
||||||
21
|
|
||||||
22
|
|
||||||
23
|
|
||||||
24
|
|
||||||
25
|
|
||||||
26
|
|
||||||
27
|
|
||||||
28
|
|
||||||
29
|
|
||||||
30
|
|
||||||
31
|
|
||||||
32
|
|
||||||
33
|
|
||||||
34
|
|
||||||
35
|
|
||||||
36
|
|
||||||
37
|
|
||||||
38</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-no"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-neutral"> </span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-yes">1×</span>
|
|
||||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">#!/usr/bin/env node
|
|
||||||
|
|
||||||
/// <reference path="./index.ts" />
|
|
||||||
var GulpBrowserBrowserify;
|
|
||||||
(function (GulpBrowserBrowserify) {
|
|
||||||
function init() {
|
|
||||||
return function () {
|
|
||||||
return plugins.through.obj(function (file, enc, cb) {
|
|
||||||
var bundleCallback = function (err, bufferedContent) {
|
|
||||||
<span class="missing-if-branch" title="else path not taken" >E</span>if (Buffer.isBuffer(bufferedContent)) {
|
|
||||||
file.contents = bufferedContent;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
<span class="cstat-no" title="statement not covered" > plugins.beautylog.error("gulp-browser: .browserify() " + err.message);</span>
|
|
||||||
}
|
|
||||||
cb(null, file);
|
|
||||||
};
|
|
||||||
plugins.browserify(file, { basedir: file.base })
|
|
||||||
.bundle(bundleCallback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
GulpBrowserBrowserify.init = init;
|
|
||||||
})(GulpBrowserBrowserify || (GulpBrowserBrowserify = {}));
|
|
||||||
/// <reference path="./typings/main.d.ts" />
|
|
||||||
/// <reference path="./modulebrowserify.ts" />
|
|
||||||
var plugins = {
|
|
||||||
beautylog: require("beautylog"),
|
|
||||||
through: require("through2"),
|
|
||||||
gutil: require("gulp-util"),
|
|
||||||
path: require("path"),
|
|
||||||
browserify: require("browserify")
|
|
||||||
};
|
|
||||||
//create the return object
|
|
||||||
var gulpBrowser = {};
|
|
||||||
gulpBrowser.browserify = GulpBrowserBrowserify.init();
|
|
||||||
module.exports = gulpBrowser;
|
|
||||||
</pre></td></tr>
|
|
||||||
</table></pre>
|
|
||||||
<div class='push'></div><!-- for sticky footer -->
|
|
||||||
</div><!-- /wrapper -->
|
|
||||||
<div class='footer quiet pad2 space-top1 center small'>
|
|
||||||
Code coverage
|
|
||||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 16:37:40 GMT+0100 (CET)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script src="../prettify.js"></script>
|
|
||||||
<script>
|
|
||||||
window.onload = function () {
|
|
||||||
if (typeof prettyPrint === 'function') {
|
|
||||||
prettyPrint();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<script src="../sorter.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,93 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Code coverage report for All files</title>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<link rel="stylesheet" href="prettify.css" />
|
|
||||||
<link rel="stylesheet" href="base.css" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<style type='text/css'>
|
|
||||||
.coverage-summary .sorter {
|
|
||||||
background-image: url(sort-arrow-sprite.png);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class='wrapper'>
|
|
||||||
<div class='pad1'>
|
|
||||||
<h1>
|
|
||||||
/
|
|
||||||
</h1>
|
|
||||||
<div class='clearfix'>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">93.75% </span>
|
|
||||||
<span class="quiet">Statements</span>
|
|
||||||
<span class='fraction'>15/16</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">75% </span>
|
|
||||||
<span class="quiet">Branches</span>
|
|
||||||
<span class='fraction'>3/4</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">100% </span>
|
|
||||||
<span class="quiet">Functions</span>
|
|
||||||
<span class='fraction'>5/5</span>
|
|
||||||
</div>
|
|
||||||
<div class='fl pad1y space-right2'>
|
|
||||||
<span class="strong">93.75% </span>
|
|
||||||
<span class="quiet">Lines</span>
|
|
||||||
<span class='fraction'>15/16</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class='status-line high'></div>
|
|
||||||
<div class="pad1">
|
|
||||||
<table class="coverage-summary">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
||||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
||||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
||||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
||||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
||||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
||||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
||||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
||||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
||||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody><tr>
|
|
||||||
<td class="file high" data-value="gulp-browser/"><a href="gulp-browser/index.html">gulp-browser/</a></td>
|
|
||||||
<td data-value="93.75" class="pic high"><div class="chart"><div class="cover-fill" style="width: 93%;"></div><div class="cover-empty" style="width:7%;"></div></div></td>
|
|
||||||
<td data-value="93.75" class="pct high">93.75%</td>
|
|
||||||
<td data-value="16" class="abs high">15/16</td>
|
|
||||||
<td data-value="75" class="pct medium">75%</td>
|
|
||||||
<td data-value="4" class="abs medium">3/4</td>
|
|
||||||
<td data-value="100" class="pct high">100%</td>
|
|
||||||
<td data-value="5" class="abs high">5/5</td>
|
|
||||||
<td data-value="93.75" class="pct high">93.75%</td>
|
|
||||||
<td data-value="16" class="abs high">15/16</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div><div class='push'></div><!-- for sticky footer -->
|
|
||||||
</div><!-- /wrapper -->
|
|
||||||
<div class='footer quiet pad2 space-top1 center small'>
|
|
||||||
Code coverage
|
|
||||||
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 16:37:40 GMT+0100 (CET)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script src="prettify.js"></script>
|
|
||||||
<script>
|
|
||||||
window.onload = function () {
|
|
||||||
if (typeof prettyPrint === 'function') {
|
|
||||||
prettyPrint();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<script src="sorter.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1 +0,0 @@
|
|||||||
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 209 B |
@ -1,158 +0,0 @@
|
|||||||
var addSorting = (function () {
|
|
||||||
"use strict";
|
|
||||||
var cols,
|
|
||||||
currentSort = {
|
|
||||||
index: 0,
|
|
||||||
desc: false
|
|
||||||
};
|
|
||||||
|
|
||||||
// returns the summary table element
|
|
||||||
function getTable() { return document.querySelector('.coverage-summary'); }
|
|
||||||
// returns the thead element of the summary table
|
|
||||||
function getTableHeader() { return getTable().querySelector('thead tr'); }
|
|
||||||
// returns the tbody element of the summary table
|
|
||||||
function getTableBody() { return getTable().querySelector('tbody'); }
|
|
||||||
// returns the th element for nth column
|
|
||||||
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
|
|
||||||
|
|
||||||
// loads all columns
|
|
||||||
function loadColumns() {
|
|
||||||
var colNodes = getTableHeader().querySelectorAll('th'),
|
|
||||||
colNode,
|
|
||||||
cols = [],
|
|
||||||
col,
|
|
||||||
i;
|
|
||||||
|
|
||||||
for (i = 0; i < colNodes.length; i += 1) {
|
|
||||||
colNode = colNodes[i];
|
|
||||||
col = {
|
|
||||||
key: colNode.getAttribute('data-col'),
|
|
||||||
sortable: !colNode.getAttribute('data-nosort'),
|
|
||||||
type: colNode.getAttribute('data-type') || 'string'
|
|
||||||
};
|
|
||||||
cols.push(col);
|
|
||||||
if (col.sortable) {
|
|
||||||
col.defaultDescSort = col.type === 'number';
|
|
||||||
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return cols;
|
|
||||||
}
|
|
||||||
// attaches a data attribute to every tr element with an object
|
|
||||||
// of data values keyed by column name
|
|
||||||
function loadRowData(tableRow) {
|
|
||||||
var tableCols = tableRow.querySelectorAll('td'),
|
|
||||||
colNode,
|
|
||||||
col,
|
|
||||||
data = {},
|
|
||||||
i,
|
|
||||||
val;
|
|
||||||
for (i = 0; i < tableCols.length; i += 1) {
|
|
||||||
colNode = tableCols[i];
|
|
||||||
col = cols[i];
|
|
||||||
val = colNode.getAttribute('data-value');
|
|
||||||
if (col.type === 'number') {
|
|
||||||
val = Number(val);
|
|
||||||
}
|
|
||||||
data[col.key] = val;
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
// loads all row data
|
|
||||||
function loadData() {
|
|
||||||
var rows = getTableBody().querySelectorAll('tr'),
|
|
||||||
i;
|
|
||||||
|
|
||||||
for (i = 0; i < rows.length; i += 1) {
|
|
||||||
rows[i].data = loadRowData(rows[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// sorts the table using the data for the ith column
|
|
||||||
function sortByIndex(index, desc) {
|
|
||||||
var key = cols[index].key,
|
|
||||||
sorter = function (a, b) {
|
|
||||||
a = a.data[key];
|
|
||||||
b = b.data[key];
|
|
||||||
return a < b ? -1 : a > b ? 1 : 0;
|
|
||||||
},
|
|
||||||
finalSorter = sorter,
|
|
||||||
tableBody = document.querySelector('.coverage-summary tbody'),
|
|
||||||
rowNodes = tableBody.querySelectorAll('tr'),
|
|
||||||
rows = [],
|
|
||||||
i;
|
|
||||||
|
|
||||||
if (desc) {
|
|
||||||
finalSorter = function (a, b) {
|
|
||||||
return -1 * sorter(a, b);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < rowNodes.length; i += 1) {
|
|
||||||
rows.push(rowNodes[i]);
|
|
||||||
tableBody.removeChild(rowNodes[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
rows.sort(finalSorter);
|
|
||||||
|
|
||||||
for (i = 0; i < rows.length; i += 1) {
|
|
||||||
tableBody.appendChild(rows[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// removes sort indicators for current column being sorted
|
|
||||||
function removeSortIndicators() {
|
|
||||||
var col = getNthColumn(currentSort.index),
|
|
||||||
cls = col.className;
|
|
||||||
|
|
||||||
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
|
||||||
col.className = cls;
|
|
||||||
}
|
|
||||||
// adds sort indicators for current column being sorted
|
|
||||||
function addSortIndicators() {
|
|
||||||
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
|
|
||||||
}
|
|
||||||
// adds event listeners for all sorter widgets
|
|
||||||
function enableUI() {
|
|
||||||
var i,
|
|
||||||
el,
|
|
||||||
ithSorter = function ithSorter(i) {
|
|
||||||
var col = cols[i];
|
|
||||||
|
|
||||||
return function () {
|
|
||||||
var desc = col.defaultDescSort;
|
|
||||||
|
|
||||||
if (currentSort.index === i) {
|
|
||||||
desc = !currentSort.desc;
|
|
||||||
}
|
|
||||||
sortByIndex(i, desc);
|
|
||||||
removeSortIndicators();
|
|
||||||
currentSort.index = i;
|
|
||||||
currentSort.desc = desc;
|
|
||||||
addSortIndicators();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
for (i =0 ; i < cols.length; i += 1) {
|
|
||||||
if (cols[i].sortable) {
|
|
||||||
// add the click event handler on the th so users
|
|
||||||
// dont have to click on those tiny arrows
|
|
||||||
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
|
||||||
if (el.addEventListener) {
|
|
||||||
el.addEventListener('click', ithSorter(i));
|
|
||||||
} else {
|
|
||||||
el.attachEvent('onclick', ithSorter(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// adds sorting functionality to the UI
|
|
||||||
return function () {
|
|
||||||
if (!getTable()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cols = loadColumns();
|
|
||||||
loadData(cols);
|
|
||||||
addSortIndicators();
|
|
||||||
enableUI();
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
|
|
||||||
window.addEventListener('load', addSorting);
|
|
@ -1,39 +0,0 @@
|
|||||||
TN:
|
|
||||||
SF:/Users/philkunz/github/pushrocks/gulp-browser/index.js
|
|
||||||
FN:5,(anonymous_1)
|
|
||||||
FN:6,init
|
|
||||||
FN:7,(anonymous_3)
|
|
||||||
FN:8,(anonymous_4)
|
|
||||||
FN:9,(anonymous_5)
|
|
||||||
FNF:5
|
|
||||||
FNH:5
|
|
||||||
FNDA:1,(anonymous_1)
|
|
||||||
FNDA:1,init
|
|
||||||
FNDA:1,(anonymous_3)
|
|
||||||
FNDA:1,(anonymous_4)
|
|
||||||
FNDA:1,(anonymous_5)
|
|
||||||
DA:4,1
|
|
||||||
DA:5,1
|
|
||||||
DA:6,1
|
|
||||||
DA:7,1
|
|
||||||
DA:8,1
|
|
||||||
DA:9,1
|
|
||||||
DA:10,1
|
|
||||||
DA:11,1
|
|
||||||
DA:14,0
|
|
||||||
DA:16,1
|
|
||||||
DA:18,1
|
|
||||||
DA:23,1
|
|
||||||
DA:27,1
|
|
||||||
DA:35,1
|
|
||||||
DA:36,1
|
|
||||||
DA:37,1
|
|
||||||
LF:16
|
|
||||||
LH:15
|
|
||||||
BRDA:10,1,0,1
|
|
||||||
BRDA:10,1,1,0
|
|
||||||
BRDA:24,2,0,1
|
|
||||||
BRDA:24,2,1,1
|
|
||||||
BRF:4
|
|
||||||
BRH:3
|
|
||||||
end_of_record
|
|
4
dist/gulpbrowser.browserify.d.ts
vendored
Normal file
4
dist/gulpbrowser.browserify.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import * as stream from 'stream';
|
||||||
|
declare let browserify: (transforms?: any[]) => stream.Transform;
|
||||||
|
export = browserify;
|
44
dist/gulpbrowser.browserify.js
vendored
Normal file
44
dist/gulpbrowser.browserify.js
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
"use strict";
|
||||||
|
const plugins = require("./gulpbrowser.plugins");
|
||||||
|
let browserify = function (transforms = []) {
|
||||||
|
if (!Array.isArray(transforms)) {
|
||||||
|
transforms = [transforms];
|
||||||
|
}
|
||||||
|
let forEach = function (file, enc, cb) {
|
||||||
|
// do this with every chunk (file in gulp terms)
|
||||||
|
let bundleCallback = function (err, bufferedContent) {
|
||||||
|
// our bundle callback for when browserify is finished
|
||||||
|
if (Buffer.isBuffer(bufferedContent)) {
|
||||||
|
file.contents = bufferedContent;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('gulp-browser: .browserify() ' + err.message);
|
||||||
|
cb(new Error(err.message), file);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cb(null, file);
|
||||||
|
};
|
||||||
|
if (file.contents.length > 0) {
|
||||||
|
let browserified = plugins.browserify(file, { basedir: file.base });
|
||||||
|
transforms.forEach(function (transform) {
|
||||||
|
if (typeof transform === 'function') {
|
||||||
|
browserified.transform(transform);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
browserified.transform(transform.transform, transform.options);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
browserified.bundle(bundleCallback);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.warn('gulp-browser: .browserify() file.contents appears to be empty');
|
||||||
|
cb(null, file);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let atEnd = function (cb) {
|
||||||
|
cb();
|
||||||
|
}; // no need to clean up after ourselves
|
||||||
|
return plugins.through2.obj(forEach, atEnd); // this is the through object that gets returned by gulpBrowser.browserify();
|
||||||
|
};
|
||||||
|
module.exports = browserify;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3VscGJyb3dzZXIuYnJvd3NlcmlmeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2d1bHBicm93c2VyLmJyb3dzZXJpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLGlEQUFrRDtBQUdsRCxJQUFJLFVBQVUsR0FBRyxVQUFTLFVBQVUsR0FBRyxFQUFFO0lBQ3ZDLEVBQUUsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDL0IsVUFBVSxHQUFHLENBQUMsVUFBVSxDQUFDLENBQUM7SUFDNUIsQ0FBQztJQUVELElBQUksT0FBTyxHQUFHLFVBQVMsSUFBSSxFQUFFLEdBQUcsRUFBRSxFQUFFO1FBQ2xDLGdEQUFnRDtRQUVoRCxJQUFJLGNBQWMsR0FBRyxVQUFTLEdBQUcsRUFBRSxlQUFlO1lBQ2hELHNEQUFzRDtZQUN0RCxFQUFFLENBQUMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLGVBQWUsQ0FBQyxDQUFDLENBQUMsQ0FBQztnQkFDckMsSUFBSSxDQUFDLFFBQVEsR0FBRyxlQUFlLENBQUM7WUFDbEMsQ0FBQztZQUFDLElBQUksQ0FBQyxDQUFDO2dCQUNOLE9BQU8sQ0FBQyxHQUFHLENBQUMsOEJBQThCLEdBQUcsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO2dCQUMxRCxFQUFFLENBQUMsSUFBSSxLQUFLLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxFQUFFLElBQUksQ0FBQyxDQUFDO2dCQUNqQyxNQUFNLENBQUM7WUFDVCxDQUFDO1lBQ0QsRUFBRSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztRQUNqQixDQUFDLENBQUM7UUFFRixFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQzdCLElBQUksWUFBWSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsSUFBSSxFQUFFLEVBQUUsT0FBTyxFQUFFLElBQUksQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDO1lBRXBFLFVBQVUsQ0FBQyxPQUFPLENBQUMsVUFBUyxTQUFTO2dCQUNuQyxFQUFFLENBQUMsQ0FBQyxPQUFPLFNBQVMsS0FBSyxVQUFVLENBQUMsQ0FBQyxDQUFDO29CQUNwQyxZQUFZLENBQUMsU0FBUyxDQUFDLFNBQVMsQ0FBQyxDQUFDO2dCQUNwQyxDQUFDO2dCQUFDLElBQUksQ0FBQyxDQUFDO29CQUNOLFlBQVksQ0FBQyxTQUFTLENBQUMsU0FBUyxDQUFDLFNBQVMsRUFBRSxTQUFTLENBQUMsT0FBTyxDQUFDLENBQUM7Z0JBQ2pFLENBQUM7WUFDSCxDQUFDLENBQUMsQ0FBQztZQUVILFlBQVksQ0FBQyxNQUFNLENBQUMsY0FBYyxDQUFDLENBQUM7UUFDdEMsQ0FBQztRQUFDLElBQUksQ0FBQyxDQUFDO1lBQ04sT0FBTyxDQUFDLElBQUksQ0FBQywrREFBK0QsQ0FBQyxDQUFDO1lBQzlFLEVBQUUsQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7UUFDakIsQ0FBQztJQUNILENBQUMsQ0FBQztJQUVGLElBQUksS0FBSyxHQUFHLFVBQVMsRUFBRTtRQUNyQixFQUFFLEVBQUUsQ0FBQztJQUNQLENBQUMsQ0FBQyxDQUFDLHNDQUFzQztJQUV6QyxNQUFNLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsT0FBTyxFQUFFLEtBQUssQ0FBQyxDQUFDLENBQUMsNkVBQTZFO0FBQzVILENBQUMsQ0FBQztBQUVGLGlCQUFTLFVBQVUsQ0FBQyJ9
|
3
dist/gulpbrowser.plugins.d.ts
vendored
Normal file
3
dist/gulpbrowser.plugins.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export import through2 = require('through2');
|
||||||
|
export import path = require('path');
|
||||||
|
export import browserify = require('browserify');
|
6
dist/gulpbrowser.plugins.js
vendored
Normal file
6
dist/gulpbrowser.plugins.js
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.through2 = require("through2");
|
||||||
|
exports.path = require("path");
|
||||||
|
exports.browserify = require("browserify");
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3VscGJyb3dzZXIucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2d1bHBicm93c2VyLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx1Q0FBNkM7QUFDN0MsK0JBQXFDO0FBQ3JDLDJDQUFpRCJ9
|
1
dist/index.d.ts
vendored
Normal file
1
dist/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export import browserify = require('./gulpbrowser.browserify');
|
4
dist/index.js
vendored
Normal file
4
dist/index.js
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.browserify = require("./gulpbrowser.browserify");
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHlEQUErRCJ9
|
12
index.d.ts
vendored
12
index.d.ts
vendored
@ -1,12 +0,0 @@
|
|||||||
/// <reference path="ts/typings/main.d.ts" />
|
|
||||||
declare module GulpBrowserBrowserify {
|
|
||||||
function init(): () => any;
|
|
||||||
}
|
|
||||||
declare var plugins: {
|
|
||||||
beautylog: any;
|
|
||||||
through: any;
|
|
||||||
gutil: any;
|
|
||||||
path: any;
|
|
||||||
browserify: any;
|
|
||||||
};
|
|
||||||
declare var gulpBrowser: any;
|
|
37
index.js
37
index.js
@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
/// <reference path="./index.ts" />
|
|
||||||
var GulpBrowserBrowserify;
|
|
||||||
(function (GulpBrowserBrowserify) {
|
|
||||||
function init() {
|
|
||||||
return function () {
|
|
||||||
return plugins.through.obj(function (file, enc, cb) {
|
|
||||||
var bundleCallback = function (err, bufferedContent) {
|
|
||||||
if (Buffer.isBuffer(bufferedContent)) {
|
|
||||||
file.contents = bufferedContent;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
plugins.beautylog.error("gulp-browser: .browserify() " + err.message);
|
|
||||||
}
|
|
||||||
cb(null, file);
|
|
||||||
};
|
|
||||||
plugins.browserify(file, { basedir: file.base })
|
|
||||||
.bundle(bundleCallback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
GulpBrowserBrowserify.init = init;
|
|
||||||
})(GulpBrowserBrowserify || (GulpBrowserBrowserify = {}));
|
|
||||||
/// <reference path="./typings/main.d.ts" />
|
|
||||||
/// <reference path="./modulebrowserify.ts" />
|
|
||||||
var plugins = {
|
|
||||||
beautylog: require("beautylog"),
|
|
||||||
through: require("through2"),
|
|
||||||
gutil: require("gulp-util"),
|
|
||||||
path: require("path"),
|
|
||||||
browserify: require("browserify")
|
|
||||||
};
|
|
||||||
//create the return object
|
|
||||||
var gulpBrowser = {};
|
|
||||||
gulpBrowser.browserify = GulpBrowserBrowserify.init();
|
|
||||||
module.exports = gulpBrowser;
|
|
7
npmextra.json
Normal file
7
npmextra.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"npmci": {
|
||||||
|
"npmGlobalTools": [
|
||||||
|
"npmts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"mode":"default",
|
|
||||||
"coveralls":true
|
|
||||||
}
|
|
36
package.json
36
package.json
@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "gulp-browser",
|
"name": "gulp-browser",
|
||||||
"version": "1.0.8",
|
"version": "3.0.10",
|
||||||
"description": "browserify and other goodies for gulp",
|
"description": "browserify and other goodies for gulp",
|
||||||
"main": "index.js",
|
"main": "dist/index.js",
|
||||||
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npmts)",
|
"test": "(npmts)",
|
||||||
"reinstall": "(rm -r node_modules && npm install)",
|
"reinstall": "(rm -r node_modules && npm install)",
|
||||||
@ -12,27 +13,36 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pushrocks/gulp-browser.git"
|
"url": "https://gitlab.com/pushrocks/gulp-browser.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"gulpplugin",
|
"gulpplugin",
|
||||||
"browserify"
|
"browserify",
|
||||||
|
"browser",
|
||||||
|
"TypeScript",
|
||||||
|
"typed"
|
||||||
],
|
],
|
||||||
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/pushrocks/gulp-browser/issues"
|
"url": "https://gitlab.com/pushrocks/gulp-browser/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/pushrocks/gulp-browser",
|
"homepage": "https://gitlab.com/pushrocks/gulp-browser",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"beautylog": "2.0.7",
|
"@types/browserify": "^12.0.32",
|
||||||
"browserify": "13.0.0",
|
"@types/through2": "^2.0.33",
|
||||||
"gulp-util": "3.0.7",
|
"browserify": "^16.1.1",
|
||||||
"through2": "2.0.1"
|
"smartq": "^1.1.8",
|
||||||
|
"through2": "^2.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "3.9.1",
|
"@types/gulp": "^4.0.4",
|
||||||
"gulp-function": "1.0.2",
|
"babel-core": "^6.26.0",
|
||||||
"npmts": "^2.1.8"
|
"babel-preset-es2015": "^6.24.1",
|
||||||
|
"babelify": "^8.0.0",
|
||||||
|
"beautylog": "^6.1.10",
|
||||||
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-function": "^2.2.9",
|
||||||
|
"tapbundle": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
test/test.js
29
test/test.js
@ -1,29 +0,0 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
|
||||||
var plugins = {
|
|
||||||
beautylog: require("beautylog"),
|
|
||||||
gulp: require("gulp"),
|
|
||||||
gulpBrowser: require("../index.js"),
|
|
||||||
gulpFunction: require("gulp-function")
|
|
||||||
};
|
|
||||||
describe("gulpBrowser", function () {
|
|
||||||
describe(".browserify", function () {
|
|
||||||
it("should run through smoothly", function (done) {
|
|
||||||
this.timeout(20000);
|
|
||||||
plugins.gulp.task('gulpBrowserNormal', function (cb) {
|
|
||||||
var stream = plugins.gulp.src('./test/browserifyGulpTest.js')
|
|
||||||
.pipe(plugins.gulpBrowser.browserify())
|
|
||||||
.pipe(plugins.gulp.dest("./test/result/"))
|
|
||||||
.pipe(plugins.gulpFunction(done));
|
|
||||||
return stream;
|
|
||||||
});
|
|
||||||
plugins.gulp.start.apply(plugins.gulp, ['gulpBrowserNormal']);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
plugins.gulp.task('gulpBrowserTestError', function (cb) {
|
|
||||||
plugins.beautylog.info("Expecting an error:");
|
|
||||||
var stream = plugins.gulp.src('./test/browserifyGulpTestError.js')
|
|
||||||
.pipe(plugins.gulpBrowser.browserify())
|
|
||||||
.pipe(plugins.gulp.dest("./test/result/"));
|
|
||||||
return stream;
|
|
||||||
});
|
|
74
test/test.ts
Normal file
74
test/test.ts
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
import * as beautylog from 'beautylog';
|
||||||
|
import * as gulp from 'gulp';
|
||||||
|
import * as gulpFunction from 'gulp-function';
|
||||||
|
import * as smartq from 'smartq';
|
||||||
|
|
||||||
|
import { expect, tap } from 'tapbundle';
|
||||||
|
|
||||||
|
import * as gulpBrowser from '../ts/index';
|
||||||
|
|
||||||
|
tap.test('should run through smoothly', async () => {
|
||||||
|
let done = smartq.defer();
|
||||||
|
let stream = gulp
|
||||||
|
.src('./test/testBrowserifyNormal.js')
|
||||||
|
.pipe(gulpBrowser.browserify())
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(
|
||||||
|
gulpFunction.atEnd(async () => {
|
||||||
|
done.resolve();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
await done.promise;
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should throw an error, when a module is not found', async () => {
|
||||||
|
let done = smartq.defer();
|
||||||
|
let d = require('domain').create();
|
||||||
|
let doneCalled = false;
|
||||||
|
d.on('error', function(error) {
|
||||||
|
if (!doneCalled) {
|
||||||
|
done.resolve();
|
||||||
|
doneCalled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
d.run(function() {
|
||||||
|
let stream = gulp.src('./test/testBrowserifyError.js').pipe(gulpBrowser.browserify());
|
||||||
|
});
|
||||||
|
await done.promise;
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should run through with an empty file', async () => {
|
||||||
|
let done = smartq.defer();
|
||||||
|
let stream = gulp
|
||||||
|
.src('./test/testBrowserifyEmpty.js')
|
||||||
|
.pipe(gulpBrowser.browserify())
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(
|
||||||
|
gulpFunction.atEnd(async () => {
|
||||||
|
done.resolve();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
await done.promise;
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should run through work with transforms', async () => {
|
||||||
|
let done = smartq.defer();
|
||||||
|
let transforms = [
|
||||||
|
{
|
||||||
|
transform: 'babelify',
|
||||||
|
options: { presets: ['es2015'] }
|
||||||
|
}
|
||||||
|
];
|
||||||
|
let stream = gulp
|
||||||
|
.src('./test/testBrowserifyNormal.js')
|
||||||
|
.pipe(gulpBrowser.browserify(transforms))
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(
|
||||||
|
gulpFunction.atEnd(async () => {
|
||||||
|
done.resolve();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
await done.promise;
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.start();
|
0
test/testBrowserifyEmpty.js
Normal file
0
test/testBrowserifyEmpty.js
Normal file
50
ts/gulpbrowser.browserify.ts
Normal file
50
ts/gulpbrowser.browserify.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import * as stream from 'stream';
|
||||||
|
import plugins = require('./gulpbrowser.plugins');
|
||||||
|
import * as q from 'q';
|
||||||
|
|
||||||
|
let browserify = function(transforms = []) {
|
||||||
|
if (!Array.isArray(transforms)) {
|
||||||
|
transforms = [transforms];
|
||||||
|
}
|
||||||
|
|
||||||
|
let forEach = function(file, enc, cb) {
|
||||||
|
// do this with every chunk (file in gulp terms)
|
||||||
|
|
||||||
|
let bundleCallback = function(err, bufferedContent) {
|
||||||
|
// our bundle callback for when browserify is finished
|
||||||
|
if (Buffer.isBuffer(bufferedContent)) {
|
||||||
|
file.contents = bufferedContent;
|
||||||
|
} else {
|
||||||
|
console.log('gulp-browser: .browserify() ' + err.message);
|
||||||
|
cb(new Error(err.message), file);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cb(null, file);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (file.contents.length > 0) {
|
||||||
|
let browserified = plugins.browserify(file, { basedir: file.base });
|
||||||
|
|
||||||
|
transforms.forEach(function(transform) {
|
||||||
|
if (typeof transform === 'function') {
|
||||||
|
browserified.transform(transform);
|
||||||
|
} else {
|
||||||
|
browserified.transform(transform.transform, transform.options);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
browserified.bundle(bundleCallback);
|
||||||
|
} else {
|
||||||
|
console.warn('gulp-browser: .browserify() file.contents appears to be empty');
|
||||||
|
cb(null, file);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let atEnd = function(cb) {
|
||||||
|
cb();
|
||||||
|
}; // no need to clean up after ourselves
|
||||||
|
|
||||||
|
return plugins.through2.obj(forEach, atEnd); // this is the through object that gets returned by gulpBrowser.browserify();
|
||||||
|
};
|
||||||
|
|
||||||
|
export = browserify;
|
3
ts/gulpbrowser.plugins.ts
Normal file
3
ts/gulpbrowser.plugins.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export import through2 = require('through2');
|
||||||
|
export import path = require('path');
|
||||||
|
export import browserify = require('browserify');
|
19
ts/index.ts
19
ts/index.ts
@ -1,18 +1 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
export import browserify = require('./gulpbrowser.browserify');
|
||||||
/// <reference path="./modulebrowserify.ts" />
|
|
||||||
|
|
||||||
var plugins = {
|
|
||||||
beautylog: require("beautylog"),
|
|
||||||
through: require("through2"),
|
|
||||||
gutil: require("gulp-util"),
|
|
||||||
path: require("path"),
|
|
||||||
browserify: require("browserify")
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//create the return object
|
|
||||||
var gulpBrowser:any = {};
|
|
||||||
|
|
||||||
gulpBrowser.browserify = GulpBrowserBrowserify.init();
|
|
||||||
|
|
||||||
module.exports = gulpBrowser;
|
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
module GulpBrowserBrowserify {
|
|
||||||
export function init() {
|
|
||||||
return function() {
|
|
||||||
return plugins.through.obj((file, enc, cb) => { //this is the through object that gets returned by gulpBrowser.browserify();
|
|
||||||
var bundleCallback = function(err, bufferedContent) {
|
|
||||||
if (Buffer.isBuffer(bufferedContent)){
|
|
||||||
file.contents = bufferedContent;
|
|
||||||
} else {
|
|
||||||
plugins.beautylog.error("gulp-browser: .browserify() " + err.message);
|
|
||||||
}
|
|
||||||
cb(null,file);
|
|
||||||
};
|
|
||||||
plugins.browserify(file, { basedir: file.base })
|
|
||||||
.bundle(bundleCallback)
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
23
ts/test.ts
23
ts/test.ts
@ -1,23 +0,0 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
|
||||||
var plugins = {
|
|
||||||
beautylog: require("beautylog"),
|
|
||||||
gulp: require("gulp"),
|
|
||||||
gulpBrowser: require("../index.js"),
|
|
||||||
gulpFunction: require("gulp-function")
|
|
||||||
};
|
|
||||||
|
|
||||||
describe("gulpBrowser",function(){
|
|
||||||
describe(".browserify",function(){
|
|
||||||
it("should run through smoothly",function(done){
|
|
||||||
this.timeout(20000);
|
|
||||||
plugins.gulp.task('gulpBrowserNormal',function(cb) {
|
|
||||||
var stream = plugins.gulp.src('./test/browserifyGulpTest.js')
|
|
||||||
.pipe(plugins.gulpBrowser.browserify())
|
|
||||||
.pipe(plugins.gulp.dest("./test/result/"))
|
|
||||||
.pipe(plugins.gulpFunction(done));
|
|
||||||
return stream;
|
|
||||||
});
|
|
||||||
plugins.gulp.start.apply(plugins.gulp, ['gulpBrowserNormal']);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
15
ts/tsd.json
15
ts/tsd.json
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "v4",
|
|
||||||
"repo": "borisyankov/DefinitelyTyped",
|
|
||||||
"ref": "master",
|
|
||||||
"path": "typings",
|
|
||||||
"bundle": "typings/tsd.d.ts",
|
|
||||||
"installed": {
|
|
||||||
"node/node.d.ts": {
|
|
||||||
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
|
|
||||||
},
|
|
||||||
"browserify/browserify.d.ts": {
|
|
||||||
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"ambientDependencies": {
|
|
||||||
"browserify": "github:DefinitelyTyped/DefinitelyTyped/browserify/browserify.d.ts",
|
|
||||||
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
|
|
||||||
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
3
tslint.json
Normal file
3
tslint.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "tslint-config-standard"
|
||||||
|
}
|
Reference in New Issue
Block a user