Skip to content

Commit ef3081e

Browse files
committed
style: 🎨 remove em dashes across the documentation
1 parent c9ec6b5 commit ef3081e

16 files changed

Lines changed: 114 additions & 114 deletions

‎docs/dev/api-reference.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ head:
1212

1313
The central API exposes its functionality over HTTP from `ui/server/api`. This page is a reference to those endpoints.
1414

15-
> [!WARNING] > **Internal and evolving.** These endpoints currently power Codefair's own web UI and are authenticated with the browser **session cookie**, not API tokens. They are documented here as the foundation of the planned **public REST API** — paths, payloads, and the auth model may change before a stable, token-authenticated, versioned API is released. Treat this as a contributor reference, not a public contract.
15+
> [!WARNING] > **Internal and evolving.** These endpoints currently power Codefair's own web UI and are authenticated with the browser **session cookie**, not API tokens. They are documented here as the foundation of the planned **public REST API**, so paths, payloads, and the auth model may change before a stable, token-authenticated, versioned API is released. Treat this as a contributor reference, not a public contract.
1616
1717
## :gear: Conventions
1818

@@ -54,7 +54,7 @@ Each FAIR check exposes a consistent trio: `GET` current state, `POST` to create
5454

5555
> [!NOTE]
5656
> A second, older pair of routes exists at `/dashboard/[owner]` and
57-
> `/dashboard/[owner]/[repo]`. No page calls them — the UI uses
57+
> `/dashboard/[owner]/[repo]`. No page calls them; the UI uses
5858
> `/[owner]/dashboard` and `/[owner]/[repo]/dashboard` above. Treat them as
5959
> deprecated and don't build on them.
6060
@@ -118,7 +118,7 @@ the browser rather than by `fetch`.
118118
| :----- | :--------------------------------- | :------ | :------------------------------------------------------------------------------------ |
119119
| GET | `/up` | Public | Health check for the deployment proxy. |
120120
| GET | `/login/github` | Public | Starts GitHub OAuth. Accepts `?redirect=` to return the user where they started. |
121-
| GET | `/login/github/callback` | Public | OAuth callback — validates state, creates the session, redirects to the dashboard. |
121+
| GET | `/login/github/callback` | Public | OAuth callback: validates state, creates the session, redirects to the dashboard. |
122122
| GET | `/doi/[owner]/[repo]` | Public | Redirects to the repository's published DOI. **This is the DOI badge's link target.** |
123123
| GET | `/add/license/[identifier]` | Session | Redirect shim to the license editor. Kept for links in older dashboard issues. |
124124
| GET | `/add/code-metadata/[identifier]` | Session | Redirect shim to the metadata editor. |

‎docs/dev/architecture.md‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ flowchart LR
3030
GL["GitLab (planned)"]
3131
end
3232
33-
subgraph CentralAPI["Central API — ui/ (Nuxt + Nitro)"]
33+
subgraph CentralAPI["Central API: ui/ (Nuxt + Nitro)"]
3434
WH["/api/webhooks/github"]
35-
SVC["services/ — webhooks, compliance,<br/>dashboard, archival"]
35+
SVC["services/: webhooks, compliance,<br/>dashboard, archival"]
3636
REST["/api/** REST endpoints"]
37-
WEB["Web UI — pages/, components/"]
37+
WEB["Web UI: pages/, components/"]
3838
end
3939
4040
VAL["Validator microservice<br/>(Flask, port 5000)"]
@@ -59,8 +59,8 @@ flowchart LR
5959
| :-------------- | :----------- | :------------------------------------ | :---------------------------------------------------------------------------- |
6060
| **Central API** | `ui/` | Nuxt 4, Nitro, Octokit, Prisma, Lucia | Web UI **and** backend: webhooks, compliance, dashboard, PRs, archival, auth. |
6161
| **Validator** | `validator/` | Python 3, Flask, Flask-RESTX | Validates CWL, `CITATION.cff`, and `codemeta.json` over HTTP. |
62-
| **Database** | — | PostgreSQL | Stores installations, per-check state, users, and Zenodo depositions. |
63-
| **Zenodo** | — | external | Archival of releases and DOI minting. |
62+
| **Database** | n/a | PostgreSQL | Stores installations, per-check state, users, and Zenodo depositions. |
63+
| **Zenodo** | n/a | external | Archival of releases and DOI minting. |
6464

6565
## :gear: Inside the central API (`ui/server`)
6666

@@ -70,19 +70,19 @@ The backend lives in `ui/server` and follows Nuxt/Nitro conventions:
7070
| :------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
7171
| `server/api/` | HTTP endpoints. File name encodes the method, e.g. `index.get.ts`, `index.post.ts`. See the [API reference](./api-reference.md). |
7272
| `server/routes/` | Non-API server routes: GitHub OAuth login, `add/*` redirect shims, health check. |
73-
| `server/middleware/` | Runs on every request — session validation and CSRF checks (`auth.ts`). |
73+
| `server/middleware/` | Runs on every request: session validation and CSRF checks (`auth.ts`). |
7474
| `server/services/` | The business logic, grouped by concern (see below). |
7575
| `server/utils/` | Shared helpers: `prisma.ts`, `auth/*`, `cuid.ts`, `logwatch.ts`. |
7676
| `server/plugins/` | Nitro startup plugins, e.g. `env-check.ts` which fails fast on missing env vars. |
7777

7878
The `services/` folder is where most feature work happens:
7979

80-
- **`services/webhooks/`** — one handler per GitHub event family: `installation.ts`, `push.ts`, `pull-request.ts`, `issues.ts`.
81-
- **`services/compliance/`** — the FAIR checks: `license.ts`, `metadata.ts`, `readme.ts`, `contributing.ts`, `cwl.ts`, orchestrated by `index.ts`.
82-
- **`services/providers/`** — the platform abstraction: `interface.ts` (the contract) and `github.ts` (the GitHub implementation).
83-
- **`services/github-app/`** — `client.ts` wires up the Octokit `App` and hands out installation-scoped clients.
84-
- **`services/dashboard/`** — `manager.ts` (reads/writes the dashboard issue) and `renderer.ts` (pure markdown builder).
85-
- **`services/archival/`** — `interface.ts` (the `ArchivalProvider` contract) and `zenodo.ts` (the Zenodo implementation).
80+
- **`services/webhooks/`**: one handler per GitHub event family: `installation.ts`, `push.ts`, `pull-request.ts`, `issues.ts`.
81+
- **`services/compliance/`**: the FAIR checks: `license.ts`, `metadata.ts`, `readme.ts`, `contributing.ts`, `cwl.ts`, orchestrated by `index.ts`.
82+
- **`services/providers/`**: the platform abstraction: `interface.ts` (the contract) and `github.ts` (the GitHub implementation).
83+
- **`services/github-app/`**: `client.ts` wires up the Octokit `App` and hands out installation-scoped clients.
84+
- **`services/dashboard/`**: `manager.ts` (reads/writes the dashboard issue) and `renderer.ts` (pure markdown builder).
85+
- **`services/archival/`**: `interface.ts` (the `ArchivalProvider` contract) and `zenodo.ts` (the Zenodo implementation).
8686

8787
## :inbox_tray: How a webhook is handled
8888

@@ -116,16 +116,16 @@ sequenceDiagram
116116

117117
Key handlers:
118118

119-
- **`installation` / `installation_repositories`** — a repo was added or removed. On add, Codefair creates an `Installation` row, runs the first compliance check, and opens the dashboard issue. (To protect against bulk installs, only the first repositories get a full run; the rest are rate-limited.)
120-
- **`push`** — only the default branch is processed. Codefair re-runs the checks and updates the dashboard.
121-
- **`pull_request`** — tracks the Codefair-created PRs (license, README, …) so the dashboard can show their status.
122-
- **`issues`** — reopening the dashboard issue restores it; closing updates state.
119+
- **`installation` / `installation_repositories`**: a repo was added or removed. On add, Codefair creates an `Installation` row, runs the first compliance check, and opens the dashboard issue. (To protect against bulk installs, only the first repositories get a full run; the rest are rate-limited.)
120+
- **`push`**: only the default branch is processed. Codefair re-runs the checks and updates the dashboard.
121+
- **`pull_request`**: tracks the Codefair-created PRs (license, README, …) so the dashboard can show their status.
122+
- **`issues`**: reopening the dashboard issue restores it; closing updates state.
123123

124124
## :electric_plug: The provider abstraction (multi-platform support)
125125

126126
The most important design decision is that **compliance services never touch
127127
Octokit directly**. Instead they receive a `RepositoryProvider`
128-
(`server/services/providers/interface.ts`) — a platform-agnostic contract with
128+
(`server/services/providers/interface.ts`), a platform-agnostic contract with
129129
methods like `getFileContent`, `listDirectory`, `commitFile`,
130130
`createPullRequest`, and `createIssue`.
131131

@@ -144,8 +144,8 @@ flowchart TD
144144
`GitHubRepositoryProvider` (`providers/github.ts`) implements that contract
145145
today by translating each method into an Octokit request. A future
146146
`GitLabRepositoryProvider` will implement the **same** interface, and the
147-
compliance code will not need to change. This is what makes GitLab support — and
148-
the eventual public REST API — tractable. See
147+
compliance code will not need to change. This is what makes GitLab support (and
148+
the eventual public REST API) tractable. See
149149
[Platform Providers (GitLab)](./providers.md) for how to add one.
150150

151151
Archival follows the same pattern: `ArchivalProvider`
@@ -155,7 +155,7 @@ for additional archival backends (e.g. Figshare) later.
155155
## :floppy_disk: Data model
156156

157157
State is stored in PostgreSQL through Prisma (`ui/prisma/schema.prisma`). The
158-
hub of the schema is the **`Installation`** model — one row per repository
158+
hub of the schema is the **`Installation`** model, one row per repository
159159
Codefair is installed on. Each compliance check has its own model linked 1:1 to
160160
`Installation` and cascades on delete:
161161

@@ -176,15 +176,15 @@ erDiagram
176176
Other models include `User` and `Session` (authentication), `ZenodoToken` and
177177
`ZenodoDeposition` (archival), and `Analytics` (usage counters).
178178

179-
## :lock: Authentication — two distinct identities
179+
## :lock: Authentication: two distinct identities
180180

181181
Codefair uses GitHub in two different ways, and it helps to keep them separate:
182182

183-
1. **GitHub App identity** — how Codefair acts _as the bot_ (reading repos,
183+
1. **GitHub App identity**: how Codefair acts _as the bot_ (reading repos,
184184
committing files, opening PRs and issues). Configured in
185185
`services/github-app/client.ts` with `GH_APP_ID` and `GH_APP_PRIVATE_KEY`;
186186
Octokit mints short-lived, installation-scoped tokens automatically.
187-
2. **User identity** — how a human signs in to the web dashboard. This is GitHub
187+
2. **User identity**: how a human signs in to the web dashboard. This is GitHub
188188
**OAuth**, handled with [Lucia](https://lucia-auth.com/) sessions and
189189
[Arctic](https://arctic.js.org/) (`server/utils/auth.ts`,
190190
`server/middleware/auth.ts`). The user's OAuth token is used to confirm they
@@ -195,7 +195,7 @@ Codefair uses GitHub in two different ways, and it helps to keep them separate:
195195

196196
The `validator/` service is intentionally small and stateless. It exposes a few
197197
HTTP endpoints (`/validate-cwl`, `/validate-citation`, `/validate-codemeta`,
198-
plus `/up` and `/echo`) and wraps established tools — `cwltool`, `cffconvert`,
198+
plus `/up` and `/echo`) and wraps established tools: `cwltool`, `cffconvert`,
199199
and JSON-Schema validation for CodeMeta. The central API calls it via the
200200
`VALIDATOR_URL` environment variable. Because it is decoupled over HTTP, it can
201201
be deployed and scaled independently. To add a new validation type, see
@@ -213,7 +213,7 @@ If you worked on Codefair before, here is what changed:
213213
| Two backends (`bot` + `ui`) with two `.env` files. | One app, one `ui/.env`. |
214214
| Two deployments to keep in step. | One deployment, one Prisma schema. |
215215

216-
Both backends use PostgreSQL through Prisma — that did not change in the
216+
Both backends use PostgreSQL through Prisma; that did not change in the
217217
migration. The schema now lives only in `ui/prisma/`.
218218

219219
### The `use_central_api` flag {#use-central-api-flag}
@@ -222,8 +222,8 @@ The cutover is per repository, not global. `Installation.use_central_api`
222222
(added in migration `20260320211650`) decides which backend handles a given
223223
repository:
224224

225-
- **`true`** — the central API handles it. Every `bot/` handler early-returns.
226-
- **`false`** (the default) — the legacy Probot backend still handles it.
225+
- **`true`**: the central API handles it. Every `bot/` handler early-returns.
226+
- **`false`** (the default): the legacy Probot backend still handles it.
227227

228228
This is why `bot/` is best described as **being retired** rather than gone: it
229229
still serves installations that have not been flipped over. Two consequences

‎docs/dev/compliance-check.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ head:
1010

1111
# Adding a Compliance Check :sparkles:
1212

13-
A **compliance check** is a single FAIR rule Codefair evaluates for a repository — for example "does a `LICENSE` file exist?" or "is the `codemeta.json` valid?". Each check produces a result that is stored in the database and rendered as a section of the repository's **FAIR Compliance Dashboard** issue.
13+
A **compliance check** is a single FAIR rule Codefair evaluates for a repository. For example, "does a `LICENSE` file exist?" or "is the `codemeta.json` valid?". Each check produces a result that is stored in the database and rendered as a section of the repository's **FAIR Compliance Dashboard** issue.
1414

1515
Codefair is deliberately modular: checks are small functions that receive a platform-agnostic [`RepositoryProvider`](./providers.md) and are wired into a single orchestrator, `runComplianceChecks()`. This page walks through adding a brand-new check end-to-end by building an example that verifies an `expecto_patronum.md` file exists.
1616

@@ -68,7 +68,7 @@ export async function checkForExpecto(
6868
```
6969

7070
> [!IMPORTANT]
71-
> Always go through the `provider` (`getFileContent`, `listDirectory`, `commitFile`, …) — **never** import Octokit directly in a compliance service. This is what lets the same check run unchanged on GitHub today and GitLab in the future. See [Platform Providers](./providers.md).
71+
> Always go through the `provider` (`getFileContent`, `listDirectory`, `commitFile`, …). **Never** import Octokit directly in a compliance service. This is what lets the same check run unchanged on GitHub today and GitLab in the future. See [Platform Providers](./providers.md).
7272
7373
## **Step 3**: Register the check in the orchestrator
7474

@@ -94,7 +94,7 @@ export interface ComplianceSubjects {
9494
expecto: ExpectoResult;
9595
}
9696

97-
// 3. Run it inside runComplianceChecks() — add a default stub and a Promise.all entry
97+
// 3. Run it inside runComplianceChecks(): add a default stub and a Promise.all entry
9898
const defaultExpecto: ExpectoResult = { content: '', path: '', status: false };
9999

100100
const [readme, license, metadata, contributing, cofc, expecto] =
@@ -154,7 +154,7 @@ To write results back, follow the pattern in `server/services/compliance/license
154154
155155
## **Step 5**: Render it on the dashboard
156156
157-
The dashboard issue body is built by `server/services/dashboard/renderer.ts` — a pure function that turns the compliance results into Markdown. Add a section renderer modelled on `renderReadme()`:
157+
The dashboard issue body is built by `server/services/dashboard/renderer.ts`, a pure function that turns the compliance results into Markdown. Add a section renderer modelled on `renderReadme()`:
158158
159159
```typescript
160160
function renderExpecto(
@@ -191,14 +191,14 @@ Then call it from `renderDashboard()` and add the data to the `DashboardSections
191191
body += renderExpecto(owner, repo, expecto);
192192
```
193193
194-
When `renderDashboard()` runs, the dashboard manager (`server/services/dashboard/manager.ts`) updates the single GitHub issue for the repository — no extra wiring needed.
194+
When `renderDashboard()` runs, the dashboard manager (`server/services/dashboard/manager.ts`) updates the single GitHub issue for the repository, with no extra wiring needed.
195195
196196
## **Step 6**: Test the feature
197197
198198
Run the stack locally (see [Running Locally](./running-locally.md)):
199199
200200
```bash
201-
# In ui/ — runs the Nuxt server plus the Smee webhook proxy
201+
# In ui/: runs the Nuxt server plus the Smee webhook proxy
202202
yarn dev:webhook
203203
```
204204

0 commit comments

Comments
 (0)