Template that can be used for working with monorepositories in typescript / javascript and automated changelog generation. Solves problems like versioning, publishing, dependencies between packages, developing both the depending and dependant packages at the same time, building/installing all packages dependencies with one command, besides having the benefits of typescript and definition files..
lerna create <package-name>
- create a
src/index.ts
file - copy
tsconfig.json
from one of the other files which extends the root tsconfig file - add
"typings": "lib/index.d.ts"
in package.json to link to the generated .d.ts file for types reference - Make sure the
main
property is set to the outputlib/index.js
file inpackage.json
- add
build
andwatch
scripts in package.json
- Use
yarn build
oryarn watch
to compile all packages into javascript and optionally recompile on file changes - Use
yarn start
to run the main project or the playground which uses the shared packages
- run
yarn publish