Skip to content

Commit 656f11f

Browse files
committed
trying to fix typedoc
1 parent 1c4f673 commit 656f11f

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"ts-jest": "^27.0.5",
7777
"ts-node": "^10.2.1",
7878
"typedoc": "^0.22.1",
79-
"typedoc-plugin-sourcefile-url": "^1.0.6",
8079
"typescript": "^4.4.3"
8180
},
8281
"peerDependencies": {

scripts/typedoc.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
import { execSync } from "child_process";
22
import { repository } from "../package.json";
33

4+
const loggedExecSync = (command: string): void => {
5+
console.log(command);
6+
execSync(command, { stdio: "inherit" });
7+
};
8+
49
const commitSha = process.env.VERCEL_GIT_COMMIT_SHA;
5-
let command = "typedoc";
6-
if (commitSha) {
7-
command = `${command} --sourcefile-url-prefix "${repository}/blob/${commitSha}/"`;
10+
const isNoRemote = execSync("git remote -v").toString().trim().length === 0;
11+
12+
if (commitSha && isNoRemote) {
13+
console.log(
14+
"A git remote could not be found. Manually setting it to the repositor field in the `package.json`."
15+
);
16+
17+
loggedExecSync(`git remote add origin ${repository}`);
818
}
919

10-
console.log(command);
11-
execSync(command, { stdio: "inherit" });
20+
loggedExecSync("typedoc");
21+
22+
if (commitSha && isNoRemote) {
23+
loggedExecSync("git remote remove origin");
24+
console.log("Removed the manually set origin.");
25+
}

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8002,11 +8002,6 @@ typedarray@^0.0.6:
80028002
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
80038003
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
80048004

8005-
typedoc-plugin-sourcefile-url@^1.0.6:
8006-
version "1.0.6"
8007-
resolved "https://registry.yarnpkg.com/typedoc-plugin-sourcefile-url/-/typedoc-plugin-sourcefile-url-1.0.6.tgz#e0199806616fe6370b3cb7889f647df698438b96"
8008-
integrity sha512-xHq9DzkoQywS7FyPneMm2/Hr9GRoCpjSQXkVN0W6SCJKP7fguqg2tasgh+8l5/mW6YSYvqCqEbkSYLbuD4Y6gA==
8009-
80108005
typedoc@^0.22.1:
80118006
version "0.22.1"
80128007
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.1.tgz#2919ed9d6bd3857dea7575d38bad907a9ba6ba68"

0 commit comments

Comments
 (0)