Skip to content
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

Improve monorepo support by enabling path resolution from bsconfig.json #5328

Closed

Conversation

nordfjord
Copy link

Hi all!

First of all, thanks for making this really awesome project. I'm really fond of the direction you have taken with the community and the project.

I've been trying to add rescript to our monorepo that's powered by the tooling from nx.dev. Unfortunately monorepo support in rescript seems predicated on having symlinks in node_modules which nx doesn't do.

This PR is a proof of concept of adding a "paths" property to bsconfig.json where you can specify resolutions in a map.

e.g.

{
  "paths": {
    "@app/my-module": "./packages/my-module"
  }
}

There's a test directory to showcase an example structure this can benefit. This map is a series of entries which re-map packages to lookup locations relative to bsconfig.

A big caveat here is that OCaml is not my first or second language and I'm sure I've broken every rule under the sun to make this PoC. I had two main goals doing this.

  1. Gain a better understanding of how rescript works for myself
  2. Start a discussion about whether a paths property like this could be beneficial to more people than just me

@bobzhang
Copy link
Member

bobzhang commented Nov 6, 2021

I dont have time to review the code yet. But the feature request looks reasonable to me. Can you make a feature proposal on the forum to see what other people think?

@nordfjord
Copy link
Author

Thanks for your response!

I have created a topic on the forum here: https://forum.rescript-lang.org/t/proposal-bsconfig-json-paths-property/2606

@cristianoc
Copy link
Collaborator

This has been dormant for a while.
If there's still interest, how about reviving the discussion on the forum, then take it from there (rebase on current master etc).

@cristianoc cristianoc closed this Jul 14, 2022
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.

None yet

3 participants