Skip to content

Refactor/gatsby node modularization #7622

Open
Manishnemade12 wants to merge 4 commits intolayer5io:masterfrom
Manishnemade12:refactor/gatsby-node-modularization-issue-5
Open

Refactor/gatsby node modularization #7622
Manishnemade12 wants to merge 4 commits intolayer5io:masterfrom
Manishnemade12:refactor/gatsby-node-modularization-issue-5

Conversation

@Manishnemade12
Copy link
Copy Markdown

@Manishnemade12 Manishnemade12 commented Apr 12, 2026

Description

refactor/gatsby-node-modularization-issue-5 --title "[gatsby-node] Modularize createPages handlers for blog, Kanvas labs, and Sistent" --body "Description

Closes : #7615
This PR modularizes targeted parts of gatsby-node.js to reduce merge conflicts and improve maintainability.

What changed

  • Added src/node-api/createBlogPages.js for blog post, category, and tag page creation.
  • Added src/node-api/createKanvasLabPages.js for Kanvas lab page creation.
  • Added src/node-api/createSistentComponentPages.js for Sistent component page creation.
  • Updated gatsby-node.js to orchestrate these handlers through dependency injection (graphql, createPage, reporter, templates/helpers).
  • Removed the extracted GraphQL fragments and page-creation loops from the monolithic createPages export.

Scope control

  • Only issue-relevant areas were refactored (blog/category/tags, kanvas-labs, sistent).
  • No unrelated routing behavior, templates, or node lifecycle APIs were modified.

Validation

  • Attempted targeted lint on changed files:
    • npx eslint gatsby-node.js src/node-api/createBlogPages.js src/node-api/createKanvasLabPages.js src/node-api/createSistentComponentPages.js
  • Lint execution is currently blocked in this environment due to missing local dependency: Cannot find module 'globals' from eslint.config.js.

Notes for Reviewers

  • Functional behavior for extracted pages is preserved (same path patterns and page context).
  • gatsby-node.js now acts as a cleaner orchestrator for these concerns.

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
@Manishnemade12 Manishnemade12 force-pushed the refactor/gatsby-node-modularization-issue-5 branch from 5cc1776 to 536c075 Compare April 12, 2026 04:36
@Manishnemade12
Copy link
Copy Markdown
Author

@rishiraj38 can you please review this pr

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.

Modularize gatsby-node.js to Improve Maintainability and Build Velocity

1 participant