-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fuller test and support for git refs
- Loading branch information
Showing
9 changed files
with
280 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
'git': {}, | ||
'git+http': {'scheme': 'http'}, | ||
'git+https': {'scheme': 'https'}, | ||
'git+ssh': {'scheme': 'https'}, | ||
} | ||
|
||
|
||
|
@@ -33,6 +34,14 @@ def parse_git_source(self, version: str, from_: Optional[str] = None) -> GitSour | |
if not new_url.netloc: | ||
path = new_url.path.split('/') | ||
new_url = new_url._replace(netloc=path[0], path='/'.join(path[1:])) | ||
# Replace https://[email protected]:ianstormtaylor/to-camel-case.git | ||
# wth https://[email protected]/ianstormtaylor/to-camel-case.git | ||
# for git+ssh URLs | ||
if ':' in new_url.netloc: | ||
netloc_split = new_url.netloc.split(':') | ||
new_url = new_url._replace( | ||
netloc=netloc_split[0], path=f'/{netloc_split[1]}{new_url.path}' | ||
) | ||
|
||
return GitSource( | ||
original=original_url.geturl(), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "@flatpak-node-generator-tests/git", | ||
"version": "1.0.0", | ||
"lockfileVersion": 1, | ||
"requires": true, | ||
"dependencies": { | ||
"to-camel-case": { | ||
"version": "git+ssh://[email protected]/ianstormtaylor/to-camel-case.git#00a20429b600ddb6e4f8ff5b17c52914f40fe67d", | ||
"from": "git+ssh://[email protected]/ianstormtaylor/to-camel-case.git", | ||
"requires": { | ||
"to-space-case": "^1.0.0" | ||
} | ||
}, | ||
"to-capital-case": { | ||
"version": "git+https://[email protected]/ianstormtaylor/to-capital-case.git#b82f61e00e099b01514e25177bb2d56d0f64b157", | ||
"from": "git+https://[email protected]/ianstormtaylor/to-capital-case.git", | ||
"requires": { | ||
"to-space-case": "^1.0.0" | ||
} | ||
}, | ||
"to-no-case": { | ||
"version": "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90", | ||
"from": "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90" | ||
}, | ||
"to-space-case": { | ||
"version": "git+ssh://[email protected]/ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640", | ||
"from": "git+ssh://[email protected]/ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640", | ||
"requires": { | ||
"to-no-case": "^1.0.0" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"name": "@flatpak-node-generator-tests/git", | ||
"version": "1.0.0", | ||
"lockfileVersion": 2, | ||
"requires": true, | ||
"packages": { | ||
"": { | ||
"name": "@flatpak-node-generator-tests/git", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"to-camel-case": "git+ssh://[email protected]:ianstormtaylor/to-camel-case.git", | ||
"to-capital-case": "git+https://[email protected]/ianstormtaylor/to-capital-case.git", | ||
"to-no-case": "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90", | ||
"to-space-case": "git+ssh://[email protected]:ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640" | ||
} | ||
}, | ||
"node_modules/to-camel-case": { | ||
"version": "1.0.0", | ||
"resolved": "git+ssh://[email protected]/ianstormtaylor/to-camel-case.git#00a20429b600ddb6e4f8ff5b17c52914f40fe67d", | ||
"license": "MIT", | ||
"dependencies": { | ||
"to-space-case": "^1.0.0" | ||
} | ||
}, | ||
"node_modules/to-capital-case": { | ||
"version": "1.0.0", | ||
"resolved": "git+https://[email protected]/ianstormtaylor/to-capital-case.git#b82f61e00e099b01514e25177bb2d56d0f64b157", | ||
"license": "MIT", | ||
"dependencies": { | ||
"to-space-case": "^1.0.0" | ||
} | ||
}, | ||
"node_modules/to-no-case": { | ||
"version": "1.0.0", | ||
"resolved": "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90", | ||
"integrity": "sha512-E6uMYyFvmgQWszuxWtCz0NN+BgdVvQjVCU6Nnq0BSxi8q/QKRCBs14pGUWbPQghmpjJbdkKgjICDWihePrJGOQ==", | ||
"license": "MIT" | ||
}, | ||
"node_modules/to-space-case": { | ||
"version": "1.0.0", | ||
"resolved": "git+ssh://[email protected]/ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640", | ||
"integrity": "sha512-i7ZtWv1WzR6xrLpd5wpSU/RZxoEDaoD3uLU5pDgXEZfUZJh0QpPtjJdLf7i+nr24Z80ls8qYCfBeFpZk6RzXKQ==", | ||
"license": "MIT", | ||
"dependencies": { | ||
"to-no-case": "^1.0.0" | ||
} | ||
} | ||
}, | ||
"dependencies": { | ||
"to-camel-case": { | ||
"version": "git+ssh://[email protected]/ianstormtaylor/to-camel-case.git#00a20429b600ddb6e4f8ff5b17c52914f40fe67d", | ||
"from": "to-camel-case@git+ssh://[email protected]:ianstormtaylor/to-camel-case.git", | ||
"requires": { | ||
"to-space-case": "^1.0.0" | ||
} | ||
}, | ||
"to-capital-case": { | ||
"version": "git+https://[email protected]/ianstormtaylor/to-capital-case.git#b82f61e00e099b01514e25177bb2d56d0f64b157", | ||
"from": "to-capital-case@git+https://[email protected]/ianstormtaylor/to-capital-case.git", | ||
"requires": { | ||
"to-space-case": "^1.0.0" | ||
} | ||
}, | ||
"to-no-case": { | ||
"version": "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90", | ||
"integrity": "sha512-E6uMYyFvmgQWszuxWtCz0NN+BgdVvQjVCU6Nnq0BSxi8q/QKRCBs14pGUWbPQghmpjJbdkKgjICDWihePrJGOQ==", | ||
"from": "to-no-case@git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90" | ||
}, | ||
"to-space-case": { | ||
"version": "git+ssh://[email protected]/ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640", | ||
"integrity": "sha512-i7ZtWv1WzR6xrLpd5wpSU/RZxoEDaoD3uLU5pDgXEZfUZJh0QpPtjJdLf7i+nr24Z80ls8qYCfBeFpZk6RzXKQ==", | ||
"from": "to-space-case@git+ssh://[email protected]:ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640", | ||
"requires": { | ||
"to-no-case": "^1.0.0" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "@flatpak-node-generator-tests/git", | ||
"version": "1.0.0", | ||
"lockfileVersion": 3, | ||
"requires": true, | ||
"packages": { | ||
"": { | ||
"name": "@flatpak-node-generator-tests/git", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"to-camel-case": "git+ssh://[email protected]:ianstormtaylor/to-camel-case.git", | ||
"to-capital-case": "git+https://[email protected]/ianstormtaylor/to-capital-case.git", | ||
"to-no-case": "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90", | ||
"to-space-case": "git+ssh://[email protected]:ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640" | ||
} | ||
}, | ||
"node_modules/to-camel-case": { | ||
"version": "1.0.0", | ||
"resolved": "git+ssh://[email protected]/ianstormtaylor/to-camel-case.git#00a20429b600ddb6e4f8ff5b17c52914f40fe67d", | ||
"license": "MIT", | ||
"dependencies": { | ||
"to-space-case": "^1.0.0" | ||
} | ||
}, | ||
"node_modules/to-capital-case": { | ||
"version": "1.0.0", | ||
"resolved": "git+https://[email protected]/ianstormtaylor/to-capital-case.git#b82f61e00e099b01514e25177bb2d56d0f64b157", | ||
"license": "MIT", | ||
"dependencies": { | ||
"to-space-case": "^1.0.0" | ||
} | ||
}, | ||
"node_modules/to-no-case": { | ||
"version": "1.0.0", | ||
"resolved": "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90", | ||
"integrity": "sha512-E6uMYyFvmgQWszuxWtCz0NN+BgdVvQjVCU6Nnq0BSxi8q/QKRCBs14pGUWbPQghmpjJbdkKgjICDWihePrJGOQ==", | ||
"license": "MIT" | ||
}, | ||
"node_modules/to-space-case": { | ||
"version": "1.0.0", | ||
"resolved": "git+ssh://[email protected]/ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640", | ||
"integrity": "sha512-i7ZtWv1WzR6xrLpd5wpSU/RZxoEDaoD3uLU5pDgXEZfUZJh0QpPtjJdLf7i+nr24Z80ls8qYCfBeFpZk6RzXKQ==", | ||
"license": "MIT", | ||
"dependencies": { | ||
"to-no-case": "^1.0.0" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "@flatpak-node-generator-tests/git", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"to-camel-case": "git+ssh://[email protected]:ianstormtaylor/to-camel-case.git", | ||
"to-capital-case": "git+https://[email protected]/ianstormtaylor/to-capital-case.git", | ||
"to-no-case": "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90", | ||
"to-space-case": "git+ssh://[email protected]:ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"to-camel-case@git+ssh://[email protected]:ianstormtaylor/to-camel-case.git": | ||
version "1.0.0" | ||
resolved "git+ssh://[email protected]:ianstormtaylor/to-camel-case.git#00a20429b600ddb6e4f8ff5b17c52914f40fe67d" | ||
dependencies: | ||
to-space-case "^1.0.0" | ||
|
||
"to-capital-case@git+https://[email protected]/ianstormtaylor/to-capital-case.git": | ||
version "1.0.0" | ||
resolved "git+https://[email protected]/ianstormtaylor/to-capital-case.git#b82f61e00e099b01514e25177bb2d56d0f64b157" | ||
dependencies: | ||
to-space-case "^1.0.0" | ||
|
||
to-no-case@^1.0.0: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/to-no-case/-/to-no-case-1.0.2.tgz#c722907164ef6b178132c8e69930212d1b4aa16a" | ||
integrity sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg== | ||
|
||
"to-no-case@git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90": | ||
version "1.0.0" | ||
resolved "git+https://[email protected]/ianstormtaylor/to-no-case.git#9078578dcf394e63f34fd7c6666772192e537b90" | ||
|
||
to-space-case@^1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/to-space-case/-/to-space-case-1.0.0.tgz#b052daafb1b2b29dc770cea0163e5ec0ebc9fc17" | ||
integrity sha512-rLdvwXZ39VOn1IxGL3V6ZstoTbwLRckQmn/U8ZDLuWwIXNpuZDhQ3AiRUlhTbOXFVE9C+dR51wM0CBDhk31VcA== | ||
dependencies: | ||
to-no-case "^1.0.0" | ||
|
||
"to-space-case@git+ssh://[email protected]:ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640": | ||
version "1.0.0" | ||
resolved "git+ssh://[email protected]:ianstormtaylor/to-space-case.git#aa68213d1211745ce7c6c725ba072e6b13bef640" | ||
dependencies: | ||
to-no-case "^1.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
}, | ||
"node_modules/nop": { | ||
"version": "1.0.0", | ||
"resolved": "git+ssh://[email protected]/supershabam/nop.git#f110e75f62cfe3bf4468ac3b74e3dc72ab9ae4bf", | ||
"resolved": "git+https://[email protected]/supershabam/nop.git#f110e75f62cfe3bf4468ac3b74e3dc72ab9ae4bf", | ||
"integrity": "sha512-xCwdA7C4QIORvTMytKHMlkEN6axJGimR0gv5vgjKpEKRvQrPOwhjJnrZEcd5g0LP+7IY38+TY7MP59HRY6gcwA==", | ||
"license": "MIT" | ||
} | ||
|
Oops, something went wrong.