Skip to content

Commit 2067c41

Browse files
authored
Making fixes for primitives v10 rc (#539)
* Making fix for primitives v10 * Create polite-carrots-pay.md
1 parent 30e7113 commit 2067c41

File tree

4 files changed

+18
-36
lines changed

4 files changed

+18
-36
lines changed

.changeset/polite-carrots-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/stylelint-config": patch
3+
---
4+
5+
Making fixes for primitives v10 rc

package-lock.json

Lines changed: 8 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"@changesets/changelog-github": "^0.5.0",
5959
"@changesets/cli": "2.27.9",
6060
"@github/prettier-config": "^0.0.6",
61+
"@primer/primitives": "^10.0.0-rc.e5d395ea",
6162
"@rollup/plugin-commonjs": "^28.0.0",
6263
"@rollup/plugin-json": "^6.1.0",
6364
"@rollup/plugin-node-resolve": "^15.2.3",

plugins/lib/utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ export function primitivesVariables(type) {
3131
const data = require(`@primer/primitives/dist/styleLint/${file}`)
3232

3333
for (const key of Object.keys(data)) {
34-
const size = data[key]
35-
const values = typeof size['value'] === 'string' ? [size['value']] : size['value']
34+
const token = data[key]
35+
const valueProp = '$value' in token ? '$value' : 'value'
36+
const values = typeof token[valueProp] === 'string' ? [token[valueProp]] : token[valueProp]
3637

3738
variables.push({
38-
name: `--${size['name']}`,
39+
name: `--${token['name']}`,
3940
values,
4041
})
4142
}

0 commit comments

Comments
 (0)