@pnpm/manifest-utils
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -1,2 +0,2 @@ | ||
import { type DependenciesField, type ProjectManifest } from '@pnpm/types'; | ||
import { type DependenciesOrPeersField, type DependenciesField, type ProjectManifest } from '@pnpm/types'; | ||
export interface PackageSpecObject { | ||
@@ -10,2 +10,2 @@ alias: string; | ||
export declare function updateProjectManifestObject(prefix: string, packageManifest: ProjectManifest, packageSpecs: PackageSpecObject[]): Promise<ProjectManifest>; | ||
export declare function guessDependencyType(alias: string, manifest: ProjectManifest): DependenciesField | undefined; | ||
export declare function guessDependencyType(alias: string, manifest: ProjectManifest): DependenciesOrPeersField | undefined; |
@@ -26,4 +26,6 @@ "use strict"; | ||
const usedDepType = guessDependencyType(packageSpec.alias, packageManifest) ?? 'dependencies'; | ||
packageManifest[usedDepType] = packageManifest[usedDepType] ?? {}; | ||
packageManifest[usedDepType][packageSpec.alias] = packageSpec.pref; | ||
if (usedDepType !== 'peerDependencies') { | ||
packageManifest[usedDepType] = packageManifest[usedDepType] ?? {}; | ||
packageManifest[usedDepType][packageSpec.alias] = packageSpec.pref; | ||
} | ||
} | ||
@@ -49,3 +51,3 @@ if (packageSpec.nodeExecPath) { | ||
function guessDependencyType(alias, manifest) { | ||
return types_1.DEPENDENCIES_FIELDS | ||
return types_1.DEPENDENCIES_OR_PEER_FIELDS | ||
.find((depField) => manifest[depField]?.[alias] === '' || Boolean(manifest[depField]?.[alias])); | ||
@@ -52,0 +54,0 @@ } |
{ | ||
"name": "@pnpm/manifest-utils", | ||
"description": "Utils for dealing with package manifest", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"bugs": { | ||
@@ -23,5 +23,5 @@ "url": "https://github.com/pnpm/pnpm/issues" | ||
"dependencies": { | ||
"@pnpm/core-loggers": "9.0.0", | ||
"@pnpm/error": "5.0.0", | ||
"@pnpm/types": "9.0.0" | ||
"@pnpm/core-loggers": "9.0.1", | ||
"@pnpm/error": "5.0.1", | ||
"@pnpm/types": "9.1.0" | ||
}, | ||
@@ -31,3 +31,3 @@ "homepage": "https://github.com/pnpm/pnpm/blob/main/pkg-manifest/manifest-utils#readme", | ||
"devDependencies": { | ||
"@pnpm/manifest-utils": "5.0.0" | ||
"@pnpm/manifest-utils": "5.0.1" | ||
}, | ||
@@ -34,0 +34,0 @@ "exports": { |
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
18401
207
+ Added@pnpm/constants@7.1.0(transitive)
+ Added@pnpm/core-loggers@9.0.1(transitive)
+ Added@pnpm/error@5.0.1(transitive)
+ Added@pnpm/types@9.1.0(transitive)
- Removed@pnpm/constants@7.0.0(transitive)
- Removed@pnpm/core-loggers@9.0.0(transitive)
- Removed@pnpm/error@5.0.0(transitive)
- Removed@pnpm/types@9.0.0(transitive)
Updated@pnpm/core-loggers@9.0.1
Updated@pnpm/error@5.0.1
Updated@pnpm/types@9.1.0