CHANGELOGS & CONFLICTS
December 17, 2021 ยท View on GitHub
Before opening an issue read THIS
Show changelogs of modules in a non intrusive way.
Why?
Module developers have no way of issuing changelogs or important warnings in a clean and streamlined way. This module adds a non intrusive way for users to get important informations. What is more, a lot of times users need to rely on discord to know if modules conflict with each other. Changelogs & Conflicts will also warn users of potential conflicts and display the suggested curse of action provided by the developer (for example, you might just need to disable a setting in one of the modules for things to work).
How does it work?
You can chose the level of importance you want to see

With four options

Once you close the window you will not get notified again for the current version of the module

If you accidentaly closed a popup and want to check all your changelogs just click the show all changelogs button in Changelogs settings

You will be reminded of conflicts here as well

All
Any changelog and warning will be shown
Major
Only updates with new features (and above) will be shown
Breaking
Only updates with breaking changes (and above) will be shown
Critical
Only for emergencies, this is for module developers to issue critical messages
Color Codes
- Purple: Critical
- Red: Breaking
- Yellow: Major
- Blue: Minor
Community Conflicts
If you are aware of a conflict you can send a Pull Request and add that conflict registration to communityConflicts.js following the instructions provided below!
How to include changelogs in your module:
Including a changelog is very simple, just call the libChangelogs.register() in the libChangelogsReady hook. Since changelogs is registered on a custom hook you don't need to check if the module is active before you register your changelog nor add it as a dependency
/**
* @param {string} moduleId The package identifier, i.e. the 'id' field in your module/system/world's manifest.json
* @param {string} markdown The text in markdown language to be inserted into the changelog
* @param {string} warnLevel The level of warning to be displayed.
*
* The possible types are:
*
* - critical:
* Only use for emergencies, something went wrong or the update requires immidiate action from the user. This warning level CANNOT be disable by the user
* - breaking:
* A breaking change that requires action from the user but will not cause issues if left unattended (eg. a new feature that requires some manual configuration changes).
* - major:
* One or more Major features have been added to the module, let the user know what they do or link to other resources.
* - minor:
* Minor bugfixes or changes that won't impact the user experience with your module (this is the default option).
* **/
libChangelogs.register(moduleId, markdown, warnLevel="minor")
Example
Hooks.once('libChangelogsReady', function() {
libChangelogs.register("yourmoduleid","THIS UPDATE BREAKS EVERYTHING","critical")
})

How to include conflicts in your module:
Including a conflict is very simple, just call the libChangelogs.registerConflict() in the libChangelogsReady hook. Since changelogs is registered on a custom hook you don't need to check if the module is active before you register your conflict nor add it as a dependency. You can register multiple conflicts with separate libChangelogs.registerConflict() calls.
/**
* @param {string} moduleId The package identifier, i.e. the 'id' field in your module/system/world's manifest.json
* @param {string} conflictingModule The package identifier, i.e. the 'id' field of the conflicting module.
* @param {string} markdown The text in markdown language to be displayed for the conflict.
* @param {string} warnLevel The level of warning to be displayed.
*
* The possible types are:
*
* - critical:
* Using both modules together will make foundry unusable.
* - breaking:
* User will experience issues that can make foundry unusable under specific circumstances if the conflicting module is enabled.
* - major:
* Features will not work as expected if the conflicting module is enabled.
* - minor:
* User will experience minor issues, such as UI bugs or minor features not working - the user might need to disable some features from your or the conflicting module for things to work correctly.
* **/
libChangelogs.registerConflict(moduleId, conflictingModule, markdown, warnLevel)
Example
Hooks.once('libChangelogsReady', function() {
libChangelogs.registerConflict("yourmoduleid", "conflictingmoduleid","Enabling both modules will cause foundry to not function","critical")
})
Libraries
This module uses https://github.com/showdownjs/showdown for markdown parsing