ladle icon indicating copy to clipboard operation
ladle copied to clipboard

Support ExportSpecifier defined stories

Open i-am-the-slime opened this issue 1 year ago • 4 comments

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.

i-am-the-slime avatar Apr 09 '24 18:04 i-am-the-slime

🦋 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

changeset-bot[bot] avatar Apr 09 '24 18:04 changeset-bot[bot]

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 avatar Apr 10 '24 07:04 tajo

@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.

i-am-the-slime avatar Apr 11 '24 18:04 i-am-the-slime

@tajo Could you have another look, please?

i-am-the-slime avatar May 06 '24 14:05 i-am-the-slime

lgtm

tajo avatar May 31 '24 06:05 tajo

lgtmt

i-am-the-slime avatar Jun 01 '24 10:06 i-am-the-slime