Skip to main content

Discovery in BeDoc

Discovery in BeDoc is the process of locating the right actions to handle your request. Instead of requiring you to manually specify a parser or printer, BeDoc allows you to define what you need in terms of language and format, and it will take care of how that need is fulfilled.

However, if you prefer to be explicit, you can still specify a particular parser or printer—Discovery won’t stand in your way.

How It Works

During the Discovery process, BeDoc will:

  1. accept your input, which may include:
    • a mock directory, or
    • any configuration expression specifying:
      • language and/or format directives
      • parser and/or printer directives
  2. search for applicable actions within:
    • the global NPM node_modules
    • the local project's node_modules
  3. validate all findings, ensuring that each:
    • contains proper meta information
    • defines a valid action object
    • adheres to contract terms
Configure Decisively

Once BeDoc has compiled all viable options, it attempts to pair a parser with a printer. However, BeDoc does not do indecision:

  • if it finds more than one pairing, it errors.
  • if it finds no valid pairings, it errors.
  • BeDoc does not handle ambiguity well. Handle with care.

The Discovery Flowchart

Also, here’s a Mermaid diagram representing the Discovery process. (That there are no actual mermaids involved remains a source of deep disappointment.)