Skip to content

Commit 461bb50

Browse files
committed
Add extension
1 parent 4c8f5de commit 461bb50

File tree

5 files changed

+104
-3
lines changed

5 files changed

+104
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"changes":{"package.json":"Patch"},"note":"Add vendor by groups","date":"2025-11-17T12:41:17.276264400Z"}

__tests__/convert-type.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import { convertType } from '../convert-type'
55
test.each([['string', '"string" | Globals']])(
66
'convertType',
77
(type, expected) => {
8-
expect(convertType(type)).toEqual(expected)
8+
expect(convertType(type, {})).toEqual(expected)
99
},
1010
)

build.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const properties = (await fetch(
2222
syntax: string
2323
status: string
2424
computed?: string[] | string
25+
groups?: string[]
2526
}
2627
>
2728

@@ -98,6 +99,16 @@ for (const [property, value] of Object.entries(properties)) {
9899
else vendorLonghandProperties.push([property, value])
99100
continue
100101
}
102+
for (const gr of [
103+
['WebKit Extensions', '-webkit-'],
104+
['Microsoft Extensions', '-ms-'],
105+
['Mozilla Extensions', '-moz-'],
106+
] as const)
107+
if (value.groups?.includes(gr[0])) {
108+
if (Array.isArray(value.computed))
109+
standardShorthandProperties.push([`${gr[1]}${property}`, value])
110+
else standardLonghandProperties.push([`${gr[1]}${property}`, value])
111+
}
101112
if (Array.isArray(value.computed))
102113
standardShorthandProperties.push([property, value])
103114
else standardLonghandProperties.push([property, value])

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
"scripts": {
1616
"lint": "biome check .",
1717
"lint:fix": "biome check --write .",
18-
"build": "bun build.ts",
19-
"prepare": "husky"
18+
"build": "bun build.ts && biome check src --write",
19+
"prepare": "husky",
20+
"changepacks": "bunx @changepacks/cli"
2021
},
2122
"files": [
2223
"src"

src/index.d.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,30 @@ export interface StandardLonghandProperties {
8585
borderTopStyle?: Property.BorderTopStyle | undefined
8686
borderTopWidth?: Property.BorderTopWidth | undefined
8787
bottom?: Property.Bottom | undefined
88+
WebkitBoxAlign?: Property.WebkitBoxAlign | undefined
89+
MozBoxAlign?: Property.MozBoxAlign | undefined
8890
boxAlign?: Property.BoxAlign | undefined
8991
boxDecorationBreak?: Property.BoxDecorationBreak | undefined
92+
WebkitBoxDirection?: Property.WebkitBoxDirection | undefined
93+
MozBoxDirection?: Property.MozBoxDirection | undefined
9094
boxDirection?: Property.BoxDirection | undefined
95+
WebkitBoxFlex?: Property.WebkitBoxFlex | undefined
96+
MozBoxFlex?: Property.MozBoxFlex | undefined
9197
boxFlex?: Property.BoxFlex | undefined
98+
WebkitBoxFlexGroup?: Property.WebkitBoxFlexGroup | undefined
99+
MozBoxFlexGroup?: Property.MozBoxFlexGroup | undefined
92100
boxFlexGroup?: Property.BoxFlexGroup | undefined
101+
WebkitBoxLines?: Property.WebkitBoxLines | undefined
102+
MozBoxLines?: Property.MozBoxLines | undefined
93103
boxLines?: Property.BoxLines | undefined
104+
WebkitBoxOrdinalGroup?: Property.WebkitBoxOrdinalGroup | undefined
105+
MozBoxOrdinalGroup?: Property.MozBoxOrdinalGroup | undefined
94106
boxOrdinalGroup?: Property.BoxOrdinalGroup | undefined
107+
WebkitBoxOrient?: Property.WebkitBoxOrient | undefined
108+
MozBoxOrient?: Property.MozBoxOrient | undefined
95109
boxOrient?: Property.BoxOrient | undefined
110+
WebkitBoxPack?: Property.WebkitBoxPack | undefined
111+
MozBoxPack?: Property.MozBoxPack | undefined
96112
boxPack?: Property.BoxPack | undefined
97113
boxShadow?: Property.BoxShadow | undefined
98114
boxSizing?: Property.BoxSizing | undefined
@@ -281,6 +297,7 @@ export interface StandardLonghandProperties {
281297
outlineWidth?: Property.OutlineWidth | undefined
282298
overflowAnchor?: Property.OverflowAnchor | undefined
283299
overflowBlock?: Property.OverflowBlock | undefined
300+
MozOverflowClipBox?: Property.MozOverflowClipBox | undefined
284301
overflowClipBox?: Property.OverflowClipBox | undefined
285302
overflowClipMargin?: Property.OverflowClipMargin | undefined
286303
overflowInline?: Property.OverflowInline | undefined
@@ -1085,6 +1102,22 @@ export namespace Property {
10851102
export type BorderTopStyle = TLineStyle | Globals | (string & {})
10861103
export type BorderTopWidth = TLineWidth | Globals | (string & {})
10871104
export type Bottom = 'auto' | TLengthPercentage | Globals | (string & {})
1105+
export type WebkitBoxAlign =
1106+
| 'start'
1107+
| 'center'
1108+
| 'end'
1109+
| 'baseline'
1110+
| 'stretch'
1111+
| Globals
1112+
| (string & {})
1113+
export type MozBoxAlign =
1114+
| 'start'
1115+
| 'center'
1116+
| 'end'
1117+
| 'baseline'
1118+
| 'stretch'
1119+
| Globals
1120+
| (string & {})
10881121
export type BoxAlign =
10891122
| 'start'
10901123
| 'center'
@@ -1094,16 +1127,52 @@ export namespace Property {
10941127
| Globals
10951128
| (string & {})
10961129
export type BoxDecorationBreak = 'slice' | 'clone' | Globals | (string & {})
1130+
export type WebkitBoxDirection =
1131+
| 'normal'
1132+
| 'reverse'
1133+
| 'inherit'
1134+
| Globals
1135+
| (string & {})
1136+
export type MozBoxDirection =
1137+
| 'normal'
1138+
| 'reverse'
1139+
| 'inherit'
1140+
| Globals
1141+
| (string & {})
10971142
export type BoxDirection =
10981143
| 'normal'
10991144
| 'reverse'
11001145
| 'inherit'
11011146
| Globals
11021147
| (string & {})
1148+
export type WebkitBoxFlex = number | Globals | (string & {})
1149+
export type MozBoxFlex = number | Globals | (string & {})
11031150
export type BoxFlex = number | Globals | (string & {})
1151+
export type WebkitBoxFlexGroup = number | Globals | (string & {})
1152+
export type MozBoxFlexGroup = number | Globals | (string & {})
11041153
export type BoxFlexGroup = number | Globals | (string & {})
1154+
export type WebkitBoxLines = 'single' | 'multiple' | Globals | (string & {})
1155+
export type MozBoxLines = 'single' | 'multiple' | Globals | (string & {})
11051156
export type BoxLines = 'single' | 'multiple' | Globals | (string & {})
1157+
export type WebkitBoxOrdinalGroup = number | Globals | (string & {})
1158+
export type MozBoxOrdinalGroup = number | Globals | (string & {})
11061159
export type BoxOrdinalGroup = number | Globals | (string & {})
1160+
export type WebkitBoxOrient =
1161+
| 'horizontal'
1162+
| 'vertical'
1163+
| 'inline-axis'
1164+
| 'block-axis'
1165+
| 'inherit'
1166+
| Globals
1167+
| (string & {})
1168+
export type MozBoxOrient =
1169+
| 'horizontal'
1170+
| 'vertical'
1171+
| 'inline-axis'
1172+
| 'block-axis'
1173+
| 'inherit'
1174+
| Globals
1175+
| (string & {})
11071176
export type BoxOrient =
11081177
| 'horizontal'
11091178
| 'vertical'
@@ -1112,6 +1181,20 @@ export namespace Property {
11121181
| 'inherit'
11131182
| Globals
11141183
| (string & {})
1184+
export type WebkitBoxPack =
1185+
| 'start'
1186+
| 'center'
1187+
| 'end'
1188+
| 'justify'
1189+
| Globals
1190+
| (string & {})
1191+
export type MozBoxPack =
1192+
| 'start'
1193+
| 'center'
1194+
| 'end'
1195+
| 'justify'
1196+
| Globals
1197+
| (string & {})
11151198
export type BoxPack =
11161199
| 'start'
11171200
| 'center'
@@ -1834,6 +1917,11 @@ export namespace Property {
18341917
| 'auto'
18351918
| Globals
18361919
| (string & {})
1920+
export type MozOverflowClipBox =
1921+
| 'padding-box'
1922+
| 'content-box'
1923+
| Globals
1924+
| (string & {})
18371925
export type OverflowClipBox =
18381926
| 'padding-box'
18391927
| 'content-box'

0 commit comments

Comments
 (0)