cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-13463) No way to prevent package.json update with cordova commands even with --nosave
Date Wed, 25 Oct 2017 16:20:00 GMT


ASF GitHub Bot commented on CB-13463:

Github user audreyso commented on the issue:
    @stevengill CI is passing now. Let me know if I should merge it in!

> No way to prevent package.json update with cordova commands even with --nosave
> ------------------------------------------------------------------------------
>                 Key: CB-13463
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-cli
>    Affects Versions: cordova@7.0.0
>            Reporter: Andrew Crites
>              Labels: reproduced, triaged
> With Cordova 7, cordova commands including {{cordova platform add}} and {{cordova prepare}}
will copy plugin information from {{config.xml}} to {{package.json}}. 
> According to [the saving platforms documentation|],
using {{--nosave}} should prevent updating {{package.json}} or {{config.xml}}, but this does
not work (i.e. using {{--nosave}} still seems to update the {{package.json}}.
> I want to avoid updating {{package.json}} specifically because there doesn't seem to
be a way to avoid hard coding variables for plugins. An example is the cordova fabric plugin:
> {code}
>   <plugin name="cordova-fabric-plugin" spec="^1.1.9">
>     <variable name="FABRIC_API_KEY" value="a" />
>     <variable name="FABRIC_API_SECRET" value="b" />
>   </plugin>
> {code}
> Cordova doesn't seem to provide a way for you to parameterize variables in the configuration.
To get around this, I have {{build.config.xml}} where they are parameterized, and {{config.xml}}
is created at install-time and not version controlled. However, this would be much more difficult
to do with {{package.json}} and is practically not an option.
> When running {{cordova platform add ios --nosave}} with the above plugin, cordova still
updates {{package.json}} to include the fabric plugin with the hard coded variables.
> * Cordova 6 question (with solution):
> * Cordova 7 question (no solution yet)
> Ideally {{--nosave}} would not update {{package.json}} as advertised. Even better, there
should be a way to set up a cordova project so that any cordova commands do not save by default.
This would prevent mistakes in a larger team and allow use of tools that wrap cordova such
as ionic.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message