@applitools/eyes-storybook 3.34.0 → 3.34.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  ## Unreleased
4
4
 
5
5
 
6
+ ## 3.34.1 - 2023/5/9
7
+
8
+ ### Features
9
+ ### Bug fixes
10
+ - Fix the issue where storybook v6 will not start if storybook cli is being used
11
+
6
12
  ## 3.34.0 - 2023/5/4
7
13
 
8
14
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-storybook",
3
- "version": "3.34.0",
3
+ "version": "3.34.1",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "applitools",
@@ -3,6 +3,11 @@ const {resolve} = require('path');
3
3
  const ora = require('ora');
4
4
  const StorybookConnector = require('./storybookConnector');
5
5
  const fs = require('fs');
6
+ const {exec} = require('child_process');
7
+ const {promisify: p} = require('util');
8
+ const pexec = p(exec);
9
+ // eslint-disable-next-line
10
+ const semver = require('semver');
6
11
 
7
12
  async function startStorybookServer({
8
13
  packagePath,
@@ -16,12 +21,18 @@ async function startStorybookServer({
16
21
  }) {
17
22
  const isWindows = process.platform.startsWith('win');
18
23
  let storybookPath, sbArg;
19
-
20
- if (fs.existsSync(resolve(packagePath, 'node_modules/.bin/sb'))) {
21
- storybookPath = resolve(packagePath, 'node_modules/.bin/sb');
22
- sbArg = 'dev';
24
+ const storybookPathV6 = resolve(packagePath, 'node_modules/.bin/start-storybook');
25
+ const storybookPathV7 = resolve(packagePath, 'node_modules/.bin/sb');
26
+ if (fs.existsSync(storybookPathV7)) {
27
+ const version = await pexec(`${storybookPathV7} --version`);
28
+ if (semver.satisfies(version.stdout, '<7.0.0')) {
29
+ storybookPath = storybookPathV6;
30
+ } else {
31
+ storybookPath = storybookPathV7;
32
+ sbArg = 'dev';
33
+ }
23
34
  } else {
24
- storybookPath = resolve(packagePath, 'node_modules/.bin/start-storybook');
35
+ storybookPath = storybookPathV6;
25
36
  }
26
37
 
27
38
  const storybookConnector = new StorybookConnector({