Skip to content

Commit

Permalink
simplify launch command (#6)
Browse files Browse the repository at this point in the history
* Improve instructions

* Mark config as generated by ddev

* simplify launch command

---------

Co-authored-by: Christian López Espínola <[email protected]>
Co-authored-by: John Kaeser <[email protected]>
Co-authored-by: tyler36 <[email protected]>
  • Loading branch information
4 people authored Oct 8, 2024
1 parent f591ebc commit d9f6a53
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
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

0 comments on commit d9f6a53

Please sign in to comment.