Skip to content

validatePackageVersions

Validates that the npm package files carry the manifest’s version: package.json’s version, and package-lock.json’s root version and packages[""].version. The release bumps all of them together, so a difference means one was edited by hand, and the tag, cut from manifest.json’s version, no longer names the package that was built. A file or a field that is absent is not checked.

Import:

import { validatePackageVersions } from '@mnaoumov/obsidian-dev-toolkit/plugin-release-checks';

Signature:

function validatePackageVersions(sources: PluginPackageVersionSources, manifestVersion: string | null | undefined, manifestLabel: string): PluginCheckFinding[]

Parameters:

Parameter Type Description
sources PluginPackageVersionSources The parsed package files.
manifestVersion string | null | undefined The version of the manifest, or null / undefined when it has none, which skips the check.
manifestLabel string How the manifest is named in a finding.

Returns: PluginCheckFinding[] — The findings, empty when every version present is the manifest’s.


Links to this page: