-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Presets / Addon-docs: Cleanup framework-specific presets #8782
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/g4hua6sud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, it would be great to get rid of some of the any's here, but I think that's a bigger task.
import * as common from './preset'; | ||
import deprecate from 'util-deprecate'; | ||
import dedent from 'ts-dedent'; | ||
import * as common from '../../preset'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can avoid this by enabling ESM interop in TypeScript.
} | ||
|
||
export function addons(entry: any[] = []) { | ||
export function addons(entry: any[] = [], options: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to look at some global types for options, etc.
@@ -0,0 +1,8 @@ | |||
export function webpack(webpackConfig: any = {}, options: any = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a type for Webpack config, Configuration
from webpack
.
@@ -0,0 +1,8 @@ | |||
export function webpack(webpackConfig: any = {}, options: any = {}) { | |||
webpackConfig.module.rules.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to make this pure.
Issue: N/A
Pre-work for #5731
What I did
framework
option to presetsaddon-docs
to useframework
option, unifying the docs presetaddon-docs
framework-specific presetsHow to test
Try out: