diff --git a/.changeset/tall-berries-know.md b/.changeset/tall-berries-know.md new file mode 100644 index 00000000000..fef01c9aa99 --- /dev/null +++ b/.changeset/tall-berries-know.md @@ -0,0 +1,14 @@ +--- +"@pnpm/config": major +"pnpm": major +--- + +The next deprecated settings were removed: + +* frozen-shrinkwrap +* prefer-frozen-shrinkwrap +* shared-workspace-shrinkwrap +* shrinkwrap-directory +* lockfile-directory +* shrinkwrap-only +* store diff --git a/packages/config/src/Config.ts b/packages/config/src/Config.ts index 0803e16119c..9805bc5e7d9 100644 --- a/packages/config/src/Config.ts +++ b/packages/config/src/Config.ts @@ -152,12 +152,6 @@ export interface Config { } export interface ConfigWithDeprecatedSettings extends Config { - frozenShrinkwrap?: boolean globalPrefix?: string proxy?: string - lockfileDirectory?: string - preferFrozenShrinkwrap?: boolean - sharedWorkspaceShrinkwrap?: boolean - shrinkwrapDirectory?: string - shrinkwrapOnly?: boolean } diff --git a/packages/config/src/index.ts b/packages/config/src/index.ts index 619052289fd..23215bbc1d1 100644 --- a/packages/config/src/index.ts +++ b/packages/config/src/index.ts @@ -46,7 +46,6 @@ export const types = Object.assign({ filter: [String, Array], 'filter-prod': [String, Array], 'frozen-lockfile': Boolean, - 'frozen-shrinkwrap': Boolean, 'git-checks': Boolean, 'global-bin-dir': String, 'global-dir': String, @@ -74,7 +73,6 @@ export const types = Object.assign({ 'package-import-method': ['auto', 'hardlink', 'clone', 'copy'], pnpmfile: String, 'prefer-frozen-lockfile': Boolean, - 'prefer-frozen-shrinkwrap': Boolean, 'prefer-offline': Boolean, 'prefer-workspace-packages': Boolean, production: [null, true], @@ -89,16 +87,12 @@ export const types = Object.assign({ 'shamefully-flatten': Boolean, 'shamefully-hoist': Boolean, 'shared-workspace-lockfile': Boolean, - 'shared-workspace-shrinkwrap': Boolean, 'shell-emulator': Boolean, - 'shrinkwrap-directory': String, - 'shrinkwrap-only': Boolean, 'side-effects-cache': Boolean, 'side-effects-cache-readonly': Boolean, symlink: Boolean, sort: Boolean, 'state-dir': String, - store: String, // TODO: deprecate 'store-dir': String, stream: Boolean, 'strict-peer-dependencies': Boolean, @@ -200,9 +194,7 @@ export default async ( 'side-effects-cache': true, symlink: true, 'shared-workspace-lockfile': true, - 'shared-workspace-shrinkwrap': true, 'shell-emulator': false, - shrinkwrap: npmDefaults.shrinkwrap, reverse: false, sort: true, 'strict-peer-dependencies': true, @@ -252,25 +244,11 @@ export default async ( default: normalizeRegistryUrl(pnpmConfig.rawConfig.registry), ...getScopeRegistries(pnpmConfig.rawConfig), } - pnpmConfig.lockfileDir = pnpmConfig.lockfileDir ?? pnpmConfig.lockfileDirectory ?? pnpmConfig.shrinkwrapDirectory pnpmConfig.useLockfile = (() => { if (typeof pnpmConfig['lockfile'] === 'boolean') return pnpmConfig['lockfile'] if (typeof pnpmConfig['packageLock'] === 'boolean') return pnpmConfig['packageLock'] - if (typeof pnpmConfig['shrinkwrap'] === 'boolean') return pnpmConfig['shrinkwrap'] return false })() - pnpmConfig.lockfileOnly = typeof pnpmConfig['lockfileOnly'] === 'undefined' - ? pnpmConfig.shrinkwrapOnly - : pnpmConfig['lockfileOnly'] - pnpmConfig.frozenLockfile = typeof pnpmConfig['frozenLockfile'] === 'undefined' - ? pnpmConfig.frozenShrinkwrap - : pnpmConfig['frozenLockfile'] - pnpmConfig.preferFrozenLockfile = typeof pnpmConfig['preferFrozenLockfile'] === 'undefined' - ? pnpmConfig.preferFrozenShrinkwrap - : pnpmConfig['preferFrozenLockfile'] - pnpmConfig.sharedWorkspaceLockfile = typeof pnpmConfig['sharedWorkspaceLockfile'] === 'undefined' - ? pnpmConfig.sharedWorkspaceShrinkwrap - : pnpmConfig['sharedWorkspaceLockfile'] pnpmConfig.pnpmHomeDir = getDataDir(process) if (cliOptions['global']) { @@ -377,10 +355,6 @@ export default async ( warnings.push('The "shamefully-flatten" setting has been renamed to "shamefully-hoist". Also, in most cases you won\'t need "shamefully-hoist". Since v4, a semistrict node_modules structure is on by default (via hoist-pattern=[*]).') pnpmConfig.shamefullyHoist = true } - if (!pnpmConfig.storeDir && pnpmConfig['store']) { - warnings.push('The "store" setting has been renamed to "store-dir". Please use the new name.') - pnpmConfig.storeDir = pnpmConfig['store'] - } if (!pnpmConfig.cacheDir) { pnpmConfig.cacheDir = getCacheDir(process) } diff --git a/packages/config/test/index.ts b/packages/config/test/index.ts index 4f22e63feb7..8a62cd2caa1 100644 --- a/packages/config/test/index.ts +++ b/packages/config/test/index.ts @@ -148,13 +148,13 @@ test('throw error if --virtual-store-dir is used with --global', async () => { } }) -test('when using --global, link-workspace-packages, shared-workspace-shrinwrap and lockfile-directory are false even if it is set to true in a .npmrc file', async () => { +test('when using --global, link-workspace-packages, shared-workspace-lockfile and lockfile-dir are false even if it is set to true in a .npmrc file', async () => { prepareEmpty() const npmrc = [ 'link-workspace-packages=true', 'shared-workspace-lockfile=true', - 'lockfile-directory=/home/src', + 'lockfile-dir=/home/src', ].join('\n') await fs.writeFile('.npmrc', npmrc, 'utf8') await fs.writeFile('pnpm-workspace.yaml', '', 'utf8') diff --git a/packages/pnpm/src/shorthands.ts b/packages/pnpm/src/shorthands.ts index e51ca5c323c..8b3141a131a 100644 --- a/packages/pnpm/src/shorthands.ts +++ b/packages/pnpm/src/shorthands.ts @@ -29,10 +29,6 @@ export default { E: '--save-exact', O: '--save-optional', C: '--dir', - 'shrinkwrap-only': '--lockfile-only', - 'shared-workspace-shrinkwrap': '--shared-workspace-lockfile', - 'frozen-shrinkwrap': '--frozen-lockfile', - 'prefer-frozen-shrinkwrap': '--prefer-frozen-lockfile', w: '--workspace-root', i: '--interactive', F: '--filter',