diff --git a/.storybook/main.ts b/.storybook/main.ts index 593a17c0..3b66f5e5 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -14,6 +14,32 @@ const config: StorybookConfig = { {name: '@storybook/addon-essentials', options: {backgrounds: false}}, './theme-addon/register.tsx', ], + webpackFinal: async (config) => { + const babelModuleIdx = config.module?.rules?.findIndex((rule) => { + const use = (Array.isArray(rule.use) ? rule.use?.[0] : rule.use) as {loader: string}; + return use.loader?.includes('babel-loader') && typeof rule.include === 'function'; + }); + + if (babelModuleIdx === undefined || babelModuleIdx === -1) { + return config; + } + + if (config.module?.rules?.[babelModuleIdx]?.include) { + const ii = config.module?.rules?.[babelModuleIdx]?.include as (s: string) => boolean; + config.module.rules[babelModuleIdx].include = (input: string) => { + const res = ii(input); + if ( + input.includes('node_modules/uplot') || + input.includes('node_modules/@gravity-ui/yagr') + ) { + return true; + } + return res; + }; + } + + return config; + }, }; export default config; diff --git a/package-lock.json b/package-lock.json index a8728efb..0ec91fa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25038,4 +25038,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 775d28d5..b1db3006 100644 --- a/package.json +++ b/package.json @@ -71,10 +71,16 @@ "typescript": "^4.9.5" }, "peerDependencies": { +<<<<<<< HEAD "@gravity-ui/uikit": "^5.0.0", "react": "^16.0.0 || ^17.0.0 || ^18.0.0", "highcharts": "^8.2.2", "highcharts-react-official": "^3.2.0" +======= + "@gravity-ui/uikit": "^4.0.0", + "moment": "^2.19.3", + "react": "^16.0.0 || ^17.0.0 || ^18.0.0" +>>>>>>> bf809c4 (feat(Yagr plugin)!: update to v3 (#180)) }, "scripts": { "test": "jest", diff --git a/src/plugins/yagr/__stories__/Yagr.stories.tsx b/src/plugins/yagr/__stories__/Yagr.stories.tsx index ba45d741..e0301181 100644 --- a/src/plugins/yagr/__stories__/Yagr.stories.tsx +++ b/src/plugins/yagr/__stories__/Yagr.stories.tsx @@ -63,5 +63,6 @@ const UpdatesTemplate: Story = () => { ); }; + export const Line = LineTemplate.bind({}); export const Updates = UpdatesTemplate.bind({});