-
Notifications
You must be signed in to change notification settings - Fork 59
ReScript Project spec #51
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
Conversation
@bobzhang could you give this a review? Editor tooling needs to be able to get this correct for monorepos and normal projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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")` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is correct
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` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems correct
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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