---
# System prepended metadata

title: Shared libraries discussion

---

# Shared libraries discussion

Things to possibly chat about
•	What do we want to share? (components, utils)
•	NPM private repo with semver 
•	Monorepos (Lerna, Turborepo, NX) - https://trunkbaseddevelopment.com/monorepos/ 
•	Devops (not main focus though)
•	Git repo(s)
•	Speed of build
•	Speed of testing
•	How do we work out what projects are affected by a change?
•	Dependency graphs (eg FE  depends on components (eg button)  depends on utils (eg auto data cy id)
•	Shared caching
•	Moving to vite at same time?
•	Shared eslint/TS config etc

## Fings wot we wanna share

- utils (pure typescript)
    - primitive types organisation, no knowledge of domain
    - could be used by node (FE + BE)
- models (types)
    - eg studies
- api/RTKQ stuff
- components (frontend)
    - chips/buttons
- components (mdgroup specific)
    - visit type chips
- components FE web
- components FE native
button.web.tsx
button.native.tsx


FE -> API -> Models
   -> Components -> Utils
   -> Utils
   
   
## Other things to add/use?

- React Native Web
- Vite transition
- Storybook


## Monorepo platforms

- Lerna: https://github.com/lerna/lerna
- Turborepo: https://turborepo.org/
- Nx: https://nx.dev/


## Semver NPM private repository

- Can be individually versioned
- Would be painful to keep dependant packages up to date 


## Need/extra thoughts

- decent integration tests
- identify what is affected by changes
- what happens if your change to a util affects many shared things? (Ticket scope)
- to 'try and avoid versioning' so we dont add to tech debt as we will always be up to date and working