forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackageManager.ts
More file actions
39 lines (34 loc) · 1.08 KB
/
PackageManager.ts
File metadata and controls
39 lines (34 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
/**
* This represents the available Package Manager tools as a string
* @public
*/
export type PackageManagerName = 'pnpm' | 'npm' | 'yarn' | 'bun';
/**
* An abstraction for controlling the supported package managers: PNPM, NPM, Bun, and Yarn.
* @public
*/
export abstract class PackageManager {
/**
* The package manager.
*/
public readonly packageManager: PackageManagerName;
/**
* The SemVer version of the package manager.
*/
public readonly version: string;
/**
* The filename of the shrinkwrap file that is used by the package manager.
*
* @remarks
* Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
*/
public readonly shrinkwrapFilename: string;
/** @internal */
protected constructor(version: string, packageManager: PackageManagerName, shrinkwrapFilename: string) {
this.version = version;
this.packageManager = packageManager;
this.shrinkwrapFilename = shrinkwrapFilename;
}
}