You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/05/08 05:24:47 UTC

[GitHub] [cordova-docs] erisu commented on a change in pull request #979: Updated Platform and Plugin Versioning

erisu commented on a change in pull request #979: Updated Platform and Plugin Versioning
URL: https://github.com/apache/cordova-docs/pull/979#discussion_r281916976
 
 

 ##########
 File path: www/docs/en/dev/platform_plugin_versioning_ref/index.md
 ##########
 @@ -22,225 +22,276 @@ toc_title: Manage versions and platforms
 description: How to manage platforms and Cordova CLI versions.
 ---
 
-# Platforms and Plugins Version Management
+## Platforms and Plugins Version Management
+
 From version 4.3.0 onwards, Cordova provides the ability to save and restore platforms and plugins.
 
 This feature allows developers to save and restore their app to a known state without having to check in all of the platform and plugin source code.
 
 When adding a platform or plugin, details about the app's platform and plugin versions are automatically saved in config.xml and package.json. It is possible to add a platform or plugin by editing package.json or config.xml directly, assuming you know the right tags + syntax. It is not possible to remove plugins or platforms in this manner. The recommended method of adding and removing plugins and platforms is with the command line cordova commands `cordova plugin add|remove ...` and `cordova platform add|remove ...` to avoid any out of sync issues.
 
-The 'restore' step happens automatically when a **'cordova prepare'** is issued, making use of information previously saved in the config.xml and package.json files.
+The 'restore' step happens automatically when a **`cordova prepare`** is issued, making use of information previously saved in the config.xml and package.json files.
 
 One scenario where save/restore capabilities come in handy is in large teams that work on an app, with each team member focusing on a platform or plugin. This feature makes it easier to share the project and reduce the amount of redundant code that is checked in the repository.
 
-
 ## Platform Versioning
 
-### Saving platforms
-To save a platform, you issue the following command :
+### Saving Platforms
+
+To save a platform, issue the following command:
 
 ```bash
-$ cordova platform add <platform[@<version>] | directory | git_url>
+cordova platform add <platform[@<version>] | directory | git_url>
 ```
 
-After running the above command, the resulting config.xml looks like :
-
-```xml
-<?xml version='1.0' encoding='utf-8'?>
-    ...
-    <engine name="android" spec="~4.0.0" />
-    ...
-</xml>
+After running the above command, the **`package.json`** should contain something as seen below:
+
+```json
+"cordova": {
+  "platforms": [
+    "android"
+  ]
+},
+"dependencies": {
 
 Review comment:
   When looking at a project that I created awhile back with Cordova 9, it put the platform as a `dependencies` and plugins as `devDependencies`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org