Open KidkArolis opened 10 years ago
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?
After talking with @briancavalier, we outlined our options for "safely" supporting npm packages that don't follow node's directory conventions:
Any other ideas?
Any further opinion or comment on this issue?
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
.
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?
What changed since https://github.com/RaveJS/rave/issues/3#issuecomment-39242879? Is it not a bad idea to make this incompatible with node?