Skip to content

Instantly share code, notes, and snippets.

@andrewmd5
Last active February 2, 2024 11:44
Show Gist options
  • Save andrewmd5/5ddade0ef06886676766488a1aef807c to your computer and use it in GitHub Desktop.
Save andrewmd5/5ddade0ef06886676766488a1aef807c to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://json.schemastore.org/bebop",
"title": "JSON schema for the Bebop compiler's configuration file",
"type": "object",
"properties": {
"generators": {
"$ref": "#/definitions/generatorsDefinition/properties/generators"
},
"include": {
"$ref": "#/definitions/includeDefinition/properties/include"
},
"exclude": {
"$ref": "#/definitions/excludeDefinition/properties/exclude"
},
"watchOptions": {
"$ref": "#/definitions/watchOptionsDefinition/properties/watchOptions"
},
"noWarn": {
"$ref": "#/definitions/noWarnDefinition/properties/noWarn"
},
"noEmit": {
"$ref": "#/definitions/noEmitDefinition/properties/noEmit"
},
"extensions": {
"$ref": "#/definitions/extensionsDefinition/properties/extensions"
}
},
"additionalProperties": false,
"definitions": {
"//": {
"explainer": "https://github.com/betwixt-labs/bebop/wiki",
"reference": "https://github.com/betwixt-labs/bebop/wiki/bebop.json-configuration"
},
"excludeDefinition": {
"properties": {
"exclude": {
"description": "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.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
}
},
"includeDefinition": {
"properties": {
"include": {
"description": "Specifies an array of filenames or patterns to include in the compiler. These filenames are resolved relative to the directory containing the bebop.json file.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
}
},
"generatorsDefinition": {
"properties": {
"generators": {
"description": "Specifies code generators to use for compilation.",
"type": "object",
"patternProperties": {
"^(cs|ts|cpp|dart|rust|py|[a-z]{1,7})$": {
"type": "object",
"properties": {
"outFile": {
"description": "Specify a file that bundles all generated code into one file.",
"type": "string"
},
"services": {
"description": "By default, bebopc generates a concrete client and a service base class. This property can be used to limit bebopc asset generation.",
"type": "string",
"enum": ["none", "client", "server", "both"],
"default": "both"
},
"emitNotice": {
"description": "Specify if the code generator should produce a notice stating code was auto-generated.",
"type": "boolean"
},
"emitBinarySchema": {
"description": "Specify if the code generator should emit a binary schema in the output file that can be used for dynamic serialization.",
"type": "boolean",
"default": false
},
"namespace": {
"description": "Specify a namespace for the generated code.",
"type": "string",
"minLength": 1,
"pattern": "^[a-zA-Z]+(\\.[a-zA-Z]+)*$"
},
"options": {
"description": "Specify custom options for the code generator.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"required": ["outFile"],
"additionalProperties": false
}
},
"additionalProperties": false
}
}
},
"watchOptionsDefinition": {
"properties": {
"watchOptions": {
"type": "object",
"description": "Settings for the watch mode in bebopc.",
"properties": {
"excludeFiles": {
"description": "Remove a list of files from the watch mode's processing.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
},
"excludeDirectories": {
"description": "Remove a list of directories from the watch process.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
}
},
"noWarnDefinition": {
"properties": {
"noWarn": {
"description": "Specifies an array of warning codes to silence",
"type": "array",
"uniqueItems": true,
"items": {
"type": "number"
}
}
}
},
"noEmitDefinition": {
"properties": {
"noEmit": {
"description": "Disable emitting files from a compilation.",
"type": "boolean"
}
}
},
"extensionsDefinition": {
"properties": {
"extensions": {
"type": "object",
"description": "An object of extensions the compiler should load.",
"patternProperties": {
"^(?:(?:@(?:[a-z0-9-*~][a-z0-9-*._~]*)?/[a-z0-9-._~])|[a-z0-9-~])[a-z0-9-._~]*$": {
"type": "string",
"description": "The version of the extension, in semver format without comparison operators.",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*))?$",
"patternErrorMessage": "Must be in semver format without comparison operators."
}
},
"additionalProperties": false
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment