Skip to content

refactor: isolate developer-tools module in data layer#17213

Merged
wackerow merged 1 commit into
unstable-cachefrom
refactor/data-layer-developer-tools-isolation
Feb 3, 2026
Merged

refactor: isolate developer-tools module in data layer#17213
wackerow merged 1 commit into
unstable-cachefrom
refactor/data-layer-developer-tools-isolation

Conversation

@pettinarip
Copy link
Copy Markdown
Member

Summary

This is a proposal to refactor the developer tools data layer code for better isolation and maintainability.

Problem

The current implementation has bidirectional imports between the data layer and app code:

  • src/data-layer/fetchers/fetchDeveloperTools.ts imports functions from app/[locale]/developers/apps/utils.ts
  • This breaks the convention that the data layer should be isolated and not depend on app-level code

Solution

Move all developer tools fetching logic into a dedicated folder:

src/data-layer/fetchers/developer-tools/
├── index.ts           # Main orchestrator (fetchDeveloperTools)
├── utils.ts           # Types, constants, utility functions
├── fetchBuidlGuidl.ts # BuidlGuidl API fetcher
├── fetchGitHub.ts     # GitHub GraphQL enrichment
└── fetchNpmJs.ts      # npm downloads enrichment

Changes

  • Moved to data layer:

    • DeveloperToolsDataEnvelope and DeveloperAppsComputedSelections types
    • DEV_APP_CATEGORY_SLUGS constant (data-only version)
    • All utility functions: seededRandom, seededShuffle, getHighlightsByCategory, etc.
  • Kept in app code:

    • getCategoryTagStyle (UI-specific, uses TagProps)
    • DEV_APP_CATEGORIES (has Icon components)
  • Updated imports:

    • tasks.ts imports from ./fetchers/developer-tools
    • index.ts imports types from new location
    • Helper fetchers import DeveloperApp from local utils

Benefits

  1. Data layer is now fully self-contained
  2. No runtime function imports from app code
  3. Only type-only import of DeveloperApp remains (acceptable as shared data contract)
  4. Cleaner module organization

🤖 Generated with Claude Code

Move all developer tools fetching logic into a dedicated folder to
maintain data layer isolation and prevent bidirectional imports
between data layer and app code.

Changes:
- Create src/data-layer/fetchers/developer-tools/ module with:
  - index.ts: main fetchDeveloperTools orchestrator
  - utils.ts: types, constants, and utility functions
  - fetchBuidlGuidl.ts: BuidlGuidl API fetcher
  - fetchGitHub.ts: GitHub GraphQL enrichment
  - fetchNpmJs.ts: npm downloads enrichment

- Move envelope types (DeveloperToolsDataEnvelope,
  DeveloperAppsComputedSelections) from app code to data layer

- Keep only UI-specific code in app (getCategoryTagStyle)

- Update all imports to use the new module structure

This ensures the data layer remains self-contained and doesn't depend
on app-level code for runtime functions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

thanks!

@wackerow wackerow merged commit 835d5a6 into unstable-cache Feb 3, 2026
3 checks passed
@wackerow wackerow deleted the refactor/data-layer-developer-tools-isolation branch February 3, 2026 18:09
@wackerow wackerow mentioned this pull request Feb 5, 2026
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.

2 participants