Skip to content

Commit 71785d6

Browse files
committed
fix: resolve CI failures (unused imports, type errors, i18n schema, a11y, component test)
1 parent a7d3613 commit 71785d6

File tree

6 files changed

+67
-27
lines changed

6 files changed

+67
-27
lines changed

app/components/AppFooter.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const closeModal = () => modalRef.value?.close?.()
2424
<div class="hidden sm:grid sm:grid-cols-2 lg:grid-cols-3 gap-x-10 gap-y-1 min-h-11 text-xs">
2525
<!-- Column 1: Product -->
2626
<div class="flex flex-col gap-1">
27-
<span class="text-fg-subtle uppercase tracking-wider text-2xs mb-1">{{ $t('footer.product') }}</span>
27+
<span class="text-fg-subtle uppercase tracking-wide text-2xs mb-1">{{ $t('footer.product') }}</span>
2828
<LinkBase :to="{ name: 'about' }">{{ $t('footer.about') }}</LinkBase>
2929
<LinkBase :to="{ name: 'blog' }">{{ $t('footer.blog') }}</LinkBase>
3030
<LinkBase :to="NPMX_DOCS_SITE">{{ $t('footer.docs') }}</LinkBase>
@@ -119,15 +119,15 @@ const closeModal = () => modalRef.value?.close?.()
119119

120120
<!-- Column 2: Legal & Info -->
121121
<div class="flex flex-col gap-1">
122-
<span class="text-fg-subtle uppercase tracking-wider text-2xs mb-1">{{ $t('footer.legal') }}</span>
122+
<span class="text-fg-subtle uppercase tracking-wide text-2xs mb-1">{{ $t('footer.legal') }}</span>
123123
<LinkBase :to="{ name: 'privacy' }">{{ $t('privacy_policy.title') }}</LinkBase>
124124
<LinkBase :to="{ name: 'accessibility' }">{{ $t('a11y.footer_title') }}</LinkBase>
125125
<LinkBase :to="{ name: 'translation-status' }">{{ $t('translation_status.title') }}</LinkBase>
126126
</div>
127127

128128
<!-- Column 3: Community -->
129129
<div class="flex flex-col gap-1">
130-
<span class="text-fg-subtle uppercase tracking-wider text-2xs mb-1">{{ $t('footer.community') }}</span>
130+
<span class="text-fg-subtle uppercase tracking-wide text-2xs mb-1">{{ $t('footer.community') }}</span>
131131
<LinkBase to="https://repo.npmx.dev">{{ $t('footer.source') }}</LinkBase>
132132
<LinkBase to="https://social.npmx.dev">{{ $t('footer.social') }}</LinkBase>
133133
<LinkBase :to="discord.url">{{ discord.label }}</LinkBase>

app/components/CollapsibleSection.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import { shallowRef, computed } from 'vue'
3-
import { LinkBase } from '#components'
43
54
interface Props {
65
title: string

app/pages/package/[[org]]/[name].vue

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ const latestVersion = computed(() => {
322322
})
323323
324324
// Detect license changes between current version and latest
325+
// SlimVersion does not carry license, so we compare against the package-level license
325326
const licenseChanged = computed(() => {
326327
const currentLicense = displayVersion.value?.license
327-
const latestLicense = latestVersion.value?.license ?? pkg.value?.license
328+
const latestLicense = pkg.value?.license
328329
if (!currentLicense || !latestLicense) return false
329-
// Normalize: compare string representations
330330
const normalize = (l: unknown): string =>
331331
typeof l === 'string' ? l : (l as { type?: string })?.type ?? ''
332332
return normalize(currentLicense) !== normalize(latestLicense)
@@ -394,18 +394,6 @@ const sizeTooltip = computed(() => {
394394
return chunks.filter(Boolean).join('\n')
395395
})
396396
397-
const hasDependencies = computed(() => {
398-
if (!displayVersion.value) return false
399-
const deps = displayVersion.value.dependencies
400-
const peerDeps = displayVersion.value.peerDependencies
401-
const optionalDeps = displayVersion.value.optionalDependencies
402-
return (
403-
(deps && Object.keys(deps).length > 0) ||
404-
(peerDeps && Object.keys(peerDeps).length > 0) ||
405-
(optionalDeps && Object.keys(optionalDeps).length > 0)
406-
)
407-
})
408-
409397
// Vulnerability count for the stats banner
410398
const vulnCount = computed(() => vulnTree.value?.totalCounts.total ?? 0)
411399
const hasVulnerabilities = computed(() => vulnCount.value > 0)
@@ -610,14 +598,14 @@ const showSkeleton = shallowRef(false)
610598
{{ $t('package.stats.license') }}
611599
</dt>
612600
<dd class="font-mono text-sm text-fg flex items-center gap-2 flex-wrap">
613-
<LicenseDisplay v-if="displayVersion?.license ?? pkg.license" :license="displayVersion?.license ?? pkg.license" />
601+
<LicenseDisplay v-if="displayVersion?.license ?? pkg.license" :license="(displayVersion?.license ?? pkg.license) as string" />
614602
<span v-else>{{ $t('package.license.none') }}</span>
615603
<TooltipApp
616604
v-if="licenseChanged"
617-
:text="$t('package.license.changed', { latest: latestVersion?.license ?? pkg.license })"
605+
:text="$t('package.license.changed', { latest: pkg.license })"
618606
position="bottom"
619607
>
620-
<span class="inline-flex items-center gap-1 px-1.5 py-0.5 text-2xs font-sans rounded bg-amber-500/15 text-amber-700 dark:text-amber-400 border border-amber-500/30 cursor-help">
608+
<span tabindex="0" class="inline-flex items-center gap-1 px-1.5 py-0.5 text-2xs font-sans rounded bg-amber-500/15 text-amber-700 dark:text-amber-400 border border-amber-500/30 cursor-help focus-visible:outline-2 focus-visible:outline-accent/70">
621609
<span class="i-lucide:triangle-alert w-3 h-3" aria-hidden="true" />
622610
{{ $t('package.license.changed_badge') }}
623611
</span>

app/pages/package/[[org]]/[name]/dependents.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ const resolvedVersion = computed(() => {
1919
return latest
2020
})
2121
22-
const displayVersion = computed(() => {
23-
if (!pkg.value || !resolvedVersion.value) return null
24-
return pkg.value.versions[resolvedVersion.value] ?? null
25-
})
22+
const displayVersion = computed(() => pkg.value?.requestedVersion ?? null)
2623
27-
const latestVersion = computed(() => displayVersion.value ?? null)
24+
const latestVersion = computed(() => {
25+
if (!pkg.value) return null
26+
const latestTag = pkg.value['dist-tags']?.latest
27+
if (!latestTag) return null
28+
return pkg.value.versions[latestTag] ?? null
29+
})
2830
2931
const versionUrlPattern = computed(() => {
3032
const split = packageName.value.split('/')

i18n/schema.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@
6363
},
6464
"keyboard_shortcuts": {
6565
"type": "string"
66+
},
67+
"product": {
68+
"type": "string"
69+
},
70+
"legal": {
71+
"type": "string"
72+
},
73+
"community": {
74+
"type": "string"
6675
}
6776
},
6877
"additionalProperties": false
@@ -625,6 +634,12 @@
625634
"scroll_to_top": {
626635
"type": "string"
627636
},
637+
"previous": {
638+
"type": "string"
639+
},
640+
"next": {
641+
"type": "string"
642+
},
628643
"cancel": {
629644
"type": "string"
630645
},
@@ -960,6 +975,9 @@
960975
},
961976
"compare_this_package": {
962977
"type": "string"
978+
},
979+
"dependents": {
980+
"type": "string"
963981
}
964982
},
965983
"additionalProperties": false
@@ -1060,6 +1078,27 @@
10601078
},
10611079
"additionalProperties": false
10621080
},
1081+
"dependents": {
1082+
"type": "object",
1083+
"properties": {
1084+
"title": {
1085+
"type": "string"
1086+
},
1087+
"subtitle": {
1088+
"type": "string"
1089+
},
1090+
"count": {
1091+
"type": "string"
1092+
},
1093+
"none": {
1094+
"type": "string"
1095+
},
1096+
"error": {
1097+
"type": "string"
1098+
}
1099+
},
1100+
"additionalProperties": false
1101+
},
10631102
"readme": {
10641103
"type": "object",
10651104
"properties": {
@@ -1368,6 +1407,9 @@
13681407
},
13691408
"vulnerabilities_count": {
13701409
"type": "string"
1410+
},
1411+
"none": {
1412+
"type": "string"
13711413
}
13721414
},
13731415
"additionalProperties": false
@@ -1698,6 +1740,12 @@
16981740
},
16991741
"none": {
17001742
"type": "string"
1743+
},
1744+
"changed_badge": {
1745+
"type": "string"
1746+
},
1747+
"changed": {
1748+
"type": "string"
17011749
}
17021750
},
17031751
"additionalProperties": false
@@ -2526,6 +2574,9 @@
25262574
},
25272575
"binary_rendering_warning": {
25282576
"type": "string"
2577+
},
2578+
"toggle_word_wrap": {
2579+
"type": "string"
25292580
}
25302581
},
25312582
"additionalProperties": false

server/api/registry/dependents/[...pkg].get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CACHE_MAX_AGE_FIVE_MINUTES, NPM_REGISTRY } from '#shared/utils/constants'
1+
import { CACHE_MAX_AGE_FIVE_MINUTES } from '#shared/utils/constants'
22

33
const NPM_SEARCH_BASE = 'https://registry.npmjs.org/-/v1/search'
44

0 commit comments

Comments
 (0)