This is a foundry plugin template that I use. I assume absolutely no responsibility for anything that goes wrong if you decide to use it yourself.
If you wish to use TypeScript, please see the TypeScript branch.
- Look for instances of
your-module-name
,YourName
,[email protected]
,YourEmail
and replace them. - Make sure you have edited any relevant urls in the following files:
package.json
,git-conventional-commits.yml
,FUNDING.yml
. (There may be others, just keep an eye out)
- Uses JSDoc/eslint to give basic typing & intellisense support.
- Has working example of ES6 unit tests that deal with foundry specific elements.
- SCSS styling.
- An example of basic localization.
- An example of how create & use a new dialog window.
- Automatic semantic versioning and changelog generation.
- Auto compiles a new release any time a tag with the syntax
vX.Y.Z
is pushed to the main branch. The zip/manifest files are then attached to the release. - Allows fast creation of zipped builds for beta distribution
- Generates changelog using conventional commits.
- Copy the files from this repo to a folder of your choice, then rename things as requested in the
Before Use
section. - Rename the
foundryconfig.example.json
tofoundryconfig.json
then edit it to point to your local Foundry location. npm install
- Download & Setup the required packagesnpm run build
- Build the modulenpm run link-project
- Link the build folder to your foundry installation. Now, runningnpm run build
will change the plugin you have installed while Foundry is running. Then press F5 to reload and pick up the majority of changes.
- When preparing for a new release, use
npm run release
to activatecommit-and-tag-version
. This package will automatically bump the version number in both thepackage.json
and/src/module.json
files, as well as automatically populate CHANGELOG.md with a new entries for the upcoming release version. The changelog is updated using conventional commits and the version numbers are updated using semantic versioning. Usenpm run release:dry
to see a preview of the run in the console. - To cut a new release, make a tag for your main branch with the syntax
vX.Y.Z
then push it to origin. This will start a Github Action which will produce a build, that will then be attached to a release of that same version number. NOTE: You can make this automatic by editing the package.json file and changing theskip
booleans oncommit
andtag
to true. Then when you usenpm run release
it will also automatically sign, create the tag, and commit it. All you'll need to do then is push it. (Disclaimer: I don't do this so it may not work 100%. Feel free to update this documentation if you desire.)
npm run devexport
will clean your build folders, then create a build for you to distribute to testers at/dist/your-module-name.zip
. The script moves your files into a folder calledyour-module-name
for easy extraction into Foundry's modules folder.
This should work on any system but since it makes changes to the filesystem with npm run devexport
(creating/deleting a folder) use at your own risk.