cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Gill (JIRA)" <>
Subject [jira] [Commented] (CB-10239) Installing platforms from scoped npm packages
Date Mon, 25 Jan 2016 05:07:40 GMT


Steve Gill commented on CB-10239:

I've done some investigating. This is due to the fact that there are various places where
we check to see if the platform you are trying to install is in the supported Platforms List

These checks all happen before the package even gets fetched. So I can't just read package.json
and do the checks using package-name.

I've been working through removing these checks, but a lot of the code in lazy_load.js is
based on it.

This is something I am going to bump until after cordova 6 as I'm not sure what the ramifications
of removing all of the checks would be. 

This code
will also have to be updated to handle scoped packages.

Something like

            var scoped = false;
            if (target[0] === '@') {
                scoped = true;
                target = target.slice(1)
            var parts = target.split('@');
            var platform = parts[0];
            var spec = parts[1];
            if(scoped) {
                platform = '@' + platform;

> Installing platforms from scoped npm packages
> ---------------------------------------------
>                 Key: CB-10239
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaLib
>    Affects Versions: 3.5.0
>            Reporter: Darryl Pogue
>              Labels: cordova-6.0.0, cordova-fetch, triaged
> I have a bugfix branch for a platform, and while waiting for it to be merged and released,
I published my fork of that platform to a scoped package on npm (i.e., @dpogue/cordova-android).
> In config.xml, there does not appear to be a way to specify that {{cordova prepare}}
should restore that scoped package instead of the canonical Apache one.
> \\
> Attempt #1:
> {code:xml}
> <engine name="@dpogue/cordova-android" spec="~4.1.1" />
> {code}
> results in a warning being printed about a null or unrecognized platform.
> \\
> Attempt #2:
> {code:xml}
> <engine name="android" spec="@dpogue/cordova-android~4.1.1" />
> {code}
> results in pulling the Apache version from npm, ignoring my scoped package.
> A workaround for now is to use a git URL, but the advantage of npm is that it can download
a tarball without the network cost of doing a full git clone.
> \\
> Also worth noting that scoped npm packages are supported with plugins:
> {code:xml}
> <plugin name="@dpogue/cordova-plugin-crosswalk-webview" spec="~1.4.0" />
> {code}
> works as intended.

This message was sent by Atlassian JIRA

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

View raw message