Skip to content

Revert "Refactor gatsby-config.js for improved configuration"#7605

Merged
leecalcote merged 1 commit intomasterfrom
revert-7601-leecalcote-patch-1
Apr 8, 2026
Merged

Revert "Refactor gatsby-config.js for improved configuration"#7605
leecalcote merged 1 commit intomasterfrom
revert-7601-leecalcote-patch-1

Conversation

@leecalcote
Copy link
Copy Markdown
Member

Reverts #7601

Copilot AI review requested due to automatic review settings April 8, 2026 21:34
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.

Reverts the previous “Refactor gatsby-config.js for improved configuration” changeset, aiming to restore/adjust Gatsby build behavior and plugin configuration.

Changes:

  • Re-introduces build-scope logic (lite vs full build) and collection exclusion/ignore globs.
  • Reshapes Gatsby flags, production-only plugins, and bundle analyzer gating.
  • Refactors RSS/feed plugin configuration and consolidates filesystem sourcing for collections.

Comment on lines +3 to +7
const {
DEFAULT_LITE_BUILD_PROFILE,
getExcludedCollections,
isFullSiteBuild,
} = require("./src/utils/build-collections");
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The PR title/description says this change “Reverts #7601”, but this diff introduces substantial new logic (e.g., build-collections utilities, new flags/plugin gating, feed rewrites) rather than a straightforward revert. Please either (1) adjust the PR title/description to match the actual intent (e.g., “Re-introduce build profiles + refactor gatsby-config”), or (2) pare this change down to a true revert of #7601 so reviewers can reason about scope and risk.

Copilot uses AI. Check for mistakes.
Comment on lines +467 to +472
{
resolve: "gatsby-plugin-purgecss",
options: {
printRejected: true,
},
],
},
},
},
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

printRejected: true can produce very large logs and noticeably slow production builds (especially in CI), making failures harder to triage. Consider defaulting this to false and enabling it only behind an explicit debug env var (e.g., PURGECSS_DEBUG) or only for local analysis runs.

Copilot uses AI. Check for mistakes.
Comment on lines +242 to +262
// }
// }
// }
// `,
// serialize: ({ query: { site, allMdx } }) => {
// return allMdx.nodes.map((node) => {
// return Object.assign({}, node.frontmatter, {
// title: node.frontmatter.title,
// author: node.frontmatter.author,
// description: node.frontmatter.description,
// date: node.frontmatter.date,
// url: site.siteMetadata.siteUrl + node.fields.slug,
// guid: site.siteMetadata.siteUrl + node.fields.slug,
// enclosure: node.frontmatter.thumbnail && {
// url: site.siteMetadata.siteUrl + node.frontmatter.thumbnail.publicURL,
// },
// custom_elements: [{ "content:encoded": node.excerpt }],
// });
// });
// },
// },
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

This large commented-out feed config significantly increases noise and makes it unclear whether /resources/feed.xml is intentionally removed or temporarily disabled. Prefer either removing the dead/commented code entirely, or gating it behind a clear feature flag (e.g., ENABLE_RESOURCES_FEED) so the intent and behavior are explicit.

Suggested change
// }
// }
// }
// `,
// serialize: ({ query: { site, allMdx } }) => {
// return allMdx.nodes.map((node) => {
// return Object.assign({}, node.frontmatter, {
// title: node.frontmatter.title,
// author: node.frontmatter.author,
// description: node.frontmatter.description,
// date: node.frontmatter.date,
// url: site.siteMetadata.siteUrl + node.fields.slug,
// guid: site.siteMetadata.siteUrl + node.fields.slug,
// enclosure: node.frontmatter.thumbnail && {
// url: site.siteMetadata.siteUrl + node.frontmatter.thumbnail.publicURL,
// },
// custom_elements: [{ "content:encoded": node.excerpt }],
// });
// });
// },
// },

Copilot uses AI. Check for mistakes.
});
});
},
},
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

Commenting out the Resources feed effectively removes a public feed endpoint (/resources/feed.xml). If this endpoint is consumed externally, this is a breaking change; please either restore the feed, add a redirect to a replacement endpoint, or document the removal and provide a migration path.

Suggested change
},
},
{
output: "/resources/feed.xml",
title: "Layer5 Resources",
query: `
{
site {
siteMetadata {
title
siteUrl
}
}
allMdx(
sort: {frontmatter: {date: DESC}}
limit: 20
filter: {
frontmatter: { published: { eq: true } }
fields: { collection: { eq: "resources" } }
}
) {
nodes {
excerpt
frontmatter {
title
author
description
date
thumbnail {
publicURL
}
}
fields {
slug
}
}
}
}
`,
serialize: ({ query: { site, allMdx } }) => {
return allMdx.nodes.map((node) => {
return Object.assign({}, node.frontmatter, {
title: node.frontmatter.title,
author: node.frontmatter.author,
description: node.frontmatter.description,
date: node.frontmatter.date,
url: site.siteMetadata.siteUrl + node.fields.slug,
guid: site.siteMetadata.siteUrl + node.fields.slug,
enclosure: node.frontmatter.thumbnail && {
url:
site.siteMetadata.siteUrl +
node.frontmatter.thumbnail.publicURL,
},
custom_elements: [{ "content:encoded": node.excerpt }],
});
});
},
},

Copilot uses AI. Check for mistakes.
@leecalcote leecalcote merged commit 099928b into master Apr 8, 2026
2 of 4 checks passed
@leecalcote leecalcote deleted the revert-7601-leecalcote-patch-1 branch April 8, 2026 21:38
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.

3 participants