Support ExportSpecifier defined stories
This is in response to #554
In my local testing it works, however it only works for the first story in the export list, is this what we want? Otherwise I could probably loop but the code would be a bit more involved.
🦋 Changeset detected
Latest commit: a9465c7115711e391395979637b062a19b0bc835
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 13 packages
| Name | Type |
|---|---|
| @ladle/react | Patch |
| example | Patch |
| test-addons | Patch |
| test-babel | Patch |
| test-config | Patch |
| test-config-ts | Patch |
| test-css | Patch |
| test-decorators | Patch |
| test-playwright | Patch |
| test-programmatic | Patch |
| test-provider | Patch |
| test-baseweb | Patch |
| test-msw | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
In my local testing it works, however it only works for the first story in the export list, is this what we want?
It should definitely work for multiple stories/specifiers. Also, tests need to be added.
This is an interesting case:
const joe = 'joe';
export { joe, joe as jim }
Should parse outjoe and jim
@tajo
It now
- parses all stories in the block
- uses the exported name if there is one
- has a test for this
It doesn't resolve the original AST node of what's being exported so it misses the "function/class/variable" check. I don't know how to do that. I hope it's okay even without this check.
@tajo Could you have another look, please?
lgtm
lgtmt