package-manager-manager
Advanced tools
Comparing version 0.1.0 to 0.1.1-1cfd3b9
@@ -1,2 +0,2 @@ | ||
import { getPackageManager as h } from "./packageManager.js"; | ||
import { getPackageManager as d } from "./packageManager.js"; | ||
import "shellac"; | ||
@@ -13,3 +13,2 @@ import "./commands/getRunScript.js"; | ||
import "./package/npm.js"; | ||
import "./package/shared.js"; | ||
import "./package/pnpm.js"; | ||
@@ -20,4 +19,4 @@ import "./package/yarn.js"; | ||
export { | ||
h as getPackageManager | ||
d as getPackageManager | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "package-manager-manager", | ||
"version": "0.1.0", | ||
"version": "0.1.1-1cfd3b9", | ||
"description": "Utilities for managing package managers.", | ||
@@ -54,2 +54,5 @@ "license": "MIT", | ||
}, | ||
"versionMetadata": { | ||
"type": "BETA" | ||
}, | ||
"scripts": { | ||
@@ -56,0 +59,0 @@ "build": "vite build", |
import { getBunGetPackageInfoFunction as n } from "./bun.js"; | ||
import { getNpmGetPackageInfoFunction as o } from "./npm.js"; | ||
import { getPnpmGetPackageInfoFunction as r } from "./pnpm.js"; | ||
import { getYarnGetPackageInfoFunction as e } from "./yarn.js"; | ||
import { getNpmGetPackageInfoFunction as e } from "./npm.js"; | ||
import { getPnpmGetPackageInfoFunction as o } from "./pnpm.js"; | ||
import { getYarnGetPackageInfoFunction as r } from "./yarn.js"; | ||
import "shellac"; | ||
import "./shared.js"; | ||
import "node:fs/promises"; | ||
@@ -12,10 +11,10 @@ import "node:path"; | ||
import "../utils/yarn.js"; | ||
function I(t) { | ||
function F(t) { | ||
switch (t.name) { | ||
case "npm": | ||
return e(); | ||
case "pnpm": | ||
return o(); | ||
case "pnpm": | ||
return r(); | ||
case "yarn": | ||
return e(t); | ||
return r(t); | ||
case "bun": | ||
@@ -28,4 +27,4 @@ return n(); | ||
export { | ||
I as getPackageInfoFunction | ||
F as getPackageInfoFunction | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,5 +0,3 @@ | ||
export declare function getNpmGetPackageInfoFunction(): (packageName: string) => Promise<{ | ||
name: string; | ||
version: string; | ||
} | null>; | ||
import type { GetPackageInfo } from './index'; | ||
export declare function getNpmGetPackageInfoFunction(): (packageName: string) => ReturnType<GetPackageInfo>; | ||
//# sourceMappingURL=npm.d.ts.map |
@@ -1,9 +0,16 @@ | ||
import { getNpmOrPnpmGetPackageInfoFunction as n } from "./shared.js"; | ||
import "shellac"; | ||
function e() { | ||
return n("npm"); | ||
import s from "shellac"; | ||
function p() { | ||
return async (...[t]) => { | ||
var n, e; | ||
try { | ||
const c = (await s`$ npm list --depth=0 --json`).stdout, o = JSON.parse(c), r = ((n = o.dependencies) == null ? void 0 : n[t]) ?? ((e = o.devDependencies) == null ? void 0 : e[t]); | ||
return r ? { name: t, version: r.version } : null; | ||
} catch { | ||
throw new Error(`An error occurred while gathering the package info of "${t}"`); | ||
} | ||
}; | ||
} | ||
export { | ||
e as getNpmGetPackageInfoFunction | ||
p as getNpmGetPackageInfoFunction | ||
}; | ||
//# sourceMappingURL=npm.js.map |
@@ -1,5 +0,3 @@ | ||
export declare function getPnpmGetPackageInfoFunction(): (packageName: string) => Promise<{ | ||
name: string; | ||
version: string; | ||
} | null>; | ||
import type { GetPackageInfo } from './index'; | ||
export declare function getPnpmGetPackageInfoFunction(): (packageName: string) => ReturnType<GetPackageInfo>; | ||
//# sourceMappingURL=pnpm.d.ts.map |
@@ -1,9 +0,15 @@ | ||
import { getNpmOrPnpmGetPackageInfoFunction as n } from "./shared.js"; | ||
import "shellac"; | ||
function e() { | ||
return n("pnpm"); | ||
import c from "shellac"; | ||
function s() { | ||
return async (...[t]) => { | ||
try { | ||
const e = (await c`$ pnpm list --depth=0`).stdout, o = new RegExp(`^${t}\\s+(.*)$`, "im"), r = e.match(o), n = r == null ? void 0 : r[1]; | ||
return n ? { name: t, version: n } : null; | ||
} catch { | ||
throw new Error(`An error occurred while gathering the package info of "${t}"`); | ||
} | ||
}; | ||
} | ||
export { | ||
e as getPnpmGetPackageInfoFunction | ||
s as getPnpmGetPackageInfoFunction | ||
}; | ||
//# sourceMappingURL=pnpm.js.map |
@@ -14,3 +14,2 @@ import p from "shellac"; | ||
import "./package/npm.js"; | ||
import "./package/shared.js"; | ||
import "./package/pnpm.js"; | ||
@@ -22,3 +21,3 @@ import "./package/yarn.js"; | ||
} | ||
async function N() { | ||
async function h() { | ||
const n = await S(); | ||
@@ -43,4 +42,4 @@ if (!n) | ||
t.cliCommandKeywords = k(t), t.getPackageInfo = R({ name: a, version: r }); | ||
const { getRunScript: u, getRunScriptStruct: m } = l(t), { getRunExec: g, getRunExecStruct: s } = f(t); | ||
return t.getRunScript = u, t.getRunScriptStruct = m, t.getRunExec = g, t.getRunExecStruct = s, t; | ||
const { getRunScript: u, getRunScriptStruct: g } = l(t), { getRunExec: m, getRunExecStruct: s } = f(t); | ||
return t.getRunScript = u, t.getRunScriptStruct = g, t.getRunExec = m, t.getRunExecStruct = s, t; | ||
} | ||
@@ -51,4 +50,4 @@ } | ||
export { | ||
N as getPackageManager | ||
h as getPackageManager | ||
}; | ||
//# sourceMappingURL=packageManager.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 3 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
124675
0
105
903
12