layer5io / layer5io/layer5

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

Open
#7,615 1 comment 0 reactions 1 assignee View on GitHub

@Manishnemade12 is already working on this.

Since Apr 11, 2026.

framework/gatsby help wanted kind/bug
Dominant language
JavaScript
Stars
1.1k
Forks
1.6k
Avg merge
2d 10h
Merged PRs (30d)
18

Description

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:
  • Host OS:
  • Browser:

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.