A reference guide on how to do releases of the VF monorepo's tools and components.
- We publish to npm with Lerna
- Versions in
vf-core
- Updating component versions
- Have installed Lerna globally
- Installed dependencies in
/tools/vf-core/
withyarn install
- Installed dependencies in root folder with
yarn install
- Have logged in to a npm account belonging to the visual-framework organization
- select the
develop
branch- reminder: we don't use
master
- reminder: we don't use
- see a list of changed packages
lerna changed
- ensure all packages to be released have ready an updated changelog and to which version are going to be bumped
- verify the new versions of each package doesn't exist on npm
- test publish
yarn run lerna:test
- publish to npm
yarn run lerna:publish
- lerna will prompt the versions of all packages twice
- 1st one to publish the packages to npm. Please enter the code for
npm
from your authenticator app as that's a requirement now for 2 factor authentication. - 2nd one to update package.json files of all packages published
- 1st one to publish the packages to npm. Please enter the code for
- In case there's a need to release a package prior to a full library release, do the following:
- Make sure the package code is updated and along with the respective CHANGELOG.md file and works well with rest of the code. Also make sure package.json is updated with the newer version you're going to push to
npm
.npm version patch
command can be used for updating the package.json in case you're doing a patch release. - Commit this package code to
develop
branch and checkout this branch on your local. Again make sure the complete code works well with latest packages and there are no discrepancies. - Make sure you're logged in to a
npm
account belonging to the visual-framework organization. - In a terminal window, go to the package folder and then run
npm publish --dry-run
. This will do a dry run of the publish command and show if there's any error before publishing. - If satisfied with dry run then do
npm publish
. It might ask you for code fornpm
from authenticator app for 2 factor authentication as mentioned above. Once the package is published tonpm
you'll get the confirmation in the window. - When you're doing a full release make sure that the package changes are accounted for in the rollup release blog.
- Make sure the package code is updated and along with the respective CHANGELOG.md file and works well with rest of the code. Also make sure package.json is updated with the newer version you're going to push to
- update the expected new tag version to
/tools/vf-component-library/src/site/_data/siteConfig.js
- see last tag
git describe --abbrev=0 --tags
- see last tag
- Remove
dev
fromvfVersionPrefix
in/tools/vf-component-library/src/site/_data/siteConfig.js
, this is needed only for development - generate an update
yarn run releasenotes
- format and review the newly made file at
tools/vf-component-library/src/site/updates
- copy structure from previous release notes
- for each component, put latest changelog updates and link it with
releaseLinks.notes
- commit and push changes to the
develop
branch- commit message in a format of:
Component release 20211130-01
- commit message in a format of:
- add a tag
- see last tag
git describe --abbrev=0 --tags
- add a semantic versioned tag
git tag -a v2.5.2-beta.5 -m 'Release of precompiled CSS, JS, assets'
- Why like this?
- We do not add tags per individual component version. However, Lerna needs a named tag to see what has changed. With our method we get one tag per release bundle and avoid tag spamming in the release history.
- Trigger a deploy to the CDN (i.e.
v2.5.0
) https://assets.emblstatic.net/vf/v2.4.10/css/styles.css
- see last tag
- push the tag
git push origin --tags
- add release notes to the tag and link to the new blog post
- Add
dev
tovfVersionPrefix
in/tools/vf-component-library/src/site/_data/siteConfig.js
, this is needed only for development. Push this change todevelop
branch.
lerna ls
list all packages known to lernalerna ls --since af04cb2a
list all changed packages since a commit (sadly not combinable with lerna publish)lerna diff
all changes since last publishlerna changed
all packages changed