-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/remove local styling md #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import 'dotenv/config'; | |
| import { neon } from '@neondatabase/serverless'; | ||
| import { drizzle } from 'drizzle-orm/neon-http'; | ||
| import { apps, bumpRules, categories } from '../src/db/schema'; | ||
| import { eq } from 'drizzle-orm'; | ||
| import seedData from '../data/apps-seed.json'; | ||
|
|
||
| async function main() { | ||
|
|
@@ -31,12 +32,12 @@ async function main() { | |
| } | ||
| console.log(` ✓ ${seedData.categories.length} categories\n`); | ||
|
|
||
| // Seed apps | ||
| // Seed apps (upsert — re-running always reflects the JSON) | ||
| console.log('Seeding apps...'); | ||
| const appIdMap: Record<string, string> = {}; | ||
|
|
||
| for (const app of seedData.apps) { | ||
| const [inserted] = await db.insert(apps).values({ | ||
| const values = { | ||
| name: app.name, | ||
| slug: app.slug, | ||
| url: app.url, | ||
|
|
@@ -47,26 +48,47 @@ async function main() { | |
| isOfficial: app.is_official, | ||
| frequency: app.frequency, | ||
| featured: app.featured || false, | ||
| }).onConflictDoNothing().returning({ id: apps.id }); | ||
| }; | ||
|
|
||
| if (inserted) { | ||
| appIdMap[app.slug] = inserted.id; | ||
| console.log(` ✓ ${app.name}`); | ||
| } else { | ||
| console.log(` - ${app.name} (already exists)`); | ||
| } | ||
| const [upserted] = await db.insert(apps) | ||
| .values(values) | ||
| .onConflictDoUpdate({ | ||
| target: apps.slug, | ||
| set: { | ||
| name: values.name, | ||
| url: values.url, | ||
| description: values.description, | ||
| tagline: values.tagline, | ||
| category: values.category, | ||
| tags: values.tags, | ||
| isOfficial: values.isOfficial, | ||
| frequency: values.frequency, | ||
| featured: values.featured, | ||
| updatedAt: new Date(), | ||
| }, | ||
| }) | ||
| .returning({ id: apps.id }); | ||
|
|
||
| appIdMap[app.slug] = upserted.id; | ||
| console.log(` ✓ ${app.name}`); | ||
| } | ||
| console.log(`\n Total: ${Object.keys(appIdMap).length} apps seeded\n`); | ||
| console.log(`\n Total: ${Object.keys(appIdMap).length} apps upserted\n`); | ||
|
|
||
| // Seed bump rules for apps that have them | ||
| // Seed bump rules (delete + reinsert per app so JSON stays authoritative) | ||
| console.log('Seeding bump rules...'); | ||
| let ruleCount = 0; | ||
|
|
||
| for (const app of seedData.apps) { | ||
| if (app.bump_rules && appIdMap[app.slug]) { | ||
| if (!appIdMap[app.slug]) continue; | ||
| const appId = appIdMap[app.slug]; | ||
|
|
||
| // Clear existing rules for this app before reinserting | ||
| await db.delete(bumpRules).where(eq(bumpRules.appId, appId)); | ||
|
|
||
| if (app.bump_rules) { | ||
|
Comment on lines
81
to
+88
|
||
| for (const rule of app.bump_rules) { | ||
| await db.insert(bumpRules).values({ | ||
| appId: appIdMap[app.slug], | ||
| appId, | ||
| ruleType: rule.type, | ||
| startTime: rule.start || null, | ||
| endTime: rule.end || null, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR removes
STYLING.md, butclaude.mdstill listsSTYLING.mdin the repository tree earlier in the document. Update that section to avoid stale documentation references (or adjust the PR scope if the file is meant to remain).