mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-29 04:21:39 -04:00
fix: installing git-hosted dependencies
Fixing a regression caused by breaking changes in the fetch function API. `@pnpm/git-fetcher` was not correctly updated. As a result, git-hosted dependencies were not being installed. PR #2580
This commit is contained in:
5
.changeset/violet-steaks-burn.md
Normal file
5
.changeset/violet-steaks-burn.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/git-fetcher": patch
|
||||
---
|
||||
|
||||
Adhere to the new FetchFunction API. cafs should be the first argument of the a fetch function.
|
||||
@@ -7,12 +7,13 @@ import tempy = require('tempy')
|
||||
export default () => {
|
||||
return {
|
||||
git: async function fetchFromGit (
|
||||
cafs: Cafs,
|
||||
resolution: {
|
||||
repo: string,
|
||||
commit: string,
|
||||
repo: string,
|
||||
type: 'git',
|
||||
},
|
||||
opts: {
|
||||
cafs: Cafs,
|
||||
manifest?: DeferredManifestPromise,
|
||||
}
|
||||
) {
|
||||
@@ -22,7 +23,7 @@ export default () => {
|
||||
// removing /.git to make directory integrity calculation faster
|
||||
await rimraf(path.join(tempLocation, '.git'))
|
||||
return {
|
||||
filesIndex: await opts.cafs.addFilesFromDir(tempLocation, opts.manifest),
|
||||
filesIndex: await cafs.addFilesFromDir(tempLocation, opts.manifest),
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -11,13 +11,17 @@ test('fetch', async t => {
|
||||
t.comment(`cafs at ${cafsDir}`)
|
||||
const fetch = createFetcher().git
|
||||
const manifest = pDefer<DependencyManifest>()
|
||||
const { filesIndex } = await fetch({
|
||||
commit: 'c9b30e71d704cd30fa71f2edd1ecc7dcc4985493',
|
||||
repo: 'https://github.com/kevva/is-positive.git',
|
||||
}, {
|
||||
cafs: createCafs(cafsDir),
|
||||
manifest,
|
||||
})
|
||||
const { filesIndex } = await fetch(
|
||||
createCafs(cafsDir),
|
||||
{
|
||||
commit: 'c9b30e71d704cd30fa71f2edd1ecc7dcc4985493',
|
||||
repo: 'https://github.com/kevva/is-positive.git',
|
||||
type: 'git',
|
||||
},
|
||||
{
|
||||
manifest,
|
||||
}
|
||||
)
|
||||
t.ok(filesIndex['package.json'])
|
||||
t.ok(await filesIndex['package.json'].generatingIntegrity)
|
||||
t.equal((await manifest.promise).name, 'is-positive')
|
||||
|
||||
@@ -51,7 +51,7 @@ export default async function testDefaults (
|
||||
registry,
|
||||
...retryOpts,
|
||||
...fetchOpts,
|
||||
}) as {},
|
||||
}),
|
||||
{
|
||||
storeDir,
|
||||
...storeOpts,
|
||||
|
||||
@@ -25,7 +25,7 @@ export default async (
|
||||
await fs.mkdir(sopts.storeDir, { recursive: true })
|
||||
const fetchers = createFetcher(sopts)
|
||||
return {
|
||||
ctrl: await createStore(resolve, fetchers as {}, {
|
||||
ctrl: await createStore(resolve, fetchers, {
|
||||
ignoreFile: sopts.ignoreFile,
|
||||
networkConcurrency: sopts.networkConcurrency,
|
||||
packageImportMethod: sopts.packageImportMethod,
|
||||
|
||||
@@ -54,7 +54,7 @@ export default async function testDefaults<T> (
|
||||
registry,
|
||||
...retryOpts,
|
||||
...fetchOpts,
|
||||
}) as {},
|
||||
}),
|
||||
{
|
||||
ignoreFile: opts?.fastUnpack === false ? undefined : (filename) => filename !== 'package.json',
|
||||
storeDir,
|
||||
|
||||
Reference in New Issue
Block a user