How apache/cordova-lib works
Project type and purpose
• This is an open-source Node.js library (cordova-lib) that implements the core logic behind the Cordova CLI (cordova) and the Cordova plugin manager (plugman).
• Its purpose is to provide reusable modules for project creation, platform management, build/compile/emulation, plugin install/uninstall, hook execution, templating, and other mobile-app lifecycle tasks.
File structure
• Top-level directories:
• src/cordova – all Cordova CLI commands (build, compile, emulate, prepare, run, serve, clean, etc.)
• src/plugman – plugin management commands (create, fetch, install, uninstall)
• src/platforms – platform discovery and configuration
• src/hooks – hook runner and context
• src/util – shared utilities (promise-util, default-engines, metadata, dependencies, etc.)
• templates – scaffolding templates for platforms and base projects
• Supporting assets:
• integration-tests/ and spec/ – end-to-end and unit tests (Jasmine)
• configuration files – package.json, .eslintrc.yml, templates/platformsConfig.json
• top-level cordova-lib.js – library entry point for Cordova CLI
README for additional insights
• Confirms that this library is consumed by both cordova CLI and plugman CLI.
• Mentions companion packages (cordova-common, cordova-create, cordova-serve).
• Lists npm scripts for linting, unit tests, integration tests.