Astro adapter - #297
Draft
Yuangwang wants to merge 21 commits into
Draft
Conversation
Yuangwang
force-pushed
the
astro-adapter
branch
from
February 6, 2025 18:43
9b98f08 to
2d733a1
Compare
jhuleatt
reviewed
Jul 18, 2025
| const outputBundle: OutputBundleConfig = { | ||
| version: "v1", | ||
| runConfig: { | ||
| runCommand: `node dist/server/entry.mjs`, |
Collaborator
There was a problem hiding this comment.
This path needs to respect the outDir option in astro.config. I think that can be done with the { dir } argument that is passed into this astro:build:done callback
jhuleatt
reviewed
Jul 18, 2025
| setAdapter(getAdapter(_options)); | ||
| }, | ||
| "astro:build:done": async () => { | ||
| await fs.mkdir("./.apphosting"); |
Collaborator
There was a problem hiding this comment.
Suggested change
| await fs.mkdir("./.apphosting"); | |
| await fs.mkdir("./.apphosting", { | |
| // Don't throw if directory already exists. Important when debugging the build locally | |
| recursive: true | |
| }); |
@astrojs/node@10 replaced the adapter `args` config with a `virtual:astro-node:config` module, so the installed major now selects the mechanism: v10+ gets a vendored config plugin and `entrypointResolution: "auto"`, v9 keeps the existing `args` export. Astro 5 support is unchanged. Also fixes two bugs that block repeat and multi-version use: - `.apphosting` was created with a non-recursive mkdir, so any second build in the same directory failed with EEXIST. - `frameworkVersion` came from `npm view astro version`, reporting the latest published release rather than the one installed. It now reads the installed package.json, which also drops a network call from the build. Verified against real App Hosting deployments on Astro 5, 6 and 7: SSR rendering, API routes and middleware all serve per-request.
Relocates @apphosting/astro-adapter to packages/@apphosting/experimental/, registering the new workspace glob and adding the directory to the CI build artifact paths. The community/ glob is dropped since adapter-astro was its only member. Pure rename, no source changes.
The move to packages/@apphosting/experimental/ updated the npm workspaces glob but not lerna.json, so lerna managed 8 packages and skipped the astro adapter entirely — `npm run build` never built it. The community/ glob is replaced rather than added to, since that directory no longer exists.
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds support for Astro in Firebase App Hosting.
To use follow these instructions:
npx astro add @apphosting/astro-adapter