6c728fff78
Created by Github action Co-authored-by: github-actions <github-actions@twenty.com>
97 lines
3.1 KiB
Plaintext
97 lines
3.1 KiB
Plaintext
---
|
||
title: Команды фронтенда
|
||
image: /images/user-guide/create-workspace/workspace-cover.png
|
||
---
|
||
|
||
<Frame>
|
||
<img src="/images/user-guide/create-workspace/workspace-cover.png" alt="Header" />
|
||
</Frame>
|
||
|
||
## Полезные команды
|
||
|
||
### Запуск приложения
|
||
|
||
```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
|
||
```
|
||
|
||
### Lint
|
||
|
||
```bash
|
||
npx nx run twenty-front:lint # pass --fix to fix lint errors
|
||
```
|
||
|
||
## Переводы
|
||
|
||
```bash
|
||
npx nx run twenty-front:lingui:extract
|
||
npx nx run twenty-front:lingui:compile
|
||
```
|
||
|
||
### Тест
|
||
|
||
```bash
|
||
npx nx run twenty-front:test # run jest tests
|
||
npx nx run twenty-front:storybook:serve:dev # run storybook
|
||
npx nx run twenty-front:storybook:test # run tests # (needs yarn storybook:serve:dev to be running)
|
||
npx nx run twenty-front:storybook:coverage # (needs yarn storybook:serve:dev to be running)
|
||
```
|
||
|
||
## Технологический стек
|
||
|
||
Проект имеет чистый и простой стек с минимальным кодом.
|
||
|
||
**Приложение**
|
||
|
||
- [React](https://react.dev/)
|
||
- [Apollo](https://www.apollographql.com/docs/)
|
||
- [GraphQL Codegen](https://the-guild.dev/graphql/codegen)
|
||
- [Recoil](https://recoiljs.org/docs/introduction/core-concepts)
|
||
- [TypeScript](https://www.typescriptlang.org/)
|
||
|
||
**Тестирование**
|
||
|
||
- [Jest](https://jestjs.io/)
|
||
- [Storybook](https://storybook.js.org/)
|
||
|
||
**Инструменты**
|
||
|
||
- [Yarn](https://yarnpkg.com/)
|
||
- [Craco](https://craco.js.org/docs/)
|
||
- [ESLint](https://eslint.org/)
|
||
|
||
## Архитектура
|
||
|
||
### Маршрутизация
|
||
|
||
[React Router](https://reactrouter.com/) обрабатывает маршрутизацию.
|
||
|
||
Чтобы избежать ненужных [перерисовок](/l/ru/developers/frontend-development/best-practices-front#managing-re-renders), вся логика маршрутизации находится в `useEffect` в `PageChangeEffect`.
|
||
|
||
### Управление состоянием
|
||
|
||
[Recoil](https://recoiljs.org/docs/introduction/core-concepts) обрабатывает управление состоянием.
|
||
|
||
[лучшие практики](/l/ru/developers/frontend-development/best-practices-front#state-management) для получения дополнительной информации об управлении состоянием.
|
||
|
||
## Тестирование
|
||
|
||
[Jest](https://jestjs.io/) служит инструментом для модульного тестирования, а [Storybook](https://storybook.js.org/) — для тестирования компонентов.
|
||
|
||
Jest в основном используется для тестирования утилит, а не самих компонентов.
|
||
|
||
Storybook предназначен для тестирования поведения изолированных компонентов, а также для отображения системы дизайна.
|
||
|