Proposal: make bs-platform work with opam or esy


#1

Recently, we added support of NODE_PATH in module resolution (thanks to @purkhusid https://github.com/BuckleScript/bucklescript/pull/3701 ), so technically, the package manager does not have to be npm.
If there are more people interested in this direction, I would be happy to push this forward


#2

Yes. I do want bs-platform to work with esy. But there is already an issue on github with details information for esy support right?


#3

If esy can add support for the NODE_PATH environment variable we are pretty close to something that could work. We also have to compile everything into the top-level lib folder but that has been done before.


#4

But there is already an issue on github with details information for esy support right?

Yes, the issue is https://github.com/BuckleScript/bucklescript/issues/3276, the gist is (based on the current status of esy):

  1. Make bsb support resolving modules via pnp.
  2. Make bsb do not put artifacts into package source trees (so it won’t pollute the global cache)
  3. Model bsc as an esy package so esy can cache the build in its store. (this item isn’t strictly required but nice to have)

#5

Yesss this would be so nice!!


#6

Yes. This would be awesome.


#7

Would this pave the way for being able to install BuckleScript with opam and use it with Dune, as part of a bigger OCaml project? If yes, this is #1 on my wish list!


#8

I think it should be good to pair with opam.