Skip to content

Commit 0d1ae52

Browse files
committed
Merge branch 'main' into feat-enable-pwa-manifest
2 parents 68f2597 + b4b9cc8 commit 0d1ae52

27 files changed

Lines changed: 113 additions & 246 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ jobs:
199199
run: pnpm knip
200200

201201
- name: 🧹 Check for unused production code
202-
run: pnpm knip --production
202+
run: pnpm knip --production --exclude dependencies
203203

204204
i18n:
205205
name: 🌐 i18n validation

app/components/Compare/ComparisonGrid.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import type { ModuleReplacement } from 'module-replacements'
33
4-
export interface ComparisonGridColumn {
4+
interface ComparisonGridColumn {
55
name: string
66
version?: string
77
/** Module replacement data for this package (if available) */

app/components/Package/Header.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const props = defineProps<{
1818
}>()
1919
2020
const { requestedVersion, orgName } = usePackageRoute()
21-
const { scrollToTop, isTouchDeviceClient } = useScrollToTop()
21+
const { scrollToTop } = useScrollToTop()
2222
const packageHeaderHeight = usePackageHeaderHeight()
2323
2424
const header = useTemplateRef('header')
@@ -61,9 +61,7 @@ onBeforeUnmount(() => {
6161
const navExtraOffsetStyle = { '--package-nav-extra': '0px' }
6262
6363
const { y: scrollY } = useScroll(window)
64-
const showScrollToTop = computed(
65-
() => isTouchDeviceClient.value && scrollY.value > SCROLL_TO_TOP_THRESHOLD,
66-
)
64+
const showScrollToTop = computed(() => scrollY.value > SCROLL_TO_TOP_THRESHOLD)
6765
6866
const packageName = computed(() => props.pkg?.name ?? '')
6967
const compactNumberFormatter = useCompactNumberFormatter()

app/components/Package/ListControls.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
export type SortOption = 'downloads' | 'updated' | 'name-asc' | 'name-desc'
2+
type SortOption = 'downloads' | 'updated' | 'name-asc' | 'name-desc'
33
44
const props = defineProps<{
55
/** Current search/filter text */

app/components/Package/Maintainers.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ watch(
189189
class="link-subtle text-sm shrink-0"
190190
dir="ltr"
191191
>
192-
~{{ maintainer.name }}
192+
<i18n-t keypath="package.maintainers.maintainer_template">
193+
<template #avatar>
194+
<UserAvatar :username="maintainer.name" size="xs" aria-hidden="true" />
195+
</template>
196+
<template #char126>~</template>
197+
<template #name>{{ maintainer.name }}</template>
198+
</i18n-t>
193199
</LinkBase>
194200
<span v-else class="font-mono text-sm text-fg-muted" dir="ltr">{{
195201
maintainer.email

app/components/Select/Field.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const SELECT_FIELD_LABEL_SIZES = {
1919
2020
const model = defineModel<string | undefined>({ default: undefined })
2121
22-
export interface SelectFieldProps extends SelectBaseProps {
22+
interface SelectFieldProps extends SelectBaseProps {
2323
items: { label: string; value: string; disabled?: boolean }[]
2424
size?: keyof typeof SELECT_FIELD_SIZES
2525
selectAttrs?: Omit<SelectBaseProps, 'size' | 'id'> &

app/components/User/Avatar.vue

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
11
<script setup lang="ts">
22
const props = defineProps<{
33
username: string
4+
size: 'xs' | 'lg'
45
}>()
56
7+
const sizePixels = computed(() => {
8+
switch (props.size) {
9+
case 'xs':
10+
return 24
11+
case 'lg':
12+
return 64
13+
}
14+
})
15+
16+
const sizeClass = computed(() => {
17+
switch (props.size) {
18+
case 'xs':
19+
return 'size-6'
20+
case 'lg':
21+
return 'size-16'
22+
}
23+
})
24+
25+
const textClass = computed(() => {
26+
switch (props.size) {
27+
case 'xs':
28+
return 'text-xs'
29+
case 'lg':
30+
return 'text-2xl'
31+
}
32+
})
33+
634
const { data: gravatarUrl } = useLazyFetch(() => `/api/gravatar/${props.username}`, {
735
transform: res => (res.hash ? `/_avatar/${res.hash}?s=128&d=404` : null),
836
getCachedData(key, nuxtApp) {
@@ -14,7 +42,8 @@ const { data: gravatarUrl } = useLazyFetch(() => `/api/gravatar/${props.username
1442
<template>
1543
<!-- Avatar -->
1644
<div
17-
class="size-16 shrink-0 rounded-full bg-bg-muted border border-border flex items-center justify-center overflow-hidden"
45+
class="shrink-0 rounded-full bg-bg-muted border border-border flex items-center justify-center overflow-hidden"
46+
:class="sizeClass"
1847
role="img"
1948
:aria-label="`Avatar for ${username}`"
2049
>
@@ -23,13 +52,22 @@ const { data: gravatarUrl } = useLazyFetch(() => `/api/gravatar/${props.username
2352
v-if="gravatarUrl"
2453
:src="gravatarUrl"
2554
alt=""
26-
width="64"
27-
height="64"
55+
:width="sizePixels"
56+
:height="sizePixels"
2857
class="w-full h-full object-cover"
2958
/>
30-
<!-- Else fallback to initials -->
31-
<span v-else class="text-2xl text-fg-subtle font-mono" aria-hidden="true">
32-
{{ username.charAt(0).toUpperCase() }}
33-
</span>
59+
<!-- Else fallback to initials (use svg to avoid underline styling) -->
60+
<svg
61+
v-else
62+
xmlns="http://www.w3.org/2000/svg"
63+
:width="sizePixels"
64+
:height="sizePixels"
65+
class="text-fg-subtle"
66+
:class="textClass"
67+
>
68+
<text x="50%" y="50%" dominant-baseline="central" text-anchor="middle" fill="currentColor">
69+
{{ username.charAt(0).toUpperCase() }}
70+
</text>
71+
</svg>
3472
</div>
3573
</template>

app/composables/npm/useAlgoliaSearch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function hitToSearchResult(hit: AlgoliaHit): NpmSearchResult {
107107
}
108108
}
109109

110-
export interface AlgoliaSearchOptions {
110+
interface AlgoliaSearchOptions {
111111
size?: number
112112
from?: number
113113
filters?: string
@@ -121,7 +121,7 @@ export interface AlgoliaMultiSearchChecks {
121121
checkPackage?: string
122122
}
123123

124-
export interface AlgoliaSearchWithSuggestionsResult {
124+
interface AlgoliaSearchWithSuggestionsResult {
125125
search: NpmSearchResponse
126126
orgExists: boolean
127127
userExists: boolean

app/composables/npm/useNpmSearch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { emptySearchResponse, metaToSearchResult } from './search-utils'
22

3-
export interface NpmSearchOptions {
3+
interface NpmSearchOptions {
44
size?: number
55
from?: number
66
}

app/composables/useVirtualInfiniteScroll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface WindowVirtualizerHandle {
1111
) => void
1212
}
1313

14-
export interface UseVirtualInfiniteScrollOptions {
14+
interface UseVirtualInfiniteScrollOptions {
1515
/** Reference to the WindowVirtualizer component */
1616
listRef: Ref<WindowVirtualizerHandle | null>
1717
/** Current item count */

0 commit comments

Comments
 (0)