Hey all,
Re: The breaking changes outlined here:
It is important that your updates to your plugins are not published to npm until the following steps are taken (in this order):
- If you have any plugins already published with fixes for v0.6.0 (otherwise skip this):
- Unpublish them now
- Create a branch that branches out from the last
v0.5.x
compatible commit: git checkout -b somethingunique {commitHash}
- Add a property to
package.json
called nbbpm
with the following Object: { "compatibility": "^0.5.0" }
, or whatever the compatibility hash your plugin is already using
- Commit and publish this as a new version to npm
- While your plugin is compatible with
v0.5.x
:
- Remove the
compatibility
or minver
property from plugin.json
, it is now deprecated. Remember the old value.
- Add a new property to your plugin's
package.json
called nbbpm
. This property contains an object with the property compatibility
. This property points to a semver-compatible string stating the plugin's compatibility with NodeBB. If you know your plugin works against v0.5.2 only (but not v0.5.1), then the string you should use is ^0.5.2
- For reference, this is what it looks like:
{
...
"nbbpm": {
"compatibility": "^0.5.0"
}
}
- Publish this to npm as a new version
- Make the appropriate changes to comply with v0.6.0's changes
- Change the
compatibility
value in package.json
to now read ^0.6.0
- You're done!
Rationale
The reason behind this is simple: We want to stop plugins from becoming incompatible as they are updated against newer versions of NodeBB. npm tends to assume you want the latest version when you run npm install packagename
, so we are building a system for v0.6.0 (that will be backported into v0.5.x
) that queries the NodeBB Package Manager and requests a version given the installed NodeBB version.
You can see it in action here: https://packages.nodebb.org/api/v1/suggest?package=nodebb-plugin-sso-github&version=0.5.3
This way, even when your plugin is updated to v0.6.0, and breaking compatibility for v0.5.x versions, those NodeBBs will still be able to install plugins via the ACP, they'll just install the lower version that is reported (by you!) to be working.
Please let me know if any of this is comfusing, and I will try to explain better 