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

why has directories.lib support been added #60

Open
KidkArolis opened this issue Aug 19, 2014 · 5 comments
Open

why has directories.lib support been added #60

KidkArolis opened this issue Aug 19, 2014 · 5 comments

Comments

@KidkArolis
Copy link
Contributor

What changed since #3 (comment)? Is it not a bad idea to make this incompatible with node?

@unscriptable
Copy link
Contributor

I said:

I'm not sure we can use directories.lib since npm and node ignore it. If one environment uses it and another doesn't, this would prevent code from being portable between rave and node.

Thanks for reminding me! It's somewhat ironic, but I added this feature because there are already packages on npm that aren't compatible with node!

My latest thinking is that if the npm folks really want to claim that npm is not just for node, then we need to make sure we can consume packages that aren't structured in "the node way". This feature would help.

What do you think, @KidkArolis?

@unscriptable
Copy link
Contributor

After talking with @briancavalier, we outlined our options for "safely" supporting npm packages that don't follow node's directory conventions:

  1. Keep the functionality that we released in 0.3.0 and discourage use of a top-level directories.lib through documentation.
  2. Keep the functionality that we released in 0.3.0 and prevent use of a top-level directories.lib through special-case logic.
  3. Change the metadata property from directories.lib to something unique like modules_root. :)

Any other ideas?

@unscriptable
Copy link
Contributor

Any further opinion or comment on this issue?

@phated
Copy link

phated commented Sep 27, 2014

Can you compare the directories.lib to the main property and see if they share a common path? Typically, if the main doesn't exist in the directories.lib, then it is the entry point that will load files from directories.lib. Also, note that npm init currently adds directories it sees to directories.

@unscriptable
Copy link
Contributor

Pasted from #cujojs:

[9:41pm] phated: if i set directories.lib to 'src/'
[9:41pm] phated: and my main is 'src/main.js'
[9:41pm] phated: since they share the src/ directory
[9:41pm] phated: the root of my package is probably src/
[9:42pm] phated: instead of /
[9:42pm] phated: if i just had 'main.js', the root of my package is /
[9:42pm] phated: and main.js will probably require from src/

Seems reasonable. Any thoughts from others?

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

3 participants