Skip to content

Commit aecf787

Browse files
Merge branch 'main' into chore/settings-shortcut-comma-to-s
2 parents 1b11197 + 6db03a6 commit aecf787

File tree

29 files changed

+1585
-48
lines changed

29 files changed

+1585
-48
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: "\U0001F41E Bug report"
22
description: Create a report to help us improve npmx
3+
type: bug
4+
labels: ['pending triage']
35
body:
46
- type: markdown
57
attributes:

.github/ISSUE_TEMPLATE/feature-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: '🚀 Feature request'
22
description: Suggest a feature that will improve npmx
3+
type: feature
34
labels: ['pending triage']
45
body:
56
- type: markdown

.storybook/handlers.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,37 @@ export const contributorsHandler = http.get('/api/contributors', () => {
5757
},
5858
])
5959
})
60+
61+
export const pdsUsersHandler = http.get('/api/atproto/pds-users', () => {
62+
return HttpResponse.json([
63+
{
64+
did: 'did:plc:mock0001',
65+
handle: 'patak.dog',
66+
displayName: 'Patak Dog',
67+
avatar:
68+
'https://cdn.bsky.app/img/avatar/plain/did:plc:zjfptjaegvgc7r2axkkyyzqn/bafkreihrcqhp575f6dph4uztbeyxfrmfnbv7x2gvovrgu4idgdsdw7wety',
69+
},
70+
{
71+
did: 'did:plc:mock0002',
72+
handle: 'patakllama.mockpmx.social',
73+
displayName: 'Patak Llama',
74+
avatar: 'https://api.dicebear.com/9.x/initials/svg?seed=llama',
75+
},
76+
{
77+
did: 'did:plc:mock0003',
78+
handle: 'patak.horse',
79+
displayName: 'Patak Horse',
80+
avatar:
81+
'https://cdn.bsky.app/img/avatar/plain/did:plc:vqh7id7sddkrfkhgt7tstlpd/bafkreifodkgqszgpt2qnoyljnbafokr6eujqwztj2kxo473adv5b57hjse',
82+
},
83+
{
84+
did: 'did:plc:mock0004',
85+
handle: 'patakcatapiller.mockpmx.social',
86+
},
87+
{
88+
did: 'did:plc:mock0005',
89+
handle: 'patakgoat.mockpmx.social',
90+
displayName: 'Patak Goat',
91+
},
92+
])
93+
})

app/components/AppFooter.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ const closeModal = () => modalRef.value?.close?.()
120120
<kbd class="kbd">f</kbd>
121121
<span>{{ $t('shortcuts.open_diff') }}</span>
122122
</li>
123+
<li class="flex gap-2 items-center">
124+
<kbd class="kbd">t</kbd>
125+
<span>{{ $t('shortcuts.open_timeline') }}</span>
126+
</li>
123127
<li class="flex gap-2 items-center">
124128
<kbd class="kbd">c</kbd>
125129
<span>{{ $t('shortcuts.compare_from_package') }}</span>

app/components/Chart/SplitSparkline.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const props = defineProps<{
3131
3232
const { locale } = useI18n()
3333
const colorMode = useColorMode()
34+
const numberFormatter = useNumberFormatter({
35+
maximumFractionDigits: 0,
36+
})
3437
const resolvedMode = shallowRef<'light' | 'dark'>('light')
3538
const rootEl = shallowRef<HTMLElement | null>(null)
3639
const palette = getPalette('')
@@ -153,6 +156,9 @@ const configs = computed(() => {
153156
fontSize: 24,
154157
bold: false,
155158
color: colors.value.fg,
159+
formatter: ({ value }) => {
160+
return numberFormatter.value.format(value)
161+
},
156162
datetimeFormatter: {
157163
enable: true,
158164
locale: locale.value,

app/components/Package/Header.vue

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const props = defineProps<{
1010
latestVersion?: SlimVersion | null
1111
provenanceData?: ProvenanceDetails | null
1212
provenanceStatus?: string | null
13-
page: 'main' | 'docs' | 'code' | 'diff'
13+
page: 'main' | 'docs' | 'code' | 'diff' | 'timeline'
1414
versionUrlPattern: string
1515
}>()
1616
@@ -162,12 +162,26 @@ const diffLink = computed((): RouteLocationRaw | null => {
162162
return diffRoute(props.pkg.name, props.resolvedVersion, props.latestVersion.version)
163163
})
164164
165+
const timelineLink = computed((): RouteLocationRaw | null => {
166+
if (props.pkg == null || props.resolvedVersion == null) return null
167+
const split = props.pkg.name.split('/')
168+
return {
169+
name: 'timeline',
170+
params: {
171+
org: split.length === 2 ? split[0] : undefined,
172+
packageName: split.length === 2 ? split[1]! : split[0]!,
173+
version: props.resolvedVersion,
174+
},
175+
}
176+
})
177+
165178
useShortcuts({
166179
'.': () => codeLink.value,
167180
'm': () => mainLink.value,
168181
'd': () => docsLink.value,
169182
'c': () => props.pkg && { name: 'compare' as const, query: { packages: props.pkg.name } },
170183
'f': () => diffLink.value,
184+
't': () => timelineLink.value,
171185
})
172186
</script>
173187

@@ -330,6 +344,15 @@ useShortcuts({
330344
>
331345
{{ $t('compare.compare_versions') }}
332346
</LinkBase>
347+
<LinkBase
348+
v-if="timelineLink"
349+
:to="timelineLink"
350+
aria-keyshortcuts="t"
351+
class="decoration-none border-b-2 p-1 hover:border-accent/50 focus-visible:[outline-offset:-2px]!"
352+
:class="page === 'timeline' ? 'border-accent text-accent!' : 'border-transparent'"
353+
>
354+
{{ $t('package.links.timeline') }}
355+
</LinkBase>
333356
</nav>
334357
</div>
335358
</div>

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ function handleModalTransitioned() {
6060
}
6161
6262
const { fetchPackageDownloadEvolution } = useCharts()
63+
const numberFormatter = useNumberFormatter({
64+
maximumFractionDigits: 0,
65+
})
6366
6467
const { accentColors, selectedAccentColor } = useAccentColor()
6568
@@ -359,6 +362,9 @@ const config = computed<VueUiSparklineConfig>(() => {
359362
fontSize: 28,
360363
bold: false,
361364
color: colors.value.fg,
365+
formatter: ({ value }) => {
366+
return numberFormatter.value.format(value)
367+
},
362368
},
363369
line: {
364370
color: colors.value.borderHover,

app/components/Readme.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function handleClick(event: MouseEvent) {
8989
min-width: 0;
9090
/* Contain all children z-index values inside this container */
9191
isolation: isolate;
92+
contain: layout paint;
9293
}
9394
9495
/* README headings - styled by visual level (data-level), not semantic level */

app/components/Tab/Panel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const resolvedTabId = computed(() => getTabId(props.value))
2121

2222
<template>
2323
<div
24-
v-show="isSelected"
24+
v-if="isSelected"
2525
:id="resolvedPanelId"
2626
role="tabpanel"
2727
:aria-labelledby="resolvedTabId"

app/composables/npm/useAlgoliaSearch.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ export function useAlgoliaSearch() {
161161
}
162162
}
163163

164-
/** Fetch all packages for an owner using `owner.name` filter with pagination. */
165-
async function searchByOwner(
164+
/** Fetch all packages for a maintainer using `owners.name` filter with pagination. */
165+
async function searchByMaintainer(
166166
ownerName: string,
167167
options: { maxResults?: number } = {},
168168
): Promise<NpmSearchResponse> {
@@ -185,7 +185,7 @@ export function useAlgoliaSearch() {
185185
query: '',
186186
offset,
187187
length,
188-
filters: `owner.name:${ownerName}`,
188+
filters: `owners.name:${ownerName}`,
189189
analyticsTags: ['npmx.dev'],
190190
attributesToRetrieve: ATTRIBUTES_TO_RETRIEVE,
191191
attributesToHighlight: [],
@@ -286,7 +286,7 @@ export function useAlgoliaSearch() {
286286
requests.push({
287287
indexName,
288288
query: '',
289-
filters: `owner.name:${checks.name}`,
289+
filters: `owners.name:${checks.name}`,
290290
length: 1,
291291
analyticsTags: ['npmx.dev'],
292292
attributesToRetrieve: EXISTENCE_CHECK_ATTRS,
@@ -347,7 +347,7 @@ export function useAlgoliaSearch() {
347347
return {
348348
search,
349349
searchWithSuggestions,
350-
searchByOwner,
350+
searchByMaintainer,
351351
getPackagesByName,
352352
}
353353
}

0 commit comments

Comments
 (0)