eehitus-global-styles
v1.1.2
Published
This project holds all the global styles required for eehitus-ui.
Readme
eehitus-visual-ui library
This project holds all the global styles required for eehitus-ui.
E-ehitus CSS with styles is included into E-ehitus UI Root component
Table of Contents
Getting started with development
Prerequisites
- Node.js (v18.20.6)
- Yarn (v1.x)
- Recommendation:
Running locally
npm i yarn -g- If you don't have yarn installed locally for given node versionyarn installyarn start
Local development
yarn start opens http://localhost:3000
You have to look for BrowserRouter definition to find the urls you can navigate to.
Usually can be found at ./src/App.tsx or in the component rendered inside it.
./public/config.jscontains all the endpoint URL-s for different microservices.- Default endpoint should end with
/v1 - You can specify a certain API to point to your projects API
/project_ingress
- Default endpoint should end with
Development patterns overview
Style guide
Sass architecture: the 7-1 pattern
Common components
- eehitus-ui-extras
- New common business logic components or enums, should be added to this library
- TEDI library - E-Ehitus is moving to use Estonian TEDI library for react.
- New features should be developed using them, if possible.
- ehr-components Old components
- These are old components and you should not create new functionality with them if possible.
- eehitus-visuaal eehitus-ui has usage of global styles
- When making changes there, make sure your change does not have impact to the rest of the UI libraries
Testing
For library unit testing we use Jest.
E2E Tests are located in this project.
Debugging with source-maps
If you have developed locally and when you update the library version in eehitus-ui project and start receiving errors,
it's wise to generate local build using yarn cibuild:debug
This generates ./dist folder
Then go into eehitus-ui project
- Remove .cache
eehitus-ui/node_modules/.cache - Remove old dist
eehitus-ui/node_modules/eehitus-*project_name*/dist - Copy your project local debug build dist folder to
eehitus-ui/node_modules/eehitus-*project_name* - Start
eehitus-uiusingyarn startnow the error should have source-maps and debugging it, should be easier.
Branching
For developing we use Git Flow branching pattern
Example branch names
- release/project_name
- fix/TICKET_NR-short-description
- feature/TICKET_NR-short-description
- company_name/feature/TICKET_NR-short-description
We don't recommend creating develop branch.
Good approach is to create a release/* branch and all new development in company_name/feature/* you create a Merge Request against release/*
You create tags on the release/* branch and you have a separate project namespace in rancher where you update eehitus-ui
Publishing
To get new version of the library up.
- Go to Gitlab
- Find your project and go to tags page document-ui as example
- Create a New tag, specify version in semver pattern
version-*.*.*add a description of project tag or other description - Update your projects
eehitus-ui/package.jsonversion and runyarnto generate newyarn.lockfile and commit it - Create a New tag for
eehitus-ui - Update the
eehitus-uiin rancher project_namespace, you should never update thev1ingresseehitus-ui.v1represents master and should always be in stable state.
