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

feat: add enabled option #612

Merged
merged 5 commits into from
Jun 4, 2024

Conversation

huang-julien
Copy link
Contributor

@huang-julien huang-julien commented May 29, 2024

Fixes #555 and fixes storybook-vue/storybook-nuxt#63.

Hi 👋 this PR adds an enabled option.

This can be useful for layers.
Some users have project A, B with A extending B that has storybook but is not needed in A. This can improve dev server startup as storybook can be quite heavy to load on bigger projects.

Copy link

netlify bot commented May 29, 2024

👷 Deploy request for nuxt-storybook pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit be1bb48

@tobiasdiez
Copy link
Collaborator

Good idea, this would also resolve #555, right?

I'm not so sure about the name of the option. Currently, the module indeed only starts the storybook server - but that may change in the future. So I would prefer a name that reflects that only the storybook dev server can be disabled by this option. Tailwind has it under viewer. Maybe just also use viewer here for storybook? Or do you have better suggestion?

@tobiasdiez tobiasdiez added type: enhancement New feature or request status: needs info/work Further information or work required (usually from the creator of the issue or PR) labels May 30, 2024
@huang-julien
Copy link
Contributor Author

oh indeed.
About the name, i'm not convinced that viewer is a good name. This option just prevent the whole module from being run. viewer would fit an option that control if the module adds the storybook tab or not in the devtools.
I don't really have any other suggestion, but i think some other modules are also using enabled

@tobiasdiez
Copy link
Collaborator

Okay, if more fine-grained control is needed in the future, we can add another viewer/devserver/whatever option in the future.

Could you please add a short description of the option to https://github.com/nuxt-modules/storybook/blob/main/docs/content/1.getting-started/2.options.md (perhaps with your use case of layers as motivation). Otherwise this looks good from my side.

src/module.ts Outdated Show resolved Hide resolved
@tobiasdiez
Copy link
Collaborator

Thanks!

@tobiasdiez tobiasdiez merged commit be74a80 into nuxt-modules:main Jun 4, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs info/work Further information or work required (usually from the creator of the issue or PR) type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate dev and storybook server? Add optional dev flag to Nuxt module
2 participants