Skip to content

[DEV-3882] Refactor sitemap API Layer#2201

Open
Sebastiano-Bertolin wants to merge 3 commits intoDEV-3881-refactor-releaseNotes-api-layerfrom
DEV-3882-refactor-sitemap-api-layer
Open

[DEV-3882] Refactor sitemap API Layer#2201
Sebastiano-Bertolin wants to merge 3 commits intoDEV-3881-refactor-releaseNotes-api-layerfrom
DEV-3882-refactor-sitemap-api-layer

Conversation

@Sebastiano-Bertolin
Copy link
Copy Markdown
Collaborator

List of Changes

Sitemap Data Fetching Refactor

  • Moved all sitemap-related data fetching (product slugs, single pages, tutorials, API data) from fetchSitemapData.ts into their respective repositories (ProductRepository, TutorialRepository, ApiDataListRepository), and updated the sitemap generation logic to use these new repository methods. This improves code modularity and maintainability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
  • Removed the now-obsolete fetchSitemapData.ts file and its fetchers, consolidating all Strapi data access into repository classes.

Repository and Fetcher Enhancements

  • Added new fetcher helpers (fetchProductSlugsReader, fetchProductSinglePagesReader, fetchProductApiDataReader, and fetchCollectionFromStrapi) to encapsulate Strapi queries for different entities, making the code more DRY and testable. [1] [2] [3]
  • Updated repository interfaces and documentation for clarity, including new methods on ProductRepository and ApiDataListRepository for more targeted data access. [1] [2] [3] [4] [5]

Import Path and Naming Consistency

  • Standardized import paths throughout the codebase to use lowerCamelCase file names (e.g., buildEnv, strapiConfig, browserConfig) for consistency and to avoid case-sensitivity issues in some environments. [1] [2] [3] [4] [5] [6] [7]

General Codebase Maintenance

  • Updated and improved JSDoc comments and function signatures for better developer understanding and future maintainability. [1] [2] [3] [4]

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

🦋 Changeset detected

Latest commit: 6a93c3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nextjs-website Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Sebastiano-Bertolin Sebastiano-Bertolin changed the title Dev 3882 refactor sitemap api layer [DEV-3882] Refactor sitemap API Layer Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Jira Pull Request Link

This Pull Request refers to the following Jira issue DEV-3882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant