Kumacut 🐻 ✂
A script for handling the cutting of a release on the Kuma website.
PLEASE NOTE: This script is already present in the website repo. This repo exists for standalone testing that won't touch any of the website files and allows us to work without any other files getting in the way. If you want to work on the version for the end goal, focus on the website repo.
Running the script locally
As to not interfere with the version that is run from the website repository, you can run it locally via $ ./kumacut.js [command]. When it's live on the website project, you'll be able to use npm link and run it globally: $ kumacut [command].
What the script does
- It will clone the
draftdirectory to a new directory that is named by the version specified - After cloning the directory, it will find and replace all instances of
%%VER%%in the markdown files with the new version - It will add the new sidebar navigation structure for the new version to the
sidebar-nav.jsfile (it bases the nav structure on the previous versions, so it may require manual editing on your part if there are new pages under your new release) - It will append the new version to the
releases.jsonfile, which is what the website uses to handle the versioning on the documentation pages, install, etc.
How do I use the script?
You'll want to re-run npm|yarn install first and foremost. Once that's done, run npm link. This will link the kumacut command to your bin so you can run it globally.
Here's the command breakdown
kumacut --help
Usage: kumacut [options] [command]
Options:
-v, --version Output the current version of this script.
-h, --help output usage information
Commands:
latest display the latest version of Kuma
bump this will simply cut a new patch and bump the patch number up by 1
new <type> [ver] options: major, minor, custom <version>, or it defaults to patch
If you want to simply put out a new patch and increment by 1, you can run kumacut bump. For anything else, you can run kumacut new [major|minor|custom]. For custom, you can supply a version number in case you don't want to use the default options.
If you want to simply see what the latest version in the docs is for reference, you can run kumacut latest.
Developer notes
targetscontains the files we modify with this script. This folder is for testing. In the website project, the paths for these files must be modified accordingly at the top of the script. We usepath.resolveto figure out their location.draftis a clone of a version directory from the website. It's used as the base from which our clone functionality copies from. It's special here because instead of containing a version number hard-coded into the markdown files, it contains the token%%VER%%. This is what the script looks for when doing a find-and-replace.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
