tpmjs/packages/db/sync-single-tool.mjs
Ajax Davis fe96bc780d fix: update dependency cruiser config to allow TypeScript path aliases and workspace packages
- Add `^@/` to pathNot to allow Next.js `@/` path alias
- Add `^@tpmjs/` to pathNot to allow workspace package imports
- Fixes architecture check failures in CI
- Apply Biome formatting to check-tool.mjs and sync-single-tool.mjs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 01:55:51 +10:00

35 lines
1 KiB
JavaScript

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());