Skip to content

Commit f6cc859

Browse files
committed
fix: harden hydration and release checks
1 parent f105158 commit f6cc859

51 files changed

Lines changed: 1574 additions & 181 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ bun.lockb
3838
# Temporary files
3939
*.log
4040
*.tmp
41+
.tmp-*/
4142
nul
4243

4344
# Claude Code session state (local per-user)

bun.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/auth-starter/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# mandu-auth-starter
22

3+
## 0.1.67
4+
5+
### Patch Changes
6+
7+
- Updated dependencies []:
8+
- @mandujs/core@0.54.16
9+
10+
## 0.1.66
11+
12+
### Patch Changes
13+
14+
- Updated dependencies []:
15+
- @mandujs/core@0.54.15
16+
17+
## 0.1.65
18+
19+
### Patch Changes
20+
21+
- Updated dependencies []:
22+
- @mandujs/core@0.54.14
23+
324
## 0.1.64
425

526
### Patch Changes

demo/auth-starter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mandu-auth-starter",
3-
"version": "0.1.64",
3+
"version": "0.1.67",
44
"private": true,
55
"type": "module",
66
"scripts": {

demo/desktop-starter/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# mandu-desktop-starter
22

3+
## 0.1.66
4+
5+
### Patch Changes
6+
7+
- Updated dependencies []:
8+
- @mandujs/core@0.54.16
9+
10+
## 0.1.65
11+
12+
### Patch Changes
13+
14+
- Updated dependencies []:
15+
- @mandujs/core@0.54.15
16+
17+
## 0.1.64
18+
19+
### Patch Changes
20+
21+
- Updated dependencies []:
22+
- @mandujs/core@0.54.14
23+
324
## 0.1.63
425

526
### Patch Changes

demo/desktop-starter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mandu-desktop-starter",
3-
"version": "0.1.63",
3+
"version": "0.1.66",
44
"private": true,
55
"type": "module",
66
"description": "Minimal Mandu desktop app (Phase 9c). Opens a native WebView pointing at a local Bun.serve() instance.",

demo/edge-workers-starter/CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# mandu-edge-workers-starter
22

3+
## 0.1.67
4+
5+
### Patch Changes
6+
7+
- Updated dependencies []:
8+
- @mandujs/core@0.54.16
9+
- @mandujs/edge@0.4.64
10+
11+
## 0.1.66
12+
13+
### Patch Changes
14+
15+
- Updated dependencies []:
16+
- @mandujs/core@0.54.15
17+
- @mandujs/edge@0.4.63
18+
19+
## 0.1.65
20+
21+
### Patch Changes
22+
23+
- Updated dependencies []:
24+
- @mandujs/core@0.54.14
25+
- @mandujs/edge@0.4.62
26+
327
## 0.1.64
428

529
### Patch Changes

demo/edge-workers-starter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mandu-edge-workers-starter",
3-
"version": "0.1.64",
3+
"version": "0.1.67",
44
"private": true,
55
"type": "module",
66
"scripts": {

packages/ate/prompts/streaming_ssr.v1.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ these is how we assert the stream shape.
3131
- Consume the stream with `await res.text()` and then assert on the
3232
full string. That defeats the "streaming" semantic — the ordering
3333
guarantee you care about is chunk-by-chunk.
34+
- Use `localhost` in transport URLs. Use `http://127.0.0.1:<port>` so
35+
Windows CI does not hit an IPv6/IPv4 localhost mismatch.
3436
- Assume a specific `boundaryCount` without reading the page's Suspense
3537
boundaries — if the page adds one, the spec breaks. Pull the count
3638
from the route context (`mandu_ate_context({ scope: "route" })`).
@@ -60,7 +62,7 @@ import { test, expect } from "bun:test";
6062
import { assertStreamBoundary } from "@mandujs/core/testing";
6163

6264
test("GET /dashboard streams shell → 2 boundaries → scripts", async () => {
63-
const res = await fetch("http://localhost:3333/dashboard");
65+
const res = await fetch("http://127.0.0.1:3333/dashboard");
6466
await assertStreamBoundary(res, {
6567
shellChunkContains: ["<!DOCTYPE", "<html"],
6668
boundaryCount: 2,
@@ -70,12 +72,12 @@ test("GET /dashboard streams shell → 2 boundaries → scripts", async () => {
7072
});
7173

7274
test("shell fits under 20KB budget", async () => {
73-
const res = await fetch("http://localhost:3333/dashboard");
75+
const res = await fetch("http://127.0.0.1:3333/dashboard");
7476
await assertStreamBoundary(res, { firstChunkMaxSizeBytes: 20_480 });
7577
});
7678

7779
test("no Suspense boundaries on a static page", async () => {
78-
const res = await fetch("http://localhost:3333/about");
80+
const res = await fetch("http://127.0.0.1:3333/about");
7981
await assertStreamBoundary(res, { boundaryCount: 0 });
8082
});
8183
```

packages/ate/tests/prompts/goldens.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ import {
1616
writeFileSync,
1717
existsSync,
1818
mkdirSync,
19+
readdirSync,
1920
} from "node:fs";
2021
import { join } from "node:path";
2122
import { composePrompt } from "../../src/prompt-composer";
2223
import type { Exemplar } from "../../src/exemplar-scanner";
2324

2425
const GOLDEN_DIR = join(__dirname);
26+
const PROMPT_DIR = join(__dirname, "..", "..", "prompts");
2527
const UPDATE = process.env.UPDATE_GOLDEN === "1";
2628

2729
interface GoldenCase {
@@ -255,6 +257,17 @@ const CASES: GoldenCase[] = [
255257
];
256258

257259
describe("prompt goldens", () => {
260+
test("prompt catalog does not teach localhost transport fetches", () => {
261+
const bannedFetch = /\bfetch\(\s*[`'"]http:\/\/localhost:/;
262+
for (const file of readdirSync(PROMPT_DIR)) {
263+
if (!file.endsWith(".md")) continue;
264+
const content = readFileSync(join(PROMPT_DIR, file), "utf8");
265+
if (bannedFetch.test(content)) {
266+
throw new Error(`${file} contains a localhost fetch example; use 127.0.0.1`);
267+
}
268+
}
269+
});
270+
258271
for (const c of CASES) {
259272
test(`${c.kind} composed prompt matches golden`, async () => {
260273
const composed = await composePrompt({

0 commit comments

Comments
 (0)