A calm place to write long-form, and publish it to the open social web. skypress.blog/
0

Configure Feed

Select the types of activity you want to include in your feed.

Underscore-prefix colocated tests under src/pages/ so the build prerenders

Astro's file router imports every .ts under src/pages/ during static-path
collection to find getStaticPaths/endpoint handlers. The colocated
*.test.ts guards there ran their top-level `import … from 'vitest'` during
that import, which throws outside the vitest runner — surfacing as the
Cloudflare prerender server returning 500 ("Vitest failed to access its
internal state") and breaking `astro build` / `npm run deploy`.

The two .meta.test.ts files added with the recent OG work (7f1cffe,
24b64f5) joined index.phase.test.ts under src/pages/ and tipped the build
over.

Prefix the three files with `_` so Astro ignores them as routes, while
vitest's `src/**/*.test.ts` glob still discovers them. Each test reads its
sibling .astro via import.meta.url, so the in-place rename keeps every
relative path working and preserves the colocated-test convention. Record
the rule as constraint #8 in AGENTS.md so future page tests follow it.

+6
+6
AGENTS.md
··· 40 40 In **dev you must serve on `http://127.0.0.1:<port>`, not `localhost`** (atproto 41 41 loopback requirement), and the loopback `client_id` must be path-less — see 42 42 `src/lib/auth/oauth.ts`. Auth + editor live in the `Studio` client-only island. 43 + 8. **Colocated tests under `src/pages/` MUST be underscore-prefixed** (e.g. 44 + `_index.meta.test.ts`). Astro's file router imports every `.ts` in `src/pages/` during 45 + static-path collection; a `*.test.ts` there runs its top-level `import … from 'vitest'`, 46 + which throws outside the vitest runner → the build's prerender server 500s 47 + (`Vitest failed to access its internal state`). A leading `_` makes Astro ignore the 48 + file as a route while vitest's `src/**/*.test.ts` glob still finds it. 43 49 44 50 ## Product guardrails (from the brief) 45 51
src/pages/[author]/[slug]/[rkey].meta.test.ts src/pages/[author]/[slug]/_[rkey].meta.test.ts
src/pages/[author]/[slug]/index.meta.test.ts src/pages/[author]/[slug]/_index.meta.test.ts
src/pages/index.phase.test.ts src/pages/_index.phase.test.ts