diff --git a/.meta-updater/src/index.ts b/.meta-updater/src/index.ts index d007d0168d..cddfcdbe4c 100644 --- a/.meta-updater/src/index.ts +++ b/.meta-updater/src/index.ts @@ -6,7 +6,7 @@ import { createUpdateOptions, type FormatPluginFnOptions } from '@pnpm/meta-upda import { sortDirectKeys, sortKeysByPriority } from '@pnpm/object.key-sorting' import { findWorkspacePackagesNoCheck } from '@pnpm/workspace.find-packages' import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' import { loadJsonFileSync } from 'load-json-file' import semver from 'semver' import normalizePath from 'normalize-path' diff --git a/__typings__/local.d.ts b/__typings__/local.d.ts index 6b70c28c82..d82aca6ef4 100644 --- a/__typings__/local.d.ts +++ b/__typings__/local.d.ts @@ -64,8 +64,7 @@ declare module 'ansi-diff' { } declare module 'better-path-resolve' { - const anything: any - export = anything + export const betterPathResolve: (...args: any[]) => any } // cspell:disable-next-line @@ -85,13 +84,12 @@ declare module 'exists-link' { } declare module 'graceful-git' { - const anything: any - export = anything + export const gracefulGit: any + export const noRetry: any } declare module 'is-inner-link' { - const anything: any - export = anything + export function isInnerLink (parent: string, relativePathToLink: string): Promise<{ isInner: boolean, target: string }> } declare module 'read-package-json' { diff --git a/__utils__/assert-project/src/index.ts b/__utils__/assert-project/src/index.ts index d0acde3d9a..a49f0dcaba 100644 --- a/__utils__/assert-project/src/index.ts +++ b/__utils__/assert-project/src/index.ts @@ -7,7 +7,7 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import type { LockfileFile } from '@pnpm/lockfile.types' import type { Modules } from '@pnpm/modules-yaml' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { writePackageSync } from 'write-package' import isExecutable from './isExecutable.js' @@ -141,7 +141,7 @@ export function assertProject (projectPath: string, encodedRegistryName?: string }, readCurrentLockfile () { try { - return readYamlFile(path.join(getVirtualStoreDir(), 'lock.yaml')) + return readYamlFileSync(path.join(getVirtualStoreDir(), 'lock.yaml')) } catch (err: unknown) { if (util.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') return null! throw err @@ -150,7 +150,7 @@ export function assertProject (projectPath: string, encodedRegistryName?: string readModulesManifest: () => readModulesManifest(modules), readLockfile (lockfileName: string = WANTED_LOCKFILE) { try { - return readYamlFile(path.join(projectPath, lockfileName)) + return readYamlFileSync(path.join(projectPath, lockfileName)) } catch (err: unknown) { if (util.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') return null! throw err @@ -164,7 +164,7 @@ export function assertProject (projectPath: string, encodedRegistryName?: string function readModulesManifest (modulesDir: string): Modules { try { - return readYamlFile(path.join(modulesDir, '.modules.yaml')) + return readYamlFileSync(path.join(modulesDir, '.modules.yaml')) } catch (err: unknown) { if (util.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') return null! throw err diff --git a/__utils__/prepare/src/index.ts b/__utils__/prepare/src/index.ts index 59f10df8ce..4cffc8af7a 100644 --- a/__utils__/prepare/src/index.ts +++ b/__utils__/prepare/src/index.ts @@ -3,8 +3,8 @@ import path from 'path' import { assertProject, type Modules, type Project } from '@pnpm/assert-project' import type { ProjectManifest } from '@pnpm/types' import { tempDir } from '@pnpm/prepare-temp-dir' -import { sync as writeJson5File } from 'write-json5-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeJson5FileSync } from 'write-json5-file' +import { writeYamlFileSync } from 'write-yaml-file' import { writePackageSync } from 'write-package' export type { Modules, Project } @@ -61,10 +61,10 @@ export function prepare ( writePackageSync(dir, { name: 'project', version: '0.0.0', ...manifest } as any) // eslint-disable-line break case 'JSON5': - writeJson5File(path.join(dir, 'package.json5'), { name: 'project', version: '0.0.0', ...manifest } as any) // eslint-disable-line + writeJson5FileSync(path.join(dir, 'package.json5'), { name: 'project', version: '0.0.0', ...manifest } as any) // eslint-disable-line break case 'YAML': - writeYamlFile(path.join(dir, 'package.yaml'), { name: 'project', version: '0.0.0', ...manifest } as any) // eslint-disable-line + writeYamlFileSync(path.join(dir, 'package.yaml'), { name: 'project', version: '0.0.0', ...manifest } as any) // eslint-disable-line break } process.chdir(dir) diff --git a/__utils__/scripts/src/copy-artifacts.ts b/__utils__/scripts/src/copy-artifacts.ts index 0682d8103d..4b2070b463 100644 --- a/__utils__/scripts/src/copy-artifacts.ts +++ b/__utils__/scripts/src/copy-artifacts.ts @@ -1,7 +1,7 @@ import fs from 'fs' import * as execa from 'execa' import path from 'path' -import makeEmptyDir from 'make-empty-dir' +import { makeEmptyDir } from 'make-empty-dir' import stream from 'stream' import * as tar from 'tar' import { glob } from 'tinyglobby' diff --git a/__utils__/test-ipc-server/test/TestIpcServer.test.ts b/__utils__/test-ipc-server/test/TestIpcServer.test.ts index dd383284aa..5c61a93967 100644 --- a/__utils__/test-ipc-server/test/TestIpcServer.test.ts +++ b/__utils__/test-ipc-server/test/TestIpcServer.test.ts @@ -2,7 +2,7 @@ import fs from 'fs' import net from 'net' import path from 'path' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { setTimeout } from 'timers/promises' import { promisify } from 'util' import { prepare } from '@pnpm/prepare' diff --git a/building/build-commands/src/rebuild.ts b/building/build-commands/src/rebuild.ts index a5273a72e8..6294cff00e 100644 --- a/building/build-commands/src/rebuild.ts +++ b/building/build-commands/src/rebuild.ts @@ -12,7 +12,7 @@ import { } from '@pnpm/store-connection-manager' import type { ProjectRootDir } from '@pnpm/types' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { recursiveRebuild } from './recursive.js' export function rcOptionsTypes (): Record { diff --git a/building/build-commands/test/index.ts b/building/build-commands/test/index.ts index 9973f6d3d1..d5bcb67228 100644 --- a/building/build-commands/test/index.ts +++ b/building/build-commands/test/index.ts @@ -9,7 +9,7 @@ import { rebuild } from '@pnpm/building.build-commands' import { prepare } from '@pnpm/prepare' import { getIntegrity, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { fixtures } from '@pnpm/test-fixtures' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { jest } from '@jest/globals' import { DEFAULT_OPTS } from './utils/index.js' diff --git a/building/build-commands/test/recursive.ts b/building/build-commands/test/recursive.ts index 333aa658e1..3377fc046b 100644 --- a/building/build-commands/test/recursive.ts +++ b/building/build-commands/test/recursive.ts @@ -5,8 +5,8 @@ import { rebuild } from '@pnpm/building.build-commands' import { preparePackages } from '@pnpm/prepare' import { createTestIpcServer } from '@pnpm/test-ipc-server' import type { PackageManifest } from '@pnpm/types' -import execa from 'execa' -import { sync as writeYamlFile } from 'write-yaml-file' +import { safeExeca as execa } from 'execa' +import { writeYamlFileSync } from 'write-yaml-file' import { DEFAULT_OPTS, REGISTRY } from './utils/index.js' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') @@ -104,7 +104,7 @@ test('pnpm recursive rebuild with hoisted node linker', async () => { ]) const { allProjects, selectedProjectsGraph } = await filterPackagesFromDir(process.cwd(), []) - writeYamlFile('pnpm-workspace.yaml', { packages: ['*'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['*'] }) await execa('node', [ pnpmBin, 'install', @@ -195,7 +195,7 @@ test('rebuild multiple packages in correct order', async () => { }, ] preparePackages(pkgs) - writeYamlFile('pnpm-workspace.yaml', { packages: pkgs.map(pkg => pkg.name) }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: pkgs.map(pkg => pkg.name) }) const { allProjects, selectedProjectsGraph } = await filterPackagesFromDir(process.cwd(), []) await execa('node', [ diff --git a/building/policy-commands/src/approveBuilds.ts b/building/policy-commands/src/approveBuilds.ts index c4d919c5cb..79ccf7261f 100644 --- a/building/policy-commands/src/approveBuilds.ts +++ b/building/policy-commands/src/approveBuilds.ts @@ -7,7 +7,7 @@ import { type StrictModules, writeModulesManifest } from '@pnpm/modules-yaml' import { lexCompare } from '@pnpm/util.lex-comparator' import chalk from 'chalk' import enquirer from 'enquirer' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { getAutomaticallyIgnoredBuilds } from './getAutomaticallyIgnoredBuilds.js' export type ApproveBuildsCommandOpts = Pick & { all?: boolean, global?: boolean } diff --git a/building/policy-commands/src/ignoredBuilds.ts b/building/policy-commands/src/ignoredBuilds.ts index 864e2b0efd..26c927a694 100644 --- a/building/policy-commands/src/ignoredBuilds.ts +++ b/building/policy-commands/src/ignoredBuilds.ts @@ -1,5 +1,5 @@ import type { Config } from '@pnpm/config' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { getAutomaticallyIgnoredBuilds } from './getAutomaticallyIgnoredBuilds.js' export type IgnoredBuildsCommandOpts = Pick diff --git a/building/policy-commands/test/approveBuilds.test.ts b/building/policy-commands/test/approveBuilds.test.ts index cbc0e58922..9c414e2688 100644 --- a/building/policy-commands/test/approveBuilds.test.ts +++ b/building/policy-commands/test/approveBuilds.test.ts @@ -10,9 +10,9 @@ import { jest } from '@jest/globals' import { omit } from 'ramda' import { tempDir } from '@pnpm/prepare-temp-dir' import { writePackageSync } from 'write-package' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' -import execa from 'execa' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' +import { safeExeca as execa } from 'execa' jest.unstable_mockModule('enquirer', () => ({ default: { prompt: jest.fn() } })) const { default: enquirer } = await import('enquirer') @@ -94,7 +94,7 @@ test('approve selected build', async () => { await approveSomeBuilds() - const workspaceManifest = readYamlFile(path.resolve('pnpm-workspace.yaml')) // eslint-disable-line + const workspaceManifest = readYamlFileSync(path.resolve('pnpm-workspace.yaml')) // eslint-disable-line expect(workspaceManifest.allowBuilds).toStrictEqual({ '@pnpm.e2e/install-script-example': false, '@pnpm.e2e/pre-and-postinstall-scripts-example': true, @@ -115,7 +115,7 @@ test('approve no builds', async () => { await approveNoBuilds() - const manifest = readYamlFile(path.resolve('pnpm-workspace.yaml')) // eslint-disable-line + const manifest = readYamlFileSync(path.resolve('pnpm-workspace.yaml')) // eslint-disable-line // allowBuilds is now the unified setting expect(Object.keys(manifest.allowBuilds ?? {}).sort()).toStrictEqual([ '@pnpm.e2e/install-script-example', @@ -148,7 +148,7 @@ test("works when root project manifest doesn't exist in a workspace", async () = const workspaceDir = path.resolve('../..') const workspaceManifestFile = path.join(workspaceDir, 'pnpm-workspace.yaml') - writeYamlFile(workspaceManifestFile, { packages: ['packages/*'] }) + writeYamlFileSync(workspaceManifestFile, { packages: ['packages/*'] }) const config = await getApproveBuildsConfig() prompt.mockResolvedValueOnce({ @@ -157,7 +157,7 @@ test("works when root project manifest doesn't exist in a workspace", async () = prompt.mockResolvedValueOnce({ build: true }) await approveBuilds.handler({ ...config, workspaceDir, rootProjectManifestDir: workspaceDir }) - expect(readYamlFile(workspaceManifestFile)).toStrictEqual({ + expect(readYamlFileSync(workspaceManifestFile)).toStrictEqual({ packages: ['packages/*'], allowBuilds: { '@pnpm.e2e/install-script-example': false, @@ -179,10 +179,10 @@ test('should approve builds with package.json that has no allowBuilds field defi }) const workspaceManifestFile = path.join(temp, 'pnpm-workspace.yaml') - writeYamlFile(workspaceManifestFile, { packages: ['packages/*'] }) + writeYamlFileSync(workspaceManifestFile, { packages: ['packages/*'] }) await approveSomeBuilds({ workspaceDir: temp, rootProjectManifestDir: temp }) - expect(readYamlFile(workspaceManifestFile)).toStrictEqual({ + expect(readYamlFileSync(workspaceManifestFile)).toStrictEqual({ packages: ['packages/*'], allowBuilds: { '@pnpm.e2e/install-script-example': false, @@ -207,7 +207,7 @@ test('approve all builds with --all flag', async () => { expect(prompt).not.toHaveBeenCalled() - const workspaceManifest = readYamlFile(path.resolve('pnpm-workspace.yaml')) // eslint-disable-line + const workspaceManifest = readYamlFileSync(path.resolve('pnpm-workspace.yaml')) // eslint-disable-line expect(workspaceManifest.allowBuilds).toStrictEqual({ '@pnpm.e2e/install-script-example': true, '@pnpm.e2e/pre-and-postinstall-scripts-example': true, @@ -236,7 +236,7 @@ test('should retain existing allowBuilds entries when approving builds', async ( await execPnpmInstall() const workspaceManifestFile = path.join(temp, 'pnpm-workspace.yaml') - writeYamlFile(workspaceManifestFile, { + writeYamlFileSync(workspaceManifestFile, { packages: ['packages/*'], allowBuilds: { '@pnpm.e2e/test': false, @@ -259,7 +259,7 @@ test('should retain existing allowBuilds entries when approving builds', async ( }, }) - expect(readYamlFile(workspaceManifestFile)).toStrictEqual({ + expect(readYamlFileSync(workspaceManifestFile)).toStrictEqual({ packages: ['packages/*'], allowBuilds: { '@pnpm.e2e/install-script-example': false, diff --git a/cache/commands/src/cache.cmd.ts b/cache/commands/src/cache.cmd.ts index 75539b58ad..19956a4333 100644 --- a/cache/commands/src/cache.cmd.ts +++ b/cache/commands/src/cache.cmd.ts @@ -4,7 +4,7 @@ import { type Config, types as allTypes } from '@pnpm/config' import { FULL_FILTERED_META_DIR, ABBREVIATED_META_DIR } from '@pnpm/constants' import { getStorePath } from '@pnpm/store-path' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { cacheList, cacheView, diff --git a/cache/commands/test/cacheDelete.cmd.test.ts b/cache/commands/test/cacheDelete.cmd.test.ts index 7b5f4779f7..0ce14b8365 100644 --- a/cache/commands/test/cacheDelete.cmd.test.ts +++ b/cache/commands/test/cacheDelete.cmd.test.ts @@ -1,9 +1,9 @@ import path from 'path' import { prepare } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { cache } from '@pnpm/cache.commands' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') const REGISTRY = `http://localhost:${REGISTRY_MOCK_PORT}/` @@ -25,8 +25,8 @@ describe('cache delete', () => { '--config.resolution-mode=highest', `--registry=${REGISTRY}`, ]) - rimraf('node_modules') - rimraf('pnpm-lock.yaml') + rimrafSync('node_modules') + rimrafSync('pnpm-lock.yaml') await execa('node', [ pnpmBin, 'add', diff --git a/cache/commands/test/cacheList.cmd.test.ts b/cache/commands/test/cacheList.cmd.test.ts index cec0f7ebda..b6e4fffc6d 100644 --- a/cache/commands/test/cacheList.cmd.test.ts +++ b/cache/commands/test/cacheList.cmd.test.ts @@ -1,9 +1,9 @@ import path from 'path' import { prepare } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { cache } from '@pnpm/cache.commands' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') const REGISTRY = `http://localhost:${REGISTRY_MOCK_PORT}/` @@ -25,8 +25,8 @@ describe('cache', () => { '--config.resolution-mode=highest', `--registry=${REGISTRY}`, ]) - rimraf('node_modules') - rimraf('pnpm-lock.yaml') + rimrafSync('node_modules') + rimrafSync('pnpm-lock.yaml') await execa('node', [ pnpmBin, 'add', diff --git a/cache/commands/test/cacheView.cmd.test.ts b/cache/commands/test/cacheView.cmd.test.ts index 6821e8e687..40d34e39ee 100644 --- a/cache/commands/test/cacheView.cmd.test.ts +++ b/cache/commands/test/cacheView.cmd.test.ts @@ -1,9 +1,9 @@ import path from 'path' import { prepare } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { cache } from '@pnpm/cache.commands' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') const REGISTRY = `http://localhost:${REGISTRY_MOCK_PORT}/` @@ -25,8 +25,8 @@ describe('cache view', () => { '--config.resolution-mode=highest', `--registry=${REGISTRY}`, ]) - rimraf('node_modules') - rimraf('pnpm-lock.yaml') + rimrafSync('node_modules') + rimrafSync('pnpm-lock.yaml') await execa('node', [ pnpmBin, 'add', diff --git a/completion/plugin-commands-completion/src/generateCompletion.ts b/completion/plugin-commands-completion/src/generateCompletion.ts index 04f6af4815..509f59fb04 100644 --- a/completion/plugin-commands-completion/src/generateCompletion.ts +++ b/completion/plugin-commands-completion/src/generateCompletion.ts @@ -1,4 +1,4 @@ -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { getCompletionScript, SUPPORTED_SHELLS } from '@pnpm/tabtab' import { getShellFromParams } from './getShell.js' diff --git a/config/config/src/checkGlobalBinDir.ts b/config/config/src/checkGlobalBinDir.ts index 27c571ac5e..db66e99dfd 100644 --- a/config/config/src/checkGlobalBinDir.ts +++ b/config/config/src/checkGlobalBinDir.ts @@ -2,7 +2,7 @@ import { promises as fs } from 'fs' import path from 'path' import util from 'util' import { PnpmError } from '@pnpm/error' -import { sync as canWriteToDir } from 'can-write-to-dir' +import { canWriteToDirSync } from 'can-write-to-dir' import PATH from 'path-name' export async function checkGlobalBinDir ( @@ -33,7 +33,7 @@ const areDirsEqual = (dir1: string, dir2: string): boolean => function canWriteToDirAndExists (dir: string): boolean { try { - return canWriteToDir(dir) + return canWriteToDirSync(dir) } catch (err: unknown) { if (util.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') return false throw err diff --git a/config/config/src/index.ts b/config/config/src/index.ts index 48703b8c0d..53c29ae76e 100644 --- a/config/config/src/index.ts +++ b/config/config/src/index.ts @@ -13,13 +13,13 @@ import { safeReadProjectManifestOnly } from '@pnpm/read-project-manifest' import { getCurrentBranch } from '@pnpm/git-utils' import { createMatcher } from '@pnpm/matcher' import type { ProjectManifest } from '@pnpm/types' -import betterPathResolve from 'better-path-resolve' +import { betterPathResolve } from 'better-path-resolve' import camelcase from 'camelcase' import isWindows from 'is-windows' import kebabCase from 'lodash.kebabcase' import normalizeRegistryUrl from 'normalize-registry-url' -import realpathMissing from 'realpath-missing' -import pathAbsolute from 'path-absolute' +import { realpathMissing } from 'realpath-missing' +import { pathAbsolute } from 'path-absolute' import which from 'which' import { inheritAuthConfig, isIniConfigKey, pickIniConfig } from './auth.js' import { isConfigFileKey } from './configFileKey.js' diff --git a/config/config/test/index.ts b/config/config/test/index.ts index e4d37238e1..11316349b2 100644 --- a/config/config/test/index.ts +++ b/config/config/test/index.ts @@ -3,7 +3,7 @@ import fs from 'fs' import os from 'os' import path from 'path' import PATH from 'path-name' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import loadNpmConf from '@pnpm/npm-conf' import { prepare, prepareEmpty } from '@pnpm/prepare' import { fixtures } from '@pnpm/test-fixtures' @@ -210,7 +210,7 @@ test('.npmrc does not load pnpm settings', async () => { test('rc options appear as kebab-case in rawConfig even if it was defined as camelCase by pnpm-workspace.yaml', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { ignoreScripts: true, linkWorkspacePackages: true, nodeLinker: 'hoisted', @@ -250,7 +250,7 @@ test('rc options appear as kebab-case in rawConfig even if it was defined as cam test('workspace-specific settings preserve case in rawConfig', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['foo', 'bar'], packageExtensions: { '@babel/parser': { @@ -308,7 +308,7 @@ test('workspace-specific settings preserve case in rawConfig', async () => { test('when using --global, linkWorkspacePackages, sharedWorkspaceLockfile and lockfileDir are false even if they are set to true in pnpm-workspace.yaml', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { linkWorkspacePackages: true, sharedWorkspaceLockfile: true, lockfileDir: true, @@ -700,7 +700,7 @@ test('normalize the value of the color flag', async () => { test.skip('read only supported settings from config', async () => { prepare() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { storeDir: '__store__', foo: 'bar', }) @@ -839,7 +839,7 @@ test('respects changedFilesIgnorePattern', async () => { { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { changedFilesIgnorePattern: ['.github/**', '**/README.md'], }) @@ -1035,7 +1035,7 @@ test('respect mergeGitBranchLockfilesBranchPattern', async () => { { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { mergeGitBranchLockfilesBranchPattern: ['main', 'release/**'], }) @@ -1057,7 +1057,7 @@ test('respect mergeGitBranchLockfilesBranchPattern', async () => { test('getConfig() sets mergeGitBranchLockfiles when branch matches mergeGitBranchLockfilesBranchPattern', async () => { prepareEmpty() { - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { mergeGitBranchLockfilesBranchPattern: ['main', 'release/**'], }) @@ -1312,7 +1312,7 @@ test('loads setting from environment variable pnpm_config_*', async () => { test('environment variable pnpm_config_* should override pnpm-workspace.yaml', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { fetchRetries: 5, }) @@ -1437,7 +1437,7 @@ describe('global config.yaml', () => { prepareEmpty() fs.mkdirSync('.config/pnpm', { recursive: true }) - writeYamlFile('.config/pnpm/config.yaml', { + writeYamlFileSync('.config/pnpm/config.yaml', { dangerouslyAllowAllBuilds: true, }) @@ -1466,7 +1466,7 @@ describe('global config.yaml', () => { test('lockfile: false in pnpm-workspace.yaml sets useLockfile to false', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { lockfile: false, }) @@ -1485,7 +1485,7 @@ test('lockfile: false in pnpm-workspace.yaml sets useLockfile to false', async ( test('pnpm_config_lockfile env var overrides lockfile from pnpm-workspace.yaml in useLockfile', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { lockfile: true, }) @@ -1507,7 +1507,7 @@ test('pnpm_config_lockfile env var overrides lockfile from pnpm-workspace.yaml i test('ci disables enableGlobalVirtualStore by default', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { ci: true, }) @@ -1527,7 +1527,7 @@ test('ci disables enableGlobalVirtualStore by default', async () => { test('ci respects explicit enableGlobalVirtualStore from config', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { ci: true, enableGlobalVirtualStore: true, }) @@ -1548,7 +1548,7 @@ test('ci respects explicit enableGlobalVirtualStore from config', async () => { test('pnpm_config_git_branch_lockfile env var overrides git-branch-lockfile from pnpm-workspace.yaml in useGitBranchLockfile', async () => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { gitBranchLockfile: false, }) diff --git a/config/deps-installer/src/installConfigDeps.ts b/config/deps-installer/src/installConfigDeps.ts index 0885ebd2f4..501dca4e60 100644 --- a/config/deps-installer/src/installConfigDeps.ts +++ b/config/deps-installer/src/installConfigDeps.ts @@ -9,7 +9,7 @@ import { pickRegistryForPackage } from '@pnpm/pick-registry-for-package' import { readModulesDir } from '@pnpm/read-modules-dir' import { safeReadPackageJsonFromDir } from '@pnpm/read-package-json' import type { ConfigDependencies, Registries } from '@pnpm/types' -import rimraf from '@zkochan/rimraf' +import { rimraf } from '@zkochan/rimraf' import getNpmTarballUrl from 'get-npm-tarball-url' import symlinkDir from 'symlink-dir' import { migrateConfigDepsToLockfile } from './migrateConfigDeps.js' diff --git a/config/deps-installer/test/installConfigDeps.ts b/config/deps-installer/test/installConfigDeps.ts index 9540e30c64..c5d022aaf3 100644 --- a/config/deps-installer/test/installConfigDeps.ts +++ b/config/deps-installer/test/installConfigDeps.ts @@ -5,7 +5,7 @@ import { prepareEmpty } from '@pnpm/prepare' import { getIntegrity, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { createTempStore } from '@pnpm/testing.temp-store' import { loadJsonFileSync } from 'load-json-file' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' const registry = `http://localhost:${REGISTRY_MOCK_PORT}/` @@ -130,7 +130,7 @@ test('migration: installs from old inline integrity format and creates env lockf } // Verify pnpm-lock.env.yaml was created with expected content - const envLockfile = readYamlFile('pnpm-lock.env.yaml') + const envLockfile = readYamlFileSync('pnpm-lock.env.yaml') expect(envLockfile.lockfileVersion).toBeDefined() expect(envLockfile.importers['.'].configDependencies['@pnpm.e2e/foo']).toEqual({ specifier: '100.0.0', diff --git a/config/deps-installer/test/resolveConfigDeps.test.ts b/config/deps-installer/test/resolveConfigDeps.test.ts index 529d0dc027..c9c5fd371d 100644 --- a/config/deps-installer/test/resolveConfigDeps.test.ts +++ b/config/deps-installer/test/resolveConfigDeps.test.ts @@ -4,7 +4,7 @@ import { readEnvLockfile } from '@pnpm/lockfile.fs' import { prepareEmpty } from '@pnpm/prepare' import { getIntegrity, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { createTempStore } from '@pnpm/testing.temp-store' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' const registry = `http://localhost:${REGISTRY_MOCK_PORT}/` @@ -24,7 +24,7 @@ test('configuration dependency is resolved', async () => { }) // Workspace manifest should have a clean specifier (no integrity) - const workspaceManifest = readYamlFile<{ configDependencies: Record }>('pnpm-workspace.yaml') + const workspaceManifest = readYamlFileSync<{ configDependencies: Record }>('pnpm-workspace.yaml') expect(workspaceManifest.configDependencies).toStrictEqual({ '@pnpm.e2e/foo': '100.0.0', }) diff --git a/config/plugin-commands-config/src/config.ts b/config/plugin-commands-config/src/config.ts index 2ab26b928b..045acb0a37 100644 --- a/config/plugin-commands-config/src/config.ts +++ b/config/plugin-commands-config/src/config.ts @@ -1,6 +1,6 @@ import { docsUrl } from '@pnpm/cli-utils' import { PnpmError } from '@pnpm/error' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { configGet } from './configGet.js' import { configSet } from './configSet.js' import { configList } from './configList.js' diff --git a/config/plugin-commands-config/test/configDelete.test.ts b/config/plugin-commands-config/test/configDelete.test.ts index ff1e86d30b..3b96023c02 100644 --- a/config/plugin-commands-config/test/configDelete.test.ts +++ b/config/plugin-commands-config/test/configDelete.test.ts @@ -3,8 +3,8 @@ import path from 'path' import { tempDir } from '@pnpm/prepare' import { config } from '@pnpm/plugin-commands-config' import { readIniFileSync } from 'read-ini-file' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' test('config delete on registry key not set', async () => { const tmp = tempDir() @@ -84,7 +84,7 @@ test('config delete on pnpm-specific key not set', async () => { const tmp = tempDir() const configDir = path.join(tmp, 'global-config') fs.mkdirSync(configDir, { recursive: true }) - writeYamlFile(path.join(configDir, 'config.yaml'), { + writeYamlFileSync(path.join(configDir, 'config.yaml'), { cacheDir: '~/cache', }) @@ -96,7 +96,7 @@ test('config delete on pnpm-specific key not set', async () => { rawConfig: {}, }, ['delete', 'store-dir']) - expect(readYamlFile(path.join(configDir, 'config.yaml'))).toStrictEqual({ + expect(readYamlFileSync(path.join(configDir, 'config.yaml'))).toStrictEqual({ cacheDir: '~/cache', }) }) @@ -105,7 +105,7 @@ test('config delete on pnpm-specific key set', async () => { const tmp = tempDir() const configDir = path.join(tmp, 'global-config') fs.mkdirSync(configDir, { recursive: true }) - writeYamlFile(path.join(configDir, 'config.yaml'), { + writeYamlFileSync(path.join(configDir, 'config.yaml'), { cacheDir: '~/cache', }) diff --git a/config/plugin-commands-config/test/configSet.test.ts b/config/plugin-commands-config/test/configSet.test.ts index 0a90c9f540..bca61d26b2 100644 --- a/config/plugin-commands-config/test/configSet.test.ts +++ b/config/plugin-commands-config/test/configSet.test.ts @@ -4,7 +4,7 @@ import { PnpmError } from '@pnpm/error' import { tempDir } from '@pnpm/prepare' import { config } from '@pnpm/plugin-commands-config' import { readIniFileSync } from 'read-ini-file' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { type ConfigFilesData, readConfigFiles, writeConfigFiles } from './utils/index.js' test('config set registry setting using the global option', async () => { @@ -180,7 +180,7 @@ test('config delete with location=project, when delete the last setting from pnp rawConfig: {}, }, ['set', 'virtual-store-dir', '.pnpm']) - expect(readYamlFile(path.join(tmp, 'pnpm-workspace.yaml'))).toEqual({ + expect(readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml'))).toEqual({ virtualStoreDir: '.pnpm', }) @@ -274,7 +274,7 @@ test('config set saves the setting in the right format to pnpm-workspace.yaml', rawConfig: {}, }, ['set', 'fetch-timeout', '1000']) - expect(readYamlFile(path.join(tmp, 'pnpm-workspace.yaml'))).toEqual({ + expect(readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml'))).toEqual({ fetchTimeout: 1000, }) }) @@ -576,7 +576,7 @@ test('config set with location=project and json=true', async () => { rawConfig: {}, }, ['set', 'catalog', '{ "react": "19" }']) - expect(readYamlFile(path.join(tmp, 'pnpm-workspace.yaml'))).toStrictEqual({ + expect(readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml'))).toStrictEqual({ catalog: { react: '19', }, @@ -602,7 +602,7 @@ test('config set with location=project and json=true', async () => { }, })]) - expect(readYamlFile(path.join(tmp, 'pnpm-workspace.yaml'))).toStrictEqual({ + expect(readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml'))).toStrictEqual({ catalog: { react: '19', }, @@ -837,7 +837,7 @@ test('config set when both pnpm-workspace.yaml and .npmrc exist, pnpm-workspace. rawConfig: {}, }, ['set', 'fetch-timeout', '2000']) - expect(readYamlFile(path.join(tmp, 'pnpm-workspace.yaml'))).toEqual({ + expect(readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml'))).toEqual({ fetchRetries: 5, fetchTimeout: 2000, }) @@ -862,7 +862,7 @@ test('config set when only pnpm-workspace.yaml exists, writes to it', async () = rawConfig: {}, }, ['set', 'fetch-timeout', '3000']) - expect(readYamlFile(path.join(tmp, 'pnpm-workspace.yaml'))).toEqual({ + expect(readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml'))).toEqual({ fetchRetries: 5, fetchTimeout: 3000, }) diff --git a/config/plugin-commands-config/test/utils/index.ts b/config/plugin-commands-config/test/utils/index.ts index 714f3b2f41..2324d46db7 100644 --- a/config/plugin-commands-config/test/utils/index.ts +++ b/config/plugin-commands-config/test/utils/index.ts @@ -2,8 +2,8 @@ import fs from 'fs' import path from 'path' import { readIniFileSync } from 'read-ini-file' import { writeIniFileSync } from 'write-ini-file' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import type { config } from '../../src/index.js' export function getOutputString (result: config.ConfigHandlerResult): string { @@ -38,13 +38,13 @@ export function readConfigFiles (globalConfigDir: string | undefined, localDir: ? tryRead(() => readIniFileSync(path.join(globalConfigDir, 'rc')) as Record) : undefined, globalYaml: globalConfigDir - ? tryRead(() => readYamlFile(path.join(globalConfigDir, 'config.yaml'))) + ? tryRead(() => readYamlFileSync(path.join(globalConfigDir, 'config.yaml'))) : undefined, localRc: localDir ? tryRead(() => readIniFileSync(path.join(localDir, '.npmrc')) as Record) : undefined, localYaml: localDir - ? tryRead(() => readYamlFile(path.join(localDir, 'pnpm-workspace.yaml'))) + ? tryRead(() => readYamlFileSync(path.join(localDir, 'pnpm-workspace.yaml'))) : undefined, } } @@ -58,7 +58,7 @@ export function writeConfigFiles (globalConfigDir: string | undefined, localDir: } if (data.globalYaml) { - writeYamlFile(path.join(globalConfigDir, 'config.yaml'), data.globalYaml) + writeYamlFileSync(path.join(globalConfigDir, 'config.yaml'), data.globalYaml) } } @@ -70,7 +70,7 @@ export function writeConfigFiles (globalConfigDir: string | undefined, localDir: } if (data.localYaml) { - writeYamlFile(path.join(localDir, 'pnpm-workspace.yaml'), data.localYaml) + writeYamlFileSync(path.join(localDir, 'pnpm-workspace.yaml'), data.localYaml) } } } diff --git a/env/plugin-commands-env/src/env.ts b/env/plugin-commands-env/src/env.ts index 43a343fdfe..d1614afecd 100644 --- a/env/plugin-commands-env/src/env.ts +++ b/env/plugin-commands-env/src/env.ts @@ -1,6 +1,6 @@ import { docsUrl } from '@pnpm/cli-utils' import { PnpmError } from '@pnpm/error' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { envList } from './envList.js' import { envUse } from './envUse.js' import type { NvmNodeCommandOptions } from './node.js' diff --git a/env/system-node-version/src/index.ts b/env/system-node-version/src/index.ts index 96228fcc70..41ebaff719 100644 --- a/env/system-node-version/src/index.ts +++ b/env/system-node-version/src/index.ts @@ -5,7 +5,7 @@ import * as execa from 'execa' export function getSystemNodeVersionNonCached (): string | undefined { if (detectIfCurrentPkgIsExecutable()) { try { - return execa.sync('node', ['--version']).stdout.toString() + return execa.sync('node', ['--version']).stdout?.toString() } catch { // Node.js is not installed on the system return undefined diff --git a/exec/plugin-commands-script-runners/src/create.ts b/exec/plugin-commands-script-runners/src/create.ts index bc24703bdf..9a871b53cd 100644 --- a/exec/plugin-commands-script-runners/src/create.ts +++ b/exec/plugin-commands-script-runners/src/create.ts @@ -1,4 +1,4 @@ -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { docsUrl } from '@pnpm/cli-utils' import { PnpmError } from '@pnpm/error' import * as dlx from './dlx.js' diff --git a/exec/plugin-commands-script-runners/src/dlx.ts b/exec/plugin-commands-script-runners/src/dlx.ts index 87fe9eb217..2c03ce5cf4 100644 --- a/exec/plugin-commands-script-runners/src/dlx.ts +++ b/exec/plugin-commands-script-runners/src/dlx.ts @@ -14,9 +14,9 @@ import { readPackageJsonFromDir } from '@pnpm/read-package-json' import { getBinsFromPackageManifest } from '@pnpm/package-bins' import type { PackageManifest, PnpmSettings, SupportedArchitectures } from '@pnpm/types' import { lexCompare } from '@pnpm/util.lex-comparator' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import symlinkDir from 'symlink-dir' import { makeEnv } from './makeEnv.js' import { diff --git a/exec/plugin-commands-script-runners/src/exec.ts b/exec/plugin-commands-script-runners/src/exec.ts index b8175b8769..74218386d5 100644 --- a/exec/plugin-commands-script-runners/src/exec.ts +++ b/exec/plugin-commands-script-runners/src/exec.ts @@ -9,11 +9,11 @@ import { logger } from '@pnpm/logger' import { tryReadProjectManifest } from '@pnpm/read-project-manifest' import { sortPackages } from '@pnpm/sort-packages' import type { Project, ProjectsGraph, ProjectRootDir, ProjectRootDirRealPath } from '@pnpm/types' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import pLimit from 'p-limit' import { prependDirsToPath } from '@pnpm/env.path' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { existsInDir } from './existsInDir.js' import { makeEnv } from './makeEnv.js' import { diff --git a/exec/plugin-commands-script-runners/src/restart.ts b/exec/plugin-commands-script-runners/src/restart.ts index 17b88b05f1..7d845a7453 100644 --- a/exec/plugin-commands-script-runners/src/restart.ts +++ b/exec/plugin-commands-script-runners/src/restart.ts @@ -1,6 +1,6 @@ import { types as allTypes } from '@pnpm/config' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { handler as run, IF_PRESENT_OPTION, diff --git a/exec/plugin-commands-script-runners/src/run.ts b/exec/plugin-commands-script-runners/src/run.ts index e8db4d75a0..5db1c98383 100644 --- a/exec/plugin-commands-script-runners/src/run.ts +++ b/exec/plugin-commands-script-runners/src/run.ts @@ -18,8 +18,8 @@ import { import { syncInjectedDeps } from '@pnpm/workspace.injected-deps-syncer' import type { PackageScripts, ProjectManifest } from '@pnpm/types' import { pick } from 'ramda' -import realpathMissing from 'realpath-missing' -import renderHelp from 'render-help' +import { realpathMissing } from 'realpath-missing' +import { renderHelp } from 'render-help' import { runRecursive, type RecursiveRunOpts, getSpecifiedScripts as getSpecifiedScriptWithoutStartCommand } from './runRecursive.js' import { existsInDir } from './existsInDir.js' import { handler as exec } from './exec.js' diff --git a/exec/plugin-commands-script-runners/src/runRecursive.ts b/exec/plugin-commands-script-runners/src/runRecursive.ts index 7873906b15..56ad361c9e 100644 --- a/exec/plugin-commands-script-runners/src/runRecursive.ts +++ b/exec/plugin-commands-script-runners/src/runRecursive.ts @@ -11,7 +11,7 @@ import { import { groupStart } from '@pnpm/log.group' import { sortPackages } from '@pnpm/sort-packages' import pLimit from 'p-limit' -import realpathMissing from 'realpath-missing' +import { realpathMissing } from 'realpath-missing' import { existsInDir } from './existsInDir.js' import { createEmptyRecursiveSummary, getExecutionDuration, getResumedPackageChunks, writeRecursiveSummary } from './exec.js' import { type RunScriptOptions, runScript } from './run.js' diff --git a/exec/plugin-commands-script-runners/test/dlx.ts b/exec/plugin-commands-script-runners/test/dlx.ts index 8abecddf2a..d5e91c5f31 100644 --- a/exec/plugin-commands-script-runners/test/dlx.ts +++ b/exec/plugin-commands-script-runners/test/dlx.ts @@ -4,11 +4,11 @@ import { jest } from '@jest/globals' import { DLX_DEFAULT_OPTS as DEFAULT_OPTS } from './utils/index.js' jest.unstable_mockModule('execa', () => ({ - default: jest.fn(), + safeExeca: jest.fn(), sync: jest.fn(), })) -const { default: execa } = await import('execa') +const { safeExeca: execa } = await import('execa') const { dlx } = await import('@pnpm/plugin-commands-script-runners') beforeEach(() => jest.mocked(execa).mockClear()) diff --git a/exec/plugin-commands-script-runners/test/exec.e2e.ts b/exec/plugin-commands-script-runners/test/exec.e2e.ts index 6f1714eadc..051ca14eb2 100644 --- a/exec/plugin-commands-script-runners/test/exec.e2e.ts +++ b/exec/plugin-commands-script-runners/test/exec.e2e.ts @@ -6,7 +6,7 @@ import { exec, run } from '@pnpm/plugin-commands-script-runners' import { prepare, prepareEmpty, preparePackages } from '@pnpm/prepare' import { createTestIpcServer } from '@pnpm/test-ipc-server' import type { ProjectRootDirRealPath, ProjectRootDir } from '@pnpm/types' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { DEFAULT_OPTS, REGISTRY_URL } from './utils/index.js' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') diff --git a/exec/plugin-commands-script-runners/test/exec.logs.ts b/exec/plugin-commands-script-runners/test/exec.logs.ts index b829fc5fbc..5cf7eb671f 100644 --- a/exec/plugin-commands-script-runners/test/exec.logs.ts +++ b/exec/plugin-commands-script-runners/test/exec.logs.ts @@ -2,7 +2,7 @@ import fs from 'fs' import path from 'path' import { preparePackages } from '@pnpm/prepare' import { jest } from '@jest/globals' -import writeYamlFile from 'write-yaml-file' +import { writeYamlFile } from 'write-yaml-file' import { DEFAULT_OPTS } from './utils/index.js' const debug = jest.fn() diff --git a/exec/plugin-commands-script-runners/test/exec.ts b/exec/plugin-commands-script-runners/test/exec.ts index 1b383cfda3..18348bdb05 100644 --- a/exec/plugin-commands-script-runners/test/exec.ts +++ b/exec/plugin-commands-script-runners/test/exec.ts @@ -3,11 +3,11 @@ import { jest } from '@jest/globals' import { DEFAULT_OPTS } from './utils/index.js' jest.unstable_mockModule('execa', () => ({ - default: jest.fn(), + safeExeca: jest.fn(), sync: jest.fn(), })) -const { default: execa } = await import('execa') +const { safeExeca: execa } = await import('execa') const { exec } = await import('@pnpm/plugin-commands-script-runners') beforeEach(() => jest.mocked(execa).mockClear()) diff --git a/exec/plugin-commands-script-runners/test/index.ts b/exec/plugin-commands-script-runners/test/index.ts index 25213435cb..eeee3c6c42 100644 --- a/exec/plugin-commands-script-runners/test/index.ts +++ b/exec/plugin-commands-script-runners/test/index.ts @@ -9,9 +9,9 @@ import { } from '@pnpm/plugin-commands-script-runners' import { prepare, preparePackages } from '@pnpm/prepare' import { createTestIpcServer } from '@pnpm/test-ipc-server' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import isWindows from 'is-windows' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { DEFAULT_OPTS, REGISTRY_URL } from './utils/index.js' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') @@ -334,7 +334,7 @@ test('"pnpm run" prints the list of available commands, including commands of th }, }, ]) - writeYamlFile('pnpm-workspace.yaml', {}) + writeYamlFileSync('pnpm-workspace.yaml', {}) const workspaceDir = process.cwd() const { allProjects, selectedProjectsGraph } = await filterPackagesFromDir(process.cwd(), []) @@ -425,7 +425,7 @@ test('if a script is not found but is present in the root, print an info message version: '1.0.0', }, ]) - writeYamlFile('pnpm-workspace.yaml', {}) + writeYamlFileSync('pnpm-workspace.yaml', {}) await execa(pnpmBin, [ 'install', diff --git a/exec/plugin-commands-script-runners/test/runRecursive.ts b/exec/plugin-commands-script-runners/test/runRecursive.ts index 9ff8efe09d..5db25b4cd9 100644 --- a/exec/plugin-commands-script-runners/test/runRecursive.ts +++ b/exec/plugin-commands-script-runners/test/runRecursive.ts @@ -6,8 +6,8 @@ import { filterPkgsBySelectorObjects } from '@pnpm/filter-workspace-packages' import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir' import type { PnpmError } from '@pnpm/error' import { createTestIpcServer } from '@pnpm/test-ipc-server' -import execa from 'execa' -import { sync as writeYamlFile } from 'write-yaml-file' +import { safeExeca as execa } from 'execa' +import { writeYamlFileSync } from 'write-yaml-file' import { DEFAULT_OPTS, REGISTRY_URL } from './utils/index.js' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') @@ -740,7 +740,7 @@ test('`pnpm run -r` should avoid infinite recursion', async () => { }, }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**'], }) diff --git a/exec/plugin-commands-script-runners/test/testRecursive.ts b/exec/plugin-commands-script-runners/test/testRecursive.ts index fea23a3dfd..b8ed0d4adf 100644 --- a/exec/plugin-commands-script-runners/test/testRecursive.ts +++ b/exec/plugin-commands-script-runners/test/testRecursive.ts @@ -4,7 +4,7 @@ import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir' import { run } from '@pnpm/plugin-commands-script-runners' import { preparePackages } from '@pnpm/prepare' import { createTestIpcServer } from '@pnpm/test-ipc-server' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { DEFAULT_OPTS, REGISTRY_URL } from './utils/index.js' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') diff --git a/exec/prepare-package/src/index.ts b/exec/prepare-package/src/index.ts index e08ff3ca31..e201b48568 100644 --- a/exec/prepare-package/src/index.ts +++ b/exec/prepare-package/src/index.ts @@ -6,8 +6,8 @@ import { PnpmError } from '@pnpm/error' import { runLifecycleHook, type RunLifecycleHookOptions } from '@pnpm/lifecycle' import { safeReadPackageJsonFromDir } from '@pnpm/read-package-json' import type { AllowBuild, PackageManifest } from '@pnpm/types' -import rimraf from '@zkochan/rimraf' -import preferredPM from 'preferred-pm' +import { rimraf } from '@zkochan/rimraf' +import { preferredPM } from 'preferred-pm' import { omit } from 'ramda' // We don't run prepublishOnly to prepare the dependency. diff --git a/fetching/binary-fetcher/src/index.ts b/fetching/binary-fetcher/src/index.ts index 4de4798d9b..a4cfeb4338 100644 --- a/fetching/binary-fetcher/src/index.ts +++ b/fetching/binary-fetcher/src/index.ts @@ -6,8 +6,8 @@ import type { BinaryFetcher, FetchFunction, FetchResult } from '@pnpm/fetcher-ba import type { StoreIndex } from '@pnpm/store.index' import { addFilesFromDir } from '@pnpm/worker' import AdmZip from 'adm-zip' -import isSubdir from 'is-subdir' -import renameOverwrite from 'rename-overwrite' +import { isSubdir } from 'is-subdir' +import { renameOverwrite } from 'rename-overwrite' import { temporaryDirectory } from 'tempy' import ssri from 'ssri' diff --git a/fetching/directory-fetcher/test/index.ts b/fetching/directory-fetcher/test/index.ts index 2612c18084..56c63f678c 100644 --- a/fetching/directory-fetcher/test/index.ts +++ b/fetching/directory-fetcher/test/index.ts @@ -3,7 +3,7 @@ import fs from 'fs' import path from 'path' import { fixtures } from '@pnpm/test-fixtures' import { lexCompare } from '@pnpm/util.lex-comparator' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { jest } from '@jest/globals' const debug = jest.fn() @@ -115,9 +115,9 @@ describe('fetch resolves symlinked files to their real locations', () => { const srcPath = f.find('simple-pkg') beforeAll(async () => { process.chdir(f.find('pkg-with-symlinked-dir-and-files')) - rimraf('index.js') + rimrafSync('index.js') fs.symlinkSync(indexJsPath, path.resolve('index.js'), 'file') - rimraf('src') + rimrafSync('src') fs.symlinkSync(srcPath, path.resolve('src'), 'dir') }) test('fetch resolves symlinked files to their real locations', async () => { diff --git a/fetching/git-fetcher/src/index.ts b/fetching/git-fetcher/src/index.ts index dd50df3bd3..585c839c28 100644 --- a/fetching/git-fetcher/src/index.ts +++ b/fetching/git-fetcher/src/index.ts @@ -8,8 +8,8 @@ import { preparePackage } from '@pnpm/prepare-package' import type { StoreIndex } from '@pnpm/store.index' import { addFilesFromDir } from '@pnpm/worker' import { PnpmError } from '@pnpm/error' -import rimraf from '@zkochan/rimraf' -import execa from 'execa' +import { rimraf } from '@zkochan/rimraf' +import { safeExeca as execa } from 'execa' import { URL } from 'url' export interface CreateGitFetcherOptions { @@ -96,5 +96,5 @@ function prefixGitArgs (): string[] { async function execGit (args: string[], opts?: object): Promise { const fullArgs = prefixGitArgs().concat(args || []) const { stdout } = await execa('git', fullArgs, opts) - return stdout + return stdout as string } diff --git a/fetching/git-fetcher/test/index.ts b/fetching/git-fetcher/test/index.ts index f837d49408..231bf66317 100644 --- a/fetching/git-fetcher/test/index.ts +++ b/fetching/git-fetcher/test/index.ts @@ -12,7 +12,7 @@ import { lexCompare } from '@pnpm/util.lex-comparator' return { __esModule: true, ...originalModule, - default: jest.fn(originalModule.default), + safeExeca: jest.fn(originalModule.safeExeca), } }) } @@ -27,7 +27,7 @@ import { lexCompare } from '@pnpm/util.lex-comparator' } const { globalWarn } = await import('@pnpm/logger') -const { default: execa } = await import('execa') +const { safeExeca: execa } = await import('execa') const { createGitFetcher } = await import('@pnpm/git-fetcher') const storeIndexes: StoreIndex[] = [] diff --git a/fs/hard-link-dir/src/index.ts b/fs/hard-link-dir/src/index.ts index d5ec3670bb..dd3f764b60 100644 --- a/fs/hard-link-dir/src/index.ts +++ b/fs/hard-link-dir/src/index.ts @@ -4,8 +4,8 @@ import util from 'util' import fs from 'fs' import { globalWarn } from '@pnpm/logger' import gfs from '@pnpm/graceful-fs' -import { sync as renameOverwrite } from 'rename-overwrite' -import pathTemp from 'path-temp' +import { renameOverwriteSync } from 'rename-overwrite' +import { pathTemp } from 'path-temp' export function hardLinkDir (src: string, destDirs: string[]): void { if (destDirs.length === 0) return @@ -21,7 +21,7 @@ export function hardLinkDir (src: string, destDirs: string[]): void { } _hardLinkDir(src, tempDestDirs, true) for (let i = 0; i < filteredDestDirs.length; i++) { - renameOverwrite(tempDestDirs[i], filteredDestDirs[i]) + renameOverwriteSync(tempDestDirs[i], filteredDestDirs[i]) } } diff --git a/fs/indexed-pkg-importer/src/importIndexedDir.ts b/fs/indexed-pkg-importer/src/importIndexedDir.ts index 1abdaa8305..d2f5adec58 100644 --- a/fs/indexed-pkg-importer/src/importIndexedDir.ts +++ b/fs/indexed-pkg-importer/src/importIndexedDir.ts @@ -3,11 +3,11 @@ import util from 'util' import fsx from 'fs-extra' import path from 'path' import { globalWarn, logger } from '@pnpm/logger' -import { sync as rimraf } from '@zkochan/rimraf' -import { sync as makeEmptyDir } from 'make-empty-dir' +import { rimrafSync } from '@zkochan/rimraf' +import { makeEmptyDirSync } from 'make-empty-dir' import sanitizeFilename from 'sanitize-filename' import { fastPathTemp as pathTemp } from 'path-temp' -import renameOverwrite from 'rename-overwrite' +import { renameOverwriteSync } from 'rename-overwrite' import gfs from '@pnpm/graceful-fs' const filenameConflictsLogger = logger('_filename-conflicts') @@ -31,7 +31,7 @@ export function importIndexedDir ( } } catch (err: unknown) { try { - rimraf(stage) + rimrafSync(stage) } catch {} // eslint-disable-line:no-empty if (util.types.isNativeError(err) && 'code' in err && err.code === 'EEXIST') { const { uniqueFileMap, conflictingFileNames } = getUniqueFileMap(filenames) @@ -62,14 +62,14 @@ They were renamed.`) throw err } try { - renameOverwrite.sync(stage, newDir) + renameOverwriteSync(stage, newDir) } catch (renameErr: unknown) { // When enableGlobalVirtualStore is true, multiple worker threads may import // the same package to the same global store location concurrently. Their // rename operations can race. If the rename fails but the target already // has the expected content, another thread completed the import. try { - rimraf(stage) + rimrafSync(stage) } catch {} // eslint-disable-line:no-empty if (util.types.isNativeError(renameErr) && 'code' in renameErr && (renameErr.code === 'ENOTEMPTY' || renameErr.code === 'EEXIST')) { const firstFile = filenames.keys().next().value @@ -112,7 +112,7 @@ function sanitizeFilenames (filenames: Map): SanitizeFilenamesRe } function tryImportIndexedDir (importFile: ImportFile, newDir: string, filenames: Map): void { - makeEmptyDir(newDir, { recursive: true }) + makeEmptyDirSync(newDir, { recursive: true }) const allDirs = new Set() for (const f of filenames.keys()) { const dir = path.dirname(f) diff --git a/fs/indexed-pkg-importer/test/createImportPackage.test.ts b/fs/indexed-pkg-importer/test/createImportPackage.test.ts index 0adeb20757..bf1c7b4be8 100644 --- a/fs/indexed-pkg-importer/test/createImportPackage.test.ts +++ b/fs/indexed-pkg-importer/test/createImportPackage.test.ts @@ -23,7 +23,7 @@ jest.unstable_mockModule('@pnpm/graceful-fs', () => { } }) jest.unstable_mockModule('path-temp', () => ({ fastPathTemp: (file: string) => `${file}_tmp` })) -jest.unstable_mockModule('rename-overwrite', () => ({ default: { sync: jest.fn() } })) +jest.unstable_mockModule('rename-overwrite', () => ({ renameOverwrite: jest.fn(), renameOverwriteSync: jest.fn() })) jest.unstable_mockModule('fs-extra', () => ({ default: { copySync: jest.fn(), diff --git a/fs/indexed-pkg-importer/test/importIndexedDir.race.test.ts b/fs/indexed-pkg-importer/test/importIndexedDir.race.test.ts index 162351615e..9315b377b9 100644 --- a/fs/indexed-pkg-importer/test/importIndexedDir.race.test.ts +++ b/fs/indexed-pkg-importer/test/importIndexedDir.race.test.ts @@ -9,7 +9,8 @@ import { tempDir } from '@pnpm/prepare' // repeatedly recreating the target, which can't be reproduced deterministically. const renameOverwriteSyncMock = jest.fn() jest.unstable_mockModule('rename-overwrite', () => ({ - default: { sync: renameOverwriteSyncMock }, + renameOverwrite: jest.fn(), + renameOverwriteSync: renameOverwriteSyncMock, })) const { importIndexedDir } = await import('../src/importIndexedDir.js') diff --git a/global/commands/src/globalAdd.ts b/global/commands/src/globalAdd.ts index a9112aa799..4b8c45b696 100644 --- a/global/commands/src/globalAdd.ts +++ b/global/commands/src/globalAdd.ts @@ -13,7 +13,7 @@ import { linkBinsOfPackages } from '@pnpm/link-bins' import { readPackageJsonFromDirRawSync } from '@pnpm/read-package-json' import { removeBin } from '@pnpm/remove-bins' import type { CreateStoreControllerOptions } from '@pnpm/store-connection-manager' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' import symlinkDir from 'symlink-dir' import { installGlobalPackages } from './installGlobalPackages.js' diff --git a/global/commands/src/globalRemove.ts b/global/commands/src/globalRemove.ts index b3a9155b9a..ee3a160a31 100644 --- a/global/commands/src/globalRemove.ts +++ b/global/commands/src/globalRemove.ts @@ -8,7 +8,7 @@ import { type GlobalPackageInfo, } from '@pnpm/global.packages' import { removeBin } from '@pnpm/remove-bins' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' export async function handleGlobalRemove ( opts: { diff --git a/global/commands/src/globalUpdate.ts b/global/commands/src/globalUpdate.ts index 026158e17c..3cc5468d18 100644 --- a/global/commands/src/globalUpdate.ts +++ b/global/commands/src/globalUpdate.ts @@ -12,7 +12,7 @@ import { import { linkBinsOfPackages } from '@pnpm/link-bins' import { removeBin } from '@pnpm/remove-bins' import type { CreateStoreControllerOptions } from '@pnpm/store-connection-manager' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' import symlinkDir from 'symlink-dir' import { installGlobalPackages } from './installGlobalPackages.js' diff --git a/hooks/pnpmfile/src/requireHooks.ts b/hooks/pnpmfile/src/requireHooks.ts index d993503e3c..c7e4627872 100644 --- a/hooks/pnpmfile/src/requireHooks.ts +++ b/hooks/pnpmfile/src/requireHooks.ts @@ -2,7 +2,7 @@ import type { PreResolutionHookContext, PreResolutionHookLogger, CustomResolver, import { PnpmError } from '@pnpm/error' import { hookLogger } from '@pnpm/core-loggers' import { createHashFromMultipleFiles } from '@pnpm/crypto.hash' -import pathAbsolute from 'path-absolute' +import { pathAbsolute } from 'path-absolute' import type { ImportIndexedPackageAsync } from '@pnpm/store-controller-types' import type { ReadPackageHook, BeforePackingHook, BaseManifest } from '@pnpm/types' import type { LockfileObject } from '@pnpm/lockfile.types' diff --git a/lockfile/fs/src/read.ts b/lockfile/fs/src/read.ts index da981f9bbf..2516a39890 100644 --- a/lockfile/fs/src/read.ts +++ b/lockfile/fs/src/read.ts @@ -9,7 +9,7 @@ import { PnpmError } from '@pnpm/error' import { mergeLockfileChanges } from '@pnpm/lockfile.merger' import type { LockfileObject } from '@pnpm/lockfile.types' import type { ProjectId } from '@pnpm/types' -import comverToSemver from 'comver-to-semver' +import { comverToSemver } from 'comver-to-semver' import yaml from 'js-yaml' import semver from 'semver' import stripBom from 'strip-bom' diff --git a/lockfile/fs/src/write.ts b/lockfile/fs/src/write.ts index 867e335c04..9513ced84b 100644 --- a/lockfile/fs/src/write.ts +++ b/lockfile/fs/src/write.ts @@ -2,7 +2,7 @@ import { promises as fs } from 'fs' import path from 'path' import type { LockfileObject, LockfileFile } from '@pnpm/lockfile.types' import { WANTED_LOCKFILE } from '@pnpm/constants' -import rimraf from '@zkochan/rimraf' +import { rimraf } from '@zkochan/rimraf' import yaml from 'js-yaml' import { isEmpty } from 'ramda' import writeFileAtomic from 'write-file-atomic' diff --git a/lockfile/merger/src/index.ts b/lockfile/merger/src/index.ts index 88d19fc792..7eff82c9c2 100644 --- a/lockfile/merger/src/index.ts +++ b/lockfile/merger/src/index.ts @@ -1,6 +1,6 @@ import type { LockfileObject, PackageSnapshot, PackageSnapshots } from '@pnpm/lockfile.types' import type { DepPath, ProjectId } from '@pnpm/types' -import comverToSemver from 'comver-to-semver' +import { comverToSemver } from 'comver-to-semver' import semver from 'semver' export function mergeLockfileChanges (ours: LockfileObject, theirs: LockfileObject): LockfileObject { diff --git a/lockfile/plugin-commands-audit/src/audit.ts b/lockfile/plugin-commands-audit/src/audit.ts index 7584809241..2d6e64663d 100644 --- a/lockfile/plugin-commands-audit/src/audit.ts +++ b/lockfile/plugin-commands-audit/src/audit.ts @@ -9,7 +9,7 @@ import type { Registries } from '@pnpm/types' import { table } from '@zkochan/table' import chalk, { type ChalkInstance } from 'chalk' import { difference, pick, pickBy } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { fix } from './fix.js' import { ignore } from './ignore.js' diff --git a/lockfile/plugin-commands-audit/test/fix.ts b/lockfile/plugin-commands-audit/test/fix.ts index db7879b69b..594e5a6d00 100644 --- a/lockfile/plugin-commands-audit/test/fix.ts +++ b/lockfile/plugin-commands-audit/test/fix.ts @@ -1,7 +1,7 @@ import path from 'path' import { fixtures } from '@pnpm/test-fixtures' import { audit } from '@pnpm/plugin-commands-audit' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import nock from 'nock' import * as responses from './utils/responses/index.js' @@ -34,7 +34,7 @@ test('overrides are added for vulnerable dependencies', async () => { expect(exitCode).toBe(0) expect(output).toMatch(/Run "pnpm install"/) - const manifest = readYamlFile<{ overrides?: Record }>(path.join(tmp, 'pnpm-workspace.yaml')) + const manifest = readYamlFileSync<{ overrides?: Record }>(path.join(tmp, 'pnpm-workspace.yaml')) expect(manifest.overrides?.['axios@<=0.18.0']).toBe('>=0.18.1') expect(manifest.overrides?.['sync-exec@>=0.0.0']).toBeFalsy() }) @@ -89,7 +89,7 @@ test('CVEs found in the allow list are not added as overrides', async () => { expect(exitCode).toBe(0) expect(output).toMatch(/Run "pnpm install"/) - const manifest = readYamlFile<{ overrides?: Record }>(path.join(tmp, 'pnpm-workspace.yaml')) + const manifest = readYamlFileSync<{ overrides?: Record }>(path.join(tmp, 'pnpm-workspace.yaml')) expect(manifest.overrides?.['axios@<=0.18.0']).toBeFalsy() expect(manifest.overrides?.['axios@<0.21.1']).toBeFalsy() expect(manifest.overrides?.['minimist@<0.2.1']).toBeFalsy() diff --git a/lockfile/plugin-commands-audit/test/ignore.ts b/lockfile/plugin-commands-audit/test/ignore.ts index 6d223850db..718b9adc03 100644 --- a/lockfile/plugin-commands-audit/test/ignore.ts +++ b/lockfile/plugin-commands-audit/test/ignore.ts @@ -2,7 +2,7 @@ import path from 'path' import { fixtures } from '@pnpm/test-fixtures' import { audit } from '@pnpm/plugin-commands-audit' import nock from 'nock' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import * as responses from './utils/responses/index.js' const f = fixtures(import.meta.dirname) @@ -35,7 +35,7 @@ test('ignores are added for vulnerable dependencies with no resolutions', async expect(exitCode).toBe(0) expect(output).toContain('2 new vulnerabilities were ignored') - const manifest = readYamlFile(path.join(tmp, 'pnpm-workspace.yaml')) // eslint-disable-line + const manifest = readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml')) // eslint-disable-line const cveList = manifest.auditConfig?.ignoreCves expect(cveList?.length).toBe(2) expect(cveList).toStrictEqual(expect.arrayContaining(['CVE-2017-16115', 'CVE-2017-16024'])) @@ -63,7 +63,7 @@ test('the specified vulnerabilities are ignored', async () => { expect(exitCode).toBe(0) expect(output).toContain('1 new vulnerabilities were ignored') - const manifest = readYamlFile(path.join(tmp, 'pnpm-workspace.yaml')) // eslint-disable-line + const manifest = readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml')) // eslint-disable-line expect(manifest.auditConfig?.ignoreCves).toStrictEqual(['CVE-2017-16115']) }) @@ -120,6 +120,6 @@ test('ignored CVEs are not duplicated', async () => { expect(exitCode).toBe(0) expect(output).toBe('No new vulnerabilities were ignored') - const manifest = readYamlFile(path.join(tmp, 'pnpm-workspace.yaml')) // eslint-disable-line + const manifest = readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml')) // eslint-disable-line expect(manifest.auditConfig?.ignoreCves).toStrictEqual(expect.arrayContaining(existingCves)) }) diff --git a/lockfile/plugin-commands-audit/test/preserveReferenceOverrides.ts b/lockfile/plugin-commands-audit/test/preserveReferenceOverrides.ts index 41a33b7c69..05e1b0a5da 100644 --- a/lockfile/plugin-commands-audit/test/preserveReferenceOverrides.ts +++ b/lockfile/plugin-commands-audit/test/preserveReferenceOverrides.ts @@ -2,7 +2,7 @@ import path from 'path' import { audit } from '@pnpm/plugin-commands-audit' import { fixtures } from '@pnpm/test-fixtures' import { readProjectManifest } from '@pnpm/read-project-manifest' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import nock from 'nock' import * as responses from './utils/responses/index.js' @@ -41,6 +41,6 @@ test('overrides with references (via $) are preserved during audit --fix', async expect(exitCode).toBe(0) expect(output).toMatch(/overrides were added/) - const manifest = readYamlFile(path.join(tmp, 'pnpm-workspace.yaml')) // eslint-disable-line + const manifest = readYamlFileSync(path.join(tmp, 'pnpm-workspace.yaml')) // eslint-disable-line expect(manifest.overrides?.['is-positive']).toBe('$is-positive') }) diff --git a/lockfile/settings-checker/src/calcPatchHashes.ts b/lockfile/settings-checker/src/calcPatchHashes.ts index c19ea40099..2573bfdda3 100644 --- a/lockfile/settings-checker/src/calcPatchHashes.ts +++ b/lockfile/settings-checker/src/calcPatchHashes.ts @@ -1,8 +1,8 @@ -import pMapValues from 'p-map-values' +import { pMapValues } from 'p-map-values' import { createHexHashFromFile } from '@pnpm/crypto.hash' export async function calcPatchHashes (patches: Record): Promise> { - return pMapValues.default(async (patchFilePath) => { + return pMapValues(async (patchFilePath: string) => { return createHexHashFromFile(patchFilePath) }, patches) } diff --git a/packages/git-utils/src/index.ts b/packages/git-utils/src/index.ts index e2801b1832..8104126bda 100644 --- a/packages/git-utils/src/index.ts +++ b/packages/git-utils/src/index.ts @@ -1,4 +1,4 @@ -import execa from 'execa' +import { safeExeca as execa } from 'execa' // git checks logic is from https://github.com/sindresorhus/np/blob/master/source/git-tasks.js @@ -14,7 +14,7 @@ export async function isGitRepo (): Promise { export async function getCurrentBranch (): Promise { try { const { stdout } = await execa('git', ['symbolic-ref', '--short', 'HEAD']) - return stdout + return stdout as string } catch { // Command will fail with code 1 if the HEAD is detached. return null diff --git a/packages/git-utils/test/index.test.ts b/packages/git-utils/test/index.test.ts index 96b0e4f6ac..6e105e4e06 100644 --- a/packages/git-utils/test/index.test.ts +++ b/packages/git-utils/test/index.test.ts @@ -1,5 +1,5 @@ import { temporaryDirectory } from 'tempy' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import fs from 'fs' import path from 'path' import { getCurrentBranch, isGitRepo, isWorkingTreeClean } from '@pnpm/git-utils' diff --git a/packages/make-dedicated-lockfile/src/index.ts b/packages/make-dedicated-lockfile/src/index.ts index c2db7fc50a..f9b677271b 100644 --- a/packages/make-dedicated-lockfile/src/index.ts +++ b/packages/make-dedicated-lockfile/src/index.ts @@ -11,7 +11,7 @@ import { pruneSharedLockfile } from '@pnpm/lockfile.pruner' import { readProjectManifest } from '@pnpm/read-project-manifest' import { DEPENDENCIES_FIELDS, type ProjectId, type ProjectManifest } from '@pnpm/types' import { pickBy } from 'ramda' -import renameOverwrite from 'rename-overwrite' +import { renameOverwrite } from 'rename-overwrite' export async function makeDedicatedLockfile (lockfileDir: string, projectDir: string): Promise { const lockfile = await readWantedLockfile(lockfileDir, { ignoreIncompatible: false }) diff --git a/packages/make-dedicated-lockfile/test/index.ts b/packages/make-dedicated-lockfile/test/index.ts index e3db37bbb2..36c29efc38 100644 --- a/packages/make-dedicated-lockfile/test/index.ts +++ b/packages/make-dedicated-lockfile/test/index.ts @@ -1,5 +1,5 @@ import path from 'path' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { readWantedLockfile } from '@pnpm/lockfile.fs' import { fixtures } from '@pnpm/test-fixtures' import { makeDedicatedLockfile } from '../lib/index.js' diff --git a/packages/plugin-commands-doctor/src/doctor.ts b/packages/plugin-commands-doctor/src/doctor.ts index 836ee254ac..f3ae279297 100644 --- a/packages/plugin-commands-doctor/src/doctor.ts +++ b/packages/plugin-commands-doctor/src/doctor.ts @@ -1,4 +1,4 @@ -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { docsUrl } from '@pnpm/cli-utils' import { logger } from '@pnpm/logger' import type { Config } from '@pnpm/config' diff --git a/packages/plugin-commands-init/src/init.ts b/packages/plugin-commands-init/src/init.ts index a5ba5b5fc5..259c5fb97f 100644 --- a/packages/plugin-commands-init/src/init.ts +++ b/packages/plugin-commands-init/src/init.ts @@ -8,7 +8,7 @@ import { sortKeysByPriority } from '@pnpm/object.key-sorting' import type { ProjectManifest } from '@pnpm/types' import { writeProjectManifest } from '@pnpm/write-project-manifest' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { parseRawConfig } from './utils.js' export const rcOptionsTypes = cliOptionsTypes diff --git a/packages/plugin-commands-setup/src/setup.ts b/packages/plugin-commands-setup/src/setup.ts index c0739dd556..5a1892dfc4 100644 --- a/packages/plugin-commands-setup/src/setup.ts +++ b/packages/plugin-commands-setup/src/setup.ts @@ -9,7 +9,7 @@ import { type ConfigReport, type PathExtenderReport, } from '@pnpm/os.env.path-extender' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' export const rcOptionsTypes = (): Record => ({}) diff --git a/patching/plugin-commands-patching/src/getPatchedDependency.ts b/patching/plugin-commands-patching/src/getPatchedDependency.ts index 524ceb0ea3..0af0134a08 100644 --- a/patching/plugin-commands-patching/src/getPatchedDependency.ts +++ b/patching/plugin-commands-patching/src/getPatchedDependency.ts @@ -5,7 +5,7 @@ import { readCurrentLockfile, type TarballResolution } from '@pnpm/lockfile.fs' import { nameVerFromPkgSnapshot } from '@pnpm/lockfile.utils' import { PnpmError } from '@pnpm/error' import { isGitHostedPkgUrl } from '@pnpm/pick-fetcher' -import realpathMissing from 'realpath-missing' +import { realpathMissing } from 'realpath-missing' import semver from 'semver' import type { Config } from '@pnpm/config' diff --git a/patching/plugin-commands-patching/src/patch.ts b/patching/plugin-commands-patching/src/patch.ts index 64a9816dbd..856fc781b2 100644 --- a/patching/plugin-commands-patching/src/patch.ts +++ b/patching/plugin-commands-patching/src/patch.ts @@ -8,7 +8,7 @@ import type { CreateStoreControllerOptions, } from '@pnpm/store-connection-manager' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import chalk from 'chalk' import terminalLink from 'terminal-link' import { PnpmError } from '@pnpm/error' diff --git a/patching/plugin-commands-patching/src/patchCommit.ts b/patching/plugin-commands-patching/src/patchCommit.ts index 18e795d74c..f9bee6e03a 100644 --- a/patching/plugin-commands-patching/src/patchCommit.ts +++ b/patching/plugin-commands-patching/src/patchCommit.ts @@ -13,10 +13,10 @@ import type { ProjectRootDir } from '@pnpm/types' import { glob } from 'tinyglobby' import normalizePath from 'normalize-path' import { pick, equals } from 'ramda' -import execa from 'safe-execa' +import { safeExeca as execa } from 'safe-execa' import escapeStringRegexp from 'escape-string-regexp' -import makeEmptyDir from 'make-empty-dir' -import renderHelp from 'render-help' +import { makeEmptyDir } from 'make-empty-dir' +import { renderHelp } from 'render-help' import { type WritePackageOptions, writePackage } from './writePackage.js' import { type ParseWantedDependencyResult, parseWantedDependency } from '@pnpm/parse-wanted-dependency' import { type GetPatchedDependencyOptions, getVersionsFromLockfile } from './getPatchedDependency.js' @@ -174,11 +174,11 @@ async function diffFolders (folderA: string, folderB: string): Promise { }, stripFinalNewline: false, }) - stdout = result.stdout - stderr = result.stderr + stdout = result.stdout as string + stderr = result.stderr as string } catch (err: any) { // eslint-disable-line - stdout = err.stdout - stderr = err.stderr + stdout = err.stdout as string + stderr = err.stderr as string } // we cannot rely on exit code, because --no-index implies --exit-code // i.e. git diff will exit with 1 if there were differences diff --git a/patching/plugin-commands-patching/src/patchRemove.ts b/patching/plugin-commands-patching/src/patchRemove.ts index 1d6a7fd3df..17e04518b6 100644 --- a/patching/plugin-commands-patching/src/patchRemove.ts +++ b/patching/plugin-commands-patching/src/patchRemove.ts @@ -4,7 +4,7 @@ import { docsUrl } from '@pnpm/cli-utils' import { install } from '@pnpm/plugin-commands-installation' import { type Config, types as allTypes } from '@pnpm/config' import { PnpmError } from '@pnpm/error' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import enquirer from 'enquirer' import { pick } from 'ramda' import { updatePatchedDependencies } from './updatePatchedDependencies.js' diff --git a/patching/plugin-commands-patching/test/patch.test.ts b/patching/plugin-commands-patching/test/patch.test.ts index b45bceb896..5f3985bb39 100644 --- a/patching/plugin-commands-patching/test/patch.test.ts +++ b/patching/plugin-commands-patching/test/patch.test.ts @@ -4,7 +4,7 @@ import path from 'path' import { prepare, preparePackages, tempDir } from '@pnpm/prepare' import { install } from '@pnpm/plugin-commands-installation' import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' import type { PatchCommandOptions, PatchRemoveCommandOptions } from '@pnpm/plugin-commands-patching' import { temporaryDirectory } from 'tempy' @@ -1000,7 +1000,7 @@ describe('patch and commit in workspaces', () => { dir: process.cwd(), storeDir, } - writeYamlFile('pnpm-workspace.yaml', { packages: ['project-1', 'project-2'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['project-1', 'project-2'] }) }) test('patch commit should work in workspaces', async () => { diff --git a/pkg-manager/core/src/install/index.ts b/pkg-manager/core/src/install/index.ts index 1ba9870b72..d341f2e267 100644 --- a/pkg-manager/core/src/install/index.ts +++ b/pkg-manager/core/src/install/index.ts @@ -75,7 +75,7 @@ import type { ProjectRootDir, } from '@pnpm/types' import { lexCompare } from '@pnpm/util.lex-comparator' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' import pLimit from 'p-limit' import { map as mapValues, clone, isEmpty, pipeWith, props } from 'ramda' import { parseWantedDependencies } from '../parseWantedDependencies.js' diff --git a/pkg-manager/core/src/install/validateModules.ts b/pkg-manager/core/src/install/validateModules.ts index deb92e2634..938ba7defb 100644 --- a/pkg-manager/core/src/install/validateModules.ts +++ b/pkg-manager/core/src/install/validateModules.ts @@ -11,7 +11,7 @@ import { type Registries, type ProjectRootDir, } from '@pnpm/types' -import rimraf from '@zkochan/rimraf' +import { rimraf } from '@zkochan/rimraf' import enquirer from 'enquirer' import { equals } from 'ramda' import { checkCompatibility } from './checkCompatibility/index.js' diff --git a/pkg-manager/core/test/breakingChanges.ts b/pkg-manager/core/test/breakingChanges.ts index 0d38e2d74e..59bb7e1ea1 100644 --- a/pkg-manager/core/test/breakingChanges.ts +++ b/pkg-manager/core/test/breakingChanges.ts @@ -4,7 +4,7 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import type { PnpmError } from '@pnpm/error' import { prepareEmpty, preparePackages } from '@pnpm/prepare' import { addDependenciesToPackage, install } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { isCI } from 'ci-info' import { testDefaults } from './utils/index.js' @@ -42,7 +42,7 @@ test("don't fail on non-compatible node_modules when forced in a workspace", asy process.chdir('pkg') const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['is-positive@1.0.0'], testDefaults({ lockfileDir: path.resolve('..') })) - rimraf('node_modules') + rimrafSync('node_modules') process.chdir('..') diff --git a/pkg-manager/core/test/brokenLockfileIntegrity.ts b/pkg-manager/core/test/brokenLockfileIntegrity.ts index c9e10ba8c9..e08ecff50d 100644 --- a/pkg-manager/core/test/brokenLockfileIntegrity.ts +++ b/pkg-manager/core/test/brokenLockfileIntegrity.ts @@ -3,14 +3,14 @@ import type { TarballResolution } from '@pnpm/lockfile.fs' import { prepareEmpty } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' import type { ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { jest } from '@jest/globals' import { clone } from 'ramda' import { addDependenciesToPackage, mutateModulesInSingleProject, } from '@pnpm/core' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { testDefaults } from './utils/index.js' test('installation breaks if the lockfile contains the wrong checksum', async () => { @@ -24,12 +24,12 @@ test('installation breaks if the lockfile contains the wrong checksum', async () testDefaults() ) - rimraf('node_modules') + rimrafSync('node_modules') const corruptedLockfile = project.readLockfile() const correctLockfile = clone(corruptedLockfile) // breaking the lockfile ;(corruptedLockfile.packages['@pnpm.e2e/pkg-with-1-dep@100.0.0'].resolution as TarballResolution).integrity = (corruptedLockfile.packages['@pnpm.e2e/dep-of-pkg-with-1-dep@100.0.0'].resolution as TarballResolution).integrity - writeYamlFile(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) + writeYamlFileSync(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) await expect(mutateModulesInSingleProject({ manifest, @@ -46,9 +46,9 @@ test('installation breaks if the lockfile contains the wrong checksum', async () expect(project.readLockfile()).toStrictEqual(correctLockfile) // Breaking the lockfile again - writeYamlFile(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) + writeYamlFileSync(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, @@ -74,7 +74,7 @@ test('installation breaks if the lockfile contains the wrong checksum and the st const correctIntegrity = (corruptedLockfile.packages['@pnpm.e2e/pkg-with-1-dep@100.0.0'].resolution as TarballResolution).integrity // breaking the lockfile ;(corruptedLockfile.packages['@pnpm.e2e/pkg-with-1-dep@100.0.0'].resolution as TarballResolution).integrity = 'sha512-pl8WtlGAnoIQ7gPxT187/YwhKRnsFBR4h0YY+v0FPQjT5WPuZbI9dPRaKWgKBFOqWHylJ8EyPy34V5u9YArfng==' - writeYamlFile(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) + writeYamlFileSync(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) await expect( mutateModulesInSingleProject({ @@ -96,9 +96,9 @@ test('installation breaks if the lockfile contains the wrong checksum and the st } // Breaking the lockfile again - writeYamlFile(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) + writeYamlFileSync(WANTED_LOCKFILE, corruptedLockfile, { lineWidth: 1000 }) - rimraf('node_modules') + rimrafSync('node_modules') const reporter = jest.fn() await mutateModulesInSingleProject({ diff --git a/pkg-manager/core/test/hoistedNodeLinker/install.ts b/pkg-manager/core/test/hoistedNodeLinker/install.ts index 7f4eb7464f..ea4d4d8ad7 100644 --- a/pkg-manager/core/test/hoistedNodeLinker/install.ts +++ b/pkg-manager/core/test/hoistedNodeLinker/install.ts @@ -4,9 +4,9 @@ import { addDependenciesToPackage, install, mutateModules, mutateModulesInSingle import { prepareEmpty, preparePackages } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' import type { ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { loadJsonFileSync } from 'load-json-file' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import symlinkDir from 'symlink-dir' import { testDefaults } from '../utils/index.js' @@ -29,10 +29,10 @@ test('installing with hoisted node-linker', async () => { expect(fs.realpathSync('node_modules/ms')).toEqual(path.resolve('node_modules/ms')) expect(fs.existsSync('node_modules/send/node_modules/ms')).toBeTruthy() - expect(readYamlFile<{ nodeLinker: string }>('node_modules/.modules.yaml').nodeLinker).toBe('hoisted') + expect(readYamlFileSync<{ nodeLinker: string }>('node_modules/.modules.yaml').nodeLinker).toBe('hoisted') // If a package from node_modules is removed, it should be re-added. - rimraf('node_modules/send') + rimrafSync('node_modules/send') await install(manifest, testDefaults({ nodeLinker: 'hoisted', })) diff --git a/pkg-manager/core/test/install/auth.ts b/pkg-manager/core/test/install/auth.ts index b346bd05da..878b51739d 100644 --- a/pkg-manager/core/test/install/auth.ts +++ b/pkg-manager/core/test/install/auth.ts @@ -2,7 +2,7 @@ import path from 'path' import { prepareEmpty } from '@pnpm/prepare' import { addUser, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { addDependenciesToPackage, install } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' const skipOnNode17 = ['v14', 'v16'].includes(process.version.split('.')[0]) ? test : test.skip @@ -30,8 +30,8 @@ test('a package that need authentication', async () => { // should work when a lockfile is available // and the registry in .npmrc is not the same as the one in lockfile - rimraf('node_modules') - rimraf(path.join('..', '.store')) + rimrafSync('node_modules') + rimrafSync(path.join('..', '.store')) authConfig = { [`//localhost:${REGISTRY_MOCK_PORT}/:_authToken`]: data.token, @@ -118,8 +118,8 @@ test('a scoped package that need authentication specific to scope', async () => project.has('@private/foo') // should work when a lockfile is available - rimraf('node_modules') - rimraf(path.join('..', '.store')) + rimrafSync('node_modules') + rimrafSync(path.join('..', '.store')) // Recreating options to have a new storeController with clean cache opts = testDefaults({}, { @@ -158,8 +158,8 @@ test('a scoped package that need legacy authentication specific to scope', async project.has('@private/foo') // should work when a lockfile is available - rimraf('node_modules') - rimraf(path.join('..', '.store')) + rimrafSync('node_modules') + rimrafSync(path.join('..', '.store')) // Recreating options to have a new storeController with clean cache opts = testDefaults({}, { @@ -226,9 +226,9 @@ skipOnNode17('a package that need authentication reuses authorization tokens for const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['@pnpm.e2e/needs-auth'], opts) - rimraf('node_modules') - rimraf(path.join('..', '.registry')) - rimraf(path.join('..', '.store')) + rimrafSync('node_modules') + rimrafSync(path.join('..', '.registry')) + rimrafSync(path.join('..', '.store')) // Recreating options to clean store cache opts = testDefaults({ diff --git a/pkg-manager/core/test/install/autoInstallPeers.ts b/pkg-manager/core/test/install/autoInstallPeers.ts index 78c66ef80f..0cc8386e24 100644 --- a/pkg-manager/core/test/install/autoInstallPeers.ts +++ b/pkg-manager/core/test/install/autoInstallPeers.ts @@ -4,7 +4,7 @@ import { addDependenciesToPackage, install, mutateModules, mutateModulesInSingle import { prepareEmpty, preparePackages } from '@pnpm/prepare' import { addDistTag, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import type { ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { createPeerDepGraphHash } from '@pnpm/dependency-path' import { testDefaults } from '../utils/index.js' @@ -211,7 +211,7 @@ test('automatically install root peer dependencies', async () => { } // Automatically install the peer dependency when the lockfile is up to date - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ autoInstallPeers: true, frozenLockfile: true })) diff --git a/pkg-manager/core/test/install/bunRuntime.ts b/pkg-manager/core/test/install/bunRuntime.ts index 45778cadb7..6ac1258e1e 100644 --- a/pkg-manager/core/test/install/bunRuntime.ts +++ b/pkg-manager/core/test/install/bunRuntime.ts @@ -2,8 +2,8 @@ import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants' import { prepareEmpty } from '@pnpm/prepare' import { addDependenciesToPackage, install } from '@pnpm/core' import { getIntegrity } from '@pnpm/registry-mock' -import { sync as rimraf } from '@zkochan/rimraf' -import { sync as writeYamlFile } from 'write-yaml-file' +import { rimrafSync } from '@zkochan/rimraf' +import { writeYamlFileSync } from 'write-yaml-file' import { testDefaults } from '../utils/index.js' const RESOLUTIONS = [ @@ -159,7 +159,7 @@ test('installing Bun runtime', async () => { }, }) - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true }, { offline: true, // We want to verify that Bun is resolved from cache. })) @@ -220,7 +220,7 @@ test('installing Bun runtime fails if offline mode is used and Bun not found loc test('installing Bun runtime fails if integrity check fails', async () => { prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { settings: { autoInstallPeers: true, excludeLinksFromLockfile: false, diff --git a/pkg-manager/core/test/install/dedupeDirectDeps.ts b/pkg-manager/core/test/install/dedupeDirectDeps.ts index 961603e3ef..0b8faf23e3 100644 --- a/pkg-manager/core/test/install/dedupeDirectDeps.ts +++ b/pkg-manager/core/test/install/dedupeDirectDeps.ts @@ -3,7 +3,7 @@ import path from 'path' import { preparePackages } from '@pnpm/prepare' import { mutateModules, type MutatedProject } from '@pnpm/core' import type { ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' test('dedupe direct dependencies', async () => { @@ -170,7 +170,7 @@ test('dedupe direct dependencies after public hoisting', async () => { expect(fs.existsSync('project-2/node_modules')).toBeFalsy() // Test the same with headless install - rimraf('node_modules') + rimrafSync('node_modules') await mutateModules(importers, { ...opts, frozenLockfile: true }) projects['project-1'].has('@pnpm.e2e/dep-of-pkg-with-1-dep') projects['project-2'].hasNot('@pnpm.e2e/dep-of-pkg-with-1-dep') diff --git a/pkg-manager/core/test/install/denoRuntime.ts b/pkg-manager/core/test/install/denoRuntime.ts index 0d76182903..396d4bb47e 100644 --- a/pkg-manager/core/test/install/denoRuntime.ts +++ b/pkg-manager/core/test/install/denoRuntime.ts @@ -2,9 +2,9 @@ import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants' import { prepareEmpty } from '@pnpm/prepare' import { addDependenciesToPackage, install } from '@pnpm/core' import { getIntegrity } from '@pnpm/registry-mock' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import nock from 'nock' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { testDefaults } from '../utils/index.js' afterEach(() => { @@ -157,7 +157,7 @@ test('installing Deno runtime', async () => { }, }) - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true }, { offline: true, // We want to verify that Deno is resolved from cache. })) @@ -221,7 +221,7 @@ test('installing Deno runtime fails if offline mode is used and Deno not found l test('installing Deno runtime fails if integrity check fails', async () => { prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { settings: { autoInstallPeers: true, excludeLinksFromLockfile: false, diff --git a/pkg-manager/core/test/install/excludeLinksFromLockfile.ts b/pkg-manager/core/test/install/excludeLinksFromLockfile.ts index 350be79a79..7a7b0170c5 100644 --- a/pkg-manager/core/test/install/excludeLinksFromLockfile.ts +++ b/pkg-manager/core/test/install/excludeLinksFromLockfile.ts @@ -13,9 +13,9 @@ import type { ProjectRootDir, ProjectId } from '@pnpm/types' import { prepareEmpty, preparePackages, tempDir } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' import { fixtures } from '@pnpm/test-fixtures' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import normalizePath from 'normalize-path' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { writeJsonFileSync } from 'write-json-file' import { testDefaults } from '../utils/index.js' @@ -79,16 +79,16 @@ test('links are not added to the lockfile when excludeLinksFromLockfile is true' }, ] await mutateModules(importers, testDefaults({ allProjects, excludeLinksFromLockfile: true })) - const lockfile: LockfileFile = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileFile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile.importers?.['project-1'].dependencies?.['external-1']).toBeUndefined() expect(lockfile.importers?.['project-2'].dependencies?.['external-2']).toBeUndefined() expect(fs.existsSync(path.resolve('project-1/node_modules/external-1/index.js'))).toBeTruthy() expect(fs.existsSync(path.resolve('project-2/node_modules/external-2/index.js'))).toBeTruthy() - rimraf('node_modules') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') await mutateModules(importers, testDefaults({ allProjects, excludeLinksFromLockfile: true, frozenLockfile: true })) expect(lockfile.importers?.['project-1'].dependencies?.['external-1']).toBeUndefined() @@ -97,9 +97,9 @@ test('links are not added to the lockfile when excludeLinksFromLockfile is true' expect(fs.existsSync(path.resolve('project-1/node_modules/external-1/index.js'))).toBeTruthy() expect(fs.existsSync(path.resolve('project-2/node_modules/external-2/index.js'))).toBeTruthy() - rimraf('node_modules') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') await mutateModules(importers, testDefaults({ allProjects, excludeLinksFromLockfile: true, frozenLockfile: false, preferFrozenLockfile: false })) expect(lockfile.importers?.['project-1'].dependencies?.['external-1']).toBeUndefined() @@ -137,7 +137,7 @@ test('local file using absolute path is correctly installed on repeat install', } expect(manifest.dependencies).toStrictEqual(expectedSpecs) - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true, excludeLinksFromLockfile: true })) { const m = project.requireModule('local-pkg') @@ -213,7 +213,7 @@ test('update the lockfile when a new project is added to the workspace but do no }) await mutateModules(importers, testDefaults({ allProjects, excludeLinksFromLockfile: true, frozenLockfile: true })) - const lockfile: LockfileObject = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileObject = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.importers)).toStrictEqual(['project-1', 'project-2']) expect(Object.keys(lockfile.importers['project-1' as ProjectId].dependencies ?? {})).toStrictEqual(['is-positive']) }) @@ -287,7 +287,7 @@ test('links resolved from workspace protocol dependencies are not removed', asyn lockfileOnly: true, })) - const lockfile: LockfileFile = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileFile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile.importers?.['project-1'].dependencies?.['project-2']).toStrictEqual({ specifier: 'workspace:*', version: 'link:../project-2', diff --git a/pkg-manager/core/test/install/fixLockfile.ts b/pkg-manager/core/test/install/fixLockfile.ts index 6603929269..6db19ba879 100644 --- a/pkg-manager/core/test/install/fixLockfile.ts +++ b/pkg-manager/core/test/install/fixLockfile.ts @@ -2,8 +2,8 @@ import path from 'path' import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants' import { prepareEmpty, preparePackages } from '@pnpm/prepare' import { install, type MutatedProject, mutateModules } from '@pnpm/core' -import { sync as writeYamlFile } from 'write-yaml-file' -import { sync as readYamlFile } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import type { LockfileFile, PackageSnapshots } from '@pnpm/lockfile.fs' import type { ProjectRootDir } from '@pnpm/types' import { testDefaults } from '../utils/index.js' @@ -11,7 +11,7 @@ import { testDefaults } from '../utils/index.js' test('fix broken lockfile with --fix-lockfile', async () => { prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { dependencies: { '@types/semver': { specifier: '^5.3.31', @@ -49,7 +49,7 @@ test('fix broken lockfile with --fix-lockfile', async () => { }, }, testDefaults({ fixLockfile: true })) - const lockfile: LockfileFile = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileFile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.packages as PackageSnapshots)).toHaveLength(2) expect(lockfile.packages?.['@types/semver@5.3.31']).toBeTruthy() expect(lockfile.packages?.['@types/semver@5.3.31']?.resolution).toEqual({ @@ -97,7 +97,7 @@ test('--fix-lockfile should preserve all locked dependencies version', async () * and @babel/runtime-corejs3@7.15.3 depends on core-js-pure@3.17.2 while @babel/runtime-corejs3@7.15.4 depends on core-js-pure@3.17.3 * --fix-lockfile should not change the locked dependency version and only adding missing fields in this scene */ - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { lockfileVersion: LOCKFILE_VERSION, importers: { '.': {}, @@ -203,7 +203,7 @@ test('--fix-lockfile should preserve all locked dependencies version', async () ], })) - const lockfile: LockfileFile = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileFile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.packages as PackageSnapshots)).toHaveLength(5) diff --git a/pkg-manager/core/test/install/fromRepo.ts b/pkg-manager/core/test/install/fromRepo.ts index 91bcd9a303..6ba0a8a5fd 100644 --- a/pkg-manager/core/test/install/fromRepo.ts +++ b/pkg-manager/core/test/install/fromRepo.ts @@ -9,7 +9,7 @@ import { } from '@pnpm/core' import { fixtures } from '@pnpm/test-fixtures' import { assertProject } from '@pnpm/assert-project' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { isCI } from 'ci-info' import nock from 'nock' import { jest } from '@jest/globals' @@ -235,15 +235,15 @@ test.skip('from a github repo that needs to be built. isolated node linker is us project.hasNot('@pnpm.e2e/prepare-script-works/prepare.txt') - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ preferFrozenLockfile: false })) project.has('@pnpm.e2e/prepare-script-works/prepare.txt') - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true })) project.has('@pnpm.e2e/prepare-script-works/prepare.txt') - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true, ignoreScripts: true }, { ignoreScripts: true })) project.hasNot('@pnpm.e2e/prepare-script-works/prepare.txt') }) @@ -259,15 +259,15 @@ test.skip('from a github repo that needs to be built. hoisted node linker is us project.hasNot('@pnpm.e2e/prepare-script-works/prepare.txt') - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ preferFrozenLockfile: false, nodeLinker: 'hoisted' })) project.has('@pnpm.e2e/prepare-script-works/prepare.txt') - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true, nodeLinker: 'hoisted' })) project.has('@pnpm.e2e/prepare-script-works/prepare.txt') - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true, ignoreScripts: true, nodeLinker: 'hoisted' }, { ignoreScripts: true })) project.hasNot('@pnpm.e2e/prepare-script-works/prepare.txt') }) diff --git a/pkg-manager/core/test/install/gitBranchLockfile.test.ts b/pkg-manager/core/test/install/gitBranchLockfile.test.ts index 2630778a18..514d6c2bd3 100644 --- a/pkg-manager/core/test/install/gitBranchLockfile.test.ts +++ b/pkg-manager/core/test/install/gitBranchLockfile.test.ts @@ -5,7 +5,7 @@ import { testDefaults } from '../utils/index.js' import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants' import type { ProjectRootDir, ProjectManifest } from '@pnpm/types' import { jest } from '@jest/globals' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' jest.unstable_mockModule('@pnpm/git-utils', () => ({ getCurrentBranch: jest.fn() })) @@ -137,7 +137,7 @@ test('install with --merge-git-branch-lockfiles', async () => { jest.mocked(getCurrentBranch).mockReturnValue(Promise.resolve(branchName)) const otherLockfilePath: string = path.resolve('pnpm-lock.other.yaml') - writeYamlFile(otherLockfilePath, { + writeYamlFileSync(otherLockfilePath, { whatever: 'whatever', }) @@ -162,7 +162,7 @@ test('install with --merge-git-branch-lockfiles when merged lockfile is up to da const project = prepareEmpty() // @types/semver installed in the main branch - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { importers: { '.': { dependencies: { @@ -224,7 +224,7 @@ test('install with --merge-git-branch-lockfiles when merged lockfile is up to da 'is-positive@3.1.0': {}, }, } - writeYamlFile(otherLockfilePath, otherLockfileContent, { lineWidth: 1000 }) + writeYamlFileSync(otherLockfilePath, otherLockfileContent, { lineWidth: 1000 }) // the other branch merged to the main branch const projectManifest: ProjectManifest = { diff --git a/pkg-manager/core/test/install/globalVirtualStore.ts b/pkg-manager/core/test/install/globalVirtualStore.ts index b4108ff580..f031bf6aa4 100644 --- a/pkg-manager/core/test/install/globalVirtualStore.ts +++ b/pkg-manager/core/test/install/globalVirtualStore.ts @@ -7,7 +7,7 @@ import type { PackageFilesIndex } from '@pnpm/store.cafs' import { StoreIndex, storeIndexKey } from '@pnpm/store.index' import { getIntegrity } from '@pnpm/registry-mock' import type { ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' const storeIndexes: StoreIndex[] = [] @@ -38,8 +38,8 @@ test('using a global virtual store', async () => { expect(fs.existsSync(path.join(globalVirtualStoreDir, '@pnpm.e2e/pkg-with-1-dep/100.0.0', files[0], 'node_modules/@pnpm.e2e/dep-of-pkg-with-1-dep/package.json'))).toBeTruthy() } - rimraf('node_modules') - rimraf(globalVirtualStoreDir) + rimrafSync('node_modules') + rimrafSync(globalVirtualStoreDir) await install(manifest, testDefaults({ enableGlobalVirtualStore: true, virtualStoreDir: globalVirtualStoreDir, @@ -73,7 +73,7 @@ test('reinstall from warm global virtual store after deleting node_modules', asy await install(manifest, opts) // Delete only node_modules, keep the global virtual store warm - rimraf('node_modules') + rimrafSync('node_modules') expect(fs.existsSync(globalVirtualStoreDir)).toBeTruthy() // Spy on fetchPackage to verify the fast-path skips fetching @@ -141,7 +141,7 @@ test('GVS hashes are engine-agnostic for packages not in allowBuilds', async () virtualStoreDir: gvsDir1, allowBuilds: {}, })) - rimraf('node_modules') + rimrafSync('node_modules') // Scenario 2: Dependency allowed to build — parent hash becomes engine-specific // because it transitively depends on a package that is allowed to build @@ -181,7 +181,7 @@ test('GVS hashes are stable when allowBuilds targets an unrelated package', asyn virtualStoreDir: gvsDir1, allowBuilds: {}, })) - rimraf('node_modules') + rimrafSync('node_modules') // Scenario 2: An unrelated package allowed to build // This should NOT affect hashes of @pnpm.e2e/pkg-with-1-dep or its deps @@ -337,12 +337,12 @@ test('GVS rebuilds successfully after simulated build failure cleanup', async () expect(fs.existsSync(path.join(hashDir, 'node_modules/@pnpm.e2e/pre-and-postinstall-scripts-example/generated-by-postinstall.js'))).toBeTruthy() // Step 2: Simulate a previous build failure by removing the GVS hash directory - rimraf(hashDir) + rimrafSync(hashDir) expect(fs.existsSync(hashDir)).toBeFalsy() // Step 3: Remove node_modules and reinstall with frozenLockfile // The GVS fast path should NOT kick in because the hash dir is gone - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ enableGlobalVirtualStore: true, virtualStoreDir: globalVirtualStoreDir, @@ -390,7 +390,7 @@ test('GVS .pnpm-needs-build marker triggers re-import on next install', async () expect(fs.existsSync(path.join(pkgInGvs, '.pnpm-needs-build'))).toBeTruthy() // Remove node_modules to force a re-install - rimraf('node_modules') + rimrafSync('node_modules') // Step 3: Reinstall — the GVS fast path should detect the .pnpm-needs-build // marker and force a re-fetch, re-import, and re-build. diff --git a/pkg-manager/core/test/install/hoist.ts b/pkg-manager/core/test/install/hoist.ts index 379b002916..3810247c1a 100644 --- a/pkg-manager/core/test/install/hoist.ts +++ b/pkg-manager/core/test/install/hoist.ts @@ -10,12 +10,12 @@ import { mutateModulesInSingleProject, } from '@pnpm/core' import type { DepPath, ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' -import resolveLinkTarget from 'resolve-link-target' +import { rimrafSync } from '@zkochan/rimraf' +import { resolveLinkTarget } from 'resolve-link-target' import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants' import { addDistTag } from '@pnpm/registry-mock' import symlinkDir from 'symlink-dir' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { testDefaults } from '../utils/index.js' test('should hoist dependencies', async () => { @@ -407,8 +407,8 @@ test('hoist-pattern: hoist all dependencies to the virtual store node_modules', projects['package'].hasNot('@pnpm.e2e/foo') projects['package'].hasNot('@pnpm.e2e/bar') - rimraf('node_modules') - rimraf('package/node_modules') + rimrafSync('node_modules') + rimrafSync('package/node_modules') await mutateModules(mutatedProjects, testDefaults({ allProjects, frozenLockfile: true, hoistPattern: '*' })) @@ -562,7 +562,7 @@ test('hoisting should not create a broken symlink to a skipped optional dependen expect(rootModules.readCurrentLockfile()).toStrictEqual(rootModules.readLockfile()) // Verifying the same with headless installation - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ publicHoistPattern: '*' })) @@ -580,7 +580,7 @@ test('the hoisted packages should not override the bin files of the direct depen expect(cmd).toContain('/hello-world-js-bin-parent/') } - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ fastUnpack: false, frozenLockfile: true, publicHoistPattern: '*' })) @@ -643,7 +643,7 @@ test('hoist packages which is in the dependencies tree of the selected projects' * when partial install project@3.0.0, is-positive@3.0.0 always should be hoisted * instead of using is-positive@2.0.0 and does not hoist anything */ - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { lockfileVersion: LOCKFILE_VERSION, importers: { '.': {}, @@ -701,7 +701,7 @@ test('only hoist packages which is in the dependencies tree of the selected proj }, ]) - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { lockfileVersion: LOCKFILE_VERSION, importers: { '.': {}, @@ -909,7 +909,7 @@ test('hoistWorkspacePackages should hoist all workspace projects', async () => { projects['package'].hasNot('@pnpm.e2e/foo') projects['package'].hasNot('@pnpm.e2e/bar') - rimraf('node_modules') + rimrafSync('node_modules') await mutateModules(mutatedProjects, testDefaults({ allProjects, frozenLockfile: true, diff --git a/pkg-manager/core/test/install/injectLocalPackages.ts b/pkg-manager/core/test/install/injectLocalPackages.ts index c2772053c3..fb16c25e93 100644 --- a/pkg-manager/core/test/install/injectLocalPackages.ts +++ b/pkg-manager/core/test/install/injectLocalPackages.ts @@ -4,7 +4,7 @@ import { assertProject } from '@pnpm/assert-project' import { type MutatedProject, mutateModules, type ProjectOptions } from '@pnpm/core' import { preparePackages } from '@pnpm/prepare' import type { ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { writeJsonFileSync } from 'write-json-file' import { testDefaults } from '../utils/index.js' @@ -157,10 +157,10 @@ test('inject local packages', async () => { expect(modulesState?.injectedDeps?.['project-1'][1]).toContain(`node_modules${path.sep}.pnpm`) } - rimraf('node_modules') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') - rimraf('project-3/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') + rimrafSync('project-3/node_modules') await mutateModules(importers, testDefaults({ autoInstallPeers: false, @@ -353,10 +353,10 @@ test('inject local packages using the injectWorkspacePackages setting', async () expect(modulesState?.injectedDeps?.['project-1'][1]).toContain(`node_modules${path.sep}.pnpm`) } - rimraf('node_modules') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') - rimraf('project-3/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') + rimrafSync('project-3/node_modules') await mutateModules(importers, testDefaults({ autoInstallPeers: false, @@ -559,10 +559,10 @@ test('inject local packages declared via file protocol', async () => { expect(modulesState?.injectedDeps?.['project-1'][1]).toContain(`node_modules${path.sep}.pnpm`) } - rimraf('node_modules') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') - rimraf('project-3/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') + rimrafSync('project-3/node_modules') await mutateModules(importers, testDefaults({ autoInstallPeers: false, @@ -749,10 +749,10 @@ test('inject local packages when the file protocol is used', async () => { expect(modulesState?.injectedDeps?.['project-1'][1]).toContain(`node_modules${path.sep}.pnpm`) } - rimraf('node_modules') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') - rimraf('project-3/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') + rimrafSync('project-3/node_modules') await mutateModules(importers, testDefaults({ autoInstallPeers: false, @@ -903,10 +903,10 @@ test('inject local packages and relink them after build', async () => { }, }) - rimraf('node_modules') - rimraf('project-1/main.js') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/main.js') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') await mutateModules(importers, testDefaults({ autoInstallPeers: false, @@ -1011,10 +1011,10 @@ test('inject local packages and relink them after build (file protocol is used)' }, }) - rimraf('node_modules') - rimraf('project-1/main.js') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/main.js') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') await mutateModules(importers, testDefaults({ autoInstallPeers: false, @@ -1970,10 +1970,10 @@ test('injected local packages are deduped', async () => { expect(modulesState?.injectedDeps?.['project-1'][0]).toContain(`node_modules${path.sep}.pnpm`) } - rimraf('node_modules') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') - rimraf('project-3/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') + rimrafSync('project-3/node_modules') await mutateModules(importers, testDefaults({ autoInstallPeers: true, diff --git a/pkg-manager/core/test/install/lifecycleScripts.ts b/pkg-manager/core/test/install/lifecycleScripts.ts index 7d39d73bac..022f5d122e 100644 --- a/pkg-manager/core/test/install/lifecycleScripts.ts +++ b/pkg-manager/core/test/install/lifecycleScripts.ts @@ -14,7 +14,7 @@ import { createTestIpcServer } from '@pnpm/test-ipc-server' import type { ProjectRootDir } from '@pnpm/types' import { restartWorkerPool } from '@pnpm/worker' import { jest } from '@jest/globals' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import isWindows from 'is-windows' import { loadJsonFileSync } from 'load-json-file' import PATH from 'path-name' @@ -40,7 +40,7 @@ test('run pre/postinstall scripts', async () => { expect(typeof generatedByPostinstall).toBe('function') } - rimraf('node_modules') + rimrafSync('node_modules') // testing that the packages are not installed even though they are in lockfile // and that their scripts are not tried to be executed @@ -336,7 +336,7 @@ test('lifecycle scripts run before linking bins', async () => { project.isExecutable('.bin/cmd1') project.isExecutable('.bin/cmd2') - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, @@ -357,7 +357,7 @@ test('hoisting does not fail on commands that will be created by lifecycle scrip // project.isExecutable('.pnpm/node_modules/.bin/cmd2') // Testing the same with headless installation - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, @@ -389,7 +389,7 @@ test('bins are linked even if lifecycle scripts are ignored', async () => { expect(fs.existsSync('node_modules/@pnpm.e2e/pre-and-postinstall-scripts-example/package.json')).toBeTruthy() expect(fs.existsSync('node_modules/@pnpm.e2e/pre-and-postinstall-scripts-example/generated-by-preinstall.js')).toBeFalsy() - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, @@ -454,7 +454,7 @@ test('selectively ignore scripts in some dependencies by allowBuilds (not others expect(fs.existsSync('node_modules/@pnpm.e2e/pre-and-postinstall-scripts-example/generated-by-postinstall.js')).toBeFalsy() expect(fs.existsSync('node_modules/@pnpm.e2e/install-script-example/generated-by-install.js')).toBeTruthy() - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ fastUnpack: false, frozenLockfile: true, allowBuilds })) @@ -482,7 +482,7 @@ test('selectively allow scripts in some dependencies by allowBuilds', async () = } reporter.mockClear() - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ fastUnpack: false, @@ -520,7 +520,7 @@ test('selectively allow scripts in some dependencies by allowBuilds using exact } reporter.mockClear() - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ fastUnpack: false, @@ -565,7 +565,7 @@ test('lifecycle scripts run after linking root dependencies', async () => { rootDir: process.cwd() as ProjectRootDir, }, testDefaults({ fastUnpack: false, allowBuilds: { '@pnpm.e2e/postinstall-requires-is-positive': true } })) - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, @@ -598,7 +598,7 @@ test('ignore-dep-scripts', async () => { expect(fs.existsSync('node_modules/@pnpm.e2e/pre-and-postinstall-scripts-example/generated-by-preinstall.js')).toBeFalsy() - rimraf('node_modules') + rimrafSync('node_modules') server1.clear() server2.clear() await install(manifest, testDefaults({ fastUnpack: false, ignoreDepScripts: true })) diff --git a/pkg-manager/core/test/install/local.ts b/pkg-manager/core/test/install/local.ts index ba566ec30c..55025b0814 100644 --- a/pkg-manager/core/test/install/local.ts +++ b/pkg-manager/core/test/install/local.ts @@ -14,9 +14,9 @@ import { mutateModulesInSingleProject, type ProjectOptions, } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import normalizePath from 'normalize-path' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import symlinkDir from 'symlink-dir' import { testDefaults } from '../utils/index.js' @@ -87,7 +87,7 @@ test('local directory with no package.json', async () => { expect(manifest.dependencies).toStrictEqual(expectedSpecs) project.has('pkg') - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true })) project.has('pkg') @@ -331,7 +331,7 @@ test('frozen-lockfile: installation fails if the integrity of a tarball dependen f.copy('tar-pkg-with-dep-1/tar-pkg-with-dep-1.0.0.tgz', path.resolve('..', 'tar.tgz')) const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['../tar.tgz'], testDefaults()) - rimraf('node_modules') + rimrafSync('node_modules') f.copy('tar-pkg-with-dep-2/tar-pkg-with-dep-1.0.0.tgz', path.resolve('..', 'tar.tgz')) @@ -374,7 +374,7 @@ test('deep local', async () => { process.chdir('project-1') await install(manifest1, testDefaults()) - const lockfile = readYamlFile('pnpm-lock.yaml') + const lockfile = readYamlFileSync('pnpm-lock.yaml') expect(Object.keys(lockfile.packages ?? {})).toStrictEqual(['project-2@file:../project-2', 'project-3@file:../project-2/project-3']) }) diff --git a/pkg-manager/core/test/install/lockfileDir.ts b/pkg-manager/core/test/install/lockfileDir.ts index f07849b587..0a62d11750 100644 --- a/pkg-manager/core/test/install/lockfileDir.ts +++ b/pkg-manager/core/test/install/lockfileDir.ts @@ -3,10 +3,10 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import type { LockfileObject } from '@pnpm/lockfile.fs' import { prepareEmpty } from '@pnpm/prepare' import { fixtures } from '@pnpm/test-fixtures' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { addDependenciesToPackage, mutateModulesInSingleProject } from '@pnpm/core' import type { ProjectRootDir, DepPath } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' const f = fixtures(import.meta.dirname) @@ -18,7 +18,7 @@ test.skip('subsequent installation uses same lockfile directory by default', asy await addDependenciesToPackage(manifest, ['is-negative@1.0.0'], testDefaults()) - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(Object.keys(lockfile.packages ?? {})).toStrictEqual(['is-negative/1.0.0', 'is-positive/1.0.0']) }) @@ -54,11 +54,11 @@ test(`tarball location is correctly saved to ${WANTED_LOCKFILE} when a shared ${ rootDir: process.cwd() as ProjectRootDir, }, testDefaults({ lockfileDir })) - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.packages!['tar-pkg-with-dep@file:project/pkg.tgz' as DepPath]).toBeTruthy() expect(lockfile.packages!['tar-pkg-with-dep@file:project/pkg.tgz' as DepPath].resolution).toHaveProperty(['tarball'], 'file:project/pkg.tgz') - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, diff --git a/pkg-manager/core/test/install/misc.ts b/pkg-manager/core/test/install/misc.ts index 29d943fb20..019a62f018 100644 --- a/pkg-manager/core/test/install/misc.ts +++ b/pkg-manager/core/test/install/misc.ts @@ -19,14 +19,14 @@ import { UnexpectedStoreError, UnexpectedVirtualStoreDirError, } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' -import execa from 'execa' +import { rimrafSync } from '@zkochan/rimraf' +import { safeExeca as execa } from 'execa' import { isCI } from 'ci-info' import isWindows from 'is-windows' import semver from 'semver' import { jest } from '@jest/globals' import deepRequireCwd from 'deep-require-cwd' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { testDefaults } from '../utils/index.js' const f = fixtures(import.meta.dirname) @@ -389,7 +389,7 @@ test('forcing', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['magic-hook@2.0.0'], testDefaults({ fastUnpack: false })) const distPath = path.resolve('node_modules', 'magic-hook', 'dist') - rimraf(distPath) + rimrafSync(distPath) await addDependenciesToPackage(manifest, ['magic-hook@2.0.0'], testDefaults({ fastUnpack: false, force: true })) @@ -402,7 +402,7 @@ test('argumentless forcing', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['magic-hook@2.0.0'], testDefaults({ fastUnpack: false })) const distPath = path.resolve('node_modules', 'magic-hook', 'dist') - rimraf(distPath) + rimrafSync(distPath) await install(manifest, testDefaults({ fastUnpack: false, force: true })) @@ -415,7 +415,7 @@ test('no forcing', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['magic-hook@2.0.0'], testDefaults()) const distPath = path.resolve('node_modules', 'magic-hook', 'dist') - rimraf(distPath) + rimrafSync(distPath) await addDependenciesToPackage(manifest, ['magic-hook@2.0.0'], testDefaults()) @@ -428,8 +428,8 @@ test('refetch package to store if it has been modified', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['magic-hook@2.0.0'], testDefaults({ fastUnpack: false })) const distPathInStore = project.resolve('magic-hook', '2.0.0', 'dist') - rimraf(distPathInStore) - rimraf('node_modules') + rimrafSync(distPathInStore) + rimrafSync('node_modules') const distPath = path.resolve('node_modules', 'magic-hook', 'dist') await addDependenciesToPackage(manifest, ['magic-hook@2.0.0'], testDefaults({ fastUnpack: false })) @@ -453,7 +453,7 @@ test.skip('relink package to project if the dependency is not linked from store' // rewriting package.json, to destroy the link const pkgJson = fs.readFileSync(pkgJsonPath, 'utf8') - rimraf(pkgJsonPath) + rimrafSync(pkgJsonPath) fs.writeFileSync(pkgJsonPath, pkgJson, 'utf8') expect(storeInode).not.toEqual(getInode()) @@ -709,7 +709,7 @@ test('lockfile locks npm dependencies', async () => { await addDistTag({ package: '@pnpm.e2e/dep-of-pkg-with-1-dep', version: '100.1.0', distTag: 'latest' }) - rimraf('node_modules') + rimrafSync('node_modules') reporter.mockClear() await install(manifest, testDefaults({ reporter })) @@ -745,7 +745,7 @@ test('install on project with lockfile and no node_modules', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['is-negative'], testDefaults()) - rimraf('node_modules') + rimrafSync('node_modules') await addDependenciesToPackage(manifest, ['is-positive'], testDefaults()) @@ -831,9 +831,9 @@ test('reinstalls missing packages to node_modules', async () => { expect(reporter).not.toHaveBeenCalledWith(expect.objectContaining(missingDepLog)) - rimraf('pnpm-lock.yaml') - rimraf('node_modules/is-positive') - rimraf(depLocation) + rimrafSync('pnpm-lock.yaml') + rimrafSync('node_modules/is-positive') + rimrafSync(depLocation) project.hasNot('is-positive') @@ -861,8 +861,8 @@ test('reinstalls missing packages to node_modules during headless install', asyn expect(reporter).not.toHaveBeenCalledWith(expect.objectContaining(missingDepLog)) - rimraf('node_modules/is-positive') - rimraf(depLocation) + rimrafSync('node_modules/is-positive') + rimrafSync(depLocation) project.hasNot('is-positive') @@ -908,7 +908,7 @@ test('all the subdeps of dependencies are linked when a node_modules is partiall rootDir: process.cwd() as ProjectRootDir, }, testDefaults()) - writeYamlFile(path.resolve('pnpm-lock.yaml'), { + writeYamlFileSync(path.resolve('pnpm-lock.yaml'), { dependencies: { '@pnpm.e2e/foobarqar': { specifier: '1.0.1', @@ -997,7 +997,7 @@ test('subdep symlinks are updated if the lockfile has new subdep versions specif ] ) - writeYamlFile(path.resolve('pnpm-lock.yaml'), { + writeYamlFileSync(path.resolve('pnpm-lock.yaml'), { dependencies: { '@pnpm.e2e/parent-of-pkg-with-1-dep': { specifier: '1.0.0', @@ -1239,7 +1239,7 @@ test('a package should be able to be a dependency of itself', async () => { expect(pkg.version).toBe('1.0.0') } - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true })) { diff --git a/pkg-manager/core/test/install/modulesDir.ts b/pkg-manager/core/test/install/modulesDir.ts index e9d8b53e91..593790583a 100644 --- a/pkg-manager/core/test/install/modulesDir.ts +++ b/pkg-manager/core/test/install/modulesDir.ts @@ -6,7 +6,7 @@ import { mutateModules, } from '@pnpm/core' import type { ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' test('installing to a custom modules directory', async () => { @@ -20,7 +20,7 @@ test('installing to a custom modules directory', async () => { project.has('is-positive', 'pnpm_modules') - rimraf('pnpm_modules') + rimrafSync('pnpm_modules') project.hasNot('is-positive', 'pnpm_modules') await install({ diff --git a/pkg-manager/core/test/install/multipleImporters.ts b/pkg-manager/core/test/install/multipleImporters.ts index 55856dfdd4..b6cbfae9d1 100644 --- a/pkg-manager/core/test/install/multipleImporters.ts +++ b/pkg-manager/core/test/install/multipleImporters.ts @@ -12,12 +12,12 @@ import { mutateModules, mutateModulesInSingleProject, } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { createPeerDepGraphHash } from '@pnpm/dependency-path' import { loadJsonFileSync } from 'load-json-file' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { jest } from '@jest/globals' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { testDefaults } from '../utils/index.js' test('install only the dependencies of the specified importer', async () => { @@ -78,7 +78,7 @@ test('install only the dependencies of the specified importer', async () => { rootModules.has('.pnpm/is-positive@1.0.0') rootModules.hasNot('.pnpm/is-negative@1.0.0') - const lockfile: any = readYamlFile(WANTED_LOCKFILE) // eslint-disable-line + const lockfile: any = readYamlFileSync(WANTED_LOCKFILE) // eslint-disable-line expect(lockfile.importers?.['project-2' as ProjectId].dependencies?.['is-negative'].version).toBe('1.0.0') }) @@ -137,7 +137,7 @@ test('install only the dependencies of the specified importer, when node-linker rootModules.has('is-positive') // rootModules.hasNot('is-negative') // TODO: fix - const lockfile: any = readYamlFile(WANTED_LOCKFILE) // eslint-disable-line + const lockfile: any = readYamlFileSync(WANTED_LOCKFILE) // eslint-disable-line expect(lockfile.importers?.['project-2' as ProjectId].dependencies?.['is-negative'].version).toBe('1.0.0') }) @@ -199,7 +199,7 @@ test('install only the dependencies of the specified importer, when no lockfile rootModules.has('.pnpm/is-positive@1.0.0') rootModules.hasNot('.pnpm/is-negative@1.0.0') - const lockfile: any = readYamlFile(path.resolve('node_modules/.pnpm/lock.yaml')) // eslint-disable-line + const lockfile: any = readYamlFileSync(path.resolve('node_modules/.pnpm/lock.yaml')) // eslint-disable-line expect(lockfile.importers?.['project-2' as ProjectId]).toStrictEqual({}) }) @@ -797,7 +797,7 @@ test('partial installation in a monorepo does not remove dependencies of other w ], })) - writeYamlFile(path.resolve('pnpm-lock.yaml'), { + writeYamlFileSync(path.resolve('pnpm-lock.yaml'), { importers: { 'project-1': { dependencies: { @@ -896,7 +896,7 @@ test('partial installation in a monorepo does not remove dependencies of other w ], })) - writeYamlFile(path.resolve('pnpm-lock.yaml'), { + writeYamlFileSync(path.resolve('pnpm-lock.yaml'), { importers: { 'project-1': { dependencies: { @@ -1473,7 +1473,7 @@ test('resolve a subdependency from the workspace', async () => { const wantedLockfile = project.readLockfile() expect(wantedLockfile.snapshots['@pnpm.e2e/pkg-with-1-dep@100.0.0'].dependencies?.['@pnpm.e2e/dep-of-pkg-with-1-dep']).toBe('link:@pnpm.e2e/dep-of-pkg-with-1-dep') - rimraf('node_modules') + rimrafSync('node_modules') // Testing that headless installation does not fail with links in subdeps await mutateModules(importers, testDefaults({ @@ -1616,7 +1616,7 @@ test('resolve a subdependency from the workspace, when it uses the workspace pro const wantedLockfile = project.readLockfile() expect(wantedLockfile.snapshots['@pnpm.e2e/pkg-with-1-dep@100.0.0'].dependencies?.['@pnpm.e2e/dep-of-pkg-with-1-dep']).toBe('link:@pnpm.e2e/dep-of-pkg-with-1-dep') - rimraf('node_modules') + rimrafSync('node_modules') // Testing that headless installation does not fail with links in subdeps await mutateModules(importers, testDefaults({ @@ -1828,7 +1828,7 @@ test('symlink local package from the location described in its publishConfig.dir const lockfile = project.readLockfile() expect(lockfile.importers['project-1'].publishDirectory).toBe('dist') - rimraf('node_modules') + rimrafSync('node_modules') await mutateModules(importers, testDefaults({ allProjects, frozenLockfile: true })) { @@ -1951,9 +1951,9 @@ require("fs").writeFileSync("created-by-prepare", "", "utf8")`) expect(fs.existsSync('project-1/created-by-prepare')).toBeTruthy() - rimraf('node_modules') - rimraf('project-1/node_modules') - rimraf('project-2/node_modules') + rimrafSync('node_modules') + rimrafSync('project-1/node_modules') + rimrafSync('project-2/node_modules') fs.renameSync('project-2/bin.js', 'project-2/__bin.js') await mutateModules(importers, testDefaults({ allProjects, frozenLockfile: true })) diff --git a/pkg-manager/core/test/install/nodeRuntime.ts b/pkg-manager/core/test/install/nodeRuntime.ts index ae3117a014..3f846473ed 100644 --- a/pkg-manager/core/test/install/nodeRuntime.ts +++ b/pkg-manager/core/test/install/nodeRuntime.ts @@ -5,8 +5,8 @@ import type { VariationsResolution } from '@pnpm/resolver-base' import { prepareEmpty } from '@pnpm/prepare' import { addDependenciesToPackage, install } from '@pnpm/core' import { getIntegrity } from '@pnpm/registry-mock' -import { sync as rimraf } from '@zkochan/rimraf' -import { sync as writeYamlFile } from 'write-yaml-file' +import { rimrafSync } from '@zkochan/rimraf' +import { writeYamlFileSync } from 'write-yaml-file' import { testDefaults } from '../utils/index.js' // The standard glibc variants from nodejs.org/download/release/ @@ -277,7 +277,7 @@ test('installing Node.js runtime', async () => { // Verify that package.json is created expect(fs.existsSync(path.resolve('node_modules/node/package.json'))).toBeTruthy() - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true }, { offline: true, // We want to verify that Node.js is resolved from cache. })) @@ -346,7 +346,7 @@ test('installing Node.js runtime from RC channel', async () => { test('installing Node.js runtime fails if integrity check fails', async () => { prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { settings: { autoInstallPeers: true, excludeLinksFromLockfile: false, @@ -414,7 +414,7 @@ test('installing Node.js runtime for the given supported architecture', async () }) ) project.has(expectedBinLocation) - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({ frozenLockfile: true, supportedArchitectures })) project.has(expectedBinLocation) }) diff --git a/pkg-manager/core/test/install/optionalDependencies.ts b/pkg-manager/core/test/install/optionalDependencies.ts index c50282ae8f..6b4b9d3d7b 100644 --- a/pkg-manager/core/test/install/optionalDependencies.ts +++ b/pkg-manager/core/test/install/optionalDependencies.ts @@ -5,7 +5,7 @@ import { prepareEmpty, preparePackages } from '@pnpm/prepare' import type { ProjectRootDir } from '@pnpm/types' import { jest } from '@jest/globals' import deepRequireCwd from 'deep-require-cwd' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { addDependenciesToPackage, install, @@ -13,7 +13,7 @@ import { mutateModules, mutateModulesInSingleProject, } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' test('successfully install optional dependency with subdependencies', async () => { @@ -92,7 +92,7 @@ test('skip optional dependency that does not support the current OS', async () = expect(currentLockfile.packages).toStrictEqual(lockfile.packages) - const modulesInfo = readYamlFile<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) + const modulesInfo = readYamlFileSync<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) expect(modulesInfo.skipped).toStrictEqual([ '@pnpm.e2e/dep-of-optional-pkg@1.0.0', '@pnpm.e2e/not-compatible-with-any-os@1.0.0', @@ -121,7 +121,7 @@ test('skip optional dependency that does not support the current OS', async () = expect(modules?.skipped).toStrictEqual(['@pnpm.e2e/not-compatible-with-any-os@1.0.0']) } - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, @@ -257,10 +257,10 @@ test('optional subdependency is not removed from current lockfile when new depen ) { - const modulesInfo = readYamlFile<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) + const modulesInfo = readYamlFileSync<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) expect(modulesInfo.skipped).toStrictEqual(['@pnpm.e2e/dep-of-optional-pkg@1.0.0', '@pnpm.e2e/not-compatible-with-any-os@1.0.0']) - const currentLockfile = readYamlFile(path.resolve('node_modules/.pnpm/lock.yaml')) + const currentLockfile = readYamlFileSync(path.resolve('node_modules/.pnpm/lock.yaml')) expect(currentLockfile.packages).toHaveProperty(['@pnpm.e2e/not-compatible-with-any-os@1.0.0']) } @@ -273,7 +273,7 @@ test('optional subdependency is not removed from current lockfile when new depen ], testDefaults({ allProjects, fastUnpack: false, hoistPattern: ['*'] })) { - const currentLockfile = readYamlFile(path.resolve('node_modules/.pnpm/lock.yaml')) + const currentLockfile = readYamlFileSync(path.resolve('node_modules/.pnpm/lock.yaml')) expect(currentLockfile.packages).toHaveProperty(['@pnpm.e2e/not-compatible-with-any-os@1.0.0']) } }) @@ -285,7 +285,7 @@ test('optional subdependency is skipped', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['@pnpm.e2e/pkg-with-optional', '@pnpm.e2e/dep-of-optional-pkg'], testDefaults({ reporter })) { - const modulesInfo = readYamlFile<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) + const modulesInfo = readYamlFileSync<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) expect(modulesInfo.skipped).toStrictEqual(['@pnpm.e2e/not-compatible-with-any-os@1.0.0']) } @@ -307,7 +307,7 @@ test('optional subdependency is skipped', async () => { // recreate the lockfile with optional dependencies present expect(fs.existsSync('pnpm-lock.yaml')).toBeTruthy() - rimraf('pnpm-lock.yaml') + rimrafSync('pnpm-lock.yaml') await mutateModulesInSingleProject({ manifest, @@ -333,7 +333,7 @@ test('optional subdependency is skipped', async () => { expect(fs.existsSync('node_modules/.pnpm/@pnpm.e2e+not-compatible-with-any-os@1.0.0')).toBeTruthy() { - const modulesInfo = readYamlFile<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) + const modulesInfo = readYamlFileSync<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) expect(modulesInfo.skipped).toStrictEqual([]) } }) @@ -345,7 +345,7 @@ test('optional subdependency of newly added optional dependency is skipped', asy await addDependenciesToPackage({}, ['@pnpm.e2e/pkg-with-optional'], testDefaults({ reporter, targetDependenciesField: 'optionalDependencies' })) - const modulesInfo = readYamlFile<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) + const modulesInfo = readYamlFileSync<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) expect(modulesInfo.skipped).toStrictEqual(['@pnpm.e2e/dep-of-optional-pkg@1.0.0', '@pnpm.e2e/not-compatible-with-any-os@1.0.0']) const lockfile = project.readLockfile() @@ -365,14 +365,14 @@ test('only that package is skipped which is an optional dependency only and not ], testDefaults({ reporter })) { - const modulesInfo = readYamlFile<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) + const modulesInfo = readYamlFileSync<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) expect(modulesInfo.skipped).toStrictEqual([]) } const lockfile = project.readLockfile() expect(typeof lockfile.snapshots['@pnpm.e2e/dep-of-optional-pkg@1.0.0'].optional).toBe('undefined') - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, @@ -381,7 +381,7 @@ test('only that package is skipped which is an optional dependency only and not }, testDefaults({ frozenLockfile: true })) { - const modulesInfo = readYamlFile<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) + const modulesInfo = readYamlFileSync<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) expect(modulesInfo.skipped).toStrictEqual([]) } }) @@ -528,7 +528,7 @@ test('skip optional dependency that does not support the current OS, when doing preferFrozenLockfile: false, })) - const modulesInfo = readYamlFile<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) + const modulesInfo = readYamlFileSync<{ skipped: string[] }>(path.join('node_modules', '.modules.yaml')) expect(modulesInfo.skipped).toStrictEqual([ '@pnpm.e2e/dep-of-optional-pkg@1.0.0', '@pnpm.e2e/not-compatible-with-any-os@1.0.0', @@ -681,7 +681,7 @@ test('optional dependency is hardlinked to the store if it does not require a bu }) ) - rimraf('node_modules') + rimrafSync('node_modules') reporter.mockClear() await install(manifest, testDefaults({ frozenLockfile: true, reporter }, {}, {}, { packageImportMethod: 'hardlink' })) diff --git a/pkg-manager/core/test/install/overrides.ts b/pkg-manager/core/test/install/overrides.ts index f96f647a91..4503d3dd7b 100644 --- a/pkg-manager/core/test/install/overrides.ts +++ b/pkg-manager/core/test/install/overrides.ts @@ -1,6 +1,6 @@ import path from 'path' import fs from 'fs' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { PnpmError } from '@pnpm/error' import { prepare, prepareEmpty, preparePackages } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' @@ -206,7 +206,7 @@ test('overrides with local file and link specs', async () => { }, }) - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile.importers?.['packages/direct']).toStrictEqual({ dependencies: { diff --git a/pkg-manager/core/test/install/patch.ts b/pkg-manager/core/test/install/patch.ts index c5e95f54b2..52f37780d5 100644 --- a/pkg-manager/core/test/install/patch.ts +++ b/pkg-manager/core/test/install/patch.ts @@ -10,7 +10,7 @@ import { getIntegrity } from '@pnpm/registry-mock' import { StoreIndex, storeIndexKey } from '@pnpm/store.index' import { fixtures } from '@pnpm/test-fixtures' import { jest } from '@jest/globals' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' const f = fixtures(import.meta.dirname) @@ -74,7 +74,7 @@ test('patch package with exact version', async () => { expect(originalFileDigest).not.toEqual(patchedFileDigest) // The same with frozen lockfile - rimraf('node_modules') + rimrafSync('node_modules') await install({ dependencies: { 'is-positive': '1.0.0', @@ -86,7 +86,7 @@ test('patch package with exact version', async () => { expect(fs.readFileSync('node_modules/is-positive/index.js', 'utf8')).toContain('// patched') // The same with frozen lockfile and hoisted node_modules - rimraf('node_modules') + rimrafSync('node_modules') await install({ dependencies: { 'is-positive': '1.0.0', @@ -171,7 +171,7 @@ test('patch package with version range', async () => { expect(originalFileDigest).not.toEqual(patchedFileDigest) // The same with frozen lockfile - rimraf('node_modules') + rimrafSync('node_modules') await install({ dependencies: { 'is-positive': '1.0.0', @@ -183,7 +183,7 @@ test('patch package with version range', async () => { expect(fs.readFileSync('node_modules/is-positive/index.js', 'utf8')).toContain('// patched') // The same with frozen lockfile and hoisted node_modules - rimraf('node_modules') + rimrafSync('node_modules') await install({ dependencies: { 'is-positive': '1.0.0', @@ -340,7 +340,7 @@ test('patch package when scripts are ignored', async () => { expect(originalFileDigest).not.toEqual(patchedFileDigest) // The same with frozen lockfile - rimraf('node_modules') + rimrafSync('node_modules') await install({ dependencies: { 'is-positive': '1.0.0', @@ -352,7 +352,7 @@ test('patch package when scripts are ignored', async () => { expect(fs.readFileSync('node_modules/is-positive/index.js', 'utf8')).toContain('// patched') // The same with frozen lockfile and hoisted node_modules - rimraf('node_modules') + rimrafSync('node_modules') await install({ dependencies: { 'is-positive': '1.0.0', @@ -430,7 +430,7 @@ test('patch package when the package is not in allowBuilds list', async () => { expect(originalFileDigest).not.toEqual(patchedFileDigest) // The same with frozen lockfile - rimraf('node_modules') + rimrafSync('node_modules') await install({ dependencies: { 'is-positive': '1.0.0', @@ -442,7 +442,7 @@ test('patch package when the package is not in allowBuilds list', async () => { expect(fs.readFileSync('node_modules/is-positive/index.js', 'utf8')).toContain('// patched') // The same with frozen lockfile and hoisted node_modules - rimraf('node_modules') + rimrafSync('node_modules') await install({ dependencies: { 'is-positive': '1.0.0', diff --git a/pkg-manager/core/test/install/peerDependencies.ts b/pkg-manager/core/test/install/peerDependencies.ts index 691a393093..c35e7527ff 100644 --- a/pkg-manager/core/test/install/peerDependencies.ts +++ b/pkg-manager/core/test/install/peerDependencies.ts @@ -8,7 +8,7 @@ import { addDistTag, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { fixtures } from '@pnpm/test-fixtures' import type { ProjectRootDir } from '@pnpm/types' import { jest } from '@jest/globals' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { addDependenciesToPackage, install, @@ -18,7 +18,7 @@ import { type PeerDependencyIssuesError, type ProjectOptions, } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import deepRequireCwd from 'deep-require-cwd' import { createPeerDepGraphHash, depPathToFilename } from '@pnpm/dependency-path' import { testDefaults } from '../utils/index.js' @@ -39,8 +39,8 @@ test('peer dependency is grouped with dependency when peer is resolved not from expect(deepRequireCwd(['@pnpm.e2e/using-ajv', 'ajv-keywords', 'ajv', './package.json']).version).toBe('4.10.4') // testing that peers are reinstalled correctly using info from the lockfile - rimraf('node_modules') - rimraf(path.resolve('..', '.store')) + rimrafSync('node_modules') + rimrafSync(path.resolve('..', '.store')) manifest = (await install(manifest, testDefaults())).updatedManifest expect(fs.existsSync(path.resolve('node_modules/.pnpm/ajv-keywords@1.5.0_ajv@4.10.4/node_modules/ajv'))).toBeTruthy() @@ -161,7 +161,7 @@ test('the right peer dependency is used in every workspace package', async () => strictPeerDependencies: false, })) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) expect(lockfile.importers?.['project-1'].dependencies).toStrictEqual({ 'ajv-keywords': { @@ -863,7 +863,7 @@ test('peer dependency is grouped with dependent when the peer is a top dependenc expect(fs.existsSync(path.join('../node_modules/.pnpm/ajv-keywords@1.5.0_ajv@4.10.4/node_modules/ajv-keywords'))).toBeTruthy() - const lockfile = readYamlFile(path.join('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.join('..', WANTED_LOCKFILE)) expect(lockfile.importers?.project).toStrictEqual({ dependencies: { @@ -909,7 +909,7 @@ test('peer dependency is grouped with dependent when the peer is a top dependenc let { updatedManifest: manifest } = await addDependenciesToPackage({}, ['ajv@4.10.4', 'ajv-keywords@1.5.0'], testDefaults({ lockfileDir, strictPeerDependencies: false })) { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers?._).toStrictEqual({ dependencies: { ajv: { @@ -927,7 +927,7 @@ test('peer dependency is grouped with dependent when the peer is a top dependenc manifest = (await install(manifest, testDefaults({ lockfileDir, strictPeerDependencies: false }))).updatedManifest { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers?._).toStrictEqual({ dependencies: { ajv: { @@ -956,7 +956,7 @@ test('peer dependency is grouped with dependent when the peer is a top dependenc ) { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers?._).toStrictEqual({ dependencies: { 'ajv-keywords': { @@ -977,7 +977,7 @@ test('external lockfile: peer dependency is grouped with dependent even after a const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['ajv@4.10.4', 'ajv-keywords@1.4.0'], testDefaults({ lockfileDir })) { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers?._).toStrictEqual({ dependencies: { ajv: { @@ -995,7 +995,7 @@ test('external lockfile: peer dependency is grouped with dependent even after a await addDependenciesToPackage(manifest, ['ajv-keywords@1.5.0'], testDefaults({ lockfileDir })) { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers?._).toStrictEqual({ dependencies: { ajv: { @@ -1020,7 +1020,7 @@ test('external lockfile: peer dependency is grouped with dependent even after a const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['@pnpm.e2e/peer-c@1.0.0', '@pnpm.e2e/abc-parent-with-ab@1.0.0'], testDefaults({ lockfileDir, strictPeerDependencies: false })) { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers?._).toStrictEqual({ dependencies: { '@pnpm.e2e/abc-parent-with-ab': { @@ -1038,7 +1038,7 @@ test('external lockfile: peer dependency is grouped with dependent even after a await addDependenciesToPackage(manifest, ['@pnpm.e2e/peer-c@2.0.0'], testDefaults({ lockfileDir, strictPeerDependencies: false })) { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers?._).toStrictEqual({ dependencies: { '@pnpm.e2e/abc-parent-with-ab': { @@ -1085,7 +1085,7 @@ test('peer dependency is resolved from parent package', async () => { rootDir: path.resolve('pkg') as ProjectRootDir, }, testDefaults()) - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.snapshots ?? {}).sort()).toStrictEqual([ '@pnpm.e2e/has-tango-as-peer-dep@1.0.0(@pnpm.e2e/tango@1.0.0)', '@pnpm.e2e/tango@1.0.0', @@ -1112,7 +1112,7 @@ test('transitive peerDependencies field does not break the lockfile on subsequen rootDir: path.resolve('pkg') as ProjectRootDir, }, testDefaults()) - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.snapshots!['most@1.7.3'].dependencies!)).toStrictEqual([ '@most/multicast', @@ -1134,7 +1134,7 @@ test('peer dependency is resolved from parent package via its alias', async () = rootDir: path.resolve('pkg') as ProjectRootDir, }, testDefaults()) - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.snapshots ?? {}).sort()).toStrictEqual([ '@pnpm.e2e/has-tango-as-peer-dep@1.0.0(@pnpm.e2e/tango-tango@1.0.0)', '@pnpm.e2e/tango-tango@1.0.0(@pnpm.e2e/tango-tango@1.0.0)', @@ -1335,7 +1335,7 @@ test('local tarball dependency with peer dependency', async () => { expect(integrityLocalPkgDirs).toHaveLength(1) - rimraf('node_modules') + rimrafSync('node_modules') await mutateModulesInSingleProject({ manifest, @@ -1431,7 +1431,7 @@ test('peer dependency is grouped with dependency when peer is resolved not from ] await mutateModules(importers, testDefaults({ allProjects })) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) expect(lockfile.snapshots?.['ajv-keywords@1.5.0(ajv@ajv)'].dependencies?.['ajv']).toBe('link:ajv') }) @@ -1445,7 +1445,7 @@ test('deduplicate packages that have optional and non-optional peers', async () testDefaults({ autoInstallPeers: false, dedupePeerDependents: true }) ) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) const depPaths = Object.keys(lockfile.snapshots ?? {}) expect(depPaths).toHaveLength(5) expect(depPaths).toContain(`@pnpm.e2e/abc-optional-peers@1.0.0${createPeerDepGraphHash([{ name: '@pnpm.e2e/peer-a', version: '1.0.0' }, { name: '@pnpm.e2e/peer-b', version: '1.0.0' }, { name: '@pnpm.e2e/peer-c', version: '1.0.0' }])}`) @@ -1463,7 +1463,7 @@ test('deduplicate packages that have peers', async () => { testDefaults({ autoInstallPeers: false, dedupePeerDependents: true }) ) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) const depPaths = Object.keys(lockfile.snapshots ?? {}) expect(depPaths).toHaveLength(8) expect(depPaths).toContain(`@pnpm.e2e/abc@1.0.0${createPeerDepGraphHash([{ name: '@pnpm.e2e/peer-a', version: '1.0.0' }, { name: '@pnpm.e2e/peer-b', version: '1.0.0' }, { name: '@pnpm.e2e/peer-c', version: '1.0.0' }])}`) @@ -1527,7 +1527,7 @@ test('deduplicate packages that have peers, when adding new dependency in a work } await mutateModules(importers, testDefaults({ allProjects, autoInstallPeers: false, dedupePeerDependents: true })) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) const depPaths = Object.keys(lockfile.snapshots ?? {}) expect(depPaths).toHaveLength(8) expect(depPaths).toContain(`@pnpm.e2e/abc@1.0.0${createPeerDepGraphHash([{ name: '@pnpm.e2e/peer-a', version: '1.0.0' }, { name: '@pnpm.e2e/peer-b', version: '1.0.0' }, { name: '@pnpm.e2e/peer-c', version: '1.0.0' }])}`) @@ -1545,7 +1545,7 @@ test('resolve peer dependencies from aliased subdependencies if they are depende testDefaults({ autoInstallPeers: false, strictPeerDependencies: false }) ) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.snapshots['@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-a@1.0.0)(@pnpm.e2e/peer-b@1.0.0)(@pnpm.e2e/peer-c@1.0.0)']).toBeTruthy() }) @@ -1556,7 +1556,7 @@ test('resolve peer dependency from aliased direct dependency', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['peer-a@npm:@pnpm.e2e/peer-a@1.0.0'], opts) await addDependenciesToPackage(manifest, ['@pnpm.e2e/abc@1.0.0'], opts) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.snapshots['@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-a@1.0.0)']).toBeTruthy() }) @@ -1567,7 +1567,7 @@ test('resolve peer dependency using the alias that differs from the real name of const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['@pnpm.e2e/peer-b@npm:@pnpm.e2e/peer-a@1.0.0'], opts) await addDependenciesToPackage(manifest, ['@pnpm.e2e/abc@1.0.0'], opts) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.snapshots['@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-a@1.0.0)(@pnpm.e2e/peer-a@1.0.0)']).toBeTruthy() expect(lockfile.snapshots['@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-a@1.0.0)(@pnpm.e2e/peer-a@1.0.0)']?.dependencies['@pnpm.e2e/peer-a']).toBe('1.0.0') expect(lockfile.snapshots['@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-a@1.0.0)(@pnpm.e2e/peer-a@1.0.0)']?.dependencies['@pnpm.e2e/peer-b']).toBe('@pnpm.e2e/peer-a@1.0.0') @@ -1584,7 +1584,7 @@ test('when there are several aliased dependencies of the same package, pick the ], opts) await addDependenciesToPackage(manifest, ['@pnpm.e2e/abc@1.0.0'], opts) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.snapshots['@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-c@2.0.0)']).toBeTruthy() }) @@ -1598,7 +1598,7 @@ test('when there is an aliases dependency and a non-aliased one, prefer the non- ], opts) await addDependenciesToPackage(manifest, ['@pnpm.e2e/abc@1.0.0'], opts) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.snapshots['@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-c@1.0.0)']).toBeTruthy() }) @@ -1607,7 +1607,7 @@ test('in a subdependency, when there are several aliased dependencies of the sam await addDependenciesToPackage({}, ['@pnpm.e2e/abc-parent-with-aliases-of-same-pkg@1.0.0'], testDefaults({ autoInstallPeers: false, strictPeerDependencies: false })) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.snapshots['@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-c@2.0.0)']).toBeTruthy() }) @@ -1671,7 +1671,7 @@ test('peer having peer is resolved correctly', async () => { strictPeerDependencies: false, })) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.importers['project-1'].dependencies?.['@pnpm.e2e/has-has-y-peer-only-as-peer']['version']).not.toEqual(lockfile.importers['project-2'].dependencies?.['@pnpm.e2e/has-has-y-peer-only-as-peer']['version']) expect(lockfile.snapshots['@pnpm.e2e/has-has-y-peer-only-as-peer@1.0.0(@pnpm.e2e/has-y-peer@1.0.0(@pnpm/y@1.0.0))'].dependencies['@pnpm.e2e/has-y-peer']).toBe('1.0.0(@pnpm/y@1.0.0)') @@ -1737,7 +1737,7 @@ test('peer having peer is resolved correctly. The peer is also in the dependenci strictPeerDependencies: false, })) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.importers['project-1'].dependencies?.['@pnpm.e2e/has-has-y-peer-only-as-peer-and-y']['version']).toBe('1.0.0(@pnpm.e2e/has-y-peer@1.0.0(@pnpm/y@2.0.0))') expect(lockfile.importers['project-2'].dependencies?.['@pnpm.e2e/has-has-y-peer-only-as-peer-and-y']['version']).toBe('1.0.0(@pnpm.e2e/has-y-peer@1.0.0(@pnpm/y@1.0.0))') @@ -1809,7 +1809,7 @@ test('peer having peer is resolved correctly. The peer is also in the dependenci strictPeerDependencies: false, })) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.snapshots['@pnpm.e2e/has-has-y-peer-only-as-peer-and-y@1.0.0(@pnpm.e2e/has-y-peer@1.0.0(@pnpm/y@2.0.0))'].dependencies['@pnpm.e2e/has-y-peer']).toBe('1.0.0(@pnpm/y@2.0.0)') expect(lockfile.snapshots['@pnpm.e2e/has-has-y-peer-only-as-peer-and-y@2.0.0(@pnpm.e2e/has-y-peer@1.0.0(@pnpm/y@1.0.0))'].dependencies['@pnpm.e2e/has-y-peer']).toBe('1.0.0(@pnpm/y@1.0.0)') diff --git a/pkg-manager/core/test/install/sideEffects.ts b/pkg-manager/core/test/install/sideEffects.ts index 08d757df72..33a45c74f5 100644 --- a/pkg-manager/core/test/install/sideEffects.ts +++ b/pkg-manager/core/test/install/sideEffects.ts @@ -7,7 +7,7 @@ import { StoreIndex, storeIndexKey } from '@pnpm/store.index' import { getIntegrity, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { prepareEmpty } from '@pnpm/prepare' import { ENGINE_NAME } from '@pnpm/constants' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' const ENGINE_DIR = `${process.platform}-${process.arch}-node-${process.version.split('.')[0]}` @@ -110,8 +110,8 @@ test('using side effects cache', async () => { addedFiles.delete('generated-by-postinstall.js') storeIndex.set(filesIndexKey, filesIndex) - rimraf('node_modules') - rimraf('pnpm-lock.yaml') // to avoid headless install + rimrafSync('node_modules') + rimrafSync('pnpm-lock.yaml') // to avoid headless install const opts2 = testDefaults({ fastUnpack: false, sideEffectsCacheRead: true, @@ -141,7 +141,7 @@ test.skip('readonly side effects cache', async () => { const cacheBuildDir = path.join(opts1.storeDir, `localhost+${REGISTRY_MOCK_PORT}/diskusage/1.1.3/side_effects/${ENGINE_DIR}/package/build`) fs.writeFileSync(path.join(cacheBuildDir, 'new-file.txt'), 'some new content') - rimraf('node_modules') + rimrafSync('node_modules') const opts2 = testDefaults({ fastUnpack: false, sideEffectsCacheRead: true, @@ -152,7 +152,7 @@ test.skip('readonly side effects cache', async () => { expect(fs.existsSync('node_modules/diskusage/build/new-file.txt')).toBeTruthy() - rimraf('node_modules') + rimrafSync('node_modules') // changing version to make sure we don't create the cache await addDependenciesToPackage(manifest, ['diskusage@1.1.2'], opts2) @@ -252,9 +252,9 @@ test('a corrupted side-effects cache is ignored', async () => { const sideEffectFileStat = filesIndex4.sideEffects!.get(sideEffectsKey)!.added!.get('generated-by-preinstall.js')! const sideEffectFile = getFilePathByModeInCafs(opts.storeDir, sideEffectFileStat.digest, sideEffectFileStat.mode) expect(fs.existsSync(sideEffectFile)).toBeTruthy() - rimraf(sideEffectFile) // we remove the side effect file to break the store + rimrafSync(sideEffectFile) // we remove the side effect file to break the store - rimraf('node_modules') + rimrafSync('node_modules') const opts2 = testDefaults({ fastUnpack: false, sideEffectsCacheRead: true, diff --git a/pkg-manager/core/test/install/stats.ts b/pkg-manager/core/test/install/stats.ts index 1f8cbca578..6212981acf 100644 --- a/pkg-manager/core/test/install/stats.ts +++ b/pkg-manager/core/test/install/stats.ts @@ -4,7 +4,7 @@ import { type MutatedProject, } from '@pnpm/core' import type { ProjectRootDir } from '@pnpm/types' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from '../utils/index.js' test('spec not specified in package.json.dependencies', async () => { @@ -36,7 +36,7 @@ test('spec not specified in package.json.dependencies', async () => { expect(stats.removed).toBe(0) expect(stats.linkedToRoot).toBe(1) } - rimraf('node_modules') + rimrafSync('node_modules') { const { stats } = await mutateModules(importers, testDefaults({ allProjects, frozenLockfile: true })) expect(stats.added).toBe(1) diff --git a/pkg-manager/core/test/install/update.ts b/pkg-manager/core/test/install/update.ts index eb11fabd40..23cbb9a714 100644 --- a/pkg-manager/core/test/install/update.ts +++ b/pkg-manager/core/test/install/update.ts @@ -3,7 +3,7 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import type { LockfileFile } from '@pnpm/lockfile.fs' import { prepareEmpty } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { addDependenciesToPackage, install } from '@pnpm/core' import { testDefaults } from '../utils/index.js' @@ -110,7 +110,7 @@ test('update dependency when external lockfile directory is used', async () => { await install(manifest, testDefaults({ update: true, depth: 0, lockfileDir })) - const lockfile = readYamlFile(path.join('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.join('..', WANTED_LOCKFILE)) expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/foo@100.1.0']) }) diff --git a/pkg-manager/core/test/lockfile.ts b/pkg-manager/core/test/lockfile.ts index ceba14104b..73ad4fa9ed 100644 --- a/pkg-manager/core/test/lockfile.ts +++ b/pkg-manager/core/test/lockfile.ts @@ -11,7 +11,7 @@ import { readPackageJsonFromDir } from '@pnpm/read-package-json' import { addDistTag, getIntegrity, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import type { DepPath, ProjectManifest, ProjectRootDir } from '@pnpm/types' import { jest } from '@jest/globals' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { addDependenciesToPackage, install, @@ -20,10 +20,10 @@ import { type MutatedProject, type ProjectOptions, } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { loadJsonFileSync } from 'load-json-file' import nock from 'nock' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { testDefaults } from './utils/index.js' afterEach(() => { @@ -104,7 +104,7 @@ test('lockfile has dev deps even when installing for prod only', async () => { test('lockfile with scoped package', async () => { prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { importers: { '.': { dependencies: { @@ -174,7 +174,7 @@ test('a lockfile created even when there are no deps in package.json', async () test('current lockfile removed when no deps in package.json', async () => { const project = prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { dependencies: { 'is-negative': { specifier: '2.1.0', @@ -200,7 +200,7 @@ test('current lockfile removed when no deps in package.json', async () => { test('lockfile is fixed when it does not match package.json', async () => { const project = prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { dependencies: { '@types/semver': { specifier: '5.3.31', @@ -263,7 +263,7 @@ test('lockfile is fixed when it does not match package.json', async () => { test(`doing named installation when ${WANTED_LOCKFILE} exists already`, async () => { const project = prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { dependencies: { '@types/semver': { specifier: '5.3.31', @@ -342,8 +342,8 @@ test(`respects ${WANTED_LOCKFILE} for top dependencies`, async () => { await Promise.all(pkgs.map(async (pkgName) => addDistTag({ package: pkgName, version: '100.1.0', distTag: 'latest' }))) - rimraf('node_modules') - rimraf(path.join('..', '.store')) + rimrafSync('node_modules') + rimrafSync(path.join('..', '.store')) reporter.mockClear() @@ -391,7 +391,7 @@ test(`subdeps are updated on repeat install if outer ${WANTED_LOCKFILE} does not lockfile.snapshots['@pnpm.e2e/pkg-with-1-dep@100.0.0'].dependencies!['@pnpm.e2e/dep-of-pkg-with-1-dep'] = '100.1.0' - writeYamlFile(WANTED_LOCKFILE, lockfile, { lineWidth: 1000 }) + writeYamlFileSync(WANTED_LOCKFILE, lockfile, { lineWidth: 1000 }) await install(manifest, testDefaults()) @@ -437,7 +437,7 @@ test('repeat install with lockfile should not mutate lockfile when dependency ha expect(lockfile1.importers['.'].dependencies?.['highmaps-release'].version).toBe('5.0.11') - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults()) @@ -551,7 +551,7 @@ test('repeat install with no inner lockfile should not rewrite packages in node_ const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['is-negative@1.0.0'], testDefaults()) - rimraf('node_modules/.pnpm/lock.yaml') + rimrafSync('node_modules/.pnpm/lock.yaml') await install(manifest, testDefaults()) @@ -662,7 +662,7 @@ test('no lockfile', async () => { test('lockfile is ignored when lockfile = false', async () => { const project = prepareEmpty() - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { dependencies: { 'is-negative': { specifier: '2.1.0', @@ -844,12 +844,12 @@ test('lockfile file has correct format when lockfile directory does not equal th process.chdir('..') - const modules = readYamlFile(path.resolve('node_modules', '.modules.yaml')) // eslint-disable-line @typescript-eslint/no-explicit-any + const modules = readYamlFileSync(path.resolve('node_modules', '.modules.yaml')) // eslint-disable-line @typescript-eslint/no-explicit-any expect(modules).toBeTruthy() expect(modules.pendingBuilds).toHaveLength(0) { - const lockfile: LockfileFile = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileFile = readYamlFileSync(WANTED_LOCKFILE) const id = '@pnpm.e2e/pkg-with-1-dep@100.0.0' expect(lockfile.lockfileVersion).toBe(LOCKFILE_VERSION) @@ -881,7 +881,7 @@ test('lockfile file has correct format when lockfile directory does not equal th })) { - const lockfile = readYamlFile(path.join('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.join('..', WANTED_LOCKFILE)) expect(lockfile.importers).toHaveProperty(['project-2']) @@ -925,7 +925,7 @@ test(`doing named installation when shared ${WANTED_LOCKFILE} exists already`, a pkg2, ]) - writeYamlFile(WANTED_LOCKFILE, { + writeYamlFileSync(WANTED_LOCKFILE, { importers: { pkg1: { dependencies: { @@ -968,7 +968,7 @@ test(`doing named installation when shared ${WANTED_LOCKFILE} exists already`, a }) )).updatedManifest - const currentLockfile = readYamlFile(path.resolve('node_modules/.pnpm/lock.yaml')) + const currentLockfile = readYamlFileSync(path.resolve('node_modules/.pnpm/lock.yaml')) expect(Object.keys(currentLockfile.importers ?? {})).toStrictEqual(['pkg2']) @@ -1009,7 +1009,7 @@ test(`use current ${WANTED_LOCKFILE} as initial wanted one, when wanted was remo const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['lodash@4.17.11', 'underscore@1.9.0'], testDefaults()) - rimraf(WANTED_LOCKFILE) + rimrafSync(WANTED_LOCKFILE) await addDependenciesToPackage(manifest, ['underscore@1.9.1'], testDefaults()) @@ -1027,7 +1027,7 @@ test('existing dependencies are preserved when updating a lockfile to a newer fo const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['@pnpm.e2e/pkg-with-1-dep'], testDefaults()) const initialLockfile = project.readLockfile() - writeYamlFile(WANTED_LOCKFILE, { ...initialLockfile, lockfileVersion: '6.0' }, { lineWidth: 1000 }) + writeYamlFileSync(WANTED_LOCKFILE, { ...initialLockfile, lockfileVersion: '6.0' }, { lineWidth: 1000 }) await addDistTag({ package: '@pnpm.e2e/dep-of-pkg-with-1-dep', version: '100.1.0', distTag: 'latest' }) @@ -1053,7 +1053,7 @@ test('broken lockfile is fixed even if it seems like up to date at first. Unless expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/dep-of-pkg-with-1-dep@100.0.0']) delete lockfile.packages['@pnpm.e2e/dep-of-pkg-with-1-dep@100.0.0'] delete lockfile.snapshots['@pnpm.e2e/dep-of-pkg-with-1-dep@100.0.0'] - writeYamlFile(WANTED_LOCKFILE, lockfile, { lineWidth: 1000 }) + writeYamlFileSync(WANTED_LOCKFILE, lockfile, { lineWidth: 1000 }) } let err!: PnpmError @@ -1410,11 +1410,11 @@ test('a broken lockfile should not break the store', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['is-positive@1.0.0'], { ...opts, lockfileOnly: true }) - const lockfile: LockfileObject = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileObject = readYamlFileSync(WANTED_LOCKFILE) lockfile.packages!['is-positive@1.0.0' as DepPath].name = 'bad-name' lockfile.packages!['is-positive@1.0.0' as DepPath].version = '1.0.0' - writeYamlFile(WANTED_LOCKFILE, lockfile) + writeYamlFileSync(WANTED_LOCKFILE, lockfile) await mutateModulesInSingleProject({ manifest, @@ -1425,8 +1425,8 @@ test('a broken lockfile should not break the store', async () => { delete lockfile.packages!['is-positive@1.0.0' as DepPath].name delete lockfile.packages!['is-positive@1.0.0' as DepPath].version - writeYamlFile(WANTED_LOCKFILE, lockfile) - rimraf(path.resolve('node_modules')) + writeYamlFileSync(WANTED_LOCKFILE, lockfile) + rimrafSync(path.resolve('node_modules')) await mutateModulesInSingleProject({ manifest, @@ -1474,7 +1474,7 @@ test('lockfile v6', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['@pnpm.e2e/pkg-with-1-dep@100.0.0'], testDefaults({ useLockfileV6: true })) { - const lockfile = readYamlFile(WANTED_LOCKFILE) // eslint-disable-line @typescript-eslint/no-explicit-any + const lockfile = readYamlFileSync(WANTED_LOCKFILE) // eslint-disable-line @typescript-eslint/no-explicit-any expect(lockfile.lockfileVersion).toBe(LOCKFILE_VERSION) expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/pkg-with-1-dep@100.0.0']) } @@ -1482,7 +1482,7 @@ test('lockfile v6', async () => { await addDependenciesToPackage(manifest, ['@pnpm.e2e/foo@100.0.0'], testDefaults()) { - const lockfile = readYamlFile(WANTED_LOCKFILE) // eslint-disable-line @typescript-eslint/no-explicit-any + const lockfile = readYamlFileSync(WANTED_LOCKFILE) // eslint-disable-line @typescript-eslint/no-explicit-any expect(lockfile.lockfileVersion).toBe(LOCKFILE_VERSION) expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/pkg-with-1-dep@100.0.0']) expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/foo@100.0.0']) @@ -1496,7 +1496,7 @@ test('lockfile v5 is converted to lockfile v6', async () => { await install({ dependencies: { '@pnpm.e2e/pkg-with-1-dep': '100.0.0' } }, testDefaults()) - const lockfile = readYamlFile(WANTED_LOCKFILE) // eslint-disable-line @typescript-eslint/no-explicit-any + const lockfile = readYamlFileSync(WANTED_LOCKFILE) // eslint-disable-line @typescript-eslint/no-explicit-any expect(lockfile.lockfileVersion).toBe(LOCKFILE_VERSION) expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/pkg-with-1-dep@100.0.0']) }) @@ -1545,7 +1545,7 @@ test('update the lockfile when a new project is added to the workspace', async ( }) await mutateModules(importers, testDefaults({ allProjects })) - const lockfile: LockfileObject = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileObject = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.importers)).toStrictEqual(['project-1', 'project-2']) }) @@ -1593,7 +1593,7 @@ test('update the lockfile when a new project is added to the workspace and lockf }) await mutateModules(importers, testDefaults({ allProjects, lockfileOnly: true })) - const lockfile: LockfileObject = readYamlFile(WANTED_LOCKFILE) + const lockfile: LockfileObject = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.importers)).toStrictEqual(['project-1', 'project-2']) }) diff --git a/pkg-manager/core/test/offline.ts b/pkg-manager/core/test/offline.ts index 4d454bee3f..5455897c2a 100644 --- a/pkg-manager/core/test/offline.ts +++ b/pkg-manager/core/test/offline.ts @@ -1,6 +1,6 @@ import { prepareEmpty } from '@pnpm/prepare' import { addDependenciesToPackage, install } from '@pnpm/core' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { testDefaults } from './utils/index.js' test('offline installation fails when package meta not found in local registry mirror', async () => { @@ -19,7 +19,7 @@ test('offline installation fails when package tarball not found in local registr const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['is-positive@3.0.0'], testDefaults()) - rimraf('node_modules') + rimrafSync('node_modules') try { await addDependenciesToPackage(manifest, ['is-positive@3.1.0'], testDefaults({}, { offline: true }, { offline: true })) @@ -34,7 +34,7 @@ test('successful offline installation', async () => { const { updatedManifest: manifest } = await addDependenciesToPackage({}, ['is-positive@3.0.0'], testDefaults({ save: true })) - rimraf('node_modules') + rimrafSync('node_modules') await install(manifest, testDefaults({}, { offline: true }, { offline: true })) diff --git a/pkg-manager/core/test/uninstall.ts b/pkg-manager/core/test/uninstall.ts index cedbfec105..227177bf01 100644 --- a/pkg-manager/core/test/uninstall.ts +++ b/pkg-manager/core/test/uninstall.ts @@ -11,7 +11,7 @@ import { prepareEmpty, preparePackages } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { fixtures } from '@pnpm/test-fixtures' import type { ProjectRootDir, PackageManifest } from '@pnpm/types' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import symlinkDir from 'symlink-dir' import { addDependenciesToPackage, @@ -300,7 +300,7 @@ test('uninstalling a dependency from package that uses shared lockfile', async ( projects['project-1'].hasNot('is-positive') projects['project-2'].has('is-negative') - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile).toStrictEqual({ settings: { diff --git a/pkg-manager/direct-dep-linker/src/linkDirectDeps.ts b/pkg-manager/direct-dep-linker/src/linkDirectDeps.ts index 2c757b75ce..b9e94109b7 100644 --- a/pkg-manager/direct-dep-linker/src/linkDirectDeps.ts +++ b/pkg-manager/direct-dep-linker/src/linkDirectDeps.ts @@ -4,8 +4,8 @@ import { rootLogger } from '@pnpm/core-loggers' import { symlinkDependency, symlinkDirectRootDependency } from '@pnpm/symlink-dependency' import { omit } from 'ramda' import { readModulesDir } from '@pnpm/read-modules-dir' -import rimraf from '@zkochan/rimraf' -import resolveLinkTarget from 'resolve-link-target' +import { rimraf } from '@zkochan/rimraf' +import { resolveLinkTarget } from 'resolve-link-target' export interface LinkedDirectDep { alias: string diff --git a/pkg-manager/get-context/src/index.ts b/pkg-manager/get-context/src/index.ts index e573123402..956e3388e9 100644 --- a/pkg-manager/get-context/src/index.ts +++ b/pkg-manager/get-context/src/index.ts @@ -19,7 +19,7 @@ import type { ProjectRootDir, ProjectRootDirRealPath, } from '@pnpm/types' -import pathAbsolute from 'path-absolute' +import { pathAbsolute } from 'path-absolute' import { clone } from 'ramda' import { registerProject } from '@pnpm/package-store' import { readLockfiles } from './readLockfiles.js' diff --git a/pkg-manager/headless/src/index.ts b/pkg-manager/headless/src/index.ts index a71d5c8fec..45fa09b910 100644 --- a/pkg-manager/headless/src/index.ts +++ b/pkg-manager/headless/src/index.ts @@ -73,9 +73,9 @@ import { import * as dp from '@pnpm/dependency-path' import { symlinkAllModules } from '@pnpm/worker' import pLimit from 'p-limit' -import pathAbsolute from 'path-absolute' +import { pathAbsolute } from 'path-absolute' import { equals, isEmpty, omit, pick, pickBy, props, union } from 'ramda' -import realpathMissing from 'realpath-missing' +import { realpathMissing } from 'realpath-missing' import { linkHoistedModules } from './linkHoistedModules.js' import { type DirectDependenciesByImporterId, diff --git a/pkg-manager/headless/src/linkHoistedModules.ts b/pkg-manager/headless/src/linkHoistedModules.ts index 119f4f88fe..a0d4760e8c 100644 --- a/pkg-manager/headless/src/linkHoistedModules.ts +++ b/pkg-manager/headless/src/linkHoistedModules.ts @@ -17,7 +17,7 @@ import type { } from '@pnpm/store-controller-types' import pLimit from 'p-limit' import { difference, isEmpty } from 'ramda' -import rimraf from '@zkochan/rimraf' +import { rimraf } from '@zkochan/rimraf' import type { AllowBuild } from '@pnpm/types' const limitLinking = pLimit(16) diff --git a/pkg-manager/headless/test/index.ts b/pkg-manager/headless/test/index.ts index 70465be828..66fbe6f138 100644 --- a/pkg-manager/headless/test/index.ts +++ b/pkg-manager/headless/test/index.ts @@ -21,7 +21,7 @@ import { getIntegrity } from '@pnpm/registry-mock' import { fixtures } from '@pnpm/test-fixtures' import { createTestIpcServer } from '@pnpm/test-ipc-server' import { jest } from '@jest/globals' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { loadJsonFileSync } from 'load-json-file' import { testDefaults } from './utils/testDefaults.js' @@ -759,7 +759,7 @@ test.skip('using side effects cache and hoistPattern=*', async () => { const cacheBuildDir = path.join(opts.storeDir, `diskusage@1.1.3/side_effects/${ENGINE_DIR}/package/build`) fs.writeFileSync(path.join(cacheBuildDir, 'new-file.txt'), 'some new content') - rimraf(path.join(lockfileDir, 'node_modules')) + rimrafSync(path.join(lockfileDir, 'node_modules')) await headlessInstall(opts) expect(fs.existsSync(path.join(lockfileDir, 'node_modules/.pnpm/node_modules/diskusage/build/new-file.txt'))).toBeTruthy() diff --git a/pkg-manager/hoist/src/index.ts b/pkg-manager/hoist/src/index.ts index f9ab6d0ae0..da27870f1e 100644 --- a/pkg-manager/hoist/src/index.ts +++ b/pkg-manager/hoist/src/index.ts @@ -7,8 +7,8 @@ import { logger } from '@pnpm/logger' import { createMatcher } from '@pnpm/matcher' import type { DepPath, HoistedDependencies, ProjectId, DependenciesField } from '@pnpm/types' import { lexCompare } from '@pnpm/util.lex-comparator' -import isSubdir from 'is-subdir' -import resolveLinkTarget from 'resolve-link-target' +import { isSubdir } from 'is-subdir' +import { resolveLinkTarget } from 'resolve-link-target' import symlinkDir from 'symlink-dir' export interface DependenciesGraphNode { diff --git a/pkg-manager/link-bins/src/index.ts b/pkg-manager/link-bins/src/index.ts index 0088dc4643..ab5bde9286 100644 --- a/pkg-manager/link-bins/src/index.ts +++ b/pkg-manager/link-bins/src/index.ts @@ -11,8 +11,8 @@ import { readPackageJsonFromDir } from '@pnpm/read-package-json' import { safeReadProjectManifestOnly } from '@pnpm/read-project-manifest' import type { EngineDependency, DependencyManifest, ProjectManifest } from '@pnpm/types' import cmdShim from '@zkochan/cmd-shim' -import rimraf from '@zkochan/rimraf' -import isSubdir from 'is-subdir' +import { rimraf } from '@zkochan/rimraf' +import { isSubdir } from 'is-subdir' import isWindows from 'is-windows' import normalizePath from 'normalize-path' import { isEmpty, unnest, groupBy, partition } from 'ramda' diff --git a/pkg-manager/link-bins/test/index.ts b/pkg-manager/link-bins/test/index.ts index f0af9cfdfa..70d70ba331 100644 --- a/pkg-manager/link-bins/test/index.ts +++ b/pkg-manager/link-bins/test/index.ts @@ -3,7 +3,7 @@ import fs from 'fs' import path from 'path' import { fixtures } from '@pnpm/test-fixtures' import { jest } from '@jest/globals' -import CMD_EXTENSION from 'cmd-extension' +import { cmdExtension as CMD_EXTENSION } from 'cmd-extension' import isWindows from 'is-windows' import normalizePath from 'normalize-path' import { temporaryDirectory } from 'tempy' diff --git a/pkg-manager/modules-cleaner/src/prune.ts b/pkg-manager/modules-cleaner/src/prune.ts index f767167660..9de2cc5f46 100644 --- a/pkg-manager/modules-cleaner/src/prune.ts +++ b/pkg-manager/modules-cleaner/src/prune.ts @@ -23,7 +23,7 @@ import { type ProjectRootDir, } from '@pnpm/types' import { depPathToFilename } from '@pnpm/dependency-path' -import rimraf from '@zkochan/rimraf' +import { rimraf } from '@zkochan/rimraf' import { difference, equals, mergeAll, pickAll } from 'ramda' import { removeDirectDependency, removeIfEmpty } from './removeDirectDependency.js' diff --git a/pkg-manager/modules-cleaner/src/removeDirectDependency.ts b/pkg-manager/modules-cleaner/src/removeDirectDependency.ts index b034ee95f1..932593bb38 100644 --- a/pkg-manager/modules-cleaner/src/removeDirectDependency.ts +++ b/pkg-manager/modules-cleaner/src/removeDirectDependency.ts @@ -3,7 +3,7 @@ import { promises as fs } from 'fs' import { rootLogger } from '@pnpm/core-loggers' import { removeBin, removeBinsOfDependency } from '@pnpm/remove-bins' import type { DependenciesField, ProjectRootDir } from '@pnpm/types' -import rimraf from '@zkochan/rimraf' +import { rimraf } from '@zkochan/rimraf' export async function removeDirectDependency ( dependency: { diff --git a/pkg-manager/modules-yaml/src/index.ts b/pkg-manager/modules-yaml/src/index.ts index 0decd07dac..1ac7c4a8a4 100644 --- a/pkg-manager/modules-yaml/src/index.ts +++ b/pkg-manager/modules-yaml/src/index.ts @@ -7,7 +7,7 @@ import type { IgnoredBuilds, Registries, } from '@pnpm/types' -import readYamlFile from 'read-yaml-file' +import { readYamlFile } from 'read-yaml-file' import { map as mapValues } from 'ramda' import isWindows from 'is-windows' @@ -50,7 +50,7 @@ export async function readModulesManifest (modulesDir: string): Promise(modulesYamlPath) + modulesRaw = await readYamlFile(modulesYamlPath) if (!modulesRaw) return modulesRaw } catch (err: any) { // eslint-disable-line if ((err as NodeJS.ErrnoException).code !== 'ENOENT') { diff --git a/pkg-manager/modules-yaml/test/index.ts b/pkg-manager/modules-yaml/test/index.ts index 8d5c3b0d17..4c02375310 100644 --- a/pkg-manager/modules-yaml/test/index.ts +++ b/pkg-manager/modules-yaml/test/index.ts @@ -1,7 +1,7 @@ /// import path from 'path' import { readModulesManifest, writeModulesManifest, type StrictModules } from '@pnpm/modules-yaml' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import isWindows from 'is-windows' import { temporaryDirectory } from 'tempy' @@ -32,7 +32,7 @@ test('writeModulesManifest() and readModulesManifest()', async () => { await writeModulesManifest(modulesDir, modulesYaml) expect(await readModulesManifest(modulesDir)).toEqual(modulesYaml) - const raw = readYamlFile(path.join(modulesDir, '.modules.yaml')) // eslint-disable-line @typescript-eslint/no-explicit-any + const raw = readYamlFileSync(path.join(modulesDir, '.modules.yaml')) // eslint-disable-line @typescript-eslint/no-explicit-any expect(raw.virtualStoreDir).toBeDefined() expect(path.isAbsolute(raw.virtualStoreDir)).toEqual(isWindows()) }) diff --git a/pkg-manager/package-bins/src/index.ts b/pkg-manager/package-bins/src/index.ts index 259a261cdc..3a922d4a05 100644 --- a/pkg-manager/package-bins/src/index.ts +++ b/pkg-manager/package-bins/src/index.ts @@ -1,7 +1,7 @@ import path from 'path' import type { DependencyManifest, PackageBin } from '@pnpm/types' import { glob } from 'tinyglobby' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' export interface Command { name: string diff --git a/pkg-manager/package-requester/src/packageRequester.ts b/pkg-manager/package-requester/src/packageRequester.ts index f534a769be..51649de0a9 100644 --- a/pkg-manager/package-requester/src/packageRequester.ts +++ b/pkg-manager/package-requester/src/packageRequester.ts @@ -52,7 +52,7 @@ import { import { familySync } from 'detect-libc' import PQueue from 'p-queue' import pDefer, { type DeferredPromise } from 'p-defer' -import pShare from 'promise-share' +import { pShare } from 'promise-share' import { pick } from 'ramda' import ssri from 'ssri' diff --git a/pkg-manager/plugin-commands-installation/src/add.ts b/pkg-manager/plugin-commands-installation/src/add.ts index 5beb042855..5c6c6da068 100644 --- a/pkg-manager/plugin-commands-installation/src/add.ts +++ b/pkg-manager/plugin-commands-installation/src/add.ts @@ -6,7 +6,7 @@ import { PnpmError } from '@pnpm/error' import { handleGlobalAdd } from '@pnpm/global.commands' import { createStoreController } from '@pnpm/store-connection-manager' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { getFetchFullMetadata } from './getFetchFullMetadata.js' import type { InstallCommandOptions } from './install.js' import { installDeps } from './installDeps.js' diff --git a/pkg-manager/plugin-commands-installation/src/ci.ts b/pkg-manager/plugin-commands-installation/src/ci.ts index c22b15e2a1..e637471477 100644 --- a/pkg-manager/plugin-commands-installation/src/ci.ts +++ b/pkg-manager/plugin-commands-installation/src/ci.ts @@ -1,6 +1,6 @@ import { docsUrl } from '@pnpm/cli-utils' import { PnpmError } from '@pnpm/error' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' export const rcOptionsTypes = (): Record => ({}) diff --git a/pkg-manager/plugin-commands-installation/src/dedupe.ts b/pkg-manager/plugin-commands-installation/src/dedupe.ts index 0560503b4d..f03195f7f3 100644 --- a/pkg-manager/plugin-commands-installation/src/dedupe.ts +++ b/pkg-manager/plugin-commands-installation/src/dedupe.ts @@ -1,7 +1,7 @@ import { docsUrl } from '@pnpm/cli-utils' import { OPTIONS, UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-help' import { dedupeDiffCheck } from '@pnpm/dedupe.check' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { type InstallCommandOptions, rcOptionsTypes as installCommandRcOptionsTypes } from './install.js' import { installDeps } from './installDeps.js' import { omit } from 'ramda' diff --git a/pkg-manager/plugin-commands-installation/src/fetch.ts b/pkg-manager/plugin-commands-installation/src/fetch.ts index 84dc375353..2c66c69f76 100644 --- a/pkg-manager/plugin-commands-installation/src/fetch.ts +++ b/pkg-manager/plugin-commands-installation/src/fetch.ts @@ -4,7 +4,7 @@ import { type Config, getOptionsFromRootManifest } from '@pnpm/config' import { createStoreController, type CreateStoreControllerOptions } from '@pnpm/store-connection-manager' import { type InstallOptions, mutateModulesInSingleProject } from '@pnpm/core' import type { ProjectRootDir } from '@pnpm/types' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { cliOptionsTypes } from './install.js' export const rcOptionsTypes = cliOptionsTypes diff --git a/pkg-manager/plugin-commands-installation/src/import/index.ts b/pkg-manager/plugin-commands-installation/src/import/index.ts index 4f9d63d25a..f6749f16bd 100644 --- a/pkg-manager/plugin-commands-installation/src/import/index.ts +++ b/pkg-manager/plugin-commands-installation/src/import/index.ts @@ -15,10 +15,10 @@ import { findWorkspacePackages } from '@pnpm/workspace.find-packages' import type { ProjectsGraph, Project } from '@pnpm/types' import { logger } from '@pnpm/logger' import { sequenceGraph } from '@pnpm/sort-packages' -import rimraf from '@zkochan/rimraf' +import { rimraf } from '@zkochan/rimraf' import { loadJsonFile } from 'load-json-file' import { map as mapValues } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import yarnLockfileLib from '@yarnpkg/lockfile' import type { LockFileObject } from '@yarnpkg/lockfile' import * as structUtils from '@yarnpkg/core/structUtils' diff --git a/pkg-manager/plugin-commands-installation/src/install.ts b/pkg-manager/plugin-commands-installation/src/install.ts index 003ed045e5..a40258a3c1 100644 --- a/pkg-manager/plugin-commands-installation/src/install.ts +++ b/pkg-manager/plugin-commands-installation/src/install.ts @@ -5,7 +5,7 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import { PnpmError } from '@pnpm/error' import type { CreateStoreControllerOptions } from '@pnpm/store-connection-manager' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { getFetchFullMetadata } from './getFetchFullMetadata.js' import { installDeps, type InstallDepsOptions } from './installDeps.js' diff --git a/pkg-manager/plugin-commands-installation/src/link.ts b/pkg-manager/plugin-commands-installation/src/link.ts index 8eedcc86a8..7df35fe157 100644 --- a/pkg-manager/plugin-commands-installation/src/link.ts +++ b/pkg-manager/plugin-commands-installation/src/link.ts @@ -15,7 +15,7 @@ import type { } from '@pnpm/core' import { logger } from '@pnpm/logger' import { pick, partition } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { createProjectManifestWriter } from './createProjectManifestWriter.js' import { getSaveType } from './getSaveType.js' import * as install from './install.js' diff --git a/pkg-manager/plugin-commands-installation/src/prune.ts b/pkg-manager/plugin-commands-installation/src/prune.ts index fb8f84c5f6..7136dffbf1 100644 --- a/pkg-manager/plugin-commands-installation/src/prune.ts +++ b/pkg-manager/plugin-commands-installation/src/prune.ts @@ -2,7 +2,7 @@ import { docsUrl } from '@pnpm/cli-utils' import { UNIVERSAL_OPTIONS, OPTIONS } from '@pnpm/common-cli-options-help' import { types as allTypes } from '@pnpm/config' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import * as install from './install.js' export const rcOptionsTypes = cliOptionsTypes diff --git a/pkg-manager/plugin-commands-installation/src/recursive.ts b/pkg-manager/plugin-commands-installation/src/recursive.ts index 5e1c276954..7d20537d7e 100755 --- a/pkg-manager/plugin-commands-installation/src/recursive.ts +++ b/pkg-manager/plugin-commands-installation/src/recursive.ts @@ -45,7 +45,7 @@ import { type UpdateMatchingFunction, type WorkspacePackages, } from '@pnpm/core' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' import pFilter from 'p-filter' import pLimit from 'p-limit' import { createWorkspaceSpecs, updateToWorkspacePackagesFromManifest } from './updateWorkspaceDependencies.js' diff --git a/pkg-manager/plugin-commands-installation/src/remove.ts b/pkg-manager/plugin-commands-installation/src/remove.ts index 31eb765be1..b0bcf79133 100644 --- a/pkg-manager/plugin-commands-installation/src/remove.ts +++ b/pkg-manager/plugin-commands-installation/src/remove.ts @@ -16,7 +16,7 @@ import { createStoreController, type CreateStoreControllerOptions } from '@pnpm/ import type { DependenciesField, ProjectRootDir, Project } from '@pnpm/types' import { mutateModulesInSingleProject } from '@pnpm/core' import { pick, without } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { getSaveType } from './getSaveType.js' import { recursive } from './recursive.js' diff --git a/pkg-manager/plugin-commands-installation/src/unlink.ts b/pkg-manager/plugin-commands-installation/src/unlink.ts index 29a30db4f1..f5dddbcd72 100644 --- a/pkg-manager/plugin-commands-installation/src/unlink.ts +++ b/pkg-manager/plugin-commands-installation/src/unlink.ts @@ -1,6 +1,6 @@ import { docsUrl } from '@pnpm/cli-utils' import { UNIVERSAL_OPTIONS } from '@pnpm/common-cli-options-help' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { createProjectManifestWriter } from './createProjectManifestWriter.js' import * as install from './install.js' diff --git a/pkg-manager/plugin-commands-installation/src/update/index.ts b/pkg-manager/plugin-commands-installation/src/update/index.ts index 5efd9695f4..07ca858e17 100644 --- a/pkg-manager/plugin-commands-installation/src/update/index.ts +++ b/pkg-manager/plugin-commands-installation/src/update/index.ts @@ -15,7 +15,7 @@ import type { IncludedDependencies, ProjectRootDir } from '@pnpm/types' import enquirer from 'enquirer' import chalk from 'chalk' import { pick, pluck, unnest } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import type { InstallCommandOptions } from '../install.js' import { installDeps } from '../installDeps.js' import { type ChoiceRow, getUpdateChoices } from './getUpdateChoices.js' diff --git a/pkg-manager/plugin-commands-installation/test/addRecursive.ts b/pkg-manager/plugin-commands-installation/test/addRecursive.ts index 3667d8040a..d554810860 100644 --- a/pkg-manager/plugin-commands-installation/test/addRecursive.ts +++ b/pkg-manager/plugin-commands-installation/test/addRecursive.ts @@ -4,7 +4,7 @@ import type { LockfileObject } from '@pnpm/lockfile.types' import { add } from '@pnpm/plugin-commands-installation' import { preparePackages } from '@pnpm/prepare' import type { ProjectId } from '@pnpm/types' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { DEFAULT_OPTS } from './utils/index.js' test('recursive add --save-dev, --save-peer on workspace with multiple lockfiles', async () => { @@ -160,7 +160,7 @@ test('recursive add --save-dev, --save-peer on workspace with single lockfile', ) } - const lockfile = readYamlFile('./pnpm-lock.yaml') + const lockfile = readYamlFileSync('./pnpm-lock.yaml') expect( lockfile.importers['project-1' as ProjectId].devDependencies ).toEqual( diff --git a/pkg-manager/plugin-commands-installation/test/dedupe.ts b/pkg-manager/plugin-commands-installation/test/dedupe.ts index 70c27aa047..e40e8950c0 100644 --- a/pkg-manager/plugin-commands-installation/test/dedupe.ts +++ b/pkg-manager/plugin-commands-installation/test/dedupe.ts @@ -8,7 +8,7 @@ import { prepare } from '@pnpm/prepare' import { fixtures } from '@pnpm/test-fixtures' import { createTestIpcServer } from '@pnpm/test-ipc-server' import { diff } from 'jest-diff' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { DEFAULT_OPTS } from './utils/index.js' const f = fixtures(import.meta.dirname) @@ -157,7 +157,7 @@ async function testFixture (fixtureName: string) { resolutionMode: 'highest' as const, // TODO: this should work with the default resolution mode (TODOv8) } - const readProjectLockfile = () => readYamlFile(path.join(project.dir(), './pnpm-lock.yaml')) + const readProjectLockfile = () => readYamlFileSync(path.join(project.dir(), './pnpm-lock.yaml')) const originalLockfile = readProjectLockfile() diff --git a/pkg-manager/plugin-commands-installation/test/fetch.ts b/pkg-manager/plugin-commands-installation/test/fetch.ts index a6b1124409..0e68d99a8c 100644 --- a/pkg-manager/plugin-commands-installation/test/fetch.ts +++ b/pkg-manager/plugin-commands-installation/test/fetch.ts @@ -6,7 +6,7 @@ import { prepare } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { closeAllStoreIndexes } from '@pnpm/store.index' import { finishWorkers } from '@pnpm/worker' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' const REGISTRY_URL = `http://localhost:${REGISTRY_MOCK_PORT}` @@ -56,8 +56,8 @@ test('fetch dependencies', async () => { storeDir, }) - rimraf(path.resolve(project.dir(), 'node_modules')) - rimraf(path.resolve(project.dir(), './package.json')) + rimrafSync(path.resolve(project.dir(), 'node_modules')) + rimrafSync(path.resolve(project.dir(), './package.json')) project.storeHasNot('is-negative') project.storeHasNot('is-positive') @@ -87,8 +87,8 @@ test('fetch production dependencies', async () => { storeDir, }) - rimraf(path.resolve(project.dir(), 'node_modules')) - rimraf(path.resolve(project.dir(), './package.json')) + rimrafSync(path.resolve(project.dir(), 'node_modules')) + rimrafSync(path.resolve(project.dir(), './package.json')) project.storeHasNot('is-negative') project.storeHasNot('is-positive') @@ -119,8 +119,8 @@ test('fetch only dev dependencies', async () => { storeDir, }) - rimraf(path.resolve(project.dir(), 'node_modules')) - rimraf(path.resolve(project.dir(), './package.json')) + rimrafSync(path.resolve(project.dir(), 'node_modules')) + rimrafSync(path.resolve(project.dir(), './package.json')) project.storeHasNot('is-negative') project.storeHasNot('is-positive') @@ -166,10 +166,10 @@ test('fetch skips file: protocol dependencies that do not exist', async () => { storeDir, }) - rimraf(path.resolve(project.dir(), 'node_modules')) - rimraf(path.resolve(project.dir(), './package.json')) + rimrafSync(path.resolve(project.dir(), 'node_modules')) + rimrafSync(path.resolve(project.dir(), './package.json')) // Remove the local package directory to simulate Docker build scenario - rimraf(localPkgDir) + rimrafSync(localPkgDir) project.storeHasNot('is-positive') @@ -211,7 +211,7 @@ test('fetch populates global virtual store links/', async () => { closeAllStoreIndexes() // Remove the store — simulate a cold start with only the lockfile - rimraf(storeDir) + rimrafSync(storeDir) // Fetch with enableGlobalVirtualStore — should populate links/ await fetch.handler({ diff --git a/pkg-manager/plugin-commands-installation/test/install.ts b/pkg-manager/plugin-commands-installation/test/install.ts index adafbe36bc..a69056ab4c 100644 --- a/pkg-manager/plugin-commands-installation/test/install.ts +++ b/pkg-manager/plugin-commands-installation/test/install.ts @@ -4,7 +4,7 @@ import path from 'path' import { STORE_VERSION } from '@pnpm/constants' import { add, install } from '@pnpm/plugin-commands-installation' import { prepare, prepareEmpty } from '@pnpm/prepare' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { loadJsonFileSync } from 'load-json-file' import { DEFAULT_OPTS } from './utils/index.js' @@ -46,7 +46,7 @@ test('install with no store integrity validation', async () => { const readmePath = path.join(DEFAULT_OPTS.storeDir, STORE_VERSION, 'files/9a/f6af85f55c111108eddf1d7ef7ef224b812e7c7bfabae41c79cf8bc9a910352536963809463e0af2799abacb975f22418a35a1d170055ef3fdc3b2a46ef1c5') fs.writeFileSync(readmePath, 'modified', 'utf8') - rimraf('node_modules') + rimrafSync('node_modules') await install.handler({ ...DEFAULT_OPTS, diff --git a/pkg-manager/plugin-commands-installation/test/link.ts b/pkg-manager/plugin-commands-installation/test/link.ts index cd2e1a7534..ae04477e68 100644 --- a/pkg-manager/plugin-commands-installation/test/link.ts +++ b/pkg-manager/plugin-commands-installation/test/link.ts @@ -4,10 +4,10 @@ import { prepare, preparePackages, prepareEmpty } from '@pnpm/prepare' import { isExecutable, assertProject } from '@pnpm/assert-project' import { fixtures } from '@pnpm/test-fixtures' import PATH from 'path-name' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { writePackageSync } from 'write-package' import { jest } from '@jest/globals' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { DEFAULT_OPTS } from './utils/index.js' const original = await import('@pnpm/logger') @@ -102,7 +102,7 @@ test('relative link', async () => { project.isExecutable('.bin/hello-world-js-bin') - const manifest = readYamlFile<{ overrides?: Record }>('pnpm-workspace.yaml') + const manifest = readYamlFileSync<{ overrides?: Record }>('pnpm-workspace.yaml') expect(manifest.overrides?.['@pnpm.e2e/hello-world-js-bin']).toBe('link:../hello-world-js-bin') const wantedLockfile = project.readLockfile() @@ -275,7 +275,7 @@ test('relative link from workspace package', async () => { } writePackageSync('workspace/packages/project', rootProjectManifest) const workspaceDir = path.resolve('workspace') - writeYamlFile(path.join(workspaceDir, 'pnpm-workspace.yaml'), { packages: ['packages/*'] }) + writeYamlFileSync(path.join(workspaceDir, 'pnpm-workspace.yaml'), { packages: ['packages/*'] }) f.copy('hello-world-js-bin', 'hello-world-js-bin') @@ -296,7 +296,7 @@ test('relative link from workspace package', async () => { workspacePackagePatterns: ['packages/*'], }, ['../../../hello-world-js-bin']) - const manifest = readYamlFile<{ overrides?: Record }>(path.join(workspaceDir, 'pnpm-workspace.yaml')) + const manifest = readYamlFileSync<{ overrides?: Record }>(path.join(workspaceDir, 'pnpm-workspace.yaml')) expect(manifest.overrides?.['@pnpm.e2e/hello-world-js-bin']).toBe('link:../hello-world-js-bin') const workspace = assertProject(workspaceDir) diff --git a/pkg-manager/plugin-commands-installation/test/miscRecursive.ts b/pkg-manager/plugin-commands-installation/test/miscRecursive.ts index f5a38785b9..71abf30a42 100644 --- a/pkg-manager/plugin-commands-installation/test/miscRecursive.ts +++ b/pkg-manager/plugin-commands-installation/test/miscRecursive.ts @@ -7,10 +7,10 @@ import { add, install, remove, update } from '@pnpm/plugin-commands-installation import { preparePackages } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' import type { ProjectManifest } from '@pnpm/types' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { loadJsonFile } from 'load-json-file' import { writeJsonFileSync } from 'write-json-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { DEFAULT_OPTS } from './utils/index.js' import symlinkDir from 'symlink-dir' @@ -216,7 +216,7 @@ test('running `pnpm recursive` on a subset of packages', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['project-1'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['project-1'] }) await install.handler({ ...DEFAULT_OPTS, @@ -396,7 +396,7 @@ test('recursive --filter ignore excluded packages', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: [ '**', '!project-1', @@ -617,7 +617,7 @@ test('recursive install on workspace with custom lockfile-dir', async () => { workspaceDir: process.cwd(), }) - const lockfile = readYamlFile(path.join(lockfileDir, 'pnpm-lock.yaml')) + const lockfile = readYamlFileSync(path.join(lockfileDir, 'pnpm-lock.yaml')) expect(Object.keys(lockfile.importers!)).toStrictEqual(['../project-1', '../project-2']) }) @@ -736,7 +736,7 @@ test('prefer-workspace-package', async () => { workspaceDir: process.cwd(), }) - const lockfile = readYamlFile(path.resolve('pnpm-lock.yaml')) + const lockfile = readYamlFileSync(path.resolve('pnpm-lock.yaml')) expect(lockfile.importers?.['project-1'].dependencies?.['@pnpm.e2e/foo'].version).toBe('link:../foo') }) diff --git a/pkg-manager/plugin-commands-installation/test/remove/workspace.ts b/pkg-manager/plugin-commands-installation/test/remove/workspace.ts index c0396a4c86..007b0988af 100644 --- a/pkg-manager/plugin-commands-installation/test/remove/workspace.ts +++ b/pkg-manager/plugin-commands-installation/test/remove/workspace.ts @@ -3,7 +3,7 @@ import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir' import type { LockfileFile } from '@pnpm/lockfile.types' import { install, remove } from '@pnpm/plugin-commands-installation' import { preparePackages } from '@pnpm/prepare' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { DEFAULT_OPTS } from '../utils/index.js' test('remove --filter only changes the specified dependency, when run with link-workspace-packages=false', async () => { @@ -71,7 +71,7 @@ test('remove --filter only changes the specified dependency, when run with link- projects['project-2'].hasNot('is-negative') // The lockfile agrees with the above - const lockfile = readYamlFile('./pnpm-lock.yaml') + const lockfile = readYamlFileSync('./pnpm-lock.yaml') expect(lockfile.importers?.['project-1'].dependencies?.['is-negative']).toStrictEqual({ specifier: '1.0.0', @@ -151,7 +151,7 @@ test('remove from within a workspace package dir only affects the specified depe projects['project-2'].hasNot('is-negative') // The lockfile agrees with the above - const lockfile = readYamlFile('./pnpm-lock.yaml') + const lockfile = readYamlFileSync('./pnpm-lock.yaml') expect(lockfile.importers?.['project-1'].dependencies?.['is-negative']).toStrictEqual({ specifier: '1.0.0', diff --git a/pkg-manager/plugin-commands-installation/test/saveCatalog.ts b/pkg-manager/plugin-commands-installation/test/saveCatalog.ts index b97a9b1f84..34de8f0609 100644 --- a/pkg-manager/plugin-commands-installation/test/saveCatalog.ts +++ b/pkg-manager/plugin-commands-installation/test/saveCatalog.ts @@ -5,7 +5,7 @@ import { prepare, preparePackages } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' import type { LockfileFile } from '@pnpm/lockfile.types' import { loadJsonFileSync } from 'load-json-file' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import nock from 'nock' import { DEFAULT_OPTS } from './utils/index.js' @@ -38,7 +38,7 @@ test('saveCatalogName creates new workspace manifest with the new catalogs', asy '@pnpm.e2e/foo': 'catalog:', }) - expect(readYamlFile('pnpm-workspace.yaml')).toHaveProperty(['catalog'], { + expect(readYamlFileSync('pnpm-workspace.yaml')).toHaveProperty(['catalog'], { '@pnpm.e2e/foo': '^100.1.0', }) @@ -95,7 +95,7 @@ test('saveCatalogName works with different protocols', async () => { 'is-positive': 'catalog:', }) - expect(readYamlFile('pnpm-workspace.yaml')).toHaveProperty(['catalog'], { + expect(readYamlFileSync('pnpm-workspace.yaml')).toHaveProperty(['catalog'], { '@pnpm.e2e/foo': '100.1.0', '@rus/greet': 'jsr:0.0.3', 'is-positive': 'github:kevva/is-positive#97edff6', @@ -171,8 +171,8 @@ test('saveCatalogName does not work with local dependencies', async () => { expect(fs.existsSync('pnpm-workspace.yaml')).toBe(false) - expect(readYamlFile('pnpm-lock.yaml')).not.toHaveProperty(['catalog']) - expect(readYamlFile('pnpm-lock.yaml')).not.toHaveProperty(['catalogs']) + expect(readYamlFileSync('pnpm-lock.yaml')).not.toHaveProperty(['catalog']) + expect(readYamlFileSync('pnpm-lock.yaml')).not.toHaveProperty(['catalogs']) }) test('saveCatalogName with non-default name', async () => { @@ -190,7 +190,7 @@ test('saveCatalogName with non-default name', async () => { '@pnpm.e2e/foo': 'catalog:my-catalog', }) - expect(readYamlFile('pnpm-workspace.yaml')).toHaveProperty(['catalogs', 'my-catalog'], { + expect(readYamlFileSync('pnpm-workspace.yaml')).toHaveProperty(['catalogs', 'my-catalog'], { '@pnpm.e2e/foo': '^100.1.0', }) diff --git a/pkg-manager/plugin-commands-installation/test/update/interactive.ts b/pkg-manager/plugin-commands-installation/test/update/interactive.ts index 94e716a1af..577580062a 100644 --- a/pkg-manager/plugin-commands-installation/test/update/interactive.ts +++ b/pkg-manager/plugin-commands-installation/test/update/interactive.ts @@ -4,7 +4,7 @@ import type { LockfileObject } from '@pnpm/lockfile.types' 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 { readYamlFileSync } from 'read-yaml-file' import chalk from 'chalk' jest.unstable_mockModule('enquirer', () => ({ default: { prompt: jest.fn() } })) @@ -268,7 +268,7 @@ test('interactive update of dev dependencies only', async () => { workspaceDir: process.cwd(), }) - const lockfile = readYamlFile('pnpm-lock.yaml') + const lockfile = readYamlFileSync('pnpm-lock.yaml') expect(Object.keys(lockfile.packages ?? {})).toStrictEqual([ 'is-negative@1.0.1', diff --git a/pkg-manager/plugin-commands-installation/test/update/recursive.ts b/pkg-manager/plugin-commands-installation/test/update/recursive.ts index 8ec03a2b47..17d28c6056 100644 --- a/pkg-manager/plugin-commands-installation/test/update/recursive.ts +++ b/pkg-manager/plugin-commands-installation/test/update/recursive.ts @@ -6,7 +6,7 @@ import { install, update } from '@pnpm/plugin-commands-installation' import { preparePackages } from '@pnpm/prepare' import { readProjectManifestOnly } from '@pnpm/read-project-manifest' import { addDistTag } from '@pnpm/registry-mock' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { DEFAULT_OPTS } from '../utils/index.js' test('recursive update', async () => { @@ -109,7 +109,7 @@ test('recursive update prod dependencies only', async () => { workspaceDir: process.cwd(), }) - const lockfile = readYamlFile('./pnpm-lock.yaml') + const lockfile = readYamlFileSync('./pnpm-lock.yaml') expect( Object.keys(lockfile.packages ?? {}) ).toStrictEqual( @@ -314,7 +314,7 @@ test('recursive update --latest foo should only update projects that have foo', workspaceDir: process.cwd(), }, ['@zkochan/async-regex-replace', '@pnpm.e2e/foo']) - const lockfile = readYamlFile('./pnpm-lock.yaml') + const lockfile = readYamlFileSync('./pnpm-lock.yaml') expect(Object.keys(lockfile.packages ?? {}).sort()).toStrictEqual([ '@zkochan/async-regex-replace@0.2.0', diff --git a/pkg-manager/read-projects-context/src/index.ts b/pkg-manager/read-projects-context/src/index.ts index d9644320f5..1c2ad5c4ca 100644 --- a/pkg-manager/read-projects-context/src/index.ts +++ b/pkg-manager/read-projects-context/src/index.ts @@ -13,7 +13,7 @@ import type { ProjectRootDir, ProjectRootDirRealPath, } from '@pnpm/types' -import realpathMissing from 'realpath-missing' +import { realpathMissing } from 'realpath-missing' export interface ProjectOptions { binsDir?: string diff --git a/pkg-manager/remove-bins/src/removeBins.ts b/pkg-manager/remove-bins/src/removeBins.ts index f21f9d258d..b6db880830 100644 --- a/pkg-manager/remove-bins/src/removeBins.ts +++ b/pkg-manager/remove-bins/src/removeBins.ts @@ -5,8 +5,8 @@ import { import { getBinsFromPackageManifest } from '@pnpm/package-bins' import { safeReadPackageJsonFromDir } from '@pnpm/read-package-json' import type { DependencyManifest } from '@pnpm/types' -import rimraf from '@zkochan/rimraf' -import CMD_EXTENSION from 'cmd-extension' +import { rimraf } from '@zkochan/rimraf' +import { cmdExtension as CMD_EXTENSION } from 'cmd-extension' import isWindows from 'is-windows' async function removeOnWin (cmd: string): Promise { diff --git a/pkg-manager/resolve-dependencies/src/index.ts b/pkg-manager/resolve-dependencies/src/index.ts index 988549d2ca..dc60a2ebe5 100644 --- a/pkg-manager/resolve-dependencies/src/index.ts +++ b/pkg-manager/resolve-dependencies/src/index.ts @@ -29,7 +29,7 @@ import { type PkgIdWithPatchHash, } from '@pnpm/types' import { difference, zipWith } from 'ramda' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' import { getWantedDependencies, type WantedDependency } from './getWantedDependencies.js' import { depPathToRef } from './depPathToRef.js' import type { NodeId } from './nextNodeId.js' diff --git a/pkg-manager/resolve-dependencies/src/resolveDependencies.ts b/pkg-manager/resolve-dependencies/src/resolveDependencies.ts index 0dc595fb0a..25d6d5082b 100644 --- a/pkg-manager/resolve-dependencies/src/resolveDependencies.ts +++ b/pkg-manager/resolve-dependencies/src/resolveDependencies.ts @@ -50,7 +50,7 @@ import type { PatchInfo } from '@pnpm/patching.types' import normalizePath from 'normalize-path' import { pathExists } from 'path-exists' import pDefer from 'p-defer' -import pShare from 'promise-share' +import { pShare } from 'promise-share' import { pickBy, omit, zipWith } from 'ramda' import semver from 'semver' import { getExactSinglePreferredVersions } from './getExactSinglePreferredVersions.js' diff --git a/pkg-manager/resolve-dependencies/src/safeIsInnerLink.ts b/pkg-manager/resolve-dependencies/src/safeIsInnerLink.ts index b07c9fd729..255b114c3d 100644 --- a/pkg-manager/resolve-dependencies/src/safeIsInnerLink.ts +++ b/pkg-manager/resolve-dependencies/src/safeIsInnerLink.ts @@ -1,8 +1,8 @@ import path from 'path' import { logger } from '@pnpm/logger' -import isInnerLink from 'is-inner-link' -import isSubdir from 'is-subdir' -import renameOverwrite from 'rename-overwrite' +import { isInnerLink } from 'is-inner-link' +import { isSubdir } from 'is-subdir' +import { renameOverwrite } from 'rename-overwrite' export async function safeIsInnerLink ( projectModulesDir: string, diff --git a/pkg-manifest/exportable-manifest/src/index.ts b/pkg-manifest/exportable-manifest/src/index.ts index 982949e13d..151331d22a 100644 --- a/pkg-manifest/exportable-manifest/src/index.ts +++ b/pkg-manifest/exportable-manifest/src/index.ts @@ -7,7 +7,7 @@ import { tryReadProjectManifest } from '@pnpm/read-project-manifest' import type { Hooks } from '@pnpm/pnpmfile' import type { Dependencies, ProjectManifest } from '@pnpm/types' import { omit } from 'ramda' -import pMapValues from 'p-map-values' +import { pMapValues } from 'p-map-values' import { overridePublishConfig } from './overridePublishConfig.js' import { type ExportedManifest, transform } from './transform/index.js' @@ -105,8 +105,8 @@ async function makePublishDependencies ( { modulesDir, convertDependencyForPublish }: MakePublishDependenciesOpts ): Promise { if (dependencies == null) return dependencies - const publishDependencies = await pMapValues.default( - async (depSpec, depName) => convertDependencyForPublish(depName, depSpec, dir, modulesDir), + const publishDependencies = await pMapValues( + async (depSpec: string, depName: string) => convertDependencyForPublish(depName, depSpec, dir, modulesDir), dependencies ) return publishDependencies diff --git a/pkg-manifest/exportable-manifest/test/beforePackingHook.test.ts b/pkg-manifest/exportable-manifest/test/beforePackingHook.test.ts index 3007b28c08..541ab1d9bb 100644 --- a/pkg-manifest/exportable-manifest/test/beforePackingHook.test.ts +++ b/pkg-manifest/exportable-manifest/test/beforePackingHook.test.ts @@ -2,7 +2,7 @@ import fs from 'fs' import { createExportableManifest, type MakePublishManifestOptions } from '@pnpm/exportable-manifest' import { requireHooks } from '@pnpm/pnpmfile' import { prepare } from '@pnpm/prepare' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' const defaultOpts: MakePublishManifestOptions = { catalogs: {}, @@ -82,7 +82,7 @@ module.exports = { }, }, }`, 'utf8') - writeYamlFile('pnpm-workspace.yaml', { pnpmfile: pnpmfiles }) + writeYamlFileSync('pnpm-workspace.yaml', { pnpmfile: pnpmfiles }) const { hooks } = await requireHooks(process.cwd(), { pnpmfiles }) expect(await createExportableManifest(process.cwd(), { diff --git a/pkg-manifest/exportable-manifest/test/index.test.ts b/pkg-manifest/exportable-manifest/test/index.test.ts index 49d0884cfe..0dd79b73cb 100644 --- a/pkg-manifest/exportable-manifest/test/index.test.ts +++ b/pkg-manifest/exportable-manifest/test/index.test.ts @@ -2,7 +2,7 @@ import { getCatalogsFromWorkspaceManifest } from '@pnpm/catalogs.config' import { type MakePublishManifestOptions, createExportableManifest } from '@pnpm/exportable-manifest' import { preparePackages } from '@pnpm/prepare' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import type { ProjectManifest } from '@pnpm/types' import crossSpawn from 'cross-spawn' import path from 'path' @@ -157,7 +157,7 @@ test('workspace deps are replaced', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) crossSpawn.sync(pnpmBin, ['install', '--store-dir=store']) @@ -221,7 +221,7 @@ test('catalog deps are replaced', async () => { }, }, } - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) crossSpawn.sync(pnpmBin, ['install', '--store-dir=store']) diff --git a/pkg-manifest/read-project-manifest/src/index.ts b/pkg-manifest/read-project-manifest/src/index.ts index a60bf08eb4..9ca5cc447c 100644 --- a/pkg-manifest/read-project-manifest/src/index.ts +++ b/pkg-manifest/read-project-manifest/src/index.ts @@ -5,7 +5,7 @@ import type { ProjectManifest, EngineDependency } from '@pnpm/types' import { convertEnginesRuntimeToDependencies } from '@pnpm/manifest-utils' import { extractComments, type CommentSpecifier } from '@pnpm/text.comments-parser' import { writeProjectManifest } from '@pnpm/write-project-manifest' -import readYamlFile from 'read-yaml-file' +import { readYamlFile } from 'read-yaml-file' import detectIndent from 'detect-indent' import equal from 'fast-deep-equal' import isWindows from 'is-windows' @@ -188,7 +188,7 @@ export async function readExactProjectManifest (manifestPath: string): Promise { try { - return await readYamlFile.default(filePath) + return await readYamlFile(filePath) } catch (err: any) { // eslint-disable-line if (err.name !== 'YAMLException') throw err err.message = `${err.message as string}\nin ${filePath}` diff --git a/pkg-manifest/write-project-manifest/src/index.ts b/pkg-manifest/write-project-manifest/src/index.ts index 9e3c8ddb5c..002e6b79e0 100644 --- a/pkg-manifest/write-project-manifest/src/index.ts +++ b/pkg-manifest/write-project-manifest/src/index.ts @@ -4,7 +4,7 @@ import { insertComments, type CommentSpecifier } from '@pnpm/text.comments-parse import type { ProjectManifest } from '@pnpm/types' import JSON5 from 'json5' import writeFileAtomic from 'write-file-atomic' -import writeYamlFile from 'write-yaml-file' +import { writeYamlFile } from 'write-yaml-file' const YAML_FORMAT = { noCompatMode: true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 091e802420..3abc984fae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -250,8 +250,8 @@ catalogs: specifier: ^0.2.0 version: 0.2.0 '@zkochan/rimraf': - specifier: ^3.0.2 - version: 3.0.2 + specifier: ^4.0.0 + version: 4.0.0 '@zkochan/table': specifier: ^2.0.1 version: 2.0.1 @@ -265,8 +265,8 @@ catalogs: specifier: ^1.0.0 version: 1.0.0 better-path-resolve: - specifier: 1.0.0 - version: 1.0.0 + specifier: 2.0.0 + version: 2.0.0 bin-links: specifier: ^5.0.0 version: 5.0.0 @@ -286,11 +286,11 @@ catalogs: specifier: ^10.0.1 version: 10.0.2 can-link: + specifier: ^3.0.0 + version: 3.0.0 + can-write-to-dir: specifier: ^2.0.0 version: 2.0.0 - can-write-to-dir: - specifier: ^1.1.1 - version: 1.1.1 chalk: specifier: ^5.6.0 version: 5.6.2 @@ -304,11 +304,11 @@ catalogs: specifier: ^4.0.0 version: 4.0.0 cmd-extension: - specifier: ^1.0.2 - version: 1.0.2 + specifier: ^2.0.0 + version: 2.0.0 comver-to-semver: - specifier: ^1.0.0 - version: 1.0.0 + specifier: ^2.0.0 + version: 2.0.0 concurrently: specifier: 9.2.1 version: 9.2.1 @@ -340,8 +340,8 @@ catalogs: specifier: ^5.1.0 version: 5.1.0 dir-is-case-sensitive: - specifier: ^2.0.0 - version: 2.0.0 + specifier: ^3.0.0 + version: 3.0.0 encode-registry: specifier: ^3.0.1 version: 3.0.1 @@ -373,8 +373,8 @@ catalogs: specifier: ^2.10.0 version: 2.10.0 execa: - specifier: npm:safe-execa@0.2.0 - version: 0.2.0 + specifier: npm:safe-execa@0.3.0 + version: 0.3.0 exists-link: specifier: 2.0.0 version: 2.0.0 @@ -409,8 +409,8 @@ catalogs: specifier: ^4.2.11 version: 4.2.11 graceful-git: - specifier: ^4.0.0 - version: 4.0.0 + specifier: ^5.0.0 + version: 5.0.0 graph-cycles: specifier: 3.0.0 version: 3.0.0 @@ -433,11 +433,11 @@ catalogs: specifier: 2.0.0 version: 2.0.0 is-inner-link: - specifier: ^4.0.0 - version: 4.0.0 + specifier: ^5.0.0 + version: 5.0.0 is-subdir: - specifier: ^1.2.0 - version: 1.2.0 + specifier: ^2.0.0 + version: 2.0.0 is-windows: specifier: ^1.0.2 version: 1.0.2 @@ -481,8 +481,8 @@ catalogs: specifier: ^11.1.0 version: 11.2.6 make-empty-dir: - specifier: ^3.0.2 - version: 3.0.2 + specifier: ^4.0.0 + version: 4.0.0 mdast-util-to-string: specifier: ^2.0.0 version: 2.0.0 @@ -535,8 +535,8 @@ catalogs: specifier: ^7.1.0 version: 7.3.0 p-map-values: - specifier: ^1.0.0 - version: 1.0.0 + specifier: ^0.1.0 + version: 0.1.0 p-memoize: specifier: 8.0.0 version: 8.0.0 @@ -550,8 +550,8 @@ catalogs: specifier: ^4.0.0 version: 4.0.0 path-absolute: - specifier: ^1.0.1 - version: 1.0.1 + specifier: ^2.0.0 + version: 2.0.0 path-exists: specifier: ^5.0.0 version: 5.0.0 @@ -559,14 +559,14 @@ catalogs: specifier: ^1.0.0 version: 1.0.0 path-temp: - specifier: ^2.1.1 - version: 2.1.1 + specifier: ^3.0.0 + version: 3.0.0 pidtree: specifier: ^0.6.0 version: 0.6.0 preferred-pm: - specifier: ^3.1.4 - version: 3.1.4 + specifier: ^5.0.0 + version: 5.0.0 pretty-bytes: specifier: ^7.0.1 version: 7.1.0 @@ -574,8 +574,8 @@ catalogs: specifier: ^9.2.0 version: 9.3.0 promise-share: - specifier: ^1.0.0 - version: 1.0.0 + specifier: ^2.0.0 + version: 2.0.0 proxyquire: specifier: ^2.1.3 version: 2.1.3 @@ -586,14 +586,14 @@ catalogs: specifier: npm:@pnpm/ramda@0.28.1 version: 0.28.1 read-ini-file: - specifier: 4.0.0 - version: 4.0.0 + specifier: 5.0.0 + version: 5.0.0 read-yaml-file: - specifier: ^2.1.0 - version: 2.1.0 + specifier: ^3.0.0 + version: 3.0.0 realpath-missing: - specifier: ^1.1.0 - version: 1.1.0 + specifier: ^2.0.0 + version: 2.0.0 remark-parse: specifier: ^9.0.0 version: 9.0.0 @@ -601,23 +601,23 @@ catalogs: specifier: ^9.0.1 version: 9.0.1 rename-overwrite: - specifier: ^6.0.6 - version: 6.0.6 + specifier: ^7.0.0 + version: 7.0.0 render-help: - specifier: ^1.0.3 - version: 1.0.3 - resolve-link-target: specifier: ^2.0.0 version: 2.0.0 + resolve-link-target: + specifier: ^3.0.0 + version: 3.0.0 rimraf: specifier: ^6.1.2 version: 6.1.3 root-link-target: - specifier: ^3.1.0 - version: 3.1.0 - run-groups: specifier: ^4.0.0 version: 4.0.0 + run-groups: + specifier: ^5.0.0 + version: 5.0.0 rxjs: specifier: ^7.8.2 version: 7.8.2 @@ -625,11 +625,11 @@ catalogs: specifier: 5.2.1 version: 5.2.1 safe-execa: - specifier: ^0.2.0 - version: 0.2.0 + specifier: ^0.3.0 + version: 0.3.0 safe-promise-defer: - specifier: ^1.0.1 - version: 1.0.1 + specifier: ^2.0.0 + version: 2.0.0 sanitize-filename: specifier: ^1.6.3 version: 1.6.3 @@ -724,20 +724,20 @@ catalogs: specifier: ^7.0.0 version: 7.0.1 write-ini-file: - specifier: 4.0.1 - version: 4.0.1 + specifier: 5.0.0 + version: 5.0.0 write-json-file: specifier: ^7.0.0 version: 7.0.0 write-json5-file: - specifier: ^3.1.0 - version: 3.1.0 + specifier: ^4.0.0 + version: 4.0.0 write-package: specifier: 7.2.0 version: 7.2.0 write-yaml-file: - specifier: ^5.0.0 - version: 5.0.0 + specifier: ^6.0.0 + version: 6.0.0 yaml: specifier: ^2.8.1 version: 2.8.2 @@ -908,7 +908,7 @@ importers: version: 3.0.2 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 load-json-file: specifier: 'catalog:' version: 7.0.1 @@ -972,7 +972,7 @@ importers: version: 2.0.0 read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 write-package: specifier: 'catalog:' version: 7.2.0 @@ -1109,13 +1109,13 @@ importers: version: link:../../packages/types write-json5-file: specifier: 'catalog:' - version: 3.1.0 + version: 4.0.0 write-package: specifier: 'catalog:' version: 7.2.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 devDependencies: '@pnpm/prepare': specifier: workspace:* @@ -1143,13 +1143,13 @@ importers: version: 1000.3.0 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 fast-glob: specifier: 'catalog:' version: 3.3.3 make-empty-dir: specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 normalize-path: specifier: 'catalog:' version: 3.0.0 @@ -1202,7 +1202,7 @@ importers: version: 22.19.15 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 __utils__/tsconfig: devDependencies: @@ -1298,7 +1298,7 @@ importers: version: 7.3.0 run-groups: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -1341,7 +1341,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -1387,10 +1387,10 @@ importers: version: 0.29.12 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 building/during-install: dependencies: @@ -1447,7 +1447,7 @@ importers: version: '@pnpm/ramda@0.28.1' run-groups: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 devDependencies: '@pnpm/building.during-install': specifier: workspace:* @@ -1519,7 +1519,7 @@ importers: version: 2.4.1 render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -1541,7 +1541,7 @@ importers: version: 0.29.12 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 load-json-file: specifier: 'catalog:' version: 7.0.1 @@ -1550,13 +1550,13 @@ importers: version: '@pnpm/ramda@0.28.1' read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 write-package: specifier: 'catalog:' version: 7.2.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 cache/api: dependencies: @@ -1614,7 +1614,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@pnpm/cache.commands': specifier: workspace:* @@ -1633,10 +1633,10 @@ importers: version: 0.29.12 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 catalogs/config: dependencies: @@ -1922,7 +1922,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 split-cmd: specifier: 'catalog:' version: 1.1.0 @@ -1983,7 +1983,7 @@ importers: version: link:../../workspace/read-manifest better-path-resolve: specifier: 'catalog:' - version: 1.0.0 + version: 2.0.0 camelcase: specifier: 'catalog:' version: 9.0.0 @@ -1992,13 +1992,13 @@ importers: version: 10.0.2 can-write-to-dir: specifier: 'catalog:' - version: 1.1.1 + version: 2.0.0 ci-info: specifier: 'catalog:' version: 4.4.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 is-windows: specifier: 'catalog:' version: 1.0.2 @@ -2010,7 +2010,7 @@ importers: version: 2.0.1 path-absolute: specifier: 'catalog:' - version: 1.0.1 + version: 2.0.0 path-name: specifier: 'catalog:' version: 1.0.0 @@ -2019,10 +2019,10 @@ importers: version: '@pnpm/ramda@0.28.1' read-ini-file: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 realpath-missing: specifier: 'catalog:' - version: 1.1.0 + version: 2.0.0 which: specifier: 'catalog:' version: '@pnpm/which@3.0.1' @@ -2056,7 +2056,7 @@ importers: version: 7.1.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 config/config-writer: dependencies: @@ -2150,7 +2150,7 @@ importers: version: link:../../worker '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 get-npm-tarball-url: specifier: 'catalog:' version: 2.1.0 @@ -2175,7 +2175,7 @@ importers: version: 7.0.1 read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 config/matcher: dependencies: @@ -2228,7 +2228,7 @@ importers: version: 2.1.2 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 memoize: specifier: 'catalog:' version: 10.2.0 @@ -2318,16 +2318,16 @@ importers: version: 4.1.1 read-ini-file: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 write-ini-file: specifier: 'catalog:' - version: 4.0.1 + version: 5.0.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -2349,7 +2349,7 @@ importers: version: 4.1.9 read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 config/version-policy: dependencies: @@ -2736,7 +2736,7 @@ importers: version: link:../node.resolver render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -2755,7 +2755,7 @@ importers: version: link:../../cli/cli-meta execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 memoize: specifier: 'catalog:' version: 10.2.0 @@ -2804,7 +2804,7 @@ importers: version: 5.0.0 run-groups: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 shlex: specifier: 'catalog:' version: 3.0.0 @@ -2829,7 +2829,7 @@ importers: version: 1.0.2 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 load-json-file: specifier: 'catalog:' version: 7.0.1 @@ -2916,7 +2916,7 @@ importers: version: link:../../workspace/injected-deps-syncer '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 didyoumean2: specifier: 'catalog:' version: 7.0.4 @@ -2925,7 +2925,7 @@ importers: version: 2.4.1 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 p-limit: specifier: 'catalog:' version: 7.3.0 @@ -2934,10 +2934,10 @@ importers: version: '@pnpm/ramda@0.28.1' realpath-missing: specifier: 'catalog:' - version: 1.1.0 + version: 2.0.0 render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 symlink-dir: specifier: 'catalog:' version: 7.1.0 @@ -2989,13 +2989,13 @@ importers: version: 1.0.2 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 exec/pnpm-cli-runner: dependencies: execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 devDependencies: '@pnpm/exec.pnpm-cli-runner': specifier: workspace:* @@ -3017,13 +3017,13 @@ importers: version: link:../../packages/types '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 preferred-pm: specifier: 'catalog:' - version: 3.1.4 + version: 5.0.0(ts-toolbelt@9.6.0) ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -3085,10 +3085,10 @@ importers: version: 0.5.16 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 rename-overwrite: specifier: 'catalog:' - version: 6.0.6 + version: 7.0.0 ssri: specifier: 'catalog:' version: 13.0.0 @@ -3150,7 +3150,7 @@ importers: version: 3.0.2 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 fetching/fetcher-base: dependencies: @@ -3193,10 +3193,10 @@ importers: version: link:../../worker '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -3309,7 +3309,7 @@ importers: version: 4.1.1 p-map-values: specifier: 'catalog:' - version: 1.0.0 + version: 0.1.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -3405,10 +3405,10 @@ importers: version: link:../graceful-fs path-temp: specifier: 'catalog:' - version: 2.1.1 + version: 3.0.0 rename-overwrite: specifier: 'catalog:' - version: 6.0.6 + version: 7.0.0 devDependencies: '@pnpm/fs.hard-link-dir': specifier: workspace:* @@ -3436,22 +3436,22 @@ importers: version: 0.1.19 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 fs-extra: specifier: 'catalog:' version: 11.3.4 make-empty-dir: specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 p-limit: specifier: 'catalog:' version: 7.3.0 path-temp: specifier: 'catalog:' - version: 2.1.1 + version: 3.0.0 rename-overwrite: specifier: 'catalog:' - version: 6.0.6 + version: 7.0.0 sanitize-filename: specifier: 'catalog:' version: 1.6.3 @@ -3585,7 +3585,7 @@ importers: version: 3.0.2 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 symlink-dir: specifier: 'catalog:' version: 7.1.0 @@ -3644,7 +3644,7 @@ importers: version: 5.6.2 path-absolute: specifier: 'catalog:' - version: 1.0.1 + version: 2.0.0 devDependencies: '@pnpm/fetcher-base': specifier: workspace:* @@ -3860,7 +3860,7 @@ importers: version: 3.0.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 yaml-tag: specifier: 'catalog:' version: 1.1.0 @@ -3896,10 +3896,10 @@ importers: version: link:../../packages/types '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 comver-to-semver: specifier: 'catalog:' - version: 1.0.0 + version: 2.0.0 js-yaml: specifier: 'catalog:' version: '@zkochan/js-yaml@0.0.11' @@ -3948,7 +3948,7 @@ importers: version: 3.0.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 yaml-tag: specifier: 'catalog:' version: 1.1.0 @@ -4000,7 +4000,7 @@ importers: version: link:../../packages/types comver-to-semver: specifier: 'catalog:' - version: 1.0.0 + version: 2.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -4064,7 +4064,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@pnpm/plugin-commands-audit': specifier: workspace:* @@ -4089,7 +4089,7 @@ importers: version: 13.3.4 read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 tempy: specifier: 'catalog:' version: 3.0.0 @@ -4163,7 +4163,7 @@ importers: version: link:../../config/parse-overrides p-map-values: specifier: 'catalog:' - version: 1.0.0 + version: 0.1.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -4235,7 +4235,7 @@ importers: version: 3.0.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 yaml-tag: specifier: 'catalog:' version: 1.1.0 @@ -4545,7 +4545,7 @@ importers: dependencies: execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 devDependencies: '@pnpm/git-utils': specifier: workspace:* @@ -4601,7 +4601,7 @@ importers: version: '@pnpm/ramda@0.28.1' rename-overwrite: specifier: 'catalog:' - version: 6.0.6 + version: 7.0.0 devDependencies: '@pnpm/make-dedicated-lockfile': specifier: workspace:* @@ -4614,7 +4614,7 @@ importers: version: 0.29.12 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 packages/naming-cases: devDependencies: @@ -4645,7 +4645,7 @@ importers: version: link:../../config/config render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -4688,7 +4688,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@pnpm/plugin-commands-init': specifier: workspace:* @@ -4719,7 +4719,7 @@ importers: version: 2.0.3 render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -4891,7 +4891,7 @@ importers: version: 1.0.2 make-empty-dir: specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 normalize-path: specifier: 'catalog:' version: 3.0.0 @@ -4900,13 +4900,13 @@ importers: version: '@pnpm/ramda@0.28.1' realpath-missing: specifier: 'catalog:' - version: 1.1.0 + version: 2.0.0 render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 safe-execa: specifier: 'catalog:' - version: 0.2.0 + version: 0.3.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -4955,7 +4955,7 @@ importers: version: 3.0.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 patching/types: devDependencies: @@ -5175,16 +5175,16 @@ importers: version: link:../../worker '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 enquirer: specifier: 'catalog:' version: 2.4.1 is-inner-link: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 load-json-file: specifier: 'catalog:' version: 7.0.1 @@ -5205,7 +5205,7 @@ importers: version: '@pnpm/ramda@0.28.1' run-groups: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -5287,7 +5287,7 @@ importers: version: 1.0.0 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 exists-link: specifier: 'catalog:' version: 2.0.0 @@ -5302,10 +5302,10 @@ importers: version: 1.0.0 read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 resolve-link-target: specifier: 'catalog:' - version: 2.0.0 + version: 3.0.0 symlink-dir: specifier: 'catalog:' version: 7.1.0 @@ -5314,7 +5314,7 @@ importers: version: 7.0.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 pkg-manager/direct-dep-linker: dependencies: @@ -5329,13 +5329,13 @@ importers: version: link:../../fs/symlink-dependency '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' resolve-link-target: specifier: 'catalog:' - version: 2.0.0 + version: 3.0.0 devDependencies: '@pnpm/logger': specifier: workspace:* @@ -5375,7 +5375,7 @@ importers: version: link:../../packages/types path-absolute: specifier: 'catalog:' - version: 1.0.1 + version: 2.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -5478,13 +5478,13 @@ importers: version: link:../../worker '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 p-limit: specifier: 'catalog:' version: 7.3.0 path-absolute: specifier: 'catalog:' - version: 1.0.1 + version: 2.0.0 path-exists: specifier: 'catalog:' version: 5.0.0 @@ -5493,7 +5493,7 @@ importers: version: '@pnpm/ramda@0.28.1' realpath-missing: specifier: 'catalog:' - version: 1.1.0 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -5581,13 +5581,13 @@ importers: version: 3.0.2 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' resolve-link-target: specifier: 'catalog:' - version: 2.0.0 + version: 3.0.0 symlink-dir: specifier: 'catalog:' version: 7.1.0 @@ -5633,13 +5633,13 @@ importers: version: 8.0.1 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 bin-links: specifier: 'catalog:' version: 5.0.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 is-windows: specifier: 'catalog:' version: 1.0.2 @@ -5685,7 +5685,7 @@ importers: version: 7.7.1 cmd-extension: specifier: 'catalog:' - version: 1.0.2 + version: 2.0.0 tempy: specifier: 'catalog:' version: 3.0.0 @@ -5721,7 +5721,7 @@ importers: version: link:../../packages/types '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -5752,7 +5752,7 @@ importers: version: '@pnpm/ramda@0.28.1' read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 devDependencies: '@pnpm/modules-yaml': specifier: workspace:* @@ -5774,7 +5774,7 @@ importers: version: link:../../packages/types is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 tinyglobby: specifier: 'catalog:' version: 0.2.15 @@ -5850,7 +5850,7 @@ importers: version: 8.1.1 promise-share: specifier: 'catalog:' - version: 1.0.0 + version: 2.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -6049,7 +6049,7 @@ importers: version: 3.0.3 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 '@zkochan/table': specifier: 'catalog:' version: 2.0.1 @@ -6064,7 +6064,7 @@ importers: version: 2.1.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 load-json-file: specifier: 'catalog:' version: 7.0.1 @@ -6082,7 +6082,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 version-selector-type: specifier: 'catalog:' version: 3.0.0 @@ -6164,7 +6164,7 @@ importers: version: 2.1.3 read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 symlink-dir: specifier: 'catalog:' version: 7.1.0 @@ -6179,7 +6179,7 @@ importers: version: 7.2.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 pkg-manager/read-projects-context: dependencies: @@ -6197,7 +6197,7 @@ importers: version: link:../../packages/types realpath-missing: specifier: 'catalog:' - version: 1.1.0 + version: 2.0.0 devDependencies: '@pnpm/logger': specifier: workspace:* @@ -6250,10 +6250,10 @@ importers: version: link:../../packages/types '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 cmd-extension: specifier: 'catalog:' - version: 1.0.2 + version: 2.0.0 is-windows: specifier: 'catalog:' version: 1.0.2 @@ -6359,10 +6359,10 @@ importers: version: 3.0.0 is-inner-link: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 normalize-path: specifier: 'catalog:' version: 3.0.0 @@ -6374,16 +6374,16 @@ importers: version: 5.0.0 promise-share: specifier: 'catalog:' - version: 1.0.0 + version: 2.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' rename-overwrite: specifier: 'catalog:' - version: 6.0.6 + version: 7.0.0 safe-promise-defer: specifier: 'catalog:' - version: 1.0.1 + version: 2.0.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -6435,7 +6435,7 @@ importers: version: link:../../packages/types p-map-values: specifier: 'catalog:' - version: 1.0.0 + version: 0.1.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -6466,7 +6466,7 @@ importers: version: 7.0.6 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 pkg-manifest/manifest-utils: dependencies: @@ -6558,7 +6558,7 @@ importers: version: 8.3.0 read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 strip-bom: specifier: 'catalog:' version: 5.0.0 @@ -6595,7 +6595,7 @@ importers: version: 7.0.1 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 devDependencies: '@pnpm/write-project-manifest': specifier: workspace:* @@ -6849,7 +6849,7 @@ importers: version: 0.2.0 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 chalk: specifier: 'catalog:' version: 5.6.2 @@ -6867,13 +6867,13 @@ importers: version: 6.0.0 dir-is-case-sensitive: specifier: 'catalog:' - version: 2.0.0 + version: 3.0.0 esbuild: specifier: 'catalog:' version: 0.25.12 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 exists-link: specifier: 'catalog:' version: 2.0.0 @@ -6885,7 +6885,7 @@ importers: version: 6.0.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 is-windows: specifier: 'catalog:' version: 1.0.2 @@ -6921,10 +6921,10 @@ importers: version: '@pnpm/ramda@0.28.1' read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -6948,7 +6948,7 @@ importers: version: 7.2.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 pnpm/artifacts/exe: dependencies: @@ -6961,7 +6961,7 @@ importers: version: 'link:' execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 tar: specifier: 'catalog:' version: 7.5.11 @@ -7115,7 +7115,7 @@ importers: version: 3.0.2 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 normalize-path: specifier: 'catalog:' version: 3.0.0 @@ -7124,10 +7124,10 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -7212,7 +7212,7 @@ importers: version: link:../../packages/types '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 chalk: specifier: 'catalog:' version: 5.6.2 @@ -7224,7 +7224,7 @@ importers: version: 2.4.1 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 libnpmpublish: specifier: 'catalog:' version: 11.1.3 @@ -7242,10 +7242,10 @@ importers: version: '@pnpm/ramda@0.28.1' realpath-missing: specifier: 'catalog:' - version: 1.1.0 + version: 2.0.0 render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 tar-stream: specifier: 'catalog:' version: 3.1.8 @@ -7327,7 +7327,7 @@ importers: version: 7.5.11 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 resolving/bun-resolver: dependencies: @@ -7504,7 +7504,7 @@ importers: version: link:../resolver-base graceful-git: specifier: 'catalog:' - version: 4.0.0 + version: 5.0.0 hosted-git-info: specifier: 'catalog:' version: '@pnpm/hosted-git-info@1.0.0' @@ -7654,13 +7654,13 @@ importers: version: 4.0.0 path-temp: specifier: 'catalog:' - version: 2.1.1 + version: 3.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' rename-overwrite: specifier: 'catalog:' - version: 6.0.6 + version: 7.0.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -7789,10 +7789,10 @@ importers: version: 3.0.0 realpath-missing: specifier: 'catalog:' - version: 1.1.0 + version: 2.0.0 resolve-link-target: specifier: 'catalog:' - version: 2.0.0 + version: 3.0.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -7856,7 +7856,7 @@ importers: version: 7.3.0 path-absolute: specifier: 'catalog:' - version: 1.0.1 + version: 2.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -8042,7 +8042,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -8106,7 +8106,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -8140,10 +8140,10 @@ importers: version: 0.29.12 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 reviewing/plugin-commands-outdated: dependencies: @@ -8203,7 +8203,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@pnpm/constants': specifier: workspace:* @@ -8273,7 +8273,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@pnpm/plugin-commands-installation': specifier: workspace:* @@ -8362,7 +8362,7 @@ importers: version: link:../../exec/pnpm-cli-runner render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -8409,19 +8409,19 @@ importers: version: link:../../packages/types '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 is-gzip: specifier: 'catalog:' version: 2.0.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 p-limit: specifier: 'catalog:' version: 7.3.0 rename-overwrite: specifier: 'catalog:' - version: 6.0.6 + version: 7.0.0 semver: specifier: 'catalog:' version: 7.7.4 @@ -8488,7 +8488,7 @@ importers: version: 10.2.0 path-temp: specifier: 'catalog:' - version: 2.1.1 + version: 3.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -8565,10 +8565,10 @@ importers: version: link:../../worker '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 ramda: specifier: 'catalog:' version: '@pnpm/ramda@0.28.1' @@ -8687,7 +8687,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@jest/globals': specifier: 'catalog:' @@ -8730,10 +8730,10 @@ importers: version: 7.1.5 '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 ssri: specifier: 'catalog:' version: 13.0.0 @@ -8784,7 +8784,7 @@ importers: version: 5.6.2 render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 devDependencies: '@pnpm/plugin-commands-store-inspecting': specifier: workspace:* @@ -8794,7 +8794,7 @@ importers: version: link:../../__utils__/prepare execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 load-json-file: specifier: 'catalog:' version: 7.0.1 @@ -8824,7 +8824,7 @@ importers: version: link:../index dir-is-case-sensitive: specifier: 'catalog:' - version: 2.0.0 + version: 3.0.0 devDependencies: '@pnpm/logger': specifier: workspace:* @@ -8862,19 +8862,19 @@ importers: version: link:../../packages/error '@zkochan/rimraf': specifier: 'catalog:' - version: 3.0.2 + version: 4.0.0 can-link: specifier: 'catalog:' - version: 2.0.0 + version: 3.0.0 path-absolute: specifier: 'catalog:' - version: 1.0.1 + version: 2.0.0 path-temp: specifier: 'catalog:' - version: 2.1.1 + version: 3.0.0 root-link-target: specifier: 'catalog:' - version: 3.1.0 + version: 4.0.0 touch: specifier: 'catalog:' version: 3.1.0 @@ -8997,7 +8997,7 @@ importers: version: '@pnpm/ramda@0.28.1' render-help: specifier: 'catalog:' - version: 1.0.3 + version: 2.0.0 symlink-dir: specifier: 'catalog:' version: 7.1.0 @@ -9123,13 +9123,13 @@ importers: version: link:../pkgs-graph execa: specifier: 'catalog:' - version: safe-execa@0.2.0 + version: safe-execa@0.3.0 find-up: specifier: 'catalog:' version: 7.0.0 is-subdir: specifier: 'catalog:' - version: 1.2.0 + version: 2.0.0 micromatch: specifier: 'catalog:' version: 4.0.8 @@ -9311,10 +9311,10 @@ importers: version: 4.0.3 read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 write-yaml-file: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 workspace/pkgs-graph: dependencies: @@ -9342,7 +9342,7 @@ importers: version: 0.29.12 better-path-resolve: specifier: 'catalog:' - version: 1.0.0 + version: 2.0.0 workspace/read-manifest: dependencies: @@ -9357,7 +9357,7 @@ importers: version: link:../../packages/types read-yaml-file: specifier: 'catalog:' - version: 2.1.0 + version: 3.0.0 devDependencies: '@pnpm/workspace.read-manifest': specifier: workspace:* @@ -10402,6 +10402,9 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@lazy-node/types-path@1.0.3': + resolution: {integrity: sha512-5Bnl5s5jh7o14i0oa7gj+Y0fDLIlri3+KVZmv4gk0OFGuOrOEmWBBCI9ky3Syip5g/yPHZdfa+WO5BVJMUpMdw==} + '@manypkg/find-root@1.1.0': resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} @@ -11116,6 +11119,9 @@ packages: '@types/node': optional: true + '@sec-ant/readable-stream@0.4.1': + resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} + '@sigstore/bundle@4.0.0': resolution: {integrity: sha512-NwCl5Y0V6Di0NexvkTqdoVfmjTaQwoLM236r89KEojGmq/jMls8S+zb7yOwAPdXvbwfKDlP+lmXgAL4vKSQT+A==} engines: {node: ^20.17.0 || >=22.9.0} @@ -11154,6 +11160,10 @@ packages: resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} + '@sindresorhus/merge-streams@4.0.0': + resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} + engines: {node: '>=18'} + '@sinonjs/commons@3.0.1': resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} @@ -11756,6 +11766,10 @@ packages: resolution: {integrity: sha512-GBf4ua7ogWTr7fATnzk/JLowZDBnBJMm8RkMaC/KcvxZ9gxbMWix0/jImd815LmqKyIHZ7h7lADRddGMdGBuCA==} engines: {node: '>=18.12'} + '@zkochan/rimraf@4.0.0': + resolution: {integrity: sha512-0EdBn93hMsbx4svJsKQCch+sNMuXvzWbVYqTCGdctQmxtuYK57uCURZPNiNdwS2Y31d96DMWI3BpJ9DLN2Jxfw==} + engines: {node: '>=22.13'} + '@zkochan/table@2.0.1': resolution: {integrity: sha512-o+nA2fbYPcngLhCTuBQYkdt0Ef6lb8ppaGpXtz/9qsm1F9g5e9UQe8LGkT6NnkcGtwU/hlMvckuGafRGHP3NxQ==} engines: {node: '>=16.14'} @@ -12069,6 +12083,10 @@ packages: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} + better-path-resolve@2.0.0: + resolution: {integrity: sha512-VvvsZgI0upmMbG1iEFiQ7hRG+fDJwmw7iFfKLzBVNhRd2ycauJ3+3w50ESX+pS2tvS9R2hMzijwE+vinDyqQzQ==} + engines: {node: '>=22.13'} + bin-links@4.0.4: resolution: {integrity: sha512-cMtq4W5ZsEwcutJrVId+a/tjt8GSbS+h0oNkdl6+6rBuEv8Ot33Bevj5KPm40t309zuhVic8NjpuL42QCiJWWA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -12224,10 +12242,18 @@ packages: resolution: {integrity: sha512-2W2yAdkQQrrL0WM6BrGqkrLkWlVon8riZch0EBNklid2CZsOzZnqR5HE7W3Q3BrMWUop+9I2dpjyZqhSOYh6Yg==} engines: {node: '>=10'} + can-link@3.0.0: + resolution: {integrity: sha512-dhguuV14nOt9Jdg1crCPqeY+k9pzE2SatedDbKGYei+0wQA9gw/uh4PsFmpTbaLVqvInZtrO3Uj60Bu6Ek/UUQ==} + engines: {node: '>=22.13'} + can-write-to-dir@1.1.1: resolution: {integrity: sha512-eOgiEWqjppB+3DN/5E82EQ8dTINus8d9GXMCbEsUnp2hcUIcXmBvzWmD3tXMk3CuBK0v+ddK9qw0EAF+JVRMjQ==} engines: {node: '>=10.13'} + can-write-to-dir@2.0.0: + resolution: {integrity: sha512-4wXLh+SqvKDzWND9SGE8cWllVMc65LxHVrCePc56IbfrtORUyxTWCVMI8rbGIVRBSNf5C+zbfaken7Abs34AEQ==} + engines: {node: '>=22.13'} + caniuse-lite@1.0.30001777: resolution: {integrity: sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==} @@ -12354,6 +12380,10 @@ packages: resolution: {integrity: sha512-iWDjmP8kvsMdBmLTHxFaqXikO8EdFRDfim7k6vUHglY/2xJ5jLrPsnQGijdfp4U+sr/BeecG0wKm02dSIAeQ1g==} engines: {node: '>=10'} + cmd-extension@2.0.0: + resolution: {integrity: sha512-KmDsvn5CnKlELO9vQ7nTfn5aK4H1QSvUfm3h5natue7pjhwsOPyGMpzEL0d5XUZ0YzTiBODcaayRNsXCF9n3Fw==} + engines: {node: '>=22.13'} + cmd-shim@6.0.3: resolution: {integrity: sha512-FMabTRlc5t5zjdenF6mS0MBeFZm0XqHqeOkcskKFb/LYCcRQ5fVgLOHVc4Lq9CqABd9zhjwPjMBCJvMCziSVtA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -12425,9 +12455,9 @@ packages: resolution: {integrity: sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==} engines: {node: '>= 0.8.0'} - comver-to-semver@1.0.0: - resolution: {integrity: sha512-gcGtbRxjwROQOdXLUWH1fQAXqThUVRZ219aAwgtX3KfYw429/Zv6EIJRf5TBSzWdAGwePmqH7w70WTaX4MDqag==} - engines: {node: '>=12.17'} + comver-to-semver@2.0.0: + resolution: {integrity: sha512-4pxiLt2bXHe5BDrolTJs9wfwwT0pPQPQxeUj+X6SKTCkpi8VwvOvgMzohTVVDLXHmAjrZuKEq+tyb0C5zzTSxw==} + engines: {node: '>=22.13'} concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -12746,6 +12776,10 @@ packages: resolution: {integrity: sha512-ziinF4N8GYUXrxxKyoIX6GAaqzmc7Ck4j5U/hxqkNPLK3vlxrFJAGUkBWuTb8OmBLqklPo8d8UMmAVA3ZmM6BA==} engines: {node: '>=10'} + dir-is-case-sensitive@3.0.0: + resolution: {integrity: sha512-xId1VV2XkiiETrOZPb8zcXHGbM7UEwIbHX0Cd6Dtxc1pIsWT7Yphvft/r/cI6Zz45zaj/LeUYU8h5IraHvm7SQ==} + engines: {node: '>=22.13'} + dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} engines: {node: '>=8'} @@ -13030,6 +13064,10 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} + execa@9.6.1: + resolution: {integrity: sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==} + engines: {node: ^18.19.0 || >=20.5.0} + exists-link@2.0.0: resolution: {integrity: sha512-YbykYxM4Xl9aCcANggu2MqOAMa7dh+5fq1HNpoqp42R2qiRWHXRhsgYSX6XQS/b2tQlg/LeZ7Jpnekl5B3M7/w==} engines: {node: '>= 4'} @@ -13128,6 +13166,10 @@ packages: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} + figures@6.1.0: + resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} + engines: {node: '>=18'} + file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -13155,6 +13197,10 @@ packages: find-root@1.1.0: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} + find-up-simple@1.0.1: + resolution: {integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==} + engines: {node: '>=18'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -13174,6 +13220,9 @@ packages: find-yarn-workspace-root2@1.2.16: resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} + find-yarn-workspace-root2@1.2.53: + resolution: {integrity: sha512-0P66/qSVapUMgxLt0BwnKQ2VEg7uR/PIX82y/YuKOf8oHK437uq3OcMUdB4NGDJrCZ2is6jME0yZcV9nAM0RoQ==} + find-yarn-workspace-root@2.0.0: resolution: {integrity: sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==} @@ -13355,6 +13404,10 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + get-stream@9.0.1: + resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} + engines: {node: '>=18'} + get-symbol-description@1.1.0: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} @@ -13450,6 +13503,10 @@ packages: resolution: {integrity: sha512-zK/rCH/I0DMKpPBLCElXGI7za3EnXeQFdiK6CTP02Tt1N1L+bMLghZY7cXozlx9M2bx4Q0zrY9ADYP3eI8haIw==} engines: {node: '>=18.12'} + graceful-git@5.0.0: + resolution: {integrity: sha512-cmogaKKsYEW06+FriOqkhewEGf9YdMfpK/iSqtW02/GcXhSlsjNrSq1VqrM2zbMfWw0Og+lh5knLd730THxv/A==} + engines: {node: '>=22.13'} + graceful-readlink@1.0.1: resolution: {integrity: sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w==} @@ -13608,6 +13665,10 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + human-signals@8.0.1: + resolution: {integrity: sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==} + engines: {node: '>=18.18.0'} + humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} @@ -13825,9 +13886,9 @@ packages: is-hexadecimal@1.0.4: resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} - is-inner-link@4.0.0: - resolution: {integrity: sha512-ndVRxdfEKJAGvS1IyVIErP6rseojoaMfM37iKV+mDmmf33k3pZFgdPXVaTHE0QjDxygfx7A27edP3cC2Q+iieQ==} - engines: {node: '>=10'} + is-inner-link@5.0.0: + resolution: {integrity: sha512-aSlGGPZ+pe6q3DRU8GGdUeG1rZckcHnkBEtCdhWYkPKY44BuQYnHr1sFqcOZFAIV1E1socv8/rMvQ5vHBvAMeg==} + engines: {node: '>=22.13'} is-interactive@1.0.0: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} @@ -13915,6 +13976,10 @@ packages: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + is-stream@4.0.1: + resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} + engines: {node: '>=18'} + is-string@1.1.1: resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} engines: {node: '>= 0.4'} @@ -13923,6 +13988,10 @@ packages: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} + is-subdir@2.0.0: + resolution: {integrity: sha512-iOXmZKniv4jGFMSYc1K3V/XNl30X1d/m86BKTiDeE2MDULREgBiNpLXsqQKjyETOkWbOyXNQD4M4AZCH51pm7g==} + engines: {node: '>=22.13'} + is-symbol@1.1.1: resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} engines: {node: '>= 0.4'} @@ -13942,6 +14011,10 @@ packages: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + is-utf8@0.2.1: resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==} @@ -14324,6 +14397,10 @@ packages: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} + load-yaml-file@1.0.0: + resolution: {integrity: sha512-Xw+A/X4c5R6GWu7ZUQgw1rnbfUr1P/hAZbDTrreo+/fP/YSGgxAKoWe2IcT+bt4RHuyIca6S7SMGcWx+QI3WIw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -14450,10 +14527,6 @@ packages: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} - make-dir@3.1.0: - resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} - engines: {node: '>=8'} - make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -14462,6 +14535,10 @@ packages: resolution: {integrity: sha512-wbms3J521rrnc+B4xLC3WN5etHAAABxZlkBFmOBnHtdF8zhUW0AImApqQZnVWK0ucJaetALBC3tRNXbDjfIsaQ==} engines: {node: '>=18.12'} + make-empty-dir@4.0.0: + resolution: {integrity: sha512-YKBz1FUAkNBFkQCBdGvLgeq1d4grJOhcKLra9wkOklqdrn7JJwB3d7r9gZlQC/1EXAQQ4YkFO/EfnhvHXh3LpQ==} + engines: {node: '>=22.13'} + make-fetch-happen@14.0.3: resolution: {integrity: sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==} engines: {node: ^18.17.0 || >=20.5.0} @@ -14895,6 +14972,10 @@ packages: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} + npm-run-path@6.0.0: + resolution: {integrity: sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==} + engines: {node: '>=18'} + npmlog@4.1.2: resolution: {integrity: sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==} deprecated: This package is no longer supported. @@ -15031,6 +15112,10 @@ packages: resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + p-map-values@0.1.0: + resolution: {integrity: sha512-IMr3wlbvIFnAIkUiJEZ4gUtMMte1tzDm+mehuFXJT7nXgluGsv6HbHaxuVgTc2D/LmKWOjdZN5IxnjVuudlt1w==} + engines: {node: '>=22.13'} + p-map-values@1.0.0: resolution: {integrity: sha512-/n8QJM4Os3HLRMSuQWwAocsMExENSQwWTgRi8m3JVEOWQ/4gud14igBcnYvSGQTbiyZbuizxEmwf0w3ITn67gg==} engines: {node: '>=14'} @@ -15067,6 +15152,10 @@ packages: resolution: {integrity: sha512-paHV8NUz8zDHu5lhr/ngGWQiW067DK/+IbJ+RfZ4k+s8y4EKyYCz8pGYWjxCg35eHztpJAt+NUgvN4L+GCbPlg==} engines: {node: '>=8'} + p-reflect@3.1.0: + resolution: {integrity: sha512-3sG3UlpisPSaX+o7u2q01hIQmrpkvdl5GSO1ZwL7pfc5kHB2bPF0eFNCfYTrW1/LTUdgmPwBAvmT0Zr8eSmaAQ==} + engines: {node: '>=12'} + p-timeout@3.2.0: resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==} engines: {node: '>=8'} @@ -15130,6 +15219,10 @@ packages: resolution: {integrity: sha512-gds5iRhSeOcDtj8gfWkRHLtZKTPsFVuh7utbjYtvnclw4XM+ffRzJrwqMhOD1PVqef7nBLmgsu1vIujjvAJrAw==} engines: {node: '>=4'} + path-absolute@2.0.0: + resolution: {integrity: sha512-yt9Q06veuarrNppU6hfzXdrrHGTtMMsjiixJKnaZilOkh47rYW7UYyOeWbOvSy+iAAC/2Lic7tOagFhxkbse2Q==} + engines: {node: '>=22.13'} + path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} engines: {node: '>=4'} @@ -15146,6 +15239,9 @@ packages: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + path-is-network-drive@1.0.24: + resolution: {integrity: sha512-sux7NWiMq/ul8EEQTQbdM1m/zr+Rrq11/P9tEBgxMgTnVHS8f54tQm0kfrTxkvPNg/OVkRjHNgSia5VxnawOZg==} + path-key@2.0.1: resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} engines: {node: '>=4'} @@ -15154,6 +15250,10 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + path-name@1.0.0: resolution: {integrity: sha512-/dcAb5vMXH0f51yvMuSUqFpxUcA8JelbRmE5mW/p4CUJxrNgK24IkstnV7ENtg2IDGBOu6izKTG6eilbnbNKWQ==} @@ -15164,6 +15264,9 @@ packages: resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} engines: {node: 18 || 20 || >=22} + path-strip-sep@1.0.21: + resolution: {integrity: sha512-V5Lvyhx0fE6/wEk/YseTtoRQIaD32cepnzrQ1b3kOzOxxDoSglry8IZ1b6LPObIeIbpC0+i9ygUsBNhkOttQKw==} + path-temp@2.0.0: resolution: {integrity: sha512-92olbatybjsHTGB2CUnAM7s0mU/27gcMfLNA7t09UftndUdxywlQKur3fzXEPpfLrgZD3I2Bt8+UmiL7YDEgXQ==} engines: {node: '>=8.15'} @@ -15172,6 +15275,10 @@ packages: resolution: {integrity: sha512-2pIjpQb28baC42ttBsQuRRqZ33a8DnWzfSwEFKJjz7SMiCmBECUOebUNLTmmPCG8F4ZIXG7ZRJ8FAxYXdx0Jiw==} engines: {node: '>=8.15'} + path-temp@3.0.0: + resolution: {integrity: sha512-5lJ7KUrynYR0TTTiU9SELstnX2fhz8qJ1rBfsEaI1IT3WDWcVkrg8T3lTUSJ/LJkIvrolbF0cFcq9shBC0jzxQ==} + engines: {node: '>=22.13'} + path-to-regexp@0.1.12: resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} @@ -15230,6 +15337,10 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + pkg-dir@5.0.0: + resolution: {integrity: sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==} + engines: {node: '>=10'} + possible-typed-array-names@1.1.0: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} @@ -15242,6 +15353,10 @@ packages: resolution: {integrity: sha512-lEHd+yEm22jXdCphDrkvIJQU66EuLojPPtvZkpKIkiD+l0DMThF/niqZKJSoU8Vl7iuvtmzyMhir9LdVy5WMnA==} engines: {node: '>=10'} + preferred-pm@5.0.0: + resolution: {integrity: sha512-qs9WZBOIW4tXjxoYxUathIb53hcV3cjVpLJl8Y0h3QOiyqnbDzWmw0jvTI5YOw/RAkhDsB/sFVt9pYV+r6NP2A==} + engines: {node: '>=22.13'} + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -15322,6 +15437,10 @@ packages: resolution: {integrity: sha512-lpABypysb42MdCZjMJAdapxt+uTU9F0BZW0YeYVlPD/Gv390c43CdFwBSC9YM3siAgyAjLV94WDuDnwHIJjxiw==} engines: {node: '>=8'} + promise-share@2.0.0: + resolution: {integrity: sha512-aJ7A/uh5IqCR9nyD4d8k0bp2xbR3NA2vp9FijCfiQmqmHDAUjf1OqZsBaUAe2RFnb3gQFuxJzjImL0TNeuUXQQ==} + engines: {node: '>=22.13'} + propagate@2.0.1: resolution: {integrity: sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==} engines: {node: '>= 8'} @@ -15421,6 +15540,10 @@ packages: resolution: {integrity: sha512-zz4qv/sKETv7nAkATqSJ9YMbKD8NXRPuA8d17VdYCuNYrVstB1S6UAMU6aytf5vRa9MESbZN7jLZdcmrOxz4gg==} engines: {node: '>=14.6'} + read-ini-file@5.0.0: + resolution: {integrity: sha512-MaUq//yy75pw4obW8dhqpmJ8EXnmuR/q1bFAoCrLhy5lVBu2MKg5X9ZJtXk9gVY4mkJb8eVP+RSEzB3y722EsA==} + engines: {node: '>=22.13'} + read-pkg-up@7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} @@ -15449,6 +15572,10 @@ packages: resolution: {integrity: sha512-UkRNRIwnhG+y7hpqnycCL/xbTk7+ia9VuVTC0S+zVbwd65DI9eUpRMfsWIGrCWxTU/mi+JW8cHQCrv+zfCbEPQ==} engines: {node: '>=10.13'} + read-yaml-file@3.0.0: + resolution: {integrity: sha512-7urDNDyx3oJt9NGkymzT3qudju76BoJhT6ICWclx6274zxMeSUOhyiceHscSBk4Lfbs0IYpjOjUwLkaOzrsJdQ==} + engines: {node: '>=22.13'} + readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} @@ -15468,6 +15595,10 @@ packages: resolution: {integrity: sha512-wnWtnywepjg/eHIgWR97R7UuM5i+qHLA195qdN9UPKvcMqfn60+67S8sPPW3vDlSEfYHoFkKU8IvpCNty3zQvQ==} engines: {node: '>=10'} + realpath-missing@2.0.0: + resolution: {integrity: sha512-3pyjW3p6MbuafG62OJdz4R2WJgFVKtDdrSSq9pn0gJQnRGpgst/EboL5xQFXIdcFv4ncauY2mKu8puzBp6BRdQ==} + engines: {node: '>=22.13'} + rechoir@0.6.2: resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} engines: {node: '>= 0.10'} @@ -15521,9 +15652,13 @@ packages: resolution: {integrity: sha512-bSbsw/VyMyDez6NJKxqURBCLRCm98uezWBi03UZCeEFccCNIthC6Jk5JazMjexOTdrYd4q/jIxTIwGtgk1k1gA==} engines: {node: '>=18'} - render-help@1.0.3: - resolution: {integrity: sha512-oC1+EZEeVpinZDtG0j7Frby2HRGUtU+x62/0QRH/1FcZR9U/OgsI7HKpy/a36iXdI9by0SouWTHm8CDaOeqx3A==} - engines: {node: '>=10'} + rename-overwrite@7.0.0: + resolution: {integrity: sha512-DjRc82L24rSj0I67XFWZsC8ZQIzILbnLQGEtbPhLNlh/ovtwLApgITeKnP3qyI5J7st7fjKRuspkMiaiEb7NiQ==} + engines: {node: '>=22.13'} + + render-help@2.0.0: + resolution: {integrity: sha512-G2+pwTfPNVD4s3kgTey+ehVkZO6Cnsj9bDwG8VlxDjxLThPko8Nh33Egmqw/nVcksT5loHijaSdwf9g71id7wA==} + engines: {node: '>=22.13'} repeat-string@1.6.1: resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} @@ -15567,9 +15702,9 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} - resolve-link-target@2.0.0: - resolution: {integrity: sha512-jR9pmK8PUtjwUSNYn4fuTewcNUJE5e9B8tWD1C2dmDk40dvig+l1WSPmdH/03cx3ULWK7oS0E3cdam+poDepYQ==} - engines: {node: '>=10'} + resolve-link-target@3.0.0: + resolution: {integrity: sha512-WMnCSeV4WeH1F00qJmZ0mUKscxCYZTSbbTEfyJesRcr9Hs6e5rc0LX+7Pi7Q2GHoyW+vzCUQ0Y2GoyzjMc2DVw==} + engines: {node: '>=22.13'} resolve-options@1.1.0: resolution: {integrity: sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A==} @@ -15625,6 +15760,10 @@ packages: resolution: {integrity: sha512-hdke7IGy7j6TCIGhUDnaX41OFpHgZOaZ70GHUS2RdolaHj9Gn3jVvV9xE+sd6rTuRd4t7bNpzYSKSpAz/74H/A==} engines: {node: '>=10'} + root-link-target@4.0.0: + resolution: {integrity: sha512-JvT9C9+Y9+AXoXuy17yLUxzvuBBYMFVtov6TnZu2RPyNm5KgH2CE8OJxhFRSG5g/ai7tefE00cvENGnWnAKFIQ==} + engines: {node: '>=22.13'} + rotated-array-set@3.0.0: resolution: {integrity: sha512-G7689wvCM0szMFXUAhi3GfNGcSPlndg077cdRWoq7UegOAwfU2MJ0jD7s7jB+2ppKA75Kr/O0HwAP9+rRdBctg==} engines: {node: ^14.13.1 || >=16.0.0} @@ -15637,9 +15776,9 @@ packages: resolution: {integrity: sha512-2hIL01Osd6FWsQVhVGqJ7drNikmTaUg2A/VBR98+LuhQ1jV1Xlh43BQH4gJiNaOzfHJTasD0pw5YviIfdVVY4g==} engines: {node: '>=10'} - run-groups@4.0.0: - resolution: {integrity: sha512-P2JW1SZrHtO3ag0NsO4/jzo1njhaGUB1uYnfxi9Rf6ZVvqmKyhmtBr4HL8MPtPrfJATh+8MvVWvxk91Q4H4jBw==} - engines: {node: '>=20.19'} + run-groups@5.0.0: + resolution: {integrity: sha512-IpIAITIDF5m1FyL6ccgG2WbnXUpVKOOAgMuZz3E/MPV6s60YWnqu9P0ijSyDSMeLXQ+nTLdGevqIDOzup0BF6Q==} + engines: {node: '>=22.13'} run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -15665,13 +15804,13 @@ packages: resolution: {integrity: sha512-GI3k4zl4aLC3lxZNEEXAxxcXE6E3TfOsJ5xxJPhcAv9MWwnH2O9I0HrDmZFsVnu/C8wzRYSsTHdoVRmL0VicDw==} engines: {node: '>=12'} - safe-execa@0.2.0: - resolution: {integrity: sha512-JNG61R7tOc7LnCme+Ek5O5x0OEV9pWriDBOooih8E+3uLPHUNfw0wNoxxJs6Zmr5OgULBDqKYQ4mZJdwNl4+0A==} - engines: {node: '>=18'} + safe-execa@0.3.0: + resolution: {integrity: sha512-LMzgcWXnnL60sDuAzlmGehx7OHa4ajy0R/3djFOfnZwj4aksZUcdHfZgIIWLNcqverOAQJ2qOe7BDFm7Qpxd6Q==} + engines: {node: '>=22.13'} - safe-promise-defer@1.0.1: - resolution: {integrity: sha512-nKdAwtdSxWQpV2AIjU9rw5j/Pgt9+u+pegXJahWQY9D8G0tNvHnJnpL3zVJ1kKtWTo7s/Rvp9ZUDBtPPMpLctA==} - engines: {node: '>=12'} + safe-promise-defer@2.0.0: + resolution: {integrity: sha512-EXEr5wh/FntJnwiOdsZgR9eJ6pqfk8Nrh6BxMb+tupeIVXM7gHZt+AYpB6FvJ3EGp/5JQPyRCdh8mJsW2vN5/Q==} + engines: {node: '>=22.13'} safe-push-apply@1.0.0: resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} @@ -16043,6 +16182,10 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-final-newline@4.0.0: + resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} + engines: {node: '>=18'} + strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -16240,6 +16383,11 @@ packages: ts-toolbelt@9.6.0: resolution: {integrity: sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==} + ts-type@3.0.8: + resolution: {integrity: sha512-DAuveqHehSx5vU/02Qe3cJEwnZvnKKXoHK9bClBg2QXYto9Vaz9HiK3KhGa1UOi1Q/tJuSMUV5TBN8MNDgTLzA==} + peerDependencies: + ts-toolbelt: ^9.6.0 + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -16336,6 +16484,9 @@ packages: resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} engines: {node: '>= 0.4'} + typedarray-dts@1.0.0: + resolution: {integrity: sha512-Ka0DBegjuV9IPYFT1h0Qqk5U4pccebNIJCGl8C5uU7xtOs+jpJvKGAY4fHGK25hTmXZOEUl9Cnsg5cS6K/b5DA==} + typedarray-to-buffer@3.1.5: resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} @@ -16390,6 +16541,10 @@ packages: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} + unicorn-magic@0.3.0: + resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} + engines: {node: '>=18'} + unified@9.2.2: resolution: {integrity: sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==} @@ -16449,6 +16604,9 @@ packages: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} engines: {node: '>=8'} + upath2@3.1.23: + resolution: {integrity: sha512-HQ7CivlKonWnq7m7VZuZHIDXXUCHOoCoIqgVyCk/z/wsuB/agGwGFhFjGSTArGlvBddiejrW4ChW6SwEMhAURQ==} + update-browserslist-db@1.2.3: resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} hasBin: true @@ -16599,6 +16757,10 @@ packages: resolution: {integrity: sha512-MOiaDbA5ZZgUjkeMWM5EkJp4loW5ZRoa5bc3/aeMox/PJelMhE6t7S/mLuiY43DBupyxH+S0U1bTui9kWUlmsw==} engines: {node: '>=8.15'} + which-pm@4.0.0: + resolution: {integrity: sha512-kLoLJ/y2o0GnU8ZNgI5/nlCbyjpUlqtaJQjMrzR2sKyQQ3BcJJ61oSOdZWIrfoScunyZS5w9U0wyFb0Bij9cyg==} + engines: {node: '>=22.13'} + which-typed-array@1.1.20: resolution: {integrity: sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==} engines: {node: '>= 0.4'} @@ -16663,9 +16825,9 @@ packages: resolution: {integrity: sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==} engines: {node: ^20.17.0 || >=22.9.0} - write-ini-file@4.0.1: - resolution: {integrity: sha512-8XPBFS/EqPls2V4vYSc8kPVXjLg2b0GgVVC52w2WEH4sVDXew9rgch60ckXLiTfiYQKmkxezRaRctbGQr7oj5Q==} - engines: {node: '>=14.6'} + write-ini-file@5.0.0: + resolution: {integrity: sha512-BnXZVAu2aX993klPnX+IyWpHkt9GVv6uiJa2WVNLTUUOiPEo9x442QjPa133Lvh/PhYvn1vsfhvKkxvzB+3pbQ==} + engines: {node: '>=22.13'} write-json-file@5.0.0: resolution: {integrity: sha512-ddSsCLa4aQ3kI21BthINo4q905/wfhvQ3JL3774AcRjBaiQmfn5v4rw77jQ7T6CmAit9VOQO+FsLyPkwxoB1fw==} @@ -16679,9 +16841,9 @@ packages: resolution: {integrity: sha512-rj8As6LkachKauGxvZkFzCEd6hIRTi9FKtCNKOa4SaH5vPOiACbGcmPUEJXgkhTHwzNsYmcSbD3C9a6whBfyOg==} engines: {node: '>=20'} - write-json5-file@3.1.0: - resolution: {integrity: sha512-Xt2KWSJ6Y8frmTT9JUNEp8M6GoeIvnofhxdm3sZPMi9JzlAhAgtOVMoZI9MxElAT7RH+NMoHClnq3EZrnwXSmw==} - engines: {node: '>=10.12'} + write-json5-file@4.0.0: + resolution: {integrity: sha512-EleDbLgnZhElTTN9evspVSbTkBsM5b8HqNlNrBjGomUV5IQa0siyWY6ehNae5c53DnR9LJ6N/bVpnlR3XL/Crg==} + engines: {node: '>=22.13'} write-package@7.2.0: resolution: {integrity: sha512-uMQTubF/vcu+Wd0b5BGtDmiXePd/+44hUWQz2nZPbs92/BnxRo74tqs+hqDo12RLiEd+CXFKUwxvvIZvtt34Jw==} @@ -16695,6 +16857,10 @@ packages: resolution: {integrity: sha512-FdNA4RyH1L43TlvGG8qOMIfcEczwA5ij+zLXUy3Z83CjxhLvcV7/Q/8pk22wnCgYw7PJhtK+7lhO+qqyT4NdvQ==} engines: {node: '>=16.14'} + write-yaml-file@6.0.0: + resolution: {integrity: sha512-WG6oDbTuNkiDr0sjYiuV715ZBUYOZVf838wu+7M0WAbkCmv5z2P7OW9gCfgEclXPwP08r5CvBtEyqV7vht070A==} + engines: {node: '>=22.13'} + xdg-basedir@5.1.0: resolution: {integrity: sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==} engines: {node: '>=12'} @@ -16753,6 +16919,10 @@ packages: resolution: {integrity: sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==} engines: {node: '>=18'} + yoctocolors@2.1.2: + resolution: {integrity: sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==} + engines: {node: '>=18'} + zwitch@1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} @@ -17954,6 +18124,14 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + '@lazy-node/types-path@1.0.3(ts-toolbelt@9.6.0)': + dependencies: + '@types/node': 25.4.0 + ts-type: 3.0.8(ts-toolbelt@9.6.0) + tslib: 2.8.1 + transitivePeerDependencies: + - ts-toolbelt + '@manypkg/find-root@1.1.0': dependencies: '@babel/runtime': 7.28.6 @@ -19484,6 +19662,8 @@ snapshots: optionalDependencies: '@types/node': 25.4.0 + '@sec-ant/readable-stream@0.4.1': {} + '@sigstore/bundle@4.0.0': dependencies: '@sigstore/protobuf-specs': 0.5.0 @@ -19524,6 +19704,8 @@ snapshots: '@sindresorhus/is@4.6.0': {} + '@sindresorhus/merge-streams@4.0.0': {} + '@sinonjs/commons@3.0.1': dependencies: type-detect: 4.0.8 @@ -20292,6 +20474,8 @@ snapshots: '@zkochan/rimraf@3.0.2': {} + '@zkochan/rimraf@4.0.0': {} + '@zkochan/table@2.0.1': dependencies: ajv: 8.18.0 @@ -20617,6 +20801,10 @@ snapshots: dependencies: is-windows: 1.0.2 + better-path-resolve@2.0.0: + dependencies: + is-windows: 1.0.2 + bin-links@4.0.4: dependencies: cmd-shim: 6.0.3 @@ -20839,10 +21027,16 @@ snapshots: can-link@2.0.0: {} + can-link@3.0.0: {} + can-write-to-dir@1.1.1: dependencies: path-temp: 2.1.1 + can-write-to-dir@2.0.0: + dependencies: + path-temp: 3.0.0 + caniuse-lite@1.0.30001777: {} caseless@0.12.0: {} @@ -20949,6 +21143,8 @@ snapshots: cmd-extension@1.0.2: {} + cmd-extension@2.0.0: {} + cmd-shim@6.0.3: {} cmd-shim@7.0.0: {} @@ -21012,7 +21208,7 @@ snapshots: transitivePeerDependencies: - supports-color - comver-to-semver@1.0.0: {} + comver-to-semver@2.0.0: {} concat-map@0.0.1: {} @@ -21349,6 +21545,10 @@ snapshots: dependencies: path-temp: 2.0.0 + dir-is-case-sensitive@3.0.0: + dependencies: + path-temp: 3.0.0 + dot-prop@5.3.0: dependencies: is-obj: 2.0.0 @@ -21735,6 +21935,21 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + execa@9.6.1: + dependencies: + '@sindresorhus/merge-streams': 4.0.0 + cross-spawn: 7.0.6 + figures: 6.1.0 + get-stream: 9.0.1 + human-signals: 8.0.1 + is-plain-obj: 4.1.0 + is-stream: 4.0.1 + npm-run-path: 6.0.0 + pretty-ms: 9.3.0 + signal-exit: 4.1.0 + strip-final-newline: 4.0.0 + yoctocolors: 2.1.2 + exists-link@2.0.0: {} exit-x@0.2.2: {} @@ -21848,6 +22063,10 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 + figures@6.1.0: + dependencies: + is-unicode-supported: 2.1.0 + file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -21881,6 +22100,8 @@ snapshots: find-root@1.1.0: {} + find-up-simple@1.0.1: {} + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -21907,6 +22128,15 @@ snapshots: micromatch: 4.0.8 pkg-dir: 4.2.0 + find-yarn-workspace-root2@1.2.53(ts-toolbelt@9.6.0): + dependencies: + micromatch: 4.0.8 + pkg-dir: 5.0.0 + tslib: 2.8.1 + upath2: 3.1.23(ts-toolbelt@9.6.0) + transitivePeerDependencies: + - ts-toolbelt + find-yarn-workspace-root@2.0.0: dependencies: micromatch: 4.0.8 @@ -22106,6 +22336,11 @@ snapshots: get-stream@6.0.1: {} + get-stream@9.0.1: + dependencies: + '@sec-ant/readable-stream': 0.4.1 + is-stream: 4.0.1 + get-symbol-description@1.1.0: dependencies: call-bound: 1.0.4 @@ -22252,6 +22487,11 @@ snapshots: retry: 0.13.1 safe-execa: 0.1.4 + graceful-git@5.0.0: + dependencies: + retry: 0.13.1 + safe-execa: 0.3.0 + graceful-readlink@1.0.1: {} graph-cycles@3.0.0: @@ -22434,6 +22674,8 @@ snapshots: human-signals@2.1.0: {} + human-signals@8.0.1: {} + humanize-ms@1.2.1: dependencies: ms: 2.1.3 @@ -22634,10 +22876,10 @@ snapshots: is-hexadecimal@1.0.4: {} - is-inner-link@4.0.0: + is-inner-link@5.0.0: dependencies: - is-subdir: 1.2.0 - resolve-link-target: 2.0.0 + is-subdir: 2.0.0 + resolve-link-target: 3.0.0 is-interactive@1.0.0: {} @@ -22695,6 +22937,8 @@ snapshots: is-stream@3.0.0: {} + is-stream@4.0.1: {} + is-string@1.1.1: dependencies: call-bound: 1.0.4 @@ -22704,6 +22948,10 @@ snapshots: dependencies: better-path-resolve: 1.0.0 + is-subdir@2.0.0: + dependencies: + better-path-resolve: 2.0.0 + is-symbol@1.1.1: dependencies: call-bound: 1.0.4 @@ -22722,6 +22970,8 @@ snapshots: is-unicode-supported@0.1.0: {} + is-unicode-supported@2.1.0: {} + is-utf8@0.2.1: {} is-valid-glob@1.0.0: {} @@ -23393,6 +23643,12 @@ snapshots: pify: 4.0.1 strip-bom: 3.0.0 + load-yaml-file@1.0.0: + dependencies: + graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1) + js-yaml: '@zkochan/js-yaml@0.0.11' + strip-bom: 5.0.0 + locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -23495,10 +23751,6 @@ snapshots: lru-cache@7.18.3: {} - make-dir@3.1.0: - dependencies: - semver: 7.7.4 - make-dir@4.0.0: dependencies: semver: 7.7.4 @@ -23507,6 +23759,10 @@ snapshots: dependencies: '@zkochan/rimraf': 3.0.2 + make-empty-dir@4.0.0: + dependencies: + '@zkochan/rimraf': 4.0.0 + make-fetch-happen@14.0.3: dependencies: '@npmcli/agent': 3.0.0 @@ -23991,6 +24247,11 @@ snapshots: dependencies: path-key: 3.1.1 + npm-run-path@6.0.0: + dependencies: + path-key: 4.0.0 + unicorn-magic: 0.3.0 + npmlog@4.1.2: dependencies: are-we-there-yet: 1.1.7 @@ -24132,6 +24393,8 @@ snapshots: dependencies: p-limit: 4.0.0 + p-map-values@0.1.0: {} + p-map-values@1.0.0: {} p-map@2.1.0: {} @@ -24164,6 +24427,8 @@ snapshots: p-reflect@2.1.0: {} + p-reflect@3.1.0: {} + p-timeout@3.2.0: dependencies: p-finally: 1.0.0 @@ -24224,6 +24489,8 @@ snapshots: path-absolute@1.0.1: {} + path-absolute@2.0.0: {} + path-exists@3.0.0: {} path-exists@4.0.0: {} @@ -24232,10 +24499,16 @@ snapshots: path-is-absolute@1.0.1: {} + path-is-network-drive@1.0.24: + dependencies: + tslib: 2.8.1 + path-key@2.0.1: {} path-key@3.1.1: {} + path-key@4.0.0: {} + path-name@1.0.0: {} path-parse@1.0.7: {} @@ -24245,6 +24518,10 @@ snapshots: lru-cache: 11.2.6 minipass: 7.1.3 + path-strip-sep@1.0.21: + dependencies: + tslib: 2.8.1 + path-temp@2.0.0: dependencies: unique-string: 2.0.0 @@ -24253,6 +24530,10 @@ snapshots: dependencies: unique-string: 2.0.0 + path-temp@3.0.0: + dependencies: + unique-string: 3.0.0 + path-to-regexp@0.1.12: {} path-type@4.0.0: {} @@ -24308,6 +24589,10 @@ snapshots: dependencies: find-up: 4.1.0 + pkg-dir@5.0.0: + dependencies: + find-up: 5.0.0 + possible-typed-array-names@1.1.0: {} postman-request@2.88.1-postman.40: @@ -24342,6 +24627,14 @@ snapshots: path-exists: 4.0.0 which-pm: 2.2.0 + preferred-pm@5.0.0(ts-toolbelt@9.6.0): + dependencies: + find-up-simple: 1.0.1 + find-yarn-workspace-root2: 1.2.53(ts-toolbelt@9.6.0) + which-pm: 4.0.0 + transitivePeerDependencies: + - ts-toolbelt + prelude-ls@1.2.1: {} prettier@2.8.8: {} @@ -24407,6 +24700,10 @@ snapshots: dependencies: p-reflect: 2.1.0 + promise-share@2.0.0: + dependencies: + p-reflect: 3.1.0 + propagate@2.0.1: {} proto-list@1.2.4: {} @@ -24500,6 +24797,11 @@ snapshots: ini: 3.0.1 strip-bom: 4.0.0 + read-ini-file@5.0.0: + dependencies: + ini: 6.0.0 + strip-bom: 5.0.0 + read-pkg-up@7.0.1: dependencies: find-up: 4.1.0 @@ -24546,6 +24848,11 @@ snapshots: js-yaml: '@zkochan/js-yaml@0.0.11' strip-bom: 4.0.0 + read-yaml-file@3.0.0: + dependencies: + js-yaml: '@zkochan/js-yaml@0.0.11' + strip-bom: 5.0.0 + readable-stream@2.3.8: dependencies: core-util-is: 1.0.3 @@ -24574,6 +24881,8 @@ snapshots: realpath-missing@1.1.0: {} + realpath-missing@2.0.0: {} + rechoir@0.6.2: dependencies: resolve: 1.22.11 @@ -24647,7 +24956,12 @@ snapshots: '@zkochan/rimraf': 3.0.2 fs-extra: 11.3.0 - render-help@1.0.3: + rename-overwrite@7.0.0: + dependencies: + '@zkochan/rimraf': 4.0.0 + fs-extra: 11.3.4 + + render-help@2.0.0: dependencies: table: 6.9.0 @@ -24675,7 +24989,7 @@ snapshots: resolve-from@5.0.0: {} - resolve-link-target@2.0.0: {} + resolve-link-target@3.0.0: {} resolve-options@1.1.0: dependencies: @@ -24725,6 +25039,12 @@ snapshots: next-path: 1.0.0 path-temp: 2.0.0 + root-link-target@4.0.0: + dependencies: + can-link: 3.0.0 + next-path: 1.0.0 + path-temp: 3.0.0 + rotated-array-set@3.0.0: {} run-async@3.0.0: {} @@ -24733,7 +25053,7 @@ snapshots: dependencies: p-limit: 3.1.0 - run-groups@4.0.0: + run-groups@5.0.0: dependencies: p-limit: 7.3.0 @@ -24769,15 +25089,15 @@ snapshots: execa: 5.1.1 path-name: 1.0.0 - safe-execa@0.2.0: + safe-execa@0.3.0: dependencies: '@zkochan/which': 2.0.3 - execa: 5.1.1 + execa: 9.6.1 path-name: 1.0.0 - safe-promise-defer@1.0.1: + safe-promise-defer@2.0.0: dependencies: - promise-share: 1.0.0 + promise-share: 2.0.0 safe-push-apply@1.0.0: dependencies: @@ -25223,6 +25543,8 @@ snapshots: strip-final-newline@2.0.0: {} + strip-final-newline@4.0.0: {} + strip-indent@3.0.0: dependencies: min-indent: 1.0.1 @@ -25432,6 +25754,13 @@ snapshots: ts-toolbelt@9.6.0: {} + ts-type@3.0.8(ts-toolbelt@9.6.0): + dependencies: + '@types/node': 25.4.0 + ts-toolbelt: 9.6.0 + tslib: 2.8.1 + typedarray-dts: 1.0.0 + tslib@2.8.1: {} tuf-js@4.1.0: @@ -25526,6 +25855,8 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 + typedarray-dts@1.0.0: {} + typedarray-to-buffer@3.1.5: dependencies: is-typedarray: 1.0.0 @@ -25573,6 +25904,8 @@ snapshots: unicorn-magic@0.1.0: {} + unicorn-magic@0.3.0: {} + unified@9.2.2: dependencies: '@types/unist': 2.0.11 @@ -25652,6 +25985,16 @@ snapshots: untildify@4.0.0: {} + upath2@3.1.23(ts-toolbelt@9.6.0): + dependencies: + '@lazy-node/types-path': 1.0.3(ts-toolbelt@9.6.0) + '@types/node': 25.4.0 + path-is-network-drive: 1.0.24 + path-strip-sep: 1.0.21 + tslib: 2.8.1 + transitivePeerDependencies: + - ts-toolbelt + update-browserslist-db@1.2.3(browserslist@4.28.1): dependencies: browserslist: 4.28.1 @@ -25900,6 +26243,10 @@ snapshots: load-yaml-file: 0.2.0 path-exists: 4.0.0 + which-pm@4.0.0: + dependencies: + load-yaml-file: 1.0.0 + which-typed-array@1.1.20: dependencies: available-typed-arrays: 1.0.7 @@ -25974,11 +26321,10 @@ snapshots: dependencies: signal-exit: 4.1.0 - write-ini-file@4.0.1: + write-ini-file@5.0.0: dependencies: - ini: 3.0.1 - make-dir: 3.1.0 - write-file-atomic: 5.0.1 + ini: 6.0.0 + write-file-atomic: 7.0.1 write-json-file@5.0.0: dependencies: @@ -26001,11 +26347,11 @@ snapshots: sort-keys: 6.0.0 write-file-atomic: 6.0.0 - write-json5-file@3.1.0: + write-json5-file@4.0.0: dependencies: json5: 2.2.3 - sort-keys: 4.2.0 - write-file-atomic: 3.0.3 + sort-keys: 6.0.0 + write-file-atomic: 7.0.1 write-package@7.2.0: dependencies: @@ -26025,6 +26371,11 @@ snapshots: js-yaml: '@zkochan/js-yaml@0.0.11' write-file-atomic: 5.0.1 + write-yaml-file@6.0.0: + dependencies: + js-yaml: '@zkochan/js-yaml@0.0.11' + write-file-atomic: 7.0.1 + xdg-basedir@5.1.0: {} xtend@4.0.2: {} @@ -26073,4 +26424,6 @@ snapshots: yoctocolors-cjs@2.1.3: {} + yoctocolors@2.1.2: {} + zwitch@1.0.5: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0348b98364..7a4df340f3 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -146,26 +146,26 @@ catalog: '@yarnpkg/pnp': ^4.0.8 '@zkochan/cmd-shim': ^8.0.1 '@zkochan/retry': ^0.2.0 - '@zkochan/rimraf': ^3.0.2 + '@zkochan/rimraf': ^4.0.0 '@zkochan/table': ^2.0.1 adm-zip: ^0.5.16 ansi-diff: ^1.2.0 archy: ^1.0.0 - better-path-resolve: 1.0.0 + better-path-resolve: 2.0.0 bin-links: ^5.0.0 bole: ^5.0.17 boxen: npm:@zkochan/boxen@5.1.2 c8: ^7.14.0 camelcase: ^9.0.0 camelcase-keys: ^10.0.1 - can-link: ^2.0.0 - can-write-to-dir: ^1.1.1 + can-link: ^3.0.0 + can-write-to-dir: ^2.0.0 chalk: ^5.6.0 ci-info: ^4.3.0 cli-columns: ^4.0.0 cli-truncate: ^4.0.0 - cmd-extension: ^1.0.2 - comver-to-semver: ^1.0.0 + cmd-extension: ^2.0.0 + comver-to-semver: ^2.0.0 concurrently: 9.2.1 cross-env: ^10.1.0 cross-spawn: ^7.0.6 @@ -176,7 +176,7 @@ catalog: detect-libc: ^2.0.3 didyoumean2: ^7.0.4 dint: ^5.1.0 - dir-is-case-sensitive: ^2.0.0 + dir-is-case-sensitive: ^3.0.0 encode-registry: ^3.0.1 enquirer: ^2.4.1 esbuild: ^0.25.9 @@ -187,7 +187,7 @@ catalog: eslint-plugin-n: ^17.23.2 eslint-plugin-promise: ^7.2.1 eslint-plugin-regexp: ^2.10.0 - execa: npm:safe-execa@0.2.0 + execa: npm:safe-execa@0.3.0 exists-link: 2.0.0 fast-deep-equal: ^3.1.3 fast-glob: ^3.3.3 @@ -199,7 +199,7 @@ catalog: get-port: ^7.1.0 ghooks: 2.0.4 graceful-fs: ^4.2.11 - graceful-git: ^4.0.0 + graceful-git: ^5.0.0 graph-cycles: 3.0.0 hosted-git-info: npm:@pnpm/hosted-git-info@1.0.0 https-proxy-server-express: 0.1.2 @@ -207,8 +207,8 @@ catalog: hyperdrive-schemas: ^2.0.0 ini: 6.0.0 is-gzip: 2.0.0 - is-inner-link: ^4.0.0 - is-subdir: ^1.2.0 + is-inner-link: ^5.0.0 + is-subdir: ^2.0.0 is-windows: ^1.0.2 isexe: 2.0.0 jest: ^30.2.0 @@ -223,7 +223,7 @@ catalog: lodash.throttle: 4.1.1 loud-rejection: ^2.2.0 lru-cache: ^11.1.0 - make-empty-dir: ^3.0.2 + make-empty-dir: ^4.0.0 mdast-util-to-string: ^2.0.0 memoize: ^10.2.0 micromatch: ^4.0.8 @@ -241,38 +241,38 @@ catalog: p-every: ^2.0.0 p-filter: ^4.1.0 p-limit: ^7.1.0 - p-map-values: ^1.0.0 + p-map-values: ^0.1.0 p-memoize: 8.0.0 p-queue: ^8.1.0 parse-json: ^8.3.0 parse-npm-tarball-url: ^4.0.0 - path-absolute: ^1.0.1 + path-absolute: ^2.0.0 path-exists: ^5.0.0 path-name: ^1.0.0 - path-temp: ^2.1.1 + path-temp: ^3.0.0 pidtree: ^0.6.0 - preferred-pm: ^3.1.4 + preferred-pm: ^5.0.0 pretty-bytes: ^7.0.1 pretty-ms: ^9.2.0 - promise-share: ^1.0.0 + promise-share: ^2.0.0 proxyquire: ^2.1.3 ps-list: ^8.1.1 ramda: npm:@pnpm/ramda@0.28.1 - read-ini-file: 4.0.0 - read-yaml-file: ^2.1.0 - realpath-missing: ^1.1.0 + read-ini-file: 5.0.0 + read-yaml-file: ^3.0.0 + realpath-missing: ^2.0.0 remark-parse: ^9.0.0 remark-stringify: ^9.0.1 - rename-overwrite: ^6.0.6 - render-help: ^1.0.3 - resolve-link-target: ^2.0.0 + rename-overwrite: ^7.0.0 + render-help: ^2.0.0 + resolve-link-target: ^3.0.0 rimraf: ^6.1.2 - root-link-target: ^3.1.0 - run-groups: ^4.0.0 + root-link-target: ^4.0.0 + run-groups: ^5.0.0 rxjs: ^7.8.2 safe-buffer: 5.2.1 - safe-execa: ^0.2.0 - safe-promise-defer: ^1.0.1 + safe-execa: ^0.3.0 + safe-promise-defer: ^2.0.0 sanitize-filename: ^1.6.3 semver: ^7.7.2 semver-range-intersect: ^0.3.1 @@ -304,11 +304,11 @@ catalog: version-selector-type: ^3.0.0 which: npm:@pnpm/which@^3.0.1 write-file-atomic: ^7.0.0 - write-ini-file: 4.0.1 + write-ini-file: 5.0.0 write-json-file: ^7.0.0 - write-json5-file: ^3.1.0 + write-json5-file: ^4.0.0 write-package: 7.2.0 - write-yaml-file: ^5.0.0 + write-yaml-file: ^6.0.0 yaml: ^2.8.1 yaml-tag: 1.1.0 @@ -334,18 +334,47 @@ minimumReleaseAge: 1440 # At least a day minimumReleaseAgeExclude: - '@pnpm/*' - '@rushstack/worker-pool@0.7.1' + - '@zkochan/*' - '@zkochan/cmd-shim@8.0.0 || 8.0.1' + - better-path-resolve - body-parser@2.2.1 + - can-link + - can-write-to-dir + - cmd-extension + - comver-to-semver + - dir-is-case-sensitive - express@4.22.1 - glob@11.1.0 + - graceful-git + - is-inner-link + - is-subdir - jws@3.2.3 + - make-empty-dir - normalize-registry-url - - path-temp@2.1.1 + - p-map-values - parse-npm-tarball-url@4.0.0 + - path-absolute + - path-temp - pnpm - - rename-overwrite@6.0.6 - - run-groups@4.0.0 + - preferred-pm + - promise-share + - read-ini-file + - read-json5-file + - read-yaml-file + - realpath-missing + - rename-overwrite + - render-help + - resolve-link-target + - root-link-target + - run-groups + - safe-execa + - safe-promise-defer - tar@7.5.10 + - which-pm + - which-pm-runs + - write-ini-file + - write-json5-file + - write-yaml-file - lodash@4.17.23 - qs@6.14.2 diff --git a/pnpm/src/cmd/bin.ts b/pnpm/src/cmd/bin.ts index 4cf0713c80..ed30c6369e 100644 --- a/pnpm/src/cmd/bin.ts +++ b/pnpm/src/cmd/bin.ts @@ -1,7 +1,7 @@ import { docsUrl } from '@pnpm/cli-utils' import { types as allTypes } from '@pnpm/config' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' export const rcOptionsTypes = cliOptionsTypes diff --git a/pnpm/src/cmd/clean.ts b/pnpm/src/cmd/clean.ts index eca85d02d8..5fd2512296 100644 --- a/pnpm/src/cmd/clean.ts +++ b/pnpm/src/cmd/clean.ts @@ -2,10 +2,10 @@ import { promises as fs } from 'fs' import path from 'path' import { docsUrl } from '@pnpm/cli-utils' import { findWorkspacePackagesNoCheck } from '@pnpm/workspace.find-packages' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' import { pathExists } from 'path-exists' -import rimraf from '@zkochan/rimraf' -import renderHelp from 'render-help' +import { rimraf } from '@zkochan/rimraf' +import { renderHelp } from 'render-help' export const commandNames = ['clean'] diff --git a/pnpm/src/cmd/help.ts b/pnpm/src/cmd/help.ts index 075d018847..f69a10fb33 100644 --- a/pnpm/src/cmd/help.ts +++ b/pnpm/src/cmd/help.ts @@ -1,6 +1,6 @@ import { packageManager, detectIfCurrentPkgIsExecutable } from '@pnpm/cli-meta' import { docsUrl } from '@pnpm/cli-utils' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import type { CommandDefinition } from './index.js' type HelpByCommandName = Record string> diff --git a/pnpm/src/cmd/installTest.ts b/pnpm/src/cmd/installTest.ts index 0c26fc5d72..3cb2a8aadd 100644 --- a/pnpm/src/cmd/installTest.ts +++ b/pnpm/src/cmd/installTest.ts @@ -1,7 +1,7 @@ import { docsUrl } from '@pnpm/cli-utils' import { install } from '@pnpm/plugin-commands-installation' import { run } from '@pnpm/plugin-commands-script-runners' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import type { PnpmOptions } from '../types.js' export const cliOptionsTypes = install.cliOptionsTypes diff --git a/pnpm/src/cmd/recursive.ts b/pnpm/src/cmd/recursive.ts index c5b0f2fc1c..5e13289732 100644 --- a/pnpm/src/cmd/recursive.ts +++ b/pnpm/src/cmd/recursive.ts @@ -2,7 +2,7 @@ import { docsUrl } from '@pnpm/cli-utils' import { FILTERING } from '@pnpm/common-cli-options-help' import { WANTED_LOCKFILE } from '@pnpm/constants' import { getDefaultWorkspaceConcurrency } from '@pnpm/config' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' export const rcOptionsTypes = (): Record => ({}) export const cliOptionsTypes = (): Record => ({}) diff --git a/pnpm/src/cmd/root.ts b/pnpm/src/cmd/root.ts index 7cdac30448..79e51a4336 100644 --- a/pnpm/src/cmd/root.ts +++ b/pnpm/src/cmd/root.ts @@ -2,7 +2,7 @@ import path from 'path' import { types as allTypes } from '@pnpm/config' import { docsUrl } from '@pnpm/cli-utils' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' export const rcOptionsTypes = cliOptionsTypes diff --git a/pnpm/test/clean.ts b/pnpm/test/clean.ts index 02d16d68d2..b8ea0dd507 100644 --- a/pnpm/test/clean.ts +++ b/pnpm/test/clean.ts @@ -1,7 +1,7 @@ import fs from 'fs' import path from 'path' import { preparePackages, tempDir } from '@pnpm/prepare' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpmSync } from './utils/index.js' test('pnpm clean removes pnpm entries and packages but preserves non-pnpm hidden files', () => { @@ -80,7 +80,7 @@ test('pnpm clean works in a workspace', () => { ]) fs.writeFileSync('package.json', JSON.stringify({ name: 'root', version: '1.0.0' })) - writeYamlFile('pnpm-workspace.yaml', { packages: ['*'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['*'] }) // Set up fake node_modules in root and each project for (const dir of ['.', 'project-a', 'project-b']) { @@ -150,7 +150,7 @@ test('pnpm clean --lockfile removes lockfiles in workspace', () => { ]) fs.writeFileSync('package.json', JSON.stringify({ name: 'root', version: '1.0.0' })) - writeYamlFile('pnpm-workspace.yaml', { packages: ['*'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['*'] }) // Set up lockfiles and node_modules for (const dir of ['.', 'project-a', 'project-b']) { diff --git a/pnpm/test/cli.ts b/pnpm/test/cli.ts index 1b0f09a4b7..721e73a60b 100644 --- a/pnpm/test/cli.ts +++ b/pnpm/test/cli.ts @@ -3,9 +3,8 @@ import path from 'path' import PATH_NAME from 'path-name' import { prepare, prepareEmpty } from '@pnpm/prepare' import { fixtures } from '@pnpm/test-fixtures' -import { sync as rimraf } from '@zkochan/rimraf' -import execa from 'execa' -import isWindows from 'is-windows' +import { rimrafSync } from '@zkochan/rimraf' +import { safeExeca as execa } from 'execa' import { execPnpm, execPnpmSync, @@ -52,7 +51,7 @@ test('pnpm import does not move modules created by npm', async () => { test('pass through to npm with all the args', async () => { prepare() - rimraf('package.json') + rimrafSync('package.json') const result = execPnpmSync(['dist-tag', 'ls', 'pnpm']) @@ -64,7 +63,7 @@ test('pnpm fails when an unsupported command is used', async () => { const { status } = execPnpmSync(['unsupported-command']) - expect(status).toBe(isWindows() ? 1 : 254) + expect(status).toBe(1) }) test('pnpm fails when no command is specified', async () => { diff --git a/pnpm/test/config/get.ts b/pnpm/test/config/get.ts index 249f1d3cda..e583f210f0 100644 --- a/pnpm/test/config/get.ts +++ b/pnpm/test/config/get.ts @@ -1,6 +1,6 @@ import fs from 'fs' import path from 'path' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import type { WorkspaceManifest } from '@pnpm/workspace.read-manifest' import { prepare } from '@pnpm/prepare' import { execPnpmSync } from '../utils/index.js' @@ -62,7 +62,7 @@ test('pnpm config get reads npm options but ignores other settings from .npmrc', test('pnpm config get reads workspace-specific settings from pnpm-workspace.yaml', () => { prepare() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { dlxCacheMaxAge: 1234, trustPolicyExclude: ['foo', 'bar'], packages: ['baz', 'qux'], @@ -96,7 +96,7 @@ test('pnpm config get reads workspace-specific settings from pnpm-workspace.yaml test('pnpm config get ignores non camelCase settings from pnpm-workspace.yaml', () => { prepare() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { 'dlx-cache-max-age': 1234, 'trust-policy-exclude': ['foo', 'bar'], }) @@ -139,7 +139,7 @@ test('pnpm config get accepts a property path', () => { } satisfies Partial prepare() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packageExtensions: { '@babel/parser': { peerDependencies: { @@ -199,7 +199,7 @@ test('pnpm config get accepts a property path', () => { test('pnpm config get "" gives exactly the same result as pnpm config list', () => { prepare() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { dlxCacheMaxAge: 1234, trustPolicyExclude: ['foo', 'bar'], packages: ['baz', 'qux'], @@ -236,7 +236,7 @@ test('pnpm config get shows settings from global config.yaml', () => { const XDG_CONFIG_HOME = path.resolve('.config') const configDir = path.join(XDG_CONFIG_HOME, 'pnpm') fs.mkdirSync(configDir, { recursive: true }) - writeYamlFile(path.join(configDir, 'config.yaml'), { + writeYamlFileSync(path.join(configDir, 'config.yaml'), { dangerouslyAllowAllBuilds: true, dlxCacheMaxAge: 1234, dev: true, diff --git a/pnpm/test/config/list.ts b/pnpm/test/config/list.ts index b1af03f576..c198ebf821 100644 --- a/pnpm/test/config/list.ts +++ b/pnpm/test/config/list.ts @@ -1,6 +1,6 @@ import fs from 'fs' import path from 'path' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import type { Config } from '@pnpm/config' import { prepare } from '@pnpm/prepare' import { execPnpmSync } from '../utils/index.js' @@ -59,7 +59,7 @@ test('pnpm config list reads workspace-specific settings from pnpm-workspace.yam } prepare() - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) const { stdout } = execPnpmSync(['config', 'list', '--json'], { expectSuccess: true }) expect(JSON.parse(stdout.toString())).toStrictEqual(expect.objectContaining(workspaceManifest)) @@ -87,7 +87,7 @@ test('pnpm config list ignores non camelCase settings from pnpm-workspace.yaml', } prepare() - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) const { stdout } = execPnpmSync(['config', 'list', '--json'], { expectSuccess: true }) expect(JSON.parse(stdout.toString())).not.toHaveProperty(['dlx-cache-max-age']) @@ -106,7 +106,7 @@ test('pnpm config list still reads unknown camelCase keys from pnpm-workspace.ya } prepare() - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) { const { stdout } = execPnpmSync(['config', 'list'], { expectSuccess: true }) @@ -135,7 +135,7 @@ test('pnpm config list --json shows all keys in camelCase', () => { } prepare() - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) const { stdout } = execPnpmSync(['config', 'list'], { expectSuccess: true }) expect(JSON.parse(stdout.toString())).toStrictEqual(expect.objectContaining(workspaceManifest)) @@ -150,7 +150,7 @@ test('pnpm config list shows settings from global config.yaml', () => { const XDG_CONFIG_HOME = path.resolve('.config') const configDir = path.join(XDG_CONFIG_HOME, 'pnpm') fs.mkdirSync(configDir, { recursive: true }) - writeYamlFile(path.join(configDir, 'config.yaml'), { + writeYamlFileSync(path.join(configDir, 'config.yaml'), { dangerouslyAllowAllBuilds: true, dlxCacheMaxAge: 1234, dev: true, diff --git a/pnpm/test/configurationalDependencies.test.ts b/pnpm/test/configurationalDependencies.test.ts index fcad9df6a7..fad9e1a15b 100644 --- a/pnpm/test/configurationalDependencies.test.ts +++ b/pnpm/test/configurationalDependencies.test.ts @@ -3,15 +3,15 @@ import path from 'path' import { readEnvLockfile } from '@pnpm/lockfile.fs' import { prepare } from '@pnpm/prepare' import { getIntegrity } from '@pnpm/registry-mock' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { writeJsonFileSync } from 'write-json-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { execPnpm, execPnpmSync, pnpmBinLocation } from './utils/index.js' test('patch from configuration dependency is applied', async () => { prepare() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { configDependencies: { '@pnpm.e2e/has-patch-for-foo': `1.0.0+${getIntegrity('@pnpm.e2e/has-patch-for-foo', '1.0.0')}`, }, @@ -27,7 +27,7 @@ test('patch from configuration dependency is applied', async () => { test('patch from configuration dependency is applied via updateConfig hook', async () => { const project = prepare() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { configDependencies: { '@pnpm.e2e/has-patch-for-foo': `1.0.0+${getIntegrity('@pnpm.e2e/has-patch-for-foo', '1.0.0')}`, }, @@ -49,7 +49,7 @@ test('catalog applied by configurational dependency hook', async () => { '@pnpm.e2e/bar': 'catalog:bar', }, }) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { configDependencies: { '@pnpm.e2e/update-config-with-catalogs': `1.0.0+${getIntegrity('@pnpm.e2e/update-config-with-catalogs', '1.0.0')}`, }, @@ -122,7 +122,7 @@ test('config deps are installed after switching to a pnpm version that supports // Write .npmrc so the switched-to pnpm version can find the mock registry fs.writeFileSync('.npmrc', `registry=http://localhost:${REGISTRY_MOCK_PORT}/\n`) // Use old inline integrity format that pnpm v10 understands - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { configDependencies: { '@pnpm.e2e/has-patch-for-foo': `1.0.0+${getIntegrity('@pnpm.e2e/has-patch-for-foo', '1.0.0')}`, }, @@ -175,7 +175,7 @@ test('installing a new configurational dependency', async () => { await execPnpm(['add', '@pnpm.e2e/foo@100.0.0', '--config']) // Workspace manifest should have a clean specifier (no integrity) - const workspaceManifest = readYamlFile<{ configDependencies: Record }>('pnpm-workspace.yaml') + const workspaceManifest = readYamlFileSync<{ configDependencies: Record }>('pnpm-workspace.yaml') expect(workspaceManifest.configDependencies).toStrictEqual({ '@pnpm.e2e/foo': '100.0.0', }) diff --git a/pnpm/test/deploy.ts b/pnpm/test/deploy.ts index 6d82cde0ad..9b04082b7d 100644 --- a/pnpm/test/deploy.ts +++ b/pnpm/test/deploy.ts @@ -2,7 +2,7 @@ import fs from 'fs' import path from 'path' import { preparePackages } from '@pnpm/prepare' import { loadJsonFileSync } from 'load-json-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from './utils/index.js' // Covers https://github.com/pnpm/pnpm/issues/9550 @@ -42,7 +42,7 @@ test.skip('legacy deploy creates only necessary directories when the root manife }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: [ 'services/*', 'packages/*', diff --git a/pnpm/test/errorHandler.test.ts b/pnpm/test/errorHandler.test.ts index fbfe313bd4..5522a50e70 100644 --- a/pnpm/test/errorHandler.test.ts +++ b/pnpm/test/errorHandler.test.ts @@ -1,7 +1,7 @@ import { prepare, preparePackages } from '@pnpm/prepare' import isWindows from 'is-windows' import getPort from 'get-port' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpmSync } from './utils/index.js' import { fixtures } from '@pnpm/test-fixtures' import { isPortInUse } from './utils/isPortInUse.js' @@ -35,7 +35,7 @@ test('should print json format error when add dependency on workspace root', asy version: '1.0.0', }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) const { status, stdout } = execPnpmSync(['add', 'nanoid', '--parseable']) @@ -85,7 +85,7 @@ test('should print error summary when some packages fail with --no-bail', async }, }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) const { stdout } = execPnpmSync(['-r', '--no-bail', 'run', 'build']) const output = stdout.toString() expect(output).toContain('ERR_PNPM_RECURSIVE_FAIL') diff --git a/pnpm/test/filterProd.test.ts b/pnpm/test/filterProd.test.ts index fccd53e232..fbfe0907ff 100644 --- a/pnpm/test/filterProd.test.ts +++ b/pnpm/test/filterProd.test.ts @@ -1,4 +1,4 @@ -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from './utils/index.js' import { preparePackages, @@ -49,7 +49,7 @@ test.each([ ] preparePackages(projects) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['install']) await execPnpm([filter, '...project-3', 'test']) diff --git a/pnpm/test/hooks.ts b/pnpm/test/hooks.ts index e735c48c36..561cb16ab4 100644 --- a/pnpm/test/hooks.ts +++ b/pnpm/test/hooks.ts @@ -5,7 +5,7 @@ import type { PackageManifest } from '@pnpm/types' import { prepare, preparePackages } from '@pnpm/prepare' import { getIntegrity } from '@pnpm/registry-mock' import { loadJsonFileSync } from 'load-json-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm, execPnpmSync } from './utils/index.js' test('readPackage hook in single project doesn\'t modify manifest', async () => { @@ -75,7 +75,7 @@ test('readPackage hook in monorepo doesn\'t modify manifest', async () => { } ` fs.writeFileSync('.pnpmfile.cjs', pnpmfile, 'utf8') - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['add', 'is-positive@1.0.0', '--filter', 'project-a']) let pkg: PackageManifest = loadJsonFileSync(path.resolve('project-a/package.json')) @@ -139,7 +139,7 @@ test('importPackage hooks', async () => { } ` - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { globalPnpmfile: '.pnpmfile.cjs', }) @@ -282,7 +282,7 @@ export const hooks = { nodeLinker: 'hoisted', }), }`, 'utf8') - writeYamlFile('pnpm-workspace.yaml', { pnpmfile: ['.pnpmfile.mjs'] }) + writeYamlFileSync('pnpm-workspace.yaml', { pnpmfile: ['.pnpmfile.mjs'] }) await execPnpm(['add', 'is-odd@1.0.0']) @@ -314,7 +314,7 @@ module.exports = { }, }, }`, 'utf8') - writeYamlFile('pnpm-workspace.yaml', { pnpmfile: ['pnpmfile1.cjs', 'pnpmfile2.cjs'] }) + writeYamlFileSync('pnpm-workspace.yaml', { pnpmfile: ['pnpmfile1.cjs', 'pnpmfile2.cjs'] }) await execPnpm(['add', 'is-odd@1.0.0']) diff --git a/pnpm/test/install/globalVirtualStore.ts b/pnpm/test/install/globalVirtualStore.ts index 711453fbde..c58a994404 100644 --- a/pnpm/test/install/globalVirtualStore.ts +++ b/pnpm/test/install/globalVirtualStore.ts @@ -1,7 +1,7 @@ import fs from 'fs' import path from 'path' import { prepare } from '@pnpm/prepare' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from '../utils/index.js' test('using a global virtual store', async () => { @@ -12,7 +12,7 @@ test('using a global virtual store', async () => { }) const storeDir = path.resolve('store') const globalVirtualStoreDir = path.join(storeDir, 'v11/links') - writeYamlFile(path.resolve('pnpm-workspace.yaml'), { + writeYamlFileSync(path.resolve('pnpm-workspace.yaml'), { enableGlobalVirtualStore: true, storeDir, privateHoistPattern: '*', diff --git a/pnpm/test/install/hoist.ts b/pnpm/test/install/hoist.ts index b83ce4cdc7..1ddd5995f2 100644 --- a/pnpm/test/install/hoist.ts +++ b/pnpm/test/install/hoist.ts @@ -1,5 +1,5 @@ import { prepare, preparePackages } from '@pnpm/prepare' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from '../utils/index.js' test('hoist the dependency graph', async () => { @@ -56,7 +56,7 @@ test('shamefully-hoist: applied to all the workspace projects when set to true i }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], shamefullyHoist: true, }) @@ -92,7 +92,7 @@ test('shamefully-hoist: applied to all the workspace projects when set to true i }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], shamefullyHoist: true, dedupeDirectDeps: true, diff --git a/pnpm/test/install/hooks.ts b/pnpm/test/install/hooks.ts index 3626d4990c..fefadb6a12 100644 --- a/pnpm/test/install/hooks.ts +++ b/pnpm/test/install/hooks.ts @@ -3,9 +3,9 @@ import path from 'path' import type { LockfileFile } from '@pnpm/lockfile.types' import { prepare, preparePackages } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { loadJsonFileSync } from 'load-json-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { addDistTag, execPnpm, @@ -233,7 +233,7 @@ test('readPackage hook from pnpmfile at root of workspace', async () => { ` fs.writeFileSync('.pnpmfile.cjs', pnpmfile, 'utf8') - writeYamlFile('pnpm-workspace.yaml', { packages: ['project-1'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['project-1'] }) const storeDir = path.resolve('store') @@ -248,7 +248,7 @@ test('readPackage hook from pnpmfile at root of workspace', async () => { process.chdir('..') - const lockfile = readYamlFile('pnpm-lock.yaml') + const lockfile = readYamlFileSync('pnpm-lock.yaml') expect(lockfile.snapshots!['is-positive@1.0.0'].dependencies).toStrictEqual({ '@pnpm.e2e/dep-of-pkg-with-1-dep': '100.1.0', }) @@ -589,7 +589,7 @@ test('readPackage hook is used during removal inside a workspace', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['project-1'], autoInstallPeers: false, }) @@ -614,7 +614,7 @@ test('readPackage hook is used during removal inside a workspace', async () => { await execPnpm(['uninstall', 'is-positive', '--no-strict-peer-dependencies']) process.chdir('..') - const lockfile = readYamlFile('pnpm-lock.yaml') + const lockfile = readYamlFileSync('pnpm-lock.yaml') expect(lockfile.packages!['@pnpm.e2e/abc@1.0.0'].peerDependencies!['is-negative']).toBe('1.0.0') }) @@ -633,7 +633,7 @@ test('preResolution hook', async () => { const npmrc = '@foo:registry=https://foo.com' fs.writeFileSync('.npmrc', npmrc, 'utf8') - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { globalPnpmfile: '.pnpmfile.cjs', }) @@ -672,7 +672,7 @@ test('pass readPackage with shared lockfile', async () => { }, }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['*'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['*'] }) fs.writeFileSync('.pnpmfile.cjs', ` module.exports = { hooks: { diff --git a/pnpm/test/install/issue-8959.ts b/pnpm/test/install/issue-8959.ts index 7e855dddb1..ece8c6d216 100644 --- a/pnpm/test/install/issue-8959.ts +++ b/pnpm/test/install/issue-8959.ts @@ -1,6 +1,6 @@ import fs from 'fs' import { preparePackages } from '@pnpm/prepare' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from '../utils/index.js' // Covers https://github.com/pnpm/pnpm/issues/8959 @@ -27,7 +27,7 @@ test('restores deleted modules dir of a workspace package', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['packages/*'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['packages/*'] }) await execPnpm(['install']) expect(fs.readdirSync('node_modules')).toContain('.pnpm-workspace-state-v1.json') diff --git a/pnpm/test/install/lifecycleScripts.ts b/pnpm/test/install/lifecycleScripts.ts index 3603300c0b..5a1709c84b 100644 --- a/pnpm/test/install/lifecycleScripts.ts +++ b/pnpm/test/install/lifecycleScripts.ts @@ -4,7 +4,7 @@ import { prepare } from '@pnpm/prepare' import type { PackageManifest, ProjectManifest } from '@pnpm/types' import PATH from 'path-name' import { loadJsonFileSync } from 'load-json-file' -import writeYamlFile from 'write-yaml-file' +import { writeYamlFile } from 'write-yaml-file' import { execPnpmSync, pnpmBinLocation } from '../utils/index.js' import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest' diff --git a/pnpm/test/install/misc.ts b/pnpm/test/install/misc.ts index 64a7071a9a..a8504cee9c 100644 --- a/pnpm/test/install/misc.ts +++ b/pnpm/test/install/misc.ts @@ -11,11 +11,11 @@ import { StoreIndex, storeIndexKey } from '@pnpm/store.index' import { lexCompare } from '@pnpm/util.lex-comparator' import { writeProjectManifest } from '@pnpm/write-project-manifest' import { fixtures } from '@pnpm/test-fixtures' -import dirIsCaseSensitive from 'dir-is-case-sensitive' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as rimraf } from '@zkochan/rimraf' +import { dirIsCaseSensitive } from 'dir-is-case-sensitive' +import { readYamlFileSync } from 'read-yaml-file' +import { rimrafSync } from '@zkochan/rimraf' import isWindows from 'is-windows' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import crossSpawn from 'cross-spawn' import { execPnpm, @@ -80,7 +80,7 @@ test('write to stderr when --use-stderr is used', async () => { test('install with lockfile being false in pnpm-workspace.yaml', async () => { const project = prepare() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { lockfile: false, }) @@ -113,7 +113,7 @@ test('install with external lockfile directory', async () => { project.has('is-positive') - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(Object.keys(lockfile.importers)).toStrictEqual(['project']) }) @@ -177,7 +177,7 @@ test("don't fail on case insensitive filesystems when package has 2 files with s expect(packageFiles).toStrictEqual(['Foo.js', 'foo.js', 'package.json']) const files = fs.readdirSync('node_modules/@pnpm.e2e/with-same-file-in-different-cases') - if (await dirIsCaseSensitive.default(storeDir)) { + if (await dirIsCaseSensitive(storeDir)) { expect([...files].sort(lexCompare)).toStrictEqual(['Foo.js', 'foo.js', 'package.json']) } else { expect([...files].map((f) => f.toLowerCase()).sort(lexCompare)).toStrictEqual(['foo.js', 'package.json']) @@ -410,8 +410,8 @@ test('using a custom virtual-store-dir location', async () => { expect(fs.existsSync('node_modules/.pnpm/lock.yaml')).toBeTruthy() expect(fs.existsSync('.pnpm/node_modules/once/package.json')).toBeTruthy() - rimraf('node_modules') - rimraf('.pnpm') + rimrafSync('node_modules') + rimrafSync('.pnpm') await execPnpm(['install', '--virtual-store-dir=.pnpm', '--frozen-lockfile']) @@ -442,7 +442,7 @@ test('installing in a CI environment', async () => { await execPnpm(['install', '--no-frozen-lockfile'], { env: { CI: 'true' } }) - rimraf('node_modules') + rimrafSync('node_modules') project.writePackageJson({ dependencies: { rimraf: '2' }, }) @@ -526,7 +526,7 @@ test('installation fails when the stored package name and version do not match t manifest: { ...cacheIntegrity.manifest, name: 'foo' }, }) - rimraf('node_modules') + rimrafSync('node_modules') await expect( execPnpm(['install', ...settings]) ).rejects.toThrow() diff --git a/pnpm/test/install/preferOffline.ts b/pnpm/test/install/preferOffline.ts index b77b5dd048..cf5a5ea439 100644 --- a/pnpm/test/install/preferOffline.ts +++ b/pnpm/test/install/preferOffline.ts @@ -1,6 +1,6 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import { prepare } from '@pnpm/prepare' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { addDistTag, execPnpm, @@ -14,8 +14,8 @@ test('when prefer offline is used, meta from store is used, where latest might b // This will cache the meta of `foo` await execPnpm(['install', '@pnpm.e2e/foo']) - rimraf('node_modules') - rimraf(WANTED_LOCKFILE) + rimrafSync('node_modules') + rimrafSync(WANTED_LOCKFILE) await addDistTag('@pnpm.e2e/foo', '100.1.0', 'latest') diff --git a/pnpm/test/install/sideEffects.ts b/pnpm/test/install/sideEffects.ts index b07dc05142..5f57981f3c 100644 --- a/pnpm/test/install/sideEffects.ts +++ b/pnpm/test/install/sideEffects.ts @@ -2,7 +2,7 @@ import fs from 'fs' import path from 'path' import { prepare } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import { sync as rimraf } from '@zkochan/rimraf' +import { rimrafSync } from '@zkochan/rimraf' import { execPnpm } from '../utils/index.js' const ENGINE_DIR = `${process.platform}-${process.arch}-node-${process.version.split('.')[0]}` @@ -38,7 +38,7 @@ test.skip('using side effects cache', async function () { const cacheBuildDir = path.join(storePath, `localhost+${REGISTRY_MOCK_PORT}/diskusage/1.1.3/side_effects/${ENGINE_DIR}/package/build`) fs.writeFileSync(path.join(cacheBuildDir, 'new-file.txt'), 'some new content') - rimraf('node_modules') + rimrafSync('node_modules') await execPnpm(['add', 'diskusage@1.1.3', '--side-effects-cache', '--no-verify-store-integrity', '--package-import-method', 'copy']) expect(fs.existsSync('node_modules/diskusage/build/new-file.txt')).toBeTruthy() @@ -54,12 +54,12 @@ test.skip('readonly side effects cache', async function () { const cacheBuildDir = path.join(storePath, `localhost+${REGISTRY_MOCK_PORT}/diskusage/1.1.2/side_effects/${ENGINE_DIR}/package/build`) fs.writeFileSync(path.join(cacheBuildDir, 'new-file.txt'), 'some new content') - rimraf('node_modules') + rimrafSync('node_modules') await execPnpm(['add', 'diskusage@1.1.2', '--side-effects-cache-readonly', '--no-verify-store-integrity', '--package-import-method', 'copy']) expect(fs.existsSync('node_modules/diskusage/build/new-file.txt')).toBeTruthy() - rimraf('node_modules') + rimrafSync('node_modules') // changing version to make sure we don't create the cache await execPnpm(['add', 'diskusage@1.1.3', '--side-effects-cache-readonly', '--no-verify-store-integrity', '--package-import-method', 'copy']) diff --git a/pnpm/test/install/supportedArchitectures.ts b/pnpm/test/install/supportedArchitectures.ts index 6a8766dca0..1732254de0 100644 --- a/pnpm/test/install/supportedArchitectures.ts +++ b/pnpm/test/install/supportedArchitectures.ts @@ -2,7 +2,7 @@ import fs from 'fs' import { prepare, prepareEmpty } from '@pnpm/prepare' import { readModulesManifest } from '@pnpm/modules-yaml' import type { WorkspaceManifest } from '@pnpm/workspace.read-manifest' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from '../utils/index.js' const describeOnLinuxOnly = process.platform === 'linux' ? describe : describe.skip @@ -97,7 +97,7 @@ describeOnLinuxOnly('install with supportedArchitectures from CLI options and ma }, }) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { supportedArchitectures: workspaceConfig, } as WorkspaceManifest) @@ -119,7 +119,7 @@ describeOnLinuxOnly('add with supportedArchitectures from CLI options and manife test.each(TEST_CASES)('%j on %j', async (cliOpts, workspaceConfig, installed, skipped) => { prepareEmpty() - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { supportedArchitectures: workspaceConfig, } as WorkspaceManifest) diff --git a/pnpm/test/list.ts b/pnpm/test/list.ts index fce848e0e4..cc4730f89a 100644 --- a/pnpm/test/list.ts +++ b/pnpm/test/list.ts @@ -1,7 +1,7 @@ import fs from 'fs' import path from 'path' import { prepare, preparePackages } from '@pnpm/prepare' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm, execPnpmSync } from './utils/index.js' test('ls --filter=not-exist --json should prints an empty array (#9672)', async () => { @@ -16,7 +16,7 @@ test('ls --filter=not-exist --json should prints an empty array (#9672)', async }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['packages/*'], }) @@ -49,7 +49,7 @@ test('pnpm list returns correct paths with global virtual store', async () => { '@pnpm.e2e/pkg-with-1-dep': '100.0.0', }, }) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { enableGlobalVirtualStore: true, storeDir: path.resolve('store'), privateHoistPattern: '*', diff --git a/pnpm/test/monorepo/dedupePeers.test.ts b/pnpm/test/monorepo/dedupePeers.test.ts index 8b769a8343..6789ba1b56 100644 --- a/pnpm/test/monorepo/dedupePeers.test.ts +++ b/pnpm/test/monorepo/dedupePeers.test.ts @@ -3,10 +3,10 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import type { LockfileFile } from '@pnpm/lockfile.types' import { preparePackages } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { createPeerDepGraphHash } from '@pnpm/dependency-path' import { loadJsonFileSync } from 'load-json-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from '../utils/index.js' test('deduplicate packages that have peers, when adding new dependency in a workspace', async () => { @@ -34,7 +34,7 @@ test('deduplicate packages that have peers, when adding new dependency in a work }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], dedupePeerDependents: true, autoInstallPeers: false, @@ -42,7 +42,7 @@ test('deduplicate packages that have peers, when adding new dependency in a work await execPnpm(['install']) await execPnpm(['--filter=project-2', 'add', '@pnpm.e2e/abc@1.0.0']) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) const depPaths = Object.keys(lockfile.snapshots ?? {}) expect(depPaths).toHaveLength(8) expect(depPaths).toContain(`@pnpm.e2e/abc@1.0.0${createPeerDepGraphHash([{ name: '@pnpm.e2e/peer-a', version: '1.0.0' }, { name: '@pnpm.e2e/peer-b', version: '1.0.0' }, { name: '@pnpm.e2e/peer-c', version: '1.0.0' }])}`) @@ -79,7 +79,7 @@ test('partial update in a workspace should work with dedupe-peer-dependents is t }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], dedupePeerDependents: true, autoInstallPeers: false, @@ -124,7 +124,7 @@ test('partial update --latest in a workspace should not affect other packages wh }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], dedupePeerDependents: true, autoInstallPeers: false, @@ -145,7 +145,7 @@ test('partial update --latest in a workspace should not affect other packages wh // similar for the importers in the lockfile; project 1 is unaffected, while // project 2 resolves the latest foo, but keeps bar to the previous version - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.importers['project-1']?.dependencies?.['@pnpm.e2e/foo'].version).toBe('1.0.0') expect(lockfile.importers['project-1']?.dependencies?.['@pnpm.e2e/bar'].version).toBe('100.0.0') expect(lockfile.importers['project-2']?.dependencies?.['@pnpm.e2e/foo'].version).toBe('2.0.0') @@ -176,7 +176,7 @@ test('peer dependents deduplication should not remove peer dependencies', async }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], dedupePeerDependents: true, autoInstallPeers: true, @@ -184,6 +184,6 @@ test('peer dependents deduplication should not remove peer dependencies', async await execPnpm(['install']) await execPnpm(['--filter=project-2', 'add', 'is-positive@1.0.0']) - const lockfile = readYamlFile(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line + const lockfile = readYamlFileSync(path.resolve(WANTED_LOCKFILE)) // eslint-disable-line expect(lockfile.importers['.']?.dependencies?.['@pnpm.e2e/abc-parent-with-missing-peers'].version).toBe('1.0.0(@pnpm.e2e/peer-a@1.0.0)(@pnpm.e2e/peer-b@1.0.0)(@pnpm.e2e/peer-c@1.0.0)') }) diff --git a/pnpm/test/monorepo/index.ts b/pnpm/test/monorepo/index.ts index f35226cef8..f55d05b589 100644 --- a/pnpm/test/monorepo/index.ts +++ b/pnpm/test/monorepo/index.ts @@ -14,12 +14,12 @@ import { tempDir as makeTempDir, } from '@pnpm/prepare' import { readPackageJsonFromDir } from '@pnpm/read-package-json' -import { sync as readYamlFile } from 'read-yaml-file' -import execa from 'execa' -import { sync as rimraf } from '@zkochan/rimraf' +import { readYamlFileSync } from 'read-yaml-file' +import { safeExeca as execa } from 'execa' +import { rimrafSync } from '@zkochan/rimraf' import { temporaryDirectory } from 'tempy' import symlink from 'symlink-dir' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm, execPnpmSync } from '../utils/index.js' import { addDistTag } from '@pnpm/registry-mock' import { createTestIpcServer } from '@pnpm/test-ipc-server' @@ -33,7 +33,7 @@ test('no projects matched the filters', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) { const { stdout } = execPnpmSync(['list', '--filter=not-exists']) @@ -98,7 +98,7 @@ invalidWorkspaceManifests.forEach((filename) => { }, ]) - writeYamlFile(filename, { packages: ['**', '!store/**'] }) + writeYamlFileSync(filename, { packages: ['**', '!store/**'] }) const { status, stderr } = execPnpmSync(['install']) expect(stderr.toString()).toMatch(/The workspace manifest file should be named "pnpm-workspace.yaml"/) @@ -126,7 +126,7 @@ test('linking a package inside a monorepo with --link-workspace-packages when in }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], linkWorkspacePackages: true, }) @@ -170,7 +170,7 @@ test('linking a package inside a monorepo with --link-workspace-packages when in }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], linkWorkspacePackages: true, saveWorkspaceProtocol: 'rolling', @@ -234,7 +234,7 @@ test('linking a package inside a monorepo with --link-workspace-packages', async }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], linkWorkspacePackages: true, sharedWorkspaceLockfile: false, @@ -314,7 +314,7 @@ test('topological order of packages with self-dependencies in monorepo is correc }, }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], linkWorkspacePackages: true, }) @@ -382,7 +382,7 @@ test('testPattern is respected by the test script', async () => { fs.writeFileSync('project-2/file.js', '') fs.writeFileSync('project-4/different-pattern.js', '') - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], testPattern: ['*/file.js'], }) @@ -452,7 +452,7 @@ test('changedFilesIgnorePattern is respected', async () => { }) fs.writeFileSync('project-5-ignored-by-pattern/cache/a/b/index.js', '') - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execa('git', ['add', '.']) await execa('git', [ @@ -463,7 +463,7 @@ test('changedFilesIgnorePattern is respected', async () => { '--no-gpg-sign', ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { changedFilesIgnorePattern, packages: ['**', '!store/**'], }) @@ -549,7 +549,7 @@ test('do not get confused by filtered dependencies when searching for dependents }, }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], linkWorkspacePackages: true, }) @@ -625,7 +625,7 @@ test('shared-workspace-lockfile: installation with --link-workspace-packages lin }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], sharedWorkspaceLockfile: true, linkWorkspacePackages: true, @@ -634,7 +634,7 @@ test('shared-workspace-lockfile: installation with --link-workspace-packages lin await execPnpm(['install']) { - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile.importers!.project!.dependencies!['is-positive'].version).toBe('2.0.0') expect(lockfile.importers!.project!.dependencies!.negative.version).toBe('is-negative@1.0.0') } @@ -652,7 +652,7 @@ test('shared-workspace-lockfile: installation with --link-workspace-packages lin await execPnpm(['install']) { - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile.importers!.project!.dependencies!['is-positive'].version).toBe('link:../is-positive') expect(lockfile.importers!.project!.dependencies!.negative.version).toBe('link:../is-negative') } @@ -692,7 +692,7 @@ test('recursive install with link-workspace-packages and shared-workspace-lockfi }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], packageConfigs: { 'is-positive': { saveExact: true }, @@ -705,7 +705,7 @@ test('recursive install with link-workspace-packages and shared-workspace-lockfi expect(projects['is-positive'].requireModule('is-negative')).toBeTruthy() expect(projects['project-1'].requireModule('is-positive/package.json').author).toBeFalsy() - const sharedLockfile = readYamlFile(WANTED_LOCKFILE) + const sharedLockfile = readYamlFileSync(WANTED_LOCKFILE) expect(sharedLockfile.importers!['project-1']!.devDependencies!['is-positive'].version).toBe('link:../is-positive') expect(server.getLines()).toStrictEqual(['is-positive', 'project-1']) @@ -774,7 +774,7 @@ test('recursive install with shared-workspace-lockfile builds workspace projects }, ], { manifestFormat: 'YAML' }) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'install', '--link-workspace-packages', '--shared-workspace-lockfile=true', '--store-dir', 'store']) @@ -796,7 +796,7 @@ test('recursive install with shared-workspace-lockfile builds workspace projects 'project-2-prepare', ]) - rimraf('node_modules') + rimrafSync('node_modules') server1.clear() server2.clear() @@ -851,11 +851,11 @@ test('recursive installation with shared-workspace-lockfile and a readPackage ho } ` fs.writeFileSync('.pnpmfile.cjs', pnpmfile, 'utf8') - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'install', '--shared-workspace-lockfile', '--store-dir', 'store']) - const lockfile = readYamlFile(`./${WANTED_LOCKFILE}`) + const lockfile = readYamlFileSync(`./${WANTED_LOCKFILE}`) expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/dep-of-pkg-with-1-dep@100.1.0']) await execPnpm(['recursive', 'install', '--shared-workspace-lockfile', '--store-dir', 'store', '--filter', 'project-1']) @@ -879,7 +879,7 @@ test('local packages should be preferred when running "pnpm install" inside a wo }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], linkWorkspacePackages: true, sharedWorkspaceLockfile: false, @@ -902,14 +902,14 @@ test('shared-workspace-lockfile: create shared lockfile format when installation }, }) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', 'project', '!store/**'], sharedWorkspaceLockfile: true, }) await execPnpm(['install', '--store-dir', 'store']) - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile.importers).toHaveProperty(['.']) expect(lockfile.lockfileVersion).toBe(LOCKFILE_VERSION) @@ -945,14 +945,14 @@ test("shared-workspace-lockfile: don't install dependencies in projects that are await symlink('workspace-2/package-2', 'workspace-1/package-2') - writeYamlFile('workspace-1/pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) - writeYamlFile('workspace-2/pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('workspace-1/pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('workspace-2/pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) process.chdir('workspace-1') await execPnpm(['recursive', 'install', '--store-dir', 'store', '--shared-workspace-lockfile', '--link-workspace-packages']) - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile).toStrictEqual({ settings: { @@ -1029,13 +1029,13 @@ test('shared-workspace-lockfile: install dependencies in projects that are relat }, ]) - writeYamlFile('monorepo/workspace/pnpm-workspace.yaml', { packages: ['../**', '!store/**'] }) + writeYamlFileSync('monorepo/workspace/pnpm-workspace.yaml', { packages: ['../**', '!store/**'] }) process.chdir('monorepo/workspace') await execPnpm(['-r', 'install', '--store-dir', 'store', '--shared-workspace-lockfile', '--link-workspace-packages', '--no-save-workspace-protocol']) - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(lockfile).toStrictEqual({ settings: { @@ -1122,21 +1122,21 @@ test('shared-workspace-lockfile: entries of removed projects should be removed f }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'install', '--store-dir', 'store', '--shared-workspace-lockfile', '--link-workspace-packages']) { - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.importers!)).toStrictEqual(['package-1', 'package-2']) } - rimraf('package-2') + rimrafSync('package-2') await execPnpm(['recursive', 'install', '--store-dir', 'store', '--shared-workspace-lockfile', '--link-workspace-packages']) { - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.importers!)).toStrictEqual(['package-1']) } }) @@ -1181,7 +1181,7 @@ test('shared-workspace-lockfile: removing a package recursively', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], sharedWorkspaceLockfile: true, linkWorkspacePackages: true, @@ -1203,7 +1203,7 @@ test('shared-workspace-lockfile: removing a package recursively', async () => { expect(pkg.dependencies).toStrictEqual({ 'is-negative': '1.0.0' }) // is-positive removed from project2') } - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile.packages ?? {})).toStrictEqual(['is-negative@1.0.0']) // is-positive removed from ${WANTED_LOCKFILE} }) @@ -1225,7 +1225,7 @@ test('peer dependency is grouped with dependent when the peer is a top dependenc }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], sharedWorkspaceLockfile: true, linkWorkspacePackages: true, @@ -1237,7 +1237,7 @@ test('peer dependency is grouped with dependent when the peer is a top dependenc await execPnpm(['install', 'ajv@4.10.4', 'ajv-keywords@1.5.0']) { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers!.foo).toStrictEqual({ dependencies: { ajv: { @@ -1259,7 +1259,7 @@ test('peer dependency is grouped with dependent when the peer is a top dependenc await execPnpm(['uninstall', 'ajv', '--no-strict-peer-dependencies']) { - const lockfile = readYamlFile(path.resolve('..', WANTED_LOCKFILE)) + const lockfile = readYamlFileSync(path.resolve('..', WANTED_LOCKFILE)) expect(lockfile.importers!.foo).toStrictEqual({ dependencies: { 'ajv-keywords': { @@ -1291,7 +1291,7 @@ test('dependencies of workspace projects are built during headless installation' }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], sharedWorkspaceLockfile: false, allowBuilds: { @@ -1331,15 +1331,15 @@ test("linking the package's bin to another workspace package in a monorepo", asy fs.writeFileSync('./hello/index.js', '#!/usr/bin/env node', 'utf8') - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['install']) projects.main.isExecutable('.bin/hello') expect(fs.existsSync('main/node_modules')).toBeTruthy() - rimraf('main/node_modules') - rimraf('node_modules') + rimrafSync('main/node_modules') + rimrafSync('node_modules') await execPnpm(['install', '--frozen-lockfile']) @@ -1370,7 +1370,7 @@ test('pnpm sees the bins from the root of the workspace', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['install']) @@ -1414,7 +1414,7 @@ test('root package is included when not specified', async () => { ) ) const workspacePackagePatterns = ['project-', '!store/**'] - writeYamlFile('pnpm-workspace.yaml', { packages: workspacePackagePatterns }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: workspacePackagePatterns }) const workspacePackages = await findWorkspacePackages(tempDir, { engineStrict: false, patterns: workspacePackagePatterns }) expect(workspacePackages.some(project => { @@ -1452,7 +1452,7 @@ test("root package can't be ignored using '!.' (or any other such glob)", async ) ) const workspacePackagePatterns = ['project-', '!.', '!./', '!store/**'] - writeYamlFile('pnpm-workspace.yaml', { packages: workspacePackagePatterns }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: workspacePackagePatterns }) const workspacePackages = await findWorkspacePackages(tempDir, { engineStrict: false, patterns: workspacePackagePatterns }) expect(workspacePackages.some(project => { @@ -1473,7 +1473,7 @@ test('custom virtual store directory in a workspace with not shared lockfile', a }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], virtualStoreDir: 'virtual-store', sharedWorkspaceLockfile: false, @@ -1491,9 +1491,9 @@ test('custom virtual store directory in a workspace with not shared lockfile', a } } - rimraf('project-1/virtual-store') - rimraf('project-1/node_modules') - rimraf('node_modules') + rimrafSync('project-1/virtual-store') + rimrafSync('project-1/node_modules') + rimrafSync('node_modules') await execPnpm(['install', '--frozen-lockfile']) @@ -1520,7 +1520,7 @@ test('custom virtual store directory in a workspace with shared lockfile', async }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], virtualStoreDir: 'virtual-store', sharedWorkspaceLockfile: true, @@ -1533,8 +1533,8 @@ test('custom virtual store directory in a workspace with shared lockfile', async expect(modulesManifest?.virtualStoreDir).toBe(path.resolve('virtual-store')) } - rimraf('virtual-store') - rimraf('node_modules') + rimrafSync('virtual-store') + rimrafSync('node_modules') await execPnpm(['install', '--frozen-lockfile']) @@ -1563,7 +1563,7 @@ test('pnpm run should ignore the root project', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['-r', '--config.use-beta-cli=true', 'test']) @@ -1589,7 +1589,7 @@ test('pnpm run should include the workspace root when --workspace-root option is }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['--filter=project', '--workspace-root', 'test']) @@ -1616,7 +1616,7 @@ test('pnpm run should include the workspace root when include-workspace-root is }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], includeWorkspaceRoot: true, }) @@ -1645,7 +1645,7 @@ test('legacy directory filtering', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], legacyDirFiltering: true, }) @@ -1674,7 +1674,7 @@ test('directory filtering', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) { const { stdout } = execPnpmSync(['list', '--filter=./packages', '--parseable', '--depth=-1']) @@ -1720,7 +1720,7 @@ test('run --stream should prefix with dir name', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) const result = execPnpmSync([ '--stream', @@ -1802,7 +1802,7 @@ test('run --reporter-hide-prefix should hide prefix', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) const result = execPnpmSync([ '--stream', @@ -1874,7 +1874,7 @@ test('peer dependencies are resolved from the root of the workspace when a new d }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) process.chdir('project-2') @@ -1902,7 +1902,7 @@ test('overrides in workspace project should be taken into account when shared-wo }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], sharedWorkspaceLockfile: false, }) @@ -1939,7 +1939,7 @@ test('deploy should keep files created by lifecycle scripts', async () => { preparedManifests['project-0'], ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], injectWorkspacePackages: true, allowBuilds: { @@ -1990,7 +1990,7 @@ test('rebuild in a directory created with "pnpm deploy" and with "pnpm.neverBuil preparedManifests['project-0'], ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], injectWorkspacePackages: true, allowBuilds: { diff --git a/pnpm/test/monorepo/peerDependencies.ts b/pnpm/test/monorepo/peerDependencies.ts index 1533291028..91575b4568 100644 --- a/pnpm/test/monorepo/peerDependencies.ts +++ b/pnpm/test/monorepo/peerDependencies.ts @@ -1,8 +1,8 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import type { LockfileFile } from '@pnpm/lockfile.types' import { preparePackages } from '@pnpm/prepare' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from '../utils/index.js' // Covers https://github.com/pnpm/pnpm/issues/6272 @@ -24,13 +24,13 @@ test('peer dependency is not unlinked when adding a new dependency', async () => }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], autoInstallPeers: false, }) await execPnpm(['install']) await execPnpm(['--filter=project-1', 'add', 'is-odd@1.0.0']) - const lockfile = readYamlFile(WANTED_LOCKFILE) + const lockfile = readYamlFileSync(WANTED_LOCKFILE) expect(Object.keys(lockfile!.snapshots!)).toContain('@pnpm.e2e/abc@1.0.0(@pnpm.e2e/peer-a@@pnpm.e2e+peer-a)') }) diff --git a/pnpm/test/patch/allowUnusedPatches.ts b/pnpm/test/patch/allowUnusedPatches.ts index 8ec8c90282..acd30a0cfa 100644 --- a/pnpm/test/patch/allowUnusedPatches.ts +++ b/pnpm/test/patch/allowUnusedPatches.ts @@ -1,6 +1,6 @@ import { preparePackages } from '@pnpm/prepare' import { fixtures } from '@pnpm/test-fixtures' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpmSync } from '../utils/index.js' const f = fixtures(import.meta.dirname) @@ -21,7 +21,7 @@ test('allowUnusedPatches=false errors on unused patches', async () => { const patchFile = f.find('patch-pkg/is-positive@1.0.0.patch') - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { allowUnusedPatches: false, packages: ['**', '!store/**'], patchedDependencies: { @@ -52,7 +52,7 @@ test('allowUnusedPatches=true warns about unused patches', async () => { const patchFile = f.find('patch-pkg/is-positive@1.0.0.patch') - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { allowUnusedPatches: true, packages: ['**', '!store/**'], patchedDependencies: { diff --git a/pnpm/test/recursive/misc.ts b/pnpm/test/recursive/misc.ts index 608ef91647..5b7884f491 100644 --- a/pnpm/test/recursive/misc.ts +++ b/pnpm/test/recursive/misc.ts @@ -4,10 +4,10 @@ import type { Config } from '@pnpm/config' import { preparePackages } from '@pnpm/prepare' import type { WorkspaceManifest } from '@pnpm/workspace.read-manifest' import type { LockfileFile } from '@pnpm/lockfile.types' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' import { isCI } from 'ci-info' import isWindows from 'is-windows' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm, execPnpmSync, @@ -33,7 +33,7 @@ test('recursive installation with packageConfigs', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['*'], packageConfigs: { 'project-2': { hoist: false }, @@ -46,10 +46,10 @@ test('recursive installation with packageConfigs', async () => { expect(projects['project-1'].requireModule('is-positive')).toBeTruthy() expect(projects['project-2'].requireModule('is-negative')).toBeTruthy() - const modulesYaml1 = readYamlFile<{ hoistPattern: string }>(path.resolve('project-1', 'node_modules', '.modules.yaml')) + const modulesYaml1 = readYamlFileSync<{ hoistPattern: string }>(path.resolve('project-1', 'node_modules', '.modules.yaml')) expect(modulesYaml1?.hoistPattern).toStrictEqual(['*']) - const modulesYaml2 = readYamlFile<{ hoistPattern: string }>(path.resolve('project-2', 'node_modules', '.modules.yaml')) + const modulesYaml2 = readYamlFileSync<{ hoistPattern: string }>(path.resolve('project-2', 'node_modules', '.modules.yaml')) expect(modulesYaml2?.hoistPattern).toBeFalsy() }) @@ -80,7 +80,7 @@ test('workspace packageConfigs is always read', async () => { ]) const storeDir = path.resolve('../store') - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['workspace/*'], packageConfigs: { 'project-2': { hoist: false }, @@ -94,7 +94,7 @@ test('workspace packageConfigs is always read', async () => { expect(projects['project-1'].requireModule('is-positive')).toBeTruthy() - const modulesYaml1 = readYamlFile<{ hoistPattern: string }>(path.resolve('node_modules', '.modules.yaml')) + const modulesYaml1 = readYamlFileSync<{ hoistPattern: string }>(path.resolve('node_modules', '.modules.yaml')) expect(modulesYaml1?.hoistPattern).toStrictEqual(['*']) process.chdir('..') @@ -104,7 +104,7 @@ test('workspace packageConfigs is always read', async () => { expect(projects['project-2'].requireModule('is-negative')).toBeTruthy() - const modulesYaml2 = readYamlFile<{ hoistPattern: string }>(path.resolve('node_modules', '.modules.yaml')) + const modulesYaml2 = readYamlFileSync<{ hoistPattern: string }>(path.resolve('node_modules', '.modules.yaml')) expect(modulesYaml2?.hoistPattern).toBeFalsy() }) @@ -196,11 +196,11 @@ test('recursive installation of packages in workspace ignores hooks in packages' } `) - writeYamlFile('pnpm-workspace.yaml', { packages: ['project-1', 'project-2'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['project-1', 'project-2'] }) await execPnpm(['install']) - const lockfile = readYamlFile('pnpm-lock.yaml') + const lockfile = readYamlFileSync('pnpm-lock.yaml') const depPaths = Object.keys(lockfile.snapshots ?? {}) expect(depPaths).not.toContain('@pnpm.e2e/dep-of-pkg-with-1-dep@100.1.0') expect(depPaths).toContain('is-number@1.0.0') @@ -283,7 +283,7 @@ test('recursive command with filter from config', async () => { ]) fs.writeFileSync('package.json', '{}', 'utf8') - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { filter: ['project-1', 'project-2'], }) await execPnpm(['recursive', 'install']) @@ -442,7 +442,7 @@ test('set recursive-install to false in .npmrc would disable recursive install i ]) process.chdir('workspace') - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**'], recursiveInstall: false, dedupePeerDependents: false, @@ -482,7 +482,7 @@ test('set recursive-install to false would install as --filter {.}...', async () ]) process.chdir('workspace') - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**'], recursiveInstall: false, }) diff --git a/pnpm/test/recursive/run.ts b/pnpm/test/recursive/run.ts index 4e9c154cae..eb418604cf 100644 --- a/pnpm/test/recursive/run.ts +++ b/pnpm/test/recursive/run.ts @@ -1,6 +1,6 @@ import { preparePackages } from '@pnpm/prepare' import { createTestIpcServer } from '@pnpm/test-ipc-server' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from '../utils/index.js' test('pnpm recursive run finds bins from the root of the workspace', async () => { @@ -32,7 +32,7 @@ test('pnpm recursive run finds bins from the root of the workspace', async () => }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['-r', 'install']) diff --git a/pnpm/test/recursive/update.ts b/pnpm/test/recursive/update.ts index b6f7a3ea08..e777a95bac 100644 --- a/pnpm/test/recursive/update.ts +++ b/pnpm/test/recursive/update.ts @@ -1,5 +1,5 @@ import path from 'path' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import type { Config } from '@pnpm/config' import { preparePackages } from '@pnpm/prepare' import type { WorkspaceManifest } from '@pnpm/workspace.read-manifest' @@ -37,7 +37,7 @@ test.skip('recursive update --latest should update deps with correct specs', asy }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['*'], packageConfigs: { 'project-2': { saveExact: true }, diff --git a/pnpm/test/run.ts b/pnpm/test/run.ts index f6e10a87c1..8a7d143d4b 100644 --- a/pnpm/test/run.ts +++ b/pnpm/test/run.ts @@ -2,7 +2,7 @@ import fs from 'fs' import path from 'path' import { prepare, preparePackages } from '@pnpm/prepare' import isWindows from 'is-windows' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm, execPnpmSync } from './utils/index.js' const RECORD_ARGS_FILE = 'require(\'fs\').writeFileSync(\'args.json\', JSON.stringify(require(\'./args.json\').concat([process.argv.slice(2)])), \'utf8\')' @@ -144,7 +144,7 @@ testOnPosix('pnpm run with preferSymlinkedExecutables true', async () => { }, }) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { preferSymlinkedExecutables: true, }) @@ -160,7 +160,7 @@ testOnPosix('pnpm run with preferSymlinkedExecutables and custom virtualStoreDir }, }) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { virtualStoreDir: '/foo/bar', preferSymlinkedExecutables: true, }) diff --git a/pnpm/test/saveCatalog.ts b/pnpm/test/saveCatalog.ts index 8748d8a795..4e62c1962f 100644 --- a/pnpm/test/saveCatalog.ts +++ b/pnpm/test/saveCatalog.ts @@ -3,8 +3,8 @@ import { prepare, preparePackages } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' import type { ProjectManifest } from '@pnpm/types' import { loadJsonFileSync } from 'load-json-file' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from './utils/index.js' test('--save-catalog adds catalogs to the manifest of a single package workspace', async () => { @@ -19,7 +19,7 @@ test('--save-catalog adds catalogs to the manifest of a single package workspace prepare(manifest) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { catalog: { '@pnpm.e2e/bar': '^100.1.0', }, @@ -29,7 +29,7 @@ test('--save-catalog adds catalogs to the manifest of a single package workspace await addDistTag({ package: '@pnpm.e2e/bar', version: '100.1.0', distTag: 'latest' }) await execPnpm(['install']) - expect(readYamlFile('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/bar': { @@ -54,7 +54,7 @@ test('--save-catalog adds catalogs to the manifest of a single package workspace } as Partial)) await execPnpm(['add', '--save-catalog', '@pnpm.e2e/foo']) - expect(readYamlFile('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/bar': { @@ -86,7 +86,7 @@ test('--save-catalog adds catalogs to the manifest of a single package workspace '@pnpm.e2e/foo@100.1.0': expect.anything(), }, } as Partial)) - expect(readYamlFile('pnpm-workspace.yaml')).toStrictEqual({ + expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({ catalog: { '@pnpm.e2e/bar': '^100.1.0', '@pnpm.e2e/foo': '^100.1.0', @@ -118,7 +118,7 @@ test('--save-catalog adds catalogs to the manifest of a shared lockfile workspac preparePackages(manifests) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { sharedWorkspaceLockfile: true, catalog: { '@pnpm.e2e/bar': '^100.1.0', @@ -130,7 +130,7 @@ test('--save-catalog adds catalogs to the manifest of a shared lockfile workspac await addDistTag({ package: '@pnpm.e2e/bar', version: '100.1.0', distTag: 'latest' }) await execPnpm(['install']) - expect(readYamlFile('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/bar': { @@ -156,7 +156,7 @@ test('--save-catalog adds catalogs to the manifest of a shared lockfile workspac } as Partial)) await execPnpm(['--filter=project-1', 'add', '--save-catalog', '@pnpm.e2e/foo']) - expect(readYamlFile('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/bar': { @@ -192,7 +192,7 @@ test('--save-catalog adds catalogs to the manifest of a shared lockfile workspac '@pnpm.e2e/foo@100.1.0': expect.anything(), }, } as Partial)) - expect(readYamlFile('pnpm-workspace.yaml')).toStrictEqual({ + expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({ catalog: { '@pnpm.e2e/bar': '^100.1.0', '@pnpm.e2e/foo': '^100.1.0', @@ -225,7 +225,7 @@ test('--save-catalog adds catalogs to the manifest of a multi-lockfile workspace preparePackages(manifests) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { sharedWorkspaceLockfile: false, catalog: { '@pnpm.e2e/bar': '^100.1.0', @@ -239,7 +239,7 @@ test('--save-catalog adds catalogs to the manifest of a multi-lockfile workspace { await execPnpm(['install']) - const lockfile0: LockfileFile = readYamlFile('project-0/pnpm-lock.yaml') + const lockfile0: LockfileFile = readYamlFileSync('project-0/pnpm-lock.yaml') expect(lockfile0.catalogs).toStrictEqual({ default: { '@pnpm.e2e/bar': { @@ -259,7 +259,7 @@ test('--save-catalog adds catalogs to the manifest of a multi-lockfile workspace }, } as LockfileFile['importers']) - const lockfile1: LockfileFile = readYamlFile('project-1/pnpm-lock.yaml') + const lockfile1: LockfileFile = readYamlFileSync('project-1/pnpm-lock.yaml') expect(lockfile1.catalogs).toBeUndefined() expect(lockfile1.importers).toStrictEqual({ '.': {}, @@ -269,7 +269,7 @@ test('--save-catalog adds catalogs to the manifest of a multi-lockfile workspace { await execPnpm(['--filter=project-1', 'add', '--save-catalog', '@pnpm.e2e/foo']) - const lockfile0: LockfileFile = readYamlFile('project-0/pnpm-lock.yaml') + const lockfile0: LockfileFile = readYamlFileSync('project-0/pnpm-lock.yaml') expect(lockfile0.catalogs).toStrictEqual({ default: { '@pnpm.e2e/bar': { @@ -289,7 +289,7 @@ test('--save-catalog adds catalogs to the manifest of a multi-lockfile workspace }, } as LockfileFile['importers']) - const lockfile1: LockfileFile = readYamlFile('project-1/pnpm-lock.yaml') + const lockfile1: LockfileFile = readYamlFileSync('project-1/pnpm-lock.yaml') expect(lockfile1.catalogs).toStrictEqual({ default: { '@pnpm.e2e/foo': { @@ -309,7 +309,7 @@ test('--save-catalog adds catalogs to the manifest of a multi-lockfile workspace }, } as LockfileFile['importers']) - expect(readYamlFile('pnpm-workspace.yaml')).toStrictEqual({ + expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({ catalog: { '@pnpm.e2e/bar': '^100.1.0', '@pnpm.e2e/foo': '^100.1.0', @@ -342,14 +342,14 @@ test('--save-catalog does not add local workspace dependency as a catalog', asyn preparePackages(manifests) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['project-0', 'project-1'], }) { await execPnpm(['install']) - const lockfile: LockfileFile = readYamlFile('pnpm-lock.yaml') + const lockfile: LockfileFile = readYamlFileSync('pnpm-lock.yaml') expect(lockfile.catalogs).toBeUndefined() expect(lockfile.importers).toStrictEqual({ 'project-0': {}, @@ -360,7 +360,7 @@ test('--save-catalog does not add local workspace dependency as a catalog', asyn { await execPnpm(['--filter=project-1', 'add', '--save-catalog', 'project-0@workspace:*']) - const lockfile: LockfileFile = readYamlFile('pnpm-lock.yaml') + const lockfile: LockfileFile = readYamlFileSync('pnpm-lock.yaml') expect(lockfile.catalogs).toBeUndefined() expect(lockfile.importers).toStrictEqual({ 'project-0': {}, @@ -374,7 +374,7 @@ test('--save-catalog does not add local workspace dependency as a catalog', asyn }, }) - expect(readYamlFile('pnpm-workspace.yaml')).toStrictEqual({ + expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({ packages: ['project-0', 'project-1'], }) @@ -399,7 +399,7 @@ test('--save-catalog does not affect new dependencies from package.json', async const project = prepare(manifest) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { catalog: { '@pnpm.e2e/pkg-a': '1.0.0', }, @@ -500,7 +500,7 @@ test('--save-catalog does not overwrite existing catalogs', async () => { preparePackages(manifests) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { catalog: { '@pnpm.e2e/bar': '=100.0.0', // intentionally outdated }, @@ -511,7 +511,7 @@ test('--save-catalog does not overwrite existing catalogs', async () => { await addDistTag({ package: '@pnpm.e2e/bar', version: '100.1.0', distTag: 'latest' }) await execPnpm(['install']) - expect(readYamlFile('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/bar': { @@ -534,7 +534,7 @@ test('--save-catalog does not overwrite existing catalogs', async () => { } as Partial)) await execPnpm(['add', '--filter=project-1', '--save-catalog', '@pnpm.e2e/foo@100.1.0', '@pnpm.e2e/bar@100.1.0']) - expect(readYamlFile('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/bar': { @@ -570,7 +570,7 @@ test('--save-catalog does not overwrite existing catalogs', async () => { }, }, } as Partial)) - expect(readYamlFile('pnpm-workspace.yaml')).toStrictEqual({ + expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({ catalog: { '@pnpm.e2e/bar': '=100.0.0', // unchanged '@pnpm.e2e/foo': '100.1.0', // created by `pnpm add --save-catalog` @@ -604,7 +604,7 @@ test('--save-catalog creates new workspace manifest with the new catalog (recurs await execPnpm(['add', '--recursive', '--save-catalog', '@pnpm.e2e/foo@100.1.0']) - expect(readYamlFile('project-0/pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('project-0/pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/foo': { @@ -624,7 +624,7 @@ test('--save-catalog creates new workspace manifest with the new catalog (recurs }, }, } as Partial)) - expect(readYamlFile('project-1/pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('project-1/pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/foo': { @@ -645,7 +645,7 @@ test('--save-catalog creates new workspace manifest with the new catalog (recurs }, } as Partial)) - expect(readYamlFile('pnpm-workspace.yaml')).toStrictEqual({ + expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({ catalog: { '@pnpm.e2e/foo': '100.1.0', }, @@ -679,7 +679,7 @@ test('--save-catalog-name', async () => { prepare(manifest) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { catalog: { '@pnpm.e2e/bar': '^100.1.0', }, @@ -689,7 +689,7 @@ test('--save-catalog-name', async () => { await addDistTag({ package: '@pnpm.e2e/bar', version: '100.1.0', distTag: 'latest' }) await execPnpm(['install']) - expect(readYamlFile('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/bar': { @@ -714,7 +714,7 @@ test('--save-catalog-name', async () => { } as Partial)) await execPnpm(['add', '--save-catalog-name=my-catalog', '@pnpm.e2e/foo']) - expect(readYamlFile('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ + expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({ catalogs: { default: { '@pnpm.e2e/bar': { @@ -748,7 +748,7 @@ test('--save-catalog-name', async () => { '@pnpm.e2e/foo@100.1.0': expect.anything(), }, } as Partial)) - expect(readYamlFile('pnpm-workspace.yaml')).toStrictEqual({ + expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({ catalog: { '@pnpm.e2e/bar': '^100.1.0', }, diff --git a/pnpm/test/switchingVersions.test.ts b/pnpm/test/switchingVersions.test.ts index 32764189a2..50602a687e 100644 --- a/pnpm/test/switchingVersions.test.ts +++ b/pnpm/test/switchingVersions.test.ts @@ -2,7 +2,7 @@ import path from 'path' import fs from 'fs' import { prepare } from '@pnpm/prepare' import { writeJsonFileSync } from 'write-json-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpmSync } from './utils/index.js' import isWindows from 'is-windows' @@ -23,7 +23,7 @@ test('do not switch to the pnpm version specified in the packageManager field of prepare() const pnpmHome = path.resolve('pnpm') const env = { PNPM_HOME: pnpmHome } - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { managePackageManagerVersions: false, }) writeJsonFileSync('package.json', { diff --git a/pnpm/test/syncInjectedDepsAfterScripts-bin.ts b/pnpm/test/syncInjectedDepsAfterScripts-bin.ts index d5c2f8ad2a..458523ed65 100644 --- a/pnpm/test/syncInjectedDepsAfterScripts-bin.ts +++ b/pnpm/test/syncInjectedDepsAfterScripts-bin.ts @@ -1,6 +1,6 @@ import fs from 'fs' import { preparePackages } from '@pnpm/prepare' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from './utils/index.js' test('sync bin links after build script', async () => { @@ -32,7 +32,7 @@ test('sync bin links after build script', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['*'], reporter: 'append-only', injectWorkspacePackages: true, diff --git a/pnpm/test/syncInjectedDepsAfterScripts.ts b/pnpm/test/syncInjectedDepsAfterScripts.ts index 24a2c2c249..44ea00a7b5 100644 --- a/pnpm/test/syncInjectedDepsAfterScripts.ts +++ b/pnpm/test/syncInjectedDepsAfterScripts.ts @@ -2,7 +2,7 @@ import fs from 'fs' import path from 'path' import { preparePackages } from '@pnpm/prepare' import { fixtures } from '@pnpm/test-fixtures' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm } from './utils/index.js' const f = fixtures(import.meta.dirname) @@ -49,7 +49,7 @@ function prepareInjectedDepsWorkspace (syncInjectedDepsAfterScripts: string[]) { f.copy('injected-dep-files', pkgName) } - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['*'], reporter: 'append-only', injectWorkspacePackages: true, diff --git a/pnpm/test/update.ts b/pnpm/test/update.ts index 4dd295a858..94200b84f1 100644 --- a/pnpm/test/update.ts +++ b/pnpm/test/update.ts @@ -1,8 +1,8 @@ import path from 'path' import { prepare, preparePackages } from '@pnpm/prepare' import { readPackageJsonFromDir } from '@pnpm/read-package-json' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { addDistTag, execPnpm, @@ -79,10 +79,10 @@ test('recursive update --no-save', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'update', '--no-save']) - const lockfile = readYamlFile('pnpm-lock.yaml') // eslint-disable-line + const lockfile = readYamlFileSync('pnpm-lock.yaml') // eslint-disable-line expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/foo@100.1.0']) const pkg = await readPackageJsonFromDir(path.resolve('project')) @@ -102,10 +102,10 @@ test('recursive update', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'update']) - const lockfile = readYamlFile('pnpm-lock.yaml') // eslint-disable-line + const lockfile = readYamlFileSync('pnpm-lock.yaml') // eslint-disable-line expect(lockfile.packages).toHaveProperty(['@pnpm.e2e/foo@100.1.0']) const pkg = await readPackageJsonFromDir(path.resolve('project')) @@ -127,7 +127,7 @@ test('recursive update --no-shared-workspace-lockfile', async function () { }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'update', '--no-shared-workspace-lockfile']) const lockfile = projects['project'].readLockfile() @@ -448,7 +448,7 @@ test('recursive update --latest on projects with a shared a lockfile', async () }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'install']) await execPnpm(['recursive', 'update', '--latest']) @@ -465,7 +465,7 @@ test('recursive update --latest on projects with a shared a lockfile', async () '@pnpm.e2e/foo': '100.1.0', }) - const lockfile = readYamlFile('pnpm-lock.yaml') // eslint-disable-line + const lockfile = readYamlFileSync('pnpm-lock.yaml') // eslint-disable-line expect(lockfile.importers['project-1'].dependencies['@pnpm.e2e/dep-of-pkg-with-1-dep'].version).toBe('101.0.0') expect(lockfile.importers['project-1'].dependencies['@pnpm.e2e/foo'].version).toBe('100.1.0') expect(lockfile.importers['project-2'].dependencies['@pnpm.e2e/bar'].version).toBe('100.1.0') @@ -504,7 +504,7 @@ test('recursive update --latest --prod on projects with a shared a lockfile', as }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'install']) await execPnpm(['recursive', 'update', '--latest', '--prod']) @@ -525,7 +525,7 @@ test('recursive update --latest --prod on projects with a shared a lockfile', as '@pnpm.e2e/bar': '100.0.0', }) - const lockfile = readYamlFile('pnpm-lock.yaml') // eslint-disable-line + const lockfile = readYamlFileSync('pnpm-lock.yaml') // eslint-disable-line expect(lockfile.importers['project-1'].dependencies['@pnpm.e2e/dep-of-pkg-with-1-dep'].version).toBe('101.0.0') expect(lockfile.importers['project-1'].devDependencies['@pnpm.e2e/foo'].version).toBe('100.0.0') expect(lockfile.importers['project-2'].devDependencies['@pnpm.e2e/bar'].version).toBe('100.0.0') @@ -567,7 +567,7 @@ test('recursive update --latest specific dependency on projects with a shared a }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['recursive', 'install']) await execPnpm(['recursive', 'update', '--latest', '@pnpm.e2e/foo', 'alias']) @@ -585,7 +585,7 @@ test('recursive update --latest specific dependency on projects with a shared a '@pnpm.e2e/foo': '100.1.0', }) - const lockfile = readYamlFile('pnpm-lock.yaml') // eslint-disable-line + const lockfile = readYamlFileSync('pnpm-lock.yaml') // eslint-disable-line expect(lockfile.importers['project-1'].dependencies['@pnpm.e2e/dep-of-pkg-with-1-dep'].version).toBe('100.0.0') expect(lockfile.importers['project-1'].dependencies['@pnpm.e2e/foo'].version).toBe('100.1.0') expect(lockfile.importers['project-1'].dependencies['alias'].version).toBe('@pnpm.e2e/qar@100.1.0') @@ -622,7 +622,7 @@ test('update to latest without downgrading already defined prerelease (#7436)', }, }) - const lockfile1 = readYamlFile('pnpm-lock.yaml') + const lockfile1 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile1).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) expect(lockfile1).not.toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) @@ -635,7 +635,7 @@ test('update to latest without downgrading already defined prerelease (#7436)', }, }) - const lockfile2 = readYamlFile('pnpm-lock.yaml') + const lockfile2 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile2).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) expect(lockfile2).not.toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) @@ -648,7 +648,7 @@ test('update to latest without downgrading already defined prerelease (#7436)', }, }) - const lockfile3 = readYamlFile('pnpm-lock.yaml') + const lockfile3 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile3).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) expect(lockfile3).not.toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) }) @@ -666,7 +666,7 @@ test('update with tag @latest will downgrade prerelease', async function () { }, }) - const lockfile1 = readYamlFile('pnpm-lock.yaml') + const lockfile1 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile1).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) expect(lockfile1).not.toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) @@ -679,7 +679,7 @@ test('update with tag @latest will downgrade prerelease', async function () { }, }) - const lockfile2 = readYamlFile('pnpm-lock.yaml') + const lockfile2 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile2).not.toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) expect(lockfile2).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) }) @@ -752,10 +752,10 @@ test('update to latest recursive workspace (outdated, updated, prerelease, outda }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['install', '-r']) - const lockfile1 = readYamlFile('pnpm-lock.yaml') + const lockfile1 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile1).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@1.0.0']) expect(lockfile1).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) expect(lockfile1).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) @@ -795,7 +795,7 @@ test('update to latest recursive workspace (outdated, updated, prerelease, outda }, }) - const lockfile2 = readYamlFile('pnpm-lock.yaml') + const lockfile2 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile2).not.toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@1.0.0']) expect(lockfile2).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) expect(lockfile2).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) @@ -819,10 +819,10 @@ test('update to latest recursive workspace (prerelease, outdated)', async functi }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm(['install', '-r']) - const lockfile1 = readYamlFile('pnpm-lock.yaml') + const lockfile1 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile1).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@1.0.0']) expect(lockfile1).not.toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) expect(lockfile1).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) @@ -848,7 +848,7 @@ test('update to latest recursive workspace (prerelease, outdated)', async functi }, }) - const lockfile2 = readYamlFile('pnpm-lock.yaml') + const lockfile2 = readYamlFileSync('pnpm-lock.yaml') expect(lockfile2).not.toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@1.0.0']) expect(lockfile2).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@2.0.0']) expect(lockfile2).toHaveProperty(['packages', '@pnpm.e2e/has-prerelease@3.0.0-rc.0']) diff --git a/pnpm/test/utils/execPnpm.ts b/pnpm/test/utils/execPnpm.ts index ed59d3a227..c17c04d548 100644 --- a/pnpm/test/utils/execPnpm.ts +++ b/pnpm/test/utils/execPnpm.ts @@ -4,7 +4,7 @@ import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import type { Config } from '@pnpm/config' import isWindows from 'is-windows' import crossSpawn from 'cross-spawn' -import { sync as readYamlFile } from 'read-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' export const binDir = path.join(import.meta.dirname, '../..', isWindows() ? 'dist' : 'bin') export const pnpmBinLocation = path.join(binDir, 'pnpm.mjs') @@ -150,7 +150,7 @@ export function execPnpxSync ( function createEnv (opts?: { storeDir?: string }): NodeJS.ProcessEnv { let workspaceManifest: Record | undefined try { - workspaceManifest = readYamlFile('pnpm-workspace.yaml') + workspaceManifest = readYamlFileSync('pnpm-workspace.yaml') } catch (error) { if (error && typeof error === 'object' && 'code' in error && error.code === 'ENOENT') { workspaceManifest = undefined diff --git a/pnpm/test/verifyDepsBeforeRun/exec.ts b/pnpm/test/verifyDepsBeforeRun/exec.ts index f138ac9109..54d557ed2e 100644 --- a/pnpm/test/verifyDepsBeforeRun/exec.ts +++ b/pnpm/test/verifyDepsBeforeRun/exec.ts @@ -3,7 +3,7 @@ import path from 'path' import { prepare, preparePackages } from '@pnpm/prepare' import type { ProjectManifest } from '@pnpm/types' import { loadWorkspaceState } from '@pnpm/workspace.state' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm, execPnpmSync } from '../utils/index.js' const CONFIG = ['--config.verify-deps-before-run=error'] as const @@ -129,7 +129,7 @@ test('multi-project workspace', async () => { manifests.bar, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) const EXEC = ['exec', 'node', '--print', '"hello from exec: " + process.cwd()'] as const diff --git a/pnpm/test/verifyDepsBeforeRun/issue-9424.ts b/pnpm/test/verifyDepsBeforeRun/issue-9424.ts index 00866b730f..44af9f99c3 100644 --- a/pnpm/test/verifyDepsBeforeRun/issue-9424.ts +++ b/pnpm/test/verifyDepsBeforeRun/issue-9424.ts @@ -3,7 +3,7 @@ import path from 'path' import { preparePackages } from '@pnpm/prepare' import type { ProjectManifest } from '@pnpm/types' import { type WorkspaceState, loadWorkspaceState } from '@pnpm/workspace.state' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm, execPnpmSync } from '../utils/index.js' test('hoisted node linker and node_modules not exist (#9424)', async () => { @@ -35,7 +35,7 @@ test('hoisted node linker and node_modules not exist (#9424)', async () => { preparePackages([manifests['has-deps'], manifests['has-no-deps']]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) // attempting to execute a script recursively without installing dependencies should fail { diff --git a/pnpm/test/verifyDepsBeforeRun/multiProjectWorkspace.ts b/pnpm/test/verifyDepsBeforeRun/multiProjectWorkspace.ts index 37bb42385d..683d3a6b26 100644 --- a/pnpm/test/verifyDepsBeforeRun/multiProjectWorkspace.ts +++ b/pnpm/test/verifyDepsBeforeRun/multiProjectWorkspace.ts @@ -3,7 +3,7 @@ import path from 'path' import { preparePackages } from '@pnpm/prepare' import type { ProjectManifest } from '@pnpm/types' import { loadWorkspaceState } from '@pnpm/workspace.state' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { execPnpm, execPnpmSync, pnpmBinLocation } from '../utils/index.js' const CONFIG = ['--config.verify-deps-before-run=error'] as const @@ -56,7 +56,7 @@ test('single dependency', async () => { manifests.bar, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) // attempting to execute a script in root without installing dependencies should fail { @@ -342,7 +342,7 @@ test('multiple lockfiles', async () => { manifests.bar, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) const config = [ ...CONFIG, @@ -608,7 +608,7 @@ test('filtered install', async () => { manifests.bar, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) // attempting to execute a script without installing dependencies should fail { @@ -678,7 +678,7 @@ test('no dependencies', async () => { manifests.bar, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) // attempting to execute a script without `pnpm install` should fail { @@ -759,7 +759,7 @@ test('nested `pnpm run` should not check for mutated manifest', async () => { projects[name].writePackageJson(manifests[name]) } - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], // verifyDepsBeforeRun: 'error', }) @@ -859,7 +859,7 @@ test('should check for outdated catalogs', async () => { } as Record, packages: ['**', '!store/**'], } - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) // attempting to execute a script without installing dependencies should fail { @@ -897,7 +897,7 @@ test('should check for outdated catalogs', async () => { } workspaceManifest.catalog.foo = '=100.1.0' - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) // attempting to execute a script without updating dependencies should fail { @@ -958,7 +958,7 @@ test('failed to install dependencies', async () => { manifests.bar, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) await execPnpm([...CONFIG, 'install']) diff --git a/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts b/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts index d4659ac3fe..c245ce5a27 100644 --- a/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts +++ b/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts @@ -1,6 +1,6 @@ import fs from 'fs' import path from 'path' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { prepare } from '@pnpm/prepare' import type { ProjectManifest } from '@pnpm/types' import { loadWorkspaceState } from '@pnpm/workspace.state' @@ -199,7 +199,7 @@ test('nested `pnpm run` should not check for mutated manifest', async () => { fs.writeFileSync(require.resolve('./package.json'), jsonText) console.log('manifest mutated') `) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { verifyDepsBeforeRun: 'error', }) diff --git a/releasing/plugin-commands-deploy/src/deploy.ts b/releasing/plugin-commands-deploy/src/deploy.ts index e2658c0734..cfdd12d180 100644 --- a/releasing/plugin-commands-deploy/src/deploy.ts +++ b/releasing/plugin-commands-deploy/src/deploy.ts @@ -11,9 +11,9 @@ import { install } from '@pnpm/plugin-commands-installation' import { FILTERING } from '@pnpm/common-cli-options-help' import { PnpmError } from '@pnpm/error' import { getLockfileImporterId, readWantedLockfile, writeWantedLockfile } from '@pnpm/lockfile.fs' -import rimraf from '@zkochan/rimraf' -import renderHelp from 'render-help' -import writeYamlFile from 'write-yaml-file' +import { rimraf } from '@zkochan/rimraf' +import { renderHelp } from 'render-help' +import { writeYamlFile } from 'write-yaml-file' import { deployHook } from './deployHook.js' import { logger, globalWarn } from '@pnpm/logger' import type { Project } from '@pnpm/types' diff --git a/releasing/plugin-commands-deploy/test/shared-lockfile.test.ts b/releasing/plugin-commands-deploy/test/shared-lockfile.test.ts index e2fd741a0f..f8e4df0611 100644 --- a/releasing/plugin-commands-deploy/test/shared-lockfile.test.ts +++ b/releasing/plugin-commands-deploy/test/shared-lockfile.test.ts @@ -9,7 +9,7 @@ import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir' import { fixtures } from '@pnpm/test-fixtures' import type { ProjectManifest } from '@pnpm/types' import { jest } from '@jest/globals' -import writeYamlFile from 'write-yaml-file' +import { writeYamlFile } from 'write-yaml-file' import { DEFAULT_OPTS } from './utils/index.js' const f = fixtures(import.meta.dirname) diff --git a/releasing/plugin-commands-publishing/src/executeTokenHelper.ts b/releasing/plugin-commands-publishing/src/executeTokenHelper.ts index adbf6d212c..bb81ad0005 100644 --- a/releasing/plugin-commands-publishing/src/executeTokenHelper.ts +++ b/releasing/plugin-commands-publishing/src/executeTokenHelper.ts @@ -9,11 +9,12 @@ export function executeTokenHelper ([cmd, ...args]: [string, ...string[]], opts: stdio: 'pipe', }) - if (execResult.stderr.trim()) { - for (const line of execResult.stderr.trimEnd().split('\n')) { + const stderr = execResult.stderr?.toString() ?? '' + if (stderr.trim()) { + for (const line of stderr.trimEnd().split('\n')) { opts.globalWarn(`(tokenHelper stderr) ${line}`) } } - return execResult.stdout.trim() + return (execResult.stdout?.toString() ?? '').trim() } diff --git a/releasing/plugin-commands-publishing/src/pack.ts b/releasing/plugin-commands-publishing/src/pack.ts index edc8313eb3..ab2b135976 100644 --- a/releasing/plugin-commands-publishing/src/pack.ts +++ b/releasing/plugin-commands-publishing/src/pack.ts @@ -12,8 +12,8 @@ import type { Hooks } from '@pnpm/pnpmfile' import type { ProjectManifest, Project, ProjectRootDir, ProjectsGraph, DependencyManifest } from '@pnpm/types' import { glob } from 'tinyglobby' import { pick } from 'ramda' -import realpathMissing from 'realpath-missing' -import renderHelp from 'render-help' +import { realpathMissing } from 'realpath-missing' +import { renderHelp } from 'render-help' import tar from 'tar-stream' import { runScriptsIfPresent } from './publish.js' import chalk from 'chalk' diff --git a/releasing/plugin-commands-publishing/src/publish.ts b/releasing/plugin-commands-publishing/src/publish.ts index c45ac5e9e8..4783d0e227 100644 --- a/releasing/plugin-commands-publishing/src/publish.ts +++ b/releasing/plugin-commands-publishing/src/publish.ts @@ -7,10 +7,10 @@ import { runLifecycleHook, type RunLifecycleHookOptions } from '@pnpm/lifecycle' import type { ProjectManifest } from '@pnpm/types' import { getCurrentBranch, isGitRepo, isRemoteHistoryClean, isWorkingTreeClean } from '@pnpm/git-utils' import enquirer from 'enquirer' -import rimraf from '@zkochan/rimraf' +import { rimraf } from '@zkochan/rimraf' import { pick } from 'ramda' -import realpathMissing from 'realpath-missing' -import renderHelp from 'render-help' +import { realpathMissing } from 'realpath-missing' +import { renderHelp } from 'render-help' import { temporaryDirectory } from 'tempy' import { extractManifestFromPacked, isTarballPath } from './extractManifestFromPacked.js' import { optionsWithOtpEnv } from './otpEnv.js' diff --git a/releasing/plugin-commands-publishing/test/gitChecks.ts b/releasing/plugin-commands-publishing/test/gitChecks.ts index e9916e84b5..3a2db35c90 100644 --- a/releasing/plugin-commands-publishing/test/gitChecks.ts +++ b/releasing/plugin-commands-publishing/test/gitChecks.ts @@ -2,7 +2,7 @@ import fs from 'fs' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { prepare } from '@pnpm/prepare' import { PnpmError } from '@pnpm/error' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { temporaryDirectory } from 'tempy' import { jest } from '@jest/globals' diff --git a/releasing/plugin-commands-publishing/test/pack.ts b/releasing/plugin-commands-publishing/test/pack.ts index b9d4190683..3a5becabb6 100644 --- a/releasing/plugin-commands-publishing/test/pack.ts +++ b/releasing/plugin-commands-publishing/test/pack.ts @@ -4,7 +4,7 @@ import { pack } from '@pnpm/plugin-commands-publishing' import { prepare, preparePackages, tempDir } from '@pnpm/prepare' import * as tar from 'tar' import chalk from 'chalk' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir' import type { PackResultJson } from '../src/pack.js' import { DEFAULT_OPTS } from './utils/index.js' @@ -638,7 +638,7 @@ test('pack: recursive pack and display in json format', async () => { tempDir: path.join(dir, 'project'), }) - writeYamlFile(path.join(dir, 'pnpm-workspace.yaml'), { packages: pkgs.filter(pkg => pkg).map(pkg => pkg.name) }) + writeYamlFileSync(path.join(dir, 'pnpm-workspace.yaml'), { packages: pkgs.filter(pkg => pkg).map(pkg => pkg.name) }) const { selectedProjectsGraph } = await filterPackagesFromDir(dir, []) @@ -723,7 +723,7 @@ test('pack: recursive pack with filter', async () => { tempDir: path.join(dir, 'project'), }) - writeYamlFile(path.join(dir, 'pnpm-workspace.yaml'), { packages: pkgs.filter(pkg => pkg).map(pkg => pkg.name) }) + writeYamlFileSync(path.join(dir, 'pnpm-workspace.yaml'), { packages: pkgs.filter(pkg => pkg).map(pkg => pkg.name) }) const { selectedProjectsGraph } = await filterPackagesFromDir(dir, [{ namePattern: '@pnpmtest/*' }]) diff --git a/releasing/plugin-commands-publishing/test/publish.ts b/releasing/plugin-commands-publishing/test/publish.ts index b2efc83de4..9a3193bc78 100644 --- a/releasing/plugin-commands-publishing/test/publish.ts +++ b/releasing/plugin-commands-publishing/test/publish.ts @@ -1,7 +1,7 @@ import fs from 'fs' import path from 'path' import { temporaryDirectory } from 'tempy' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { isCI } from 'ci-info' import isWindows from 'is-windows' import { getCatalogsFromWorkspaceManifest } from '@pnpm/catalogs.config' @@ -10,7 +10,7 @@ import { prepare, preparePackages } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import { createTestIpcServer } from '@pnpm/test-ipc-server' import crossSpawn from 'cross-spawn' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { DEFAULT_OPTS, checkPkgExists } from './utils/index.js' const skipOnWindowsCI = isCI && isWindows() ? test.skip : test @@ -105,7 +105,7 @@ skipOnWindowsCI('pack packages with workspace LICENSE if no own LICENSE is prese ], { manifestFormat: 'YAML' }) const workspaceDir = process.cwd() - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) fs.writeFileSync('LICENSE', 'workspace license', 'utf8') fs.writeFileSync('project-2/LICENSE', 'project-2 license', 'utf8') @@ -165,7 +165,7 @@ test('publish packages with workspace LICENSE if no own LICENSE is present', asy ], { manifestFormat: 'YAML' }) const workspaceDir = process.cwd() - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) fs.writeFileSync('LICENSE', 'workspace license', 'utf8') fs.writeFileSync('project-200/LICENSE', 'project-200 license', 'utf8') @@ -380,7 +380,7 @@ test.skip('publish package that calls executable from the workspace .bin folder ]) const workspaceDir = process.cwd() - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) process.chdir('test-publish-scripts') await publish.handler({ @@ -484,7 +484,7 @@ test.skip('convert specs with workspace protocols to regular version ranges', as }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) process.chdir('workspace-protocol-package') @@ -589,7 +589,7 @@ test.skip('convert specs with relative workspace protocols to regular version ra }, ]) - writeYamlFile('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'] }) process.chdir('relative-workspace-protocol-package') @@ -657,7 +657,7 @@ describe('catalog protocol converted when publishing', () => { packages: ['**', '!store/**'], catalog: { 'is-positive': '1.0.0' }, } - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) process.chdir(testPackageName) @@ -719,7 +719,7 @@ describe('catalog protocol converted when publishing', () => { qux: { 'is-positive': '1.0.0' }, }, } - writeYamlFile('pnpm-workspace.yaml', workspaceManifest) + writeYamlFileSync('pnpm-workspace.yaml', workspaceManifest) process.chdir(testPackageName) diff --git a/releasing/plugin-commands-publishing/test/recursivePublish.ts b/releasing/plugin-commands-publishing/test/recursivePublish.ts index f177721201..afcdf5853c 100644 --- a/releasing/plugin-commands-publishing/test/recursivePublish.ts +++ b/releasing/plugin-commands-publishing/test/recursivePublish.ts @@ -7,7 +7,7 @@ import { preparePackages } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' import type { ProjectManifest } from '@pnpm/types' import { jest } from '@jest/globals' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import crossSpawn from 'cross-spawn' import { loadJsonFileSync } from 'load-json-file' import { DEFAULT_OPTS, checkPkgExists } from './utils/index.js' @@ -113,7 +113,7 @@ test('recursive publish', async () => { { const { stdout } = await execa('npm', ['dist-tag', 'ls', pkg1.name, '--registry', `http://localhost:${REGISTRY_MOCK_PORT}`]) - expect(stdout.toString()).toContain('next: 2.0.0') + expect(stdout?.toString()).toContain('next: 2.0.0') } }) diff --git a/releasing/plugin-commands-publishing/test/utils/index.ts b/releasing/plugin-commands-publishing/test/utils/index.ts index 42283f9769..84ea393eef 100644 --- a/releasing/plugin-commands-publishing/test/utils/index.ts +++ b/releasing/plugin-commands-publishing/test/utils/index.ts @@ -1,5 +1,5 @@ import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import execa from 'execa' +import { safeExeca as execa } from 'execa' const REGISTRY = `http://localhost:${REGISTRY_MOCK_PORT}` @@ -53,6 +53,6 @@ export const DEFAULT_OPTS = { export async function checkPkgExists (packageName: string, expectedVersion: string): Promise { const { stdout } = await execa('npm', ['view', packageName, 'versions', '--registry', `http://localhost:${REGISTRY_MOCK_PORT}`, '--json']) - const output = JSON.parse(stdout.toString()) + const output = JSON.parse(stdout?.toString() ?? '') expect(Array.isArray(output) ? output[0] : output).toStrictEqual(expectedVersion) } diff --git a/resolving/git-resolver/src/index.ts b/resolving/git-resolver/src/index.ts index b20699fda6..c2d57d00c1 100644 --- a/resolving/git-resolver/src/index.ts +++ b/resolving/git-resolver/src/index.ts @@ -1,5 +1,5 @@ import type { TarballResolution, GitResolution, PkgResolutionId, ResolveOptions, ResolveResult } from '@pnpm/resolver-base' -import git from 'graceful-git' +import { gracefulGit as git } from 'graceful-git' import semver from 'semver' import { parseBareSpecifier, type HostedPackageSpec } from './parseBareSpecifier.js' import { createGitHostedPkgId } from './createGitHostedPkgId.js' diff --git a/resolving/git-resolver/src/parseBareSpecifier.ts b/resolving/git-resolver/src/parseBareSpecifier.ts index 30ff1f9134..3b6dbcfa2c 100644 --- a/resolving/git-resolver/src/parseBareSpecifier.ts +++ b/resolving/git-resolver/src/parseBareSpecifier.ts @@ -3,7 +3,7 @@ import urlLib, { URL } from 'url' import { fetchWithAgent } from '@pnpm/fetch' import type { AgentOptions } from '@pnpm/network.agent' -import git from 'graceful-git' +import { gracefulGit as git } from 'graceful-git' import HostedGit from 'hosted-git-info' export interface HostedPackageSpec { diff --git a/resolving/git-resolver/test/index.ts b/resolving/git-resolver/test/index.ts index 0a9ffd5572..3d566e8680 100644 --- a/resolving/git-resolver/test/index.ts +++ b/resolving/git-resolver/test/index.ts @@ -7,12 +7,12 @@ const { fetchWithAgent: fetchWithAgentOriginal } = await import('@pnpm/fetch') jest.unstable_mockModule('@pnpm/fetch', () => ({ fetchWithAgent: jest.fn(), })) -const { default: gitOriginal } = await import('graceful-git') +const { gracefulGit: gitOriginal } = await import('graceful-git') jest.unstable_mockModule('graceful-git', () => ({ - default: jest.fn(), + gracefulGit: jest.fn(), })) const { fetchWithAgent } = await import('@pnpm/fetch') -const { default: git } = await import('graceful-git') +const { gracefulGit: git } = await import('graceful-git') const { createGitResolver } = await import('@pnpm/git-resolver') const resolveFromGit = createGitResolver({}) diff --git a/resolving/npm-resolver/src/pickPackage.ts b/resolving/npm-resolver/src/pickPackage.ts index 096572c53e..c312934697 100644 --- a/resolving/npm-resolver/src/pickPackage.ts +++ b/resolving/npm-resolver/src/pickPackage.ts @@ -11,7 +11,7 @@ import pLimit, { type LimitFunction } from 'p-limit' import { fastPathTemp as pathTemp } from 'path-temp' import { pick } from 'ramda' import semver from 'semver' -import renameOverwrite from 'rename-overwrite' +import { renameOverwrite } from 'rename-overwrite' import { toRaw } from './toRaw.js' import type { FetchMetadataResult } from './fetch.js' import { diff --git a/reviewing/dependencies-hierarchy/src/buildDependenciesTree.ts b/reviewing/dependencies-hierarchy/src/buildDependenciesTree.ts index 475ffa2508..74de8346fa 100644 --- a/reviewing/dependencies-hierarchy/src/buildDependenciesTree.ts +++ b/reviewing/dependencies-hierarchy/src/buildDependenciesTree.ts @@ -15,8 +15,8 @@ import { readModulesDir } from '@pnpm/read-modules-dir' import { safeReadPackageJsonFromDir } from '@pnpm/read-package-json' import { type DependenciesField, type Finder, DEPENDENCIES_FIELDS, type Registries } from '@pnpm/types' import normalizePath from 'normalize-path' -import realpathMissing from 'realpath-missing' -import resolveLinkTarget from 'resolve-link-target' +import { realpathMissing } from 'realpath-missing' +import { resolveLinkTarget } from 'resolve-link-target' import type { DependencyNode } from './DependencyNode.js' import { buildDependencyGraph } from './buildDependencyGraph.js' import { getTree, type BaseTreeOpts, type MaterializationCache } from './getTree.js' diff --git a/reviewing/dependencies-hierarchy/src/buildDependentsTree.ts b/reviewing/dependencies-hierarchy/src/buildDependentsTree.ts index 65e90095c6..672d7dd4f8 100644 --- a/reviewing/dependencies-hierarchy/src/buildDependentsTree.ts +++ b/reviewing/dependencies-hierarchy/src/buildDependentsTree.ts @@ -12,7 +12,7 @@ import { normalizeRegistries } from '@pnpm/normalize-registries' import type { DependenciesField, DependencyManifest, Finder, Registries } from '@pnpm/types' import { lexCompare } from '@pnpm/util.lex-comparator' import semver from 'semver' -import realpathMissing from 'realpath-missing' +import { realpathMissing } from 'realpath-missing' import { buildDependencyGraph, type DependencyGraph } from './buildDependencyGraph.js' import { createPackagesSearcher } from './createPackagesSearcher.js' import { peersSuffixHashFromDepPath } from './peersSuffixHash.js' diff --git a/reviewing/license-scanner/src/getPkgInfo.ts b/reviewing/license-scanner/src/getPkgInfo.ts index 5c4304d7fc..c7dcab26b3 100644 --- a/reviewing/license-scanner/src/getPkgInfo.ts +++ b/reviewing/license-scanner/src/getPkgInfo.ts @@ -1,5 +1,5 @@ import path from 'path' -import pathAbsolute from 'path-absolute' +import { pathAbsolute } from 'path-absolute' import { readFile } from 'fs/promises' import { readPackageJson } from '@pnpm/read-package-json' import { depPathToFilename } from '@pnpm/dependency-path' diff --git a/reviewing/plugin-commands-licenses/src/licenses.ts b/reviewing/plugin-commands-licenses/src/licenses.ts index ef969bf22c..763ccc232d 100644 --- a/reviewing/plugin-commands-licenses/src/licenses.ts +++ b/reviewing/plugin-commands-licenses/src/licenses.ts @@ -7,7 +7,7 @@ import { FILTERING } from '@pnpm/common-cli-options-help' import { types as allTypes } from '@pnpm/config' import { PnpmError } from '@pnpm/error' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import type { LicensesCommandResult } from './LicensesCommandResult.js' import { licensesList, type LicensesCommandOptions } from './licensesList.js' diff --git a/reviewing/plugin-commands-listing/src/list.ts b/reviewing/plugin-commands-listing/src/list.ts index 0e65839640..4373c61099 100644 --- a/reviewing/plugin-commands-listing/src/list.ts +++ b/reviewing/plugin-commands-listing/src/list.ts @@ -5,7 +5,7 @@ import { listGlobalPackages } from '@pnpm/global.commands' import { list, listForPackages } from '@pnpm/list' import type { Finder, IncludedDependencies } from '@pnpm/types' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { computeInclude, resolveFinders, determineReportAs, SHARED_CLI_HELP_OPTIONS, BASE_RC_OPTION_KEYS } from './common.js' import { listRecursive } from './recursive.js' diff --git a/reviewing/plugin-commands-listing/src/why.ts b/reviewing/plugin-commands-listing/src/why.ts index 04fcaf6f28..0138aebf8f 100644 --- a/reviewing/plugin-commands-listing/src/why.ts +++ b/reviewing/plugin-commands-listing/src/why.ts @@ -4,7 +4,7 @@ import { types as allTypes } from '@pnpm/config' import { PnpmError } from '@pnpm/error' import { whyForPackages } from '@pnpm/list' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { computeInclude, resolveFinders, determineReportAs, SHARED_CLI_HELP_OPTIONS, BASE_RC_OPTION_KEYS } from './common.js' import { type ListCommandOptions, EXCLUDE_PEERS_HELP } from './list.js' diff --git a/reviewing/plugin-commands-listing/test/index.ts b/reviewing/plugin-commands-listing/test/index.ts index d122fd16d2..e95fda4d80 100644 --- a/reviewing/plugin-commands-listing/test/index.ts +++ b/reviewing/plugin-commands-listing/test/index.ts @@ -4,9 +4,9 @@ import { WANTED_LOCKFILE } from '@pnpm/constants' import { list, why } from '@pnpm/plugin-commands-listing' import { prepare, preparePackages } from '@pnpm/prepare' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { stripVTControlCharacters as stripAnsi } from 'util' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') @@ -90,7 +90,7 @@ test(`listing packages of a project that has an external ${WANTED_LOCKFILE}`, as }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { sharedWorkspaceLockfile: true, packages: ['**', '!store/**'], }) diff --git a/reviewing/plugin-commands-listing/test/recursive.ts b/reviewing/plugin-commands-listing/test/recursive.ts index 24b0142ee2..8e987edfc4 100644 --- a/reviewing/plugin-commands-listing/test/recursive.ts +++ b/reviewing/plugin-commands-listing/test/recursive.ts @@ -6,7 +6,7 @@ import { list, why } from '@pnpm/plugin-commands-listing' import { prepare, preparePackages } from '@pnpm/prepare' import { addDistTag } from '@pnpm/registry-mock' import { stripVTControlCharacters as stripAnsi } from 'util' -import { sync as writeYamlFile } from 'write-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { DEFAULT_OPTS } from './utils/index.js' test('recursive list', async () => { @@ -96,7 +96,7 @@ test('recursive list with sharedWorkspaceLockfile', async () => { }, ]) - writeYamlFile('pnpm-workspace.yaml', { + writeYamlFileSync('pnpm-workspace.yaml', { packages: ['**', '!store/**'], sharedWorkspaceLockfile: true, }) diff --git a/reviewing/plugin-commands-listing/test/why.ts b/reviewing/plugin-commands-listing/test/why.ts index 426b2e2719..27c0c07bc4 100644 --- a/reviewing/plugin-commands-listing/test/why.ts +++ b/reviewing/plugin-commands-listing/test/why.ts @@ -4,7 +4,7 @@ import type { PnpmError } from '@pnpm/error' import { why } from '@pnpm/plugin-commands-listing' import { prepare } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { stripVTControlCharacters as stripAnsi } from 'util' const pnpmBin = path.join(import.meta.dirname, '../../../pnpm/bin/pnpm.mjs') diff --git a/reviewing/plugin-commands-outdated/src/outdated.ts b/reviewing/plugin-commands-outdated/src/outdated.ts index 33ebac3b99..d0749dbb04 100644 --- a/reviewing/plugin-commands-outdated/src/outdated.ts +++ b/reviewing/plugin-commands-outdated/src/outdated.ts @@ -19,7 +19,7 @@ import type { DependenciesField, PackageManifest, ProjectManifest, ProjectRootDi import { table } from '@zkochan/table' import chalk from 'chalk' import { pick, sortWith } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { stripVTControlCharacters as stripAnsi } from 'util' import { DEFAULT_COMPARATORS, diff --git a/reviewing/plugin-commands-sbom/src/sbom.ts b/reviewing/plugin-commands-sbom/src/sbom.ts index 233184a23d..e80a68fafd 100644 --- a/reviewing/plugin-commands-sbom/src/sbom.ts +++ b/reviewing/plugin-commands-sbom/src/sbom.ts @@ -14,7 +14,7 @@ import { type SbomComponentType, } from '@pnpm/sbom' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' export type SbomCommandOptions = { sbomFormat?: string diff --git a/runtime/commands/src/runtime.ts b/runtime/commands/src/runtime.ts index 42a17606c5..585ddba6a3 100644 --- a/runtime/commands/src/runtime.ts +++ b/runtime/commands/src/runtime.ts @@ -2,7 +2,7 @@ import { docsUrl } from '@pnpm/cli-utils' import type { Config } from '@pnpm/config' import { PnpmError } from '@pnpm/error' import { runPnpmCli } from '@pnpm/exec.pnpm-cli-runner' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' export type RuntimeCommandOptions = Pick { ], { cwd: project2Dir }) // Delete project1 - rimraf(project1Dir) + rimrafSync(project1Dir) // Verify package still exists in links/@/ directory const linksDir = path.join(storeDir, STORE_VERSION, 'links') @@ -546,7 +546,7 @@ describe('global virtual store prune', () => { const afterPrune = fs.readdirSync(unscopedDir) expect(afterPrune).toContain('is-positive') - rimraf(project2Dir) + rimrafSync(project2Dir) }) test('prune removes packages when project using them is deleted', async () => { @@ -596,7 +596,7 @@ describe('global virtual store prune', () => { expect(beforePrune).toContain('is-negative') // Delete project1 (which uses is-positive) - rimraf(project1Dir) + rimrafSync(project1Dir) // Run prune await store.handler({ @@ -619,7 +619,7 @@ describe('global virtual store prune', () => { // is-negative should remain since project2 still exists expect(afterPrune).toContain('is-negative') - rimraf(project2Dir) + rimrafSync(project2Dir) }) test('prune preserves transitive dependencies and removes isolated ones', async () => { diff --git a/store/plugin-commands-store/test/storeStatus.ts b/store/plugin-commands-store/test/storeStatus.ts index f6314fe810..f38818e87b 100644 --- a/store/plugin-commands-store/test/storeStatus.ts +++ b/store/plugin-commands-store/test/storeStatus.ts @@ -4,8 +4,8 @@ import type { PnpmError } from '@pnpm/error' import { store } from '@pnpm/plugin-commands-store' import { prepare } from '@pnpm/prepare' import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock' -import { sync as rimraf } from '@zkochan/rimraf' -import execa from 'execa' +import { rimrafSync } from '@zkochan/rimraf' +import { safeExeca as execa } from 'execa' import { temporaryDirectory } from 'tempy' const REGISTRY = `http://localhost:${REGISTRY_MOCK_PORT}/` @@ -31,7 +31,7 @@ test('CLI fails when store status finds modified packages', async () => { '--verify-store-integrity', ], execaOpts) - rimraf('node_modules/.pnpm/is-positive@3.1.0/node_modules/is-positive/index.js') + rimrafSync('node_modules/.pnpm/is-positive@3.1.0/node_modules/is-positive/index.js') let err!: PnpmError & { modified: string[] } const modulesState = project.readModulesManifest() diff --git a/store/store-path/src/index.ts b/store/store-path/src/index.ts index 08c4d15303..5f33848899 100644 --- a/store/store-path/src/index.ts +++ b/store/store-path/src/index.ts @@ -1,13 +1,13 @@ import { promises as fs } from 'fs' import { STORE_VERSION } from '@pnpm/constants' import { PnpmError } from '@pnpm/error' -import rimraf from '@zkochan/rimraf' -import canLink from 'can-link' +import { rimraf } from '@zkochan/rimraf' +import { canLink } from 'can-link' import os from 'os' import path from 'path' -import pathAbsolute from 'path-absolute' -import pathTemp from 'path-temp' -import rootLinkTarget from 'root-link-target' +import { pathAbsolute } from 'path-absolute' +import { pathTemp } from 'path-temp' +import { rootLinkTarget } from 'root-link-target' import touch from 'touch' export function getStorePath ( diff --git a/store/store-path/test/index.ts b/store/store-path/test/index.ts index 9985709c26..fbf2241023 100644 --- a/store/store-path/test/index.ts +++ b/store/store-path/test/index.ts @@ -15,14 +15,14 @@ jest.unstable_mockModule('root-link-target', () => { } return { - default: async function (file: string): Promise { + rootLinkTarget: async function (file: string): Promise { return MAPPINGS[file] }, } }) jest.unstable_mockModule('path-temp', () => { return { - default: function (dir: string): string { + pathTemp: function (dir: string): string { return path.join(dir, 'tmp') }, } @@ -32,13 +32,25 @@ jest.unstable_mockModule('os', () => ({ homedir: () => '/home/user', }, })) -jest.unstable_mockModule('fs', () => ({ +const fsMock = { + default: { + promises: { + mkdir: () => {}, + unlink: () => {}, + rmdir: () => {}, + rm: () => {}, + }, + rmSync: () => {}, + }, promises: { mkdir: () => {}, unlink: () => {}, rmdir: () => {}, + rm: () => {}, }, -})) +} +jest.unstable_mockModule('fs', () => fsMock) +jest.unstable_mockModule('node:fs', () => fsMock) jest.unstable_mockModule('can-link', () => { const CAN_LINK = new Set([ '/can-link-to-homedir/tmp=>/home/user/tmp', @@ -46,7 +58,7 @@ jest.unstable_mockModule('can-link', () => { ]) return { - default: function (existingPath: string, newPath: string): boolean { + canLink: function (existingPath: string, newPath: string): boolean { return CAN_LINK.has(`${existingPath}=>${newPath}`) }, } diff --git a/tools/plugin-commands-self-updater/src/selfUpdate.ts b/tools/plugin-commands-self-updater/src/selfUpdate.ts index 6b4221d958..90cc83ce6b 100644 --- a/tools/plugin-commands-self-updater/src/selfUpdate.ts +++ b/tools/plugin-commands-self-updater/src/selfUpdate.ts @@ -10,7 +10,7 @@ import { globalWarn } from '@pnpm/logger' import { readProjectManifest } from '@pnpm/read-project-manifest' import { createStoreController, type CreateStoreControllerOptions } from '@pnpm/store-connection-manager' import { pick } from 'ramda' -import renderHelp from 'render-help' +import { renderHelp } from 'render-help' import { installPnpm } from './installPnpm.js' export function rcOptionsTypes (): Record { diff --git a/workspace/filter-workspace-packages/src/getChangedPackages.ts b/workspace/filter-workspace-packages/src/getChangedPackages.ts index 103518f713..90a2a1bb45 100644 --- a/workspace/filter-workspace-packages/src/getChangedPackages.ts +++ b/workspace/filter-workspace-packages/src/getChangedPackages.ts @@ -3,7 +3,7 @@ import path from 'path' import util from 'util' import { PnpmError } from '@pnpm/error' import * as micromatch from 'micromatch' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { findUp } from 'find-up' import type { ProjectRootDir } from '@pnpm/types' @@ -68,7 +68,7 @@ async function getChangedDirsSinceCommit (commit: string, workingDir: string, te '--', workingDir, ], { cwd: workingDir }) - ).stdout + ).stdout as string } catch (err: unknown) { assert(util.types.isNativeError(err)) throw new PnpmError('FILTER_CHANGED', `Filtering by changed packages failed. ${'stderr' in err ? err.stderr as string : ''}`) diff --git a/workspace/filter-workspace-packages/src/index.ts b/workspace/filter-workspace-packages/src/index.ts index efc72e1d50..a47a13bff1 100644 --- a/workspace/filter-workspace-packages/src/index.ts +++ b/workspace/filter-workspace-packages/src/index.ts @@ -2,7 +2,7 @@ import { createMatcher } from '@pnpm/matcher' import type { ProjectRootDir, SupportedArchitectures } from '@pnpm/types' import { findWorkspacePackages, type Project } from '@pnpm/workspace.find-packages' import { createPkgGraph, type Package, type PackageNode } from '@pnpm/workspace.pkgs-graph' -import isSubdir from 'is-subdir' +import { isSubdir } from 'is-subdir' import { difference, partition, pick } from 'ramda' import * as micromatch from 'micromatch' import { getChangedPackages } from './getChangedPackages.js' diff --git a/workspace/filter-workspace-packages/test/index.ts b/workspace/filter-workspace-packages/test/index.ts index fc68f7769d..34f99e99dc 100644 --- a/workspace/filter-workspace-packages/test/index.ts +++ b/workspace/filter-workspace-packages/test/index.ts @@ -5,7 +5,7 @@ import type { Package } from '@pnpm/workspace.pkgs-graph' import type { ProjectRootDir } from '@pnpm/types' import './parsePackageSelector.js' import fs from 'fs' -import execa from 'execa' +import { safeExeca as execa } from 'execa' import { isCI } from 'ci-info' import isWindows from 'is-windows' import path from 'path' diff --git a/workspace/manifest-writer/test/addCatalogs.test.ts b/workspace/manifest-writer/test/addCatalogs.test.ts index ff6d6609e7..02208346e7 100644 --- a/workspace/manifest-writer/test/addCatalogs.test.ts +++ b/workspace/manifest-writer/test/addCatalogs.test.ts @@ -3,8 +3,8 @@ import path from 'path' import { WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants' import { tempDir } from '@pnpm/prepare-temp-dir' import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' test('addCatalogs does not write new workspace manifest for empty catalogs', async () => { const dir = tempDir(false) @@ -39,36 +39,36 @@ test('addCatalogs does not write new workspace manifest for empty any-named cata test('addCatalogs does not add empty catalogs', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, {}) + writeYamlFileSync(filePath, {}) await updateWorkspaceManifest(dir, { updatedCatalogs: {}, }) - expect(readYamlFile(filePath)).toStrictEqual({}) + expect(readYamlFileSync(filePath)).toStrictEqual({}) }) test('addCatalogs does not add empty default catalogs', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, {}) + writeYamlFileSync(filePath, {}) await updateWorkspaceManifest(dir, { updatedCatalogs: { default: {}, }, }) - expect(readYamlFile(filePath)).toStrictEqual({}) + expect(readYamlFileSync(filePath)).toStrictEqual({}) }) test('addCatalogs does not add empty any-named catalogs', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, {}) + writeYamlFileSync(filePath, {}) await updateWorkspaceManifest(dir, { updatedCatalogs: { foo: {}, bar: {}, }, }) - expect(readYamlFile(filePath)).toStrictEqual({}) + expect(readYamlFileSync(filePath)).toStrictEqual({}) }) test('addCatalogs adds `default` catalogs to the `catalog` object by default', async () => { @@ -81,7 +81,7 @@ test('addCatalogs adds `default` catalogs to the `catalog` object by default', a }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalog: { foo: '^0.1.2', }, @@ -91,7 +91,7 @@ test('addCatalogs adds `default` catalogs to the `catalog` object by default', a test('addCatalogs adds `default` catalogs to the `catalog` object if it exists', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalog: { bar: '3.2.1', }, @@ -103,7 +103,7 @@ test('addCatalogs adds `default` catalogs to the `catalog` object if it exists', }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalog: { bar: '3.2.1', foo: '^0.1.2', @@ -114,7 +114,7 @@ test('addCatalogs adds `default` catalogs to the `catalog` object if it exists', test('addCatalogs adds `default` catalogs to the `catalogs.default` object if it exists', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalogs: { default: { bar: '3.2.1', @@ -128,7 +128,7 @@ test('addCatalogs adds `default` catalogs to the `catalogs.default` object if it }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { default: { bar: '3.2.1', @@ -151,7 +151,7 @@ test('addCatalogs creates a `catalogs` object for any-named catalogs', async () }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { abc: '0.1.2', @@ -166,7 +166,7 @@ test('addCatalogs creates a `catalogs` object for any-named catalogs', async () test('addCatalogs add any-named catalogs to the `catalogs` object if it already exists', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalogs: { foo: { ghi: '7.8.9', @@ -183,7 +183,7 @@ test('addCatalogs add any-named catalogs to the `catalogs` object if it already }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { abc: '0.1.2', diff --git a/workspace/manifest-writer/test/removeCatalogs.test.ts b/workspace/manifest-writer/test/removeCatalogs.test.ts index 3d4363efc6..b431152e7c 100644 --- a/workspace/manifest-writer/test/removeCatalogs.test.ts +++ b/workspace/manifest-writer/test/removeCatalogs.test.ts @@ -4,8 +4,8 @@ import { WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants' import { tempDir } from '@pnpm/prepare-temp-dir' import { prepare } from '@pnpm/prepare' import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' import { findPackages } from '@pnpm/fs.find-packages' test('remove the default catalog if it is empty', async () => { @@ -30,7 +30,7 @@ test('remove the default catalog if it is empty', async () => { }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalog: { foo: '^0.1.2', }, @@ -45,7 +45,7 @@ test('remove the default catalog if it is empty', async () => { test('remove the unused default catalog', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalog: { bar: '3.2.1', }, @@ -57,7 +57,7 @@ test('remove the unused default catalog', async () => { }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalog: { bar: '3.2.1', foo: '^0.1.2', @@ -74,7 +74,7 @@ test('remove the unused default catalog', async () => { cleanupUnusedCatalogs: true, allProjects, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalog: { bar: '3.2.1', }, @@ -84,7 +84,7 @@ test('remove the unused default catalog', async () => { test('remove the unused default catalog with catalogs', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalogs: { default: { bar: '3.2.1', @@ -98,7 +98,7 @@ test('remove the unused default catalog with catalogs', async () => { }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { default: { bar: '3.2.1', @@ -117,7 +117,7 @@ test('remove the unused default catalog with catalogs', async () => { cleanupUnusedCatalogs: true, allProjects, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { default: { bar: '3.2.1', @@ -139,7 +139,7 @@ test('remove the unused named catalog', async () => { }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { abc: '0.1.2', @@ -160,7 +160,7 @@ test('remove the unused named catalog', async () => { cleanupUnusedCatalogs: true, allProjects, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { bar: { def: '3.2.1', @@ -172,7 +172,7 @@ test('remove the unused named catalog', async () => { test('remove all unused named catalogs', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalogs: { foo: { ghi: '7.8.9', @@ -189,7 +189,7 @@ test('remove all unused named catalogs', async () => { }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { abc: '0.1.2', @@ -212,7 +212,7 @@ test('remove all unused named catalogs', async () => { cleanupUnusedCatalogs: true, allProjects, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { bar: { def: '3.2.1', @@ -238,7 +238,7 @@ test('remove all unused named catalogs', async () => { test('same pkg with different version', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalogs: { foo: { ghi: '7.8.9', @@ -256,7 +256,7 @@ test('same pkg with different version', async () => { }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { abc: '0.1.2', @@ -283,7 +283,7 @@ test('same pkg with different version', async () => { cleanupUnusedCatalogs: true, allProjects, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { bar: { abc: '1.2.3', @@ -300,7 +300,7 @@ test('same pkg with different version', async () => { test('update catalogs and remove catalog', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalogs: { foo: { ghi: '7.8.9', @@ -317,7 +317,7 @@ test('update catalogs and remove catalog', async () => { }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { abc: '0.1.2', @@ -344,7 +344,7 @@ test('update catalogs and remove catalog', async () => { cleanupUnusedCatalogs: true, allProjects, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { ghi: '7.9.9', @@ -359,7 +359,7 @@ test('update catalogs and remove catalog', async () => { test('when allProjects is undefined should not cleanup unused catalogs', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { + writeYamlFileSync(filePath, { catalogs: { foo: { ghi: '7.8.9', @@ -376,7 +376,7 @@ test('when allProjects is undefined should not cleanup unused catalogs', async ( }, }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { abc: '0.1.2', @@ -402,7 +402,7 @@ test('when allProjects is undefined should not cleanup unused catalogs', async ( cleanupUnusedCatalogs: true, allProjects: undefined, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ catalogs: { foo: { abc: '0.1.2', diff --git a/workspace/manifest-writer/test/updateWorkspaceManifest.test.ts b/workspace/manifest-writer/test/updateWorkspaceManifest.test.ts index 6207c8694b..515f695b90 100644 --- a/workspace/manifest-writer/test/updateWorkspaceManifest.test.ts +++ b/workspace/manifest-writer/test/updateWorkspaceManifest.test.ts @@ -3,17 +3,17 @@ import path from 'path' import { WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants' import { tempDir } from '@pnpm/prepare-temp-dir' import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer' -import { sync as readYamlFile } from 'read-yaml-file' -import { sync as writeYamlFile } from 'write-yaml-file' +import { readYamlFileSync } from 'read-yaml-file' +import { writeYamlFileSync } from 'write-yaml-file' test('updateWorkspaceManifest adds a new setting', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { packages: ['*'], allowBuilds: {} }) + writeYamlFileSync(filePath, { packages: ['*'], allowBuilds: {} }) await updateWorkspaceManifest(dir, { updatedFields: { allowBuilds: {} }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ packages: ['*'], allowBuilds: {}, }) @@ -22,11 +22,11 @@ test('updateWorkspaceManifest adds a new setting', async () => { test('updateWorkspaceManifest removes an existing setting', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { packages: ['*'], overrides: { foo: '2' } }) + writeYamlFileSync(filePath, { packages: ['*'], overrides: { foo: '2' } }) await updateWorkspaceManifest(dir, { updatedFields: { overrides: undefined }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ packages: ['*'], }) }) @@ -34,11 +34,11 @@ test('updateWorkspaceManifest removes an existing setting', async () => { test('updateWorkspaceManifest updates an existing setting', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { packages: ['*'], overrides: { foo: '2' } }) + writeYamlFileSync(filePath, { packages: ['*'], overrides: { foo: '2' } }) await updateWorkspaceManifest(dir, { updatedFields: { overrides: { bar: '3' } }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ packages: ['*'], overrides: { bar: '3' }, }) @@ -86,11 +86,11 @@ overrides: test('updateWorkspaceManifest updates allowBuilds', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { packages: ['*'], allowBuilds: { qar: 'warn' } }) + writeYamlFileSync(filePath, { packages: ['*'], allowBuilds: { qar: 'warn' } }) await updateWorkspaceManifest(dir, { updatedFields: { allowBuilds: { foo: true, bar: false } }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ packages: ['*'], allowBuilds: { bar: false, @@ -102,11 +102,11 @@ test('updateWorkspaceManifest updates allowBuilds', async () => { test('updateWorkspaceManifest with updatedOverrides adds overrides when none exist', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { packages: ['*'] }) + writeYamlFileSync(filePath, { packages: ['*'] }) await updateWorkspaceManifest(dir, { updatedOverrides: { foo: '1.0.0', bar: '2.0.0' }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ packages: ['*'], overrides: { bar: '2.0.0', @@ -118,11 +118,11 @@ test('updateWorkspaceManifest with updatedOverrides adds overrides when none exi test('updateWorkspaceManifest with updatedOverrides merges into existing overrides', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { packages: ['*'], overrides: { existing: '1.0.0' } }) + writeYamlFileSync(filePath, { packages: ['*'], overrides: { existing: '1.0.0' } }) await updateWorkspaceManifest(dir, { updatedOverrides: { newPkg: '2.0.0' }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ packages: ['*'], overrides: { existing: '1.0.0', @@ -134,11 +134,11 @@ test('updateWorkspaceManifest with updatedOverrides merges into existing overrid test('updateWorkspaceManifest with updatedOverrides updates existing override values', async () => { const dir = tempDir(false) const filePath = path.join(dir, WORKSPACE_MANIFEST_FILENAME) - writeYamlFile(filePath, { packages: ['*'], overrides: { foo: '1.0.0', bar: '1.0.0' } }) + writeYamlFileSync(filePath, { packages: ['*'], overrides: { foo: '1.0.0', bar: '1.0.0' } }) await updateWorkspaceManifest(dir, { updatedOverrides: { foo: '2.0.0' }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ packages: ['*'], overrides: { bar: '1.0.0', @@ -202,7 +202,7 @@ test('updateWorkspaceManifest adds a new catalog', async () => { }, }) - expect(readYamlFile(filePath)).toStrictEqual({ + expect(readYamlFileSync(filePath)).toStrictEqual({ packages: ['*'], catalog: { foo: '1.0.0' }, }) diff --git a/workspace/pkgs-graph/test/index.ts b/workspace/pkgs-graph/test/index.ts index 7bdde4de2a..aa325ef2a1 100644 --- a/workspace/pkgs-graph/test/index.ts +++ b/workspace/pkgs-graph/test/index.ts @@ -1,6 +1,6 @@ /// import { createPkgGraph } from '@pnpm/workspace.pkgs-graph' -import pathResolve from 'better-path-resolve' +import { betterPathResolve as pathResolve } from 'better-path-resolve' const BAR1_PATH = pathResolve('/zkochan/src/bar') const FOO1_PATH = pathResolve('/zkochan/src/foo') diff --git a/workspace/read-manifest/src/index.ts b/workspace/read-manifest/src/index.ts index 08f6132ec1..917ec51574 100644 --- a/workspace/read-manifest/src/index.ts +++ b/workspace/read-manifest/src/index.ts @@ -2,7 +2,7 @@ import util from 'util' import { type GLOBAL_CONFIG_YAML_FILENAME, WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants' import type { PnpmSettings } from '@pnpm/types' import path from 'node:path' -import readYamlFile from 'read-yaml-file' +import { readYamlFile } from 'read-yaml-file' import { assertValidWorkspaceManifestCatalog, assertValidWorkspaceManifestCatalogs, @@ -40,7 +40,7 @@ export async function readWorkspaceManifest (dir: string, cfgFileName: ConfigFil async function readManifestRaw (dir: string, cfgFileName: ConfigFileName): Promise { try { - return await readYamlFile.default(path.join(dir, cfgFileName)) + return await readYamlFile(path.join(dir, cfgFileName)) } catch (err: unknown) { // File not exists is the same as empty file (undefined) if (util.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') {