diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..cb3029c --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,19 @@ +name: Site check + +on: + pull_request: + push: + branches: [main] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: node --check server.js + - run: npm run check diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..6590cdf --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,36 @@ +# Makerble API docs + +The site at api-docs.makerble.com. It is an Express app (`server.js`) deployed on Vercel. + +- `openapi.yaml` (repo root): the OpenAPI spec, served at `/openapi.yaml` and used by the Prism mock server at `/mock`. +- `server.js`: the routes, plus the whole docs page (HTML, CSS and endpoint cards) in `buildDocsPage()`. +- `assets/`: the Makerble logo and favicon, served from `/assets/makerble-logo.png` and `/favicon.png`. +- `vercel.json`: must keep `includeFiles: ["assets/**", "openapi.yaml"]`. Without it, Vercel leaves those files out and the logo, favicon and spec return errors. + +## Don't undo other people's changes + +The Makerble branding (PR #52) was wiped out by a later docs commit. That commit was built from an out-of-date copy of `server.js`, so it rewrote the page styles and deleted `assets/` without anyone noticing. To stop that happening again: + +- **Start from the latest `main`.** Fetch and merge `origin/main` before you edit, and again before you open a PR. Never paste or rewrite `server.js` wholesale from an older copy. Make targeted edits. +- **Check your diff before you commit.** A docs PR should only touch `openapi.yaml` and the endpoint cards or nav links in `server.js`. If `git diff --stat` shows changes to the ` @@ -848,17 +897,13 @@ function buildDocsPage() {
- - - makerble + + API Reference
API v2 OpenAPI spec ↗ - ⬡ Try mock API + Try mock API Makerble.com ↗
@@ -875,61 +920,61 @@ function buildDocsPage() { @@ -3715,7 +3760,7 @@ function buildDocsPage() { /mock
-

Creating a Story

+

Creating a Story

{ "story": { "story_group": "change_created", diff --git a/vercel.json b/vercel.json index 4eb087b..f763573 100644 --- a/vercel.json +++ b/vercel.json @@ -1,7 +1,7 @@ { "version": 2, "builds": [ - { "src": "server.js", "use": "@vercel/node" } + { "src": "server.js", "use": "@vercel/node", "config": { "includeFiles": ["assets/**", "openapi.yaml"] } } ], "routes": [ { "src": "/(.*)", "dest": "server.js" }