mariocasciaro / scatter

IoC container and out-of-the-box extensibility for Node.js applications
MIT License
154 stars 14 forks source link

Feature Request: directory as dependency #12

Open k7sleeper opened 10 years ago

k7sleeper commented 10 years ago

Based on Node.js's require() it should be possible for a module to be dependent not only of other modules but also of directories. The directory should be resolved to <directory>/index.js.

If you agree I can send a PR.

mariocasciaro commented 10 years ago

I actually have mixed opinions about this feature. My main concern is that the user can end up thinking in therms of directories instead of namespaces. It's important to differentiate Scatter namespace from physical directories, nonetheless I can see some usefulness in this feature. I think implementing it should also be easy (just changes in the Resolver).

Anyway just a reminder that we should consider adding new code and features only if the effort to implement it is not greater than its advantages (or it the code is self-contained). If you already have a PR send it, if it's simple enough I'll be more than glad to merge it.

On Thu, Dec 12, 2013 at 8:00 AM, Klaus Sevensleeper < notifications@github.com> wrote:

Based on Node.js's require() it should be possible for a module to be dependent not only of other modules but also of directories. The directory should be resolved to /index.js.

If you agree I can send a PR.

— Reply to this email directly or view it on GitHubhttps://github.com/mariocasciaro/scatter/issues/12 .

k7sleeper commented 10 years ago

After tests are running with 0.7.1 I can look at this issue again.