npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ghost-fvtt/foundry-factory

v1.4.3

Published

An interactive command line tool to bootstrap modules and systems for Foundry Virtual Tabletop

Downloads

63

Readme

Foundry Factory

Checks npm downloads REUSE status Ko-fi

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.

It is designed to be extendable so that adding additional presets is quite easy.

Foundry Factory Demo

Usage

In order to Foundry Factory, a recent version of Node.js 14 or higher is required. You can run it with npx:

npx @ghost-fvtt/foundry-factory <project-directory>

Alternatively you can install it globally and then execute it:

npm install -g @ghost-fvtt/foundry-factory
foundry-factory <project-directory>

Command Line Options

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: "ghost-gulp-rollup", "league-js")
  -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
  -m, --packageManager <packageManager>  Use the specified npm client when installing dependencies (choices: "npm", "yarn", "yarn2", default: "npm")
  -h, --help                             display help for command

Presets

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. If you use nvm or fnm to manage your node versions, you can simply run

nvm install

or

fnm install

in the project's root directory.

You also need to install the project's dependencies. To do so, run

npm install

Building

You can build the project by running

npm run build

Alternatively, you can run

npm run build:watch

to watch for changes and automatically build as necessary.

Running the tests

You can run the tests with the following command:

npm test

Contributing

Contributions via 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/presets directory.
  • In that folder, create a class which implements the Preset interface and has the methods of the PresetConstructor interface as static methods.
    • The getProgrammaticFiles method returns a mapping between files to create and the contents (as string) to write them.
    • The getTemplateFiles method returns a mapping between files to create and Nunjucks template files used to render them.
    • The getTemplateVariables returns a record of additional template variables to pass to the Nunjucks templates.
    • The getAdditionalDirectories returns a list of additional directories to create.
    • The getDependencies method returns a list of dependencies to install.
    • The getDevDependencies method returns a list of development dependencies to install.
    • The getPostInstallationCommands method returns a list of shell commands to run after the rest of the installation has completed. Make sure that they work on both Unix-like systems and Windows.
  • If your preset does not need some of these features, simply omit the corresponding methods. Except for the static methods, all of them are optional.
  • Add your preset to the presets constant in src/presets/presets.ts.
  • Optionally, create a folder for your preset in the template directory, containing any Nunjucks templates you want to render. In order to render them, you need to return paths to them (relative to the template directory) from the getTemplateFiles method of your class.

Licensing

This project uses REUSE to specify the used licenses. Currently, everything is licensed under the MIT license. More information (including the copyright holders) can be found in the individual files.

Acknowledgment

While this is not a fork of Foundry Project Creator, a lot of inspiration was taken from it. You could think of it more as a rewrite with a couple of different design goals.

Credit for the name "Foundry Factory" goes to BadIdeasBureau.