Skip to content

Using this alongside Cypress can cause an infinite loop due to Cypresses file watcher #5

Closed
@silbinarywolf

Description

@silbinarywolf

The problem
Cypress is a testing tool that allows you to interactively develop your application. I've hit an issue where because this module always writes type definition files, regardless of whether it changed or not, it will trigger Cypresses file watcher and get caught in an infinite loop.

The solution
There are one of two solutions that could be put into place.

  1. This module reads/checks for an existing file and only writes the file if it's actually changed. In my opinion, this module should be reading the file first anyway to ensure that it is indeed a generated file before trying to write over it.

  2. Cypress adds the ability to ignore certain files in the watcher (unless there's a config I've missed somewhere) - Issue raised here: Allow excluding certain files from cypress watch cypress-io/cypress#3098

I personally prefer option 1 because I feel that it'll help keep this module "just working" alongside others.
Happy to do a PR as well if this solution sounds reasonable.

P.S. Thank you so much for open-sourcing this. In a world full of half-baked open-source, you guys seem to deliver tools that solve the problem adequately and improve developer happiness, so thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions