Skip to content

feat(github): add opt-out flags for auto-generated links - #28

Merged
ManningWorks merged 2 commits into
mainfrom
issue-24-suppress-links
Aug 18, 2026
Merged

feat(github): add opt-out flags for auto-generated links#28
ManningWorks merged 2 commits into
mainfrom
issue-24-suppress-links

Conversation

@ManningWorks

@ManningWorks ManningWorks commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

For projects where type: 'github' but the site already IS the live URL (e.g. a personal site), there was no way to suppress the auto-generated links — links: { github: '', live: '' } fails Zod validation before normalisation runs, and override doesn't cover links.

Implements option 2 from #24: two opt-out flags on github and hybrid projects, both defaulting to true for backward compatibility.

{
  id: 'my-site',
  type: 'github',
  repo: 'ManningWorks/my-site',
  status: 'active',
  useGithubLinkFromRepo: false,  // suppress auto github link (repo html_url)
  useLiveLinkFromRepo: false,    // suppress auto live link (repo homepage)
}

Flags only suppress auto-generated links — explicit links in config still win.

Design notes

  • Issue option 1 deliberately not implementedlinks values remain strict URLs; the literal repro links: { github: '', live: '' } still fails validation. Suppression is via the flags instead.
  • Hybrid extension is deliberate scope — the issue asked for type: 'github' only, but hybrid shares the same GitHub-derived link path, so the flags apply to both.
  • Naming: useLiveLinkFromRepo aligns with useGithubLinkFromRepo (both derive from the repo).
  • Flags vs linkOrder: linkOrder omission filters after links are resolved (and removes even explicit live links); the flags prevent generation (and never touch explicit links). linkOrder: ['live'] cannot resurrect a flag-suppressed link. Both mechanisms are cross-referenced in project-types.md and project-links.md.

Changes

  • types/index.ts — shared GitHubSourceFields (repo/commits/flags) extended by GitHubProjectInput and HybridProjectInput
  • lib/config-schema.ts — shared gitHubSourceFields Zod fragment on github + hybrid schemas
  • lib/normalise.ts — one unified link-generation block for github/hybrid (previously two branches with asymmetric undefined-key vs omit semantics); flags gate generation with ?? true defaults
  • Docs — project-types.md (new section), projex-project-input.md, projex-project-input-schema.md, project-links.md (flags vs linkOrder comparison)
  • CHANGELOG.md — Unreleased entry
  • Tests — 10 focused cases in normalise.test.ts / config-schema.test.ts

Test cases

  • Suppress live link only (useLiveLinkFromRepo: false)
  • Suppress github link only (useGithubLinkFromRepo: false)
  • Suppress both (the exact Cannot suppress auto-generated links for type=github #24 scenario)
  • Flag-suppressed live link stays absent even when linkOrder includes live
  • Explicit config links win over suppressed auto-generation
  • Default keeps both links (backward compat)
  • Hybrid: flags suppress github/live while npm link survives
  • Schema: flags accepted on github and hybrid; non-boolean rejected

Closes #24

useGithubLinkFromRepo and useLiveLinkFromGithub (default true) on github
and hybrid projects suppress the GitHub-derived github/live links without
clearing the repo homepage. Explicit config links always win.

Closes #24
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
projex-docs Ready Ready Preview Aug 18, 2026 9:24pm

Address review findings on PR #28:

- Unify github/hybrid link blocks into one; suppression is now
  omit-style for both (no asymmetric undefined-key vs omit semantics)
- Rename useLiveLinkFromGithub -> useLiveLinkFromRepo for consistency
  with useGithubLinkFromRepo
- Extract shared GitHubSourceFields interface and gitHubSourceFields
  Zod fragment used by github and hybrid inputs
- Simplify flag guards to ?? true
- Document flags vs linkOrder interaction in project-types.md and
  project-links.md, with a linkOrder-cannot-resurrect test
- Add CHANGELOG Unreleased entry
@ManningWorks ManningWorks self-assigned this Aug 18, 2026
@ManningWorks
ManningWorks merged commit ac0511a into main Aug 18, 2026
6 checks passed
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.

Cannot suppress auto-generated links for type=github

1 participant