nx icon indicating copy to clipboard operation
nx copied to clipboard

NestJS REPL support

Open exsesx opened this issue 1 year ago • 1 comments

Description

NestJS has a simple interactive environment that takes single user inputs, executes them, and returns the result to the user.

The REPL feature lets you inspect your dependency graph and call methods on your providers (and controllers) directly from your terminal.

To make this work, one has to add a new @nx/webpack:webpack executor target (basically default build target, but with a different main option), which creates a lot of boilerplate code and requires keeping changes of build and repl targets in sync.

Implementing this feature "natively" would be great, or perhaps have a better workaround.

Motivation

NestJS REPL is a convenient and powerful tool; everybody should have it at their disposal.

Suggested Implementation

Idea: is there a way to modify build target options? We could've set the build target to build and changed main inside those options to reduce the boilerplate. I'd be okay with that solution.

Additional References

https://stackoverflow.com/questions/73843467/nestjs-repl-on-nx

exsesx avatar Jul 04 '23 23:07 exsesx

Nx is flexible, so I've posted a workaround to this problem, which seems elegant enough. You can check it out here https://stackoverflow.com/a/76616322/9753648. Especially for those who have the same problem.

exsesx avatar Jul 04 '23 23:07 exsesx

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Mar 12 '24 00:03 github-actions[bot]

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

github-actions[bot] avatar Apr 28 '24 00:04 github-actions[bot]