Compare commits

...

70 Commits

Author SHA1 Message Date
53d27dae90 update npmextra.json: githost 2024-04-01 21:33:03 +02:00
b24d1e978a update npmextra.json: githost 2024-04-01 19:57:20 +02:00
c5dfbc6aab update npmextra.json: githost 2024-03-30 21:46:16 +01:00
3e5133df51 switch to new org scheme 2023-07-10 02:41:14 +02:00
ce906cb908 3.0.19 2019-02-14 11:07:58 +01:00
caea0e0dcd fix(core): update 2019-02-14 11:07:57 +01:00
3585264df8 3.0.18 2019-02-13 22:05:37 +01:00
2df97435ce fix(structure): format 2019-02-13 22:05:37 +01:00
22fdf03d3c 3.0.17 2019-02-13 21:23:03 +01:00
69bd6a03a0 fix(core): update 2019-02-13 21:23:03 +01:00
56b675dbbf 3.0.16 2019-02-13 00:49:53 +01:00
0aab9fcff9 fix(core): update 2019-02-13 00:49:52 +01:00
f28557c403 3.0.15 2019-02-13 00:48:37 +01:00
95fac7da7e fix(build): remove npmts 2019-02-13 00:48:36 +01:00
0d1493ca2c 3.0.14 2019-02-13 00:29:32 +01:00
de02ccb0f8 fix(core): update 2019-02-13 00:29:32 +01:00
0261ce3c31 3.0.13 2019-02-13 00:24:14 +01:00
54c655b15a fix(core): update 2019-02-13 00:24:14 +01:00
206896f552 3.0.12 2019-02-13 00:22:19 +01:00
383e204ae2 fix(core): update to latest standards 2019-02-13 00:22:18 +01:00
31f21c7dec 3.0.11 2018-03-16 10:47:10 +01:00
a96db2e036 update dependencies 2018-03-16 10:47:06 +01:00
18e2a32b8e 3.0.10 2018-03-16 10:36:37 +01:00
6784784f86 update dependencies 2018-03-16 10:36:31 +01:00
6996193568 3.0.9 2018-03-16 10:31:06 +01:00
ebc07f4c5b update dependencies 2018-03-16 10:31:01 +01:00
088a5e6fe5 3.0.8 2018-03-15 01:21:25 +01:00
04345d1691 fix typo 2018-03-15 01:21:13 +01:00
ab6870a193 3.0.7 2018-03-15 00:33:50 +01:00
d1486c2bef update to latest Standards 2018-03-15 00:33:43 +01:00
87e684aa7b 3.0.6 2017-07-07 18:35:25 +02:00
9c31773f31 update docs 2017-07-07 18:35:20 +02:00
c0bb143128 3.0.5 2017-07-07 18:32:40 +02:00
d3069ebf5f update to latest standards 2017-07-07 18:32:37 +02:00
Philipp Kunz
d0e6bbd162 3.0.4 2016-12-23 22:09:57 +01:00
Philipp Kunz
9b27ed9e7f improve README and metadata 2016-12-23 22:09:55 +01:00
93ed4fbbf9 3.0.3 2016-12-13 23:02:10 +01:00
8aa5ce6a5d compiled 2016-12-13 23:02:07 +01:00
2992f54f11 added typings, removed beautylog 2016-12-13 23:01:25 +01:00
c9929963d7 3.0.2 2016-07-26 18:50:11 +02:00
5ea199e470 fix README 2016-07-26 18:50:00 +02:00
e729dd8e6f add node 6 badge 2016-07-26 18:48:06 +02:00
54335338ab 3.0.1 2016-07-26 18:30:44 +02:00
3109585d30 fix gitlab ci 2016-07-26 18:30:39 +02:00
b28b79cae6 3.0.0 2016-07-26 18:15:27 +02:00
a7d0bfc63f now fully es6 2016-07-26 18:15:03 +02:00
f436fffecd 2.1.9 2016-06-03 21:05:08 +02:00
77b5949a81 remove react from transform options 2016-06-03 21:05:04 +02:00
ad9dde6fb6 2.1.8 2016-06-03 20:57:40 +02:00
e928510886 compile 2016-06-03 20:57:34 +02:00
7065094a84 add babelify test and example 2016-06-03 20:57:10 +02:00
7e210d473f 2.1.7 2016-06-03 20:11:27 +02:00
e3aa4cbbcc now using typings-global 2016-06-03 20:11:17 +02:00
4a7ffa1caf 2.1.6 2016-06-03 19:39:06 +02:00
872eef5de8 2.1.5 2016-06-03 19:32:37 +02:00
7d464df932 update dependencies 2016-06-03 19:32:32 +02:00
712000b688 2.1.4 2016-05-13 18:22:12 +00:00
e2ed8c5f4c README fix 2016-05-13 18:22:03 +00:00
245449ee13 2.1.3 2016-05-13 18:20:14 +00:00
7cd695fc92 small TypeScript change 2016-05-13 18:20:07 +00:00
80223dc038 2.1.2 2016-05-13 18:18:53 +00:00
7b1df4148d update README 2016-05-13 18:18:49 +00:00
e81288a9dd 2.1.1 2016-05-13 18:15:31 +00:00
1734a2030b update README 2016-05-13 18:15:16 +00:00
65b96af6a8 2.1.0 2016-05-13 18:05:46 +00:00
eec824e959 2.0.2 2016-05-13 18:05:00 +00:00
d28634a865 compiled 2016-05-13 18:04:41 +00:00
540d9a9b56 Merge pull request #56 from enigmamarketing/master
Add ability to pass through transform plugins to browserify.
2016-05-13 19:55:09 +02:00
Steffan Donal
65c70eec98 Fix bug where passing an object with transform options causes an exception. 2016-05-13 15:31:24 +01:00
Steffan Donal
1622715a51 Add ability to pass through transform plugins to browserify. 2016-05-12 11:15:04 +01:00
20 changed files with 6739 additions and 254 deletions

12
.gitignore vendored
View File

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

150
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,150 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
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
# ====================
testLTS:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
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
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -1,15 +0,0 @@
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/HRCSbCbJkbmwTYtx4PV0xS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IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015 Push.Rocks
Copyright (c) 2015 Lossless GmbH
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,39 +1,57 @@
# gulp-browser
# @pushrocks/gulp-browser
browserify and other goodies for gulp
### Status
[![Build Status](https://travis-ci.org/pushrocks/gulp-browser.svg?branch=master)](https://travis-ci.org/pushrocks/gulp-browser)
[![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)
## 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/)
### Usage
gulp-browser is meant to be easy:
## Status for master
[![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/)
## Usage
Use TypeScript for best in class instellisense.
#### Browserify:
```javascript
var gulp = require("gulp");
var gulpBrowser = require("gulp-browser");
gulp.task('gulpBrowserTest',function() {
var stream = gulp.src('./test/*.js')
.pipe(gulpBrowser.browserify())
.pipe(gulp.dest("./test/browserifiedJS/"));
return stream;
});
let gulp = require('gulp');
let gulpBrowser = require('gulp-browser');
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;
});
```
> **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)
### Contributors
### Extending this module
If you have ideas for other great browser related gulp pipe stops, feel free to raise an issue on GitHub.
- [Phil Kunz](https://github.com/philkunz)
- [Steffan Donal](https://github.com/SteffanDonal)
### About the authors:
[![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.
[![PayPal](https://img.shields.io/badge/Support%20us-PayPal-blue.svg)](https://paypal.me/lossless)
> 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)

View File

@ -1,34 +0,0 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./gulpbrowser.plugins");
var browserify = function () {
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) {
plugins.browserify(file, { basedir: file.base })
.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;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBicm93c2VyLmJyb3dzZXJpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyx1QkFBdUIsQ0FBQyxDQUFDO0FBR2xELElBQUksVUFBVSxHQUFJO0lBRWQsSUFBSSxPQUFPLEdBQUcsVUFBUyxJQUFJLEVBQUUsR0FBRyxFQUFFLEVBQUU7UUFFaEMsSUFBSSxjQUFjLEdBQUcsVUFBUyxHQUFHLEVBQUUsZUFBZTtZQUM5QyxFQUFFLENBQUMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLGVBQWUsQ0FBQyxDQUFDLENBQUEsQ0FBQztnQkFDbEMsSUFBSSxDQUFDLFFBQVEsR0FBRyxlQUFlLENBQUM7WUFDcEMsQ0FBQztZQUFDLElBQUksQ0FBQyxDQUFDO2dCQUNKLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLDhCQUE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mJ1bmRsZShidW5kbGVDYWxsYmFjayk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwbHVnaW5zLmJlYXV0eWxvZy53YXJuKFwiZ3VscC1icm93c2VyOiAuYnJvd3NlcmlmeSgpIGZpbGUuY29udGVudHMgYXBwZWFycyB0byBiZSBlbXB0eVwiKTtcbiAgICAgICAgICAgIGNiKG51bGwsZmlsZSk7XG4gICAgICAgIH07XG4gICAgfVxuICAgICAgICBcbiAgICBsZXQgYXRFbmQgPSBmdW5jdGlvbihjYil7XG4gICAgICAgIGNiKCk7XG4gICAgfSAvLyBubyBuZWVkIHRvIGNsZWFuIHVwIGFmdGVyIG91cnNlbHZlc1xuICAgIFxuICAgIHJldHVybiBwbHVnaW5zLnRocm91Z2gub2JqKGZvckVhY2gsYXRFbmQpOyAvLyB0aGlzIGlzIHRoZSB0aHJvdWdoIG9iamVjdCB0aGF0IGdldHMgcmV0dXJuZWQgYnkgZ3VscEJyb3dzZXIuYnJvd3NlcmlmeSgpO1xuIH07XG5cbmV4cG9ydCA9IGJyb3dzZXJpZnk7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9

View File

@ -1,8 +0,0 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
exports.beautylog = require("beautylog");
exports.through = require("through2");
exports.path = require("path");
exports.browserify = require("browserify");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBicm93c2VyLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUNqQyxpQkFBUyxHQUFHLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FBQztBQUNqQyxlQUFPLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0FBQzlCLFlBQUksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDdkIsa0JBQVUsR0FBRyxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUMiLCJmaWxlIjoiZ3VscGJyb3dzZXIucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmV4cG9ydCBsZXQgYmVhdXR5bG9nID0gcmVxdWlyZShcImJlYXV0eWxvZ1wiKTtcbmV4cG9ydCBsZXQgdGhyb3VnaCA9IHJlcXVpcmUoXCJ0aHJvdWdoMlwiKTtcbmV4cG9ydCBsZXQgcGF0aCA9IHJlcXVpcmUoXCJwYXRoXCIpO1xuZXhwb3J0IGxldCBicm93c2VyaWZ5ID0gcmVxdWlyZShcImJyb3dzZXJpZnlcIik7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

5
dist/index.js vendored
View File

@ -1,5 +0,0 @@
/// <reference path="./typings/main.d.ts" />
"use strict";
exports.browserify = require("./gulpbrowser.browserify");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFFOUIsa0JBQVUsV0FBVywwQkFBMEIsQ0FBQyxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuXG5leHBvcnQgaW1wb3J0IGJyb3dzZXJpZnkgPSByZXF1aXJlKFwiLi9ndWxwYnJvd3Nlci5icm93c2VyaWZ5XCIpO1xuXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

19
npmextra.json Normal file
View File

@ -0,0 +1,19 @@
{
"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"
}
}

View File

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

6377
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +1,47 @@
{
"name": "gulp-browser",
"version": "2.0.1",
"name": "@push.rocks/gulp-browser",
"version": "3.0.19",
"private": false,
"description": "browserify and other goodies for gulp",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"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)"
"test": "(tstest test/)",
"build": "(tsbuild)"
},
"repository": {
"type": "git",
"url": "https://github.com/pushrocks/gulp-browser.git"
"url": "https://gitlab.com/pushrocks/gulp-browser.git"
},
"keywords": [
"gulpplugin",
"browserify"
"browserify",
"browser",
"TypeScript",
"typed"
],
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
"license": "MIT",
"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": {
"beautylog": "^4.1.1",
"browserify": "^13.0.0",
"through2": "^2.0.1"
"@pushrocks/smartpromise": "^2.0.5",
"@types/browserify": "^12.0.36",
"@types/through2": "^2.0.34",
"browserify": "^16.2.3",
"through2": "^3.0.0"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-function": "^1.2.5",
"npmts": "^5.0.3",
"should": "^8.3.0"
"@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"
}
}
}

View File

@ -1,42 +0,0 @@
/// <reference path="../ts/typings/main.d.ts" />
var plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
gulpBrowser: require("../dist/index.js"),
gulpFunction: require("gulp-function")
};
var should = 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.gulpB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AgICAgXG4gICAgICAgIGl0KFwic2hvdWxkIHRocm93IGFuIGVycm9yLCB3aGVuIGEgbW9kdWxlIGlzIG5vdCBmb3VuZFwiLCBmdW5jdGlvbiAoZG9uZSkge1xuICAgICAgICAgICAgbGV0IGQgPSByZXF1aXJlKCdkb21haW4nKS5jcmVhdGUoKTtcbiAgICAgICAgICAgIGxldCBkb25lQ2FsbGVkID0gZmFsc2VcbiAgICAgICAgICAgIGQub24oXCJlcnJvclwiLGZ1bmN0aW9uKGVycm9yKXtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhlcnJvci5tZXNzYWdlKVxuICAgICAgICAgICAgICAgIGlmKCFkb25lQ2FsbGVkKXtcbiAgICAgICAgICAgICAgICAgICAgZG9uZSgpO1xuICAgICAgICAgICAgICAgICAgICBkb25lQ2FsbGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTsgXG4gICAgICAgICAgICBkLnJ1bihmdW5jdGlvbigpIHsgXG4gICAgICAgICAgICAgICAgbGV0IHN0cmVhbSA9IHBsdWdpbnMuZ3VscC5zcmMoXCIuL3Rlc3QvdGVzdEJyb3dzZXJpZnlFcnJvci5qc1wiKVxuICAgICAgICAgICAgICAgICAgICAucGlwZShwbHVnaW5zLmd1bHBCcm93c2VyLmJyb3dzZXJpZnkoKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIFxuICAgICAgICBpdChcInNob3VsZCBydW4gdGhyb3VnaCB3aXRoIGFuIGVtcHR5IGZpbGVcIiwgZnVuY3Rpb24gKGRvbmUpIHtcbiAgICAgICAgICAgIGxldCBzdHJlYW0gPSBwbHVnaW5zLmd1bHAuc3JjKCcuL3Rlc3QvdGVzdEJyb3dzZXJpZnlFbXB0eS5qcycpXG4gICAgICAgICAgICAgICAgLnBpcGUocGx1Z2lucy5ndWxwQnJvd3Nlci5icm93c2VyaWZ5KCkpXG4gICAgICAgICAgICAgICAgLnBpcGUoc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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"}

View File

@ -1,44 +1,57 @@
/// <reference path="../ts/typings/main.d.ts" />
let plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
gulpBrowser: require("../dist/index.js"),
gulpFunction: require("gulp-function")
};
let should = require("should");
import * as gulp from 'gulp';
import * as gulpFunction from '@pushrocks/gulp-function';
import * as smartpromise from '@pushrocks/smartpromise';
import { expect, tap } from '@pushrocks/tapbundle';
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));
});
});
import * as gulpBrowser from '../ts/index';
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;
});
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,36 +1,50 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./gulpbrowser.plugins");
import * as stream from 'stream';
import plugins = require('./gulpbrowser.plugins');
import * as smartpromise from '@pushrocks/smartpromise';
let browserify = function(transforms = []) {
if (!Array.isArray(transforms)) {
transforms = [transforms];
}
let browserify = function() {
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){
plugins.browserify(file, { basedir: file.base })
.bundle(bundleCallback);
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 {
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();
};
browserified.transform(transform.transform, transform.options);
}
});
export = browserify;
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;

View File

@ -1,5 +1,3 @@
/// <reference path="./typings/main.d.ts" />
export let beautylog = require("beautylog");
export let through = require("through2");
export let path = require("path");
export let browserify = require("browserify");
export import through2 = require('through2');
export import path = require('path');
export import browserify = require('browserify');

View File

@ -1,4 +1 @@
/// <reference path="./typings/main.d.ts" />
export import browserify = require("./gulpbrowser.browserify");
export import browserify = require('./gulpbrowser.browserify');

View File

@ -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"
}
}

14
tsconfig.json Normal file
View File

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