Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It turns out that while the publish to NPM solved our Ionic/Cordova resolution errors, Cordova has some behaviour where it updates
package.json
with each plugin as a Dependency, along with updatingconfig.xml
with the usual plugin details.Because this repo is published at https://www.npmjs.com/package/cordova-open-native-settings,
npm install cordova-open-native-settings
causes this repo to be added topackage.json
as this:However when Cordova reconciles the plugin repo on npmjs.com (
cordova-open-native-settings
) it adds the plugin ID topackage.json
instead of the NPM repo name, which creates this:This new
package.json
now fails tonpm install
because the plugin ID as a dependency isn't an actual NPM package.I think the plugin needs to be published to NPM as its plugin ID, not as the
package.json
name. To confirm this behaviour, I published the plugin to a private registry:After adjusting my project to pull from this private registry, the install process worked mostly as expected:
... but as you can see, Cordova parses the NPM repo and adds the plugin ID to
package.json
, and in this casenet.gsrweb.cordova.plugins.cordovaopennativesettings
is not a valid repository so if this change gets committed, any build after this point will result in a failure to obtain the plugin.This PR is a 2-step fix for these problems. Contained here are some changes:
package.json
name with plugin ID... and to make this fully functional, this plugin will need to be published to NPM as its plugin ID (
net.gsrweb.cordova.plugins.cordovaopennativesettings
). Now that thepackage.json
name is the same as the plugin ID, the procedure is simplynpm publish
after merging this PR.@guyromb as maintainer of this project, I think it makes sense for you to perform the merge and publish! Please let me know if it's a hassle and perhaps we can publish in a different way.