Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 1.63 KB

development.md

File metadata and controls

63 lines (46 loc) · 1.63 KB

Development

Prepare local environment

  • install nodejs 12+ version and corresponded npm
  • in root folder run npm ci
  • install docker and setup it to make possible run without sudo (to able run pre-push hook)
    • copy paste the script for ubuntu/debian/pop os systems
  • [optionally] to generate docs images
    • npm i -g @mermaid-js/mermaid-cli
    • sudo apt install graphviz

Start development server

npm run start:dev

Run jest tests

npm run jest:watch # comfortable for development

Code generation

we use plop tool to generate new files with consistency.

See details in plopfile.js and templates/ folder

Generate redux slice

npm run g:slice someListPage src/app/modules/some/pages/some-list-page/state
# tree src/modules/some/
src/modules/some/
└── pages
    └── some-list-page
        └── state
            ├── some-list-page.actions.ts
            ├── some-list-page.epics.ts
            ├── some-list-page.reducer.ts
            └── some-list-page.selectors.ts

Generate React functional component

# positional arguments:
# - name in dash-case/PascalCase/camelCase
# - destination folder (without component folder)

npm run g:react-fc fancy-button src/common/ui/

# tree src/common/ui/fancy-button
src/common/ui/fancy-button
├── fancy-button.scss
└── fancy-button.tsx

NOTE: the generation task automatically adds component-name folder to destination path