Files
twenty/packages/twenty-docs/l/ru/developers/contribute/capabilities/frontend-development/frontend-commands.mdx
T
github-actions[bot] cd73088be6 i18n - docs translations (#19925)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2026-04-21 10:57:27 +02:00

92 lines
3.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Команды фронтенда
icon: terminal
---
## Полезные команды
### Запуск приложения
```bash
npx nx start twenty-front
```
### Перегенерировать схему graphql на основе схемы API graphql
```bash
npx nx run twenty-front:graphql:generate --configuration=metadata
```
ИЛИ
```bash
npx nx run twenty-front:graphql:generate
```
### Линт
```bash
npx nx run twenty-front:lint # используйте --fix для исправления ошибок линтинга
```
## Переводы
```bash
npx nx run twenty-front:lingui:extract
npx nx run twenty-front:lingui:compile
```
### Тест
```bash
npx nx run twenty-front:test # запуск тестов jest
npx nx run twenty-front:storybook:serve:dev # запуск storybook
npx nx run twenty-front:storybook:test # запуск тестов # (требуется yarn storybook:serve:dev для работы)
npx nx run twenty-front:storybook:coverage # (требуется yarn storybook:serve:dev для работы)
```
## Технологический стек
Проект имеет чистый и простой стек с минимальным кодом.
**Приложение**
* [React](https://react.dev/)
* [Apollo](https://www.apollographql.com/docs/)
* [GraphQL Codegen](https://the-guild.dev/graphql/codegen)
* [Jotai](https://jotai.org/)
* [TypeScript](https://www.typescriptlang.org/)
**Тестирование**
* [Jest](https://jestjs.io/)
* [Storybook](https://storybook.js.org/)
**Инструменты**
* [Yarn](https://yarnpkg.com/)
* [Craco](https://craco.js.org/docs/)
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
## Архитектура
### Маршрутизация
[React Router](https://reactrouter.com/) обрабатывает маршрутизацию.
Чтобы избежать ненужных [перерисовок](/l/ru/developers/contribute/capabilities/frontend-development/best-practices-front#managing-re-renders), вся логика маршрутизации находится в `useEffect` в `PageChangeEffect`.
### Управление состоянием
[Jotai](https://jotai.org/) отвечает за управление состоянием.
[лучшие практики](/l/ru/developers/contribute/capabilities/frontend-development/best-practices-front#state-management) для получения дополнительной информации об управлении состоянием.
## Тестирование
[Jest](https://jestjs.io/) служит инструментом для модульного тестирования, а [Storybook](https://storybook.js.org/) — для тестирования компонентов.
Jest в основном используется для тестирования утилит, а не самих компонентов.
Storybook предназначен для тестирования поведения изолированных компонентов, а также для отображения системы дизайна.