The primary action for "releasing" TimelineJS is pushing a new version to cdn.knightlab.com but as of mid-2020, we also publish new versions to the npmjs package registry.
- Before cutting a release, test thoroughly. Is this an opportunity to add new unit tests? Develop functional testing? If nothing else,
npm run compareprovides a way to see how some historical timelines would function with the new code. (Note that because of Google Sheets API changes, compare now compares back to the oldest release in the 3.8.x series instead of the pre-webpack version) - Update
CHANGELOGto indicate the release date under the "not yet released" version header. Hopefully you've been incrementally updating the file with relevant changes so that this is just editing the version "header". Commit this change (npm versionrefuses to run unless the working directory, including the index, is fully clean, so this can't just be staged). - Run
npm version <newversion>(e.g.npm version 3.9.13, ornpm version major/minor/patch). This bumpspackage.jsonandpackage-lock.json, commits that bump, and creates a matching git tag. The repo's.npmrcconfiguresnpm versionto tag as3.9.13rather than the npm defaultv3.9.13, matching our existing tags. - Push the commit and the tag to GitHub:
git push && git push --tags - Execute
npm run stage_latest, which creates both a versioned edition of the library and a copy of it in the/latest/directory of the CDN repository. (stage.jsreads the version to stage directly frompackage.json, so it must already be bumped and tagged by the previous step before you run this.) - Execute
npm publish(permissions required) - Change directories to the local copy of the
cdn.knightlab.comrepository, to which files were copied by the previous step git add app/libs/timeline3to add the new version and updatedlatestto Git- Commit those changes with a message like "TimelineJS 3.x.x"
- Push changes to GitHub
- (probably) activate the virtual environment which can publish to the CDN
- execute
fab deployto copy the new files up to the Knight Lab CDN - In an incognito/private browser, load timeline.knightlab.com and verify that the demo timeline works as expected
The Wordpress plugin bundles the TimelineJS code, so when a new version of the library is released, a new version of the plugin should also be published. This requires you to have a copy of the plugin Git repository locally in a directory adjacent to your copy of the TimelineJS repo.
- In the TimelineJS3 repo, execute
fab stage_wp - Change to the
TimelineJS-Wordpress-Plugindirectory - Update the plugin version in
knightlab-timeline.phpandreadme.txt - Add all changed files to Github and commit them.
- Execute
./deploy.sh - When prompted, specify a commit message. If you're just updating the JS, you can say something like "Update to TimelineJS 3.x.x"
Note that releases of the JavaScript library are independent from updates to timeline.knightlab.com, which is deployed using fab deploy:prd in the python environment.