Skip to content

Commit 0a2bd79

Browse files
kylemclarenclaude
andcommitted
Switch to commit-generated-docs approach
- Generate CLI docs in CI, commit result (not generated on every build) - Simplify Dockerfile: remove CLI installation - Remove prebuild hook from package.json - Keep generate:api for API docs (still generated on build) - Add Callout margin fix - Update checkpoints.mdx to use Callout component This approach: - Makes Docker builds simpler and faster - Makes deploys more reliable (no external API dependency) - Makes doc changes visible in PRs for review Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 579e44e commit 0a2bd79

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
env:
4747
SPRITES_TEST_TOKEN: ${{ secrets.SPRITES_TEST_TOKEN }}
4848

49+
- name: Generate CLI Docs
50+
run: pnpm generate:cli-docs
51+
4952
- name: Build
5053
run: pnpm build
5154

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ styles/write-good/
5555
# Sprites CLI local config
5656
.sprite
5757

58-
# Generated CLI documentation (rebuilt on deploy)
58+
# CLI test reports
5959
cli-test-report.json
60-
src/content/docs/cli/commands.mdx
6160

6261
# Generated API documentation (rebuilt on deploy)
6362
src/content/docs/api/

Dockerfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,17 @@ ENV NODE_ENV="production"
88
# Install pnpm
99
RUN corepack enable && corepack prepare pnpm@latest --activate
1010

11-
# Install packages needed for sharp native module and CLI
11+
# Install packages needed for sharp native module
1212
RUN apt-get update -qq && \
13-
apt-get install --no-install-recommends -y build-essential git pkg-config python-is-python3 curl ca-certificates && \
13+
apt-get install --no-install-recommends -y build-essential git pkg-config python-is-python3 && \
1414
rm -rf /var/lib/apt/lists/*
1515

16-
# Install Sprites CLI
17-
RUN curl -fsSL https://sprites.dev/install.sh | bash
18-
ENV PATH="/root/.local/bin:$PATH"
19-
2016
# Install dependencies
2117
COPY package.json pnpm-lock.yaml* ./
2218
RUN pnpm install --frozen-lockfile || pnpm install
2319

24-
# Copy and build (skip CLI tests in Docker - no API access)
20+
# Copy and build
2521
COPY . .
26-
ENV SKIP_CLI_TESTS=true
2722
RUN pnpm run build
2823

2924
# Final stage - minimal nginx

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"generate:cli-docs": "tsx scripts/generate-cli-docs/index.ts",
88
"dev": "pnpm generate:api && astro dev",
99
"start": "pnpm generate:api && astro dev",
10-
"prebuild": "pnpm generate:cli-docs",
1110
"build": "pnpm generate:api && astro build",
1211
"preview": "astro preview",
1312
"lint": "biome check",

src/components/react/Callout.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ export function Callout({ type = 'info', title, children }: CalloutProps) {
3434
const Icon = icons[type];
3535

3636
return (
37-
<Alert className={cn('my-6', styles[type])}>
38-
<Icon />
39-
{title && <AlertTitle className={titleStyles[type]}>{title}</AlertTitle>}
40-
<AlertDescription className="[&>p]:m-0">{children}</AlertDescription>
41-
</Alert>
37+
<div style={{ marginTop: '2.5rem', marginBottom: '1.5rem' }}>
38+
<Alert className={cn(styles[type])}>
39+
<Icon />
40+
{title && <AlertTitle className={titleStyles[type]}>{title}</AlertTitle>}
41+
<AlertDescription className="[&>p]:m-0 justify-items-stretch">{children}</AlertDescription>
42+
</Alert>
43+
</div>
4244
);
4345
}

src/content/docs/concepts/checkpoints.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ draft: true
55
---
66

77
import { Tabs, TabItem } from '@astrojs/starlight/components';
8-
import { Snippet, LinkCard, CardGrid } from '@/components/react';
8+
import { Snippet, LinkCard, CardGrid, Callout } from '@/components/react';
99

1010
**Sprites are programmable Linux environments you can spin up, script, and share. Checkpoints let you save a Sprite's entire state and bring it back later.** They capture persistent state: your filesystem, installed packages, environment config, dotfiles. They don't include running processes, network connections, or anything in memory.
1111

@@ -284,16 +284,19 @@ Deleted
284284
</TabItem>
285285
</Tabs>
286286

287-
### Delete Restrictions
288-
287+
<Callout type="warning" title="Delete Restrictions" client:load>
289288
You cannot delete the currently active checkpoint. Attempting to do so returns an error:
290289

291290
```bash
292291
sprite checkpoint delete v2
293-
# Error: cannot delete active checkpoint
292+
```
293+
294+
```output
295+
Error: cannot delete active checkpoint
294296
```
295297

296298
To delete an active checkpoint, first restore to a different checkpoint, then delete the original.
299+
</Callout>
297300

298301
### Cleanup Considerations
299302

0 commit comments

Comments
 (0)