From 548fd34f4282623d313080238d13d2e9a34ab1c4 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Wed, 6 Dec 2023 21:08:30 -0500 Subject: [PATCH 1/6] ng-deploy may not have configurations configured... --- src/frameworks/angular/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frameworks/angular/utils.ts b/src/frameworks/angular/utils.ts index 70a381b2217..67b62f36130 100644 --- a/src/frameworks/angular/utils.ts +++ b/src/frameworks/angular/utils.ts @@ -220,7 +220,9 @@ export async function getContext(dir: string, targetOrConfiguration?: string) { } if (deployTarget) { - const options = await architectHost.getOptionsForTarget(deployTarget); + const options = await architectHost + .getOptionsForTarget(deployTarget) + .catch(() => workspaceProject.targets.get("deploy")?.options); if (!options) throw new FirebaseError("Unable to get options for ng-deploy."); if (options.buildTarget) { assertIsString(options.buildTarget); From ac071282bc7e533b98e8ba6e8c99db399c48653c Mon Sep 17 00:00:00 2001 From: James Daniels Date: Wed, 6 Dec 2023 22:11:30 -0500 Subject: [PATCH 2/6] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb2d..c76768396c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1 @@ +- Fixed an issue preventing Angular apps using ng-deploy from being emulated or deployed. (#6584) From a49a6d421810be67639dd525eab04888baeadd0e Mon Sep 17 00:00:00 2001 From: James Daniels Date: Wed, 6 Dec 2023 23:13:16 -0500 Subject: [PATCH 3/6] Pull serveTarget --- src/frameworks/angular/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frameworks/angular/utils.ts b/src/frameworks/angular/utils.ts index 67b62f36130..aa932b9360d 100644 --- a/src/frameworks/angular/utils.ts +++ b/src/frameworks/angular/utils.ts @@ -240,6 +240,10 @@ export async function getContext(dir: string, targetOrConfiguration?: string) { assertIsString(options.serverTarget); serverTarget = targetFromTargetString(options.serverTarget); } + if (options.serveTarget) { + assertIsString(options.serveTarget); + serveTarget = targetFromTargetString(options.serveTarget); + } if (options.serveOptimizedImages) { serveOptimizedImages = true; } From e9f7316234ae9c0e2d502047630730c3f1eb91f4 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Wed, 6 Dec 2023 23:28:55 -0500 Subject: [PATCH 4/6] Default should be development --- src/frameworks/angular/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/angular/utils.ts b/src/frameworks/angular/utils.ts index aa932b9360d..03859dd590e 100644 --- a/src/frameworks/angular/utils.ts +++ b/src/frameworks/angular/utils.ts @@ -208,7 +208,7 @@ export async function getContext(dir: string, targetOrConfiguration?: string) { throw new FirebaseError(`builder ${builder} not known.`); } } else if (workspaceProject.targets.has("deploy")) { - const { builder, defaultConfiguration = "production" } = + const { builder, defaultConfiguration = "development" } = workspaceProject.targets.get("deploy")!; if (builder === ExpectedBuilder.DEPLOY) { deployTarget = { From e8ce027f3495a465a3ed879c4317256564802a91 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Wed, 6 Dec 2023 23:41:50 -0500 Subject: [PATCH 5/6] Default to prod --- src/frameworks/angular/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/angular/utils.ts b/src/frameworks/angular/utils.ts index 03859dd590e..aa932b9360d 100644 --- a/src/frameworks/angular/utils.ts +++ b/src/frameworks/angular/utils.ts @@ -208,7 +208,7 @@ export async function getContext(dir: string, targetOrConfiguration?: string) { throw new FirebaseError(`builder ${builder} not known.`); } } else if (workspaceProject.targets.has("deploy")) { - const { builder, defaultConfiguration = "development" } = + const { builder, defaultConfiguration = "production" } = workspaceProject.targets.get("deploy")!; if (builder === ExpectedBuilder.DEPLOY) { deployTarget = { From 816bde3080fc7f2db309c13c9bca7fcb5cf94825 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 7 Dec 2023 09:45:26 -0500 Subject: [PATCH 6/6] Use target name, incase it was an override --- src/frameworks/angular/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/angular/utils.ts b/src/frameworks/angular/utils.ts index aa932b9360d..42b8639e6b4 100644 --- a/src/frameworks/angular/utils.ts +++ b/src/frameworks/angular/utils.ts @@ -222,7 +222,7 @@ export async function getContext(dir: string, targetOrConfiguration?: string) { if (deployTarget) { const options = await architectHost .getOptionsForTarget(deployTarget) - .catch(() => workspaceProject.targets.get("deploy")?.options); + .catch(() => workspaceProject.targets.get(deployTarget!.target)?.options); if (!options) throw new FirebaseError("Unable to get options for ng-deploy."); if (options.buildTarget) { assertIsString(options.buildTarget);