Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC981196D3 for ; Fri, 18 Mar 2016 00:20:33 +0000 (UTC) Received: (qmail 66815 invoked by uid 500); 18 Mar 2016 00:20:33 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 66787 invoked by uid 500); 18 Mar 2016 00:20:33 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 66771 invoked by uid 99); 18 Mar 2016 00:20:33 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Mar 2016 00:20:33 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 727182C1F56 for ; Fri, 18 Mar 2016 00:20:33 +0000 (UTC) Date: Fri, 18 Mar 2016 00:20:33 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-10679) Update plugin add behavior to allow plugins to list engine constraints MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-10679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15200687#comment-15200687 ] ASF GitHub Bot commented on CB-10679: ------------------------------------- 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" > Update plugin add behavior to allow plugins to list engine constraints > ---------------------------------------------------------------------- > > Key: CB-10679 > URL: https://issues.apache.org/jira/browse/CB-10679 > Project: Apache Cordova > Issue Type: Improvement > Components: CordovaLib > Reporter: Richard B Knoll > Assignee: Richard B Knoll > Labels: triaged > > 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 -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org