From ae8bd732db71fc70405237294e789123c1e3ce07 Mon Sep 17 00:00:00 2001 From: Kirill Skvortsov Date: Wed, 27 Nov 2024 19:16:50 +0300 Subject: [PATCH] fix(utils): fix project root path definition --- lib/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index 876973e..4ed7d1c 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -76,7 +76,7 @@ function getInstalledVarsPackage() { function runInsideCoreComponents() { try { - const rootPackage = require(path.join(__dirname, '../../../package.json')); + const rootPackage = require(path.join(process.cwd(), 'package.json')); return rootPackage.name === CORE_COMPONENTS_PACKAGE; } catch (e) { console.log(e); @@ -94,7 +94,7 @@ function resolveVarsFile(file) { return fs.readFileSync(require.resolve(fullPath)); } else { - return fs.readFileSync(path.resolve(__dirname, `../../../packages/vars/src/${file}`)); + return fs.readFileSync(path.resolve(process.cwd(), `packages/vars/src/${file}`)); } } @@ -268,7 +268,7 @@ function findTypographyMixins(ruleProps) { return TYPOGRAPHY_PROPS.every((prop) => ruleProps[prop] === mixinProps[prop]); } else { return TYPOGRAPHY_PROPS.every( - (prop) => !ruleProps[prop] || ruleProps[prop] === mixinProps[prop] + (prop) => !ruleProps[prop] || ruleProps[prop] === mixinProps[prop], ); } })