From fd20e3b482056350f2eca48445b0863678387354 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 5 Oct 2023 11:48:42 -0700 Subject: [PATCH 01/32] CsfFile: Automatically extract componentPath --- code/lib/csf-tools/src/CsfFile.test.ts | 112 +++++++++++++++++++++++++ code/lib/csf-tools/src/CsfFile.ts | 16 ++++ 2 files changed, 128 insertions(+) diff --git a/code/lib/csf-tools/src/CsfFile.test.ts b/code/lib/csf-tools/src/CsfFile.test.ts index c57859e3fee5..95a98ab43ecb 100644 --- a/code/lib/csf-tools/src/CsfFile.test.ts +++ b/code/lib/csf-tools/src/CsfFile.test.ts @@ -1195,4 +1195,116 @@ describe('CsfFile', () => { `); }); }); + + describe('componenent paths', () => { + it('no component', () => { + const { indexInputs } = loadCsf( + dedent` + import { Component } from '../src/Component.js'; + export default { + title: 'custom foo title', + }; + + export const A = { + render: () => {}, + }; + `, + { makeTitle, fileName: 'foo/bar.stories.js' } + ).parse(); + + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + exportName: A + name: A + title: custom foo title + tags: [] + __id: custom-foo-title--a + `); + }); + + it('local component', () => { + const { indexInputs } = loadCsf( + dedent` + const Component = (props) =>
hello
; + + export default { + title: 'custom foo title', + component: Component, + }; + + export const A = { + render: () => {}, + }; + `, + { makeTitle, fileName: 'foo/bar.stories.js' } + ).parse(); + + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + exportName: A + name: A + title: custom foo title + tags: [] + __id: custom-foo-title--a + `); + }); + + it('imported component from file', () => { + const { indexInputs } = loadCsf( + dedent` + import { Component } from '../src/Component.js'; + export default { + title: 'custom foo title', + component: Component, + }; + + export const A = { + render: () => {}, + }; + `, + { makeTitle, fileName: 'foo/bar.stories.js' } + ).parse(); + + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + componentPath: ../src/Component.js + exportName: A + name: A + title: custom foo title + tags: [] + __id: custom-foo-title--a + `); + }); + + it('imported component from library', () => { + const { indexInputs } = loadCsf( + dedent` + import { Component } from 'some-library'; + export default { + title: 'custom foo title', + component: Component, + }; + + export const A = { + render: () => {}, + }; + `, + { makeTitle, fileName: 'foo/bar.stories.js' } + ).parse(); + + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + componentPath: some-library + exportName: A + name: A + title: custom foo title + tags: [] + __id: custom-foo-title--a + `); + }); + }); }); diff --git a/code/lib/csf-tools/src/CsfFile.ts b/code/lib/csf-tools/src/CsfFile.ts index 15ab39abdc45..4bf828236ad5 100644 --- a/code/lib/csf-tools/src/CsfFile.ts +++ b/code/lib/csf-tools/src/CsfFile.ts @@ -140,6 +140,8 @@ export class CsfFile { _fileName: string; + _componentPath?: string; + _makeTitle: (title: string) => string; _meta?: StaticMeta; @@ -200,6 +202,19 @@ export class CsfFile { } else if (['includeStories', 'excludeStories'].includes(p.key.name)) { (meta as any)[p.key.name] = parseIncludeExclude(p.value); } else if (p.key.name === 'component') { + let n = p.value; + if (t.isIdentifier(n)) { + const id = n.name; + const importStmt = program.body.find((stmt) => ( + t.isImportDeclaration(stmt) && stmt.specifiers.find((spec) => spec.local.name === id) + )) as t.ImportDeclaration; + if (importStmt) { + const { source } = importStmt; + if (t.isStringLiteral(source)) { + this._componentPath = source.value; + } + } + } const { code } = recast.print(p.value, {}); meta.component = code; } else if (p.key.name === 'tags') { @@ -567,6 +582,7 @@ export class CsfFile { return { type: 'story', importPath: this._fileName, + componentPath: this._componentPath, exportName, name: story.name, title: this.meta?.title, From 8c78f835a89b16fccc7dc80b7299bd4fa5558b9a Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 11 Oct 2023 11:15:52 +0800 Subject: [PATCH 02/32] Indexer: Add componentPath to to the indexer --- .../StoryIndexGenerator.deprecated.test.ts | 107 ++++++++++++- .../src/utils/StoryIndexGenerator.test.ts | 147 +++++++++++++++++- .../src/utils/StoryIndexGenerator.ts | 26 +++- .../src/componentPath/component.js | 1 + .../src/componentPath/extension.stories.js | 7 + .../src/componentPath/noExtension.stories.js | 7 + .../src/componentPath/package.stories.js | 7 + code/lib/csf-tools/src/CsfFile.ts | 16 +- code/lib/types/src/modules/indexer.ts | 2 + 9 files changed, 304 insertions(+), 16 deletions(-) create mode 100644 code/lib/core-server/src/utils/__mockdata__/src/componentPath/component.js create mode 100644 code/lib/core-server/src/utils/__mockdata__/src/componentPath/extension.stories.js create mode 100644 code/lib/core-server/src/utils/__mockdata__/src/componentPath/noExtension.stories.js create mode 100644 code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.deprecated.test.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.deprecated.test.ts index 60d700bad62e..6d7a7667efcb 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.deprecated.test.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.deprecated.test.ts @@ -119,6 +119,36 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { expect(await generator.getIndex()).toMatchInlineSnapshot(` Object { "entries": Object { + "componentpath-extension--story-one": Object { + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": Object { + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": Object { + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + "type": "story", + }, "nested-button--story-one": Object { "id": "nested-button--story-one", "importPath": "./src/nested/Button.stories.ts", @@ -182,6 +212,36 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { "title": "B", "type": "story", }, + "componentpath-extension--story-one": Object { + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": Object { + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": Object { + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + "type": "story", + }, "d--story-one": Object { "id": "d--story-one", "importPath": "./src/D.stories.jsx", @@ -339,6 +399,36 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { "title": "B", "type": "story", }, + "componentpath-extension--story-one": Object { + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": Object { + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": Object { + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + "type": "story", + }, "d--docs": Object { "id": "d--docs", "importPath": "./src/D.stories.jsx", @@ -448,6 +538,12 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { "d--story-one", "h--docs", "h--story-one", + "componentpath-extension--docs", + "componentpath-extension--story-one", + "componentpath-noextension--docs", + "componentpath-noextension--story-one", + "componentpath-package--docs", + "componentpath-package--story-one", "first-nested-deeply-f--docs", "first-nested-deeply-f--story-one", "nested-button--docs", @@ -1228,6 +1324,9 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { "componentreference--docs", "notitle--docs", "h--story-one", + "componentpath-extension--story-one", + "componentpath-noextension--story-one", + "componentpath-package--story-one", "first-nested-deeply-f--story-one", ] `); @@ -1246,7 +1345,7 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(loadCsfMock).toHaveBeenCalledTimes(7); + expect(loadCsfMock).toHaveBeenCalledTimes(10); loadCsfMock.mockClear(); await generator.getIndex(); @@ -1303,7 +1402,7 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(loadCsfMock).toHaveBeenCalledTimes(7); + expect(loadCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', false); @@ -1388,7 +1487,7 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(loadCsfMock).toHaveBeenCalledTimes(7); + expect(loadCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', true); @@ -1427,7 +1526,7 @@ describe('StoryIndexGenerator with deprecated indexer API', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(loadCsfMock).toHaveBeenCalledTimes(7); + expect(loadCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', true); diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts index fad7090789fe..dc3fc8321288 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts @@ -82,6 +82,7 @@ describe('StoryIndexGenerator', () => { Object { "entries": Object { "a--story-one": Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -113,6 +114,7 @@ describe('StoryIndexGenerator', () => { Object { "entries": Object { "f--story-one": Object { + "componentPath": undefined, "id": "f--story-one", "importPath": "./src/F.story.ts", "name": "Story One", @@ -143,6 +145,7 @@ describe('StoryIndexGenerator', () => { Object { "entries": Object { "stories--story-one": Object { + "componentPath": undefined, "id": "stories--story-one", "importPath": "./src/stories.ts", "name": "Story One", @@ -172,7 +175,41 @@ describe('StoryIndexGenerator', () => { expect(await generator.getIndex()).toMatchInlineSnapshot(` Object { "entries": Object { + "componentpath-extension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": Object { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + "type": "story", + }, "nested-button--story-one": Object { + "componentPath": undefined, "id": "nested-button--story-one", "importPath": "./src/nested/Button.stories.ts", "name": "Story One", @@ -184,6 +221,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "second-nested-g--story-one": Object { + "componentPath": undefined, "id": "second-nested-g--story-one", "importPath": "./src/second-nested/G.stories.ts", "name": "Story One", @@ -213,6 +251,7 @@ describe('StoryIndexGenerator', () => { Object { "entries": Object { "a--story-one": Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -225,6 +264,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "b--story-one": Object { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -235,7 +275,41 @@ describe('StoryIndexGenerator', () => { "title": "B", "type": "story", }, + "componentpath-extension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": Object { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + "type": "story", + }, "d--story-one": Object { + "componentPath": undefined, "id": "d--story-one", "importPath": "./src/D.stories.jsx", "name": "Story One", @@ -247,6 +321,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "first-nested-deeply-f--story-one": Object { + "componentPath": undefined, "id": "first-nested-deeply-f--story-one", "importPath": "./src/first-nested/deeply/F.stories.js", "name": "Story One", @@ -257,6 +332,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "h--story-one": Object { + "componentPath": undefined, "id": "h--story-one", "importPath": "./src/H.stories.mjs", "name": "Story One", @@ -268,6 +344,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "nested-button--story-one": Object { + "componentPath": undefined, "id": "nested-button--story-one", "importPath": "./src/nested/Button.stories.ts", "name": "Story One", @@ -279,6 +356,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "second-nested-g--story-one": Object { + "componentPath": undefined, "id": "second-nested-g--story-one", "importPath": "./src/second-nested/G.stories.ts", "name": "Story One", @@ -323,6 +401,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "page--story-one": Object { + "componentPath": undefined, "id": "page--story-one", "importPath": "./src/nested/Page.stories.mdx", "name": "StoryOne", @@ -358,6 +437,7 @@ describe('StoryIndexGenerator', () => { Object { "entries": Object { "a--story-one": Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -382,6 +462,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "b--story-one": Object { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -392,6 +473,39 @@ describe('StoryIndexGenerator', () => { "title": "B", "type": "story", }, + "componentpath-extension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": Object { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + "type": "story", + }, "d--docs": Object { "id": "d--docs", "importPath": "./src/D.stories.jsx", @@ -405,6 +519,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "d--story-one": Object { + "componentPath": undefined, "id": "d--story-one", "importPath": "./src/D.stories.jsx", "name": "Story One", @@ -416,6 +531,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "first-nested-deeply-f--story-one": Object { + "componentPath": undefined, "id": "first-nested-deeply-f--story-one", "importPath": "./src/first-nested/deeply/F.stories.js", "name": "Story One", @@ -438,6 +554,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "h--story-one": Object { + "componentPath": undefined, "id": "h--story-one", "importPath": "./src/H.stories.mjs", "name": "Story One", @@ -449,6 +566,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "nested-button--story-one": Object { + "componentPath": undefined, "id": "nested-button--story-one", "importPath": "./src/nested/Button.stories.ts", "name": "Story One", @@ -460,6 +578,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "second-nested-g--story-one": Object { + "componentPath": undefined, "id": "second-nested-g--story-one", "importPath": "./src/second-nested/G.stories.ts", "name": "Story One", @@ -501,6 +620,12 @@ describe('StoryIndexGenerator', () => { "d--story-one", "h--docs", "h--story-one", + "componentpath-extension--docs", + "componentpath-extension--story-one", + "componentpath-noextension--docs", + "componentpath-noextension--story-one", + "componentpath-package--docs", + "componentpath-package--story-one", "first-nested-deeply-f--docs", "first-nested-deeply-f--story-one", "nested-button--docs", @@ -608,6 +733,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "b--story-one": Object { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -667,6 +793,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "b--story-one": Object { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -718,6 +845,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "a--story-one": Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -762,6 +890,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "duplicate-a--story-one": Object { + "componentPath": undefined, "id": "duplicate-a--story-one", "importPath": "./duplicate/A.stories.js", "name": "Story One", @@ -773,6 +902,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "duplicate-a--story-two": Object { + "componentPath": undefined, "id": "duplicate-a--story-two", "importPath": "./duplicate/SecondA.stories.js", "name": "Story Two", @@ -832,6 +962,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "my-component-a--story-one": Object { + "componentPath": undefined, "id": "my-component-a--story-one", "importPath": "./docs-id-generation/A.stories.jsx", "name": "Story One", @@ -886,6 +1017,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "a--story-one": Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -1009,6 +1141,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "a--story-one": Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -1076,6 +1209,7 @@ describe('StoryIndexGenerator', () => { Object { "entries": Object { "a--story-one": Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -1088,6 +1222,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "b--story-one": Object { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -1151,6 +1286,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "my-component-b--story-one": Object { + "componentPath": undefined, "id": "my-component-b--story-one", "importPath": "./docs-id-generation/B.stories.jsx", "name": "Story One", @@ -1334,6 +1470,9 @@ describe('StoryIndexGenerator', () => { "componentreference--docs", "notitle--docs", "h--story-one", + "componentpath-extension--story-one", + "componentpath-noextension--story-one", + "componentpath-package--story-one", "first-nested-deeply-f--story-one", ] `); @@ -1352,7 +1491,7 @@ describe('StoryIndexGenerator', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(readCsfMock).toHaveBeenCalledTimes(7); + expect(readCsfMock).toHaveBeenCalledTimes(10); readCsfMock.mockClear(); await generator.getIndex(); @@ -1409,7 +1548,7 @@ describe('StoryIndexGenerator', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(readCsfMock).toHaveBeenCalledTimes(7); + expect(readCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', false); @@ -1494,7 +1633,7 @@ describe('StoryIndexGenerator', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(readCsfMock).toHaveBeenCalledTimes(7); + expect(readCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', true); @@ -1533,7 +1672,7 @@ describe('StoryIndexGenerator', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(readCsfMock).toHaveBeenCalledTimes(7); + expect(readCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', true); diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index 0f847b8917a1..3687ae6d281d 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -270,6 +270,27 @@ export class StoryIndexGenerator { ); } + /** + * Try to find the component path from a raw import string and return it in + * the same format as `importPath`. + * + * If no such file exists, assume that the import is from a package and + * return the raw path. + */ + resolveComponentPath(rawComponentPath: Path, absolutePath: Path) { + const absoluteComponentPath = path.resolve(path.dirname(absolutePath), rawComponentPath); + const candidates = ['', '.js', '.ts', '.jsx', '.tsx'].map( + (ext) => `${absoluteComponentPath}${ext}` + ); + const existing = candidates.find((candidate) => fs.existsSync(candidate)); + if (existing) { + const relativePath = path.relative(this.options.workingDir, existing); + return slash(normalizeStoryPath(relativePath)); + } + + return rawComponentPath; + } + async extractStories( specifier: NormalizedStoriesSpecifier, absolutePath: Path @@ -309,8 +330,10 @@ export class StoryIndexGenerator { const entries: ((StoryIndexEntryWithMetaId | DocsCacheEntry) & { tags: Tag[] })[] = indexInputs.map((input) => { const name = input.name ?? storyNameFromExport(input.exportName); + const componentPath = + input.rawComponentPath && this.resolveComponentPath(input.rawComponentPath, absolutePath); const title = input.title ?? defaultMakeTitle(); - // eslint-disable-next-line no-underscore-dangle + const id = input.__id ?? toId(input.metaId ?? title, storyNameFromExport(input.exportName)); const tags = (input.tags || []).concat('story'); @@ -321,6 +344,7 @@ export class StoryIndexGenerator { name, title, importPath, + componentPath, tags, }; }); diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/component.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/component.js new file mode 100644 index 000000000000..ff8b4c56321a --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/component.js @@ -0,0 +1 @@ +export default {}; diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/extension.stories.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/extension.stories.js new file mode 100644 index 000000000000..8a2b7cff9b7e --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/extension.stories.js @@ -0,0 +1,7 @@ +import component from './component.js'; + +export default { + component, +}; + +export const StoryOne = {}; diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/noExtension.stories.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/noExtension.stories.js new file mode 100644 index 000000000000..4bb5febc075f --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/noExtension.stories.js @@ -0,0 +1,7 @@ +import component from './component'; + +export default { + component, +}; + +export const StoryOne = {}; diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js new file mode 100644 index 000000000000..b218fc26b970 --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js @@ -0,0 +1,7 @@ +import component from 'component-package'; + +export default { + component, +}; + +export const StoryOne = {}; diff --git a/code/lib/csf-tools/src/CsfFile.ts b/code/lib/csf-tools/src/CsfFile.ts index 4bf828236ad5..7bb453a43a21 100644 --- a/code/lib/csf-tools/src/CsfFile.ts +++ b/code/lib/csf-tools/src/CsfFile.ts @@ -140,7 +140,7 @@ export class CsfFile { _fileName: string; - _componentPath?: string; + _rawComponentPath?: string; _makeTitle: (title: string) => string; @@ -202,16 +202,18 @@ export class CsfFile { } else if (['includeStories', 'excludeStories'].includes(p.key.name)) { (meta as any)[p.key.name] = parseIncludeExclude(p.value); } else if (p.key.name === 'component') { - let n = p.value; + const n = p.value; if (t.isIdentifier(n)) { const id = n.name; - const importStmt = program.body.find((stmt) => ( - t.isImportDeclaration(stmt) && stmt.specifiers.find((spec) => spec.local.name === id) - )) as t.ImportDeclaration; + const importStmt = program.body.find( + (stmt) => + t.isImportDeclaration(stmt) && + stmt.specifiers.find((spec) => spec.local.name === id) + ) as t.ImportDeclaration; if (importStmt) { const { source } = importStmt; if (t.isStringLiteral(source)) { - this._componentPath = source.value; + this._rawComponentPath = source.value; } } } @@ -582,7 +584,7 @@ export class CsfFile { return { type: 'story', importPath: this._fileName, - componentPath: this._componentPath, + rawComponentPath: this._rawComponentPath, exportName, name: story.name, title: this.meta?.title, diff --git a/code/lib/types/src/modules/indexer.ts b/code/lib/types/src/modules/indexer.ts index 4f0838bba05e..7a63a3c4dc41 100644 --- a/code/lib/types/src/modules/indexer.ts +++ b/code/lib/types/src/modules/indexer.ts @@ -107,6 +107,8 @@ export type IndexEntry = StoryIndexEntry | DocsIndexEntry; export type BaseIndexInput = { /** The file to import from e.g. the story file. */ importPath: Path; + /** The raw path/package to the file that provides meta.component, if one exists */ + rawComponentPath?: Path; /** The name of the export to import. */ exportName: ExportName; /** The name of the entry, auto-generated from {@link exportName} if unspecified. */ From 746914e5a075390df406b27b31eaa9b8dd2c8a94 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 11 Oct 2023 11:18:58 +0800 Subject: [PATCH 03/32] Clean up and add mjs/mts support --- code/lib/core-server/src/utils/StoryIndexGenerator.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index 3687ae6d281d..83fe289bcc64 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -279,10 +279,9 @@ export class StoryIndexGenerator { */ resolveComponentPath(rawComponentPath: Path, absolutePath: Path) { const absoluteComponentPath = path.resolve(path.dirname(absolutePath), rawComponentPath); - const candidates = ['', '.js', '.ts', '.jsx', '.tsx'].map( - (ext) => `${absoluteComponentPath}${ext}` - ); - const existing = candidates.find((candidate) => fs.existsSync(candidate)); + const existing = ['', '.js', '.ts', '.jsx', '.tsx', '.mjs', '.mts'] + .map((ext) => `${absoluteComponentPath}${ext}`) + .find((candidate) => fs.existsSync(candidate)); if (existing) { const relativePath = path.relative(this.options.workingDir, existing); return slash(normalizeStoryPath(relativePath)); From 51edf4aaa939c885aa74a748d2489aa856fc6952 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 11 Oct 2023 11:51:41 +0800 Subject: [PATCH 04/32] Fix CI --- .../src/utils/StoryIndexGenerator.ts | 1 + .../src/componentPath/package.stories.js | 1 + .../utils/__tests__/index-extraction.test.ts | 13 ++ .../src/utils/stories-json.test.ts | 186 ++++++++++++++++++ 4 files changed, 201 insertions(+) diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index 83fe289bcc64..eb00150157db 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -333,6 +333,7 @@ export class StoryIndexGenerator { input.rawComponentPath && this.resolveComponentPath(input.rawComponentPath, absolutePath); const title = input.title ?? defaultMakeTitle(); + // eslint-disable-next-line no-underscore-dangle const id = input.__id ?? toId(input.metaId ?? title, storyNameFromExport(input.exportName)); const tags = (input.tags || []).concat('story'); diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js index b218fc26b970..20509edcf2be 100644 --- a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unresolved import component from 'component-package'; export default { diff --git a/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts b/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts index 39820b3e2c17..599105fcf59d 100644 --- a/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts +++ b/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts @@ -68,6 +68,7 @@ describe('story extraction', () => { "dependents": Array [], "entries": Array [ Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": "a", @@ -80,6 +81,7 @@ describe('story extraction', () => { "type": "story", }, Object { + "componentPath": undefined, "id": "some-fully-custom-id", "importPath": "./src/A.stories.js", "metaId": "custom-id", @@ -124,6 +126,7 @@ describe('story extraction', () => { "dependents": Array [], "entries": Array [ Object { + "componentPath": undefined, "id": "f--story-one", "importPath": "./src/first-nested/deeply/F.stories.js", "metaId": undefined, @@ -171,6 +174,7 @@ describe('story extraction', () => { "dependents": Array [], "entries": Array [ Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/first-nested/deeply/F.stories.js", "metaId": "a", @@ -219,6 +223,7 @@ describe('story extraction', () => { "dependents": Array [], "entries": Array [ Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": "a", @@ -285,6 +290,7 @@ describe('story extraction', () => { "dependents": Array [], "entries": Array [ Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -297,6 +303,7 @@ describe('story extraction', () => { "type": "story", }, Object { + "componentPath": undefined, "id": "custom-title--story-two", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -309,6 +316,7 @@ describe('story extraction', () => { "type": "story", }, Object { + "componentPath": undefined, "id": "custom-meta-id--story-three", "importPath": "./src/A.stories.js", "metaId": "custom-meta-id", @@ -354,6 +362,7 @@ describe('story extraction', () => { "dependents": Array [], "entries": Array [ Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -417,6 +426,7 @@ describe('docs entries from story extraction', () => { "type": "docs", }, Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -478,6 +488,7 @@ describe('docs entries from story extraction', () => { "type": "docs", }, Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -527,6 +538,7 @@ describe('docs entries from story extraction', () => { "dependents": Array [], "entries": Array [ Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -589,6 +601,7 @@ describe('docs entries from story extraction', () => { "type": "docs", }, Object { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, diff --git a/code/lib/core-server/src/utils/stories-json.test.ts b/code/lib/core-server/src/utils/stories-json.test.ts index e1f0b1f6d613..9d1047741bab 100644 --- a/code/lib/core-server/src/utils/stories-json.test.ts +++ b/code/lib/core-server/src/utils/stories-json.test.ts @@ -158,6 +158,39 @@ describe('useStoriesJson', () => { "title": "B", "type": "story", }, + "componentpath-extension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": Object { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + "type": "story", + }, "d--story-one": Object { "id": "d--story-one", "importPath": "./src/D.stories.jsx", @@ -370,6 +403,57 @@ describe('useStoriesJson', () => { ], "title": "B", }, + "componentpath-extension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "kind": "componentPath/extension", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-extension--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/extension.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + }, + "componentpath-noextension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "kind": "componentPath/noExtension", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-noextension--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/noExtension.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + }, + "componentpath-package--story-one": Object { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "kind": "componentPath/package", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-package--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/package.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + }, "d--story-one": Object { "id": "d--story-one", "importPath": "./src/D.stories.jsx", @@ -604,6 +688,57 @@ describe('useStoriesJson', () => { ], "title": "B", }, + "componentpath-extension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "kind": "componentPath/extension", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-extension--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/extension.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + }, + "componentpath-noextension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "kind": "componentPath/noExtension", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-noextension--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/noExtension.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + }, + "componentpath-package--story-one": Object { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "kind": "componentPath/package", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-package--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/package.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + }, "d--story-one": Object { "id": "d--story-one", "importPath": "./src/D.stories.jsx", @@ -796,6 +931,57 @@ describe('useStoriesJson', () => { ], "title": "B", }, + "componentpath-extension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "kind": "componentPath/extension", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-extension--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/extension.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/extension", + }, + "componentpath-noextension--story-one": Object { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "kind": "componentPath/noExtension", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-noextension--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/noExtension.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/noExtension", + }, + "componentpath-package--story-one": Object { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "kind": "componentPath/package", + "name": "Story One", + "parameters": Object { + "__id": "componentpath-package--story-one", + "docsOnly": false, + "fileName": "./src/componentPath/package.stories.js", + }, + "story": "Story One", + "tags": Array [ + "story", + ], + "title": "componentPath/package", + }, "d--story-one": Object { "id": "d--story-one", "importPath": "./src/D.stories.jsx", From d61652d24bf850626150a510fd3dab3c87b95759 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 17 Nov 2023 18:53:15 +0800 Subject: [PATCH 05/32] Update snapshot --- code/lib/csf-tools/src/CsfFile.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/lib/csf-tools/src/CsfFile.test.ts b/code/lib/csf-tools/src/CsfFile.test.ts index 95a98ab43ecb..6f5622097257 100644 --- a/code/lib/csf-tools/src/CsfFile.test.ts +++ b/code/lib/csf-tools/src/CsfFile.test.ts @@ -1270,7 +1270,7 @@ describe('CsfFile', () => { expect(indexInputs).toMatchInlineSnapshot(` - type: story importPath: foo/bar.stories.js - componentPath: ../src/Component.js + rawComponentPath: ../src/Component.js exportName: A name: A title: custom foo title @@ -1298,7 +1298,7 @@ describe('CsfFile', () => { expect(indexInputs).toMatchInlineSnapshot(` - type: story importPath: foo/bar.stories.js - componentPath: some-library + rawComponentPath: some-library exportName: A name: A title: custom foo title From d82fb47bb1b5545c09c71fbb5a4c8fe63d9e451e Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 9 Feb 2024 10:23:42 +0100 Subject: [PATCH 06/32] remove stories.mdx reporting in telemetry --- .../src/utils/summarizeIndex.test.ts | 63 ------------------- .../core-server/src/utils/summarizeIndex.ts | 6 +- docs/configure/telemetry.md | 1 - 3 files changed, 1 insertion(+), 69 deletions(-) diff --git a/code/lib/core-server/src/utils/summarizeIndex.test.ts b/code/lib/core-server/src/utils/summarizeIndex.test.ts index 8647c007463b..4370503d89ac 100644 --- a/code/lib/core-server/src/utils/summarizeIndex.test.ts +++ b/code/lib/core-server/src/utils/summarizeIndex.test.ts @@ -144,7 +144,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 0, "version": 4, } @@ -202,7 +201,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 1, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 0, "version": 4, } @@ -258,7 +256,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 4, "version": 4, } @@ -315,69 +312,11 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 1, "playStoryCount": 1, - "storiesMdxCount": 0, "storyCount": 1, "version": 4, } `); }); - it('storiesMdx', () => { - expect( - summarizeIndex({ - v: 4, - entries: { - 'stories-renderers-react-react-mdx--docs': { - id: 'stories-renderers-react-react-mdx--docs', - title: 'stories/renderers/react/react-mdx', - name: 'Docs', - importPath: './src/stories/renderers/react/react-mdx.stories.mdx', - type: 'docs', - tags: ['stories-mdx', 'docs'], - storiesImports: [], - }, - 'stories-renderers-react-react-mdx--primary': { - id: 'stories-renderers-react-react-mdx--primary', - title: 'stories/renderers/react/react-mdx', - name: 'Primary', - importPath: './src/stories/renderers/react/react-mdx.stories.mdx', - tags: ['stories-mdx', 'story'], - type: 'story', - }, - 'stories-renderers-react-react-mdx--secondary': { - id: 'stories-renderers-react-react-mdx--secondary', - title: 'stories/renderers/react/react-mdx', - name: 'Secondary', - importPath: './src/stories/renderers/react/react-mdx.stories.mdx', - tags: ['stories-mdx', 'story'], - type: 'story', - }, - 'stories-renderers-react-react-mdx--from-template': { - id: 'stories-renderers-react-react-mdx--from-template', - title: 'stories/renderers/react/react-mdx', - name: 'From Template', - importPath: './src/stories/renderers/react/react-mdx.stories.mdx', - tags: ['stories-mdx', 'story'], - type: 'story', - }, - }, - }) - ).toMatchInlineSnapshot(` - { - "autodocsCount": 0, - "componentCount": 1, - "exampleDocsCount": 0, - "exampleStoryCount": 0, - "mdxCount": 0, - "onboardingDocsCount": 0, - "onboardingStoryCount": 0, - "pageStoryCount": 0, - "playStoryCount": 0, - "storiesMdxCount": 1, - "storyCount": 3, - "version": 4, - } - `); - }); it('autodocs', () => { expect( summarizeIndex({ @@ -430,7 +369,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 0, "version": 4, } @@ -481,7 +419,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 0, "version": 4, } diff --git a/code/lib/core-server/src/utils/summarizeIndex.ts b/code/lib/core-server/src/utils/summarizeIndex.ts index 091038cdaccf..8b74ad8b7f5f 100644 --- a/code/lib/core-server/src/utils/summarizeIndex.ts +++ b/code/lib/core-server/src/utils/summarizeIndex.ts @@ -1,6 +1,6 @@ import type { IndexEntry, StoryIndex } from '@storybook/types'; -import { STORIES_MDX_TAG, isMdxEntry, AUTODOCS_TAG, PLAY_FN_TAG } from './StoryIndexGenerator'; +import { isMdxEntry, AUTODOCS_TAG, PLAY_FN_TAG } from './StoryIndexGenerator'; const PAGE_REGEX = /(page|screen)/i; @@ -44,7 +44,6 @@ export function summarizeIndex(storyIndex: StoryIndex) { let pageStoryCount = 0; let playStoryCount = 0; let autodocsCount = 0; - let storiesMdxCount = 0; let mdxCount = 0; Object.values(storyIndex.entries).forEach((entry) => { if (isCLIExampleEntry(entry)) { @@ -65,8 +64,6 @@ export function summarizeIndex(storyIndex: StoryIndex) { } else if (entry.type === 'docs') { if (isMdxEntry(entry)) { mdxCount += 1; - } else if (entry.tags?.includes(STORIES_MDX_TAG)) { - storiesMdxCount += 1; } else if (entry.tags?.includes(AUTODOCS_TAG)) { autodocsCount += 1; } @@ -79,7 +76,6 @@ export function summarizeIndex(storyIndex: StoryIndex) { pageStoryCount, playStoryCount, autodocsCount, - storiesMdxCount, mdxCount, exampleStoryCount, exampleDocsCount, diff --git a/docs/configure/telemetry.md b/docs/configure/telemetry.md index ff3298ac86fd..136cb48422ba 100644 --- a/docs/configure/telemetry.md +++ b/docs/configure/telemetry.md @@ -70,7 +70,6 @@ Will generate the following output: "pageStoryCount": 0, "playStoryCount": 0, "autodocsCount": 0, - "storiesMdxCount": 0, "mdxCount": 0, "exampleStoryCount": 8, "exampleDocsCount": 3, From 656c71828097ca91f273c71e53641fcd78ab0317 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 9 Feb 2024 10:24:59 +0100 Subject: [PATCH 07/32] remove stories.mdx from tests --- .../src/utils/__tests__/autoName.test.ts | 4 +- .../src/utils/watch-story-specifiers.test.ts | 28 +++++----- .../src/to-require-context.test.ts | 54 +++++++++---------- code/lib/csf-tools/src/CsfFile.test.ts | 4 +- .../src/tests/mockStoriesEntries.ts | 1 - .../preview-web/render/CsfDocsRender.ts | 2 - 6 files changed, 42 insertions(+), 51 deletions(-) diff --git a/code/lib/core-server/src/utils/__tests__/autoName.test.ts b/code/lib/core-server/src/utils/__tests__/autoName.test.ts index 9aefb7ec3eed..64954fc55d17 100644 --- a/code/lib/core-server/src/utils/__tests__/autoName.test.ts +++ b/code/lib/core-server/src/utils/__tests__/autoName.test.ts @@ -2,9 +2,9 @@ import { it, expect } from 'vitest'; import { autoName } from '../autoName'; it('pulls name from named MDX files', () => { - expect(autoName('Conventions.mdx', 'Button.stories.mdx', 'Docs')).toEqual('Conventions'); + expect(autoName('Conventions.mdx', 'Button.mdx', 'Docs')).toEqual('Conventions'); }); it('falls back for default named MDX files', () => { - expect(autoName('Button.mdx', 'Button.stories.mdx', 'Docs')).toEqual('Docs'); + expect(autoName('Button.mdx', 'Button.stories.jsx', 'Docs')).toEqual('Docs'); }); diff --git a/code/lib/core-server/src/utils/watch-story-specifiers.test.ts b/code/lib/core-server/src/utils/watch-story-specifiers.test.ts index 22d3e0901de8..4026de15fa11 100644 --- a/code/lib/core-server/src/utils/watch-story-specifiers.test.ts +++ b/code/lib/core-server/src/utils/watch-story-specifiers.test.ts @@ -83,7 +83,7 @@ describe('watchStorySpecifiers', () => { }); it('watches single file globs', async () => { - const specifier = normalizeStoriesEntry('../src/nested/Button.stories.mdx', options); + const specifier = normalizeStoriesEntry('../src/nested/Button.mdx', options); const onInvalidate = vi.fn(); close = watchStorySpecifiers([specifier], { workingDir }, onInvalidate); @@ -98,33 +98,33 @@ describe('watchStorySpecifiers', () => { // File changed, matching onInvalidate.mockClear(); - await onChange('src/nested/Button.stories.mdx', 1234); - expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.stories.mdx`, false); + await onChange('src/nested/Button.mdx', 1234); + expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.mdx`, false); // File changed, NOT matching onInvalidate.mockClear(); - await onChange('src/nested/Button.mdx', 1234); + await onChange('src/nested/Button.tsx', 1234); expect(onInvalidate).not.toHaveBeenCalled(); // File removed, matching onInvalidate.mockClear(); - await onRemove('src/nested/Button.stories.mdx'); - expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.stories.mdx`, true); + await onRemove('src/nested/Button.mdx'); + expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.mdx`, true); // File removed, NOT matching onInvalidate.mockClear(); - await onRemove('src/nested/Button.mdx'); + await onRemove('src/nested/Button.tsx'); expect(onInvalidate).not.toHaveBeenCalled(); // File moved out, matching onInvalidate.mockClear(); - await onChange('src/nested/Button.stories.mdx', null); - expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.stories.mdx`, true); + await onChange('src/nested/Button.mdx', null); + expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.mdx`, true); }); it('multiplexes between two specifiers on the same directory', async () => { const globSpecifier = normalizeStoriesEntry('../src/**/*.stories.@(ts|js)', options); - const fileSpecifier = normalizeStoriesEntry('../src/nested/Button.stories.mdx', options); + const fileSpecifier = normalizeStoriesEntry('../src/nested/Button.mdx', options); const onInvalidate = vi.fn(); close = watchStorySpecifiers([globSpecifier, fileSpecifier], { workingDir }, onInvalidate); @@ -145,11 +145,7 @@ describe('watchStorySpecifiers', () => { ); onInvalidate.mockClear(); - await onChange('src/nested/Button.stories.mdx', 1234); - expect(onInvalidate).toHaveBeenCalledWith( - fileSpecifier, - `./src/nested/Button.stories.mdx`, - false - ); + await onChange('src/nested/Button.mdx', 1234); + expect(onInvalidate).toHaveBeenCalledWith(fileSpecifier, `./src/nested/Button.mdx`, false); }); }); diff --git a/code/lib/core-webpack/src/to-require-context.test.ts b/code/lib/core-webpack/src/to-require-context.test.ts index 90fab1d15f97..e6dbd3c8a90a 100644 --- a/code/lib/core-webpack/src/to-require-context.test.ts +++ b/code/lib/core-webpack/src/to-require-context.test.ts @@ -61,21 +61,21 @@ const testCases = [ }, // INVALID GLOB { - glob: '../src/stories/**/*.stories.(js|mdx)', + glob: '../src/stories/**/*.stories.(js|ts)', recursive: true, validPaths: [ '../src/stories/components/Icon.stories.js', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.ts', '../src/stories/components/Icon/Icon.stories.js', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/stories/components/Icon.stories/Icon.stories.ts', ], invalidPaths: [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', - '../src/stories/components/Icon/Icon.stories.ts', + '../src/Icon.stories.ts', + '../src/stories/components/Icon/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', ], }, @@ -89,59 +89,59 @@ const testCases = [ invalidPaths: ['./dirname/../stories.js', './dirname/../App.stories.js'], }, { - glob: '../src/stories/**/@(*.stories.js|*.stories.mdx)', + glob: '../src/stories/**/@(*.stories.js|*.stories.ts)', recursive: true, validPaths: [ '../src/stories/components/Icon.stories.js', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.ts', '../src/stories/components/Icon/Icon.stories.js', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/stories/components/Icon.stories/Icon.stories.ts', ], invalidPaths: [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', - '../src/stories/components/Icon/Icon.stories.ts', + '../src/Icon.stories.ts', + '../src/stories/components/Icon/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', ], }, { - glob: '../src/stories/**/*.stories.+(js|mdx)', + glob: '../src/stories/**/*.stories.+(js|ts)', recursive: true, validPaths: [ '../src/stories/components/Icon.stories.js', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.ts', '../src/stories/components/Icon/Icon.stories.js', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/stories/components/Icon.stories/Icon.stories.ts', ], invalidPaths: [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', - '../src/stories/components/Icon/Icon.stories.ts', + '../src/Icon.stories.tsx', + '../src/stories/components/Icon/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', ], }, { - glob: '../src/stories/**/*.stories.*(js|mdx)', + glob: '../src/stories/**/*.stories.*(js|ts)', recursive: true, validPaths: [ '../src/stories/components/Icon.stories.js', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.ts', '../src/stories/components/Icon/Icon.stories.js', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/stories/components/Icon.stories/Icon.stories.ts', ], invalidPaths: [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', - '../src/stories/components/Icon/Icon.stories.ts', + '../src/Icon.stories.ts', + '../src/stories/components/Icon/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', ], }, @@ -150,13 +150,13 @@ const testCases = [ recursive: false, validPaths: ['../src/stories/components/Icon.stories.js'], invalidPaths: [ - '../src/Icon.stories.mdx', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/Icon.stories.tsx', + '../src/stories/components/Icon.stories/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', '../src/stories/components/Icon/Icon.stories.js', '../src/stories/components/Icon/Icon.stories.ts', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.tsx', './Icon.stories.js', './src/stories/Icon.stories.js', './stories.js', @@ -191,7 +191,7 @@ const testCases = [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', + '../src/Icon.stories.tsx', '../src/stories/components/Icon/Icon.stories.ts', '../src/stories/components/Icon/Icon.mdx', ], @@ -205,7 +205,7 @@ const testCases = [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', + '../src/Icon.stories.tsx', '../src/stories/components/Icon/Icon.stories.ts', '../src/stories/components/Icon/Icon.mdx', ], @@ -219,7 +219,7 @@ const testCases = [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', + '../src/Icon.stories.tsx', '../components/icon/Icon.stories.js', '../components/basics/simple/icon/Icon.stories.js', '../src/stories/components/Icon/Icon.stories.ts', @@ -235,7 +235,7 @@ const testCases = [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', + '../src/Icon.stories.tsx', '../src/stories/components/Icon/Icon.stories.ts', '../src/stories/components/Icon/Icon.mdx', ], diff --git a/code/lib/csf-tools/src/CsfFile.test.ts b/code/lib/csf-tools/src/CsfFile.test.ts index 7e0d223a23af..b773b026646a 100644 --- a/code/lib/csf-tools/src/CsfFile.test.ts +++ b/code/lib/csf-tools/src/CsfFile.test.ts @@ -442,7 +442,7 @@ describe('CsfFile', () => { export const TestControl = () => _jsx("p", { children: "Hello" }); - export default { title: 'foo/bar', tags: ['stories-mdx'], includeStories: ["__page"] }; + export default { title: 'foo/bar', includeStories: ["__page"] }; export const __page = () => {}; __page.parameters = { docsOnly: true }; `, @@ -451,8 +451,6 @@ describe('CsfFile', () => { ).toMatchInlineSnapshot(` meta: title: foo/bar - tags: - - stories-mdx includeStories: - __page stories: diff --git a/code/lib/manager-api/src/tests/mockStoriesEntries.ts b/code/lib/manager-api/src/tests/mockStoriesEntries.ts index 703b6e6efb76..a820307f4ef2 100644 --- a/code/lib/manager-api/src/tests/mockStoriesEntries.ts +++ b/code/lib/manager-api/src/tests/mockStoriesEntries.ts @@ -53,7 +53,6 @@ export const docsEntries: StoryIndex['entries'] = { name: 'Docs', importPath: './path/to/component-b.ts', storiesImports: [], - tags: ['stories-mdx'], }, 'component-c--story-4': { type: 'story', diff --git a/code/lib/preview-api/src/modules/preview-web/render/CsfDocsRender.ts b/code/lib/preview-api/src/modules/preview-web/render/CsfDocsRender.ts index 019d43d97893..0be1ce5821c3 100644 --- a/code/lib/preview-api/src/modules/preview-web/render/CsfDocsRender.ts +++ b/code/lib/preview-api/src/modules/preview-web/render/CsfDocsRender.ts @@ -25,8 +25,6 @@ import { DocsContext } from '../docs-context/DocsContext'; * * Use cases: * - Autodocs, where there is no story, and we fall back to the globally defined template. - * - *.stories.mdx files, where the MDX compiler produces a CSF file with a `.parameter.docs.page` - * parameter containing the compiled content of the MDX file. */ export class CsfDocsRender implements Render { public readonly type: RenderType = 'docs'; From 2021951ef50a09bbdfc9f41416ace3b8366f81fb Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 9 Feb 2024 10:25:27 +0100 Subject: [PATCH 08/32] remove stories.mdx from index creation --- .../src/utils/StoryIndexGenerator.ts | 21 ++----- .../utils/__tests__/index-extraction.test.ts | 62 +------------------ 2 files changed, 7 insertions(+), 76 deletions(-) diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index a650f04c1ffa..20b0f4d70046 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -55,12 +55,11 @@ export type StoryIndexGeneratorOptions = { }; export const AUTODOCS_TAG = 'autodocs'; -export const STORIES_MDX_TAG = 'stories-mdx'; export const PLAY_FN_TAG = 'play-fn'; /** Was this docs entry generated by a .mdx file? (see discussion below) */ export function isMdxEntry({ tags }: DocsIndexEntry) { - return !tags?.includes(AUTODOCS_TAG) && !tags?.includes(STORIES_MDX_TAG); + return !tags?.includes(AUTODOCS_TAG); } const makeAbsolute = (otherImport: Path, normalizedPath: Path, workingDir: Path) => @@ -83,12 +82,11 @@ const makeAbsolute = (otherImport: Path, normalizedPath: Path, workingDir: Path) * * A stories file is indexed by an indexer (passed in), which produces a list of stories. * - If the stories have the `parameters.docsOnly` setting, they are disregarded. - * - If the stories have the 'stories-mdx' tag (i.e. were generated by a .stories.mdx file), - * OR autodocs is enabled, a docs entry is added pointing to the story file. + * - If the stories have autodocs enabled, a docs entry is added pointing to the story file. * * A (modern) docs (.mdx) file is indexed, a docs entry is added. * - * In the preview, a docs entry with either the `autodocs` or `stories-mdx` tags will be rendered + * In the preview, a docs entry with the `autodocs` tag will be rendered * as a CSF file that exports an MDX template on the `docs.page` parameter, whereas * other docs entries are rendered as MDX files directly. * @@ -308,11 +306,8 @@ export class StoryIndexGenerator { // We need a docs entry attached to the CSF file if either: // a) autodocs is globally enabled // b) we have autodocs enabled for this file - // c) it is a stories.mdx transpiled to CSF const hasAutodocsTag = entries.some((entry) => entry.tags.includes(AUTODOCS_TAG)); - const isStoriesMdx = entries.some((entry) => entry.tags.includes(STORIES_MDX_TAG)); - const createDocEntry = - autodocs === true || (autodocs === 'tag' && hasAutodocsTag) || isStoriesMdx; + const createDocEntry = autodocs === true || (autodocs === 'tag' && hasAutodocsTag); if (createDocEntry && this.options.build?.test?.disableAutoDocs !== true) { const name = this.options.docs.defaultName ?? 'Docs'; @@ -326,17 +321,13 @@ export class StoryIndexGenerator { name, importPath, type: 'docs', - tags: [...metaTags, 'docs', ...(!hasAutodocsTag && !isStoriesMdx ? [AUTODOCS_TAG] : [])], + tags: [...metaTags, 'docs', ...(!hasAutodocsTag ? [AUTODOCS_TAG] : [])], storiesImports: [], }); } - const entriesWithoutDocsOnlyStories = entries.filter( - (entry) => !(entry.type === 'story' && entry.tags.includes('stories-mdx-docsOnly')) - ); - return { - entries: entriesWithoutDocsOnlyStories, + entries, dependents: [], type: 'stories', }; diff --git a/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts b/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts index a1936c6719dd..b6e603f8b86a 100644 --- a/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts +++ b/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts @@ -8,7 +8,7 @@ import { normalizeStoriesEntry } from '@storybook/core-common'; import type { NormalizedStoriesSpecifier } from '@storybook/types'; import type { StoryIndexGeneratorOptions } from '../StoryIndexGenerator'; -import { AUTODOCS_TAG, STORIES_MDX_TAG, StoryIndexGenerator } from '../StoryIndexGenerator'; +import { AUTODOCS_TAG, StoryIndexGenerator } from '../StoryIndexGenerator'; vi.mock('@storybook/node-logger'); @@ -537,64 +537,4 @@ describe('docs entries from story extraction', () => { } `); }); - it(`adds docs entry when an entry has the "${STORIES_MDX_TAG}" tag`, async () => { - const relativePath = './src/A.stories.js'; - const absolutePath = path.join(options.workingDir, relativePath); - const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry(relativePath, options); - - const generator = new StoryIndexGenerator([specifier], { - ...options, - docs: { defaultName: 'docs', autodocs: false }, - indexers: [ - { - test: /\.stories\.(m?js|ts)x?$/, - createIndex: async (fileName) => [ - { - exportName: 'StoryOne', - __id: 'a--story-one', - name: 'Story One', - title: 'A', - tags: [STORIES_MDX_TAG, 'story-tag-from-indexer'], - importPath: fileName, - type: 'story', - }, - ], - }, - ], - }); - const result = await generator.extractStories(specifier, absolutePath); - - expect(result).toMatchInlineSnapshot(` - { - "dependents": [], - "entries": [ - { - "id": "a--docs", - "importPath": "./src/A.stories.js", - "name": "docs", - "storiesImports": [], - "tags": [ - "docs", - ], - "title": "A", - "type": "docs", - }, - { - "id": "a--story-one", - "importPath": "./src/A.stories.js", - "metaId": undefined, - "name": "Story One", - "tags": [ - "stories-mdx", - "story-tag-from-indexer", - "story", - ], - "title": "A", - "type": "story", - }, - ], - "type": "stories", - } - `); - }); }); From a0268b8c7f91ff1affe2297bc87bea9da84491a8 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 9 Feb 2024 10:25:45 +0100 Subject: [PATCH 09/32] remove stories.mdx from client apis --- .../utils/__tests__/normalize-stories.test.ts | 124 +++++++++--------- code/lib/manager-api/src/lib/stories.test.ts | 3 - code/lib/manager-api/src/lib/stories.ts | 3 +- .../preview-web/PreviewWithSelection.tsx | 3 +- 4 files changed, 64 insertions(+), 69 deletions(-) diff --git a/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts b/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts index 8bf64a548ed5..9cefd9052bf4 100644 --- a/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts +++ b/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts @@ -42,172 +42,172 @@ const options = { describe('normalizeStoriesEntry', () => { it('direct file path', () => { - const specifier = normalizeStoriesEntry('../path/to/file.stories.mdx', options); + const specifier = normalizeStoriesEntry('../path/to/file.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": "./path/to", - "files": "file.stories.mdx", + "files": "file.stories.jsx", "importPathMatcher": {} } `); - expect(specifier.importPathMatcher).toMatchPaths(['./path/to/file.stories.mdx']); + expect(specifier.importPathMatcher).toMatchPaths(['./path/to/file.stories.jsx']); expect(specifier.importPathMatcher).not.toMatchPaths([ './path/to/file.stories.js', - './file.stories.mdx', - '../file.stories.mdx', + './file.stories.jsx', + '../file.stories.jsx', ]); }); it('story in config dir', () => { - const specifier = normalizeStoriesEntry('./file.stories.mdx', options); + const specifier = normalizeStoriesEntry('./file.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": "./.storybook", - "files": "file.stories.mdx", + "files": "file.stories.jsx", "importPathMatcher": {} } `); - expect(specifier.importPathMatcher).toMatchPaths(['./.storybook/file.stories.mdx']); + expect(specifier.importPathMatcher).toMatchPaths(['./.storybook/file.stories.jsx']); expect(specifier.importPathMatcher).not.toMatchPaths([ - '.storybook/file.stories.mdx', - './file.stories.mdx', - '../file.stories.mdx', + '.storybook/file.stories.jsx', + './file.stories.jsx', + '../file.stories.jsx', ]); }); it('non-recursive files glob', () => { - const specifier = normalizeStoriesEntry('../*/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../*/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "*/*.stories.mdx", + "files": "*/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './path/file.stories.mdx', - './second-path/file.stories.mdx', + './path/file.stories.jsx', + './second-path/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ './path/file.stories.js', - './path/to/file.stories.mdx', - './file.stories.mdx', - '../file.stories.mdx', + './path/to/file.stories.jsx', + './file.stories.jsx', + '../file.stories.jsx', ]); }); it('double non-recursive directory/files glob', () => { - const specifier = normalizeStoriesEntry('../*/*/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../*/*/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "*/*/*.stories.mdx", + "files": "*/*/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './path/to/file.stories.mdx', - './second-path/to/file.stories.mdx', + './path/to/file.stories.jsx', + './second-path/to/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ - './file.stories.mdx', - './path/file.stories.mdx', - './path/to/third/file.stories.mdx', + './file.stories.jsx', + './path/file.stories.jsx', + './path/to/third/file.stories.jsx', './path/to/file.stories.js', - '../file.stories.mdx', + '../file.stories.jsx', ]); }); it('directory/files glob', () => { - const specifier = normalizeStoriesEntry('../**/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../**/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "**/*.stories.mdx", + "files": "**/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './file.stories.mdx', - './path/file.stories.mdx', - './path/to/file.stories.mdx', - './path/to/third/file.stories.mdx', + './file.stories.jsx', + './path/file.stories.jsx', + './path/to/file.stories.jsx', + './path/to/third/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ './file.stories.js', - '../file.stories.mdx', + '../file.stories.jsx', ]); }); it('double stars glob', () => { - const specifier = normalizeStoriesEntry('../**/foo/**/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../**/foo/**/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "**/foo/**/*.stories.mdx", + "files": "**/foo/**/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './foo/file.stories.mdx', - './path/to/foo/file.stories.mdx', - './path/to/foo/third/fourth/file.stories.mdx', + './foo/file.stories.jsx', + './path/to/foo/file.stories.jsx', + './path/to/foo/third/fourth/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ - './file.stories.mdx', + './file.stories.jsx', './file.stories.js', - '../file.stories.mdx', + '../file.stories.jsx', ]); }); it('intermediate directory glob', () => { - const specifier = normalizeStoriesEntry('../**/foo/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../**/foo/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "**/foo/*.stories.mdx", + "files": "**/foo/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './path/to/foo/file.stories.mdx', - './foo/file.stories.mdx', + './path/to/foo/file.stories.jsx', + './foo/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ - './file.stories.mdx', + './file.stories.jsx', './file.stories.js', - './path/to/foo/third/fourth/file.stories.mdx', - '../file.stories.mdx', + './path/to/foo/third/fourth/file.stories.jsx', + '../file.stories.jsx', ]); }); it('directory outside of working dir', () => { - const specifier = normalizeStoriesEntry('../../src/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../../src/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": "../src", - "files": "*.stories.mdx", + "files": "*.stories.jsx", "importPathMatcher": {} } `); - expect(specifier.importPathMatcher).toMatchPaths(['../src/file.stories.mdx']); + expect(specifier.importPathMatcher).toMatchPaths(['../src/file.stories.jsx']); expect(specifier.importPathMatcher).not.toMatchPaths([ - './src/file.stories.mdx', + './src/file.stories.jsx', '../src/file.stories.js', ]); }); @@ -237,11 +237,11 @@ describe('normalizeStoriesEntry', () => { }); it('directory/files specifier', () => { - const specifier = normalizeStoriesEntry({ directory: '..', files: '*.stories.mdx' }, options); + const specifier = normalizeStoriesEntry({ directory: '..', files: '*.stories.jsx' }, options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", - "files": "*.stories.mdx", + "files": "*.stories.jsx", "directory": ".", "importPathMatcher": {} } @@ -262,13 +262,13 @@ describe('normalizeStoriesEntry', () => { it('directory/titlePrefix/files specifier', () => { const specifier = normalizeStoriesEntry( - { directory: '..', titlePrefix: 'atoms', files: '*.stories.mdx' }, + { directory: '..', titlePrefix: 'atoms', files: '*.stories.jsx' }, options ); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "atoms", - "files": "*.stories.mdx", + "files": "*.stories.jsx", "directory": ".", "importPathMatcher": {} } @@ -276,25 +276,25 @@ describe('normalizeStoriesEntry', () => { }); it('globs with negation', () => { - const specifier = normalizeStoriesEntry('../!(negation)/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../!(negation)/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "!(negation)/*.stories.mdx", + "files": "!(negation)/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './path/file.stories.mdx', - './second-path/file.stories.mdx', + './path/file.stories.jsx', + './second-path/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ './path/file.stories.js', - './path/to/file.stories.mdx', - './file.stories.mdx', - '../file.stories.mdx', + './path/to/file.stories.jsx', + './file.stories.jsx', + '../file.stories.jsx', ]); }); }); diff --git a/code/lib/manager-api/src/lib/stories.test.ts b/code/lib/manager-api/src/lib/stories.test.ts index fcce4a94d874..3968bb88080d 100644 --- a/code/lib/manager-api/src/lib/stories.test.ts +++ b/code/lib/manager-api/src/lib/stories.test.ts @@ -115,9 +115,6 @@ describe('transformStoryIndexV3toV4', () => { "docsOnly": true, }, "storiesImports": [], - "tags": [ - "stories-mdx", - ], "title": "Story 1", "type": "docs", }, diff --git a/code/lib/manager-api/src/lib/stories.ts b/code/lib/manager-api/src/lib/stories.ts index 9d6b1817e677..79b3098d04e4 100644 --- a/code/lib/manager-api/src/lib/stories.ts +++ b/code/lib/manager-api/src/lib/stories.ts @@ -66,7 +66,6 @@ export const transformSetStoriesStoryDataToPreparedStoryIndex = ( if (docsOnly) { acc[id] = { type: 'docs', - tags: ['stories-mdx'], storiesImports: [], ...base, }; @@ -123,7 +122,7 @@ export const transformStoryIndexV3toV4 = (index: StoryIndexV3): API_PreparedStor } acc[entry.id] = { type, - ...(type === 'docs' && { tags: ['stories-mdx'], storiesImports: [] }), + ...(type === 'docs' && { storiesImports: [] }), ...entry, }; diff --git a/code/lib/preview-api/src/modules/preview-web/PreviewWithSelection.tsx b/code/lib/preview-api/src/modules/preview-web/PreviewWithSelection.tsx index 76f17e2419f8..50575dbbdbc3 100644 --- a/code/lib/preview-api/src/modules/preview-web/PreviewWithSelection.tsx +++ b/code/lib/preview-api/src/modules/preview-web/PreviewWithSelection.tsx @@ -54,12 +54,11 @@ function focusInInput(event: Event) { } export const AUTODOCS_TAG = 'autodocs'; -export const STORIES_MDX_TAG = 'stories-mdx'; export const ATTACHED_MDX_TAG = 'attached-mdx'; /** Was this docs entry generated by a .mdx file? (see discussion below) */ export function isMdxEntry({ tags }: DocsIndexEntry) { - return !tags?.includes(AUTODOCS_TAG) && !tags?.includes(STORIES_MDX_TAG); + return !tags?.includes(AUTODOCS_TAG); } type PossibleRender = From 3aaf33af89e206118a24bd289bcd4ed8407d816a Mon Sep 17 00:00:00 2001 From: kyletsang <6854874+kyletsang@users.noreply.github.com> Date: Thu, 22 Feb 2024 23:46:03 -0800 Subject: [PATCH 10/32] Docs: fix link to react-inspector theme --- code/lib/theming/src/convert.ts | 2 +- docs/configure/theming.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/lib/theming/src/convert.ts b/code/lib/theming/src/convert.ts index fc23399d4a38..9765adc03d61 100644 --- a/code/lib/theming/src/convert.ts +++ b/code/lib/theming/src/convert.ts @@ -178,7 +178,7 @@ export const convert = (inherit: ThemeVars = themes[getPreferredColorScheme()]): }), // Addon actions theme - // API example https://github.com/xyc/react-inspector/blob/master/src/styles/themes/chromeLight.js + // API example https://github.com/storybookjs/react-inspector/blob/master/src/styles/themes/chromeLight.tsx addonActionsTheme: { ...(base === 'light' ? chromeLight : chromeDark), diff --git a/docs/configure/theming.md b/docs/configure/theming.md index 5ac07a9b5a61..f1e745646594 100644 --- a/docs/configure/theming.md +++ b/docs/configure/theming.md @@ -196,7 +196,7 @@ Here's how you might insert a custom `` block: Some addons require specific theme variables that a Storybook user must add. If you share your theme with the community, make sure to support the official API and other popular addons, so your users have a consistent experience. -For example, the popular Actions addon uses [react-inspector](https://github.com/xyc/react-inspector/blob/master/src/styles/themes/chromeLight.js), which has themes of its own. Supply additional theme variables to style it like so: +For example, the popular Actions addon uses [react-inspector](https://github.com/storybookjs/react-inspector/blob/master/src/styles/themes/chromeLight.tsx), which has themes of its own. Supply additional theme variables to style it like so: From 20a1a244a5c1dfa67b4369374a113f3741562530 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 12:58:57 +0200 Subject: [PATCH 11/32] Build: Update trigger conditions for Circle CI workflows --- .github/workflows/trigger-circle-ci-workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index c8c8a4c0af9c..2f8e56cbf324 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -4,7 +4,7 @@ on: # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. pull_request_target: - types: [opened, synchronize, labeled, unlabeled, reopened, converted_to_draft, ready_for_review] + types: [opened, synchronize, labeled, reopened] push: branches: - next @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:normal') + if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:normal' steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:docs') + if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:docs' steps: - name: Trigger docs tests run: > @@ -77,7 +77,7 @@ jobs: trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:merged') + if: github.event_name == 'push' || github.event.label.name == 'ci:merged' steps: - name: Trigger merged tests run: > @@ -96,7 +96,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:daily') + if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:daily' steps: - name: Trigger the daily tests run: > From 09653c1dbe1dd0339c53cd91c0d5a9dd06b5a2e9 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 13:18:31 +0200 Subject: [PATCH 12/32] Display Github Context --- .github/workflows/trigger-circle-ci-workflow.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 2f8e56cbf324..75afa9842bf1 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -3,7 +3,7 @@ name: Trigger CircleCI workflow on: # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. - pull_request_target: + pull_request: types: [opened, synchronize, labeled, reopened] push: branches: @@ -60,6 +60,11 @@ jobs: needs: get-branch if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:docs' steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" - name: Trigger docs tests run: > curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \ From b5331b2509b26e95f4806d77f20e771404dad21a Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 13:34:50 +0200 Subject: [PATCH 13/32] Apply more constraint if conditions to run certain CircleCI actions --- .github/workflows/trigger-circle-ci-workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 75afa9842bf1..fc2fbbb21cf4 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:normal' + if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:docs' + if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Dump GitHub context env: @@ -82,7 +82,7 @@ jobs: trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'push' || github.event.label.name == 'ci:merged' + if: github.event_name == 'push' || (github.event.type == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged')) steps: - name: Trigger merged tests run: > @@ -101,7 +101,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:daily' + if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: > From 6f4d27a0d4828712764756a5bc965afa4eff488b Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 13:40:35 +0200 Subject: [PATCH 14/32] Test --- .github/workflows/trigger-circle-ci-workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index fc2fbbb21cf4..04221dd6b9ba 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -1,7 +1,7 @@ name: Trigger CircleCI workflow on: - # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. + # Use pull_request, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. pull_request: types: [opened, synchronize, labeled, reopened] @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) + if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) + if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Dump GitHub context env: @@ -101,7 +101,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) + if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: > From 7e4a26ce546fcd2b3affab5e976cb56cac16e68e Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 13:43:59 +0200 Subject: [PATCH 15/32] Fix workflow --- .github/workflows/trigger-circle-ci-workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 04221dd6b9ba..b0a24cb3f7c9 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) + if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) + if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Dump GitHub context env: @@ -82,7 +82,7 @@ jobs: trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'push' || (github.event.type == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged')) + if: github.event_name == 'push' || (github.event.action == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged')) steps: - name: Trigger merged tests run: > @@ -101,7 +101,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) + if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: > From ec0823acecbdac40be95f92d3959a3c3b8303ea5 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 3 Jun 2024 14:24:17 +0200 Subject: [PATCH 16/32] Remove GitHub context logging in CI --- .github/workflows/trigger-circle-ci-workflow.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index b0a24cb3f7c9..973381a733f8 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -60,11 +60,6 @@ jobs: needs: get-branch if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: | - echo "$GITHUB_CONTEXT" - name: Trigger docs tests run: > curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \ From a2df89a6922545e61a3fcdc8f938bb67eff7f1d6 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Tue, 4 Jun 2024 17:54:54 +0100 Subject: [PATCH 17/32] CLI: Fix typo in React Docgen migration --- code/lib/cli/src/automigrate/fixes/react-docgen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/cli/src/automigrate/fixes/react-docgen.ts b/code/lib/cli/src/automigrate/fixes/react-docgen.ts index 41e0875f475d..9359a96bacd9 100644 --- a/code/lib/cli/src/automigrate/fixes/react-docgen.ts +++ b/code/lib/cli/src/automigrate/fixes/react-docgen.ts @@ -62,7 +62,7 @@ export const reactDocgen: Fix = { For known "react-docgen" limitations, see: ${chalk.yellow('https://github.com/storybookjs/storybook/issues/26606')} - Press Y to revert to ${chalk.cyan('react-docgen-typesript')}, press N to use ${chalk.cyan( + Press Y to revert to ${chalk.cyan('react-docgen-typescript')}, press N to use ${chalk.cyan( 'react-docgen' )} `; From 786d9765d2df345dbc6cfdd1d99005bdf5789b1f Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Wed, 5 Jun 2024 09:12:19 +0200 Subject: [PATCH 18/32] Portable Stories: Add tags to composed story --- .../store/csf/portable-stories.test.ts | 22 ++++++++++++------- .../src/modules/store/csf/portable-stories.ts | 1 + code/lib/types/src/modules/composedStory.ts | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts b/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts index 6babf08285ec..893596f03ea4 100644 --- a/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts +++ b/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts @@ -23,6 +23,7 @@ describe('composeStory', () => { label: 'Hello World', primary: true, }, + tags: ['metaTag'], }; it('should compose project annotations in all module formats', () => { @@ -40,15 +41,16 @@ describe('composeStory', () => { it('should return story with composed annotations from story, meta and project', () => { const decoratorFromProjectAnnotations = vi.fn((StoryFn) => StoryFn()); const decoratorFromStoryAnnotations = vi.fn((StoryFn) => StoryFn()); - setProjectAnnotations([ - { - parameters: { injected: true }, - globalTypes: { - locale: { defaultValue: 'en' }, - }, - decorators: [decoratorFromProjectAnnotations], + const projectAnnotations = { + parameters: { injected: true }, + globalTypes: { + locale: { defaultValue: 'en' }, }, - ]); + decorators: [decoratorFromProjectAnnotations], + tags: ['projectTag'], + }; + + setProjectAnnotations(projectAnnotations); const Story: Story = { render: () => {}, @@ -57,6 +59,7 @@ describe('composeStory', () => { secondAddon: true, }, decorators: [decoratorFromStoryAnnotations], + tags: ['storyTag'], }; const composedStory = composeStory(Story, meta); @@ -64,6 +67,9 @@ describe('composeStory', () => { expect(composedStory.parameters).toEqual( expect.objectContaining({ ...Story.parameters, ...meta.parameters }) ); + expect(composedStory.tags).toEqual( + expect.arrayContaining([...Story.tags!, ...projectAnnotations.tags, ...meta.tags!]) + ); composedStory(); diff --git a/code/lib/preview-api/src/modules/store/csf/portable-stories.ts b/code/lib/preview-api/src/modules/store/csf/portable-stories.ts index 056daa5dcbcb..987240ecab66 100644 --- a/code/lib/preview-api/src/modules/store/csf/portable-stories.ts +++ b/code/lib/preview-api/src/modules/store/csf/portable-stories.ts @@ -172,6 +172,7 @@ export function composeStory, play: playFunction as ComposedStoryPlayFn | undefined, + tags: story.tags, } ); diff --git a/code/lib/types/src/modules/composedStory.ts b/code/lib/types/src/modules/composedStory.ts index f670b1ef12a0..ffbc0a2122af 100644 --- a/code/lib/types/src/modules/composedStory.ts +++ b/code/lib/types/src/modules/composedStory.ts @@ -56,6 +56,7 @@ export type ComposedStoryFn< storyName: string; parameters: Parameters; argTypes: StrictArgTypes; + tags: string[]; }; /** * Based on a module of stories, it returns all stories within it, filtering non-stories From c8f01bae0812c571b0e2fcc963693786006c7119 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Wed, 5 Jun 2024 14:33:17 +0200 Subject: [PATCH 19/32] Upgrade deps of @storybook/test --- ...@vitest-expect-npm-1.6.0-0e382f8212.patch} | 2 +- code/lib/test/package.json | 15 +- code/package.json | 3 +- code/yarn.lock | 311 +++++------------- 4 files changed, 90 insertions(+), 241 deletions(-) rename code/.yarn/patches/{@vitest-expect-npm-1.3.1-973071a540.patch => @vitest-expect-npm-1.6.0-0e382f8212.patch} (94%) diff --git a/code/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch b/code/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch similarity index 94% rename from code/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch rename to code/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch index b2028a85b1ff..04c3bd5cfd7a 100644 --- a/code/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch +++ b/code/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch @@ -1,5 +1,5 @@ diff --git a/dist/index.js b/dist/index.js -index 640839e4b9fef0f25d08d055d4350845a8a29791..844f3d5834147848b5fa54276e96e665bcc675f9 100644 +index 13af149aa3c44f52dd5c5a80db3bf5689dfe15ea..1d111032c3fdc104723e19dea49db62be8b79b94 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6,26 +6,32 @@ import { processError } from '@vitest/utils/error'; diff --git a/code/lib/test/package.json b/code/lib/test/package.json index 096820553050..1ae789143982 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -23,9 +23,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "node": "./dist/index.js", "import": "./dist/index.mjs", - "require": "./dist/index.js" + "require": "./dist/index.js", + "node": "./dist/index.js", + "default": "./dist/index.mjs" }, "./package.json": "./package.json" }, @@ -47,11 +48,11 @@ "@storybook/core-events": "workspace:*", "@storybook/instrumenter": "workspace:*", "@storybook/preview-api": "workspace:*", - "@testing-library/dom": "^9.3.4", - "@testing-library/jest-dom": "^6.4.2", - "@testing-library/user-event": "^14.5.2", - "@vitest/expect": "1.3.1", - "@vitest/spy": "^1.3.1", + "@testing-library/dom": "10.1.0", + "@testing-library/jest-dom": "6.4.5", + "@testing-library/user-event": "14.5.2", + "@vitest/expect": "1.6.0", + "@vitest/spy": "1.6.0", "util": "^0.12.4" }, "devDependencies": { diff --git a/code/package.json b/code/package.json index 147d84c8bcb1..0932e56ecd00 100644 --- a/code/package.json +++ b/code/package.json @@ -80,9 +80,8 @@ "resolutions": { "@playwright/test": "1.36.0", "@storybook/theming": "workspace:*", - "@testing-library/jest-dom/aria-query": "5.1.3", "@types/node": "^18.0.0", - "@vitest/expect": "patch:@vitest/expect@npm%3A1.3.1#~/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch", + "@vitest/expect": "patch:@vitest/expect@npm%3A1.6.0#~/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch", "esbuild": "^0.20.1", "playwright": "1.36.0", "playwright-core": "1.36.0", diff --git a/code/yarn.lock b/code/yarn.lock index 60936fb56b7a..0d2f161d0f94 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -501,7 +501,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.24.1, @babel/helper-create-class-features-plugin@npm:^7.24.4": +"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.24.0, @babel/helper-create-class-features-plugin@npm:^7.24.1, @babel/helper-create-class-features-plugin@npm:^7.24.4": version: 7.24.4 resolution: "@babel/helper-create-class-features-plugin@npm:7.24.4" dependencies: @@ -520,25 +520,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.24.0": - version: 7.24.0 - resolution: "@babel/helper-create-class-features-plugin@npm:7.24.0" - dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-function-name": "npm:^7.23.0" - "@babel/helper-member-expression-to-functions": "npm:^7.23.0" - "@babel/helper-optimise-call-expression": "npm:^7.22.5" - "@babel/helper-replace-supers": "npm:^7.22.20" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.22.5" - "@babel/helper-split-export-declaration": "npm:^7.22.6" - semver: "npm:^6.3.1" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/341548496df202805489422a160bba75b111d994c64d788a397c35f01784632af48bf06023af8aa2fe72c2c254f8c885b4e0f7f3df5ef17a37370f2feaf80328 - languageName: node - linkType: hard - "@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.22.15, @babel/helper-create-regexp-features-plugin@npm:^7.22.5": version: 7.22.15 resolution: "@babel/helper-create-regexp-features-plugin@npm:7.22.15" @@ -567,21 +548,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-define-polyfill-provider@npm:^0.6.0": - version: 0.6.0 - resolution: "@babel/helper-define-polyfill-provider@npm:0.6.0" - dependencies: - "@babel/helper-compilation-targets": "npm:^7.22.6" - "@babel/helper-plugin-utils": "npm:^7.22.5" - debug: "npm:^4.1.1" - lodash.debounce: "npm:^4.0.8" - resolve: "npm:^1.14.2" - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/bf6af52fadbbebc5bf71166b91eac4fc21431ec9b0d2a94063f3a3d900ed44aa1384ad23e920a85e7a657fcf3e80edb2eaaac9d902bd1e632f3b50c836b45c53 - languageName: node - linkType: hard - "@babel/helper-define-polyfill-provider@npm:^0.6.1, @babel/helper-define-polyfill-provider@npm:^0.6.2": version: 0.6.2 resolution: "@babel/helper-define-polyfill-provider@npm:0.6.2" @@ -623,7 +589,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.22.15, @babel/helper-member-expression-to-functions@npm:^7.23.0": +"@babel/helper-member-expression-to-functions@npm:^7.23.0": version: 7.23.0 resolution: "@babel/helper-member-expression-to-functions@npm:7.23.0" dependencies: @@ -632,16 +598,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.8.3": - version: 7.22.15 - resolution: "@babel/helper-module-imports@npm:7.22.15" - dependencies: - "@babel/types": "npm:^7.22.15" - checksum: 10c0/4e0d7fc36d02c1b8c8b3006dfbfeedf7a367d3334a04934255de5128115ea0bafdeb3e5736a2559917f0653e4e437400d54542da0468e08d3cbc86d3bbfa8f30 - languageName: node - linkType: hard - -"@babel/helper-module-imports@npm:^7.24.1, @babel/helper-module-imports@npm:^7.24.3": +"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.24.1, @babel/helper-module-imports@npm:^7.24.3, @babel/helper-module-imports@npm:^7.8.3": version: 7.24.3 resolution: "@babel/helper-module-imports@npm:7.24.3" dependencies: @@ -694,19 +651,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-replace-supers@npm:^7.22.20": - version: 7.22.20 - resolution: "@babel/helper-replace-supers@npm:7.22.20" - dependencies: - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-member-expression-to-functions": "npm:^7.22.15" - "@babel/helper-optimise-call-expression": "npm:^7.22.5" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/6b0858811ad46873817c90c805015d63300e003c5a85c147a17d9845fa2558a02047c3cc1f07767af59014b2dd0fa75b503e5bc36e917f360e9b67bb6f1e79f4 - languageName: node - linkType: hard - "@babel/helper-replace-supers@npm:^7.24.1": version: 7.24.1 resolution: "@babel/helper-replace-supers@npm:7.24.1" @@ -802,16 +746,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.11.5, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.4, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.5, @babel/parser@npm:^7.23.6, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.6.0, @babel/parser@npm:^7.9.6": - version: 7.24.0 - resolution: "@babel/parser@npm:7.24.0" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/77593d0b9de9906823c4d653bb6cda1c7593837598516330f655f70cba6224a37def7dbe5b4dad0038482d407d8d209eb8be5f48ca9a13357d769f829c5adb8e - languageName: node - linkType: hard - -"@babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.11.5, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.4, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.5, @babel/parser@npm:^7.23.6, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.6.0, @babel/parser@npm:^7.9.6": version: 7.24.4 resolution: "@babel/parser@npm:7.24.4" bin: @@ -1283,18 +1218,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.23.4, @babel/plugin-transform-block-scoping@npm:^7.8.3": - version: 7.23.4 - resolution: "@babel/plugin-transform-block-scoping@npm:7.23.4" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/83006804dddf980ab1bcd6d67bc381e24b58c776507c34f990468f820d0da71dba3697355ca4856532fa2eeb2a1e3e73c780f03760b5507a511cbedb0308e276 - languageName: node - linkType: hard - -"@babel/plugin-transform-block-scoping@npm:^7.24.4": +"@babel/plugin-transform-block-scoping@npm:^7.23.4, @babel/plugin-transform-block-scoping@npm:^7.24.4, @babel/plugin-transform-block-scoping@npm:^7.8.3": version: 7.24.4 resolution: "@babel/plugin-transform-block-scoping@npm:7.24.4" dependencies: @@ -7140,11 +7064,11 @@ __metadata: "@storybook/core-events": "workspace:*" "@storybook/instrumenter": "workspace:*" "@storybook/preview-api": "workspace:*" - "@testing-library/dom": "npm:^9.3.4" - "@testing-library/jest-dom": "npm:^6.4.2" - "@testing-library/user-event": "npm:^14.5.2" - "@vitest/expect": "npm:1.3.1" - "@vitest/spy": "npm:^1.3.1" + "@testing-library/dom": "npm:10.1.0" + "@testing-library/jest-dom": "npm:6.4.5" + "@testing-library/user-event": "npm:14.5.2" + "@vitest/expect": "npm:1.6.0" + "@vitest/spy": "npm:1.6.0" chai: "npm:^4.4.1" tinyspy: "npm:^2.2.0" ts-dedent: "npm:^2.2.0" @@ -7401,6 +7325,22 @@ __metadata: languageName: node linkType: hard +"@testing-library/dom@npm:10.1.0": + version: 10.1.0 + resolution: "@testing-library/dom@npm:10.1.0" + dependencies: + "@babel/code-frame": "npm:^7.10.4" + "@babel/runtime": "npm:^7.12.5" + "@types/aria-query": "npm:^5.0.1" + aria-query: "npm:5.3.0" + chalk: "npm:^4.1.0" + dom-accessibility-api: "npm:^0.5.9" + lz-string: "npm:^1.5.0" + pretty-format: "npm:^27.0.2" + checksum: 10c0/81f0e0a510d24e458c3af17777960ed678fb4fe464903ef8ec9ed816c9794fc69a673ea94f87b9e054b181383c51814605451dbf4fd9df93d0d8f24b4859990d + languageName: node + linkType: hard + "@testing-library/dom@npm:^7.28.1, @testing-library/dom@npm:^7.29.4": version: 7.31.2 resolution: "@testing-library/dom@npm:7.31.2" @@ -7417,7 +7357,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/dom@npm:^9.0.0, @testing-library/dom@npm:^9.3.1, @testing-library/dom@npm:^9.3.3, @testing-library/dom@npm:^9.3.4": +"@testing-library/dom@npm:^9.0.0, @testing-library/dom@npm:^9.3.1, @testing-library/dom@npm:^9.3.3": version: 9.3.4 resolution: "@testing-library/dom@npm:9.3.4" dependencies: @@ -7463,9 +7403,9 @@ __metadata: languageName: node linkType: hard -"@testing-library/jest-dom@npm:^6.4.1, @testing-library/jest-dom@npm:^6.4.2": - version: 6.4.2 - resolution: "@testing-library/jest-dom@npm:6.4.2" +"@testing-library/jest-dom@npm:6.4.5, @testing-library/jest-dom@npm:^6.4.1": + version: 6.4.5 + resolution: "@testing-library/jest-dom@npm:6.4.5" dependencies: "@adobe/css-tools": "npm:^4.3.2" "@babel/runtime": "npm:^7.9.2" @@ -7473,7 +7413,7 @@ __metadata: chalk: "npm:^3.0.0" css.escape: "npm:^1.5.1" dom-accessibility-api: "npm:^0.6.3" - lodash: "npm:^4.17.15" + lodash: "npm:^4.17.21" redent: "npm:^3.0.0" peerDependencies: "@jest/globals": ">= 28" @@ -7492,7 +7432,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10c0/e7eba527b34ce30cde94424d2ec685bdfed51daaafb7df9b68b51aec6052e99a50c8bfe654612dacdf857a1eb81d68cf294fc89de558ee3a992bf7a6019fffcc + checksum: 10c0/4cfdd44e2abab2b9d399c47cbfe686729bb65160d7df0f9e2329aaaea7702f6e852a9eefb29b468f00c1e5a5274b684f8cac76959d33299dfa909ba007ea191d languageName: node linkType: hard @@ -7545,7 +7485,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/user-event@npm:^14.4.3, @testing-library/user-event@npm:^14.5.2": +"@testing-library/user-event@npm:14.5.2, @testing-library/user-event@npm:^14.4.3": version: 14.5.2 resolution: "@testing-library/user-event@npm:14.5.2" peerDependencies: @@ -8935,25 +8875,25 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:1.3.1": - version: 1.3.1 - resolution: "@vitest/expect@npm:1.3.1" +"@vitest/expect@npm:1.6.0": + version: 1.6.0 + resolution: "@vitest/expect@npm:1.6.0" dependencies: - "@vitest/spy": "npm:1.3.1" - "@vitest/utils": "npm:1.3.1" + "@vitest/spy": "npm:1.6.0" + "@vitest/utils": "npm:1.6.0" chai: "npm:^4.3.10" - checksum: 10c0/ea66a1e912d896a481a27631b68089b885af7e8ed62ba8aaa119c37a9beafe6c094fd672775a20e6e23460af66e294f9ca259e6e0562708d1b7724eaaf53c7bb + checksum: 10c0/a4351f912a70543e04960f5694f1f1ac95f71a856a46e87bba27d3eb72a08c5d11d35021cbdc6077452a152e7d93723fc804bba76c2cc53c8896b7789caadae3 languageName: node linkType: hard -"@vitest/expect@patch:@vitest/expect@npm%3A1.3.1#~/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch": - version: 1.3.1 - resolution: "@vitest/expect@patch:@vitest/expect@npm%3A1.3.1#~/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch::version=1.3.1&hash=9dbd39" +"@vitest/expect@patch:@vitest/expect@npm%3A1.6.0#~/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch": + version: 1.6.0 + resolution: "@vitest/expect@patch:@vitest/expect@npm%3A1.6.0#~/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch::version=1.6.0&hash=7cb178" dependencies: - "@vitest/spy": "npm:1.3.1" - "@vitest/utils": "npm:1.3.1" + "@vitest/spy": "npm:1.6.0" + "@vitest/utils": "npm:1.6.0" chai: "npm:^4.3.10" - checksum: 10c0/f54446b97ffac9d64653ed771b883e4d733dc4f3bb6d4b161a583a8c5ef0461383f3d457174af71baf5b2d3c92e1b75495f0c1d0cca75644ad4a6f0df8f4ec55 + checksum: 10c0/073cfd09bfe6934408d0041be5a7251c2f80563a655f9387b8cd16a802752b47f1084de921ad6b5c45a48b5447773c52358c1cf68bb7e3b665b44c8cba19d8d3 languageName: node linkType: hard @@ -8988,12 +8928,12 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:1.3.1, @vitest/spy@npm:^1.3.1": - version: 1.3.1 - resolution: "@vitest/spy@npm:1.3.1" +"@vitest/spy@npm:1.6.0": + version: 1.6.0 + resolution: "@vitest/spy@npm:1.6.0" dependencies: tinyspy: "npm:^2.2.0" - checksum: 10c0/efc42f679d2a51fc6583ca3136ccd47581cb27c923ed3cb0500f5dee9aac99b681bfdd400c16ef108f2e0761daa642bc190816a6411931a2aba99ebf8b213dd4 + checksum: 10c0/df66ea6632b44fb76ef6a65c1abbace13d883703aff37cd6d062add6dcd1b883f19ce733af8e0f7feb185b61600c6eb4042a518e4fb66323d0690ec357f9401c languageName: node linkType: hard @@ -9009,15 +8949,15 @@ __metadata: languageName: node linkType: hard -"@vitest/utils@npm:1.3.1, @vitest/utils@npm:^1.3.1": - version: 1.3.1 - resolution: "@vitest/utils@npm:1.3.1" +"@vitest/utils@npm:1.6.0, @vitest/utils@npm:^1.3.1": + version: 1.6.0 + resolution: "@vitest/utils@npm:1.6.0" dependencies: diff-sequences: "npm:^29.6.3" estree-walker: "npm:^3.0.3" loupe: "npm:^2.3.7" pretty-format: "npm:^29.7.0" - checksum: 10c0/d604c8ad3b1aee30d4dcd889098f591407bfe18547ff96485b1d1ed54eff58219c756a9544a7fbd4e37886863abacd7a89a76334cb3ea7f84c3d496bb757db23 + checksum: 10c0/8b0d19835866455eb0b02b31c5ca3d8ad45f41a24e4c7e1f064b480f6b2804dc895a70af332f14c11ed89581011b92b179718523f55f5b14787285a0321b1301 languageName: node linkType: hard @@ -10075,6 +10015,15 @@ __metadata: languageName: node linkType: hard +"aria-query@npm:5.3.0, aria-query@npm:^5.0.0, aria-query@npm:^5.3.0": + version: 5.3.0 + resolution: "aria-query@npm:5.3.0" + dependencies: + dequal: "npm:^2.0.3" + checksum: 10c0/2bff0d4eba5852a9dd578ecf47eaef0e82cc52569b48469b0aac2db5145db0b17b7a58d9e01237706d1e14b7a1b0ac9b78e9c97027ad97679dd8f91b85da1469 + languageName: node + linkType: hard + "aria-query@npm:^4.2.2": version: 4.2.2 resolution: "aria-query@npm:4.2.2" @@ -10085,15 +10034,6 @@ __metadata: languageName: node linkType: hard -"aria-query@npm:^5.3.0": - version: 5.3.0 - resolution: "aria-query@npm:5.3.0" - dependencies: - dequal: "npm:^2.0.3" - checksum: 10c0/2bff0d4eba5852a9dd578ecf47eaef0e82cc52569b48469b0aac2db5145db0b17b7a58d9e01237706d1e14b7a1b0ac9b78e9c97027ad97679dd8f91b85da1469 - languageName: node - linkType: hard - "arr-diff@npm:^4.0.0": version: 4.0.0 resolution: "arr-diff@npm:4.0.0" @@ -10636,7 +10576,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.4.10": +"babel-plugin-polyfill-corejs2@npm:^0.4.10, babel-plugin-polyfill-corejs2@npm:^0.4.8": version: 0.4.11 resolution: "babel-plugin-polyfill-corejs2@npm:0.4.11" dependencies: @@ -10649,19 +10589,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.4.8": - version: 0.4.9 - resolution: "babel-plugin-polyfill-corejs2@npm:0.4.9" - dependencies: - "@babel/compat-data": "npm:^7.22.6" - "@babel/helper-define-polyfill-provider": "npm:^0.6.0" - semver: "npm:^6.3.1" - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/2cd47af763eb40aa41f1d6d9cbf1bdd217ff6c28f614b057c0328ee42a4d82cbcdcbc7d081d93e2a2d80446c899f25c3ebec048a63d260ef65a0a364134f71cd - languageName: node - linkType: hard - "babel-plugin-polyfill-corejs3@npm:^0.10.1, babel-plugin-polyfill-corejs3@npm:^0.10.4": version: 0.10.4 resolution: "babel-plugin-polyfill-corejs3@npm:0.10.4" @@ -10901,26 +10828,6 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:1.20.1": - version: 1.20.1 - resolution: "body-parser@npm:1.20.1" - dependencies: - bytes: "npm:3.1.2" - content-type: "npm:~1.0.4" - debug: "npm:2.6.9" - depd: "npm:2.0.0" - destroy: "npm:1.2.0" - http-errors: "npm:2.0.0" - iconv-lite: "npm:0.4.24" - on-finished: "npm:2.4.1" - qs: "npm:6.11.0" - raw-body: "npm:2.5.1" - type-is: "npm:~1.6.18" - unpipe: "npm:1.0.0" - checksum: 10c0/a202d493e2c10a33fb7413dac7d2f713be579c4b88343cd814b6df7a38e5af1901fc31044e04de176db56b16d9772aa25a7723f64478c20f4d91b1ac223bf3b8 - languageName: node - linkType: hard - "body-parser@npm:1.20.2": version: 1.20.2 resolution: "body-parser@npm:1.20.2" @@ -12482,13 +12389,6 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.5.0": - version: 0.5.0 - resolution: "cookie@npm:0.5.0" - checksum: 10c0/c01ca3ef8d7b8187bae434434582288681273b5a9ed27521d4d7f9f7928fe0c920df0decd9f9d3bbd2d14ac432b8c8cf42b98b3bdd5bfe0e6edddeebebe8b61d - languageName: node - linkType: hard - "cookie@npm:0.6.0": version: 0.6.0 resolution: "cookie@npm:0.6.0" @@ -15150,46 +15050,7 @@ __metadata: languageName: node linkType: hard -"express@npm:^4.17.3": - version: 4.18.2 - resolution: "express@npm:4.18.2" - dependencies: - accepts: "npm:~1.3.8" - array-flatten: "npm:1.1.1" - body-parser: "npm:1.20.1" - content-disposition: "npm:0.5.4" - content-type: "npm:~1.0.4" - cookie: "npm:0.5.0" - cookie-signature: "npm:1.0.6" - debug: "npm:2.6.9" - depd: "npm:2.0.0" - encodeurl: "npm:~1.0.2" - escape-html: "npm:~1.0.3" - etag: "npm:~1.8.1" - finalhandler: "npm:1.2.0" - fresh: "npm:0.5.2" - http-errors: "npm:2.0.0" - merge-descriptors: "npm:1.0.1" - methods: "npm:~1.1.2" - on-finished: "npm:2.4.1" - parseurl: "npm:~1.3.3" - path-to-regexp: "npm:0.1.7" - proxy-addr: "npm:~2.0.7" - qs: "npm:6.11.0" - range-parser: "npm:~1.2.1" - safe-buffer: "npm:5.2.1" - send: "npm:0.18.0" - serve-static: "npm:1.15.0" - setprototypeof: "npm:1.2.0" - statuses: "npm:2.0.1" - type-is: "npm:~1.6.18" - utils-merge: "npm:1.0.1" - vary: "npm:~1.1.2" - checksum: 10c0/75af556306b9241bc1d7bdd40c9744b516c38ce50ae3210658efcbf96e3aed4ab83b3432f06215eae5610c123bc4136957dc06e50dfc50b7d4d775af56c4c59c - languageName: node - linkType: hard - -"express@npm:^4.19.2": +"express@npm:^4.17.3, express@npm:^4.19.2": version: 4.19.2 resolution: "express@npm:4.19.2" dependencies: @@ -24000,18 +23861,6 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:2.5.1": - version: 2.5.1 - resolution: "raw-body@npm:2.5.1" - dependencies: - bytes: "npm:3.1.2" - http-errors: "npm:2.0.0" - iconv-lite: "npm:0.4.24" - unpipe: "npm:1.0.0" - checksum: 10c0/5dad5a3a64a023b894ad7ab4e5c7c1ce34d3497fc7138d02f8c88a3781e68d8a55aa7d4fd3a458616fa8647cc228be314a1c03fb430a07521de78b32c4dd09d2 - languageName: node - linkType: hard - "raw-body@npm:2.5.2": version: 2.5.2 resolution: "raw-body@npm:2.5.2" @@ -28049,23 +27898,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.0.3, typescript@npm:^5.3.2, typescript@npm:~5.3.2": - version: 5.3.3 - resolution: "typescript@npm:5.3.3" +"typescript@npm:^5.0.3, typescript@npm:^5.3.2, typescript@npm:^5.4.3": + version: 5.4.3 + resolution: "typescript@npm:5.4.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/e33cef99d82573624fc0f854a2980322714986bc35b9cb4d1ce736ed182aeab78e2cb32b385efa493b2a976ef52c53e20d6c6918312353a91850e2b76f1ea44f + checksum: 10c0/22443a8760c3668e256c0b34b6b45c359ef6cecc10c42558806177a7d500ab1a7d7aac1f976d712e26989ddf6731d2fbdd3212b7c73290a45127c1c43ba2005a languageName: node linkType: hard -"typescript@npm:^5.4.3": - version: 5.4.3 - resolution: "typescript@npm:5.4.3" +"typescript@npm:~5.3.2": + version: 5.3.3 + resolution: "typescript@npm:5.3.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/22443a8760c3668e256c0b34b6b45c359ef6cecc10c42558806177a7d500ab1a7d7aac1f976d712e26989ddf6731d2fbdd3212b7c73290a45127c1c43ba2005a + checksum: 10c0/e33cef99d82573624fc0f854a2980322714986bc35b9cb4d1ce736ed182aeab78e2cb32b385efa493b2a976ef52c53e20d6c6918312353a91850e2b76f1ea44f languageName: node linkType: hard @@ -28079,23 +27928,23 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.0.3#optional!builtin, typescript@patch:typescript@npm%3A^5.3.2#optional!builtin, typescript@patch:typescript@npm%3A~5.3.2#optional!builtin": - version: 5.3.3 - resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" +"typescript@patch:typescript@npm%3A^5.0.3#optional!builtin, typescript@patch:typescript@npm%3A^5.3.2#optional!builtin, typescript@patch:typescript@npm%3A^5.4.3#optional!builtin": + version: 5.4.3 + resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin::version=5.4.3&hash=5adc0c" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/1d0a5f4ce496c42caa9a30e659c467c5686eae15d54b027ee7866744952547f1be1262f2d40de911618c242b510029d51d43ff605dba8fb740ec85ca2d3f9500 + checksum: 10c0/6e51f8b7e6ec55b897b9e56b67e864fe8f44e30f4a14357aad5dc0f7432db2f01efc0522df0b6c36d361c51f2dc3dcac5c832efd96a404cfabf884e915d38828 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin": - version: 5.4.3 - resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin::version=5.4.3&hash=5adc0c" +"typescript@patch:typescript@npm%3A~5.3.2#optional!builtin": + version: 5.3.3 + resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/6e51f8b7e6ec55b897b9e56b67e864fe8f44e30f4a14357aad5dc0f7432db2f01efc0522df0b6c36d361c51f2dc3dcac5c832efd96a404cfabf884e915d38828 + checksum: 10c0/1d0a5f4ce496c42caa9a30e659c467c5686eae15d54b027ee7866744952547f1be1262f2d40de911618c242b510029d51d43ff605dba8fb740ec85ca2d3f9500 languageName: node linkType: hard From 40b1799386f65e3b18b103e91d067aae7ad4be1b Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Wed, 5 Jun 2024 16:44:14 +0200 Subject: [PATCH 20/32] Update deps --- .../portable-stories-kitchen-sink/nextjs/package.json | 2 +- .../portable-stories-kitchen-sink/react/package.json | 2 +- test-storybooks/portable-stories-kitchen-sink/vue3/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json b/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json index 072270485f6a..9f6c1133c07d 100644 --- a/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json @@ -26,7 +26,7 @@ "@storybook/nextjs": "^8.0.0", "@storybook/react": "^8.0.0", "@storybook/test": "^8.0.0", - "@testing-library/jest-dom": "^6.4.2", + "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^14.2.1", "@types/react": "^18.2.55", "@types/react-dom": "^18.2.19", diff --git a/test-storybooks/portable-stories-kitchen-sink/react/package.json b/test-storybooks/portable-stories-kitchen-sink/react/package.json index 591c4bbf2771..22536659e00c 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/react/package.json @@ -28,7 +28,7 @@ "@storybook/test": "^8.0.0", "@swc/core": "^1.4.2", "@swc/jest": "^0.2.36", - "@testing-library/jest-dom": "^6.4.2", + "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^14.2.1", "@types/identity-obj-proxy": "^3", "@types/react": "^18.2.55", diff --git a/test-storybooks/portable-stories-kitchen-sink/vue3/package.json b/test-storybooks/portable-stories-kitchen-sink/vue3/package.json index f576b4dd3ee8..537062cf9f74 100644 --- a/test-storybooks/portable-stories-kitchen-sink/vue3/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/vue3/package.json @@ -24,7 +24,7 @@ "@storybook/test": "^8.0.0", "@storybook/vue3": "^8.0.0", "@storybook/vue3-vite": "^8.0.0", - "@testing-library/jest-dom": "^6.4.2", + "@testing-library/jest-dom": "^6.4.5", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", "@vitejs/plugin-vue": "^5.0.4", From 94d1bbd7e810d1da2a468839cf699cb2c4edba4c Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Thu, 6 Jun 2024 17:07:45 +0200 Subject: [PATCH 21/32] Addon-action: Only log spies with names --- code/addons/actions/src/loaders.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/code/addons/actions/src/loaders.ts b/code/addons/actions/src/loaders.ts index eebb09acb71b..a2d479367f9a 100644 --- a/code/addons/actions/src/loaders.ts +++ b/code/addons/actions/src/loaders.ts @@ -20,6 +20,7 @@ const logActionsWhenMockCalled: LoaderFunction = (context) => { const onMockCall = global.__STORYBOOK_TEST_ON_MOCK_CALL__ as typeof onMockCallType; onMockCall((mock, args) => { const name = mock.getMockName(); + if (name === 'spy') return; // TODO: Make this a configurable API in 8.2 if ( From 60db7ba592afe98206142496940c56c60569a49d Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 7 Jun 2024 00:25:46 +0800 Subject: [PATCH 22/32] Review feedback --- .../src/modules/store/csf/portable-stories.test.ts | 4 +--- code/lib/types/src/modules/composedStory.ts | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts b/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts index 893596f03ea4..425e2162c425 100644 --- a/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts +++ b/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts @@ -67,9 +67,7 @@ describe('composeStory', () => { expect(composedStory.parameters).toEqual( expect.objectContaining({ ...Story.parameters, ...meta.parameters }) ); - expect(composedStory.tags).toEqual( - expect.arrayContaining([...Story.tags!, ...projectAnnotations.tags, ...meta.tags!]) - ); + expect(composedStory.tags).toEqual(['dev', 'test', 'projectTag', 'metaTag', 'storyTag']); composedStory(); diff --git a/code/lib/types/src/modules/composedStory.ts b/code/lib/types/src/modules/composedStory.ts index ffbc0a2122af..f4b49f24793a 100644 --- a/code/lib/types/src/modules/composedStory.ts +++ b/code/lib/types/src/modules/composedStory.ts @@ -6,6 +6,7 @@ import type { Renderer, StoryId, StrictArgTypes, + Tag, } from '@storybook/csf'; import type { @@ -56,7 +57,7 @@ export type ComposedStoryFn< storyName: string; parameters: Parameters; argTypes: StrictArgTypes; - tags: string[]; + tags: Tag[]; }; /** * Based on a module of stories, it returns all stories within it, filtering non-stories From a97603c68a7227f18bc64b3c729c87b1baa8f239 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:58:57 +0000 Subject: [PATCH 23/32] Write changelog for 8.2.0-alpha.6 [skip ci] --- CHANGELOG.prerelease.md | 10 ++++++++++ code/package.json | 3 ++- docs/versions/next.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 7bcf905f3bc2..f15a15ea9b0e 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,13 @@ +## 8.2.0-alpha.6 + +- Addon-actions: Only log spies with names - [#28091](https://github.com/storybookjs/storybook/pull/28091), thanks @kasperpeulen! +- Build: Change require/import order, so that import has higher prio if both are specified - [#27730](https://github.com/storybookjs/storybook/pull/27730), thanks @kasperpeulen! +- CLI: Only log the UpgradeStorybookToSameVersionError but continue the upgrade as normal - [#27217](https://github.com/storybookjs/storybook/pull/27217), thanks @kasperpeulen! +- Core: Replace ip function with a small helper function to address security concerns - [#27529](https://github.com/storybookjs/storybook/pull/27529), thanks @tony19! +- Portable Stories: Add tags to composed story - [#27708](https://github.com/storybookjs/storybook/pull/27708), thanks @yannbf! +- Test: Upgrade deps of @storybook/test - [#27862](https://github.com/storybookjs/storybook/pull/27862), thanks @kasperpeulen! +- Vite: Fix stats-plugin to normalize file names with posix paths - [#27218](https://github.com/storybookjs/storybook/pull/27218), thanks @AlexAtVista! + ## 8.2.0-alpha.5 - Angular: Fix wrong detection of standalone components - [#27353](https://github.com/storybookjs/storybook/pull/27353), thanks @dario-baumberger! diff --git a/code/package.json b/code/package.json index 0932e56ecd00..4e430f5eafb5 100644 --- a/code/package.json +++ b/code/package.json @@ -297,5 +297,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "8.2.0-alpha.6" } diff --git a/docs/versions/next.json b/docs/versions/next.json index 467a20f42b4c..26523a287829 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.2.0-alpha.5","info":{"plain":"- Angular: Fix wrong detection of standalone components - [#27353](https://github.com/storybookjs/storybook/pull/27353), thanks @dario-baumberger!\n- Dependency: Bump Express.js - [#26680](https://github.com/storybookjs/storybook/pull/26680), thanks @valentinpalkovic!\n- Tags: Fix unsafe project-level tags lookup - [#27511](https://github.com/storybookjs/storybook/pull/27511), thanks @shilman!"}} +{"version":"8.2.0-alpha.6","info":{"plain":"- Addon-actions: Only log spies with names - [#28091](https://github.com/storybookjs/storybook/pull/28091), thanks @kasperpeulen!\n- Build: Change require/import order, so that import has higher prio if both are specified - [#27730](https://github.com/storybookjs/storybook/pull/27730), thanks @kasperpeulen!\n- CLI: Only log the UpgradeStorybookToSameVersionError but continue the upgrade as normal - [#27217](https://github.com/storybookjs/storybook/pull/27217), thanks @kasperpeulen!\n- Core: Replace ip function with a small helper function to address security concerns - [#27529](https://github.com/storybookjs/storybook/pull/27529), thanks @tony19!\n- Portable Stories: Add tags to composed story - [#27708](https://github.com/storybookjs/storybook/pull/27708), thanks @yannbf!\n- Test: Upgrade deps of @storybook/test - [#27862](https://github.com/storybookjs/storybook/pull/27862), thanks @kasperpeulen!\n- Vite: Fix stats-plugin to normalize file names with posix paths - [#27218](https://github.com/storybookjs/storybook/pull/27218), thanks @AlexAtVista!"}} From 3f3cb5d1f7dbd2d6cab99313a45dbef9a4f7ff2b Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Fri, 7 Jun 2024 02:22:32 +0000 Subject: [PATCH 24/32] Bump version from "8.2.0-alpha.5" to "8.2.0-alpha.6" [skip ci] --- code/addons/a11y/package.json | 2 +- code/addons/actions/package.json | 2 +- code/addons/backgrounds/package.json | 2 +- code/addons/controls/package.json | 2 +- code/addons/docs/package.json | 2 +- code/addons/essentials/package.json | 2 +- code/addons/gfm/package.json | 2 +- code/addons/highlight/package.json | 2 +- code/addons/interactions/package.json | 2 +- code/addons/jest/package.json | 2 +- code/addons/links/package.json | 2 +- code/addons/measure/package.json | 2 +- code/addons/onboarding/package.json | 2 +- code/addons/outline/package.json | 2 +- code/addons/storysource/package.json | 2 +- code/addons/themes/package.json | 2 +- code/addons/toolbars/package.json | 2 +- code/addons/viewport/package.json | 2 +- code/builders/builder-manager/package.json | 2 +- code/builders/builder-vite/package.json | 2 +- code/builders/builder-webpack5/package.json | 2 +- code/frameworks/angular/package.json | 2 +- code/frameworks/ember/package.json | 2 +- code/frameworks/html-vite/package.json | 2 +- code/frameworks/html-webpack5/package.json | 2 +- code/frameworks/nextjs/package.json | 2 +- code/frameworks/preact-vite/package.json | 2 +- code/frameworks/preact-webpack5/package.json | 2 +- code/frameworks/react-vite/package.json | 2 +- code/frameworks/react-webpack5/package.json | 2 +- code/frameworks/server-webpack5/package.json | 2 +- code/frameworks/svelte-vite/package.json | 2 +- code/frameworks/svelte-webpack5/package.json | 2 +- code/frameworks/sveltekit/package.json | 2 +- code/frameworks/vue3-vite/package.json | 2 +- code/frameworks/vue3-webpack5/package.json | 2 +- .../web-components-vite/package.json | 2 +- .../web-components-webpack5/package.json | 2 +- code/lib/channels/package.json | 2 +- code/lib/cli-sb/package.json | 2 +- code/lib/cli-storybook/package.json | 2 +- code/lib/cli/package.json | 2 +- code/lib/client-logger/package.json | 2 +- code/lib/codemod/package.json | 2 +- code/lib/core-common/package.json | 2 +- code/lib/core-common/src/versions.ts | 160 +++++++++--------- code/lib/core-events/package.json | 2 +- code/lib/core-server/package.json | 2 +- code/lib/core-webpack/package.json | 2 +- code/lib/csf-plugin/package.json | 2 +- code/lib/csf-tools/package.json | 2 +- code/lib/docs-tools/package.json | 2 +- code/lib/instrumenter/package.json | 2 +- code/lib/manager-api/package.json | 2 +- code/lib/manager-api/src/version.ts | 2 +- code/lib/node-logger/package.json | 2 +- code/lib/preview-api/package.json | 2 +- code/lib/preview/package.json | 2 +- code/lib/react-dom-shim/package.json | 2 +- code/lib/router/package.json | 2 +- code/lib/source-loader/package.json | 2 +- code/lib/telemetry/package.json | 2 +- code/lib/test/package.json | 2 +- code/lib/theming/package.json | 2 +- code/lib/types/package.json | 2 +- code/package.json | 5 +- code/presets/create-react-app/package.json | 2 +- code/presets/html-webpack/package.json | 2 +- code/presets/preact-webpack/package.json | 2 +- code/presets/react-webpack/package.json | 2 +- code/presets/server-webpack/package.json | 2 +- code/presets/svelte-webpack/package.json | 2 +- code/presets/vue3-webpack/package.json | 2 +- code/renderers/html/package.json | 2 +- code/renderers/preact/package.json | 2 +- code/renderers/react/package.json | 2 +- code/renderers/server/package.json | 2 +- code/renderers/svelte/package.json | 2 +- code/renderers/vue3/package.json | 2 +- code/renderers/web-components/package.json | 2 +- code/ui/blocks/package.json | 2 +- code/ui/components/package.json | 2 +- code/ui/manager/package.json | 2 +- 83 files changed, 163 insertions(+), 164 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index d7f7a97d24c5..2aeed947237a 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 35866de65e86..6853af10ffb7 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 98252d64b039..bf05bfeb36ed 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index fbdf633f3ef7..92d33059d918 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 9137b1804ddc..0c7a0db78541 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 3de10dfcff70..d655123a021a 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index c2821c4f8e29..a06c050ad458 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 2302c2f1e3cc..72cc2204faa8 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 2df28b071a6e..42ebff7780a0 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 24415e61e289..89ffc4accd2c 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 52b44dfdd422..6b3a3565880f 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "addon", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index adb3e935c080..738617a43cba 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/onboarding/package.json b/code/addons/onboarding/package.json index 0eaafa4f016e..6a3210ad3f79 100644 --- a/code/addons/onboarding/package.json +++ b/code/addons/onboarding/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-onboarding", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Addon Onboarding - Introduces a new onboarding experience", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index c121331c3682..22ef4732f279 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index a7bc35268745..5f20fd4915d8 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index 34e08f4d2801..389e3db56634 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-themes", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Switch between multiple themes for you components in Storybook", "keywords": [ "css", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index efe83d09032d..5fa83fdeff46 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index b69c208a3296..e630c077f42f 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json index d31e22ff22de..d4d87df93b00 100644 --- a/code/builders/builder-manager/package.json +++ b/code/builders/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook manager builder", "keywords": [ "storybook" diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 44cb42b7517a..735a3225a8e3 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 928d84f95d11..d6f65b9aed2b 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 3be1758e1541..b53d5fc7ece0 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 6fb22a528e7b..067f462d5968 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index c3ca5690371d..8c7650892b19 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index d40bb42182f0..ce8b2fa4ec30 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 791965a931d5..592d28880d00 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Next.js", "keywords": [ "storybook", diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index bc8a6052d5ba..ad6c5c403e51 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index ea5236693efc..a8a138237adb 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 55d69b602592..a9ac52364148 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 40d69e46abc4..dc6db63e6407 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index fe715841047e..cef50a93244f 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 3e0e88aff337..8cf81dbcf28a 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index f3f705dba22d..30d2c7a559ff 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index d0ecbd692a6d..4e0b178a190b 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for SvelteKit", "keywords": [ "storybook", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index d4608d34ed50..9b82e91b42a6 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 75088d17849a..4f4fe51beeae 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index df4a459c8013..18c070d04afa 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 7c858232f63c..3aa3b098e498 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index 201cfe461b77..a90f029acbf3 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index c9ea662ba9de..6a4ea600af4e 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index 3720a8c341ce..85d88756d72c 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index acd759f8f67f..59f285cd422c 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook's CLI - install, dev, build, upgrade, and more", "keywords": [ "cli", diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index 1d0c363df0ce..1a186362de3f 100644 --- a/code/lib/client-logger/package.json +++ b/code/lib/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 7fc0f6fd0c84..326c94b99fd6 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index e0ac74e5fc07..4f805f5e54ea 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/core-common/src/versions.ts b/code/lib/core-common/src/versions.ts index 1e098af7355a..938bb031fdb6 100644 --- a/code/lib/core-common/src/versions.ts +++ b/code/lib/core-common/src/versions.ts @@ -1,83 +1,83 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '8.2.0-alpha.5', - '@storybook/addon-actions': '8.2.0-alpha.5', - '@storybook/addon-backgrounds': '8.2.0-alpha.5', - '@storybook/addon-controls': '8.2.0-alpha.5', - '@storybook/addon-docs': '8.2.0-alpha.5', - '@storybook/addon-essentials': '8.2.0-alpha.5', - '@storybook/addon-highlight': '8.2.0-alpha.5', - '@storybook/addon-interactions': '8.2.0-alpha.5', - '@storybook/addon-jest': '8.2.0-alpha.5', - '@storybook/addon-links': '8.2.0-alpha.5', - '@storybook/addon-mdx-gfm': '8.2.0-alpha.5', - '@storybook/addon-measure': '8.2.0-alpha.5', - '@storybook/addon-onboarding': '8.2.0-alpha.5', - '@storybook/addon-outline': '8.2.0-alpha.5', - '@storybook/addon-storysource': '8.2.0-alpha.5', - '@storybook/addon-themes': '8.2.0-alpha.5', - '@storybook/addon-toolbars': '8.2.0-alpha.5', - '@storybook/addon-viewport': '8.2.0-alpha.5', - '@storybook/angular': '8.2.0-alpha.5', - '@storybook/blocks': '8.2.0-alpha.5', - '@storybook/builder-manager': '8.2.0-alpha.5', - '@storybook/builder-vite': '8.2.0-alpha.5', - '@storybook/builder-webpack5': '8.2.0-alpha.5', - '@storybook/channels': '8.2.0-alpha.5', - '@storybook/cli': '8.2.0-alpha.5', - '@storybook/client-logger': '8.2.0-alpha.5', - '@storybook/codemod': '8.2.0-alpha.5', - '@storybook/components': '8.2.0-alpha.5', - '@storybook/core-common': '8.2.0-alpha.5', - '@storybook/core-events': '8.2.0-alpha.5', - '@storybook/core-server': '8.2.0-alpha.5', - '@storybook/core-webpack': '8.2.0-alpha.5', - '@storybook/csf-plugin': '8.2.0-alpha.5', - '@storybook/csf-tools': '8.2.0-alpha.5', - '@storybook/docs-tools': '8.2.0-alpha.5', - '@storybook/ember': '8.2.0-alpha.5', - '@storybook/html': '8.2.0-alpha.5', - '@storybook/html-vite': '8.2.0-alpha.5', - '@storybook/html-webpack5': '8.2.0-alpha.5', - '@storybook/instrumenter': '8.2.0-alpha.5', - '@storybook/manager': '8.2.0-alpha.5', - '@storybook/manager-api': '8.2.0-alpha.5', - '@storybook/nextjs': '8.2.0-alpha.5', - '@storybook/node-logger': '8.2.0-alpha.5', - '@storybook/preact': '8.2.0-alpha.5', - '@storybook/preact-vite': '8.2.0-alpha.5', - '@storybook/preact-webpack5': '8.2.0-alpha.5', - '@storybook/preset-create-react-app': '8.2.0-alpha.5', - '@storybook/preset-html-webpack': '8.2.0-alpha.5', - '@storybook/preset-preact-webpack': '8.2.0-alpha.5', - '@storybook/preset-react-webpack': '8.2.0-alpha.5', - '@storybook/preset-server-webpack': '8.2.0-alpha.5', - '@storybook/preset-svelte-webpack': '8.2.0-alpha.5', - '@storybook/preset-vue3-webpack': '8.2.0-alpha.5', - '@storybook/preview': '8.2.0-alpha.5', - '@storybook/preview-api': '8.2.0-alpha.5', - '@storybook/react': '8.2.0-alpha.5', - '@storybook/react-dom-shim': '8.2.0-alpha.5', - '@storybook/react-vite': '8.2.0-alpha.5', - '@storybook/react-webpack5': '8.2.0-alpha.5', - '@storybook/router': '8.2.0-alpha.5', - '@storybook/server': '8.2.0-alpha.5', - '@storybook/server-webpack5': '8.2.0-alpha.5', - '@storybook/source-loader': '8.2.0-alpha.5', - '@storybook/svelte': '8.2.0-alpha.5', - '@storybook/svelte-vite': '8.2.0-alpha.5', - '@storybook/svelte-webpack5': '8.2.0-alpha.5', - '@storybook/sveltekit': '8.2.0-alpha.5', - '@storybook/telemetry': '8.2.0-alpha.5', - '@storybook/test': '8.2.0-alpha.5', - '@storybook/theming': '8.2.0-alpha.5', - '@storybook/types': '8.2.0-alpha.5', - '@storybook/vue3': '8.2.0-alpha.5', - '@storybook/vue3-vite': '8.2.0-alpha.5', - '@storybook/vue3-webpack5': '8.2.0-alpha.5', - '@storybook/web-components': '8.2.0-alpha.5', - '@storybook/web-components-vite': '8.2.0-alpha.5', - '@storybook/web-components-webpack5': '8.2.0-alpha.5', - sb: '8.2.0-alpha.5', - storybook: '8.2.0-alpha.5', + '@storybook/addon-a11y': '8.2.0-alpha.6', + '@storybook/addon-actions': '8.2.0-alpha.6', + '@storybook/addon-backgrounds': '8.2.0-alpha.6', + '@storybook/addon-controls': '8.2.0-alpha.6', + '@storybook/addon-docs': '8.2.0-alpha.6', + '@storybook/addon-essentials': '8.2.0-alpha.6', + '@storybook/addon-highlight': '8.2.0-alpha.6', + '@storybook/addon-interactions': '8.2.0-alpha.6', + '@storybook/addon-jest': '8.2.0-alpha.6', + '@storybook/addon-links': '8.2.0-alpha.6', + '@storybook/addon-mdx-gfm': '8.2.0-alpha.6', + '@storybook/addon-measure': '8.2.0-alpha.6', + '@storybook/addon-onboarding': '8.2.0-alpha.6', + '@storybook/addon-outline': '8.2.0-alpha.6', + '@storybook/addon-storysource': '8.2.0-alpha.6', + '@storybook/addon-themes': '8.2.0-alpha.6', + '@storybook/addon-toolbars': '8.2.0-alpha.6', + '@storybook/addon-viewport': '8.2.0-alpha.6', + '@storybook/angular': '8.2.0-alpha.6', + '@storybook/blocks': '8.2.0-alpha.6', + '@storybook/builder-manager': '8.2.0-alpha.6', + '@storybook/builder-vite': '8.2.0-alpha.6', + '@storybook/builder-webpack5': '8.2.0-alpha.6', + '@storybook/channels': '8.2.0-alpha.6', + '@storybook/cli': '8.2.0-alpha.6', + '@storybook/client-logger': '8.2.0-alpha.6', + '@storybook/codemod': '8.2.0-alpha.6', + '@storybook/components': '8.2.0-alpha.6', + '@storybook/core-common': '8.2.0-alpha.6', + '@storybook/core-events': '8.2.0-alpha.6', + '@storybook/core-server': '8.2.0-alpha.6', + '@storybook/core-webpack': '8.2.0-alpha.6', + '@storybook/csf-plugin': '8.2.0-alpha.6', + '@storybook/csf-tools': '8.2.0-alpha.6', + '@storybook/docs-tools': '8.2.0-alpha.6', + '@storybook/ember': '8.2.0-alpha.6', + '@storybook/html': '8.2.0-alpha.6', + '@storybook/html-vite': '8.2.0-alpha.6', + '@storybook/html-webpack5': '8.2.0-alpha.6', + '@storybook/instrumenter': '8.2.0-alpha.6', + '@storybook/manager': '8.2.0-alpha.6', + '@storybook/manager-api': '8.2.0-alpha.6', + '@storybook/nextjs': '8.2.0-alpha.6', + '@storybook/node-logger': '8.2.0-alpha.6', + '@storybook/preact': '8.2.0-alpha.6', + '@storybook/preact-vite': '8.2.0-alpha.6', + '@storybook/preact-webpack5': '8.2.0-alpha.6', + '@storybook/preset-create-react-app': '8.2.0-alpha.6', + '@storybook/preset-html-webpack': '8.2.0-alpha.6', + '@storybook/preset-preact-webpack': '8.2.0-alpha.6', + '@storybook/preset-react-webpack': '8.2.0-alpha.6', + '@storybook/preset-server-webpack': '8.2.0-alpha.6', + '@storybook/preset-svelte-webpack': '8.2.0-alpha.6', + '@storybook/preset-vue3-webpack': '8.2.0-alpha.6', + '@storybook/preview': '8.2.0-alpha.6', + '@storybook/preview-api': '8.2.0-alpha.6', + '@storybook/react': '8.2.0-alpha.6', + '@storybook/react-dom-shim': '8.2.0-alpha.6', + '@storybook/react-vite': '8.2.0-alpha.6', + '@storybook/react-webpack5': '8.2.0-alpha.6', + '@storybook/router': '8.2.0-alpha.6', + '@storybook/server': '8.2.0-alpha.6', + '@storybook/server-webpack5': '8.2.0-alpha.6', + '@storybook/source-loader': '8.2.0-alpha.6', + '@storybook/svelte': '8.2.0-alpha.6', + '@storybook/svelte-vite': '8.2.0-alpha.6', + '@storybook/svelte-webpack5': '8.2.0-alpha.6', + '@storybook/sveltekit': '8.2.0-alpha.6', + '@storybook/telemetry': '8.2.0-alpha.6', + '@storybook/test': '8.2.0-alpha.6', + '@storybook/theming': '8.2.0-alpha.6', + '@storybook/types': '8.2.0-alpha.6', + '@storybook/vue3': '8.2.0-alpha.6', + '@storybook/vue3-vite': '8.2.0-alpha.6', + '@storybook/vue3-webpack5': '8.2.0-alpha.6', + '@storybook/web-components': '8.2.0-alpha.6', + '@storybook/web-components-vite': '8.2.0-alpha.6', + '@storybook/web-components-webpack5': '8.2.0-alpha.6', + sb: '8.2.0-alpha.6', + storybook: '8.2.0-alpha.6', }; diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index d54c3ba7ae95..e9391f8fa08d 100644 --- a/code/lib/core-events/package.json +++ b/code/lib/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index 89db30c28aae..9f832722a45a 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index 3d19b4bc69f1..f6e99b0448c9 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index 45c5f8fdb3cd..7ebbffb201dd 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index ea0d2bd6b613..d79bdfd7b05f 100644 --- a/code/lib/csf-tools/package.json +++ b/code/lib/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index 3ff4941ccf0d..af9fa6cd2fc8 100644 --- a/code/lib/docs-tools/package.json +++ b/code/lib/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 8e7b95055e0d..3d196b4eb5c7 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index b445cf4c9882..d6d6566f210e 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" diff --git a/code/lib/manager-api/src/version.ts b/code/lib/manager-api/src/version.ts index 6b3f64cd9cd3..e93b3f36000a 100644 --- a/code/lib/manager-api/src/version.ts +++ b/code/lib/manager-api/src/version.ts @@ -1 +1 @@ -export const version = '8.2.0-alpha.5'; +export const version = '8.2.0-alpha.6'; diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index a3faf09985d2..4b8dc0e96dfe 100644 --- a/code/lib/node-logger/package.json +++ b/code/lib/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index 858a2191bb18..77676813060c 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 56885577778d..5a104ae99f58 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index ada371a47e77..8afbdaab29e0 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 97662d45cf09..7ddd5e1f1da4 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 3780ccf7082d..1f9b0823073e 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Source loader", "keywords": [ "lib", diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json index 4a09035fca76..fe50d3cf7e68 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" diff --git a/code/lib/test/package.json b/code/lib/test/package.json index 1ae789143982..a5081369e5c5 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/test", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index 74e75c191892..8cabe4b136c5 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/lib/types/package.json b/code/lib/types/package.json index 0408d190e02c..22fe63c075ec 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook TS Types", "keywords": [ "storybook" diff --git a/code/package.json b/code/package.json index 4e430f5eafb5..e9414600048a 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -297,6 +297,5 @@ "Dependency Upgrades" ] ] - }, - "deferredNextVersion": "8.2.0-alpha.6" + } } diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index c7aa0f96164f..e640a82301ce 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Create React App preset", "keywords": [ "storybook" diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index ad0dea6eb8f0..5829ba58ddce 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 838d3d4d858a..3c06a504fa36 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 54c1bed8f156..0bc7f9b7b2b5 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index d9a15a1c98e5..93635391d9e2 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 8d3396f1bf00..63e2649dc111 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 7adb79525110..430ffe5ade46 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 6ef005dfb98f..f9ccf6b70484 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook HTML renderer", "keywords": [ "storybook" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 654100b78455..5b3cbb607aa9 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Preact renderer", "keywords": [ "storybook" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 508a429375b8..b60d351ebb2e 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook React renderer", "keywords": [ "storybook" diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index cd8f5400a922..3af40544ea9f 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Server renderer", "keywords": [ "storybook" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index 52e30e920ce7..361a3c49f72c 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Svelte renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index 1c1336e51e2c..098ae7721e2b 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index b830983baf9f..e3967365de15 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook web-components renderer", "keywords": [ "lit", diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index 8b42b7801bf8..90546091c538 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Doc Blocks", "keywords": [ "storybook" diff --git a/code/ui/components/package.json b/code/ui/components/package.json index 179ea366663d..bbc5f475b5ff 100644 --- a/code/ui/components/package.json +++ b/code/ui/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/ui/manager/package.json b/code/ui/manager/package.json index 56c4b155f356..98b3a9c04187 100644 --- a/code/ui/manager/package.json +++ b/code/ui/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook UI", "keywords": [ "storybook" From 88097b55b536fe5efee46c02ef4b6703651f3bc3 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 7 Jun 2024 13:58:10 +0200 Subject: [PATCH 25/32] Angular: Allow outputPath object syntax --- code/frameworks/angular/src/server/angular-cli-webpack.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/frameworks/angular/src/server/angular-cli-webpack.js b/code/frameworks/angular/src/server/angular-cli-webpack.js index 621680125536..f4e667fee6ee 100644 --- a/code/frameworks/angular/src/server/angular-cli-webpack.js +++ b/code/frameworks/angular/src/server/angular-cli-webpack.js @@ -68,6 +68,10 @@ exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext } styles: builderOptions.styles ?.map((style) => (typeof style === 'string' ? style : style.input)) .filter((style) => typeof style === 'string' || style.inject !== false), + outputPath: + typeof builderOptions.outputPath === 'string' + ? builderOptions.outputPath + : builderOptions.outputPath?.base, // Fixed options optimization: false, From 6f19ef586e7bb21a447352dd033a0663333d5771 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 7 Jun 2024 14:09:25 +0200 Subject: [PATCH 26/32] Angular: Add preserveSymlinks option to Storybook builders --- .../frameworks/angular/src/builders/build-storybook/index.ts | 3 +++ .../angular/src/builders/build-storybook/schema.json | 5 +++++ .../frameworks/angular/src/builders/start-storybook/index.ts | 3 +++ .../angular/src/builders/start-storybook/schema.json | 5 +++++ .../angular/src/builders/utils/standalone-options.ts | 1 + 5 files changed, 17 insertions(+) diff --git a/code/frameworks/angular/src/builders/build-storybook/index.ts b/code/frameworks/angular/src/builders/build-storybook/index.ts index 25f7faeb5268..892547aabe80 100644 --- a/code/frameworks/angular/src/builders/build-storybook/index.ts +++ b/code/frameworks/angular/src/builders/build-storybook/index.ts @@ -40,6 +40,7 @@ export type StorybookBuilderOptions = JsonObject & { enableProdMode?: boolean; styles?: StyleElement[]; stylePreprocessorOptions?: StylePreprocessorOptions; + preserveSymlinks?: boolean; assets?: AssetPattern[]; sourceMap?: SourceMapUnion; } & Pick< @@ -102,6 +103,7 @@ const commandBuilder: BuilderHandlerFn = ( assets, previewUrl, sourceMap = false, + preserveSymlinks = false, } = options; const standaloneOptions: StandaloneBuildOptions = { @@ -121,6 +123,7 @@ const commandBuilder: BuilderHandlerFn = ( ...(styles ? { styles } : {}), ...(assets ? { assets } : {}), sourceMap, + preserveSymlinks, }, tsConfig, webpackStatsJson, diff --git a/code/frameworks/angular/src/builders/build-storybook/schema.json b/code/frameworks/angular/src/builders/build-storybook/schema.json index 6b614e574172..dbc2a734417e 100644 --- a/code/frameworks/angular/src/builders/build-storybook/schema.json +++ b/code/frameworks/angular/src/builders/build-storybook/schema.json @@ -19,6 +19,11 @@ "description": "Directory where to store built files.", "default": "storybook-static" }, + "preserveSymlinks": { + "type": "boolean", + "description": "Do not use the real path when resolving modules. If true, symlinks are resolved to their real path, if false, symlinks are resolved to their symlinked path.", + "default": false + }, "configDir": { "type": "string", "description": "Directory where to load Storybook configurations from.", diff --git a/code/frameworks/angular/src/builders/start-storybook/index.ts b/code/frameworks/angular/src/builders/start-storybook/index.ts index 2ecbb63c8a0f..7700cc3acdbc 100644 --- a/code/frameworks/angular/src/builders/start-storybook/index.ts +++ b/code/frameworks/angular/src/builders/start-storybook/index.ts @@ -37,6 +37,7 @@ export type StorybookBuilderOptions = JsonObject & { styles?: StyleElement[]; stylePreprocessorOptions?: StylePreprocessorOptions; assets?: AssetPattern[]; + preserveSymlinks?: boolean; sourceMap?: SourceMapUnion; } & Pick< // makes sure the option exists @@ -118,6 +119,7 @@ const commandBuilder: BuilderHandlerFn = (options, cont statsJson, previewUrl, sourceMap = false, + preserveSymlinks = false, } = options; const standaloneOptions: StandaloneOptions = { @@ -141,6 +143,7 @@ const commandBuilder: BuilderHandlerFn = (options, cont ...(stylePreprocessorOptions ? { stylePreprocessorOptions } : {}), ...(styles ? { styles } : {}), ...(assets ? { assets } : {}), + preserveSymlinks, sourceMap, }, tsConfig, diff --git a/code/frameworks/angular/src/builders/start-storybook/schema.json b/code/frameworks/angular/src/builders/start-storybook/schema.json index 2b98bab9039c..a2eef03e4b08 100644 --- a/code/frameworks/angular/src/builders/start-storybook/schema.json +++ b/code/frameworks/angular/src/builders/start-storybook/schema.json @@ -19,6 +19,11 @@ "type": "string", "description": "The full path for the TypeScript configuration file, relative to the current workspace." }, + "preserveSymlinks": { + "type": "boolean", + "description": "Do not use the real path when resolving modules. If true, symlinks are resolved to their real path, if false, symlinks are resolved to their symlinked path.", + "default": false + }, "port": { "type": "number", "description": "Port to listen on.", diff --git a/code/frameworks/angular/src/builders/utils/standalone-options.ts b/code/frameworks/angular/src/builders/utils/standalone-options.ts index ef73d78f01b5..83fc0090985c 100644 --- a/code/frameworks/angular/src/builders/utils/standalone-options.ts +++ b/code/frameworks/angular/src/builders/utils/standalone-options.ts @@ -18,6 +18,7 @@ export type StandaloneOptions = CLIOptions & stylePreprocessorOptions?: StylePreprocessorOptions; assets?: AssetPattern[]; sourceMap?: SourceMapUnion; + preserveSymlinks?: boolean; }; angularBuilderContext?: BuilderContext | null; tsConfig?: string; From 096c612f93e5ea6bdefef6d2f079fe9690e2e87e Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 7 Jun 2024 14:47:39 +0200 Subject: [PATCH 27/32] Build: Add --prod flag to be able to create Angular-specific sandboxes in linked mode --- CONTRIBUTING.md | 13 +++++++++++++ scripts/task.ts | 5 +++++ scripts/tasks/compile.ts | 4 ++-- scripts/tasks/sandbox-parts.ts | 18 ++++++++++++------ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f8ae3a42c13c..cab252f7d26e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,6 +61,19 @@ yarn build --watch react core-server api addon-docs yarn task --task dev --template --start-from=publish ``` +### Making code changes when working on Angular-specific code + +If you are working on Angular-specific code, you will need to append `--prod` to the above mentioned commands to ensure that the Angular compiler is able to pick up the changes appropriately and doesn't fail. This will build all the packages in production mode. + +```sh +yarn task --prod +``` + +```bash +cd code +yarn build --prod --watch angular core-server api addon-docs +``` + ## Contributing to Storybook For further advice on how to contribute, please refer to our [NEW contributing guide on the Storybook website](https://storybook.js.org/docs/contribute). diff --git a/scripts/task.ts b/scripts/task.ts index 1247cc89351a..2d1225ddbe6c 100644 --- a/scripts/task.ts +++ b/scripts/task.ts @@ -157,6 +157,11 @@ export const options = createOptions({ inverse: true, promptType: false, }, + prod: { + type: 'boolean', + description: 'Build code for production', + promptType: false, + }, dryRun: { type: 'boolean', description: "Don't execute commands, just list them (dry run)?", diff --git a/scripts/tasks/compile.ts b/scripts/tasks/compile.ts index af220b9f27a4..0275a363e222 100644 --- a/scripts/tasks/compile.ts +++ b/scripts/tasks/compile.ts @@ -33,9 +33,9 @@ export const compile: Task = { return false; } }, - async run({ codeDir }, { link, dryRun, debug }) { + async run({ codeDir }, { link, dryRun, debug, prod }) { return exec( - link ? linkCommand : noLinkCommand, + link && !prod ? linkCommand : noLinkCommand, { cwd: codeDir }, { startMessage: '🥾 Bootstrapping', diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index b80c1d5e734b..8bc2566a21a7 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -620,18 +620,24 @@ export async function setImportMap(cwd: string) { await writeJson(join(cwd, 'package.json'), packageJson, { spaces: 2 }); } -/** - * Sets compodoc option in angular.json projects to false. We have to generate compodoc - * manually to avoid symlink issues related to the template-stories folder. - * In a second step a docs:json script is placed into the package.json to generate the - * Compodoc documentation.json, which respects symlinks - * */ async function prepareAngularSandbox(cwd: string, templateName: string) { const angularJson = await readJson(join(cwd, 'angular.json')); Object.keys(angularJson.projects).forEach((projectName: string) => { + /** + * Sets compodoc option in angular.json projects to false. We have to generate compodoc + * manually to avoid symlink issues related to the template-stories folder. + * In a second step a docs:json script is placed into the package.json to generate the + * Compodoc documentation.json, which respects symlinks + */ angularJson.projects[projectName].architect.storybook.options.compodoc = false; angularJson.projects[projectName].architect['build-storybook'].options.compodoc = false; + /** + * Sets preserveSymlinks option in angular.json projects to true. This is necessary to + * respect symlinks so that Angular doesn't complain about wrong types in @storybook/* packages + */ + angularJson.projects[projectName].architect.storybook.options.preserveSymlinks = true; + angularJson.projects[projectName].architect['build-storybook'].options.preserveSymlinks = true; }); await writeJson(join(cwd, 'angular.json'), angularJson, { spaces: 2 }); From f78360566f53f8026821dd535c43c0fc823482e6 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 7 Jun 2024 15:03:06 +0200 Subject: [PATCH 28/32] chore: Update trigger conditions for Circle CI workflows --- .github/workflows/trigger-circle-ci-workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 973381a733f8..66bcc0f1a7ce 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -1,9 +1,9 @@ name: Trigger CircleCI workflow on: - # Use pull_request, as we don't need to check out the actual code of the fork in this script. + # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. - pull_request: + pull_request_target: types: [opened, synchronize, labeled, reopened] push: branches: @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Trigger docs tests run: > @@ -96,7 +96,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: > From c69d5366f23cf230bfad45840f9aa999ded3a127 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 8 Jun 2024 11:37:30 +0800 Subject: [PATCH 29/32] Support tsconfig paths --- code/lib/core-server/package.json | 1 + .../src/utils/StoryIndexGenerator.ts | 30 ++++++++++++++++--- code/yarn.lock | 1 + 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index 9f832722a45a..a9c5033a1866 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -96,6 +96,7 @@ "telejson": "^7.2.0", "tiny-invariant": "^1.3.1", "ts-dedent": "^2.0.0", + "tsconfig-paths": "^4.2.0", "util": "^0.12.4", "util-deprecate": "^1.0.2", "watchpack": "^2.2.0", diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index f75713dd9698..fd1eb40c9496 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -3,6 +3,8 @@ import chalk from 'chalk'; import fs from 'fs-extra'; import slash from 'slash'; import invariant from 'tiny-invariant'; +import * as TsconfigPaths from 'tsconfig-paths'; +import findUp from 'find-up'; import type { IndexEntry, @@ -280,13 +282,22 @@ export class StoryIndexGenerator { /** * Try to find the component path from a raw import string and return it in - * the same format as `importPath`. + * the same format as `importPath`. Respect tsconfig paths if available. * * If no such file exists, assume that the import is from a package and * return the raw path. */ - resolveComponentPath(rawComponentPath: Path, absolutePath: Path) { - const absoluteComponentPath = path.resolve(path.dirname(absolutePath), rawComponentPath); + resolveComponentPath( + rawComponentPath: Path, + absolutePath: Path, + matchPath: TsconfigPaths.MatchPath | undefined + ) { + let rawPath = rawComponentPath; + if (matchPath) { + rawPath = matchPath(rawPath) ?? rawPath; + } + + const absoluteComponentPath = path.resolve(path.dirname(absolutePath), rawPath); const existing = ['', '.js', '.ts', '.jsx', '.tsx', '.mjs', '.mts'] .map((ext) => `${absoluteComponentPath}${ext}`) .find((candidate) => fs.existsSync(candidate)); @@ -319,12 +330,23 @@ export class StoryIndexGenerator { invariant(indexer, `No matching indexer found for ${absolutePath}`); const indexInputs = await indexer.createIndex(absolutePath, { makeTitle: defaultMakeTitle }); + const tsconfigPath = await findUp('tsconfig.json', { cwd: this.options.workingDir }); + const tsconfig = TsconfigPaths.loadConfig(tsconfigPath); + let matchPath: TsconfigPaths.MatchPath | undefined; + if (tsconfig.resultType === 'success') { + matchPath = TsconfigPaths.createMatchPath(tsconfig.absoluteBaseUrl, tsconfig.paths, [ + 'browser', + 'module', + 'main', + ]); + } const entries: ((StoryIndexEntryWithMetaId | DocsCacheEntry) & { tags: Tag[] })[] = indexInputs.map((input) => { const name = input.name ?? storyNameFromExport(input.exportName); const componentPath = - input.rawComponentPath && this.resolveComponentPath(input.rawComponentPath, absolutePath); + input.rawComponentPath && + this.resolveComponentPath(input.rawComponentPath, absolutePath, matchPath); const title = input.title ?? defaultMakeTitle(); // eslint-disable-next-line no-underscore-dangle diff --git a/code/yarn.lock b/code/yarn.lock index 0d2f161d0f94..b1ddfe6b5077 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6002,6 +6002,7 @@ __metadata: telejson: "npm:^7.2.0" tiny-invariant: "npm:^1.3.1" ts-dedent: "npm:^2.0.0" + tsconfig-paths: "npm:^4.2.0" typescript: "npm:^5.3.2" util: "npm:^0.12.4" util-deprecate: "npm:^1.0.2" From a57e45c10d508af24f01c14b08786d5d99c5fb19 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sun, 9 Jun 2024 18:43:23 +0800 Subject: [PATCH 30/32] Add indexer API docs --- code/lib/types/src/modules/indexer.ts | 2 +- docs/api/main-config-indexers.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/lib/types/src/modules/indexer.ts b/code/lib/types/src/modules/indexer.ts index b01c0fb697b6..a34a2422766c 100644 --- a/code/lib/types/src/modules/indexer.ts +++ b/code/lib/types/src/modules/indexer.ts @@ -93,7 +93,7 @@ export type IndexEntry = StoryIndexEntry | DocsIndexEntry; export type BaseIndexInput = { /** The file to import from e.g. the story file. */ importPath: Path; - /** The raw path/package to the file that provides meta.component, if one exists */ + /** The raw path/package of the file that provides meta.component, if one exists */ rawComponentPath?: Path; /** The name of the export to import. */ exportName: ExportName; diff --git a/docs/api/main-config-indexers.md b/docs/api/main-config-indexers.md index 79e7fa2f2651..a2b17648ed40 100644 --- a/docs/api/main-config-indexers.md +++ b/docs/api/main-config-indexers.md @@ -97,6 +97,7 @@ Type: exportName: string; importPath: string; type: 'story'; + rawComponentPath?: string; metaId?: string; name?: string; tags?: string[]; @@ -133,6 +134,12 @@ Type: `'story'` The type of entry. +##### `rawComponentPath` + +Type: `string` + +The raw path/package of the file that provides `meta.component`, if one exists. + ##### `metaId` Type: `string` From ee008764e9d9ea416ba3c3fd2495db74ab854b36 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 10 Jun 2024 09:09:11 +0200 Subject: [PATCH 31/32] add bun to canary release pr workflow --- .github/workflows/canary-release-pr.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/canary-release-pr.yml b/.github/workflows/canary-release-pr.yml index 557a0331fe2d..1b97a35368da 100644 --- a/.github/workflows/canary-release-pr.yml +++ b/.github/workflows/canary-release-pr.yml @@ -59,6 +59,11 @@ jobs: uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" + + - uses: oven-sh/setup-bun@v1 + with: + bun-version: 1.1.1 + - name: Cache dependencies uses: actions/cache@v4 with: From c388109586094350ccea098a81a566b2a737c672 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 10 Jun 2024 16:21:29 +0800 Subject: [PATCH 32/32] Restore back-compat code --- code/lib/manager-api/src/lib/stories.test.ts | 3 +++ code/lib/manager-api/src/lib/stories.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/lib/manager-api/src/lib/stories.test.ts b/code/lib/manager-api/src/lib/stories.test.ts index 1107f23bb8d4..f8a7c5882cfb 100644 --- a/code/lib/manager-api/src/lib/stories.test.ts +++ b/code/lib/manager-api/src/lib/stories.test.ts @@ -120,6 +120,9 @@ describe('transformStoryIndexV3toV4', () => { "docsOnly": true, }, "storiesImports": [], + "tags": [ + "stories-mdx", + ], "title": "Story 1", "type": "docs", }, diff --git a/code/lib/manager-api/src/lib/stories.ts b/code/lib/manager-api/src/lib/stories.ts index fc8f866c575a..db8cc4c1efb3 100644 --- a/code/lib/manager-api/src/lib/stories.ts +++ b/code/lib/manager-api/src/lib/stories.ts @@ -66,6 +66,7 @@ export const transformSetStoriesStoryDataToPreparedStoryIndex = ( if (docsOnly) { acc[id] = { type: 'docs', + tags: ['stories-mdx'], storiesImports: [], ...base, }; @@ -122,7 +123,7 @@ export const transformStoryIndexV3toV4 = (index: StoryIndexV3): API_PreparedStor } acc[entry.id] = { type, - ...(type === 'docs' && { storiesImports: [] }), + ...(type === 'docs' && { tags: ['stories-mdx'], storiesImports: [] }), ...entry, };