All user data for FoundryVTT. Includes worlds, systems, modules, and any asset in the "foundryuserdata" directory. Does NOT include the FoundryVTT installation itself.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
3.0 KiB

1 year ago
  1. # 1. Contributing to libWrapper
  2. - [1. Contributing to libWrapper](#1-contributing-to-libwrapper)
  3. - [1.1. Installation](#11-installation)
  4. - [1.2. Test Suite](#12-test-suite)
  5. - [1.3. Generating a Release Artifact](#13-generating-a-release-artifact)
  6. - [1.4. Pull Requests](#14-pull-requests)
  7. ## 1.1. Installation
  8. You should clone this repository and symlink it inside Foundry VTT's `Data/modules` folder, then restart the server.
  9. - After cloning this repository, you will need to install NPM and then run the following console commands to set up the development environment:
  10. ```bash
  11. npm install
  12. npm run build
  13. ```
  14. These will install the NPM dependencies required for module development, and compile [less/lib-wrapper.less](less/lib-wrapper.less) into `dist/lib-wrapper.css`.
  15. ## 1.2. Test Suite
  16. The script contains a basic test suite in [tests](tests) which can be used to validate various usage cases and library behaviour. This can be run by doing `npm test`.
  17. - ⚠ While this test suite does test a significant amount of the library functionality, it does not achieve full coverage. It is always recommended to test the library with some real-world modules and confirm that they are working as expected.
  18. - The wiki list of [Modules using libWrapper](https://github.com/ruipin/fvtt-lib-wrapper/wiki/Modules-using-libWrapper) can be used as a source of modules for testing.
  19. ## 1.3. Generating a Release Artifact
  20. To generate a release artifact, you should use the command `npm run build`.
  21. - The JS code in [src](src) will be rolled up into a single file and minified automatically, with the corresponding sourcemap also generated. The results of this process are stored in `dist/lib-wrapper.js` and `dist/lib-wrapper.js.map`.
  22. - For ease of development, by default the module manifest points to the unprocessed [src/index.js](src/index.js) such that source code changes are immediately visible.
  23. - To use the output of the `npm run build` command, you will need to locally update your local [module.json](module.json) to point to `dist/lib-wrapper.js` instead of [src/index.js](src/index.js).
  24. - The LESS stylesheet [less/lib-wrapper.less](less/lib-wrapper.less) will be compiled into `dist/lib-wrapper.css`.
  25. - Note that the actual [release artifacts](https://github.com/ruipin/fvtt-lib-wrapper/releases) on Github are generated using a custom Github Action, which is responsible for updating the module manifest and packaging the build output into a ZIP file.
  26. This is implemented in [.github/workflows/release.yml](.github/workflows/release.yml).
  27. ## 1.4. Pull Requests
  28. I am happy to receive pull requests and other contributions, although I might not have the time to look at them immediately.
  29. Before submitting a pull request, please ensure the test suite passes. It is also a good idea to open an issue in the issue tracker before doing any work, and discuss your plans.
  30. The issue tracker will contain various feature requests, and contributions for those is particularly welcome.