Skip to content

Refactor: Rename imports to seeds and standardize documentation - #156

Merged
Ardnived merged 4 commits into
mainfrom
refactor/rename-imports-to-seeds
Jan 19, 2026
Merged

Ardnived merged 4 commits into
mainfrom
refactor/rename-imports-to-seeds

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

  • Rename imports/ folder to seeds/ to better reflect its purpose (seeding data)
  • Update all references across the codebase (27 files)
  • Add comprehensive documentation for creating new seed scripts
  • Document identified inconsistencies for future standardization

Changes

Folder Rename

  • Atomic rename imports/ → seeds/ preserving git history

Path Updates (26 files)

  • package.json - 4 script references
  • vitest.config.mts - test include path
  • .gitignore - cache directory path
  • src/payload.config.ts - seed script detection
  • src/app/(payload)/api/seed/[script]/route.ts - import paths
  • Documentation files (CLAUDE.md, architecture.md, DEPLOYMENT.md)
  • Internal seeds/ documentation and source files
  • Test file imports and comments

Documentation Additions (seeds/CLAUDE.md)

  1. "Creating a New Seed Script" section with:

    • Checklist for new script creation
    • Full code template with best practices
    • Required patterns (preload, upsert, error handling)
    • Pagination support guidance
    • Media upload and locale handling patterns
  2. "Identified Inconsistencies" section documenting:

    • Data source approaches (embedded, JSON, API)
    • Error handling patterns
    • Locale handling variations
    • Custom preload patterns
    • Identifier passing consistency
    • Follow-up issue recommendations

Test Results

  • Integration tests: 306 passed, 1 skipped
  • Build: ✓ Success
  • Lint: ✓ Pass (only pre-existing warnings)
  • Seed script verification:
    • pnpm seed --help ✓
    • pnpm seed tags --dry-run ✓
    • pnpm seed wemeditate --dry-run ✓
    • pnpm seed meditations --dry-run ✓

Follow-up Issues (as documented)

The following should be addressed in separate issues:

  1. Standardize error handling - per-item try/catch with this.addError()
  2. Add preloadWithCompositeKey helper - abstract storyblok's composite key pattern
  3. Standardize identifier passing - always pass explicit identifiers

Closes #154

🤖 Generated with Claude Code

Ardnived and others added 4 commits January 15, 2026 19:01
Rename the folder to better reflect its purpose (seeding data).
This is an atomic rename to preserve git history.

Part of #154

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update all paths and references across:
- package.json scripts
- vitest.config.mts test includes
- .gitignore cache directory
- src/payload.config.ts seed script detection
- API route imports
- Documentation files (CLAUDE.md, architecture.md, DEPLOYMENT.md)
- Internal seeds/ documentation and source files
- Test file imports and comments

Part of #154

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add two new sections to seeds/CLAUDE.md:

1. "Creating a New Seed Script" - Comprehensive guide including:
   - Checklist for new script creation
   - Full code template with best practices
   - Required patterns (preload, upsert, error handling)
   - Pagination support guidance
   - Media upload and locale handling patterns

2. "Identified Inconsistencies" - Documents current inconsistencies
   for future standardization with priority levels and follow-up
   issue recommendations

Part of #154

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update remaining "import" terminology to "seed" in documentation files:
- seeds/lib/CLAUDE.md title: "Import Utilities Library" → "Seed Utilities Library"
- seeds/lib/CLAUDE.md section: "Creating New Import Scripts" → "Creating New Seed Scripts"
- seeds/CLAUDE.md: "Import scripts should never call..." → "Seed scripts should never call..."

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@Ardnived
Ardnived merged commit 35c5044 into main Jan 19, 2026
@Ardnived
Ardnived deleted the refactor/rename-imports-to-seeds branch January 19, 2026 11:54
Ardnived added a commit that referenced this pull request Nov 2, 2026
…1061)

Backfills (owner confirmed both are done): delete
scripts/backfill-region-breadcrumb-urls.ts (#640) and
scripts/backfill-schedule-last-date.ts (#604), the src/lib routines only
they used, their int specs, and the doc rows pointing at them. New writes
fill breadcrumbs[].url and schedule.lastDate on their own, and
region-canonical-url / events specs cover that live behaviour.

seeds/tests harness: test-storyblok.sh and test-meditations.sh run
importers that have had no CLI entry point since #156, so each "test"
exited 0 having done nothing; check-db-stats.ts queried the music
collections renamed in #180. Delete them with setup-test-db.ts and
test-payload.config.ts (used only by them), rewrite the folder guide
around the spec that stays, and drop the third buildConfig site from
the systemEntities / access.md / postgresTestPool comments.

Smaller: meditation-duration's "backfill migration logic" block
re-implemented a migration deleted in #308 and called none of our code;
seed-pagination's PaginationOptions block only read back an object
literal; lemonfox-client's comment named transcribe.ts's old path.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Rename imports to seeds and standardize documentation

1 participant