@spark-ui/cli-utils 2.2.7 → 2.4.0
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.4.0](https://github.com/adevinta/spark/compare/@spark-ui/cli-utils@2.3.0...@spark-ui/cli-utils@2.4.0) (2023-03-03)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **cli-utils:** handle overlooked edge cases ([d5c1ae3](https://github.com/adevinta/spark/commit/d5c1ae3d1eb41aa7c7c8a265d63e74dd7c416531))
|
|
11
|
+
|
|
12
|
+
# [2.3.0](https://github.com/adevinta/spark/compare/@spark-ui/cli-utils@2.2.7...@spark-ui/cli-utils@2.3.0) (2023-03-02)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **cli-utils:** update toTailwindConfig mapper to handle edge cases ([2af919a](https://github.com/adevinta/spark/commit/2af919a3dd7bbab02d00cd9892c1e9a7971aec38))
|
|
17
|
+
|
|
6
18
|
## [2.2.7](https://github.com/adevinta/spark/compare/@spark-ui/cli-utils@2.2.6...@spark-ui/cli-utils@2.2.7) (2023-03-02)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @spark-ui/cli-utils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-ui/cli-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Spark CLI utils",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@clack/prompts": "0.2.2",
|
|
16
|
-
"@spark-ui/theme-utils": "^2.6.
|
|
16
|
+
"@spark-ui/theme-utils": "^2.6.1",
|
|
17
17
|
"camel-case": "4.1.2",
|
|
18
18
|
"chalk": "5.2.0",
|
|
19
19
|
"commander": "10.0.0",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"url": "git@github.com:adevinta/spark.git",
|
|
30
30
|
"directory": "packages/utils/cli"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "8592733ad239e8ebdda108387df3dd8997e1353c"
|
|
33
33
|
}
|
|
@@ -3,6 +3,7 @@ import { join } from 'node:path'
|
|
|
3
3
|
|
|
4
4
|
import hexRgb from 'hex-rgb'
|
|
5
5
|
|
|
6
|
+
import { DEFAULT_KEY } from './constants.js'
|
|
6
7
|
import { doubleHyphensRegex, isHex, isObject, isStringOrNumber, toKebabCase } from './utils.js'
|
|
7
8
|
|
|
8
9
|
function toCSSVars(_theme, className) {
|
|
@@ -26,7 +27,10 @@ function toCSSVars(_theme, className) {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
flattenedTheme[
|
|
29
|
-
`--${[...paths, key
|
|
30
|
+
`--${[...paths, key === DEFAULT_KEY ? key.toLowerCase() : key]
|
|
31
|
+
.map(toKebabCase)
|
|
32
|
+
.join('-')
|
|
33
|
+
.replace(doubleHyphensRegex, '-')}`
|
|
30
34
|
] = getFormattedValue()
|
|
31
35
|
}
|
|
32
36
|
})
|
|
@@ -3,7 +3,7 @@ import { join } from 'node:path'
|
|
|
3
3
|
|
|
4
4
|
import { defaultTheme } from '@spark-ui/theme-utils'
|
|
5
5
|
|
|
6
|
-
import { tailwindKeys } from './constants.js'
|
|
6
|
+
import { DEFAULT_KEY, defaultColors, tailwindKeys } from './constants.js'
|
|
7
7
|
import {
|
|
8
8
|
doubleHyphensRegex,
|
|
9
9
|
hasNumber,
|
|
@@ -60,6 +60,10 @@ function toTailwindConfig(_theme) {
|
|
|
60
60
|
|
|
61
61
|
if (isObject(value)) {
|
|
62
62
|
Object.keys(value).forEach(k => {
|
|
63
|
+
if (k === DEFAULT_KEY) {
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
|
|
63
67
|
if (!isObject(value[k]) && !isCamelCase(k)) {
|
|
64
68
|
return
|
|
65
69
|
}
|
|
@@ -85,7 +89,7 @@ function toTailwindConfig(_theme) {
|
|
|
85
89
|
return String(value).toLowerCase()
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
return `var(--${paths.join('-')}-${key})`
|
|
92
|
+
return `var(--${paths.join('-')}-${key.toLowerCase()})`
|
|
89
93
|
})()
|
|
90
94
|
|
|
91
95
|
theme[key] = isScreenValue
|
|
@@ -97,7 +101,7 @@ function toTailwindConfig(_theme) {
|
|
|
97
101
|
|
|
98
102
|
traverse(themeCpy)
|
|
99
103
|
|
|
100
|
-
return themeCpy
|
|
104
|
+
return { ...themeCpy, colors: { ...themeCpy.colors, ...defaultColors } }
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
/**
|