mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-04 23:34:58 -04:00
6
.changeset/heavy-dolls-itch.md
Normal file
6
.changeset/heavy-dolls-itch.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@pnpm/plugin-commands-deploy": patch
|
||||||
|
"pnpm": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
The deploy command should not ask for confirmation to purge the `node_modules` directory [#6510](https://github.com/pnpm/pnpm/issues/6510).
|
||||||
6
.changeset/neat-zoos-glow.md
Normal file
6
.changeset/neat-zoos-glow.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@pnpm/get-context": minor
|
||||||
|
"@pnpm/core": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
New option added: confirmModulesPurge.
|
||||||
@@ -123,6 +123,7 @@ export interface StrictInstallOptions {
|
|||||||
dedupePeerDependents: boolean
|
dedupePeerDependents: boolean
|
||||||
extendNodePath: boolean
|
extendNodePath: boolean
|
||||||
excludeLinksFromLockfile: boolean
|
excludeLinksFromLockfile: boolean
|
||||||
|
confirmModulesPurge: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InstallOptions =
|
export type InstallOptions =
|
||||||
@@ -139,6 +140,7 @@ const defaults = async (opts: InstallOptions) => {
|
|||||||
allowNonAppliedPatches: false,
|
allowNonAppliedPatches: false,
|
||||||
autoInstallPeers: true,
|
autoInstallPeers: true,
|
||||||
childConcurrency: 5,
|
childConcurrency: 5,
|
||||||
|
confirmModulesPurge: !opts.force,
|
||||||
depth: 0,
|
depth: 0,
|
||||||
enablePnp: false,
|
enablePnp: false,
|
||||||
engineStrict: false,
|
engineStrict: false,
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ test('do not fail on non-compatible node_modules when forced with a named instal
|
|||||||
|
|
||||||
await install({}, {
|
await install({}, {
|
||||||
...opts,
|
...opts,
|
||||||
force: true, // Don't ask for prompt
|
confirmModulesPurge: false,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ test('do not fail on non-compatible store when forced during named installation'
|
|||||||
|
|
||||||
await install({}, {
|
await install({}, {
|
||||||
...opts,
|
...opts,
|
||||||
force: true, // Don't ask for prompt
|
confirmModulesPurge: false,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ test('fail if installing different types of dependencies in a project that uses
|
|||||||
await project.hasNot('once')
|
await project.hasNot('once')
|
||||||
|
|
||||||
const newOpts = await testDefaults({
|
const newOpts = await testDefaults({
|
||||||
force: true, // Don't ask for prompt
|
confirmModulesPurge: false,
|
||||||
include: {
|
include: {
|
||||||
dependencies: true,
|
dependencies: true,
|
||||||
devDependencies: true,
|
devDependencies: true,
|
||||||
|
|||||||
@@ -1063,7 +1063,7 @@ test('lockfile is not getting broken if the used registry changes', async () =>
|
|||||||
rootDir: process.cwd(),
|
rootDir: process.cwd(),
|
||||||
}, {
|
}, {
|
||||||
...newOpts,
|
...newOpts,
|
||||||
force: true, // Don't ask for prompt
|
confirmModulesPurge: false,
|
||||||
})
|
})
|
||||||
await addDependenciesToPackage(manifest, ['is-negative@1'], newOpts)
|
await addDependenciesToPackage(manifest, ['is-negative@1'], newOpts)
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ interface HookOptions {
|
|||||||
|
|
||||||
export interface GetContextOptions {
|
export interface GetContextOptions {
|
||||||
allProjects: Array<ProjectOptions & HookOptions>
|
allProjects: Array<ProjectOptions & HookOptions>
|
||||||
|
confirmModulesPurge?: boolean
|
||||||
force: boolean
|
force: boolean
|
||||||
forceNewModules?: boolean
|
forceNewModules?: boolean
|
||||||
forceSharedLockfile: boolean
|
forceSharedLockfile: boolean
|
||||||
@@ -116,7 +117,7 @@ export async function getContext (
|
|||||||
registries: opts.registries,
|
registries: opts.registries,
|
||||||
storeDir: opts.storeDir,
|
storeDir: opts.storeDir,
|
||||||
virtualStoreDir,
|
virtualStoreDir,
|
||||||
confirmModulesPurge: !opts.force && !isCI,
|
confirmModulesPurge: opts.confirmModulesPurge && !isCI,
|
||||||
|
|
||||||
forceHoistPattern: opts.forceHoistPattern,
|
forceHoistPattern: opts.forceHoistPattern,
|
||||||
hoistPattern: opts.hoistPattern,
|
hoistPattern: opts.hoistPattern,
|
||||||
@@ -408,6 +409,7 @@ export async function getContextForSingleImporter (
|
|||||||
force: boolean
|
force: boolean
|
||||||
forceNewModules?: boolean
|
forceNewModules?: boolean
|
||||||
forceSharedLockfile: boolean
|
forceSharedLockfile: boolean
|
||||||
|
confirmModulesPurge?: boolean
|
||||||
extraBinPaths: string[]
|
extraBinPaths: string[]
|
||||||
extendNodePath?: boolean
|
extendNodePath?: boolean
|
||||||
lockfileDir: string
|
lockfileDir: string
|
||||||
@@ -472,7 +474,7 @@ export async function getContextForSingleImporter (
|
|||||||
registries: opts.registries,
|
registries: opts.registries,
|
||||||
storeDir: opts.storeDir,
|
storeDir: opts.storeDir,
|
||||||
virtualStoreDir,
|
virtualStoreDir,
|
||||||
confirmModulesPurge: !opts.force && !isCI,
|
confirmModulesPurge: opts.confirmModulesPurge && !isCI,
|
||||||
|
|
||||||
forceHoistPattern: opts.forceHoistPattern,
|
forceHoistPattern: opts.forceHoistPattern,
|
||||||
hoistPattern: opts.hoistPattern,
|
hoistPattern: opts.hoistPattern,
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ export type InstallCommandOptions = Pick<Config,
|
|||||||
saveLockfile?: boolean
|
saveLockfile?: boolean
|
||||||
workspace?: boolean
|
workspace?: boolean
|
||||||
includeOnlyPackageFiles?: boolean
|
includeOnlyPackageFiles?: boolean
|
||||||
|
confirmModulesPurge?: boolean
|
||||||
} & Partial<Pick<Config, 'modulesCacheMaxAge' | 'pnpmHomeDir' | 'preferWorkspacePackages'>>
|
} & Partial<Pick<Config, 'modulesCacheMaxAge' | 'pnpmHomeDir' | 'preferWorkspacePackages'>>
|
||||||
|
|
||||||
export async function handler (
|
export async function handler (
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export async function handler (
|
|||||||
await copyProject(deployedDir, deployDir, { includeOnlyPackageFiles })
|
await copyProject(deployedDir, deployDir, { includeOnlyPackageFiles })
|
||||||
await install.handler({
|
await install.handler({
|
||||||
...opts,
|
...opts,
|
||||||
|
confirmModulesPurge: false,
|
||||||
depth: Infinity,
|
depth: Infinity,
|
||||||
hooks: {
|
hooks: {
|
||||||
...opts.hooks,
|
...opts.hooks,
|
||||||
|
|||||||
Reference in New Issue
Block a user