Skip to content

legacy subcommand & CLI structure refactor #162

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Bushuo
Copy link
Collaborator

@Bushuo Bushuo commented May 6, 2025

This PR refactors the CLI structure of rewatch to enhance clarity and improve the usability of subcommands and their associated arguments.

Key Changes:

Introduction of New Subcommands:

  • legacy: Acts as a passthrough to the legacy CLI rescript. In the future, this will be named rescript-legacy.
  • dump: Serves as an alias for legacy dump.
  • format: Serves as an alias for legacy format.

Breaking Change:
The --compiler-args argument has been replaced with a new subcommand compiler-args. I assume this change will have minimal impact. I guess this is mainly used as a debug command.

Benefits:

The refactored structure ensures a more intuitive CLI experience by clearly delineating which arguments apply to specific subcommands.
The introduction of aliases (dump and format) simplifies common operations and aims to make the transition to rewatch as the default build system easier.
The new compiler-args subcommand makes the CLI behavior more consistent and predictable.

@Bushuo Bushuo changed the title --legacy flag to proxy to legacy build system --legacy flag to passthrough to legacy build system May 6, 2025
@Bushuo Bushuo force-pushed the legacy-build-system-cli branch 2 times, most recently from e0084c2 to b4945ea Compare May 6, 2025 19:42
@Bushuo Bushuo force-pushed the legacy-build-system-cli branch from 5d7834f to 6c3607f Compare May 10, 2025 13:51
@Bushuo Bushuo force-pushed the legacy-build-system-cli branch from 6c3607f to bf41fd4 Compare May 10, 2025 20:07
@Bushuo Bushuo changed the title --legacy flag to passthrough to legacy build system legacy subcommand to passthrough to legacy build system May 10, 2025
@Bushuo Bushuo changed the title legacy subcommand to passthrough to legacy build system legacy subcommand & CLI structure refactor May 10, 2025
@Bushuo Bushuo marked this pull request as ready for review May 10, 2025 20:45
@Bushuo
Copy link
Collaborator Author

Bushuo commented May 10, 2025

@jfrolich It seems to be running a bit slower now, but I don't understand why it would be.
The performance is only measured starting in build but I did not touch anything in there and deeper.

@jfrolich
Copy link
Collaborator

Only in this PR? Or is the performance hit potentially introduced earlier?

@Bushuo
Copy link
Collaborator Author

Bushuo commented May 11, 2025

Only in this PR? Or is the performance hit potentially introduced earlier?

I noticed it because the snapshots are different. I think it is only this PR.

Bushuo added 2 commits May 12, 2025 22:28
if args are passed before a subcommand they conflict.
args should be passed after the subcommand.
`rewatch --no-timing build` will treat `build` as folder arg.
@Bushuo
Copy link
Collaborator Author

Bushuo commented May 12, 2025

@jfrolich I had a misunderstanding and --no-timing did not work as intended.
The tests are passing but there is a further change.
Calls like rewatch --no-timing build are discouraged now because the build part will be treated as folder arg.

The confusion stemmed from --no-timing printing the timings as 0.0s.
Maybe we should make it omit the timing info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants