Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

use enderDependencies instead of dependencies if exists #57

Closed
coolaj86 opened this issue Jul 28, 2011 · 12 comments
Closed

use enderDependencies instead of dependencies if exists #57

coolaj86 opened this issue Jul 28, 2011 · 12 comments

Comments

@coolaj86
Copy link
Contributor

In the case where ender's dependencies are not the same as node's dependencies (node has events built-in, node doesn't. The browser has localStorage built in, node doesn't) there should be alternate dependency list.

https://groups.google.com/d/msg/npm-/0Z5hE-41Rpc/iOKJ9x4jzJ8J

Also, there should be a way to provide one package AS another. I.E. it should be possible to provide events.node AS events, etc.

@fat
Copy link
Contributor

fat commented Jul 29, 2011

you could do the latter i believe by just doing:

provide("events", events.node);

@fat
Copy link
Contributor

fat commented Jul 29, 2011

We've been planning on extending the current ender key to an object (rather than just a path to the ender bridge)... so in a given package.json you would see something like this (optionally):

{
  "name": "foo"
  ...
  "ender": {
    "bridge": "./path/to/bridge",
    "dependencies": {
      "future": ">= 2.1.0"
    }
  }
}

@coolaj86
Copy link
Contributor Author

Second: I think that will work well if { ender: dependencies: {}} overrides the regular dependencies entirely.

First: I think you're right, but I'd rather be able to specific the name the module should provide in the package.json since that seems to be a generally better place for it.

Thanks for your responses. :-D

@fat
Copy link
Contributor

fat commented Jul 29, 2011

I agree that if an ender specific dependency definition was present, it should be used entirely instead of a regular dependency mapping... hopefully we'll start working on this next, because i think we could do lots of cool stuff here and it shouldn't hopefully be too hard to add.

To the alternate name thing -- i see what you mean -- i suppose we could add that to the ender key as well? Do you see any problem with that? It could get sort of confusing perhaps because you wouldn't be able to reference it by that name when actually building with the Ender cli.

@coolaj86
Copy link
Contributor Author

As per the CommonJS 1.1 spec, there's a formal way to handle this:

package.json.overlay.ender.dependencies

http://wiki.commonjs.org/wiki/Packages/1.1

@ded
Copy link
Member

ded commented Oct 21, 2011

@coolaj86 ah! that's a good find

@ded
Copy link
Member

ded commented Oct 21, 2011

not that we haven't seen that page before... but it's an easy thing to miss or gloss over

@coolaj86
Copy link
Contributor Author

I don't think that npm or node honor overlays though - despite that they're in the examples on the wiki.

I've got at least one comment from Isaac on the mailing list saying that he used to, but dropped it due to confusion that it caused, so an extension may still be in order.

@coolaj86
Copy link
Contributor Author

This is fixed in http://github.com/coolaj86/node-pakman and http://github.com/coolaj86/node-pakmanager I decided to use browserDependencies

@coolaj86
Copy link
Contributor Author

Also, dependencies are added and removed by editing package.json

@vic
Copy link

vic commented Mar 8, 2012

Well, it seems a lot of the ender issues are related to taking dependencies from a json file. I've sent the following pull request:

#125

@rvagg
Copy link
Member

rvagg commented May 9, 2012

ref #131

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

No branches or pull requests

5 participants