@rushstack/lockfile-explorer
Version:
Rush Lockfile Explorer: The UI for solving version conflicts quickly in a large monorepo
64 lines • 2.55 kB
JavaScript
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.LfxGraph = exports.LfxGraphEntry = exports.LfxGraphDependency = void 0;
/**
* Represents an graph edge, which is an exact dependency version obtained from the lockfile.
*/
class LfxGraphDependency {
constructor(options) {
this.resolvedEntry = undefined;
const { name, versionPath, entryId, originalSpecifier, dependencyKind, peerDependencyMeta, containingEntry } = options;
this.name = name;
this.versionPath = versionPath;
this.entryId = entryId;
this.originalSpecifier = originalSpecifier;
this.dependencyKind = dependencyKind;
this.peerDependencyMeta = peerDependencyMeta;
this.containingEntry = containingEntry;
}
}
exports.LfxGraphDependency = LfxGraphDependency;
/**
* Represents a project or package listed in the pnpm lockfile.
*
* @remarks
* Each project or package will have its own LockfileEntry, which is created when the lockfile is first parsed.
* The fields for the LockfileEntry are outlined below:
*/
class LfxGraphEntry {
constructor(options) {
/**
* A list of all the dependencies for this entry.
* Note that dependencies, dev dependencies, as well as peer dependencies are all included.
*/
this.dependencies = [];
/**
* A list of dependencies that are listed under the "transitivePeerDependencies" in the pnpm lockfile.
*/
this.transitivePeerDependencies = new Set();
/**
* A list of entries that specify this entry as a dependency.
*/
this.referrers = [];
const { kind, entryId, rawEntryId, packageJsonFolderPath, entryPackageName, displayText, entryPackageVersion, entrySuffix } = options;
this.kind = kind;
this.entryId = entryId;
this.rawEntryId = rawEntryId;
this.packageJsonFolderPath = packageJsonFolderPath;
this.entryPackageName = entryPackageName;
this.displayText = displayText;
this.entryPackageVersion = entryPackageVersion;
this.entrySuffix = entrySuffix;
}
}
exports.LfxGraphEntry = LfxGraphEntry;
class LfxGraph {
constructor(workspace) {
this.entries = [];
this.workspace = Object.assign({}, workspace);
}
}
exports.LfxGraph = LfxGraph;
//# sourceMappingURL=LfxGraph.js.map