If you would like to contribute to the project then I welcome any contributions. There are plenty of things to work on, so fork the repository and start submitting pull requests!!!
In order to setup your development environment, we need to ensure that a few things are in place:
- You'll need
node
installed on your system. You will need a version ofnode
that is at least 12.x or greater. To install it, go to https://nodejs.org/en/download/ and choose an installer for your operating system. The current LTS is probably a good choice, though the current version works just as well. - This system uses
gulp
to processless
into usablecss
as well as some other utilities. You will need to installgulp
for this purpose. To install, open up your prefered command line tool and enter the following commandnpm install --global gulp-cli
. This will install thegulp
command line utilities globally. - You'll also need a
git
client installed. Whether that is the command line tool or something like Sourcetree or GitKraken is up to you.
With those things installed, we can work on getting the repository ready for development. The preferred method for contributing to the repository is through the typical "Pull Request" methodology. To get started, you'll need to fork the foundryvtt-starfinder repository. Once you've forked the repository, you can clone that repo to your local machine. When you are making changes, it is recommended that you create a new branch for this purpose, based off of the development branch. Once you've pushed your changes back to your forked repository, you can then create a pull request from there.
Once you've cloned the repository to your local machine, follow these steps to get your development environment going:
- Install the development dependencies by running the following command:
npm install
- Configure a
foundryconfig.json
file in the root folder of the project with adataPath
property. And example can be found in thefoundryconfig.example.json
file provided in the project. Just copy the file and rename it tofoundryconfig.json
and change thedataPath
. ThedataPath
property is the file path to your Foundry installs user data. This can be found on the Configuration tab on the Setup screen. - Run
npm run build
. This will compile all of theless
and copy all of the necessary files to adist
folder in the project root. It will also create a symbolic link to this new folder with your Foundry installs user data path. - Run
npm run build:watch
while your developing so that changes are automatically synced with thedist
folder. When you make changes tohtml
,css
, orjavascript
files, you'll need to do a page refresh in foundry to pick up the changes (F5). Any changes totemplate.json
orsystem.json
require you to return to the Setup screen and then reload the world.
This should be all you need to help contribute. If you have any issues, you can reach out to me on the Foundry discord.
If you want to do data entry for the project, we have a version control friendly way of managing the compendium data.
Please be aware that this process relies on you having completed the previously mentioned setup steps.
Inside the src/items
folder, you will find a subfolder for each compendium we have. Within these subfolders you will find a json file for each entry.
The easiest workflow is to work through Foundry, and follow the following steps:
- Create a new item in the Items sidebar tab.
- Fill out the details, modifiers, etc.
- Right-clicking the item in the Items sidebar tab and select Export Data.
- Save the JSON file into the appropriate compendium subfolder.
- Open the exported JSON file in a text editor of your choice, and do some clean-up.
- Remove the ID field.
- Remove the permission field, if it is there.
- Remove the sort field, if it is there.
- Remove the exportSource section from the flags field, if it is there.
- Save and close the JSON file.
- Update the compendium pack files, by running the following command:
npm run cook
- Restart Foundry.
- Check in Foundry if the compendium is updated properly.
- Submit pull request if everything's great. :-)
An alternative workflow, for the more tech-savvy people, would be to skip step 1-4, simply duplicate an existing JSON file, editing it, and then continuing from step 5.
The easiest workflow is to work through Foundry, and follow the following steps:
- Create a new item in the Items sidebar tab.
- Right-clicking the item in the Items sidebar tab and select Import Data.
- Import the JSON file for the item you wish to make changes to.
- Make the changes you want to make, details, modifiers, etc.
- Right-clicking the item in the Items sidebar tab and select Export Data.
- Save the JSON file into the appropriate compendium subfolder.
- Open the exported JSON file in a text editor of your choice, and do some clean-up.
- Revert the ID field, set it to the old value.
- Remove the permission field, if it is there.
- Remove the sort field, if it is there.
- Remove the exportSource section from the flags field, if it is there.
- Update the compendium pack files, by running the following command:
npm run cook
- Restart Foundry.
- Check in Foundry if the compendium is updated properly.
- Submit pull request if everything's great. :-)
Alternatively, you can make edits directly to the json files and save the file, and then continue the workflow from step 7.
BE CAREFUL
Do NOT alter already existing IDs! Editing the ID field will break existing links to the item. ID field edits will get rejected when you submit your Pull Request!
Sometimes, an item is in the wrong place, is duplicate, erroneous, or there is another reason as to why it should be deleted. Because it is possible to link to items, care must be taken not to break references unnecessarily. There is no Foundry workflow for this, and this is going to get a little more technical.
- Open the item JSON file you wish to delete.
- Copy the ID field value, e.g.
MkyvEJGsciB2FCD2
- Search the entire
src/items
directory for files containing that ID.- If no results are found, no-one was referencing this item directly, and you can safely delete the JSON file.
- If results are found, you will have to remove all references to the item from the referencing items.
- Update the compendium pack files, by running the following command:
npm run cook
- Restart Foundry.
- Check in Foundry if the compendium is updated properly.
- Submit pull request if everything's great. :-)