Skip to content
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

remove exclusion of TS 2 options, add lib support #449

Merged
merged 7 commits into from
Mar 22, 2017

Conversation

nicknisi
Copy link
Collaborator

@nicknisi nicknisi commented Mar 15, 2017

  • Remove restriction on what compilerOptions can be set
  • remove filtering of TS 2.2 compilerOptions
  • add support for 'list' option types
  • Switch to processed compilerOptions
  • add support for compilerOptions.lib

This PR removes the restrictions on setting options that aren't explicitly setup as options to allow new compilerOptions to pass through TypeDoc to TypeScript. It also sets up support for 'list' parameter types, and switches to use the processed compilerOptions, rather than raw so that the lib properties are properly parsed.

This should fix #315 and I believe #311.


if (map instanceof Map && map.has(key)) {
value = map.get(key);
} else if (key in map) {
value = map[key];
} else if (errorCallback) {
} else if (!~values.indexOf(value) && errorCallback) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the non-clever format of indexOf, cheers! 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed! Sorry about that!

this.setValues(value, prefix + key + '.', errorCallback);
} else {
this.setValue(prefix + key, value, errorCallback);
this.setValue(prefix + key, value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason behind this signature change?

@@ -51,31 +51,30 @@ export class TSConfigReader extends OptionsComponent {
return;
}

let data = ts.readConfigFile(fileName, ts.sys.readFile).config;
if (data === undefined) {
let { config } = ts.readConfigFile(fileName, ts.sys.readFile);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use const if there's no other mutation?

@blakeembrey
Copy link
Member

Sorry for the delay, I just had a couple of last comments. Once those are reviewed, I'm happy to merge!

* Remove restriction on what compilerOptions can be set
* remove filtering of TS 2.2 compilerOptions
* add support for 'list' option types
* Switch to processed compilerOptions
* add support for `compilerOptions.lib`

This PR removes the restrictions on setting options that aren't explicitly setup as options to allow new compilerOptions
to pass through TypeDoc to TypeScript. It also sets up support for 'list' parameter types, and switches to use the
processed compilerOptions, rather than `raw` so that the `lib` properties are properly parsed.

This should fix TypeStrong#315 and I believe TypeStrong#311.
@nicknisi
Copy link
Collaborator Author

@blakeembrey Thanks! I rebased off the latest master and pushed up two commits to address your comments. Regarding the signature change, I actually modified my approach now that OptionDeclaration#map is a Map. The big thing I changed with this code (and the previous signature change) was that I am trying to let unknown-to-TypeDoc options simply pass through without throwing an error. That way, TypeDoc doesn't need to maintain a whitelist of compilerOptions, and should be more future proof.

Also, I checked in a number of changes to the built files (in a separate commit). These changes aren't related to this work, and appear when running the tests, even on master. I can remove this commit if you like.

@blakeembrey
Copy link
Member

Thanks @nicknisi! ❤️

I'm going to make a minor edit since it looks like you accidentally inserted a tab where there's spaces, then I'll merge 👍

@blakeembrey blakeembrey merged commit 9d720f4 into TypeStrong:master Mar 22, 2017
@blakeembrey
Copy link
Member

Weird. I just pulled this in and tested, but I end up reverting all the .html changes you recently made. Do you have something locally affecting that?

@nicknisi
Copy link
Collaborator Author

Yep, you're totally right... I didn't realize I had the themes repo npm link'd in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeDoc doesn't support the lib option
2 participants