Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase supported Astro version to 4 #6960

Merged
merged 4 commits into from
Apr 11, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Fixes bug where `firebase deploy --only firestore:rules,firestore:indexes` does not update rules and indexes. (#6966)
- Add Firebase console link after creating or restoring a Firestore database (#6949)
- Increase supported Astro version to 4 (#6960)
2 changes: 1 addition & 1 deletion src/frameworks/astro/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
export const name = "Astro";
export const support = SupportLevel.Experimental;
export const type = FrameworkType.MetaFramework;
export const supportedRange = "2 - 3";
export const supportedRange = "2 - 4";

export async function discover(dir: string): Promise<Discovery | undefined> {

Check warning on line 14 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
if (!existsSync(join(dir, "package.json"))) return;
const version = getAstroVersion(dir);
if (!version) return;
const { output } = await getConfig(dir);

Check warning on line 18 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe array destructuring of a tuple element with an `any` value
return {
mayWantBackend: output !== "static",
version,
Expand All @@ -24,12 +24,12 @@

const DEFAULT_BUILD_SCRIPT = ["astro build"];

export async function build(cwd: string): Promise<BuildResult> {

Check warning on line 27 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
const cli = getNodeModuleBin("astro", cwd);
await warnIfCustomBuildScript(cwd, name, DEFAULT_BUILD_SCRIPT);
const { output, adapter } = await getConfig(cwd);

Check warning on line 30 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe array destructuring of a tuple element with an `any` value

Check warning on line 30 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe array destructuring of a tuple element with an `any` value
const wantsBackend = output !== "static";
if (wantsBackend && adapter?.name !== "@astrojs/node") {

Check warning on line 32 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .name on an `any` value
throw new FirebaseError(
"Deploying an Astro application with SSR on Firebase Hosting requires the @astrojs/node adapter in middleware mode. https://docs.astro.build/en/guides/integrations-guide/node/",
);
Expand All @@ -39,14 +39,14 @@
return { wantsBackend };
}

export async function ɵcodegenPublicDirectory(root: string, dest: string) {

Check warning on line 42 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function

Check warning on line 42 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
const { outDir, output } = await getConfig(root);

Check warning on line 43 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe array destructuring of a tuple element with an `any` value
// output: "server" in astro.config builds "client" and "server" folders, otherwise assets are in top-level outDir
const assetPath = join(root, outDir, output !== "static" ? "client" : "");
await copy(assetPath, dest);
}

export async function ɵcodegenFunctionsDirectory(sourceDir: string, destDir: string) {

Check warning on line 49 in src/frameworks/astro/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
const { outDir } = await getConfig(sourceDir);
const packageJson = await readJSON(join(sourceDir, "package.json"));
await copy(join(sourceDir, outDir, "server"), join(destDir));
Expand Down