TypeScript + lerna + yarnmonorepos FTWParis TypeScript #10 10/10/20171
View Slide
Me, myself & IPaul SoucheFront End developer @S_A_N_T_E_C_HIn love with TypeScript since 2014@paul.souchepaulsouche@paulsouche2
Multi repos : why ?- Monoliths no more- Build only the necessary- Clearer subversion history- Easier revert- 1 app > 1 repo- 1 service > 1 repo... 3
Multi repos :but ... - Switch project all the time- Sequential builds- Evergreen anti pattern- Dependencies- Versioning- Features branch4
- Build everything everytime- Build order- Subversion Conflicts- Licenses5Did you saidmonorepo?
6DEPENDENCIESAPP 1DEPENDENCIESAPP 2Projectsarchitecture
Editor architecture7DEPENDENCIESCOMMON 2COMMON 1APP 1 APP 2 APP 3 APP 4
Lerna<< Lerna is a tool that optimizes the workflowaround managing multi-package repositories withgit and npm >>8
Prerequisites9
Lerna project structure- lerna import - lerna bootstrap10
What it does11
Demo12
Yeah… But ?- devDependencies are the sameso lerna bootstrap could be veryslow for more packages (cache)- Build is sequential13
yarn workspaces14
Lerna config15
What happen to the structure16
Demo17
Build18- Several flags such as --parallel I won’t talk about- Bash is always the answer for uncommon problems
That’s all folksTHANKSReferencesLernaYarn workspacesDemo19