mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-25 08:08:14 -05:00
7
.changeset/selfish-icons-beam.md
Normal file
7
.changeset/selfish-icons-beam.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-installation": minor
|
||||
"@pnpm/core": minor
|
||||
"pnpm": minor
|
||||
---
|
||||
|
||||
`pnpm install --resolution-only` re-runs resolution to print out any peer dependency issues [#6411](https://github.com/pnpm/pnpm/pull/6411).
|
||||
@@ -35,6 +35,7 @@ export interface StrictInstallOptions {
|
||||
mergeGitBranchLockfiles: boolean
|
||||
linkWorkspacePackagesDepth: number
|
||||
lockfileOnly: boolean
|
||||
forceFullResolution: boolean
|
||||
fixLockfile: boolean
|
||||
dedupe: boolean
|
||||
ignoreCompatibilityDb: boolean
|
||||
@@ -142,6 +143,7 @@ const defaults = async (opts: InstallOptions) => {
|
||||
enablePnp: false,
|
||||
engineStrict: false,
|
||||
force: false,
|
||||
forceFullResolution: false,
|
||||
forceSharedLockfile: false,
|
||||
frozenLockfile: false,
|
||||
hoistPattern: undefined,
|
||||
|
||||
@@ -318,7 +318,8 @@ export async function mutateModules (
|
||||
patchedDependencies,
|
||||
}) ||
|
||||
opts.fixLockfile ||
|
||||
!ctx.wantedLockfile.lockfileVersion.toString().startsWith('6.')
|
||||
!ctx.wantedLockfile.lockfileVersion.toString().startsWith('6.') ||
|
||||
opts.forceFullResolution
|
||||
if (needsFullResolution) {
|
||||
ctx.wantedLockfile.overrides = opts.overrides
|
||||
ctx.wantedLockfile.neverBuiltDependencies = opts.neverBuiltDependencies
|
||||
|
||||
@@ -6,7 +6,7 @@ import { type CreateStoreControllerOptions } from '@pnpm/store-connection-manage
|
||||
import { isCI } from 'ci-info'
|
||||
import pick from 'ramda/src/pick'
|
||||
import renderHelp from 'render-help'
|
||||
import { installDeps } from './installDeps'
|
||||
import { installDeps, type InstallDepsOptions } from './installDeps'
|
||||
|
||||
export function rcOptionsTypes () {
|
||||
return pick([
|
||||
@@ -74,6 +74,7 @@ export const cliOptionsTypes = () => ({
|
||||
...rcOptionsTypes(),
|
||||
...pick(['force'], allTypes),
|
||||
'fix-lockfile': Boolean,
|
||||
'resolution-only': Boolean,
|
||||
recursive: Boolean,
|
||||
})
|
||||
|
||||
@@ -228,6 +229,10 @@ Install all optionalDependencies even they don\'t satisfy the current environmen
|
||||
description: 'Only use the side effects cache if present, do not create it for new packages',
|
||||
name: '--side-effects-cache-readonly',
|
||||
},
|
||||
{
|
||||
description: 'Re-runs resolution: useful for printing out peer dependency issues',
|
||||
name: '--resolution-only',
|
||||
},
|
||||
...UNIVERSAL_OPTIONS,
|
||||
],
|
||||
},
|
||||
@@ -296,6 +301,7 @@ export type InstallCommandOptions = Pick<Config,
|
||||
pruneDirectDependencies?: boolean
|
||||
pruneStore?: boolean
|
||||
recursive?: boolean
|
||||
resolutionOnly?: boolean
|
||||
saveLockfile?: boolean
|
||||
workspace?: boolean
|
||||
includeOnlyPackageFiles?: boolean
|
||||
@@ -309,12 +315,17 @@ export async function handler (
|
||||
devDependencies: opts.dev !== false,
|
||||
optionalDependencies: opts.optional !== false,
|
||||
}
|
||||
return installDeps({
|
||||
const installDepsOptions: InstallDepsOptions = {
|
||||
...opts,
|
||||
frozenLockfileIfExists: isCI && !opts.lockfileOnly &&
|
||||
typeof opts.rawLocalConfig['frozen-lockfile'] === 'undefined' &&
|
||||
typeof opts.rawLocalConfig['prefer-frozen-lockfile'] === 'undefined',
|
||||
include,
|
||||
includeDirect: include,
|
||||
}, [])
|
||||
}
|
||||
if (opts.resolutionOnly) {
|
||||
installDepsOptions.lockfileOnly = true
|
||||
installDepsOptions.forceFullResolution = true
|
||||
}
|
||||
return installDeps(installDepsOptions, [])
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ export type InstallDepsOptions = Pick<Config,
|
||||
original: string[]
|
||||
}
|
||||
allowNew?: boolean
|
||||
forceFullResolution?: boolean
|
||||
frozenLockfileIfExists?: boolean
|
||||
include?: IncludedDependencies
|
||||
includeDirect?: IncludedDependencies
|
||||
|
||||
Reference in New Issue
Block a user