TimelineJS3 has two independent products which can be "deployed". The deployment process requires specific access permissions, so the instructions below are not expected to be meaningful outside of Knight Lab.
- The JavaScript Library
- The Website
To deploy updates to the javascript, you must have a local copy of the cdn.knightlab.com repository checked out on your filesystem, "next to" your TimelineJS3 repository.
"Next to" means that the TimelineJS3 repository and the other repositories should have the same parent directory. Of course, you must also have authorization to write to the appropriate S3 buckets, or, for the Wordpress plugin, to the Wordpress SVN server.
Before beginning to deploy, make sure all changes are thoroughly tested. Update CHANGELOG to track changes and establish the release date for the version. Update package.json to the new version number.
Deploying the JavaScript library uses npm scripts defined in package.json. To deploy to the Knight Lab CDN, use the following scripts:
- npm run stage_latest (most common)
- npm run stage
- npm run stage_dev
To stage a new release of TimelineJS, use npm run stage_latest. This will ask you for a version number (tag), build the code, and copy it to the appropriate versioned subdirectory of the cdn.knightlab.com repository, as well as copying it to the /latest/ directory. In the rare case when you want to tag a version, but not change latest, use npm run stage although then copying that to /latest/ is outside the scope of these tools.
When a new version is deployed to the CDN, it should also be published to the npmjs repository. Do this by running npm publish.
Note: this does not deploy the new code. There is one more step--you must switch to the CDN repository, commit the new code, and deploy the repository.
We no longer actively maintain the Wordpress plugin, because recent versions of Wordpress (since the "Gutenberg" redesign) support "Custom HTML" blocks into which TimelineJS embed code can be pasted.
To deploy changes to the website which explains TimelineJS3 and hosts the "authoring tool":
cd website/
./deploy.sh prd
This will build the website and copy the files to the timeline.knightlab.com server.