NPM and Optional Dependencies and Etiquette

182 views
Skip to first unread message

Rob Ashton

unread,
Jul 10, 2012, 12:05:42 PM7/10/12
to nod...@googlegroups.com
Hey,

We encountered some fun times with Zombie today, which has dependencies listed of

  "dependencies": {
    "eventsource": "~0.0.5",
    "html5": "~0.3.8",
    "jsdom": "=0.2.14",
    "mime": "~1.2.5",
    "ms": "~0.1.0",
    "q": "~0.8.4",
    "request": "~2.9.202",
    "tough-cookie": "~0.9.13",
    "ws": "~0.4.14"
  },
  "devDependencies": {
    "coffee-script": "~1.3.1",
    "docco": "~0.3.0",
    "express": "~2.5.9",
    "highlight": "~0.2.2",
    "mocha": "~1.0.3",
    "replay": "~1.5.0",
    "ronn": "~0.3.8"
  },

Great! Now, JsDom has dependencies of

  "dependencies": {
    "htmlparser": "1.x",
    "request": "2.x",
    "cssom": "0.2.x",
    "contextify": "0.1.x"
  },
  "optionalDependencies": {
    "contextify": "0.1.x"
  },

Also Great!

However, Zombie doesn't fully work if contextify isn't available (You can't fire events because zombie does some patching of jsdom and makes assumptions about contextify being present)

Now... JsDom is ... not quite right in specifying the contextify in both places (although the documentation clearly states that the optional dependencies will overwrite the depedencies so that's not a problem.

The question is... what's the etiquette here? Should I, as a consumer of Zombie and therefore JsDom be specifying contextify in *my* package.json as a dev dependency? Or should zombie be specifying it as a dependency because it won't work without it (even though it's not a direct consumer of that package).

Just wondering who (if anybody) I should be sending a pull request to

Cheers,

Rob
Reply all
Reply to author
Forward
0 new messages