-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix loading options twice in bootstrap to keep 'extends'. #1273
Conversation
This will break wrappers around TypeDoc. Both the Grunt and Gulp wrappers around TypeDoc use the option passing in bootstrap to let users specify config files or options directly. A better solution would be to clone the options object before mutating it. |
@Gerrit0 Thanks for the tip. Please review the new changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing
@@ -21,6 +21,11 @@ export function addTypeDocOptions(options: Options) { | |||
type: ParameterType.Array | |||
}); | |||
|
|||
options.addDeclaration({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implies that users can specify --extends
on the command line, or in typedocOptions in tsconfig.json, which isn't true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to just remove it, I still need to update the website docs to mention this, but it shouldn't show up in --help.
logger.error(`The file ${file} is not an object.`); | ||
return; | ||
} | ||
|
||
// clone option object to avoid of property changes in re-calling this file | ||
const data: object = cloneDeep(fileContent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks! Should have a release out this weekend. |
Fix #1272
Every time we open the option files and after reading the value of extends in each one, this property is removed from that file, so the next time the value of extends is no longer available to us (according to this code logics).
Therefore, reading the options file more than once will cause #1272 issue.