mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-10 18:18:56 -04:00
* refactor: remove ignoreDepScripts and neverBuiltDependencies settings These settings are redundant in v11: - `ignore-dep-scripts` is superseded by the default behavior of `allowBuilds` - `neverBuiltDependencies` was already dead code, replaced by `allowBuilds` * chore: add changeset for removed ignore-dep-scripts setting
96 lines
2.2 KiB
TypeScript
96 lines
2.2 KiB
TypeScript
import { LOCKFILE_VERSION } from '@pnpm/constants'
|
|
import type { ProjectId } from '@pnpm/types'
|
|
|
|
import { convertToLockfileFile } from '../lib/lockfileFormatConverters.js'
|
|
|
|
test('empty overrides are removed during lockfile normalization', () => {
|
|
expect(convertToLockfileFile({
|
|
lockfileVersion: LOCKFILE_VERSION,
|
|
overrides: {},
|
|
patchedDependencies: {},
|
|
packages: {},
|
|
importers: {
|
|
['foo' as ProjectId]: {
|
|
dependencies: {
|
|
bar: 'link:../bar',
|
|
},
|
|
specifiers: {
|
|
bar: 'link:../bar',
|
|
},
|
|
},
|
|
},
|
|
})).toStrictEqual({
|
|
lockfileVersion: LOCKFILE_VERSION,
|
|
importers: {
|
|
foo: {
|
|
dependencies: {
|
|
bar: {
|
|
version: 'link:../bar',
|
|
specifier: 'link:../bar',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|
|
})
|
|
|
|
test('redundant fields are removed from "time"', () => {
|
|
expect(convertToLockfileFile({
|
|
lockfileVersion: LOCKFILE_VERSION,
|
|
packages: {},
|
|
importers: {
|
|
['foo' as ProjectId]: {
|
|
dependencies: {
|
|
bar: '1.0.0',
|
|
},
|
|
devDependencies: {
|
|
foo: '1.0.0(react@18.0.0)',
|
|
},
|
|
optionalDependencies: {
|
|
qar: '1.0.0',
|
|
},
|
|
specifiers: {
|
|
bar: '1.0.0',
|
|
foo: '1.0.0',
|
|
qar: '1.0.0',
|
|
},
|
|
},
|
|
},
|
|
time: {
|
|
'bar@1.0.0': '2021-02-11T22:54:29.120Z',
|
|
'foo@1.0.0': '2021-02-11T22:54:29.120Z',
|
|
'qar@1.0.0': '2021-02-11T22:54:29.120Z',
|
|
'zoo@1.0.0': '2021-02-11T22:54:29.120Z',
|
|
},
|
|
})).toStrictEqual({
|
|
lockfileVersion: LOCKFILE_VERSION,
|
|
importers: {
|
|
foo: {
|
|
dependencies: {
|
|
bar: {
|
|
version: '1.0.0',
|
|
specifier: '1.0.0',
|
|
},
|
|
},
|
|
devDependencies: {
|
|
foo: {
|
|
version: '1.0.0(react@18.0.0)',
|
|
specifier: '1.0.0',
|
|
},
|
|
},
|
|
optionalDependencies: {
|
|
qar: {
|
|
version: '1.0.0',
|
|
specifier: '1.0.0',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
time: {
|
|
'bar@1.0.0': '2021-02-11T22:54:29.120Z',
|
|
'foo@1.0.0': '2021-02-11T22:54:29.120Z',
|
|
'qar@1.0.0': '2021-02-11T22:54:29.120Z',
|
|
},
|
|
})
|
|
})
|