-
-
Notifications
You must be signed in to change notification settings - Fork 736
TypeDoc doesn't support the lib option #315
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
Comments
@aciccarello Any ETA on a fixing release? I cannot run typedoc anymore on TS 2.0 |
@unsafecode As far as I know no one is working on it. There is no active maintainer of this project so fixes/features are entirely community driven. |
It seems the fix has been merged but there is no new release. I tried to install from master branch to get it:
Installing works but running does not:
|
Since typedoc 0.5.1 the "lib" option is silently ignored and typedoc now complains about the missing type definitions. I found a simple but ugly workaround (No pull request for this) to fix this (At least for me). Insert these lines into var path = require("path");
var tsconfigPath = path.resolve(process.cwd(), "tsconfig.json");
var tsconfig = require(tsconfigPath);
if (tsconfig.compilerOptions && tsconfig.compilerOptions.lib) {
tsconfig.compilerOptions.lib.forEach(function(lib) {
process.argv.push("node_modules/typescript/lib/lib." + lib + ".d.ts");
});
} As I said this is just an ugly "works for me" workaround and I just mention it in case it is useful for someone else waiting for a real fix for this issue. |
Does anyone know if this was fixed in #359? |
Any update on this one ??? lib is not taken in account yet, why this is not assigned to anyone? |
You can also manually include the lib files in your include section of your typescript config file. A less hackier version than modifying the binary.
|
* 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.
* 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.
* 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.
Thanks. I will try it later.
Yohei Onishi
2017-03-22 12:37 GMT+09:00 Blake Embrey <[email protected]>:
… Closed #315 <#315> via #449
<#449>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#315 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAY5A8mqncTbpcxVebrcrnuiMpwpzx4uks5roJeXgaJpZM4KeKRP>
.
|
@blakeembrey , @nicknisi -- Is the lib option (specifically) supported via any command line args? Gulp-typedoc is basically a passthrough for command line options, and while I'm using lib in my tsconfig, I'm not sure if I can pipe that into that plugin anymore. |
@brphelps It's not specifically supported via the command line currently, but it is something that should probably be supported. When set via command line args, it does pass through to TypeScript, but it doesn't get the conversion to the correct filename. Currently, |
FYI, this seems to work for my project, not sure if it is universal or not: |
When using A workaround for this issue is to use the full declaration file name (e.g. |
Passing TS options (like lib) through the command line should not be required in the vast majority of cases. We support reading a tsconfig.json file, which is where TS options should really be set. I'm not worried about requiring the full declaration file name on the command line. In the 100 or so projects that I've looked at that use TypeDoc, none pass lib options through the CLI. I don't think the extra complexity in the option parsing code to handle shorthand names is worth it. |
I use the new
lib
option intsconfig.json
to explicitly set the built-in type definitions I want to use in my project:Unfortunately typedoc doesn't support this:
For now I reverted back to using external type definitions for the needed ES2015 features so I'm able to use TypeDoc but it would be nice if TypeDoc could support this useful new feature.
The text was updated successfully, but these errors were encountered: