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(