@nx/storybook 16.5.0 → 16.5.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": "16.5.0",
3
+ "version": "16.5.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": {
@@ -30,12 +30,12 @@
30
30
  "migrations": "./migrations.json"
31
31
  },
32
32
  "dependencies": {
33
- "@nrwl/storybook": "16.5.0",
34
- "@nx/cypress": "16.5.0",
35
- "@nx/devkit": "16.5.0",
36
- "@nx/js": "16.5.0",
37
- "@nx/linter": "16.5.0",
38
- "@nx/workspace": "16.5.0",
33
+ "@nrwl/storybook": "16.5.2",
34
+ "@nx/cypress": "16.5.2",
35
+ "@nx/devkit": "16.5.2",
36
+ "@nx/js": "16.5.2",
37
+ "@nx/linter": "16.5.2",
38
+ "@nx/workspace": "16.5.2",
39
39
  "@phenomnomnominal/tsquery": "~5.0.1",
40
40
  "dotenv": "~10.0.0",
41
41
  "semver": "7.5.3"
@@ -44,5 +44,5 @@
44
44
  "access": "public"
45
45
  },
46
46
  "types": "./index.d.ts",
47
- "gitHead": "eaebcc34f92db2200dab0bde2e2e1dde107a47bf"
47
+ "gitHead": "928273940d11aa7dea87cb625a92f2c3ec62e726"
48
48
  }
@@ -375,7 +375,7 @@ function createProjectStorybookDir(tree, projectName, uiFramework, js, tsConfigu
375
375
  exports.createProjectStorybookDir = createProjectStorybookDir;
376
376
  function getTsConfigPath(tree, projectName, path) {
377
377
  const { root, projectType } = (0, devkit_1.readProjectConfiguration)(tree, projectName);
378
- return (0, path_1.join)(root, path && path.length > 0
378
+ return (0, path_1.join)(root, (path === null || path === void 0 ? void 0 : path.length) > 0
379
379
  ? path
380
380
  : projectType === 'application'
381
381
  ? 'tsconfig.app.json'
@@ -393,7 +393,8 @@ function addBuildStorybookToCacheableOperations(tree) {
393
393
  }
394
394
  exports.addBuildStorybookToCacheableOperations = addBuildStorybookToCacheableOperations;
395
395
  function projectIsRootProjectInStandaloneWorkspace(projectRoot) {
396
- return (0, path_1.relative)(devkit_1.workspaceRoot, projectRoot).length === 0;
396
+ var _a;
397
+ return ((_a = (0, path_1.relative)(devkit_1.workspaceRoot, projectRoot)) === null || _a === void 0 ? void 0 : _a.length) === 0;
397
398
  }
398
399
  exports.projectIsRootProjectInStandaloneWorkspace = projectIsRootProjectInStandaloneWorkspace;
399
400
  function workspaceHasRootProject(tree) {
@@ -449,20 +450,20 @@ function getViteConfigFilePath(tree, projectRoot, configFile) {
449
450
  }
450
451
  exports.getViteConfigFilePath = getViteConfigFilePath;
451
452
  function renameAndMoveOldTsConfig(projectRoot, pathToStorybookConfigFile, tree) {
452
- if (pathToStorybookConfigFile) {
453
+ if (pathToStorybookConfigFile && tree.exists(pathToStorybookConfigFile)) {
453
454
  (0, devkit_1.updateJson)(tree, pathToStorybookConfigFile, (json) => {
454
- var _a;
455
+ var _a, _b, _c, _d;
455
456
  if ((_a = json.extends) === null || _a === void 0 ? void 0 : _a.startsWith('../')) {
456
457
  // drop one level of nesting
457
458
  json.extends = json.extends.replace('../', './');
458
459
  }
459
- for (let i = 0; i < json.files.length; i++) {
460
+ for (let i = 0; i < ((_b = json.files) === null || _b === void 0 ? void 0 : _b.length); i++) {
460
461
  // drop one level of nesting
461
462
  if (json.files[i].startsWith('../../../')) {
462
463
  json.files[i] = json.files[i].replace('../../../', '../../');
463
464
  }
464
465
  }
465
- for (let i = 0; i < json.include.length; i++) {
466
+ for (let i = 0; i < ((_c = json.include) === null || _c === void 0 ? void 0 : _c.length); i++) {
466
467
  if (json.include[i].startsWith('../')) {
467
468
  json.include[i] = json.include[i].replace('../', '');
468
469
  }
@@ -473,7 +474,7 @@ function renameAndMoveOldTsConfig(projectRoot, pathToStorybookConfigFile, tree)
473
474
  json.include[i] = '.storybook/*.ts';
474
475
  }
475
476
  }
476
- for (let i = 0; i < json.exclude.length; i++) {
477
+ for (let i = 0; i < ((_d = json.exclude) === null || _d === void 0 ? void 0 : _d.length); i++) {
477
478
  if (json.exclude[i].startsWith('../')) {
478
479
  json.exclude[i] = json.exclude[i].replace('../', 'src/');
479
480
  }
@@ -483,14 +484,26 @@ function renameAndMoveOldTsConfig(projectRoot, pathToStorybookConfigFile, tree)
483
484
  tree.rename(pathToStorybookConfigFile, (0, devkit_1.joinPathFragments)(projectRoot, `tsconfig.storybook.json`));
484
485
  }
485
486
  const projectTsConfig = (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.json');
486
- (0, devkit_1.updateJson)(tree, projectTsConfig, (json) => {
487
- for (let i = 0; i < json.references.length; i++) {
488
- if (json.references[i].path === './.storybook/tsconfig.json') {
489
- json.references[i].path = './tsconfig.storybook.json';
490
- break;
487
+ if (tree.exists(projectTsConfig)) {
488
+ (0, devkit_1.updateJson)(tree, projectTsConfig, (json) => {
489
+ var _a;
490
+ for (let i = 0; i < ((_a = json.references) === null || _a === void 0 ? void 0 : _a.length); i++) {
491
+ if (json.references[i].path === './.storybook/tsconfig.json') {
492
+ json.references[i].path = './tsconfig.storybook.json';
493
+ break;
494
+ }
491
495
  }
492
- }
493
- return json;
494
- });
496
+ return json;
497
+ });
498
+ }
499
+ const projectEsLintFile = (0, devkit_1.joinPathFragments)(projectRoot, '.eslintrc.json');
500
+ if (tree.exists(projectEsLintFile)) {
501
+ (0, devkit_1.updateJson)(tree, projectEsLintFile, (json) => {
502
+ const jsonString = JSON.stringify(json);
503
+ const newJsonString = jsonString.replace(/\.storybook\/tsconfig\.json/g, 'tsconfig.storybook.json');
504
+ json = JSON.parse(newJsonString);
505
+ return json;
506
+ });
507
+ }
495
508
  }
496
509
  exports.renameAndMoveOldTsConfig = renameAndMoveOldTsConfig;
@@ -181,6 +181,7 @@ function isTheFileAStory(tree, path) {
181
181
  ]);
182
182
  importSpecifiers.forEach((importSpecifier) => {
183
183
  if (importSpecifier.getText() === 'Story' ||
184
+ importSpecifier.getText() === 'Meta' ||
184
185
  importSpecifier.getText() === 'storiesOf' ||
185
186
  importSpecifier.getText() === 'ComponentStory') {
186
187
  nodeContainsStoryImport = true;
@@ -6,4 +6,4 @@ export declare const litVersion = "^2.6.1";
6
6
  export declare const tsNodeVersion = "10.9.1";
7
7
  export declare const storybookVersion = "^7.0.24";
8
8
  export declare const reactVersion = "^18.2.0";
9
- export declare const viteVersion = "^4.3.4";
9
+ export declare const viteVersion = "~4.3.9";
@@ -9,4 +9,4 @@ exports.litVersion = '^2.6.1';
9
9
  exports.tsNodeVersion = '10.9.1';
10
10
  exports.storybookVersion = '^7.0.24';
11
11
  exports.reactVersion = '^18.2.0';
12
- exports.viteVersion = '^4.3.4';
12
+ exports.viteVersion = '~4.3.9';