-
Notifications
You must be signed in to change notification settings - Fork 108
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
[Proposal] Dependencies with command arguments #950
Comments
What happens if a script has a transitive dependency on both Do we want to create conditions where it's forbidden for one script to depend upon another? Currently the only other reason it's disallowed for one script to depend upon another is if it creates a cycle in the dependency graph. |
I think you could consider flags to be variants of the scripts and that leads to some answers here... Right now you to do separate prod and debug builds you would need separate commands like Now, maybe that's bad and this could be an opportunity to do better. I think there are only to potentially valid ways to run this differently:
(1) is certainly simpler to do, and it might not block (2) in the future. I also think that adding flags has the potential to lead towards a design for macro scripts. If we can define parameters to scripts, we can have other scripts invoke them with arguments - that allows for some conveniences of macros (ie a typescript macro?) and propagating parameters. |
In other words, the potential for invalid transitive dependencies already exists since script declarations can de facto mutually exclusive / non-idempotent variants ( Is my interpretation correct? |
Use case
I have
build
command that takes an optionaldebug
flag that triggers a debug build. It would be very convenient if I could have a script that depends on the debug build without having to create a separatebuild-debug
script, since the only difference is this extra argument:This dovetails very nicely with how wireit already works, as wireit already
Thus successive, alternating invocations of
npm run run
andnpm run debug
is very efficient, only having to restore cached output ofbuild
orbuild debug
as needed.The text was updated successfully, but these errors were encountered: