From dfa61e7305ed28b74dcc2c68bd665b36751ad933 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 14 May 2026 18:36:41 +0100 Subject: [PATCH] Improve pattern matching and error handling --- build.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.mjs b/build.mjs index 7dea367fc..ef94ffd6e 100644 --- a/build.mjs +++ b/build.mjs @@ -87,7 +87,12 @@ const entryPointsPlugin = { build.onStart(() => { const actionFiles = globSync("src/*-action{,-post}.ts"); for (const actionFile of actionFiles) { - const match = actionFile.match(/src\/(.*)-action(-post)?.ts/); + const match = basename(actionFile).match(/(.*)-action(-post)?/); + + if (match.length < 2) { + throw new Error(`'${actionFile}' didn't match expected pattern.`); + } + const actionName = match[1]; const isPost = match[2] !== undefined;