Re: [npm] duplicate code

Jean-Marie Lemetayer

Hi Stefan,

I have recently worked on a yocto project using npm and I have seen some issues. I have solved a few but only for bitbake:

As I have more time now, I wanted to continue my work by fixing devtool / recipetool.

I have also checked the bugzilla for issues that I could fix / that should be tested again:

I ended up with this todo list:
- merge the duplicate code between bitbake and recipetool
- fix the npm package name handling in recipetool
- fix the npm package version handling in recipetool
- fix the lockdown.json file generation in recipetool
- create an example nodejs application to test all these cases
- update the wiki using this example application:

Finally, in my recent project, we were using angular ( for the front-end. I have planned to add the work done to support angular applications in yocto (angular.bbclass) and update recipetool to handle them.

Your work sounds very interesting. The good point is that npm-shrinkwrap.json and lockdown.json files (which have generation issues btw) will no longer be required. But projects using npm can have a lot of dependencies (e.g. the angular example app have 1053 dependencies). Is recipetool will be handling the whole recipes creation in one time ?

Is it possible to see your work ? A public fork would be nice. I would gladly help you / test your work / add my fixes if needed.

Best regards,
Jean-Marie Lemetayer

----- Mail original -----
De: "Stefan Herbrechtsmeier" <stefan@...>
À: "Yocto-mailing-list" <yocto@...>
Envoyé: Vendredi 4 Octobre 2019 08:53:10
Objet: Re: [yocto] [npm] duplicate code

Hi Jean-Marie,

what work do you plan to do on npm and recipetool?

I have start to rework the complete npm integration to synchronize it
with other languages like python. I replace the bitbake npm fetch with
the wget fetcher and download the npm tgz files direct. The idea is to
handle every package as a separate recipe and move the package
dependencies into the recipes. Therefore I parse the package.json and
the npm server json to create a recipe.


Am 03.10.19 um 17:37 schrieb Jean-marie Lemetayer:

Hi all,

I am planning to do some work on npm and recipetool.

I have seen that there is some duplicate code between bitbake/lib/bb/fetch2/ and scripts/lib/recipetool/ but there is some inconsistencies.

Here is an example, the _parse_view() function which I patched recently has differ:

I think merging this "npm utility functions" is a good idea. But where ?

I think about creating a new file: bitbake/lib/bb/

Or maybe use the existing bitbake/lib/bb/ ?

What do you think ?

Enthusiast embedded systems engineer
Savoir-faire Linux
yocto mailing list

Join to automatically receive all group messages.