Skip to content

Commit

Permalink
Allow event plugins to require("shared/lib/scriptValue/helpers")
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismaltby committed May 20, 2024
1 parent e83e5b3 commit d20ac15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/project/loadScriptEventHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { ScriptEventFieldSchema } from "shared/lib/entities/entitiesTypes";
import { Dictionary } from "@reduxjs/toolkit";
import { readFile } from "fs-extra";
import trimLines from "shared/lib/helpers/trimlines";
import * as scriptValueHelpers from "shared/lib/scriptValue/helpers";

const globAsync = promisify(glob);

Expand Down Expand Up @@ -51,7 +52,7 @@ export type ScriptEventPresetValue = {
groups?: string[] | string;
subGroups?: Record<string, string>;
values: Record<string, unknown>;
}
};

export interface ScriptEventDef {
id: string;
Expand Down Expand Up @@ -114,6 +115,7 @@ const vm = new NodeVM({
"../compiler/compileEntityEvents": compileEntityEvents,
"../helpers/trimlines": trimLines,
"shared/lib/helpers/trimlines": trimLines,
"shared/lib/scriptValue/helpers": scriptValueHelpers,
},
},
});
Expand Down

0 comments on commit d20ac15

Please sign in to comment.