|
44 | 44 | $fetch<{ downloads: number }>( |
45 | 45 | `https://api.npmjs.org/downloads/point/last-week/${encoded}`, |
46 | 46 | ).catch(() => null), |
47 | | - $fetch<{ 'dist-tags'?: { latest?: string } }>( |
48 | | - `https://registry.npmjs.org/${encoded}`, |
49 | | - { headers: { Accept: 'application/vnd.npm.install-v1+json' } }, |
50 | | - ).catch(() => null), |
| 47 | + $fetch<{ 'dist-tags'?: { latest?: string } }>(`https://registry.npmjs.org/${encoded}`, { |
| 48 | + headers: { Accept: 'application/vnd.npm.install-v1+json' }, |
| 49 | + }).catch(() => null), |
51 | 50 | ]) |
52 | 51 | return { |
53 | 52 | name, |
@@ -118,31 +117,20 @@ function barPct(downloads: number): string { |
118 | 117 | class="opacity-80 tracking-[-0.1em]" |
119 | 118 | :style="{ color: primaryColor }" |
120 | 119 | style="margin-right: 0.25rem" |
121 | | - >./</span>compare |
| 120 | + >./</span |
| 121 | + >compare |
122 | 122 | </h1> |
123 | 123 | </div> |
124 | 124 |
|
125 | 125 | <!-- Bar chart rows --> |
126 | 126 | <div class="flex flex-col gap-2"> |
127 | | - <div |
128 | | - v-for="pkg in stats" |
129 | | - :key="pkg.name" |
130 | | - class="flex flex-col gap-1" |
131 | | - > |
| 127 | + <div v-for="pkg in stats" :key="pkg.name" class="flex flex-col gap-1"> |
132 | 128 | <!-- Label row: name + downloads + version --> |
133 | | - <div |
134 | | - class="flex items-center gap-3" |
135 | | - style="font-family: 'Geist', sans-serif" |
136 | | - > |
137 | | - <span |
138 | | - class="text-2xl font-semibold tracking-tight" |
139 | | - :style="{ color: pkg.color }" |
140 | | - > |
| 129 | + <div class="flex items-center gap-3" style="font-family: 'Geist', sans-serif"> |
| 130 | + <span class="text-2xl font-semibold tracking-tight" :style="{ color: pkg.color }"> |
141 | 131 | {{ pkg.name }} |
142 | 132 | </span> |
143 | | - <span class="text-xl text-[#737373]"> |
144 | | - {{ formatDownloads(pkg.downloads) }}/wk |
145 | | - </span> |
| 133 | + <span class="text-xl text-[#737373]"> {{ formatDownloads(pkg.downloads) }}/wk </span> |
146 | 134 | <span |
147 | 135 | v-if="pkg.version" |
148 | 136 | class="text-lg px-2 py-0.5 rounded-md border" |
|
0 commit comments