cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-14133) Avoid reinstalling already installed plugins in cordova-fetch
Date Sat, 16 Jun 2018 22:20:00 GMT


ASF GitHub Bot commented on CB-14133:

raphinesse commented on issue #24: CB-14133 Avoid reinstalling already installed plugins
   Good point. I'd make this a real merge to keep diff readability. Are you fine with that?

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Avoid reinstalling already installed plugins in cordova-fetch
> -------------------------------------------------------------
>                 Key: CB-14133
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Wish
>          Components: cordova-cli, cordova-fetch
>    Affects Versions: 8.0.0
>            Reporter: Zak
>            Assignee: Raphael
>            Priority: Minor
> Relates to CB-13992
> The pull request for CB-13992 removed the {{dependency-ls}} package which helped to
speed up the platform add step. However, each plugin still gets {{npm install}} ed seemingly
just to determine the package name. 
> Typical workflow is to run {{npm install}} as the first task after cloning a node repository.
The current practice for cordova is to save plugins to the package.json meaning that plugins
are already installed to the node_modules directory, so running {{npm install}} for each of
them individually is redundant.
> If the main function in {{cordova-fetch}} is simplified to just return the path to the
given module (albeit this isn't the most elegant implementation):
> {code:javascript}
> module.exports = function (target, dest, opts = {}) {
>     var fetchArgs = ? ['link'] : ['list'];
>     var nodeModulesDir = dest + '/node_modules/';
>     // check if npm is installed
>     return module.exports.isNpmInstalled()
>         .then(function () {
>             const mod = target.slice(0, target.lastIndexOf('@'));
>             return path.resolve(nodeModulesDir, mod)
>         })
>         .catch(function (err) {
>             throw new CordovaError(err);
>         });
> };
> {code}
> the platform add process runs almost instantly rather than taking a few minutes.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message