Skip to content

Commit

Permalink
v1.12.8.0: Get rid of v10 package 'data' deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ruipin committed Sep 4, 2022
1 parent 5cedb47 commit e2864f7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions 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.
Expand Down
2 changes: 1 addition & 1 deletion module.json
Expand Up @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions shim/shim.js
Expand Up @@ -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');

Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/shared
Submodule shared updated 1 files
+5 −2 package_info.js

0 comments on commit e2864f7

Please sign in to comment.