Skip to content
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

Add cordovaDependencies section to package.json #348

Merged
merged 1 commit into from
Sep 21, 2016

Conversation

vladimir-kotikov
Copy link
Contributor

@vladimir-kotikov vladimir-kotikov commented Sep 19, 2016

This PR updates 'engines' in 'package.json' to comply w/ manifest format (engines value should be an object, not an array) and new plugin fetching model.

Also there is no 5.0.0 version of 'cordova-plugman' so it has been updated to just 'cordova'.

This also adds a 'protective' entry for next major plugin version to protect end-users from fetching edge versions of the plugin by incompatible version of cordova. This requires explicitly updating of package.json on every major plugin release to make it 'installable' by cordova.

See corresponding discussion on mailing list for more details and reasons behind this.

This reflects `engines` elements from plugin manifest to package.json to comply w/ [new plugin fetching model](https://github.com/cordova/cordova-discuss/blob/master/proposals/plugin-version-fetching.md).

This also adds a 'protective' entry for next major plugin version to protect end-users from fetching edge versions of the plugin by incompatible version of cordova. See corresponding [discussion on mailing list](http://apache.markmail.org/thread/p73loqtvbzvfzsv5) for more details and reasons behind this.
@randdusing
Copy link
Owner

Let me confirm this on my side tonight or tomorrow and I'll merge.

@vladimir-kotikov
Copy link
Contributor Author

Sure! Thanks for looking...

@randdusing
Copy link
Owner

I'm kind of confused by the protective entry. If my plugin is version 4.2.0, what exactly is '5.0.0': {'cordova': '>=5.0.0'} preventing from happening? It seems like the protective entry will always be one step ahead and not doing anything...

@randdusing
Copy link
Owner

I re-read your second link. So basically the protective entry ensures that the plugin author will verify the minimum cordova version for new major releases of their plugin? So if I update my plugin to 5.0.0 and now require cordova-android 6.0.0, I would have the entries below:

  "engines": {
    "cordovaDependencies": {
      "4.2.0": {
        "cordova": ">=5.0.0",
        "cordova-android": ">=5.0.0"
      },
      "5.0.0": {
        "cordova": ">=6.0.0",
        "cordova-android": ">=6.0.0"
      },
      "6.0.0": {
        "cordova": ">=100"
      }
    }
  },

And this prevents cordova@5.0.0 users from accidentally using cordova-bluetoothle@5.0.0?

@vladimir-kotikov
Copy link
Contributor Author

vladimir-kotikov commented Sep 21, 2016

Yeah, exactly. This would produce the following warning for users of cordova@5.0.0 when installing plugin

Unmet project requirements for latest version of cordova-plugin-bluetoothle:
    cordova (5.0.0 in project, >=6.0.0 required)
Fetching highest version of cordova-plugin-bluetoothle that this project supports: 4.2.0 (latest is 5.0.0)

and install latest compatible plugin version

Though user still would be able to install the edge version of the plugin if he wants to, by explicitly passing cordova-plugin-bluetoothle@5.0.0 to cordova plugin add

@randdusing randdusing merged commit 762f3e5 into randdusing:master Sep 21, 2016
@randdusing
Copy link
Owner

Thanks for the PR and explanation!

@vladimir-kotikov vladimir-kotikov deleted the pin_plugin_version branch September 21, 2016 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants