Skip to content

Commit

Permalink
feat(react-native): add optional syncDeps param to storybook executor (
Browse files Browse the repository at this point in the history
…#22032)

closed #22009

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## 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.
  • Loading branch information
arekkubaczkowski authored and Coly010 committed May 15, 2024
1 parent f34dcae commit 6993581
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/react-native/src/executors/storybook/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export interface ReactNativeStorybookOptions {
searchDir: string[];
outputFile: string;
pattern: string;
syncDeps?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -37,7 +39,7 @@ export default async function* reactNativeStorybookExecutor(
);
const projectPackageJson = readJsonFile<PackageJson>(packageJsonPath);

if (fileExists(packageJsonPath))
if (isSyncDepsEnabled && fileExists(packageJsonPath))
displayNewlyAddedDepsMessage(
context.projectName,
await syncDeps(
Expand Down

0 comments on commit 6993581

Please sign in to comment.