File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 76
76
"ts-jest" : " ^27.0.5" ,
77
77
"ts-node" : " ^10.2.1" ,
78
78
"typedoc" : " ^0.22.1" ,
79
- "typedoc-plugin-sourcefile-url" : " ^1.0.6" ,
80
79
"typescript" : " ^4.4.3"
81
80
},
82
81
"peerDependencies" : {
Original file line number Diff line number Diff line change 1
1
import { execSync } from "child_process" ;
2
2
import { repository } from "../package.json" ;
3
3
4
+ const loggedExecSync = ( command : string ) : void => {
5
+ console . log ( command ) ;
6
+ execSync ( command , { stdio : "inherit" } ) ;
7
+ } ;
8
+
4
9
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 } ` ) ;
8
18
}
9
19
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
+ }
Original file line number Diff line number Diff line change @@ -8002,11 +8002,6 @@ typedarray@^0.0.6:
8002
8002
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
8003
8003
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
8004
8004
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
-
8010
8005
typedoc@^0.22.1 :
8011
8006
version "0.22.1"
8012
8007
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.1.tgz#2919ed9d6bd3857dea7575d38bad907a9ba6ba68"
You can’t perform that action at this time.
0 commit comments