better errors for plugins #640

Open
MehdiK opened this Issue Sep 11, 2013 · 4 comments

Projects

None yet

4 participants

@MehdiK
MehdiK commented Sep 11, 2013

I just started writing a plugin and I think errors around plugin management could be improved.

I am now getting

warning: Skipped the unsupported plugin: heroku due to version-plugin

and have no idea what this means (help on this would be appreciated). Before this I set my version to 0.1 and I got this error:

/_mine/Code/mehdi-khalili.com/node_modules/docpad/node_modules/semver/semver.js:271
    throw new TypeError('Invalid Version: ' + version);
      ^
TypeError: Invalid Version: 0.1

While this one was not that hard to figure out, it could be an error logged to the console pointing out the requirements around version number instead of an unhandled exception.


Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

@balupton
Member

Good feedback. For the error, plugin versions must be 2.x.x to work with DocPad v6. Will see what I can do about improving the message to explain this better.

@MehdiK
MehdiK commented Sep 11, 2013

Thanks for the quick response. That fixed it. I read the plugin docos "The reason reason why we do version 2.0.0 is just a general convention" but the word "convention" didn't make me think that's a hard rule.

Error messages aside, starting with V2.0.0 for a plugin seems a bit strange and could communicate a wrong message to the users of the plugin! Thoughts?

@nfriedly
Contributor
nfriedly commented Nov 2, 2013

I'd like to see docpad support any version of plugins and instead check for peerDependencies - http://blog.nodejs.org/2013/02/07/peer-dependencies/

@nfriedly nfriedly referenced this issue in bobobo1618/docpad-plugin-sunny Nov 2, 2013
Open

Version rollback #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment