Conversation
Make the seeder idempotent: scripts/seed-apps.ts now upserts apps (onConflictDoUpdate) and returns app IDs instead of skipping existing records, and it updates updatedAt. Bump rules are cleared per-app before reinserting so the JSON remains authoritative, and apps without a DB id are skipped. Update seed data (data/apps-seed.json) to add new teaching apps and adjust featured flags. Minor import tweaks (added eq/asc) to support the changes.
Design system docs moved to string/STYLING.md so all String apps can reference it via the parent CLAUDE.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR removes the local styling/design-system markdown document and updates seeding + documentation to better reflect current app directory/profile behavior, while also extending the seed dataset.
Changes:
- Deleted
STYLING.mdfrom the repo. - Updated
scripts/seed-apps.tsto upsert apps fromapps-seed.jsonand to reseed bump rules per app. - Updated
data/apps-seed.jsonwith new apps and adjustedfeaturedflags; updatedclaude.mdworkflow wording; adjusted imports inapi/apps.ts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| STYLING.md | Removed local design system documentation file. |
| scripts/seed-apps.ts | Switched app seeding to upsert; bump rules now cleared + reinserted per app. |
| data/apps-seed.json | Added new app entries; adjusted featured presence for some apps. |
| claude.md | Updated workflow text around where apps appear and approval visibility. |
| api/apps.ts | Updated drizzle import list (currently introduces an unused import). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { drizzle } from 'drizzle-orm/neon-http'; | ||
| import { apps, featuredApps, bumpRules, appSubmissions } from '../src/db/schema'; | ||
| import { eq, desc, and, gte, lte } from 'drizzle-orm'; | ||
| import { eq, desc, and, gte, lte, asc } from 'drizzle-orm'; |
There was a problem hiding this comment.
asc is imported but not used in this file. With noUnusedLocals: true in tsconfig, this will fail TypeScript compilation—remove asc or use it in an orderBy(...) call.
| import { eq, desc, and, gte, lte, asc } from 'drizzle-orm'; | |
| import { eq, desc, and, gte, lte } from 'drizzle-orm'; |
| 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) { |
There was a problem hiding this comment.
This seeder now unconditionally deletes all bump rules for every app (even when app.bump_rules is missing), which can wipe manually-managed rules and makes db:seed destructive. Consider only deleting/replacing rules when bump rules are present in the JSON (or add an explicit --force/confirmation flag) to avoid accidental data loss.
| 6. **App shows immediately on user's personal profile (`/[slug]`)** | ||
| 7. Admin reviews via Drizzle Studio | ||
| 8. Approved → visible globally in app directory | ||
| 8. **Approved** → visible globally on main `string.sg` homepage and searchable in app directory |
There was a problem hiding this comment.
The PR removes STYLING.md, but claude.md still lists STYLING.md in 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).
- api/apps.ts: keep normalizeOpalLogo import from main (drop unused asc); fix dbApps → officialApps typo introduced by merge - data/apps-seed.json: keep logo_url on LangBuddy from main and retain Write Formula Game, String Buy, String Diagrams entries from this branch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No description provided.