Skip to content

Commit

Permalink
Merge pull request #386 from fvtt-fria-ligan/12-18-chore_deps_Audit_deps
Browse files Browse the repository at this point in the history
chore(deps): 🔗 Audit deps
  • Loading branch information
aMediocreDad authored Dec 18, 2023
2 parents 37abc34 + be0da9b commit 1469308
Show file tree
Hide file tree
Showing 21 changed files with 229 additions and 263 deletions.
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.2.2/schema.json",
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"organizeImports": {
"enabled": false
},
Expand All @@ -16,6 +16,7 @@
},
"complexity": {
"noStaticOnlyClass": "off",
"noThisInStatic": "off",
"useLiteralKeys": "off"
}
}
Expand Down
Binary file modified bun.lockb
Binary file not shown.
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,25 @@
},
"devDependencies": {
"@arkweid/lefthook": "0.7.7",
"@biomejs/biome": "1.3.3",
"@changesets/changelog-github": "0.4.8",
"@changesets/cli": "2.26.2",
"@types/jquery": "3.5.27",
"@types/node": "20.9.0",
"@types/showdown": "2.0.4",
"bun": "1.0.13",
"@biomejs/biome": "1.4.1",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@types/jquery": "3.5.29",
"@types/node": "20.10.5",
"@types/showdown": "2.0.6",
"bun": "1.0.18",
"bun-types": "1.0.18-1",
"devmoji": "2.3.0",
"esbuild": "0.19.5",
"esbuild": "0.19.9",
"esbuild-sass-plugin": "2.16.0",
"execa": "8.0.1",
"globby": "14.0.0",
"gluegun": "5.1.6",
"typescript": "5.2.2"
"typescript": "5.3.3"
},
"workspaces": {
"packages": ["types/foundry"]
"packages": [
"types/foundry"
]
}
}
6 changes: 4 additions & 2 deletions src/actor/party/components/character-picker-dialog.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const noop = () => {};

export class CharacterPickerDialog extends Dialog {
/**
* Show dialog that allows to pick a character from a list
*
*/
static async show(title, characters, onSelect, onCancel) {
onSelect = onSelect || function () {};
onCancel = onCancel || function () {};
onSelect = onSelect || noop;
onCancel = onCancel || noop;

const characterSelector = await this.buildCharacterSelector(characters);

Expand Down
2 changes: 1 addition & 1 deletion src/actor/party/components/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class Helpers {
character = character instanceof Actor ? character : game.user.character;
if (!character) return;

let charSheetClass = function () {};
let charSheetClass = () => {};
for (const chName in CONFIG.Actor.sheetClasses.character) {
if (chName === "forbidden-lands.ForbiddenLandsCharacterSheet") {
charSheetClass = CONFIG.Actor.sheetClasses.character[chName].cls;
Expand Down
26 changes: 13 additions & 13 deletions src/actor/party/components/travel-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function handleTravelAction(assignedPartyMemberIds, rollName) {
CharacterPickerDialog.show(
`${localizeString("FLPS.UI.WHO_ROLLS")} ${localizeString(rollName)}`,
assignedPartyMembers,
function (entityId) {
(entityId) => {
rollTravelAction(game.actors.get(entityId), rollName);
},
);
Expand All @@ -46,7 +46,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.FORCED_MARCH",
class: "travel-forced-march",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.hike,
"travel-forced-march",
Expand All @@ -56,7 +56,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.HIKE_IN_DARKNESS",
class: "travel-hike-in-darkness",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.hike,
"travel-hike-in-darkness",
Expand All @@ -73,7 +73,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.NAVIGATE",
class: "travel-navigate",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.lead,
"travel-navigate",
Expand All @@ -90,7 +90,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.KEEP_WATCH",
class: "travel-keep-watch",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.watch,
"travel-keep-watch",
Expand All @@ -107,7 +107,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.MAKE_CAMP",
class: "travel-make-camp",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.camp,
"travel-make-camp",
Expand All @@ -124,7 +124,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL.REST",
class: "travel-rest",
handler: function (party) {
handler: (party) => {
handleTravelAction(party.actorProperties.travel.rest, "rest");
},
},
Expand All @@ -138,14 +138,14 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL.REST",
class: "travel-sleep",
handler: function (party) {
handler: (party) => {
handleTravelAction(party.actorProperties.travel.sleep, "rest");
},
},
{
name: "FLPS.TRAVEL_ROLL.FIND_GOOD_PLACE",
class: "travel-find-good-place",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.sleep,
"travel-find-good-place",
Expand All @@ -168,7 +168,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.FIND_FOOD",
class: "travel-find-food",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.forage,
"travel-find-food",
Expand All @@ -185,7 +185,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.FIND_PREY",
class: "travel-find-prey",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.hunt,
"travel-find-prey",
Expand All @@ -195,7 +195,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.KILL_PREY",
class: "travel-kill-prey",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.hunt,
"travel-kill-prey",
Expand All @@ -212,7 +212,7 @@ export const TravelActionsConfig = {
{
name: "FLPS.TRAVEL_ROLL.CATCH_FISH",
class: "travel-catch-fish",
handler: function (party) {
handler: (party) => {
handleTravelAction(
party.actorProperties.travel.fish,
"travel-catch-fish",
Expand Down
8 changes: 4 additions & 4 deletions src/components/macros/macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ async function handleWeaponMacro(actor, item) {
rejectClose: true,
})
: item.type === "armor"
? "armor"
: "gear";
? "armor"
: "gear";
const command =
type === "gear"
? `game.actors.get("${actor.id}").sheet.rollGear("${item._id}")`
: type === "armor"
? `game.actors.get("${actor.id}").sheet.rollSpecificArmor("${item._id}")`
: `game.actors.get("${actor.id}").sheet.rollAction("${type}","${item._id}")`;
? `game.actors.get("${actor.id}").sheet.rollSpecificArmor("${item._id}")`
: `game.actors.get("${actor.id}").sheet.rollAction("${type}","${item._id}")`;
/* eslint-enable no-nested-ternary */
// eslint-disable-next-line no-shadow
const name =
Expand Down
2 changes: 1 addition & 1 deletion src/components/message-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const isCurrent = (msg) => {
const hasDisplayed = (identifier) => {
const settings = game.settings.get("forbidden-lands", "messages");
if (settings?.includes(identifier)) return true;
else return false;
return false;
};

const displayPrompt = (title, content) => {
Expand Down
5 changes: 2 additions & 3 deletions src/components/roll-engine/dice-labels.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export function registerYZURLabels() {
CONFIG.YZUR.Icons.getLabel = function (type, result) {
return `<img src="systems/forbidden-lands/assets/dice/${type}-${result}.png" alt="${result}" title="${result}" />`;
};
CONFIG.YZUR.Icons.getLabel = (type, result) =>
`<img src="systems/forbidden-lands/assets/dice/${type}-${result}.png" alt="${result}" title="${result}" />`;
}

export class ForbiddenLandsD6 extends Die {
Expand Down
24 changes: 12 additions & 12 deletions src/components/roll-engine/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class FBLRollHandler extends FormApplication {
*/
static getSpeaker({ actor, scene, token }) {
if (scene && token) return game.scenes.get(scene)?.tokens.get(token)?.actor;
else return game.actors.get(actor);
return game.actors.get(actor);
}

/**
Expand Down Expand Up @@ -351,14 +351,14 @@ export class FBLRollHandler extends FormApplication {
this.g = Array.isArray(gear)
? gear
: gear
? [
{
term: "g",
number: gear,
flavor: this.gear.label,
},
]
: [];
? [
{
term: "g",
number: gear,
flavor: this.gear.label,
},
]
: [];
this.a = this.parseArtifacts(artifact, this.gear.label);

const diff = skill + modifier;
Expand Down Expand Up @@ -473,8 +473,8 @@ export class FBLRollHandler extends FormApplication {
const maxPush = unlimitedPush
? 10000
: this.options.actorType === "monster"
? "0"
: 1;
? "0"
: 1;
return {
name: this.title,
title: this.title,
Expand Down Expand Up @@ -730,7 +730,7 @@ export class FBLRollHandler extends FormApplication {
/**
* @override Register FBLRoll as rollclass and remove chat templates to support normal dice rolls.
*/
YearZeroRollManager.registerRoll = function (cls = FBLRoll, i = 1) {
YearZeroRollManager.registerRoll = (cls = FBLRoll, i = 1) => {
CONFIG.Dice.rolls[i] = cls;
CONFIG.Dice.rolls[i].CHAT_TEMPLATE = CONFIG.YZUR.ROLL.chatTemplate;
CONFIG.Dice.rolls[i].TOOLTIP_TEMPLATE = CONFIG.YZUR.ROLL.tooltipTemplate;
Expand Down
2 changes: 1 addition & 1 deletion src/forbidden-lands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Hooks.once("ready", () => {

// Only add the context menu to decrease consumables if consumables aren't automatically handled.
if (game.settings.get("forbidden-lands", "autoDecreaseConsumable") === 0)
Hooks.on("getChatLogEntryContext", function (_html, options) {
Hooks.on("getChatLogEntryContext", (_html, options) => {
const isConsumableRoll: ContextOptionCondition = (li) =>
!!li.find(".consumable-result").length;

Expand Down
2 changes: 1 addition & 1 deletion src/item/item-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class ForbiddenLandsItem extends Item {
get parryPenalty() {
if (this.category === "melee" && !this.itemProperties.features?.parrying)
return CONFIG.fbl.actionModifiers.parry;
else return 0;
return 0;
}

get range() {
Expand Down
35 changes: 16 additions & 19 deletions src/journal/adventure-sites/adventure-site-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const parseRollStrings = (results) => {
fns("all_results"),
parseInt(parsedResults[1]),
);
else return [];
return [];
};

// Result transformers applied based on the type of result
Expand All @@ -107,31 +107,28 @@ const fns = (type) => {
),
hybrid: (results) => {
// The more results the higher the chance we go for unique columns
if (Math.random() < 1 / results.length) {
return [results[0]];
} else {
const newResult = results.reduce((obj, cur, i) => {
cur = Object.entries(cur);
obj[cur[i][0]] = cur[i][1];
return obj;
}, {});
return [newResult];
}
if (Math.random() < 1 / results.length) return [results[0]];

const newResult = results.reduce((obj, cur, i) => {
cur = Object.entries(cur);
obj[cur[i][0]] = cur[i][1];
return obj;
}, {});
return [newResult];
},
inn_name_string: (results) => {
if (Math.random() > 0.5) {
if (Math.random() > 0.5)
return [
{
the_name_of_the_inn: `The ${results[0].first_word} ${results[1].second_word}`,
},
];
} else {
return [
{
the_name_of_the_inn: `The ${results[0].second_word} & ${results[0].second_word}`,
},
];
}

return [
{
the_name_of_the_inn: `The ${results[0].second_word} & ${results[0].second_word}`,
},
];
},
};
return types[type] ?? types.all_results;
Expand Down
2 changes: 1 addition & 1 deletion src/journal/journal-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class ForbiddenLandsJournalEntry extends JournalEntry {
get type() {
const type = this.getFlag("forbidden-lands", "type");
if (type) return type;
else return CONST.BASE_DOCUMENT_TYPE;
return CONST.BASE_DOCUMENT_TYPE;
}

// Lifted straight out of Foundry because in V11 it removes the base type from the list of types
Expand Down
Loading

0 comments on commit 1469308

Please sign in to comment.