Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should paths be resolved relative to the config file or the app root? #7

Open
aredridel opened this issue Aug 18, 2014 · 0 comments
Open

Comments

@aredridel
Copy link

@totherik:

all handlers consider that root:
https://github.com/krakenjs/kraken-js/blob/master/lib/config.js#L29-L37
there has been discussion around making all handlers relative to their current file

@aredridel:

I do like the relative-to-file rather than relative-to-app.

@totherik

relative-to-file is harder than 🍎 🍰
pros: more inline with require behavior. cons: complicates refactoring

@aredridel

Yeah. Or simplifies refactoring, depending on what you're doing.
(extract-and-make-module being my favorite. It makes that one easier)

@totherik

well since config files are separate from the impl, there would be a lot of '../../../lib/foo'
still need to update, but less counting ../s

@aredridel:

It allows modular config in an interesting way: resolve:plugin/config/default.json
(and inside that, resolve:./all-env.json, or whatever)

@totherik:

sorry, for resolve maybe
if we mean the same thing, resolve would find items within a module
for items in the app there's already handlers

@aredridel:

Yeah.
Though with ./, resolve would (I'd hope) be relative to the file it's used in
(matching node's behavior exactly)

@totherik

that's fine. don't have a problem with resolve behaving however it wants
it's the other handlers we need to figure out then
whether we want them all to behave consistently or not
if they all match node's behavior it 1) breaks backward compat so will be [email protected] and 2) is a non-trivial change

@aredridel

Yep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant