From 46fe889ab45ef3be94b2cb41f79d4b918359b51a Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 5 Feb 2026 20:57:50 -0800 Subject: [PATCH] fix(tools): fix cross-ref validator path handling and add to CI - Fix doubled path bug when source uses repo-root-relative paths - Add lint:cross-refs step to GitHub workflow for CI parity --- .github/workflows/quality.yml | 3 +++ tools/validate-cross-refs.cjs | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 4ef28e68..1f8f8145 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -49,3 +49,6 @@ jobs: - name: Validate JSON manifests run: mise run lint:manifests + + - name: Validate cross-references + run: mise run lint:cross-refs diff --git a/tools/validate-cross-refs.cjs b/tools/validate-cross-refs.cjs index 0b076cc3..627e8139 100644 --- a/tools/validate-cross-refs.cjs +++ b/tools/validate-cross-refs.cjs @@ -76,9 +76,14 @@ function validatePlugin(plugin) { info(`Validating plugin: ${pluginName}`); // Determine plugin directory path + // Source can be relative to repo root (./plugins/foo) or to plugins dir (./foo) const source = plugin.source || `./${pluginName}`; const normalizedSource = source.replace(/^\.\//, "").replace(/\/$/, ""); - const pluginDir = path.join(PLUGINS_ROOT, normalizedSource); + + // If source already includes plugins/ prefix, use as-is; otherwise prepend PLUGINS_ROOT + const pluginDir = normalizedSource.startsWith(`${PLUGINS_ROOT}/`) + ? normalizedSource + : path.join(PLUGINS_ROOT, normalizedSource); // Check 1: Plugin directory exists if (!fs.existsSync(pluginDir)) {