Compare commits

..

No commits in common. "master" and "v2.1.7" have entirely different histories.

23 changed files with 300 additions and 6709 deletions

12
.gitignore vendored
View File

@ -1,6 +1,14 @@
node_modules/
.settings/
.idea/
npm-debug.log
ts/*.js
ts/*.js.map
ts/typings/
test/result/
coverage/
pages/
public
docs/

View File

@ -1,150 +1,37 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: "$CI_BUILD_STAGE"
image: hosttoday/ht-docker-node:latest
stages:
- security
- test
- release
- metadata
- page
# ====================
# security stage
# ====================
mirror:
stage: security
testLEGACY:
stage: test
script:
- npmci git mirror
- npmci test legacy
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
sast:
stage: security
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- npmci npm prepare
- npmci npm install
- npmci command npm run build
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
--volume "$PWD:/code"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
artifacts:
reports:
sast: gl-sast-report.json
tags:
- docker
- priv
# ====================
# test stage
# ====================
- docker
testLTS:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
- npmci test lts
tags:
- docker
- notpriv
- docker
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
- npmci test stable
tags:
- docker
- notpriv
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags:
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: metadata
script:
- npmci command npm install -g typedoc typescript
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags:
- docker
- notpriv
- npmci publish npm
- npmci trigger
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true
tags:
- docker

15
.travis.yml Normal file
View File

@ -0,0 +1,15 @@
language: node_js
node_js:
- 4
- stable
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=

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015 Lossless GmbH
Copyright (c) 2015 Push.Rocks
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,57 +1,45 @@
# @pushrocks/gulp-browser
# gulp-browser
browserify and other goodies for gulp
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/gulp-browser)
* [gitlab.com (source)](https://gitlab.com/pushrocks/gulp-browser)
* [github.com (source mirror)](https://github.com/pushrocks/gulp-browser)
* [docs (typedoc)](https://pushrocks.gitlab.io/gulp-browser/)
## Status for master
### Status
[![build status](https://gitlab.com/pushrocks/gulp-browser/badges/master/build.svg)](https://gitlab.com/pushrocks/gulp-browser/commits/master)
[![coverage report](https://gitlab.com/pushrocks/gulp-browser/badges/master/coverage.svg)](https://gitlab.com/pushrocks/gulp-browser/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/gulp-browser.svg)](https://www.npmjs.com/package/@pushrocks/gulp-browser)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/gulp-browser/badge.svg)](https://snyk.io/test/npm/@pushrocks/gulp-browser)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![Dependency Status](https://david-dm.org/pushrocks/gulp-browser.svg)](https://david-dm.org/pushrocks/gulp-browser)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/gulp-browser/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/gulp-browser/badges/code.svg)](https://www.bithound.io/github/pushrocks/gulp-browser)
[![codecov.io](https://codecov.io/github/pushrocks/gulp-browser/coverage.svg?branch=master)](https://codecov.io/github/pushrocks/gulp-browser?branch=master)
## Usage
Use TypeScript for best in class instellisense.
### Usage
gulp-browser is meant to be easy:
#### Browserify:
```typescript
let gulp = require("gulp");
let gulpBrowser = require("gulp-browser");
```javascript
let gulp = require('gulp');
let gulpBrowser = require('gulp-browser');
let transforms = [];
let transforms = [
{
transform: 'babelify',
options: { presets: ['es2015'] }
}
];
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;
});
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.
### Dev Information:
[![devDependency Status](https://david-dm.org/pushrocks/gulp-browser/dev-status.svg)](https://david-dm.org/pushrocks/gulp-browser#info=devDependencies)
[![bitHound Dev Dependencies](https://www.bithound.io/github/pushrocks/gulp-browser/badges/devDependencies.svg)](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
### Extending this module
If you have ideas for other great browser related gulp pipe stops, feel free to raise an issue on GitHub.
### Contributors
* [Phil Kunz](https://github.com/philkunz)
* [Steffan Donal](https://github.com/SteffanDonal)
- [Phil Kunz](https://github.com/philkunz)
- [Steffan Donal](https://github.com/SteffanDonal)
### About the maintainer:
[![Project Phase](https://mediaserve.lossless.digital/lossless.com/img/createdby_github.svg)](https://lossless.com/)
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)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)
[![PayPal](https://img.shields.io/badge/Support%20us-PayPal-blue.svg)](https://paypal.me/lossless)

3
dist/gulpbrowser.browserify.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import "typings-global";
declare let browserify: (transforms?: any[]) => any;
export = browserify;

46
dist/gulpbrowser.browserify.js vendored Normal file
View 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBicm93c2VyLmJyb3dzZXJpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFPLE9BQU8sV0FBVyx1QkFBdUIsQ0FBQyxDQUFDO0FBR2xELElBQUksVUFBVSxHQUFJLFVBQVMsVUFBZTtJQUFmLDBCQUFlLEdBQWYsZUFBZTtJQUV0QyxFQUFFLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzdCLFVBQVUsR0FBRyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQzlCLENBQUM7SUFFRCxJQUFJLE9BQU8sR0FBRyxVQUFTLElBQUksRUFBRSxHQUFH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pZmllZC50cmFuc2Zvcm0odHJhbnNmb3JtKTtcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJvd3NlcmlmaWVkLnRyYW5zZm9ybSh0cmFuc2Zvcm0udHJhbnNmb3JtLCB0cmFuc2Zvcm0ub3B0aW9ucyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG5cclxuICAgICAgICAgICAgYnJvd3NlcmlmaWVkLmJ1bmRsZShidW5kbGVDYWxsYmFjayk7XHJcbiAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cud2FybihcImd1bHAtYnJvd3NlcjogLmJyb3dzZXJpZnkoKSBmaWxlLmNvbnRlbnRzIGFwcGVhcnMgdG8gYmUgZW1wdHlcIik7XHJcbiAgICAgICAgICAgIGNiKG51bGwsZmlsZSk7XHJcbiAgICAgICAgfTtcclxuICAgIH1cclxuXHJcbiAgICBsZXQgYXRFbmQgPSBmdW5jdGlvbihjYil7XHJcbiAgICAgICAgY2IoKTtcclxuICAgIH0gLy8gbm8gbmVlZCB0byBjbGVhbiB1cCBhZnRlciBvdXJzZWx2ZXNcclxuXHJcbiAgICByZXR1cm4gcGx1Z2lucy50aHJvdWdoLm9iaihmb3JFYWNoLGF0RW5kKTsgLy8gdGhpcyBpcyB0aGUgdGhyb3VnaCBvYmplY3QgdGhhdCBnZXRzIHJldHVybmVkIGJ5IGd1bHBCcm93c2VyLmJyb3dzZXJpZnkoKTtcclxuIH07XHJcblxyXG5leHBvcnQgPSBicm93c2VyaWZ5O1xyXG4iXX0=

5
dist/gulpbrowser.plugins.d.ts vendored Normal file
View 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
View 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
View File

@ -0,0 +1,2 @@
import "typings-global";
export import browserify = require("./gulpbrowser.browserify");

5
dist/index.js vendored Normal file
View File

@ -0,0 +1,5 @@
"use strict";
require("typings-global");
exports.browserify = require("./gulpbrowser.browserify");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFFVixrQkFBVSxXQUFXLDBCQUEwQixDQUFDLENBQUMiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgXCJ0eXBpbmdzLWdsb2JhbFwiO1xyXG5cclxuZXhwb3J0IGltcG9ydCBicm93c2VyaWZ5ID0gcmVxdWlyZShcIi4vZ3VscGJyb3dzZXIuYnJvd3NlcmlmeVwiKTtcclxuXHJcbiJdfQ==

View File

@ -1,19 +0,0 @@
{
"gitzone": {
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "gulp-browser",
"shortDescription": "browserify and other goodies for gulp",
"npmPackagename": "@push.rocks/gulp-browser",
"license": "MIT"
}
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"tsdocs": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

4
npmts.json Normal file
View File

@ -0,0 +1,4 @@
{
"mode":"default",
"coveralls":true
}

6377
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,14 @@
{
"name": "@push.rocks/gulp-browser",
"version": "3.0.19",
"private": false,
"name": "gulp-browser",
"version": "2.1.7",
"description": "browserify and other goodies for gulp",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild)"
"test": "(npmts)",
"reinstall": "(rm -r node_modules && npm install)",
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
"update": "(git checkout master && git pull origin master && npm install)",
"upgrade": "(npm run update) && (ncu upgradeAll && npm install)"
},
"repository": {
"type": "git",
@ -15,10 +16,7 @@
},
"keywords": [
"gulpplugin",
"browserify",
"browser",
"TypeScript",
"typed"
"browserify"
],
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"license": "MIT",
@ -27,21 +25,16 @@
},
"homepage": "https://gitlab.com/pushrocks/gulp-browser",
"dependencies": {
"@pushrocks/smartpromise": "^2.0.5",
"@types/browserify": "^12.0.36",
"@types/through2": "^2.0.34",
"browserify": "^16.2.3",
"through2": "^3.0.0"
"beautylog": "^5.0.8",
"browserify": "^13.0.1",
"through2": "^2.0.1",
"typings-global": "^1.0.3"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.8",
"@gitzone/tstest": "^1.0.18",
"@pushrocks/gulp-function": "^3.0.1",
"@pushrocks/tapbundle": "^3.0.7",
"@types/gulp": "^4.0.5",
"babel-core": "^6.26.3",
"babel-preset-es2015": "^6.24.1",
"babelify": "^10.0.0",
"gulp": "^4.0.0"
"gulp": "^3.9.1",
"gulp-function": "^1.3.1",
"npmts": "^5.2.1",
"should": "^9.0.0",
"typings-test": "^1.0.1"
}
}

2
test/test.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import "typings-test";
import "should";

43
test/test.js Normal file
View File

@ -0,0 +1,43 @@
"use strict";
require("typings-test");
var plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
gulpBrowser: require("../dist/index.js"),
gulpFunction: require("gulp-function")
};
require("should");
describe("gulpBrowser", function () {
describe(".browserify", function () {
it("should run through smoothly", function (done) {
this.timeout(30000);
var 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) {
var d = require('domain').create();
var doneCalled = false;
d.on("error", function (error) {
console.log(error.message);
if (!doneCalled) {
done();
doneCalled = true;
}
});
d.run(function () {
var stream = plugins.gulp.src("./test/testBrowserifyError.js")
.pipe(plugins.gulpBrowser.browserify());
});
});
it("should run through with an empty file", function (done) {
var stream = plugins.gulp.src('./test/testBrowserifyEmpty.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/"))
.pipe(plugins.gulpFunction(done));
});
});
});
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FDUCxDQUFDLENBRG9CO0FBQ3JCLElBQUksT0FBTyxHQUFHO0lBQ1YsU0FBUyxFQUFFLE9BQU8sQ0FBQyxXQUFXLENBQUM7SUFDL0IsSUFBSSxFQUFFLE9BQU8sQ0FBQyxNQUFNLENBQUM7SUFDckIsV0FBVyxFQUFFLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQztJQUN4QyxZQUFZLEVBQUUsT0FBTyxDQUFDLGVBQWUsQ0FBQztDQUN6QyxDQUFDO0FBQ0YsUUFBTyxRQUFRLENBQUMsQ0FBQTtBQUdoQixRQUFRLENBQUMsYUFBYSxFQUFFO0lBQ3BCLFFBQVEsQ0FBQyxhQUFhLEVBQUU7UUFDcEIsRUFBRSxDQUFDLDZCQUE2QixFQUFFLFVBQVUsSUFBSTtZQUM1QyxJQUFJLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDO1lBQ3BCLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJL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VhbSA9IHBsdWdpbnMuZ3VscC5zcmMoJy4vdGVzdC90ZXN0QnJvd3NlcmlmeU5vcm1hbC5qcycpXHJcbiAgICAgICAgICAgICAgICAucGlwZShwbHVnaW5zLmd1bHBCcm93c2VyLmJyb3dzZXJpZnkoKSlcclxuICAgICAgICAgICAgICAgIC5waXBlKHBsdWdpbnMuZ3VscC5kZXN0KFwiLi90ZXN0L3Jlc3VsdC9cIikpXHJcbiAgICAgICAgICAgICAgICAucGlwZShwbHVnaW5zLmd1bHBGdW5jdGlvbihkb25lKSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgXHJcbiAgICAgICAgaXQoXCJzaG91bGQgdGhyb3cgYW4gZXJyb3IsIHdoZW4gYSBtb2R1bGUgaXMgbm90IGZvdW5kXCIsIGZ1bmN0aW9uIChkb25lKSB7XHJcbiAgICAgICAgICAgIGxldCBkID0gcmVxdWlyZSgnZG9tYWluJykuY3JlYXRlKCk7XHJcbiAgICAgICAgICAgIGxldCBkb25lQ2FsbGVkID0gZmFsc2VcclxuICAgICAgICAgICAgZC5vbihcImVycm9yXCIsZnVuY3Rpb24oZXJyb3Ipe1xyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IubWVzc2FnZSlcclxuICAgICAgICAgICAgICAgIGlmKCFkb25lQ2FsbGVkKXtcclxuICAgICAgICAgICAgICAgICAgICBkb25lKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgZG9uZUNhbGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pOyBcclxuICAgICAgICAgICAgZC5ydW4oZnVuY3Rpb24oKSB7IFxyXG4gICAgICAgICAgICAgICAgbGV0IHN0cmVhbSA9IHBsdWdpbnMuZ3VscC5zcmMoXCIuL3Rlc3QvdGVzdEJyb3dzZXJpZnlFcnJvci5qc1wiKVxyXG4gICAgICAgICAgICAgICAgICAgIC5waXBlKHBsdWdpbnMuZ3VscEJyb3dzZXIuYnJvd3NlcmlmeSgpKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgXHJcbiAgICAgICAgaXQoXCJzaG91bGQgcnVuIHRocm91Z2ggd2l0aCBhbiBlbXB0eSBmaWxlXCIsIGZ1bmN0aW9uIChkb25lKSB7XHJcbiAgICAgICAgICAgIGxldCBzdHJlYW0gPSBwbHVnaW5zLmd1bHAuc3JjKCcuL3Rlc3QvdGVzdEJyb3dzZXJpZnlFbXB0eS5qcycpXHJcbiAgICAgICAgICAgICAgICAucGlwZShwbHVnaW5zLmd1bHBCcm93c2VyLmJyb3dzZXJpZnkoKSlcclxuICAgICAgICAgICAgICAgIC5waXBlKHBsdWdpbnMuZ3VscC5kZXN0KFwiLi90ZXN0L3Jlc3VsdC9cIikpXHJcbiAgICAgICAgICAgICAgICAucGlwZShwbHVnaW5zLmd1bHBGdW5jdGlvbihkb25lKSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9KTtcclxufSk7XHJcbiJdfQ==

1
test/test.js.map Normal file
View 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;i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AAC;AACP,CAAC,CAAC,CAAC"}

View File

@ -1,57 +1,44 @@
import * as gulp from 'gulp';
import * as gulpFunction from '@pushrocks/gulp-function';
import * as smartpromise from '@pushrocks/smartpromise';
import "typings-test"
let plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
gulpBrowser: require("../dist/index.js"),
gulpFunction: require("gulp-function")
};
import "should";
import { expect, tap } from '@pushrocks/tapbundle';
import * as gulpBrowser from '../ts/index';
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));
});
tap.test('should run through smoothly', async () => {
let done = smartpromise.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;
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));
});
});
});
tap.test('should run through with an empty file', async () => {
let done = smartpromise.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 = smartpromise.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();

View File

@ -1,50 +1,49 @@
import * as stream from 'stream';
import plugins = require('./gulpbrowser.plugins');
import * as smartpromise from '@pushrocks/smartpromise';
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 browserify = function(transforms = []) {
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);
if (!Array.isArray(transforms)) {
transforms = [transforms];
}
};
let atEnd = function(cb) {
cb();
}; // no need to clean up after ourselves
let forEach = function(file, enc, cb){ // do this with every chunk (file in gulp terms)
return plugins.through2.obj(forEach, atEnd); // this is the through object that gets returned by gulpBrowser.browserify();
};
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;

View File

@ -1,3 +1,5 @@
export import through2 = require('through2');
export import path = require('path');
export import browserify = require('browserify');
import "typings-global";
export let beautylog = require("beautylog");
export let through = require("through2");
export let path = require("path");
export let browserify = require("browserify");

View File

@ -1 +1,4 @@
export import browserify = require('./gulpbrowser.browserify');
import "typings-global";
export import browserify = require("./gulpbrowser.browserify");

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}