Foundryborne Daggerheart
repository·main·Indexed 41 days ago
https://github.com/foundryborne/daggerheartA community-driven system for the Foundry Virtual Tabletop (VTT) designed to support the Daggerheart tabletop roleplaying game.
What's inside Foundryborne Daggerheart
- The Foundryborne Daggerheart system does not use generative or other AI in its implementation. All contributors must follow this policy. Contributions made using AI will be rejected outright.
Install Foundryborne Daggerheart for Foundry VTT
mainYou can install the Daggerheart system for Foundry VTT using one of three methods:
- In-App Search (Recommended): Search for
DaggerheartorFoundrybornewithin the System Installation dialog in the FoundryVTT admin settings. - Manifest URL: Paste the following URL into the Install System dialog on the FoundryVTT Setup menu:
https://raw.githubusercontent.com/Foundryborne/daggerheart/refs/heads/main/system.json - Manual Install: Download a
.ziparchive from the GitHub Releases page and extract it into your Foundry Data folder atData/systems/daggerheart.
https://raw.githubusercontent.com/Foundryborne/daggerheart/refs/heads/main/system.json- In-App Search (Recommended): Search for
Set up a development environment for Daggerheart
mainTo develop on the Daggerheart system, follow these steps:
- Navigate to the repository directory:
cd <path>/<to>/<repo> - Install dependencies:
npm install - Configure environment variables:
Copy
.env.exampleto.env. You must set:foundry path: Must point tomain.js.data path: Must point to the folder containing theDatafolder (do not point to theDatafolder itself).
- Setup symlinks:
Run the following command in a shell with elevated privileges to set up types and symlink the daggerheart folder into your Foundry data:
npm run createSymlink - Start development:
npm start
- Navigate to the repository directory:
Available development scripts
mainThe following npm scripts are available for development:
npm start: Starts development mode with file watching and automatically launches Foundry.npm run build: Performs a one-time build of the project.npm run createSymlink: Sets up types and creates necessary output symlinks.
npm start npm run build npm run createSymlinkGlobal variables for JavaScript files
mainFor
.jsand.mjsfiles, the ESLint configuration defines a set of read-only global variables to preventno-undeferrors. These include browser globals, project-specific constants (CONFIG,CONST), and various Foundry/PIXI/ProseMirror related classes and namespaces.Global Classes & Namespaces:
Color,Handlebars,Hooks,PIXI,ProseMirror,Rollcanvas,foundry,game,uiActiveEffect,Actor,BaseScene,ChatMessage,Combat,Combatant,Item,Macro,Scene,TokenDocument,RollTableCollection,FormDataExtended,TextEditor
Global Functions:
fromUuid,fromUuidSync,getDocumentClass,_del,_replace,_loc
// Excerpt of globals defined in eslint.config.mjs languageOptions: { globals: { ...globals.browser, CONFIG: 'readonly', CONST: 'readonly', Color: 'readonly', Handlebars: 'readonly', Hooks: 'readonly', PIXI: 'readonly', ProseMirror: 'readonly', Roll: 'readonly', canvas: 'readonly', foundry: 'readonly', game: 'readonly', ui: 'readonly', fromUuid: 'readonly', fromUuidSync: 'readonly', getDocumentClass: 'readonly', _del: 'readonly', _replace: 'readonly', _loc: 'readonly', ActiveEffect: 'readonly', Actor: 'readonly', BaseScene: 'readonly', ChatMessage: 'readonly', Combat: 'readonly', Combatant: 'readonly', Item: 'readonly', Macro: 'readonly', Scene: 'readonly', TokenDocument: 'readonly', RollTable: 'readonly', Collection: 'readonly', FormDataExtended: 'readonly', TextEditor: 'readonly' } }Configure stylistic rules via stylisticRules
mainThe project exports a
stylisticRulesobject intended for use in ESLint configurations. It uses the@stylistic/eslint-pluginto enforce specific code formatting and style patterns. Key configurations include:- Indentation: 4 spaces, with 1 space for
SwitchCase. - Line Length: Maximum of 120 characters, ignoring comments, strings, template literals, and regex literals.
- Quotes: Single quotes, but allows template literals.
- Arrow Functions: Parentheses are used only as needed.
- Comma Dangle: Set to
never. - Spacing: Enforces specific spacing for infix operators, keywords, semi-colons, unary operators, and more.
export const stylisticRules = { '@stylistic/indent': [ 'error', 4, { SwitchCase: 1 } ], '@stylistic/max-len': ['error', { code: 120, ignoreComments: true, ignoreStrings: true, ignoreTemplateLiterals: true, ignoreRegExpLiterals: true }], '@stylistic/quotes': ['error', 'single', { allowTemplateLiterals: 'always' }], '@stylistic/arrow-parens': ['error', 'as-needed'], '@stylistic/quote-props': ['error', 'as-needed'], '@stylistic/array-bracket-newline': ['error', 'consistent'], '@stylistic/key-spacing': 'error', '@stylistic/comma-dangle': ['error', 'never'], '@stylistic/space-in-parens': ['error', 'never'], '@stylistic/space-infix-ops': 2, '@stylistic/keyword-spacing': 2, '@stylistic/semi-spacing': 2, '@stylistic/no-multi-spaces': 2, '@stylistic/no-extra-semi': 2, '@stylistic/no-whitespace-before-property': 2, '@stylistic/space-unary-ops': 2 };- Indentation: 4 spaces, with 1 space for