Skip to content

Commit 7fe20b9

Browse files
trueberrylessautofix-ci[bot]43081jghostdevv
authored
refactor: remove npms (#2155)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: James Garbutt <43081j@users.noreply.github.com> Co-authored-by: Willow (GHOST) <git@willow.sh>
1 parent 5658f1a commit 7fe20b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+425
-1291
lines changed

app/components/ColumnPicker.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ const columnLabels = computed(() => ({
4949
updated: $t('filters.columns.published'),
5050
maintainers: $t('filters.columns.maintainers'),
5151
keywords: $t('filters.columns.keywords'),
52-
qualityScore: $t('filters.columns.quality_score'),
53-
popularityScore: $t('filters.columns.popularity_score'),
54-
maintenanceScore: $t('filters.columns.maintenance_score'),
55-
combinedScore: $t('filters.columns.combined_score'),
5652
security: $t('filters.columns.security'),
5753
selection: $t('filters.columns.selection'),
5854
}))

app/components/Package/ListToolbar.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ const sortKeyLabelKeys = computed<Record<SortKey, string>>(() => ({
102102
'downloads-year': t('filters.sort.downloads_year'),
103103
'updated': t('filters.sort.published'),
104104
'name': t('filters.sort.name'),
105-
'quality': t('filters.sort.quality'),
106-
'popularity': t('filters.sort.popularity'),
107-
'maintenance': t('filters.sort.maintenance'),
108-
'score': t('filters.sort.score'),
109105
}))
110106
111107
function getSortKeyLabelKey(key: SortKey): string {

app/components/Package/Table.vue

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,13 @@ const columnToSortKey: Record<string, SortKey> = {
3737
name: 'name',
3838
downloads: 'downloads-week',
3939
updated: 'updated',
40-
qualityScore: 'quality',
41-
popularityScore: 'popularity',
42-
maintenanceScore: 'maintenance',
43-
combinedScore: 'score',
4440
}
4541
4642
// Default direction for each column
4743
const columnDefaultDirection: Record<string, 'asc' | 'desc'> = {
4844
name: 'asc',
4945
downloads: 'desc',
5046
updated: 'desc',
51-
qualityScore: 'desc',
52-
popularityScore: 'desc',
53-
maintenanceScore: 'desc',
54-
combinedScore: 'desc',
5547
}
5648
5749
function isColumnSorted(id: string): boolean {
@@ -97,10 +89,6 @@ const columnLabels = computed(() => ({
9789
updated: t('filters.columns.published'),
9890
maintainers: t('filters.columns.maintainers'),
9991
keywords: t('filters.columns.keywords'),
100-
qualityScore: t('filters.columns.quality_score'),
101-
popularityScore: t('filters.columns.popularity_score'),
102-
maintenanceScore: t('filters.columns.maintenance_score'),
103-
combinedScore: t('filters.columns.combined_score'),
10492
security: t('filters.columns.security'),
10593
selection: t('filters.columns.selection'),
10694
}))
@@ -264,38 +252,6 @@ function getColumnLabel(id: ColumnId): string {
264252
{{ getColumnLabel('keywords') }}
265253
</th>
266254

267-
<th
268-
v-if="isColumnVisible('qualityScore')"
269-
scope="col"
270-
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"
271-
>
272-
{{ getColumnLabel('qualityScore') }}
273-
</th>
274-
275-
<th
276-
v-if="isColumnVisible('popularityScore')"
277-
scope="col"
278-
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"
279-
>
280-
{{ getColumnLabel('popularityScore') }}
281-
</th>
282-
283-
<th
284-
v-if="isColumnVisible('maintenanceScore')"
285-
scope="col"
286-
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"
287-
>
288-
{{ getColumnLabel('maintenanceScore') }}
289-
</th>
290-
291-
<th
292-
v-if="isColumnVisible('combinedScore')"
293-
scope="col"
294-
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"
295-
>
296-
{{ getColumnLabel('combinedScore') }}
297-
</th>
298-
299255
<th
300256
v-if="isColumnVisible('security')"
301257
scope="col"

app/components/Package/TableRow.vue

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@ const emit = defineEmits<{
1414
}>()
1515
1616
const pkg = computed(() => props.result.package)
17-
const score = computed(() => props.result.score)
1817
1918
const updatedDate = computed(() => props.result.package.date)
2019
const { isPackageSelected, togglePackageSelection, canSelectMore } = usePackageSelection()
2120
const isSelected = computed<boolean>(() => {
2221
return isPackageSelected(props.result.package.name)
2322
})
2423
25-
function formatScore(value?: number): string {
26-
if (value === undefined || value === 0) return '-'
27-
return Math.round(value * 100).toString()
28-
}
29-
3024
function isColumnVisible(id: string): boolean {
3125
return props.columns.find(c => c.id === id)?.visible ?? false
3226
}
@@ -163,38 +157,6 @@ const compactNumberFormatter = useCompactNumberFormatter()
163157
<span v-else class="text-fg-subtle">-</span>
164158
</td>
165159

166-
<!-- Quality Score -->
167-
<td
168-
v-if="isColumnVisible('qualityScore')"
169-
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
170-
>
171-
{{ formatScore(score?.detail?.quality) }}
172-
</td>
173-
174-
<!-- Popularity Score -->
175-
<td
176-
v-if="isColumnVisible('popularityScore')"
177-
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
178-
>
179-
{{ formatScore(score?.detail?.popularity) }}
180-
</td>
181-
182-
<!-- Maintenance Score -->
183-
<td
184-
v-if="isColumnVisible('maintenanceScore')"
185-
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
186-
>
187-
{{ formatScore(score?.detail?.maintenance) }}
188-
</td>
189-
190-
<!-- Combined Score -->
191-
<td
192-
v-if="isColumnVisible('combinedScore')"
193-
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
194-
>
195-
{{ formatScore(score?.final) }}
196-
</td>
197-
198160
<!-- Security -->
199161
<td v-if="isColumnVisible('security')" class="py-2 px-3">
200162
<span v-if="result.flags?.insecure" class="text-syntax-kw">

app/composables/npm/search-utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export function metaToSearchResult(meta: PackageMetaResponse): NpmSearchResult {
1111
author: meta.author,
1212
maintainers: meta.maintainers,
1313
},
14-
score: { final: 0, detail: { quality: 0, popularity: 0, maintenance: 0 } },
1514
searchScore: 0,
1615
downloads: meta.weeklyDownloads !== undefined ? { weekly: meta.weeklyDownloads } : undefined,
1716
updated: meta.date,

app/composables/npm/useAlgoliaSearch.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ function hitToSearchResult(hit: AlgoliaHit): NpmSearchResult {
9191
}))
9292
: [],
9393
},
94-
score: {
95-
final: 0,
96-
detail: {
97-
quality: hit.popular ? 1 : 0,
98-
popularity: hit.downloadsRatio,
99-
maintenance: 0,
100-
},
101-
},
10294
searchScore: 0,
10395
downloads: {
10496
weekly: Math.round(hit.downloadsLast30Days / 4.3),

app/composables/useStructuredFilters.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -332,18 +332,6 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
332332
case 'name':
333333
diff = a.package.name.localeCompare(b.package.name)
334334
break
335-
case 'quality':
336-
diff = (a.score?.detail?.quality ?? 0) - (b.score?.detail?.quality ?? 0)
337-
break
338-
case 'popularity':
339-
diff = (a.score?.detail?.popularity ?? 0) - (b.score?.detail?.popularity ?? 0)
340-
break
341-
case 'maintenance':
342-
diff = (a.score?.detail?.maintenance ?? 0) - (b.score?.detail?.maintenance ?? 0)
343-
break
344-
case 'score':
345-
diff = (a.score?.final ?? 0) - (b.score?.final ?? 0)
346-
break
347335
case 'relevance':
348336
// Relevance preserves server order (already sorted by search relevance)
349337
diff = 0

app/pages/search.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ const ALL_SORT_KEYS: SortKey[] = [
134134
'downloads-year',
135135
'updated',
136136
'name',
137-
'quality',
138-
'popularity',
139-
'maintenance',
140-
'score',
141137
]
142138
143139
// Disable sort keys the current provider can't meaningfully sort by

docs/content/2.guide/6.badges.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ npmx.dev offers many different SVG badges with stats about any package via its A
2727
- **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"}
2828
- **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"}
2929
- **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"}
30-
- **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"}
31-
- **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"}
32-
- **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"}
33-
- **score**: The overall NPMS.io combined score. :img{src="https://img.shields.io/badge/%233b82f6-3b82f6" class="inline align-middle h-5 w-14"}
3430
- **name**: Simple badge displaying the package name. :img{src="https://img.shields.io/badge/%2364748b-64748b" class="inline align-middle h-5 w-14"}
3531

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

5753
[![Open on npmx.dev](https://npmx.dev/api/registry/badge/version/react/v/18.0.0)](https://npmx.dev/package/react)
58-
59-
# Quality Score
60-
61-
[![Open on npmx.dev](https://npmx.dev/api/registry/badge/quality/pinia)](https://npmx.dev/package/pinia)
6254
```
6355

6456
## Customization Parameters

docs/shared/utils/badges.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ export const BADGE_TYPES = Object.freeze([
1515
'types',
1616
'maintainers',
1717
'deprecated',
18-
'quality',
19-
'popularity',
20-
'maintenance',
21-
'score',
2218
'name',
2319
] as const)
2420

0 commit comments

Comments
 (0)