anubis-ui 1.2.9 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anubis-ui",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "description": "Class-based css generator",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -3,6 +3,10 @@
3
3
  "prefix": "bg",
4
4
  "declaration": "background: ${color}"
5
5
  },
6
+ {
7
+ "prefix": "text",
8
+ "declaration": "color: ${color}"
9
+ },
6
10
  {
7
11
  "prefix": "border",
8
12
  "declaration": "border-width: ${value} !important; border-color: ${color} !important; border-style: solid;",
@@ -31,19 +31,28 @@ const init = () => {
31
31
  checkUserConfig()
32
32
 
33
33
  for (const file of anubisConfigFiles) {
34
- let configToUse = null
34
+ let configToUse = []
35
+
36
+ const filePath = path.join(anubisConfigFolder, `${file}.config.json`)
37
+ const configContent = fs.readFileSync(filePath, { encoding: 'utf-8' })
38
+ if (!configContent) { continue }
39
+
40
+ configToUse = JSON.parse(configContent)
35
41
 
36
42
  if (userConfig && userConfig[file]) {
37
- log(`${file} config found, overriding default.`)
38
- configToUse = userConfig[file]
39
- } else {
40
- const filePath = path.join(anubisConfigFolder, `${file}.config.json`)
41
- const configContent = fs.readFileSync(filePath, { encoding: 'utf-8' })
42
- if (!configContent) { continue }
43
-
44
- configToUse = JSON.parse(configContent)
43
+ log(`${file} config found, adding to default.`)
44
+ configToUse.push(...userConfig[file])
45
+
46
+ configToUse = configToUse.filter(({ prefix }, index) => {
47
+ return configToUse.findIndex(item => item.prefix === prefix) === index
48
+ })
49
+
50
+ if (file === 'presets') {
51
+ console.log({ configToUse })
52
+ }
45
53
  }
46
54
 
55
+
47
56
  config[file as keyof typeof config] = configToUse
48
57
  }
49
58