mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-24 07:38:12 -05:00
feat!: default value of virtual-store-dir-max-length set to 60 on Windows (#8556)
This commit is contained in:
6
.changeset/two-peaches-dress.md
Normal file
6
.changeset/two-peaches-dress.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/config": major
|
||||
"pnpm": major
|
||||
---
|
||||
|
||||
The default value of `virtual-store-dir-max-length` on Windows reduced to 60 characters.
|
||||
@@ -185,7 +185,7 @@ export async function getConfig (opts: {
|
||||
'workspace-prefix': opts.workspaceDir,
|
||||
'embed-readme': false,
|
||||
'registry-supports-time-field': false,
|
||||
'virtual-store-dir-max-length': 120,
|
||||
'virtual-store-dir-max-length': isWindows() ? 60 : 120,
|
||||
'peers-suffix-max-length': 1000,
|
||||
}
|
||||
|
||||
|
||||
@@ -52,5 +52,5 @@ export const DEFAULT_OPTS = {
|
||||
cpu: ['current'],
|
||||
libc: ['current'],
|
||||
},
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export const DEFAULT_OPTS = {
|
||||
cpu: ['current'],
|
||||
libc: ['current'],
|
||||
},
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
export const DLX_DEFAULT_OPTS = {
|
||||
@@ -94,5 +94,5 @@ export const DLX_DEFAULT_OPTS = {
|
||||
cpu: ['current'],
|
||||
libc: ['current'],
|
||||
},
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ test('overrides are added for vulnerable dependencies', async () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(0)
|
||||
@@ -54,7 +54,7 @@ test('no overrides are added if no vulnerabilities are found', async () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(0)
|
||||
@@ -90,7 +90,7 @@ test('CVEs found in the allow list are not added as overrides', async () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
expect(exitCode).toBe(0)
|
||||
expect(output).toMatch(/Run "pnpm install"/)
|
||||
|
||||
@@ -60,7 +60,7 @@ export const DEFAULT_OPTS = {
|
||||
useRunningStoreServer: false,
|
||||
useStoreServer: false,
|
||||
workspaceConcurrency: 4,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
peersSuffixMaxLength: 1000,
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ describe('plugin-commands-audit', () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
expect(exitCode).toBe(1)
|
||||
expect(stripAnsi(output)).toMatchSnapshot()
|
||||
@@ -100,7 +100,7 @@ describe('plugin-commands-audit', () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(1)
|
||||
@@ -118,7 +118,7 @@ describe('plugin-commands-audit', () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(1)
|
||||
@@ -135,7 +135,7 @@ describe('plugin-commands-audit', () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(stripAnsi(output)).toBe('No known vulnerabilities found\n')
|
||||
@@ -153,7 +153,7 @@ describe('plugin-commands-audit', () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
const json = JSON.parse(output)
|
||||
@@ -173,7 +173,7 @@ describe('plugin-commands-audit', () => {
|
||||
rawConfig,
|
||||
dev: true,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(0)
|
||||
@@ -194,7 +194,7 @@ describe('plugin-commands-audit', () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(0)
|
||||
@@ -216,7 +216,7 @@ describe('plugin-commands-audit', () => {
|
||||
[`${registries.default.replace(/^https?:/, '')}:_authToken`]: '123',
|
||||
},
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(stripAnsi(output)).toBe('No known vulnerabilities found\n')
|
||||
@@ -237,7 +237,7 @@ describe('plugin-commands-audit', () => {
|
||||
userConfig: {},
|
||||
rawConfig,
|
||||
registries,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})).rejects.toThrow(AuditEndpointNotExistsError)
|
||||
})
|
||||
|
||||
@@ -266,7 +266,7 @@ describe('plugin-commands-audit', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(1)
|
||||
@@ -298,7 +298,7 @@ describe('plugin-commands-audit', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(1)
|
||||
@@ -331,7 +331,7 @@ describe('plugin-commands-audit', () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
})
|
||||
|
||||
expect(exitCode).toBe(1)
|
||||
|
||||
@@ -27,7 +27,7 @@ const basePatchOption = {
|
||||
registries: { default: `http://localhost:${REGISTRY_MOCK_PORT}/` },
|
||||
userConfig: {},
|
||||
virtualStoreDir: 'node_modules/.pnpm',
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
describe('patch and commit', () => {
|
||||
|
||||
@@ -53,6 +53,6 @@ export const DEFAULT_OPTS = {
|
||||
cpu: ['current'],
|
||||
libc: ['current'],
|
||||
},
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
peersSuffixMaxLength: 1000,
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ const DEFAULT_OPTIONS = {
|
||||
storeDir: path.join(tmp, 'store'),
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('installing with "workspace:" should work even if link-workspace-packages is off', async () => {
|
||||
|
||||
@@ -32,7 +32,7 @@ const DEFAULT_OPTIONS = {
|
||||
sort: true,
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('fetch dependencies', async () => {
|
||||
|
||||
@@ -36,7 +36,7 @@ const DEFAULT_OPTIONS = {
|
||||
storeDir: path.join(tmp, 'store'),
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('globally installed package is linked with active version of Node.js', async () => {
|
||||
|
||||
@@ -40,7 +40,7 @@ const DEFAULT_OPTS = {
|
||||
userConfig: {},
|
||||
useRunningStoreServer: false,
|
||||
useStoreServer: false,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('import from package-lock.json', async () => {
|
||||
|
||||
@@ -38,7 +38,7 @@ const DEFAULT_OPTS = {
|
||||
userConfig: {},
|
||||
useRunningStoreServer: false,
|
||||
useStoreServer: false,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('import from shared yarn.lock of monorepo', async () => {
|
||||
|
||||
@@ -35,7 +35,7 @@ const DEFAULT_OPTIONS = {
|
||||
storeDir: path.join(TMP, 'store'),
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('root dependency that has a peer is correctly updated after its version changes', async () => {
|
||||
|
||||
@@ -36,7 +36,7 @@ const DEFAULT_OPTIONS = {
|
||||
sort: true,
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('prune removes external link that is not in package.json', async () => {
|
||||
|
||||
@@ -41,7 +41,7 @@ const DEFAULT_OPTIONS = {
|
||||
sort: true,
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('interactively update', async () => {
|
||||
|
||||
@@ -38,7 +38,7 @@ const DEFAULT_OPTIONS = {
|
||||
sort: true,
|
||||
userConfig: {},
|
||||
workspaceConcurrency: 1,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
test('interactive recursive should not error on git specifier override', async () => {
|
||||
|
||||
@@ -49,5 +49,5 @@ export const DEFAULT_OPTS = {
|
||||
useRunningStoreServer: false,
|
||||
useStoreServer: false,
|
||||
workspaceConcurrency: 4,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
@@ -49,5 +49,5 @@ export const DEFAULT_OPTS = {
|
||||
useRunningStoreServer: false,
|
||||
useStoreServer: false,
|
||||
workspaceConcurrency: 4,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@ export const DEFAULT_OPTS = {
|
||||
useRunningStoreServer: false,
|
||||
useStoreServer: false,
|
||||
workspaceConcurrency: 4,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { fixtures } from '@pnpm/test-fixtures'
|
||||
import { buildDependenciesHierarchy, type PackageNode } from '@pnpm/reviewing.dependencies-hierarchy'
|
||||
import { depPathToFilename } from '@pnpm/dependency-path'
|
||||
|
||||
const virtualStoreDirMaxLength = process.platform === 'win32' ? 60 : 120
|
||||
const f = fixtures(__dirname)
|
||||
const generalFixture = f.find('general')
|
||||
const withPeerFixture = f.find('with-peer')
|
||||
@@ -19,7 +20,7 @@ const workspaceWithNestedWorkspaceDeps = f.find('workspace-with-nested-workspace
|
||||
const customModulesDirFixture = f.find('custom-modules-dir')
|
||||
|
||||
test('one package depth 0', async () => {
|
||||
const tree = await buildDependenciesHierarchy([generalFixture], { depth: 0, lockfileDir: generalFixture, virtualStoreDirMaxLength: 120 })
|
||||
const tree = await buildDependenciesHierarchy([generalFixture], { depth: 0, lockfileDir: generalFixture, virtualStoreDirMaxLength })
|
||||
const modulesDir = path.join(generalFixture, 'node_modules')
|
||||
|
||||
expect(tree).toStrictEqual({
|
||||
@@ -80,7 +81,7 @@ test('one package depth 0', async () => {
|
||||
})
|
||||
|
||||
test('one package depth 1', async () => {
|
||||
const tree = await buildDependenciesHierarchy([generalFixture], { depth: 1, lockfileDir: generalFixture, virtualStoreDirMaxLength: 120 })
|
||||
const tree = await buildDependenciesHierarchy([generalFixture], { depth: 1, lockfileDir: generalFixture, virtualStoreDirMaxLength })
|
||||
const modulesDir = path.join(generalFixture, 'node_modules')
|
||||
|
||||
expect(tree).toStrictEqual({
|
||||
@@ -179,7 +180,7 @@ test('only prod depth 0', async () => {
|
||||
optionalDependencies: false,
|
||||
},
|
||||
lockfileDir: generalFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
}
|
||||
)
|
||||
const modulesDir = path.join(generalFixture, 'node_modules')
|
||||
@@ -225,7 +226,7 @@ test('only dev depth 0', async () => {
|
||||
optionalDependencies: false,
|
||||
},
|
||||
lockfileDir: generalFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
}
|
||||
)
|
||||
const modulesDir = path.join(generalFixture, 'node_modules')
|
||||
@@ -254,7 +255,7 @@ test('hierarchy for no packages', async () => {
|
||||
depth: 100,
|
||||
lockfileDir: generalFixture,
|
||||
search: () => false,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
})
|
||||
|
||||
expect(tree).toStrictEqual({
|
||||
@@ -273,7 +274,7 @@ test('filter 1 package with depth 0', async () => {
|
||||
depth: 0,
|
||||
lockfileDir: generalFixture,
|
||||
search: ({ name }) => name === 'rimraf',
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
}
|
||||
)
|
||||
const modulesDir = path.join(generalFixture, 'node_modules')
|
||||
@@ -304,7 +305,7 @@ test('circular dependency', async () => {
|
||||
const tree = await buildDependenciesHierarchy([circularFixture], {
|
||||
depth: 1000,
|
||||
lockfileDir: circularFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
})
|
||||
const modulesDir = path.join(circularFixture, 'node_modules')
|
||||
|
||||
@@ -340,7 +341,7 @@ test('local package depth 0', async () => {
|
||||
const tree = await buildDependenciesHierarchy([withFileDepFixture], {
|
||||
depth: 1,
|
||||
lockfileDir: withFileDepFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
})
|
||||
const modulesDir = path.join(withFileDepFixture, 'node_modules')
|
||||
|
||||
@@ -378,7 +379,7 @@ test('on a package that has only links', async () => {
|
||||
const tree = await buildDependenciesHierarchy([withLinksOnlyFixture], {
|
||||
depth: 1000,
|
||||
lockfileDir: withLinksOnlyFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
})
|
||||
|
||||
expect(tree).toStrictEqual({
|
||||
@@ -407,7 +408,7 @@ test('on a package with nested workspace links', async () => {
|
||||
{
|
||||
depth: 1000,
|
||||
lockfileDir: workspaceWithNestedWorkspaceDeps,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -449,7 +450,7 @@ test('unsaved dependencies are listed', async () => {
|
||||
expect(await buildDependenciesHierarchy([withUnsavedDepsFixture], {
|
||||
depth: 0,
|
||||
lockfileDir: withUnsavedDepsFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
}))
|
||||
.toStrictEqual({
|
||||
[withUnsavedDepsFixture]: {
|
||||
@@ -492,7 +493,7 @@ test('unsaved dependencies are listed and filtered', async () => {
|
||||
depth: 0,
|
||||
lockfileDir: withUnsavedDepsFixture,
|
||||
search: ({ name }) => name === 'symlink-dir',
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
}
|
||||
)
|
||||
).toStrictEqual({
|
||||
@@ -522,7 +523,7 @@ test(`do not fail on importers that are not in current ${WANTED_LOCKFILE}`, asyn
|
||||
expect(await buildDependenciesHierarchy([fixtureMonorepo], {
|
||||
depth: 0,
|
||||
lockfileDir: fixtureMonorepo,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
})).toStrictEqual({ [fixtureMonorepo]: {} })
|
||||
})
|
||||
|
||||
@@ -532,7 +533,7 @@ test('dependency with an alias', async () => {
|
||||
await buildDependenciesHierarchy([withAliasedDepFixture], {
|
||||
depth: 0,
|
||||
lockfileDir: withAliasedDepFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
})
|
||||
).toStrictEqual({
|
||||
[withAliasedDepFixture]: {
|
||||
@@ -559,7 +560,7 @@ test('peer dependencies', async () => {
|
||||
const hierarchy = await buildDependenciesHierarchy([withPeerFixture], {
|
||||
depth: 1,
|
||||
lockfileDir: withPeerFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
})
|
||||
expect(hierarchy[withPeerFixture].dependencies![1].dependencies![0].name).toEqual('ajv')
|
||||
expect(hierarchy[withPeerFixture].dependencies![1].dependencies![0].isPeer).toEqual(true)
|
||||
@@ -573,7 +574,7 @@ test('dependency without a package.json', async () => {
|
||||
const tree = await buildDependenciesHierarchy([withNonPackageDepFixture], {
|
||||
depth: 0,
|
||||
lockfileDir: withNonPackageDepFixture,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
})
|
||||
const resolved = `https://codeload.github.com/${org}/${pkg}/tar.gz/${commit}`
|
||||
expect(tree).toStrictEqual({
|
||||
@@ -586,7 +587,7 @@ test('dependency without a package.json', async () => {
|
||||
isPeer: false,
|
||||
isSkipped: false,
|
||||
name: 'camelcase',
|
||||
path: path.join(withNonPackageDepFixture, 'node_modules/.pnpm', `camelcase@${depPathToFilename(resolved, 120)}`, 'node_modules/camelcase'),
|
||||
path: path.join(withNonPackageDepFixture, 'node_modules/.pnpm', depPathToFilename(`camelcase@${resolved}`, virtualStoreDirMaxLength), 'node_modules/camelcase'),
|
||||
resolved,
|
||||
version: '0.0.0',
|
||||
},
|
||||
@@ -613,7 +614,7 @@ test('on custom modules-dir workspaces', async () => {
|
||||
depth: 1000,
|
||||
lockfileDir: customModulesDirFixture,
|
||||
modulesDir: 'fake_modules',
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength,
|
||||
}
|
||||
)
|
||||
expect(tree).toEqual({
|
||||
|
||||
@@ -47,5 +47,5 @@ export const DEFAULT_OPTS = {
|
||||
useStoreServer: false,
|
||||
virtualStoreDir: 'node_modules/.pnpm',
|
||||
workspaceConcurrency: 4,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ test('listing packages', async () => {
|
||||
dev: false,
|
||||
dir: process.cwd(),
|
||||
optional: false,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, [])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
@@ -44,7 +44,7 @@ is-positive 1.0.0`)
|
||||
dir: process.cwd(),
|
||||
optional: false,
|
||||
production: false,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, [])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
@@ -58,7 +58,7 @@ is-negative 1.0.0`)
|
||||
{
|
||||
const output = await list.handler({
|
||||
dir: process.cwd(),
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, [])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
@@ -95,7 +95,7 @@ test(`listing packages of a project that has an external ${WANTED_LOCKFILE}`, as
|
||||
const output = await list.handler({
|
||||
dir: process.cwd(),
|
||||
lockfileDir: path.resolve('..'),
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, [])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
@@ -117,7 +117,7 @@ test.skip('list on a project with skipped optional dependencies', async () => {
|
||||
const output = await list.handler({
|
||||
depth: 10,
|
||||
dir: process.cwd(),
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, [])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
@@ -134,7 +134,7 @@ pkg-with-optional 1.0.0
|
||||
const output = await list.handler({
|
||||
depth: 10,
|
||||
dir: process.cwd(),
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['not-compatible-with-any-os'])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
@@ -149,7 +149,7 @@ pkg-with-optional 1.0.0
|
||||
{
|
||||
const output = await why.handler({
|
||||
dir: process.cwd(),
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['not-compatible-with-any-os'])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
@@ -186,7 +186,7 @@ test('listing packages should not fail on package that has local file directory
|
||||
dev: false,
|
||||
dir: pkgDir,
|
||||
optional: false,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, [])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
|
||||
@@ -47,5 +47,5 @@ export const DEFAULT_OPTS = {
|
||||
useRunningStoreServer: false,
|
||||
useStoreServer: false,
|
||||
workspaceConcurrency: 4,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ test('`pnpm why` should fail if no package name was provided', async () => {
|
||||
try {
|
||||
await why.handler({
|
||||
dir: process.cwd(),
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, [])
|
||||
} catch (_err: any) { // eslint-disable-line
|
||||
err = _err
|
||||
@@ -39,7 +39,7 @@ test('"why" should find non-direct dependency', async () => {
|
||||
dev: false,
|
||||
dir: process.cwd(),
|
||||
optional: false,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['@pnpm.e2e/dep-of-pkg-with-1-dep'])
|
||||
|
||||
expect(stripAnsi(output)).toBe(`Legend: production dependency, optional only, dev only
|
||||
|
||||
@@ -51,5 +51,5 @@ export const DEFAULT_OPTS = {
|
||||
useRunningStoreServer: false,
|
||||
useStoreServer: false,
|
||||
workspaceConcurrency: 4,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ test('pnpm store add express@4.16.3', async () => {
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: 0,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['add', 'express@4.16.3'])
|
||||
|
||||
const { cafsHas } = assertStore(path.join(storeDir, STORE_VERSION))
|
||||
@@ -51,7 +51,7 @@ test('pnpm store add scoped package that uses not the standard registry', async
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: 0,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['add', '@foo/no-deps@1.0.0'])
|
||||
|
||||
const { cafsHas } = assertStore(path.join(storeDir, STORE_VERSION))
|
||||
@@ -81,7 +81,7 @@ test('should fail if some packages can not be added', async () => {
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: 0,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['add', '@pnpm/this-does-not-exist'])
|
||||
} catch (e: any) { // eslint-disable-line
|
||||
thrown = true
|
||||
|
||||
@@ -20,7 +20,7 @@ test('CLI prints the current store path', async () => {
|
||||
storeDir: '/home/example/.pnpm-store',
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: 0,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['path'])
|
||||
|
||||
const expectedStorePath = os.platform() === 'win32'
|
||||
|
||||
@@ -50,7 +50,7 @@ test('remove unreferenced packages', async () => {
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: Infinity,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
|
||||
expect(reporter).toHaveBeenCalledWith(
|
||||
@@ -75,7 +75,7 @@ test('remove unreferenced packages', async () => {
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: Infinity,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
|
||||
expect(reporter).not.toHaveBeenCalledWith(
|
||||
@@ -112,7 +112,7 @@ test.skip('remove packages that are used by project that no longer exist', async
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: Infinity,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
|
||||
expect(reporter).toHaveBeenCalledWith(
|
||||
@@ -152,7 +152,7 @@ test('keep dependencies used by others', async () => {
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: Infinity,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
|
||||
project.storeHasNot('camelcase-keys', '3.0.0')
|
||||
@@ -178,7 +178,7 @@ test('keep dependency used by package', async () => {
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: Infinity,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
|
||||
project.storeHas('is-positive', '3.1.0')
|
||||
@@ -202,7 +202,7 @@ test('prune will skip scanning non-directory in storeDir', async () => {
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: Infinity,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
})
|
||||
|
||||
@@ -230,7 +230,7 @@ test('prune does not fail if the store contains an unexpected directory', async
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: Infinity,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
|
||||
expect(reporter).toHaveBeenCalledWith(
|
||||
@@ -269,7 +269,7 @@ test('prune removes alien files from the store if the --force flag is used', asy
|
||||
userConfig: {},
|
||||
force: true,
|
||||
dlxCacheMaxAge: Infinity,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
expect(reporter).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
@@ -335,7 +335,7 @@ test('prune removes cache directories that outlives dlx-cache-max-age', async ()
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: 7,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['prune'])
|
||||
|
||||
expect(
|
||||
|
||||
@@ -41,7 +41,7 @@ test('CLI fails when store status finds modified packages', async () => {
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: 0,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['status'])
|
||||
} catch (_err: any) { // eslint-disable-line
|
||||
err = _err
|
||||
@@ -94,6 +94,6 @@ test('CLI does not fail when store status does not find modified packages', asyn
|
||||
storeDir,
|
||||
userConfig: {},
|
||||
dlxCacheMaxAge: 0,
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
}, ['status'])
|
||||
})
|
||||
|
||||
@@ -53,7 +53,7 @@ function prepareOptions (dir: string) {
|
||||
pnpmfile: '',
|
||||
rawConfig: {},
|
||||
cacheDir: path.join(dir, '.cache'),
|
||||
virtualStoreDirMaxLength: 120,
|
||||
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
|
||||
dir: process.cwd(),
|
||||
managePackageManagerVersions: false,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user