commit: f4bf3745095cc370a03383976f0fd54090acc51d
parent 6811191147c6e7eacdff580cdf291538e7df6e5e
Author: Henry Jameson <me@hjkos.com>
Date: Mon, 19 Feb 2024 00:12:07 +0200
cleanup and warn if there are collisions in .style.js files
Diffstat:
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
@@ -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) => {