@pnpm/resolving.git-resolver 1100.0.7 → 1100.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { DispatcherOptions } from '@pnpm/network.fetch';
2
- import type { GitResolution, ResolveOptions, ResolveResult, TarballResolution } from '@pnpm/resolving.resolver-base';
2
+ import type { GitResolution, LatestInfo, LatestQuery, ResolveOptions, ResolveResult, TarballResolution } from '@pnpm/resolving.resolver-base';
3
3
  import { createGitHostedPkgId } from './createGitHostedPkgId.js';
4
4
  import { type HostedPackageSpec } from './parseBareSpecifier.js';
5
5
  export { createGitHostedPkgId };
@@ -13,3 +13,4 @@ export type GitResolver = (wantedDependency: {
13
13
  bareSpecifier: string;
14
14
  }, opts?: Pick<ResolveOptions, 'currentPkg' | 'update'>) => Promise<GitResolveResult | null>;
15
15
  export declare function createGitResolver(opts: DispatcherOptions): GitResolver;
16
+ export declare function resolveLatestFromGit(query: LatestQuery): Promise<LatestInfo | undefined>;
package/lib/index.js CHANGED
@@ -73,6 +73,19 @@ export function createGitResolver(opts) {
73
73
  };
74
74
  };
75
75
  }
76
+ // Git deps have no concept of "latest" — we'd need to query the host's tag list
77
+ // to know about newer commits, which isn't a uniform thing across protocols.
78
+ // Claim the dep so the dispatcher stops; the caller still surfaces a
79
+ // ref-mismatch report if the lockfile shifted to a different commit.
80
+ export async function resolveLatestFromGit(query) {
81
+ const bareSpecifier = query.wantedDependency.bareSpecifier;
82
+ if (!bareSpecifier)
83
+ return undefined;
84
+ const parsedSpecFunc = parseBareSpecifier(bareSpecifier, {});
85
+ if (parsedSpecFunc == null)
86
+ return undefined;
87
+ return {};
88
+ }
76
89
  function resolveVTags(vTags, range) {
77
90
  return semver.maxSatisfying(vTags, range, true);
78
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/resolving.git-resolver",
3
- "version": "1100.0.7",
3
+ "version": "1100.1.0",
4
4
  "description": "Resolver for git-hosted packages",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -29,9 +29,9 @@
29
29
  "graceful-git": "^5.0.0",
30
30
  "hosted-git-info": "npm:@pnpm/hosted-git-info@1.0.0",
31
31
  "semver": "^7.7.2",
32
+ "@pnpm/network.fetch": "1100.0.6",
32
33
  "@pnpm/error": "1100.0.0",
33
- "@pnpm/network.fetch": "1100.0.4",
34
- "@pnpm/resolving.resolver-base": "1100.1.3"
34
+ "@pnpm/resolving.resolver-base": "1100.3.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@jest/globals": "30.3.0",
@@ -39,7 +39,7 @@
39
39
  "@types/is-windows": "^1.0.2",
40
40
  "@types/semver": "7.7.1",
41
41
  "is-windows": "^1.0.2",
42
- "@pnpm/resolving.git-resolver": "1100.0.7"
42
+ "@pnpm/resolving.git-resolver": "1100.1.0"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22.13"