creevey 0.8.0-beta.1 → 0.8.1-beta.0

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.
@@ -244,7 +244,7 @@ async function compile(config, {
244
244
  allowlist: /(webpack|dummy-hmr|generated-stories-entry|generated-config-entry|generated-other-entry)/
245
245
  }), // TODO Don't work well with monorepos
246
246
  (0, _webpackNodeExternals.default)({
247
- modulesDir: (0, _helpers.resolveFromStorybook)('@storybook/core').split('@storybook')[0],
247
+ modulesDir: (0, _helpers.resolveFromStorybook)('@storybook/core-client').split('@storybook')[0],
248
248
  includeAbsolutePaths: true,
249
249
  allowlist: /(webpack|dummy-hmr|generated-stories-entry|generated-config-entry|generated-other-entry)/
250
250
  })]; // NOTE Exclude some plugins
@@ -11,7 +11,7 @@ var _helpers = require("./helpers");
11
11
 
12
12
  const framework = (0, _helpers.getStorybookFramework)(); // eslint-disable-next-line @typescript-eslint/no-var-requires
13
13
 
14
- const core = require((0, _helpers.resolveFromStorybook)('@storybook/core'));
14
+ const core = require((0, _helpers.resolveFromStorybook)('@storybook/core-client'));
15
15
 
16
16
  const start = core.start;
17
17
  const api = start(() => void 0);
@@ -14,7 +14,7 @@ exports.isCSFv3Enabled = isCSFv3Enabled;
14
14
  exports.isStorybookVersion = isStorybookVersion;
15
15
  exports.isStorybookVersionGreaterThan = isStorybookVersionGreaterThan;
16
16
  exports.isStorybookVersionLessThan = isStorybookVersionLessThan;
17
- exports.storybookDirRef = exports.storybookConfigRef = exports.resolveFromStorybookCoreServer = exports.resolveFromStorybookCore = exports.resolveFromStorybookBuilderWebpack4 = exports.resolveFromStorybookAddonDocs = exports.resolveFromStorybook = void 0;
17
+ exports.storybookDirRef = exports.storybookConfigRef = exports.resolveFromStorybookCoreServer = exports.resolveFromStorybookCoreClient = exports.resolveFromStorybookBuilderWebpack4 = exports.resolveFromStorybookAddonDocs = exports.resolveFromStorybook = void 0;
18
18
 
19
19
  var _path = _interopRequireDefault(require("path"));
20
20
 
@@ -44,9 +44,9 @@ const resolveFromStorybookBuilderWebpack4 = modulePath => (0, _resolveFrom.defau
44
44
 
45
45
  exports.resolveFromStorybookBuilderWebpack4 = resolveFromStorybookBuilderWebpack4;
46
46
 
47
- const resolveFromStorybookCore = modulePath => (0, _resolveFrom.default)(resolveFromStorybook('@storybook/core'), modulePath);
47
+ const resolveFromStorybookCoreClient = modulePath => (0, _resolveFrom.default)(resolveFromStorybook('@storybook/core-client'), modulePath);
48
48
 
49
- exports.resolveFromStorybookCore = resolveFromStorybookCore;
49
+ exports.resolveFromStorybookCoreClient = resolveFromStorybookCoreClient;
50
50
 
51
51
  const resolveFromStorybookCoreServer = modulePath => (0, _resolveFrom.default)(resolveFromStorybook('@storybook/core-server'), modulePath);
52
52
 
@@ -9,6 +9,7 @@ exports.isShuttingDown = exports.isInsideDocker = void 0;
9
9
  exports.removeProps = removeProps;
10
10
  exports.runSequence = runSequence;
11
11
  exports.shouldSkip = shouldSkip;
12
+ exports.shouldSkipByOption = shouldSkipByOption;
12
13
  exports.shutdown = shutdown;
13
14
  exports.shutdownWorkers = shutdownWorkers;
14
15
  exports.skipOptionKeys = void 0;
@@ -48,38 +49,30 @@ function shouldSkip(browser, meta, skipOptions, test) {
48
49
  return skipOptions;
49
50
  }
50
51
 
51
- if (Array.isArray(skipOptions)) {
52
- for (const skip of skipOptions) {
53
- const reason = shouldSkip(browser, meta, skip, test);
54
- if (reason) return reason;
55
- }
56
-
57
- return false;
52
+ for (const skipKey in skipOptions) {
53
+ const reason = shouldSkipByOption(browser, meta, skipOptions[skipKey], skipKey, test);
54
+ if (reason) return reason;
58
55
  }
59
56
 
60
- let hasSkipOptionKeys = false;
57
+ return false;
58
+ }
61
59
 
62
- for (const skipKey in skipOptions) {
63
- if (skipOptionKeys.includes(skipKey)) {
64
- hasSkipOptionKeys = true;
65
- continue;
60
+ function shouldSkipByOption(browser, meta, skipOption, reason, test) {
61
+ if (Array.isArray(skipOption)) {
62
+ for (const skip of skipOption) {
63
+ const result = shouldSkipByOption(browser, meta, skip, reason, test);
64
+ if (result) return result;
66
65
  }
67
66
 
68
- const reason = shouldSkip(browser, meta, {
69
- reason: skipKey,
70
- ...skipOptions[skipKey]
71
- }, test);
72
- if (reason) return reason;
67
+ return false;
73
68
  }
74
69
 
75
- if (!hasSkipOptionKeys) return false;
76
70
  const {
77
71
  in: browsers,
78
72
  kinds,
79
73
  stories,
80
- tests,
81
- reason = true
82
- } = skipOptions;
74
+ tests
75
+ } = skipOption;
83
76
  const {
84
77
  kind,
85
78
  story
@@ -221,7 +221,7 @@ export default async function compile(config, {
221
221
  allowlist: /(webpack|dummy-hmr|generated-stories-entry|generated-config-entry|generated-other-entry)/
222
222
  }), // TODO Don't work well with monorepos
223
223
  nodeExternals({
224
- modulesDir: resolveFromStorybook('@storybook/core').split('@storybook')[0],
224
+ modulesDir: resolveFromStorybook('@storybook/core-client').split('@storybook')[0],
225
225
  includeAbsolutePaths: true,
226
226
  allowlist: /(webpack|dummy-hmr|generated-stories-entry|generated-config-entry|generated-other-entry)/
227
227
  })]; // NOTE Exclude some plugins
@@ -2,7 +2,7 @@ import { addons } from '@storybook/addons';
2
2
  import { getStorybookFramework, resolveFromStorybook } from './helpers';
3
3
  const framework = getStorybookFramework(); // eslint-disable-next-line @typescript-eslint/no-var-requires
4
4
 
5
- const core = require(resolveFromStorybook('@storybook/core'));
5
+ const core = require(resolveFromStorybook('@storybook/core-client'));
6
6
 
7
7
  const start = core.start;
8
8
  const api = start(() => void 0);
@@ -7,7 +7,7 @@ export const storybookDirRef = {
7
7
  export const resolveFromStorybook = modulePath => resolveFrom(storybookDirRef.current, modulePath);
8
8
  export const resolveFromStorybookAddonDocs = modulePath => resolveFrom(resolveFromStorybook('@storybook/addon-docs'), modulePath);
9
9
  export const resolveFromStorybookBuilderWebpack4 = modulePath => resolveFrom(resolveFromStorybook('@storybook/builder-webpack4'), modulePath);
10
- export const resolveFromStorybookCore = modulePath => resolveFrom(resolveFromStorybook('@storybook/core'), modulePath);
10
+ export const resolveFromStorybookCoreClient = modulePath => resolveFrom(resolveFromStorybook('@storybook/core-client'), modulePath);
11
11
  export const resolveFromStorybookCoreServer = modulePath => resolveFrom(resolveFromStorybook('@storybook/core-server'), modulePath);
12
12
 
13
13
  const importFromStorybook = modulePath => import(resolveFromStorybook(modulePath));
@@ -20,38 +20,29 @@ export function shouldSkip(browser, meta, skipOptions, test) {
20
20
  return skipOptions;
21
21
  }
22
22
 
23
- if (Array.isArray(skipOptions)) {
24
- for (const skip of skipOptions) {
25
- const reason = shouldSkip(browser, meta, skip, test);
26
- if (reason) return reason;
27
- }
28
-
29
- return false;
23
+ for (const skipKey in skipOptions) {
24
+ const reason = shouldSkipByOption(browser, meta, skipOptions[skipKey], skipKey, test);
25
+ if (reason) return reason;
30
26
  }
31
27
 
32
- let hasSkipOptionKeys = false;
33
-
34
- for (const skipKey in skipOptions) {
35
- if (skipOptionKeys.includes(skipKey)) {
36
- hasSkipOptionKeys = true;
37
- continue;
28
+ return false;
29
+ }
30
+ export function shouldSkipByOption(browser, meta, skipOption, reason, test) {
31
+ if (Array.isArray(skipOption)) {
32
+ for (const skip of skipOption) {
33
+ const result = shouldSkipByOption(browser, meta, skip, reason, test);
34
+ if (result) return result;
38
35
  }
39
36
 
40
- const reason = shouldSkip(browser, meta, {
41
- reason: skipKey,
42
- ...skipOptions[skipKey]
43
- }, test);
44
- if (reason) return reason;
37
+ return false;
45
38
  }
46
39
 
47
- if (!hasSkipOptionKeys) return false;
48
40
  const {
49
41
  in: browsers,
50
42
  kinds,
51
43
  stories,
52
- tests,
53
- reason = true
54
- } = skipOptions;
44
+ tests
45
+ } = skipOption;
55
46
  const {
56
47
  kind,
57
48
  story
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="webpack-env" />
3
3
  import type { StoryApi } from '@storybook/addons';
4
- declare const start: typeof import("@storybook/core").start;
4
+ declare const start: typeof import("@storybook/core-client").start;
5
5
  export declare const channel: import("@storybook/channels").Channel;
6
6
  declare type ClientApi = ReturnType<typeof start>['clientApi'];
7
7
  export declare const clientApi: ClientApi;
@@ -5,7 +5,7 @@ export declare const storybookDirRef: {
5
5
  export declare const resolveFromStorybook: (modulePath: string) => string;
6
6
  export declare const resolveFromStorybookAddonDocs: (modulePath: string) => string;
7
7
  export declare const resolveFromStorybookBuilderWebpack4: (modulePath: string) => string;
8
- export declare const resolveFromStorybookCore: (modulePath: string) => string;
8
+ export declare const resolveFromStorybookCoreClient: (modulePath: string) => string;
9
9
  export declare const resolveFromStorybookCoreServer: (modulePath: string) => string;
10
10
  export declare const importStorybookClientLogger: <T = typeof import("@storybook/client-logger")>() => Promise<T>;
11
11
  export declare const importStorybookCoreCommon: <T = typeof import("@storybook/core-common")>() => Promise<T>;
@@ -1,4 +1,4 @@
1
- import { SkipOptions, TestData } from '../types';
1
+ import { SkipOptions, SkipOption, TestData } from '../types';
2
2
  export declare const isShuttingDown: {
3
3
  current: boolean;
4
4
  };
@@ -9,6 +9,10 @@ export declare function shouldSkip(browser: string, meta: {
9
9
  kind: string;
10
10
  story: string;
11
11
  }, skipOptions: SkipOptions, test?: string): string | boolean;
12
+ export declare function shouldSkipByOption(browser: string, meta: {
13
+ kind: string;
14
+ story: string;
15
+ }, skipOption: SkipOption | SkipOption[], reason: string, test?: string): string | boolean;
12
16
  export declare function shutdownWorkers(): Promise<void>;
13
17
  export declare function shutdown(): void;
14
18
  export declare function getCreeveyCache(): string;
@@ -400,13 +400,12 @@ export interface CreeveyUpdate {
400
400
  removedTests?: TestMeta[];
401
401
  }
402
402
  export interface SkipOption {
403
- reason?: string;
404
403
  in?: string | string[] | RegExp;
405
404
  kinds?: string | string[] | RegExp;
406
405
  stories?: string | string[] | RegExp;
407
406
  tests?: string | string[] | RegExp;
408
407
  }
409
- export declare type SkipOptions = boolean | string | SkipOption | SkipOption[] | Record<string, SkipOption | SkipOption[]>;
408
+ export declare type SkipOptions = boolean | string | Record<string, SkipOption | SkipOption[]>;
410
409
  export declare type CreeveyTestFunction = (this: {
411
410
  browser: WebDriver;
412
411
  until: typeof until;
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "addon",
14
14
  "test"
15
15
  ],
16
- "version": "0.8.0-beta.1",
16
+ "version": "0.8.1-beta.0",
17
17
  "bin": {
18
18
  "creevey": "./lib/cjs/cli.js"
19
19
  },
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "./addon": {
26
26
  "types": "./lib/types/client/addon/index.d.ts",
27
+ "module": "./lib/esm/client/addon/index.js",
27
28
  "default": "./lib/cjs/client/addon/index.js"
28
29
  },
29
30
  "./preset": "./preset/index.js",
@@ -149,7 +150,6 @@
149
150
  "@storybook/channels": "^6.5.9",
150
151
  "@storybook/client-api": "^6.5.9",
151
152
  "@storybook/client-logger": "^6.5.9",
152
- "@storybook/core": "^6.5.9",
153
153
  "@storybook/core-client": "^6.5.9",
154
154
  "@storybook/core-common": "^6.5.9",
155
155
  "@storybook/core-events": "^6.5.9",