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

fix: #8168 - enforce webframeworks only when needed #8169

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
12 changes: 11 additions & 1 deletion src/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,17 @@ export const deploy = async function (

if (targetNames.includes("hosting")) {
const config = options.config.get("hosting");
if (Array.isArray(config) ? config.some((it) => it.source) : config.source) {
if (
Array.isArray(config)
? config.some(
(it) =>
it.source &&
(!options.only.includes("hosting:") ||
new RegExp(`\\bhosting:${it.target}\\b`).exec(options.only)),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is lame, and reflects my lack of understanding of all the config flags/etc and how best to parse this. But the point is to make this logic, "Enforce webframeworks if either all sites need to be deployed, or if the site being deployed itself has source").

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivecar I just pushed this commit to improve readability and to handle the case when using firebase deploy which was erroring out.
All the functionality should remain the same.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome - it looks so much better, @chalosalvador . Thanks for your help and support!

)
: config.source
) {
console.log("preparing webframeworks");
experiments.assertEnabled("webframeworks", "deploy a web framework from source");
await prepareFrameworks("deploy", targetNames, context, options);
}
Expand Down