@nx/storybook 19.0.0-beta.6 → 19.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/storybook",
3
- "version": "19.0.0-beta.6",
3
+ "version": "19.0.0-beta.7",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Storybook contains executors and generators for allowing your workspace to use the powerful Storybook integration testing & documenting capabilities.",
6
6
  "repository": {
@@ -30,14 +30,14 @@
30
30
  "migrations": "./migrations.json"
31
31
  },
32
32
  "dependencies": {
33
- "@nx/devkit": "19.0.0-beta.6",
33
+ "@nx/devkit": "19.0.0-beta.7",
34
34
  "@phenomnomnominal/tsquery": "~5.0.1",
35
35
  "semver": "^7.5.3",
36
36
  "tslib": "^2.3.0",
37
- "@nx/cypress": "19.0.0-beta.6",
38
- "@nx/js": "19.0.0-beta.6",
39
- "@nx/eslint": "19.0.0-beta.6",
40
- "@nrwl/storybook": "19.0.0-beta.6"
37
+ "@nx/cypress": "19.0.0-beta.7",
38
+ "@nx/js": "19.0.0-beta.7",
39
+ "@nx/eslint": "19.0.0-beta.7",
40
+ "@nrwl/storybook": "19.0.0-beta.7"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -73,7 +73,9 @@ async function buildStorybookTargets(configFilePath, projectRoot, options, conte
73
73
  const targets = {};
74
74
  targets[options.buildStorybookTargetName] = buildTarget(namedInputs, buildOutputs, projectRoot, frameworkIsAngular, projectName, configFilePath);
75
75
  targets[options.serveStorybookTargetName] = serveTarget(projectRoot, frameworkIsAngular, projectName, configFilePath);
76
- targets[options.testStorybookTargetName] = testTarget(projectRoot);
76
+ if (isStorybookTestRunnerInstalled()) {
77
+ targets[options.testStorybookTargetName] = testTarget(projectRoot);
78
+ }
77
79
  targets[options.staticStorybookTargetName] = serveStaticTarget(options, projectRoot);
78
80
  return targets;
79
81
  }
@@ -187,10 +189,10 @@ function normalizeOutputPath(projectRoot) {
187
189
  }
188
190
  function normalizeOptions(options) {
189
191
  options ??= {};
190
- options.buildStorybookTargetName = 'build-storybook';
191
- options.serveStorybookTargetName = 'storybook';
192
- options.testStorybookTargetName = 'test-storybook';
193
- options.staticStorybookTargetName = 'static-storybook';
192
+ options.buildStorybookTargetName ??= 'build-storybook';
193
+ options.serveStorybookTargetName ??= 'storybook';
194
+ options.testStorybookTargetName ??= 'test-storybook';
195
+ options.staticStorybookTargetName ??= 'static-storybook';
194
196
  return options;
195
197
  }
196
198
  function buildProjectName(projectRoot, workspaceRoot) {
@@ -207,3 +209,12 @@ function buildProjectName(projectRoot, workspaceRoot) {
207
209
  }
208
210
  return name;
209
211
  }
212
+ function isStorybookTestRunnerInstalled() {
213
+ try {
214
+ require.resolve('@storybook/test-runner');
215
+ return true;
216
+ }
217
+ catch (e) {
218
+ return false;
219
+ }
220
+ }