Skip to content

Update to latest Typescript version #654

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
"node": ">= 4.2.0"
},
"dependencies": {
"@types/fs-extra": "4.0.0",
"@types/handlebars": "4.0.31",
"@types/highlight.js": "9.1.8",
"@types/lodash": "4.14.74",
"@types/fs-extra": "4.0.5",
"@types/handlebars": "4.0.36",
"@types/highlight.js": "9.12.2",
"@types/lodash": "4.14.87",
"@types/marked": "0.3.0",
"@types/minimatch": "2.0.29",
"@types/shelljs": "0.7.0",
"@types/minimatch": "3.0.1",
"@types/shelljs": "0.7.6",
"fs-extra": "^4.0.0",
"handlebars": "^4.0.6",
"highlight.js": "^9.0.0",
Expand All @@ -46,7 +46,7 @@
"progress": "^2.0.0",
"shelljs": "^0.7.0",
"typedoc-default-themes": "^0.5.0",
"typescript": "2.5.3"
"typescript": "2.6.2"
},
"devDependencies": {
"@types/mocha": "^2.2.39",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/converter/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ConverterResult {
/**
* An array containing all errors generated by the TypeScript compiler.
*/
errors: ts.Diagnostic[];
errors: ReadonlyArray<ts.Diagnostic>;

/**
* The resulting project reflection.
Expand Down Expand Up @@ -344,7 +344,7 @@ export class Converter extends ChildableComponent<Application, ConverterComponen
* @param context The context object describing the current state the converter is in.
* @returns An array containing all errors generated by the TypeScript compiler.
*/
private compile(context: Context): ts.Diagnostic[] {
private compile(context: Context): ReadonlyArray<ts.Diagnostic> {
const program = context.program;

program.getSourceFiles().forEach((sourceFile) => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/loggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class Logger {
*
* @param diagnostics The TypeScript messages that should be logged.
*/
public diagnostics(diagnostics: ts.Diagnostic[]) {
public diagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>) {
diagnostics.forEach((diagnostic) => {
this.diagnostic(diagnostic);
});
Expand Down
18 changes: 0 additions & 18 deletions src/lib/utils/options/sources/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@ export class ComponentSource extends OptionsComponent {
}
}
}

private removeComponent(component: AbstractComponent<any>) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was this method removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was breaking the build as it was defined, but never used: from #641:

src/lib/utils/options/sources/component.ts(37,13): error TS6133: 'removeComponent' is declared but its value is never read.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I see. I probably should review this class to ensure that there is not an implementation bug here before I merge the PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like removeComponent should have been called in onComponentRemoved. I probably should put together a separate PR and do some testing. Looks like the minimal theme triggers removing components.

renderer.removeComponent('assets');
renderer.removeComponent('javascriptIndex');
renderer.removeComponent('navigation');
renderer.removeComponent('toc');

There also looks to be some bugs in removeComponent (i.e. slice on this array will do nothing).

if (index !== -1) {
this.knownComponents.slice(index, 1);
for (let declaration of component.getOptionDeclarations()) {

const name = component.componentName;
let index = this.knownComponents.indexOf(name);
if (index !== -1) {
this.knownComponents.slice(index, 1);
for (let declaration of component.getOptionDeclarations()) {
this.owner.removeDeclarationByName(declaration.name);
}
}

if (component instanceof ChildableComponent) {
for (let child of component.getComponents()) {
this.removeComponent(child);
}
}
}

private onComponentAdded(e: ComponentEvent) {
this.addComponent(e.component);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h1>Class DefaultExportedClass</h1>
<div class="lead">
<p>This class is exported via es6 export syntax.</p>
</div>
<pre><code><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DefaultExportedClass</span></span>
<pre><code><span class="hljs-builtin-name">export</span><span class="hljs-built_in"> default </span>class DefaultExportedClass
</code></pre>
</div>
</section>
Expand Down
2 changes: 2 additions & 0 deletions src/test/renderer/specs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ <h2 id="plugins">Plugins</h2>
<ul>
<li><a href="https://github.com/christopherthielen/typedoc-plugin-external-module-name">External Module Name</a> - Set the name of TypeDoc external modules</li>
<li><a href="https://github.com/gdelmas/typedoc-plugin-sourcefile-url">Sourcefile URL</a> - Set custom source file URL links</li>
<li><a href="https://github.com/christopherthielen/typedoc-plugin-internal-external">Internal/External Module</a> - Explicitly mark modules as <code>@internal</code> or <code>@external</code></li>
<li><a href="https://github.com/christopherthielen/typedoc-plugin-single-line-tags">Single Line Tags</a> - Process certain <code>@tags</code> as single lines</li>
</ul>
<h2 id="advanced-guides-and-docs">Advanced guides and docs</h2>
<p>Visit our homepage for advanced guides and an extensive API documentation:<br>
Expand Down
262 changes: 262 additions & 0 deletions src/test/renderer/specs/modules/_variables_.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>&quot;variables&quot; | typedoc</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">typedoc</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="_variables_.html">&quot;variables&quot;</a>
</li>
</ul>
<h1>External module &quot;variables&quot;</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Variables</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-variable tsd-parent-kind-external-module"><a href="_variables_.html#constvariable" class="tsd-kind-icon">const<wbr>Variable</a></li>
<li class="tsd-kind-variable tsd-parent-kind-external-module"><a href="_variables_.html#letvariable" class="tsd-kind-icon">let<wbr>Variable</a></li>
<li class="tsd-kind-variable tsd-parent-kind-external-module"><a href="_variables_.html#varvariable" class="tsd-kind-icon">var<wbr>Variable</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Variables</h2>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module">
<a name="constvariable" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> const<wbr>Variable</h3>
<div class="tsd-signature tsd-kind-icon">const<wbr>Variable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"const"</span><span class="tsd-signature-symbol"> =&nbsp;&quot;const&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/variables.ts#L4">variables.ts:4</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A const variable</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module">
<a name="letvariable" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagLet">Let</span> let<wbr>Variable</h3>
<div class="tsd-signature tsd-kind-icon">let<wbr>Variable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;let&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/variables.ts#L9">variables.ts:9</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A let variable</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module">
<a name="varvariable" class="tsd-anchor"></a>
<h3>var<wbr>Variable</h3>
<div class="tsd-signature tsd-kind-icon">var<wbr>Variable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> =&nbsp;&quot;var&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/variables.ts#L14">variables.ts:14</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A var variable</p>
</div>
</div>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Globals</em></a>
</li>
<li class=" tsd-kind-external-module">
<a href="_access_.html">"access"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_classes_.html">"classes"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_default_export_.html">"default-<wbr>export"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_enumerations_.html">"enumerations"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_flattened_.html">"flattened"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_functions_.html">"functions"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_generics_.html">"generics"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_modules_.html">"modules"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_single_export_.html">"single-<wbr>export"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_typescript_1_3_.html">"typescript-<wbr>1.3"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_typescript_1_4_.html">"typescript-<wbr>1.4"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="_typescript_1_5_.html">"typescript-<wbr>1.5"</a>
</li>
<li class="current tsd-kind-external-module">
<a href="_variables_.html">"variables"</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
<li class=" tsd-kind-variable tsd-parent-kind-external-module">
<a href="_variables_.html#constvariable" class="tsd-kind-icon">const<wbr>Variable</a>
</li>
<li class=" tsd-kind-variable tsd-parent-kind-external-module">
<a href="_variables_.html#letvariable" class="tsd-kind-icon">let<wbr>Variable</a>
</li>
<li class=" tsd-kind-variable tsd-parent-kind-external-module">
<a href="_variables_.html#varvariable" class="tsd-kind-icon">var<wbr>Variable</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>