Skip to content

Stop committing the generated hugoautogen workspace#473

Merged
chalin merged 4 commits into
google:mainfrom
chalin:chalin-m24-install-all-2026-0701
Jul 1, 2026
Merged

Stop committing the generated hugoautogen workspace#473
chalin merged 4 commits into
google:mainfrom
chalin:chalin-m24-install-all-2026-0701

Conversation

@chalin

@chalin chalin commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator
  • Stops committing packages/hugoautogen/package.jsonhugo mod npm pack generates it to aggregate the theme's npm deps (Bootstrap, Font Awesome), so a committed copy is just generated noise that can drift.
  • Adds install:all (npm install && hugo mod npm pack && npm install) to regenerate the manifest on demand, and routes every from-scratch build path through it, since a bare npm install silently prunes the theme deps (exit 0, no error) when the manifest is absent:
    • CI (links.yaml) installs via npm run install:all; this drops the old --omit=optional, so the links job now also installs the optional dev deps (prettier, npm-check-updates) — a deliberate, negligible cost for one canonical build path.
    • Netlify (netlify.toml) prefixes both build commands with it.
    • README lists it as a prerequisite for running the site locally.
    • An echo notes that the double install exists only because Hugo, which runs the pack, is itself an npm dependency.
  • Ignores the generated packages/hugoautogen/ directory.
  • Simplifies the freshness guard check:generated to _diff:fail now that no generated file is committed; it still guards the committed .lycheecache.
  • Verified on a simulated fresh clone (node_modules, lockfile, and generated dir removed): install:allbuildtest:site → offline link check all pass, and both CI and the Netlify deploy preview build green.
  • Confirmed that link-check CI fails when cache is updated during CI, see https://github.com/google/docsy-example/actions/runs/28535558521/job/84595896420?pr=473

@chalin chalin force-pushed the chalin-m24-install-all-2026-0701 branch from 54d4f9d to a323a9a Compare July 1, 2026 13:27
@chalin chalin changed the title Add install:all convenience script for the generated workspace Stop committing the generated hugoautogen workspace Jul 1, 2026
@chalin chalin force-pushed the chalin-m24-install-all-2026-0701 branch 2 times, most recently from a179213 to 604cda4 Compare July 1, 2026 13:47
- Stops committing `packages/hugoautogen/package.json` — `hugo mod npm pack` generates it to aggregate the theme's npm deps (Bootstrap, Font Awesome), so a committed copy is just generated noise that can drift.
- Adds `install:all` (`npm install && hugo mod npm pack && npm install`) to regenerate the manifest on demand, and routes every from-scratch build path through it, since a bare `npm install` silently prunes the theme deps (exit 0, no error) when the manifest is absent:
  - CI (`links.yaml`) installs via `npm run install:all`; this drops the old `--omit=optional`, so the links job now also installs the optional dev deps (`prettier`, `npm-check-updates`) — a deliberate, negligible cost for one canonical build path.
  - Netlify (`netlify.toml`) prefixes both build commands with it.
  - README lists it as a prerequisite for running the site locally.
  - An echo notes that the double install exists only because Hugo, which runs the pack, is itself an npm dependency.
- Ignores the generated `packages/hugoautogen/` directory.
- Simplifies the freshness guard `check:generated` to `_diff:fail` now that no generated file is committed; it still guards the committed `.lycheecache`.
@chalin chalin force-pushed the chalin-m24-install-all-2026-0701 branch from 604cda4 to de6ec7b Compare July 1, 2026 14:22
@chalin chalin force-pushed the chalin-m24-install-all-2026-0701 branch from ac77c72 to b9cd328 Compare July 1, 2026 17:23
@chalin chalin merged commit c4b169e into google:main Jul 1, 2026
12 checks passed
@chalin chalin deleted the chalin-m24-install-all-2026-0701 branch July 1, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant