@pnpm/resolving.git-resolver 1100.1.2 → 1100.1.4
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/createGitHostedPkgId.js +12 -1
- package/package.json +8 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export function createGitHostedPkgId({ repo, commit, path }) {
|
|
2
|
-
|
|
2
|
+
const normalizedRepo = normalizeGitRepoForPkgResolutionId(repo);
|
|
3
|
+
let id = `${normalizedRepo.includes('://') ? '' : 'https://'}${normalizedRepo}#${commit}`;
|
|
3
4
|
if (!id.startsWith('git+'))
|
|
4
5
|
id = `git+${id}`;
|
|
5
6
|
if (path) {
|
|
@@ -7,4 +8,14 @@ export function createGitHostedPkgId({ repo, commit, path }) {
|
|
|
7
8
|
}
|
|
8
9
|
return id;
|
|
9
10
|
}
|
|
11
|
+
function normalizeGitRepoForPkgResolutionId(repo) {
|
|
12
|
+
// Only scp-style shorthand (`user@host:path`) needs rewriting. A repo that
|
|
13
|
+
// already carries a URL scheme (e.g. `ssh://user@host:2222/path`) is left
|
|
14
|
+
// alone — its `@host:port` would otherwise match the scp pattern and get
|
|
15
|
+
// mangled into `ssh://ssh://…`.
|
|
16
|
+
if (repo.includes('://'))
|
|
17
|
+
return repo;
|
|
18
|
+
const scp = /^([^@\s]+@[^:\s]+):(.+)$/.exec(repo);
|
|
19
|
+
return scp == null ? repo : `ssh://${scp[1]}/${scp[2]}`;
|
|
20
|
+
}
|
|
10
21
|
//# sourceMappingURL=createGitHostedPkgId.js.map
|
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.4",
|
|
4
4
|
"description": "Resolver for git-hosted packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"funding": "https://opencollective.com/pnpm",
|
|
13
|
-
"repository":
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/pnpm/pnpm/tree/main/resolving/git-resolver"
|
|
16
|
+
},
|
|
14
17
|
"homepage": "https://github.com/pnpm/pnpm/tree/main/resolving/git-resolver#readme",
|
|
15
18
|
"bugs": {
|
|
16
19
|
"url": "https://github.com/pnpm/pnpm/issues"
|
|
@@ -30,8 +33,8 @@
|
|
|
30
33
|
"hosted-git-info": "npm:@pnpm/hosted-git-info@1.0.0",
|
|
31
34
|
"semver": "^7.8.1",
|
|
32
35
|
"@pnpm/error": "1100.0.0",
|
|
33
|
-
"@pnpm/
|
|
34
|
-
"@pnpm/
|
|
36
|
+
"@pnpm/network.fetch": "1100.1.1",
|
|
37
|
+
"@pnpm/resolving.resolver-base": "1100.4.1"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@jest/globals": "30.3.0",
|
|
@@ -39,7 +42,7 @@
|
|
|
39
42
|
"@types/is-windows": "^1.0.2",
|
|
40
43
|
"@types/semver": "7.7.1",
|
|
41
44
|
"is-windows": "^1.0.2",
|
|
42
|
-
"@pnpm/resolving.git-resolver": "1100.1.
|
|
45
|
+
"@pnpm/resolving.git-resolver": "1100.1.4"
|
|
43
46
|
},
|
|
44
47
|
"engines": {
|
|
45
48
|
"node": ">=22.13"
|