Closed nekitk closed 4 years ago
@ndelangen hi! could you please take a look at these PRs? (https://github.com/storybookjs/addon-smart-knobs/pull/61 & https://github.com/storybookjs/addon-smart-knobs/pull/60) We are currently forced to use our own fork with these PRs merged.
@nekitk This package has gone a bit neglected, I'm sorry. Would you be interested in helping maintain this?
I've invited you to the github org, this should give you the ability to merge these.
Deployment failed with the following error:
Your `package.json` file is missing a `build` property inside the `script` property.
@ndelangen sure, thanks!
Deployment failed with the following error:
Your `package.json` file is missing a `build` property inside the `script` property.
@ndelangen Hi! I've merged some of the opened pull requests. Could you please publish a new version? Note that there were a breaking change in https://github.com/storybookjs/addon-smart-knobs/pull/65 — decorator usage changed from withSmartKnobs
to withSmartKnobs(options)
.
@nekitk what's you npm account url?
So release a new major version?
@ndelangen
@nekitk what's you npm account url?
So release a new major version?
yes, as it has broken backward compatibility
@nekitk enable 2FA for your npm account and you should be able to publish to https://www.npmjs.com/package/storybook-addon-smart-knobs 👍
@ndelangen released a new version 6.0.0, thanks!
Hi @nekitk, for clarification if I've react-docgen-typescript-loader
in .storybook/main.js
like instructed in the docs, do I still need to do the configuration steps for babel-plugin-react-docgen
in the smart knob README?
My main.js:
module.exports = {
stories: ["../src/**/*.stories.(tsx|mdx)"],
webpackFinal: async (config) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve("babel-loader"),
options: {
presets: [["react-app", { flow: false, typescript: true }]],
},
},
{
loader: require.resolve("react-docgen-typescript-loader"),
options: {
tsconfigPath: path.resolve(__dirname, "../tsconfig.json"),
},
},
],
});
config.resolve.extensions.push(".ts", ".tsx");
return config;
},
addons: [
"@storybook/addon-a11y",
"@storybook/addon-essentials",
"@storybook/addon-actions",
"@storybook/addon-knobs",
"@storybook/addon-docs",
"@storybook/addon-links",
],
};
And would preloading globally in preview.js
work like so:
import { addDecorator } from '@storybook/react';
import { withKnobs } from "@storybook/addon-knobs";
import { withSmartKnobs } from 'storybook-addon-smart-knobs'
/**
* May need additional config
* https://github.com/storybookjs/addon-smart-knobs#configuration
*/
addDecorator(withSmartKnobs())
addDecorator(withKnobs);
Hi @nekitk, for clarification if I've
react-docgen-typescript-loader
in.storybook/main.js
like instructured in the docs, do I still need to do the configuration steps forbabel-plugin-react-docgen
in the smart knob README?
Hi! No, you don't need to configure babel-plugin-react-docgen
with typescript. You should add shouldExtractLiteralValuesFromEnum: true
to the options of react-docgen-typescript-loader
for richer enum support.
Preloading globally should work.
Thank you! I appreciate your work on this.
Fixes https://github.com/storybookjs/addon-smart-knobs/issues/25