-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate Storybook URLs using v5+ structure #12
Conversation
LGTM. Intent is aligned with need. Solution confirmed to work by running |
src/index.ts
Outdated
`/?selectedKind=${encodedKind}&selectedStory=${encodeURIComponent(name)}` | ||
); | ||
} else { | ||
url = join(this.targetUrl, `/?selectedKind=${encodedKind}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use query
parameter like: urlJoin(this.targetUrl, { query: { selectedKind: encodedKind } });
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary.
Firstly, it just makes me to repeat put same option inputs on every call (proper-url-join has troublesome API definition, the problem is not type definition but the implementation is not suitable for rest params input definition).
Secondly, it is more visible to maintenance. No need to delegate SB URL specifics into a 3rd party lib. I just use it to ensure the final concatenated string is a good lookin valid URL without redundant characters(e.g. excessive slashes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Fixes #11