File tree 2 files changed +11
-5
lines changed
src/lib/converter/plugins
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 8
8
9
9
### Bug Fixes
10
10
11
- - TypeDoc will now warn if a project name/version cannot be inferred from a package.json file, #1907 .
11
+ - TypeDoc will now warn if a project name/version cannot be inferred from a package.json file rather than using ` undefined ` , #1907 .
12
12
13
13
### Thanks!
14
14
15
15
- @ejuda
16
- - @schlusslicht
17
16
- @matteobruni
17
+ - @schlusslicht
18
18
19
19
## v0.22.14 (2022-04-07)
20
20
Original file line number Diff line number Diff line change @@ -106,20 +106,26 @@ export class PackagePlugin extends ConverterComponent {
106
106
if ( ! project . name ) {
107
107
if ( ! project . packageInfo . name ) {
108
108
context . logger . warn (
109
- 'The --name option was not specified, and package.json does not have a name field. Defaulting project name to "Documentation"'
109
+ 'The --name option was not specified, and package.json does not have a name field. Defaulting project name to "Documentation". '
110
110
) ;
111
111
project . name = "Documentation" ;
112
112
} else {
113
113
project . name = String ( project . packageInfo . name ) ;
114
114
}
115
115
}
116
116
if ( this . includeVersion ) {
117
- project . name = `${ project . name } - v${ project . packageInfo . version } ` ;
117
+ if ( project . packageInfo . version ) {
118
+ project . name = `${ project . name } - v${ project . packageInfo . version } ` ;
119
+ } else {
120
+ context . logger . warn (
121
+ "--includeVersion was specified, but package.json does not specify a version."
122
+ ) ;
123
+ }
118
124
}
119
125
} else {
120
126
if ( ! project . name ) {
121
127
context . logger . warn (
122
- 'The --name option was not specified, and no package.json was found. Defaulting project name to "Documentation"'
128
+ 'The --name option was not specified, and no package.json was found. Defaulting project name to "Documentation". '
123
129
) ;
124
130
project . name = "Documentation" ;
125
131
}
You can’t perform that action at this time.
0 commit comments