π΄ Evergis UI
Contributing
π Before start:
yarn
Update webstorm to >2017.3.3
Install Styled Components plugin Jetbrains plugins
π οΈ Start dev:
yarn storybook
Open in browser localhost:6006
β
Start tests:
yarn test
How to release
- Π‘ΠΎΠ·Π΄Π°ΡΡ Π²ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ Π²Π΅ΡΠΊΡ (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ,
publish
) - ΠΠ·ΠΌΠ΅Π½ΠΈΡΡ Π²Π΅ΡΡΠΈΡ ΠΏΠ°ΠΊΠ΅ΡΠ° Π²
package.json
yarn
- ΠΎΡΠ²Π΅ΠΆΠΈΡΡ Π²ΡΠ΅ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈyarn lint:fix
- Π°Π²ΡΠΎΠΏΠΎΠΏΡΠ°Π²ΠΊΠ° eslint ΠΎΡΠΈΠ±ΠΎΠΊyarn build
- ΡΠ±ΠΎΡΠΊΠ°npm publish
- ΠΏΠ°Π±Π»ΠΈΡ- Π‘ΠΎΠ·Π΄Π°ΡΡ ΠΠ ΠΈΠ· Π²ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ Π²Π΅ΡΠΊΠΈ Π²
master
How to link
For testing uilib locally in client (or other projects)
without rebuilding after every update use linking:
yarn build
- ΡΠ±ΠΎΡΠΊΠ°yarn link
- ΡΠΎΠ·Π΄Π°ΡΠΌ Π³Π»ΠΎΠ±Π°Π»ΡΠ½ΡΡ ΡΡΡΠ»ΠΊΡ Π½Π° uilib- ΠΡΠΊΡΡΠ²Π°Π΅ΠΌ client ΠΈΠ»ΠΈ Π΄ΡΡΠ³ΠΎΠΉ ΠΏΡΠΎΠ΅ΠΊΡ
yarn link "@evergis/ui"
- ΠΏΡΠΈΠ²ΡΠ·ΡΠ²Π°Π΅ΠΌ uilib ΠΊ ΠΏΡΠΎΠ΅ΠΊΡΡyarn start
- Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΠΏΡΠΎΠ΅ΠΊΡ Ρ ΠΏΡΠΈΠ²ΡΠ·Π°Π½Π½ΠΎΠΉ uilibyarn build
- ΠΏΠΎΡΠ»Π΅ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ Π² uilib Π΄Π΅Π»Π°Π΅ΠΌ Π΅Π³ΠΎ ΠΏΠ΅ΡΠ΅ΡΠ±ΠΎΡΠΊΡ
How to manage icons
- https://icomoon.io/app/#/projects
- Import Project ΠΈΠ·
src/fonts/selection.json
- Load
- ΠΠ»ΠΈΠΊ ΠΏΠΎ Π³Π°ΠΌΠ±ΡΡΠ³Π΅Ρ Π½Π°Π±ΠΎΡΠ° EverCloud Π² ΠΏΡΠ°Π²ΠΎΠΌ Π²Π΅ΡΡ
Π½Π΅ΠΌ ΡΠ³Π»Ρ Import to Set
- Generate Font Π² ΠΏΡΠ°Π²ΠΎΠΌ Π½ΠΈΠΆΠ½Π΅ΠΌ ΡΠ³Π»Ρ
- ΠΠ°ΠΌΠ΅Π½Π° ΡΠ°ΠΉΠ»ΠΎΠ²
src/fonts
Π½Π° Π·Π°Π³ΡΡΠΆΠ΅Π½Π½ΡΠ΅ ΠΈΠ· Π°ΡΡ
ΠΈΠ²Π° (ΠΏΠ°ΠΏΠΊΠ° fonts ΠΈ selection.json)
Used libraries, languages and tools
- Typescript Docs
- React Docs
- Styled-components Docs
- Jest Docs
- Storybook Docs
Style Guide
-
Every component in separate directory
-
Test file in same directory, with name *.test.tsx
-
Do not write snapshot tests for components, for snapshot testing used stories, test only specific behavior and functions
-
Story file in same directory, with name *.story.tsx
-
Write stories for every possible component state
-
Every component must be working without any props
-
Do not create pull request with any linters or ts errors
-
File naming convention:
- PascalCase for file exporting classes and Components
- camelCase for file exporting objects and functions
- kebab-case for module replacements
-
Do not use default exports
-
Write component description in source file
Completed Component must include the following:
- Stories for every possible component state
- Tests for specific behaviors and functions
- Declared Theme variables
- Props type
- Component description
Project structure
- Import "styled-components" maps to styled-with-theme.ts
- theme is theme folder π’
- Simple reusable styled components and html tags with style are located in atoms folder
- Groups of atoms are located in molecules folder
- Groups of atoms, molecules and other are located in organisms folder
Todo
- Upgrade tippy (tooltip) package version
- Upgrade imask & react-imask packages version