I'm using `package_json` and I am finding that if ...
# general
b
I'm using
package_json
and I am finding that if I include tsx source then those files are not included in the sandbox when running build. I can get it included though if it is a javscript_source. The impact of this is that I need to wrap all my tsx files as resources in order for them to then be included in the sandbox. Anyone else have this issue?
d
Which version of pants are you using? There were several fixes in 2.25 for the typescript support
b
I tried 2.25 and actually the latest 2.26 and both have this issue
b
Thanks for trying the new backends, very helpful to have people explore and iterate. That definitely sounds unexpected, and it doesn't sound similar to any of the existing bugs I can see: https://github.com/pantsbuild/pants/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22backend%3A%20JavaScript%22 Is it possible for you to either share the relevant snippets of your
pants.toml
and
BUILD
files, or (best case) make a standalone reduced reproducer?
b
repro using the
example-javascript
as a foundation and adding a
tsx_source
to it. Documented the issue in the PR description: https://github.com/eakmanrq/example-javascript/pull/1
👍 1
b
Thank you! I’m not in a position to look at the moment, but will in the next few days
b
Thank you!
b
Ah okay. I've investigated a bit, and we just... don't support any goals for the typescript targets other than tailoring (i.e. making them exist). I've filed https://github.com/pantsbuild/pants/issues/22151 for the specifics of packaging, and https://github.com/pantsbuild/pants/issues/22147 for the typescript backend more generally. For now, I think the short-term workarounds are probably: • using
resources
as you mention initially • use `adhoc_tool`/`shell_command` targets to run the various pieces of functionality, rather than the
package_json
ones
b
Really appreciate you taking a look @broad-processor-92400 and creating the issues. Looking forward to when it is fully implemented!