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

Allow control of the ordering of the essential addons #12640

Closed
kylemh opened this issue Oct 1, 2020 · 4 comments
Closed

Allow control of the ordering of the essential addons #12640

kylemh opened this issue Oct 1, 2020 · 4 comments

Comments

@kylemh
Copy link
Member

kylemh commented Oct 1, 2020

Is your feature request related to a problem? Please describe
I like to have the Controls addon always appear first. I also always use the essential addons.

Describe the solution you'd like
Give me the ability to control the order of the addons from the essential addons pack.

Are you able to assist to bring the feature to reality?
Definitely! I would just wanna make sure we agree on the interface. My non-breaking change recommendation would be to interface this config similar to disabling individual addons in the pack: https://github.com/storybookjs/storybook/tree/next/addons/essentials#disabling-addons

module.exports = {
  addons: [{
    name: '@storybook/addon-essentials',
    order: ['controls', 'actions', 'docs', 'viewport', 'toolbars'],
    options: {
      backgrounds: false,
    }
  }]
};

or, keep the same interface, but hope they remember that order matters with the keys in the object:

module.exports = {
  addons: [{
    name: '@storybook/addon-essentials',
    order: ['controls', 'actions', 'docs', 'viewport', 'toolbars'],
    options: {
      // order matters
      controls: true,
      actions: true,
      backgrounds: false,
      docs: true,
      viewport: true,
      toolbars: true,
    }
  }]
};

or, a breaking change:

module.exports = {
  addons: [{
    name: '@storybook/addon-essentials',
    use: ['controls', 'actions', 'docs', 'viewport', 'toolbars'],
    // no more options key, if the name is missing above, the related addon wont be leveraged
  }]
};
@kylemh
Copy link
Member Author

kylemh commented Oct 1, 2020

Anyways... anybody that wants to do this, here's the workaround: OperationCode/front-end#1235

@shilman
Copy link
Member

shilman commented Oct 1, 2020

What if we just always made controls come first?

@kylemh
Copy link
Member Author

kylemh commented Oct 1, 2020

I'd personally be happy with that!

@shilman
Copy link
Member

shilman commented Oct 3, 2020

Egads!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.19 containing PR #12652 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants