Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Chore: Fix gulp watch on Windows#187

Merged
alinais merged 4 commits intomasterfrom
chore/gulp-watch-windows
Sep 14, 2018
Merged

Chore: Fix gulp watch on Windows#187
alinais merged 4 commits intomasterfrom
chore/gulp-watch-windows

Conversation

@miroslavstastny
Copy link
Member

@miroslavstastny miroslavstastny commented Sep 5, 2018

This fixes #172:

  • glob filter for gulp watch always uses forward slashes regardless the OS,
  • build:docs:example-menu remembers files, so it is run on all files when a file changes.

While the gulp.watch documentation clearly states that forward slashes must be used, there is no such statement for gulp.src. For now it seems that gulp.src works even with backslashes. I am not sure whether we want to change it there as well or not (make is consistent vs. don't fix anything that's not broken).

@codecov
Copy link

codecov bot commented Sep 5, 2018

Codecov Report

Merging #187 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #187   +/-   ##
=======================================
  Coverage   67.82%   67.82%           
=======================================
  Files         101      101           
  Lines        1386     1386           
  Branches      265      275   +10     
=======================================
  Hits          940      940           
  Misses        443      443           
  Partials        3        3
Impacted Files Coverage Δ
src/components/Menu/MenuItem.tsx 92.3% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e56b62c...5289658. Read the comment docs.

@kuzhelov kuzhelov added 🧰 fix Introduces fix for broken behavior. 🚀 ready for review labels Sep 5, 2018
posix: undefined, // all the sibling values, but with forward slashes regardless the OS
}

paths.posix = _.mapValues(paths, func => (...args) => func(...args).replace(/\\/g, '/'))
Copy link
Contributor

@kuzhelov kuzhelov Sep 5, 2018

Choose a reason for hiding this comment

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

seems that we should consider it to be a mandatory preprocessing method for provided values, so that for paths we would have POSIX ones by default:

const paths = posix({
   src: ...,
   dist: ...,
   ...
})

// and then
paths.src()    // returns POSIX variant by default

// and, if it will be necessary, we can do the following (this will be about extending functionality of 'posix()')
paths.original.src()

The reason I see it being a better approach is that we will be provided with a safe defaults as a result - in contrast to the approach that is currently suggested. What do you think?


task('build:docs:example-menu', () =>
src(examplesSrc, { since: lastRun('build:docs:example-menu') })
.pipe(remember('example-menu')) // FIXME: with watch this unnecessarily processes index files for all examples
Copy link
Contributor

Choose a reason for hiding this comment

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

another problem that I might see here is that if file will be removed, it will still remain to be part of the stream - and this will result in non-relevant produced result.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

for some reason this 'unlink' event doesn't fire on my machine - seems to be an issue with 'chokidar' lib (while for 'change' events everything works). This was, essentially, the reason to ask - thanks!

@kuzhelov kuzhelov added needs author feedback Author's opinion is asked and removed 🚀 ready for review labels Sep 5, 2018
@kuzhelov kuzhelov added 🚀 ready for review and removed needs author feedback Author's opinion is asked labels Sep 5, 2018
@miroslavstastny miroslavstastny added needs author feedback Author's opinion is asked and removed 🚀 ready for review labels Sep 10, 2018
@alinais alinais added ready for merge and removed needs author feedback Author's opinion is asked labels Sep 14, 2018
@alinais alinais merged commit 8be5d6f into master Sep 14, 2018
@levithomason levithomason deleted the chore/gulp-watch-windows branch October 29, 2019 22:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🧰 fix Introduces fix for broken behavior. ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docsite: watch issues

3 participants