Skip to content

Commit

Permalink
Merge pull request dmdorman#817 from phBalance/phBalance/rename-to-esm
Browse files Browse the repository at this point in the history
Rename modules to ESM extension
  • Loading branch information
phBalance authored Mar 9, 2024
2 parents c596025 + 9851532 commit 020febb
Show file tree
Hide file tree
Showing 50 changed files with 117 additions and 119 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RoundFavorPlayerUp } from "../utility/round.js";
import { RoundFavorPlayerUp } from "../utility/round.mjs";

export class HeroSystem6eActorActiveEffects extends ActiveEffect {
// Rhair3 suggestion:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HeroSystemActorSheet } from "./actor-sheet.js";
import { HeroSystemActorSheet } from "./actor-sheet.mjs";

export class HeroSystemActorSavuoriSheet extends HeroSystemActorSheet {
/** @override */
Expand Down
18 changes: 9 additions & 9 deletions module/actor/actor-sheet.js → module/actor/actor-sheet.mjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { HeroSystem6eActor } from "./actor.js";
import { HeroSystem6eActor } from "./actor.mjs";

import { HeroSystem6eItem } from "../item/item.js";
import { HeroSystem6eItem } from "../item/item.mjs";

import { determineDefense } from "../utility/defense.js";
import { presenceAttackPopOut } from "../utility/presence-attack.js";
import { onManageActiveEffect } from "../utility/effects.js";
import { determineDefense } from "../utility/defense.mjs";
import { presenceAttackPopOut } from "../utility/presence-attack.mjs";
import { onManageActiveEffect } from "../utility/effects.mjs";
import {
getPowerInfo,
getCharacteristicInfoArrayForActor,
} from "../utility/util.js";
} from "../utility/util.mjs";
import {
CombatSkillLevelsForAttack,
convertToDcFromItem,
getDiceFormulaFromItemDC,
} from "../utility/damage.js";
import { HeroRoller } from "../utility/dice.js";
import { getSystemDisplayUnits } from "../utility/units.js";
} from "../utility/damage.mjs";
import { HeroRoller } from "../utility/dice.mjs";
import { getSystemDisplayUnits } from "../utility/units.mjs";

export class HeroSystemActorSheet extends ActorSheet {
/** @override */
Expand Down
4 changes: 2 additions & 2 deletions module/actor/actor-token.js → module/actor/actor-token.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Possible reference: https://github.com/foundryvtt/foundryvtt/issues/9026
// Possible reference: https://gitlab.com/woodentavern/foundryvtt-bar-brawl

import { getBarExtendedAttribute } from "../bar3/extendTokenConfig.js";
import { HEROSYS } from "../herosystem6e.js";
import { getBarExtendedAttribute } from "../bar3/extendTokenConfig.mjs";
import { HEROSYS } from "../herosystem6e.mjs";

export class HeroSystem6eTokenDocument extends TokenDocument {
constructor(data, context) {
Expand Down
8 changes: 4 additions & 4 deletions module/actor/actor.js → module/actor/actor.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { HeroSystem6eActorActiveEffects } from "./actor-active-effects.js";
import { HeroSystem6eItem } from "../item/item.js";
import { HEROSYS } from "../herosystem6e.js";
import { HeroSystem6eActorActiveEffects } from "./actor-active-effects.mjs";
import { HeroSystem6eItem } from "../item/item.mjs";
import { HEROSYS } from "../herosystem6e.mjs";
import {
getPowerInfo,
getCharacteristicInfoArrayForActor,
} from "../utility/util.js";
} from "../utility/util.mjs";

/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HEROSYS } from "../herosystem6e.js";
import { HEROSYS } from "../herosystem6e.mjs";

export const extendTokenConfig = async function (tokenConfig, html, data) {
// Ignore if bar3 not set
Expand Down
2 changes: 1 addition & 1 deletion module/bar3/tokenHud.js → module/bar3/tokenHud.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Large portions have been inspired by https://gitlab.com/woodentavern/foundryvtt-bar-brawl */

import { getBarExtendedAttribute } from "./extendTokenConfig.js";
import { getBarExtendedAttribute } from "./extendTokenConfig.mjs";

// TokenHUD does not appear to be extendable, so hook on renderTokenHUD

Expand Down
6 changes: 3 additions & 3 deletions module/card/attack-card.js → module/card/attack-card.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HEROSYS } from "../herosystem6e.js";
import { HeroSystem6eCard } from "./card.js";
import { HeroSystem6eToHitCard } from "./toHit-card.js";
import { HEROSYS } from "../herosystem6e.mjs";
import { HeroSystem6eCard } from "./card.mjs";
import { HeroSystem6eToHitCard } from "./toHit-card.mjs";

export class HeroSystem6eAttackCard extends HeroSystem6eCard {
static chatListeners(html) {
Expand Down
8 changes: 4 additions & 4 deletions module/card/card-helpers.js → module/card/card-helpers.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HeroSystem6eCard } from "./card.js";
import { HeroSystem6eAttackCard } from "./attack-card.js";
import { HeroSystem6eToHitCard } from "./toHit-card.js";
import * as Attack from "../item/item-attack.js";
import { HeroSystem6eCard } from "./card.mjs";
import { HeroSystem6eAttackCard } from "./attack-card.mjs";
import { HeroSystem6eToHitCard } from "./toHit-card.mjs";
import * as Attack from "../item/item-attack.mjs";

export class HeroSystem6eCardHelpers {
static onMessageRendered(html) {
Expand Down
2 changes: 1 addition & 1 deletion module/card/card.js → module/card/card.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HeroSystem6eItem } from "../item/item.js";
import { HeroSystem6eItem } from "../item/item.mjs";

export class HeroSystem6eCard {
constructor() {}
Expand Down
4 changes: 2 additions & 2 deletions module/card/toHit-card.js → module/card/toHit-card.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HeroSystem6eCard } from "./card.js";
import { modifyRollEquation } from "../utility/util.js";
import { HeroSystem6eCard } from "./card.mjs";
import { modifyRollEquation } from "../utility/util.mjs";

export class HeroSystem6eToHitCard extends HeroSystem6eCard {
static async chatListeners(/* html */) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 25 additions & 26 deletions module/herosystem6e.js → module/herosystem6e.mjs
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
// Import Modules
import { HERO } from "./config.js";
import { POWERS } from "./powers/powers-rules.js";
import { HeroSystem6eActor } from "./actor/actor.js";
import { HeroSystemActorSheet } from "./actor/actor-sheet.js";
import { HeroSystemActorSavuoriSheet } from "./actor/actor-savuori-sheet.js";
import { HERO } from "./config.mjs";
import { HeroSystem6eActor } from "./actor/actor.mjs";
import { HeroSystemActorSheet } from "./actor/actor-sheet.mjs";
import { HeroSystemActorSavuoriSheet } from "./actor/actor-savuori-sheet.mjs";

import {
HeroSystem6eToken,
HeroSystem6eTokenDocument,
} from "./actor/actor-token.js";
} from "./actor/actor-token.mjs";
import {
HeroSystem6eItem,
initializeItemHandlebarsHelpers,
} from "./item/item.js";
import { HeroSystem6eItemSheet } from "./item/item-sheet.js";
import { HeroSystem6eItem2Sheet } from "./item/item2-sheet.js";
import * as chat from "./chat.js";
import * as macros from "./macros.js";
import { HeroSystem6eCardHelpers } from "./card/card-helpers.js";
import { HeroSystem6eActorActiveEffects } from "./actor/actor-active-effects.js";
import HeroSystem6eMeasuredTemplate from "./measuretemplate.js";
import { HeroSystem6eCombat } from "./combat.js";
import { HeroSystem6eCombatTracker } from "./combatTracker.js";
import SettingsHelpers from "./settings/settings-helpers.js";
import { HeroSystem6eTokenHud } from "./bar3/tokenHud.js";
import { extendTokenConfig } from "./bar3/extendTokenConfig.js";
import { HeroRuler } from "./ruler.js";
import { initializeHandlebarsHelpers } from "./handlebars-helpers.js";
import { getPowerInfo } from "./utility/util.js";
} from "./item/item.mjs";
import { HeroSystem6eItemSheet } from "./item/item-sheet.mjs";
import { HeroSystem6eItem2Sheet } from "./item/item2-sheet.mjs";
import * as chat from "./chat.mjs";
import * as macros from "./macros.mjs";
import { HeroSystem6eCardHelpers } from "./card/card-helpers.mjs";
import { HeroSystem6eActorActiveEffects } from "./actor/actor-active-effects.mjs";
import HeroSystem6eMeasuredTemplate from "./measuretemplate.mjs";
import { HeroSystem6eCombat } from "./combat.mjs";
import { HeroSystem6eCombatTracker } from "./combatTracker.mjs";
import SettingsHelpers from "./settings/settings-helpers.mjs";
import { HeroSystem6eTokenHud } from "./bar3/tokenHud.mjs";
import { extendTokenConfig } from "./bar3/extendTokenConfig.mjs";
import { HeroRuler } from "./ruler.mjs";
import { initializeHandlebarsHelpers } from "./handlebars-helpers.mjs";
import { getPowerInfo } from "./utility/util.mjs";
import {
performAdjustment,
renderAdjustmentChatCards,
} from "./utility/adjustment.js";
import { migrateWorld } from "./migration.js";
} from "./utility/adjustment.mjs";
import { migrateWorld } from "./migration.mjs";

import "./testing/testing-main.mjs";

Hooks.once("init", async function () {
game.herosystem6e = {
Expand All @@ -53,8 +54,6 @@ Hooks.once("init", async function () {

CONFIG.HERO = HERO;

CONFIG.POWERS = POWERS;

CONFIG.Combat.documentClass = HeroSystem6eCombat;
CONFIG.Combat.defeatedStatusId = "dead";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CombatSkillLevelsForAttack } from "../utility/damage.js";
import { CombatSkillLevelsForAttack } from "../utility/damage.mjs";
import {
_processAttackOptions,
_processAttackAoeOptions,
} from "../item/item-attack.js";
import { getSystemDisplayUnits } from "../utility/units.js";
} from "../item/item-attack.mjs";
import { getSystemDisplayUnits } from "../utility/units.mjs";

const heroAoeTypeToFoundryAoeTypeConversions = {
any: "rect",
Expand Down
20 changes: 10 additions & 10 deletions module/item/item-attack.js → module/item/item-attack.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { getPowerInfo } from "../utility/util.js";
import { determineDefense } from "../utility/defense.js";
import { HeroSystem6eActorActiveEffects } from "../actor/actor-active-effects.js";
import { RoundFavorPlayerDown, RoundFavorPlayerUp } from "../utility/round.js";
import { getPowerInfo } from "../utility/util.mjs";
import { determineDefense } from "../utility/defense.mjs";
import { HeroSystem6eActorActiveEffects } from "../actor/actor-active-effects.mjs";
import { RoundFavorPlayerDown, RoundFavorPlayerUp } from "../utility/round.mjs";
import {
calculateDiceFormulaParts,
CombatSkillLevelsForAttack,
convertToDcFromItem,
} from "../utility/damage.js";
} from "../utility/damage.mjs";
import {
performAdjustment,
renderAdjustmentChatCards,
} from "../utility/adjustment.js";
import { getSystemDisplayUnits } from "../utility/units.js";
import { RequiresASkillRollCheck } from "../item/item.js";
import { ItemAttackFormApplication } from "../item/item-attack-application.js";
import { HeroRoller } from "../utility/dice.js";
} from "../utility/adjustment.mjs";
import { getSystemDisplayUnits } from "../utility/units.mjs";
import { RequiresASkillRollCheck } from "../item/item.mjs";
import { ItemAttackFormApplication } from "../item/item-attack-application.mjs";
import { HeroRoller } from "../utility/dice.mjs";

export async function chatListeners(html) {
html.on("click", "button.roll-damage", this._onRollDamage.bind(this));
Expand Down
8 changes: 4 additions & 4 deletions module/item/item-sheet.js → module/item/item-sheet.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { HeroSystem6eItem } from "./item.js";
import { editSubItem, deleteSubItem } from "../powers/powers.js";
import { HeroSystem6eItem } from "./item.mjs";
import { editSubItem, deleteSubItem } from "../powers/powers.mjs";
import {
adjustmentSourcesPermissive,
adjustmentSourcesStrict,
} from "../utility/adjustment.js";
import { getPowerInfo } from "../utility/util.js";
} from "../utility/adjustment.mjs";
import { getPowerInfo } from "../utility/util.mjs";

/**
* Extend the basic ItemSheet with some very simple modifications
Expand Down
24 changes: 12 additions & 12 deletions module/item/item.js → module/item/item.mjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { HEROSYS } from "../herosystem6e.js";
import { HeroSystem6eActor } from "../actor/actor.js";
import * as Attack from "../item/item-attack.js";
import { createSkillPopOutFromItem } from "../item/skill.js";
import { enforceManeuverLimits } from "../item/manuever.js";
import { HEROSYS } from "../herosystem6e.mjs";
import { HeroSystem6eActor } from "../actor/actor.mjs";
import * as Attack from "../item/item-attack.mjs";
import { createSkillPopOutFromItem } from "../item/skill.mjs";
import { enforceManeuverLimits } from "../item/manuever.mjs";
import {
adjustmentSourcesPermissive,
adjustmentSourcesStrict,
determineMaxAdjustment,
} from "../utility/adjustment.js";
import { onActiveEffectToggle } from "../utility/effects.js";
import { getPowerInfo, getModifierInfo } from "../utility/util.js";
import { RoundFavorPlayerDown, RoundFavorPlayerUp } from "../utility/round.js";
} from "../utility/adjustment.mjs";
import { onActiveEffectToggle } from "../utility/effects.mjs";
import { getPowerInfo, getModifierInfo } from "../utility/util.mjs";
import { RoundFavorPlayerDown, RoundFavorPlayerUp } from "../utility/round.mjs";
import {
convertToDcFromItem,
getDiceFormulaFromItemDC,
} from "../utility/damage.js";
import { getSystemDisplayUnits } from "../utility/units.js";
import { HeroRoller } from "../utility/dice.js";
} from "../utility/damage.mjs";
import { getSystemDisplayUnits } from "../utility/units.mjs";
import { HeroRoller } from "../utility/dice.mjs";

export function initializeItemHandlebarsHelpers() {
Handlebars.registerHelper("itemFullDescription", itemFullDescription);
Expand Down
2 changes: 1 addition & 1 deletion module/item/item2-sheet.js → module/item/item2-sheet.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPowerInfo } from "../utility/util.js";
import { getPowerInfo } from "../utility/util.mjs";

/**
* Extend the basic ItemSheet with some very simple modifications
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion module/item/skill.js → module/item/skill.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HeroRoller } from "../utility/dice.js";
import { HeroRoller } from "../utility/dice.mjs";

async function _renderSkillForm(item, actor, stateData) {
const token = actor.token;
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions module/migration.js → module/migration.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HeroSystem6eItem } from "./item/item.js";
import { determineCostPerActivePoint } from "./utility/adjustment.js";
import { RoundFavorPlayerUp } from "./utility/round.js";
import { HeroSystem6eItem } from "./item/item.mjs";
import { determineCostPerActivePoint } from "./utility/adjustment.mjs";
import { RoundFavorPlayerUp } from "./utility/round.mjs";

function getAllActorsInGame() {
return [
Expand Down
1 change: 0 additions & 1 deletion module/powers/powers-rules.js

This file was deleted.

2 changes: 1 addition & 1 deletion module/powers/powers.js → module/powers/powers.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getItem, HeroSystem6eItem } from "../item/item.js";
import { getItem, HeroSystem6eItem } from "../item/item.mjs";

export async function editSubItem(event) {
event.preventDefault();
Expand Down
4 changes: 2 additions & 2 deletions module/ruler.js → module/ruler.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HEROSYS } from "./herosystem6e.js";
import { getSystemDisplayUnits } from "./utility/units.js";
import { HEROSYS } from "./herosystem6e.mjs";
import { getSystemDisplayUnits } from "./utility/units.mjs";

export class HeroRuler {
static initialize() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HEROSYS } from "../herosystem6e.js";
import { HEROSYS } from "../herosystem6e.mjs";

export default class SettingsHelpers {
// Initialize System Settings after the Init Hook
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HeroSystem6eActor } from "../actor/actor.js";
import { HeroSystem6eItem } from "../item/item.js";
import { HeroSystem6eActor } from "../actor/actor.mjs";
import { HeroSystem6eItem } from "../item/item.mjs";
import {
getDiceFormulaFromItemDC,
convertToDcFromItem,
} from "../utility/damage.js";
} from "../utility/damage.mjs";

export function registerDamageFunctionTests(quench) {
quench.registerBatch(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HeroSystem6eActor } from "../actor/actor.js";
import { HeroSystem6eItem } from "../item/item.js";
import { determineDefense } from "../utility/defense.js";
import { HeroSystem6eActor } from "../actor/actor.mjs";
import { HeroSystem6eItem } from "../item/item.mjs";
import { determineDefense } from "../utility/defense.mjs";

export function registerDefenseTests(quench) {
quench.registerBatch(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HeroRoller } from "../utility/dice.js";
import { HeroRoller } from "../utility/dice.mjs";

function FixedDieRoll(fixedRollResult) {
return class extends Die {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HeroSystem6eActor } from "../actor/actor.js";
import { HeroSystem6eActor } from "../actor/actor.mjs";

export function registerFullTests(quench) {
quench.registerBatch(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { registerUtilTests } from "./testing-util.js";
import { registerDamageFunctionTests } from "./testing-damage-functions.js";
import { registerTagTests } from "./testing-tag.js";
import { registerUploadTests } from "./testing-upload.js";
import { registerDefenseTests } from "./testing-defense.js";
import { registerFullTests } from "./testing-full.js";
import { registerDiceTests } from "./testing-dice.js";
import { registerUtilTests } from "./testing-util.mjs";
import { registerDamageFunctionTests } from "./testing-damage-functions.mjs";
import { registerTagTests } from "./testing-tag.mjs";
import { registerUploadTests } from "./testing-upload.mjs";
import { registerDefenseTests } from "./testing-defense.mjs";
import { registerFullTests } from "./testing-full.mjs";
import { registerDiceTests } from "./testing-dice.mjs";

Hooks.once("ready", async function () {
if (!game.modules.get("_dev-mode")?.active) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { damageRollToTag } from "../utility/tag.js";
import { damageRollToTag } from "../utility/tag.mjs";

export function registerTagTests(quench) {
quench.registerBatch(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HeroSystem6eActor } from "../actor/actor.js";
import { HeroSystem6eItem } from "../item/item.js";
import { HeroSystem6eActor } from "../actor/actor.mjs";
import { HeroSystem6eItem } from "../item/item.mjs";

export function registerUploadTests(quench) {
quench.registerBatch(
Expand Down
Loading

0 comments on commit 020febb

Please sign in to comment.