Type Definitions

CompendiaJSON

Definitions for module-included compendium databases. If String forms are used, values will apply to all discovered compendiums. If Object fields are used, values should be String:String pairs keyed by the compendium's containing folder, which is used as its ID.

Type:
  • Object
Properties
NameTypeAttributesDescription
pathglobstring

Defines root folders for general, or specific database discovery

typeString | Object

FoundryVTT Document type for discovered databases

labelString | Object

Displayed name of compendium in FoundryVTT

bannerString | Object<optional>

Asset path for compendium banner

systemString | Object<optional>

associated system (if any) for compendiums

folderObject<optional>

Top level folder definition, color fields use hex-strings of the form "#RRGGBB".

DenConfigJSON

Type:
  • Object
Properties
NameTypeAttributesDefaultDescription
idString<optional>

Top level identifier for module (default is BD file name, as [id].bd.json)

versionString

Directly added to resulting manifest

titleString

Directly added to resulting manifeste

descriptionString

Directly added to resulting manifest

projectUrlString<optional>
packagePackageJSON<optional>

Global packaging instructions for all profiles. Overridden by profile entries.

entryPointsEntryPointJSON
destString

Output directory for resulting build, relative to this bd config file

staticglobstring<optional>

File/folder paths to be directly copied to built package once upon initial bundle only (not re-copied on watch trigger)

profileRecord.<String, DenProfileJSON>

List of profile objects keyed by its name, such as 'release' or 'dev'

dependenciesObject<optional>

Inner String arrays are treated as [min, verified, max] versions

Properties
NameTypeAttributesDefaultDescription
coreArray.<String><optional>
[]
modulesRecord.<String, Array.<String>><optional>
{}

Module id to version array

systemsRecord.<String, Array.<String>><optional>
{}

System id to version array

authorsObject | Array.<Object><optional>

Directly added to resulting manifest

flagsObject<optional>

Directy added to resulting manifest

socketBoolean<optional>
false

Directly added to resulting manifest -- automatically detected by presense of 'game.socket' in bundled code.

storageBoolean<optional>
false

Directly added to resulting manifest as "persistentStorage" -- automatically detected by presense of 'uploadPersistent' in bundled code.

DenProfileJSON

Type:
  • Object
Properties
NameTypeAttributesDescription
destString<optional>

output directory for resulting build, relative to this bd config file (overrides DenConfigJSON.dest)

idString<optional>

top level identifier for module (overrides DenConfigJSON.id)

versionString<optional>

directly added to resulting manifest (overrides DenConfigJSON.version)

compressBoolean<optional>

compress resulting json, (m)js, and css files (extremely conservative, but do confirm proper operation)

sourcemapsBoolean<optional>

generate sourcemaps for resulting (m)js and css files.

cleanBoolean<optional>

clear contents of target dest directory before build (does not clean on watch)

hmrBoolean<optional>

enable hot reload functionality for html, css, hbs, and json files (overrides clean to false)

entryPointsEntryPointJSON<optional>

merged with top level entryPoints field; see DenConfigJSON.entryPoints

staticglobstring<optional>

merged with top level static field; see DenConfigJSON.static

packagePackageJSON<optional>

Profile-specific packaging instructions, merged with top-level field.

flagsObject<optional>

merged with top level flags field; see DenConfigJSON.flags

EntryPointJSON

Top level definition of this module's root files, or entry points. Language files should follow the country code naming convention, e.g. en.json or ja.json, for proper detection. All files/globstrings listed in this section, except for compendia, will be watched for changes and trigger rebundles. Compendium entries are unpacked (if requested) prior to any cleaning operation of the output folder, and packed after said cleaning operation.

Type:
  • Object
Properties
NameTypeAttributesDescription
mainglobstring

paths for top level module files (e.g. init.mjs or [module name].mjs)

langglobstring<optional>

paths for language files with [country code].json format (e.g. en.json)

templatesglobstring<optional>

paths for handlebars template files (.hbs or .html)

compendiaCompendiaJSON<optional>

folder paths containing leveldb source files, with equivalent relative paths used as location for profile's built package databases

PackageJSON

Defines if and how the resulting bundle should be packaged as a .zip file for distribution. Resulting archive is placed as a sibling of the profile's destination path.

Type:
  • Object
Properties
NameTypeAttributesDefaultDescription
createBoolean<optional>
false

Should the resulting bundle be zipped for distribution

nameString<optional>

Base name of the resulting zip file, e.g. "cool-mod" -> "cool-mod.zip". Defaults to "[id]-[version]".

protectedBoolean<optional>
false

Controls packing for premium modules and has the following side effects: - manifest: defaults to Foundry's premium content server unless specified otherwise - download: removes this field (if provided) as it is served from Foundry after DRM validation

manifestString<optional>
""

URL pointing to the most recent release's manifest file

downloadString<optional>
""

URL pointing to this specific release's distribution package (.zip file)

globstring

A string, or string array, of "glob" paths describing files/folders.

Excerpt from fast-glob's documentation, which is the library used to resolve file paths for all fields of this type:

Basic syntax

  • An asterisk (*) — matches everything except slashes (path separators), hidden files (names starting with .).
  • A double star or globstar (**) — matches zero or more directories.
  • Question mark (?) – matches any single character except slashes (path separators).
  • Sequence ([seq]) — matches any character in sequence.
Type:
  • String | Array.<String>
Example
`src/** /*.js` //matches all files in the `src` directory (any level of nesting) that have the `.js` extension. (space after `/**` due to formatting only, should not be included) 
`src/*.??` //matches all files in the `src` directory (only first level of nesting) that have a two-character extension.
`file-[01].js` //matches files: `file-0.js`, `file-1.js`.