@nx/storybook 20.6.2 → 20.6.4

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.6.2",
3
+ "version": "20.6.4",
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.6.2",
36
+ "@nx/devkit": "20.6.4",
37
37
  "@phenomnomnominal/tsquery": "~5.0.1",
38
38
  "semver": "^7.5.3",
39
39
  "tslib": "^2.3.0",
40
- "@nx/cypress": "20.6.2",
41
- "@nx/js": "20.6.2",
42
- "@nx/eslint": "20.6.2"
40
+ "@nx/cypress": "20.6.4",
41
+ "@nx/js": "20.6.4",
42
+ "@nx/eslint": "20.6.4"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.editRootTsConfig = editRootTsConfig;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const js_1 = require("@nx/js");
5
6
  /**
6
7
  * This is a temporary fix for Storybook to support TypeScript configuration files.
7
8
  * The issue is that if there is a root tsconfig.json file, Storybook will use it, and
@@ -13,21 +14,21 @@ function editRootTsConfig(tree) {
13
14
  return;
14
15
  }
15
16
  (0, devkit_1.updateJson)(tree, 'tsconfig.json', (json) => {
16
- if (json['ts-node']) {
17
- json['ts-node'] = {
18
- ...json['ts-node'],
19
- compilerOptions: {
20
- ...(json['ts-node'].compilerOptions ?? {}),
21
- module: 'commonjs',
22
- },
23
- };
17
+ json['ts-node'] ??= {};
18
+ json['ts-node'].compilerOptions ??= {};
19
+ json['ts-node'].compilerOptions.module = 'commonjs';
20
+ json['ts-node'].compilerOptions.moduleResolution = 'node10';
21
+ if (json.compilerOptions?.customConditions) {
22
+ json['ts-node'].compilerOptions.customConditions = null;
24
23
  }
25
24
  else {
26
- json['ts-node'] = {
27
- compilerOptions: {
28
- module: 'commonjs',
29
- },
30
- };
25
+ const rootTsconfigFile = (0, js_1.getRootTsConfigFileName)(tree);
26
+ if (rootTsconfigFile) {
27
+ const rootTsconfigJson = (0, devkit_1.readJson)(tree, rootTsconfigFile);
28
+ if (rootTsconfigJson.compilerOptions?.customConditions) {
29
+ json['ts-node'].compilerOptions.customConditions = null;
30
+ }
31
+ }
31
32
  }
32
33
  return json;
33
34
  });