5.3.1 • Published 2 months ago

@talend/scripts-config-storybook-lib v5.3.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

Storybook configuration for lib

This configuration module contains an opinionated storybook configuration, supporting some extra features around talend libraries and framework.

How to use

First step is to use it with the default configuration as possible.

This is served with talend presets

yarn add @talend/scripts-core @talend/scripts-preset-react-lib
# or
yarn add @talend/scripts-core @talend/scripts-preset-react
# or
yarn add @talend/scripts-core @talend/scripts-preset-react-ng

In your package.json

{
    "scripts": {
        "start-storybook": "talend-scripts start-storybook",
        "build-storybook": "talend-scripts build-storybook",
    }
}

Default configuration

Default configuration can be found in ui-scripts repo:

MSW addon

MSW addon is configured and initialized out of the box. You can use it directly without any other configuration.

CMF

You can initialize @talend/react-cmf with a proper decorator by exporting the cmf modules and settings in preview.js.

import cmfModule, { settings } from './cmfModule';

export const cmf = {
	modules: [cmfModule],
	settings, // optional
};

i18n

You can initialize i18next with a proper decorator by exporting the i18n namespaces and locales preview.js. Locales can be static translations or urls to the translation files.

Static translations example

import { locales as datasetLocales } from '@talend/locales-inventory-dataset/locales';
import { namespaces as datasetNamespaces } from '@talend/locales-inventory-dataset/namespaces';
import { locales as ratingLocales } from '@talend/locales-inventory-rating/locales';
import { namespaces as ratingNamespaces } from '@talend/locales-inventory-rating/namespaces';
import { locales as sharingLocales } from '@talend/locales-inventory-sharing/locales';
import { namespaces as sharingNamespaces } from '@talend/locales-inventory-sharing/namespaces';

export const i18n = {
	namespaces: [...datasetNamespaces, ...ratingNamespaces, ...sharingNamespaces],
	locales: merge(sharingLocales, datasetLocales, ratingLocales),
};

Remote translations example

import { namespaces as tuiNamespaces } from '@talend/locales-tui-components/namespaces';
import { namespaces as dsNamespaces } from '@talend/locales-design-system/namespaces';

export const i18n = {
	namespaces: [...tuiNamespaces, ...dsNamespaces],
	remoteLocalesMap: {
		'tui-components':
			'https://unpkg.com/@talend/locales-tui-components/locales/{{lng}}/{{ns}}.json',
		'design-system': 'https://unpkg.com/@talend/locales-design-system/locales/{{lng}}/{{ns}}.json',
	},
};

Advanced configuration

It is possible to add custom storybook configurations. They will be merged with default configuration.

To do so, just create a .storybook/ folder and any storybook configuration files in it, like when you configure your storybook yourself. Keep in mind that using @talend/scripts to run/build storybook will always take default settings too.

5.3.1

2 months ago

5.3.0

4 months ago

5.2.1

5 months ago

5.1.0

6 months ago

5.2.0

5 months ago

5.0.0

7 months ago

4.1.0

9 months ago

4.0.3

11 months ago

4.0.2

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

2.3.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.3.1

1 year ago

3.0.0

1 year ago

2.1.2

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.2.0

2 years ago

1.2.1

2 years ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.9.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.3.0

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago