mirror of
https://github.com/pnpm/pnpm.git
synced 2026-02-07 13:42:10 -05:00
* fix: force re-fetch when resolution integrity changes When a resolver returns a resolution with a different integrity than the current package's resolution, automatically force re-fetching the package. This allows custom resolvers to trigger re-fetches by simply returning the updated integrity, without needing to explicitly set a forceFetch flag. Closes #10451 * refactor: remove forceFetch * test: fix --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
@pnpm/local-resolver
Resolver for local packages
Installation
pnpm add @pnpm/local-resolver
Usage
'use strict'
const resolveFromLocal = require('@pnpm/local-resolver').default
resolveFromLocal({bareSpecifier: './example-package'}, {prefix: process.cwd()})
.then(resolveResult => console.log(resolveResult))
//> { id: 'link:example-package',
// normalizedBareSpecifier: 'link:example-package',
// package:
// { name: 'foo',
// version: '1.0.0',
// readme: '# foo\n',
// readmeFilename: 'README.md',
// description: '',
// _id: 'foo@1.0.0' },
// resolution: { directory: 'example-package', type: 'directory' }
// resolvedVia: 'local-filesystem' }
License
MIT