Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for running and building all apps in a monorepo with --all flag #2026

Closed
1 task done
necmettindev opened this issue Apr 10, 2023 · 6 comments
Closed
1 task done

Comments

@necmettindev
Copy link

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Having a monorepo with multiple apps inside, it would be useful to have commands like nest start --all, nest start:dev --all and nest build --all.

Describe the solution you'd like

In a monorepo with multiple apps, it can be tedious to run or build each app individually. It would be more convenient and efficient to have commands that can start, run in development mode, or build all apps in the monorepo at once.

Introduce new command line options for the nest CLI that support running and building all apps in a monorepo at once. Specifically, these commands should be implemented:

nest start --all: Start all apps in the monorepo
nest start:dev --all: Start all apps in development mode
nest build --all: Build all apps in the monorepo
The --all flag should be optional, and the commands should continue to work as they do currently when it is not provided. For example, nest start without the --all flag should start only the default app.

Drawbacks
Increased complexity in the CLI implementation and documentation.
Potential performance issues when running or building multiple apps simultaneously, particularly in large monorepos.

Teachability, documentation, adoption, migration strategy

To ensure users can easily understand and adopt this new feature, we should update the documentation to include the new commands and their usage. This can be done by adding a new section under the existing documentation for the nest CLI, with examples and explanations of the --all flag.

### Running and Building All Apps in a Monorepo




In a monorepo with multiple apps, you can use the `--all` flag with the `nest start`, `nest start:dev`, and `nest build` commands to run or build all apps at once.

- `nest start --all`: Start all apps in the monorepo
- `nest start:dev --all`: Start all apps in development mode
- `nest build --all`: Build all apps in the monorepo

By default, without the `--all` flag, these commands will only run or build the default app.

Example usage:

```sh
$ nest start --all

What is the motivation / use case for changing the behavior?

The primary motivation for this change is to simplify the development and build process for users who have multiple apps in a monorepo. Currently, they need to run or build each app individually, which can be time-consuming and error-prone. By allowing users to run or build all apps with a single command, we can streamline the process and improve the overall developer experience.

@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue? 🙌

@necmettindev
Copy link
Author

Would you like to create a PR for this issue? 🙌

sure, i'd be happy to create a pull request for this issue. is there any specific guidance or guidelines that I should follow when contributing to this project?

@kamilmysliwiec kamilmysliwiec transferred this issue from nestjs/nest Apr 11, 2023
@kamilmysliwiec
Copy link
Member

Contributing guide: https://github.com/nestjs/nest-cli/blob/master/CONTRIBUTING.md
& package.json (build, test scripts)

@jjunyjjuny
Copy link

Is this going on?

@iliazeus
Copy link

@kamilmysliwiec I've tried to implement (a part of) this feature in #2312. Specifically, the build --all, because that was the one that I needed.

If everything is alright and I have time, I will try to implement start --all and start:dev --all in a similar way.

@kamilmysliwiec
Copy link
Member

Let's track this here #2312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants