This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-docs.git
The following commit(s) were added to refs/heads/master by this push:
new 53a86050ab doc: refactor platform plugin versioning (#1314)
53a86050ab is described below
commit 53a86050ab07b2f333cdd3d8ca2fef1b4def6351
Author: エリス <[email protected]>
AuthorDate: Fri May 26 20:19:45 2023 +0900
doc: refactor platform plugin versioning (#1314)
* doc: refactor platform plugin versioning
* chore: apply suggestions from code review
* doc: refactor platform pinning page more
Co-authored-by: Niklas Merz <[email protected]>
---
.../en/dev/platform_plugin_versioning_ref/index.md | 71 +++++++++++++++++-----
1 file changed, 57 insertions(+), 14 deletions(-)
diff --git a/www/docs/en/dev/platform_plugin_versioning_ref/index.md
b/www/docs/en/dev/platform_plugin_versioning_ref/index.md
index dd09452470..ac45023539 100644
--- a/www/docs/en/dev/platform_plugin_versioning_ref/index.md
+++ b/www/docs/en/dev/platform_plugin_versioning_ref/index.md
@@ -44,7 +44,9 @@ To save a platform, issue the following command:
cordova platform add <platform[@<version>] | directory | git_url>
```
-After running the above command, the **`package.json`** should contain
something as seen below:
+After running the above command, the **`package.json`** should update with the
platform dependency and cordova related information.
+
+Example:
```json
"cordova": {
@@ -57,30 +59,71 @@ After running the above command, the **`package.json`**
should contain something
}
```
-The `--nosave` flag prevents adding and deleting specified platforms to the
`package.json` file. To prevent saving a platform, issue the following command:
+The `--nosave` flag prevents adding and deleting the specified platform from
the `package.json` file.
+
+Example:
```bash
cordova platform add <platform[@<version>] | directory | git_url> --nosave
```
-Some Examples:
+The examples below fetch the package, extract it to `node_modules` and update
the `package.json` file accordingly. Under the covers, this process is
controlled by the npm CLI. Here are various ways to add platforms.
-* **`cordova platform add android`**
+*Adding with Cordova resolved name:*
- Retrieves the pinned version of `cordova-android` platform from npm, adds it
to the project and updates the `package.json` file.
+Example:
-* **`cordova platform add [email protected]`**
+```bash
+cordova platform add android
+```
- Retrieves the `cordova-android` platform version `7.1.4` from npm, adds it
to the project and updates the `package.json` file.
+The avaialble Cordova resolved names are:
-* **`cordova platform add https://github.com/apache/cordova-android.git`**
-
- **`cordova platform add https://github.com/apache/cordova-android`**
-
- **`cordova platform add github:apache/cordova-android`**
+| Cordova Resolved Name | NPM Package Name |
+| --- | --- |
+| `android` | `cordova-android` |
+| `electron` | `cordova-electron` |
+| `ios` | `cordova-ios` |
+| `browser` | `cordova-browser` |
+
+*Adding with Cordova resolved name and pinned version:*
+
+Example:
+
+```bash
+cordova platform add [email protected]
+```
+
+This command will explicitly fetch for version `7.1.4`.
+
+*Adding with npm package name:*
+
+Example:
+
+```bash
+cordova platform add cordova-android
+```
+
+*Adding with Git URL:*
+
+Example:
+
+```bash
+cordova platform add https://github.com/apache/cordova-android.git
+```
+
+or
+
+```bash
+cordova platform add https://github.com/apache/cordova-android
+```
+
+or
+
+```bash
+cordova platform add github:apache/cordova-android
+```
- npm retrieves the `cordova-android` platform from the git repository, adds
it to the project and updates the `package.json`.
-
* **`cordova platform add C:/path/to/android/platform`**
Retrieves the Android platform from the specified directory, adds it to the
project, and updates the `package.json` file.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]