Skip to content
Open
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
4 changes: 0 additions & 4 deletions app/components/ColumnPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ const columnLabels = computed(() => ({
updated: $t('filters.columns.published'),
maintainers: $t('filters.columns.maintainers'),
keywords: $t('filters.columns.keywords'),
qualityScore: $t('filters.columns.quality_score'),
popularityScore: $t('filters.columns.popularity_score'),
maintenanceScore: $t('filters.columns.maintenance_score'),
combinedScore: $t('filters.columns.combined_score'),
security: $t('filters.columns.security'),
selection: $t('filters.columns.selection'),
}))
Expand Down
4 changes: 0 additions & 4 deletions app/components/Package/ListToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ const sortKeyLabelKeys = computed<Record<SortKey, string>>(() => ({
'downloads-year': t('filters.sort.downloads_year'),
'updated': t('filters.sort.published'),
'name': t('filters.sort.name'),
'quality': t('filters.sort.quality'),
'popularity': t('filters.sort.popularity'),
'maintenance': t('filters.sort.maintenance'),
'score': t('filters.sort.score'),
}))

function getSortKeyLabelKey(key: SortKey): string {
Expand Down
44 changes: 0 additions & 44 deletions app/components/Package/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,13 @@ const columnToSortKey: Record<string, SortKey> = {
name: 'name',
downloads: 'downloads-week',
updated: 'updated',
qualityScore: 'quality',
popularityScore: 'popularity',
maintenanceScore: 'maintenance',
combinedScore: 'score',
}

// Default direction for each column
const columnDefaultDirection: Record<string, 'asc' | 'desc'> = {
name: 'asc',
downloads: 'desc',
updated: 'desc',
qualityScore: 'desc',
popularityScore: 'desc',
maintenanceScore: 'desc',
combinedScore: 'desc',
}

function isColumnSorted(id: string): boolean {
Expand Down Expand Up @@ -97,10 +89,6 @@ const columnLabels = computed(() => ({
updated: t('filters.columns.published'),
maintainers: t('filters.columns.maintainers'),
keywords: t('filters.columns.keywords'),
qualityScore: t('filters.columns.quality_score'),
popularityScore: t('filters.columns.popularity_score'),
maintenanceScore: t('filters.columns.maintenance_score'),
combinedScore: t('filters.columns.combined_score'),
security: t('filters.columns.security'),
selection: t('filters.columns.selection'),
}))
Expand Down Expand Up @@ -264,38 +252,6 @@ function getColumnLabel(id: ColumnId): string {
{{ getColumnLabel('keywords') }}
</th>

<th
v-if="isColumnVisible('qualityScore')"
scope="col"
class="py-3 px-3 text-xs text-start text-fg-muted font-mono font-medium uppercase tracking-wider whitespace-nowrap select-none text-end"
>
{{ getColumnLabel('qualityScore') }}
</th>

<th
v-if="isColumnVisible('popularityScore')"
scope="col"
class="py-3 px-3 text-xs text-start text-fg-muted font-mono font-medium uppercase tracking-wider whitespace-nowrap select-none text-end"
>
{{ getColumnLabel('popularityScore') }}
</th>

<th
v-if="isColumnVisible('maintenanceScore')"
scope="col"
class="py-3 px-3 text-xs text-start text-fg-muted font-mono font-medium uppercase tracking-wider whitespace-nowrap select-none text-end"
>
{{ getColumnLabel('maintenanceScore') }}
</th>

<th
v-if="isColumnVisible('combinedScore')"
scope="col"
class="py-3 px-3 text-xs text-start text-fg-muted font-mono font-medium uppercase tracking-wider whitespace-nowrap select-none text-end"
>
{{ getColumnLabel('combinedScore') }}
</th>

<th
v-if="isColumnVisible('security')"
scope="col"
Expand Down
38 changes: 0 additions & 38 deletions app/components/Package/TableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@ const emit = defineEmits<{
}>()

const pkg = computed(() => props.result.package)
const score = computed(() => props.result.score)

const updatedDate = computed(() => props.result.package.date)
const { isPackageSelected, togglePackageSelection, canSelectMore } = usePackageSelection()
const isSelected = computed<boolean>(() => {
return isPackageSelected(props.result.package.name)
})

function formatScore(value?: number): string {
if (value === undefined || value === 0) return '-'
return Math.round(value * 100).toString()
}

function isColumnVisible(id: string): boolean {
return props.columns.find(c => c.id === id)?.visible ?? false
}
Expand Down Expand Up @@ -163,38 +157,6 @@ const compactNumberFormatter = useCompactNumberFormatter()
<span v-else class="text-fg-subtle">-</span>
</td>

<!-- Quality Score -->
<td
v-if="isColumnVisible('qualityScore')"
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
>
{{ formatScore(score?.detail?.quality) }}
</td>

<!-- Popularity Score -->
<td
v-if="isColumnVisible('popularityScore')"
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
>
{{ formatScore(score?.detail?.popularity) }}
</td>

<!-- Maintenance Score -->
<td
v-if="isColumnVisible('maintenanceScore')"
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
>
{{ formatScore(score?.detail?.maintenance) }}
</td>

<!-- Combined Score -->
<td
v-if="isColumnVisible('combinedScore')"
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
>
{{ formatScore(score?.final) }}
</td>

<!-- Security -->
<td v-if="isColumnVisible('security')" class="py-2 px-3">
<span v-if="result.flags?.insecure" class="text-syntax-kw">
Expand Down
1 change: 0 additions & 1 deletion app/composables/npm/search-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export function metaToSearchResult(meta: PackageMetaResponse): NpmSearchResult {
author: meta.author,
maintainers: meta.maintainers,
},
score: { final: 0, detail: { quality: 0, popularity: 0, maintenance: 0 } },
searchScore: 0,
downloads: meta.weeklyDownloads !== undefined ? { weekly: meta.weeklyDownloads } : undefined,
updated: meta.date,
Expand Down
8 changes: 0 additions & 8 deletions app/composables/npm/useAlgoliaSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ function hitToSearchResult(hit: AlgoliaHit): NpmSearchResult {
}))
: [],
},
score: {
final: 0,
detail: {
quality: hit.popular ? 1 : 0,
popularity: hit.downloadsRatio,
maintenance: 0,
},
},
searchScore: 0,
downloads: {
weekly: Math.round(hit.downloadsLast30Days / 4.3),
Expand Down
12 changes: 0 additions & 12 deletions app/composables/useStructuredFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,18 +332,6 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
case 'name':
diff = a.package.name.localeCompare(b.package.name)
break
case 'quality':
diff = (a.score?.detail?.quality ?? 0) - (b.score?.detail?.quality ?? 0)
break
case 'popularity':
diff = (a.score?.detail?.popularity ?? 0) - (b.score?.detail?.popularity ?? 0)
break
case 'maintenance':
diff = (a.score?.detail?.maintenance ?? 0) - (b.score?.detail?.maintenance ?? 0)
break
case 'score':
diff = (a.score?.final ?? 0) - (b.score?.final ?? 0)
break
case 'relevance':
// Relevance preserves server order (already sorted by search relevance)
diff = 0
Expand Down
4 changes: 0 additions & 4 deletions app/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ const ALL_SORT_KEYS: SortKey[] = [
'downloads-year',
'updated',
'name',
'quality',
'popularity',
'maintenance',
'score',
]

// Disable sort keys the current provider can't meaningfully sort by
Expand Down
8 changes: 0 additions & 8 deletions docs/content/2.guide/6.badges.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ npmx.dev offers many different SVG badges with stats about any package via its A
- **types**: Indicates if TypeScript types are included. :img{src="https://img.shields.io/badge/%233b82f6-3b82f6" class="inline align-middle h-5 w-14"} / :img{src="https://img.shields.io/badge/%2364748b-64748b" class="inline align-middle h-5 w-14"}
- **maintainers**: Displays the total count of package maintainers. :img{src="https://img.shields.io/badge/%2306b6d4-06b6d4" class="inline align-middle h-5 w-14"}
- **deprecated**: Shows if the package is active or deprecated. :img{src="https://img.shields.io/badge/%2322c55e-22c55e" class="inline align-middle h-5 w-14"} / :img{src="https://img.shields.io/badge/%23ef4444-ef4444" class="inline align-middle h-5 w-14"}
- **quality**: NPMS.io quality score based on linting and tests. :img{src="https://img.shields.io/badge/%23a855f7-a855f7" class="inline align-middle h-5 w-14"}
- **popularity**: NPMS.io popularity score based on downloads and stars. :img{src="https://img.shields.io/badge/%2306b6d4-06b6d4" class="inline align-middle h-5 w-14"}
- **maintenance**: NPMS.io maintenance score based on activity. :img{src="https://img.shields.io/badge/%23eab308-eab308" class="inline align-middle h-5 w-14"}
- **score**: The overall NPMS.io combined score. :img{src="https://img.shields.io/badge/%233b82f6-3b82f6" class="inline align-middle h-5 w-14"}
- **name**: Simple badge displaying the package name. :img{src="https://img.shields.io/badge/%2364748b-64748b" class="inline align-middle h-5 w-14"}

## Examples
Expand All @@ -55,10 +51,6 @@ npmx.dev offers many different SVG badges with stats about any package via its A
# Specific Version

[![Open on npmx.dev](https://npmx.dev/api/registry/badge/version/react/v/18.0.0)](https://npmx.dev/package/react)

# Quality Score

[![Open on npmx.dev](https://npmx.dev/api/registry/badge/quality/pinia)](https://npmx.dev/package/pinia)
```

## Customization Parameters
Expand Down
41 changes: 32 additions & 9 deletions i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
"links": "روابط",
"tap_to_search": "اضغط للبحث"
},
"blog": {
"author": {},
"atproto": {}
},
"settings": {
"title": "الإعدادات",
"tagline": "تخصيص تجربتك على npmx",
Expand Down Expand Up @@ -122,6 +126,7 @@
"edit_on_github": "تعديل على GitHub",
"view_guide": "دليل الترجمة"
},
"error": {},
"common": {
"loading": "جارٍ التحميل…",
"loading_more": "جارٍ تحميل المزيد…",
Expand Down Expand Up @@ -149,6 +154,9 @@
"github": "عرض على GitHub"
}
},
"profile": {
"invite": {}
},
"package": {
"not_found": "لم يتم العثور على الحزمة",
"not_found_message": "تعذّر العثور على الحزمة.",
Expand All @@ -161,6 +169,7 @@
"version": "تم إهمال هذا الإصدار.",
"no_reason": "لم يتم تقديم سبب"
},
"size_increase": {},
"replacement": {
"title": "قد لا تحتاج إلى هذه التبعية.",
"native": "يمكن استبدالها بـ {replacement}، المتوفرة منذ Node {nodeVersion}.",
Expand Down Expand Up @@ -307,7 +316,8 @@
"filter_help": "مساعدة فلتر نطاق semver",
"filter_tooltip": "فلترة الإصدارات باستخدام {link}. مثلاً ^3.0.0 يعرض كل إصدارات 3.x.",
"filter_tooltip_link": "نطاق semver",
"no_matches": "لا توجد إصدارات تطابق هذا النطاق"
"no_matches": "لا توجد إصدارات تطابق هذا النطاق",
"copy_alt": {}
},
"dependencies": {
"title": "التبعيات ({count})",
Expand Down Expand Up @@ -367,7 +377,8 @@
"downloads": "التنزيلات",
"likes": "الإعجابات",
"contributors": "المساهمون"
}
},
"copy_alt": {}
},
"downloads": {
"title": "التنزيلات الأسبوعية",
Expand Down Expand Up @@ -460,7 +471,8 @@
"b": "{size} بايت",
"kb": "{size} كيلوبايت",
"mb": "{size} ميجابايت"
}
},
"download": {}
},
"connector": {
"modal": {
Expand Down Expand Up @@ -754,10 +766,6 @@
"published": "آخر نشر",
"maintainers": "المشرفون",
"keywords": "الكلمات المفتاحية",
"quality_score": "درجة الجودة",
"popularity_score": "درجة الشعبية",
"maintenance_score": "درجة الصيانة",
"combined_score": "الدرجة المجمعة",
"security": "الأمان"
},
"view_mode": {
Expand Down Expand Up @@ -814,6 +822,8 @@
"managers": "مديري"
}
},
"sponsors": {},
"oss_partners": {},
"team": {
"title": "الفريق",
"governance": "الحوكمة",
Expand Down Expand Up @@ -841,6 +851,7 @@
"description": "تحدث، اطرح الأسئلة، وشارك الأفكار.",
"cta": "انضم إلى Discord"
},
"builders": {},
"follow": {
"title": "ابقَ على اطلاع",
"description": "اكتشف آخر الأخبار عن npmx.",
Expand Down Expand Up @@ -1013,7 +1024,15 @@
"trends": {
"title": "مقارنة التوجهات"
}
}
},
"version_invalid_url_format": {},
"file_filter_option": {},
"filter": {}
},
"pds": {
"join": {},
"server": {},
"community": {}
},
"privacy_policy": {
"title": "سياسة الخصوصية",
Expand Down Expand Up @@ -1124,5 +1143,9 @@
"p1": "إذا واجهت عائقاً في إمكانية الوصول على {app}، يرجى إبلاغنا بفتح بلاغ في {link}. نأخذ هذه البلاغات على محمل الجد وسنبذل قصارى جهدنا لمعالجتها.",
"link": "مستودع GitHub"
}
}
},
"translation_status": {
"table": {}
},
"action_bar": {}
}
14 changes: 8 additions & 6 deletions i18n/locales/az-AZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@
"b": "{size} B",
"kb": "{size} kB",
"mb": "{size} MB"
}
},
"download": {}
},
"connector": {
"modal": {
Expand Down Expand Up @@ -869,10 +870,6 @@
"published": "Son Dərc",
"maintainers": "Dəstəkçilər",
"keywords": "Açar sözlər",
"quality_score": "Keyfiyyət xalı",
"popularity_score": "Populyarlıq xalı",
"maintenance_score": "Baxım xalı",
"combined_score": "Ümumi xal",
"security": "Təhlükəsizlik"
},
"view_mode": {
Expand Down Expand Up @@ -1149,6 +1146,7 @@
"file_size_warning": "{size} müqayisə üçün 250KB limitini keçir",
"compare_versions": "fərq",
"compare_versions_title": "Versiyaları müqayisə et",
"version_invalid_url_format": {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use a string (or omit the key) for compare.version_invalid_url_format.

Line 1149 sets this to {}, but this key is a user-facing message slot and should not be an object. Either provide a translated string or remove it to fall back to the base locale.

Suggested fix
-    "version_invalid_url_format": {},

Based on learnings: in this project, non-English locale files may omit keys that exist in English.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"version_invalid_url_format": {},

"summary": "Xülasə",
"deps_count": "{count} asılılıq",
"dependencies": "Asılılıqlar",
Expand Down Expand Up @@ -1313,5 +1311,9 @@
"p1": "{app} saytında əlçatanlıq maneəsi ilə qarşılaşsanız, xahiş edirik {link} issue açaraq bizə bildirin. Bu hesabatları ciddi qəbul edirik və onları həll etmək üçün əlimizdən gələni edəcəyik.",
"link": "GitHub repozitoriyası"
}
}
},
"translation_status": {
"table": {}
},
"action_bar": {}
}
Loading
Loading