Vite: Improve handling of preview annotations #42772
Annotations
3 errors
src/codegen-modern-iframe-script.test.ts > generateModernIframeScriptCodeFromPreviews > handle one annotation:
code/builders/builder-vite/src/codegen-modern-iframe-script.test.ts#L14
Error: Snapshot `generateModernIframeScriptCodeFromPreviews > handle one annotation 1` mismatched
- Expected
+ Received
- "import { setup } from '@storybook/core/preview/runtime';
+ "import { setup } from 'storybook/internal/preview/runtime';
- import '/virtual:/@storybook/builder-vite/setup-addons.js';
+
+ import '/virtual:/@storybook/builder-vite/setup-addons.js';
- setup();
+ setup();
- import { composeConfigs, PreviewWeb, ClientApi } from 'storybook/internal/preview-api';
+ import { composeConfigs, PreviewWeb, ClientApi } from 'storybook/internal/preview-api';
- import { importFn } from '/virtual:/@storybook/builder-vite/storybook-stories.js';
+ import { importFn } from '/virtual:/@storybook/builder-vite/storybook-stories.js';
-
- import * as previewAnnotations_2477 from "/user/previewAnnotations";
+
+ import * as previewAnnotations_2477 from "/user/previewAnnotations";
- const getProjectAnnotations = (hmrPreviewAnnotationModules = []) => {
+ const getProjectAnnotations = (hmrPreviewAnnotationModules = []) => {
- const configs = [
+ const configs = [
- hmrPreviewAnnotationModules[0] ?? previewAnnotations_2477
+ hmrPreviewAnnotationModules[0] ?? previewAnnotations_2477
- ]
+ ]
- return composeConfigs(configs);
+ return composeConfigs(configs);
- }
+ }
- window.__STORYBOOK_PREVIEW__ = window.__STORYBOOK_PREVIEW__ || new PreviewWeb(importFn, getProjectAnnotations);
+ window.__STORYBOOK_PREVIEW__ = window.__STORYBOOK_PREVIEW__ || new PreviewWeb(importFn, getProjectAnnotations);
-
- window.__STORYBOOK_STORY_STORE__ = window.__STORYBOOK_STORY_STORE__ || window.__STORYBOOK_PREVIEW__.storyStore;
+
+ window.__STORYBOOK_STORY_STORE__ = window.__STORYBOOK_STORY_STORE__ || window.__STORYBOOK_PREVIEW__.storyStore;
-
- if (import.meta.hot) {
+
+ if (import.meta.hot) {
- import.meta.hot.accept('/virtual:/@storybook/builder-vite/storybook-stories.js', (newModule) => {
+ import.meta.hot.accept('/virtual:/@storybook/builder-vite/storybook-stories.js', (newModule) => {
- // importFn has changed so we need to patch the new one in
+ // importFn has changed so we need to patch the new one in
- window.__STORYBOOK_PREVIEW__.onStoriesChanged({ importFn: newModule.importFn });
+ window.__STORYBOOK_PREVIEW__.onStoriesChanged({ importFn: newModule.importFn });
- });
+ });
-
+
- import.meta.hot.accept(["/user/previewAnnotations"], (previewAnnotationModules) => {
+ import.meta.hot.accept(["/user/previewAnnotations"], (previewAnnotationModules) => {
- // getProjectAnnotations has changed so we need to patch the new one in
+ // getProjectAnnotations has changed so we need to patch the new one in
- window.__STORYBOOK_PREVIEW__.onGetProjectAnnotationsChanged({ getProjectAnnotations: () => getProjectAnnotations(previewAnnotationModules) });
+ window.__STORYBOOK_PREVIEW__.onGetProjectAnnotationsChanged({ getProjectAnnotations: () => getProjectAnnotations(previewAnnotationModules) });
- });
+ });
- };"
+ };"
❯ src/codegen-modern-iframe-script.test.ts:14:20
|
src/codegen-modern-iframe-script.test.ts > generateModernIframeScriptCodeFromPreviews > handle multiple annotations:
code/builders/builder-vite/src/codegen-modern-iframe-script.test.ts#L54
Error: Snapshot `generateModernIframeScriptCodeFromPreviews > handle multiple annotations 1` mismatched
- Expected
+ Received
- "import { setup } from '@storybook/core/preview/runtime';
+ "import { setup } from 'storybook/internal/preview/runtime';
- import '/virtual:/@storybook/builder-vite/setup-addons.js';
+
+ import '/virtual:/@storybook/builder-vite/setup-addons.js';
- setup();
+ setup();
- import { composeConfigs, PreviewWeb, ClientApi } from 'storybook/internal/preview-api';
+ import { composeConfigs, PreviewWeb, ClientApi } from 'storybook/internal/preview-api';
- import { importFn } from '/virtual:/@storybook/builder-vite/storybook-stories.js';
+ import { importFn } from '/virtual:/@storybook/builder-vite/storybook-stories.js';
-
- import * as previewAnnotations1_2526 from "/user/previewAnnotations1";
+
+ import * as previewAnnotations1_2526 from "/user/previewAnnotations1";
- import * as previewAnnotations2_2527 from "/user/previewAnnotations2";
+ import * as previewAnnotations2_2527 from "/user/previewAnnotations2";
- const getProjectAnnotations = (hmrPreviewAnnotationModules = []) => {
+ const getProjectAnnotations = (hmrPreviewAnnotationModules = []) => {
- const configs = [
+ const configs = [
- hmrPreviewAnnotationModules[0] ?? previewAnnotations1_2526,
+ hmrPreviewAnnotationModules[0] ?? previewAnnotations1_2526,
- hmrPreviewAnnotationModules[1] ?? previewAnnotations2_2527
+ hmrPreviewAnnotationModules[1] ?? previewAnnotations2_2527
- ]
+ ]
- return composeConfigs(configs);
+ return composeConfigs(configs);
- }
+ }
- window.__STORYBOOK_PREVIEW__ = window.__STORYBOOK_PREVIEW__ || new PreviewWeb(importFn, getProjectAnnotations);
+ window.__STORYBOOK_PREVIEW__ = window.__STORYBOOK_PREVIEW__ || new PreviewWeb(importFn, getProjectAnnotations);
-
- window.__STORYBOOK_STORY_STORE__ = window.__STORYBOOK_STORY_STORE__ || window.__STORYBOOK_PREVIEW__.storyStore;
+
+ window.__STORYBOOK_STORY_STORE__ = window.__STORYBOOK_STORY_STORE__ || window.__STORYBOOK_PREVIEW__.storyStore;
-
- if (import.meta.hot) {
+
+ if (import.meta.hot) {
- import.meta.hot.accept('/virtual:/@storybook/builder-vite/storybook-stories.js', (newModule) => {
+ import.meta.hot.accept('/virtual:/@storybook/builder-vite/storybook-stories.js', (newModule) => {
- // importFn has changed so we need to patch the new one in
+ // importFn has changed so we need to patch the new one in
- window.__STORYBOOK_PREVIEW__.onStoriesChanged({ importFn: newModule.importFn });
+ window.__STORYBOOK_PREVIEW__.onStoriesChanged({ importFn: newModule.importFn });
- });
+ });
-
+
- import.meta.hot.accept(["/user/previewAnnotations1","/user/previewAnnotations2"], (previewAnnotationModules) => {
+ import.meta.hot.accept(["/user/previewAnnotations1","/user/previewAnnotations2"], (previewAnnotationModules) => {
- // getProjectAnnotations has changed so we need to patch the new one in
+ // getProjectAnnotations has changed so we need to patch the new one in
- window.__STORYBOOK_PREVIEW__.onGetProjectAnnotationsChanged({ getProjectAnnotations: () => getProjectAnnotations(previewAnnotationModules) });
+ window.__STORYBOOK_PREVIEW__.onGetProjectAnnotationsChanged({ getProjectAnnotations: () => getProjectAnnotations(previewAnnotationModules) });
- });
+ });
- };"
+ };"
❯ src/codegen-modern-iframe-script.test.ts:54:20
|
Core Unit Tests, windows-latest
Process completed with exit code 1.
|