Skip to content

bebop.json Reference

Andrew edited this page May 3, 2023 · 2 revisions

Bebop Configuration File

This document describes the usage of the Bebop compiler's configuration file (bebop.json).

A bebop.json file in a directory indicates that the directory is the root of a Bebop project. The config file can be either a bebop.json or *.bebop.json, both have the same set of config variables.

Usage

include

Specifies an array of filenames or patterns to include in the program. These filenames are resolved relative to the directory containing the bebop.json file.

Example:

"include": [
    "**/*.bop"
]

exclude

Specifies an array of filenames or patterns that should be skipped when resolving include. The exclude property only affects the files included via the include property.

Example:

"exclude": [
    "**/*.test.bop"
]

namespace

Optionally specifies a namespace that generated code will use.

Example:

"namespace": "MyNamespace"

generators

Specifies a list of code generators to target during compilation.

Each generator must include the following properties:

  • alias (required): Specify the code generator schemas will be compiled to. Must be one of: cs, ts, cpp, dart, or rust.
  • outFile (required): Specify a file that bundles all generated code into one file.
  • langVersion: (optional) Specify the version of the language the code generator should target.
  • noGenerationNotice: (optional) Specify if the code generator should produces a notice at the start of the output file stating code was auto-generated. Default is false.
  • services: (optional) By default, bebopc generates a concrete client and a service base class. This property can be used to limit bebopc asset generation. Must be one of: none, client, server, or both. Default is both.

Example:

"generators": [
    {
        "alias": "cs",
        "outFile": "./src/Generated.g.cs"
    }
]

watchOptions

Settings for the watch mode in bebopc.

Each watch option is optional and can include the following properties:

  • excludeFiles: (optional) Remove a list of files from the watch mode's processing. Supports globbing.
  • excludeDirectories: (optional) Remove a list of directories from the watch process. Supports globbing.

Example:

"watchOptions": {
    "excludeFiles": [
        "example.bop"
    ],
    "excludeDirectories": [
        "node_modules",
        "build"
    ]
}

Example usage:

{
    "include": [
        "**/*.bop"
    ],
    "exclude": [
        "**/*.test.bop"
    ],
    "namespace": "MyNamespace",
    "generators": [
        {
            "alias": "cs",
            "outFile": "./src/Generated.g.cs"
        }
    ],
    "watchOptions": {
        "excludeFiles": [
            "example.bop"
        ],
        "excludeDirectories": [
            "node_modules",
            "build"
        ]
    }
}