You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Thomas Brian <tb...@tobostudio.com> on 2018/02/16 22:03:19 UTC

cordova-fetch Pull Request to fix CB-13503 problems with using plugins from local file system

Hello everyone,

I was updating one of our projects from Cordova 6.5 to Cordova 8.0 this
week and I ran into the same issue as described in CB-13503 that prevents
local plugins from working properly when using cordova-fetch (
https://issues.apache.org/jira/browse/CB-13503)

I tried to dig into the problem and I think I have a working fix, so I
published it as PR #13 on GitHub: https://github.com/apache/cord
ova-fetch/pull/13. Talking to Jan Piotrowski on the slack channel, he
suggested that I also bring attention to it on this Mailing-List.

Specifically, this PR adds support for plugins added to package.json with
the syntax "my-plugin": "file:path/to/plugin". The trimID function did not
support those previously, since it tried to form a path with "target" +
"package.json" ("file:path/to/plugin/package.json") and used this path in
fs.existsSync, which failed because this function does not expect a file:
prefix.

I also added a test case that should reproduce the bug. It fetches the
plugin twice, because the first install doesn't trigger the trimID function
since the getJsonDiff works as expected the first time, and it only falls
back to trimID on the second run.

Please let me know if you have any questions or concerns regarding this
pull request. I will also try to monitor the PR on GitHub.

Have a nice day,
Thomas
-- 
Thomas Brian
Développeur Frontend
Frontend Developer
tbrian@tobostudio.com <tb...@tobogganstudio.com>
www.tobostudio.com <http://tobostudio.com/>

Re: cordova-fetch Pull Request to fix CB-13503 problems with using plugins from local file system

Posted by Steven Gill <st...@gmail.com>.
Thanks Thomas! I'll take a look at the PR

On Fri, Feb 16, 2018 at 2:03 PM, Thomas Brian <tb...@tobostudio.com> wrote:

> Hello everyone,
>
> I was updating one of our projects from Cordova 6.5 to Cordova 8.0 this
> week and I ran into the same issue as described in CB-13503 that prevents
> local plugins from working properly when using cordova-fetch (
> https://issues.apache.org/jira/browse/CB-13503)
>
> I tried to dig into the problem and I think I have a working fix, so I
> published it as PR #13 on GitHub: https://github.com/apache/cord
> ova-fetch/pull/13. Talking to Jan Piotrowski on the slack channel, he
> suggested that I also bring attention to it on this Mailing-List.
>
> Specifically, this PR adds support for plugins added to package.json with
> the syntax "my-plugin": "file:path/to/plugin". The trimID function did not
> support those previously, since it tried to form a path with "target" +
> "package.json" ("file:path/to/plugin/package.json") and used this path in
> fs.existsSync, which failed because this function does not expect a file:
> prefix.
>
> I also added a test case that should reproduce the bug. It fetches the
> plugin twice, because the first install doesn't trigger the trimID function
> since the getJsonDiff works as expected the first time, and it only falls
> back to trimID on the second run.
>
> Please let me know if you have any questions or concerns regarding this
> pull request. I will also try to monitor the PR on GitHub.
>
> Have a nice day,
> Thomas
> --
> Thomas Brian
> Développeur Frontend
> Frontend Developer
> tbrian@tobostudio.com <tb...@tobogganstudio.com>
> www.tobostudio.com <http://tobostudio.com/>
>