Skip to content

Commit 2da3fed

Browse files
committed
fix: GitHost.fromUrl d.ts
1 parent c0d77d1 commit 2da3fed

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"cosmiconfig": "^9.0.0",
5454
"dayjs": "^1.11.13",
5555
"execa": "^9.5.3",
56-
"hosted-git-info": "^8.1.0",
56+
"hosted-git-info": "^7.0.2",
5757
"inquirer": "9.2.17",
5858
"is-subdir": "^1.2.0",
5959
"log-symbols": "^6.0.0",

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dts/hosted-git-info-patch.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// hosted-git-info-patch.d.ts
2+
import 'hosted-git-info';
3+
4+
declare module 'hosted-git-info' {
5+
export default class GitHost {
6+
static parseUrl(url: string): URL | undefined;
7+
}
8+
}

src/options.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ async function checkRepositoryUrl(opts: ReleaseOptions) {
220220
);
221221
}
222222

223-
const gitUrl: URL = GitHost.fromUrl(repoUrl);
223+
const gitUrl = GitHost.parseUrl(repoUrl);
224+
console.log(gitUrl);
224225
const protocols = ['git+ssh:', 'ssh:', 'git+http:', 'http:', 'git+https:', 'https:', 'git:'];
225-
if (!protocols.includes(gitUrl.protocol)) {
226+
if (!gitUrl || !protocols.includes(gitUrl.protocol)) {
226227
return invalid(`${chalk.red(repoUrl)} is not a valid git url.`);
227228
}
228229

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
},
1515
"include": [
1616
"src/**/*.ts",
17+
"src/**/*.d.ts",
1718
"test/**/*.test.ts"
1819
]
1920
}

0 commit comments

Comments
 (0)