Skip to content
Open
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
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ public
**/generated
dist
build
bruno
bruno
packages/documentation/**
10 changes: 10 additions & 0 deletions .github/workflows/node-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ jobs:
- run: pnpm --filter frontend typecheck
- run: pnpm --filter frontend build

documentation:
runs-on: ubuntu-latest
needs: prerequisite
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/rafiki/env-setup
- run: pnpm --filter documentation lint

auth:
runs-on: ubuntu-latest
needs: prerequisite
Expand Down Expand Up @@ -351,6 +360,7 @@ jobs:
card-service,
point-of-sale,
mock-account-servicing-entity,
documentation,
graphql,
codeql-analyze,
integration-test
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ build
.docusaurus
.cache-loader
.astro
open-payments-specifications/**
open-payments-specifications/**
packages/documentation/**
33 changes: 30 additions & 3 deletions packages/documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,37 @@ This website is built with [Starlight](https://starlight.astro.build/), a docume
- Make sure all the dependencies for the website are installed. Because this is a monorepo, you should run the following command in the root of the project folder:

```sh
$ pnpm i
pnpm i
```

- Run the dev server from the `/packages/documentation` folder:

```sh
$ pnpm start
pnpm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

- Build the site, again, this must be run from the `/packages/documentation` folder:

```sh
$ pnpm build:docs
pnpm build:docs
```

This command generates static content into the build directory and can be served using any static contents hosting service.

- Format code and fix linting issues:

```sh
pnpm format
```

- Check formatting and linting:

```sh
pnpm lint
```

## Editing Content

Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. Due to the nature of how Starlight deals with content and their generated URLs, all docs content lives in `/src/content/docs/`. For example, the home page of the documentation lives within the `/src/content/docs/` folder and is rendered at rafiki.dev, not rafiki.dev/docs.
Expand Down Expand Up @@ -112,3 +124,18 @@ import Base from '../layouts/Base.astro';
```

Refer to the Astro documentation on [pages](https://docs.astro.build/en/core-concepts/astro-pages/) for more detailed guidance.

## Code Formatting

This project uses [Biome](https://biomejs.dev/), [Prettier](https://prettier.io/), and [ESLint](https://eslint.org/) for code quality. Biome handles most JS/TS/JSON linting + formatting and also enforces import order. Prettier handles markdown/MDX, and ESLint covers Astro/TypeScript-specific rules.

1. **Fix issues**: Run `pnpm format` to execute Biome (`biome format --write .`), format markdown via Prettier, and run ESLint with `--fix`. This is the quickest way to resolve most style issues.
2. **Check before pushing**: Run `pnpm lint` to run Biome, Prettier (in `--check` mode), and ESLint without auto-fixes. CI executes the same command, so make sure it passes locally.

Biome tips:

- Configuration lives in `biome.json`. Adjust rules there if the defaults block development.
- Scope Biome runs to a directory when iterating, e.g. `pnpm biome check src/components/Header.astro`.
- Biome respects `.gitignore`, so add new generated folders there if they should be skipped.

ESLint is configured to work with TypeScript and Astro files. The configuration extends recommended rules from ESLint, TypeScript ESLint, and Astro ESLint plugins.
11 changes: 5 additions & 6 deletions packages/documentation/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { defineConfig } from 'astro/config'
import { rehypeHeadingIds } from '@astrojs/markdown-remark'
import starlight from '@astrojs/starlight'

import remarkMath from 'remark-math'
import { defineConfig } from 'astro/config'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeMathjax from 'rehype-mathjax'
import starlightLinksValidator from 'starlight-links-validator'
import remarkMath from 'remark-math'
import starlightFullViewMode from 'starlight-fullview-mode'
import { rehypeHeadingIds } from '@astrojs/markdown-remark'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import starlightLinksValidator from 'starlight-links-validator'
import starlightVersions from 'starlight-versions'

// https://astro.build/config
Expand Down
49 changes: 49 additions & 0 deletions packages/documentation/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.7/schema.json",
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded",
"trailingCommas": "none",
"jsxQuoteStyle": "single"
}
},
"files": {
"includes": [
"**/*.astro",
"**/*.{js,jsx,ts,tsx,cjs,mjs,json}",
"!**/node_modules",
"!**/dist",
"!**/build",
"!**/.astro"
]
},
"overrides": [
{
"includes": ["**/*.astro"],
"formatter": {
"enabled": true
},
"linter": {
"rules": {
"correctness": {
"noUnusedImports": "off",
"noUnusedVariables": "off"
}
}
}
}
]
}
Loading
Loading