-
Notifications
You must be signed in to change notification settings - Fork 1.1k
redirect to init apphosting for webframeworks on init hosting #9887
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
base: jh-remove-wf
Are you sure you want to change the base?
Changes from all commits
73d83f6
fd64729
7e50b5e
cc05c02
bbbee83
c7d00ea
bfe48fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import * as clc from "colorette"; | ||
| import { join } from "path"; | ||
| import { Client } from "../../../apiv2"; | ||
| import { discover } from "../../../frameworks"; | ||
| import * as github from "./github"; | ||
| import { confirm, input } from "../../../prompt"; | ||
| import { logger } from "../../../logger"; | ||
|
|
@@ -19,6 +20,7 @@ const MISSING_TEMPLATE = readTemplateSync("init/hosting/404.html"); | |
| const DEFAULT_IGNORES = ["firebase.json", "**/.*", "**/node_modules/**"]; | ||
|
|
||
| export interface RequiredInfo { | ||
| redirectToAppHosting?: boolean; | ||
| newSiteId?: string; | ||
| public?: string; | ||
| spa?: boolean; | ||
|
|
@@ -27,6 +29,19 @@ export interface RequiredInfo { | |
| // TODO: come up with a better way to type this | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| export async function askQuestions(setup: Setup, config: Config, options: Options): Promise<void> { | ||
| const discoveredFramework = await discover(config.projectDir, false); | ||
| if (discoveredFramework && discoveredFramework.mayWantBackend) { | ||
| const frameworkName = discoveredFramework.framework; | ||
| logger.info(); | ||
| logger.info( | ||
| `Detected a ${frameworkName} codebase. Setting up ${clc.bold("App Hosting")} instead.`, | ||
| ); | ||
| setup.featureInfo ||= {}; | ||
| setup.featureInfo.hosting = { redirectToAppHosting: true }; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. app hosting does not support flutter and i believe one of the web frameworks detected is flutter
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for bringing this up. Flutter won't actually trigger this because its However, frameworks other than Angular and Next.js that (I think) are not supported by App Hosting will have this issue:
WDYT about:
|
||
| setup.features?.unshift("apphosting"); | ||
| return; | ||
| } | ||
|
|
||
| setup.featureInfo = setup.featureInfo || {}; | ||
| setup.featureInfo.hosting = {}; | ||
|
|
||
|
|
@@ -93,6 +108,10 @@ export async function actuate(setup: Setup, config: Config, options: Options): P | |
| ); | ||
| } | ||
|
|
||
| if (hostingInfo.redirectToAppHosting) { | ||
| return; | ||
| } | ||
|
|
||
| if (hostingInfo.newSiteId && setup.projectId) { | ||
| await createSite(setup.projectId, hostingInfo.newSiteId); | ||
| logger.info(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.