For those with medium to large projects + a good number of npm dependencies, how do you like to organize external bindings?
I’ve thought of a few different ways, wondering if there’s a community standard or if anyone has any strong opinions on it:
1. A bunch of top level modules in a bindings
directory
.
└── bindings/
├── Chalk.res
├── Chokidar.res
└── FastGlob.res
2. Inside a single module, something like Deps.res
or Npm.res
This feels similar to how deno wants you to handle dependencies
module Chalk = {
}
module Chokidar = {
}
module FastGlob = {
}
module Chalk = Npm.Chalk
module Chokidar = Npm.Chokidar
// (...)
3. Abstracted inline into more domain specific modules
// Logger.res
@module("chalk") external red: // ...
let error = msg => Console.log(red("ERR"))
// FileSystem.res
@module("chokidar") external watch: (..)
@module("fastglob") external find: (..)
4. Separate into different packages in a monorepo
Pro is that they can be published for the community, but this seems like a lot of work & setup for little payoff