From 2314195f2e4cdcea26f2a5b115328b928dd2f64c Mon Sep 17 00:00:00 2001 From: j-mendez Date: Mon, 11 Mar 2024 06:38:38 -0400 Subject: [PATCH] chore(rules): fix import rules target path --- kayle/builder/build-rules.ts | 4 ++-- kayle/lib/rules/index.ts | 3 ++- kayle/package.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kayle/builder/build-rules.ts b/kayle/builder/build-rules.ts index c37e981..571b628 100644 --- a/kayle/builder/build-rules.ts +++ b/kayle/builder/build-rules.ts @@ -130,9 +130,9 @@ import type { Rule } from "./build-types"; }; // import rule list with locales - export const importRules = async (locale: ${localesList.map((l) => `"${l}"`).join(" | ")}, runner: "htmlcs" | "axe"): Promise => { + export const importRules = async (locale: ${localesList.map((l) => `"${l}"`).join(" | ")}, runner: "htmlcs" | "axe", baseDir?: "string"): Promise => { const rules = await import(` + - "`./${locale.replace('-', '_')}/${runner === 'htmlcs' ? 'htmlcs' : 'axe'}-rules`" + + "`${baseDir || './'}${locale.replace('-', '_')}/${runner === 'htmlcs' ? 'htmlcs' : 'axe'}-rules`" + `` + `); diff --git a/kayle/lib/rules/index.ts b/kayle/lib/rules/index.ts index b67f196..76985fb 100644 --- a/kayle/lib/rules/index.ts +++ b/kayle/lib/rules/index.ts @@ -64,9 +64,10 @@ export const importRules = async ( | "pt_BR" | "en", runner: "htmlcs" | "axe", + baseDir?: "string", ): Promise => { const rules = await import( - `./${locale.replace("-", "_")}/${runner === "htmlcs" ? "htmlcs" : "axe"}-rules` + `${baseDir || "./"}${locale.replace("-", "_")}/${runner === "htmlcs" ? "htmlcs" : "axe"}-rules` ); return rules.axeRules || rules.htmlcsRules; diff --git a/kayle/package.json b/kayle/package.json index c964d2e..32d6539 100644 --- a/kayle/package.json +++ b/kayle/package.json @@ -1,6 +1,6 @@ { "name": "kayle", - "version": "0.8.37", + "version": "0.8.40", "description": "Extremely fast and accurate accessibility engine built for any headless tool like playwright or puppeteer.", "main": "./build/index.js", "keywords": [