Skip to content

Commit d9c5fe9

Browse files
arekkubaczkowskiFrozenPandaz
authored andcommitted
feat(react-native): add optional syncDeps param to storybook executor (#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. (cherry picked from commit d4140b0)
1 parent ad0c3d1 commit d9c5fe9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/react-native/src/executors/storybook/schema.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export interface ReactNativeStorybookOptions {
22
searchDir: string[];
33
outputFile: string;
44
pattern: string;
5+
syncDeps?: boolean;
56
}

packages/react-native/src/executors/storybook/storybook.impl.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export default async function* reactNativeStorybookExecutor(
2020
options: ReactNativeStorybookOptions,
2121
context: ExecutorContext
2222
): AsyncGenerator<{ success: boolean }> {
23+
const { syncDeps: isSyncDepsEnabled = true } = options;
24+
2325
const projectRoot =
2426
context.projectsConfigurations.projects[context.projectName].root;
2527
logger.info(
@@ -37,7 +39,7 @@ export default async function* reactNativeStorybookExecutor(
3739
);
3840
const projectPackageJson = readJsonFile<PackageJson>(packageJsonPath);
3941

40-
if (fileExists(packageJsonPath))
42+
if (isSyncDepsEnabled && fileExists(packageJsonPath))
4143
displayNewlyAddedDepsMessage(
4244
context.projectName,
4345
await syncDeps(

0 commit comments

Comments
 (0)