-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
DONE AS OF 2023-05-20:
- https://github.com/bmish/check-dependency-version-consistency/releases/tag/v3.2.0
- https://github.com/bmish/check-dependency-version-consistency#node-api
Considering a few possible options for how to expose our functionality for programmatic usage instead of just as a CLI binary. We could possibly expose both raw functions and a class.
1. Expose functions
import { check, fix } from 'check-dependency-version-consistency';
const path = 'path/to/workspace/root';
const versionMismatches = check({ path }); // pass any options
const versionMismatchesRemaining = fix({ path }); // pass any options
2. Expose a class
import CheckDependencyVersionConsistency from 'check-dependency-version-consistency';
const path = 'path/to/workspace/root';
const checker = new CheckDependencyVersionConsistency({ path }); // pass any options
const versionMismatches = checker.check();
const versionMismatchesRemaining = checker.fix();
Types
Version mismatches would be an object of this type (currently used internally).
export type MismatchingDependencyVersions = Array<{
dependency: string;
versions: {
version: string;
packages: string[];
}[];
}>;
Note: this is low priority since I haven't heard had a need or use case for this yet. If you have one, please comment.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request