From f4bf3745095cc370a03383976f0fd54090acc51d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 19 Feb 2024 00:12:07 +0200 Subject: [PATCH] cleanup and warn if there are collisions in .style.js files --- src/services/theme_data/theme_data_3.service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/theme_data/theme_data_3.service.js b/src/services/theme_data/theme_data_3.service.js index 5d3f4e8b..d916f97d 100644 --- a/src/services/theme_data/theme_data_3.service.js +++ b/src/services/theme_data/theme_data_3.service.js @@ -24,6 +24,9 @@ const components = { const componentsContext = require.context('src', true, /\.style.js(on)?$/) componentsContext.keys().forEach(key => { const component = componentsContext(key).default + if (components[component.name] != null) { + console.warn(`Component in file ${key} is trying to override existing component ${component.name}! You have collisions/duplicates!`) + } components[component.name] = component }) @@ -169,7 +172,6 @@ export const init = (extraRuleset, palette) => { return rule }) - console.log(rulesetUnsorted) const ruleset = rulesetUnsorted .map((data, index) => ({ data, index })) @@ -188,8 +190,6 @@ export const init = (extraRuleset, palette) => { }) .map(({ data }) => data) - console.log(ruleset.filter(c => c.component === 'ButtonUnstyled')) - const virtualComponents = new Set(Object.values(components).filter(c => c.virtual).map(c => c.name)) const findColor = (color, dynamicVars) => {