Giter VIP home page Giter VIP logo

Comments (6)

bencoveney avatar bencoveney commented on May 18, 2024

When documenting this feature it would be good to include an example of how to run Barrelsby and TypeScript in watch mode at the same time using concurrently.

from barrelsby.

tannerntannern avatar tannerntannern commented on May 18, 2024

What's the status on this? I would really like to have this feature. I could try implementing the feature using chokidar if you'd like??

Edit: Perhaps this is unnecessary, given how simple it is to use chokidar-cli:

{
  "scripts": {
    "build-barrels": "barrelsby ...",
    "watch-barrels": "chokidar \"src/**/*.ts\" -c \"npm run build-barrels\""
  }
}

from barrelsby.

bencoveney avatar bencoveney commented on May 18, 2024

Hi @tannerntannern thanks for contributing.

I don't know of anyone looking at this issue at the moment - if you want to make a PR you'd be more than welcome to 😄

Adding chokidar sounds good. Or if you are happy with your solution for now, it might be good for me to stick it in the docs either way 👍

from barrelsby.

vjpr avatar vjpr commented on May 18, 2024

The difficulty comes in preventing the barrel file writing triggering a watch event causing an endless loop.

I am writing my own using watchman at the moment.


Also, barrelsby has to run effectively run on every file change so it needs to be as efficient as possible in choosing which files to run on.

from barrelsby.

github-actions avatar github-actions commented on May 18, 2024

No activity has been seen recently, marking as stale. If this is a mistake please reach out to a collaborator

from barrelsby.

thatkookooguy avatar thatkookooguy commented on May 18, 2024

Using chokidar:

// ...
"scripts": {
    "generate-barrels": "barrelsby --delete -d ./src -l below -q --exclude spec.ts --exclude __mocks__",
    "generate-barrels:watch": "chokidar \"src/**/*.ts\" -i \"src/**/index.ts\" -c 'npm run generate-barrels'"
},
// ...

from barrelsby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.