mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
feat(lockfile.fs): export writeLockfileFile and convertToLockfileFile (#8735)
This commit is contained in:
5
.changeset/flat-ways-develop.md
Normal file
5
.changeset/flat-ways-develop.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/lockfile.fs": minor
|
||||
---
|
||||
|
||||
Export `writeLockfileFile` and `convertToLockfileFile`.
|
||||
@@ -3,9 +3,11 @@ export {
|
||||
writeLockfiles,
|
||||
writeCurrentLockfile,
|
||||
writeWantedLockfile,
|
||||
writeLockfileFile,
|
||||
} from './write'
|
||||
export { existsNonEmptyWantedLockfile } from './existsWantedLockfile'
|
||||
export { getLockfileImporterId } from './getLockfileImporterId'
|
||||
export * from '@pnpm/lockfile.types'
|
||||
export * from './read'
|
||||
export { cleanGitBranchLockfiles } from './gitBranchLockfile'
|
||||
export { convertToLockfileFile } from './lockfileFormatConverters'
|
||||
|
||||
@@ -60,9 +60,14 @@ async function writeLockfile (
|
||||
const lockfilePath = path.join(pkgPath, lockfileFilename)
|
||||
|
||||
const lockfileToStringify = convertToLockfileFile(wantedLockfile)
|
||||
return writeLockfileFile(lockfilePath, lockfileToStringify)
|
||||
}
|
||||
|
||||
const yamlDoc = yamlStringify(lockfileToStringify)
|
||||
|
||||
export function writeLockfileFile (
|
||||
lockfilePath: string,
|
||||
wantedLockfile: LockfileFile
|
||||
): Promise<void> {
|
||||
const yamlDoc = yamlStringify(wantedLockfile)
|
||||
return writeFileAtomic(lockfilePath, yamlDoc)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user