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
2 changes: 1 addition & 1 deletion .github/workflows/exposure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Exposure

on:
schedule:
- cron: '17 6 * * *'
- cron: "17 6 * * *"
workflow_dispatch:

permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ name: Sync

on:
schedule:
- cron: '23 5 * * *'
- cron: '41 5 * * 1'
- cron: "23 5 * * *"
- cron: "41 5 * * 1"
repository_dispatch:
types: [sources-released]
workflow_dispatch:
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ RUN --mount=type=cache,id=spinbox-docs-sfw,target=/root/.cache/spin-stack/sfw \
# task dev runs as the host's user: Vite and Astro write their caches under node_modules.
&& chmod a+rwx node_modules

# Biome over the code - lint, formatting, sorted imports (biome.json) - and astro check over the
# types. .git is in the context, so Biome leaves out what .gitignore does, as it would on a host.
FROM deps AS lint
COPY . .
RUN pnpm exec biome ci . && pnpm exec astro check

FROM deps AS build
ARG SITE_URL
ARG BASE_PATH
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ that is not one task (`taskgate`).
and the issues, pull requests and comments for secrets and for what is private without being one;
`.github/workflows/exposure.yml` runs it every morning. A value public on purpose is answered in
`.github/exposure-allow.txt` with why, a secret gitleaks takes for one in `.gitleaks.toml`.
- **The code is linted** by `task lint`: [Biome](https://biomejs.dev) - its lint, its
formatting and sorted imports, as `biome.json` sets them, the blog's settings - and `astro
check` over the types, as a stage of the image. What is generated or copied (`src/data`,
`src/assets`, brand's stylesheets, `public/`) is not linted, and nor is `pnpm-workspace.yaml`,
which pnpm writes. `pnpm exec biome check --write .` in the image fixes what Biome can.
- **Pages** are Markdown under `src/content/docs/`. Every page needs a `description`: it is its
line in `llms.txt`. A page must be in `src/lib/nav.mjs`, or the build fails. Each group there
belongs to a topic - Docs, Install and operate, Security, Reference - and the sidebar shows one
Expand Down
10 changes: 8 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"

# The site: Astro Starlight under src/, and two Go tools under tools/ - refgen writes the
# reference pages from the sources they describe, linkcheck fails on a link the build did not
Expand Down Expand Up @@ -124,6 +124,11 @@ tasks:
--build-arg SITE_URL={{.SITE_URL}} --build-arg BASE_PATH={{.BASE_PATH}}
--output type=local,dest=dist .

lint:
desc: Biome over the code (lint, formatting, sorted imports; biome.json) and astro check over the types, as a stage of the image. Biome's own fixes are `pnpm exec biome check --write` in it.
cmds:
- docker build --target lint $(versions args golang node) --secret id=github_token,env=GITHUB_TOKEN --output type=cacheonly .

links:
desc: Fail on a link to a page or an anchor the build did not produce.
cmds:
Expand All @@ -135,7 +140,7 @@ tasks:
- go run ./tools/linkcheck -external dist

gate:
desc: What CI runs - every install through the firewall and every workflow step a task, the install, vet and the tools' tests, the reference against the public sources, the build, and every link.
desc: What CI runs - every install through the firewall and every workflow step a task, the install, vet and the tools' tests, Biome and astro check, the reference against the public sources, the build, and every link.
cmds:
- sfw check
# The Task running this one, which taskgate asks for the task names a workflow step runs.
Expand All @@ -146,6 +151,7 @@ tasks:
- task: install
- go vet ./...
- go test ./...
- task: lint
- task: reference:public
- task: build
- task: links
Expand Down
6 changes: 3 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @ts-check
import starlight from '@astrojs/starlight';
import { defineConfig } from 'astro/config';
import { rehypeBaseLinks } from './src/lib/base-links.mjs';
import { rehypeFeatureLinks } from './src/lib/feature-links.mjs';
import { rehypePostLinks } from './src/lib/post-links.mjs';
import starlightImageZoom from 'starlight-image-zoom';
import starlightSidebarTopics from 'starlight-sidebar-topics';
import { rehypeBaseLinks } from './src/lib/base-links.mjs';
import { rehypeFeatureLinks } from './src/lib/feature-links.mjs';
import { sidebarTopics } from './src/lib/nav.mjs';
import { rehypePostLinks } from './src/lib/post-links.mjs';

// Where the site is served: a GitHub project page is https://<org>.github.io/<repo>/. The
// content links from the root, and rehypeBaseLinks puts the base in front.
Expand Down
41 changes: 41 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://biomejs.dev/schemas/2.6.8/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": ["**", "!**/*.md", "!public", "!tools", "!ui-hill-climb", "!pnpm-workspace.yaml", "!src/data", "!src/assets", "!src/styles/brand-*.css"]
},
"formatter": {
"indentStyle": "tab",
"lineWidth": 160
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"json": {
"formatter": {
"indentStyle": "space",
"indentWidth": 2
}
},
"html": {
"experimentalFullSupportEnabled": true
},
"overrides": [
{
"includes": ["**/*.astro"],
"linter": {
"rules": {
"style": {
"noDescendingSpecificity": "off"
}
}
}
}
]
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@
"starlight-image-zoom": "0.16.2",
"starlight-sidebar-topics": "0.9.0",
"unist-util-visit": "^5.2.0"
},
"devDependencies": {
"@astrojs/check": "0.9.12",
"@biomejs/biome": "2.6.8",
"typescript": "6.0.3"
}
}
Loading