Fix building with new vtt types

This commit is contained in:
Johannes Loher 2021-08-19 04:01:55 +02:00
parent 6d5e3b949a
commit 15c74e995a
3 changed files with 15 additions and 9 deletions

View file

@ -49,6 +49,7 @@
"test:watch": "jest --watch",
"test:ci": "jest --ci --reporters=default --reporters=jest-junit",
"format": "prettier --write \"./**/*.(ts|js|json|scss)\"",
"typecheck": "tsc --noEmit",
"postinstall": "husky install"
},
"devDependencies": {

View file

@ -55,7 +55,9 @@ export async function migrateScenes(getSceneUpdateData: SceneUpdateDataGetter):
const updateData = getSceneUpdateData(scene.data);
if (updateData) {
logger.info(`Migrating Scene document ${scene.name} (${scene.id})`);
await scene.update(updateData);
await scene.update(
updateData as DeepPartial<Parameters<foundry.data.SceneData["_initializeSource"]>[0]>,
);
}
} catch (err) {
err.message = `Error during migration of Scene document ${scene.name} (${scene.id}), continuing anyways.`;
@ -94,7 +96,7 @@ export function getActorUpdateDataGetter(getItemUpdateData: ItemUpdateDataGetter
export function getSceneUpdateDataGetter(getActorUpdateData: ActorUpdateDataGetter): SceneUpdateDataGetter {
return (sceneData: foundry.documents.BaseScene["data"]) => {
const tokens = (sceneData.tokens as Collection<TokenDocument>).map((token: TokenDocument) => {
const tokens = sceneData.tokens.map((token: TokenDocument) => {
const t = token.toObject();
if (!t.actorId || t.actorLink) {
t.actorData = {};
@ -162,7 +164,10 @@ export function getCompendiumMigrator(
updateData && (await doc.update(updateData));
} else if (doc instanceof Scene && getSceneUpdateData) {
const updateData = getSceneUpdateData(doc.data);
updateData && (await doc.update(updateData));
updateData &&
(await doc.update(
updateData as DeepPartial<Parameters<foundry.data.SceneData["_initializeSource"]>[0]>,
));
}
} catch (err) {
err.message = `Error during migration of document ${doc.name} (${doc.id}) in compendium ${compendium.collection}, continuing anyways.`;

View file

@ -2930,9 +2930,9 @@ __metadata:
linkType: hard
"earcut@npm:^2.1.5":
version: 2.2.2
resolution: "earcut@npm:2.2.2"
checksum: 030e091437c4fae34c4538e0886a1d7c68f67c3ec3ba793210b280df24b329221ed81179e300742abf7aa2c394332a77395133c5163717b1806cebab6aa6c88c
version: 2.2.3
resolution: "earcut@npm:2.2.3"
checksum: 0aee2e9ab069f93518d20583f4bcf18ea5ba47bcab7147f790394814cdf7820b6b6d80fc9428348b21229dbf564b46f9c70cffa6b72e08c468aa4bfacba20fa9
languageName: node
linkType: hard
@ -8101,11 +8101,11 @@ fsevents@^1.2.7:
linkType: hard
"uglify-js@npm:^3.1.4":
version: 3.13.10
resolution: "uglify-js@npm:3.13.10"
version: 3.14.1
resolution: "uglify-js@npm:3.14.1"
bin:
uglifyjs: bin/uglifyjs
checksum: 2c8467faf68a0ba4da7a9539026dc996804f0e89f184ce0a6ceaa9a9c7e4e2ab78399caee8ebbebcd3df64a45b049585c4125e144f1c5992f9b61e81864d9535
checksum: 7f8292e9555c7ae9636407c11e76df53232f03783770ec8d920daa20f69f1e820802212685fce4d8a5da1473643a1c0578c34a5c0784c688127fcb83cd592578
languageName: node
linkType: hard