From e2864f7c1bfda871e57378899d4074b5328f0784 Mon Sep 17 00:00:00 2001 From: Rui Pinheiro Date: Sun, 4 Sep 2022 18:25:00 +0100 Subject: [PATCH] v1.12.8.0: Get rid of v10 package 'data' deprecation warnings --- CHANGELOG.md | 6 ++++++ module.json | 2 +- shim/shim.js | 7 ++++--- src/shared | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 262660e..2faf777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.12.8.0 (2022-09-04) + +- Get rid of FVTT v10 deprecation warnings caused by legacy style package 'data' accesses. + - Shim updated to v1.12.2 to also get rid of these warnings when libWrapper is not installed. + - Closes [Issue #71](https://github.com/ruipin/fvtt-lib-wrapper/issues/71). Thanks to wickermoon for the issue report and fix proposal! + # 1.12.7.2 (2022-09-02) - Add `authors` key to the module manifest to avoid compatibility warnings in FVTT v10. diff --git a/module.json b/module.json index 7658dc5..827a47e 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "name": "lib-wrapper", "title": "libWrapper", "description": "Library for wrapping core Foundry VTT methods, meant to improve compatibility between packages that wrap the same methods.", - "version": "1.12.7.2", + "version": "1.12.8.0", "author": "Rui Pinheiro", "authors": [{ "name": "Rui Pinheiro", diff --git a/shim/shim.js b/shim/shim.js index 3f62694..863eda6 100644 --- a/shim/shim.js +++ b/shim/shim.js @@ -7,7 +7,7 @@ // A shim for the libWrapper library export let libWrapper = undefined; -export const VERSIONS = [1,12,1]; +export const VERSIONS = [1,12,2]; export const TGT_SPLIT_RE = new RegExp("([^.[]+|\\[('([^'\\\\]|\\\\.)+?'|\"([^\"\\\\]|\\\\.)+?\")\\])", 'g'); export const TGT_CLEANUP_RE = new RegExp("(^\\['|'\\]$|^\\[\"|\"\\]$)", 'g'); @@ -90,9 +90,10 @@ Hooks.once('init', () => { if(match?.length !== 3) return [null,null]; const dirs = match[2].split('/'); if(match[1] === 'worlds') return dirs.find(n => n && game.world.id === n) ? [game.world.id, game.world.title] : [null,null]; - if(match[1] === 'systems') return dirs.find(n => n && game.system.id === n) ? [game.system.id, game.system.data.title] : [null,null]; + if(match[1] === 'systems') return dirs.find(n => n && game.system.id === n) ? [game.system.id, game.system.title ?? game.system.data.title] : [null,null]; const id = dirs.find(n => n && game.modules.has(n)); - return [id, game.modules.get(id)?.data?.title]; + const mdl = game.modules.get(id); + return [id, mdl?.title ?? mdl?.data?.title]; })(); if(!PACKAGE_ID || !PACKAGE_TITLE) { diff --git a/src/shared b/src/shared index ae73127..7c839b5 160000 --- a/src/shared +++ b/src/shared @@ -1 +1 @@ -Subproject commit ae73127469912cc23bc6ab8774d5f94660dc26f4 +Subproject commit 7c839b5310f8184707f654affbd54f866f3c3b2b