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
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ updates:
update-types:
- "minor"
- "patch"
fontawesome:
patterns:
- "@fortawesome/fontawesome-svg-core"
- "@fortawesome/free-brands-svg-icons"
- "@fortawesome/free-solid-svg-icons"
19 changes: 3 additions & 16 deletions .github/workflows/next.yml → .github/workflows/astro.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Next.js
name: Astro

on:
push:
branches: [ main ]
pull_request:

jobs:
lint:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -17,23 +17,10 @@ jobs:
node-version-file: package.json

- name: Install dependencies
run: yarn install
run: yarn install --frozen-lockfile

- name: Lint
run: yarn lint

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
with:
node-version-file: package.json

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build
34 changes: 0 additions & 34 deletions .github/workflows/vercel-preview.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/vercel.yml

This file was deleted.

15 changes: 10 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

*.patch

# dependencies
/node_modules
/.pnp
Expand All @@ -11,12 +13,12 @@ package-lock.json
# testing
/coverage

# next.js
/.next/
/out/
# astro
/.astro/

# production
/build
/dist

# misc
.DS_Store
Expand All @@ -31,13 +33,16 @@ yarn-error.log*
# local env files
.env*.local

# vercel
# deployment state
.vercel
.wrangler

# local Claude Code settings
.claude/

# typescript
*.tsbuildinfo

public/robots.txt
public/sitemap*.xml

graphql.schema.json
Expand Down
79 changes: 73 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,85 @@

A package registry website for Cabin, a package manager and build system for C++.

### Contributing
### Architecture

#### Install Node.js dependencies
This site is a fully static Astro build. Package data is fetched from
`https://cabin.hasura.app/v1/graphql` at build time, package detail pages are
pre-rendered, and `/packages.json` is generated for client-side search.

The output in `dist/` can be served by Cloudflare Pages, Cloudflare Workers
Static Assets, or any static file host. No Next.js, Vercel runtime, SSR adapter,
API routes, or server functions are required.

### Development

Install Node.js dependencies:

```bash
yarn install
```

Start the local Astro dev server:

```bash
$ yarn install
yarn dev
```

#### Start endpoint
`yarn dev` regenerates GraphQL types from Hasura before starting Astro, so a
fresh checkout works without a separate `yarn generate` step. Astro serves the
site at [`localhost:4321`](http://localhost:4321) by default.

### Build and preview

```bash
$ yarn dev
yarn lint
yarn typecheck
yarn build
yarn preview
```

Now you can visit [`localhost:3000`](http://localhost:3000) from your browser.
`yarn build` regenerates GraphQL types, runs Astro type checking, fetches package
data from Hasura, verifies that generated HTML has no inline scripts, and writes
the static site to `dist/`.

Biome is used for TypeScript, JavaScript, CSS, and config files. Astro component
files are excluded from Biome because this setup relies on Astro's own parser and
type checker for `.astro`; run `yarn typecheck` directly, or rely on `yarn build`,
which runs `astro check` before building.

### Cloudflare deployment

`wrangler.jsonc` is configured for Workers Static Assets with `./dist` as the
asset directory. Build before deploying:

```bash
yarn build
yarn wrangler deploy
```

No deploy workflow is included because Cloudflare account and project secrets
vary by environment.

### Static search

`/search` is a static page. In the browser it reads `q`, `page`, and `perPage`
from the URL, fetches `/packages.json`, filters package names with
case-insensitive substring matching, and renders pagination links by updating
the query string. The browser does not call Hasura.

### Package detail routes

Each package gets two statically generated detail routes:

- `/packages/<group>/<name>` renders the latest version.
- `/packages/<group>/<name>/<version>` renders that exact version.

Both are pre-rendered at build time from the same Hasura package data and share
their markup through `src/components/package/PackageDetailView.astro`.

### Known limitation

Package detail routes use `/packages/<group>/<name>`, matching the previous site
and Cabin's current two-segment package naming. Packages with names that do not
fit exactly one slash are included in `/packages.json` but do not get a generated
detail page; the search UI renders them as non-clickable cards.
71 changes: 0 additions & 71 deletions app/_components/external-link-button.tsx

This file was deleted.

56 changes: 0 additions & 56 deletions app/_components/feature-card.tsx

This file was deleted.

Loading
Loading