Contributing to Brunch
Did you find a bug?
First, make sure it was not already reported by taking a look at the currently open Issues on GitHub.
If nothing resembling what you are experiencing was reported, feel free to open a new issue. Make sure your description of the issue is clear and contains as much relevant information as possible. The issue will be handled more quickly if it includes a link to a sample repo that demonstrates incorrect behavior.
We never ask you to share your private, possibly NDA'd, application with us. Just create a tiny application that includes a resembling config as well as just enough code to reproduce the issue.A
Do you want to write a patch yourself?
- Open a new Pull Request with the patch.
- Clearly describe what is being fixed. If possible, reference a bug report or a feature request.
- Update the docs if the new functionality is added.
Brunch internals overview
Brunch, the tool, is split across several modules:
brunch/brunch is the main repo. It ties everything together to provide the build tool you'll love. Generally, if something doesn't fit into the other repos, it goes here.
brunch/deppack is at heart of Brunch 2's new NPM integration. If it has to do with exposing NPM modules to the browser, it most likely belongs here.
brunch/node-browser-modules exposes browser shims for Node modules. This one is used by
brunch/commonjs-require-definition is the CommonJS runtime. It handles how modules are registered and required. This probably shouldn't be touched unless there is a new deppack feature that needs some changes to the runtime.
- paulmillr/loggy is a lightweight logging library.
- paulmillr/chokidar is behind Brunch's file watching magic.
- paulmillr/pushserver is the default http server.
Where the documentation lives:
How to set up the dev env
It won't make much sense to blindly edit the Brunch's sources and get no feedback on whether you are heading in the right direction. If you are making changes, you most likely are either a) fixing a bug, or b) adding a feature — in both of which cases you probably already have a sample app.
To use your local fork of Brunch, as you need to do is:
npm linkin the Brunch fork directory. This will make your fork the globally available Brunch on your system.
npm link brunchin your sample application. This will make
node_modules/brunchin your app a symlink to your Brunch fork.
Additionally, if your changes span past
brunch/brunch, you will also need to:
npm linkfrom the forked module.
npm link <module name>from the Brunch fork directory to link it to Brunch.