Effect-TS / docgen

An opinionated documentation generator for Effect projects
https://effect-ts.github.io/docgen
MIT License
34 stars 8 forks source link

Utilize `ConfigProvider` to load configuration #62

Closed IMax153 closed 11 months ago

IMax153 commented 11 months ago

The work in this PR allows for configuration to be loaded from either the command-line arguments, the environment, or from the docgen.json file.

The precedence for loading configuration is as follows:

  1. Command-line arguments
  2. Environment variables (prefixed by DOCGEN_
  3. docgen.json

All configuration parameters can be loaded from any one of the three sources listed above and they will be merged together. This is thanks to the ConfigProvider implementation that is included in this PR.

changeset-bot[bot] commented 11 months ago

⚠️ No Changeset found

Latest commit: 82369e4648777a749b130de835d8e5a976839121

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

tim-smart commented 11 months ago

Good start, I think we once we add some apis for working with config files to /cli it will remove some of the ceremony.

IMax153 commented 11 months ago

Good start, I think we once we add some apis for working with config files to /cli it will remove some of the ceremony.

I agree, we definitely need better APIs for handling these kinds of nested structures because loading a fully array or full object as a config value is currently a bit cumbersome.