@versatiles/release-tool
v2.9.1
Published
VersaTiles release and documentation tools
Readme
VersaTiles Release Tools
Tools used for:
- creating a graph of the source code as mermaid:
vrt deps-graph - upgrading all package dependencies:
vrt deps-upgrade - creating Markdown documentation of executables:
vrt doc-command - inserting Markdown into documents:
vrt doc-insert - updating "Table of Content" in Markdown files:
vrt doc-toc - releasing the project as npm package:
vrt release-npm
Installation
npm i -D @versatiles/release-toolconfigure scripts
You need to configure the scripts in the package.json:
{
"scripts": {
"check": "npm run lint && npm run build && npm run test",
"prepack": "npm run build && npm run doc",
"release": "vrt release-npm",
...
},
...
}scripts.checkis required by the release command. Here you can lint, build and test your code.scripts.prepackis recommended to ensure that all files are up-to-date before releasing. Here you can build code and documentation.scripts.releaseis recommended to make it easy to release a new version.
Holding back dependencies
By default deps-upgrade upgrades every dependency to its latest version. Dependencies that must not follow can be declared in the vrt.depsUpgrade.ignore field of your package.json:
{
"vrt": {
"depsUpgrade": {
"ignore": ["path-to-regexp@<7.0.0", "typescript"]
}
}
}- An entry without a range (
"typescript") blocks every upgrade of that package. - An entry with a semver range (
"path-to-regexp@<7.0.0") only blocks versions outside that range, so patches and minor releases keep coming in. Such a package is upgraded within the range that is already declared in your package.json, e.g."^6.3.0"is upgraded to the latest6.x.
The same rules can be given as an object, and on the command line:
"ignore": { "path-to-regexp": "<7.0.0", "typescript": true }vrt deps-upgrade --ignore 'path-to-regexp@<7.0.0' --ignore typescriptCommand line entries are merged into the configured ones and win in case of a conflict.
Trimming a noisy dependency graph
For repos with high fan-out, deps-graph accepts repeatable globs to collapse or drop nodes:
# Merge all region scrapers into a single labelled node ("regions/*.ts (24 files)").
vrt deps-graph --collapse-dir 'src/regions/*.ts'
# Drop trivial barrels and stubs from the graph entirely.
vrt deps-graph --exclude '**/_planned.ts' --exclude '**/index.ts'Command vrt
4-->5 6-->4 7-->5 7-->4 7-->8 8-->5 8-->4 9-->A B-->4 C-->5 C-->A D-->E D-->5 D-->F D-->4 D-->G D-->8 E-->F F-->8 H-->2 H-->6 H-->7 H-->9 H-->B H-->C H-->D H-->4
class 0,1,3 subgraphs; classDef subgraphs fill-opacity:0.1, fill:#888, color:#888, stroke:#888;
