Move dev-only hooks into their own folder that isn't included in the build

This commit is contained in:
Eldritch-Oliver 2025-10-10 18:45:13 -06:00
parent 8de63e91c7
commit 803c1673e2
7 changed files with 37 additions and 4 deletions

View file

@ -0,0 +1,15 @@
/*
This hook exists to be able to change all of the actor-sheets to allow
them to have dev-mode controls in their header that are useful for
testing purposes. (This is particularly useful for testing embedded
items that are only allowed to exist on specific actor types)
*/
Hooks.on(`getHeaderControlsActorSheetV2`, (_app, controls) => {
if (!game.settings.get(`ripcrypt`, `devMode`)) { return }
controls.push({
icon: `fa-solid fa-terminal`,
label: `Embed New Item (DEV)`,
action: `createItem`,
});
});

View file

@ -1,4 +1,4 @@
import { Logger } from "../utils/Logger.mjs"; import { Logger } from "../../module/utils/Logger.mjs";
const loaders = { const loaders = {
svg(data) { svg(data) {

3
dev/main.mjs Normal file
View file

@ -0,0 +1,3 @@
// Hooks
import "./hooks/hotReload.mjs";
import "./hooks/getHeaderControlsActorSheetV2.mjs";

View file

@ -12,6 +12,7 @@
}, },
"include": [ "include": [
"module/**/*", "module/**/*",
"dev/**/*",
"foundry/client/client.mjs", "foundry/client/client.mjs",
"foundry/client/global.d.mts", "foundry/client/global.d.mts",
"foundry/common/primitives/global.d.mts" "foundry/common/primitives/global.d.mts"

View file

@ -1,7 +1,6 @@
// Hooks // Hooks
import "./hooks/init.mjs"; import "./hooks/init.mjs";
import "./hooks/ready.mjs"; import "./hooks/ready.mjs";
import "./hooks/hotReload.mjs";
// Global API // Global API
import "./api.mjs"; import "./api.mjs";

View file

@ -0,0 +1,14 @@
/*
The intent of this script is to do all of the modifications of the
manifest file that we need to do in order to release the system. This
can include removing dev-only fields/attributes that end users will
never, and should never, care about nor need.
*/
// TODO: load the manifest
// TODO: remove all files that start with dev/ from the esmodules list
// TODO: remove flags.hotReload
// TODO: write the new manifest to disk

View file

@ -12,7 +12,8 @@
{ "name": "Oliver" } { "name": "Oliver" }
], ],
"esmodules": [ "esmodules": [
"module/main.mjs" "module/main.mjs",
"dev/main.mjs"
], ],
"styles": [ "styles": [
{ {
@ -36,7 +37,7 @@
"flags": { "flags": {
"hotReload": { "hotReload": {
"extensions": ["css", "hbs", "json", "mjs", "svg"], "extensions": ["css", "hbs", "json", "mjs", "svg"],
"paths": ["assets", "templates", "langs", "module"] "paths": ["assets", "templates", "langs", "module", "dev"]
} }
}, },
"documentTypes": { "documentTypes": {