Direct downloads look at the ` zip`

Direct downloads (look at the .zip): https://tooomm.github.io/github-release-stats/?username=Gwillewyn&repository=dnd-item-icons-by-gwill Forge install percentage https://www.foundryvtt-hub.com/package/dnd-item-icons-by-gwill/ When looking at direct downloads (through Foundry package manager mostly) look at the zip link. The Forge caches packages, so the percentage install is a rough number w/ an unknown max. With the numbers you have it may just be easiest to update the links / package and put out an explanation. If you had some chops on the coding side it's definitely possible to provide migration, but you need to weigh that against the install base as well. Being a free package also determines the amount of support you provide.
6 Replies
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Wasp
Wasp•2y ago
The best way would be to create a migration for your users that would automatically update things for them. Not perfect, but will get people 90% there. I can send some code examples tomorrow!
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Wasp
Wasp•2y ago
Alright, so here's what I do in Sequencer - this function is run on ready, which sorts through my custom migrations and only runs the ones that are newer than the stored migration:
export default async function runMigrations() {
const currentMigrationVersion = game.settings.get("sequencer", "migration-version");
const sortedMigrations = Object.entries(migrations).sort((a, b) => {
return isNewerVersion(b[0], a[0]) ? -1 : 1;
}).filter(([version]) => isNewerVersion(version, currentMigrationVersion));

for (const [version, migration] of sortedMigrations) {
try {
await migration(version);
await game.settings.set("sequencer", "migration-version", version);
} catch (err) {
custom_warning(
"Sequencer",
`Something went wrong when migrating to version ${version}. Please check the console for the error!`,
true
);
console.error(err);
break;
}
}
}
export default async function runMigrations() {
const currentMigrationVersion = game.settings.get("sequencer", "migration-version");
const sortedMigrations = Object.entries(migrations).sort((a, b) => {
return isNewerVersion(b[0], a[0]) ? -1 : 1;
}).filter(([version]) => isNewerVersion(version, currentMigrationVersion));

for (const [version, migration] of sortedMigrations) {
try {
await migration(version);
await game.settings.set("sequencer", "migration-version", version);
} catch (err) {
custom_warning(
"Sequencer",
`Something went wrong when migrating to version ${version}. Please check the console for the error!`,
true
);
console.error(err);
break;
}
}
}
In this case, migrations is an object that looks like this:
const migrations = {
"1.0.0": async (version) => {
// do the thing that this migration needs to do, which only happens once, and only if it needs to happen
}
};
const migrations = {
"1.0.0": async (version) => {
// do the thing that this migration needs to do, which only happens once, and only if it needs to happen
}
};
I hope this makes sense 😄
TyphonJS (Michael)
TyphonJS (Michael)OP•2y ago
This definitely is the right path for controlling migration execution. This is also good when there are multiple expected migrations to potentially happen in future versions. In this case it may be a one time migration. I think @gwillewyn will have a challenge figuring out what to put in the actual migration function. If I understand things correctly this is an art asset package and the assets could be assigned in many different document types and locations potentially. Potentially scanning all / most document types to update any content links will be a demanding operation. You have to be very careful in general not to muck up anything that shouldn't be changed. I'm still leaning toward just bitting the bullet. Putting out a notification to any users. Explain the situation and put all your effort into making sure the updated package is indeed formatted in the way that you expect to organize things in a more permanent manner. Basically, creating effective migration code can be hard and error prone without a strong technical background in addition to Foundry dev knowledge and even more could potentially go wrong w/ incorrect migration code.
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server