Skip to content

Commit d939c0b

Browse files
style: format code with Prettier
This commit fixes the style issues introduced in f656ee8 according to the output from Prettier. Details: None
1 parent f656ee8 commit d939c0b

4 files changed

Lines changed: 26 additions & 26 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export const PureArgsTable = () => ({ kind: 'pure' });
2-
export const Other = 1;
1+
export const PureArgsTable = () => ({ kind: 'pure' })
2+
export const Other = 1
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export * from './blocks-original';
1+
export * from './blocks-original'
22
// Re-export with a from-clause so the alias is applied to the external export
3-
export { PureArgsTable as ArgsTable } from './blocks-original';
3+
export { PureArgsTable as ArgsTable } from './blocks-original'
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import * as blocks from './blocks-reexport';
1+
import * as blocks from './blocks-reexport'
22

33
describe('local simulation: blocks re-export', () => {
44
test('exports ArgsTable', () => {
55
// debug dump
66
// eslint-disable-next-line no-console
7-
console.log('DEBUG blocks exports:', Object.keys(blocks));
8-
expect(blocks.ArgsTable).toBeDefined();
9-
});
7+
console.log('DEBUG blocks exports:', Object.keys(blocks))
8+
expect(blocks.ArgsTable).toBeDefined()
9+
})
1010

1111
test('ArgsTable equals PureArgsTable', () => {
12-
expect(blocks.ArgsTable).toBe(blocks.PureArgsTable);
13-
});
14-
});
12+
expect(blocks.ArgsTable).toBe(blocks.PureArgsTable)
13+
})
14+
})

tools/patches/PR_DESCRIPTION.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
PR: re-export `ArgsTable` from `@storybook/addon-docs/blocks`
22

3-
Summary
4-
-------
3+
## Summary
4+
55
This small change re-exports the existing `PureArgsTable` implementation as a stable named export `ArgsTable` from `code/addons/docs/src/blocks.ts`.
66

7-
Rationale
8-
---------
7+
## Rationale
8+
99
- Some bundlers / pre-bundlers (for example Vite optimizeDeps) can alter the compiled modules and effectively remove/change named exports consumers expect, resulting in runtime errors like:
10-
``Error: The requested module '.../blocks.js' does not provide an export named 'ArgsTable'``
10+
`Error: The requested module '.../blocks.js' does not provide an export named 'ArgsTable'`
1111
- Storybook currently exports an equivalent implementation under a different name (`PureArgsTable`). Re-exporting it under `ArgsTable` restores compatibility with MDX files and third-party docs that import `ArgsTable` directly.
1212

13-
Change
14-
------
13+
## Change
14+
1515
- Add a single line: `export { PureArgsTable as ArgsTable }` in `code/addons/docs/src/blocks.ts` (or the corresponding entry point that builds `blocks` bundle).
1616

17-
Notes / Alternatives
18-
--------------------
17+
## Notes / Alternatives
18+
1919
- Alternatively, we could update the package exports map or build step to guarantee `ArgsTable` is exported explicitly from the built artifact. This PR picks the smallest non-breaking change that is easy to review and test.
2020

21-
Testing
22-
-------
21+
## Testing
22+
2323
- Unit tests for docs blocks should continue to pass.
2424
- Added unit test: `code/addons/docs/src/__tests__/blocks.test.ts` — asserts `ArgsTable` is exported and is an alias of `PureArgsTable`.
2525
- Manual verification: build with Vite and run Storybook + MDX that imports `ArgsTable` to ensure runtime import succeeds.
2626

27-
Changelog
28-
---------
27+
## Changelog
28+
2929
- Fix: re-export `ArgsTable` from `@storybook/addon-docs/blocks` to restore compatibility with imports that expect the named export.
3030

31-
Request
32-
-------
31+
## Request
32+
3333
If maintainers are okay with this approach, I can open a formal PR against Storybook with the change, tests and a short changelog entry.

0 commit comments

Comments
 (0)