Conversation
|
@bobzhang could you give this a review? Editor tooling needs to be able to get this correct for monorepos and normal projects. |
bobzhang
left a comment
There was a problem hiding this comment.
we can schedule a meeting if you find it more efficient
| 2. platform specific `bsc.exe` (formatter) | ||
| - Starting from the current open file, walk the filesystem upwards, until `./node_modules/bs-platform` is located | ||
| - `bsc.exe` is located at `path.join(foundDirectory, "./node_modules/bs-platform", platform, "bsc.exe")` | ||
|
|
There was a problem hiding this comment.
This is not exact since if you are not in the root project but in a dependency, this might be wrong
There was a problem hiding this comment.
I have a vague memory that there is something called path.resolve
|
|
||
| 1. `.compiler.log` (diagnostics) | ||
| - Starting from the current open file, walk the filesystem upwards, until `bsconfig.json` is located | ||
| - `.compiler.log` is located at `path.join(foundDirectory, "lib", "bs", ".compiler.log")` |
| 1. `bsc.exe` can be found in `/root/node_modules/bs-platform/{platform}/bsc.exe` | ||
| 2. `.compiler.log` can be found in `/root/folder1/lib/bs/.compiler.log` | ||
| 3. `bsb` to get a build for this project and get the freshest data: `/root/folder1/node_modules/.bin/bsb`. Note that there's also a one in `/root/node_modules/.bin/bsb`. The bsb in the subfolder is a symlink to the one in the root's node_modules. Bsb needs a `bsconfig.json` in the current working directory, so the cwd for bsb needs to be `/root/folder1` | ||
|
|
| 1. run `yarn` in the root | ||
| 2. build folder1: `cd folder1 && yarn bsb` | ||
| 3. build folder2: `cd folder2 && yarn bsb` | ||
|
|
There was a problem hiding this comment.
this is incorrect. user should only run bsb in the main repo.
The project is organised with the assumption that there's only main entry point, user should never run bsb in different directories.
| ### Yarn workspace with multiple ReScript projects in subfolders where one is on a different bs-platform version | ||
|
|
||
| Monorepo where `folder1` and `folder2` are on `bs-platform` 8.4.2 and `folder3` on 8.3.3 | ||
|
|
There was a problem hiding this comment.
This should not happen, since the main entry point decides the compiler version
|
@bobzhang if you have some time, would it be possible to schedule a short meeting to go over my questions and your feedback? It might be faster. |
Formalize the heuristics to detect compiler executables for editor tooling