GitToTheHub commented on PR #939:
URL: 
https://github.com/apache/cordova-plugin-camera/pull/939#issuecomment-3625475445

   > The actual requirements that are enforced are as defined in the plugin.xml 
file engine elements.
   
   But do I understand wrong, that this can be replaced by 
`cordovaDependencies` in `package.json`? Why does the 
[documentation](https://cordova.apache.org/docs/en/13.x-2025.11/plugin_ref/spec.html#engines-and-engine)
 say, that this is the replacement for the `<engines>` tag in `plugin.xml`? Is 
it wrong to remove the `<engines>` tag in `plugin.xml`, when 
`cordovaDependencies` is present in `package.json`? What do I miss here?
   
   > The idea with the list of cordovaDependencies in package.json is that if 
you did cordova plugin add cordova-plugin-camera, the CLI tooling would look at 
the cordovaDependencies of the latest version of cordova-plugin-camera and 
check your local platform/tooling versions and then figure out which version of 
the plugin was actually compatible and install that one, rather than defaulting 
to the latest. I don't think that ever got fully implemented in the tooling 
through.
   
   I understand. If have for e.g. `cordova-ios` `7.0.0` installed, the cli 
looks in `cordovaDependencies` of a plugin which plugin version should be used 
for it. There would be no other good way, to determine the needed plugin 
version for `cordova-ios` `7.0.0`.
   
   > The platform versions should not be listed as dependencies because that 
would cause other platforms to potentially be downloaded when they aren't 
needed (i.e. an app that only targets Android could end up getting cordova-ios 
pulled in as an unnecessary dependency).
   
   I understand and makes sense. Maybe 
[peerDependencies](https://docs.npmjs.com/cli/v11/configuring-npm/package-json/#peerdependencies)
 could be used for it along with 
[peerDependenciesMeta](https://docs.npmjs.com/cli/v11/configuring-npm/package-json/#peerdependenciesmeta).
 Maybe`peerDependenciesMeta` could be used to define which plugin version uses 
which Cordova related dependency. `peerDependencies` itself would than define 
Cordova dependencies for the latest plugin version.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to