Skip to content

Commit a31cc4d

Browse files
committed
fix: update baseUrl to GitHub Pages and add mtime-based updatedAt
- Change default baseUrl from Deno Deploy to GitHub Pages - Add updatedAt option to generateApiMarkdown for file mtime display - Update .claude/CLAUDE.md deployment info for GitHub Pages
1 parent 1115d05 commit a31cc4d

3 files changed

Lines changed: 30 additions & 31 deletions

File tree

.claude/CLAUDE.md

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Repository: `probitas/documents`
88

99
- **Runtime**: Deno 2.x
1010
- **Framework**: Hono (web server)
11-
- **Deploy**: New Deno Deploy (`documents.probitas.deno.net`)
11+
- **Deploy**: GitHub Pages (`https://jsr-probitas.github.io/documents`)
1212

1313
## Commands
1414

@@ -17,39 +17,22 @@ deno task dev # Start dev server with watch mode
1717
deno task start # Start production server
1818
deno task check # Type check all .ts files
1919
deno task verify # Run fmt, lint, and check
20+
deno task build # Build static site for deployment
2021
```
2122

2223
## Deployment
2324

24-
This project uses the **new Deno Deploy** (not Deploy Classic).
25+
This project is deployed to **GitHub Pages** as a static site.
2526

26-
### Key Differences from Deploy Classic
27+
### Build Process
2728

28-
| Feature | New Deno Deploy | Deploy Classic |
29-
| ---------- | ---------------------------- | --------------------------- |
30-
| URL format | `{app}.{org}.deno.net` | `{project}.deno.dev` |
31-
| Console | `console.deno.com` | `dash.deno.com` |
32-
| Build | Integrated CI/CD or external | External only (`deployctl`) |
33-
| CLI | `deno` CLI built-in | Separate `deployctl` |
29+
1. Run `deno task build` to generate static files in `dist/`
30+
2. GitHub Actions automatically deploys on push to main branch
3431

35-
### New Deno Deploy Features
32+
### Local Development
3633

37-
- **Integrated CI/CD**: Connect GitHub repo for automatic branch deploys and
38-
previews
39-
- **`--tunnel` flag**: `deno run --tunnel` exposes local dev to public URL with
40-
environment variables from dashboard
41-
- **OpenTelemetry**: Built-in logging, tracing, and metrics
42-
- **Framework detection**: Auto-detects Hono and optimizes configuration
43-
44-
### Deployment Methods
45-
46-
1. **GitHub Integration** (recommended): Connect repo, auto-deploy on push
47-
2. **Manual trigger**: Select branch and trigger build from console
48-
3. **Local tunnel**: `deno run --tunnel main.ts` for testing with production env
49-
50-
### Console Access
51-
52-
- Dashboard: https://console.deno.com
34+
- `deno task dev` - Start dev server with hot reload
35+
- `deno task start` - Start production server locally
5336

5437
## Related Documentation
5538

lib/api-markdown.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class TypeReferenceCollector {
6161
localTypes: Set<string>,
6262
typeToPackage: Map<string, string>,
6363
currentPackage: string,
64-
baseUrl = "https://documents.probitas.deno.net",
64+
baseUrl = "https://jsr-probitas.github.io/documents",
6565
) {
6666
this.localTypes = localTypes;
6767
this.typeToPackage = typeToPackage;
@@ -532,6 +532,8 @@ export interface ApiMarkdownOptions {
532532
allPackages?: PackageDoc[];
533533
/** Base URL for links */
534534
baseUrl?: string;
535+
/** Last updated timestamp (from file mtime) */
536+
updatedAt?: Date;
535537
}
536538

537539
/**
@@ -542,8 +544,11 @@ export function generateApiMarkdown(
542544
options: ApiMarkdownOptions = {},
543545
): string {
544546
const lines: string[] = [];
545-
const { allPackages = [], baseUrl = "https://documents.probitas.deno.net" } =
546-
options;
547+
const {
548+
allPackages = [],
549+
baseUrl = "https://jsr-probitas.github.io/documents",
550+
updatedAt,
551+
} = options;
547552

548553
// Build local types set
549554
const localTypes = new Set<string>();
@@ -738,5 +743,12 @@ export function generateApiMarkdown(
738743
}
739744
}
740745

746+
// Footer with last updated timestamp
747+
if (updatedAt) {
748+
lines.push("---");
749+
lines.push("");
750+
lines.push(`*Last updated: ${updatedAt.toISOString().split("T")[0]}*`);
751+
}
752+
741753
return lines.join("\n");
742754
}

main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ app.get(
134134
`./data/api/${packageName}.json`,
135135
import.meta.url,
136136
);
137-
const content = await Deno.readTextFile(jsonPath);
137+
const [content, stat] = await Promise.all([
138+
Deno.readTextFile(jsonPath),
139+
Deno.stat(jsonPath),
140+
]);
138141
const pkg: PackageDoc = JSON.parse(content);
142+
const updatedAt = stat.mtime ?? undefined;
139143

140144
// Load all packages for cross-package linking
141145
const indexPath = new URL("./data/api/index.json", import.meta.url);
@@ -156,7 +160,7 @@ app.get(
156160
}
157161
}
158162

159-
const markdown = generateApiMarkdown(pkg, { allPackages });
163+
const markdown = generateApiMarkdown(pkg, { allPackages, updatedAt });
160164
return c.text(markdown, 200, {
161165
"Content-Type": "text/markdown; charset=utf-8",
162166
});

0 commit comments

Comments
 (0)