Jordan-Hall / nx-bun

https://jordan-hall.github.io/nx-bun/
Other
58 stars 6 forks source link

Support build target option for run executor #1

Closed marcus-sa closed 9 months ago

marcus-sa commented 10 months ago

Similarly to how the buildTarget option works in the @nx/js:node executor.

Use case: TypeScript for compiling, but Bun for running the code.

If the option is present, and the build target executor is anything but Bun, then it should build that target, watch for changes and then rerun.

Jordan-Hall commented 10 months ago

Sure, sounds like a good idea to add. I'm looking at integrating @nx/js as its core generator, that way its easier to manage. I took this approach for now because of the complexity in bun unsupported features.

marcus-sa commented 10 months ago

Sure, sounds like a good idea to add. I'm looking at integrating @nx/js as its core generator, that way its easier to manage. I took this approach for now because of the complexity in bun unsupported features.

Let me know if you need a hand, I've already implemented it in my workspace.

Jordan-Hall commented 10 months ago

Yes please, If you don't mind. Now Bun in v1 I'm currently adding unit tests and ensuring everything 100%. A lot was went in on custom task runner to get bun working because nothing worked when i started this for a personal project

Jordan-Hall commented 10 months ago

Correct. It should support --bun flag to force it all in bun. However, since upgrading to v1 they maybe a small issue with --bun which I'm currently looking into. The issue will be in the custom task runner

marcus-sa commented 10 months ago

@Jordan-Hall maybe we should make buildTarget option required? Then we can use the main option in the build target to figure out which file to run.

Jordan-Hall commented 10 months ago

Try and make it optional for now if possible. But if its causing an issue then yes lets make it required

marcus-sa commented 10 months ago

Try and make it optional for now if possible. But if its causing an issue then yes lets make it required

https://github.com/Jordan-Hall/nx-bun/pull/2

Jordan-Hall commented 10 months ago

Thank you for this. Going to take a better look tomorrow if you dont mind, I want to test with -- bun too. I think I can make this optional without a big change. If the target is itself and its :build then ignore main and run the compile :)

Jordan-Hall commented 9 months ago

Merged in 0.2.1 with migration