Skip to content

Refactor/gatsby node modularization #7622

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

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

Conversation

@Manishnemade12
Copy link
Copy Markdown
Contributor

@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
Contributor Author

@rishiraj38 can you please review this pr

@rishiraj38
Copy link
Copy Markdown
Member

Screenshot 2026-04-17 at 11 42 41 AM Why are these commits included in this PR?

@Manishnemade12
Copy link
Copy Markdown
Contributor Author

Manishnemade12 commented Apr 17, 2026

Screenshot 2026-04-17 at 11 42 41 AM Why are these commits included in this PR?

@rishiraj38 actually i forgot to checkout master during creating current branch , but i reverted that part .

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 18, 2026

Preview deployment for PR #7622 removed.

This PR preview was automatically pruned because we keep only the 6 most recently updated previews on GitHub Pages to stay within deployment size limits.

If needed, push a new commit to this PR to generate a fresh preview.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR modularizes parts of gatsby-node.js by extracting page-creation logic for Blog, Kanvas Labs, and Sistent components into dedicated handler modules, aiming to reduce merge conflicts and improve maintainability.

Changes:

  • Added three new src/node-api/* handlers to create Blog, Kanvas Lab, and Sistent component pages.
  • Updated gatsby-node.js to orchestrate these handlers via dependency injection.
  • Removed the extracted GraphQL sections and page-creation loops from the monolithic createPages implementation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
gatsby-node.js Calls newly extracted handlers and removes inlined GraphQL/page-creation logic.
src/node-api/createBlogPages.js Encapsulates blog post + category/tag list page creation.
src/node-api/createKanvasLabPages.js Encapsulates Kanvas lab page creation.
src/node-api/createSistentComponentPages.js Encapsulates Sistent component (tabbed) page creation via grouping.

Comment thread src/node-api/createBlogPages.js
Comment thread src/node-api/createBlogPages.js Outdated
Comment thread src/node-api/createSistentComponentPages.js Outdated
Comment thread src/node-api/createKanvasLabPages.js Outdated
Comment thread gatsby-node.js
Manishnemade12 and others added 3 commits April 23, 2026 14:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Manish Nemade <166635137+Manishnemade12@users.noreply.github.com>
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
@Manishnemade12 Manishnemade12 force-pushed the refactor/gatsby-node-modularization-issue-5 branch from 375ac83 to 5a572b3 Compare April 23, 2026 08:57
@Bhumikagarggg
Copy link
Copy Markdown
Contributor

@Manishnemade12 Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

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

5 participants