Skip to content

Update CompilerArgs path help text #7599

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

Merged
merged 2 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 40 additions & 24 deletions rewatch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,62 +43,78 @@ Find this output by running `yarn rewatch --help`.
```
Rewatch is an alternative build system for the Rescript Compiler bsb (which uses Ninja internally). It strives to deliver consistent and faster builds in monorepo setups with multiple packages, where the default build system fails to pick up changed interfaces across multiple packages

Usage: rewatch [OPTIONS] [COMMAND] [FOLDER]
Usage: rewatch [OPTIONS] [FOLDER]
rewatch <COMMAND>

Commands:
build Build using Rewatch
watch Build, then start a watcher
clean Clean the build artifacts
format Alias to `legacy format`
dump Alias to `legacy dump`
compiler-args This prints the compiler arguments. It expects the path to a rescript file (.res or .resi)
legacy Use the legacy build system
help Print this message or the help of the given subcommand(s)

Arguments:
[COMMAND]
Possible values:
- build: Build using Rewatch
- watch: Build, then start a watcher
- clean: Clean the build artifacts

[FOLDER]
The relative path to where the main rescript.json resides. IE - the root of your project

[default: .]

Options:
-f, --filter <FILTER>
Filter allows for a regex to be supplied which will filter the files to be compiled. For instance, to filter out test files for compilation while doing feature work

-a, --after-build <AFTER_BUILD>
This allows one to pass an additional command to the watcher, which allows it to run when finished. For instance, to play a sound when done compiling, or to run a test suite. NOTE - You may need to add '--color=always' to your subcommand in case you want to output colour as well

-n, --no-timing [<NO_TIMING>]
[default: false]
[possible values: true, false]

-v, --verbose...
Increase logging verbosity

-q, --quiet...
Decrease logging verbosity

-f, --filter <FILTER>
Filter files by regex

Filter allows for a regex to be supplied which will filter the files to be compiled. For instance, to filter out test files for compilation while doing feature work.

-a, --after-build <AFTER_BUILD>
Action after build

This allows one to pass an additional command to the watcher, which allows it to run when finished. For instance, to play a sound when done compiling, or to run a test suite. NOTE - You may need to add '--color=always' to your subcommand in case you want to output color as well

-c, --create-sourcedirs [<CREATE_SOURCEDIRS>]
Create source_dirs.json

This creates a source_dirs.json file at the root of the monorepo, which is needed when you want to use Reanalyze

[default: false]
[possible values: true, false]

--compiler-args <COMPILER_ARGS>
This prints the compiler arguments. It expects the path to a rescript.json file. This also requires --bsc-path and --rescript-version to be present

--dev [<DEV>]
Build development dependencies

This is the flag to also compile development dependencies It's important to know that we currently do not discern between project src, and dependencies. So enabling this flag will enable building _all_ development dependencies of _all_ packages

[default: false]
[possible values: true, false]

--rescript-version <RESCRIPT_VERSION>
To be used in conjunction with compiler_args
-n, --no-timing [<NO_TIMING>]
Disable timing on the output

[default: false]
[possible values: true, false]

-s, --snapshot-output [<SNAPSHOT_OUTPUT>]
simple output for snapshot testing

[default: false]
[possible values: true, false]

--bsc-path <BSC_PATH>
A custom path to bsc
Custom path to bsc

-h, --help
Print help (see a summary with '-h')

-V, --version
Print version

```

# Contributing
Expand Down
4 changes: 2 additions & 2 deletions rewatch/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ pub enum Command {
#[arg(allow_hyphen_values = true, num_args = 0..)]
dump_args: Vec<OsString>,
},
/// This prints the compiler arguments. It expects the path to a rescript.json file.
/// This prints the compiler arguments. It expects the path to a rescript file (.res or .resi).
CompilerArgs {
/// Path to a rescript.json file
/// Path to a rescript file (.res or .resi)
#[command()]
path: String,

Expand Down