* doc(CONTRIBUTING): remove from README & update content * doc(DEVELOPMENT): add & cleanup README * doc(README): update badges * doc(README): cleanup overview * doc(README): add Supported Platforms section * doc(README): cleanup Installation & merge Plugin Variables * doc(README): create App Configuration section * doc(README): added Android-Specific to App Configuration * chore(README): fix list format
3.2 KiB
Development
Using a Cloned Repo as a Linked Plugin
By default, when you add a plugin to a Cordova project, the plugin files are copied into the project. However, during development, it can be easier to link the plugin instead.
Using the --link option creates symbolic links to your local copy of the plugin repository instead of copying the files into the project. This means the project uses the same files, so any changes you make, whether from the app's workspace or directly in the plugin, are immediately reflected.
To add a linked plugin, run:
cordova plugin add --link /path/to/cordova-plugin-camera
Testing Main Branch Without Cloning (Unstable)
It is possible to install the plugin from the GitHub repository URL.
cordova plugin add https://github.com/apache/cordova-plugin-camera.git
While this is possible, the preferred approach for development is to clone and link the plugin's repository, as this makes it easier to prepare changes for potential pull requests.
Linting
During development, you should run the linter to ensure the code follows our coding standards:
npm run lint
Fixing Lint Issues
In many cases, lint warnings can be fixed automatically with:
npm run lint:fix
If an issue cannot be resolved automatically, it will require manual review and correction.
Building from Source
-
Clone the repository locally.
-
Change to the repository directory.
-
Install dependencies:
npm installInstalls all production and development dependencies required for using and developing the package.
-
Update sub-dependencies:
npm updateOver time,
package-lock.jsoncan become stale and may trigger audit warnings.npm updaterefreshes dependencies within the pinned versions.Under normal circumstances, users install the published package from the npm registry, which does not include its own
package-lock.json. Instead, npm resolves and installs the latest compatible dependency versions at install time, which may result in no audit warnings.Running
npm updatelocally can provide a more accurate representation of current npm audit results for the project. -
Generate a tarball:
npm packCreates a
.tgztarball file in the.asf-releasedirectory. This tarball file can be installed in a Cordova project via:cordova plugin add /path/to/package.tgz