a Monorepo sample using lernajs, CRA typescript and rollup
In this Repo there are four packages, three would be shared packages
- common-components
- common-types
- common-utils
and one would be the consumer application.
consumer-application is created by CRA. common-components are configured by rollup for creating the bundle.
There is a template folder inside common-components which can be used to create a new component.
- in the root
npx lerna bootstrap
- in the
packages/common-utils
yarn run rollup
- in the
packages/common-components
yarn run rollup
- in the
packages/consumer-app
yarn start
or
in the root
npx lerna run start --scope=consumer-app
- Create a new component in common-component package,
cd packages/common-components
npx generate-react-cli component NewComponentName
- Add a package(source-package) to another package(destination-package)
npx lerna add source-package --scope=destination-package
- generating a new version, in the root
npx lerna version --conventional-commits ---yes
there only would be a new version when there were changes to any of the packages.