I have a Nx Node project that uses pre-processed summary stats files. These stats files require a lot of processing and rarely need to be generated. However, once they are generated the primary Node app runs quickly.
I want a pre-processing step that can be run manually to generate these stats assets. I want to use Nx's typescript, prettier and linting support to write the code to generate these stats files. But creating a whole Node Nx library for each processing step seems like a lot of unnecessary infrastructure.
There is an option to run custom commands: https://nx.dev/latest/node/executors/run-commands-builder. I want to do this with a Typescript file but the documentation only shows shell commands or combining pre-existing Nx commands. AFAICT I can't just point this to a typescript file.
Question is:
- Can I run a custom command to trigger a single typescript file?
- Is it more idiomatic to just create a whole Node library for each file that generates these stats?
Thanks