diff --git a/.changepacks/changepack_log_sxhI41g8_4YUVxCXCQ8JA.json b/.changepacks/changepack_log_sxhI41g8_4YUVxCXCQ8JA.json new file mode 100644 index 0000000..9aeefc2 --- /dev/null +++ b/.changepacks/changepack_log_sxhI41g8_4YUVxCXCQ8JA.json @@ -0,0 +1 @@ +{"changes":{"package.json":"Patch"},"note":"Add vendor by groups","date":"2025-11-17T12:41:17.276264400Z"} \ No newline at end of file diff --git a/__tests__/convert-type.test.ts b/__tests__/convert-type.test.ts index bd6c056..82bf937 100644 --- a/__tests__/convert-type.test.ts +++ b/__tests__/convert-type.test.ts @@ -5,6 +5,6 @@ import { convertType } from '../convert-type' test.each([['string', '"string" | Globals']])( 'convertType', (type, expected) => { - expect(convertType(type)).toEqual(expected) + expect(convertType(type, {})).toEqual(expected) }, ) diff --git a/build.ts b/build.ts index 8cdb860..5417b94 100644 --- a/build.ts +++ b/build.ts @@ -22,6 +22,7 @@ const properties = (await fetch( syntax: string status: string computed?: string[] | string + groups?: string[] } > @@ -98,6 +99,16 @@ for (const [property, value] of Object.entries(properties)) { else vendorLonghandProperties.push([property, value]) continue } + for (const gr of [ + ['WebKit Extensions', '-webkit-'], + ['Microsoft Extensions', '-ms-'], + ['Mozilla Extensions', '-moz-'], + ] as const) + if (value.groups?.includes(gr[0])) { + if (Array.isArray(value.computed)) + standardShorthandProperties.push([`${gr[1]}${property}`, value]) + else standardLonghandProperties.push([`${gr[1]}${property}`, value]) + } if (Array.isArray(value.computed)) standardShorthandProperties.push([property, value]) else standardLonghandProperties.push([property, value]) diff --git a/package.json b/package.json index 4504e88..b1b9914 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,9 @@ "scripts": { "lint": "biome check .", "lint:fix": "biome check --write .", - "build": "bun build.ts", - "prepare": "husky" + "build": "bun build.ts && biome check src --write", + "prepare": "husky", + "changepacks": "bunx @changepacks/cli" }, "files": [ "src" diff --git a/src/index.d.ts b/src/index.d.ts index 562efe9..7da3d5f 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -85,14 +85,30 @@ export interface StandardLonghandProperties { borderTopStyle?: Property.BorderTopStyle | undefined borderTopWidth?: Property.BorderTopWidth | undefined bottom?: Property.Bottom | undefined + WebkitBoxAlign?: Property.WebkitBoxAlign | undefined + MozBoxAlign?: Property.MozBoxAlign | undefined boxAlign?: Property.BoxAlign | undefined boxDecorationBreak?: Property.BoxDecorationBreak | undefined + WebkitBoxDirection?: Property.WebkitBoxDirection | undefined + MozBoxDirection?: Property.MozBoxDirection | undefined boxDirection?: Property.BoxDirection | undefined + WebkitBoxFlex?: Property.WebkitBoxFlex | undefined + MozBoxFlex?: Property.MozBoxFlex | undefined boxFlex?: Property.BoxFlex | undefined + WebkitBoxFlexGroup?: Property.WebkitBoxFlexGroup | undefined + MozBoxFlexGroup?: Property.MozBoxFlexGroup | undefined boxFlexGroup?: Property.BoxFlexGroup | undefined + WebkitBoxLines?: Property.WebkitBoxLines | undefined + MozBoxLines?: Property.MozBoxLines | undefined boxLines?: Property.BoxLines | undefined + WebkitBoxOrdinalGroup?: Property.WebkitBoxOrdinalGroup | undefined + MozBoxOrdinalGroup?: Property.MozBoxOrdinalGroup | undefined boxOrdinalGroup?: Property.BoxOrdinalGroup | undefined + WebkitBoxOrient?: Property.WebkitBoxOrient | undefined + MozBoxOrient?: Property.MozBoxOrient | undefined boxOrient?: Property.BoxOrient | undefined + WebkitBoxPack?: Property.WebkitBoxPack | undefined + MozBoxPack?: Property.MozBoxPack | undefined boxPack?: Property.BoxPack | undefined boxShadow?: Property.BoxShadow | undefined boxSizing?: Property.BoxSizing | undefined @@ -281,6 +297,7 @@ export interface StandardLonghandProperties { outlineWidth?: Property.OutlineWidth | undefined overflowAnchor?: Property.OverflowAnchor | undefined overflowBlock?: Property.OverflowBlock | undefined + MozOverflowClipBox?: Property.MozOverflowClipBox | undefined overflowClipBox?: Property.OverflowClipBox | undefined overflowClipMargin?: Property.OverflowClipMargin | undefined overflowInline?: Property.OverflowInline | undefined @@ -1085,6 +1102,22 @@ export namespace Property { export type BorderTopStyle = TLineStyle | Globals | (string & {}) export type BorderTopWidth = TLineWidth | Globals | (string & {}) export type Bottom = 'auto' | TLengthPercentage | Globals | (string & {}) + export type WebkitBoxAlign = + | 'start' + | 'center' + | 'end' + | 'baseline' + | 'stretch' + | Globals + | (string & {}) + export type MozBoxAlign = + | 'start' + | 'center' + | 'end' + | 'baseline' + | 'stretch' + | Globals + | (string & {}) export type BoxAlign = | 'start' | 'center' @@ -1094,16 +1127,52 @@ export namespace Property { | Globals | (string & {}) export type BoxDecorationBreak = 'slice' | 'clone' | Globals | (string & {}) + export type WebkitBoxDirection = + | 'normal' + | 'reverse' + | 'inherit' + | Globals + | (string & {}) + export type MozBoxDirection = + | 'normal' + | 'reverse' + | 'inherit' + | Globals + | (string & {}) export type BoxDirection = | 'normal' | 'reverse' | 'inherit' | Globals | (string & {}) + export type WebkitBoxFlex = number | Globals | (string & {}) + export type MozBoxFlex = number | Globals | (string & {}) export type BoxFlex = number | Globals | (string & {}) + export type WebkitBoxFlexGroup = number | Globals | (string & {}) + export type MozBoxFlexGroup = number | Globals | (string & {}) export type BoxFlexGroup = number | Globals | (string & {}) + export type WebkitBoxLines = 'single' | 'multiple' | Globals | (string & {}) + export type MozBoxLines = 'single' | 'multiple' | Globals | (string & {}) export type BoxLines = 'single' | 'multiple' | Globals | (string & {}) + export type WebkitBoxOrdinalGroup = number | Globals | (string & {}) + export type MozBoxOrdinalGroup = number | Globals | (string & {}) export type BoxOrdinalGroup = number | Globals | (string & {}) + export type WebkitBoxOrient = + | 'horizontal' + | 'vertical' + | 'inline-axis' + | 'block-axis' + | 'inherit' + | Globals + | (string & {}) + export type MozBoxOrient = + | 'horizontal' + | 'vertical' + | 'inline-axis' + | 'block-axis' + | 'inherit' + | Globals + | (string & {}) export type BoxOrient = | 'horizontal' | 'vertical' @@ -1112,6 +1181,20 @@ export namespace Property { | 'inherit' | Globals | (string & {}) + export type WebkitBoxPack = + | 'start' + | 'center' + | 'end' + | 'justify' + | Globals + | (string & {}) + export type MozBoxPack = + | 'start' + | 'center' + | 'end' + | 'justify' + | Globals + | (string & {}) export type BoxPack = | 'start' | 'center' @@ -1834,6 +1917,11 @@ export namespace Property { | 'auto' | Globals | (string & {}) + export type MozOverflowClipBox = + | 'padding-box' + | 'content-box' + | Globals + | (string & {}) export type OverflowClipBox = | 'padding-box' | 'content-box'