# Module Development

## Information

- [Foundry Documentation](https://foundryvtt.com/kb/)
- [Foundry API Documentation](https://foundryvtt.com/api/)
- [PF1 API Documentation](https://foundryvtt_pathfinder1e.gitlab.io/foundryvtt-pathfinder1/)

  ⚠️ This is generated from latest development version, not latest release.

- [System Contribution Guide](../../CONTRIBUTING.MD)

  May have useful information.

## System Typings

To get the system typings into your project, the following steps should

1. Clone the system git repository with your favorite tools
   - If you want to develop for specific version, you could clone specific version's branch.
2. Symlink the system project folder under your own module project
3. Edit your `jsconfig.json` or `tsconfig.json`

   ```json
   {
     "references": [{ "path": "./pf1/" }],
     "include": ["pf1/**/*.mjs", "pf1/**/*.d.ts"],
     "exclude": ["pf1/dist/", "pf1/foundry/", "pf1/node_modules/"]
   }
   ```

This will allow your project to see the system typings, for example how `pf1.utils.CR.fromString()` works without needing to read the online API docs or generating them yourself locally.

## Module Setup

If the module does not support other systems, or only subset of them, ensure you have something like the following in your `module.json`.

```json
"relationships": {
  "systems": [
    {
      "id": "pf1",
      "compatibility": { "minimum": "11.8","verified": "11.9" }
    }
  ],
}
```

This makes sure your module can not be enabled for systems you don't support.
