Skip to content
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

simplify launch command #6

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ The addon assumes the developer is correctly installed and configured Storybook
ddev get tyler36/ddev-storybook
ddev restart
```
2. Install storybook if you haven't already. See the [Storybook get started page](https://storybook.js.org/docs/get-started/install) for instructions. E.g.
```shell
ddev exec npx storybook@latest init
```

## Usage

Expand Down
17 changes: 1 addition & 16 deletions commands/host/storybook
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,7 @@ startStorybookServer () {

# Open storybook in prefered browser. This assumes the server is running
launch () {
FULLURL="${DDEV_PRIMARY_URL}:6006"
case $OSTYPE in
linux-gnu)
if [[ ! -z "${GITPOD_INSTANCE_ID}" ]]; then
gp preview ${FULLURL}
else
xdg-open ${FULLURL}
fi
;;
"darwin"*)
open ${FULLURL}
;;
"win*"* | "msys"*)
start ${FULLURL}
;;
esac
ddev launch :6006
}


Expand Down
1 change: 1 addition & 0 deletions config.storybook.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#ddev-generated
web_extra_exposed_ports:
- name: storybook
container_port: 6006
Expand Down