Description
The gatsby-node.js file is currently a monolithic runtime file spanning over 1,200 lines. It handles Node creation, GraphQL querying, and the generation of virtually every dynamic page on the Layer5 site sequentially (blogposts, resources, careers, member profiles, kanvas labs, programs, integrations, and sistent components). This monolithic structure creates a very high likelihood of merge conflicts for concurrent PRs targeting dynamic page logic. It also yields poor maintainability as the site scales, mixing logic for drastically different collections in a single massive createPages export.
Expected Behavior
gatsby-node.js should be refactored by orchestrating its logic into a new src/node-api/ directory (or similar utility structure) utilizing functional composition. The API should extract createPages logic related to the blog, category, and tags into a dedicated createBlogPages.js module, and similarly for Kanvas labs and Sistent components. The main node file should then cleanly require these smaller handler functions and pass the graphql and createPage actions via dependency injection. This vast minimization of merge conflicts improves CI/CD integrity and Developer Velocity.
Screenshots
Environment:

Contributor Resources and Handbook
The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.
Join the Layer5 Community by submitting your community member form.
Description
The
gatsby-node.jsfile is currently a monolithic runtime file spanning over 1,200 lines. It handles Node creation, GraphQL querying, and the generation of virtually every dynamic page on the Layer5 site sequentially (blogposts, resources, careers, member profiles, kanvas labs, programs, integrations, and sistent components). This monolithic structure creates a very high likelihood of merge conflicts for concurrent PRs targeting dynamic page logic. It also yields poor maintainability as the site scales, mixing logic for drastically different collections in a single massivecreatePagesexport.Expected Behavior
gatsby-node.jsshould be refactored by orchestrating its logic into a newsrc/node-api/directory (or similar utility structure) utilizing functional composition. The API should extractcreatePageslogic related to theblog,category, andtagsinto a dedicatedcreateBlogPages.jsmodule, and similarly for Kanvas labs and Sistent components. The main node file should then cleanly require these smaller handler functions and pass thegraphqlandcreatePageactions via dependency injection. This vast minimization of merge conflicts improves CI/CD integrity and Developer Velocity.Screenshots
Environment:
Contributor Resources and Handbook
The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the
masterbranch.