All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-marie Lemetayer <jean-marie.lemetayer@savoirfairelinux.com>
To: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Cc: Yocto-mailing-list <yocto@yoctoproject.org>,
	Savoir-faire Linux Rennes <rennes@savoirfairelinux.com>
Subject: Re: [npm] duplicate code
Date: Fri, 4 Oct 2019 08:37:13 -0400 (EDT)	[thread overview]
Message-ID: <967547077.8619660.1570192633081.JavaMail.zimbra@savoirfairelinux.com> (raw)
In-Reply-To: <51c5973e-2c1a-f212-f963-9a2b321f480d@herbrechtsmeier.net>

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:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=eecba41822e86b69ebdb9cbc8fbfd512ad9a47d7
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a34d0d539e5fdf341541fb628652d22289e80512
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e90cd2ed61b93ee7e290e7e592f1f0242ab5c281
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a35abe31dc23916fd06afdb3a5e22a81ef3df579

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:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10515
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10760
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11028
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11029
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12534
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13415

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:
   https://wiki.yoctoproject.org/wiki/TipsAndTricks/NPM

Finally, in my recent project, we were using angular (https://angular.io) 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@herbrechtsmeier.net>
À: "Yocto-mailing-list" <yocto@yoctoproject.org>
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.

Regards
   Stefan


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/npm.py and scripts/lib/recipetool/create_npm.py but there is some inconsistencies.
> 
> Here is an example, the _parse_view() function which I patched recently has differ:
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/bb/fetch2/npm.py#n157
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/scripts/lib/recipetool/create_npm.py#n244
> 
> I think merging this "npm utility functions" is a good idea. But where ?
> 
> I think about creating a new file: bitbake/lib/bb/npm_utils.py
> 
> Or maybe use the existing bitbake/lib/bb/utils.py ?
> 
> What do you think ?
> 
> 
> Jean-Marie LEMETAYER
> Enthusiast embedded systems engineer
> Savoir-faire Linux
> 

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


  reply	other threads:[~2019-10-04 12:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 15:37 [npm] duplicate code Jean-marie Lemetayer
2019-10-04  6:53 ` Stefan Herbrechtsmeier
2019-10-04 12:37   ` Jean-marie Lemetayer [this message]
2019-10-04 14:55     ` Stefan Herbrechtsmeier
2019-10-07 12:16       ` Jean-marie Lemetayer
2019-10-07 19:33         ` Stefan Herbrechtsmeier
2019-10-08  5:12           ` Josef Holzmayr
2019-10-08 20:04             ` Stefan Herbrechtsmeier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=967547077.8619660.1570192633081.JavaMail.zimbra@savoirfairelinux.com \
    --to=jean-marie.lemetayer@savoirfairelinux.com \
    --cc=rennes@savoirfairelinux.com \
    --cc=stefan@herbrechtsmeier.net \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.