Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
buy_me_a_coffee: omar.hanafy
5 changes: 5 additions & 0 deletions plugins/glyphpact/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,8 @@ Run the bundled CLI directly when debugging a packaged release:
```bash
python plugins/glyphpact/scripts/run_glyphpact.py --version
```

## Support

If GlyphPact saves you time, you can
[support ongoing maintenance](https://buymeacoffee.com/omar.hanafy).
1 change: 1 addition & 0 deletions site/src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const { version } = Astro.props;
<li><a href={site.links.issues}>Issue tracker</a></li>
<li><a href={site.links.security}>Security policy</a></li>
<li><a href={site.links.contributing}>Contributing</a></li>
<li><a href={site.links.support}>Support GlyphPact</a></li>
</ul>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions site/src/components/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const isCurrent = (href: string) => {
</a>
))
}
<a href={site.links.support}>Support</a>
<a class="gp-nav__repo" href={site.links.repo}>
<GitHubIcon />
GitHub
Expand All @@ -54,6 +55,7 @@ const isCurrent = (href: string) => {
</a>
))
}
<a href={site.links.support}>Support</a>
<a class="gp-nav__repo" href={site.links.repo}>
<GitHubIcon />
GitHub
Expand Down
1 change: 1 addition & 0 deletions site/src/site.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const site = {
license: 'MIT',
links: {
repo: REPO,
support: 'https://buymeacoffee.com/omar.hanafy',
issues: `${REPO}/issues`,
releases: `${REPO}/releases`,
readme: `${REPO}#readme`,
Expand Down
33 changes: 33 additions & 0 deletions site/tests/site.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,39 @@ test('machine-readable release facts match v1.0.1', async ({ page }) => {
expect(JSON.stringify(schemas)).toContain('"softwareVersion":"1.0.1"');
});

test('support is easy to find without an embedded solicitation', async ({ page }) => {
const supportUrl = 'https://buymeacoffee.com/omar.hanafy';
await page.goto('/glyphpact/');

const headerSupport = page
.locator('.gp-header')
.getByRole('link', { name: 'Support', exact: true });
const footerSupport = page
.locator('.gp-footer')
.getByRole('link', { name: 'Support GlyphPact', exact: true });
await expect(headerSupport).toHaveAttribute('href', supportUrl);
await expect(footerSupport).toHaveAttribute('href', supportUrl);
// Desktop and mobile navigation both exist in the DOM; only one is visible.
await expect(page.locator(`a[href="${supportUrl}"]`)).toHaveCount(3);
await expect(
page.locator(
'script[src*="buymeacoffee"], iframe[src*="buymeacoffee"], img[src*="buymeacoffee"]',
),
).toHaveCount(0);
});

test('support remains visible in the mobile menu', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 844 });
await page.goto('/glyphpact/');
await page.locator('.gp-mobile-nav summary').click();

const support = page
.locator('.gp-mobile-nav__panel')
.getByRole('link', { name: 'Support', exact: true });
await expect(support).toBeVisible();
await expect(support).toHaveAttribute('href', 'https://buymeacoffee.com/omar.hanafy');
});

test('four-card homepage grids form balanced rows', async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 });
await page.goto('/glyphpact/');
Expand Down
13 changes: 13 additions & 0 deletions tests/test_release_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ def test_release_versions_and_generated_surfaces_agree(tmp_path: Path) -> None:
assert f"GlyphPact {__version__}" in dart


def test_support_url_is_consistent_across_passive_public_surfaces() -> None:
project = Path(__file__).parents[1]
expected = "https://buymeacoffee.com/omar.hanafy"
assert (project / ".github" / "FUNDING.yml").read_text(encoding="utf-8") == (
"buy_me_a_coffee: omar.hanafy\n"
)

plugin_readme = (project / "plugins" / "glyphpact" / "README.md").read_text(encoding="utf-8")
site_config = (project / "site" / "src" / "site.config.ts").read_text(encoding="utf-8")
assert plugin_readme.count(expected) == 1
assert f"support: '{expected}'" in site_config


def test_release_publication_is_tag_only_and_default_branch_contained() -> None:
project = Path(__file__).parents[1]
workflow = (project / ".github" / "workflows" / "release.yml").read_text(encoding="utf-8")
Expand Down
Loading