0
2
next: HUD's own hud check, the app's lexicons and its HUD version
Only what this pull adds. It is built on The next grain.social and grain-ios, drawn by HUD.
.knotless/workflows/next.yml+33−3
| @@ -1,10 +1,17 @@ | ||
# The next grain.social, next/: the views, svelte-check, then the | ||
# The next grain.social, next/: the apps HUD loads (`hud check next`, | ||
# then Grain's own rules, next/check-apps.mjs), svelte-check, then the | ||
# SvelteKit build (adapter-node, as next/Dockerfile builds it), as `just | ||
# next-build` runs them. It builds HUD's renderer from the copy in | ||
# vendor/hud, so a pull moving that copy (`just vendor-hud <commit>`) is | ||
# checked here too. Its packages are kept between runs and installed again | ||
# only when next/package-lock.json changes (the npm-ci shared step). | ||
# | ||
# `hud check` is HUD's own loader, as hud-next runs it at startup: the hud | ||
# binary is built from HUD's public repository at vendor/hud/COMMIT, the | ||
# HUD this copy is of, and kept in /opt/hud, so it is built again only | ||
# when that commit moves; its build (Rust, and HUD's pages, which it | ||
# embeds) is deleted once the binary is out of it. | ||
# | ||
# ios/ is not checked: an iOS app builds only on macOS, with Xcode, and | ||
# these runners are Linux. Build it on a Mac (ios/README.md), or with Xcode | ||
# Cloud (ios/ci_scripts). | ||
| @@ -20,11 +27,34 @@ on: | ||
push: { refs: [refs/heads/main, refs/heads/feature/*] } | ||
pull: | ||
base: [refs/heads/main, refs/heads/feature/*] | ||
paths: [next/**, vendor/**, .knotless/workflows/next.yml] | ||
cache: [next/node_modules] | ||
paths: [next/**, vendor/**, lexicons/social/grain/**, .knotless/workflows/next.yml] | ||
cache: [next/node_modules, /opt/hud] | ||
steps: | ||
- uses: chadtmiller.com/steps/npm-ci@1 | ||
with: { dir: next } | ||
- name: hud | ||
timeout: 45 | ||
run: | | ||
set -e | ||
commit=$(cat vendor/hud/COMMIT) | ||
if [ "$(cat /opt/hud/COMMIT 2>/dev/null)" != "$commit" ]; then | ||
apt-get update -qq | ||
apt-get install -y -qq --no-install-recommends build-essential ca-certificates curl git >/dev/null | ||
export RUSTUP_HOME=/tmp/rustup CARGO_HOME=/tmp/cargo | ||
# The Rust HUD's Dockerfile builds hud-next's image with. | ||
curl -fsSL https://sh.rustup.rs | sh -s -- -y -q --profile minimal --no-modify-path --default-toolchain 1.98.0 | ||
git init -q /tmp/hud | ||
git -C /tmp/hud fetch -q --depth 1 https://knotless.dev/chadtmiller.com/hud "$commit" | ||
git -C /tmp/hud checkout -q FETCH_HEAD | ||
(cd /tmp/hud/web && npm ci --no-audit --no-fund && npm run build) | ||
(cd /tmp/hud && /tmp/cargo/bin/cargo build --release --locked -p hud) | ||
# /opt/hud is the cache's mount: emptied, not removed. | ||
mkdir -p /opt/hud && rm -f /opt/hud/hud /opt/hud/COMMIT | ||
cp /tmp/hud/target/release/hud /opt/hud/hud | ||
echo "$commit" > /opt/hud/COMMIT | ||
rm -rf /tmp/hud /tmp/rustup /tmp/cargo | ||
fi | ||
HUD_WORKSPACE=off /opt/hud/hud check next | ||
- name: views | ||
run: cd next && node check-apps.mjs | ||
- name: svelte-check | ||
android/gradle.properties+3−0
| @@ -4,3 +4,6 @@ org.gradle.caching=true | ||
android.useAndroidX=true | ||
android.nonTransitiveRClass=true | ||
kotlin.code.style=official | ||
# HUD's one version, which vendor/hud/android/hudkit's build names as its | ||
# own (HUD's android/gradle.properties): kept as HUD's at vendor/hud/COMMIT. | ||
hudVersion=0.2.0 | ||
next/lexicons/social/grain/actor/defs.jsonnew+195−0
| @@ -0,0 +1,195 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "social.grain.actor.defs", | ||
"defs": { | ||
"profileView": { | ||
"type": "object", | ||
"required": ["did", "handle"], | ||
"properties": { | ||
"cid": { "type": "string", "format": "cid" }, | ||
"did": { "type": "string", "format": "did" }, | ||
"handle": { "type": "string", "format": "handle" }, | ||
"displayName": { | ||
"type": "string", | ||
"maxGraphemes": 64, | ||
"maxLength": 640 | ||
}, | ||
"description": { | ||
"type": "string", | ||
"maxLength": 2560, | ||
"maxGraphemes": 256 | ||
}, | ||
"labels": { | ||
"type": "array", | ||
"items": { | ||
"ref": "com.atproto.label.defs#label", | ||
"type": "ref" | ||
} | ||
}, | ||
"avatar": { "type": "string", "format": "uri" }, | ||
"createdAt": { "type": "string", "format": "datetime" } | ||
} | ||
}, | ||
"profileViewDetailed": { | ||
"type": "object", | ||
"required": ["did", "handle"], | ||
"properties": { | ||
"cid": { "type": "string", "format": "cid" }, | ||
"did": { "type": "string", "format": "did" }, | ||
"handle": { "type": "string", "format": "handle" }, | ||
"displayName": { | ||
"type": "string", | ||
"maxGraphemes": 64, | ||
"maxLength": 640 | ||
}, | ||
"description": { | ||
"type": "string", | ||
"maxGraphemes": 256, | ||
"maxLength": 2560 | ||
}, | ||
"avatar": { "type": "string", "format": "uri" }, | ||
"cameras": { | ||
"type": "array", | ||
"items": { "type": "string" }, | ||
"description": "List of camera make and models used by this actor derived from EXIF data of photos linked to galleries." | ||
}, | ||
"followersCount": { "type": "integer" }, | ||
"followsCount": { "type": "integer" }, | ||
"galleryCount": { "type": "integer" }, | ||
"indexedAt": { "type": "string", "format": "datetime" }, | ||
"createdAt": { "type": "string", "format": "datetime" }, | ||
"messageMe": { "type": "ref", "ref": "#messageMe" }, | ||
"viewer": { "type": "ref", "ref": "#viewerState" }, | ||
"labels": { | ||
"type": "array", | ||
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" } | ||
} | ||
} | ||
}, | ||
"messageMe": { | ||
"type": "object", | ||
"required": ["showButtonTo", "messageMeUrl"], | ||
"properties": { | ||
"messageMeUrl": { "type": "string", "format": "uri" }, | ||
"showButtonTo": { "type": "string", "knownValues": ["usersIFollow", "everyone"] } | ||
} | ||
}, | ||
"viewerState": { | ||
"type": "object", | ||
"description": "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.", | ||
"properties": { | ||
"following": { "type": "string", "format": "at-uri" }, | ||
"followedBy": { "type": "string", "format": "at-uri" }, | ||
"blocking": { "type": "string", "format": "at-uri" }, | ||
"blockedBy": { "type": "boolean" }, | ||
"muted": { "type": "boolean" } | ||
} | ||
}, | ||
"profileSearchResult": { | ||
"type": "object", | ||
"required": ["did"], | ||
"properties": { | ||
"did": { "type": "string", "format": "did" }, | ||
"handle": { "type": "string" }, | ||
"displayName": { "type": "string" }, | ||
"description": { "type": "string" }, | ||
"avatar": { "type": "string" } | ||
} | ||
}, | ||
"typeaheadItem": { | ||
"type": "object", | ||
"required": ["did"], | ||
"properties": { | ||
"did": { "type": "string", "format": "did" }, | ||
"handle": { "type": "string" }, | ||
"displayName": { "type": "string" }, | ||
"avatar": { "type": "string" } | ||
} | ||
}, | ||
"suggestedFollow": { | ||
"type": "object", | ||
"required": ["did"], | ||
"properties": { | ||
"did": { "type": "string", "format": "did" }, | ||
"handle": { "type": "string" }, | ||
"displayName": { "type": "string" }, | ||
"description": { "type": "string" }, | ||
"avatar": { "type": "string" }, | ||
"followersCount": { "type": "integer" } | ||
} | ||
}, | ||
"preferences": { | ||
"type": "array", | ||
"items": { | ||
"type": "union", | ||
"refs": ["#pinnedFeedsPref", "#photoMetadataPref", "#themePref", "#notificationsPref"] | ||
} | ||
}, | ||
"pinnedFeedsPref": { | ||
"type": "object", | ||
"description": "The feeds pinned to the viewer's navigation.", | ||
"required": ["items"], | ||
"properties": { | ||
"items": { | ||
"type": "array", | ||
"items": { "type": "ref", "ref": "#pinnedFeed" }, | ||
"description": "In the order they show." | ||
} | ||
} | ||
}, | ||
"pinnedFeed": { | ||
"type": "object", | ||
"required": ["id", "label", "type", "path"], | ||
"properties": { | ||
"id": { "type": "string", "maxLength": 2048 }, | ||
"label": { "type": "string", "maxLength": 640 }, | ||
"type": { "type": "string", "knownValues": ["feed", "camera", "location", "hashtag"] }, | ||
"path": { | ||
"type": "string", | ||
"maxLength": 2048, | ||
"description": "The page it opens, on this site." | ||
} | ||
} | ||
}, | ||
"photoMetadataPref": { | ||
"type": "object", | ||
"description": "What an upload keeps of a photo's metadata.", | ||
"properties": { | ||
"includeExif": { | ||
"type": "boolean", | ||
"description": "Keep camera settings on uploaded photos." | ||
}, | ||
"includeLocation": { | ||
"type": "boolean", | ||
"description": "Keep where a photo was taken on uploaded photos." | ||
} | ||
} | ||
}, | ||
"themePref": { | ||
"type": "object", | ||
"required": ["theme"], | ||
"properties": { | ||
"theme": { "type": "string", "knownValues": ["system", "light", "dark"] } | ||
} | ||
}, | ||
"notificationsPref": { | ||
"type": "object", | ||
"description": "How each kind of notification reaches the viewer. A kind left out takes the default: push and in-app, from anyone.", | ||
"properties": { | ||
"favorites": { "type": "ref", "ref": "#notificationPref" }, | ||
"follows": { "type": "ref", "ref": "#notificationPref" }, | ||
"comments": { "type": "ref", "ref": "#notificationPref" }, | ||
"mentions": { "type": "ref", "ref": "#notificationPref" } | ||
} | ||
}, | ||
"notificationPref": { | ||
"type": "object", | ||
"required": ["push", "inApp", "from"], | ||
"properties": { | ||
"push": { "type": "boolean" }, | ||
"inApp": { "type": "boolean" }, | ||
"from": { "type": "string", "knownValues": ["all", "follows"] } | ||
} | ||
} | ||
} | ||
} | ||
next/lexicons/social/grain/actor/getFavorites.jsonnew+33−0
| @@ -0,0 +1,33 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "social.grain.actor.getFavorites", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get galleries favorited by the authenticated actor. Only the actor themselves can view their favorites.", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["actor"], | ||
"properties": { | ||
"actor": { "type": "string", "format": "at-identifier" }, | ||
"limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 30 }, | ||
"cursor": { "type": "string" } | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["items"], | ||
"properties": { | ||
"items": { | ||
"type": "array", | ||
"items": { "type": "ref", "ref": "social.grain.gallery.defs#galleryView" } | ||
}, | ||
"cursor": { "type": "string" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
next/lexicons/social/grain/actor/getPreferences.jsonnew+20−0
| @@ -0,0 +1,20 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "social.grain.actor.getPreferences", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get the viewer's grain preferences, one of each kind they have set. Requires auth.", | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["preferences"], | ||
"properties": { | ||
"preferences": { "type": "ref", "ref": "social.grain.actor.defs#preferences" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
next/lexicons/social/grain/actor/getProfile.jsonnew+31−0
| @@ -0,0 +1,31 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "social.grain.actor.getProfile", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get an actor's profile with gallery stats and follow relationships.", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["actor"], | ||
"properties": { | ||
"actor": { "type": "string", "format": "at-identifier" } | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { "type": "ref", "ref": "social.grain.actor.defs#profileViewDetailed" } | ||
}, | ||
"errors": [ | ||
{ | ||
"name": "AccountTakedown", | ||
"description": "An admin, or the account's host, took it down." | ||
}, | ||
{ | ||
"name": "AccountDeactivated", | ||
"description": "The account's host says it is deactivated." | ||
} | ||
] | ||
} | ||
} | ||
} | ||
next/lexicons/social/grain/actor/getSuggestedFollows.jsonnew+30−0
| @@ -0,0 +1,30 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "social.grain.actor.getSuggestedFollows", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get suggested profiles to follow based on bsky follow graph.", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["actor"], | ||
"properties": { | ||
"actor": { "type": "string", "format": "did" }, | ||
"limit": { "type": "integer", "minimum": 1, "maximum": 20, "default": 10 } | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"items": { | ||
"type": "array", | ||
"items": { "type": "ref", "ref": "social.grain.actor.defs#suggestedFollow" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
next/lexicons/social/grain/actor/profile.jsonnew+34−0
| @@ -0,0 +1,34 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "social.grain.actor.profile", | ||
"defs": { | ||
"main": { | ||
"type": "record", | ||
"description": "A declaration of a basic account profile.", | ||
"key": "literal:self", | ||
"record": { | ||
"type": "object", | ||
"properties": { | ||
"displayName": { | ||
"type": "string", | ||
"maxGraphemes": 64, | ||
"maxLength": 640 | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "Free-form profile description text.", | ||
"maxGraphemes": 256, | ||
"maxLength": 2560 | ||
}, | ||
"avatar": { | ||
"type": "blob", | ||
"description": "Small image to be displayed next to posts from account. AKA, 'profile picture'", | ||
"accept": ["image/png", "image/jpeg"], | ||
"maxSize": 1000000 | ||
}, | ||
"createdAt": { "type": "string", "format": "datetime" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
next/lexicons/social/grain/actor/putPreferences.jsonnew+24−0
| @@ -0,0 +1,24 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "social.grain.actor.putPreferences", | ||
"defs": { | ||
"main": { | ||
"type": "procedure", | ||
"description": "Set the viewer's grain preferences, replacing all of them, as app.bsky.actor.putPreferences does. Requires auth.", | ||
"input": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["preferences"], | ||
"properties": { | ||
"preferences": { "type": "ref", "ref": "social.grain.actor.defs#preferences" } | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { "type": "object", "properties": {} } | ||
} | ||
} | ||
} | ||
} | ||
next/lexicons/social/grain/actor/searchActors.jsonnew+33−0
| @@ -0,0 +1,33 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "social.grain.actor.searchActors", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Full-text search for user profiles.", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["q"], | ||
"properties": { | ||
"q": { "type": "string", "description": "Search query" }, | ||
"limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 30 }, | ||
"cursor": { "type": "string" }, | ||
"fuzzy": { "type": "boolean", "default": true } | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"items": { | ||
"type": "array", | ||
"items": { "type": "ref", "ref": "social.grain.actor.defs#profileSearchResult" } | ||
}, | ||
"cursor": { "type": "string" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||