2de681da72
Created by Github action <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22317?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions <github-actions@twenty.com>
92 lines
2.3 KiB
Plaintext
92 lines
2.3 KiB
Plaintext
---
|
|
title: Comandos do Frontend
|
|
icon: terminal
|
|
---
|
|
|
|
## Comandos Úteis
|
|
|
|
### Iniciando o aplicativo
|
|
|
|
```bash
|
|
npx nx start twenty-front
|
|
```
|
|
|
|
### Regenerar esquema GraphQL baseado no esquema de API GraphQL
|
|
|
|
```bash
|
|
npx nx run twenty-front:graphql:generate --configuration=metadata
|
|
```
|
|
|
|
OU
|
|
|
|
```bash
|
|
npx nx run twenty-front:graphql:generate
|
|
```
|
|
|
|
### Lint
|
|
|
|
```bash
|
|
npx nx run twenty-front:lint # pass --fix to fix lint errors
|
|
```
|
|
|
|
## Traduções
|
|
|
|
```bash
|
|
npx nx run twenty-front:lingui:extract
|
|
npx nx run twenty-front:lingui:compile
|
|
```
|
|
|
|
### Teste
|
|
|
|
```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)
|
|
```
|
|
|
|
## Pilha de Tecnologias
|
|
|
|
O projeto possui uma pilha limpa e simples, com pouco código boilerplate.
|
|
|
|
**Aplicativo**
|
|
|
|
* [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/)
|
|
|
|
**Testes**
|
|
|
|
* [Jest](https://jestjs.io/)
|
|
* [Storybook](https://storybook.js.org/)
|
|
|
|
**Ferramentas**
|
|
|
|
* [Yarn](https://yarnpkg.com/)
|
|
* [Craco](https://craco.js.org/docs/)
|
|
* [Oxlint](https://oxc.rs/docs/guide/usage/linter.html)
|
|
|
|
## Arquitetura
|
|
|
|
### Roteamento
|
|
|
|
[React Router](https://reactrouter.com/) gerencia o roteamento.
|
|
|
|
Para evitar [re-renders]desnecessário (/developers/contribute/capabilities/frontend-development/best-practices-front#managing-re-renders) toda a lógica de roteamento está em um `useEffect` em `PageChangeEffect`.
|
|
|
|
### Gerenciamento de Estado
|
|
|
|
[Jotai](https://jotai.org/) gerencia o estado.
|
|
|
|
Veja [melhores práticas](/l/pt/developers/contribute/capabilities/frontend-development/best-practices-front#state-management) para mais informações sobre gerenciamento de estado.
|
|
|
|
## Testes
|
|
|
|
[Jest](https://jestjs.io/) serve como ferramenta para testes unitários enquanto [Storybook](https://storybook.js.org/) para teste de componentes.
|
|
|
|
Jest é principalmente para testar funções utilitárias, e não os componentes em si.
|
|
|
|
Storybook é para testar o comportamento de componentes isolados, bem como exibir o sistema de design.
|