Hi! I know better javascript support is coming (is...
# general
g
Hi! I know better javascript support is coming (is that available in beta somewhere?), but in the meantime, I'm trying to use
experimental_shell_command
to run part of an
npm install
to produce an asset that I need to put into a pex binary. I can't figure out how to get the pex_binary to include the output of the shell command (set with the
outputs
param). I could get it into the docker image separately, but I really do need it in the binary if possible. Is there something simple I'm missing?
w
I haven't tried this, but I can provide you with a
pnpm
recipe I use right now, maybe it could be of some help?
I use the output to archive to a zip, so I'm extracting everything as expected
https://gist.github.com/sureshjoshi/98fb09f2a340f7c1dad270c4887865a0#file-build-pants-sveltekit-L127 Maybe if you use output_directories, or output_files, you'd have some luck?
g
It looks like I should perhaps try 2.16.x in general over 2.15.x, as shell_command looks to have a lot of improvements
w
Yep, shell kinda became adhoc tool, which is pretty dope. https://www.pantsbuild.org/v2.16/docs/adhoc-tool
*become == replaced by?
g
the particular piece that I can't get to work right in 2.15 is around defining resources with those outputs. something like the following:
Copy code
resources(sources=["*.js", "*.css", "storybook:css:dist/assets/custom-assets.css"], dependencies=["storybook:css"])
I don't get warnings from that syntax, but the resource doesn't look like it is actually defined as expected
w
I always struggle with this, but should it be a resource or a file?
g
resource - files are not included in the pex bundle. Although I'm half tempted to convert this to files and bundle this differently, as I know I can get that to work
I ended up restructuring this a bit to work around this (and to pull static assets out of the pex archive). Haven't had much luck getting the shell command to run in CI yet (runs perfectly locally of course) - keeps timing out - but hoping I can get some more useful error messages out soon