Skip to content

Commit

Permalink
feat(dependencies): updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de committed Oct 26, 2022
1 parent c994409 commit 6617fcf
Show file tree
Hide file tree
Showing 6 changed files with 2,304 additions and 36 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "gulp"
"extends": "gulp",
"rules": {
"max-statements": 0
}
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

# glob-watcher

> ### Forked Version using updated dependencies
> Original repo at https://github.com/gulpjs/glob-watcher

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]

Watch globs and execute a function upon change, with intelligent defaults for debouncing and queueing.
Expand Down
39 changes: 18 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "glob-watcher",
"version": "5.0.5",
"name": "@fomantic/glob-watcher",
"version": "5.0.6",
"description": "Watch globs and execute a function upon change, with intelligent defaults for debouncing and queueing.",
"author": "Gulp Team <[email protected]> (http://gulpjs.com/)",
"author": "Gulp Team <[email protected]> (https://gulpjs.com/)",
"contributors": [],
"repository": "gulpjs/glob-watcher",
"repository": "https://github.com/fomantic/glob-watcher",
"license": "MIT",
"engines": {
"node": ">= 0.10"
"node": ">=12"
},
"main": "index.js",
"files": [
Expand All @@ -17,29 +17,26 @@
"lint": "eslint .",
"pretest": "npm run lint",
"test": "mocha --async-only",
"cover": "istanbul cover _mocha --report lcovonly",
"coveralls": "npm run cover && istanbul-coveralls"
"coverage": "nyc mocha --async-only"
},
"dependencies": {
"anymatch": "^2.0.0",
"async-done": "^1.2.0",
"chokidar": "^2.0.0",
"anymatch": "^3.1.2",
"async-done": "^2.0.0",
"chokidar": "^3.5.3",
"is-negated-glob": "^1.0.0",
"just-debounce": "^1.0.0",
"just-debounce": "^1.1.0",
"normalize-path": "^3.0.0",
"object.defaults": "^1.1.0"
},
"devDependencies": {
"coveralls": "^2.11.2",
"eslint": "^2.13.1",
"eslint-config-gulp": "^3.0.1",
"expect": "^1.16.0",
"istanbul": "^0.4.0",
"istanbul-coveralls": "^1.0.1",
"mocha": "^2.0.0",
"mocha-lcov-reporter": "^1.2.0",
"rimraf": "^2.6.1",
"through2": "^2.0.1"
"eslint": "^8.26.0",
"eslint-config-gulp": "^5.0.1",
"expect": "^27.5.1",
"nyc": "^15.1.0",
"mocha": "^9.2.2",
"rimraf": "^3.0.2",
"sinon": "^14.0.1",
"through2": "^4.0.2"
},
"keywords": [
"watch",
Expand Down
3 changes: 0 additions & 3 deletions test/.eslintrc

This file was deleted.

43 changes: 32 additions & 11 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var fs = require('fs');
var path = require('path');

var expect = require('expect');
var sinon = require('sinon');
var rimraf = require('rimraf');
var through = require('through2');
var normalizePath = require('normalize-path');
Expand All @@ -21,8 +22,8 @@ describe('glob-watcher', function() {
var outFile1 = path.join(outDir, 'changed.js');
var outFile2 = path.join(outDir, 'added.js');
var globPattern = '**/*.js';
var outGlob = normalizePath(path.join(outDir, globPattern));
var singleAdd = normalizePath(path.join(outDir, 'changed.js'));
var outGlob = path.join(outDir, globPattern);
var singleAdd = path.join(outDir, 'changed.js');
var ignoreGlob = '!' + singleAdd;

function changeFile() {
Expand Down Expand Up @@ -257,10 +258,9 @@ describe('glob-watcher', function() {
});

it('watches exactly the given event', function(done) {
var spy = expect.createSpy()
.andCall(function(cb) {
var spy = sinon.spy(function(cb) {
cb();
spy.andThrow(new Error('`Add` handler called for `change` event'));
expect(spy.callCount).toEqual(1);
setTimeout(done, 500);
changeFile();
});
Expand All @@ -271,14 +271,18 @@ describe('glob-watcher', function() {
});

it('accepts multiple events to watch', function(done) {
var spy = expect.createSpy()
.andThrow(new Error('`Add`/`Unlink` handler called for `change` event'));
var spy = sinon.spy(function(cb) {
cb();
if (spy.callCount === 2) {
done();
}
});

watcher = watch(outGlob, { events: ['add', 'unlink'] }, spy);
watcher = watch(outGlob, { events: ['add', 'change'] }, spy);

watcher.on('ready', function() {
changeFile();
setTimeout(done, 500);
watcher.on('ready', addFile);
watcher.on('add', function() {
setTimeout(changeFile, 500);
});
});

Expand Down Expand Up @@ -309,6 +313,23 @@ describe('glob-watcher', function() {
watcher.on('ready', changeFile);
});

it('can re-add a glob after it has been negated (unix style path)', function(done) {
watcher = watch([
normalizePath(outGlob),
normalizePath(ignoreGlob),
normalizePath(singleAdd),
]);

watcher.once('change', function(filepath) {
// chokidar pass windows style path on windows.
expect(filepath).toEqual(singleAdd);
done();
});

// We default `ignoreInitial` to true, so always wait for `on('ready')`
watcher.on('ready', changeFile);
});

it('does not mutate the globs array', function(done) {
var globs = [outGlob, ignoreGlob, singleAdd];
watcher = watch(globs);
Expand Down
Loading

0 comments on commit 6617fcf

Please sign in to comment.