From 385a8fecbaea161fd365a85903643fefe34221fb Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 8 Apr 2025 09:18:32 +0200 Subject: [PATCH] build: adds another fail scenario to the circular checker if it encounters fewer dependencies than anticipated --- src/Umbraco.Web.UI.Client/devops/circular/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/devops/circular/index.js b/src/Umbraco.Web.UI.Client/devops/circular/index.js index 107556b6ee..31223f1098 100644 --- a/src/Umbraco.Web.UI.Client/devops/circular/index.js +++ b/src/Umbraco.Web.UI.Client/devops/circular/index.js @@ -52,7 +52,12 @@ if (circular.length) { */ // TODO: Remove this check and set an exit with argument 1 when we have fixed all circular dependencies. - if (circular.length > 7) { + const MAX_CIRCULAR_DEPENDENCIES = 7; + if (circular.length > MAX_CIRCULAR_DEPENDENCIES) { + process.exit(1); + } else if (circular.length < MAX_CIRCULAR_DEPENDENCIES) { + console.error(`\nYou have fewer circular dependencies (${circular.length}) than anticipated (${MAX_CIRCULAR_DEPENDENCIES}). That is great!\n`); + console.error(`(Now please adjust the number in MAX_CIRCULAR_DEPENDENCIES to ${circular.length} in devops/circular/index.js).\n`); process.exit(1); } else { process.exit(0);