cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Koudritsky <>
Subject Sharing code between plugman and cordova-cli
Date Thu, 10 Apr 2014 18:53:28 GMT
I often find myself making changes that require commits to both plugman and
cli, it’s not always clear which repo new code should live in and sharing
utility functions between the two projects is not trivial.

The idea of “cordova-lib” was mentioned several times on this mailing list.
The lib would contain most of the code from both plugman and cli while the
end tools will be thin wrappers around the lib.

I wanted to probe how people working on CLI feel about such rearrangement.

But if we are already in this discussion, now that the heavy platforms
files are distributed separately from cordova-cli (repos like cordova-ios
etc), is there anything that prevents us from merging plugman and cli into
a single npm package with 2 executables?

Examples of code that should be shared include:
- Common logging and error handling logic (e.g. CordovaError exception)
- Fetching logic (for plugins and platforms)
- Platform-specific logic (e.g. where the config.xml file lives within each
- Generic utilities like xml-helpers.js (currently copied but slightly
diverged in the 2 repos)

The first option that comes to mind is to create another repo and another
npm package for cordova-lib, but this creates significant overhead:
 - Version release would get more difficult (see the failed release vote
thread <>from
last Friday)
 - In many cases new functionality in plugman or CLI would require changes
in 2 or even 3 repos. This is a significant additional barrier for new
contributors that don’t have commit rights - coordinating two
interdependent pull request is quite a hassle.
 - Strictly speaking, cordova-lib major version number will have to be
bumped every time we change some function signatures, which will happen
rather frequently in this case (this point also partially holds true if the
lib will be part of the plugman repo and npm package).

Based on the points above a single repo and npm package containing both
plugman and cli seems to provide the most benefit.

What do you think?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message