Bug 2387212 - Please ship esbuild JS module
Summary: Please ship esbuild JS module
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: golang-github-evanw-esbuild
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: W. Michael Petullo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-08-08 07:31 UTC by Martin Pitt
Modified: 2025-11-17 02:59 UTC (History)
5 users (show)

Fixed In Version: golang-github-evanw-esbuild-0.24.2-5.fc43 golang-github-evanw-esbuild-0.24.2-3.fc42
Clone Of:
Environment:
Last Closed: 2025-11-09 03:06:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Martin Pitt 2025-08-08 07:31:57 UTC
The current golang-github-evanw-esbuild rpm only ships the actual binary. This is fine for simple projects, but if you  need more control over the build process -- e.g. using plugins -- you need to use the JS API [1].

But that's not currently possible to do with the packaged esbuild in Fedora, thus these projects need to download it from npmjs.com. My case are the cockpit packages. In Fedora they current ship a pre-build dist/ and avoid invoking esbuild during rpm build at all. But that sucks wrt. policy and making it possible to modify/patch the Fedora package downstream.

Debian's packaging ships [2] the JS module as well:

/usr/lib/x86_64-linux-gnu/nodejs/esbuild
/usr/lib/x86_64-linux-gnu/nodejs/esbuild/bin
/usr/lib/x86_64-linux-gnu/nodejs/esbuild/bin/esbuild
/usr/lib/x86_64-linux-gnu/nodejs/esbuild/install.js
/usr/lib/x86_64-linux-gnu/nodejs/esbuild/lib
/usr/lib/x86_64-linux-gnu/nodejs/esbuild/lib/main.d.ts
/usr/lib/x86_64-linux-gnu/nodejs/esbuild/lib/main.js
/usr/lib/x86_64-linux-gnu/nodejs/esbuild/package.json

and then a similar set for esbuild-wasm, but that's unrelated. 

Would you consider shipping the JS module in the Fedora package as well? If so, I'm happy to work on a .spec patch or PR.

[1] https://esbuild.github.io/api/#js-details
[2] https://salsa.debian.org/go-team/packages/golang-github-evanw-esbuild/-/blob/debian/sid/debian/esbuild.install?ref_type=heads

Reproducible: Always

Comment 1 Jelle van der Waa 2025-10-14 11:46:38 UTC
I've created a patch to build a separate package which contains the JavaScript module, I am not 100% sure if this is how it is supposed to happen or if it can be part of "esbuild". Another issue is that Fedora's %{nodejs_sitelib} expands to the `nodejs-devel` version so it won't be compatible with nodejs20/nodejs/24 but only 22 as:

[jelle@⬢ rhel-developer-toolbox][~/projects/fedora-packages/golang-github-evanw-esbuild]%rpm -pql results_golang-github-evanw-esbuild/0.24.2/6.fc44/js-esbuild-0.24.2-6.fc44.noarch.rpm
/usr/lib/node_modules_22/esbuild/main.d.ts
/usr/lib/node_modules_22/esbuild/main.js


https://src.fedoraproject.org/fork/jelly/rpms/golang-github-evanw-esbuild/diff/rawhide..install-npm-module

Comment 2 Martin Pitt 2025-10-15 11:36:21 UTC
Thanks Jelle!

That was a good start, but not quite sufficient yet. The goal is that this command works:

    node -e 'const esbuild = require("esbuild"); esbuild.transformSync("const x=1",{loader:"js"}); console.log("esbuild works")'

It does on Debian, but not yet with your version. It's missing package.json, has wrong paths, and also requires calling esbuild *not* from /usr/bin because the module's search is... special:

   var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";

I updated your initial patch, also added correct package deps, and tested it locally. Sent to https://src.fedoraproject.org/rpms/golang-github-evanw-esbuild/pull-request/13

Comment 3 W. Michael Petullo 2025-10-31 15:30:01 UTC
I just merged Martin's work. See https://src.fedoraproject.org/rpms/golang-github-evanw-esbuild/pull-request/13, which should resolve this report.

Comment 4 Fedora Update System 2025-10-31 16:27:10 UTC
FEDORA-2025-39d56cce21 (golang-github-evanw-esbuild-0.24.2-5.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-39d56cce21

Comment 5 Fedora Update System 2025-11-01 03:09:06 UTC
FEDORA-2025-39d56cce21 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-39d56cce21`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-39d56cce21

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Martin Pitt 2025-11-02 09:01:31 UTC
See https://bodhi.fedoraproject.org/updates/FEDORA-2025-39d56cce21 works fine, thanks!

Comment 7 Fedora Update System 2025-11-09 00:07:46 UTC
FEDORA-2025-df91eab101 (golang-github-evanw-esbuild-0.24.2-3.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-df91eab101

Comment 8 Fedora Update System 2025-11-09 03:06:11 UTC
FEDORA-2025-39d56cce21 (golang-github-evanw-esbuild-0.24.2-5.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2025-11-09 04:36:11 UTC
FEDORA-2025-df91eab101 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-df91eab101`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-df91eab101

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2025-11-17 02:59:30 UTC
FEDORA-2025-df91eab101 (golang-github-evanw-esbuild-0.24.2-3.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.