Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionic state save doesn't save the plugin version even when I explicitly mentioned it in the package.json #666

Closed
janpio opened this issue Nov 25, 2015 · 4 comments

Comments

@janpio
Copy link
Contributor

janpio commented Nov 25, 2015

I have set the plugin version of multiple cordovaPlugins explicitly in package.json after the big update to Cordova plugins. plugins/fetch.json also contains the version numbers as it should.

But when I do ionic state save my package.json gets recreated without all these versions, so a future ionic state restore/reset won't work as intended. Is this intended that this information is ignored or is this a bug and should be fixed?

@poornerd
Copy link

poornerd commented Dec 7, 2015

I have the same problem

@tomsun
Copy link

tomsun commented Mar 14, 2016

Same issue here when using Git urls with refs.

Attempting to target tag r1.0.0 in this example, which plugins/fetch.json captures correctly, but which ionic state save omits in package.json, which means ionic state restore picks the latest version:

$ ionic plugin add https://github.com/apache/cordova-plugin-console.git#r1.0.0
Fetching plugin "https://github.com/apache/cordova-plugin-console.git" via git clone
Repository "https://github.com/apache/cordova-plugin-console.git" checked out to git ref "r1.0.0".
Installing "cordova-plugin-console" for android
Installing "cordova-plugin-console" for ios
Saving plugin to package.json file
$ cat plugins/fetch.json
...
    "cordova-plugin-console": {
        "source": {
            "type": "git",
            "url": "https://github.com/apache/cordova-plugin-console.git",
            "subdir": ".",
            "ref": "r1.0.0"
        },
        "is_top_level": true,
        "variables": {}
    }
...
$ ionic state save
$ cat package.json
...
    {
      "locator": "https://github.com/apache/cordova-plugin-console.git",
      "id": "cordova-plugin-console"
    }
...
$ cordova plugin remove cordova-plugin-console
Uninstalling cordova-plugin-console from android
Uninstalling cordova-plugin-console from ios
Removing "cordova-plugin-console"
$ ionic state restore
Attempting to restore your Ionic application from package.json

...

cordova plugin add https://github.com/apache/cordova-plugin-console.git 
Restore plugins is complete

Ionic state restore completed
$ cat plugins/cordova-plugin-console/package.json |grep version
  "version": "1.0.3-dev",

@tomsun
Copy link

tomsun commented Mar 14, 2016

Letting npm fetch the source locally can be a viable workaround sometimes (requires a package.json in the plugin repo):

npm install --save git+https://github.com/apache/cordova-plugin-console.git#r1.0.0
ionic plugin add ./node_modules/cordova-plugin-console
ionic state save

@jgw96
Copy link
Contributor

jgw96 commented May 2, 2016

Hello all! Thanks for opening an issue with us. We are currently in the process of deprecating the ionic state commands in favor of doing it the cordova way. https://cordova.apache.org/docs/en/latest/platform_plugin_versioning_ref/index.html You can keep up with the status of this on #904 . Thanks for using Ionic!

@jgw96 jgw96 closed this as completed May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants