The goal of this repo is to define a good way to build :
- A monorepo containing a list of Javascript/Angular packages
- An Angular app having dependencies to these packages
-
Build both the monorepo and the app locally for development at two different place....BUT....It should be easy to serve the app and modify the libraries of the monorepo without publishing, installing, etc.. JUST CODING !!!
-
Build both the monorepo and the app for production using a CI tool
Remark : yarn is needed :
npm install yarn -g
- Install :
$ yarn
- Bootstrap package :
$ yarn bootstrap
- Build package :
$ yarn build
- Post Build copy package.json in dist
- Link to libs
$ yarn run link:internal
- Run the app
$ npm start (would like to use yarn but it check the lib on the registry even if they are links...)
The goal is to be able to build all packages in a single command : npm run build
OAO is a lerna like using yarn and it support almost what we want to do. A packaging phase is missing
Today, even there are linked, yarn doesn't support libraries that are not found on the registry. A hack is to remove dependencies from the package.json, do the yarn install and recreate the package.json...
OAO doesn't do the building/packaging of our libraries, some steps need to be executed before publishing :
- transpile code using
ngc
- package code using
rollup
- copy static files :
- copy and clean the package.json. Also replacing placeholders version to have common versions
- copy the README.md
- AOT compatible
- links between app and monorepo
- avoiding scripts with hardcoded libs names
- having one tsconfig per lib...but with ngc on lib-3, they are strange duplications
- be able to publish
- remove dependency to ng2-translate in the angular-app
New wave modularity with Lerna, monorepos, and npm organizations : Article explaining the problematic and how npm organization works
Thoughts about package modularization : Article explaining the problematic of multiple packages and the lerna library
Setting Up a Javascript monorepo : Description of 2 tools, lerna and builder, but introduce a simpler bash script
Monorepo scaling project : Description of multiple tools and introduce his own tool : bumped
Babel : Example of monorepo usage and explanation