feat(github): add opt-out flags for auto-generated links - #28
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andoverridedoesn't cover links.Implements option 2 from #24: two opt-out flags on
githubandhybridprojects, both defaulting totruefor backward compatibility.Flags only suppress auto-generated links — explicit
linksin config still win.Design notes
linksvalues remain strict URLs; the literal reprolinks: { github: '', live: '' }still fails validation. Suppression is via the flags instead.type: 'github'only, but hybrid shares the same GitHub-derived link path, so the flags apply to both.useLiveLinkFromRepoaligns withuseGithubLinkFromRepo(both derive from the repo).linkOrder:linkOrderomission filters after links are resolved (and removes even explicitlivelinks); the flags prevent generation (and never touch explicit links).linkOrder: ['live']cannot resurrect a flag-suppressed link. Both mechanisms are cross-referenced inproject-types.mdandproject-links.md.Changes
types/index.ts— sharedGitHubSourceFields(repo/commits/flags) extended byGitHubProjectInputandHybridProjectInputlib/config-schema.ts— sharedgitHubSourceFieldsZod fragment on github + hybrid schemaslib/normalise.ts— one unified link-generation block for github/hybrid (previously two branches with asymmetricundefined-key vs omit semantics); flags gate generation with?? truedefaultsproject-types.md(new section),projex-project-input.md,projex-project-input-schema.md,project-links.md(flags vslinkOrdercomparison)CHANGELOG.md— Unreleased entrynormalise.test.ts/config-schema.test.tsTest cases
useLiveLinkFromRepo: false)useGithubLinkFromRepo: false)linkOrderincludesliveCloses #24