all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: zamfofex <zamfofex@twdb.moe>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: bringing npm packages to Guix
Date: Mon, 21 Nov 2022 19:52:42 -0300 (BRT)	[thread overview]
Message-ID: <1327358359.716196.1669071162549@privateemail.com> (raw)
In-Reply-To: <878rk4lfv1.fsf@gnu.org>

Hello! Thanks for responding.

The premise of the idea I’m proposing is that it wouldn’t be necessary to traverse into (most of) the ‘devDependencies’ if you build the packages ad‐hoc using esbuild. So, the idea is to sidestep the build process that the package has, and just invoke esbuild on the appropriate files of the package. My hope is that this is sufficient to bring most (or at least a lot of) useful packages from npm to Guix without the need of a binary importer.

I set up a package for sucrase as a proof of concept, since sucrase is a CLI tool that can be run and tried out easily (as opposed to jQuery, which is a library meant to be used in browsers). However, note that following my proposed approach, packaging jQuery becomes entirely trivial — it is a matter of simply running esbuild on jQuery’s input files. For the sake of example, I have included a Guix package I created for jQuery in the GitHub Gist I sent above. (And I can anecdotally verify that it works when tring it on a browser.) <https://gist.github.com/zamfofex/eac93bc0e00477a8b79f5ca4dc1a34ff#file-jquery-scm>

I will admit that I cheated a bit, since I used the currently unreleased 4.0.0 version, as opposed to the latest released 3.x versions, since the realeased 3.x versions use the old and outdated AMD format (“asynchronous module definition”) for representing dependencies between files in a project. (See <https://github.com/evanw/esbuild/issues/1035>) However, most packages nowadays have already moved away from AMD (and jQuery is getting there), so this shouldn’t be an issue in practice.


  reply	other threads:[~2022-11-21 22:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19 21:27 bringing npm packages to Guix zamfofex
2022-11-21 11:13 ` Ludovic Courtès
2022-11-21 22:52   ` zamfofex [this message]
2022-12-20  9:00 ` Mekeor Melire
2022-12-20 14:01   ` Joshua Branson

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=1327358359.716196.1669071162549@privateemail.com \
    --to=zamfofex@twdb.moe \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.