This document is for maintainers who publish plotly.js. For contributor workflows, read CONTRIBUTING.md and BUILDING.md.
plotly.js follows semver. A release that adds functionality bumps the minor version. A minor version can go past 9, so v1.22.0 is valid.
Do every step below for each release, unless indicated otherwise.
-
Open GitHub Actions and confirm that the
mainbranch passes the tests -
Run
git switch main && git pull -
Run
git statusand confirm that the working tree is clean -
Run
git switch -c release-vX.Y.Z, whereX.Y.Zis the new version number -
Run
npx check-node-version --node 22 --npm 10to confirm the tooling versions before you install -
Run
npm ci -
Run
npm run preversion -
Update the version number and the release date in README.md and CITATION.cff. Skip this step for a release candidate.
- Use find-and-replace in the README. The version number appears in three
https://cdn.plot.ly/plotly-X.Y.Z...script URLs. - Update the
versionfield and thedate-releasedfield in CITATION.cff
- Use find-and-replace in the README. The version number appears in three
-
Run
npm run use-draftlogsto copy thedraftlogs/folder into CHANGELOG.md[!NOTE]
npm run use-draftlogsaccepts a filename that ends in_add.md,_remove.md,_deprecate.md,_change.md, or_fix.md. This will raise an error for any other name; rename files if necessary. -
Review CHANGELOG.md. Replace the placeholder heading
## [X.Y.Z] -- UNRELEASEDwith the real version number and release date.- Follow keepachangelog style
- Correct typos and add missing entries and extra details
- Open
https://github.com/plotly/plotly.js/compare/vX.Y.Q...mainto view every commit since the previous releasevX.Y.Q - Confirm that every draftlog entry uses the link template
[[#1234](https://github.com/plotly/plotly.js/pull/1234)] - Credit a community contributor at the end of that entry: ', with thanks to @ for the contribution!'
-
Run
npm run empty-draftlogsto empty thedraftlogs/folder. Skip this step for a release candidate. -
Run
git add -u . && git commit -m "chore: Updates for release vX.Y.Z"
-
Run
npm version vX.Y.Zfrom the repository root (for a release candidate, include the prerelease part, as innpm version v4.2.0-rc.0). The command runs these steps in order:- Run the
preversionscript, which tests the Node.js andnpmversions, tests fornpm linked packages, and walks the dependency tree - Bump the version in
package.json - Run the
versionscript, which runsnpm run buildand thengit add -A lib dist build src/version.js git commit, with the message'X.Y.Z'git tag -a, with the tag'vX.Y.Z'- The
postversionscript, which prints Version bumped and committed. If ok, run: git push && git push --tags
The build writes the
dist/files: main bundles, partial bundles, locales, plot-schema, and geo assets. The build also writes the generated build files underbuild/and the package version file insrc/.[!NOTE] The
npm lsstep insidepreversionfails if the dependencies undernode_modules/don't meet the requirements listed inpackage.json. Runnpm cito fix this issue. - Run the
-
Run
git show HEADto review the commit- The output shows the new CDN bundle links and the new bundle sizes in
dist/README.md, plus the new code in the dist bundles - Carefully review the new bundle sizes in
dist/README.md. If a bundle size has changed unexpectedly, or the diff contains any other unexpected change, rungit reset --hard HEAD^andgit tag -d vX.Y.Zto undo the last commit and tag. Investigate the issue before proceeding.
- The output shows the new CDN bundle links and the new bundle sizes in
-
If everything looks good, run
git push && git push --tagsto push the release branch and the release tag -
Open a pull request against
main, and assign theno-draftloglabel -
Wait for CI to pass, and get an approval
-
Merge the pull request with a merge commit
[!CAUTION] Do not squash merge, since that will result in the tagged commit
vX.Y.Znot being part ofmain
- Run
git switch main && git pullafter the pull request merges - Run
git branch --contains vX.Y.Zand confirm that the output includesmain
-
Run
npm access list packages | grep plotlyto confirm your permission to publish the plotly.js packages- The output lists the Plotly packages that you can update
-
If that command returns no result, authenticate with npm:
- Confirm your membership in the
plotlynpm organization. If you're not a member, contact the Libraries team for next steps. - Run
npm login - Complete the authentication flow with the credentials for your account
- Confirm in the terminal that the command finished
- Run
npm access list packages | grep plotlyagain, and read the list of Plotly packages
- Confirm your membership in the
-
Run
npm pack --dry-run. This shows what will be included in the published package without actually publishing.- Compare the package size against the previous release. An unexpected large change can be an indicator that something was added/removed that shouldn't have been.
- Look for any files that don't belong in the release (usually at the project root level). If you find any, investigate why they're showing up. One resolution option is updating .npmignore.
-
For a full release, run
npm publish. This will publish the new version to the npm registry. -
For a release candidate, run
npm publish --tag rcinstead -
You will be prompted by npm to authorize publishing before proceeding. If you see an option to allow publishing without a challenge for the next few minutes, enable it. This will allow for easy partial bundle publishing that immediately follows completion of the
publishstep.[!NOTE] Before the
publishstep starts, theprepackandpostpackscripts will run. These manage converting TS files to JS before packing and removing them after packing. After thepublishstep completes, thepostpublishscript will run. This kicks offtasks/sync_packages.js, which publishes the partial bundles.
- Run
aws --versionand confirm that the output starts withaws-cli/2 - If the command is not found, or the output shows version 1, install AWS CLI v2:
- On macOS, run
brew install awscli - On Linux or Windows, follow the AWS CLI install guide
- On macOS, run
- Run
./tasks/cdn_publish.shto upload the new release files to the CDN bucket on S3 - If that step fails with an authentication error, run
aws configureand enter the credentials for the plotly.js CDN bucket
- Open the releases page and click "Draft a new release"
- Select the tag for the release
- Set the title to
vX.Y.Z, the same text as the tag - Copy the description from the matching section of the CHANGELOG. Add extra context if necessary.
- For a release candidate, select the "This is a pre-release" box
- Click "Publish release"
- Post a link to the release tag,
https://github.com/plotly/plotly.js/releases/tag/vX.Y.Z, in the team announcement channels
At times it may be required to patch an older version of plotly.js (for a security fix, etc.). This example patches v3.7.0 and publishes 3.7.1.
- Run
git show v3.7.0:package.jsonand read thepreversionscript for the toolchain- A v3 tag needs Node.js 18. A v4 tag needs Node.js 22.
- Run
git switch -c maintenance-v3.7.1 v3.7.0 - Run
npm ci - Find the commits on
mainthat fixed the bugs in question. This example usesa34ad3. - Run
git cherry-pick a34ad3, fix the merge conflicts, and test the behavior - To apply several patches at once, use GitHub's
.patchURLs withgit am - Run
npm version patch. The command bumps the version to3.7.1, runsnpm run build, commits, and adds the tagv3.7.1. - Run
git show HEADto review the version commit - Run
git push && git push --tags - Run
DRYRUN=1 npm publish --tag maintenanceDRYRUNprevents publishing of the partial bundles viatasks/sync_packages.js. The patched bundle will still be published.
- Run
npm view plotly.js versionsand confirm that the list holds3.7.1 - Run
npm dist-tag ls plotly.jsand confirm thatlateststill points at the current release
- The
--tagargument in thenpm publishstep is very important. Without that argument, the maintenance release takes thelatesttag on npm. A cleannpm install plotly.jsthen installs3.7.1instead of the current release frommain. - Do not push a maintenance release to the CDN. This policy encourages every user to run the current plotly.js release.