Skip to content

Commit 69a3065

Browse files
authored
fix: fix font-sizes for NPM summary on library stat pages (#658)
* fix font-sizes * add missing corePackageNames * core package name fixes
1 parent 944dea0 commit 69a3065

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

src/components/npm-stats/NPMSummary.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function StatCard({
8686
return (
8787
<div className="flex flex-col items-center text-center">
8888
<div
89-
className="text-2xl sm:text-3xl md:text-4xl font-bold text-gray-900 dark:text-white"
89+
className="text-xl sm:text-xl md:text-2xl font-bold text-gray-900 dark:text-white"
9090
style={{ fontVariantNumeric: 'tabular-nums' }}
9191
>
9292
{animated && npmData ? (
@@ -113,18 +113,18 @@ function NPMSummaryContent({ library }: { library: Library }) {
113113
const { data: recentStats } = useSuspenseQuery(recentDownloadsQuery(library))
114114

115115
return (
116-
<div className="mb-6">
116+
<div className="my-6">
117117
<p className="text-sm text-gray-500 dark:text-gray-400 mb-4">
118118
View download statistics for TanStack {library.name} packages. Compare
119119
different time periods and track usage trends.
120120
</p>
121121

122-
<p className="text-xs text-gray-400 dark:text-gray-500 mt-3 italic">
122+
<p className="text-xs text-gray-400 dark:text-gray-500 my-3 italic">
123123
*These top summary stats account for core packages, legacy package
124124
names, and all framework adapters.
125125
</p>
126126

127-
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 sm:gap-6">
127+
<div className="grid grid-cols-2 gap-4 sm:gap-6 md:grid-cols-2 xl:grid-cols-4 py-6">
128128
<StatCard label="All Time Downloads" animated npmData={ossStats.npm} />
129129
<StatCard
130130
value={recentStats.monthlyDownloads}

src/libraries/libraries.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const router: LibrarySlim = {
5050
badge: undefined,
5151
repo: 'tanstack/router',
5252
frameworks: ['react', 'solid'],
53+
corePackageName: '@tanstack/router-core',
5354
latestVersion: 'v1',
5455
latestBranch: 'main',
5556
availableVersions: ['v1'],
@@ -129,7 +130,7 @@ export const table: LibrarySlim = {
129130
scarfId: 'dc8b39e1-3fe9-4f3a-8e56-d4e2cf420a9e',
130131
ogImage: 'https://github.com/tanstack/table/raw/main/media/repo-header.png',
131132
defaultDocs: 'introduction',
132-
corePackageName: 'table-core',
133+
corePackageName: '@tanstack/table-core',
133134
legacyPackages: ['react-table'],
134135
}
135136

@@ -150,6 +151,7 @@ export const form: LibrarySlim = {
150151
bgRadial: 'from-yellow-500 via-yellow-600/50 to-transparent',
151152
badge: 'new',
152153
repo: 'tanstack/form',
154+
corePackageName: '@tanstack/form-core',
153155
frameworks: ['react', 'vue', 'angular', 'solid', 'lit', 'svelte'],
154156
latestVersion: 'v1',
155157
latestBranch: 'main',
@@ -176,6 +178,7 @@ export const virtual: LibrarySlim = {
176178
badge: undefined,
177179
repo: 'tanstack/virtual',
178180
frameworks: ['react', 'solid', 'vue', 'svelte', 'lit', 'angular'],
181+
corePackageName: '@tanstack/virtual-core',
179182
latestVersion: 'v3',
180183
latestBranch: 'main',
181184
availableVersions: ['v3'],

src/libraries/table.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const tableProject = {
1414
bgRadial: 'from-cyan-500 via-blue-600/50 to-transparent',
1515
textColor: 'text-blue-600',
1616
defaultDocs: 'introduction',
17-
corePackageName: 'table-core',
1817
legacyPackages: ['react-table'],
1918
handleRedirects: (href: string) => {
2019
handleRedirects(

src/routes/$libraryId/$version.docs.framework.index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ function getPackageName(
2020
): string {
2121
if (frameworkValue === 'vanilla') {
2222
// For vanilla, use corePackageName if provided, otherwise just libraryId
23-
const coreName = library.corePackageName || libraryId
24-
return `@tanstack/${coreName}`
23+
return library.corePackageName ?? `@tanstack/${libraryId}`
2524
}
2625
// Special case: Angular Query uses experimental package
2726
if (frameworkValue === 'angular' && libraryId === 'query') {

src/utils/npm-packages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function getLibraryMainPackage(library: LibrarySlim): string {
112112

113113
// Use corePackageName if specified (e.g., table-core)
114114
if (library.corePackageName) {
115-
return `@tanstack/${library.corePackageName}`
115+
return library.corePackageName
116116
}
117117

118118
return `@tanstack/${library.id}`

0 commit comments

Comments
 (0)