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
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
target-branch: develop
schedule:
interval: weekly
groups:
minor-and-patch:
update-types: [minor, patch]
- package-ecosystem: github-actions
directory: /
target-branch: develop
schedule:
interval: weekly
groups:
actions:
patterns: ["*"]
52 changes: 52 additions & 0 deletions .github/workflows/branch-flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Branch flow

# Changes flow one way: topic branches → develop → qa → main, and main is what's published.
# Urgent fixes go hotfix/* → main and are merged back. This check fails a pull request aimed at
# the wrong branch.
on:
pull_request:
types: [opened, reopened, edited, synchronize]

permissions:
contents: read

jobs:
direction:
name: Branch flow
runs-on: ubuntu-24.04
steps:
- name: Check the source and target branches
env:
FROM: ${{ github.head_ref }}
TO: ${{ github.base_ref }}
FROM_FORK: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
run: |
refuse() {
echo "::error::A pull request from '$FROM' can't target '$TO'. $1"
exit 1
}

case "$TO" in
develop)
[ "$FROM_FORK" = "true" ] && exit 0
case "$FROM" in
feature/* | fix/* | chore/* | docs/* | content/* | dependabot/* | main) exit 0 ;;
*) refuse "Name the branch feature/…, fix/…, chore/…, docs/… or content/…." ;;
esac
;;
qa)
case "$FROM" in
develop | main) exit 0 ;;
*) refuse "Only develop is promoted to qa (and main, to bring back a hotfix)." ;;
esac
;;
main)
case "$FROM" in
qa | hotfix/*) exit 0 ;;
*) refuse "Only qa and hotfix/* branches go into main." ;;
esac
;;
*)
refuse "Open pull requests against develop."
;;
esac
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
pull_request:
push:
branches: [develop, qa, main]

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: Build and check
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm format:check
- run: pnpm typecheck
- run: pnpm test
# Builds the site, then checks that nothing in it loads from another server and that every
# link within the site points at a page that exists.
- run: pnpm build
48 changes: 48 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to GitHub Pages

# Every change that reaches main is published at https://patchyard.github.io/.
on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

# One deployment at a time; a newer push waits rather than cancelling one in flight.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
name: Build the site
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- uses: actions/upload-pages-artifact@v5
with:
path: dist

deploy:
name: Deploy
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pnpm-lock.yaml
dist
.astro
vendor
59 changes: 56 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,60 @@

The Patchyard website, published at <https://patchyard.github.io/>.

Patchyard makes small, useful open-source tools, built in the open. This site lists them and holds
a page for each one.
No one should have to pay for software. Patchyard builds open-source replacements for the tools
teams pay for every month, one at a time. This site lists them and holds a page for each one.

Licensed under the Apache License 2.0. See [LICENSE](LICENSE).
| Address | What's there |
| ------------------- | --------------------------------------------------------------- |
| `/` | Patchyard and every tool |
| `/kindwall/` | Kindwall, with a live demo wall drawn by Kindwall's real widget |
| `/kindwall/hosted/` | Kindwall's free hosted server |
| `/reprodrop/` | ReproDrop's own site, published from its repository |

## Working on it

You need Node 24 (see `.nvmrc`) and pnpm 9 (`corepack enable`).

```bash
pnpm install
pnpm dev # http://localhost:4321
pnpm verify # lint, formatting, types, tests and a production build
```

`pnpm build` writes the site to `dist/` and then checks it: nothing may load from another server
(no analytics, trackers, web fonts or scripts from elsewhere), and every link to a page on this
site must point at a page that exists.

## Adding a tool

1. Add it to [`src/data/products.ts`](src/data/products.ts). The home page, the footer and the
404 page are built from that list.
2. If the tool's page lives here, add `src/pages/<slug>/index.astro`. Give it the tool's own look,
inside the Patchyard header and footer ([`src/layouts/Base.astro`](src/layouts/Base.astro)).
If the tool publishes its own site, set `page` to its address instead.

A path such as `/kindwall/` is served from this repository only while the tool's own repository
has GitHub Pages switched off. If a tool's repository turns Pages on, its site takes over that
path.

## Kindwall's demo wall

The wall on `/kindwall/` is drawn by Kindwall's widget, copied unchanged into
[`vendor/kindwall`](vendor/kindwall) with the commit it came from. To update it from a Kindwall
checkout next to this one:

```bash
pnpm kindwall:widget ../kindwall
```

The hosted server's address and upload limits are in [`src/data/site.ts`](src/data/site.ts).

## Publishing

Changes go through pull requests: topic branches into `develop`, then `develop` into `qa`, then
`qa` into `main`. Every push to `main` is built and deployed to GitHub Pages by
[`.github/workflows/pages.yml`](.github/workflows/pages.yml).

## License

Apache License 2.0. See [LICENSE](LICENSE).
9 changes: 9 additions & 0 deletions aliases.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// The vendored Kindwall widget imports "@kindwall/shared"; point it at the vendored copy.
import { fileURLToPath } from "node:url";

const vendored = (path) => fileURLToPath(new URL(`./vendor/kindwall/${path}`, import.meta.url));

export const kindwallAliases = [
{ find: /^@kindwall\/shared\/constants$/, replacement: vendored("shared/constants.ts") },
{ find: /^@kindwall\/shared$/, replacement: vendored("shared/index.ts") },
];
13 changes: 13 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// @ts-check
import { defineConfig } from "astro/config";
import { kindwallAliases } from "./aliases.mjs";

export default defineConfig({
site: "https://patchyard.github.io",
trailingSlash: "always",
build: { format: "directory" },
devToolbar: { enabled: false },
vite: {
resolve: { alias: kindwallAliases },
},
});
Loading