You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Treggiari, Leo" <le...@intel.com> on 2014/08/13 20:41:03 UTC

cordova plugin save

I'm new to this mailing list.  I work on the Intel(r) XDK which is another IDE which supports the creation of hybrid apps using Cordova plugins.

I'm having trouble figuring out what the proposed 'cordova plugin save' command does.  Is there an up-to-date 'spec' that explains the goals of the command and the implementation?

A couple of things that I have read in the mailing list concern me.

There is mention of saving information in config.xml.  The usage of config.xml is somewhat of a mystery to me:
-  Who owns the file?  Does the user own and edit it?  Do certain Cordova CLI commands edit it?  What are the valid entries?
-  Is it treated differently by different platform builds - e.g. iOS vs. Android?  Is it treated differently by Cordova CLI vs. other Cordova IDEs which directly use Cordova CLI or not - e.g. PhoneGap build?
-  If Cordova CLI wants to store 'project-level' metadata, is this a good place to put it?  If the answer to the first question above is not well defined, or the answer to the second question is that different 'things' are using it differently, then config.xml may not be a good place to be putting new metadata.

There is a mention of plugin "restoring" and making the plugins directory optional.  This relates to the issue of plugin 'versions'.  Now, when a user executes 'cordova plugin add', plugin sources are fetched and the version of the plugin that was added is fixed until the user explicitly removes and re-adds it.  Is 'cordova plugin save' & 'restore' suggesting a new version management model?  E.g. if I add a plugin without a specific version suffix and 'restore' it later, I may not get the same version, right?

If there is a 'spec', I should be able to answer these questions myself.

Thanks,
Leo Treggiari


Re: cordova plugin save

Posted by Michal Mocny <mm...@chromium.org>.
A few answers:
- There is no spec, since this is an "experimental" feature we aren't
ourselves sure yet how it will look when complete.  That was the point of
recent threads.
- The file belongs to the app / user, not to the workspace / tooling.
- Aside from the initial create script that sets name etc, the
plugin/platform save command is the first tooling command to edit the file
directly (I think?).
- You can read more here:
https://cordova.apache.org/docs/en/edge/config_ref_index.md.html
- The top level "app" config.xml is not platform specific, but you can have
platform specific settings in there by using the <platform> tag
- It is specific to cordova CLI.  Each platform has another, different
config.xml (we usually call it the "platform" config.xml) which is created
during cordova prepare, and thats what edited with non cli workflow.
- Phonegap workflow (also chrome cordova (cca) and likely others) is
compatible with cordova config.xml, but those often also add extensions to
the options
- "project-level" (I call this "workspace") metadata should *not* go into
app config.xml. We already have another file, .cordova/config.json for
those.  However, the list of plugins that your app needs is arguably not a
property of a workspace, but truly a property of your application.  Ditto
for platforms (to a lesser extent).

I'm not so sure what the proposal is for removing plugins/ directory, I
don't think there is anything concrete for that, it was just ramblings of
various contributors ;)

-Michal


On Wed, Aug 13, 2014 at 2:41 PM, Treggiari, Leo <le...@intel.com>
wrote:

> I'm new to this mailing list.  I work on the Intel(r) XDK which is another
> IDE which supports the creation of hybrid apps using Cordova plugins.
>
> I'm having trouble figuring out what the proposed 'cordova plugin save'
> command does.  Is there an up-to-date 'spec' that explains the goals of the
> command and the implementation?
>
> A couple of things that I have read in the mailing list concern me.
>
> There is mention of saving information in config.xml.  The usage of
> config.xml is somewhat of a mystery to me:
> -  Who owns the file?  Does the user own and edit it?  Do certain Cordova
> CLI commands edit it?  What are the valid entries?
> -  Is it treated differently by different platform builds - e.g. iOS vs.
> Android?  Is it treated differently by Cordova CLI vs. other Cordova IDEs
> which directly use Cordova CLI or not - e.g. PhoneGap build?
> -  If Cordova CLI wants to store 'project-level' metadata, is this a good
> place to put it?  If the answer to the first question above is not well
> defined, or the answer to the second question is that different 'things'
> are using it differently, then config.xml may not be a good place to be
> putting new metadata.
>
> There is a mention of plugin "restoring" and making the plugins directory
> optional.  This relates to the issue of plugin 'versions'.  Now, when a
> user executes 'cordova plugin add', plugin sources are fetched and the
> version of the plugin that was added is fixed until the user explicitly
> removes and re-adds it.  Is 'cordova plugin save' & 'restore' suggesting a
> new version management model?  E.g. if I add a plugin without a specific
> version suffix and 'restore' it later, I may not get the same version,
> right?
>
> If there is a 'spec', I should be able to answer these questions myself.
>
> Thanks,
> Leo Treggiari
>
>