Move dev-only hooks into their own folder that isn't included in the build
This commit is contained in:
parent
8de63e91c7
commit
803c1673e2
7 changed files with 37 additions and 4 deletions
15
dev/hooks/getHeaderControlsActorSheetV2.mjs
Normal file
15
dev/hooks/getHeaderControlsActorSheetV2.mjs
Normal 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`,
|
||||
});
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Logger } from "../utils/Logger.mjs";
|
||||
import { Logger } from "../../module/utils/Logger.mjs";
|
||||
|
||||
const loaders = {
|
||||
svg(data) {
|
||||
3
dev/main.mjs
Normal file
3
dev/main.mjs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
// Hooks
|
||||
import "./hooks/hotReload.mjs";
|
||||
import "./hooks/getHeaderControlsActorSheetV2.mjs";
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
},
|
||||
"include": [
|
||||
"module/**/*",
|
||||
"dev/**/*",
|
||||
"foundry/client/client.mjs",
|
||||
"foundry/client/global.d.mts",
|
||||
"foundry/common/primitives/global.d.mts"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Hooks
|
||||
import "./hooks/init.mjs";
|
||||
import "./hooks/ready.mjs";
|
||||
import "./hooks/hotReload.mjs";
|
||||
|
||||
// Global API
|
||||
import "./api.mjs";
|
||||
|
|
|
|||
14
scripts/prepareManifest.mjs
Normal file
14
scripts/prepareManifest.mjs
Normal 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
|
||||
|
|
@ -12,7 +12,8 @@
|
|||
{ "name": "Oliver" }
|
||||
],
|
||||
"esmodules": [
|
||||
"module/main.mjs"
|
||||
"module/main.mjs",
|
||||
"dev/main.mjs"
|
||||
],
|
||||
"styles": [
|
||||
{
|
||||
|
|
@ -36,7 +37,7 @@
|
|||
"flags": {
|
||||
"hotReload": {
|
||||
"extensions": ["css", "hbs", "json", "mjs", "svg"],
|
||||
"paths": ["assets", "templates", "langs", "module"]
|
||||
"paths": ["assets", "templates", "langs", "module", "dev"]
|
||||
}
|
||||
},
|
||||
"documentTypes": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue