Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jun 2023 11:38:20 -0700
From:      Pete Wright <pete@nomadlogic.org>
To:        ports@freebsd.org
Subject:   Re: Guidance on creating a port for an npm installed tool
Message-ID:  <7dcd37f0-52a5-153b-1640-bb26f267cd3c@nomadlogic.org>
In-Reply-To: <A87A6646-22EE-4371-ADC5-AA10B97AB043@punkt.de>
References:  <A87A6646-22EE-4371-ADC5-AA10B97AB043@punkt.de>

next in thread | previous in thread | raw e-mail | index | archive | help


On 6/9/23 11:11, Patrick M. Hausen wrote:
> Hi all,
>
> is there some general guide on how to go about creating a port
> for anything implemented in node.js and using npm to download
> all sorts of dependencies at build/install time?
>
> I'd like to see a port of this:
> https://github.com/louislam/uptime-kuma
>
> Similarly a port of mineos would be awesome.
>
> Cloning from Github and running npm works and delivers a
> functional installation in ${WRKSRC} ...
>
> What now?
>
> I did not find any detailled help in the handbook or by searching.
> There seems to be a general method if all modules are available
> in npm (they have a repository it seems).
>
> But what with products like these?
>
> For Go applications there are very convenient tools to get
> all the dependencies into the port Makefile and do it in a clean way.
>
> Section 6.5.8 here:
> https://docs.freebsd.org/en/books/porters-handbook/special/#building
>
> So any help with porting these would be greatly appreciated.

i've had to build node/js code in the past internally and i've found 
that whole ecosystem is awkward at best to work with (ports or not).

i did poke around the ports tree just now and found www/hedgedoc which 
makes use of yarn for building, it may be worth taking a look at that 
Makefile for inspiration.  for my internal pkgs i did something similar 
that is in the "do-build" section iirc.

-pete

-- 
Pete Wright
pete@nomadlogic.org
@nomadlogicLA




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7dcd37f0-52a5-153b-1640-bb26f267cd3c>