@nx/storybook 20.4.0-beta.0 → 20.4.0-beta.2

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": "20.4.0-beta.0",
3
+ "version": "20.4.0-beta.2",
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": {
@@ -33,13 +33,13 @@
33
33
  "migrations": "./migrations.json"
34
34
  },
35
35
  "dependencies": {
36
- "@nx/devkit": "20.4.0-beta.0",
36
+ "@nx/devkit": "20.4.0-beta.2",
37
37
  "@phenomnomnominal/tsquery": "~5.0.1",
38
38
  "semver": "^7.5.3",
39
39
  "tslib": "^2.3.0",
40
- "@nx/cypress": "20.4.0-beta.0",
41
- "@nx/js": "20.4.0-beta.0",
42
- "@nx/eslint": "20.4.0-beta.0"
40
+ "@nx/cypress": "20.4.0-beta.2",
41
+ "@nx/js": "20.4.0-beta.2",
42
+ "@nx/eslint": "20.4.0-beta.2"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
@@ -12,6 +12,7 @@ const versions_1 = require("../../utils/versions");
12
12
  const interaction_testing_utils_1 = require("./lib/interaction-testing.utils");
13
13
  const ensure_dependencies_1 = require("./lib/ensure-dependencies");
14
14
  const edit_root_tsconfig_1 = require("./lib/edit-root-tsconfig");
15
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
15
16
  function configurationGenerator(tree, schema) {
16
17
  return configurationGeneratorInternal(tree, { addPlugin: false, ...schema });
17
18
  }
@@ -62,7 +63,8 @@ async function configurationGeneratorInternal(tree, rawSchema) {
62
63
  const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
63
64
  ? p === '@nx/storybook/plugin'
64
65
  : p.plugin === '@nx/storybook/plugin');
65
- const mainDir = !!nextConfigFilePath && projectType === 'application'
66
+ const mainDir = !!nextConfigFilePath &&
67
+ (0, ts_solution_setup_1.getProjectType)(tree, root, projectType) === 'application'
66
68
  ? 'components'
67
69
  : 'src';
68
70
  const usesVite = !!viteConfigFilePath || schema.uiFramework?.endsWith('-vite');
@@ -399,7 +399,8 @@ function addStorybookToTargetDefaults(tree, setCache = true) {
399
399
  (0, devkit_1.updateNxJson)(tree, nxJson);
400
400
  }
401
401
  function createProjectStorybookDir(tree, projectName, uiFramework, js, tsConfiguration, root, projectType, projectIsRootProjectInStandaloneWorkspace, interactionTests, mainDir, isNextJs, usesSwc, usesVite, viteConfigFilePath, hasPlugin, viteConfigFileName, usesReactNative) {
402
- let projectDirectory = projectType === 'application'
402
+ let projectDirectory = (0, ts_solution_setup_1.getProjectType)(tree, root, projectType) ===
403
+ 'application'
403
404
  ? isNextJs
404
405
  ? 'components'
405
406
  : 'src/app'
@@ -424,7 +425,9 @@ function createProjectStorybookDir(tree, projectName, uiFramework, js, tsConfigu
424
425
  projectType,
425
426
  interactionTests,
426
427
  mainDir,
427
- isNextJs: isNextJs && projectType === 'application',
428
+ isNextJs: isNextJs &&
429
+ (0, ts_solution_setup_1.getProjectType)(tree, root, projectType) ===
430
+ 'application',
428
431
  usesSwc,
429
432
  usesVite,
430
433
  isRootProject: projectIsRootProjectInStandaloneWorkspace,
@@ -450,7 +453,7 @@ function getTsConfigPath(tree, projectName, path) {
450
453
  const { root, projectType } = (0, devkit_1.readProjectConfiguration)(tree, projectName);
451
454
  return (0, path_1.join)(root, path?.length > 0
452
455
  ? path
453
- : projectType === 'application'
456
+ : (0, ts_solution_setup_1.getProjectType)(tree, root, projectType) === 'application'
454
457
  ? 'tsconfig.app.json'
455
458
  : 'tsconfig.lib.json');
456
459
  }