Package Exports
- @ghost-fvtt/foundry-factory
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ghost-fvtt/foundry-factory) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Foundry Factory
Foundry Factory is an interactive CLI tool that developers can use to bootstrap modules and systems for Foundry Virtual Tabletop. It allows developers to choose among different presets to initialize their projects (currently only one preset based on Gulp and Rollup is available).
It is designed to be extendable so that adding additional presets is quite easy.
Usage
Usage: foundry-factory [options] <project-directory>
Options:
-v, --version Show the version number of Foundry Factory
-t, --type <type> Create a project of this type (choices: "module",
"system")
-p, --preset <preset> Use this preset (choices: "gulp-rollup")
-d, --default Use the default preset (default: false)
-n, --no-config Skip the configuration prompts of the selected preset
and use its default configuration
-f, --force Overwrite target directory if it exists (default:
false)
--no-deps Skip installing project dependencies
--no-git Skip git initialization
-h, --help display help for commandPresets
Here is a list of available presets with links to their individual documentation:
Development
Prerequisites
In order to build this project, recent versions of node and npm are
required. Most likely using yarn also works but only npm is officially
supported. We recommend using the latest lts version of node, which is
v14.15.5 at the time of writing. If you use nvm to manage your node
versions, you can simply run
nvm installin the project's root directory.
You also need to install the the project's dependencies. To do so, run
npm installBuilding
You can build the project by running
npm run buildAlternatively, you can run
npm run build:watchto watch for changes and automatically build as necessary.
Running the tests
You can run the tests with the following command:
npm testContributing
Contributions vie pull requests are very welcome. If you find any issues, please report them in the issue tracker.
Creating new presets
Foundry Factory is designed to be easily extendable, so adding new presets should be pretty straight forward. In order to create a new preset, there are a couple of things you need to do:
- Add a new folder for your preset in the
src/presetsdirectory. - In that folder, create a class which implements the
Presetinterface and has the methods of thePresetConstructorinterface as static methods.- The
getProgrammaticFilesmethod returns a mapping between files to create and the contents (asstring) to write them. - The
getTemplateFilesmethod returns a mapping between files to create and Nunjucks template files used to render them. - The
getTemplateVariablesreturns a record of additional template variables to pass to the Nunjucks templates. - The
getAdditionalDirectoriesreturns a list of additional directories to create. - The
getDependenciesmethod returns a list of dependencies to install. - The
getDevDependenciesmethod returns a list of development dependencies to install. - The
getPostInstallationCommandsmethod returns a list of shell commands to run after the rest of the installation has completed.
- The
- If your preset does not need some of these features, simply return an empty list or object, depending on the method.
- Add your preset to the
presetsconstant insrc/presets/presets.ts. - Optionally, create a folder for your preset in the
templatedirectory, containing any Nunjucks templates you want to render. In order to render them, you need to return paths to them (relative to thetemplatedirectory) from thegetTemplateFilesmethod of your class.
Licensing
This software project is licensed under the MIT License, a copy of which can be found under LICENSE.
Acknowledgement
While this is not a fork of Foundry Project Creator, a lot of inspiration was taken from it. You could think if it more as a rewrite with a couple of different design goals.
Credit for the name "Foundry Factory" goes to BadIdeasBureau.