Passthrough commands #590
Closed
paularmstrong
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
agreed, maintaining plugins for every possible command is not sustainable. I think exposing a passthrough to the underlying package manager command would be useful for sure. 👍 As for yargs strict mode my vote is to turn it off for these commands if possible i think its clearer than having to use -- to passthrough |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Looking at #554 and #555, there are too many unknowns with passing through to commands like vite and astro (and webpack, next, etc, for that matter). It doesn't seem sustainable to attempt to curate plugins to every single npx command available. Nor does it seem helpful for users of oneRepo to leave them to need to write the entire passthrough on their own.
Passthrough commands
Which opens the idea for "passthrough commands". This would be a way for Workspace configurations to declare commands that should pass through to run with the
graph.packageManager.run
(essentially:cd <workspace> && npx <command...> [options...]
Using the previous configuration, users can enter either:
one ws docs astro -- build # Runs `cd <docs-location> && npx astro build`
one ws docs start # Runs `cd <docs-location> && npx astro dev`
Downsides
This is essentially "npm package.json scripts", with some extra helpers (documentation, etc).
Open questions
Should we keep yargs in strict mode for these commands?
This is our default behavior, which prevents unknown/undefined arguments in the command string – and requires the use of
--
to use passthrough arguments. Turning strict mode off would enableone ws docs astro build
for the first config scenario, but could reduce clarity and feedback for what is possible.Beta Was this translation helpful? Give feedback.
All reactions