layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

feat: improve build profile DevEx — a la carte collection picker, copy buttons, contributing guide link

Open yi-nuo426 opened this issue 7 months ago • 8 comments

Summary

This PR improves the developer experience around site build profiles, make targets, and the lite-mode placeholder page that contributors see when visiting a disabled route.

Make targets

  • make site-content — new target for the content profile (blog/news/events/resources included; members/integrations skipped). Previously the content profile existed in code but had no make target — it was only discoverable via an echo hint in make site.
  • make site-custom — new target for fully à la carte builds. Uses a new none base profile (zero preset exclusions) so BUILD_COLLECTIONS_EXCLUDE is the only thing that controls what is skipped. Example: BUILD_COLLECTIONS_EXCLUDE=members,events make site-custom
  • make profiles — new target that lists all profiles, their excluded collections, and the BUILD_COLLECTIONS_EXCLUDE escape hatch.
  • make cache-clean — new target that clears the Gatsby cache without triggering a full production rebuild. The existing make clean does both, which surprised contributors who just wanted to reset cache.
  • make site-analyze — fixed missing ## help comment and .PHONY entry (was invisible to make help output).
  • site-fast — description updated from the useless "Alternate method" to a precise description of what it actually skips.

npm scripts

  • develop:content — mirrors develop:lite with LITE_BUILD_PROFILE=content.
  • develop:custom — uses LITE_BUILD_PROFILE=none for the à la carte target.
  • start:content — alias consistent with the existing start / start:full pattern.

build-collections.js

  • Added none profile — excludes nothing by default, making BUILD_COLLECTIONS_EXCLUDE the sole driver of exclusions for make site-custom.

Lite-mode placeholder page

The placeholder shown when a contributor visits a disabled route (e.g. /blog in core mode) now has three improvements:

  1. Copy-to-clipboard buttons on every suggested make command.
  2. A la carte collection picker — six checkboxes that dynamically generate the correct make command as you toggle them. The current route's collection is pre-checked.
  3. Link to the contributing guide (CONTRIBUTING.md#environment-variables) for full profile documentation.

Lint-staged fix

Added --no-warn-ignored to the ESLint call in .lintstagedrc.js. src/utils/ is in ESLint's ignore list, but lint-staged passes files explicitly, causing a warning that tripped --max-warnings=0 on every commit touching a src/utils/ file.

Test plan

  • [ ] make (no args) — help output lists site-content, site-custom, profiles, cache-clean, site-analyze
  • [ ] make profiles — prints all four profiles with accurate exclusion lists
  • [ ] make site — echo banner mentions site-content and site-full
  • [ ] make site-content — dev server starts with blog/news/events/resources enabled
  • [ ] make cache-clean — clears .cache without starting a build
  • [ ] BUILD_COLLECTIONS_EXCLUDE=members,events make site-custom — only listed collections excluded
  • [ ] Visit /blog in core mode — placeholder shows make site-content first with Copy button; blog pre-checked in picker
  • [ ] Visit /community/members — placeholder shows only make site-full
  • [ ] Toggle checkboxes — command updates live; all checked → make site-full; none checked → make site
  • [ ] Contributing guide link opens CONTRIBUTING.md#environment-variables

yi-nuo426 avatar Apr 04 '26 17:04 yi-nuo426

/gemini review

yi-nuo426 avatar Apr 08 '26 04:04 yi-nuo426

@yi-nuo426 I tried to build the site using make site, which runs develop:lite, but it doesn’t seem to work as expected. It consumes all my resources, and even after stopping the process, Gatsby keeps running in the background, crashing my laptop.

image

saurabhraghuvanshii avatar Apr 08 '26 07:04 saurabhraghuvanshii

@yi-nuo426 I tried to build the site using make site, which runs develop:lite, but it doesn’t seem to work as expected. It consumes all my resources, and even after stopping the process, Gatsby keeps running in the background, crashing my laptop.

image

yes same

Siddhi-sahu avatar Apr 08 '26 12:04 Siddhi-sahu

@yi-nuo426 I tried to build the site using make site, which runs develop:lite, but it doesn’t seem to work as expected. It consumes all my resources, and even after stopping the process, Gatsby keeps running in the background, crashing my laptop.

@saurabhraghuvanshii is this different than your current experience?

leecalcote avatar Apr 08 '26 17:04 leecalcote

@Siddhi-sahu, @saurabhraghuvanshii, when you run LITE_BUILD_PROFILE=content make site, do you have a similar experience?

leecalcote avatar Apr 08 '26 17:04 leecalcote

@Siddhi-sahu, @saurabhraghuvanshii, when you run LITE_BUILD_PROFILE=content make site, do you have a similar experience?

yes, same, at least for me.

Siddhi-sahu avatar Apr 08 '26 17:04 Siddhi-sahu

@yi-nuo426 I tried to build the site using make site, which runs develop:lite, but it doesn’t seem to work as expected. It consumes all my resources, and even after stopping the process, Gatsby keeps running in the background, crashing my laptop.

@saurabhraghuvanshii is this different than your current experience?

Yes. but I noticed same behaviour on master branch so issue is something else.

saurabhraghuvanshii avatar Apr 08 '26 18:04 saurabhraghuvanshii

Already approved — just want to add a note for the community here.

This is a genuinely thoughtful developer experience improvement, @yi-nuo426. The à la carte collection picker, copy-to-clipboard buttons on every make command, and the contributing guide link in the placeholder page all address real friction points that come up repeatedly in community onboarding. The make profiles target and make cache-clean are small additions that will save contributors from a lot of unnecessary full rebuilds.

Regarding the memory issue raised by @saurabhraghuvanshii and @Siddhi-sahu: confirmed that the behavior they're seeing exists on master as well — so it's not a regression introduced by this PR. That's a separate tracking item.

The --no-warn-ignored fix to .lintstagedrc.js is a nice catch that will save contributors from confusing lint failures on src/utils/ files.

Great contribution.

arjunmehta-git avatar Apr 09 '26 07:04 arjunmehta-git