@pnpm/resolving.git-resolver 1001.1.5 → 1100.0.1

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,4 +1,4 @@
1
- import type { AgentOptions } from '@pnpm/network.agent';
1
+ import type { DispatcherOptions } from '@pnpm/network.fetch';
2
2
  import type { GitResolution, ResolveOptions, ResolveResult, TarballResolution } from '@pnpm/resolving.resolver-base';
3
3
  import { createGitHostedPkgId } from './createGitHostedPkgId.js';
4
4
  import { type HostedPackageSpec } from './parseBareSpecifier.js';
@@ -12,4 +12,4 @@ export interface GitResolveResult extends ResolveResult {
12
12
  export type GitResolver = (wantedDependency: {
13
13
  bareSpecifier: string;
14
14
  }, opts?: Pick<ResolveOptions, 'currentPkg' | 'update'>) => Promise<GitResolveResult | null>;
15
- export declare function createGitResolver(opts: AgentOptions): GitResolver;
15
+ export declare function createGitResolver(opts: DispatcherOptions): GitResolver;
@@ -1,4 +1,4 @@
1
- import type { AgentOptions } from '@pnpm/network.agent';
1
+ import { type DispatcherOptions } from '@pnpm/network.fetch';
2
2
  export interface HostedPackageSpec {
3
3
  fetchSpec: string;
4
4
  hosted?: {
@@ -13,4 +13,4 @@ export interface HostedPackageSpec {
13
13
  gitRange?: string;
14
14
  path?: string;
15
15
  }
16
- export declare function parseBareSpecifier(bareSpecifier: string, opts: AgentOptions): null | (() => Promise<HostedPackageSpec>);
16
+ export declare function parseBareSpecifier(bareSpecifier: string, opts: DispatcherOptions): null | (() => Promise<HostedPackageSpec>);
@@ -1,6 +1,6 @@
1
1
  // cspell:ignore sshurl
2
2
  import urlLib, { URL } from 'node:url';
3
- import { fetchWithAgent } from '@pnpm/network.fetch';
3
+ import { fetchWithDispatcher } from '@pnpm/network.fetch';
4
4
  import { gracefulGit as git } from 'graceful-git';
5
5
  import HostedGit from 'hosted-git-info';
6
6
  const gitProtocols = new Set([
@@ -47,11 +47,11 @@ function urlToFetchSpec(url) {
47
47
  }
48
48
  return fetchSpec;
49
49
  }
50
- async function fromHostedGit(hosted, agentOptions) {
50
+ async function fromHostedGit(hosted, dispatcherOptions) {
51
51
  let fetchSpec = null;
52
52
  // try git/https url before fallback to ssh url
53
53
  const gitHttpsUrl = hosted.https({ noCommittish: true, noGitPlus: true });
54
- if (gitHttpsUrl && await isRepoPublic(gitHttpsUrl, agentOptions) && await accessRepository(gitHttpsUrl)) {
54
+ if (gitHttpsUrl && await isRepoPublic(gitHttpsUrl, dispatcherOptions) && await accessRepository(gitHttpsUrl)) {
55
55
  fetchSpec = gitHttpsUrl;
56
56
  }
57
57
  else {
@@ -63,7 +63,7 @@ async function fromHostedGit(hosted, agentOptions) {
63
63
  if (!fetchSpec) {
64
64
  const httpsUrl = hosted.https({ noGitPlus: true, noCommittish: true });
65
65
  if (httpsUrl) {
66
- if ((hosted.auth || !await isRepoPublic(httpsUrl, agentOptions)) && await accessRepository(httpsUrl)) {
66
+ if ((hosted.auth || !await isRepoPublic(httpsUrl, dispatcherOptions)) && await accessRepository(httpsUrl)) {
67
67
  return {
68
68
  fetchSpec: httpsUrl,
69
69
  hosted: {
@@ -82,7 +82,7 @@ async function fromHostedGit(hosted, agentOptions) {
82
82
  // this is very similar to yarn classic's behavior.
83
83
  // npm instead tries git ls-remote directly which prompts user for login credentials.
84
84
  // HTTP HEAD on https://domain/user/repo, strip out ".git"
85
- const response = await fetchWithAgent(httpsUrl.replace(/\.git$/, ''), { method: 'HEAD', follow: 0, retry: { retries: 0 }, agentOptions });
85
+ const response = await fetchWithDispatcher(httpsUrl.replace(/\.git$/, ''), { method: 'HEAD', redirect: 'manual', retry: { retries: 0 }, dispatcherOptions });
86
86
  if (response.ok) {
87
87
  fetchSpec = httpsUrl;
88
88
  }
@@ -108,9 +108,9 @@ async function fromHostedGit(hosted, agentOptions) {
108
108
  ...parseGitParams(hosted.committish),
109
109
  };
110
110
  }
111
- async function isRepoPublic(httpsUrl, agentOptions) {
111
+ async function isRepoPublic(httpsUrl, dispatcherOptions) {
112
112
  try {
113
- const response = await fetchWithAgent(httpsUrl.replace(/\.git$/, ''), { method: 'HEAD', follow: 0, retry: { retries: 0 }, agentOptions });
113
+ const response = await fetchWithDispatcher(httpsUrl.replace(/\.git$/, ''), { method: 'HEAD', redirect: 'manual', retry: { retries: 0 }, dispatcherOptions });
114
114
  return response.ok;
115
115
  }
116
116
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/resolving.git-resolver",
3
- "version": "1001.1.5",
3
+ "version": "1100.0.1",
4
4
  "description": "Resolver for git-hosted packages",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -29,18 +29,17 @@
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/error": "1000.0.5",
33
- "@pnpm/resolving.resolver-base": "1005.1.0",
34
- "@pnpm/network.fetch": "1000.2.6"
32
+ "@pnpm/error": "1100.0.0",
33
+ "@pnpm/network.fetch": "1100.0.1",
34
+ "@pnpm/resolving.resolver-base": "1100.0.1"
35
35
  },
36
36
  "devDependencies": {
37
- "@jest/globals": "30.0.5",
38
- "@pnpm/network.agent": "^2.0.3",
37
+ "@jest/globals": "30.3.0",
39
38
  "@types/hosted-git-info": "^3.0.5",
40
39
  "@types/is-windows": "^1.0.2",
41
40
  "@types/semver": "7.7.1",
42
41
  "is-windows": "^1.0.2",
43
- "@pnpm/resolving.git-resolver": "1001.1.5"
42
+ "@pnpm/resolving.git-resolver": "1100.0.1"
44
43
  },
45
44
  "engines": {
46
45
  "node": ">=22.13"
@@ -50,9 +49,9 @@
50
49
  },
51
50
  "scripts": {
52
51
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
53
- "_test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest",
54
- "test": "pnpm run compile && pnpm run _test",
52
+ "test": "pn compile && pn .test",
55
53
  "fix": "tslint -c tslint.json src/**/*.ts test/**/*.ts --fix",
56
- "compile": "tsgo --build && pnpm run lint --fix"
54
+ "compile": "tsgo --build && pn lint --fix",
55
+ ".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
57
56
  }
58
57
  }