percy / percy-storybook

Percy's Storybook SDK.
https://docs.percy.io/docs/storybook
MIT License
149 stars 45 forks source link

Unable to set different Storybook "config-dir" #509

Closed WesSouza closed 2 years ago

WesSouza commented 2 years ago

My team uses the -c parameter when running Storybook:

start-storybook -c ./configs/storybook --ci --port 9001

The command percy storybook:start does not allow me to configure this, and therefore fails:

ERR! Error: No configuration files have been found in your configDir (/Users/wessouza/Sites/interface-percy/.storybook).
ERR! Storybook needs either a "main" or "config" file.
ERR!     at validateConfigurationFiles (/Users/wessouza/Sites/interface-percy/.yarn/unplugged/@storybook-core-virtual-3a1b859b16/node_modules/@storybook/core/dist/server/utils/validate-configuration-files.js:50:11)

It would be nice if this parameter was allowed, or there was a way of passing parameters through, such as:

percy storybook:start -- -c ./configs/storybook --ci --port 9001
github-actions[bot] commented 2 years ago

This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

wwilsman commented 2 years ago

The -c flag will not work because it is used by percy's own --config flag. The full Storybook flag for --config-dir should always work though.

Also, -- -c ... should work, however we previously relied on oclif to parse flags, which might explain why it didn't. I'd give that syntax another shot with the latest version of this SDK.

Also, if using yarn, it likes to strip -- from commands. So you'll have to double up on it to get it to listen. i.e. yarn percy storybook:start -- -- -c ...