Nodeenv demo#3759
Conversation
1e422aa to
163bd45
Compare
|
Some kind of solution for defining tasks like |
|
I like the idea of cargo xtask too, but it doesn't solve every problem (e.g. setting up the environment), and I never quite get past setting up the boilerplate I'd need to find out how much more verbose it has to be as compared to a shell script. |
Try ``` poetry install poetry run -- nodeenv -p poetry run -- npm install # After merging this PR with jj-vcs#3757. ``` If we wanted to use this approach for real, we'd probably want to either use something like <https://python-poetry.org/docs/pyproject#scripts> or a [`cargo xtask`](https://github.com/matklad/cargo-xtask).
|
I'll close this. I think DPrint is a better option; it can be cargo-installed. |
UPDATE: I'll likely close this soon. I remembered that https://pre-commit.com/ is likely a better option than
nodeenv. IIRC, it can install Node+Pretter in a hermetic way, removing the need for apackage.json. It should be possible to install pre-commit with Poetry orpipx.OTOH, I'm not sure pre-commit currently has a working Prettier plugin. pre-commit/pre-commit#3133
This is a demo of using
nodeenvto install Prettier for #3757. It may or may not be later fleshed out to a real PR.Try
poetry install poetry run -- nodeenv -p poetry run -- npm install # After merging this PR with #3757.If we wanted to use this approach for real, we'd probably want to either use something like https://python-poetry.org/docs/pyproject#scripts or a
cargo xtask.Checklist
If applicable:
CHANGELOG.md