Skip to content

Commit 4bed585

Browse files
authoredApr 1, 2022
feat: remove deprecated settings (#4519)
1 parent 8dac029 commit 4bed585

File tree

5 files changed

+16
-38
lines changed

5 files changed

+16
-38
lines changed
 

‎.changeset/tall-berries-know.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@pnpm/config": major
3+
"pnpm": major
4+
---
5+
6+
The next deprecated settings were removed:
7+
8+
* frozen-shrinkwrap
9+
* prefer-frozen-shrinkwrap
10+
* shared-workspace-shrinkwrap
11+
* shrinkwrap-directory
12+
* lockfile-directory
13+
* shrinkwrap-only
14+
* store

‎packages/config/src/Config.ts

-6
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,6 @@ export interface Config {
152152
}
153153

154154
export interface ConfigWithDeprecatedSettings extends Config {
155-
frozenShrinkwrap?: boolean
156155
globalPrefix?: string
157156
proxy?: string
158-
lockfileDirectory?: string
159-
preferFrozenShrinkwrap?: boolean
160-
sharedWorkspaceShrinkwrap?: boolean
161-
shrinkwrapDirectory?: string
162-
shrinkwrapOnly?: boolean
163157
}

‎packages/config/src/index.ts

-26
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export const types = Object.assign({
4646
filter: [String, Array],
4747
'filter-prod': [String, Array],
4848
'frozen-lockfile': Boolean,
49-
'frozen-shrinkwrap': Boolean,
5049
'git-checks': Boolean,
5150
'global-bin-dir': String,
5251
'global-dir': String,
@@ -74,7 +73,6 @@ export const types = Object.assign({
7473
'package-import-method': ['auto', 'hardlink', 'clone', 'copy'],
7574
pnpmfile: String,
7675
'prefer-frozen-lockfile': Boolean,
77-
'prefer-frozen-shrinkwrap': Boolean,
7876
'prefer-offline': Boolean,
7977
'prefer-workspace-packages': Boolean,
8078
production: [null, true],
@@ -89,16 +87,12 @@ export const types = Object.assign({
8987
'shamefully-flatten': Boolean,
9088
'shamefully-hoist': Boolean,
9189
'shared-workspace-lockfile': Boolean,
92-
'shared-workspace-shrinkwrap': Boolean,
9390
'shell-emulator': Boolean,
94-
'shrinkwrap-directory': String,
95-
'shrinkwrap-only': Boolean,
9691
'side-effects-cache': Boolean,
9792
'side-effects-cache-readonly': Boolean,
9893
symlink: Boolean,
9994
sort: Boolean,
10095
'state-dir': String,
101-
store: String, // TODO: deprecate
10296
'store-dir': String,
10397
stream: Boolean,
10498
'strict-peer-dependencies': Boolean,
@@ -200,9 +194,7 @@ export default async (
200194
'side-effects-cache': true,
201195
symlink: true,
202196
'shared-workspace-lockfile': true,
203-
'shared-workspace-shrinkwrap': true,
204197
'shell-emulator': false,
205-
shrinkwrap: npmDefaults.shrinkwrap,
206198
reverse: false,
207199
sort: true,
208200
'strict-peer-dependencies': true,
@@ -252,25 +244,11 @@ export default async (
252244
default: normalizeRegistryUrl(pnpmConfig.rawConfig.registry),
253245
...getScopeRegistries(pnpmConfig.rawConfig),
254246
}
255-
pnpmConfig.lockfileDir = pnpmConfig.lockfileDir ?? pnpmConfig.lockfileDirectory ?? pnpmConfig.shrinkwrapDirectory
256247
pnpmConfig.useLockfile = (() => {
257248
if (typeof pnpmConfig['lockfile'] === 'boolean') return pnpmConfig['lockfile']
258249
if (typeof pnpmConfig['packageLock'] === 'boolean') return pnpmConfig['packageLock']
259-
if (typeof pnpmConfig['shrinkwrap'] === 'boolean') return pnpmConfig['shrinkwrap']
260250
return false
261251
})()
262-
pnpmConfig.lockfileOnly = typeof pnpmConfig['lockfileOnly'] === 'undefined'
263-
? pnpmConfig.shrinkwrapOnly
264-
: pnpmConfig['lockfileOnly']
265-
pnpmConfig.frozenLockfile = typeof pnpmConfig['frozenLockfile'] === 'undefined'
266-
? pnpmConfig.frozenShrinkwrap
267-
: pnpmConfig['frozenLockfile']
268-
pnpmConfig.preferFrozenLockfile = typeof pnpmConfig['preferFrozenLockfile'] === 'undefined'
269-
? pnpmConfig.preferFrozenShrinkwrap
270-
: pnpmConfig['preferFrozenLockfile']
271-
pnpmConfig.sharedWorkspaceLockfile = typeof pnpmConfig['sharedWorkspaceLockfile'] === 'undefined'
272-
? pnpmConfig.sharedWorkspaceShrinkwrap
273-
: pnpmConfig['sharedWorkspaceLockfile']
274252
pnpmConfig.pnpmHomeDir = getDataDir(process)
275253

276254
if (cliOptions['global']) {
@@ -377,10 +355,6 @@ export default async (
377355
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=[*]).')
378356
pnpmConfig.shamefullyHoist = true
379357
}
380-
if (!pnpmConfig.storeDir && pnpmConfig['store']) {
381-
warnings.push('The "store" setting has been renamed to "store-dir". Please use the new name.')
382-
pnpmConfig.storeDir = pnpmConfig['store']
383-
}
384358
if (!pnpmConfig.cacheDir) {
385359
pnpmConfig.cacheDir = getCacheDir(process)
386360
}

‎packages/config/test/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ test('throw error if --virtual-store-dir is used with --global', async () => {
148148
}
149149
})
150150

151-
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 () => {
151+
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 () => {
152152
prepareEmpty()
153153

154154
const npmrc = [
155155
'link-workspace-packages=true',
156156
'shared-workspace-lockfile=true',
157-
'lockfile-directory=/home/src',
157+
'lockfile-dir=/home/src',
158158
].join('\n')
159159
await fs.writeFile('.npmrc', npmrc, 'utf8')
160160
await fs.writeFile('pnpm-workspace.yaml', '', 'utf8')

‎packages/pnpm/src/shorthands.ts

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ export default {
2929
E: '--save-exact',
3030
O: '--save-optional',
3131
C: '--dir',
32-
'shrinkwrap-only': '--lockfile-only',
33-
'shared-workspace-shrinkwrap': '--shared-workspace-lockfile',
34-
'frozen-shrinkwrap': '--frozen-lockfile',
35-
'prefer-frozen-shrinkwrap': '--prefer-frozen-lockfile',
3632
w: '--workspace-root',
3733
i: '--interactive',
3834
F: '--filter',

0 commit comments

Comments
 (0)
Please sign in to comment.