creevey 0.8.0-beta.1 → 0.8.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.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/docs/config.md +29 -26
- package/lib/cjs/server/loaders/webpack/compile.js +1 -1
- package/lib/cjs/server/storybook/entry.js +1 -1
- package/lib/cjs/server/storybook/helpers.js +3 -3
- package/lib/cjs/server/utils.js +14 -21
- package/lib/esm/server/loaders/webpack/compile.js +1 -1
- package/lib/esm/server/storybook/entry.js +1 -1
- package/lib/esm/server/storybook/helpers.js +1 -1
- package/lib/esm/server/utils.js +13 -22
- package/lib/types/server/storybook/entry.d.ts +1 -1
- package/lib/types/server/storybook/helpers.d.ts +1 -1
- package/lib/types/server/utils.d.ts +5 -1
- package/lib/types/types.d.ts +1 -2
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# [0.8.0](https://github.com/wKich/creevey/compare/v0.8.0-beta.1...v0.8.0) (2023-03-07)
|
2
|
+
|
3
|
+
### Bug Fixes
|
4
|
+
|
5
|
+
- drop support of SkipOption on root skip level ([31be1bf](https://github.com/wKich/creevey/commit/31be1bf4d67f464ea6790e6e218ca75674366711))
|
6
|
+
|
1
7
|
# [0.8.0-beta.1](https://github.com/wKich/creevey/compare/v0.8.0-beta.0...v0.8.0-beta.1) (2023-01-18)
|
2
8
|
|
3
9
|
### Bug Fixes
|
package/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
[<img width="274" alt="Creevey" src="https://user-images.githubusercontent.com/4607770/220418756-89cf4f54-ccb7-4086-a74c-a044ea1d2a61.png">](https://harrypotter.fandom.com/wiki/Colin_Creevey)
|
2
2
|
|
3
3
|
**IMPORTANT** _Looking for any help with maintaining_
|
4
4
|
|
package/docs/config.md
CHANGED
@@ -120,7 +120,7 @@ export const parameters = {
|
|
120
120
|
creevey: {
|
121
121
|
// Skip all *hover tests in IE11 on the global level
|
122
122
|
skip: {
|
123
|
-
ie11: { in: 'ie11', tests: /.*hover$/ },
|
123
|
+
"hovers don't work in ie11": { in: 'ie11', tests: /.*hover$/ },
|
124
124
|
},
|
125
125
|
},
|
126
126
|
};
|
@@ -137,15 +137,14 @@ export default {
|
|
137
137
|
parameters: {
|
138
138
|
creevey: {
|
139
139
|
// You could skip some browsers/stories or even specific tests
|
140
|
-
skip:
|
141
|
-
|
142
|
-
{ in: 'firefox', stories: 'Loading'
|
143
|
-
{
|
140
|
+
skip: {
|
141
|
+
"`MyComponent` doesn't support ie11": { in: 'ie11' },
|
142
|
+
"Loading stories are flaky in firefox": { in: 'firefox', stories: 'Loading' },
|
143
|
+
"`MyComponent` hovering doesn't work correctly": {
|
144
144
|
in: ['firefox', 'chrome'],
|
145
145
|
tests: /.*hover$/,
|
146
|
-
reason: "For some reason `MyComponent` hovering doesn't work correctly",
|
147
146
|
},
|
148
|
-
|
147
|
+
},
|
149
148
|
},
|
150
149
|
},
|
151
150
|
} as Meta & CreeveyMeta;
|
@@ -169,43 +168,47 @@ Basic.parameters = {
|
|
169
168
|
|
170
169
|
```ts
|
171
170
|
interface SkipOption {
|
172
|
-
reason?: string;
|
173
171
|
in?: string | string[] | RegExp;
|
174
172
|
kinds?: string | string[] | RegExp;
|
175
173
|
stories?: string | string[] | RegExp;
|
176
174
|
tests?: string | string[] | RegExp;
|
177
175
|
}
|
178
176
|
|
179
|
-
type SkipOptions =
|
177
|
+
type SkipOptions = boolean | string | Record<string, SkipOption | SkipOption[]>;
|
180
178
|
```
|
181
179
|
|
182
180
|
- Skip all stories for all browsers:
|
183
181
|
- `skip: true`
|
184
182
|
- `skip: 'Skip reason message'`
|
185
|
-
- `skip: {
|
183
|
+
- `skip: { 'Skip reason message': true }`
|
186
184
|
- Skip all stories for specific browsers:
|
187
|
-
- `skip: { in: 'ie11' }`
|
188
|
-
- `skip: { in: ['ie11', 'chrome'] }`
|
189
|
-
- `skip: { in: /^fire.*/ }`
|
185
|
+
- `skip: { 'Skip reason message': { in: 'ie11' } }`
|
186
|
+
- `skip: { 'Skip reason message': { in: ['ie11', 'chrome'] } }`
|
187
|
+
- `skip: { 'Skip reason message': { in: /^fire.*/ } }`
|
190
188
|
- Skip all stories in specific kinds:
|
191
|
-
- `skip: { kinds: 'Button' }`
|
192
|
-
- `skip: { kinds: ['Button', 'Input'] }`
|
193
|
-
- `skip: { kinds: /.*Modal$/ }`
|
189
|
+
- `skip: { 'Skip reason message': { kinds: 'Button' } }`
|
190
|
+
- `skip: { 'Skip reason message': { kinds: ['Button', 'Input'] } }`
|
191
|
+
- `skip: { 'Skip reason message': { kinds: /.*Modal$/ } }`
|
194
192
|
- Skip all tests in specific stories:
|
195
|
-
- `skip: { stories: 'simple' }`
|
196
|
-
- `skip: { stories: ['simple', 'special'] }`
|
197
|
-
- `skip: { stories: /.*large$/ }`
|
193
|
+
- `skip: { 'Skip reason message': { stories: 'simple' } }`
|
194
|
+
- `skip: { 'Skip reason message': { stories: ['simple', 'special'] } }`
|
195
|
+
- `skip: { 'Skip reason message': { stories: /.*large$/ } }`
|
198
196
|
- Skip specific tests:
|
199
|
-
- `skip: { tests: 'click' }`
|
200
|
-
- `skip: { tests: ['hover', 'click'] }`
|
201
|
-
- `skip: { tests: /^press.*$/ }`
|
197
|
+
- `skip: { 'Skip reason message': { tests: 'click' } }`
|
198
|
+
- `skip: { 'Skip reason message': { tests: ['hover', 'click'] } }`
|
199
|
+
- `skip: { 'Skip reason message': { tests: /^press.*$/ } }`
|
202
200
|
- Multiple skip options:
|
203
|
-
-
|
204
|
-
|
201
|
+
- for one reason
|
202
|
+
```
|
203
|
+
skip: {
|
204
|
+
"reason": [{ /* ... */ }, { /* ... */ }],
|
205
|
+
}
|
206
|
+
```
|
207
|
+
- for several reasons
|
205
208
|
```
|
206
209
|
skip: {
|
207
|
-
|
208
|
-
|
210
|
+
"reason 1": { /* ... */ },
|
211
|
+
"reason 2": { /* ... */ },
|
209
212
|
}
|
210
213
|
```
|
211
214
|
|
@@ -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.
|
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
|
47
|
+
const resolveFromStorybookCoreClient = modulePath => (0, _resolveFrom.default)(resolveFromStorybook('@storybook/core-client'), modulePath);
|
48
48
|
|
49
|
-
exports.
|
49
|
+
exports.resolveFromStorybookCoreClient = resolveFromStorybookCoreClient;
|
50
50
|
|
51
51
|
const resolveFromStorybookCoreServer = modulePath => (0, _resolveFrom.default)(resolveFromStorybook('@storybook/core-server'), modulePath);
|
52
52
|
|
package/lib/cjs/server/utils.js
CHANGED
@@ -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
|
-
|
52
|
-
|
53
|
-
|
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
|
-
|
57
|
+
return false;
|
58
|
+
}
|
61
59
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
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
|
-
|
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
|
-
|
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
|
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));
|
package/lib/esm/server/utils.js
CHANGED
@@ -20,38 +20,29 @@ export function shouldSkip(browser, meta, skipOptions, test) {
|
|
20
20
|
return skipOptions;
|
21
21
|
}
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
-
|
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
|
-
|
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
|
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;
|
package/lib/types/types.d.ts
CHANGED
@@ -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 |
|
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
|
16
|
+
"version": "0.8.0",
|
17
17
|
"bin": {
|
18
18
|
"creevey": "./lib/cjs/cli.js"
|
19
19
|
},
|
@@ -149,7 +149,6 @@
|
|
149
149
|
"@storybook/channels": "^6.5.9",
|
150
150
|
"@storybook/client-api": "^6.5.9",
|
151
151
|
"@storybook/client-logger": "^6.5.9",
|
152
|
-
"@storybook/core": "^6.5.9",
|
153
152
|
"@storybook/core-client": "^6.5.9",
|
154
153
|
"@storybook/core-common": "^6.5.9",
|
155
154
|
"@storybook/core-events": "^6.5.9",
|