happo 6.10.0 → 6.10.2
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/dist/cli/cancelJob-DQ3TD7VC.js +10 -0
- package/dist/cli/{chunk-JJOM7NVS.js → chunk-2CCKQG4B.js} +2 -2
- package/dist/cli/{chunk-AJQL27KK.js → chunk-5GCRDC6E.js} +2 -2
- package/dist/cli/{chunk-V2ULNFYX.js → chunk-BJXCKTWI.js} +3 -3
- package/dist/cli/{chunk-WUYZIKHR.js → chunk-LGXU3JNM.js} +2 -2
- package/dist/cli/{chunk-JIRDD3RO.js → chunk-P4CGDKZS.js} +2 -2
- package/dist/cli/{chunk-KTUIEOPK.js → chunk-Z32R7CJB.js} +2 -2
- package/dist/cli/{chunk-KTUIEOPK.js.map → chunk-Z32R7CJB.js.map} +1 -1
- package/dist/cli/createAsyncComparison-P277GZ47.js +10 -0
- package/dist/cli/{createAsyncReport-QFCSVMAO.js → createAsyncReport-4XB6OU6P.js} +4 -4
- package/dist/cli/{createExtendsReportSnapRequest-X2DLPLP5.js → createExtendsReportSnapRequest-L2XBZPJ3.js} +4 -4
- package/dist/cli/{findBaselineReport-N4AUOVXP.js → findBaselineReport-K4JN4ZMB.js} +4 -4
- package/dist/cli/{getFlakes-M2LSXSTW.js → getFlakes-6GNOYD2U.js} +4 -4
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/main.js +24 -17
- package/dist/cli/main.js.map +2 -2
- package/dist/cli/package-UABOUH2S.js +7 -0
- package/dist/cli/parseOptions.d.ts +3 -0
- package/dist/cli/parseOptions.d.ts.map +1 -1
- package/dist/cli/{prepareSnapRequests-RINWFSWA.js → prepareSnapRequests-KMVRPKIT.js} +4 -4
- package/dist/cli/startJob-TUFOU2O5.js +10 -0
- package/dist/cli/{wrapper-YYNZLEMW.js → wrapper-XUOTVPDW.js} +7 -7
- package/dist/cypress/task.js +1 -1
- package/dist/cypress/task.js.map +1 -1
- package/dist/playwright/index.js +1 -1
- package/dist/playwright/index.js.map +1 -1
- package/dist/storybook/browser/register.d.ts.map +1 -1
- package/dist/storybook/browser/register.js +12 -10
- package/dist/storybook/browser/register.js.map +2 -2
- package/package.json +1 -1
- package/dist/cli/cancelJob-PHMDAIJB.js +0 -10
- package/dist/cli/createAsyncComparison-D525PJCA.js +0 -10
- package/dist/cli/package-3UUMFV7J.js +0 -7
- package/dist/cli/startJob-JAVHOIR6.js +0 -10
- /package/dist/cli/{cancelJob-PHMDAIJB.js.map → cancelJob-DQ3TD7VC.js.map} +0 -0
- /package/dist/cli/{chunk-JJOM7NVS.js.map → chunk-2CCKQG4B.js.map} +0 -0
- /package/dist/cli/{chunk-AJQL27KK.js.map → chunk-5GCRDC6E.js.map} +0 -0
- /package/dist/cli/{chunk-V2ULNFYX.js.map → chunk-BJXCKTWI.js.map} +0 -0
- /package/dist/cli/{chunk-WUYZIKHR.js.map → chunk-LGXU3JNM.js.map} +0 -0
- /package/dist/cli/{chunk-JIRDD3RO.js.map → chunk-P4CGDKZS.js.map} +0 -0
- /package/dist/cli/{createAsyncComparison-D525PJCA.js.map → createAsyncComparison-P277GZ47.js.map} +0 -0
- /package/dist/cli/{createAsyncReport-QFCSVMAO.js.map → createAsyncReport-4XB6OU6P.js.map} +0 -0
- /package/dist/cli/{createExtendsReportSnapRequest-X2DLPLP5.js.map → createExtendsReportSnapRequest-L2XBZPJ3.js.map} +0 -0
- /package/dist/cli/{findBaselineReport-N4AUOVXP.js.map → findBaselineReport-K4JN4ZMB.js.map} +0 -0
- /package/dist/cli/{getFlakes-M2LSXSTW.js.map → getFlakes-6GNOYD2U.js.map} +0 -0
- /package/dist/cli/{package-3UUMFV7J.js.map → package-UABOUH2S.js.map} +0 -0
- /package/dist/cli/{prepareSnapRequests-RINWFSWA.js.map → prepareSnapRequests-KMVRPKIT.js.map} +0 -0
- /package/dist/cli/{startJob-JAVHOIR6.js.map → startJob-TUFOU2O5.js.map} +0 -0
- /package/dist/cli/{wrapper-YYNZLEMW.js.map → wrapper-XUOTVPDW.js.map} +0 -0
|
@@ -127,6 +127,18 @@ async function getExamples() {
|
|
|
127
127
|
}
|
|
128
128
|
function filterExamples(all, initConfig) {
|
|
129
129
|
const { chunk, targetName, only } = initConfig;
|
|
130
|
+
if (globalThis.happoOnly) {
|
|
131
|
+
const happoOnly = globalThis.happoOnly;
|
|
132
|
+
all = all.filter((e) => happoOnly.some((item) => item.component === e.component));
|
|
133
|
+
}
|
|
134
|
+
if (globalThis.happoSkipped) {
|
|
135
|
+
const happoSkipped = globalThis.happoSkipped;
|
|
136
|
+
all = all.filter(
|
|
137
|
+
(e) => !happoSkipped.some(
|
|
138
|
+
(item) => item.component === e.component && (item.variant === void 0 || item.variant === e.variant)
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
130
142
|
if (chunk) {
|
|
131
143
|
const examplesPerChunk = Math.ceil(all.length / chunk.total);
|
|
132
144
|
const startIndex = chunk.index * examplesPerChunk;
|
|
@@ -248,16 +260,6 @@ globalThis.happo.nextExample = async () => {
|
|
|
248
260
|
let pausedAtStep;
|
|
249
261
|
let variant = rawVariant;
|
|
250
262
|
try {
|
|
251
|
-
if (globalThis.happoSkipped && globalThis.happoSkipped.some(
|
|
252
|
-
(item) => item.component === component && (item.variant === void 0 || item.variant === variant)
|
|
253
|
-
)) {
|
|
254
|
-
console.log(`Skipping ${component}, ${variant} since it is in the skip list`);
|
|
255
|
-
return { component, variant, skipped: true };
|
|
256
|
-
}
|
|
257
|
-
if (globalThis.happoOnly && !globalThis.happoOnly.some((item) => item.component === component)) {
|
|
258
|
-
console.log(`Skipping ${component}, ${variant} since it is not in the only list`);
|
|
259
|
-
return { component, variant, skipped: true };
|
|
260
|
-
}
|
|
261
263
|
const docsRootElement = document.getElementById("docs-root");
|
|
262
264
|
if (docsRootElement) {
|
|
263
265
|
docsRootElement.dataset.happoIgnore = "true";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/storybook/browser/register.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Channel } from 'storybook/internal/channels';\nimport type { StoryStore } from 'storybook/internal/preview-api';\n\nimport type {\n InitConfig,\n NextExampleResult,\n WindowHappo,\n} from '../../isomorphic/types.ts';\nimport type { OnlyItems, SkipItems } from '../isomorphic/types.ts';\nimport { SB_ROOT_ELEMENT_SELECTOR } from './constants.ts';\n\ninterface HappoTime {\n originalDateNow: typeof Date.now;\n originalSetTimeout: typeof setTimeout;\n}\n\ndeclare global {\n var happoTime: HappoTime | undefined;\n var happoSkipped: SkipItems | undefined;\n var happoOnly: OnlyItems | null | undefined;\n var __IS_HAPPO_RUN: boolean | undefined;\n var __STORYBOOK_CLIENT_API__:\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _storyStore: StoryStore<any>;\n }\n | undefined;\n var __STORYBOOK_PREVIEW__:\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n storyStoreValue: StoryStore<any>;\n }\n | undefined;\n var __STORYBOOK_ADDONS_CHANNEL__: Channel | undefined;\n}\n\nconst time = globalThis.happoTime || {\n originalDateNow: Date.now,\n originalSetTimeout: globalThis.setTimeout.bind(globalThis),\n};\n\nconst STORY_STORE_TIMEOUT = 10_000;\n\ntype HookFunction = ({\n rootElement,\n}: {\n rootElement: HTMLElement;\n}) => void | Promise<void>;\n\ninterface Example {\n component: string;\n variant: string;\n storyId: string;\n delay: number;\n waitForContent: string | undefined;\n waitFor: () => boolean;\n beforeScreenshot: HookFunction;\n afterScreenshot: HookFunction;\n targets: Array<string>;\n theme?: string;\n}\n\nlet renderTimeoutMs = 2000;\nlet examples: Array<Example>;\nlet currentIndex = 0;\nlet defaultDelay: number;\nlet themeSwitcher: (theme: string, channel: Channel) => Promise<void>;\nlet forcedHappoScreenshotSteps:\n | Array<{ stepLabel: string; done: boolean }>\n | undefined;\nlet shouldWaitForCompletedEvent = true;\n\nclass ForcedHappoScreenshot extends Error {\n type: string;\n step: string;\n\n constructor(stepLabel: string) {\n super(`Forced screenshot with label \"${stepLabel}\"`);\n this.name = 'ForcedHappoScreenshot';\n this.type = 'ForcedHappoScreenshot';\n this.step = stepLabel;\n }\n}\n\nasync function waitForWaitFor(\n waitFor: () => boolean,\n start = time.originalDateNow(),\n): Promise<void> {\n const duration = time.originalDateNow() - start;\n if (!waitFor() && duration < renderTimeoutMs) {\n return new Promise((resolve) =>\n time.originalSetTimeout(() => resolve(waitForWaitFor(waitFor, start)), 50),\n );\n }\n\n return;\n}\n\n/**\n * Type safe function to check if a value is defined\n *\n * @example\n * const filtered = values.filter(isDefined);\n */\nfunction isDefined<T>(value: T): value is NonNullable<T> {\n if (value === undefined) {\n return false;\n }\n if (value === null) {\n return false;\n }\n return true;\n}\n\nasync function getStoryStore(startTime = time.originalDateNow()) {\n const duration = time.originalDateNow() - startTime;\n if (duration >= STORY_STORE_TIMEOUT) {\n throw new Error(\n `Timeout: Could not find Storybook Client API after ${STORY_STORE_TIMEOUT}ms`,\n );\n }\n\n const { __STORYBOOK_CLIENT_API__: clientApi, __STORYBOOK_PREVIEW__: preview } =\n globalThis;\n\n if (clientApi && clientApi._storyStore) {\n return clientApi._storyStore;\n }\n if (preview && preview.storyStoreValue) {\n return preview.storyStoreValue;\n }\n\n // Wait 100ms and try again\n await new Promise((resolve) => time.originalSetTimeout(resolve, 100));\n return getStoryStore(startTime);\n}\n\nasync function getExamples(): Promise<Array<Example>> {\n const storyStore = await getStoryStore();\n\n if (!storyStore) {\n throw new Error('Could not get Storybook story store');\n }\n\n if (!storyStore.extract) {\n throw new Error('Missing Storybook Client API');\n }\n\n if (storyStore.cacheAllCSFFiles) {\n await storyStore.cacheAllCSFFiles();\n }\n\n return Object.values(storyStore.extract())\n .map(({ id, kind, story, parameters }) => {\n if (parameters.happo === false) {\n return;\n }\n let delay = defaultDelay;\n let waitForContent;\n let waitFor;\n let beforeScreenshot;\n let afterScreenshot;\n let targets;\n let themes;\n if (typeof parameters.happo === 'object' && parameters.happo !== null) {\n delay = parameters.happo.delay || defaultDelay;\n waitForContent = parameters.happo.waitForContent;\n waitFor = parameters.happo.waitFor;\n beforeScreenshot = parameters.happo.beforeScreenshot;\n afterScreenshot = parameters.happo.afterScreenshot;\n targets = parameters.happo.targets;\n themes = parameters.happo.themes;\n }\n return {\n component: kind,\n variant: story,\n storyId: id,\n delay,\n waitForContent,\n waitFor,\n beforeScreenshot,\n afterScreenshot,\n targets,\n themes,\n };\n })\n .filter(isDefined)\n .reduce<Array<Example>>((result, { themes, ...rest }) => {\n if (themes) {\n for (const theme of themes) {\n result.push({\n ...rest,\n variant: `${rest.variant} [${theme}]`,\n theme,\n });\n }\n } else {\n result.push(rest);\n }\n\n return result;\n }, [])\n .toSorted((a, b) => {\n const aCompare = `${a.component}-${a.theme}-${a.storyId}`;\n const bCompare = `${b.component}-${b.theme}-${b.storyId}`;\n if (aCompare === bCompare) {\n return 0;\n }\n return aCompare < bCompare ? -1 : 1;\n });\n}\n\nfunction filterExamples(\n all: Array<Example>,\n initConfig: InitConfig,\n): Array<Example> {\n const { chunk, targetName, only } = initConfig;\n\n if (chunk) {\n const examplesPerChunk = Math.ceil(all.length / chunk.total);\n const startIndex = chunk.index * examplesPerChunk;\n const endIndex = startIndex + examplesPerChunk;\n all = all.slice(startIndex, endIndex);\n }\n\n if (targetName) {\n all = all.filter((e) => {\n if (!e.targets || !Array.isArray(e.targets)) {\n // This story hasn't been filtered for specific targets\n return true;\n }\n\n return e.targets.includes(targetName);\n });\n }\n\n if (only) {\n all = all.filter(\n (e) => e.component === only.component && e.variant === only.variant,\n );\n }\n\n return all;\n}\n\nglobalThis.happo = globalThis.happo || ({} as WindowHappo);\n\nglobalThis.happo.init = async (config: InitConfig) => {\n examples = filterExamples(await getExamples(), config);\n};\n\ninterface Story {\n kind: string;\n story: string;\n storyId: string;\n}\n\nfunction renderStory(\n story: Story,\n { force = false } = {},\n): Promise<{ pausedAtStep?: { stepLabel: string; done: boolean } }> {\n const channel = globalThis.__STORYBOOK_ADDONS_CHANNEL__;\n\n if (!channel) {\n throw new Error('Missing Storybook Addons Channel');\n }\n\n let isPlaying = false;\n let loadingCount = 0;\n\n return new Promise((resolve) => {\n const timeout = time.originalSetTimeout(resolve, renderTimeoutMs);\n function handleRenderPhaseChanged(ev: { storyId: string; newPhase: string }) {\n if (!channel) {\n throw new Error('Missing Storybook Addons Channel');\n }\n\n if (ev.storyId !== story.storyId) {\n console.log(\n `Skipping render phase event (${ev.newPhase}) because story IDs don't match. Current storyId: ${story.storyId}, event storyId: ${ev.storyId}`,\n );\n return;\n }\n\n if (ev.newPhase === 'loading') {\n loadingCount++;\n }\n\n if (ev.newPhase === 'finished' || ev.newPhase === 'aborted') {\n loadingCount--;\n }\n\n if (ev.newPhase === 'finished') {\n if (loadingCount > 0) {\n console.log(\n `Skipping finished event because loadingCount is ${loadingCount} for story ${story.storyId}`,\n );\n return;\n }\n\n channel.off('storyRenderPhaseChanged', handleRenderPhaseChanged);\n clearTimeout(timeout);\n\n if (isPlaying && forcedHappoScreenshotSteps) {\n const pausedAtStep = forcedHappoScreenshotSteps.at(-1);\n\n if (pausedAtStep && !pausedAtStep.done) {\n return resolve({ pausedAtStep });\n }\n }\n\n return resolve({});\n }\n\n if (ev.newPhase === 'playing') {\n isPlaying = true;\n }\n }\n\n if (shouldWaitForCompletedEvent) {\n channel.on('storyRenderPhaseChanged', handleRenderPhaseChanged);\n }\n\n if (force) {\n channel.emit('forceRemount', story);\n } else {\n channel.emit('setCurrentStory', story);\n }\n\n if (!shouldWaitForCompletedEvent) {\n time.originalSetTimeout(() => {\n clearTimeout(timeout);\n resolve({});\n }, 0);\n }\n });\n}\n\nfunction assertHTMLElement(element: Element | null): asserts element is HTMLElement {\n if (element === null) {\n throw new Error('element cannot be null');\n }\n if (!(element instanceof HTMLElement)) {\n throw new TypeError('element must be an HTMLElement');\n }\n}\n\nglobalThis.happo.nextExample = async (): Promise<NextExampleResult | undefined> => {\n if (!examples) {\n throw new Error(\n 'Missing examples. Make sure to call the init function before calling nextExample.',\n );\n }\n\n if (currentIndex >= examples.length) {\n return;\n }\n\n const example = examples[currentIndex];\n if (!example) {\n throw new Error(`Missing example at index ${currentIndex}`);\n }\n\n const {\n component,\n variant: rawVariant,\n storyId,\n delay,\n waitForContent,\n waitFor,\n beforeScreenshot,\n theme,\n } = example;\n\n let pausedAtStep;\n let variant = rawVariant;\n\n try {\n if (\n globalThis.happoSkipped &&\n globalThis.happoSkipped.some(\n (item) => item.component === component && (item.variant === undefined || item.variant === variant),\n )\n ) {\n console.log(`Skipping ${component}, ${variant} since it is in the skip list`);\n return { component, variant, skipped: true };\n }\n\n if (\n globalThis.happoOnly &&\n !globalThis.happoOnly.some((item) => item.component === component)\n ) {\n console.log(`Skipping ${component}, ${variant} since it is not in the only list`);\n return { component, variant, skipped: true };\n }\n\n const docsRootElement = document.getElementById('docs-root');\n if (docsRootElement) {\n docsRootElement.dataset.happoIgnore = 'true';\n }\n\n const rootElement = document.querySelector(SB_ROOT_ELEMENT_SELECTOR);\n assertHTMLElement(rootElement);\n rootElement.dataset.happoIgnore = 'true';\n\n const { afterScreenshot } = examples[currentIndex - 1] || {};\n if (afterScreenshot && typeof afterScreenshot === 'function') {\n try {\n await afterScreenshot({ rootElement });\n } catch (e) {\n console.error('Failed to invoke afterScreenshot hook', e);\n }\n }\n\n const renderResult = await renderStory(\n {\n kind: component,\n story: rawVariant,\n storyId,\n },\n { force: !!forcedHappoScreenshotSteps },\n );\n\n pausedAtStep = renderResult.pausedAtStep;\n\n if (pausedAtStep) {\n variant = `${variant}-${pausedAtStep.stepLabel}`;\n } else {\n forcedHappoScreenshotSteps = undefined;\n }\n\n const channel = globalThis.__STORYBOOK_ADDONS_CHANNEL__;\n if (!channel) {\n throw new Error('Missing Storybook Addons Channel');\n }\n\n if (theme && themeSwitcher) {\n await themeSwitcher(theme, channel);\n }\n\n if (/sb-show-errordisplay/.test(document.body.className)) {\n // It's possible that the error is from unmounting the previous story. We\n // can try re-rendering in this case.\n channel.emit('forceReRender');\n }\n\n if (beforeScreenshot && typeof beforeScreenshot === 'function') {\n try {\n await beforeScreenshot({ rootElement });\n } catch (e) {\n console.error('Failed to invoke beforeScreenshot hook', e);\n }\n }\n\n await new Promise((resolve) => time.originalSetTimeout(resolve, delay));\n\n if (waitFor) {\n await waitForWaitFor(waitFor);\n }\n\n const highlightsRootElement = document.querySelector(\n '#storybook-highlights-root',\n );\n if (\n highlightsRootElement &&\n (highlightsRootElement instanceof HTMLElement ||\n highlightsRootElement instanceof SVGElement ||\n highlightsRootElement instanceof MathMLElement)\n ) {\n highlightsRootElement.dataset.happoIgnore = 'true';\n }\n\n return { component, variant, waitForContent };\n } catch (e) {\n console.warn(e);\n return { component, variant };\n } finally {\n if (pausedAtStep) {\n pausedAtStep.done = true;\n } else {\n currentIndex++;\n }\n }\n};\n\nexport function forceHappoScreenshot(stepLabel: string): void {\n if (!examples) {\n console.log(\n `Ignoring forceHappoScreenshot with step label \"${stepLabel}\" since we are not currently rendering for Happo`,\n );\n return;\n }\n\n if (!stepLabel) {\n throw new Error(\n 'Missing stepLabel argument. Make sure to pass a string as the first argument to this function. E.g. `forceHappoScreenshot(\"modal open\")`',\n );\n }\n\n if (\n forcedHappoScreenshotSteps &&\n forcedHappoScreenshotSteps.some((s) => s.stepLabel === stepLabel)\n ) {\n // ignore, this step has already been handled\n return;\n }\n\n forcedHappoScreenshotSteps = forcedHappoScreenshotSteps || [];\n forcedHappoScreenshotSteps.push({ stepLabel, done: false });\n\n console.log('Forcing happo screenshot', stepLabel);\n throw new ForcedHappoScreenshot(stepLabel);\n}\n\nexport function setDefaultDelay(delay: number): void {\n defaultDelay = delay;\n}\n\nexport function setRenderTimeoutMs(timeoutMs: number): void {\n renderTimeoutMs = timeoutMs;\n}\n\nexport function setThemeSwitcher(\n func: (theme: string, channel: Channel) => Promise<void>,\n): void {\n themeSwitcher = func;\n}\n\nexport function setShouldWaitForCompletedEvent(swfce: boolean): void {\n sh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AmB,KAAK;AAAA,IACvC;AAEA,QAAI,CAAC,6BAA6B;AAChC,WAAK,mBAAmB,MAAM;AAC5B,qBAAa,OAAO;AACpB,gBAAQ,CAAC,CAAC;AAAA,MACZ,GAAG,CAAC;AAAA,IACN;AAAA,EACF,CAAC;AACH;AAEA,SAAS,kBAAkB,SAAyD;AAClF,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC1C;AACA,MAAI,EAAE,mBAAmB,cAAc;AACrC,UAAM,IAAI,UAAU,gCAAgC;AAAA,EACtD;AACF;AAEA,WAAW,MAAM,cAAc,YAAoD;AACjF,MAAI,CAAC,UAAU;AACb,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,MAAI,gBAAgB,SAAS,QAAQ;AACnC;AAAA,EACF;AAEA,QAAM,UAAU,SAAS,YAAY;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,4BAA4B,YAAY,EAAE;AAAA,EAC5D;AAEA,QAAM;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI;AACJ,MAAI,UAAU;AAEd,MAAI;AACF,
|
|
4
|
+
"sourcesContent": ["import type { Channel } from 'storybook/internal/channels';\nimport type { StoryStore } from 'storybook/internal/preview-api';\n\nimport type {\n InitConfig,\n NextExampleResult,\n WindowHappo,\n} from '../../isomorphic/types.ts';\nimport type { OnlyItems, SkipItems } from '../isomorphic/types.ts';\nimport { SB_ROOT_ELEMENT_SELECTOR } from './constants.ts';\n\ninterface HappoTime {\n originalDateNow: typeof Date.now;\n originalSetTimeout: typeof setTimeout;\n}\n\ndeclare global {\n var happoTime: HappoTime | undefined;\n var happoSkipped: SkipItems | undefined;\n var happoOnly: OnlyItems | null | undefined;\n var __IS_HAPPO_RUN: boolean | undefined;\n var __STORYBOOK_CLIENT_API__:\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _storyStore: StoryStore<any>;\n }\n | undefined;\n var __STORYBOOK_PREVIEW__:\n | {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n storyStoreValue: StoryStore<any>;\n }\n | undefined;\n var __STORYBOOK_ADDONS_CHANNEL__: Channel | undefined;\n}\n\nconst time = globalThis.happoTime || {\n originalDateNow: Date.now,\n originalSetTimeout: globalThis.setTimeout.bind(globalThis),\n};\n\nconst STORY_STORE_TIMEOUT = 10_000;\n\ntype HookFunction = ({\n rootElement,\n}: {\n rootElement: HTMLElement;\n}) => void | Promise<void>;\n\ninterface Example {\n component: string;\n variant: string;\n storyId: string;\n delay: number;\n waitForContent: string | undefined;\n waitFor: () => boolean;\n beforeScreenshot: HookFunction;\n afterScreenshot: HookFunction;\n targets: Array<string>;\n theme?: string;\n}\n\nlet renderTimeoutMs = 2000;\nlet examples: Array<Example>;\nlet currentIndex = 0;\nlet defaultDelay: number;\nlet themeSwitcher: (theme: string, channel: Channel) => Promise<void>;\nlet forcedHappoScreenshotSteps:\n | Array<{ stepLabel: string; done: boolean }>\n | undefined;\nlet shouldWaitForCompletedEvent = true;\n\nclass ForcedHappoScreenshot extends Error {\n type: string;\n step: string;\n\n constructor(stepLabel: string) {\n super(`Forced screenshot with label \"${stepLabel}\"`);\n this.name = 'ForcedHappoScreenshot';\n this.type = 'ForcedHappoScreenshot';\n this.step = stepLabel;\n }\n}\n\nasync function waitForWaitFor(\n waitFor: () => boolean,\n start = time.originalDateNow(),\n): Promise<void> {\n const duration = time.originalDateNow() - start;\n if (!waitFor() && duration < renderTimeoutMs) {\n return new Promise((resolve) =>\n time.originalSetTimeout(() => resolve(waitForWaitFor(waitFor, start)), 50),\n );\n }\n\n return;\n}\n\n/**\n * Type safe function to check if a value is defined\n *\n * @example\n * const filtered = values.filter(isDefined);\n */\nfunction isDefined<T>(value: T): value is NonNullable<T> {\n if (value === undefined) {\n return false;\n }\n if (value === null) {\n return false;\n }\n return true;\n}\n\nasync function getStoryStore(startTime = time.originalDateNow()) {\n const duration = time.originalDateNow() - startTime;\n if (duration >= STORY_STORE_TIMEOUT) {\n throw new Error(\n `Timeout: Could not find Storybook Client API after ${STORY_STORE_TIMEOUT}ms`,\n );\n }\n\n const { __STORYBOOK_CLIENT_API__: clientApi, __STORYBOOK_PREVIEW__: preview } =\n globalThis;\n\n if (clientApi && clientApi._storyStore) {\n return clientApi._storyStore;\n }\n if (preview && preview.storyStoreValue) {\n return preview.storyStoreValue;\n }\n\n // Wait 100ms and try again\n await new Promise((resolve) => time.originalSetTimeout(resolve, 100));\n return getStoryStore(startTime);\n}\n\nasync function getExamples(): Promise<Array<Example>> {\n const storyStore = await getStoryStore();\n\n if (!storyStore) {\n throw new Error('Could not get Storybook story store');\n }\n\n if (!storyStore.extract) {\n throw new Error('Missing Storybook Client API');\n }\n\n if (storyStore.cacheAllCSFFiles) {\n await storyStore.cacheAllCSFFiles();\n }\n\n return Object.values(storyStore.extract())\n .map(({ id, kind, story, parameters }) => {\n if (parameters.happo === false) {\n return;\n }\n let delay = defaultDelay;\n let waitForContent;\n let waitFor;\n let beforeScreenshot;\n let afterScreenshot;\n let targets;\n let themes;\n if (typeof parameters.happo === 'object' && parameters.happo !== null) {\n delay = parameters.happo.delay || defaultDelay;\n waitForContent = parameters.happo.waitForContent;\n waitFor = parameters.happo.waitFor;\n beforeScreenshot = parameters.happo.beforeScreenshot;\n afterScreenshot = parameters.happo.afterScreenshot;\n targets = parameters.happo.targets;\n themes = parameters.happo.themes;\n }\n return {\n component: kind,\n variant: story,\n storyId: id,\n delay,\n waitForContent,\n waitFor,\n beforeScreenshot,\n afterScreenshot,\n targets,\n themes,\n };\n })\n .filter(isDefined)\n .reduce<Array<Example>>((result, { themes, ...rest }) => {\n if (themes) {\n for (const theme of themes) {\n result.push({\n ...rest,\n variant: `${rest.variant} [${theme}]`,\n theme,\n });\n }\n } else {\n result.push(rest);\n }\n\n return result;\n }, [])\n .toSorted((a, b) => {\n const aCompare = `${a.component}-${a.theme}-${a.storyId}`;\n const bCompare = `${b.component}-${b.theme}-${b.storyId}`;\n if (aCompare === bCompare) {\n return 0;\n }\n return aCompare < bCompare ? -1 : 1;\n });\n}\n\nfunction filterExamples(\n all: Array<Example>,\n initConfig: InitConfig,\n): Array<Example> {\n const { chunk, targetName, only } = initConfig;\n\n if (globalThis.happoOnly) {\n const happoOnly = globalThis.happoOnly;\n all = all.filter((e) => happoOnly.some((item) => item.component === e.component));\n }\n\n if (globalThis.happoSkipped) {\n const happoSkipped = globalThis.happoSkipped;\n all = all.filter(\n (e) =>\n !happoSkipped.some(\n (item) =>\n item.component === e.component &&\n (item.variant === undefined || item.variant === e.variant),\n ),\n );\n }\n\n if (chunk) {\n const examplesPerChunk = Math.ceil(all.length / chunk.total);\n const startIndex = chunk.index * examplesPerChunk;\n const endIndex = startIndex + examplesPerChunk;\n all = all.slice(startIndex, endIndex);\n }\n\n if (targetName) {\n all = all.filter((e) => {\n if (!e.targets || !Array.isArray(e.targets)) {\n // This story hasn't been filtered for specific targets\n return true;\n }\n\n return e.targets.includes(targetName);\n });\n }\n\n if (only) {\n all = all.filter(\n (e) => e.component === only.component && e.variant === only.variant,\n );\n }\n\n return all;\n}\n\nglobalThis.happo = globalThis.happo || ({} as WindowHappo);\n\nglobalThis.happo.init = async (config: InitConfig) => {\n examples = filterExamples(await getExamples(), config);\n};\n\ninterface Story {\n kind: string;\n story: string;\n storyId: string;\n}\n\nfunction renderStory(\n story: Story,\n { force = false } = {},\n): Promise<{ pausedAtStep?: { stepLabel: string; done: boolean } }> {\n const channel = globalThis.__STORYBOOK_ADDONS_CHANNEL__;\n\n if (!channel) {\n throw new Error('Missing Storybook Addons Channel');\n }\n\n let isPlaying = false;\n let loadingCount = 0;\n\n return new Promise((resolve) => {\n const timeout = time.originalSetTimeout(resolve, renderTimeoutMs);\n function handleRenderPhaseChanged(ev: { storyId: string; newPhase: string }) {\n if (!channel) {\n throw new Error('Missing Storybook Addons Channel');\n }\n\n if (ev.storyId !== story.storyId) {\n console.log(\n `Skipping render phase event (${ev.newPhase}) because story IDs don't match. Current storyId: ${story.storyId}, event storyId: ${ev.storyId}`,\n );\n return;\n }\n\n if (ev.newPhase === 'loading') {\n loadingCount++;\n }\n\n if (ev.newPhase === 'finished' || ev.newPhase === 'aborted') {\n loadingCount--;\n }\n\n if (ev.newPhase === 'finished') {\n if (loadingCount > 0) {\n console.log(\n `Skipping finished event because loadingCount is ${loadingCount} for story ${story.storyId}`,\n );\n return;\n }\n\n channel.off('storyRenderPhaseChanged', handleRenderPhaseChanged);\n clearTimeout(timeout);\n\n if (isPlaying && forcedHappoScreenshotSteps) {\n const pausedAtStep = forcedHappoScreenshotSteps.at(-1);\n\n if (pausedAtStep && !pausedAtStep.done) {\n return resolve({ pausedAtStep });\n }\n }\n\n return resolve({});\n }\n\n if (ev.newPhase === 'playing') {\n isPlaying = true;\n }\n }\n\n if (shouldWaitForCompletedEvent) {\n channel.on('storyRenderPhaseChanged', handleRenderPhaseChanged);\n }\n\n if (force) {\n channel.emit('forceRemount', story);\n } else {\n channel.emit('setCurrentStory', story);\n }\n\n if (!shouldWaitForCompletedEvent) {\n time.originalSetTimeout(() => {\n clearTimeout(timeout);\n resolve({});\n }, 0);\n }\n });\n}\n\nfunction assertHTMLElement(element: Element | null): asserts element is HTMLElement {\n if (element === null) {\n throw new Error('element cannot be null');\n }\n if (!(element instanceof HTMLElement)) {\n throw new TypeError('element must be an HTMLElement');\n }\n}\n\nglobalThis.happo.nextExample = async (): Promise<NextExampleResult | undefined> => {\n if (!examples) {\n throw new Error(\n 'Missing examples. Make sure to call the init function before calling nextExample.',\n );\n }\n\n if (currentIndex >= examples.length) {\n return;\n }\n\n const example = examples[currentIndex];\n if (!example) {\n throw new Error(`Missing example at index ${currentIndex}`);\n }\n\n const {\n component,\n variant: rawVariant,\n storyId,\n delay,\n waitForContent,\n waitFor,\n beforeScreenshot,\n theme,\n } = example;\n\n let pausedAtStep;\n let variant = rawVariant;\n\n try {\n const docsRootElement = document.getElementById('docs-root');\n if (docsRootElement) {\n docsRootElement.dataset.happoIgnore = 'true';\n }\n\n const rootElement = document.querySelector(SB_ROOT_ELEMENT_SELECTOR);\n assertHTMLElement(rootElement);\n rootElement.dataset.happoIgnore = 'true';\n\n const { afterScreenshot } = examples[currentIndex - 1] || {};\n if (afterScreenshot && typeof afterScreenshot === 'function') {\n try {\n await afterScreenshot({ rootElement });\n } catch (e) {\n console.error('Failed to invoke afterScreenshot hook', e);\n }\n }\n\n const renderResult = await renderStory(\n {\n kind: component,\n story: rawVariant,\n storyId,\n },\n { force: !!forcedHappoScreenshotSteps },\n );\n\n pausedAtStep = renderResult.pausedAtStep;\n\n if (pausedAtStep) {\n variant = `${variant}-${pausedAtStep.stepLabel}`;\n } else {\n forcedHappoScreenshotSteps = undefined;\n }\n\n const channel = globalThis.__STORYBOOK_ADDONS_CHANNEL__;\n if (!channel) {\n throw new Error('Missing Storybook Addons Channel');\n }\n\n if (theme && themeSwitcher) {\n await themeSwitcher(theme, channel);\n }\n\n if (/sb-show-errordisplay/.test(document.body.className)) {\n // It's possible that the error is from unmounting the previous story. We\n // can try re-rendering in this case.\n channel.emit('forceReRender');\n }\n\n if (beforeScreenshot && typeof beforeScreenshot === 'function') {\n try {\n await beforeScreenshot({ rootElement });\n } catch (e) {\n console.error('Failed to invoke beforeScreenshot hook', e);\n }\n }\n\n await new Promise((resolve) => time.originalSetTimeout(resolve, delay));\n\n if (waitFor) {\n await waitForWaitFor(waitFor);\n }\n\n const highlightsRootElement = document.querySelector(\n '#storybook-highlights-root',\n );\n if (\n highlightsRootElement &&\n (highlightsRootElement instanceof HTMLElement ||\n highlightsRootElement instanceof SVGElement ||\n highlightsRootElement instanceof MathMLElement)\n ) {\n highlightsRootElement.dataset.happoIgnore = 'true';\n }\n\n return { component, variant, waitForContent };\n } catch (e) {\n console.warn(e);\n return { component, variant };\n } finally {\n if (pausedAtStep) {\n pausedAtStep.done = true;\n } else {\n currentIndex++;\n }\n }\n};\n\nexport function forceHappoScreenshot(stepLabel: string): void {\n if (!examples) {\n console.log(\n `Ignoring forceHappoScreenshot with step label \"${stepLabel}\" since we are not currently rendering for Happo`,\n );\n return;\n }\n\n if (!stepLabel) {\n throw new Error(\n 'Missing stepLabel argument. Make sure to pass a string as the first argument to this function. E.g. `forceHappoScreenshot(\"modal open\")`',\n );\n }\n\n if (\n forcedHappoScreenshotSteps &&\n forcedHappoScreenshotSteps.some((s) => s.stepLabel === stepLabel)\n ) {\n // ignore, this step has already been handled\n return;\n }\n\n forcedHappoScreenshotSteps = forcedHappoScreenshotSteps || [];\n forcedHappoScreenshotSteps.push({ stepLabel, done: false });\n\n console.log('Forcing happo screenshot', stepLabel);\n throw new ForcedHappoScreenshot(stepLabel);\n}\n\nexport function setDefaultDelay(delay: number): void {\n defaultDelay = delay;\n}\n\nexport function setRenderTimeoutMs(timeoutMs: number): void {\n renderTimeoutMs = timeoutMs;\n}\n\nexport function setThemeSwitcher(\n func: (theme: string, channel: Channel) => Promise<void>,\n): void {\n themeSwitcher = func;\n}\n\nexport function setShouldWaitForCompletedEvent(swfce: boolean): void {\n shouldWaitForCompletedEvent = swfce;\n}\n\nexport const isHappoRun = (): boolean => globalThis.__IS_HAPPO_RUN ?? false;\n"],
|
|
5
|
+
"mappings": ";;;;;AAoCA,IAAM,OAAO,WAAW,aAAa;AAAA,EACnC,iBAAiB,KAAK;AAAA,EACtB,oBAAoB,WAAW,WAAW,KAAK,UAAU;AAC3D;AAEA,IAAM,sBAAsB;AAqB5B,IAAI,kBAAkB;AACtB,IAAI;AACJ,IAAI,eAAe;AACnB,IAAI;AACJ,IAAI;AACJ,IAAI;AAGJ,IAAI,8BAA8B;AAElC,IAAM,wBAAN,cAAoC,MAAM;AAAA,EACxC;AAAA,EACA;AAAA,EAEA,YAAY,WAAmB;AAC7B,UAAM,iCAAiC,SAAS,GAAG;AACnD,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,OAAO;AAA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2BAA2B,KAAK,CAAC,MAAM,EAAE,cAAc,SAAS,GAChE;AAEA;AAAA,EACF;AAEA,+BAA6B,8BAA8B,CAAC;AAC5D,6BAA2B,KAAK,EAAE,WAAW,MAAM,MAAM,CAAC;AAE1D,UAAQ,IAAI,4BAA4B,SAAS;AACjD,QAAM,IAAI,sBAAsB,SAAS;AAC3C;AAEO,SAAS,gBAAgB,OAAqB;AACnD,iBAAe;AACjB;AAEO,SAAS,mBAAmB,WAAyB;AAC1D,oBAAkB;AACpB;AAEO,SAAS,iBACd,MACM;AACN,kBAAgB;AAClB;AAEO,SAAS,+BAA+B,OAAsB;AACnE,gCAA8B;AAChC;AAEO,IAAM,aAAa,MAAe,WAAW,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAsyncComparison
|
|
3
|
-
} from "./chunk-JIRDD3RO.js";
|
|
4
|
-
import "./chunk-JJOM7NVS.js";
|
|
5
|
-
import "./chunk-WUYZIKHR.js";
|
|
6
|
-
import "./chunk-KTUIEOPK.js";
|
|
7
|
-
export {
|
|
8
|
-
createAsyncComparison as default
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=createAsyncComparison-D525PJCA.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/cli/{createAsyncComparison-D525PJCA.js.map → createAsyncComparison-P277GZ47.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/cli/{prepareSnapRequests-RINWFSWA.js.map → prepareSnapRequests-KMVRPKIT.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|