Files
pnpm/exec/plugin-commands-script-runners/test/utils/index.ts
2024-12-08 23:42:33 +01:00

104 lines
2.4 KiB
TypeScript

import path from 'path'
import { tempDir } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
export const REGISTRY_URL = `http://localhost:${REGISTRY_MOCK_PORT}`
const tmp = tempDir()
export const DEFAULT_OPTS = {
argv: {
original: [],
},
bail: false,
bin: 'node_modules/.bin',
ca: undefined,
cacheDir: '../cache',
cert: undefined,
extraEnv: {},
excludeLinksFromLockfile: false,
cliOptions: {},
extraBinPaths: [],
fetchRetries: 2,
fetchRetryFactor: 90,
fetchRetryMaxtimeout: 90,
fetchRetryMintimeout: 10,
filter: [] as string[],
httpsProxy: undefined,
include: {
dependencies: true,
devDependencies: true,
optionalDependencies: true,
},
key: undefined,
linkWorkspacePackages: true,
localAddress: undefined,
lock: false,
lockStaleDuration: 90,
networkConcurrency: 16,
offline: false,
pending: false,
pnpmfile: './.pnpmfile.cjs',
pnpmHomeDir: '',
preferWorkspacePackages: true,
proxy: undefined,
rawConfig: { registry: REGISTRY_URL },
rawLocalConfig: {},
rootProjectManifestDir: '',
registries: { default: REGISTRY_URL },
registry: REGISTRY_URL,
sort: true,
storeDir: '../store',
strictSsl: false,
userAgent: 'pnpm',
useRunningStoreServer: false,
useStoreServer: false,
workspaceConcurrency: 4,
supportedArchitectures: {
os: ['current'],
cpu: ['current'],
libc: ['current'],
},
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
}
export const DLX_DEFAULT_OPTS = {
argv: {
original: [],
},
bail: false,
bin: 'node_modules/.bin',
cacheDir: path.join(tmp, 'cache'),
excludeLinksFromLockfile: false,
extraEnv: {},
extraBinPaths: [],
cliOptions: {},
dlxCacheMaxAge: Infinity,
include: {
dependencies: true,
devDependencies: true,
optionalDependencies: true,
},
linkWorkspacePackages: true,
lock: true,
pnpmfile: '.pnpmfile.cjs',
pnpmHomeDir: '',
preferWorkspacePackages: true,
rawConfig: { registry: REGISTRY_URL },
rawLocalConfig: { registry: REGISTRY_URL },
registries: {
default: REGISTRY_URL,
},
rootProjectManifestDir: '',
sort: true,
storeDir: path.join(tmp, 'store'),
symlink: true,
userConfig: {},
workspaceConcurrency: 1,
supportedArchitectures: {
os: ['current'],
cpu: ['current'],
libc: ['current'],
},
virtualStoreDirMaxLength: process.platform === 'win32' ? 60 : 120,
}