From a4313bd774d598b58bd6ff996aae07eab8bbdc33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Zaera=20Avell=C3=B3n?= Date: Thu, 18 Jan 2024 12:06:10 +0100 Subject: [PATCH] feat(npm-scripts): detect playwright folder as root This is needed so that playwright SF uses its own set of rules. --- .../packages/npm-scripts/src/utils/findRoot.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/projects/npm-tools/packages/npm-scripts/src/utils/findRoot.js b/projects/npm-tools/packages/npm-scripts/src/utils/findRoot.js index c892ad4f2..7bc813ae5 100644 --- a/projects/npm-tools/packages/npm-scripts/src/utils/findRoot.js +++ b/projects/npm-tools/packages/npm-scripts/src/utils/findRoot.js @@ -33,6 +33,16 @@ function findRoot() { if (basename === 'modules') { return directory; } + + // The playwright folder is under modules, but we don't + // want to go up any further. At the same time, the root + // is not the real root of liferay-portal, so we return + // undefined (that's how it behaves in the workspaces + // folder, in fact). + + if (basename === 'playwright') { + return undefined; + } } if (path.dirname(directory) === directory) {