From 5c940712bb628848c7028192d8d1e68f29bdc6fc Mon Sep 17 00:00:00 2001 From: Alex Taing Date: Tue, 31 Oct 2023 11:13:19 -0400 Subject: [PATCH] remove required --- packages/studio-plugin/src/types/CliArgs.ts | 2 +- packages/studio/bin/studio.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/studio-plugin/src/types/CliArgs.ts b/packages/studio-plugin/src/types/CliArgs.ts index 385121e05..8f0878cac 100644 --- a/packages/studio-plugin/src/types/CliArgs.ts +++ b/packages/studio-plugin/src/types/CliArgs.ts @@ -8,5 +8,5 @@ export interface CliArgs { // This option is always provided by the cac package, and we only use it to // configure Studio to run in React Strict Mode for internal development by // using `-- strict`. - "--": string[]; + "--"?: string[]; } diff --git a/packages/studio/bin/studio.ts b/packages/studio/bin/studio.ts index 61fd5e508..9e3e25946 100755 --- a/packages/studio/bin/studio.ts +++ b/packages/studio/bin/studio.ts @@ -16,7 +16,7 @@ cli .option("--port ", "[number] port to run studio") .option("--root ", `[string] path to the root directory`) .action((options: CliArgs) => { - const useStrictMode = options["--"].includes("strict"); + const useStrictMode = options["--"]?.includes("strict"); spawnSync( "npx", [ @@ -33,7 +33,7 @@ cli env: { ...process.env, YEXT_STUDIO_ARGS: JSON.stringify(options), - VITE_STUDIO_STRICT: String(useStrictMode), + VITE_STUDIO_STRICT: String(useStrictMode ?? false), }, shell: true, }