zeplin/cli-connect-storybook-plugin

Storybook url is broken after sync

shortsn opened this issue · 3 comments

Hi,
i am running into an edge case where the storybook plugin breaks the url even though the sync seems to succeed.

Background:
We are accessing our intermediate builds of storybook using a TeamCity artifacts locator.
This allows to access files even in zip archives using a specific url pattern.
e.g.
[teamcity-build-locator]/storybook.zip!/iframe.html

Unfortunately the cli-plugin is trying to be smart and removes /iframe.html which leads to urls like
[teamcity-build-locator]/storybook.zip!?selectedKind=foo&selectedStory=bar that are no longer working.

this.targetUrl = url.endsWith(IFRAME_PATH)
? url.substring(0, url.lastIndexOf(IFRAME_PATH))
: url;

I was able to workaround this by declaring my config url like /storybook.zip!/iframe.html? but it feels dirty and might be worth fixing it.

Hi,
unfortunately when updating the plugin from v0.1.4 to v0.1.6 my workaround does no longer work and the integration becomes unusable for us.
Is there a chance to get this fixed because we are currently stuck on v0.1.4?

yuqu commented

@shortsn

Sorry about hassle. I've decided that there is no reason to enforce trimming of iframe.html if the user really want to use it. The fix is published in version v0.1.7.

Hi @yuqu,
thank you. I just tried the most recent version and the iframe.html is no longer trimmed but unfortunately the generated url is still not valid.
The appended string starts with a / like:
https://foobar/iframe.html/?selectedKind=foobar

when removing the unexpected character everthing is working fine.
expected:
https://foobar/iframe.html?selectedKind=foobar