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
50 changes: 10 additions & 40 deletions packages/docs/src/components/DependencyStats.astro
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const stats = statsEntries.map((entry) => entry.data)
<th scope="col">Framework</th>
<th scope="col">Prod Deps</th>
<th scope="col">Dev Deps</th>
<th scope="col">Graph</th>
</tr>
</thead>
<tbody>
Expand All @@ -44,37 +45,21 @@ const stats = statsEntries.map((entry) => entry.data)
<td class="framework-name">{framework.name}</td>
<td>{framework.prodDependencies}</td>
<td>{framework.devDependencies}</td>
</tr>
))
}
</tbody>
</table>
</div>
<div class="details-section">
<h3>Details</h3>
<ul class="framework-links">
{
stats.map((framework) => (
<li>
<strong>{framework.name}</strong>
{framework.npmGraphUrl && (
<span>
{' '}
-{' '}
<td>
<a
href={framework.npmGraphUrl}
href={`https://npmgraph.js.org/?q=https://github.com/e18e/framework-tracker/blob/main/packages/${framework.package}/package.json`}
target="_blank"
rel="noopener noreferrer"
class="graph-link"
>
View Dependency Graph
View
</a>
</span>
)}
</li>
))
}
</ul>
</td>
</tr>
))
}
</tbody>
</table>
</div>

<div class="table-wrapper">
Expand Down Expand Up @@ -181,21 +166,6 @@ const stats = statsEntries.map((entry) => entry.data)
margin-bottom: 2em;
}

.details-section {
margin-bottom: 2em;
}

.framework-links {
list-style: none;
padding: 0;
margin: 0;
}

.framework-links li {
padding: 8px 0;
color: #213547;
}

.coming-soon {
color: #6b7280;
font-style: italic;
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const statsCollection = defineCollection({
type: z.string(),
prodDependencies: z.number(),
devDependencies: z.number(),
npmGraphUrl: z.string().url().optional(),
package: z.string(),
installTimeMs: z.number(),
coldBuildTimeMs: z.number(),
warmBuildTimeMs: z.number(),
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/content/stats/starter-next-js.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "starter-kit",
"prodDependencies": 3,
"devDependencies": 6,
"npmGraphUrl": "https://npmgraph.js.org/?q=https://github.com/e18e/framework-tracker/blob/main/packages/starter-next-js/package.json",
"package": "starter-next-js",
"installTimeMs": 7307,
"coldBuildTimeMs": 8293,
"warmBuildTimeMs": 7593,
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/content/stats/starter-nuxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "starter-kit",
"prodDependencies": 3,
"devDependencies": 2,
"npmGraphUrl": "https://npmgraph.js.org/?q=https://github.com/e18e/framework-tracker/blob/main/packages/starter-nuxt/package.json",
"package": "starter-nuxt",
"installTimeMs": 7369,
"coldBuildTimeMs": 6721,
"warmBuildTimeMs": 6627,
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/content/stats/starter-react-router.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "starter-kit",
"prodDependencies": 6,
"devDependencies": 8,
"npmGraphUrl": "https://npmgraph.js.org/?q=https://github.com/e18e/framework-tracker/blob/main/packages/starter-react-router/package.json",
"package": "starter-react-router",
"installTimeMs": 2960,
"coldBuildTimeMs": 3017,
"warmBuildTimeMs": 3053,
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/content/stats/starter-sveltekit.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "starter-kit",
"prodDependencies": 0,
"devDependencies": 7,
"npmGraphUrl": "https://npmgraph.js.org/?q=https://github.com/e18e/framework-tracker/blob/main/packages/starter-sveltekit/package.json",
"package": "starter-sveltekit",
"installTimeMs": 2410,
"coldBuildTimeMs": 4552,
"warmBuildTimeMs": 4230,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "starter-kit",
"prodDependencies": 13,
"devDependencies": 11,
"npmGraphUrl": "https://npmgraph.js.org/?q=https://github.com/e18e/framework-tracker/blob/main/packages/starter-tanstack-start-react/package.json",
"package": "starter-tanstack-start-react",
"installTimeMs": 4545,
"coldBuildTimeMs": 10014,
"warmBuildTimeMs": 9559,
Expand Down
8 changes: 7 additions & 1 deletion packages/stats-generator/src/create-stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ async function processFramework(framework: FrameworkConfig) {

const ciStats = (await getCIStats(pkgDir)) ?? {}

const stats: FrameworkStats = { ...dependencyStats, ...ciStats }
const stats: FrameworkStats = {
name: displayName,
package: pkgDir,
type: 'starter-kit',
...dependencyStats,
...ciStats,
}

await saveStats(pkgDir, stats)
console.log(`✓ Processed ${displayName} (${pkgDir})`)
Expand Down
9 changes: 5 additions & 4 deletions packages/stats-generator/src/save-stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ export async function saveStats(packageName: string, stats: FrameworkStats) {
mergedStats = { ...existingStats, ...stats }
} catch (error) {
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
throw new Error(`Initial stats file does not exist: ${filePath}`)
// File doesn't exist yet, will create it with the new stats
} else {
throw new Error(
`Failed to read/parse stats for ${packageName}: ${error instanceof Error ? error.message : String(error)}`,
)
}
throw new Error(
`Failed to read/parse stats for ${packageName}: ${error instanceof Error ? error.message : String(error)}`,
)
}

await writeFile(filePath, JSON.stringify(mergedStats, null, 2), 'utf-8')
Expand Down
3 changes: 3 additions & 0 deletions packages/stats-generator/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export interface CIStats {
}

export interface FrameworkStats extends CIStats {
name?: string
package?: string
type?: string
prodDependencies?: number
devDependencies?: number
}
Expand Down