Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion astro/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ All notable changes to `@run402/astro`.

### Fixed

- **Too-loose Astro peer range caused a cryptic build failure on Astro 5.** `peerDependencies.astro` was `>=5 <7`, but the SSR runtime (`src/runtime/server.ts`) does `await import("astro/app/entrypoint")` — a specifier Astro 5 does not export (Astro 5.18.2 ships only `./app` and `./app/node`; `./app/entrypoint` first appears in Astro 6). A consumer on Astro 5 using the default `export default run402()` preset (or `createRun402Adapter()`) therefore aborted during `astro build`'s "Building server entrypoints" step with the opaque `[commonjs--resolver] Missing "./app/entrypoint" specifier in "astro" package` — the `try/catch` in `getAstroApp()` does not help because Vite resolves the specifier at bundle time, before the runtime guard runs. Tightened the peer range to `>=6 <7` so the declared support matches what the SSR adapter actually requires; npm now warns at install time rather than crashing mid-build. The build-time image integration (`run402Image()` / the named `run402` alias, used without the SSR adapter) never bundles `runtime/server.ts` and still runs on Astro 5, but Astro 5 is no longer in the supported peer range. Discovered while building the demos/evilme Astro SSR app, which pinned `astro@^6.1.3` to work around this.

- **`createRun402Adapter` incompatible with Astro 6** ([#403](https://github.com/kychee-com/run402/issues/403)). `astro build` on Astro 6.x previously aborted with `NoAdapterInstalled` even when the adapter was wired up, and printed a deprecation warning about `entrypointResolution: "explicit"` plus an `[ERROR] [config] adapter does not currently support sharp` line. Root cause was a mix of stale Astro-5-era adapter API usage: the adapter omitted `entrypointResolution` (defaulting to deprecated `"explicit"`), declared the legacy `exports: ["handler", "default"]` array, did not declare `sharpImageService` support, and the `run402()` preset pushed the adapter into `integrations[]` instead of the `adapter:` field — leaving `config.adapter` empty so Astro 6's check `!config.adapter && buildOutput === 'server'` threw `NoAdapterInstalled`. Fix:
- Adapter now declares `entrypointResolution: "auto"` (Astro 6 recommended path) and drops the deprecated `exports` array — `runtime/server.ts` already exports `handler` + `default` directly.
- Adapter declares `sharpImageService: "stable"` in `supportedAstroFeatures`.
- Adapter no longer forces `adapterFeatures.buildOutput: "server"` — Astro derives the build shape from `output` + per-page `prerender`.
- `run402()` preset returns `{ adapter: createRun402Adapter(...) }` on the top-level config (where Astro 6 looks for it) instead of pushing it into `integrations[]`.
- `runtime/server.ts` migrated from the Astro-5 `manifest.mjs` + `new App(manifest)` pattern to Astro 6's `createApp()` from `astro/app/entrypoint` — Vite no longer fails to resolve `./manifest.mjs` because the virtual entrypoint module bakes the manifest in.
- `astro:build:done` no longer uses `new URL("./...", pathnameString)` (invalid base) for the client dir — uses `path.join(buildOutputDir, "...")` against the resolved filesystem path instead.
Devdep bumped to `astro ^6.1.3` so the TypeScript types include `entrypointResolution`; peer dep range is unchanged (`>=5 <7`), but **the SSR adapter portion now requires Astro 6+ at runtime** (the image-only integration still works on Astro 5). Users on the integrations-array pattern should migrate to `adapter: createRun402Adapter()`:
Devdep bumped to `astro ^6.1.3` so the TypeScript types include `entrypointResolution`; **the SSR adapter portion now requires Astro 6+ at runtime** (`runtime/server.ts` imports the Astro-6-only `astro/app/entrypoint`), so the peer dep range was tightened to `>=6 <7` (see the dedicated Fixed entry above). The image-only `run402Image()` integration still runs on Astro 5 but is no longer inside the supported peer range. Users on the integrations-array pattern should migrate to `adapter: createRun402Adapter()`:

```ts
// Before (Astro 5, broken on Astro 6):
Expand Down
2 changes: 1 addition & 1 deletion astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ Compared to Next.js's `<Image>` model: Vercel transforms images lazily via Lambd
npm install @run402/astro @run402/sdk
```

Astro 5 or 6 (peer dependency, optional declaration so install never blocks).
Astro 6 (peer dependency, optional declaration so install never blocks). The SSR adapter requires Astro 6 at runtime (its server entry imports `astro/app/entrypoint`, an Astro-6-only export); the build-time image integration alone also runs on Astro 5, though Astro 5 is outside the supported peer range.

## Configure

Expand Down
2 changes: 1 addition & 1 deletion astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"peerDependencies": {
"@run402/functions": "^3.0.0",
"@run402/sdk": ">=2.18.0",
"astro": ">=5 <7",
"astro": ">=6 <7",
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading