9bc5486d0d
Created by Github action --------- Co-authored-by: github-actions <github-actions@twenty.com>
97 lines
2.5 KiB
Plaintext
97 lines
2.5 KiB
Plaintext
---
|
|
title: Comandos del Frontend
|
|
image: /images/user-guide/create-workspace/workspace-cover.png
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/create-workspace/workspace-cover.png" alt="Header" />
|
|
</Frame>
|
|
|
|
## Comandos útiles
|
|
|
|
### Iniciando la aplicación
|
|
|
|
```bash
|
|
npx nx start twenty-front
|
|
```
|
|
|
|
### Regenerar el esquema de graphql basado en el esquema API graphql
|
|
|
|
```bash
|
|
npx nx run twenty-front:graphql:generate --configuration=metadata
|
|
```
|
|
|
|
O
|
|
|
|
```bash
|
|
npx nx run twenty-front:graphql:generate
|
|
```
|
|
|
|
### Lint
|
|
|
|
```bash
|
|
npx nx run twenty-front:lint # pass --fix to fix lint errors
|
|
```
|
|
|
|
## Traducciones
|
|
|
|
```bash
|
|
npx nx run twenty-front:lingui:extract
|
|
npx nx run twenty-front:lingui:compile
|
|
```
|
|
|
|
### Prueba
|
|
|
|
```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)
|
|
```
|
|
|
|
## Stack Tecnológico
|
|
|
|
The project has a clean and simple stack, with minimal boilerplate code.
|
|
|
|
**Aplicación**
|
|
|
|
- [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/)
|
|
|
|
**Pruebas**
|
|
|
|
- [Jest](https://jestjs.io/)
|
|
- [Storybook](https://storybook.js.org/)
|
|
|
|
**Herramientas**
|
|
|
|
- [Yarn](https://yarnpkg.com/)
|
|
- [Craco](https://craco.js.org/docs/)
|
|
- [ESLint](https://eslint.org/)
|
|
|
|
## Arquitectura
|
|
|
|
### Enrutamiento
|
|
|
|
[React Router](https://reactrouter.com/) maneja el enrutamiento.
|
|
|
|
Para evitar [re-renderizados](/l/es/developers/frontend-development/best-practices-front#managing-re-renders) innecesarios toda la lógica de enrutamiento está en un `useEffect` en `PageChangeEffect`.
|
|
|
|
### Gestión del Estado
|
|
|
|
[Recoil](https://recoiljs.org/docs/introduction/core-concepts) maneja la gestión del estado.
|
|
|
|
Ver [mejores prácticas](/l/es/developers/frontend-development/best-practices-front#state-management) para más información sobre la gestión del estado.
|
|
|
|
## Pruebas
|
|
|
|
[Jest](https://jestjs.io/) sirve como la herramienta para pruebas unitarias mientras [Storybook](https://storybook.js.org/) es para pruebas de componentes.
|
|
|
|
Jest es principalmente para probar funciones utilitarias, y no los componentes en sí mismos.
|
|
|
|
Storybook es para probar el comportamiento de componentes aislados, así como mostrar el sistema de diseño.
|
|
|