Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10679

Update plugin add behavior to allow plugins to list engine constraints

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-lib
    • Labels:

      Description

      Let plugins specify their Cordova related dependencies in their package.json so that the CLI can choose a compatible version for the current project.

      Full specification is here:
      https://github.com/cordova/cordova-discuss/pull/30

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on the pull request:

        https://github.com/apache/cordova-lib/pull/363#issuecomment-187874856

        Fixed jasmine tests and created a JIRA for this (CB-10679(https://issues.apache.org/jira/browse/CB-10679))

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-lib/pull/363#issuecomment-187874856 Fixed jasmine tests and created a JIRA for this ( CB-10679 ( https://issues.apache.org/jira/browse/CB-10679 ))
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user riknoll opened a pull request:

        https://github.com/apache/cordova-docs/pull/521

        CB-10679: Adding docs for new plugin version fetching implementation

        *DO NOT MERGE! This PR is documenting https://github.com/apache/cordova-lib/pull/363 which has yet to be merged*

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/riknoll/cordova-docs CB-10679

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/cordova-docs/pull/521.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #521


        commit 437836050c2983cd2a4d578d6acdae6c6a85721a
        Author: riknoll <richard.b.knoll@gmail.com>
        Date: 2016-02-24T21:25:40Z

        CB-10679: Adding docs for new plugin version fetching implementation


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user riknoll opened a pull request: https://github.com/apache/cordova-docs/pull/521 CB-10679 : Adding docs for new plugin version fetching implementation * DO NOT MERGE! This PR is documenting https://github.com/apache/cordova-lib/pull/363 which has yet to be merged * You can merge this pull request into a Git repository by running: $ git pull https://github.com/riknoll/cordova-docs CB-10679 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/521.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #521 commit 437836050c2983cd2a4d578d6acdae6c6a85721a Author: riknoll <richard.b.knoll@gmail.com> Date: 2016-02-24T21:25:40Z CB-10679 : Adding docs for new plugin version fetching implementation
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 45a235fa73e5b23ed9fa44734449503976b999e3 in cordova-lib's branch refs/heads/master from riknoll
        [ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=45a235f ]

        CB-10679: New version choosing logic for plugin add

        Adds support for plugins specifying their cordova
        related dependencies in their package.json to
        guide cordova-lib in choosing the correct version
        of a plugin to fetch for the current project

        This closes #363

        Show
        jira-bot ASF subversion and git services added a comment - Commit 45a235fa73e5b23ed9fa44734449503976b999e3 in cordova-lib's branch refs/heads/master from riknoll [ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=45a235f ] CB-10679 : New version choosing logic for plugin add Adds support for plugins specifying their cordova related dependencies in their package.json to guide cordova-lib in choosing the correct version of a plugin to fetch for the current project This closes #363
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user riknoll opened a pull request:

        https://github.com/apache/cordova-lib/pull/406

        CB-10679: Improving version choosing logic test coverage

        This adds a test plugin to improve our end to end tests related to the new plugin version choosing logic implementation. The plugin itself is empty and published to npm under my account: https://www.npmjs.com/package/cordova-lib-test-plugin . I also added a test case for git URLs, because we were missing one.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/MSOpenTech/cordova-lib test-plugin

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/cordova-lib/pull/406.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #406


        commit 8eed08ef17d06cde56df1d2a42ec2f2f8124843e
        Author: riknoll <richard.b.knoll@gmail.com>
        Date: 2016-03-08T00:10:22Z

        CB-10679: Improving version choosing logic test coverage


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user riknoll opened a pull request: https://github.com/apache/cordova-lib/pull/406 CB-10679 : Improving version choosing logic test coverage This adds a test plugin to improve our end to end tests related to the new plugin version choosing logic implementation. The plugin itself is empty and published to npm under my account: https://www.npmjs.com/package/cordova-lib-test-plugin . I also added a test case for git URLs, because we were missing one. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-lib test-plugin Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/406.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #406 commit 8eed08ef17d06cde56df1d2a42ec2f2f8124843e Author: riknoll <richard.b.knoll@gmail.com> Date: 2016-03-08T00:10:22Z CB-10679 : Improving version choosing logic test coverage
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on the pull request:

        https://github.com/apache/cordova-lib/pull/406#issuecomment-193942230

        @stevengill @vladimir-kotikov please review when you have a moment

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-lib/pull/406#issuecomment-193942230 @stevengill @vladimir-kotikov please review when you have a moment
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user riknoll opened a pull request:

        https://github.com/apache/cordova-cli/pull/238

        CB-10679: Adding explanation for plugin version selection to plugin help

        This was just merged into cordova-lib. I wasn't totally sure where to add this blurb and decided on the current location after discussing with @dblotsky.

        @nikhilkh please review

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/MSOpenTech/cordova-cli CB-10679

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/cordova-cli/pull/238.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #238


        commit 6793a1231ea0dab9c3c18aaf89bfab79ddfc174c
        Author: riknoll <richard.b.knoll@gmail.com>
        Date: 2016-03-08T22:35:35Z

        CB-10679: Adding explanation for plugin version selection to plugin help


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user riknoll opened a pull request: https://github.com/apache/cordova-cli/pull/238 CB-10679 : Adding explanation for plugin version selection to plugin help This was just merged into cordova-lib. I wasn't totally sure where to add this blurb and decided on the current location after discussing with @dblotsky. @nikhilkh please review You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-cli CB-10679 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-cli/pull/238.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #238 commit 6793a1231ea0dab9c3c18aaf89bfab79ddfc174c Author: riknoll <richard.b.knoll@gmail.com> Date: 2016-03-08T22:35:35Z CB-10679 : Adding explanation for plugin version selection to plugin help
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user stevengill commented on the pull request:

        https://github.com/apache/cordova-lib/pull/406#issuecomment-194021132

        LGTM. Question though, what version of android are the tests using? What version gets fetched (1.1.2 it looks like)?

        Maybe add vlad and me as owners to the module on npm. Always smart to have a few people who can publish if needed.

        `npm owner add stevegill cordova-lib-test-plugin`
        `npm owner add kotikov.vladimir cordova-lib-test-plugin`

        Show
        githubbot ASF GitHub Bot added a comment - Github user stevengill commented on the pull request: https://github.com/apache/cordova-lib/pull/406#issuecomment-194021132 LGTM. Question though, what version of android are the tests using? What version gets fetched (1.1.2 it looks like)? Maybe add vlad and me as owners to the module on npm. Always smart to have a few people who can publish if needed. `npm owner add stevegill cordova-lib-test-plugin` `npm owner add kotikov.vladimir cordova-lib-test-plugin`
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on the pull request:

        https://github.com/apache/cordova-lib/pull/406#issuecomment-194025033

        Added you both as owners. The tests use cordova-android version 3.1.0, which is checked into cordova-lib:
        ```
        cordova-lib/cordova-lib/spec-cordova/fixtures/platforms/android
        ```

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-lib/pull/406#issuecomment-194025033 Added you both as owners. The tests use cordova-android version 3.1.0, which is checked into cordova-lib: ``` cordova-lib/cordova-lib/spec-cordova/fixtures/platforms/android ```
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user stevengill commented on the pull request:

        https://github.com/apache/cordova-lib/pull/406#issuecomment-194025822

        Thanks @riknoll!!

        Show
        githubbot ASF GitHub Bot added a comment - Github user stevengill commented on the pull request: https://github.com/apache/cordova-lib/pull/406#issuecomment-194025822 Thanks @riknoll!!
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user dblotsky commented on the pull request:

        https://github.com/apache/cordova-cli/pull/238#issuecomment-194053721

        LGTM.

        Show
        githubbot ASF GitHub Bot added a comment - Github user dblotsky commented on the pull request: https://github.com/apache/cordova-cli/pull/238#issuecomment-194053721 LGTM.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user nikhilkh commented on a diff in the pull request:

        https://github.com/apache/cordova-cli/pull/238#discussion_r55473629

        — Diff: doc/plugin.txt —
        @@ -4,20 +4,23 @@ Synopsis

        Manage project plugins

        • add <plugin-spec> [...] ............ Add specified plugins
          + add <plugin-spec> [...] ............ Add specified plugins. If adding a plugin from npm, the
            • End diff –

        Too many ifs.

        I was hoping we would actually have an order of resolution of how plugin add picks the plugin in the README.md which is the CLI reference doc. I'm not sure if inline CLI help is the best place for something like this.

        Show
        githubbot ASF GitHub Bot added a comment - Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/238#discussion_r55473629 — Diff: doc/plugin.txt — @@ -4,20 +4,23 @@ Synopsis Manage project plugins add <plugin-spec> [...] ............ Add specified plugins + add <plugin-spec> [...] ............ Add specified plugins. If adding a plugin from npm, the End diff – Too many ifs. I was hoping we would actually have an order of resolution of how plugin add picks the plugin in the README.md which is the CLI reference doc. I'm not sure if inline CLI help is the best place for something like this.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user vladimir-kotikov commented on the pull request:

        https://github.com/apache/cordova-lib/pull/406#issuecomment-194196784

        LGTM

        Show
        githubbot ASF GitHub Bot added a comment - Github user vladimir-kotikov commented on the pull request: https://github.com/apache/cordova-lib/pull/406#issuecomment-194196784 LGTM
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on a diff in the pull request:

        https://github.com/apache/cordova-cli/pull/238#discussion_r55559717

        — Diff: doc/plugin.txt —
        @@ -4,20 +4,23 @@ Synopsis

        Manage project plugins

        • add <plugin-spec> [...] ............ Add specified plugins
          + add <plugin-spec> [...] ............ Add specified plugins. If adding a plugin from npm, the
            • End diff –

        I was concerned about the visibility of it, which is why I put it in the help. That being said, it did end up being longer than I intended so I am cool with moving it to the reference. I'll close this PR and open another.

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/238#discussion_r55559717 — Diff: doc/plugin.txt — @@ -4,20 +4,23 @@ Synopsis Manage project plugins add <plugin-spec> [...] ............ Add specified plugins + add <plugin-spec> [...] ............ Add specified plugins. If adding a plugin from npm, the End diff – I was concerned about the visibility of it, which is why I put it in the help. That being said, it did end up being longer than I intended so I am cool with moving it to the reference. I'll close this PR and open another.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll closed the pull request at:

        https://github.com/apache/cordova-cli/pull/238

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll closed the pull request at: https://github.com/apache/cordova-cli/pull/238
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/cordova-lib/pull/406

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/cordova-lib/pull/406
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user riknoll opened a pull request:

        https://github.com/apache/cordova-cli/pull/241

        CB-10679: Documenting how the CLI chooses plugin versions

        Now in the README! Note that this relies on the documentation in https://github.com/apache/cordova-docs/pull/521 being merged.

        @nikhilkh @dblotsky please take a look.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/MSOpenTech/cordova-cli CB-10679redo

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/cordova-cli/pull/241.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #241


        commit 1a8be501d31aeba99d56fd3280c39693941a99fb
        Author: Richard Knoll <richard.b.knoll@gmail.com>
        Date: 2016-03-10T18:32:14Z

        CB-10679: Documenting how the CLI chooses plugin versions


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user riknoll opened a pull request: https://github.com/apache/cordova-cli/pull/241 CB-10679 : Documenting how the CLI chooses plugin versions Now in the README! Note that this relies on the documentation in https://github.com/apache/cordova-docs/pull/521 being merged. @nikhilkh @dblotsky please take a look. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-cli CB-10679 redo Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-cli/pull/241.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #241 commit 1a8be501d31aeba99d56fd3280c39693941a99fb Author: Richard Knoll <richard.b.knoll@gmail.com> Date: 2016-03-10T18:32:14Z CB-10679 : Documenting how the CLI chooses plugin versions
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user dblotsky commented on the pull request:

        https://github.com/apache/cordova-cli/pull/241#issuecomment-195060242

        LGTM.

        Show
        githubbot ASF GitHub Bot added a comment - Github user dblotsky commented on the pull request: https://github.com/apache/cordova-cli/pull/241#issuecomment-195060242 LGTM.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user nikhilkh commented on a diff in the pull request:

        https://github.com/apache/cordova-cli/pull/241#discussion_r55766818

        — Diff: doc/readme.md —
        @@ -337,6 +337,18 @@ There are a number of ways to specify a plugin:

        commit-ish Commit/tag/branch reference. If none is specified, 'master' is used
        subdir Sub-directory to find plugin.xml for the specified plugin.

        +### Algorithm for choosing which plugin version to fetch from npm
        +
        +When adding a plugin to a project from npm, the CLI will choose which version
        +of the plugin to fetch based on the following criteria (listed in order of
        +precedence):
        +
        +1. The plugin version specified in the command (e.g. `cordova plugin add plugin@version`)
        +2. The plugin version saved in config.xml (i.e. if the plugin was previously added with `--save`)
        +3. The latest plugin version that the current project can support (only applies to plugins that list their [Cordova dependencies] in their `package.json`)
        +4. The plugin version pinned by your installed CLI version (only applies to [Apache-developed plugins])
        — End diff –

        This will likely need an update in a couple of days - when you remove plugin pinning.

        Show
        githubbot ASF GitHub Bot added a comment - Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/241#discussion_r55766818 — Diff: doc/readme.md — @@ -337,6 +337,18 @@ There are a number of ways to specify a plugin: commit-ish Commit/tag/branch reference. If none is specified, 'master' is used subdir Sub-directory to find plugin.xml for the specified plugin. +### Algorithm for choosing which plugin version to fetch from npm + +When adding a plugin to a project from npm, the CLI will choose which version +of the plugin to fetch based on the following criteria (listed in order of +precedence): + +1. The plugin version specified in the command (e.g. `cordova plugin add plugin@version`) +2. The plugin version saved in config.xml (i.e. if the plugin was previously added with `--save`) +3. The latest plugin version that the current project can support (only applies to plugins that list their [Cordova dependencies] in their `package.json`) +4. The plugin version pinned by your installed CLI version (only applies to [Apache-developed plugins] ) — End diff – This will likely need an update in a couple of days - when you remove plugin pinning.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user nikhilkh commented on a diff in the pull request:

        https://github.com/apache/cordova-cli/pull/241#discussion_r55767811

        — Diff: doc/readme.md —
        @@ -337,6 +337,18 @@ There are a number of ways to specify a plugin:

        commit-ish Commit/tag/branch reference. If none is specified, 'master' is used
        subdir Sub-directory to find plugin.xml for the specified plugin.

        +### Algorithm for choosing which plugin version to fetch from npm
        +
        +When adding a plugin to a project from npm, the CLI will choose which version
        +of the plugin to fetch based on the following criteria (listed in order of
        +precedence):
        +
        +1. The plugin version specified in the command (e.g. `cordova plugin add plugin@version`)
        — End diff –

        Consider changing `version` to `plugin-spec`

        Show
        githubbot ASF GitHub Bot added a comment - Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/241#discussion_r55767811 — Diff: doc/readme.md — @@ -337,6 +337,18 @@ There are a number of ways to specify a plugin: commit-ish Commit/tag/branch reference. If none is specified, 'master' is used subdir Sub-directory to find plugin.xml for the specified plugin. +### Algorithm for choosing which plugin version to fetch from npm + +When adding a plugin to a project from npm, the CLI will choose which version +of the plugin to fetch based on the following criteria (listed in order of +precedence): + +1. The plugin version specified in the command (e.g. `cordova plugin add plugin@version`) — End diff – Consider changing `version` to `plugin-spec`
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user nikhilkh commented on a diff in the pull request:

        https://github.com/apache/cordova-cli/pull/241#discussion_r55768334

        — Diff: doc/readme.md —
        @@ -337,6 +337,18 @@ There are a number of ways to specify a plugin:

        commit-ish Commit/tag/branch reference. If none is specified, 'master' is used
        subdir Sub-directory to find plugin.xml for the specified plugin.

        +### Algorithm for choosing which plugin version to fetch from npm
        +
        +When adding a plugin to a project from npm, the CLI will choose which version
        +of the plugin to fetch based on the following criteria (listed in order of
        +precedence):
        +
        +1. The plugin version specified in the command (e.g. `cordova plugin add plugin@version`)
        +2. The plugin version saved in config.xml (i.e. if the plugin was previously added with `--save`)
        +3. The latest plugin version that the current project can support (only applies to plugins that list their [Cordova dependencies] in their `package.json`)
        — End diff –

        "As for version 6.1, ..."

        Show
        githubbot ASF GitHub Bot added a comment - Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/241#discussion_r55768334 — Diff: doc/readme.md — @@ -337,6 +337,18 @@ There are a number of ways to specify a plugin: commit-ish Commit/tag/branch reference. If none is specified, 'master' is used subdir Sub-directory to find plugin.xml for the specified plugin. +### Algorithm for choosing which plugin version to fetch from npm + +When adding a plugin to a project from npm, the CLI will choose which version +of the plugin to fetch based on the following criteria (listed in order of +precedence): + +1. The plugin version specified in the command (e.g. `cordova plugin add plugin@version`) +2. The plugin version saved in config.xml (i.e. if the plugin was previously added with `--save`) +3. The latest plugin version that the current project can support (only applies to plugins that list their [Cordova dependencies] in their `package.json`) — End diff – "As for version 6.1, ..."
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user nikhilkh commented on the pull request:

        https://github.com/apache/cordova-cli/pull/241#issuecomment-196928858

        LGTM. Thanks!

        Show
        githubbot ASF GitHub Bot added a comment - Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-cli/pull/241#issuecomment-196928858 LGTM. Thanks!
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll closed the pull request at:

        https://github.com/apache/cordova-docs/pull/521

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll closed the pull request at: https://github.com/apache/cordova-docs/pull/521
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user riknoll opened a pull request:

        https://github.com/apache/cordova-docs/pull/559

        CB-10679: Adding docs for new plugin version fetching implementation

        Redo of old pull request that is rebased to master and clarifies a few things

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/riknoll/cordova-docs CB-10679

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/cordova-docs/pull/559.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #559


        commit f59968793b97935fc54fa3c5d700244694221520
        Author: riknoll <richard.b.knoll@gmail.com>
        Date: 2016-02-24T21:25:40Z

        CB-10679: Adding docs for new plugin version fetching implementation

        commit 4020a751adf5f74738453887e370b26025a9844f
        Author: Richard Knoll <richard.b.knoll@gmail.com>
        Date: 2016-03-15T20:32:51Z

        Clarifying some points


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user riknoll opened a pull request: https://github.com/apache/cordova-docs/pull/559 CB-10679 : Adding docs for new plugin version fetching implementation Redo of old pull request that is rebased to master and clarifies a few things You can merge this pull request into a Git repository by running: $ git pull https://github.com/riknoll/cordova-docs CB-10679 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/559.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #559 commit f59968793b97935fc54fa3c5d700244694221520 Author: riknoll <richard.b.knoll@gmail.com> Date: 2016-02-24T21:25:40Z CB-10679 : Adding docs for new plugin version fetching implementation commit 4020a751adf5f74738453887e370b26025a9844f Author: Richard Knoll <richard.b.knoll@gmail.com> Date: 2016-03-15T20:32:51Z Clarifying some points
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on the pull request:

        https://github.com/apache/cordova-docs/pull/559#issuecomment-197010928

        @nikhilkh I just put the Cordova version in bold in the first sentence of the section. Let me know if I should update that.

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-docs/pull/559#issuecomment-197010928 @nikhilkh I just put the Cordova version in bold in the first sentence of the section. Let me know if I should update that.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on the pull request:

        https://github.com/apache/cordova-docs/pull/559#issuecomment-197479211

        Added blog post

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-docs/pull/559#issuecomment-197479211 Added blog post
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user nikhilkh commented on a diff in the pull request:

        https://github.com/apache/cordova-docs/pull/559#discussion_r56598656

        — Diff: www/docs/en/dev/guide/hybrid/plugins/index.md —
        @@ -239,3 +239,105 @@ For example, for a plugin that supports android, iOS & Windows, the keywords in
        ```

        For more detailed example of a package.json, review the [package.json file of cordova-plugin-device](https://github.com/apache/cordova-plugin-device/blob/master/package.json).
        +
        +### Specifying Cordova Dependencies
        +
        +*Cordova 6.1.0* added support for specifying the Cordova-related dependencies of a plugin
        +as part of the plugin's `package.json` file. Plugins may list the dependencies for multiple
        +releases so as to provide guidance to the Cordova CLI when it is selecting the version of a
        +plugin to fetch from npm. The CLI will choose the latest release of a plugin that is
        +compatible with the local project's installed platforms and plugins as well as the
        +the local Cordova CLI version. If no releases of the plugin are compatible, the CLI will warn
        +the user about the failed requirements and fall back to the old behavior of fetching the
        +latest release.
        +
        +This feature is intended to eventually replace the [engines element](../../../plugin_ref/spec.html#engines-and-engine) in plugin.xml.
        +Listing dependencies is a good way to ensure that your plugin will not appear broken or cause
        +build errors when fetched from npm. If the latest release of the plugin is not compatible with
        +a project, the CLI will give the app developer a list of unmet project requirements so that
        +they are aware of incompatibilites and can update their project to support your plugin. This
        +allows your plugin to respond to breaking changes without fear of confusing devlopers who
        +are building against old platforms and plugins.
        +
        +To specify Cordova-related dependencies for a plugin, alter the `engines` element in
        +`package.json` to include a `cordovaDependencies` object using the following
        +structure:
        +
        +```javascript
        +engines: {
        + cordovaDependencies: {
        + PLUGIN_VERSION:

        { + DEPENDENCY: SEMVER_RANGE, + DEPENDENCY: SEMVER_RANGE, + ... + }

        ,
        + ...
        + }
        +}
        +```
        +
        +* `PLUGIN_VERSION` specifies a version of your plugin. It should adhere the syntax for a single version as defined by [npm's semver package][npm-semver] or an upper bound (see [below](#upper-bounds))
        — End diff –

        Nit: You could as well hyper-link "upper bound"

        Show
        githubbot ASF GitHub Bot added a comment - Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/559#discussion_r56598656 — Diff: www/docs/en/dev/guide/hybrid/plugins/index.md — @@ -239,3 +239,105 @@ For example, for a plugin that supports android, iOS & Windows, the keywords in ``` For more detailed example of a package.json, review the [package.json file of cordova-plugin-device] ( https://github.com/apache/cordova-plugin-device/blob/master/package.json ). + +### Specifying Cordova Dependencies + +* Cordova 6.1.0 * added support for specifying the Cordova-related dependencies of a plugin +as part of the plugin's `package.json` file. Plugins may list the dependencies for multiple +releases so as to provide guidance to the Cordova CLI when it is selecting the version of a +plugin to fetch from npm. The CLI will choose the latest release of a plugin that is +compatible with the local project's installed platforms and plugins as well as the +the local Cordova CLI version. If no releases of the plugin are compatible, the CLI will warn +the user about the failed requirements and fall back to the old behavior of fetching the +latest release. + +This feature is intended to eventually replace the [engines element] (../../../plugin_ref/spec.html#engines-and-engine) in plugin.xml. +Listing dependencies is a good way to ensure that your plugin will not appear broken or cause +build errors when fetched from npm. If the latest release of the plugin is not compatible with +a project, the CLI will give the app developer a list of unmet project requirements so that +they are aware of incompatibilites and can update their project to support your plugin. This +allows your plugin to respond to breaking changes without fear of confusing devlopers who +are building against old platforms and plugins. + +To specify Cordova-related dependencies for a plugin, alter the `engines` element in +`package.json` to include a `cordovaDependencies` object using the following +structure: + +```javascript +engines: { + cordovaDependencies: { + PLUGIN_VERSION: { + DEPENDENCY: SEMVER_RANGE, + DEPENDENCY: SEMVER_RANGE, + ... + } , + ... + } +} +``` + +* `PLUGIN_VERSION` specifies a version of your plugin. It should adhere the syntax for a single version as defined by [npm's semver package] [npm-semver] or an upper bound (see [below] (#upper-bounds)) — End diff – Nit: You could as well hyper-link "upper bound"
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user nikhilkh commented on the pull request:

        https://github.com/apache/cordova-docs/pull/559#issuecomment-198142720

        LGTM.

        Show
        githubbot ASF GitHub Bot added a comment - Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-docs/pull/559#issuecomment-198142720 LGTM.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user stevengill commented on a diff in the pull request:

        https://github.com/apache/cordova-docs/pull/559#discussion_r56729389

        — Diff: www/_posts/2016-03-16-new-plugin-fetching.md —
        @@ -0,0 +1,46 @@
        +---
        +layout: post
        +author:
        + name: Richard Knoll
        + url: https://github.com/riknoll
        +title: "Upcoming Changes to Plugin Fetching"
        +categories: announcements
        +tags: news
        +---
        +
        +The Cordova 6.0.0 release introduced the pinning of core plugin
        +versions in cordova-lib.
        +
        +We are happy to announce that one of the new features in the upcoming
        +Cordova 6.1.0 release is a general API that allows any plugin to guide
        +the CLI in choosing a compatible plugin release to fetch for a given project.
        +This moves the plugin dependency information out of cordova-lib so that it
        +can update independently of the Cordova tools and support third-party plugins
        +outside of core. Our hope is that this feature will improve Cordova's plugin
        +ecosystem and reduce some of the frustration that Cordova developers face when
        +adding a new plugin to a project.
        +
        +<!-more->
        +
        +The new API allows for plugin developers to give a mapping of plugin
        +releases to project requirements in their `package.json`. When an app developer
        +adds a plugin to their Cordova project, cordova-lib will examine their
        +installed plugins, platforms, and cordova-lib version and decide which
        +version of the plugin to fetch based on the provided mapping.
        +If the project does not fulfill the requirements for the latest release of the
        +plugin, the CLI will print warnings indicating the problems and fetch the
        +latest release of the plugin that is compatible.
        +
        +This API may eventually replace the [engines element](http://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#engines-and-engine) in `plugin.xml`.
        — End diff –

        I would say it *will* eventually replace the engine element in plugin.xml! But we can wait until we actually make that change

        Show
        githubbot ASF GitHub Bot added a comment - Github user stevengill commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/559#discussion_r56729389 — Diff: www/_posts/2016-03-16-new-plugin-fetching.md — @@ -0,0 +1,46 @@ +--- +layout: post +author: + name: Richard Knoll + url: https://github.com/riknoll +title: "Upcoming Changes to Plugin Fetching" +categories: announcements +tags: news +--- + +The Cordova 6.0.0 release introduced the pinning of core plugin +versions in cordova-lib. + +We are happy to announce that one of the new features in the upcoming +Cordova 6.1.0 release is a general API that allows any plugin to guide +the CLI in choosing a compatible plugin release to fetch for a given project. +This moves the plugin dependency information out of cordova-lib so that it +can update independently of the Cordova tools and support third-party plugins +outside of core. Our hope is that this feature will improve Cordova's plugin +ecosystem and reduce some of the frustration that Cordova developers face when +adding a new plugin to a project. + +<!- more -> + +The new API allows for plugin developers to give a mapping of plugin +releases to project requirements in their `package.json`. When an app developer +adds a plugin to their Cordova project, cordova-lib will examine their +installed plugins, platforms, and cordova-lib version and decide which +version of the plugin to fetch based on the provided mapping. +If the project does not fulfill the requirements for the latest release of the +plugin, the CLI will print warnings indicating the problems and fetch the +latest release of the plugin that is compatible. + +This API may eventually replace the [engines element] ( http://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#engines-and-engine ) in `plugin.xml`. — End diff – I would say it * will * eventually replace the engine element in plugin.xml! But we can wait until we actually make that change
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user stevengill commented on the pull request:

        https://github.com/apache/cordova-docs/pull/559#issuecomment-198562921

        LGTM

        Show
        githubbot ASF GitHub Bot added a comment - Github user stevengill commented on the pull request: https://github.com/apache/cordova-docs/pull/559#issuecomment-198562921 LGTM
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on a diff in the pull request:

        https://github.com/apache/cordova-docs/pull/559#discussion_r56738586

        — Diff: www/_posts/2016-03-16-new-plugin-fetching.md —
        @@ -0,0 +1,46 @@
        +---
        +layout: post
        +author:
        + name: Richard Knoll
        + url: https://github.com/riknoll
        +title: "Upcoming Changes to Plugin Fetching"
        +categories: announcements
        +tags: news
        +---
        +
        +The Cordova 6.0.0 release introduced the pinning of core plugin
        +versions in cordova-lib.
        +
        +We are happy to announce that one of the new features in the upcoming
        +Cordova 6.1.0 release is a general API that allows any plugin to guide
        +the CLI in choosing a compatible plugin release to fetch for a given project.
        +This moves the plugin dependency information out of cordova-lib so that it
        +can update independently of the Cordova tools and support third-party plugins
        +outside of core. Our hope is that this feature will improve Cordova's plugin
        +ecosystem and reduce some of the frustration that Cordova developers face when
        +adding a new plugin to a project.
        +
        +<!-more->
        +
        +The new API allows for plugin developers to give a mapping of plugin
        +releases to project requirements in their `package.json`. When an app developer
        +adds a plugin to their Cordova project, cordova-lib will examine their
        +installed plugins, platforms, and cordova-lib version and decide which
        +version of the plugin to fetch based on the provided mapping.
        +If the project does not fulfill the requirements for the latest release of the
        +plugin, the CLI will print warnings indicating the problems and fetch the
        +latest release of the plugin that is compatible.
        +
        +This API may eventually replace the [engines element](http://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#engines-and-engine) in `plugin.xml`.
        — End diff –

        Sure!

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/559#discussion_r56738586 — Diff: www/_posts/2016-03-16-new-plugin-fetching.md — @@ -0,0 +1,46 @@ +--- +layout: post +author: + name: Richard Knoll + url: https://github.com/riknoll +title: "Upcoming Changes to Plugin Fetching" +categories: announcements +tags: news +--- + +The Cordova 6.0.0 release introduced the pinning of core plugin +versions in cordova-lib. + +We are happy to announce that one of the new features in the upcoming +Cordova 6.1.0 release is a general API that allows any plugin to guide +the CLI in choosing a compatible plugin release to fetch for a given project. +This moves the plugin dependency information out of cordova-lib so that it +can update independently of the Cordova tools and support third-party plugins +outside of core. Our hope is that this feature will improve Cordova's plugin +ecosystem and reduce some of the frustration that Cordova developers face when +adding a new plugin to a project. + +<!- more -> + +The new API allows for plugin developers to give a mapping of plugin +releases to project requirements in their `package.json`. When an app developer +adds a plugin to their Cordova project, cordova-lib will examine their +installed plugins, platforms, and cordova-lib version and decide which +version of the plugin to fetch based on the provided mapping. +If the project does not fulfill the requirements for the latest release of the +plugin, the CLI will print warnings indicating the problems and fetch the +latest release of the plugin that is compatible. + +This API may eventually replace the [engines element] ( http://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#engines-and-engine ) in `plugin.xml`. — End diff – Sure!
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user stevengill commented on the pull request:

        https://github.com/apache/cordova-docs/pull/559#issuecomment-199960047

        Lets merge and publish this! That way I can reference it in tools release blog post.

        Show
        githubbot ASF GitHub Bot added a comment - Github user stevengill commented on the pull request: https://github.com/apache/cordova-docs/pull/559#issuecomment-199960047 Lets merge and publish this! That way I can reference it in tools release blog post.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on the pull request:

        https://github.com/apache/cordova-docs/pull/559#issuecomment-199960669

        What is the expected review time for blog posts? I sent an email to the dev list yesterday.

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-docs/pull/559#issuecomment-199960669 What is the expected review time for blog posts? I sent an email to the dev list yesterday.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user stevengill commented on the pull request:

        https://github.com/apache/cordova-docs/pull/559#issuecomment-199991281

        We don't have a strict policy for blog posts. I think one day is good enough. We can always update blog posts at a later date if the need arises.

        Show
        githubbot ASF GitHub Bot added a comment - Github user stevengill commented on the pull request: https://github.com/apache/cordova-docs/pull/559#issuecomment-199991281 We don't have a strict policy for blog posts. I think one day is good enough. We can always update blog posts at a later date if the need arises.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user riknoll commented on the pull request:

        https://github.com/apache/cordova-docs/pull/559#issuecomment-200008409

        Okay

        Show
        githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-docs/pull/559#issuecomment-200008409 Okay
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 3def9d4281af3d00e719bc4637b434619d99bdf4 in cordova-docs's branch refs/heads/master from riknoll
        [ https://git-wip-us.apache.org/repos/asf?p=cordova-docs.git;h=3def9d4 ]

        CB-10679: Adding docs for new plugin version fetching implementation

        Show
        jira-bot ASF subversion and git services added a comment - Commit 3def9d4281af3d00e719bc4637b434619d99bdf4 in cordova-docs's branch refs/heads/master from riknoll [ https://git-wip-us.apache.org/repos/asf?p=cordova-docs.git;h=3def9d4 ] CB-10679 : Adding docs for new plugin version fetching implementation
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit b2230079045a6dde3363b562de243ca202561c23 in cordova-docs's branch refs/heads/master from Richard Knoll
        [ https://git-wip-us.apache.org/repos/asf?p=cordova-docs.git;h=b223007 ]

        CB-10679: Adding blog post for plugin version selection docs

        This closes #559

        Show
        jira-bot ASF subversion and git services added a comment - Commit b2230079045a6dde3363b562de243ca202561c23 in cordova-docs's branch refs/heads/master from Richard Knoll [ https://git-wip-us.apache.org/repos/asf?p=cordova-docs.git;h=b223007 ] CB-10679 : Adding blog post for plugin version selection docs This closes #559
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/cordova-docs/pull/559

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/cordova-docs/pull/559
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit cbc7514ab663926da62cf9bbac3d821da7cc26aa in cordova-cli's branch refs/heads/master from Richard Knoll
        [ https://git-wip-us.apache.org/repos/asf?p=cordova-cli.git;h=cbc7514 ]

        CB-10679: Documenting how the CLI chooses plugin versions

        This closes #241

        Show
        jira-bot ASF subversion and git services added a comment - Commit cbc7514ab663926da62cf9bbac3d821da7cc26aa in cordova-cli's branch refs/heads/master from Richard Knoll [ https://git-wip-us.apache.org/repos/asf?p=cordova-cli.git;h=cbc7514 ] CB-10679 : Documenting how the CLI chooses plugin versions This closes #241
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/cordova-cli/pull/241

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/cordova-cli/pull/241

          People

          • Assignee:
            riknoll Richard B Knoll
            Reporter:
            riknoll Richard B Knoll
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development