Salt la conținutul principal

Comenzi utile

Pornirea aplicației

npx nx start twenty-front

Regenerate graphql schema based on API graphql schema

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

Lint

npx nx run twenty-front:lint # utilizați --fix pentru a corecta erorile de lint

Traduceri

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

Test

npx nx run twenty-front:test # rulați teste jest
npx nx run twenty-front:storybook:serve:dev # rulați storybook
npx nx run twenty-front:storybook:test # rulați testele # (are nevoie de yarn storybook:serve:dev pentru a rula)
npx nx run twenty-front:storybook:coverage # (are nevoie de yarn storybook:serve:dev pentru a rula)

Tehnologii Utilizate

The project has a clean and simple stack, with minimal boilerplate code. Aplicație Testare Instrumente

Arhitectură

Rutare

React Router se ocupă de rutare. Pentru a evita re-redări inutile, toată logica de rutare se află în useEffect în PageChangeEffect.

Managementul stării

Recoil se ocupă de managementul stării. Consultați cele mai bune practici pentru mai multe informații despre managementul stării.

Testare

Jest servește ca instrument pentru testarea unităților, în timp ce Storybook este pentru testarea componentelor. Jest este utilizat în principal pentru testarea funcțiilor utilitare, nu a componentelor în sine. Storybook este pentru testarea comportamentului componentelor izolate, precum și pentru afișarea sistemului de design.