breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
3.01k stars 78 forks source link

[discussion] Consider setting the default root to be relative to __dirname #145

Closed spence-s closed 2 years ago

spence-s commented 2 years ago

The default bree root is path.resolve('jobs').

This means bree searches for the jobs folder relative to where the process is started (where I run the node command from), not relative to the file where bree is set up in the project.

This is just less intuitive to me than having it be relative to where I set up the bree instance in my code.

It also makes it less intuitive to properly use any transpilation process or with any framework that handles bundling/transpilation behind the scenes.

Just a suggestion - seeing if other feel the same way. There are quite a few issues related to confusion around this.

shadowgate15 commented 2 years ago

I could agree with that.

niftylettuce commented 2 years ago

Go for it, we just need major semver bump if we do this and deprecation notice