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.
- Object
Name | Type | Attributes | Description |
---|---|---|---|
path | globstring | Defines root folders for general, or specific database discovery | |
type | String | | FoundryVTT Document type for discovered databases | |
label | String | | Displayed name of compendium in FoundryVTT | |
banner | String | | <optional> | Asset path for compendium banner |
system | String | | <optional> | associated system (if any) for compendiums |
folder | Object | <optional> | Top level folder definition, color fields use hex-strings of the form |
- Source
DenConfigJSON
- Object
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | String | <optional> | Top level identifier for module (default is BD file name, as | |||||||||||||||||||||
version | String | Directly added to resulting manifest | ||||||||||||||||||||||
title | String | Directly added to resulting manifeste | ||||||||||||||||||||||
description | String | Directly added to resulting manifest | ||||||||||||||||||||||
projectUrl | String | <optional> | ||||||||||||||||||||||
package | PackageJSON | <optional> | Global packaging instructions for all profiles. Overridden by profile entries. | |||||||||||||||||||||
entryPoints | EntryPointJSON | |||||||||||||||||||||||
dest | String | Output directory for resulting build, relative to this bd config file | ||||||||||||||||||||||
static | globstring | <optional> | File/folder paths to be directly copied to built package once upon initial bundle only (not re-copied on watch trigger) | |||||||||||||||||||||
profile | Record.<String, DenProfileJSON> | List of profile objects keyed by its name, such as 'release' or 'dev' | ||||||||||||||||||||||
dependencies | Object | <optional> | Inner String arrays are treated as Properties
| |||||||||||||||||||||
authors | Object | | <optional> | Directly added to resulting manifest | |||||||||||||||||||||
flags | Object | <optional> | Directy added to resulting manifest | |||||||||||||||||||||
socket | Boolean | <optional> | false | Directly added to resulting manifest -- automatically detected by presense of 'game.socket' in bundled code. | ||||||||||||||||||||
storage | Boolean | <optional> | false | Directly added to resulting manifest as "persistentStorage" -- automatically detected by presense of 'uploadPersistent' in bundled code. |
- Source
DenProfileJSON
- Object
Name | Type | Attributes | Description |
---|---|---|---|
dest | String | <optional> | output directory for resulting build, relative to this bd config file (overrides DenConfigJSON.dest) |
id | String | <optional> | top level identifier for module (overrides DenConfigJSON.id) |
version | String | <optional> | directly added to resulting manifest (overrides DenConfigJSON.version) |
compress | Boolean | <optional> | compress resulting json, (m)js, and css files (extremely conservative, but do confirm proper operation) |
sourcemaps | Boolean | <optional> | generate sourcemaps for resulting (m)js and css files. |
clean | Boolean | <optional> | clear contents of target |
hmr | Boolean | <optional> | enable hot reload functionality for html, css, hbs, and json files (overrides |
entryPoints | EntryPointJSON | <optional> | merged with top level |
static | globstring | <optional> | merged with top level |
package | PackageJSON | <optional> | Profile-specific packaging instructions, merged with top-level field. |
flags | Object | <optional> | merged with top level |
- Source
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.
- Object
Name | Type | Attributes | Description |
---|---|---|---|
main | globstring | paths for top level module files (e.g. | |
lang | globstring | <optional> | paths for language files with |
templates | globstring | <optional> | paths for handlebars template files (.hbs or .html) |
compendia | CompendiaJSON | <optional> | folder paths containing leveldb source files, with equivalent relative paths used as location for profile's built package databases |
- Source
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.
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
create | Boolean | <optional> | false | Should the resulting bundle be zipped for distribution |
name | String | <optional> | Base name of the resulting zip file, e.g. "cool-mod" -> "cool-mod.zip". Defaults to "[id]-[version]". | |
protected | Boolean | <optional> | false | Controls packing for premium modules and has the following side effects: - |
manifest | String | <optional> | "" | URL pointing to the most recent release's manifest file |
download | String | <optional> | "" | URL pointing to this specific release's distribution package (.zip file) |
- Source
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.
- String |
Array.<String>
- Source
`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`.