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
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
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
I just merged Martin's work. See https://src.fedoraproject.org/rpms/golang-github-evanw-esbuild/pull-request/13, which should resolve this report.
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
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.
See https://bodhi.fedoraproject.org/updates/FEDORA-2025-39d56cce21 works fine, thanks!
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
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.
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.
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.