Vai al contenuto principale
Header

Comandi utili

Avviare l’app

npx nx start twenty-front

Rigenerare lo schema graphql sulla base dello schema API graphql

npx nx run twenty-front:graphql:generate --configuration=metadata
OPPURE
npx nx run twenty-front:graphql:generate

Lint

npx nx run twenty-front:lint # pass --fix to fix lint errors

Traduzioni

npx nx run twenty-front:lingui:extract
npx nx run twenty-front:lingui:compile

Test

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)

Tech Stack

Il progetto ha una struttura chiara e semplice, con un codice boilerplate minimo. App Testing Strumenti

Architettura

Routing

React Router gestisce il routing. Per evitare re-render inutili, tutta la logica del routing è in un useEffect in PageChangeEffect.

Gestione dello stato

Recoil gestisce lo stato. Vedi best practices per ulteriori informazioni sulla gestione dello stato.

Testing

Jest serve come strumento per i test unitari mentre Storybook è per i test dei componenti. Jest è principalmente per testare le funzioni utility, e non i componenti stessi. Storybook è per testare il comportamento di componenti isolati, oltre che per mostrare il sistema di design.