public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Interest in a yarn / NPM eclass
@ 2022-06-05  5:47 Chris Pritchard
  2022-06-06 11:16 ` Andrew Ammerlaan
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Pritchard @ 2022-06-05  5:47 UTC (permalink / raw
  To: gentoo-dev@lists.gentoo.org

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

Hello,

Would there be any interest in a yarn / NPM eclass that supports offline installs. For a personal overlay I've got a working yarn.eclass (https://github.com/chriscpritchard/overseerr-overlay/blob/main/eclass/yarn.eclass) and I've been able to make a version that supports npm from NPM-Shrinkwrap or npm-lock.json files (this is still being tested).

If there is an interest, would anyone be willing to support me in having an eclass added to the tree?

Thanks,

Chris

[-- Attachment #2: Type: text/html, Size: 3130 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Interest in a yarn / NPM eclass
  2022-06-05  5:47 [gentoo-dev] Interest in a yarn / NPM eclass Chris Pritchard
@ 2022-06-06 11:16 ` Andrew Ammerlaan
  2022-06-06 11:38   ` Ionen Wolkens
  2022-06-08 17:23   ` Alessandro Barbieri
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Ammerlaan @ 2022-06-06 11:16 UTC (permalink / raw
  To: gentoo-dev, chris; +Cc: Alessandro Barbieri

Hi Chris,

I think @Alessandro (CC) has already done some work on this over at [1]. 
I'm not sure what the status of it is though. Maybe you two can discuss 
this together to avoid doing double work.

Best regards,
Andrew

[1] https://github.com/Alessandro-Barbieri/node-overlay

On 05/06/2022 07:47, Chris Pritchard wrote:
> Hello,
> 
> Would there be any interest in a yarn / NPM eclass that supports offline 
> installs. For a personal overlay I’ve got a working yarn.eclass 
> (https://github.com/chriscpritchard/overseerr-overlay/blob/main/eclass/yarn.eclass 
> <https://github.com/chriscpritchard/overseerr-overlay/blob/main/eclass/yarn.eclass>) 
> and I’ve been able to make a version that supports npm from 
> NPM-Shrinkwrap or npm-lock.json files (this is still being tested).
> 
> If there is an interest, would anyone be willing to support me in having 
> an eclass added to the tree?
> 
> Thanks,
> 
> Chris
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Interest in a yarn / NPM eclass
  2022-06-06 11:16 ` Andrew Ammerlaan
@ 2022-06-06 11:38   ` Ionen Wolkens
  2022-06-06 18:00     ` Raphaël Barrois
  2022-06-08 17:23   ` Alessandro Barbieri
  1 sibling, 1 reply; 8+ messages in thread
From: Ionen Wolkens @ 2022-06-06 11:38 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]

On Mon, Jun 06, 2022 at 01:16:54PM +0200, Andrew Ammerlaan wrote:
> Hi Chris,
> 
> I think @Alessandro (CC) has already done some work on this over at [1]. 
> I'm not sure what the status of it is though. Maybe you two can discuss 
> this together to avoid doing double work.

There's been others too, e.g.
https://git.sr.ht/~dblsaiko/ebuilds/tree/master/item/eclass/npm2x.eclass

Haven't needed npm stuff myself but I was keeping looking at that
one in mind if I ever needed to. Albeit at this point I'd likely
not want the giant manifest+variables required for these without
a vendor tarball.

> 
> Best regards,
> Andrew
> 
> [1] https://github.com/Alessandro-Barbieri/node-overlay
> 
> On 05/06/2022 07:47, Chris Pritchard wrote:
> > Hello,
> > 
> > Would there be any interest in a yarn / NPM eclass that supports offline 
> > installs. For a personal overlay I’ve got a working yarn.eclass 
> > (https://github.com/chriscpritchard/overseerr-overlay/blob/main/eclass/yarn.eclass 
> > <https://github.com/chriscpritchard/overseerr-overlay/blob/main/eclass/yarn.eclass>) 
> > and I’ve been able to make a version that supports npm from 
> > NPM-Shrinkwrap or npm-lock.json files (this is still being tested).
> > 
> > If there is an interest, would anyone be willing to support me in having 
> > an eclass added to the tree?
> > 
> > Thanks,
> > 
> > Chris
> > 
> 
> 

-- 
ionen

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Interest in a yarn / NPM eclass
  2022-06-06 11:38   ` Ionen Wolkens
@ 2022-06-06 18:00     ` Raphaël Barrois
  0 siblings, 0 replies; 8+ messages in thread
From: Raphaël Barrois @ 2022-06-06 18:00 UTC (permalink / raw
  To: gentoo-dev

On Monday, 6 June 2022 13:38:07 CEST, Ionen Wolkens wrote:
> On Mon, Jun 06, 2022 at 01:16:54PM +0200, Andrew Ammerlaan wrote:
>> Hi Chris,
>> 
>> I think @Alessandro (CC) has already done some work on this over at [1]. 
>> I'm not sure what the status of it is though. Maybe you two can discuss 
>> this together to avoid doing double work.
>
> There's been others too, e.g.
> https://git.sr.ht/~dblsaiko/ebuilds/tree/master/item/eclass/npm2x.eclass
>
> Haven't needed npm stuff myself but I was keeping looking at that
> one in mind if I ever needed to. Albeit at this point I'd likely
> not want the giant manifest+variables required for these without
> a vendor tarball.
>
>> Best regards,
>> Andrew
>> 
>> [1] https://github.com/Alessandro-Barbieri/node-overlay
>> 
>> On 05/06/2022 07:47, Chris Pritchard wrote: ...
>

For what it's worth, I have made similar attempts in my personal overlay,
based on a small helper that exposes a local folder as an NPM cache which
will work as expected for the NPM command line with minimal updates.

The helper is at https://github.com/rbarrois/cjs-ledger
The eclass (could be better) at 
https://git.xelnor.net/?p=overlay.git;a=blob;f=eclass/xel-nodejs.eclass;hb=HEAD

An example usage can be found here:
https://git.xelnor.net/?p=overlay.git;a=blob;f=www-apps/xelpaste/xelpaste-3.2.1.ebuild;hb=HEAD

If this can be of interest, feel free to ping me!

-- 
Xelnor


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Interest in a yarn / NPM eclass
  2022-06-06 11:16 ` Andrew Ammerlaan
  2022-06-06 11:38   ` Ionen Wolkens
@ 2022-06-08 17:23   ` Alessandro Barbieri
  2022-06-08 20:44     ` Robin H. Johnson
  1 sibling, 1 reply; 8+ messages in thread
From: Alessandro Barbieri @ 2022-06-08 17:23 UTC (permalink / raw
  To: Andrew Ammerlaan; +Cc: gentoo-dev, chris

[-- Attachment #1: Type: text/plain, Size: 1879 bytes --]

Il Lun 6 Giu 2022, 13:16 Andrew Ammerlaan <andrewammerlaan@gentoo.org> ha
scritto:

> Hi Chris,
>
> I think @Alessandro (CC) has already done some work on this over at [1].
> I'm not sure what the status of it is though. Maybe you two can discuss
> this together to avoid doing double work.
>
> Best regards,
> Andrew
>
> [1] https://github.com/Alessandro-Barbieri/node-overlay
>
> On 05/06/2022 07:47, Chris Pritchard wrote:
> > Hello,
> >
> > Would there be any interest in a yarn / NPM eclass that supports offline
> > installs. For a personal overlay I’ve got a working yarn.eclass
> > (
> https://github.com/chriscpritchard/overseerr-overlay/blob/main/eclass/yarn.eclass
> > <
> https://github.com/chriscpritchard/overseerr-overlay/blob/main/eclass/yarn.eclass>)
>
> > and I’ve been able to make a version that supports npm from
> > NPM-Shrinkwrap or npm-lock.json files (this is still being tested).
> >
> > If there is an interest, would anyone be willing to support me in having
> > an eclass added to the tree?
> >
> > Thanks,
> >
> > Chris
> >


I'm interested in an eclass that doesn't bundle everything together. Also
I'm interested in anyone that can share the package maintainership (in guru
first).

I've already tried 3 approaches:
1) one package per dependency. The npm eclass is working fine for now, you
can unbundle packages that depend on system libs (like sqlite), the major
issue I've found is in the circular dependencies of the rollup package.

2) bundle everything. This approach doesn't always work. Some packages fail
to build dependencies written in C and you can't unbundle them.

3) package every runtime dependency and bundle build time dependencies.
Since rollup is a build time dep, I've tried to bundle every build time dep
but this require to create a custom stuff and host it somewhere.

[-- Attachment #2: Type: text/html, Size: 2897 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Interest in a yarn / NPM eclass
  2022-06-08 17:23   ` Alessandro Barbieri
@ 2022-06-08 20:44     ` Robin H. Johnson
  2022-06-09  4:58       ` Ryan Qian
  2022-06-11 12:42       ` Alessandro Barbieri
  0 siblings, 2 replies; 8+ messages in thread
From: Robin H. Johnson @ 2022-06-08 20:44 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

On Wed, Jun 08, 2022 at 07:23:15PM +0200, Alessandro Barbieri wrote:
> I'm interested in an eclass that doesn't bundle everything together. Also
> I'm interested in anyone that can share the package maintainership (in guru
> first).
> 
> I've already tried 3 approaches:
...

Since you know this yarn/NPM ecosystem well, could you evaluate two
other ideas?
4) Solutions like EGO_SUM
5) EGO_SUM successor of 2nd-level-Metadata-Manifest that I described in the recent EGO_SUM thread.

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
E-Mail   : robbat2@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1113 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Interest in a yarn / NPM eclass
  2022-06-08 20:44     ` Robin H. Johnson
@ 2022-06-09  4:58       ` Ryan Qian
  2022-06-11 12:42       ` Alessandro Barbieri
  1 sibling, 0 replies; 8+ messages in thread
From: Ryan Qian @ 2022-06-09  4:58 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

I have an npm.eclass (
https://github.com/bekcpear/ryans-repos/blob/main/eclass/npm.eclass) that
works like EGO_SUM.

However, the package-lock.json file should be patched to convert sha1 to
sha512 due to the default mechanism (script:
https://github.com/bekcpear/npm-lockfile-to-sha512.sh).

I maintain a package www-apps/filebrowser by this eclass in my overlay.


On Thu, Jun 9, 2022 at 4:44 AM Robin H. Johnson <robbat2@gentoo.org> wrote:

> On Wed, Jun 08, 2022 at 07:23:15PM +0200, Alessandro Barbieri wrote:
> > I'm interested in an eclass that doesn't bundle everything together. Also
> > I'm interested in anyone that can share the package maintainership (in
> guru
> > first).
> >
> > I've already tried 3 approaches:
> ...
>
> Since you know this yarn/NPM ecosystem well, could you evaluate two
> other ideas?
> 4) Solutions like EGO_SUM
> 5) EGO_SUM successor of 2nd-level-Metadata-Manifest that I described in
> the recent EGO_SUM thread.
>
> --
> Robin Hugh Johnson
> Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
> E-Mail   : robbat2@gentoo.org
> GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
> GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
>

[-- Attachment #2: Type: text/html, Size: 1877 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Interest in a yarn / NPM eclass
  2022-06-08 20:44     ` Robin H. Johnson
  2022-06-09  4:58       ` Ryan Qian
@ 2022-06-11 12:42       ` Alessandro Barbieri
  1 sibling, 0 replies; 8+ messages in thread
From: Alessandro Barbieri @ 2022-06-11 12:42 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 953 bytes --]

Il giorno mer 8 giu 2022 alle ore 22:45 Robin H. Johnson <robbat2@gentoo.org>
ha scritto:

> On Wed, Jun 08, 2022 at 07:23:15PM +0200, Alessandro Barbieri wrote:
> > I'm interested in an eclass that doesn't bundle everything together. Also
> > I'm interested in anyone that can share the package maintainership (in
> guru
> > first).
> >
> > I've already tried 3 approaches:
> ...
>
> Since you know this yarn/NPM ecosystem well, could you evaluate two
> other ideas?
> 4) Solutions like EGO_SUM
>

My second approach was like that


> 5) EGO_SUM successor of 2nd-level-Metadata-Manifest that I described in
> the recent EGO_SUM thread.
>
I havent' well understood it. In practice would be the same as  2/4 with
the same issues.
Let me remind you that unlike go/rust, nodejs packages aren't compiled and
if you bundle everything you'll end up with a massive amount of files
installed.
Please don't consider node any different from python/ruby/perl/php.

[-- Attachment #2: Type: text/html, Size: 1580 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-11 12:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-05  5:47 [gentoo-dev] Interest in a yarn / NPM eclass Chris Pritchard
2022-06-06 11:16 ` Andrew Ammerlaan
2022-06-06 11:38   ` Ionen Wolkens
2022-06-06 18:00     ` Raphaël Barrois
2022-06-08 17:23   ` Alessandro Barbieri
2022-06-08 20:44     ` Robin H. Johnson
2022-06-09  4:58       ` Ryan Qian
2022-06-11 12:42       ` Alessandro Barbieri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox