mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Merge remote-tracking branch 'origin/main' into feature/pypi
This commit is contained in:
commit
548d416996
64 changed files with 1689 additions and 381 deletions
|
|
@ -11,10 +11,32 @@ import {
|
|||
import { createYarnPackageManager } from "./yarn/createPackageManager.js";
|
||||
import { createPipPackageManager } from "./pip/createPackageManager.js";
|
||||
|
||||
/**
|
||||
* @type {{packageManagerName: PackageManager | null}}
|
||||
*/
|
||||
const state = {
|
||||
packageManagerName: null,
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {Object} GetDependencyUpdatesResult
|
||||
* @property {string} name
|
||||
* @property {string} version
|
||||
* @property {string} type
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} PackageManager
|
||||
* @property {(args: string[]) => Promise<{ status: number }>} runCommand
|
||||
* @property {(args: string[]) => boolean} isSupportedCommand
|
||||
* @property {(args: string[]) => Promise<GetDependencyUpdatesResult[]> | GetDependencyUpdatesResult[]} getDependencyUpdatesForCommand
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {string} packageManagerName
|
||||
*
|
||||
* @return {PackageManager}
|
||||
*/
|
||||
export function initializePackageManager(packageManagerName) {
|
||||
if (packageManagerName === "npm") {
|
||||
state.packageManagerName = createNpmPackageManager();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue