projen / projen

Rapidly build modern applications with advanced configuration management
https://projen.io
Apache License 2.0
2.65k stars 372 forks source link

Add dependency via CLI/projen task #3279

Open automartin5000 opened 8 months ago

automartin5000 commented 8 months ago

Normally developers can run CLI commands like: npm install axios or poetry add requests and their dependency is installed and added to package.json, pyproject.toml, etc. Using projen makes that now a two-step process: 1. Update projenrc, 2. Run projen.

It'd be great if something like projen add <package> would not only run the install (this seems straightforward), but also add it to projenrc (unclear about this one).

Is there an API somewhere to update projenrc?

mrgrain commented 8 months ago

That's unlikely to ever happen given that projenrc files are typically code written in a general purpose programming language. This could work for .projenrc.json but I'm not sure how popular this option is and if it's worth it.

I recognize the gap in the workflow. You could use projen watch though.

automartin5000 commented 8 months ago

I get the challenge. Just throwing this out there for the future: maybe there could be a param for allowing deps to be managed in an external JSON file (seems like there's already a .projen/deps.json).