erisu commented on PR #939: URL: https://github.com/apache/cordova-plugin-camera/pull/939#issuecomment-3625674339
I think to summarize what @dpogue was explaining: When a plugin is installed, the values defined in `plugin.xml` are the main deciding factor in whether the plugin is compatible with the project's current setup. Following his example: When the command `cordova plugin add cordova-plugin-camera` is executed, Cordova fetches the package's metadata from the npm registry and iterates through its `cordovaDependencies` to determine which version is actually compatible with the project. If the latest version is compatible, it will be used. Once the version is decided and tries to run, it will run one more test against the values defined in `plugin.xml`. The issue arises when `cordovaDependencies` includes a `-dev` version. If that version was identified as the "compatible" one and attempted to be fetched, it will fail because dev versions are never published to npm. In the case of installing from a local directory or repo, I think it skips this process. Using npm's properties—`dependencies`, `devDependencies`, `optionalDependencies`, and `peerDependencies`—wouldn't serve the same purpose as `cordovaDependencies`. At best, `peerDependencies` might be able to replace the `engines` tags in `plugin.xml`, as long as it doesn't automatically install or block anything. However, it may warn users that they need to install certain platforms or the CLI in their project, even if they don't actually support that platform or that they prefer using a global install of CLI. -- 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]
