@pnpm/resolving.git-resolver 1100.1.13 → 1100.1.14
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/CHANGELOG.md +10 -0
- package/lib/index.js +2 -2
- package/lib/lsRemote.d.ts +10 -0
- package/lib/lsRemote.js +15 -0
- package/lib/parseBareSpecifier.js +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @pnpm/git-resolver
|
|
2
2
|
|
|
3
|
+
## 1100.1.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `pnpm outdated --include-github-actions` no longer blocks on an interactive git credential prompt when a workflow uses a private action repo.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @pnpm/network.fetch@1100.1.10
|
|
11
|
+
- @pnpm/resolving.resolver-base@1101.0.0
|
|
12
|
+
|
|
3
13
|
## 1100.1.13
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PnpmError } from '@pnpm/error';
|
|
2
|
-
import { gracefulGit as git } from 'graceful-git';
|
|
3
2
|
import semver from 'semver';
|
|
4
3
|
import { createGitHostedPkgId } from './createGitHostedPkgId.js';
|
|
4
|
+
import { lsRemote } from './lsRemote.js';
|
|
5
5
|
import { parseBareSpecifier } from './parseBareSpecifier.js';
|
|
6
6
|
export { createGitHostedPkgId };
|
|
7
7
|
export function createGitResolver(opts) {
|
|
@@ -100,7 +100,7 @@ export async function getRepoRefs(repo, ref) {
|
|
|
100
100
|
gitArgs.push(`${ref}^{}`);
|
|
101
101
|
}
|
|
102
102
|
// graceful-git by default retries 10 times, reduce to single retry
|
|
103
|
-
const result = await
|
|
103
|
+
const result = await lsRemote(gitArgs, { retries: 1 });
|
|
104
104
|
const refs = {};
|
|
105
105
|
for (const line of result.stdout.split('\n')) {
|
|
106
106
|
const [commit, refName] = line.split('\t');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `git ls-remote` with interactive credential prompts disabled, so it
|
|
3
|
+
* fails fast on private repos instead of blocking on user input. All
|
|
4
|
+
* ls-remote invocations must go through this function to keep that guarantee.
|
|
5
|
+
*/
|
|
6
|
+
export declare function lsRemote(args: string[], opts: {
|
|
7
|
+
retries: number;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
stdout: string;
|
|
10
|
+
}>;
|
package/lib/lsRemote.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { gracefulGit as git } from 'graceful-git';
|
|
2
|
+
/**
|
|
3
|
+
* Runs `git ls-remote` with interactive credential prompts disabled, so it
|
|
4
|
+
* fails fast on private repos instead of blocking on user input. All
|
|
5
|
+
* ls-remote invocations must go through this function to keep that guarantee.
|
|
6
|
+
*/
|
|
7
|
+
export async function lsRemote(args, opts) {
|
|
8
|
+
return git(['ls-remote', ...args], {
|
|
9
|
+
retries: opts.retries,
|
|
10
|
+
// Snapshotted per call so changes to auth/proxy env vars made by a
|
|
11
|
+
// long-lived host process are picked up.
|
|
12
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=lsRemote.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// cspell:ignore sshurl
|
|
2
2
|
import urlLib, { URL } from 'node:url';
|
|
3
3
|
import { fetchWithDispatcher } from '@pnpm/network.fetch';
|
|
4
|
-
import { gracefulGit as git } from 'graceful-git';
|
|
5
4
|
import HostedGit from 'hosted-git-info';
|
|
5
|
+
import { lsRemote } from './lsRemote.js';
|
|
6
6
|
const gitProtocols = new Set([
|
|
7
7
|
'git',
|
|
8
8
|
'git+http',
|
|
@@ -127,7 +127,7 @@ async function isRepoPublic(httpsUrl, dispatcherOptions) {
|
|
|
127
127
|
}
|
|
128
128
|
async function accessRepository(repository) {
|
|
129
129
|
try {
|
|
130
|
-
await
|
|
130
|
+
await lsRemote(['--exit-code', repository, 'HEAD'], { retries: 0 });
|
|
131
131
|
return true;
|
|
132
132
|
}
|
|
133
133
|
catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/resolving.git-resolver",
|
|
3
|
-
"version": "1100.1.
|
|
3
|
+
"version": "1100.1.14",
|
|
4
4
|
"description": "Resolver for git-hosted packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@pnpm/error": "1100.1.0",
|
|
33
|
-
"@pnpm/network.fetch": "1100.1.
|
|
34
|
-
"@pnpm/resolving.resolver-base": "
|
|
33
|
+
"@pnpm/network.fetch": "1100.1.10",
|
|
34
|
+
"@pnpm/resolving.resolver-base": "1101.0.0",
|
|
35
35
|
"graceful-git": "^5.0.0",
|
|
36
36
|
"hosted-git-info": "npm:@pnpm/hosted-git-info@1.0.0",
|
|
37
37
|
"semver": "^7.8.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@jest/globals": "30.4.1",
|
|
41
|
-
"@pnpm/resolving.git-resolver": "1100.1.
|
|
41
|
+
"@pnpm/resolving.git-resolver": "1100.1.14",
|
|
42
42
|
"@types/hosted-git-info": "^3.0.5",
|
|
43
43
|
"@types/is-windows": "^1.0.2",
|
|
44
44
|
"@types/semver": "7.7.1",
|