Skip to content

Use platform specific rewatch binary #1101

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 3 commits into
base: master
Choose a base branch
from

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented May 27, 2025

See #1091

Please take a look at this as well @mediremi

} else if (value.startsWith("..") && value.endsWith("ocaml")) {
// This should be the lib/ocaml folder of the project
// This is a hack to support incremental compilation in monorepos
callArgs.push("-I", path.resolve(entry.project.incrementalFolderPath, "..", "..", "ocaml"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not getting any diagnostics for the following file:

  • rescript.json
  • packages
    • samples
      • rescript.json
      • src/FlappyBird.res

bunx rewatch --rescript-version 12.0.0-alpha.14 --compiler-args packages/samples/src/FlappyBird.res

gave:

{
  "compiler_args": [
    "-I",
    "../ocaml",
    "-I",
    "/Users/nojaf/Projects/rescript-kaplay/packages/rescript-kaplay/lib/ocaml",
    "-uncurried",
    "-bs-package-name",
    "@nojaf/samples",
    "-bs-package-output",
    "esmodule:src:.res.mjs",
    "-bs-v",
    "12.0.0-alpha.14",
    "src/FlappyBird.ast"
  ],
  "parser_args": [
    "-bs-v",
    "12.0.0-alpha.14",
    "-uncurried",
    "-absname",
    "-bs-ast",
    "-o",
    "src/FlappyBird.ast",
    "../../src/FlappyBird.res"
  ]
}

Where -I "../ocaml" is supposed to be packages/samples/lib/ocaml.
I was getting error for my other modules (inside the same project) not being found.

@jfrolich any ideas why this happens?

With this fix, everything works like a charm again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zth as Jaap mentioned on Discord, we should run this from bs/lib.
I changed this for Rewatch only, to not impact any existing bsb users.

@nojaf nojaf requested a review from zth May 27, 2025 15:17
@mediremi
Copy link
Contributor

LGTM ✔️

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