Skip to content

fix: emit the monorepo LHCI workflow at the workspace root - #124

Open
spencer-osbrjp wants to merge 1 commit into
mainfrom
i115-20260812-1
Open

fix: emit the monorepo LHCI workflow at the workspace root#124
spencer-osbrjp wants to merge 1 commit into
mainfrom
i115-20260812-1

Conversation

@spencer-osbrjp

Copy link
Copy Markdown
Collaborator

Closes #115

What

Monorepo projects scaffolded with --audit lhci got their Lighthouse workflow at apps/web/.github/workflows/lhci.yml — a location GitHub silently ignores — with steps that assumed a flat layout even if moved. Now:

  • copyDir gains an explicit ghRoot parameter that redirects .github/** (unifying the mechanism the add command already used via rep.GitRoot). The audit copy passes the workspace root in monorepo mode, so the workflow lands at .github/workflows/lhci.yml while lighthouserc.json stays in apps/web.
  • The workflow template is layout-aware:

Known remaining gap (same class, different content)

test (playwright) and cicd (deploy) templates still emit .github/** into apps/web in monorepo mode. Relocating them needs content-aware step changes (their run steps assume the app dir), so they're not silently moved here — happy to take that as a follow-up issue.

Testing

go test -count=1 ./... green, including a new lhci_monorepo render case pinning: workflow at the root, no stray apps/web/.github, working-directory: apps/web, apps/web/-prefixed pages_dir, and the paths filter. E2E smoke: scaffolded a fullstack monorepo, verified placement and valid YAML.

🤖 Generated with Claude Code

The audit templates were copied into apps/web, so the Lighthouse workflow
landed at apps/web/.github/workflows/ where GitHub never runs it. copyDir
gains a ghRoot redirect (shared with add's git-root relocation): the audit
copy now sends .github/** to the workspace root while lighthouserc.json
stays in apps/web. The workflow itself is monorepo-aware — lhci runs with
working-directory apps/web, the affected-pages diff uses apps/web-prefixed
paths, and a paths filter skips apps/api-only PRs entirely.

Closes #115

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

ci(templates): LHCI workflow is dead on arrival in monorepo layout

1 participant