profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/contra/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
contra contra @staeco Phoenix, AZ https://contra.io Engineer/founder - @staeco • @gulpjs • @wearefractal • @genomejs + more

aseemk/requireDir 476

Node.js helper to require() directories.

contra/blink-polyfill 150

Fix idiocy in newer browsers

contra/bank 124

simple.com API client

contra/are-you-a-cop 80

Blocks cops from visiting your site. If they are they have to tell you.

contra/4chanjs 25

NodeJS and Browser 4chan API client

contra/BetterError 7

A better Error class

contra/BetterRegExp 5

Utility wrapper over RegExp

contra/app-config-chain 3

Cascading configuration for web applications

contra/aa-rewards 2

experiments with the american airlines api

startedant-design/ant-design

started time in 15 minutes

startedant-design/ant-design

started time in 33 minutes

startedgo-shiori/dom

started time in 3 hours

startedgo-shiori/obelisk

started time in 3 hours

startedethereum/go-ethereum

started time in 3 hours

startedcontra/captchagen

started time in 8 hours

startedtevino/abool

started time in 10 hours

release sindresorhus/System-Color-Picker

v1.3.0

released time in 10 hours

release sindresorhus/active-win

v7.2.0

released time in 18 hours

startedcontra/react-responsive

started time in a day

startedtypesense/typesense

started time in a day

release sindresorhus/ky

v0.28.1

released time in a day

startedcontra/react-responsive

started time in 2 days

release sindresorhus/unused-filename

v3.0.0

released time in 2 days

release sindresorhus/srcset

v4.0.0

released time in 2 days

issue commentgulpjs/gulp

gulp.watch with **/*.js and multiple globs not working on Windows

I know this is an old issue but since I have been running into it on MacOS with gulp latest I figured I would post here for other googlers.

I've been running into this on MacOS and I suspect it related to changes in gulp4, in particular that gulp.watch really needs an async function or it will only run once (https://gulpjs.com/docs/en/getting-started/watching-files/#warning-avoid-synchronous).

It appears to be caused by either using the following pattern (where copy is synchronous)...

function copy () {
    var newer = require('gulp-newer');
    return gulp.src([srcDir+'/**/*'])
        .pipe(newer(destDir))
        .pipe(gulp.dest(destDir));
}
function watch () { 
    gulp.watch(srcDir+'/**/*', copy);    // copy is synchronous, so wrap in gulp.series(copy) to fix
}
module.exports.watch = watch;

or this pattern...

function copy () {
    var newer = require('gulp-newer');
    return gulp.src([srcDir+'/**/*'])
        .pipe(newer(destDir))
        .pipe(gulp.dest(destDir));
}
function watch (done) { 
    gulp.watch(srcDir+'/**/*', copy);    // copy is synchronous
    return done();
}
module.exports.watch = watch;

...or some combination of the two. I didn't dig in further but updating my watch code to match the example here seems to have resolved the issue...

function copy () {
    var newer = require('gulp-newer');
    return gulp.src([srcDir+'/**/*'])
        .pipe(newer(destDir))
        .pipe(gulp.dest(destDir));
}
function watch () { 
    gulp.watch(srcDir+'/**/*', gulp.series(copy));    // copy is synchronous, so wrap in gulp.series(copy)
}
module.exports.watch = watch;

I also found some bugs in my some gulp watch code on my end that hadn't gotten fully updated from gulp3 and had stuff like gulp.watch(srcDir+'/**/*', gulp.task('old-task-name'))...of course old-task-name doesn't exist anymore in gulp registry. The interesting bit was there was no warning/complaint about referencing (trying to retrieve) a task by name from the task-registry that doesn't exist (anymore). Might be helpful for people migrating from gulp3 to output some helpful warnings/errors when using the deprecated task api.

adamreisnz

comment created time in 2 days

startedcontra/exceljs

started time in 2 days

startedcontra/react-responsive

started time in 2 days

startedavast/retry-go

started time in 2 days

startedopen-source-labs/spearmint

started time in 2 days

startedcontra/node-gdal-next

started time in 2 days

startedcontra/react-responsive

started time in 2 days

startedmaxcnunes/waitforit

started time in 2 days

startedforsigner/fower

started time in 2 days

release sindresorhus/slugify

v2.1.0

released time in 3 days

startedcontra/react-responsive

started time in 3 days

release Recidiviz/web-libraries

design-system@0.5.1

released time in 3 days

startedcontra/node-gdal-next

started time in 3 days

issue closedgulpjs/gulp

watch task is always run on initialization, regardless of ignoreinitial option value and file system contents

What were you expecting to happen?

Nothing

What actually happened?

Watch task ran during initialization

Please give us a sample of your gulpfile

const { watch } = require("gulp");

function watchAction(foo) {
  console.log("foo=", foo);
}

function testingTask(cb) {
  watch("../.mydir/.myfile", { events: "add", ignoreinitial: true }, watchAction(true));
  cb();
}

exports.testing = testingTask;

Terminal output / screenshots

<!-- We need to understand what you are seeing in your terminal, so please copy the output (or screenshots of the output) below. -->

$ gulp testing

[10:20:53] Using gulpfile D:\temp\gulpfile.js
[10:20:53] Starting 'testing'...
foo= true
[10:20:53] Finished 'testing' after 19 ms

Please provide the following information:

  • OS: Windows 10 x64 v20H2 (OS Build 19042.985)
  • node: 14.16.0
  • npm: 6.14.1
  • gulp: CLI version: 2.3.0, Local version: 4.0.2

Additional information

N/A

closed time in 3 days

pm64