Feature suggestion: task for running package.json scripts
andyjy opened this issue · 3 comments
I'm using a monorepo with turborepo and (currently) npm. My biggest pain with that setup right now is managing all my unruly package.json scripts (npm run ...
) across different package workspaces.
(I have quite a lot - many in the root workspace, some standardised ones across most/all workspaces that are typically run via turborepo and not so painful, (e.g. lint
, typecheck
, build
..), and a bunch of others specific to individual workspaces that are tricky to remember exact names/locations for.)
Strikes me this kind of prompt-based UI could be sweet for that..!
I.e. new task: Run Package Script -> select package from list -> select script from list (populated from workspace package.json scripts
key).
So almost an interface to build turbo filters?
Then, maybe save as top-level script?
So could potentially be:
spaceman
> turbo
> make
> choose workspaces
> save as script
> run
> choose script
Regards your suggestion:
I.e. new task: Run Package Script -> select package from list -> select script from list (populated from workspace package.json scripts key)
Turbo is designed to run all scripts of a same name, so would it actually be:
spaceman
> turbo
> select same-named scripts
> run / save
Is it possible to share your repo / package scripts?
If private, you could add me as a collaborator temporarily; it would be useful to see another setup.
Maybe a zoom would be useful. I'll ping you on RC...
For future visitors, the final problem solved was:
- a user should be quickly be able to run any single script in the workspace
- the implementation was:
- run spaceman
- run the
Script > run
task - type to filter from ALL package scripts in the repository
- hit
Enter
to run that script