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

Change the way mdoc is configured #894

Open
Quafadas opened this issue Sep 20, 2024 · 0 comments
Open

Change the way mdoc is configured #894

Quafadas opened this issue Sep 20, 2024 · 0 comments

Comments

@Quafadas
Copy link
Contributor

When trying to get mdoc setup, the big barrier to success, particularly in a mixed JVM / JS is basically the configuration.

mdoc works - but getting it to work can be a challenging experience. I see at least 5 seperate sources of configuration. A mistake in any one of these will cause confusing error messages;

  • command line flags
  • sbt / build tool settings / plugin
  • The sbt JS project (and linker, and dept)
  • The sbt JVM project
  • the "mdoc.properties" file which sbt plugin generates, but incompletely.

My view, is that the last of these is particularly problematic, as it gets generated (at some point) during SBTs initialisation, but I'm convinced I've seen caching problems with it. For me, it was a challenge to even figure out its existence and where it was stored - it has to be on the resource path, but we can't edit the code resource path, so I think sbt plugin monkey patches the list of resource paths for that project.

Further, because the CLI ends up being opinionated toward the SBT plugin, this file represents a quite formidable barrier to integration with other tooling / build tools.

The simplest project I could get working is here. It took an entire evening to figure out the config, on top of the time invested prior spent prior to that actually authoring the PR that enabled ESModules.
https://github.com/Quafadas/mdoc_test

I'm recording this here for posterity - I have little hope that it will be worked on given all the time constraints, and the status quo is understandable given the way the project evolved - I'm not out to hate on mdoc - I like it!

I would also say, that I don't know the right answer to what the config should look like, but I'm quite convinced that if time was unlimited, the status quo should be taken apart and put back together again, so I'm putting this up here for discussion / posterity.

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

No branches or pull requests

1 participant