diff --git a/.gitignore b/.gitignore index 363d122..4ff484e 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ scripts/session-prompts.js # versioned so future rebuilds don't accidentally overwrite a released version. its-achievable-*.zip !its-achievable-0.1.0.zip +!its-achievable-0.1.1.zip diff --git a/README.md b/README.md index 3e0ac6f..fcd8c2b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Hax's Tools — It's Achievable (`its-achievable`) +# It's Achievable (`its-achievable`) Foundry VTT module: achievements engine, custom rules, rewards, achievement wall, and combat HUD. Consumes the generic Foundry hook -facade from `hax-hooks-lib` and the encounter state from `battle-focus`. +facade from `foundry-hooks-lib` and the encounter state from `battle-focus`. ## Status @@ -11,7 +11,7 @@ v0.1.0 — first release as a standalone repo. Sourced from custom-achievements-app.js, hud.js, achievement-rules.js}` at `battle-focus` v0.5.0-alpha.12 (`99cf757` on Gitea). -Stage 2 of the Hax's Tools split. The achievement code is now an +Stage 2 of the Foundry module split. The achievement code is now an independent module with its own: - Settings namespace (`its-achievable.*`) - Module id (`its-achievable`, lowercase kebab) @@ -25,7 +25,7 @@ as a soft dependency of battle-focus). ## Dependencies -- **`hax-hooks-lib`** (≥0.2.0) — provides the Foundry event stream via +- **`foundry-hooks-lib`** (≥0.2.0) — provides the Foundry event stream via the generic `{ts, hook, args}` envelope facade. See `hooks-lib/docs/HOOK_CONTRACT.md`. - **`battle-focus`** (soft) — provides the encounter singleton via @@ -87,7 +87,7 @@ in Stage 3 and the existing E2E suite exercises the moved code. ## Architecture notes - **Hooks-lib first.** its-achievable subscribes to - `hax-hooks-lib`'s envelope stream. Combat lifecycle, document CRUD, + `foundry-hooks-lib`'s envelope stream. Combat lifecycle, document CRUD, dnd5e rolls — all via `hooksLib.api.subscribeMany({...})`. No direct `Hooks.on(...)` calls. - **Encounter via battle-focus's API.** its-achievable does not import diff --git a/its-achievable-0.1.1.zip b/its-achievable-0.1.1.zip new file mode 100644 index 0000000..f83044d Binary files /dev/null and b/its-achievable-0.1.1.zip differ diff --git a/module.json b/module.json index ab1c00c..940d125 100644 --- a/module.json +++ b/module.json @@ -1,8 +1,8 @@ { "id": "its-achievable", - "title": "Hax's Tools — It's Achievable", - "description": "Foundry VTT module: achievements engine, custom rules, rewards, achievement wall, and combat HUD. Consumes the generic Foundry hook facade from hax-hooks-lib and the encounter state from battle-focus.", - "version": "0.1.0", + "title": "It's Achievable", + "description": "Foundry VTT module: achievements engine, custom rules, rewards, achievement wall, and combat HUD. Consumes the generic Foundry hook facade from foundry-hooks-lib and the encounter state from battle-focus.", + "version": "0.1.1", "library": false, "manifestPlusVersion": "1.2.0", "authors": [ @@ -19,11 +19,11 @@ "systems": [], "modules": [ { - "id": "hax-hooks-lib", + "id": "foundry-hooks-lib", "type": "module", "manifest": "https://git.homelab.local/kaykayyali/hooks-lib/raw/branch/main/module.json", "compatibility": { - "minimum": "0.2.0" + "minimum": "0.3.0" } } ], @@ -32,7 +32,7 @@ "esmodules": ["scripts/main.js"], "url": "https://git.homelab.local/kaykayyali/its-achievable", "manifest": "https://git.homelab.local/kaykayyali/its-achievable/raw/branch/main/module.json", - "download": "https://git.homelab.local/kaykayyali/its-achievable/raw/branch/main/its-achievable-0.1.0.zip", + "download": "https://git.homelab.local/kaykayyali/its-achievable/raw/branch/main/its-achievable-0.1.1.zip", "readme": "https://git.homelab.local/kaykayyali/its-achievable/blob/main/README.md", "changelog": "https://git.homelab.local/kaykayyali/its-achievable/commits/main", "bugs": "https://git.homelab.local/kaykayyali/its-achievable/issues", diff --git a/package.json b/package.json index a202dad..fe47bef 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "its-achievable", "version": "0.1.0", "private": true, - "description": "Foundry VTT module: achievements, custom rules, rewards, achievement wall, and combat HUD. Depends on hax-hooks-lib (event stream) and battle-focus (encounter state).", + "description": "Foundry VTT module: achievements, custom rules, rewards, achievement wall, and combat HUD. Depends on foundry-hooks-lib (event stream) and battle-focus (encounter state).", "main": "scripts/main.js", "type": "module", "scripts": { @@ -16,6 +16,6 @@ "license": "UNLICENSED", "comment": "This package.json is for test/CI tooling only — Foundry VTT modules are loaded by Foundry, not by npm.", "dependencies": { - "hax-hooks-lib": "^0.2.0" + "foundry-hooks-lib": "^0.2.0" } } diff --git a/scripts/main.js b/scripts/main.js index ad34ad5..f0ad8ac 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -1,7 +1,7 @@ // its-achievable — module entry point (v0.1.0). // // Achievements engine, custom rules, rewards, achievement wall, combat -// HUD. Stage 2 of the Hax's Tools split. +// HUD. Stage 2 of the Foundry module split. // // Stage 2 wiring: // - The HUD listens to battle-focus's `battle-focus:hud-update` and diff --git a/tests/PLAN.md b/tests/PLAN.md index 53a46d9..4a30a6d 100644 --- a/tests/PLAN.md +++ b/tests/PLAN.md @@ -54,14 +54,14 @@ Test asserts: catalog is an array, length ≥ 24, every entry has its-achievable's `ready` hook subscribes to hooks-lib's envelope stream. Smoke test stubs both `Hooks` (for Foundry init/ready) and -`hax-hooks-lib`'s `mod.api` (for subscribe) and asserts: +`foundry-hooks-lib`'s `mod.api` (for subscribe) and asserts: - `subscribeMany` is called with at least the combat + actor update + token update + dnd5e roll hooks listed in `.hermes/plans/2026-06-20_080000-hax-tools-stage2-achievable-v2.md` D4. -- If `hax-hooks-lib` is not installed, its-achievable logs a warning +- If `foundry-hooks-lib` is not installed, its-achievable logs a warning and continues (graceful degradation). -- If `hax-hooks-lib` is installed but `battle-focus` is not, the +- If `foundry-hooks-lib` is installed but `battle-focus` is not, the HUD's `getActiveEncounter()` returns null and the HUD skips rendering. diff --git a/tests/test-helpers.mjs b/tests/test-helpers.mjs index 5c8e6bf..de6587b 100644 --- a/tests/test-helpers.mjs +++ b/tests/test-helpers.mjs @@ -94,11 +94,11 @@ export function installStubs(opts = {}) { if (withHooksLib) { const _hooksLibSubscribers = new Map(); const _hooksLibOnce = new WeakMap(); - _modules.set("hax-hooks-lib", { - id: "hax-hooks-lib", + _modules.set("foundry-hooks-lib", { + id: "foundry-hooks-lib", active: true, api: { - MODULE_ID: "hax-hooks-lib", + MODULE_ID: "foundry-hooks-lib", version: "0.2.0", REGISTERED_HOOKS: ["combatStart", "combatEnd", "updateActor", "createToken", "dnd5e.rollAttackV2", "dnd5e.rollDamageV2", "preUpdateActor", "updateToken", "preUpdateToken"], subscribe(hookName, fn) {