Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies to match gulp 4 #108

Merged
merged 4 commits into from
May 9, 2016
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ You can pass in an object of options that are shown below: (the values for the k

```js
gulpLoadPlugins({
DEBUG: false, // when set to true, the plugin will log info to console. Useful for bug reporting and issue debugging
pattern: ['gulp-*', 'gulp.*'], // the glob(s) to search for
config: 'package.json', // where to find the plugins, by default searched up from process.cwd()
scope: ['dependencies', 'devDependencies', 'peerDependencies'], // which keys in the config to look within
replaceString: /^gulp(-|\.)/, // what to remove from the name of the module when adding it to the context
camelize: true, // if true, transforms hyphenated plugins names to camel case
lazy: true, // whether the plugins should be lazy loaded on demand
rename: {}, // a mapping of plugins to rename
renameFn: function (name) { ... } // a function to handle the renaming of plugins (the default works)
renameFn: function (name) { ... }, // a function to handle the renaming of plugins (the default works)
DEBUG: true // when set to true and using gulp-cli flag -LLLL, the plugin will log info to console. Useful for bug reporting and issue debugging
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep this as false, as this shows the default values and DEBUG should be false by default.

});
```

Expand Down
13 changes: 7 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict';
var multimatch = require('multimatch');
var micromatch = require('micromatch');
var unique = require('array-unique');
var findup = require('findup-sync');
var path = require('path');
var resolve = require('resolve');
var gutil = require('gulp-util');
var logger = require('gulplog');
var path = require('path');

function arrayify(el) {
return Array.isArray(el) ? el : [el];
Expand All @@ -21,7 +22,7 @@ module.exports = function(options) {
var requireFn;
options = options || {};

var DEBUG = options.DEBUG || false;
var DEBUG = typeof options.DEBUG === 'undefined' ? true : options.DEBUG;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEBUG should be false by default.

var pattern = arrayify(options.pattern || ['gulp-*', 'gulp.*', '@*/gulp{-,.}*']);
var config = options.config || findup('package.json', {cwd: parentDir});
var scope = arrayify(options.scope || ['dependencies', 'devDependencies', 'peerDependencies']);
Expand Down Expand Up @@ -66,7 +67,7 @@ module.exports = function(options) {

function logDebug(message) {
if(DEBUG) {
gutil.log(gutil.colors.green('gulp-load-plugins: ' + message));
logger.debug('gulp-load-plugins: ' + message);
}
}

Expand Down Expand Up @@ -108,7 +109,7 @@ module.exports = function(options) {
var scopeTest = new RegExp('^@');
var scopeDecomposition = new RegExp('^@(.+)/(.+)');

multimatch(names, pattern).forEach(function(name) {
unique(micromatch(names, pattern)).forEach(function(name) {
var decomposition;
if(scopeTest.test(name)) {
decomposition = scopeDecomposition.exec(name);
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test": "npm run lint && NODE_PATH=test/global_modules mocha",
"lint": "eslint **/*.js"
},
"license": "mit",
"license": "MIT",
"files": [
"index.js"
],
Expand All @@ -32,14 +32,16 @@
"Connor Peet",
"Dorian Camilleri",
"Carlos Henrique",
"iamfrontender <iamfrontender@gmail.com>"
"iamfrontender <iamfrontender@gmail.com>",
"Brian Woodward"
],
"license": "MIT",
"dependencies": {
"findup-sync": "^0.2.1",
"array-unique": "^0.2.1",
"findup-sync": "^0.4.0",
"gulp-util": "^3.0.7",
"multimatch": "2.0.0",
"resolve": "^1.1.6"
"gulplog": "^1.0.0",
"micromatch": "^2.3.8",
"resolve": "^1.1.7"
},
"devDependencies": {
"eslint": "^1.10.3",
Expand Down