refactor: Continue refactoring after migrating to rsbuild

This commit is contained in:
deytenit committed 2026-02-15 12:23:04 +03:00
1 parent baba22ad6f
commit 891027cab0
120 files changed
+751 -483

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
import path from 'path';
import { pluginBabel } from '@rsbuild/plugin-babel';
import type { StorybookConfig } from 'storybook-react-rsbuild';
const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
addons: [
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-a11y',
'@storybook/addon-themes',
'@storybook/addon-coverage',
],
framework: {
name: 'storybook-react-rsbuild',
options: {},
},
rsbuildFinal: (config) => {
config.resolve ||= {};
config.resolve.alias = {
...config.resolve.alias,
'#': path.resolve(__dirname, '../src'),
'@ermnvldmr/stl': path.resolve(__dirname, '../../../packages/stl/src'),
'@ermnvldmr/ui': path.resolve(__dirname, '../../../packages/ui/src'),
};
// Add Babel plugin with istanbul for coverage
config.plugins = config.plugins || [];
config.plugins.push(
pluginBabel({
include: /\.(?:jsx|tsx)$/,
exclude: /[\\/]node_modules[\\/]/,
babelLoaderOptions: (opts) => {
opts.plugins = opts.plugins || [];
opts.plugins.push([
'babel-plugin-istanbul',
{
exclude: ['**/*.stories.tsx', '**/*.test.tsx', 'node_modules/**'],
extension: ['.js', '.jsx', '.ts', '.tsx'],
},
]);
},
})
);
return config;
},
};
export default config;
@@ -0,0 +1,15 @@
import type { Preview } from '@storybook/react';
import '#/static/global.css';
const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};
export default preview;
+1
View File
@@ -0,0 +1 @@
import '@testing-library/jest-dom';