Merge branch 'main' into v11

This commit is contained in:
Zoltan Kochan
2025-08-19 00:17:44 +02:00
67 changed files with 647 additions and 192 deletions

View File

@@ -66,6 +66,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/config": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",

View File

@@ -1,6 +1,7 @@
/// <reference path="../../../__typings__/index.d.ts"/>
import fs from 'fs'
import { tempDir } from '@pnpm/prepare'
import { jest } from '@jest/globals'
import path from 'path'
import pathName from 'path-name'
import symlinkDir from 'symlink-dir'
@@ -11,7 +12,8 @@ const globalBinDir = path.join(homedir(), '.local', 'pnpm')
const isWindows = process.platform === 'win32'
jest.mock('@pnpm/npm-conf/lib/conf', () => {
const originalModule = jest.requireActual('@pnpm/npm-conf/lib/conf')
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const originalModule = jest.requireActual<any>('@pnpm/npm-conf/lib/conf')
class MockedConf extends originalModule {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor (base: any, types: any) {

View File

@@ -7,6 +7,7 @@ import { getConfig } from '@pnpm/config'
import loadNpmConf from '@pnpm/npm-conf'
import { prepare, prepareEmpty } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import { jest } from '@jest/globals'
import symlinkDir from 'symlink-dir'

View File

@@ -46,6 +46,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/package-is-installable": "workspace:*",
"@types/semver": "catalog:"

View File

@@ -1,9 +1,11 @@
import { jest } from '@jest/globals'
import type * as DetectLibc from 'detect-libc'
import { checkPlatform } from '../lib/checkPlatform'
const packageId = 'registry.npmjs.org/foo/1.0.0'
jest.mock('detect-libc', () => {
const original = jest.requireActual('detect-libc')
const original = jest.requireActual<typeof DetectLibc>('detect-libc')
return {
...original,
familySync: () => 'musl',

View File

@@ -50,6 +50,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/plugin-commands-config": "workspace:*",
"@pnpm/prepare": "workspace:*",

View File

@@ -1,5 +1,6 @@
import { config } from '@pnpm/plugin-commands-config'
import { runNpm } from '@pnpm/run-npm'
import { jest } from '@jest/globals'
jest.mock('@pnpm/run-npm', () => ({
runNpm: jest.fn(),

View File

@@ -53,6 +53,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/deps.status": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/write-project-manifest": "workspace:*",

View File

@@ -2,22 +2,23 @@ import { type Stats } from 'fs'
import { checkDepsStatus, type CheckDepsStatusOptions } from '@pnpm/deps.status'
import * as workspaceStateModule from '@pnpm/workspace.state'
import * as lockfileFs from '@pnpm/lockfile.fs'
import { jest } from '@jest/globals'
import * as fsUtils from '../lib/safeStat'
import * as statManifestFileUtils from '../lib/statManifestFile'
jest.mock('../lib/safeStat', () => ({
...jest.requireActual('../lib/safeStat'),
...jest.requireActual<object>('../lib/safeStat'),
safeStatSync: jest.fn(),
safeStat: jest.fn(),
}))
jest.mock('../lib/statManifestFile', () => ({
...jest.requireActual('../lib/statManifestFile'),
...jest.requireActual<object>('../lib/statManifestFile'),
statManifestFile: jest.fn(),
}))
jest.mock('@pnpm/lockfile.fs', () => ({
...jest.requireActual('@pnpm/lockfile.fs'),
...jest.requireActual<object>('@pnpm/lockfile.fs'),
readCurrentLockfile: jest.fn(),
readWantedLockfile: jest.fn(),
}))

View File

@@ -43,6 +43,7 @@
"detect-libc": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/cafs-types": "workspace:*",
"@pnpm/node.fetcher": "workspace:*",
"@pnpm/prepare": "workspace:*",

View File

@@ -4,6 +4,7 @@ import path from 'path'
import { Readable } from 'stream'
import { fetchNode, type FetchNodeOptionsToDir as FetchNodeOptions } from '@pnpm/node.fetcher'
import { tempDir } from '@pnpm/prepare'
import { jest } from '@jest/globals'
import { isNonGlibcLinux } from 'detect-libc'
jest.mock('detect-libc', () => ({

View File

@@ -56,6 +56,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/plugin-commands-env": "workspace:*",
"@pnpm/prepare": "workspace:*",

View File

@@ -4,6 +4,7 @@ import fs from 'fs'
import { Readable } from 'stream'
import tar from 'tar-stream'
import { globalWarn } from '@pnpm/logger'
import { jest } from '@jest/globals'
import { ZipFile } from 'yazl'
import {
getNodeDir,
@@ -54,7 +55,7 @@ jest.mock('@pnpm/fetch', () => ({
}))
jest.mock('@pnpm/logger', () => {
const originalModule = jest.requireActual('@pnpm/logger')
const originalModule = jest.requireActual<object>('@pnpm/logger')
return {
...originalModule,
globalWarn: jest.fn(),

View File

@@ -37,6 +37,7 @@
"mem": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/env.system-node-version": "workspace:*"
},
"engines": {

View File

@@ -1,3 +1,4 @@
import { jest } from '@jest/globals'
import { getSystemNodeVersionNonCached } from '../lib'
import * as execa from 'execa'

View File

@@ -46,6 +46,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/exec.build-commands": "workspace:*",
"@pnpm/plugin-commands-installation": "workspace:*",
"@pnpm/prepare": "workspace:*",

View File

@@ -9,6 +9,7 @@ import { type ProjectManifest } from '@pnpm/types'
import { getConfig } from '@pnpm/config'
import { type Modules, readModulesManifest } from '@pnpm/modules-yaml'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { jest } from '@jest/globals'
import { sync as loadJsonFile } from 'load-json-file'
import omit from 'ramda/src/omit'
import { tempDir } from '@pnpm/prepare-temp-dir'

View File

@@ -73,6 +73,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/env.system-node-version": "workspace:*",
"@pnpm/filter-workspace-packages": "workspace:*",
"@pnpm/logger": "workspace:*",

View File

@@ -1,4 +1,5 @@
import { PnpmError } from '@pnpm/error'
import { jest } from '@jest/globals'
import { create, dlx } from '../src'
import { DLX_DEFAULT_OPTS as DEFAULT_OPTS } from './utils'

View File

@@ -2,6 +2,7 @@ import path from 'path'
import execa from 'execa'
import { dlx } from '@pnpm/plugin-commands-script-runners'
import { prepareEmpty } from '@pnpm/prepare'
import { jest } from '@jest/globals'
import { DLX_DEFAULT_OPTS as DEFAULT_OPTS } from './utils'
jest.mock('execa')

View File

@@ -4,6 +4,7 @@ import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir'
import { logger } from '@pnpm/logger'
import { exec } from '@pnpm/plugin-commands-script-runners'
import { preparePackages } from '@pnpm/prepare'
import { jest } from '@jest/globals'
import writeYamlFile from 'write-yaml-file'
import { DEFAULT_OPTS } from './utils'

View File

@@ -1,6 +1,7 @@
import execa from 'execa'
import { exec } from '@pnpm/plugin-commands-script-runners'
import { prepareEmpty } from '@pnpm/prepare'
import { jest } from '@jest/globals'
import { DEFAULT_OPTS } from './utils'
jest.mock('execa')

View File

@@ -4,11 +4,12 @@ import { globalWarn } from '@pnpm/logger'
import { type VerifyDepsBeforeRun } from '@pnpm/config'
import { run } from '@pnpm/plugin-commands-script-runners'
import { prepare } from '@pnpm/prepare'
import { jest } from '@jest/globals'
import { prompt } from 'enquirer'
import { DEFAULT_OPTS } from './utils'
jest.mock('@pnpm/logger', () => {
const originalModule = jest.requireActual('@pnpm/logger')
const originalModule = jest.requireActual<object>('@pnpm/logger')
return {
...originalModule,
globalWarn: jest.fn(),

View File

@@ -43,6 +43,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/directory-fetcher": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",

View File

@@ -6,6 +6,7 @@ import { createDirectoryFetcher } from '@pnpm/directory-fetcher'
import { debug } from '@pnpm/logger'
import { fixtures } from '@pnpm/test-fixtures'
import { sync as rimraf } from '@zkochan/rimraf'
import { jest } from '@jest/globals'
const f = fixtures(__dirname)
jest.mock('@pnpm/logger', () => {

View File

@@ -43,6 +43,7 @@
"@pnpm/worker": "workspace:^"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/create-cafs-store": "workspace:*",
"@pnpm/git-fetcher": "workspace:*",
"@pnpm/logger": "workspace:*",

View File

@@ -3,11 +3,12 @@ import path from 'path'
import { createCafsStore } from '@pnpm/create-cafs-store'
import { createGitFetcher } from '@pnpm/git-fetcher'
import { globalWarn } from '@pnpm/logger'
import { jest } from '@jest/globals'
import tempy from 'tempy'
import execa from 'execa'
jest.mock('execa', () => {
const originalModule = jest.requireActual('execa')
const originalModule = jest.requireActual<any>('execa') // eslint-disable-line
return {
__esModule: true,
...originalModule,
@@ -16,7 +17,7 @@ jest.mock('execa', () => {
})
jest.mock('@pnpm/logger', () => {
const originalModule = jest.requireActual('@pnpm/logger')
const originalModule = jest.requireActual<object>('@pnpm/logger')
return {
...originalModule,
globalWarn: jest.fn(),

View File

@@ -52,6 +52,7 @@
"@pnpm/worker": "workspace:^"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/cafs-types": "workspace:*",
"@pnpm/create-cafs-store": "workspace:*",
"@pnpm/fetch": "workspace:*",

View File

@@ -5,18 +5,20 @@ import { FetchError, PnpmError } from '@pnpm/error'
import { createFetchFromRegistry } from '@pnpm/fetch'
import { createCafsStore } from '@pnpm/create-cafs-store'
import { globalWarn } from '@pnpm/logger'
import type * as Logger from '@pnpm/logger'
import { fixtures } from '@pnpm/test-fixtures'
import {
createTarballFetcher,
BadTarballError,
TarballIntegrityError,
} from '@pnpm/tarball-fetcher'
import { jest } from '@jest/globals'
import nock from 'nock'
import ssri from 'ssri'
import tempy from 'tempy'
jest.mock('@pnpm/logger', () => {
const originalModule = jest.requireActual('@pnpm/logger')
const originalModule = jest.requireActual<typeof Logger>('@pnpm/logger')
return {
...originalModule,
globalWarn: jest.fn(),

View File

@@ -60,6 +60,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/fs.indexed-pkg-importer": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/prepare": "workspace:*",

View File

@@ -3,11 +3,12 @@ import path from 'path'
import { createIndexedPkgImporter } from '@pnpm/fs.indexed-pkg-importer'
import gfs from '@pnpm/graceful-fs'
import { globalInfo } from '@pnpm/logger'
import { jest } from '@jest/globals'
const testOnLinuxOnly = (process.platform === 'darwin' || process.platform === 'win32') ? test.skip : test
jest.mock('@pnpm/graceful-fs', () => {
const { access, promises } = jest.requireActual('fs')
const { access, promises } = jest.requireActual<typeof fs>('fs')
const fsMock = {
mkdirSync: promises.mkdir,
readdirSync: promises.readdir,
@@ -190,10 +191,10 @@ test('packageImportMethod=hardlink relinks package from store if package.json is
test('packageImportMethod=hardlink does not relink package from store if package.json is not present in the store', () => {
const importPackage = createIndexedPkgImporter('hardlink')
jest.mocked(gfs.statSync).mockImplementation((file) => {
jest.mocked(gfs.statSync).mockImplementation(((file: string) => {
expect(typeof file).toBe('string')
return { ino: BigInt(1) } as BigIntStats
})
}) as unknown as typeof gfs.statSync)
expect(importPackage('project/package', {
filesMap: {
'index.js': 'hash2',
@@ -205,12 +206,12 @@ test('packageImportMethod=hardlink does not relink package from store if package
test('packageImportMethod=hardlink links packages when they are not found', () => {
const importPackage = createIndexedPkgImporter('hardlink')
jest.mocked(gfs.statSync).mockImplementation((file) => {
jest.mocked(gfs.statSync).mockImplementation(((file: string) => {
if (file === path.join('project/package', 'package.json')) {
throw Object.assign(new Error(), { code: 'ENOENT' })
}
return { ino: BigInt(0) } as BigIntStats
})
}) as unknown as typeof gfs.statSync)
expect(importPackage('project/package', {
filesMap: {
'index.js': 'hash2',

View File

@@ -47,6 +47,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/lockfile.filtering": "workspace:*",
"@pnpm/logger": "workspace:*",
"@types/ramda": "catalog:",

View File

@@ -1,12 +1,13 @@
import { LOCKFILE_VERSION } from '@pnpm/constants'
import { filterLockfileByImportersAndEngine } from '@pnpm/lockfile.filtering'
import { type DepPath, type ProjectId } from '@pnpm/types'
import { jest } from '@jest/globals'
const REGIONAL_ARCH = Object.assign({}, process.arch)
const REGIONAL_CPU = Object.assign({}, process.platform)
jest.mock('detect-libc', () => {
const original = jest.requireActual('detect-libc')
const original = jest.requireActual<object>('detect-libc')
return {
...original,
familySync: () => 'musl',

View File

@@ -56,6 +56,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/lockfile.fs": "workspace:*",
"@pnpm/logger": "workspace:*",
"@types/js-yaml": "catalog:",

View File

@@ -1,5 +1,6 @@
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { getCurrentBranch } from '@pnpm/git-utils'
import { jest } from '@jest/globals'
import { getWantedLockfileName } from '../lib/lockfileName'
jest.mock('@pnpm/git-utils', () => ({ getCurrentBranch: jest.fn() }))

View File

@@ -8,6 +8,7 @@ import {
writeWantedLockfile,
} from '@pnpm/lockfile.fs'
import { type DepPath, type ProjectId } from '@pnpm/types'
import { jest } from '@jest/globals'
import tempy from 'tempy'
jest.mock('@pnpm/git-utils', () => ({ getCurrentBranch: jest.fn() }))

View File

@@ -6,6 +6,7 @@ import {
readWantedLockfile,
writeLockfiles,
} from '@pnpm/lockfile.fs'
import { jest } from '@jest/globals'
import tempy from 'tempy'
import yaml from 'yaml-tag'
import { getCurrentBranch } from '@pnpm/git-utils'

View File

@@ -55,6 +55,7 @@
"fuse-native": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/constants": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/mount-modules": "workspace:*",

View File

@@ -1,4 +1,5 @@
import { STORE_VERSION } from '@pnpm/constants'
import { jest } from '@jest/globals'
import path from 'path'
jest.mock('fuse-native', () => ({ ENOENT: -2 }))

View File

@@ -40,6 +40,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/plugin-commands-doctor": "workspace:*"
},

View File

@@ -1,5 +1,6 @@
import { doctor } from '@pnpm/plugin-commands-doctor'
import { logger } from '@pnpm/logger'
import { jest } from '@jest/globals'
beforeEach(() => {
jest.spyOn(logger, 'warn')

View File

@@ -42,6 +42,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/error": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/plugin-commands-setup": "workspace:*",

View File

@@ -1,6 +1,7 @@
import { PnpmError } from '@pnpm/error'
import { setup } from '@pnpm/plugin-commands-setup'
import { addDirToEnvPath, type PathExtenderReport } from '@pnpm/os.env.path-extender'
import { jest } from '@jest/globals'
jest.mock('@pnpm/os.env.path-extender', () => ({
addDirToEnvPath: jest.fn(),

View File

@@ -39,6 +39,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/patching.apply-patch": "workspace:*",
"@pnpm/prepare": "workspace:*",

View File

@@ -4,11 +4,12 @@ import { applyPatchToDir } from '@pnpm/patching.apply-patch'
import { fixtures } from '@pnpm/test-fixtures'
import { tempDir } from '@pnpm/prepare'
import { globalWarn } from '@pnpm/logger'
import { jest } from '@jest/globals'
const f = fixtures(__dirname)
jest.mock('@pnpm/logger', () => {
const originalModule = jest.requireActual('@pnpm/logger')
const originalModule = jest.requireActual<object>('@pnpm/logger')
return {
...originalModule,
globalWarn: jest.fn(),

View File

@@ -71,6 +71,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/plugin-commands-patching": "workspace:*",
"@pnpm/prepare": "workspace:*",

View File

@@ -12,6 +12,7 @@ import { readProjectManifest } from '@pnpm/read-project-manifest'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { DEFAULT_OPTS } from './utils/index'
import { fixtures } from '@pnpm/test-fixtures'
import { jest } from '@jest/globals'
import * as enquirer from 'enquirer'
jest.mock('enquirer', () => ({ prompt: jest.fn() }))

View File

@@ -122,6 +122,7 @@
"@pnpm/worker": "workspace:^"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/assert-project": "workspace:*",
"@pnpm/assert-store": "workspace:*",
"@pnpm/core": "workspace:*",

View File

@@ -5,12 +5,13 @@ import { addDistTag } from '@pnpm/registry-mock'
import { type MutatedProject, mutateModules, type ProjectOptions, type MutateModulesOptions, addDependenciesToPackage } from '@pnpm/core'
import { type CatalogSnapshots } from '@pnpm/lockfile.types'
import { logger } from '@pnpm/logger'
import { jest } from '@jest/globals'
import { sync as loadJsonFile } from 'load-json-file'
import path from 'path'
import { testDefaults } from './utils'
jest.mock('@pnpm/logger', () => {
const originalModule = jest.requireActual('@pnpm/logger')
const originalModule = jest.requireActual<any>('@pnpm/logger') // eslint-disable-line
originalModule.logger.warn = jest.fn()
return originalModule
})

View File

@@ -56,6 +56,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/link-bins": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",

View File

@@ -8,6 +8,7 @@ import {
linkBinsOfPkgsByAliases,
} from '@pnpm/link-bins'
import { fixtures } from '@pnpm/test-fixtures'
import { jest } from '@jest/globals'
import CMD_EXTENSION from 'cmd-extension'
import isWindows from 'is-windows'
import normalizePath from 'normalize-path'

View File

@@ -95,6 +95,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/assert-project": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/modules-yaml": "workspace:*",

View File

@@ -5,10 +5,11 @@ import { globalWarn } from '@pnpm/logger'
import { add, install } from '@pnpm/plugin-commands-installation'
import { prepareEmpty } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import { jest } from '@jest/globals'
import { DEFAULT_OPTS } from './utils'
jest.mock('@pnpm/logger', () => {
const originalModule = jest.requireActual('@pnpm/logger')
const originalModule = jest.requireActual<object>('@pnpm/logger')
return {
...originalModule,
globalWarn: jest.fn(),

View File

@@ -4,6 +4,7 @@ import { type LockfileObject } from '@pnpm/lockfile.types'
import { add, install, update } from '@pnpm/plugin-commands-installation'
import { prepare, preparePackages } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT, addDistTag } from '@pnpm/registry-mock'
import { jest } from '@jest/globals'
import { sync as readYamlFile } from 'read-yaml-file'
import chalk from 'chalk'
import * as enquirer from 'enquirer'

View File

@@ -4,6 +4,7 @@ import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { update, install } from '@pnpm/plugin-commands-installation'
import * as enquirer from 'enquirer'
import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir'
import { jest } from '@jest/globals'
jest.mock('enquirer', () => ({ prompt: jest.fn() }))

728
pnpm-lock.yaml generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -57,6 +57,7 @@ catalog:
'@eslint/eslintrc': 3.1.0
'@eslint/js': 9.9.1
'@gwhitney/detect-indent': 7.0.1
'@jest/globals': 29.7.0
'@pnpm/builder.policy': 3.0.1
'@pnpm/byline': ^1.0.0
'@pnpm/colorize-semver-diff': ^1.0.1

View File

@@ -76,6 +76,7 @@
"node-gyp": "^11.1.0"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/assert-project": "workspace:*",
"@pnpm/byline": "catalog:",
"@pnpm/cache.commands": "workspace:*",

View File

@@ -1,6 +1,7 @@
import { getConfig } from '@pnpm/config'
import { updateCheckLogger } from '@pnpm/core-loggers'
import { prepareEmpty } from '@pnpm/prepare'
import { jest } from '@jest/globals'
import loadJsonFile from 'load-json-file'
import writeJsonFile from 'write-json-file'
import { checkForUpdates } from './checkForUpdates'

View File

@@ -71,6 +71,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/catalogs.config": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/plugin-commands-publishing": "workspace:*",

View File

@@ -8,6 +8,7 @@ import tempy from 'tempy'
import * as enquirer from 'enquirer'
import { publish } from '@pnpm/plugin-commands-publishing'
import { jest } from '@jest/globals'
import { DEFAULT_OPTS } from './utils'
jest.mock('enquirer', () => ({ prompt: jest.fn() }))

View File

@@ -54,6 +54,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/constants": "workspace:*",
"@pnpm/license-scanner": "workspace:*",
"@pnpm/logger": "workspace:*",

View File

@@ -2,11 +2,12 @@ import { findDependencyLicenses } from '@pnpm/license-scanner'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import { type DepPath, type ProjectManifest, type Registries, type ProjectId } from '@pnpm/types'
import { type LockfileObject } from '@pnpm/lockfile.fs'
import { jest } from '@jest/globals'
import { type LicensePackage } from '../lib/licenses'
import { type GetPackageInfoOptions, type PackageInfo } from '../lib/getPkgInfo'
jest.mock('../lib/getPkgInfo', () => {
const actualModule = jest.requireActual('../lib/getPkgInfo')
const actualModule = jest.requireActual<object>('../lib/getPkgInfo')
return {
...actualModule,
getPkgInfo: async (pkg: PackageInfo, _opts: GetPackageInfoOptions): Promise<

View File

@@ -41,6 +41,7 @@
"touch": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/store-path": "workspace:*",
"@types/is-windows": "catalog:",
"@types/node": "catalog:",

View File

@@ -1,5 +1,6 @@
import { STORE_VERSION } from '@pnpm/constants'
import { getStorePath } from '@pnpm/store-path'
import { jest } from '@jest/globals'
import isWindows from 'is-windows'
jest.mock('os')

View File

@@ -50,6 +50,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/env.path": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/tools.plugin-commands-self-updater": "workspace:*",

View File

@@ -3,13 +3,14 @@ import path from 'path'
import { prependDirsToPath } from '@pnpm/env.path'
import { tempDir, prepare as prepareWithPkg } from '@pnpm/prepare'
import { selfUpdate } from '@pnpm/tools.plugin-commands-self-updater'
import { jest } from '@jest/globals'
import spawn from 'cross-spawn'
import nock from 'nock'
const pnpmTarballPath = require.resolve('@pnpm/tgz-fixtures/tgz/pnpm-9.1.0.tgz')
jest.mock('@pnpm/cli-meta', () => {
const actualModule = jest.requireActual('@pnpm/cli-meta')
const actualModule = jest.requireActual<object>('@pnpm/cli-meta')
return {
...actualModule,