-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Semver Plugins #691
Comments
👍 |
Yup. I'm not supporting this with my plugin. |
Agreed... |
Totally agree. I thought I posted my thoughts on this somewhere... but can't find the place I did. So I'll just repost here. The reason this came to be, is that DocPad was around before NPM was around. Then when DocPad Plugins actually became NPM packages, NPM did not yet support Today, this still remains an issue I believe. Let's say if we are DocPad v6 in a day when DocPad v7 is out, and we do Ideally, this aforementioned issue should be fixed in NPM, by it only installing the latest version is compatible with all As a workaround, and something I'm looking into to address plugin upgrade notifications. Is to have docpad/helper pull in the NPM registry information for the plugins, and use that to fix the NPM peerDependencies install issue. By using docpad/helper to tell us which plugin version is the latest compatible with our peerDependencies. However, as mentioned, this is something that should be addressed in NPM, and I'm happy waiting for now. Maybe NPM has addressed this since |
So why not use engines clause instead of peerDependencies?
|
Engines doesn't work for dependencies, only things like the node and npm version. Hence why peerDependencies was introduced. See https://github.com/isaacs/npm/issues/1400#issuecomment-11829492 |
But it's not a dependency, since plugins are dependencies of the site
|
It's also used for Backbone extensions, such as QueryEngine, to say, I am compatible with these Backbone versions. As when it comes to DocPad's use of QueryEngine and Backbone, they are dependency peers. Using Using From my understanding though, Does that help explain things? Perhaps the idea of running DocPad as a global install is the confusing part here, as that can allude to DocPad being an engine, but DocPad as of recent, will actually fire up the local DocPad install, to ensure that DocPad always abides by the site's dependencies. |
I.e. if you are doing an explicit check in plugin-loader anyway then might |
So fair enough - peerDependencies seems to fit the bill.
|
I've made an issue on npm here to describe my proposal: https://github.com/isaacs/npm/issues/4055 |
Meanwhile I still think that peerDependencies behaviour as of now already replicates the same behaviour that plugin version check ~2 did, so maybe it's already OK to deprecate the v2 check even before isaacs/npm responds to your issue? (Unless I'm missing something about the current peerDependencies behaviour) |
peerDependency check only kicks in post-install currently, allowing you to install incompatible versions the v2 check happens pre-install, allowing you to only install compatible versions |
It runs preinstall? Docpad happily installed a v3 plugin for us and just
|
|
Well somehow plugin v3 got through for us despite that check. Docpad
|
…g system. See docpad/docpad#691 for more details.
…ng system. See docpad/docpad#691 for more details.
Next version of DocPad will accomplish this. Magic is at https://github.com/bevry/pluginloader |
Related: #690
Repurposing the major version of the a plugin's version to specify metadata about a dependency (ie. depends on docpad plugin api v2) does not strike me as the best practice.
http://docpad.org/docs/plugin-write#package-json
Can we consider using the docpad key in the engine hash of
packages.json
? Or, if that already has a specific purpose, perhaps we could create a docpad-plugin engine? The current practice would seem to keep a user's plugin from being able to use semver, and likely also prevents them from properly versioning their own project (ie. things like using the0.x.y
convention for pre-stable packages, etc.)Thanks!
cc: @unframework
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: