@pnpm/list
Advanced tools
Comparing version 6.3.3 to 7.0.0
@@ -9,3 +9,2 @@ "use strict"; | ||
async function getPkgInfo(pkg) { | ||
var _a; | ||
let manifest; | ||
@@ -28,3 +27,3 @@ try { | ||
homepage: manifest.homepage, | ||
repository: (_a = (manifest.repository && (typeof manifest.repository === 'string' ? manifest.repository : manifest.repository.url))) !== null && _a !== void 0 ? _a : undefined, | ||
repository: (manifest.repository && (typeof manifest.repository === 'string' ? manifest.repository : manifest.repository.url)) ?? undefined, | ||
}; | ||
@@ -31,0 +30,0 @@ } |
@@ -26,4 +26,4 @@ "use strict"; | ||
depth: opts.depth, | ||
include: maybeOpts === null || maybeOpts === void 0 ? void 0 : maybeOpts.include, | ||
lockfileDir: maybeOpts === null || maybeOpts === void 0 ? void 0 : maybeOpts.lockfileDir, | ||
include: maybeOpts?.include, | ||
lockfileDir: maybeOpts?.lockfileDir, | ||
registries: opts.registries, | ||
@@ -60,4 +60,4 @@ search, | ||
depth: opts.depth, | ||
include: maybeOpts === null || maybeOpts === void 0 ? void 0 : maybeOpts.include, | ||
lockfileDir: maybeOpts === null || maybeOpts === void 0 ? void 0 : maybeOpts.lockfileDir, | ||
include: maybeOpts?.include, | ||
lockfileDir: maybeOpts?.lockfileDir, | ||
registries: opts.registries, | ||
@@ -64,0 +64,0 @@ })) |
@@ -14,3 +14,2 @@ "use strict"; | ||
const jsonArr = await Promise.all(pkgs.map(async (pkg) => { | ||
var _a; | ||
const jsonObj = { | ||
@@ -23,3 +22,3 @@ name: pkg.name, | ||
for (const dependenciesField of [...types_1.DEPENDENCIES_FIELDS.sort(), 'unsavedDependencies']) { | ||
if ((_a = pkg[dependenciesField]) === null || _a === void 0 ? void 0 : _a.length) { | ||
if (pkg[dependenciesField]?.length) { | ||
jsonObj[dependenciesField] = await toJsonResult(pkg[dependenciesField], { long: opts.long }); | ||
@@ -36,4 +35,3 @@ } | ||
await Promise.all(sortPackages(entryNodes).map(async (node) => { | ||
var _a; | ||
const subDependencies = await toJsonResult((_a = node.dependencies) !== null && _a !== void 0 ? _a : [], opts); | ||
const subDependencies = await toJsonResult(node.dependencies ?? [], opts); | ||
const dep = opts.long | ||
@@ -40,0 +38,0 @@ ? await (0, getPkgInfo_1.default)(node) |
@@ -14,8 +14,7 @@ "use strict"; | ||
function renderParseableForPackage(pkg, opts) { | ||
var _a, _b, _c, _d; | ||
const pkgs = sortPackages(flatten([ | ||
...((_a = pkg.optionalDependencies) !== null && _a !== void 0 ? _a : []), | ||
...((_b = pkg.dependencies) !== null && _b !== void 0 ? _b : []), | ||
...((_c = pkg.devDependencies) !== null && _c !== void 0 ? _c : []), | ||
...((_d = pkg.unsavedDependencies) !== null && _d !== void 0 ? _d : []), | ||
...(pkg.optionalDependencies ?? []), | ||
...(pkg.dependencies ?? []), | ||
...(pkg.devDependencies ?? []), | ||
...(pkg.unsavedDependencies ?? []), | ||
])); | ||
@@ -46,7 +45,6 @@ if (!opts.alwaysPrintRootPackage && (pkgs.length === 0)) | ||
function flatten(nodes) { | ||
var _a; | ||
let packages = []; | ||
for (const node of nodes) { | ||
packages.push(node); | ||
if ((_a = node.dependencies) === null || _a === void 0 ? void 0 : _a.length) { | ||
if (node.dependencies?.length) { | ||
packages = packages.concat(flatten(node.dependencies)); | ||
@@ -53,0 +51,0 @@ } |
@@ -29,8 +29,7 @@ "use strict"; | ||
async function renderTreeForPackage(pkg, opts) { | ||
var _a, _b, _c, _d, _e; | ||
if (!opts.alwaysPrintRootPackage && | ||
!((_a = pkg.dependencies) === null || _a === void 0 ? void 0 : _a.length) && | ||
!((_b = pkg.devDependencies) === null || _b === void 0 ? void 0 : _b.length) && | ||
!((_c = pkg.optionalDependencies) === null || _c === void 0 ? void 0 : _c.length) && | ||
(!opts.showExtraneous || !((_d = pkg.unsavedDependencies) === null || _d === void 0 ? void 0 : _d.length))) | ||
!pkg.dependencies?.length && | ||
!pkg.devDependencies?.length && | ||
!pkg.optionalDependencies?.length && | ||
(!opts.showExtraneous || !pkg.unsavedDependencies?.length)) | ||
return ''; | ||
@@ -58,3 +57,3 @@ let label = ''; | ||
for (const dependenciesField of dependenciesFields) { | ||
if ((_e = pkg[dependenciesField]) === null || _e === void 0 ? void 0 : _e.length) { | ||
if (pkg[dependenciesField]?.length) { | ||
const depsLabel = chalk_1.default.cyanBright(dependenciesField !== 'unsavedDependencies' | ||
@@ -82,4 +81,3 @@ ? `${dependenciesField}:` | ||
return Promise.all(sortPackages(entryNodes).map(async (node) => { | ||
var _a; | ||
const nodes = await toArchyTree(getPkgColor, (_a = node.dependencies) !== null && _a !== void 0 ? _a : [], opts); | ||
const nodes = await toArchyTree(getPkgColor, node.dependencies ?? [], opts); | ||
if (opts.long) { | ||
@@ -86,0 +84,0 @@ const pkg = await (0, getPkgInfo_1.default)(node); |
{ | ||
"name": "@pnpm/list", | ||
"version": "6.3.3", | ||
"version": "7.0.0", | ||
"description": "List installed packages in a symlinked `node_modules`", | ||
@@ -13,3 +13,3 @@ "main": "lib/index.js", | ||
"keywords": [ | ||
"pnpm6", | ||
"pnpm7", | ||
"pnpm", | ||
@@ -20,3 +20,3 @@ "list", | ||
"engines": { | ||
"node": ">=12.17" | ||
"node": ">=14.19" | ||
}, | ||
@@ -29,6 +29,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"@pnpm/matcher": "2.0.0", | ||
"@pnpm/read-package-json": "5.0.12", | ||
"@pnpm/read-project-manifest": "2.0.13", | ||
"@pnpm/types": "7.10.0", | ||
"@pnpm/matcher": "3.0.0", | ||
"@pnpm/read-package-json": "6.0.0", | ||
"@pnpm/read-project-manifest": "3.0.0", | ||
"@pnpm/types": "8.0.0", | ||
"@zkochan/npm-package-arg": "^2.0.1", | ||
@@ -38,3 +38,3 @@ "archy": "^1.0.0", | ||
"cli-columns": "^4.0.0", | ||
"dependencies-hierarchy": "10.0.25", | ||
"dependencies-hierarchy": "11.0.0", | ||
"p-limit": "^3.1.0", | ||
@@ -45,3 +45,3 @@ "ramda": "^0.27.1", | ||
"devDependencies": { | ||
"@pnpm/list": "6.3.3", | ||
"@pnpm/list": "7.0.0", | ||
"@pnpm/logger": "^4.0.0", | ||
@@ -53,2 +53,5 @@ "@types/archy": "0.0.31", | ||
"funding": "https://opencollective.com/pnpm", | ||
"exports": { | ||
".": "./lib/index.js" | ||
}, | ||
"scripts": { | ||
@@ -55,0 +58,0 @@ "fix": "tslint -c tslint.json src/**/*.ts test/**/*.ts --fix", |
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
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
28
34376
478
+ Added@pnpm/constants@6.0.0(transitive)
+ Added@pnpm/error@3.0.0(transitive)
+ Added@pnpm/graceful-fs@2.0.0(transitive)
+ Added@pnpm/lockfile-file@5.0.0(transitive)
+ Added@pnpm/lockfile-types@4.0.0(transitive)
+ Added@pnpm/lockfile-utils@4.0.0(transitive)
+ Added@pnpm/matcher@3.0.0(transitive)
+ Added@pnpm/merge-lockfile-changes@3.0.0(transitive)
+ Added@pnpm/modules-yaml@10.0.0(transitive)
+ Added@pnpm/normalize-registries@3.0.0(transitive)
+ Added@pnpm/read-modules-dir@4.0.0(transitive)
+ Added@pnpm/read-package-json@6.0.0(transitive)
+ Added@pnpm/read-project-manifest@3.0.0(transitive)
+ Added@pnpm/resolver-base@9.0.0(transitive)
+ Added@pnpm/types@8.0.0(transitive)
+ Added@pnpm/write-project-manifest@3.0.0(transitive)
+ Addeddependencies-hierarchy@11.0.0(transitive)
+ Addeddependency-path@9.0.0(transitive)
- Removed@pnpm/constants@5.0.0(transitive)
- Removed@pnpm/error@2.1.0(transitive)
- Removed@pnpm/graceful-fs@1.0.0(transitive)
- Removed@pnpm/lockfile-file@4.3.1(transitive)
- Removed@pnpm/lockfile-types@3.2.0(transitive)
- Removed@pnpm/lockfile-utils@3.2.1(transitive)
- Removed@pnpm/matcher@2.0.0(transitive)
- Removed@pnpm/merge-lockfile-changes@2.0.8(transitive)
- Removed@pnpm/modules-yaml@9.1.1(transitive)
- Removed@pnpm/normalize-registries@2.0.13(transitive)
- Removed@pnpm/read-modules-dir@3.0.1(transitive)
- Removed@pnpm/read-package-json@5.0.12(transitive)
- Removed@pnpm/read-project-manifest@2.0.13(transitive)
- Removed@pnpm/resolver-base@8.1.6(transitive)
- Removed@pnpm/types@7.10.0(transitive)
- Removed@pnpm/write-project-manifest@2.0.11(transitive)
- Removeddependencies-hierarchy@10.0.25(transitive)
- Removeddependency-path@8.0.11(transitive)
Updated@pnpm/matcher@3.0.0
Updated@pnpm/types@8.0.0