RaveJS / rave

Zero-configuration application bootstrap and development
278 stars 8 forks source link

Encourage extension authors to include rave semver so we can inspect rave extensions for version compatibility when debugging #15

Closed unscriptable closed 10 years ago

unscriptable commented 10 years ago

In response to: https://github.com/RaveJS/rave/issues/14#issuecomment-41875887

Problem: It's possible for a dev to install rave and then install an incompatible rave extension.

This is because some rave extensions don't have an explicit dependency on rave: they don't use any modules in rave's package. It's also possible that the dev ignored the bower version conflict warning -- or that npm simply installed two versions of rave! All of these situations could cause a painful development experience.

We should encourage extension authors to include a "rave" entry in the "peerDependencies" section of their extension's package.json or bower.json, even if there is no direct dependency. (There should be a devDependency for testing, though!)

When debugging, rave should check the semver in the .json file against its own version in its .json file. If there's a match, no further action is necessary. If there's a mismatch, an error should be logged to the console. If there is no rave dependency in the extension's .json file, a warning should be logged.

An excellent suggestion from @briancavalier: the error and the warning should suggest that the developer contact the extension author directly to update the extension. If the "issues" property exists in the .json file we should present it to the dev for easy access!

The semver will only be checked when in "debug mode" since the semver code is quite bulky.

unscriptable commented 10 years ago

See this article: http://blog.nodejs.org/2013/02/07/peer-dependencies/

unscriptable commented 10 years ago

This has landed in 0.1.0.