@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 +6 -0
- package/package.json +1 -1
- package/src/startStorybookServer.js +16 -5
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 =
|
|
35
|
+
storybookPath = storybookPathV6;
|
|
25
36
|
}
|
|
26
37
|
|
|
27
38
|
const storybookConnector = new StorybookConnector({
|