diff --git a/apps/web/src/components/Markdown.tsx b/apps/web/src/components/Markdown.tsx index 8f6f1e0..8caef0a 100644 --- a/apps/web/src/components/Markdown.tsx +++ b/apps/web/src/components/Markdown.tsx @@ -13,44 +13,49 @@ interface MarkdownProps { /** * Markdown renderer component * Safely renders markdown content with GitHub Flavored Markdown support + * Styled to match npm.com's beautiful README rendering */ export function Markdown({ content, className = '' }: MarkdownProps): React.ReactElement { return (
{ const isInline = !className; if (isInline) { return ( - + {children} ); @@ -61,7 +66,18 @@ export function Markdown({ content, className = '' }: MarkdownProps): React.Reac ); }, - // Make links open in new tab + // Better styled pre blocks + pre: ({ children, ...props }) => { + return ( +
+                {children}
+              
+ ); + }, + // Make links open in new tab with better styling a: ({ href, children, ...props }) => { const isExternal = href?.startsWith('http'); return ( @@ -69,13 +85,26 @@ export function Markdown({ content, className = '' }: MarkdownProps): React.Reac href={href} target={isExternal ? '_blank' : undefined} rel={isExternal ? 'noopener noreferrer' : undefined} - className="text-primary hover:underline" + className="text-blue-600 dark:text-blue-400 hover:underline font-medium" {...props} > {children} ); }, + // Better table styling + table: ({ children, ...props }) => { + return ( +
+ + {children} +
+
+ ); + }, }} > {content} diff --git a/packages/db/sync-single-tool.mjs b/packages/db/sync-single-tool.mjs new file mode 100644 index 0000000..e7decfc --- /dev/null +++ b/packages/db/sync-single-tool.mjs @@ -0,0 +1,35 @@ +import { PrismaClient } from '@prisma/client'; +import { fetchLatestPackageWithMetadata } from '@tpmjs/npm-client'; + +const prisma = new PrismaClient(); + +async function main() { + const packageName = '@tpmjs/text-transformer'; + + console.log(`Fetching metadata for ${packageName}...`); + const pkg = await fetchLatestPackageWithMetadata(packageName); + + if (!pkg) { + console.error('Package not found!'); + return; + } + + console.log(`Found ${packageName} v${pkg.version}`); + console.log(`README length: ${pkg.readme ? pkg.readme.length : 0} chars`); + console.log(`Keywords: ${(pkg.topLevelKeywords || pkg.keywords || []).join(', ')}`); + + // Update the tool in the database + await prisma.tool.update({ + where: { npmPackageName: packageName }, + data: { + npmReadme: pkg.readme || null, + npmKeywords: pkg.topLevelKeywords || pkg.keywords || [], + npmAuthor: pkg.author || null, + npmMaintainers: pkg.maintainers || null, + } + }); + + console.log('\n✅ Tool updated successfully!'); +} + +main().finally(() => prisma.$disconnect());