npm run start
- Launching a frontend project on a webpack dev servernpm run build:prod
- Build in production modenpm run build:dev
- Build in development modenpm run prettier
- Correction files with a prettiernpm run lint:ts
- Checking ts files with a linternpm run lint:ts:fix
- Correction ts files with a linternpm run lint:css
- Checking css files with a style linternpm run lint:css:fix
- Correction css files with a style linternpm run prepare
- Pre-commit hooksnpm run storybook
- Start Storybooknpm run storybook:build
- Build Storybooknpm run test:ui
- Running screenshots of tests with lokinpm run test:ui:ok
- Confirmation of new screenshotsnpm run test:unit
- Running unit tests with jestnpm run test:unit:coverage
- Determining test coverage
The project has a Webpack config - ./config/webpack
The project has a Storybook config - ./config/storybook
The project has a Jest config - ./config/jest
The project describes story cases for each component.
The story file is created next to the component with the .stories.tsx extension
You can run Storybook with the command:
npm run storybook
Example:
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './Button';
const meta = {
title: 'shared/Button',
component: Button,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
argTypes: {
backgroundColor: { control: 'color' },
},
} satisfies Meta<typeof Button>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Primary: Story = {
args: {
primary: true,
label: 'Button',
},
};