Rewatch cli refactor
Upstream the changes of rescript-lang/rewatch#162
rescript
npm i https://pkg.pr.new/rescript-lang/rescript@7551
@rescript/darwin-arm64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7551
@rescript/darwin-x64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7551
@rescript/linux-arm64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7551
@rescript/linux-x64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7551
@rescript/win32-x64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7551
commit: 834f890
@nojaf to answer you on your comment here https://github.com/rescript-lang/rewatch/pull/162#discussion_r2125819586.
I think this is a great idea. I also think the plan was to eventually replace the legacy commands with commands implemented in rewatch.
Not sure if relevant here, but I still see 1.2.0 for bunx rewatch --version.
At some point, this should be the rescript version?
rewatch legacy --help doesn't show any help:
(base) nojaf@nojaf-mbp tower-defense % bunx rewatch legacy --help
thread 'main' panicked at src/helpers.rs:252:14:
Could not find rescript-legacy
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I got this with bunx rewatch dump as well.
Not sure if relevant here, but I still see
1.2.0forbunx rewatch --version. At some point, this should be the rescript version?
I think the right time for this would be when rewatch is the default cli.
rewatch legacy --helpdoesn't show any help:(base) nojaf@nojaf-mbp tower-defense % bunx rewatch legacy --help thread 'main' panicked at src/helpers.rs:252:14: Could not find rescript-legacy note: run with `RUST_BACKTRACE=1` environment variable to display a backtraceI got this with
bunx rewatch dumpas well.
I prematurely already look for a binary named rescript-legacy. I guess in this PR we can still look for rescript. I will also add tests for the legacy subcommands.
If I run rewatch help instead of rewatch --help, I get
error: unrecognized subcommand '--bsc-path'
Usage: rewatch.exe [OPTIONS] [FOLDER]
rewatch.exe <COMMAND>
(the --bsc-path option is appended by the node wrapper script)
@Bushuo, there still seems to be something up with the legacy commands:
@Bushuo, there still seems to be something up with the legacy commands:
Ok, strange, I will look into it. The legacy build and clean command seems to work though, I included a test for it. Those commands are not handled differently from format. The args are just passed to bsc.
@nojaf I can reproduce it and will fix it soon.