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
29 changes: 28 additions & 1 deletion .github/actions/keep-alive/__tests__/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,32 @@ def fake_create_client_sync(**kwargs):

module.run()

assert captured["url"] == "libsql://input.turso.io"
assert captured["url"] == "libsql://input.turso.io/"
assert captured["auth_token"] == "input_token"


def test_normalizes_libsql_url_to_include_trailing_slash(monkeypatch: pytest.MonkeyPatch) -> None:
module = load_action_module()

monkeypatch.setenv("ASTRO_DB_REMOTE_URL", "libsql://example.turso.io")
monkeypatch.setenv("ASTRO_DB_APP_TOKEN", "token")
monkeypatch.setattr(module.core, "get_input", lambda name, required=False: "")

captured: dict[str, str] = {}

class MockClient:
def execute(self, sql: str) -> None:
pass

def close(self) -> None:
pass

def fake_create_client_sync(**kwargs):
captured.update({"url": kwargs.get("url"), "auth_token": kwargs.get("auth_token")})
return MockClient()

monkeypatch.setattr(module, "create_client_sync", fake_create_client_sync)

module.run()

assert captured["url"] == "libsql://example.turso.io/"
16 changes: 15 additions & 1 deletion .github/actions/keep-alive/src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import os
import urllib.parse

from actions_toolkit import core
from libsql_client import create_client_sync
Expand All @@ -20,12 +21,25 @@ def get_required_value(value: str, label: str) -> str:
return trimmed


def normalize_libsql_url(url: str) -> str:
parsed = urllib.parse.urlparse(url)

# libsql-client transforms libsql:// URLs into ws(s):// for Hrana WebSockets.
# When the path is empty, some servers reject the handshake for `wss://host`
# (no trailing slash). Normalize to `.../`.
if parsed.scheme == "libsql" and parsed.netloc and parsed.path == "":
parsed = parsed._replace(path="/")
return urllib.parse.urlunparse(parsed)

return url


def run() -> None:
try:
url = get_optional_input_or_env("astro-db-remote-url", "ASTRO_DB_REMOTE_URL")
auth_token = get_optional_input_or_env("astro-db-app-token", "ASTRO_DB_APP_TOKEN")

required_url = get_required_value(url, "ASTRO_DB_REMOTE_URL")
required_url = normalize_libsql_url(get_required_value(url, "ASTRO_DB_REMOTE_URL"))
required_auth_token = get_required_value(auth_token, "ASTRO_DB_APP_TOKEN")

client = create_client_sync(url=required_url, auth_token=required_auth_token)
Expand Down
5 changes: 5 additions & 0 deletions @types/svg.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ declare module '*.svg' {
const content: unknown
export default content
}

declare module '*.svg?raw' {
const content: string
export default content
}
47 changes: 20 additions & 27 deletions _TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,9 @@ cat.structure: Rules related to the document's overall structure, like the prope
cat.tables: Rules for data tables, including headers and associations.
cat.text-alternatives: Rules for ensuring that text alternatives are provided for non-text content, such as images.

## Set up webmentions

Needs to add real API key and test
## Performance

- Get API token from webmention.io
- Add WEBMENTION_IO_TOKEN to .env
- (Optional) Set up Bridgy for social media
- Test with sample webmentions
Implement mitigations in test/e2e/specs/07-performance/PERFORMANCE.md

## Prefetch Links

Expand Down Expand Up @@ -149,13 +144,9 @@ You can then opt-out of prefetching for individual links by setting data-astro-p
<a href="/about" data-astro-prefetch="false">About</a>
```

## Mobile Social Shares UI

See the example image in Social Shares. The social shares UI on mobile should be a modal that slides in from the bottom.

## Performance
## Email Templates

Implement mitigations in test/e2e/specs/07-performance/PERFORMANCE.md
Right now we're using string literals to define HTML email templates for site mails. We should use Nunjucks with the rule-checking for valid CSS in HTML emails like we have in the corporate email footer repo.

## Analytics

Expand All @@ -171,9 +162,23 @@ npm i @vercel/analytics
import Analytics from '@vercel/analytics/astro'
https://vercel.com/docs/analytics/quickstart#add-the-analytics-component-to-your-app

## Set up webmentions

Needs to add real API key and test

- Get API token from webmention.io
- Add WEBMENTION_IO_TOKEN to .env
- (Optional) Set up Bridgy for social media
- Test with sample webmentions

## Mobile Social Shares UI

See the example image in Social Shares. The social shares UI on mobile should be a modal that slides in from the bottom.

## Themepicker tooltips, extra themes

- Add additional themes
- Add additional themes (high contrast)
- Add Carousel
- Add tooltip that makes use of the description field for the theme, explaining what the intent of the theme is

## Sentry feedback, chat bot tying into my phone and email
Expand All @@ -192,21 +197,9 @@ Where to upload to?

Add Upstash Search as a Vercel Marketplace Integration.

Lunr is a JS search library using an inverted index. Client-side search for statically hosted pages.

### [`@jackcarey/astro-lunr`](https://www.npmjs.com/package/@jackcarey/astro-lunr)

### [`@siverv/astro-lunr`](https://www.npmjs.com/package/@siverv/astro-lunr)

## Email Templates

Right now we're using string literals to define HTML email templates for site mails. We should use Nunjucks with the rule-checking for valid CSS in HTML emails like we have in the corporate email footer repo.

## Astro Components to Add

### "Add to Calendar" button

Google Calendar, Apple Calendar, Yahoo Calender, Microsoft 365, Outlook, and Teams, and generate iCal/ics files (for all other calendars and cases).
Google Calendar, Apple Calendar, Microsoft Outlook and Teams, and generate iCal/ics files (for all other calendars and cases).

`https://github.com/add2cal/add-to-calendar-button`
`https://add-to-calendar-button.com/`
Loading
Loading