creevey 0.9.0-beta.2 → 0.9.0-non-webpack.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/AUTHORS +15 -15
- package/CHANGELOG.md +1275 -1275
- package/LICENSE +21 -21
- package/README.md +7 -0
- package/addon/README.md +3 -0
- package/addon/package.json +4 -0
- package/docs/config.md +212 -212
- package/docs/grid.md +10 -10
- package/docs/tests.md +63 -63
- package/jest.config.js +6 -0
- package/lib/cjs/client/addon/Manager.js +123 -271
- package/lib/cjs/client/addon/components/Addon.js +17 -38
- package/lib/cjs/client/addon/components/Icons.js +12 -8
- package/lib/cjs/client/addon/components/Panel.js +17 -13
- package/lib/cjs/client/addon/components/TestSelect.js +11 -9
- package/lib/cjs/client/addon/components/Tools.js +21 -40
- package/lib/cjs/client/addon/decorator.js +1 -1
- package/lib/cjs/client/addon/index.js +31 -0
- package/lib/cjs/client/addon/preset.js +13 -32
- package/lib/cjs/client/addon/register.js +46 -70
- package/lib/cjs/client/addon/utils.js +1 -1
- package/lib/cjs/client/addon/withCreevey.js +164 -344
- package/lib/cjs/client/shared/components/ImagesView/BlendView.js +23 -21
- package/lib/cjs/client/shared/components/ImagesView/ImagesView.js +22 -18
- package/lib/cjs/client/shared/components/ImagesView/SideBySideView.js +42 -64
- package/lib/cjs/client/shared/components/ImagesView/SlideView.js +35 -48
- package/lib/cjs/client/shared/components/ImagesView/SwapView.js +24 -43
- package/lib/cjs/client/shared/components/ImagesView/index.js +9 -9
- package/lib/cjs/client/shared/components/PageFooter/PageFooter.js +12 -8
- package/lib/cjs/client/shared/components/PageFooter/Paging.js +14 -18
- package/lib/cjs/client/shared/components/PageHeader/ImagePreview.js +22 -18
- package/lib/cjs/client/shared/components/PageHeader/PageHeader.js +42 -67
- package/lib/cjs/client/shared/components/ResultsPage.js +39 -69
- package/lib/cjs/client/shared/creeveyClientApi.js +55 -82
- package/lib/cjs/client/shared/helpers.js +143 -214
- package/lib/cjs/client/shared/viewMode.js +5 -5
- package/lib/cjs/client/web/142.js +2 -0
- package/lib/cjs/client/web/142.js.LICENSE.txt +12 -0
- package/lib/cjs/client/web/32.js +1 -0
- package/lib/cjs/client/web/551.js +1 -0
- package/lib/cjs/client/web/566.js +2 -0
- package/lib/cjs/client/web/566.js.LICENSE.txt +31 -0
- package/lib/cjs/client/web/691.js +2 -0
- package/lib/cjs/client/web/691.js.LICENSE.txt +8 -0
- package/lib/cjs/client/web/725.js +1 -0
- package/lib/cjs/client/web/index.html +19 -19
- package/lib/cjs/client/web/main.js +2 -38
- package/lib/cjs/client/web/main.js.LICENSE.txt +49 -0
- package/lib/cjs/creevey.js +3 -5
- package/lib/cjs/index.js +4 -4
- package/lib/cjs/server/config.js +1 -1
- package/lib/cjs/server/docker.js +3 -7
- package/lib/cjs/server/index.js +1 -1
- package/lib/cjs/server/loaders/babel/creevey-plugin.js +1 -3
- package/lib/cjs/server/loaders/babel/helpers.js +13 -23
- package/lib/cjs/server/loaders/babel/register.js +1 -3
- package/lib/cjs/server/loaders/webpack/compile.js +31 -24
- package/lib/cjs/server/loaders/webpack/creevey-loader.js +10 -5
- package/lib/cjs/server/loaders/webpack/dummy-hmr.js +2 -7
- package/lib/cjs/server/loaders/webpack/mdx-loader.js +1 -1
- package/lib/cjs/server/loaders/webpack/start.js +1 -1
- package/lib/cjs/server/logger.js +2 -1
- package/lib/cjs/server/master/index.js +2 -2
- package/lib/cjs/server/master/pool.js +9 -18
- package/lib/cjs/server/master/runner.js +53 -66
- package/lib/cjs/server/master/server.js +2 -2
- package/lib/cjs/server/messages.js +8 -10
- package/lib/cjs/server/selenium/browser.js +23 -31
- package/lib/cjs/server/selenium/selenoid.js +5 -7
- package/lib/cjs/server/stories.js +9 -20
- package/lib/cjs/server/storybook/entry.js +5 -3
- package/lib/cjs/server/storybook/helpers.js +15 -21
- package/lib/cjs/server/storybook/providers/browser.js +5 -9
- package/lib/cjs/server/storybook/providers/nodejs.js +4 -4
- package/lib/cjs/server/update.js +1 -5
- package/lib/cjs/server/utils.js +13 -15
- package/lib/cjs/server/worker/reporter.js +8 -20
- package/lib/cjs/server/worker/worker.js +6 -16
- package/lib/cjs/shared/index.js +101 -0
- package/lib/cjs/shared/serializeRegExp.js +42 -0
- package/lib/cjs/types.js +6 -6
- package/lib/esm/client/addon/Manager.js +123 -271
- package/lib/esm/client/addon/components/Addon.js +15 -34
- package/lib/esm/client/addon/components/Icons.js +11 -7
- package/lib/esm/client/addon/components/Panel.js +17 -13
- package/lib/esm/client/addon/components/TestSelect.js +11 -9
- package/lib/esm/client/addon/components/Tools.js +19 -36
- package/lib/esm/client/addon/decorator.js +1 -1
- package/lib/esm/client/addon/index.js +2 -0
- package/lib/esm/client/addon/preset.js +10 -25
- package/lib/esm/client/addon/register.js +42 -66
- package/lib/esm/client/addon/utils.js +1 -1
- package/lib/esm/client/addon/withCreevey.js +157 -341
- package/lib/esm/client/shared/components/ImagesView/BlendView.js +21 -17
- package/lib/esm/client/shared/components/ImagesView/ImagesView.js +21 -17
- package/lib/esm/client/shared/components/ImagesView/SideBySideView.js +40 -60
- package/lib/esm/client/shared/components/ImagesView/SlideView.js +33 -44
- package/lib/esm/client/shared/components/ImagesView/SwapView.js +22 -39
- package/lib/esm/client/shared/components/PageFooter/PageFooter.js +12 -8
- package/lib/esm/client/shared/components/PageFooter/Paging.js +14 -18
- package/lib/esm/client/shared/components/PageHeader/ImagePreview.js +22 -18
- package/lib/esm/client/shared/components/PageHeader/PageHeader.js +37 -60
- package/lib/esm/client/shared/components/ResultsPage.js +36 -64
- package/lib/esm/client/shared/creeveyClientApi.js +57 -84
- package/lib/esm/client/shared/helpers.js +127 -198
- package/lib/esm/client/shared/viewMode.js +4 -4
- package/lib/esm/creevey.js +3 -5
- package/lib/esm/index.js +1 -3
- package/lib/esm/server/docker.js +2 -2
- package/lib/esm/server/index.js +1 -1
- package/lib/esm/server/loaders/babel/creevey-plugin.js +1 -3
- package/lib/esm/server/loaders/babel/helpers.js +12 -22
- package/lib/esm/server/loaders/babel/register.js +1 -3
- package/lib/esm/server/loaders/webpack/compile.js +31 -24
- package/lib/esm/server/loaders/webpack/creevey-loader.js +9 -4
- package/lib/esm/server/loaders/webpack/dummy-hmr.js +2 -6
- package/lib/esm/server/loaders/webpack/start.js +1 -1
- package/lib/esm/server/master/index.js +2 -2
- package/lib/esm/server/master/pool.js +7 -18
- package/lib/esm/server/master/runner.js +53 -66
- package/lib/esm/server/master/server.js +2 -2
- package/lib/esm/server/messages.js +3 -5
- package/lib/esm/server/selenium/browser.js +20 -28
- package/lib/esm/server/selenium/selenoid.js +4 -6
- package/lib/esm/server/stories.js +9 -20
- package/lib/esm/server/storybook/entry.js +4 -2
- package/lib/esm/server/storybook/helpers.js +7 -15
- package/lib/esm/server/storybook/providers/browser.js +4 -5
- package/lib/esm/server/storybook/providers/nodejs.js +3 -3
- package/lib/esm/server/update.js +1 -5
- package/lib/esm/server/utils.js +5 -9
- package/lib/esm/server/worker/reporter.js +8 -20
- package/lib/esm/server/worker/worker.js +6 -16
- package/lib/esm/shared/index.js +78 -0
- package/lib/esm/shared/serializeRegExp.js +24 -0
- package/lib/types/cli.d.ts +1 -1
- package/lib/types/client/addon/Manager.d.ts +37 -37
- package/lib/types/client/addon/components/Addon.d.ts +8 -8
- package/lib/types/client/addon/components/Icons.d.ts +7 -7
- package/lib/types/client/addon/components/Panel.d.ts +9 -9
- package/lib/types/client/addon/components/TestSelect.d.ts +8 -9
- package/lib/types/client/addon/components/Tools.d.ts +6 -6
- package/lib/types/client/addon/decorator.d.ts +1 -1
- package/lib/types/client/addon/index.d.ts +2 -0
- package/lib/types/client/addon/preset.d.ts +23 -24
- package/lib/types/client/addon/readyForCapture.d.ts +6 -6
- package/lib/types/client/addon/register.d.ts +3 -3
- package/lib/types/client/addon/utils.d.ts +2 -2
- package/lib/types/client/addon/withCreevey.d.ts +24 -24
- package/lib/types/client/shared/components/ImagesView/BlendView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/ImagesView.d.ts +24 -25
- package/lib/types/client/shared/components/ImagesView/SideBySideView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/SlideView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/SwapView.d.ts +3 -3
- package/lib/types/client/shared/components/ImagesView/index.d.ts +5 -5
- package/lib/types/client/shared/components/PageFooter/PageFooter.d.ts +8 -9
- package/lib/types/client/shared/components/PageFooter/Paging.d.ts +7 -8
- package/lib/types/client/shared/components/PageHeader/ImagePreview.d.ts +12 -12
- package/lib/types/client/shared/components/PageHeader/PageHeader.d.ts +16 -17
- package/lib/types/client/shared/components/ResultsPage.d.ts +18 -18
- package/lib/types/client/shared/creeveyClientApi.d.ts +9 -9
- package/lib/types/client/shared/helpers.d.ts +46 -46
- package/lib/types/client/shared/viewMode.d.ts +4 -4
- package/lib/types/client/web/CreeveyApp.d.ts +11 -12
- package/lib/types/client/web/CreeveyContext.d.ts +11 -11
- package/lib/types/client/web/CreeveyLoader.d.ts +2 -3
- package/lib/types/client/web/CreeveyView/SideBar/Checkbox.d.ts +19 -19
- package/lib/types/client/web/CreeveyView/SideBar/Search.d.ts +6 -6
- package/lib/types/client/web/CreeveyView/SideBar/SideBar.d.ts +14 -14
- package/lib/types/client/web/CreeveyView/SideBar/SideBarHeader.d.ts +12 -13
- package/lib/types/client/web/CreeveyView/SideBar/SuiteLink.d.ts +33 -33
- package/lib/types/client/web/CreeveyView/SideBar/TestLink.d.ts +7 -8
- package/lib/types/client/web/CreeveyView/SideBar/TestStatusIcon.d.ts +10 -10
- package/lib/types/client/web/CreeveyView/SideBar/TestsStatus.d.ts +9 -9
- package/lib/types/client/web/CreeveyView/SideBar/Toggle.d.ts +6 -6
- package/lib/types/client/web/CreeveyView/SideBar/index.d.ts +1 -1
- package/lib/types/client/web/KeyboardEventsContext.d.ts +13 -13
- package/lib/types/client/web/index.d.ts +4 -4
- package/lib/types/creevey.d.ts +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/server/config.d.ts +4 -4
- package/lib/types/server/docker.d.ts +7 -7
- package/lib/types/server/extract.d.ts +2 -2
- package/lib/types/server/index.d.ts +2 -2
- package/lib/types/server/loaders/babel/creevey-plugin.d.ts +1 -1
- package/lib/types/server/loaders/babel/helpers.d.ts +19 -19
- package/lib/types/server/loaders/babel/register.d.ts +5 -5
- package/lib/types/server/loaders/hooks/mdx.d.ts +1 -1
- package/lib/types/server/loaders/hooks/svelte.d.ts +1 -1
- package/lib/types/server/loaders/webpack/compile.d.ts +2 -2
- package/lib/types/server/loaders/webpack/creevey-loader.d.ts +4 -2
- package/lib/types/server/loaders/webpack/dummy-hmr.d.ts +10 -10
- package/lib/types/server/loaders/webpack/mdx-loader.d.ts +6 -6
- package/lib/types/server/loaders/webpack/start.d.ts +1 -1
- package/lib/types/server/logger.d.ts +10 -6
- package/lib/types/server/master/api.d.ts +7 -7
- package/lib/types/server/master/index.d.ts +3 -3
- package/lib/types/server/master/master.d.ts +7 -7
- package/lib/types/server/master/pool.d.ts +31 -31
- package/lib/types/server/master/runner.d.ts +26 -26
- package/lib/types/server/master/server.d.ts +2 -2
- package/lib/types/server/messages.d.ts +27 -27
- package/lib/types/server/selenium/browser.d.ts +17 -17
- package/lib/types/server/selenium/index.d.ts +2 -2
- package/lib/types/server/selenium/selenoid.d.ts +3 -3
- package/lib/types/server/stories.d.ts +8 -8
- package/lib/types/server/storybook/entry.d.ts +18 -18
- package/lib/types/server/storybook/helpers.d.ts +24 -24
- package/lib/types/server/storybook/providers/browser.d.ts +4 -4
- package/lib/types/server/storybook/providers/hybrid.d.ts +4 -4
- package/lib/types/server/storybook/providers/nodejs.d.ts +9 -9
- package/lib/types/server/testsFiles/parser.d.ts +12 -12
- package/lib/types/server/testsFiles/register.d.ts +2 -2
- package/lib/types/server/update.d.ts +2 -2
- package/lib/types/server/utils.d.ts +20 -20
- package/lib/types/server/worker/chai-image.d.ts +6 -6
- package/lib/types/server/worker/helpers.d.ts +8 -8
- package/lib/types/server/worker/index.d.ts +1 -1
- package/lib/types/server/worker/reporter.d.ts +8 -8
- package/lib/types/server/worker/worker.d.ts +4 -4
- package/lib/types/{shared.d.ts → shared/index.d.ts} +7 -16
- package/lib/types/shared/serializeRegExp.d.ts +9 -0
- package/lib/types/types.d.ts +490 -489
- package/package.json +115 -102
- package/preset.js +9 -9
- package/types/babel__register.d.ts +1 -1
- package/types/chai.d.ts +12 -12
- package/types/event-source-polyfill.d.ts +6 -6
- package/types/mdx.d.ts +3 -2
- package/types/mocha.d.ts +20 -20
- package/types/png.d.ts +4 -4
- package/lib/cjs/client/web/1.js +0 -13
- package/lib/cjs/client/web/2.js +0 -1
- package/lib/cjs/shared.js +0 -124
- package/lib/esm/shared.js +0 -93
- package/storybook-static/stories.json +0 -21
@@ -57,11 +57,9 @@ function getPropertyPath(path, name) {
|
|
57
57
|
|
58
58
|
function getDeclaratorPath(path) {
|
59
59
|
if (path !== null && path !== void 0 && path.isIdentifier()) {
|
60
|
-
var _path$scope$getBindin;
|
61
|
-
|
62
60
|
const {
|
63
61
|
path: bindingPath
|
64
|
-
} =
|
62
|
+
} = path.scope.getBinding(path.node.name) ?? {};
|
65
63
|
if (bindingPath !== null && bindingPath !== void 0 && bindingPath.isVariableDeclarator() || bindingPath !== null && bindingPath !== void 0 && bindingPath.isFunctionDeclaration() || bindingPath !== null && bindingPath !== void 0 && bindingPath.isImportSpecifier()) return bindingPath;
|
66
64
|
}
|
67
65
|
}
|
@@ -100,7 +98,7 @@ function removeAllPropsExcept(path, propNames) {
|
|
100
98
|
}
|
101
99
|
|
102
100
|
function removeAllPropAssignsExcept(propAssigns, propNames) {
|
103
|
-
for (const [assignPath, props] of propAssigns
|
101
|
+
for (const [assignPath, props] of propAssigns ?? []) {
|
104
102
|
const restNames = props.reduce((subPropNames, prop) => {
|
105
103
|
const propName = subPropNames.find(names => {
|
106
104
|
const name = Array.isArray(names) ? names[0] : names;
|
@@ -138,13 +136,11 @@ function getAssignmentPathWithProps(refPath) {
|
|
138
136
|
function getPropertyAssignmentPaths(idPaths) {
|
139
137
|
const assignPaths = new Map();
|
140
138
|
idPaths.forEach(idPath => {
|
141
|
-
var _idPath$scope$getBind
|
139
|
+
var _idPath$scope$getBind;
|
142
140
|
|
143
|
-
const referencePaths = (_idPath$scope$getBind =
|
141
|
+
const referencePaths = ((_idPath$scope$getBind = idPath.scope.getBinding(idPath.node.name)) === null || _idPath$scope$getBind === void 0 ? void 0 : _idPath$scope$getBind.referencePaths) ?? [];
|
144
142
|
referencePaths.forEach(refPath => {
|
145
|
-
|
146
|
-
|
147
|
-
const [assignmentPath, props] = (_getAssignmentPathWit = getAssignmentPathWithProps(refPath)) !== null && _getAssignmentPathWit !== void 0 ? _getAssignmentPathWit : [];
|
143
|
+
const [assignmentPath, props] = getAssignmentPathWithProps(refPath) ?? [];
|
148
144
|
if (assignmentPath && props) assignPaths.set(assignmentPath, props);
|
149
145
|
});
|
150
146
|
});
|
@@ -331,12 +327,12 @@ export const previewVisitor = {
|
|
331
327
|
};
|
332
328
|
export const mdxVisitor = {
|
333
329
|
FunctionDeclaration(functionPath) {
|
334
|
-
var _functionPath$get$nod, _rootPath$scope$getBi
|
330
|
+
var _functionPath$get$nod, _rootPath$scope$getBi;
|
335
331
|
|
336
332
|
const functionName = (_functionPath$get$nod = functionPath.get('id').node) === null || _functionPath$get$nod === void 0 ? void 0 : _functionPath$get$nod.name;
|
337
333
|
if (functionName != 'MDXContent') return;
|
338
334
|
const rootPath = findRootPath(functionPath);
|
339
|
-
const refs = (
|
335
|
+
const refs = (rootPath === null || rootPath === void 0 ? void 0 : (_rootPath$scope$getBi = rootPath.scope.getBinding(functionName)) === null || _rootPath$scope$getBi === void 0 ? void 0 : _rootPath$scope$getBi.referencePaths) ?? [];
|
340
336
|
refs.forEach(refPath => {
|
341
337
|
var _findRootPath;
|
342
338
|
|
@@ -361,10 +357,8 @@ export const storyVisitor = {
|
|
361
357
|
},
|
362
358
|
|
363
359
|
ExportAllDeclaration(allPath) {
|
364
|
-
var _this$reexportedStori;
|
365
|
-
|
366
360
|
const request = allPath.get('source').node.value;
|
367
|
-
this.reexportedStories.set(this.resourcePath, (
|
361
|
+
this.reexportedStories.set(this.resourcePath, (this.reexportedStories.get(this.resourcePath) ?? new Set()).add(request));
|
368
362
|
this.visitedTopPaths.add(allPath);
|
369
363
|
},
|
370
364
|
|
@@ -398,9 +392,9 @@ export const storyVisitor = {
|
|
398
392
|
const storiesIdPath = (_rootPath$get$find = rootPath.get('declarations').find(decl => decl.get('init') == rootCallPath)) === null || _rootPath$get$find === void 0 ? void 0 : _rootPath$get$find.get('id');
|
399
393
|
|
400
394
|
if (storiesIdPath !== null && storiesIdPath !== void 0 && storiesIdPath.isIdentifier()) {
|
401
|
-
var _storiesIdPath$scope
|
395
|
+
var _storiesIdPath$scope$;
|
402
396
|
|
403
|
-
((
|
397
|
+
(((_storiesIdPath$scope$ = storiesIdPath.scope.getBinding(storiesIdPath.node.name)) === null || _storiesIdPath$scope$ === void 0 ? void 0 : _storiesIdPath$scope$.referencePaths) ?? []).forEach(cleanUpStoriesOfCallChain);
|
404
398
|
}
|
405
399
|
}
|
406
400
|
|
@@ -409,11 +403,9 @@ export const storyVisitor = {
|
|
409
403
|
|
410
404
|
Identifier(identifierPath) {
|
411
405
|
if (isExports(identifierPath)) {
|
412
|
-
var _getAssignmentPathWit2;
|
413
|
-
|
414
406
|
const rootPath = findRootPath(identifierPath);
|
415
407
|
if (rootPath) this.visitedTopPaths.add(rootPath);
|
416
|
-
const [assignmentPath, props] =
|
408
|
+
const [assignmentPath, props] = getAssignmentPathWithProps(identifierPath) ?? [];
|
417
409
|
|
418
410
|
if (assignmentPath && props) {
|
419
411
|
if (props.length == 1 && props[0] != 'default') {
|
@@ -433,11 +425,9 @@ export const storyVisitor = {
|
|
433
425
|
}
|
434
426
|
|
435
427
|
if (isModuleExports(identifierPath)) {
|
436
|
-
var _getAssignmentPathWit3;
|
437
|
-
|
438
428
|
const rootPath = findRootPath(identifierPath);
|
439
429
|
if (rootPath) this.visitedTopPaths.add(rootPath);
|
440
|
-
const [assignmentPath, props] =
|
430
|
+
const [assignmentPath, props] = getAssignmentPathWithProps(identifierPath) ?? [];
|
441
431
|
|
442
432
|
if (assignmentPath && props) {
|
443
433
|
if (props.length == 1 && props[0] == 'exports') {
|
@@ -38,12 +38,10 @@ function getRequireContext(rootDir) {
|
|
38
38
|
fs.readdirSync(dirPath, {
|
39
39
|
withFileTypes: true
|
40
40
|
}).forEach(dirent => {
|
41
|
-
var _filter$test;
|
42
|
-
|
43
41
|
const filename = dirent.name;
|
44
42
|
const filePath = join(dirPath, filename);
|
45
43
|
if (dirent.isDirectory() && deep) return traverse(filePath);
|
46
|
-
if (dirent.isFile() && ((
|
44
|
+
if (dirent.isFile() && ((filter === null || filter === void 0 ? void 0 : filter.test(`./${relative(contextPath, filePath)}`)) ?? true)) return ids.push(filePath);
|
47
45
|
});
|
48
46
|
};
|
49
47
|
|
@@ -11,6 +11,8 @@ let isInitiated = false;
|
|
11
11
|
let dumpStats = noop;
|
12
12
|
|
13
13
|
function handleWebpackBuild(error, stats) {
|
14
|
+
var _stats$toJson$warning;
|
15
|
+
|
14
16
|
dumpStats(stats);
|
15
17
|
|
16
18
|
if (error || !stats || stats.hasErrors()) {
|
@@ -21,17 +23,16 @@ function handleWebpackBuild(error, stats) {
|
|
21
23
|
if (error) return console.error(error.message);
|
22
24
|
|
23
25
|
if (stats && (stats.hasErrors() || stats.hasWarnings())) {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
warnings.forEach(e => console.error(e));
|
26
|
+
var _statsJson$errors, _statsJson$warnings;
|
27
|
+
|
28
|
+
const statsJson = stats.toJson();
|
29
|
+
(_statsJson$errors = statsJson.errors) === null || _statsJson$errors === void 0 ? void 0 : _statsJson$errors.forEach(e => console.error(e));
|
30
|
+
(_statsJson$warnings = statsJson.warnings) === null || _statsJson$warnings === void 0 ? void 0 : _statsJson$warnings.forEach(e => console.error(e));
|
30
31
|
return;
|
31
32
|
}
|
32
33
|
}
|
33
34
|
|
34
|
-
stats.toJson().warnings.forEach(e => console.warn(e));
|
35
|
+
stats === null || stats === void 0 ? void 0 : (_stats$toJson$warning = stats.toJson().warnings) === null || _stats$toJson$warning === void 0 ? void 0 : _stats$toJson$warning.forEach(e => console.warn(e));
|
35
36
|
|
36
37
|
if (!isInitiated) {
|
37
38
|
isInitiated = true;
|
@@ -57,39 +58,39 @@ async function applyMdxLoader(config, areAddonsRemoved, loader) {
|
|
57
58
|
const mdRegexps = [/\.md$/, /\.mdx$/];
|
58
59
|
|
59
60
|
if (areAddonsRemoved) {
|
60
|
-
var _config$module2;
|
61
|
+
var _config$module2, _config$module2$rules;
|
61
62
|
|
62
63
|
mdRegexps.forEach(test => {
|
63
|
-
var _config$module;
|
64
|
+
var _config$module, _config$module$rules;
|
64
65
|
|
65
|
-
return (_config$module = config.module) === null || _config$module === void 0 ? void 0 : _config$module.rules.unshift({
|
66
|
+
return (_config$module = config.module) === null || _config$module === void 0 ? void 0 : (_config$module$rules = _config$module.rules) === null || _config$module$rules === void 0 ? void 0 : _config$module$rules.unshift({
|
66
67
|
test,
|
67
68
|
exclude: /(stories|story)\.mdx$/,
|
68
69
|
use: require.resolve('null-loader')
|
69
70
|
});
|
70
71
|
});
|
71
|
-
(_config$module2 = config.module) === null || _config$module2 === void 0 ? void 0 : _config$module2.rules.unshift({
|
72
|
+
(_config$module2 = config.module) === null || _config$module2 === void 0 ? void 0 : (_config$module2$rules = _config$module2.rules) === null || _config$module2$rules === void 0 ? void 0 : _config$module2$rules.unshift({
|
72
73
|
test: /(stories|story)\.mdx$/,
|
73
74
|
use: mdxLoaders
|
74
75
|
});
|
75
76
|
} else {
|
76
|
-
var _config$module3, _config$module4, _config$
|
77
|
+
var _config$module3, _config$module3$rules, _config$module4, _config$module4$rules, _config$module5, _config$module5$rules;
|
77
78
|
|
78
79
|
// NOTE Exclude addons' entry points
|
79
80
|
config.entry = Array.isArray(config.entry) ? config.entry.filter(entry => !/@storybook(\/|\\)addon/.test(entry)) : config.entry;
|
80
|
-
(_config$module3 = config.module) === null || _config$module3 === void 0 ? void 0 : _config$module3.rules.filter(rule => mdRegexps.some(test => {
|
81
|
+
(_config$module3 = config.module) === null || _config$module3 === void 0 ? void 0 : (_config$module3$rules = _config$module3.rules) === null || _config$module3$rules === void 0 ? void 0 : _config$module3$rules.flatMap(rule => typeof rule == 'object' && 'test' in rule ? rule : []).filter(rule => mdRegexps.some(test => {
|
81
82
|
var _rule$test;
|
82
83
|
|
83
84
|
return ((_rule$test = rule.test) === null || _rule$test === void 0 ? void 0 : _rule$test.toString()) == test.toString();
|
84
85
|
})).forEach(rule => rule.use = require.resolve('null-loader'));
|
85
|
-
(_config$module4 = config.module) === null || _config$module4 === void 0 ? void 0 : _config$module4.rules.filter(rule => mdxRegexps.some(test => {
|
86
|
+
(_config$module4 = config.module) === null || _config$module4 === void 0 ? void 0 : (_config$module4$rules = _config$module4.rules) === null || _config$module4$rules === void 0 ? void 0 : _config$module4$rules.flatMap(rule => typeof rule == 'object' && 'test' in rule ? rule : []).filter(rule => mdxRegexps.some(test => {
|
86
87
|
var _rule$test2;
|
87
88
|
|
88
89
|
return ((_rule$test2 = rule.test) === null || _rule$test2 === void 0 ? void 0 : _rule$test2.toString()) == test.toString();
|
89
90
|
})).forEach(rule => rule.use = mdxLoaders); // NOTE Exclude source-loader
|
90
91
|
|
91
92
|
config.module = { ...config.module,
|
92
|
-
rules: (_config$module$
|
93
|
+
rules: ((_config$module5 = config.module) === null || _config$module5 === void 0 ? void 0 : (_config$module5$rules = _config$module5.rules) === null || _config$module5$rules === void 0 ? void 0 : _config$module5$rules.flatMap(rule => typeof rule == 'object' && 'test' in rule ? rule : []).filter(rule => !(typeof rule.loader == 'string' && /@storybook(\/|\\)source-loader/.test(rule.loader)))) ?? []
|
93
94
|
};
|
94
95
|
}
|
95
96
|
}
|
@@ -182,7 +183,7 @@ export default async function compile(config, {
|
|
182
183
|
debug,
|
183
184
|
ui
|
184
185
|
}) {
|
185
|
-
var _storybookWebpackConf, _storybookWebpackConf2, _storybookWebpackConf3, _extensions$map, _storybookWebpackConf4, _storybookWebpackConf5
|
186
|
+
var _storybookWebpackConf, _storybookWebpackConf2, _storybookWebpackConf3, _extensions$map, _storybookWebpackConf4, _storybookWebpackConf5;
|
186
187
|
|
187
188
|
const storybookFramework = getStorybookFramework();
|
188
189
|
const outputDir = path.join(getCreeveyCache(), 'storybook');
|
@@ -207,7 +208,7 @@ export default async function compile(config, {
|
|
207
208
|
const areAddonsRemoved = await removeAddons();
|
208
209
|
const getWebpackConfig = isStorybookVersionLessThan(6, 2) ? getWebpackConfigForStorybook_pre6_2 : getWebpackConfigForStorybook_6_2;
|
209
210
|
const storybookWebpackConfig = await getWebpackConfig(storybookFramework, config.storybookDir, outputDir);
|
210
|
-
const extensions = (_storybookWebpackConf =
|
211
|
+
const extensions = ((_storybookWebpackConf = storybookWebpackConfig.resolve) === null || _storybookWebpackConf === void 0 ? void 0 : _storybookWebpackConf.extensions) ?? fallbackExtensions;
|
211
212
|
delete storybookWebpackConfig.optimization;
|
212
213
|
storybookWebpackConfig.devtool = false;
|
213
214
|
storybookWebpackConfig.performance = false;
|
@@ -222,18 +223,21 @@ export default async function compile(config, {
|
|
222
223
|
|
223
224
|
if (hasDocsAddon()) await applyMdxLoader(storybookWebpackConfig, areAddonsRemoved, creeveyLoader); // NOTE Add creevey-loader to cut off all unnecessary code except stories meta and tests
|
224
225
|
|
225
|
-
(
|
226
|
+
(_storybookWebpackConf2 = storybookWebpackConfig.module) === null || _storybookWebpackConf2 === void 0 ? void 0 : (_storybookWebpackConf3 = _storybookWebpackConf2.rules) === null || _storybookWebpackConf3 === void 0 ? void 0 : _storybookWebpackConf3.unshift({
|
226
227
|
enforce: 'pre',
|
227
228
|
test: new RegExp(`\\.(${(_extensions$map = extensions.map(x => x.slice(1))) === null || _extensions$map === void 0 ? void 0 : _extensions$map.join('|')})$`),
|
228
229
|
exclude: /node_modules/,
|
229
230
|
use: creeveyLoader
|
230
231
|
});
|
231
|
-
const aliases = (_storybookWebpackConf4 =
|
232
|
+
const aliases = ((_storybookWebpackConf4 = storybookWebpackConfig.resolve) === null || _storybookWebpackConf4 === void 0 ? void 0 : _storybookWebpackConf4.alias) ?? {};
|
232
233
|
const excluded = ['@storybook/addons', '@storybook/api', '@storybook/channel-postmessage', '@storybook/channels', '@storybook/client-api', '@storybook/client-logger', '@storybook/components', '@storybook/core-events', '@storybook/router', '@storybook/semver', '@storybook/theming']; // NOTE Exclude from bundle all modules from node_modules
|
233
234
|
|
234
|
-
storybookWebpackConfig.externals = [...
|
235
|
-
|
236
|
-
|
235
|
+
storybookWebpackConfig.externals = [...(Array.isArray(aliases) ? aliases.map(({
|
236
|
+
name,
|
237
|
+
alias
|
238
|
+
}) => [name, alias]) : Object.entries(aliases)).filter(([alias]) => excluded.includes(alias)).flatMap(([, aliasPath]) => aliasPath == false ? [] : (Array.isArray(aliasPath) ? aliasPath : [aliasPath]).map(x => ({
|
239
|
+
[x]: `commonjs ${x}`
|
240
|
+
}))), // NOTE Replace `@storybook/${framework}` to ../../storybook.ts
|
237
241
|
{
|
238
242
|
[`@storybook/${storybookFramework}`]: `commonjs ${require.resolve('../../storybook/entry')}`
|
239
243
|
}, nodeExternals({
|
@@ -247,11 +251,14 @@ export default async function compile(config, {
|
|
247
251
|
})]; // NOTE Exclude some plugins
|
248
252
|
|
249
253
|
const excludedPlugins = ['DocgenPlugin', 'ForkTsCheckerWebpackPlugin'];
|
250
|
-
storybookWebpackConfig.plugins = (
|
254
|
+
storybookWebpackConfig.plugins = (_storybookWebpackConf5 = storybookWebpackConfig.plugins) === null || _storybookWebpackConf5 === void 0 ? void 0 : _storybookWebpackConf5.filter(plugin => !excludedPlugins.includes(plugin.constructor.name));
|
251
255
|
const storybookWebpackCompiler = webpack(storybookWebpackConfig);
|
252
256
|
|
253
257
|
if (debug) {
|
254
|
-
dumpStats = stats =>
|
258
|
+
dumpStats = stats => {
|
259
|
+
if (!stats) return;
|
260
|
+
writeFile(path.join(config.reportDir, 'stats.json'), JSON.stringify(stats.toJson(), null, 2), noop);
|
261
|
+
};
|
255
262
|
}
|
256
263
|
|
257
264
|
if (ui) {
|
@@ -93,12 +93,17 @@ let resourcePath = '';
|
|
93
93
|
const entries = new Set();
|
94
94
|
const stories = new Set();
|
95
95
|
const reexportedStories = new Map();
|
96
|
-
|
96
|
+
|
97
|
+
const isTest = () => process.env.__CREEVEY_ENV__ == 'test';
|
98
|
+
|
97
99
|
const defaultOptions = {
|
98
|
-
debug
|
100
|
+
get debug() {
|
101
|
+
return isTest();
|
102
|
+
},
|
103
|
+
|
99
104
|
storybookDir: process.cwd()
|
100
105
|
};
|
101
|
-
export default function (source) {
|
106
|
+
export default function loader(source) {
|
102
107
|
const options = this ? getOptions(this) || defaultOptions : defaultOptions;
|
103
108
|
validate(schema, options, {
|
104
109
|
name: 'Creevey Stories Loader'
|
@@ -125,7 +130,7 @@ export default function (source) {
|
|
125
130
|
}
|
126
131
|
}
|
127
132
|
|
128
|
-
if (isTest && !Number.isNaN(Number(process.env.CREEVEY_LOADER_FILE_TYPE))) {
|
133
|
+
if (isTest() && !Number.isNaN(Number(process.env.CREEVEY_LOADER_FILE_TYPE))) {
|
129
134
|
fileType = Number(process.env.CREEVEY_LOADER_FILE_TYPE);
|
130
135
|
}
|
131
136
|
|
@@ -1,15 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
global.__CREEVEY_HMR_DATA__ = (_global$__CREEVEY_HMR = global.__CREEVEY_HMR_DATA__) !== null && _global$__CREEVEY_HMR !== void 0 ? _global$__CREEVEY_HMR : {};
|
1
|
+
global.__CREEVEY_HMR_DATA__ = global.__CREEVEY_HMR_DATA__ ?? {};
|
4
2
|
Object.entries(__webpack_require__.m).forEach(([key, moduleFn]) => {
|
5
3
|
__webpack_require__.m[key] = new Proxy(moduleFn, {
|
6
4
|
apply(target, thisArg, args) {
|
7
|
-
var _global$__CREEVEY_HMR2;
|
8
|
-
|
9
5
|
const [module] = args;
|
10
6
|
const {
|
11
7
|
data
|
12
|
-
} = global.__CREEVEY_HMR_DATA__[module.i] =
|
8
|
+
} = global.__CREEVEY_HMR_DATA__[module.i] = global.__CREEVEY_HMR_DATA__[module.i] ?? {
|
13
9
|
data: {}
|
14
10
|
};
|
15
11
|
Object.assign(module, {
|
@@ -9,7 +9,7 @@ export function startWebpackCompiler() {
|
|
9
9
|
const webpackCompiler = cluster.fork();
|
10
10
|
webpackCompiler.on('message', message => {
|
11
11
|
if (!isWebpackMessage(message)) return;
|
12
|
-
Object.values(cluster.workers).filter(worker => worker != webpackCompiler).forEach(worker => worker === null || worker === void 0 ? void 0 : worker.send(message));
|
12
|
+
Object.values(cluster.workers ?? {}).filter(worker => worker != webpackCompiler).forEach(worker => worker === null || worker === void 0 ? void 0 : worker.send(message));
|
13
13
|
|
14
14
|
switch (message.type) {
|
15
15
|
case 'success':
|
@@ -105,9 +105,9 @@ export default async function (config, options, resolveApi) {
|
|
105
105
|
}
|
106
106
|
|
107
107
|
runner.once('stop', () => {
|
108
|
-
var
|
108
|
+
var _runner6;
|
109
109
|
|
110
|
-
const tests = Object.values((
|
110
|
+
const tests = Object.values(((_runner6 = runner) === null || _runner6 === void 0 ? void 0 : _runner6.status.tests) ?? {});
|
111
111
|
const isSuccess = tests.filter(isDefined).filter(({
|
112
112
|
skip
|
113
113
|
}) => !skip).every(({
|
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import cluster from 'cluster';
|
1
|
+
import cluster, { Worker as ClusterWorker } from 'cluster';
|
4
2
|
import { EventEmitter } from 'events';
|
5
3
|
import { isWorkerMessage } from '../../types';
|
6
4
|
import { sendTestMessage, sendShutdownMessage, subscribeOnWorker } from '../messages';
|
7
5
|
import { isShuttingDown } from '../utils';
|
8
6
|
const FORK_RETRIES = 5;
|
9
7
|
export default class Pool extends EventEmitter {
|
8
|
+
workers = [];
|
9
|
+
queue = [];
|
10
|
+
forcedStop = false;
|
11
|
+
|
10
12
|
get isRunning() {
|
11
13
|
return this.workers.length !== this.freeWorkers.length;
|
12
14
|
}
|
@@ -14,19 +16,6 @@ export default class Pool extends EventEmitter {
|
|
14
16
|
constructor(config, browser) {
|
15
17
|
super();
|
16
18
|
this.browser = browser;
|
17
|
-
|
18
|
-
_defineProperty(this, "maxRetries", void 0);
|
19
|
-
|
20
|
-
_defineProperty(this, "config", void 0);
|
21
|
-
|
22
|
-
_defineProperty(this, "workers", []);
|
23
|
-
|
24
|
-
_defineProperty(this, "queue", []);
|
25
|
-
|
26
|
-
_defineProperty(this, "forcedStop", false);
|
27
|
-
|
28
|
-
_defineProperty(this, "failFast", void 0);
|
29
|
-
|
30
19
|
this.failFast = config.failFast;
|
31
20
|
this.maxRetries = config.maxRetries;
|
32
21
|
this.config = config.browsers[browser];
|
@@ -36,7 +25,7 @@ export default class Pool extends EventEmitter {
|
|
36
25
|
const poolSize = this.config.limit || 1;
|
37
26
|
this.workers = (await Promise.all(Array.from({
|
38
27
|
length: poolSize
|
39
|
-
}).map(() => this.forkWorker()))).filter(workerOrError => workerOrError instanceof
|
28
|
+
}).map(() => this.forkWorker()))).filter(workerOrError => workerOrError instanceof ClusterWorker);
|
40
29
|
if (this.workers.length != poolSize) throw new Error(`Can't instantiate workers for ${this.browser} due many errors`);
|
41
30
|
this.workers.forEach(worker => this.exitHandler(worker));
|
42
31
|
}
|
@@ -134,7 +123,7 @@ export default class Pool extends EventEmitter {
|
|
134
123
|
worker.once('exit', async () => {
|
135
124
|
if (isShuttingDown.current) return;
|
136
125
|
const workerOrError = await this.forkWorker();
|
137
|
-
if (!(workerOrError instanceof
|
126
|
+
if (!(workerOrError instanceof ClusterWorker)) throw new Error(`Can't instantiate worker for ${this.browser} due many errors`);
|
138
127
|
this.exitHandler(workerOrError);
|
139
128
|
this.workers[this.workers.indexOf(worker)] = workerOrError;
|
140
129
|
this.process();
|
@@ -1,5 +1,3 @@
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
|
-
|
3
1
|
import path from 'path';
|
4
2
|
import { copyFile, mkdir } from 'fs';
|
5
3
|
import { promisify } from 'util';
|
@@ -9,63 +7,40 @@ import Pool from './pool';
|
|
9
7
|
const copyFileAsync = promisify(copyFile);
|
10
8
|
const mkdirAsync = promisify(mkdir);
|
11
9
|
export default class Runner extends EventEmitter {
|
10
|
+
pools = {};
|
11
|
+
tests = {};
|
12
|
+
|
12
13
|
get isRunning() {
|
13
14
|
return Object.values(this.pools).some(pool => pool.isRunning);
|
14
15
|
}
|
15
16
|
|
16
17
|
constructor(config) {
|
17
18
|
super();
|
19
|
+
this.failFast = config.failFast;
|
20
|
+
this.screenDir = config.screenDir;
|
21
|
+
this.reportDir = config.reportDir;
|
22
|
+
this.browsers = Object.keys(config.browsers);
|
23
|
+
this.browsers.map(browser => this.pools[browser] = new Pool(config, browser)).map(pool => pool.on('test', this.handlePoolMessage));
|
24
|
+
}
|
18
25
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
id,
|
34
|
-
status,
|
35
|
-
result
|
36
|
-
} = message;
|
37
|
-
const test = this.tests[id];
|
38
|
-
if (!test) return;
|
39
|
-
const {
|
40
|
-
browser,
|
41
|
-
testName,
|
42
|
-
storyPath,
|
43
|
-
storyId
|
44
|
-
} = test; // TODO Handle 'retrying' status
|
45
|
-
|
46
|
-
test.status = status == 'retrying' ? 'failed' : status;
|
47
|
-
|
48
|
-
if (!result) {
|
49
|
-
this.sendUpdate({
|
50
|
-
tests: {
|
51
|
-
[id]: {
|
52
|
-
id,
|
53
|
-
browser,
|
54
|
-
testName,
|
55
|
-
storyPath,
|
56
|
-
status: test.status,
|
57
|
-
storyId
|
58
|
-
}
|
59
|
-
}
|
60
|
-
});
|
61
|
-
return;
|
62
|
-
}
|
26
|
+
handlePoolMessage = message => {
|
27
|
+
const {
|
28
|
+
id,
|
29
|
+
status,
|
30
|
+
result
|
31
|
+
} = message;
|
32
|
+
const test = this.tests[id];
|
33
|
+
if (!test) return;
|
34
|
+
const {
|
35
|
+
browser,
|
36
|
+
testName,
|
37
|
+
storyPath,
|
38
|
+
storyId
|
39
|
+
} = test; // TODO Handle 'retrying' status
|
63
40
|
|
64
|
-
|
65
|
-
test.results = [];
|
66
|
-
}
|
41
|
+
test.status = status == 'retrying' ? 'failed' : status;
|
67
42
|
|
68
|
-
|
43
|
+
if (!result) {
|
69
44
|
this.sendUpdate({
|
70
45
|
tests: {
|
71
46
|
[id]: {
|
@@ -74,29 +49,41 @@ export default class Runner extends EventEmitter {
|
|
74
49
|
testName,
|
75
50
|
storyPath,
|
76
51
|
status: test.status,
|
77
|
-
results: [result],
|
78
52
|
storyId
|
79
53
|
}
|
80
54
|
}
|
81
55
|
});
|
82
|
-
|
83
|
-
}
|
56
|
+
return;
|
57
|
+
}
|
84
58
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
59
|
+
if (!test.results) {
|
60
|
+
test.results = [];
|
61
|
+
}
|
62
|
+
|
63
|
+
test.results.push(result);
|
64
|
+
this.sendUpdate({
|
65
|
+
tests: {
|
66
|
+
[id]: {
|
67
|
+
id,
|
68
|
+
browser,
|
69
|
+
testName,
|
70
|
+
storyPath,
|
71
|
+
status: test.status,
|
72
|
+
results: [result],
|
73
|
+
storyId
|
74
|
+
}
|
91
75
|
}
|
92
76
|
});
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
this.
|
97
|
-
|
98
|
-
|
99
|
-
|
77
|
+
if (this.failFast && status == 'failed') this.stop();
|
78
|
+
};
|
79
|
+
handlePoolStop = () => {
|
80
|
+
if (!this.isRunning) {
|
81
|
+
this.sendUpdate({
|
82
|
+
isRunning: false
|
83
|
+
});
|
84
|
+
this.emit('stop');
|
85
|
+
}
|
86
|
+
};
|
100
87
|
|
101
88
|
async init() {
|
102
89
|
await Promise.all(Object.values(this.pools).map(pool => pool.init()));
|
@@ -51,7 +51,7 @@ export default function server(reportDir, port, ui) {
|
|
51
51
|
type: 'update',
|
52
52
|
payload: deserializedStories
|
53
53
|
});
|
54
|
-
Object.values(cluster.workers).filter(isDefined).filter(worker => worker.isConnected()).forEach(worker => sendStoriesMessage(worker, {
|
54
|
+
Object.values(cluster.workers ?? {}).filter(isDefined).filter(worker => worker.isConnected()).forEach(worker => sendStoriesMessage(worker, {
|
55
55
|
type: 'update',
|
56
56
|
payload: deserializedStories
|
57
57
|
}));
|
@@ -66,7 +66,7 @@ export default function server(reportDir, port, ui) {
|
|
66
66
|
workerId,
|
67
67
|
options
|
68
68
|
} = ctx.request.body;
|
69
|
-
const worker = Object.values(cluster.workers).filter(isDefined).find(worker => worker.process.pid == workerId); // NOTE: Hypothetical case when someone send to us capture req and we don't have a worker with browser session for it
|
69
|
+
const worker = Object.values(cluster.workers ?? {}).filter(isDefined).find(worker => worker.process.pid == workerId); // NOTE: Hypothetical case when someone send to us capture req and we don't have a worker with browser session for it
|
70
70
|
|
71
71
|
if (!worker) return;
|
72
72
|
await new Promise(resolve => {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import cluster from 'cluster';
|
2
2
|
|
3
3
|
function emitMessage(message) {
|
4
|
-
var _process$send, _process
|
4
|
+
var _process$send, _process;
|
5
5
|
|
6
6
|
if (cluster.isWorker && !process.connected) return false;
|
7
|
-
return (_process$send = (_process
|
7
|
+
return ((_process$send = (_process = process).send) === null || _process$send === void 0 ? void 0 : _process$send.call(_process, message)) ?? // @ts-expect-error: wrong typings `process.emit` return boolean
|
8
8
|
process.emit('message', message);
|
9
9
|
}
|
10
10
|
|
@@ -158,9 +158,7 @@ export function subscribeOn(scope, handler) {
|
|
158
158
|
}
|
159
159
|
const workers = new Map();
|
160
160
|
export function subscribeOnWorker(worker, scope, handler) {
|
161
|
-
|
162
|
-
|
163
|
-
const workerHandlers = (_workers$get = workers.get(worker)) !== null && _workers$get !== void 0 ? _workers$get : createHandlers();
|
161
|
+
const workerHandlers = workers.get(worker) ?? createHandlers();
|
164
162
|
|
165
163
|
if (!workers.has(worker)) {
|
166
164
|
workers.set(worker, workerHandlers);
|