{"id":19695011,"url":"https://github.com/rescript-lang/rewatch","last_synced_at":"2025-08-25T06:11:16.942Z","repository":{"id":143585159,"uuid":"586623730","full_name":"rescript-lang/rewatch","owner":"rescript-lang","description":"Rewatch is an alternative build system for the Rescript Compiler.","archived":false,"fork":false,"pushed_at":"2025-07-08T17:43:05.000Z","size":25441,"stargazers_count":121,"open_issues_count":12,"forks_count":17,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-08-20T06:20:31.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rescript-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-08T19:24:10.000Z","updated_at":"2025-07-16T04:49:01.000Z","dependencies_parsed_at":"2024-01-17T12:13:48.628Z","dependency_job_id":"3acc6b84-b7f3-47e4-a221-8c459cb129cd","html_url":"https://github.com/rescript-lang/rewatch","commit_stats":null,"previous_names":["teamwalnut/rewatch","rescript-lang/rewatch","rolandpeelen/rewatch"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/rescript-lang/rewatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-lang%2Frewatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-lang%2Frewatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-lang%2Frewatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-lang%2Frewatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rescript-lang","download_url":"https://codeload.github.com/rescript-lang/rewatch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-lang%2Frewatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272013545,"owners_count":24858474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T19:25:49.633Z","updated_at":"2025-08-25T06:11:16.916Z","avatar_url":"https://github.com/rescript-lang.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Rewatch\n\n## [![Release](https://github.com/rolandpeelen/rewatch/actions/workflows/build.yml/badge.svg?branch=master\u0026event=release)](https://github.com/rolandpeelen/rewatch/actions/workflows/build.yml)\n\n# Info\n\nRewatch is an alternative build system for the [Rescript Compiler](https://rescript-lang.org/) (which uses a combination of Ninja, OCaml and a Node.js script). It strives to deliver consistent and faster builds in monorepo setups. Bsb doesn't support a watch-mode in a monorepo setup, and when setting up a watcher that runs a global incremental compile it's consistent but very inefficient and thus slow. \n\nWe couldn't find a way to improve this without re-architecting the whole build system. The benefit of having a specialized build system is that it's possible to completely tailor it to ReScript and not being dependent of the constraints of a generic build system like Ninja. This allowed us to have significant performance improvements even in non-monorepo setups (30% to 3x improvements reported).\n\n# Project Status\n\nThis project should be considered in beta status. We run it in production at [Walnut](https://github.com/teamwalnut/). We're open to PR's and other contributions to make it 100% stable in the ReScript toolchain.\n\n# Usage\n\n  1. Install the package\n\n  ```\n  yarn add @rolandpeelen/rewatch\n  ```\n\n  2. Build / Clean / Watch\n\n  ```\n  yarn rewatch build\n  ```\n\n  ```\n  yarn rewatch clean\n  ```\n\n  ```\n  yarn rewatch watch\n  ```\n\n  You can pass in the folder as the second argument where the 'root' `bsconfig.json` lives. If you encounter a 'stale build error', either directly, or after a while, a `clean` may be needed to clean up some old compiler assets.\n\n## Full Options\n\nFind this output by running `yarn rewatch --help`.\n\n```\nRewatch 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\n\nUsage: rewatch [OPTIONS] [COMMAND] [FOLDER]\n\nArguments:\n  [COMMAND]\n          Possible values:\n          - build: Build using Rewatch\n          - watch: Build, then start a watcher\n          - clean: Clean the build artifacts\n\n  [FOLDER]\n          The relative path to where the main rescript.json resides. IE - the root of your project\n\nOptions:\n  -f, --filter \u003cFILTER\u003e\n          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\n\n  -a, --after-build \u003cAFTER_BUILD\u003e\n          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\n  -n, --no-timing [\u003cNO_TIMING\u003e]\n          [default: false]\n          [possible values: true, false]\n\n  -v, --verbose...\n          Increase logging verbosity\n\n  -q, --quiet...\n          Decrease logging verbosity\n\n  -c, --create-sourcedirs [\u003cCREATE_SOURCEDIRS\u003e]\n          This creates a source_dirs.json file at the root of the monorepo, which is needed when you want to use Reanalyze\n          \n          [default: false]\n          [possible values: true, false]\n\n      --compiler-args \u003cCOMPILER_ARGS\u003e\n          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\n\n      --dev [\u003cDEV\u003e]\n          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\n          \n          [default: false]\n          [possible values: true, false]\n\n      --rescript-version \u003cRESCRIPT_VERSION\u003e\n          To be used in conjunction with compiler_args\n\n      --bsc-path \u003cBSC_PATH\u003e\n          A custom path to bsc\n\n  -h, --help\n          Print help (see a summary with '-h')\n\n  -V, --version\n          Print version\n\n```\n\n# Contributing\n\n  Pre-requisites:\n\n  - [Rust](https://rustup.rs/)\n  - [NodeJS](https://nodejs.org/en/) - For running testscripts only\n  - [Yarn](https://yarnpkg.com/) or [Npm](https://www.npmjs.com/) - Npm probably comes with your node installation\n\n  1. `cd testrepo \u0026\u0026 yarn` (install dependencies for submodule)\n  2. `cargo run`\n\n  Running tests:\n\n  1. `cargo build --release`\n  2. `./tests/suite.sh`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-lang%2Frewatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frescript-lang%2Frewatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-lang%2Frewatch/lists"}