From 69935816f928442d698fd9e31dc213bdc1bd10e4 Mon Sep 17 00:00:00 2001 From: arekkubaczkowski Date: Tue, 14 May 2024 17:09:10 +0300 Subject: [PATCH] feat(react-native): add optional syncDeps param to storybook executor (#22032) closed #22009 ## Current Behavior storybook executor runs syncDeps automatically without option to disable it ## Expected Behavior as per #22009 we might need to disable syncDeps step at some circumstances. --- packages/react-native/src/executors/storybook/schema.d.ts | 1 + .../react-native/src/executors/storybook/storybook.impl.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native/src/executors/storybook/schema.d.ts b/packages/react-native/src/executors/storybook/schema.d.ts index 02b63d63cd6c4..8870991148cd8 100644 --- a/packages/react-native/src/executors/storybook/schema.d.ts +++ b/packages/react-native/src/executors/storybook/schema.d.ts @@ -2,4 +2,5 @@ export interface ReactNativeStorybookOptions { searchDir: string[]; outputFile: string; pattern: string; + syncDeps?: boolean; } diff --git a/packages/react-native/src/executors/storybook/storybook.impl.ts b/packages/react-native/src/executors/storybook/storybook.impl.ts index 1c9a7191c53fd..ab2fe8f14a267 100644 --- a/packages/react-native/src/executors/storybook/storybook.impl.ts +++ b/packages/react-native/src/executors/storybook/storybook.impl.ts @@ -20,6 +20,8 @@ export default async function* reactNativeStorybookExecutor( options: ReactNativeStorybookOptions, context: ExecutorContext ): AsyncGenerator<{ success: boolean }> { + const { syncDeps: isSyncDepsEnabled = true } = options; + const projectRoot = context.projectsConfigurations.projects[context.projectName].root; logger.info( @@ -37,7 +39,7 @@ export default async function* reactNativeStorybookExecutor( ); const projectPackageJson = readJsonFile(packageJsonPath); - if (fileExists(packageJsonPath)) + if (isSyncDepsEnabled && fileExists(packageJsonPath)) displayNewlyAddedDepsMessage( context.projectName, await syncDeps(