From 256f3f1c49dce3e2a28d52330afe2d60dfd4ceb1 Mon Sep 17 00:00:00 2001 From: 0xaptosj <129789810+0xaptosj@users.noreply.github.com> Date: Tue, 8 Oct 2024 12:25:22 -0700 Subject: [PATCH 1/2] add surf to rechose flow --- src/types.ts | 2 +- src/workflow/rechoseWorkflow.ts | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index e5bb3084..c4d06d89 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,7 +7,7 @@ import { } from "./utils/constants"; export type Result = prompts.Answers< - "projectName" | "projectType" | "template" | "network" | "signingOption" + "projectName" | "projectType" | "template" | "network" | "signingOption" | "useSurf" >; export type Template = { diff --git a/src/workflow/rechoseWorkflow.ts b/src/workflow/rechoseWorkflow.ts index 04bc9563..c7b355bd 100644 --- a/src/workflow/rechoseWorkflow.ts +++ b/src/workflow/rechoseWorkflow.ts @@ -4,6 +4,7 @@ import { workflowOptions } from "./workflowOptions.js"; import { Result } from "../types.js"; import { ContractBoilerplateTemplateValues, + FullstackBoilerplateTemplateInfo, TemplateNetwork, TemplateProjectType, } from "../utils/constants.js"; @@ -36,6 +37,7 @@ export async function rechoseWorkflow(result: Result): Promise { { title: "Project Type", value: "projectType" }, { title: "Template", value: "template" }, { title: "Network", value: "network" }, + { title: "Use Surf", value: "useSurf" }, ]; } }, @@ -114,7 +116,21 @@ export async function rechoseWorkflow(result: Result): Promise { ]) ).network; break; - + case "useSurf": + console.log("result", result); + if ( + result.template.path !== + FullstackBoilerplateTemplateInfo.value.path + ) { + break; + } + result.useSurf = ( + await prompts({ + ...workflowOptions.useSurf, + initial: result.useSurf, + }) + ).useSurf; + break; default: console.log("Invalid option selected"); break; From e159fb6866d985942d36286a9bdeb3df4a49321c Mon Sep 17 00:00:00 2001 From: 0xaptosj <129789810+0xaptosj@users.noreply.github.com> Date: Tue, 8 Oct 2024 12:33:21 -0700 Subject: [PATCH 2/2] Update src/workflow/rechoseWorkflow.ts --- src/workflow/rechoseWorkflow.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/workflow/rechoseWorkflow.ts b/src/workflow/rechoseWorkflow.ts index c7b355bd..5f5a8e5a 100644 --- a/src/workflow/rechoseWorkflow.ts +++ b/src/workflow/rechoseWorkflow.ts @@ -117,7 +117,6 @@ export async function rechoseWorkflow(result: Result): Promise { ).network; break; case "useSurf": - console.log("result", result); if ( result.template.path !== FullstackBoilerplateTemplateInfo.value.path