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

create-foundry-project

v1.5.1

Published

A tool to create a starter project for Foundry VTT modules and systems

Downloads

5

Readme

Foundry Project Creator

The Foundry Project Creator is a tool that developers can use to create modules and systems for the Foundry Virtual Tabletop software. It is designed to provide a (partially opinionated) boilerplate project and a set of scripts to quickly get started.

The CLI only creates the boilerplate project. It will by default install several development dependencies in order to use Gulp, which automates the most frequently-used tasks. When using TypeScript, it will also install the following:

  • Type definitions: Contains type definitions for the Foundry API, useful for autocomplete and Intellisense in both vanilla JavaScript and TypeScript.

Note: The above package is not published to the npm registry but is installed from its repository directly. As such, it can only be updated by reinstalling the package directly. In projects created with the CLI, run npm run update to quickly update the type definitions. You should remove this script if you uninstall the package, or add it if you install it manually.

See the wiki for more information on what the CLI does.

Usage

You can easily use the tool without installing by executing the following:

npx create-foundry-project <project-directory> [options]

If you cannot use npx, the classic method is to install the package globally

npm install -g create-foundry-project

and then execute it:

foundry <project-directory> [options]

Options

The tool accepts the following options:

  • -s, --system: Creates a system rather than a module.
  • -t, --typescript: Configures the project to use TypeScript instead of regular JavaScript.
  • --css <preprocessor>: Configures the project to use a CSS preprocessor (less or sass).
  • -f, --force: Forces the tool to clean and use an existing directory (WARNING: all files inside the directory will be deleted).
  • --no-deps: Skip installing the dependencies. Useful if you prefer to handle these things yourself. This will also not set up Gulp.
  • --no-git: Skip initializing a Git repository.

Setup

Once set up, there may be a few things you might want to check. Specifically, the manifest file (either system.json or module.json) contains a set of properties that Foundry uses. When using the CLI, it adds all valid properties for systems or modules, and you should remove any you don't use. Check the Foundry documentation on module development for information about each property.

Gulp

Projects created with the CLI will by default include a gulpfile as well as any dev dependency required by it. These scripts have replaced a separate scripts package to automate a number of tasks:

  • Build: To build TypeScript, Less and/or SASS, and copy JSON, fonts, and templates to the dist folder.
  • Link: To create a symbolic link to the build in the configured User Data folder for testing in Foundry.
  • Watch: To watch for any changes and rebuild the module.
  • Clean: To quickly clean the dist folder.
  • Package: To quickly package the build for testing or manual distribution.
  • Publish: To simplify releasing a module by updating the manifest, packaging, and tagging a release.

See the wiki for more information about how to use it.

Even if you are not using the CLI, you may find these tasks useful. You can copy the gulpfile, or derive from it, and use it in your own projects if you wish. Make sure you install the dev dependencies by running the following:

npm install --save-dev node-sass typescript fs-extra chalk archiver yargs json-stringify-pretty-compact gulp gulp-typescript gulp-less gulp-sass gulp-git