Skip to content
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

feat!: chartkit v3 #208

Merged
merged 12 commits into from
Jul 17, 2023
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": ["@gravity-ui/eslint-config", "@gravity-ui/eslint-config/client"],
"extends": [
"@gravity-ui/eslint-config",
"@gravity-ui/eslint-config/client",
"@gravity-ui/eslint-config/prettier"
],
"root": true
}
18 changes: 12 additions & 6 deletions .storybook/decorators/withLang.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import React from 'react';
import type {DecoratorFn} from '@storybook/react';
import type {Decorator} from '@storybook/react';
import {Lang, configure} from '@gravity-ui/uikit';
import {settings as dateUtilsSettings} from '@gravity-ui/date-utils';
import {settings as chartkitSettings} from '../../src/libs';

export const withLang: DecoratorFn = (Story, context) => {
const lang = context.globals.lang;
const setDateUtilsLocale = async (lang: string) => {
await dateUtilsSettings.loadLocale(lang);
dateUtilsSettings.setLocale(lang);
};

configure({
lang: lang as Lang,
});
export const withLang: Decorator = (Story, context) => {
const lang = context.globals.lang;
chartkitSettings.set({lang});
setDateUtilsLocale(lang);
configure({lang: lang as Lang});

return <Story key={lang} {...context} />;
};
3 changes: 3 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type {Config} from '@jest/types';

const esModules = ['@gravity-ui/yagr', 'uplot'].join('|');

const cfg: Config.InitialOptions = {
verbose: true,
preset: 'ts-jest',
Expand All @@ -8,6 +10,7 @@ const cfg: Config.InitialOptions = {
'^.+\\.(js|ts)?$': 'ts-jest',
},
modulePathIgnorePatterns: ['<rootDir>/build/', '<rootDir>/node_modules/'],
transformIgnorePatterns: [`<rootDir>/node_modules/(?!${esModules})`],
moduleNameMapper: {
'^.+\\.(css|scss)$': '<rootDir>/test-utils/style.mock.ts',
},
Expand Down
Loading