23
loading...
This website collects cookies to deliver better user experience
$ yarn init
package.json
file.workspaces
here set to the folders where you have your packages created. Note the version
here, it's 1.0.0
at start, but as you progess further, lerna is gonna update it according. conventionalCommits
config with lerna to manage versions. You can read more about that herepackage.json
lerna init
, you can combine the --independent
flag if you wanna maintain versions of each package separately.lerna.json
useWorkspaces
option enables us to reuse the setting for Yarn Workspaces as Lerna's workspace setting.npmClient
option from yarn
to npm
, if you want npm
to run all your commands. Finally commands
option is set to use conventionalCommits
for our publish process.$ npx lerna create @projectName/packagename
.$ yarn workspace @projectName/yourpackagename add npm-package-name
$ yarn add -W --dev typescript prettier eslint
.lerna publish
is the command used to publish your packges. --conventional-commits
flag with the above command to determine the version of your package. With this option, Lerna generates a CHANGELOG.md
for a new version.$ npx lerna publish --conventional-commits
lerna notice cli v3.19.0
lerna info versioning independent
lerna info Looking for changed packages since @zoomify/[email protected]
lerna info getChangelogConfig Successfully resolved preset "conventional-changelog-angular"
Changes:
- @zoomify/rest-api-client: 1.0.0 => 1.1.0
- @zoomify/cutomize-uploader: 3.0.1 => 3.0.2
? Are you sure you want to publish these packages? (ynH)
:
Successfully published:
- @zoomify/[email protected]
- @zoomify/[email protected]
lerna success published 2 packages
$ npx lerna run build --stream
, this will call the build command specified in package.json
files of each package.