Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -8,3 +8,7 @@ ts/*.js.map
|
|||||||
ts/typings/
|
ts/typings/
|
||||||
|
|
||||||
test/result/
|
test/result/
|
||||||
|
|
||||||
|
coverage/
|
||||||
|
|
||||||
|
docs/
|
37
.gitlab-ci.yml
Normal file
37
.gitlab-ci.yml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
image: hosttoday/ht-docker-node:latest
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- release
|
||||||
|
- page
|
||||||
|
|
||||||
|
testLEGACY:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test legacy
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
testLTS:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test lts
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
testSTABLE:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test stable
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
script:
|
||||||
|
- npmci publish npm
|
||||||
|
- npmci trigger
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
@ -1,3 +1,4 @@
|
|||||||
node_modules
|
node_modules
|
||||||
test
|
test
|
||||||
ts
|
ts
|
||||||
|
coverage/
|
@ -1,6 +1,7 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- '4.2.4'
|
- 4
|
||||||
|
- stable
|
||||||
deploy:
|
deploy:
|
||||||
provider: npm
|
provider: npm
|
||||||
email: npm@lossless.digital
|
email: npm@lossless.digital
|
||||||
|
34
README.md
34
README.md
@ -1,24 +1,31 @@
|
|||||||
# gulp-browser
|
# gulp-browser
|
||||||
browserify and other goodies for gulp
|
browserify and other goodies for gulp
|
||||||
|
|
||||||
### Build Status/Dependencies
|
### Status
|
||||||
[](https://travis-ci.org/pushrocks/gulp-browser)
|
[](https://gitlab.com/pushrocks/gulp-browser/commits/master)
|
||||||
[](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://codecov.io/github/pushrocks/gulp-browser?branch=master)
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
gulp-browser is meant to be easy:
|
gulp-browser is meant to be easy:
|
||||||
|
|
||||||
#### Browserify:
|
#### Browserify:
|
||||||
```javascript
|
```typescript
|
||||||
var gulp = require("gulp");
|
let gulp = require("gulp");
|
||||||
var gulpBrowser = require("gulp-browser");
|
let gulpBrowser = require("gulp-browser");
|
||||||
|
|
||||||
|
let transforms = [
|
||||||
|
{
|
||||||
|
transform: "babelify",
|
||||||
|
options: {presets: ["es2015"]}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
gulp.task('gulpBrowserTest',function() {
|
gulp.task('gulpBrowserTest',function() {
|
||||||
var stream = gulp.src('./test/*.js')
|
var stream = gulp.src('./test/*.js')
|
||||||
.pipe(gulpBrowser.browserify())
|
.pipe(gulpBrowser.browserify(transforms)) // gulp.browserify() accepts an optional array of tansforms
|
||||||
.pipe(gulp.dest("./test/browserifiedJS/"));
|
.pipe(gulp.dest("./test/browserifiedJS/"));
|
||||||
return stream;
|
return stream;
|
||||||
});
|
});
|
||||||
@ -30,7 +37,14 @@ gulp-browser is meant to be easy:
|
|||||||
[](https://david-dm.org/pushrocks/gulp-browser#info=devDependencies)
|
[](https://david-dm.org/pushrocks/gulp-browser#info=devDependencies)
|
||||||
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
||||||
|
|
||||||
### About the authors:
|
### Extending this module
|
||||||
[](https://lossless.com/)
|
If you have ideas for other great browser related gulp pipe stops, feel free to raise an issue on GitHub.
|
||||||
|
|
||||||
[](https://paypal.me/lossless)
|
### Contributors
|
||||||
|
* [Phil Kunz](https://github.com/philkunz)
|
||||||
|
* [Steffan Donal](https://github.com/SteffanDonal)
|
||||||
|
|
||||||
|
### About the maintainer:
|
||||||
|
[](https://lossless.com/)
|
||||||
|
|
||||||
|
[](https://paypal.me/lossless)
|
@ -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
|
|
3
dist/gulpbrowser.browserify.d.ts
vendored
Normal file
3
dist/gulpbrowser.browserify.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import "typings-global";
|
||||||
|
declare let browserify: (transforms?: any[]) => any;
|
||||||
|
export = browserify;
|
46
dist/gulpbrowser.browserify.js
vendored
Normal file
46
dist/gulpbrowser.browserify.js
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
|
var plugins = require("./gulpbrowser.plugins");
|
||||||
|
var browserify = function (transforms) {
|
||||||
|
if (transforms === void 0) { transforms = []; }
|
||||||
|
if (!Array.isArray(transforms)) {
|
||||||
|
transforms = [transforms];
|
||||||
|
}
|
||||||
|
var forEach = 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(new Error(err.message), file);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cb(null, file);
|
||||||
|
};
|
||||||
|
if (file.contents.length > 0) {
|
||||||
|
var browserified_1 = plugins.browserify(file, { basedir: file.base });
|
||||||
|
transforms.forEach(function (transform) {
|
||||||
|
if (typeof transform === 'function') {
|
||||||
|
browserified_1.transform(transform);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
browserified_1.transform(transform.transform, transform.options);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
browserified_1.bundle(bundleCallback);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
plugins.beautylog.warn("gulp-browser: .browserify() file.contents appears to be empty");
|
||||||
|
cb(null, file);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
};
|
||||||
|
var atEnd = function (cb) {
|
||||||
|
cb();
|
||||||
|
}; // no need to clean up after ourselves
|
||||||
|
return plugins.through.obj(forEach, atEnd); // this is the through object that gets returned by gulpBrowser.browserify();
|
||||||
|
};
|
||||||
|
module.exports = browserify;
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBicm93c2VyLmJyb3dzZXJpZnkudHMiXSwibmFtZXMiO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iAgICByZXR1cm4gcGx1Z2lucy50aHJvdWdoLm9iaihmb3JFYWNoLGF0RW5kKTsgLy8gdGhpcyBpcyB0aGUgdGhyb3VnaCBvYmplY3QgdGhhdCBnZXRzIHJldHVybmVkIGJ5IGd1bHBCcm93c2VyLmJyb3dzZXJpZnkoKTtcclxuIH07XHJcblxyXG5leHBvcnQgPSBicm93c2VyaWZ5O1xyXG4iXX0=
|
5
dist/gulpbrowser.plugins.d.ts
vendored
Normal file
5
dist/gulpbrowser.plugins.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import "typings-global";
|
||||||
|
export declare let beautylog: any;
|
||||||
|
export declare let through: any;
|
||||||
|
export declare let path: any;
|
||||||
|
export declare let browserify: any;
|
8
dist/gulpbrowser.plugins.js
vendored
Normal file
8
dist/gulpbrowser.plugins.js
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
|
exports.beautylog = require("beautylog");
|
||||||
|
exports.through = require("through2");
|
||||||
|
exports.path = require("path");
|
||||||
|
exports.browserify = require("browserify");
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBicm93c2VyLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUNiLGlCQUFTLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLGVBQU8sR0FBRyxPQUFPLENBQUMsVUFBVSxDQUFDLENBQUM7QUFDOUIsWUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUN2QixrQkFBVSxHQUFHLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FBQyIsImZpbGUiOiJndWxwYnJvd3Nlci5wbHVnaW5zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcclxuZXhwb3J0IGxldCBiZWF1dHlsb2cgPSByZXF1aXJlKFwiYmVhdXR5bG9nXCIpO1xyXG5leHBvcnQgbGV0IHRocm91Z2ggPSByZXF1aXJlKFwidGhyb3VnaDJcIik7XHJcbmV4cG9ydCBsZXQgcGF0aCA9IHJlcXVpcmUoXCJwYXRoXCIpO1xyXG5leHBvcnQgbGV0IGJyb3dzZXJpZnkgPSByZXF1aXJlKFwiYnJvd3NlcmlmeVwiKTtcclxuIl19
|
2
dist/index.d.ts
vendored
Normal file
2
dist/index.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import "typings-global";
|
||||||
|
export import browserify = require("./gulpbrowser.browserify");
|
5
dist/index.js
vendored
Normal file
5
dist/index.js
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
|
exports.browserify = require("./gulpbrowser.browserify");
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFFVixrQkFBVSxXQUFXLDBCQUEwQixDQUFDLENBQUMiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgXCJ0eXBpbmdzLWdsb2JhbFwiO1xyXG5cclxuZXhwb3J0IGltcG9ydCBicm93c2VyaWZ5ID0gcmVxdWlyZShcIi4vZ3VscGJyb3dzZXIuYnJvd3NlcmlmeVwiKTtcclxuXHJcbiJdfQ==
|
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;
|
|
26
package.json
26
package.json
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "gulp-browser",
|
"name": "gulp-browser",
|
||||||
"version": "1.0.8",
|
"version": "2.1.9",
|
||||||
"description": "browserify and other goodies for gulp",
|
"description": "browserify and other goodies for gulp",
|
||||||
"main": "index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npmts)",
|
"test": "(npmts)",
|
||||||
"reinstall": "(rm -r node_modules && npm install)",
|
"reinstall": "(rm -r node_modules && npm install)",
|
||||||
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"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",
|
||||||
@ -21,18 +21,20 @@
|
|||||||
"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",
|
"beautylog": "^5.0.8",
|
||||||
"browserify": "13.0.0",
|
"browserify": "^13.0.1",
|
||||||
"gulp-util": "3.0.7",
|
"through2": "^2.0.1",
|
||||||
"through2": "2.0.1"
|
"typings-global": "^1.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-function": "1.0.2",
|
"gulp-function": "^1.3.1",
|
||||||
"npmts": "^2.1.8"
|
"npmts": "^5.2.1",
|
||||||
|
"should": "^9.0.0",
|
||||||
|
"typings-test": "^1.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
test/test.d.ts
vendored
Normal file
2
test/test.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import "typings-test";
|
||||||
|
import "should";
|
61
test/test.js
61
test/test.js
File diff suppressed because one or more lines are too long
1
test/test.js.map
Normal file
1
test/test.js.map
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,OAAO,GAAG;IACV,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC,kBAAkB,CAAC;IACxC,YAAY,EAAE,OAAO,CAAC,eAAe,CAAC;CACzC,CAAC;AACF,IAAI,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAG/B,QAAQ,CAAC,aAAa,EAAE;IACpB,QAAQ,CAAC,aAAa,EAAE;QACpB,EAAE,CAAC,6BAA6B,EAAE,UAAU,IAAI;YAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,IAAI,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC;iBAC1D,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;iBACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;iBACzC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mDAAmD,EAAE,UAAU,IAAI;YAClE,IAAI,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;YACnC,IAAI,UAAU,GAAG,KAAK,CAAA;YACtB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAC,UAAS,KAAK;gBACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;gBAC1B,EAAE,CAAA,CAAC,CAAC,UAAU,CAAC,CAAA,CAAC;oBACZ,IAAI,EAAE,CAAC;oBACP,UAAU,GAAG,IAAI,CAAC;gBACtB,CAAC;YACL,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,GAAG,CAAC;gBACF,IAAI,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,+BAA+B,CAAC;qBACzD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uCAAuC,EAAE,UAAU,IAAI;YACtD,IAAI,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,+BAA+B,CAAC;iBACzD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;iBACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;iBACzC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
57
test/test.ts
Normal file
57
test/test.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import "typings-test"
|
||||||
|
let plugins = {
|
||||||
|
beautylog: require("beautylog"),
|
||||||
|
gulp: require("gulp"),
|
||||||
|
gulpBrowser: require("../dist/index.js"),
|
||||||
|
gulpFunction: require("gulp-function")
|
||||||
|
};
|
||||||
|
import "should";
|
||||||
|
|
||||||
|
|
||||||
|
describe("gulpBrowser", function () {
|
||||||
|
describe(".browserify", function () {
|
||||||
|
it("should run through smoothly", function (done) {
|
||||||
|
this.timeout(30000);
|
||||||
|
let stream = plugins.gulp.src('./test/testBrowserifyNormal.js')
|
||||||
|
.pipe(plugins.gulpBrowser.browserify())
|
||||||
|
.pipe(plugins.gulp.dest("./test/result/"))
|
||||||
|
.pipe(plugins.gulpFunction(done));
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should throw an error, when a module is not found", function (done) {
|
||||||
|
let d = require('domain').create();
|
||||||
|
let doneCalled = false
|
||||||
|
d.on("error",function(error){
|
||||||
|
console.log(error.message)
|
||||||
|
if(!doneCalled){
|
||||||
|
done();
|
||||||
|
doneCalled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
d.run(function() {
|
||||||
|
let stream = plugins.gulp.src("./test/testBrowserifyError.js")
|
||||||
|
.pipe(plugins.gulpBrowser.browserify());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should run through with an empty file", function (done) {
|
||||||
|
let stream = plugins.gulp.src('./test/testBrowserifyEmpty.js')
|
||||||
|
.pipe(plugins.gulpBrowser.browserify())
|
||||||
|
.pipe(plugins.gulp.dest("./test/result/"))
|
||||||
|
.pipe(plugins.gulpFunction(done));
|
||||||
|
});
|
||||||
|
it("should run through work with transforms", function (done) {
|
||||||
|
this.timeout(30000);
|
||||||
|
let transforms = [
|
||||||
|
{
|
||||||
|
transform: "babelify",
|
||||||
|
options: {presets: ["es2015"]}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
let stream = plugins.gulp.src('./test/testBrowserifyNormal.js')
|
||||||
|
.pipe(plugins.gulpBrowser.browserify(transforms))
|
||||||
|
.pipe(plugins.gulp.dest("./test/result/"))
|
||||||
|
.pipe(plugins.gulpFunction(done));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
0
test/testBrowserifyEmpty.js
Normal file
0
test/testBrowserifyEmpty.js
Normal file
49
ts/gulpbrowser.browserify.ts
Normal file
49
ts/gulpbrowser.browserify.ts
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
import "typings-global";
|
||||||
|
import 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 {
|
||||||
|
plugins.beautylog.error("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 {
|
||||||
|
plugins.beautylog.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.through.obj(forEach,atEnd); // this is the through object that gets returned by gulpBrowser.browserify();
|
||||||
|
};
|
||||||
|
|
||||||
|
export = browserify;
|
5
ts/gulpbrowser.plugins.ts
Normal file
5
ts/gulpbrowser.plugins.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import "typings-global";
|
||||||
|
export let beautylog = require("beautylog");
|
||||||
|
export let through = require("through2");
|
||||||
|
export let path = require("path");
|
||||||
|
export let browserify = require("browserify");
|
18
ts/index.ts
18
ts/index.ts
@ -1,18 +1,4 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
import "typings-global";
|
||||||
/// <reference path="./modulebrowserify.ts" />
|
|
||||||
|
|
||||||
var plugins = {
|
export import browserify = require("./gulpbrowser.browserify");
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user