Skip to content

Commit

Permalink
Merge pull request #23842 from storybookjs/version-patch-from-7.3.0
Browse files Browse the repository at this point in the history
Release: Patch 7.3.1
  • Loading branch information
shilman authored Aug 16, 2023
2 parents 3d5a816 + 3c34b0a commit a918f7d
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 7.3.1

- Index: Fix `*.story.*` CSF indexing - [#23852](https://github.com/storybookjs/storybook/pull/23852), thanks [@shilman](https://github.com/shilman)!

## 7.3.0

- ✨ Indexer: Introduce new experimental `indexer` API - #23691, thanks [@JReinhold](https://github.com/jreinhold)!
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-server/src/presets/common-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const features = async (
});

export const csfIndexer: Indexer = {
test: /\.stories\.(m?js|ts)x?$/,
test: /\.(stories|story)\.(m?js|ts)x?$/,
index: async (fileName, options) => (await readCsf(fileName, options)).parse().indexInputs,
};

Expand Down
30 changes: 30 additions & 0 deletions code/lib/core-server/src/utils/StoryIndexGenerator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,36 @@ describe('StoryIndexGenerator', () => {
`);
});
});
describe('single file .story specifier', () => {
it('extracts stories from the right files', async () => {
const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry(
'./src/F.story.ts',
options
);

const generator = new StoryIndexGenerator([specifier], options);
await generator.initialize();

expect(await generator.getIndex()).toMatchInlineSnapshot(`
Object {
"entries": Object {
"f--story-one": Object {
"id": "f--story-one",
"importPath": "./src/F.story.ts",
"name": "Story One",
"tags": Array [
"autodocs",
"story",
],
"title": "F",
"type": "story",
},
},
"v": 4,
}
`);
});
});
describe('non-recursive specifier', () => {
it('extracts stories from the right files', async () => {
const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry(
Expand Down
7 changes: 7 additions & 0 deletions code/lib/core-server/src/utils/__mockdata__/src/F.story.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const component = {};
export default {
component,
tags: ['autodocs'],
};

export const StoryOne = {};
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "7.3.1"
}
2 changes: 1 addition & 1 deletion docs/versions/latest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"7.3.0","info":{"plain":"- Core: Improve `composeStories` typings - [#23577](https://github.com/storybookjs/storybook/pull/23577), thanks [@yannbf](https://github.com/yannbf)!"}}
{"version":"7.3.1","info":{"plain":"- Index: Fix `*.story.*` CSF indexing - [#23852](https://github.com/storybookjs/storybook/pull/23852), thanks [@shilman](https://github.com/shilman)!"}}

0 comments on commit a918f7d

Please sign in to comment.