From e11ba4dad4e16c5e9c71157fb39bf12711b54943 Mon Sep 17 00:00:00 2001 From: Jan Piotrowski Date: Sat, 9 Nov 2024 05:42:37 +0100 Subject: [PATCH] Update readme.md (#428) --- doc/readme.md | 66 --------------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/doc/readme.md b/doc/readme.md index 2c6fff27..72b857f1 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -150,72 +150,6 @@ cordova create path [id [name]] [options] |--------|-------------| | --template | Use a custom template located locally, in NPM, or GitHub. | -### Directory structure - -Cordova CLI works with the following directory structure: - -```bash -myapp/ -|-- config.xml -|-- merges/ -| | |-- android/ -| | |-- ios/ -|-- www/ -|-- platforms/ -| |-- android/ -| |-- ios/ -|-- plugins/ - |-- cordova-plugin-camera/ -``` - -#### config.xml - -Configures your application and allows you to customize the behavior of your project. See also [config.xml reference documentation][config.xml ref] - -#### www/ - -The "`www`" directory contains the web artifacts of the project, encompassing various file types with extensions including, but not limited to, `.html`, `.css`, and `.js`. - -As a Cordova application developer, most of your code and assets will be placed in this directory. During the `cordova prepare` command execution, the contents of the "`www`" directory are copied to the corresponding `www` directories within each platform's subdirectory. For instance, you can find it at `platforms/ios/www` or `platforms/android/assets/www`. - -It's important to note that since the CLI regularly copies files from the source "`www`" folder, you should only make edits to the files in this directory and avoid modifying the ones located in the platform subdirectories. - -If you're using version control software, it's recommended to include both the source "`www`" folder and the "`merges`" folder in your version control system. - -When using frameworks that require a transpiling process, it is crucial to understand that the final output, which is intended for distribution, should be placed in the "`www`" directory. The purpose of the "`www`" directory is not to store the untranspiled source code. Instead, it is recommended to keep the untranspiled source code in a separate directory dedicated to that purpose. - -#### platforms/ - -Contains all of the source code for the platforms that you add to your project. - -> **WARNING:** When using the CLI to build your application, you should not edit any files in the /platforms/ directory unless you know what you are doing, or if documentation specifies otherwise. The files in this directory are routinely overwritten when preparing applications for building, or when plugins are re-installed. - -#### plugins/ - -Any added plugins will be extracted or copied into this directory. - -#### merges/ - -Platform-specific web assets (HTML, CSS and JavaScript files) are contained within appropriate subfolders in this directory. These are deployed during a `prepare` to the appropriate native directory. Files placed under `merges/` will override matching files in the `www/` folder for the relevant platform. A quick example, assuming a project structure of: - -```bash -merges/ -|-- ios/ -| -- app.js -|-- android/ -| -- android.js -www/ --- app.js -``` - -After building the Android and iOS projects, the Android application will contain both `app.js` and `android.js`. However, the iOS application will only contain an `app.js`, and it will be the one from `merges/ios/app.js`, overriding the "common" `app.js` located inside `www/`. - -#### Version control - -To ensure a cleaner version control setup, it is advisable not to include the `platforms/` and `plugins/` directories in your version control system. These directories are considered build artifacts. Instead, the platforms and plugins used in your project are automatically recorded in the `config.xml` and `package.json` files. When you invoke the `cordova prepare` command, the necessary platforms and plugins will be downloaded and set up based on the information specified in these configuration files. - -By excluding the `platforms/` and `plugins/` directories from version control and relying on the `config.xml` and `package.json` files, you can maintain a more streamlined development and continuous integration workflow. - ### Examples - Create a Cordova project in `myapp` directory using the specified ID and display name: