Merge branch 'deprecate/remaining-lib-cli' into norbert/sb-799-create-a-storybooktypes

This commit is contained in:
Norbert de Langen 2022-10-20 14:32:13 +02:00
commit 13e89f617e
No known key found for this signature in database
GPG Key ID: FD0E78AF9A837762
5 changed files with 20 additions and 10 deletions

View File

@ -1,6 +1,8 @@
import path from 'path';
import initStoryshots, { multiSnapshotWithOptions, Stories2SnapsConverter } from '../src';
/* deprecated and will be removed in Storybook 8.0 */
class AnotherStories2SnapsConverter extends Stories2SnapsConverter {
getSnapshotFileName(context) {
const { fileName, kind, name } = context;
@ -36,9 +38,13 @@ initStoryshots({
integrityOptions: { cwd: __dirname },
stories2snapsConverter: new AnotherStories2SnapsConverter({ snapshotExtension: '.boo' }),
config: ({ configure }) =>
configure(() => {
// eslint-disable-next-line global-require
require('./exported_metadata/Extra.stories.jsx');
}, module),
configure(
() => {
// eslint-disable-next-line global-require
require('./exported_metadata/Extra.stories.jsx');
},
module,
false
),
test: multiSnapshotWithOptions(),
});

View File

@ -19,7 +19,8 @@ const rawOptionsHelper = (options, type, isMulti, initial) => {
<>
<OptionsControl
name="options"
options={options}
labels={{}}
argType={{ options }}
value={value}
type={type}
onChange={(newVal) => setValue(newVal)}

View File

@ -40,7 +40,7 @@ export const OptionsControl: FC<OptionsProps> = (props) => {
const { type = 'select', labels, argType } = props;
const normalized = {
...props,
options: normalizeOptions(argType.options, labels),
options: argType ? normalizeOptions(argType.options, labels) : {},
isInline: type.includes('inline'),
isMulti: type.includes('multi'),
};

View File

@ -52,7 +52,6 @@ export type OptionsControlType =
export interface OptionsConfig {
labels: Record<any, string>;
options: Options;
type: OptionsControlType;
}

View File

@ -10,9 +10,13 @@ import './rn-addons';
addDecorator(withKnobs);
// import stories
configure(() => {
require('./stories');
}, module);
configure(
() => {
require('./stories');
},
module,
false
);
// Refer to https://github.com/storybookjs/react-native/tree/master/app/react-native#getstorybookui-options
// To find allowed options for getStorybookUI