Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@melt-ui/pp": "^0.3.2",
"@melt-ui/svelte": "^0.86.6",
"@oddbird/popover-polyfill": "^0.6.1",
"@projectwallace/css-analyzer": "^7.6.0",
"@projectwallace/css-analyzer": "^7.6.3",
"@projectwallace/css-code-coverage": "^0.8.2",
"@projectwallace/css-code-quality": "^3.0.2",
"@projectwallace/css-design-tokens": "^0.10.0",
Expand Down Expand Up @@ -63,6 +63,7 @@
"vitest": "^4.0.6"
},
"overrides": {
"@projectwallace/css-analyzer": "$@projectwallace/css-analyzer",
"runed": "$runed"
}
}
6 changes: 3 additions & 3 deletions src/lib/components/stats/ColorTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import type { NormalizedColorWithAuthored } from 'color-sorter'
import type { CssLocation } from '$lib/css-location'
import ShowMore from '$components/ShowMore.svelte'
import type { UniqueWithLocations } from '@projectwallace/css-analyzer'

let {
items = Object.create(null),
Expand All @@ -19,7 +20,7 @@
unique: { converted: NormalizedColorWithAuthored; locations: CssLocation[] }[]
total: number
totalUnique: number
uniqueWithLocations: Record<string, CssLocation[]>
uniqueWithLocations: UniqueWithLocations
}

let max_colors = $derived.by(() => {
Expand Down Expand Up @@ -50,13 +51,12 @@
>(
Object.entries(items)
.sort((a, b) => b[1].total - a[1].total)
// @ts-expect-error We _know_ that the value is an Item
.map(([property, item]: [string, Item]) => {
let unique = [] as { converted: { authored: string }; locations: ArrayLike<unknown> }[]
for (let [value, locations] of Object.entries(item.uniqueWithLocations)) {
unique.push({
converted: { authored: value },
locations: new Uint8Array(locations.length)
locations: new Uint8Array((locations as {}[]).length)
})
}
return [
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/stats/FontFaces.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { get_css_state } from '$lib/css-state.svelte'
import { hash } from '$lib/hash'
import { string_sort } from '$lib/string-sort'
import type { Location } from '@projectwallace/css-analyzer'

let css_state = get_css_state()
let selected_item = $derived(css_state.selected_item)
Expand Down Expand Up @@ -112,7 +113,7 @@
type: 'font-face',
node_type: 'atrule',
value,
locations: item[1]
locations: item[1] as Location[]
})
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/stats/Properties.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@
let filtered = $derived.by(() => {
switch (visibility_filter) {
case show_hacks:
return Object.entries(browserhacks[LOCATIONS_PROP_NAME]!)
return Object.entries(browserhacks[LOCATIONS_PROP_NAME])
case show_custom:
return Object.entries(custom[LOCATIONS_PROP_NAME]!)
return Object.entries(custom[LOCATIONS_PROP_NAME])
case show_prefixed:
return Object.entries(prefixed[LOCATIONS_PROP_NAME]!)
return Object.entries(prefixed[LOCATIONS_PROP_NAME])
case show_shorthands:
return shorthand_properties
}
return Object.entries(uniqueWithLocations)
})
}) as [string, CssLocation[]][]
</script>

<div id="properties">
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/stats/Radiuses.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
let { itemsPerContext } = $derived(items)
let flattened = $derived(
Object.entries(itemsPerContext).flatMap(([property, data]) => {
// @ts-expect-error Incorrect type from analyze-css
let uniqueWithLocations = data.uniqueWithLocations as Record<string, CssLocation[]>
return Object.entries(uniqueWithLocations).map(([value, locations]) => {
return {
Expand Down
Loading