Skip to content

Development

DC23 edited this page Dec 29, 2024 · 3 revisions

Compendium Management

Management of Compendium files for Foundry v12+ requires a new approach due to changes in the database format to LevelDB. This is well documented on the Community Wiki.

The LDB files used by Foundry are a binary format optimised for runtime efficiency. Unfortunately, many of the file names and timestamps change on file access even when the content has not been updated, meaning that these files do not play nicely with Git. The workflow on this project uses the Foundry CLI tool to convert the LDB files to source-controlled YAML files, and GitHub workflow steps within the release building Action reverse the process, reconstructing the binary LDB files for inclusion into the module.zip release artifact.

Since the LDB files are not included in source control at all, that stage must be run manually before pushing content updates to GitHub. This is done by running:

npm run pushLDBtoYML --if-present

prior to committing and pushing to GitHub.

Since the LDB files used by Foundry are not in GitHub, there is a bootstrapping problem when first cloning the repository to add new content via Foundry. To solve this, you can manually run the reverse process used by the release build workflow to locally create the LDB files from YAML so that Foundry has something to read. The command is:

npm run pullYMLtoLDB --if-present

If you develop on a *nix system then there is a Makefile to simplify running these two commands.

Clone this wiki locally